(self.webpackChunkroot=self.webpackChunkroot||[]).push([[524],{0:(e,n,t)=>{"use strict";e.exports=t.p+"img/asoLogo-eb0c34a967f39c0e7e3a.jpg"},384:(e,n,t)=>{"use strict";e.exports=t.p+"img/avatarGroup-faca1e69e2c224b7eebe.png"},539:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileZIP-8e94803f540ec1fbe349.svg"},911:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IldoaXRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQwMCA0MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQwMCA0MDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojRkZGRkZGO308L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MDAsMjAwYzAsMTEwLjUtODkuNSwyMDAtMjAwLDIwMFMwLDMxMC41LDAsMjAwUzg5LjUsMCwyMDAsMFM0MDAsODkuNSw0MDAsMjAweiBNMTYzLjQsMzA1LjVjODguNywwLDEzNy4yLTczLjUsMTM3LjItMTM3LjJjMC0yLjEsMC00LjItMC4xLTYuMmM5LjQtNi44LDE3LjYtMTUuMywyNC4xLTI1Yy04LjYsMy44LTE3LjksNi40LTI3LjcsNy42YzEwLTYsMTcuNi0xNS40LDIxLjItMjYuN2MtOS4zLDUuNS0xOS42LDkuNS0zMC42LDExLjdjLTguOC05LjQtMjEuMy0xNS4yLTM1LjItMTUuMmMtMjYuNiwwLTQ4LjIsMjEuNi00OC4yLDQ4LjJjMCwzLjgsMC40LDcuNSwxLjMsMTFjLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40Yy00LjEsNy4xLTYuNSwxNS40LTYuNSwyNC4yYzAsMTYuNyw4LjUsMzEuNSwyMS41LDQwLjFjLTcuOS0wLjItMTUuMy0yLjQtMjEuOC02YzAsMC4yLDAsMC40LDAsMC42YzAsMjMuNCwxNi42LDQyLjgsMzguNyw0Ny4zYy00LDEuMS04LjMsMS43LTEyLjcsMS43Yy0zLjEsMC02LjEtMC4zLTkuMS0wLjljNi4xLDE5LjIsMjMuOSwzMy4xLDQ1LDMzLjVjLTE2LjUsMTIuOS0zNy4zLDIwLjYtNTkuOSwyMC42Yy0zLjksMC03LjctMC4yLTExLjUtMC43QzExMC44LDI5Ny41LDEzNi4yLDMwNS41LDE2My40LDMwNS41Ii8+PC9zdmc+"},1037:(e,n,t)=>{"use strict";e.exports=t.p+"svg/dnsBlank-d9b5a36b6d641e2b1cd9.svg"},1205:(e,n,t)=>{"use strict";e.exports=t.p+"img/formPositionUnranked-8efe2960cfc090ba51df.png"},1416:(e,n,t)=>{"use strict";e.exports=t.p+"img/googlePlan-b18cf281f99a8608e7a9.png"},1446:(e,n,t)=>{"use strict";e.exports=t.p+"img/googleMaps-093b110e04f11e43e677.png"},1931:(e,n,t)=>{"use strict";e.exports=t.p+"img/google-3994b2066e10d4d349a4.png"},2006:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileCSV-6ea65d2431d3a4293aad.svg"},2248:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIxMDI0cHgiIGhlaWdodD0iMTAyNHB4IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPiAgICAgICAgPHRpdGxlPkZpbGwgMTwvdGl0bGU+ICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPiAgICA8ZGVmcz48L2RlZnM+ICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPiAgICAgICAgPGcgaWQ9ImZMb2dvX1doaXRlIiBmaWxsPSIjRkZGRkZFIj4gICAgICAgICAgICA8cGF0aCBkPSJNOTY3LjQ4NCwwIEw1Ni41MTcsMCBDMjUuMzA0LDAgMCwyNS4zMDQgMCw1Ni41MTcgTDAsOTY3LjQ4MyBDMCw5OTguNjk0IDI1LjI5NywxMDI0IDU2LjUyMiwxMDI0IEw1NDcsMTAyNCBMNTQ3LDYyOCBMNDE0LDYyOCBMNDE0LDQ3MyBMNTQ3LDQ3MyBMNTQ3LDM1OS4wMjkgQzU0NywyMjYuNzY3IDYyNy43NzMsMTU0Ljc0NyA3NDUuNzU2LDE1NC43NDcgQzgwMi4yNjksMTU0Ljc0NyA4NTAuODQyLDE1OC45NTUgODY1LDE2MC44MzYgTDg2NSwyOTkgTDc4My4zODQsMjk5LjAzNyBDNzE5LjM5MSwyOTkuMDM3IDcwNywzMjkuNTI5IDcwNywzNzQuMjczIEw3MDcsNDczIEw4NjAuNDg3LDQ3MyBMODQwLjUwMSw2MjggTDcwNyw2MjggTDcwNywxMDI0IEw5NjcuNDg0LDEwMjQgQzk5OC42OTcsMTAyNCAxMDI0LDk5OC42OTcgMTAyNCw5NjcuNDg0IEwxMDI0LDU2LjUxNSBDMTAyNCwyNS4zMDMgOTk4LjY5NywwIDk2Ny40ODQsMCIgaWQ9IkZpbGwtMSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+"},2281:(e,n,t)=>{"use strict";e.exports=t.p+"img/login2x-a7058a62cb4dc68d53e5.png"},2599:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankHandGlobe-724d35d1342815318f84.svg"},2630:(e,n,t)=>{"use strict";e.exports=t.p+"svg/alert-c575e88c07bbcb08605f.svg"},2647:(e,n,t)=>{"use strict";e.exports=t.p+"img/login-ba738216a561ebc04664.png"},3574:(e,n,t)=>{"use strict";e.exports=t.p+"svg/done2-fe55d02679b93e21cc5f.svg"},3691:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMCAwIDMuNzggMS42MWg0OS42MjFjMS42OTQgMCAzLjE5LS43OTggNC4xNDYtMi4wMzd6IiBmaWxsPSIjNWM4OGM1Ii8+PHBhdGggZD0iTTIyNi43NDIgMjIyLjk4OGMtOS4yNjYgMC0xNi43NzcgNy4xNy0xNi43NzcgMTYuMDE0LjAwNyAyLjc2Mi42NjMgNS40NzQgMi4wOTMgNy44NzUuNDMuNzAzLjgzIDEuNDA4IDEuMTkgMi4xMDcuMzMzLjUwMi42NSAxLjAwNS45NSAxLjUwOC4zNDMuNDc3LjY3My45NTcuOTg4IDEuNDQgMS4zMSAxLjc2OSAyLjUgMy41MDIgMy42MzcgNS4xNjguNzkzIDEuMjc1IDEuNjgzIDIuNjQgMi40NjYgMy45OSAyLjM2MyA0LjA5NCA0LjAwNyA4LjA5MiA0LjYgMTMuOTE0di4wMTJjLjE4Mi40MTIuNTE2LjY2Ni44NzkuNjY3LjQwMy0uMDAxLjc2OC0uMzE0LjkzLS43OTkuNjAzLTUuNzU2IDIuMjM4LTkuNzI5IDQuNTg1LTEzLjc5NC43ODItMS4zNSAxLjY3My0yLjcxNSAyLjQ2NS0zLjk5IDEuMTM3LTEuNjY2IDIuMzI4LTMuNCAzLjYzOC01LjE2OS4zMTUtLjQ4Mi42NDUtLjk2Mi45ODgtMS40MzkuMy0uNTAzLjYxNy0xLjAwNi45NS0xLjUwOC4zNTktLjcuNzYtMS40MDQgMS4xOS0yLjEwNyAxLjQyNi0yLjQwMiAyLTUuMTE0IDIuMDA0LTcuODc1IDAtOC44NDQtNy41MTEtMTYuMDE0LTE2Ljc3Ni0xNi4wMTR6IiBmaWxsPSIjZGQ0YjNlIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIHJ5PSI1LjU2NCIgcng9IjUuODI4IiBjeT0iMjM5LjAwMiIgY3g9IjIyNi43NDIiIGZpbGw9IiM4MDJkMjciIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjkgMC0uMzYyLS4wMjMtLjcyMi0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhjMC0uMDAyLS4wMDMtLjAwNC0uMDA0LS4wMDUtMS41ODgtMS41MjQtMy42Mi0yLjIxNS01Ljk1NS0yLjIxNXptNC40MyA1LjY2bC4wMDMuMDA2di0uMDAzeiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjE1LjE4NCAyNTEuOTI5bC03Ljk4IDcuOTc5IDI4LjQ3NyAyOC40NzVjLjI4Ny0uNjQ5LjQ0OS0xLjM2Ni40NDktMi4xMjN2LTMxLjE2NWMtLjQ2OS42NzUtLjkzNCAxLjM0OS0xLjM4MiAyLjAwNS0uNzkyIDEuMjc1LTEuNjgyIDIuNjQtMi40NjUgMy45OS0yLjM0NyA0LjA2NS0zLjk4MiA4LjAzOC00LjU4NSAxMy43OTQtLjE2Mi40ODUtLjUyNy43OTgtLjkzLjc5OS0uMzYzLS4wMDEtLjY5Ny0uMjU1LS44NzktLjY2N3YtLjAxMmMtLjU5My01LjgyMi0yLjIzNy05LjgyLTQuNi0xMy45MTQtLjc4My0xLjM1LTEuNjczLTIuNzE1LTIuNDY2LTMuOTktMS4xMzctMS42NjYtMi4zMjctMy40LTMuNjM3LTUuMTY5bC0uMDAyLS4wMDN6IiBmaWxsPSIjYzNjM2MzIi8+PHBhdGggZD0iTTIxMi45ODMgMjQ4LjQ5NWwtMzYuOTUyIDM2Ljk1M3YuODEyYTUuMjI3IDUuMjI3IDAgMCAwIDUuMjM4IDUuMjM4aDEuMDE1bDM1LjY2Ni0zNS42NjZhMTM2LjI3NSAxMzYuMjc1IDAgMCAwLTIuNzY0LTMuOSAzNy41NzUgMzcuNTc1IDAgMCAwLS45ODktMS40NGMtLjI5OS0uNTAzLS42MTYtMS4wMDYtLjk1LTEuNTA4LS4wODMtLjE2Mi0uMTc2LS4zMjYtLjI2NC0uNDg5eiIgZmlsbD0iI2ZkZGM0ZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjExLjk5OCAyNjEuMDgzbC02LjE1MiA2LjE1MSAyNC4yNjQgMjQuMjY0aC43ODFhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzktNS4yMzh2LTEuMDQ1eiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48L2c+PC9zdmc+"},3780:(e,n,t)=>{"use strict";e.exports=t.p+"svg/check-b496988ef222b46ee39a.svg"},4025:(e,n,t)=>{"use strict";e.exports=t.p+"img/ignPlan-d4659acd351e7c1a33e4.png"},4225:e=>{"use strict";e.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI1MDRweCIgaGVpZ2h0PSI1MDRweCIgdmlld0JveD0iMCAwIDUwNCA1MDQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+ICAgICAgICA8dGl0bGU+Z2x5cGgtbG9nb19NYXkyMDE2PC90aXRsZT4gICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+ICAgIDxkZWZzPiAgICAgICAgPHBvbHlnb24gaWQ9InBhdGgtMSIgcG9pbnRzPSIwIDAuMTU5IDUwMy44NDEgMC4xNTkgNTAzLjg0MSA1MDMuOTQgMCA1MDMuOTQiPjwvcG9seWdvbj4gICAgPC9kZWZzPiAgICA8ZyBpZD0iZ2x5cGgtbG9nb19NYXkyMDE2IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4gICAgICAgIDxnIGlkPSJHcm91cC0zIj4gICAgICAgICAgICA8bWFzayBpZD0ibWFzay0yIiBmaWxsPSJ3aGl0ZSI+ICAgICAgICAgICAgICAgIDx1c2UgeGxpbms6aHJlZj0iI3BhdGgtMSI+PC91c2U+ICAgICAgICAgICAgPC9tYXNrPiAgICAgICAgICAgIDxnIGlkPSJDbGlwLTIiPjwvZz4gICAgICAgICAgICA8cGF0aCBkPSJNMjUxLjkyMSwwLjE1OSBDMTgzLjUwMywwLjE1OSAxNzQuOTI0LDAuNDQ5IDE0OC4wNTQsMS42NzUgQzEyMS4yNCwyLjg5OCAxMDIuOTI3LDcuMTU3IDg2LjkwMywxMy4zODUgQzcwLjMzNywxOS44MjIgNTYuMjg4LDI4LjQzNiA0Mi4yODIsNDIuNDQxIEMyOC4yNzcsNTYuNDQ3IDE5LjY2Myw3MC40OTYgMTMuMjI2LDg3LjA2MiBDNi45OTgsMTAzLjA4NiAyLjczOSwxMjEuMzk5IDEuNTE2LDE0OC4yMTMgQzAuMjksMTc1LjA4MyAwLDE4My42NjIgMCwyNTIuMDggQzAsMzIwLjQ5NyAwLjI5LDMyOS4wNzYgMS41MTYsMzU1Ljk0NiBDMi43MzksMzgyLjc2IDYuOTk4LDQwMS4wNzMgMTMuMjI2LDQxNy4wOTcgQzE5LjY2Myw0MzMuNjYzIDI4LjI3Nyw0NDcuNzEyIDQyLjI4Miw0NjEuNzE4IEM1Ni4yODgsNDc1LjcyMyA3MC4zMzcsNDg0LjMzNyA4Ni45MDMsNDkwLjc3NSBDMTAyLjkyNyw0OTcuMDAyIDEyMS4yNCw1MDEuMjYxIDE0OC4wNTQsNTAyLjQ4NCBDMTc0LjkyNCw1MDMuNzEgMTgzLjUwMyw1MDQgMjUxLjkyMSw1MDQgQzMyMC4zMzgsNTA0IDMyOC45MTcsNTAzLjcxIDM1NS43ODcsNTAyLjQ4NCBDMzgyLjYwMSw1MDEuMjYxIDQwMC45MTQsNDk3LjAwMiA0MTYuOTM4LDQ5MC43NzUgQzQzMy41MDQsNDg0LjMzNyA0NDcuNTUzLDQ3NS43MjMgNDYxLjU1OSw0NjEuNzE4IEM0NzUuNTY0LDQ0Ny43MTIgNDg0LjE3OCw0MzMuNjYzIDQ5MC42MTYsNDE3LjA5NyBDNDk2Ljg0Myw0MDEuMDczIDUwMS4xMDIsMzgyLjc2IDUwMi4zMjUsMzU1Ljk0NiBDNTAzLjU1MSwzMjkuMDc2IDUwMy44NDEsMzIwLjQ5NyA1MDMuODQxLDI1Mi4wOCBDNTAzLjg0MSwxODMuNjYyIDUwMy41NTEsMTc1LjA4MyA1MDIuMzI1LDE0OC4yMTMgQzUwMS4xMDIsMTIxLjM5OSA0OTYuODQzLDEwMy4wODYgNDkwLjYxNiw4Ny4wNjIgQzQ4NC4xNzgsNzAuNDk2IDQ3NS41NjQsNTYuNDQ3IDQ2MS41NTksNDIuNDQxIEM0NDcuNTUzLDI4LjQzNiA0MzMuNTA0LDE5LjgyMiA0MTYuOTM4LDEzLjM4NSBDNDAwLjkxNCw3LjE1NyAzODIuNjAxLDIuODk4IDM1NS43ODcsMS42NzUgQzMyOC45MTcsMC40NDkgMzIwLjMzOCwwLjE1OSAyNTEuOTIxLDAuMTU5IFogTTI1MS45MjEsNDUuNTUgQzMxOS4xODYsNDUuNTUgMzI3LjE1NCw0NS44MDcgMzUzLjcxOCw0Ny4wMTkgQzM3OC4yOCw0OC4xMzkgMzkxLjYxOSw1Mi4yNDMgNDAwLjQ5Niw1NS42OTMgQzQxMi4yNTUsNjAuMjYzIDQyMC42NDcsNjUuNzIyIDQyOS40NjIsNzQuNTM4IEM0MzguMjc4LDgzLjM1MyA0NDMuNzM3LDkxLjc0NSA0NDguMzA3LDEwMy41MDQgQzQ1MS43NTcsMTEyLjM4MSA0NTUuODYxLDEyNS43MiA0NTYuOTgxLDE1MC4yODIgQzQ1OC4xOTMsMTc2Ljg0NiA0NTguNDUsMTg0LjgxNCA0NTguNDUsMjUyLjA4IEM0NTguNDUsMzE5LjM0NSA0NTguMTkzLDMyNy4zMTMgNDU2Ljk4MSwzNTMuODc3IEM0NTUuODYxLDM3OC40MzkgNDUxLjc1NywzOTEuNzc4IDQ0OC4zMDcsNDAwLjY1NSBDNDQzLjczNyw0MTIuNDE0IDQzOC4yNzgsNDIwLjgwNiA0MjkuNDYyLDQyOS42MjEgQzQyMC42NDcsNDM4LjQzNyA0MTIuMjU1LDQ0My44OTYgNDAwLjQ5Niw0NDguNDY2IEMzOTEuNjE5LDQ1MS45MTYgMzc4LjI4LDQ1Ni4wMiAzNTMuNzE4LDQ1Ny4xNCBDMzI3LjE1OCw0NTguMzUyIDMxOS4xOTEsNDU4LjYwOSAyNTEuOTIxLDQ1OC42MDkgQzE4NC42NSw0NTguNjA5IDE3Ni42ODQsNDU4LjM1MiAxNTAuMTIzLDQ1Ny4xNCBDMTI1LjU2MSw0NTYuMDIgMTEyLjIyMiw0NTEuOTE2IDEwMy4zNDUsNDQ4LjQ2NiBDOTEuNTg2LDQ0My44OTYgODMuMTk0LDQzOC40MzcgNzQuMzc5LDQyOS42MjEgQzY1LjU2NCw0MjAuODA2IDYwLjEwNCw0MTIuNDE0IDU1LjUzNCw0MDAuNjU1IEM1Mi4wODQsMzkxLjc3OCA0Ny45OCwzNzguNDM5IDQ2Ljg2LDM1My44NzcgQzQ1LjY0OCwzMjcuMzEzIDQ1LjM5MSwzMTkuMzQ1IDQ1LjM5MSwyNTIuMDggQzQ1LjM5MSwxODQuODE0IDQ1LjY0OCwxNzYuODQ2IDQ2Ljg2LDE1MC4yODIgQzQ3Ljk4LDEyNS43MiA1Mi4wODQsMTEyLjM4MSA1NS41MzQsMTAzLjUwNCBDNjAuMTA0LDkxLjc0NSA2NS41NjMsODMuMzUzIDc0LjM3OSw3NC41MzggQzgzLjE5NCw2NS43MjIgOTEuNTg2LDYwLjI2MyAxMDMuMzQ1LDU1LjY5MyBDMTEyLjIyMiw1Mi4yNDMgMTI1LjU2MSw0OC4xMzkgMTUwLjEyMyw0Ny4wMTkgQzE3Ni42ODcsNDUuODA3IDE4NC42NTUsNDUuNTUgMjUxLjkyMSw0NS41NSBaIiBpZD0iRmlsbC0xIiBmaWxsPSIjRkZGRkZGIiBtYXNrPSJ1cmwoI21hc2stMikiPjwvcGF0aD4gICAgICAgIDwvZz4gICAgICAgIDxwYXRoIGQ9Ik0yNTEuOTIxLDMzNi4wNTMgQzIwNS41NDMsMzM2LjA1MyAxNjcuOTQ3LDI5OC40NTcgMTY3Ljk0NywyNTIuMDggQzE2Ny45NDcsMjA1LjcwMiAyMDUuNTQzLDE2OC4xMDYgMjUxLjkyMSwxNjguMTA2IEMyOTguMjk4LDE2OC4xMDYgMzM1Ljg5NCwyMDUuNzAyIDMzNS44OTQsMjUyLjA4IEMzMzUuODk0LDI5OC40NTcgMjk4LjI5OCwzMzYuMDUzIDI1MS45MjEsMzM2LjA1MyBaIE0yNTEuOTIxLDEyMi43MTUgQzE4MC40NzQsMTIyLjcxNSAxMjIuNTU2LDE4MC42MzMgMTIyLjU1NiwyNTIuMDggQzEyMi41NTYsMzIzLjUyNiAxODAuNDc0LDM4MS40NDQgMjUxLjkyMSwzODEuNDQ0IEMzMjMuMzY3LDM4MS40NDQgMzgxLjI4NSwzMjMuNTI2IDM4MS4yODUsMjUyLjA4IEMzODEuMjg1LDE4MC42MzMgMzIzLjM2NywxMjIuNzE1IDI1MS45MjEsMTIyLjcxNSBaIiBpZD0iRmlsbC00IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgICAgICA8cGF0aCBkPSJNNDE2LjYyNywxMTcuNjA0IEM0MTYuNjI3LDEzNC4zIDQwMy4wOTIsMTQ3LjgzNCAzODYuMzk2LDE0Ny44MzQgQzM2OS43MDEsMTQ3LjgzNCAzNTYuMTY2LDEzNC4zIDM1Ni4xNjYsMTE3LjYwNCBDMzU2LjE2NiwxMDAuOTA4IDM2OS43MDEsODcuMzczIDM4Ni4zOTYsODcuMzczIEM0MDMuMDkyLDg3LjM3MyA0MTYuNjI3LDEwMC45MDggNDE2LjYyNywxMTcuNjA0IiBpZD0iRmlsbC01IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgIDwvZz48L3N2Zz4="},4236:(e,n,t)=>{"use strict";e.exports=t.p+"img/background404-7cbee4be29173b045b3e.jpg"},4362:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankSwissArmyKnife-1600d89a247ad1dab4a9.svg"},4628:(e,n,t)=>{"use strict";e.exports=t.p+"img/formPositionRanked-376168a7e3c71ed7defd.png"},5095:(e,n,t)=>{"use strict";e.exports=t.p+"img/netflixWood-fa60c8d3bb65881cf071.jpg"},5376:(e,n,t)=>{"use strict";e.exports=t.p+"svg/sad-cbf74279d944b2baac65.svg"},5594:(e,n,t)=>{"use strict";e.exports=t.p+"img/member-7b0dc9a7cc229b5ba65b.png"},5682:()=>{},6041:(e,n,t)=>{"use strict";e.exports=t.p+"img/logoWeezeventSquare-9184b02c60dbc8695435.png"},6400:(e,n,t)=>{"use strict";e.exports=t.p+"img/weezConstruction-fb73dc7a26ba038c44b3.png"},6686:(e,n,t)=>{"use strict";var i=t(4848),s=(t(8630),t(9191));function o(e){try{return Buffer.from(e).toString("base64")}catch{try{return btoa(e)}catch{return""}}}function a(e){try{return Buffer.from(e,"base64").toString()}catch{try{return atob(e)}catch{return""}}}var r,d=t(2347);!function(e){e.Development="development",e.Production="production",e.Test="test"}(r||(r={}));var l=t(6618),c=t(4854);class u{html;text;constructor(e,n=e){this.html=e,this.text=n}toString(){return this.text}}function m(e,n){return e instanceof u?"HTML"===n?e.html:e.text:"HTML"===n?(0,c.A)(String(e)):String(e)}const g=(e,n=null,t={})=>(Object.entries(e).forEach(([e,i])=>{const s=n?`${n}.${e}`:e;"object"!=typeof i||null===i||Array.isArray(i)||i instanceof u?t[s]=i:g(i,s,t)}),t);function h(e){return function(e){if(Array.isArray(e))return!0;if("object"!=typeof e||null===e)return!1;{const n=Object.getPrototypeOf(e);return n===Object.prototype||null===n}}(e)&&!Object.isFrozen(e)&&(Object.freeze(e),Object.values(e).forEach(h)),e}const p=h([]);function I(e){return null==e?[]:Array.isArray(e)?e:[e]}function f(e){return Array.isArray(e)&&e.length>0}function x(e,n){return(0,l.A)(e,n)}function _(e){return!f(e)}function j(e,n,t){const i=new Set(e);return t?i.add(n):i.delete(n),Array.from(i)}function v(e,n){const t=new Set(e);return t.has(n)?t.delete(n):t.add(n),Array.from(t)}function S(e,n,t){const i=[...e],[s]=i.splice(n,1);return void 0!==s&&i.splice(t,0,s),i}function y(e,n){return e.filter((e,t)=>t!==n)}function C(e){return(0,d.A)(e.normalize("NFD").replace(/\p{Diacritic}/gu,""))}function b(e){return(0,d.A)((e||"").trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu,""))}var A;function E(e,n={}){const t=n.replacer??A.Dash,i=C(e).trim().toLowerCase().replace(/['"]+/gi,"");let s;return s=t===A.Dash?i.replace(/[^a-z0-9\\-]+/gu,"-").replace(/-+$/,"").replace(/^-+/,""):t===A.Underscore?i.replace(/[^a-z0-9_]+/gu,"_").replace(/_+$/,"").replace(/^_+/,""):i.replace(/[^a-z0-9]+/gu,"").trim(),n?.replaceStartingNumber?s.replace(/^(\d)/,"_$1"):s}function w(e){return Array.isArray(e)&&"production"!==r.Production&&console.warn("Array passed to `isNonEmptyString()`, did you mean to use `isNonEmptyArray()` instead?"),"string"==typeof e&&e.trim().length>0}function $(e){return!w(e)}!function(e){e[e.Dash=0]="Dash",e[e.Empty=1]="Empty",e[e.Underscore=2]="Underscore"}(A||(A={}));const T={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:'"'},z=["hm","hrh","him","hih","hh","hsh","hgdh","kg","lg","kt","lt","sm","sar","sai","sas","sagd"],O=e=>w(e)?e.charAt(0).toUpperCase()+e.slice(1):"";function R(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>z.includes(e.toLowerCase())?e.toUpperCase():O(e.trim())).join(" ").split("-").map(e=>z.includes(e.toLowerCase())?e.toUpperCase():O(e.trim())).join("-")}const D=/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/i;function M(e,n){const t=(e,n,t,i,s)=>et?t+1:e+1:i===s?n:n+1;if(e===n)return 0;if(e.length>n.length){const t=e;e=n,n=t}let i=e.length,s=n.length;for(;i>0&&e.charCodeAt(i-1)===n.charCodeAt(s-1);)i--,s--;let o=0;for(;o{if("object"==typeof N&&void 0!==N[e])return N[e];if(void 0!==F?.[e])return F[e];throw new Error(`Missing env. var. ${e}`)},U=e=>"object"==typeof N&&void 0!==N[e]?N[e]:void 0!==F?.[e]?F[e]:void 0,V=e=>{const n=L(e);return"boolean"==typeof n?n:"true"===n},B=L("HEAVENT_APPLICATION_DOMAIN"),W=U("HEAVENT_RESOURCES_DOMAIN")??B,G=U("HEAVENT_ASSETS_DOMAIN")??W,q=U("HEAVENT_APP_SUBDOMAIN")??"admin",H=U("HEAVENT_API_SUBDOMAIN")??"api",Y=U("HEAVENT_PUBLIC_SUBDOMAIN")??"widget",Z=U("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",K=U("HEAVENT_ASSETS_SUBDOMAIN")??"assets",X=U("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",Q=U("HEAVENT_APPLICATION_BASENAME")??"crew",J=U("HEAVENT_RESOURCES_BASENAME")??"",ee={ADMINS:L("HEAVENT_ADMINS"),EMAIL_FROM:L("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:L("HEAVENT_EMAIL_FROM_NAME"),EMAIL_PICTURE_LINK:L("HEAVENT_EMAIL_PICTURE_LINK"),HEAVENT_APPLICATION_DOMAIN:B,HEAVENT_RESOURCES_DOMAIN:W,HEAVENT_ASSETS_DOMAIN:G,HEAVENT_APPLICATION_BASENAME:Q,HEAVENT_APP_URL:new P(U("HEAVENT_APP_DOMAIN")??B,void 0,q,U("HEAVENT_APP_BASENAME")??Q),HEAVENT_API_URL:new P(U("HEAVENT_API_DOMAIN")??B,void 0,H,U("HEAVENT_API_BASENAME")??Q),HEAVENT_PUBLIC_URL:new P(U("HEAVENT_PUBLIC_DOMAIN")??B,void 0,Y,U("HEAVENT_PUBLIC_BASENAME")??Q),HEAVENT_ASSETS_URL:new P(G,void 0,K,U("HEAVENT_ASSETS_BASENAME")??J),HEAVENT_INVOICES_URL:new P(U("HEAVENT_INVOICES_DOMAIN")??W,void 0,Z,U("HEAVENT_INVOICES_BASENAME")??J),HEAVENT_UPLOADS_URL:new P(U("HEAVENT_UPLOADS_DOMAIN")??W,void 0,X,U("HEAVENT_UPLOADS_BASENAME")??J),USE_INTERCOM:V("HEAVENT_USE_INTERCOM"),FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID:U("HEAVENT_FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID"),HIGHLIGHT_CUSTOM_COLOURS:(()=>{const e=U("HEAVENT_HIGHLIGHT_CUSTOM_COLOURS");return void 0!==e?"boolean"==typeof e?e:"true"===e:void 0})(),COGNITO_USER_POOL_ID:L("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:L("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:L("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:L("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:V("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:V("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:L("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:L("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:L("HEAVENT_WEEZEVENT_DOMAIN")},ne="x-heavent-client",te="x-heavent-commit-sha",ie="x-heavent-request-uuid",se="x-heavent-signature",oe="x-heavent-expires",ae="x-heavent-signed-scope",re="x-user-token";var de=t(6540),le=t(754);function ce(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}const ue="heavent-user-session-key",me="heavent-user-email",ge="UserNotFoundException";let he=null;const pe=()=>(null===he&&(he=new le.NE({UserPoolId:ee.COGNITO_USER_POOL_ID,ClientId:ee.COGNITO_USER_POOL_CLIENT_ID})),he);function Ie(){return new Promise((e,n)=>{const t=pe().getCurrentUser();null!==t?t.getSession((i,s)=>{i||!1===s?.isValid()?n(new Error("Could not get current user")):e({user:t,token:s.getIdToken().getJwtToken()})}):n(new Error("Could not get current user"))})}async function fe(){try{const e=localStorage.getItem("heavent-test-token");return w(e)?e:(await Ie()).token}catch{return}}function xe(e,n){const t=e.trim().toLowerCase();return new Promise((e,i)=>{const s=[new le.HB({Name:"email",Value:t})];pe().signUp(t,n,s,[],(n,t)=>{n?i(n):e(t.user)})})}function _e(){Ie().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function je(e,n,t){return new Promise((i,s)=>{const o=new le.TU({Username:e,Pool:pe()}),a=new le.By({Username:e}),r={onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){e.code===ge?s(ge):t(e)},customChallenge(){localStorage.setItem(me,e),localStorage.setItem(ue,o.Session),i({user:o,callbacks:r})}};o.setAuthenticationFlowType("CUSTOM_AUTH"),o.initiateAuth(a,r)})}function ve(e,n){return new Promise((t,i)=>{new le.TU({Username:e,Pool:pe()}).authenticateUser(new le.By({Username:e,Password:n}),{onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function Se(e){return new Promise((n,t)=>{new le.TU({Username:e,Pool:pe()}).forgotPassword({onSuccess(){n(!0)},async onFailure(i){if(i.code===ge)try{await xe(e,ce().toString()),await Se(e),n(!0)}catch(e){t(e)}else t(i)}})})}function ye(e,n,t){return new Promise((i,s)=>{new le.TU({Username:e,Pool:pe()}).confirmPassword(n,t,{async onSuccess(){i(await ve(e,t))},onFailure(e){s(e)}})})}var Ce,be,Ae,Ee,we,$e,Te,ze,Oe,Re,De,Me,Pe,ke,Fe,Ne,Le,Ue,Ve,Be,We,Ge,qe,He,Ye,Ze,Ke,Xe,Qe,Je,en,nn,tn,sn,on,an,rn,dn,ln,cn,un,mn,gn,hn,pn,In,fn,xn,_n,jn,vn,Sn,yn,Cn,bn,An,En,wn,$n,Tn,zn,On,Rn,Dn,Mn,Pn,kn,Fn,Nn,Ln,Un,Vn,Bn,Wn,Gn,qn,Hn,Yn,Zn,Kn,Xn,Qn,Jn,et,nt,tt,it,st,ot,at,rt,dt,lt,ct,ut,mt,gt,ht,pt,It,ft,xt,_t,jt,vt,St,yt,Ct,bt,At,Et,wt,$t,Tt,zt,Ot,Rt,Dt,Mt,Pt,kt,Ft,Nt,Lt,Ut,Vt=t(5338),Bt=t(6955);!function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(Ce||(Ce={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(be||(be={})),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"}(Ae||(Ae={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(Ee||(Ee={})),function(e){e.Done="Done",e.Waiting="Waiting"}(we||(we={})),function(e){e.Acronym="Acronym",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Name="Name"}($e||($e={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Te||(Te={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(ze||(ze={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(Oe||(Oe={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(Re||(Re={})),function(e){e.Car="Car",e.Moto="Moto"}(De||(De={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(Me||(Me={})),function(e){e.EventStart="EventStart",e.EventEnd="EventEnd"}(Pe||(Pe={})),function(e){e.Before="Before",e.After="After"}(ke||(ke={})),function(e){e.NoSchedule="NoSchedule",e.Datetime="Datetime",e.Anchor="Anchor"}(Fe||(Fe={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(Ne||(Ne={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(Le||(Le={})),function(e){e.Email="Email",e.Sms="Sms"}(Ue||(Ue={})),function(e){e.C10012713_1K="C10012713_1K",e.C10012713_2K="C10012713_2K",e.C10012713_3K="C10012713_3K",e.C10012713_4K="C10012713_4K",e.C10012713_5K="C10012713_5K",e.C10012713_6K="C10012713_6K",e.C10012713_7K="C10012713_7K",e.C10012713_1="C10012713_1",e.C10012713_2="C10012713_2",e.C10012713_3="C10012713_3",e.C10012713_4="C10012713_4",e.C10012713_5="C10012713_5",e.C10012713_6="C10012713_6",e.C10012713_7="C10012713_7",e.C10012717_1K="C10012717_1K",e.C10012717_2K="C10012717_2K",e.C10012717_3K="C10012717_3K",e.C10012717_4K="C10012717_4K",e.C10012717_5K="C10012717_5K",e.C10012717_6K="C10012717_6K",e.C10012717_7K="C10012717_7K",e.C10012717_1="C10012717_1",e.C10012717_2="C10012717_2",e.C10012717_3="C10012717_3",e.C10012717_4="C10012717_4",e.C10012717_5="C10012717_5",e.C10012717_6="C10012717_6",e.C10012717_7="C10012717_7",e.C10006995K="C10006995K",e.C10006995_1K="C10006995_1K",e.C10006995_2K="C10006995_2K",e.C10006995_3K="C10006995_3K",e.C10006995_4K="C10006995_4K",e.C10006995_5K="C10006995_5K",e.C10006995_6K="C10006995_6K",e.C10006995_7K="C10006995_7K",e.C10006995="C10006995",e.C10006995_1="C10006995_1",e.C10006995_2="C10006995_2",e.C10006995_3="C10006995_3",e.C10006995_4="C10006995_4",e.C10006995_5="C10006995_5",e.C10006995_6="C10006995_6",e.C10006995_7="C10006995_7",e.C10010951K="C10010951K",e.C10010951_1K="C10010951_1K",e.C10010951_2K="C10010951_2K",e.C10010951_3K="C10010951_3K",e.C10010951_4K="C10010951_4K",e.C10010951_5K="C10010951_5K",e.C10010951_6K="C10010951_6K",e.C10010951_7K="C10010951_7K",e.C10010951="C10010951",e.C10010951_1="C10010951_1",e.C10010951_2="C10010951_2",e.C10010951_3="C10010951_3",e.C10010951_4="C10010951_4",e.C10010951_5="C10010951_5",e.C10010951_6="C10010951_6",e.C10010951_7="C10010951_7",e.C10006999="C10006999",e.C10006999_1="C10006999_1",e.C10006999_2="C10006999_2",e.C10006999_3="C10006999_3",e.C10006999_4="C10006999_4",e.C10006999_5="C10006999_5",e.C10006999_6="C10006999_6",e.C10006999_7="C10006999_7",e.C10006999K="C10006999K",e.C10006999_1K="C10006999_1K",e.C10006999_2K="C10006999_2K",e.C10006999_3K="C10006999_3K",e.C10006999_4K="C10006999_4K",e.C10006999_5K="C10006999_5K",e.C10006999_6K="C10006999_6K",e.C10006999_7K="C10006999_7K",e.C10015355K="C10015355K",e.C10015355_1K="C10015355_1K",e.C10015355_2K="C10015355_2K",e.C10015355_3K="C10015355_3K",e.C10015355_4K="C10015355_4K",e.C10015355_5K="C10015355_5K",e.C10015355_6K="C10015355_6K",e.C10015355_7K="C10015355_7K",e.C10015355="C10015355",e.C10015355_1="C10015355_1",e.C10015355_2="C10015355_2",e.C10015355_3="C10015355_3",e.C10015355_4="C10015355_4",e.C10015355_5="C10015355_5",e.C10015355_6="C10015355_6",e.C10015355_7="C10015355_7"}(Ve||(Ve={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(Be||(Be={})),function(e){e.BreakTime="BreakTime",e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(We||(We={})),function(e){e.And="And",e.Or="Or"}(Ge||(Ge={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Playground="Playground",e.T24assignment="T24assignment"}(qe||(qe={})),function(e){e.All="All",e.Public="Public",e.Private="Private"}(He||(He={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(Ye||(Ye={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}(Ze||(Ze={})),(Ut=Ke||(Ke={})).Accreditation="Accreditation",Ut.Delegation="Delegation",Ut.Event="Event",Ut.Position="Position",Ut.UserInfo="UserInfo",function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersDuplicateMembers="CanLeadersDuplicateMembers",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.DelegationsSpaceLayout="DelegationsSpaceLayout",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.Parent="Parent",e.ShowAllAccreditations="ShowAllAccreditations",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(Xe||(Xe={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Qe||(Qe={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Je||(Je={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.MaxResources="MaxResources",e.Name="Name"}(en||(en={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(nn||(nn={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(tn||(tn={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(sn||(sn={})),function(e){e.Name="Name"}(on||(on={})),function(e){e.AsoPaxManifest="AsoPaxManifest",e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.DelegationCalendar="DelegationCalendar",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"}(an||(an={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(rn||(rn={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(dn||(dn={})),function(e){e.Accreditations="Accreditations",e.AccreditationsImport="AccreditationsImport",e.AccreditationsProfilesImport="AccreditationsProfilesImport",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"}(ln||(ln={})),function(e){e.Description="Description",e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}(cn||(cn={})),function(e){e.Done="Done",e.Waiting="Waiting"}(un||(un={})),function(e){e.CreatedAt="CreatedAt",e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(mn||(mn={})),(Lt=gn||(gn={})).Archived="Archived",Lt.Done="Done",Lt.Ongoing="Ongoing",Lt.Upcoming="Upcoming",function(e){e.Excel="Excel",e.Csv="CSV"}(hn||(hn={})),function(e){e.Done="Done",e.Waiting="Waiting"}(pn||(pn={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Beta="Beta",e.Community="Community",e.Criblage="Criblage",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"}(In||(In={})),function(e){e.BirthCity="birthCity",e.BirthCountry="birthCountry",e.BirthPostalCode="birthPostalCode",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"}(fn||(fn={})),function(e){e.Freeform="Freeform",e.Iban="Iban",e.Avs="Avs",e.Eid="Eid"}(xn||(xn={})),(Nt=_n||(_n={})).Address="Address",Nt.Checkbox="Checkbox",Nt.Country="Country",Nt.Date="Date",Nt.Datetime="Datetime",Nt.File="File",Nt.Language="Language",Nt.Nationality="Nationality",Nt.Number="Number",Nt.Phone="Phone",Nt.Select="Select",Nt.Sex="Sex",Nt.Text="Text",Nt.Textarea="Textarea",Nt.Time="Time",Nt.Validation="Validation",function(e){e.Done="Done",e.Waiting="Waiting"}(jn||(jn={})),function(e){e.Default="Default",e.Picture="Picture"}(vn||(vn={})),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"}(Sn||(Sn={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(yn||(yn={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(Cn||(Cn={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(bn||(bn={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(An||(An={})),function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BedBunk="BedBunk",e.Bicycle="Bicycle",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Computer="Computer",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.Motorcycle="Motorcycle",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.Phone="Phone",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice",e.WalkieTalkie="WalkieTalkie"}(En||(En={})),function(e){e.Create="Create",e.Upsert="Upsert",e.Update="Update"}(wn||(wn={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting",e.WrittenOff="WrittenOff"}($n||($n={})),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"}(Tn||(Tn={})),function(e){e.Default="Default",e.Dot="Dot",e.Badge="Badge"}(zn||(zn={})),function(e){e.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}(On||(On={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(Rn||(Rn={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(Dn||(Dn={})),function(e){e.Add="Add",e.Replace="Replace",e.Reset="Reset"}(Mn||(Mn={})),function(e){e.Categories="Categories",e.Positions="Positions"}(Pn||(Pn={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(kn||(kn={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt",e.WeezeventOrganizationId="WeezeventOrganizationId"}(Fn||(Fn={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(Nn||(Nn={})),function(e){e.List="List",e.Radio="Radio"}(Ln||(Ln={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Layer="Layer",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces",e.WeezeventIsSynchronized="WeezeventIsSynchronized",e.Zoom="Zoom"}(Un||(Un={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(Vn||(Vn={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Bn||(Bn={})),function(e){e.EndDate="EndDate",e.EndTime="EndTime",e.Resources="Resources",e.StartDate="StartDate",e.StartTime="StartTime"}(Wn||(Wn={})),function(e){e.Add="Add",e.Replace="Replace",e.Subtract="Subtract"}(Gn||(Gn={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(qn||(qn={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(Hn||(Hn={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(Yn||(Yn={})),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.IsInLast="isInLast",e.IsInNext="isInNext",e.IsMoreThanAgo="isMoreThanAgo",e.IsMoreThanAhead="isMoreThanAhead",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"}(Zn||(Zn={})),function(e){e.And="and",e.Or="or"}(Kn||(Kn={})),function(e){e.EventNotLinked="EventNotLinked",e.GroupsUnreachable="GroupsUnreachable",e.GroupNotFound="GroupNotFound",e.Unexpected="Unexpected"}(Xn||(Xn={})),function(e){e.Paper="Paper",e.Ticket="Ticket",e.Wristband="Wristband"}(Qn||(Qn={})),function(e){e.OrganizationNotLinked="OrganizationNotLinked",e.PartnersUnreachable="PartnersUnreachable",e.PartnerNotFound="PartnerNotFound",e.EventNotLinked="EventNotLinked",e.GroupsUnreachable="GroupsUnreachable",e.GroupNotFound="GroupNotFound",e.DocumentNotFound="DocumentNotFound"}(Jn||(Jn={})),function(e){e.ActivationRange="ActivationRange",e.CreatedAt="CreatedAt",e.Document="Document",e.Id="Id",e.MediaType="MediaType",e.PrinterGroup="PrinterGroup",e.Status="Status",e.WeezaccessPartner="WeezaccessPartner"}(et||(et={})),(Ft=nt||(nt={})).Active="Active",Ft.Past="Past",Ft.Upcoming="Upcoming",function(e){e.Accreditation="Accreditation",e.None="None"}(tt||(tt={})),function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(it||(it={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(st||(st={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(ot||(ot={})),(kt=at||(at={})).Calendar="Calendar",kt.Custom="Custom",kt.Display="Display",kt.DisplayDays="DisplayDays",kt.Hide="Hide",function(e){e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position"}(rt||(rt={})),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"}(dt||(dt={})),function(e){e.Accreditations="Accreditations",e.AccreditationsProfiles="AccreditationsProfiles",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers",e.Workflows="Workflows"}(lt||(lt={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(ct||(ct={})),function(e){e.Asc="Asc",e.Desc="Desc"}(ut||(ut={})),function(e){e.DelegationSpace="DelegationSpace",e.EventsShowcase="EventsShowcase",e.MembersSpace="MembersSpace"}(mt||(mt={})),(Pt=gt||(gt={})).De="De",Pt.En="En",Pt.Es="Es",Pt.Fr="Fr",Pt.Keys="Keys",Pt.Nl="Nl",function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(ht||(ht={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(pt||(pt={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(It||(It={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(ft||(ft={})),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"}(xt||(xt={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(_t||(_t={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(jt||(jt={})),function(e){e.Admin="Admin",e.Leader="Leader"}(vt||(vt={})),function(e){e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LastSeenAt="LastSeenAt",e.LocalId="LocalId",e.Name="Name",e.UpdatedAt="UpdatedAt"}(St||(St={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}(yt||(yt={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Ct||(Ct={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.Email="Email",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.OrganizationLocalId="OrganizationLocalId",e.PairedAt="PairedAt",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}(bt||(bt={})),function(e){e.OrganizationNotLinked="OrganizationNotLinked",e.PartnersUnreachable="PartnersUnreachable",e.PartnerNotFound="PartnerNotFound",e.Unexpected="Unexpected"}(At||(At={})),function(e){e.AddAccreditations="AddAccreditations",e.AddDelegationPermissions="AddDelegationPermissions",e.AddEvent="AddEvent",e.AddPositions="AddPositions",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.DeleteDelegationPermissions="DeleteDelegationPermissions",e.DeletePositions="DeletePositions",e.DuplicateMember="DuplicateMember",e.LockDelegation="LockDelegation",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField",e.UnlockDelegation="UnlockDelegation"}(Et||(Et={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(wt||(wt={})),function(e){e.Revert="Revert",e.Keep="Keep"}($t||($t={})),function(e){e.Frequency="Frequency",e.Name="Name",e.State="State"}(Tt||(Tt={})),function(e){e.Admins="Admins",e.DelegationsCategoriesLeaders="DelegationsCategoriesLeaders",e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(zt||(zt={})),function(e){e.CreatedAt="CreatedAt",e.ExecutedAt="ExecutedAt",e.Id="Id",e.Name="Name",e.VolunteersSegment="VolunteersSegment"}(Ot||(Ot={})),function(e){e.Active="Active",e.Error="Error",e.Paused="Paused"}(Rt||(Rt={})),(Mt=Dt||(Dt={})).Assigned="Assigned",Mt.DelegationsSegment="DelegationsSegment",Mt.FormSubmit="FormSubmit",Mt.VolunteersSegment="VolunteersSegment",Object.keys(Ce);const Wt=Object.keys(be),Gt=Object.keys(Ae),qt=(Object.keys(Ee),Object.keys(we),Object.keys($e)),Ht=(Object.keys(Te),Object.keys(ze),Object.keys(Oe),Object.keys(Re)),Yt=Object.keys(De),Zt=(Object.keys(Me),Object.keys(Pe)),Kt=Object.keys(ke),Xt=(Object.keys(Fe),Object.keys(Ne),Object.keys(Le)),Qt=Object.keys(Ue),Jt=(Object.keys(Ve),Object.keys(Be)),ei=(Object.keys(We),Object.keys(Ge),Object.keys(qe)),ni=(Object.keys(He),Object.keys(Ye)),ti=(Object.keys(Ze),Object.keys(Ke)),ii=Object.keys(Xe),si=(Object.keys(Qe),Object.keys(Je),Object.keys(en),Object.keys(nn)),oi=(Object.keys(tn),Object.keys(sn)),ai=(Object.keys(on),Object.keys(an),Object.keys(rn)),ri=(Object.keys(dn),Object.keys(ln)),di=(Object.keys(cn),Object.keys(un),Object.keys(mn),Object.keys(gn)),li=(Object.keys(hn),Object.keys(pn),Object.keys(In)),ci=(Object.keys(fn),Object.keys(xn)),ui=Object.keys(_n),mi=(Object.keys(jn),Object.keys(vn)),gi=(Object.keys(Sn),Object.keys(yn),Object.keys(Cn)),hi=(Object.keys(bn),Object.keys(An)),pi=Object.keys(En),Ii=Object.keys(wn),fi=Object.keys($n),xi=Object.keys(Tn),_i=Object.keys(zn),ji=(Object.keys(On),Object.keys(Rn)),vi=Object.keys(Dn),Si=Object.keys(Mn),yi=Object.keys(Pn),Ci=(Object.keys(kn),Object.keys(Fn),Object.keys(Nn),Object.keys(Ln)),bi=Object.keys(Un),Ai=(Object.keys(Vn),Object.keys(Bn),Object.keys(Wn)),Ei=Object.keys(Gn),wi=(Object.keys(qn),Object.keys(Hn),Object.keys(Yn)),$i=(Object.keys(Zn),Object.keys(Kn),Object.keys(Xn),Object.keys(Qn),Object.keys(Jn),Object.keys(et),Object.keys(nt),Object.keys(tt)),Ti=Object.keys(it),zi=Object.keys(st),Oi=Object.keys(ot),Ri=Object.keys(at),Di=Object.keys(rt),Mi=(Object.keys(dt),Object.keys(lt),Object.keys(ct)),Pi=Object.keys(ut),ki=(Object.keys(mt),Object.keys(gt),Object.keys(ht),Object.keys(pt)),Fi=Object.keys(It),Ni=(Object.keys(ft),Object.keys(xt)),Li=Object.keys(_t),Ui=(Object.keys(jt),Object.keys(vt),Object.keys(St),Object.keys(yt)),Vi=(Object.keys(Ct),Object.keys(bt)),Bi=(Object.keys(At),Object.keys(Et)),Wi=Object.keys(wt),Gi=Object.keys($t),qi=Object.keys(Tt),Hi=Object.keys(zt),Yi=(Object.keys(Ot),Object.keys(Rt)),Zi=Object.keys(Dt),Ki=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","startAt","termsAcceptedAt","lastSeenAt","registrationDate","pairedAt","executedAt"],Xi=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],Qi=["range","ranges","activationRange"],Ji=["assignedDuration","duration"];var es,ns;let ts=class{language;translations;constructor(e,n){this.language=e,this.translations=n}translate(e,...n){if("production"!==r.Test||process.env.JEST_WORKER_ID){let t=this.translations[e]||e;const i=this.translations[`${e}_plural`];return i&&"number"==typeof n[0]&&n[0]>1&&(t=i),Array.isArray(n)&&n.length>0&&(t=n.reduce((e,n,t)=>e.replaceAll(`{${t+1}}`,n),t)),t}return`${e} - ${JSON.stringify(n)}`}*interpolateWithComponents(e,...n){let t=0;for(const[s,o]of e.split(/{\d+}/).entries())t>0&&(yield(0,i.jsx)(de.Fragment,{children:n[s-1]},t)),t++,yield o}formatListValues(e,n="disjunction"){return new Intl.ListFormat(this.language.toLowerCase(),{style:"long",type:n}).format(e)}};ts=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(es=void 0!==gt&>)?es:Object,"function"==typeof(ns="undefined"!=typeof Record&&Record)?ns:Object])],ts);const is=(0,de.createContext)({});function ss(e){return(0,de.useContext)(is).container.get(e)}function os(){const e=(0,de.useContext)(is).container.get(ts);return e.translate.bind(e)}function as(){const e=(0,de.useContext)(is).container.get(ts);return e.interpolateWithComponents.bind(e)}function rs(e,n,t=[],i){const s="production"!==r.Test?e:e.loc.source.body;return(0,de.useContext)(is).useQuery(s,n,t,i)}function ds(e,n={}){return(0,de.useContext)(is).useMutation(e,n)}function ls(){return(0,de.useContext)(is).useParams()}function cs(){return(0,de.useContext)(is).useHistory()}function us(){return(0,de.useContext)(is).useLocation()}function ms(){return(0,de.useContext)(is).useLocalStorage()}const gs=e=>{const n=ls(),t=cs();return(0,de.useEffect)(()=>{w(e.path)&&(e.replace?t.replace(e.path,e.state):t.push(e.path,e.state)),e.push&&t.push(e.push(n),e.state),e.onLoad&&e.onLoad()},[]),(0,i.jsx)("div",{})},hs=(0,de.createContext)({user:null});function ps(){return(0,de.useContext)(hs)}const Is=e=>{const n=ls(),{user:t}=ps();return t&&e.shouldHaveUser||!t&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(gs,{path:e.getRedirectPath(n),replace:!0})};function fs(...e){console.log(...e)}const xs=e=>e.join("/"),_s=ee.HEAVENT_APPLICATION_BASENAME,js={FIELDS:{PLURAL:"fields",SINGLE:"field"}},vs={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},Ss={ACCREDITATIONS:"accreditations",INFORMATION:"information",DASHBOARD:"dashboard",HISTORY:"history",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},ys=e=>xs([e,vs.AUTH]),Cs=e=>xs([e,vs.CREATE]),bs=e=>xs([e,vs.EDIT]),As={PLURAL:"/organizations",SINGLE:"/organization"},Es="delegations",ws={_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"}},$s="blocked",Ts="expired",zs={ORGANIZATIONS:As.PLURAL,ORGANIZATION:e=>xs([As.SINGLE,e])},Os={ORGANIZATIONS:zs.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>zs.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>xs([Os.ORGANIZATION(e),ws._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE:e=>xs([Os.ORGANIZATION_SETTINGS(e),ws.EVENTS_SHOWCASE._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN:e=>xs([Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),ws.COMMON.DESIGN]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION:e=>xs([Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),ws.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS:e=>xs([Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),ws.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>xs([Os.ORGANIZATION_SETTINGS(e),ws.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>xs([Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),ws.COMMON.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>xs([Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),ws.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>xs([Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),ws.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>xs([Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),ws.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>xs([Os.ORGANIZATION_SETTINGS(e),ws.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>xs([Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),ws.COMMON.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>xs([Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),ws.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>xs([Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),ws.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>xs([Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),ws.COMMON.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>xs([Os.ORGANIZATION(e),Es]),IS_BLOCKED:e=>xs([e,$s]),IS_EXPIRED:e=>xs([e,Ts]),ORGANIZATION_FORM:e=>Ks.FORM(e)},Rs="dashboard",Ds="users",Ms={COMMUNITY:e=>xs([Os.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>xs([Ms.COMMUNITY(e),Rs]),COMMUNITY_USERS:e=>xs([Ms.COMMUNITY(e),Ds])},Ps={PLURAL:"forms",SINGLE:"form"},ks="elements",Fs="emails",Ns="integration",Ls="parameters",Us="preview",Vs="general",Bs="design",Ws="availabilities",Gs="missions",qs="accreditations",Hs="broadcast",Ys="state",Zs={FORMS:Ps.PLURAL,FORM:e=>xs([Ps.SINGLE,e])},Ks={FORMS:({eventId:e,...n})=>xs([e?eo.EVENT({...n,eventId:e}):Ms.COMMUNITY(n),Zs.FORMS]),FORM:({formId:e,...n})=>xs(["eventId"in n&&n.eventId?eo.EVENT(n):Ms.COMMUNITY(n),Zs.FORM(e)]),CREATE:e=>Cs(Ks.FORMS(e)),FORM_ELEMENTS:e=>xs([Ks.FORM(e),ks]),FORM_INTEGRATION:e=>xs([Ks.FORM(e),Ns]),FORM_EMAILS:e=>xs([Ks.FORM(e),Fs]),FORM_PREVIEW:e=>xs([Ks.FORM(e),Us]),FORM_PARAMETERS:e=>xs([Ks.FORM(e),Ls]),FORM_PARAMETERS_GENERAL:e=>xs([Ks.FORM_PARAMETERS(e),Vs]),FORM_PARAMETERS_DESIGN:e=>xs([Ks.FORM_PARAMETERS(e),Bs]),FORM_PARAMETERS_AVAILABILITIES:e=>xs([Ks.FORM_PARAMETERS(e),Ws]),FORM_PARAMETERS_MISSIONS:e=>xs([Ks.FORM_PARAMETERS(e),Gs]),FORM_PARAMETERS_ACCREDITATIONS:e=>xs([Ks.FORM_PARAMETERS(e),qs]),FORM_PARAMETERS_BROADCAST:e=>xs([Ks.FORM_PARAMETERS(e),Hs]),FORM_PARAMETERS_STATE:e=>xs([Ks.FORM_PARAMETERS(e),Ys])},Xs={PLURAL:"events",SINGLE:"event"},Qs={PLURAL:"teams",SINGLE:"team"},Js={EVENTS:Xs.PLURAL,EVENT:e=>xs([Xs.SINGLE,e]),TEAM:e=>xs([Qs.SINGLE,e])},eo={EVENTS_IMPORT:e=>xs([Os.ORGANIZATION(e),Js.EVENTS,vs.IMPORT]),EVENTS:e=>xs([Os.ORGANIZATION(e),Js.EVENTS]),EVENT:({eventId:e,...n})=>xs([Os.ORGANIZATION(n),Js.EVENT(e)]),EVENT_FORM:e=>xs([Ks.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...n})=>xs([eo.EVENT_FORM(n),Js.TEAM(e)])},no={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},to={PLURAL:"accreditations",SINGLE:"accreditation"},io={PLURAL:"slots",SINGLE:"slot"},so="dashboard",oo="member",ao="members",ro={ACCREDITATION_CATEGORIES:no.PLURAL,ACCREDITATION_CATEGORY:e=>xs([no.SINGLE,e]),ACCREDITATIONS:to.PLURAL,ACCREDITATION:e=>xs([to.SINGLE,e]),ACCREDITATION_SLOTS:io.PLURAL,ACCREDITATION_SLOT:e=>xs([io.SINGLE,e])},lo={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...n})=>xs([eo.EVENT(n),ro.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>xs([lo.ACCREDITATION_CATEGORY(e),so]),ACCREDITATION_CATEGORY_MEMBERS:e=>xs([lo.ACCREDITATION_CATEGORY(e),ao])},co={ACCREDITATIONS_IMPORT:e=>xs([eo.EVENT(e),ro.ACCREDITATIONS,vs.IMPORT]),ACCREDITATIONS:e=>xs([eo.EVENT(e),ro.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...n})=>xs([eo.EVENT(n),ro.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>xs([co.ACCREDITATION(e),so]),ACCREDITATION_MEMBERS:e=>xs([co.ACCREDITATION(e),ao]),ACCREDITATION_MEMBER:({userInfoId:e,...n})=>xs([co.ACCREDITATION_MEMBERS(n),oo,e]),ACCREDITATION_MEMBER_INFORMATION:e=>xs([co.ACCREDITATION_MEMBER(e),Ss.INFORMATION])},uo={ACCREDITATION_SLOT:({accreditationSlotId:e,...n})=>xs([mo.ACCREDITATION(n),ro.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>xs([uo.ACCREDITATION_SLOT(e),so]),ACCREDITATION_SLOT_MEMBERS:e=>xs([uo.ACCREDITATION_SLOT(e),ao])},mo={...lo,...co,...uo},go={PLURAL:"delegations-categories",SINGLE:"delegation-category"},ho={PLURAL:"delegations",SINGLE:"delegation"},po="accreditations",Io="availabilities",fo="positions",xo={DELEGATIONS_CATEGORIES:go.PLURAL,DELEGATION_CATEGORY:e=>xs([go.SINGLE,e]),DELEGATIONS:ho.PLURAL,DELEGATION:e=>xs([ho.SINGLE,e])},_o={DELEGATION_CATEGORY:({delegationCategoryId:e,...n})=>xs(["eventId"in n&&n.eventId?eo.EVENT(n):Ms.COMMUNITY(n),xo.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>xs([_o.DELEGATION_CATEGORY(e),Ss.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>xs([_o.DELEGATION_CATEGORY(e),Ss.MEMBERS]),DELEGATION_CATEGORY_UPDATE:e=>bs(_o.DELEGATION_CATEGORY(e))},jo={DELEGATIONS:e=>xs(["eventId"in e&&e.eventId?eo.EVENT(e):Ms.COMMUNITY(e),xo.DELEGATIONS]),DELEGATION:({delegationId:e,...n})=>xs(["eventId"in n&&n.eventId?eo.EVENT(n):Ms.COMMUNITY(n),xo.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>xs([jo.DELEGATION(e),Ss.DASHBOARD]),DELEGATION_MEMBERS:e=>xs([jo.DELEGATION(e),Ss.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>xs([jo.DELEGATION(e),po]),DELEGATION_REPORTING:e=>xs([jo.DELEGATION(e),Ss.REPORTING]),DELEGATION_DOCUMENTS:e=>xs([jo.DELEGATION(e),Ss.DOCUMENTS]),DELEGATION_TAB:e=>xs([jo.DELEGATION(e),e.slug]),DELEGATION_MEMBERS_IMPORT:e=>xs([jo.DELEGATION(e),vs.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,slug:n,...t})=>xs([w(n)?jo.DELEGATION_TAB({...t,slug:n}):jo.DELEGATION_MEMBERS(t),Ss.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>xs([jo.DELEGATION_MEMBER(e),Ss.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>xs([jo.DELEGATION_MEMBER(e),po]),DELEGATION_MEMBER_AVAILABILITIES:e=>xs([jo.DELEGATION_MEMBER(e),Io]),DELEGATION_MEMBER_POSITIONS:e=>xs([jo.DELEGATION_MEMBER(e),fo]),MEMBERS_INVITE:e=>xs([jo.DELEGATION(e),Ss.MEMBERS,vs.INVITE]),MEMBER_CREATE:({formId:e,...n})=>Cs(xs([jo.DELEGATION(n),Ss.MEMBER,Ss.FORM,e])),MEMBER_EDIT:({formId:e,...n})=>bs(xs([jo.DELEGATION_MEMBER(n),Ss.FORM,e])),DELEGATION_PROFILE:e=>xs([jo.DELEGATION(e),Ss.PROFILE]),FIELDS_EDIT:e=>bs(xs([jo.DELEGATION(e),js.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...n})=>xs([Ks.FORM(n),xo.DELEGATION(e)])},vo={..._o,...jo},So={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${vs.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members",PLANNING:"planning"}},yo={POSITION_CATEGORIES:So.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>xs([So.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:So.ITEMS.POSITIONS.PLURAL,POSITION:e=>xs([So.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:So.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>xs([So.ITEMS.POSITION_SLOTS.SINGLE,e])},Co={POSITION_CATEGORY:({positionCategoryId:e,...n})=>xs([eo.EVENT(n),yo.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>xs([Co.POSITION_CATEGORY(e),Ss.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>xs([Co.POSITION_CATEGORY(e),Ss.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>xs([Co.POSITION_CATEGORY(e),So.SECTIONS.PREASSIGNED_MEMBERS])},bo={POSITIONS:e=>xs([eo.EVENT(e),yo.POSITIONS]),POSITION:({positionId:e,positionCategoryId:n,...t})=>xs(n?[Co.POSITION_CATEGORY({positionCategoryId:n,...t}),yo.POSITION(e)]:[eo.EVENT(t),yo.POSITION(e)]),POSITION_DASHBOARD:e=>xs([bo.POSITION(e),Ss.DASHBOARD]),POSITION_MEMBERS:e=>xs([bo.POSITION(e),Ss.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>xs([bo.POSITION(e),So.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_PLANNING:e=>xs([bo.POSITION(e),So.SECTIONS.PLANNING]),POSITION_MEMBER:({userInfoId:e,...n})=>xs([bo.POSITION_MEMBERS(n),Ss.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>xs([bo.POSITION_MEMBER(e),Ss.INFORMATION]),POSITION_IMPORT_CSV:e=>xs([eo.EVENT(e),So.ACTIONS.IMPORT.CSV])},Ao={POSITION_SLOTS:e=>xs([bo.POSITION(e),yo.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...n})=>xs([bo.POSITION(n),yo.POSITION_SLOT(e)])},Eo={...Co,...bo,...Ao},wo="/auth",$o=`${wo}/sign-in`,To=`${wo}/sign-up`,zo="/backoffice",Oo=e=>`${Os.ORGANIZATION({organizationId:e})}/parameters`,Ro=(e,n,t,i)=>`${Eo.POSITION_SLOT({organizationId:e,eventId:n,positionId:t,positionSlotId:i})}/check-members`,Do=(e,n,t,i)=>`${Eo.POSITION_SLOT({organizationId:e,eventId:n,positionId:t,positionSlotId:i})}/members`,Mo=(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/volunteers`,Po=(e,n)=>`${Mo(e,n)}/search`,ko=(e,n,t)=>`${Po(e,n)}/volunteer/${t}`,Fo=(e,n,t)=>`${Mo(e,n)}/${t}`,No=(e,n,t,i)=>`${Fo(e,n,t)}/volunteer/${i}`,Lo=(e,n,t,i)=>`${Fo(e,n,t)}/volunteer-panel/${i}`,Uo=(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/emails`,Vo=(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/options`,Bo=(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/dashboard`,Wo={HOME:`/${_s}`,UNSUBSCRIBE_EMAIL:"/unsubscribe-email",USER_UPDATE_BY_TICKET_ID:(e,n)=>`/organization/${e}/update-by-ticket-id/field/${n}`,USER_FIELD_UPDATE:(e,n,t,i)=>`/organization/${e}/user/${n}/field/${t}/update/${i}`,USER_EVENT_UNREGISTER:(e,n,t)=>`/organization/${e}/user/${n}/event/${t}/unregister`,USER_ACCREDITATIONS_UNREGISTER:(e,n,t)=>`/organization/${e}/user/${n}/event/${t}/accreditations-unregister`,USER_CHECK_IN:(e,n)=>`/organization/${e}/user/${n}/check-in`,USER_CHECK_OUT:(e,n)=>`/organization/${e}/user/${n}/check-out`,AUTH:wo,AUTH_FORGOT_PASSWORD:`${wo}/forgot-password`,AUTH_SIGN_IN:$o,AUTH_SIGN_UP:To,AUTH_SIGN_IN_EMAIL:`${$o}/email`,AUTH_SIGN_IN_CODE:`${$o}/code`,AUTH_SIGN_UP_CREDENTIALS:`${To}/credentials`,AUTH_SIGN_UP_CODE:`${To}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,n)=>`/magic-link/${e}/${n}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${Os.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:zo,BACKOFFICE_ORGANIZATIONS:`${zo}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${zo}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${zo}/invoices`,ORGANIZATION_PARAMETERS:Oo,ORGANIZATION_PARAMETERS_PROFILE:e=>`${Oo(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${Oo(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${Oo(e)}/team`,ORGANIZATION_PARAMETERS_GROUPS:e=>`${Oo(e)}/groups`,CREATE_ORGANIZATION_PARAMETERS_GROUP:e=>`${Oo(e)}/groups/create`,EDIT_ORGANIZATION_PARAMETERS_GROUP:(e,n)=>`${Oo(e)}/groups/group/${n}/edit`,ORGANIZATION_PARAMETERS_ROLES:e=>`${Oo(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${Oo(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,n)=>`${Oo(e)}/roles/role/${n}/edit`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${Oo(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${Oo(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,n)=>`${Oo(e)}/emails/senders/${n}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${Oo(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,n)=>`${Oo(e)}/emails/senders/${n}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${Oo(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${Oo(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${Oo(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${Oo(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${Oo(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${Oo(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${Oo(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${Oo(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${Oo(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES:e=>`${Oo(e)}/categories/accreditation-profiles`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${Oo(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${Oo(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${Oo(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${Oo(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${Oo(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${Oo(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${Oo(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${Oo(e)}/delete-account`,COMMUNITY_USERS_SEGMENT:(e,n)=>`${Os.ORGANIZATION({organizationId:e})}/community/users/${n}`,COMMUNITY_USERS_USER:(e,n,t)=>`${Os.ORGANIZATION({organizationId:e})}/community/users/${n}/user/${t}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,n,t)=>`${Os.ORGANIZATION({organizationId:e})}/community/users/${n}/user/${t}/${Ss.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${Os.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,n)=>`${Os.ORGANIZATION({organizationId:e})}/community/user/${n}/edit`,COMMUNITY_EDIT_USER_FORM:(e,n,t)=>`${Os.ORGANIZATION({organizationId:e})}/community/user/${n}/edit/form/${t}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${Os.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${Os.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${Os.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,n)=>`${Os.ORGANIZATION({organizationId:e})}/community/delegations/${n}`,COMMUNITY_DELEGATION:(e,n)=>`${Os.ORGANIZATION({organizationId:e})}/community/delegation/${n}`,COMMUNITY_CREATE_DELEGATION(e,n){let t=`${Os.ORGANIZATION({organizationId:e})}/community/create-delegation`;return n&&(t=`${t}/${n}`),t},COMMUNITY_EDIT_DELEGATION:(e,n)=>`${Os.ORGANIZATION({organizationId:e})}/community/delegation/${n}/edit`,CREATE_EVENT_WITH_ORGANIZATION(e){let n="/create-event";return e&&(n=`${n}/${e}`),n},CREATE_EVENT:e=>`${Os.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,n)=>`${Os.ORGANIZATION({organizationId:e})}/events/${n}`,EVENT_DELEGATIONS_IMPORT:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/members-import`,EVENT_FILES_IMPORT:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/documents-import`,EDIT_EVENT:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/edit`,DASHBOARD:Bo,DASHBOARD_EVENT_SWITCH:(e,n)=>`${Bo(e,n)}/event-switch`,MOBILE_MORE:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/more`,POSITION_MEMBERS_USER:(e,n,t,i,s)=>`${Eo.POSITION_MEMBERS({organizationId:e,eventId:n,positionCategoryId:t,positionId:i})}/${s}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,n,t,i,s)=>`${Eo.POSITION_MEMBERS({organizationId:e,eventId:n,positionCategoryId:t,positionId:i})}/${s}/${Ss.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,n)=>`/export/event/${e}/positions/${n}/map`,POSITIONS_SEARCH:(e,n)=>`${Eo.POSITIONS({organizationId:e,eventId:n})}/search`,POSITIONS_SEGMENT:(e,n,t)=>`${Eo.POSITIONS({organizationId:e,eventId:n})}/${t}`,CREATE_POSITION(e,n,t){let i=`${eo.EVENT({organizationId:e,eventId:n})}/create-position`;return t&&(i=`${i}/${t}`),i},POSITION_MAP:(e,n)=>`/position/${e}-${n}/map`,POSITION_SETTINGS:(e,n,t)=>`${Eo.POSITION({organizationId:e,eventId:n,positionId:t})}/settings`,EDIT_POSITION:(e,n,t)=>`${Eo.POSITION({organizationId:e,eventId:n,positionId:t})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,n,t,i)=>`${Eo.POSITION_SLOT({organizationId:e,eventId:n,positionId:t,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_MEMBERS:Do,POSITION_SLOT_MEMBERS_USER:(e,n,t,i,s)=>`${Do(e,n,t,i)}/${s}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,n,t,i,s)=>`${Do(e,n,t,i)}/${s}/${Ss.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,n,t,i)=>`${Do(e,n,t,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,n,t,i)=>`${Ro(e,n,t,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,n,t,i)=>`${Ro(e,n,t,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,n,t,i)=>`${Ro(e,n,t,i)}/reset`,VOLUNTEERS:Mo,VOLUNTEERS_SEARCH:Po,VOLUNTEERS_SEARCH_USER:ko,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,n,t)=>`${ko(e,n,t)}/${Ss.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,n,t)=>`${Mo(e,n)}/${t}`,VOLUNTEERS_LIST_USER:No,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,n,t,i)=>`${No(e,n,t,i)}/${Ss.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:Lo,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,n,t,i)=>`${Lo(e,n,t,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,n,t,i)=>`${Lo(e,n,t,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,n,t,i)=>`${Lo(e,n,t,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,n,t,i,s)=>`${Lo(e,n,t,i)}/team/${s}`,EDIT_USER:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit`,EDIT_USER_FORM:(e,n,t,i)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,n,t,i)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,n,t,i)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,n,t,i)=>`${eo.EVENT({organizationId:e,eventId:n})}/user/${t}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/assignments`,ASSIGNMENT:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/assignment/${t}`,EDIT_ASSIGNMENT:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/edit-assignment/${t}`,TEAM_ASSIGNMENT:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/team-assignment/${t}`,PRE_ASSIGNMENT:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/pre-assignment/${t}`,ACCREDITATIONS_ASSIGNMENTS:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/accreditations-assignments`,ACCREDIT:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/accredit/${t}`,EDIT_ACCREDIT:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/edit-accredit/${t}`,EVENT_EMAILS:Uo,EVENT_EMAILS_PARAMETERS:(e,n)=>`${Uo(e,n)}/parameters`,EVENT_AUTOMATIC_EMAILS:(e,n)=>`${eo.EVENT({organizationId:e,eventId:n})}/automatic-emails`,EVENT_AUTOMATIC_EMAIL:(e,n,t)=>`${eo.EVENT({organizationId:e,eventId:n})}/automatic-emails/${t}`,OPTIONS:Vo,OPTIONS_API:(e,n)=>`${Vo(e,n)}/api`,OPTIONS_WEEZEVENT:(e,n)=>`${Vo(e,n)}/weezevent`,ACCREDITATIONS_SEGMENT:(e,n,t)=>`${mo.ACCREDITATIONS({organizationId:e,eventId:n})}/${t}`,CREATE_ACCREDITATION(e,n,t){let i=`${eo.EVENT({organizationId:e,eventId:n})}/create-accreditation`;return t&&(i=`${i}/${t}`),i},EDIT_ACCREDITATION:(e,n,t)=>`${mo.ACCREDITATION({organizationId:e,eventId:n,accreditationId:t})}/edit`,ACCREDITATION_MAP:(e,n)=>`/accreditation/${e}-${n}/map`,DELEGATIONS_SEGMENT:(e,n,t)=>`${vo.DELEGATIONS({organizationId:e,eventId:n})}/${t}`,CREATE_DELEGATION(e,n,t){let i=`${eo.EVENT({organizationId:e,eventId:n})}/create-delegation`;return t&&(i=`${i}/${t}`),i},EDIT_DELEGATION:(e,n,t)=>`${vo.DELEGATION({organizationId:e,eventId:n,delegationId:t})}/edit`},Go=(e,n)=>`/volunteers/${e}-${n}`,qo=(e,n)=>`${Go(e,n)}/assignments`,Ho=(e,n)=>`${Go(e,n)}/register`,Yo=qo;var Zo=t(1343);const Ko={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 id\n name\n }\n\n accreditation {\n id\n eventId\n name\n acronym\n description\n icon\n color\n address\n latitude\n longitude\n fields\n }\n\n accreditationSlot {\n id\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:[]},AccreditationProfileFragment:{code:"fragment AccreditationProfile on AccreditationsProfile {\n id\n accreditationProfileCategoryId\n name\n description\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileEmailFragment:{code:"fragment AccreditationProfileEmail on AccreditationsProfile {\n id\n name\n\n accreditationProfileCategory {\n name\n }\n}\n",fragments:[]},AccreditationProfileImportFragment:{code:"fragment AccreditationProfileImport on AccreditationsProfile {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileMatrixFragment:{code:"fragment AccreditationProfileMatrix on AccreditationsProfile {\n id\n name\n color\n assignedResources\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationProfileVolunteerRegistrationFragment:{code:"fragment AccreditationProfileVolunteerRegistration on AccreditationsProfile {\n id\n name\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n id\n name\n date\n assignedResources\n maxResources\n isBlocked\n\n accreditation {\n id\n accreditationCategoryName\n accreditationDisplay\n acronym\n color\n index\n name\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationSlotStatsFragment:{code:"fragment AccreditationSlotStats on AccreditationsSlot {\n assignedResources\n maxResources\n scannedResources\n wishedResources\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 fields\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n id\n accreditationCategoryId\n index\n name\n description @include(if: $includeDescription)\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 hasDateSlots\n insertedAt\n numberOfSlots\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields @include(if: $includeConditions) {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\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:[]},AccreditationsAccreditationSlotFragment:{code:"fragment AccreditationsAccreditationSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n name\n date\n assignedResources\n fillingRate\n insertedAt\n isHidden\n maxResources\n resourcesByFields(slugs: $customFieldsSlugs) @include(if: $includeResources)\n scannedResources @include(if: $includeResources)\n weezeventChecklistId\n wishedResources @include(if: $includeResources)\n\n accreditation {\n ...AccreditationsAccreditation\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationFragment"]},AccreditationsProfilesProfileFragment:{code:"fragment AccreditationsProfilesProfile on AccreditationsProfile {\n id\n name\n description @include(if: $includeDescription)\n acronym\n color\n icon\n insertedAt\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n accreditationProfileCategory {\n id\n name\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n eventId\n name\n date\n assignedResources\n maxResources\n isBlocked\n isFull\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:[]},AssignmentEmailFragment:{code:"fragment AssignmentEmail 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 timeDifferenceMinutes\n }\n}\n",fragments:["LeaderAssignmentFragment"]},AttachCustomFieldFragment:{code:"fragment AttachCustomField on CustomField {\n ...CustomFieldWithCondition\n eventId\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 delegationsIds\n usersInfosIds\n segmentsIds\n scheduledAt\n emailSenderId\n attachments\n includeDuplicateMembersAttachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n scheduleType\n scheduleAnchor\n scheduleOffsetDays\n scheduleBeforeAfter\n scheduleSendTime\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 includeDuplicateMembersAttachments\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 fileType\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n conditionsCustomFields: customFields(\n eventId: $eventId\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:[]},CreateAccreditationProfileEventFragment:{code:"fragment CreateAccreditationProfileEvent on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n color\n icon\n hasSlots\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n }\n}\n",fragments:[]},CreateCampaignEmailSenderFragment:{code:"fragment CreateCampaignEmailSender on EmailsSender {\n id\n name\n isValidToSendEmail\n buttonColor\n}\n",fragments:[]},CreateCustomFieldInfosFragment:{code:"fragment CreateCustomFieldInfos on Organization {\n # the fields a condition can depend on, of every variety: the form keeps those of its own\n customFields(\n eventId: $eventId\n privacy: All\n fieldTypes: [Checkbox, Country, Language, Nationality, Select]\n ) {\n nodes {\n id\n organizationId\n eventId\n variety\n name\n label\n fieldProperty\n fieldType\n listType\n\n values {\n id\n value\n color\n }\n }\n }\n\n # the fields an Address field can fill, of every variety: the form keeps those of its own\n addressLinksCustomFields: customFields(\n eventId: $eventId\n privacy: All\n fieldTypes: [Text, Country]\n ) {\n nodes {\n id\n organizationId\n eventId\n name\n label\n variety\n fieldType\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n campaigns(states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n\n forms {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n color\n icon\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 isWeezeventConnected\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(isValidToSendEmail: true) {\n id\n name\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n groups {\n nodes {\n id\n name\n }\n }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n id\n name\n isEditableInMemberSpace\n description\n positionTitle\n positionSubtitle\n accreditationTitle\n accreditationSubtitle\n informationTitle\n registerButtonText\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n elements {\n ...FormElementDisplay\n }\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormSlotsOptionsFragment","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 segmentsIds(usedInCustomDocument: true)\n\n userInfo {\n id\n localId\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 accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n\n accreditationsUsersInfos {\n ...AccreditationEmail\n }\n\n positionsSlotsUsersInfos {\n ...AssignmentEmail\n }\n}\n",fragments:["UserInfoLinksFragment","AccreditationProfileEmailFragment","DelegationEmailFragment","AccreditationEmailFragment","AssignmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n id\n slug\n name\n populationsIds\n shouldRegenerateTicketIdOnDownload\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 id\n value\n }\n}\n",fragments:["CreatedByFragment"]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n id\n name\n label\n slug\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n id\n name\n label\n description\n fieldType\n fieldSubtype\n listType\n fileType\n fieldProperty\n isPrivate\n hasCondition\n conditionValue\n canSelectMultiple\n slug\n isSelectV2\n canBeUpdatedByUrl\n validationRules\n\n conditionCustomField {\n id\n name\n fieldType\n fieldProperty\n canSelectMultiple\n slug\n }\n\n addressPostalCodeCustomField {\n id\n slug\n }\n\n addressCityCustomField {\n id\n slug\n }\n\n addressCountryCustomField {\n id\n slug\n }\n\n document {\n url\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},DelegationAccreditationProfileFragment:{code:"fragment DelegationAccreditationProfile on DelegationAccreditationProfile {\n accreditationProfileId\n assignedResources\n isFull\n maxResources\n}\n",fragments:[]},DelegationAccreditationProfileStatsFragment:{code:"fragment DelegationAccreditationProfileStats on DelegationAccreditationProfile {\n accreditationProfileId\n assignedResources\n maxResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n isFull\n isVisible\n assignedResources\n maxResources\n willAutoAccredit\n\n accreditationSlot {\n date\n isBlocked\n isFull\n }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationSlotId\n accreditationId\n assignedResources\n maxResources\n resourcesByFields\n scannedResources\n wishedResources\n}\n",fragments:[]},DelegationEmailFragment:{code:'fragment DelegationEmail on Delegation {\n id\n organizationId\n eventId\n formId\n name\n fields\n\n category: delegationCategory {\n id\n name\n }\n\n leaders {\n email\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\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 description @include(if: $includeDescription)\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 canLeadersDuplicateMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n showFormLinkInDelegationSpace\n showAllAccreditations\n lockedAt\n usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n insertedAt\n\n accreditationsSlots @include(if: $includeAccreditations) {\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n accreditationsProfiles @include(if: $includeAccreditationsProfiles) {\n ...DelegationAccreditationProfileStats\n\n accreditationProfile {\n ...AccreditationProfileVolunteerRegistration\n }\n }\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 parent @include(if: $includeParent) {\n id\n name\n }\n\n customDocuments @include(if: $includeDocuments) {\n slug\n name\n }\n\n delegationCategory {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n email\n name\n nameOrEmail\n }\n }\n }\n\n delegationsSpaceLayout @include(if: $includeLayout) {\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 allAccreditationsSlots @include(if: $includeAccreditationsSlots) {\n ...DelegationAccreditationSlotStats\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment","DelegationAccreditationProfileStatsFragment","AccreditationProfileVolunteerRegistrationFragment","DelegationAccreditationSlotStatsFragment"]},DelegationsSpaceLayoutTabFragment:{code:"fragment DelegationsSpaceLayoutTab on DelegationsSpaceLayoutsTab {\n id\n name\n description\n slug\n isVisible\n isPinned\n segmentType\n rendering\n infos\n}\n",fragments:[]},DesignColorsFragment:{code:"fragment DesignColors on Design {\n colors {\n grayCustom50\n grayCustom500\n grayCustom700\n grayCustom800\n grayCustom900\n primaryCustom500\n primaryCustom600\n }\n}\n",fragments:[]},DocumentAsoPaxManifestFragment:{code:"fragment DocumentAsoPaxManifest on Query {\n event(id: $eventId) {\n name\n\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n maxResources\n\n accreditation {\n id\n name\n }\n\n links {\n asoPaxManifestLink\n }\n\n volunteersRegistrations {\n id\n\n userInfo {\n id\n fields(expand: true)\n }\n }\n }\n }\n}\n",fragments:[]},DocumentDelegationCalendarFragment:{code:"fragment DocumentDelegationCalendar on Event {\n startAt\n endAt\n\n document(documentType: DelegationCalendar) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n delegation(id: $delegationId) {\n ...DelegationEmail\n\n allAccreditationsSlots(onlyVisible: $onlyVisible) {\n assignedResources\n\n accreditationSlot {\n id\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n }\n\n links {\n delegationCalendarLink\n }\n }\n}\n",fragments:["DelegationEmailFragment"]},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 startAt\n endAt\n dayStartTime\n\n document(documentType: PositionPlanning) {\n id\n options\n }\n\n position(id: $positionId) {\n name\n range\n color\n\n links {\n positionPlanningLink\n }\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n\n userInfo {\n name\n\n phone {\n internationalFormat\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n',fragments:[]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 links {\n positionSheetLink\n }\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(eventId: $eventId, 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 # For the {user.profile} and {user.delegation.*} of the texts.\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n\n preassignPositions {\n name\n }\n\n preassignPositionsCategories {\n name\n }\n\n positionsSlotsUsersInfos {\n ...AssignmentEmail\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","UserInfoDocumentFragment","AccreditationProfileEmailFragment","DelegationEmailFragment","AssignmentEmailFragment"]},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"]},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 # For the {user.profile} and {user.delegation.*} of the texts.\n accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n\n userInfo {\n ...UserInfoDocument\n }\n\n positionsSlotsUsersInfos {\n ...PsuiUserPlanning\n }\n }\n}\n",fragments:["AccreditationProfileEmailFragment","DelegationEmailFragment","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(eventId: $eventId, 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(eventId: $eventId, 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(positionId: $positionId) {\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"]},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 buttonColor\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:[]},EventCreateUpdateMemberFragment:{code:"fragment EventCreateUpdateMember on Event {\n id\n name\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n fields\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n}\n",fragments:["FormRegisterAccreditationCategoryFragment","FormRegisterAccreditationProfileCategoryFragment","FormRegisterCategoryFragment"]},EventEmailRendererFragment:{code:"fragment EventEmailRenderer on Event {\n id\n organizationId\n name\n languages\n timeZone\n startAt\n endAt\n fields\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 description @include(if: $includeDescription)\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 weezticketEventId\n weezaccessEventId\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 slug\n eventId\n name\n label\n fieldType\n listType\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 color\n }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n formCustomFields: customFields(\n eventId: $eventId\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 accreditationCategoryId\n name\n description\n color\n icon\n hiddenSlotId\n hasSlots\n accreditationDisplay\n conditionsOperator\n index\n\n slots(includeHidden: true) {\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"]},FormRegisterAccreditationProfileFragment:{code:"fragment FormRegisterAccreditationProfile on AccreditationsProfile{\n id\n name\n description\n color\n icon\n}\n",fragments:[]},FormRegisterAccreditationProfileCategoryFragment:{code:"fragment FormRegisterAccreditationProfileCategory on AccreditationsProfilesCategory {\n id\n name\n\n accreditationsProfiles {\n ...FormRegisterAccreditationProfile\n }\n}\n",fragments:["FormRegisterAccreditationProfileFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n id\n accreditationId\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 positionCategoryId\n name\n description\n acronym\n isVisible\n conditionsOperator\n positionDisplay\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 positionId\n name\n range\n nameOrRange\n isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n slotDisplay\n minNumberOfSlots\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"]},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 accreditationProfileId\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 positionCategory {\n name\n }\n }\n\n positions {\n id\n name\n range\n\n category {\n name\n }\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:[]},HistoryRowFragment:{code:"fragment HistoryRow on History {\n id\n action\n executedBy\n data\n details\n insertedAt\n\n user {\n id\n name\n email\n picture {\n url\n }\n }\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 fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\n}\n",fragments:[]},MemberRegistrationUserInfoFragment:{code:"fragment MemberRegistrationUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n fields\n}\n",fragments:["UserInfoContactInformationFragment"]},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(eventId: $eventId, 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 ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:["DesignColorsFragment"]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n id\n name\n dateFormat\n datetimeFormat\n timeFormat\n timeZone\n customBadges\n}\n",fragments:[]},OrganizationEventsShowcaseFragment:{code:"fragment OrganizationEventsShowcase on OrganizationPublic {\n eventsShowcaseDesign: spaceDesign(spaceType: EventsShowcase) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:["DesignColorsFragment"]},OrganizationMemberFragment:{code:"fragment OrganizationMember on VolunteersRegistration {\n id\n ticketId\n exportedCustomDocumentsSlugs @include(if: $includeCustomDocuments)\n\n delegation {\n name\n }\n\n event {\n id\n name\n }\n\n positionsSlotsUsersInfos{\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n\n picture {\n url\n }\n }\n}\n",fragments:[]},OrganizationMemberCustomDocumentFragment:{code:"fragment OrganizationMemberCustomDocument on CustomDocument {\n id\n eventId\n slug\n name\n populationsIds\n shouldRegenerateTicketIdOnDownload\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n name\n\n membersSpaceDesign: spaceDesign(spaceType: MembersSpace) {\n ...DesignColors\n\n logo {\n url\n }\n\n banner {\n url\n }\n }\n\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n membersSpaceExcludeAccreditations\n showMembersSpaceCommunity\n}\n",fragments:["DesignColorsFragment"]},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 acronym\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 description @include(if: $includeDescription)\n range\n resources\n assignedResources\n address\n layer\n zoom\n latitude\n longitude\n acronym\n color\n icon\n isVisible\n state\n fillingRate\n numberOfSlots\n fields\n weezeventIsSynchronized\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n checkedOutRate @include(if: $includeCheckedOutRate)\n volunteerMinutesAssigned @include(if: $includeVolunteerMinutes)\n volunteerMinutesNeeded @include(if: $includeVolunteerMinutes)\n\n category {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n name\n email\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 name\n email\n nameOrEmail\n }\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n\n traces @include(if: $includePositionTraces) {\n id\n name\n color\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 weezeventChecklistId\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n checkedOutRate @include(if: $includeCheckedOutRate)\n volunteerMinutesAssigned @include(if: $includeVolunteerMinutes)\n volunteerMinutesNeeded @include(if: $includeVolunteerMinutes)\n\n position {\n ...PositionsPosition\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:["PositionsPositionFragment"]},PrintTriggerFormEventFragment:{code:"fragment PrintTriggerFormEvent on Event {\n printerGroups {\n __typename\n\n ... on PrinterGroupList {\n nodes {\n id\n name\n }\n }\n\n ... on PrinterGroupError {\n message\n }\n }\n\n zplDocuments {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},PrintTriggerFormOrganizationFragment:{code:"fragment PrintTriggerFormOrganization on Organization {\n weezaccessPartners {\n __typename\n\n ... on WeezaccessPartnerList {\n nodes {\n id\n name\n }\n }\n\n ... on WeezaccessPartnerError {\n message\n }\n }\n}\n",fragments:[]},PrintTriggersPrintTriggerFragment:{code:"fragment PrintTriggersPrintTrigger on PrintTrigger {\n id\n insertedAt\n activationRange\n status\n\n createdBy {\n email\n name\n }\n\n weezaccessPartner {\n __typename\n ... on WeezaccessPartner {\n id\n name\n url\n }\n ... on WeezaccessPartnerError {\n message\n }\n }\n\n printerGroup {\n __typename\n ... on PrinterGroup {\n id\n name\n }\n ... on PrinterGroupError {\n message\n }\n }\n\n document {\n __typename\n ... on CustomDocument {\n name\n }\n ... on EventsDocument {\n documentType\n }\n ... on ZplDocument {\n name\n }\n }\n}\n",fragments:[]},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 fieldSubtype\n listType\n fileType\n fieldProperty\n canSelectMultiple\n isSelectV2\n isEncrypted\n validationRules\n\n category {\n id\n name\n }\n\n values {\n id\n value\n color\n }\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 predicatesGroups\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 ...DesignColors\n}\n",fragments:["DesignColorsFragment"]},TraceFragment:{code:"fragment Trace on Trace {\n id\n name\n color\n points\n direction\n startAt\n firstRunnerPace\n lastRunnerPace\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 group {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersEvents(eventId: $eventId) {\n id\n\n group {\n id\n name\n }\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 group {\n id\n name\n }\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 group {\n id\n name\n }\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 group {\n id\n name\n }\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 localId\n name\n email\n nameOrEmail\n fields\n lastSeenAt\n insertedAt\n phone: fieldValue(slug: "phone")\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n picture {\n url\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n events @include(if: $includeEvents) {\n id\n name\n }\n\n duplicatedFrom @include(if: $includeDuplicatedFrom) {\n id\n email\n name\n\n picture {\n url\n }\n }\n\n delegations(level: Organization) @include(if: $includeDelegations) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n emails(emailTypes: [Campaign], level: Organization) @include(if: $includeEmails) {\n id\n state\n\n campaign {\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 localId\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 localId\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 localId\n email\n nameOrEmail\n fields\n registrationDate(eventId: $eventId)\n canAccess(formId: $formId)\n}\n",fragments:[]},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 groups {\n id\n name\n }\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"]},UserInfoUpdateMemberFragment:{code:"fragment UserInfoUpdateMember on UsersInfo {\n id\n email\n name\n fields\n userId\n\n picture {\n url\n }\n\n formUserInfo(formId: $formId) {\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationProfileId\n accreditationsSlotsIds\n\n slots {\n startDate\n startTime\n endDate\n endTime\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 form {\n ...CreateUpdateMemberForm\n }\n }\n\n volunteerRegistration(eventId: $eventId) {\n accreditationsUsersInfos {\n accreditationSlotId\n checkInAt\n }\n }\n}\n",fragments:["CreateUpdateMemberFormFragment"]},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 isWorkflow\n organizationId\n positionCategoryId\n positionSlotId\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:[]},VolunteerPdfFragment:{code:"fragment VolunteerPdf on VolunteersRegistration {\n delegation {\n name\n }\n\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 ticketIdVersion\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 pairedAt\n volunteerMinutes @include(if: $includeVolunteerMinutes)\n weezeventPayUrl @include(if: $includeWeezeventUrls)\n weezeventTicketUrl @include(if: $includeWeezeventUrls)\n delegationBannerNumber @include(if: $includeDelegation)\n exportedCustomDocumentsSlugs @include(if: $includeCustomDocuments)\n accreditationProfileId\n wishedAccreditationProfileId @include(if: $includeAccreditationsMatrix)\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 localId\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(\n emailTypes: [Campaign]\n level: Event\n eventId: $eventId\n delegationId: $delegationId\n ) @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 accreditationProfile @include(if: $includeAccreditationProfile) {\n ...AccreditationProfileVolunteerRegistration\n }\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 accreditationProfile @include(if: $includeAccreditationProfile) {\n ...AccreditationProfileVolunteerRegistration\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 accreditationProfileId\n checkInAt\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","AccreditationProfileVolunteerRegistrationFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationProfileFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationProfile on VolunteersRegistration {\n id\n accreditationProfileId\n wishedAccreditationProfileId\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},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 accreditationProfile {\n ...AccreditationProfileEmail\n }\n\n delegation {\n ...DelegationEmail\n }\n}\n",fragments:["AccreditationProfileEmailFragment","DelegationEmailFragment"]},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 localId\n state\n accreditationState\n ticketId\n weezevent\n\n accreditationProfile {\n name\n\n accreditationProfileCategory {\n name\n }\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n accreditationCategoryId\n\n accreditationCategory {\n id\n name\n }\n\n accreditation {\n id\n name\n fields\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n\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 localId\n ...UserInfoContactInformation\n fieldsExpanded: fields(expand: true)\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n form {\n slotDisplay\n }\n\n positionsCategories {\n name\n }\n\n positions {\n name\n }\n\n positionsSlots {\n name\n range\n\n position {\n name\n }\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 frequency\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 positionsSlots @include(if: $includePositions) {\n id\n name\n range\n\n position {\n acronym\n color\n icon\n name\n }\n }\n\n segment {\n id\n name\n segmentType\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 Xo(e){return e.flatMap(e=>[e.code].concat(Xo(e.fragments.map(e=>Ko[e]))))}function Qo(e){return(0,Zo.A)(Xo(e)).join(" ")}var Jo=t(8097);const ea="yyyy-MM-dd",na="yyyy-MM-dd'T'HH:mm",ta="yyyy-MM-dd'T'HH:mm:ss";function ia(e){const[n,t]=JSON.parse(e);return Jo.IX.fromDateTimes(Jo.c9.fromISO(n,{zone:"UTC"}),Jo.c9.fromISO(t,{zone:"UTC"}))}function sa({startDate:e,startTime:n,endDate:t,endTime:i}){try{const[s="",o=""]=n.split(":"),[a="",r=""]=i.split(":");return Jo.IX.fromDateTimes(e.set({hour:parseInt(s,10),minute:parseInt(o,10)}),t.set({hour:parseInt(a,10),minute:parseInt(r,10)}))}catch{return Jo.IX.invalid("Invalid")}}function oa(e){return Jo.IX.isInterval(e)?e:sa(e)}function aa(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 ra=(e,n)=>e.contains(n)||e.start.startOf("day").toMillis()===n.startOf("day").toMillis()||e.end.minus({minute:1}).startOf("day").toMillis()===n.startOf("day").toMillis(),da=h({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 la(e){return"string"==typeof e?Jo.c9.fromISO(e,{setZone:!0}):e}function ca(){return Jo.c9.utc().toLocal().zoneName}function ua(e){return"string"==typeof e&&e.startsWith("[")}function ma(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?ma(e):e);if("boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e)return e;{const n={};return Object.keys(e).forEach(t=>{const i=e[t];Xi.includes(t)||Ki.includes(t)?n[t]=i&&Jo.c9.fromISO(i,{zone:"UTC"}):Qi.includes(t)?Array.isArray(i)?n[t]=i.map(e=>ua(e)?ia(e):e):n[t]=ua(i)?ia(i):i:Ji.includes(t)?n[t]=i&&Jo.dw.fromISO(i):n[t]=null!=i&&"object"==typeof i?ma(i):i}),n}}const ga="32a8ec00304f886eead5f6ec60cf7df43e9e8679\n".trim();var ha=t(7405);const pa="heaventRequestUuid";function Ia(e,n){return"object"==typeof e&&null!==e&&Object.defineProperty(e,pa,{value:n}),e}const fa="h-new-version";async function xa(e,n={}){let t=ee.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,s=`${e} ${f(n.fragments)?Qo(n.fragments):""}`,o=ce(),a={...n.headers,"Content-Type":"application/json",[ne]:"front",[te]:ga,[ie]:o};i.has("lang")&&(t=`${t}?lang=${i.get("lang")}`),n.token&&(a[re]=n.token);const r=await fetch(t,{method:"post",headers:a,body:JSON.stringify({query:s,variables:n.variables||{}})});if(r.ok){n.reloadOnNewVersion&&"true"===r.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(fa,{bubbles:!0}));const e=await r.json();if(e.errors){const n=e.errors[0]?.message??"";if("You need to be logged-in"===n)return localStorage.clear(),location.href="/crew",{};if(n.startsWith("You do not have access to this"))return location.href="/crew",{};throw Ia(e.errors,o)}{const n=(0,ha.A)(e.data),t={};return n.forEach(n=>{t[n]=ma(e.data[n])}),t}}throw Ia(new Error(r.statusText),o)}function _a(e,n,t){const i=Object.keys(n).sort().map(e=>{const t=n[e];return`"${e}":${JSON.stringify(t)}`}).join(",");return(0,de.useMemo)(()=>fe().then(i=>xa(e,{variables:n,token:i||void 0,fragments:t})),[e,i])}const ja="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n }\n}\n",va="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(\n eventId: $eventId\n variety: Delegation\n sort: { attribute: Name, direction: Asc }\n ) {\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 delegationsSpaceLayouts {\n id\n name\n }\n }\n }\n}\n",Sa='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 category {\n name\n }\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 category {\n name\n }\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',ya="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",Ca="query EventAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n color\n icon\n }\n }\n }\n}\n",ba="query EventAccreditationsSlots($eventId: EventId!, $loadIsBlocked: Boolean!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n isBlocked @include(if: $loadIsBlocked)\n }\n }\n }\n }\n}\n",Aa="query EventPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n acronym\n positionDisplay\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",Ea="query Volunteers(\n $eventId: EventId!\n $predicatesGroups: PredicatesGroups!\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 $accreditationsCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $accreditationsSlotsIds: [AccreditationsSlotId!]\n $accreditationsProfilesCategoriesIds: [AccreditationsProfilesCategoryId!]\n $accreditationsProfilesIds: [AccreditationsProfileId!]\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $hasCoordinates: Boolean\n $includeAccreditationProfile: Boolean!\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeCustomDocuments: 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 $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: volunteersRegistrations(\n predicatesGroups: $predicatesGroups\n name: $name\n columnsSearch: $columnsSearch\n positionCategoryId: $positionCategoryId\n positionId: $positionId\n preassignedPositionCategoryId: $preassignedPositionCategoryId\n preassignedPositionId: $preassignedPositionId\n accreditationsCategoriesIds: $accreditationsCategoriesIds\n accreditationsIds: $accreditationsIds\n accreditationsSlotsIds: $accreditationsSlotsIds\n accreditationsProfilesCategoriesIds: $accreditationsProfilesCategoriesIds\n accreditationsProfilesIds: $accreditationsProfilesIds\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",wa="mutation UserCreate {\n userCreate {\n id\n email\n }\n}\n";function $a(e,n){return rs('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,[Ko.VolunteerRegistrationWaitingAssignmentFragment],n)}function Ta(e={}){return ds("mutation VolunteersRegistrationsMassAccreditationProfileUpdate(\n $eventId: EventId!\n $massProfileUpdate: MassAccreditationProfileUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationProfileUpdate(\n eventId: $eventId\n massProfileUpdate: $massProfileUpdate\n )\n}\n",e)}function za(e={}){return ds("mutation AccreditationsProfilesMassAccreditationsEdit(\n $eventId: EventId!\n $massAccreditations: MassAccreditationsInput!\n) {\n numberOfAccreditationsProfiles: accreditationsProfilesMassAccreditationsEdit(\n eventId: $eventId\n massAccreditations: $massAccreditations\n )\n}\n",e)}function Oa(e,n){return rs("query UserProfileAccreditations(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $excludeAccreditations: [AccreditationId!]\n) {\n organization(id: $organizationId) {\n hideAccreditationsUntilConfirmationEmailSent\n\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 isAccreditationsEmailSent\n\n accreditationsUsersInfos(excludeAccreditations: $excludeAccreditations) {\n id\n eventId\n isAutoAccredit\n isWorkflow\n checkInAt\n insertedAt\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 accreditationProfile {\n id\n name\n }\n\n createdBy {\n email\n name\n }\n }\n }\n }\n}\n",e,[],n)}function Ra(e={}){return ds("mutation VolunteersRegistrationsMassAccredit(\n $eventId: EventId!\n $massAccredit: MassAccreditInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccredit(\n eventId: $eventId\n massAccredit: $massAccredit\n )\n}\n",e)}function Da(e={}){return ds("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 Ma(e={}){return ds("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 Pa(e,n){return rs("query CreateCampaignInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId\n) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n customFields(\n eventId: $eventId\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n\n event: eventMaybe(id: $eventId) {\n hasDuplicatedMembers\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,[Ko.CustomFieldFragment,Ko.CreateCampaignEmailSenderFragment],n)}function ka(e={}){return ds("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n eventLayerUpdate(eventId: $eventId, layer: $layer) {\n id\n }\n}\n",e)}function Fa(e={}){return ds("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function Na(e={}){return ds("mutation AccreditationsProfilesMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsProfilesMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function La(e={}){return ds("mutation CustomFieldsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: customFieldsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function Ua(e,n={}){return xa(ja,{...n,variables:e,fragments:[]})}function Va(e={}){return ds("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 Ba(e,n={}){return xa(va,{...n,variables:e,fragments:[Ko.MassEditCustomFieldFragment]})}function Wa(e={}){return ds("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Ga(e={}){return ds("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function qa(e={}){return ds("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 Ha(e={}){return ds("mutation WorkflowsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: workflowsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function Ya(e,n={}){return xa("query CustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel\n $name: String\n $predicatesGroups: PredicatesGroups!\n $limit: Int\n $offset: Int\n $sort: CustomFieldsSort\n) {\n data: organization(id: $organizationId) {\n rows: customFields(\n eventId: $eventId\n level: $level\n predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.CustomFieldFragment]})}function Za(e,n={}){return xa('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 delegationCategory {\n name\n }\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 delegationCategory {\n name\n }\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{...n,variables:e,fragments:[]})}function Ka(e,n={}){return xa("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",{...n,variables:e,fragments:[Ko.DelegationAccreditationSlotStatsFragment]})}function Xa(e,n){return rs("query AllEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",e,[],n)}function Qa(e={}){return ds("mutation EventDocumentsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $documentsExport: DocumentsExportInput!\n) {\n jobId: eventDocumentsExport(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n documentsExport: $documentsExport\n )\n}\n",e)}function Ja(e={}){return ds("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 er(e,n){return rs("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\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(isValidToSendEmail: true) {\n id\n name\n }\n }\n}\n",e,[],n)}function nr(e={}){return ds("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n numberOfMembers: positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function tr(e,n){return rs("query UserPositions(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n\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 isAssignmentsEmailSent\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,[Ko.FormsUsersInfosWishedFragment,Ko.UserPositionSlotUserInfoFragment],n)}function ir(e,n={}){return xa("query ConditionsCustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $fieldTypes: [FieldType!]\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: All, fieldTypes: $fieldTypes) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}function sr(e,n={}){return xa(ya,{...n,variables:e,fragments:[]})}function or(e={}){return ds("mutation VolunteersRegistrationsMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function ar(e,n={}){return xa("query User(\n $organizationId: OrganizationId!\n $eventId: EventId\n $id: UsersInfoId!\n $includeComments: Boolean!\n $includeDelegations: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: 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",{...n,variables:e,fragments:[Ko.UserInfoCommunityFragment]})}function rr(e={}){return ds("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)}function dr(e,n={}){return xa("query Users(\n $organizationId: OrganizationId!\n $eventId: EventId\n $predicatesGroups: PredicatesGroups!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: UsersInfosSort\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $includeComments: Boolean!\n $includeDelegations: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: usersInfos(\n predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.UserInfoCommunityFragment]})}function lr(e,n){return rs("query Profile($organizationId: OrganizationId!) {\n user {\n email\n language\n\n userInfo(organizationId: $organizationId) {\n id\n fields\n }\n }\n}\n",e,[],n)}function cr(e={}){return ds("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 ur(e={}){return ds("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)}function mr(e,n){return rs(Ca,e,[],n)}function gr(e,n){return rs(ba,e,[],n)}function hr(e,n={}){return xa(ba,{...n,variables:e,fragments:[]})}function pr(e,n={}){return xa(Aa,{...n,variables:e,fragments:[]})}function Ir(e={}){return ds("mutation VolunteersRegistrationsMassDuplicate(\n $eventId: EventId!\n $delegationId: DelegationId\n $selecteds: MassActionSelectedsInput!\n $numberOfCopies: Int!\n) {\n numberOfCreatedMembers: volunteersRegistrationsMassDuplicate(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n numberOfCopies: $numberOfCopies\n )\n}\n",e)}function fr(e={}){return ds("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 xr(e,n){return rs("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,[Ko.FormsUsersInfosWishedFragment],n)}function _r(e={}){return ds("mutation VolunteersRegistrationsAccreditationsValidate(\n $eventId: EventId!\n $delegationId: DelegationId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsAccreditationsValidate(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function jr(e={}){return ds("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function vr(e={}){return ds("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function Sr(e={}){return ds("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 yr(e={}){return ds("mutation VolunteersRegistrationsMassStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function Cr(e,n){return rs("query VolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $privacy: CustomFieldPrivacy!\n $loadCustomDocuments: Boolean!\n $loadForms: Boolean!\n $loadSegments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 customDocuments @include(if: $loadCustomDocuments) {\n ...CustomDocumentPopulation\n }\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,[Ko.SegmentCustomFieldFragment,Ko.CustomDocumentPopulationFragment,Ko.SegmentsFoldersSegmentsFragment],n)}function br(e,n={}){return xa("query UpdateCellDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}function Ar(e={}){return ds("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 Er(e,n={}){return xa("query Volunteer(\n $eventId: EventId!\n $id: VolunteersRegistrationId!\n $delegationId: DelegationId\n $includeAccreditationProfile: Boolean!\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeCustomDocuments: 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 $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...VolunteerRegistration\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.VolunteerRegistrationFragment]})}function wr(e,n={}){return xa(Ea,{...n,variables:e,fragments:[Ko.VolunteerRegistrationFragment,Ko.TraceFragment]})}function $r(e={}){return ds("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 Tr(e={}){return ds("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massAccredit: MassAccreditInput!\n) {\n volunteersRegistrationsMassWishedAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massAccredit: $massAccredit\n )\n}\n",e)}function zr(e={}){return ds("mutation VolunteersRegistrationsMassWishedProfileUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $massProfileUpdate: MassAccreditationProfileUpdateInput!\n) {\n volunteersRegistrationsMassWishedProfileUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massProfileUpdate: $massProfileUpdate\n )\n}\n",e)}const Or=()=>{const{code:e,source:n,organizationId:t,eventId:i}=ls();return(0,de.useEffect)(()=>{const s=localStorage.getItem(me),o=localStorage.getItem(ue);if(w(s)&&w(o)&&w(e)&&w(n)){localStorage.removeItem(me),localStorage.removeItem(ue);const a=new le.TU({Username:s,Pool:pe()});a.Session=o,a.setAuthenticationFlowType("CUSTOM_AUTH"),a.sendCustomChallengeAnswer(e,{async onSuccess(e){const s=e.getIdToken().getJwtToken();await xa(wa,{token:s}),t&&i&&n===On.VolunteerRegister?location.href=Ho(t,i):t&&i&&n===On.VolunteerAssignments?location.href=Yo(t,i):n===On.App?location.href=Wo.HOME:location.href="/"},onFailure(e){fs("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var Rr=t(7251);function Dr(e){if(e){const[n,t,i]=e.split(" ");return{color:n,fontSize:t,fontWeight:i}}return{}}function Mr(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var Pr=t(3345);const kr={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},Fr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:Nr,theme:Lr,config:Ur,getCssText:Vr,createTheme:Br,globalCss:Wr,keyframes:Gr,reset:qr}=(0,Pr.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",grayCustom50:"var(--colors-gray50)",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",grayCustom500:"var(--colors-gray500)",gray600:"#475467",gray700:"#344054",grayCustom700:"var(--colors-gray700)",gray800:"#1d2939",grayCustom800:"var(--colors-gray800)",gray900:"#101828",grayCustom900:"var(--colors-gray900)",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary50:"#F0EBF9",primary100:"#E0D8F3",primary200:"#C4B4E9",primary300:"#A58DDD",primary400:"#8666D1",primary500:"#6941C6",primaryCustom500:"var(--colors-primary500)",primary600:"#5230A1",primaryCustom600:"var(--colors-primary600)",primary700:"#3E257A",primary800:"#2A1952",primary900:"#140C27",primary950:"#0A0614",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",inherit:"inherit",blueGray25:"#ff08ce",cyan:"#ff08ce",primary25:"#ff08ce",blueGray200:"#ff08ce",blueGray300:"#ff08ce",blueGray400:"#ff08ce",blueGray800:"#ff08ce",blueLight400:"#ff08ce",blueLight900:"#ff08ce",orange400:"#ff08ce",orange600:"#ff08ce",indigo100:"#ff08ce",indigo600:"#ff08ce"},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', ${Fr}`,grafik:`Graphik, ${Fr}`,montserrat:`Montserrat, ${Fr}`,anton:`Anton, ${Fr}`,roboto:`Roboto, ${Fr}`,poppins:`Poppins, ${Fr}`,inter:`Inter, ${Fr}`,unbounded:`Unbounded, ${Fr}`,rubik:`Rubik, ${Fr}`,firaSans:`"Fira Sans", ${Fr}`,arimo:`Arimo, ${Fr}`,zuumeMedium:`"Zuume Medium", ${Fr}`,zuumeBold:`"Zuume Bold", ${Fr}`,formulaCondensedBold:`FormulaCondensedBold, ${Fr}`,raleway:`Raleway, ${Fr}`,avenir:`Avenir, ${Fr}`,movement:`Movement, ${Fr}`,atrament:`Atrament, ${Fr}`,lato:`Lato, ${Fr}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${Fr}`,graphie:`Graphie, ${Fr}`,archerBoldPro:`ArcherBoldPro, ${Fr}`,acumin:`Acumin, ${Fr}`,chillax:`Chillax, ${Fr}`,neufileGrotesk:`NeufileGrotesk, ${Fr}`},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:kr,utils:{bd:e=>{let n="$gray200",t="$2",i="$xs";if(w(e)){const s=function(e){if(e){const[n,t,i]=e.split(" ");return{borderColor:n,borderRadius:t,boxShadow:i}}return{}}(e);s.borderColor&&(n=`$${s.borderColor}`),s.borderRadius&&(t=`$${s.borderRadius}`),i=s.boxShadow?`$${s.boxShadow}`:void 0}return{borderColor:n,borderRadius:t,borderStyle:"solid",borderWidth:"1px",boxShadow:i}},clamp:e=>({display:"-webkit-box",overflow:"hidden","-webkit-line-clamp":e.toString(10),"-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})}}),Hr=Br("weezcrew-theme",{}),Yr=Nr("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},grayCustom50:{color:"$grayCustom50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},grayCustom500:{color:"$grayCustom500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},grayCustom700:{color:"$grayCustom700"},gray800:{color:"$gray800"},grayCustom800:{color:"$grayCustom800"},gray900:{color:"$gray900"},grayCustom900:{color:"$grayCustom900"},grayDark50:{color:"$grayDark50"},grayDark100:{color:"$grayDark100"},grayDark500:{color:"$grayDark500"},grayDark700:{color:"$grayDark700"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primaryCustom500:{color:"$primaryCustom500"},primary600:{color:"$primary600"},primaryCustom600:{color:"$primaryCustom600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},primary950:{color:"$primary950"},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"},blueLight50:{color:"$blueLight50"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight500:{color:"$blueLight500"},blueLight600:{color:"$blueLight600"},blueLight700:{color:"$blueLight700"},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"},purpleLight50:{color:"$purpleLight50"},purpleLight100:{color:"$purpleLight100"},purpleLight500:{color:"$purpleLight500"},purpleLight700:{color:"$purpleLight700"},purpleDark50:{color:"$purpleDark50"},purpleDark100:{color:"$purpleDark100"},purpleDark500:{color:"$purpleDark500"},purpleDark700:{color:"$purpleDark700"},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"},orange50:{color:"$orange50"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange500:{color:"$orange500"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},redLight50:{color:"$redLight50"},redLight100:{color:"$redLight100"},redLight500:{color:"$redLight500"},redLight700:{color:"$redLight700"},redDark50:{color:"$redDark50"},redDark100:{color:"$redDark100"},redDark500:{color:"$redDark500"},redDark700:{color:"$redDark700"},green50:{color:"$green50"},green100:{color:"$green100"},green500:{color:"$green500"},green700:{color:"$green700"},greenDark50:{color:"$greenDark50"},greenDark100:{color:"$greenDark100"},greenDark500:{color:"$greenDark500"},greenDark700:{color:"$greenDark700"},brown50:{color:"$brown50"},brown100:{color:"$brown100"},brown500:{color:"$brown500"},brown700:{color:"$brown700"},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"}}),Zr=(0,de.forwardRef)((e,n)=>{const t={};return e.height&&(t.height=Mr(e.height)),e.width&&(t.width=Mr(e.width)),(0,i.jsx)(Yr,{...(0,Rr.A)(e,"font"),...Dr(e.font),ref:n,css:{...t,...e.css}})});Zr.displayName="Box";var Kr=t(4625),Xr=t(6347),Qr=t(8542);function Jr(e){return"number"==typeof e&&!isNaN(e)}function ed(e,n=96){return Math.round(25.4*e/n)}function nd(e){return"number"==typeof e&&Number.isInteger(e)&&e>0}function td(e){return e?{lat:e.latitude,lng:e.longitude}:null}const id=td({latitude:43.6087733,longitude:3.87963579999996}),sd=13;function od(e,n,t){return{center:e??id,zoom:n??sd,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:rd(t),styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}}function ad(e){return Jr(e.latitude)&&Jr(e.longitude)?(0,Qr.A)(e,["latitude","longitude"]):void 0}function rd(e){return e===Rn.GoogleSatellite?"satellite":e===Rn.Google?"roadmap":e??Rn.Google}var dd=t(6996),ld=t(952);const cd=e=>{const n=(0,de.useRef)(e.value);return(0,de.useLayoutEffect)(()=>{if(e.value!==n.current){const t=n.current;n.current=e.value,e.onChange(e.value,t)}}),null},ud=e=>(0,i.jsx)(ld.D0,{allowNull:!0,name:e.name,render:({input:n})=>(0,i.jsx)(cd,{value:n.value,onChange:e.onChange}),subscription:{value:!0}});function md(){return new google.maps.ImageMapType({getTileUrl:(e,n)=>((e,n)=>`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=${n}`,`TILEROW=${e.y}`,`TILECOL=${e.x}`].join("&")}`)(e,n),tileSize:new google.maps.Size(256,256),name:Rn.IgnPlan,maxZoom:18})}const gd=(0,de.memo)(e=>{const n=(0,de.useCallback)(n=>{n&&(t.current&&(s.current?.setMap(null),t.current=null),t.current=new google.maps.Map(n,{zoom:e.coordinatesFieldsProps?.zoomProps.input.value??e.initialZoom??sd,center:td(e.center)||id,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:rd(e.layer),...e.mapOptions||{}}),t.current.mapTypes.set(Rn.IgnPlan,md()),t.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(t.current.getZoom())}),t.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),a())},[]),t=(0,de.useRef)(null),s=(0,de.useRef)(null),o=(0,de.useRef)([]),a=()=>{o.current.forEach(e=>e.setMap(null)),f(e.traces)?o.current=e.traces.map(e=>{const n=e.points.map(([e,n])=>({lat:e,lng:n})),i=e.direction===ft.None?[]:[{icon:{path:e.direction===ft.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:n,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,icons:i});return s.setMap(t.current),s}):o.current=[]};return(0,de.useEffect)(()=>{(()=>{if(s.current&&s.current.setMap(null),e.point&&t.current){const n=td(e.point);t.current.setCenter(n),s.current=new google.maps.Marker({position:n,map:t.current,draggable:"object"==typeof e.coordinatesFieldsProps&&null!==e.coordinatesFieldsProps}),e.coordinatesFieldsProps&&s.current.addListener("dragend",n=>{e.coordinatesFieldsProps?.latitudeProps.input.onChange(n.latLng.lat()),e.coordinatesFieldsProps?.longitudeProps.input.onChange(n.latLng.lng())})}})()},[JSON.stringify(e.point)]),(0,de.useEffect)(()=>{t.current?.setMapTypeId(rd(e.layer))},[e.layer]),(0,de.useEffect)(()=>{a()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(Zr,{ref:n,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(ud,{name:e.coordinatesFieldsProps.zoomProps.input.name,onChange:e=>{t.current?.setZoom(e)}})})},dd.A);gd.displayName="Map";var hd=t(961);const pd=()=>(0,hd.createPortal)((0,i.jsx)(Zr,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),Id="query AccreditationsSlotsList(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $columnsSearch: [String!]\n $customFieldsSlugs: [CustomFieldSlug!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSlotsSort\n $includeConditions: Boolean!\n $includeCustomFields: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $onlyWithDate: Boolean\n) {\n organization(id: $organizationId) @include(if: $includeCustomFields) {\n customFields(eventId: $eventId, fieldTypes: [Select]) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n name: $name\n predicatesGroups: $predicatesGroups\n includeHidden: true\n onlyWithDate: $onlyWithDate\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",fd="query BackofficeOrganization($organizationId: OrganizationId!) {\n data: backoffice {\n row: organization(id: $organizationId) {\n ...OrganizationBackoffice\n }\n }\n}\n",xd="query Events(\n $organizationId: OrganizationId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: EventsSort\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: events(\n name: $name\n whereUserIsLeader: true\n predicatesGroups: $predicatesGroups\n offset: $offset\n limit: $limit\n sort: $sort\n ) {\n nodes {\n ...EventsEvent\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",_d="query Positions(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $hasCoordinates: Boolean\n $limit: Int\n $offset: Int\n $sort: PositionsSort\n $columnsSearch: [String!]\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includePositionTraces: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n $includeTraces: Boolean!\n $includeVolunteerMinutes: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: positions(\n name: $name\n predicatesGroups: $predicatesGroups\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",jd="query VolunteersPlanning(\n $eventId: EventId!\n $positionId: PositionId\n $predicatesGroups: PredicatesGroups!\n $name: String\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n dayStartTime\n startAt\n endAt\n\n rows: volunteersRegistrations(\n positionId: $positionId\n predicatesGroups: $predicatesGroups\n name: $name\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...DocumentUsersPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n";function vd(e,n={}){return xa("query Accreditations(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: AccreditationsSort\n $columnsSearch: [String!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditations(\n name: $name\n predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.AccreditationsAccreditationFragment]})}function Sd(e,n={}){return xa("query AccreditationsAccreditation(\n $eventId: EventId!\n $id: AccreditationId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditation(id: $id) {\n ...AccreditationsAccreditation\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.AccreditationsAccreditationFragment]})}function yd(e,n={}){return xa("query AccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}function Cd(e={}){return ds("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function bd(e,n={}){return xa('query AccreditationsMobile($eventId: EventId!, $name: String, $limit: Int, $offset: Int) {\n event(id: $eventId) {\n accreditations(\n name: $name\n limit: $limit\n offset: $offset\n sort: { attribute: "Category", direction: Asc }\n ) {\n nodes {\n id\n name\n color\n icon\n index\n assignedResources\n maxResources\n\n accreditationCategory {\n id\n name\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n',{...n,variables:e,fragments:[Ko.FullPageInfoFragment]})}function Ad(e={}){return ds("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n id\n }\n}\n",e)}function Ed(e={}){return ds("mutation AccreditationsProfilesMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfAccreditationsProfiles: accreditationsProfilesMassDelete(\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function wd(e={}){return ds("mutation AccreditationProfileDuplicate(\n $eventId: EventId!\n $accreditationProfileId : AccreditationsProfileId!\n){\n accreditationProfileDuplicate(eventId: $eventId, accreditationProfileId: $accreditationProfileId) {\n id\n }\n}\n",e)}function $d(e,n={}){return xa("query AccreditationsProfiles(\n $eventId: EventId!\n $name: String\n $columnsSearch: [String!]\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: AccreditationsProfilesSort\n $includeAccreditations: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditationsProfiles(\n name: $name\n columnsSearch: $columnsSearch\n predicatesGroups: $predicatesGroups\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsProfilesProfile\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.AccreditationsProfilesProfileFragment]})}function Td(e,n={}){return xa("query AccreditationsProfilesProfile(\n $eventId: EventId!\n $id: AccreditationsProfileId!\n $includeAccreditations: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditationProfile(id: $id) {\n ...AccreditationsProfilesProfile\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.AccreditationsProfilesProfileFragment]})}function zd(e={}){return ds("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 Od(e,n){return rs(Id,e,[Ko.ConditionCustomFieldFragment,Ko.AccreditationsAccreditationSlotFragment],n)}function Rd(e,n){return rs('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,[],n)}function Dd(e,n={}){return xa(fd,{...n,variables:e,fragments:[Ko.OrganizationBackofficeFragment]})}function Md(e,n={}){return xa("query BackofficeOrganizations(\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: OrganizationSort\n) {\n data: backoffice {\n rows: organizations(\n name: $name\n predicatesGroups: $predicatesGroups\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...OrganizationBackoffice\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.OrganizationBackofficeFragment]})}function Pd(e,n){return rs("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 delegations {\n id\n name\n eventId\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,[Ko.DocumentEmailPreviewFragment],n)}function kd(e,n){return rs("query ImportInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $variety: CustomFieldVariety\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: $variety) {\n nodes {\n ...CustomFieldImport\n }\n }\n\n event: eventMaybe(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n\n accreditationsProfiles {\n nodes {\n ...AccreditationProfileImport\n }\n }\n }\n }\n}\n",e,[Ko.CustomFieldImportFragment,Ko.AccreditationImportFragment,Ko.AccreditationProfileImportFragment],n)}function Fd(e,n){return rs("query SpaceDesign(\n $organizationId: OrganizationId!\n $eventId: EventId\n $includeIntro: Boolean!\n $spaceType: SpaceType!\n) {\n organization(id: $organizationId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n\n event: eventMaybe(id: $eventId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n }\n\n eventsShowcaseSettings @include(if: $includeIntro) {\n title\n intro\n }\n }\n}\n",e,[Ko.SpaceDesignFragment],n)}function Nd(e,n={}){return xa("query CommunityCampaigns(\n $organizationId: OrganizationId!\n $predicatesGroups: PredicatesGroups!\n $name: String\n $limit: Int\n $offset: Int\n $sort: CampaignsSort\n) {\n data: organization(id: $organizationId) {\n rows: campaigns(\n level: Organization\n predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.CampaignListFragment]})}function Ld(e={}){return ds("mutation UsersInfosMerge(\n $organizationId: OrganizationId!\n $eventId: EventId\n $mainUserInfoId: UsersInfoId!\n $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n usersInfosMerge(\n organizationId: $organizationId\n eventId: $eventId\n mainUserInfoId: $mainUserInfoId\n toMergeUsersInfosIds: $toMergeUsersInfosIds\n ) {\n id\n }\n}\n",e)}function Ud(e,n={}){return xa("query CustomField($organizationId: OrganizationId!, $id: CustomFieldId!) {\n data: organization(id: $organizationId) {\n row: customField(id: $id) {\n ...CustomField\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.CustomFieldFragment]})}function Vd(e={}){return ds("mutation CustomFieldsMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfCustomFields: customFieldsMassDelete(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Bd(e={}){return ds("mutation CustomFieldsMassDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n customFieldsMassDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n ) {\n id\n }\n}\n",e)}function Wd(e,n){return rs("query CustomFieldsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $predicatesGroups: PredicatesGroups!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, predicatesGroups: $predicatesGroups) {\n nodes {\n id\n name\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: $level, eventId: $eventId, segmentType: CustomFields) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[Ko.SegmentsFoldersSegmentsFragment],n)}function Gd(e={}){return ds("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 qd(e,n={}){return xa("# The settings a new delegation takes from its parent: loaded for the chosen parent only. Through\n# delegations, scoped to what the user can access as the list of them was, not delegationMaybe\nquery DelegationParent($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization, ids: [$delegationId]) {\n nodes {\n id\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",{...n,variables:e,fragments:[]})}function Hd(e={}){return ds("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 Yd(e={}){return ds("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 Zd(e,n={}){return xa("query Delegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicatesGroups: PredicatesGroups\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: DelegationsSort\n $includeAccreditations: Boolean!\n $includeAccreditationsProfiles: Boolean!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeDocuments: Boolean!\n $includeLayout: Boolean!\n $includeLeaders: Boolean!\n $includeParent: 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 predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.DelegationsDelegationFragment]})}function Kd(e,n={}){return xa("query DelegationsDelegation(\n $organizationId: OrganizationId!\n $id: DelegationId!\n $includeAccreditations: Boolean!\n $includeAccreditationsProfiles: Boolean!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeDocuments: Boolean!\n $includeLayout: Boolean!\n $includeLeaders: Boolean!\n $includeParent: 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",{...n,variables:e,fragments:[Ko.DelegationsDelegationFragment]})}function Xd(e={}){return ds("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 Qd(e={}){return ds("mutation DelegationsMassLeadersEmailSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfDelegations: delegationsMassLeadersEmailSend(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Jd(e,n={}){return xa('query DelegationsMobile($eventId: EventId!, $name: String, $limit: Int, $offset: Int) {\n event(id: $eventId) {\n delegations(\n name: $name\n limit: $limit\n offset: $offset\n sort: { attribute: "Category", direction: Asc }\n ) {\n nodes {\n id\n name\n state\n numberOfResources\n maxResources\n\n delegationCategory {\n id\n name\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n',{...n,variables:e,fragments:[Ko.FullPageInfoFragment]})}function el(e,n){return rs('query DelegationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: Delegation, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n delegation(id: $delegationId) {\n id\n organizationId\n eventId\n formId\n name\n description\n deadlineDate\n privateNote\n state\n numberOfResources\n maxResources\n numberOfMembersAccredited\n numberOfMembersWaitingAccreditation\n numberOfMembersRefusedAccreditation\n fields\n\n category: delegationCategory {\n id\n name\n }\n\n parent {\n id\n name\n }\n\n delegationsSpaceLayout {\n id\n name\n }\n\n form {\n id\n name\n }\n\n leaders {\n id\n email\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\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',e,[Ko.CustomFieldWithConditionFragment],n)}function nl(e={}){return ds("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)}function tl(e,n){return rs("query EmailTemplate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailType: EmailType!\n) {\n organization(id: $organizationId) {\n emailSenderId\n emailsSenders(isValidToSendEmail: true) {\n id\n name\n buttonColor\n }\n\n customFields(\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n emailSender {\n id\n buttonColor\n }\n\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",e,[Ko.CustomFieldFragment],n)}function il(e={}){return ds("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)}function sl(e,n={}){return xa(xd,{...n,variables:e,fragments:[Ko.EventsEventFragment]})}function ol(e,n={}){return xa("query EventsEvent(\n $organizationId: OrganizationId!\n $id: EventId!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: event(id: $id) {\n ...EventsEvent\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.EventsEventFragment]})}function al(e,n){return rs("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,[Ko.FormListFragment],n)}function rl(e,n){return rs("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n }\n }\n}\n",e,[],n)}function dl(e={}){return ds("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function ll(e,n){return rs("query Organizations {\n organizations {\n id\n name\n }\n\n user {\n roles {\n organizationId\n type\n }\n }\n}\n",e,[],n)}function cl(e,n={}){return xa("query OrganizationMember(\n $organizationId: OrganizationId!\n $id: VolunteersRegistrationId!\n $includeCustomDocuments: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: volunteerRegistration(id: $id) {\n ...OrganizationMember\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.OrganizationMemberFragment]})}function ul(e,n={}){return xa("query OrganizationMembers(\n $organizationId: OrganizationId!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $includeCustomDocuments: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: volunteersRegistrations(\n name: $name\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...OrganizationMember\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.OrganizationMemberFragment]})}function ml(e={}){return ds("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 gl(e={}){return ds("mutation UserDelete {\n userDelete {\n id\n }\n}\n",e)}function hl(e={}){return ds("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function pl(e={}){return ds("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 Il(e,n={}){return xa("query PositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}function fl(e={}){return ds("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function xl(e,n={}){return xa("query PositionsPosition(\n $eventId: EventId!\n $id: PositionId!\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includePositionTraces: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n $includeVolunteerMinutes: Boolean!\n) {\n data: event(id: $eventId) {\n row: position(id: $id) {\n ...PositionsPosition\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.PositionsPositionFragment]})}function _l(e,n={}){return xa(_d,{...n,variables:e,fragments:[Ko.PositionsPositionFragment,Ko.TraceFragment]})}function jl(e,n={}){return xa('query PositionsMobile(\n $eventId: EventId!\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n positions(\n predicatesGroups: $predicatesGroups\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',{...n,variables:e,fragments:[Ko.LeaderInfosFragment,Ko.FullPageInfoFragment]})}function vl(e,n={}){return xa('query PositionSlotMembersMobile(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $predicatesGroups: PredicatesGroups!\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 predicatesGroups: $predicatesGroups\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',{...n,variables:e,fragments:[Ko.FullPageInfoFragment]})}function Sl(e,n={}){return xa("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",{...n,variables:e,fragments:[Ko.PositionPositionSlotFragment,Ko.FullPageInfoFragment]})}function yl(e,n){return rs("query PositionDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 numberOfSlots\n\n slots {\n id\n fillingRate\n name\n range\n }\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n\n traces {\n ...Trace\n }\n\n customFields: positionsCustomFields {\n customField {\n slug\n name\n fieldType\n listType\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,[Ko.CustomFieldWithConditionFragment,Ko.TraceFragment,Ko.LeaderInfosFragment],n)}function Cl(e,n={}){return xa("query VolunteerPlanning(\n $id: VolunteersRegistrationId!\n $eventId: EventId!\n $positionId: PositionId\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...DocumentUsersPlanning\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.DocumentUsersPlanningFragment]})}function bl(e={}){return ds("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 Al(e,n={}){return xa("query PrintTriggers(\n $eventId: EventId!\n $name: String\n $limit: Int\n $offset: Int\n $sort: PrintTriggersSort\n) {\n data: event(id: $eventId) {\n rows: printTriggers(\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PrintTriggersPrintTrigger\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.PrintTriggersPrintTriggerFragment]})}function El(e,n={}){return xa("query PrintTriggersPrintTrigger($eventId: EventId!, $id: PrintTriggerId!) {\n data: event(id: $eventId) {\n row: printTrigger(id: $id) {\n ...PrintTriggersPrintTrigger\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.PrintTriggersPrintTriggerFragment]})}function wl(e,n){return rs("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n organization: organizationPublic(id: $organizationId) {\n customField: customFieldBySlug(slug: $slug) {\n name\n description\n fieldType\n\n values {\n id\n value\n }\n }\n }\n}\n",e,[],n)}function $l(e,n={}){return xa("query CreateUserDelegationForm(\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $eventId: EventId\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n id\n name\n dateFormat\n datetimeFormat\n\n country\n\n delegation: delegationMaybe(id: $delegationId) {\n id\n\n accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots(onlyVisible: true) {\n ...DelegationAccreditationSlot\n }\n }\n\n event: eventMaybe(id: $eventId) {\n ...EventCreateUpdateMember\n }\n\n form(id: $formId) {\n ...CreateUpdateMemberForm\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.DelegationAccreditationProfileFragment,Ko.DelegationAccreditationSlotFragment,Ko.EventCreateUpdateMemberFragment,Ko.CreateUpdateMemberFormFragment]})}function Tl(e={}){return ds("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)}function zl(e={}){return ds("mutation VolunteersRegistrationsMassTicketIdRegenerate(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfEdited: volunteersRegistrationsMassTicketIdRegenerate(\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function Ol(e={}){return ds("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 Rl(e,n){return rs("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n comments {\n ...Comment\n }\n }\n }\n}\n",e,[Ko.CommentFragment],n)}function Dl(e,n){return rs("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,[Ko.ExistingVolunteerFragment],n)}function Ml(e={}){return ds("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 Pl(e,n){return rs(jd,e,[Ko.DocumentUsersPlanningFragment],n)}function kl(e,n={}){return xa(jd,{...n,variables:e,fragments:[Ko.DocumentUsersPlanningFragment]})}function Fl(e={}){return ds("mutation VolunteersRegistrationsMassPreAssign(\n $eventId: EventId!\n $massPreAssign: MassPreAssignInput!\n) {\n numberOfMembers: volunteersRegistrationsMassPreAssign(\n eventId: $eventId\n massPreAssign: $massPreAssign\n )\n}\n",e)}function Nl(e={}){return ds("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 Ll(e,n={}){return xa("query VolunteersMobile(\n $eventId: EventId!\n $predicatesGroups: PredicatesGroups!\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n volunteersRegistrations(\n predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.FullPageInfoFragment]})}function Ul(e,n){return rs("query WorkflowCustomFields(\n $organizationId: OrganizationId!\n $eventId: EventId\n $variety: CustomFieldVariety!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: $variety, privacy: All) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",e,[Ko.MassEditCustomFieldFragment],n)}function Vl(e={}){return ds("mutation WorkflowssMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Bl(e={}){return ds("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)}function Wl(e,n={}){return xa("query Workflows(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n $sort: WorkflowsSort\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n $includePositions: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: workflows(\n level: $level\n eventId: $eventId\n name: $name\n predicatesGroups: $predicatesGroups\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...WorkflowsWorkflow\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.WorkflowsWorkflowFragment]})}function Gl(e={}){return ds("mutation WorkflowsMassExecute(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfExecuted: workflowsMassExecute(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function ql(e,n){return rs("query WorkflowsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, eventId: $eventId, segmentType: Workflows) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[Ko.SegmentsFoldersSegmentsFragment],n)}const Hl=()=>{const{eventId:e,accreditationId:n}=ls(),{data:t,loader:s}=rs("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:n},[],undefined);const[o,a]=(0,de.useState)(!1);if(s)return s;{const e=t.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(gd,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:ad(e),onTilesloaded:()=>{a(!0)}})}),o&&(0,i.jsx)(pd,{})]})}};var Yl;function Zl(e){return(0,Qr.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"}(Yl||(Yl={}));const Kl=Nr("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"}}),Xl=(0,de.forwardRef)(({onClick:e,...n},t)=>{const s={};return n.height&&(s.height=Mr(n.height)),n.width&&(s.width=Mr(n.width)),(0,i.jsx)(Kl,{...n,ref:t,css:{...s,...n.css},onClick:e})});Xl.displayName="Flex";var Ql=t(7356),Jl=t(2664);let ec=class{validate(e){return async n=>{try{return await e.validate(n,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}}validateSync(e,n){try{return e.validateSync(n,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}isValidSync(e,n){return 0===Object.keys(this.validateSync(e,n)).length}validateForForm(e){return async n=>{try{return await e.validate(n,{abortEarly:!1,strict:!0}),{}}catch(e){if(!(e instanceof Jl.yI))throw e;return e.inner.reduce((e,n)=>(0,Ql.Oe)(e,n.path,n.message),{})}}}errorToObject(e){return e.inner.reduce((e,n)=>({...e,[n.path]:n.message}),{})}};ec=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)()],ec);var nc=t(924);const tc=(0,de.createContext)({}),ic=Nr("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 sc=t(9241),oc=t(2695),ac=t(8174);const rc=["access","ticket","pay"],dc=/^(con|prn|aux|nul|com[1-9]|lpt[1-9]|conin\$|conout\$|clock\$)$/i,lc=/[\u0000-\u001F\u007F-\u009F\u061C\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF\uFFF9-\uFFFB]/g,cc=/[<>:"/\\|?*]/g,uc=e=>(new TextEncoder).encode(e).length;function mc(e,n="download",t=200){let i=e.normalize("NFC").replace(lc,"").replace(cc,"-").replace(/\s+/g," ").replace(/^[.\s-]+/,"").replace(/[.\s]+$/,"");return dc.test(i.split(".")[0]??"")&&(i=`_${i}`),i=function(e,n){if(uc(e)<=n)return e;let t="";for(const i of e){if(uc(t+i)>n)break;t+=i}return t}(i,t).replace(/[.\s]+$/,""),i||n}const gc=({children:e,height:n,replace:t,style:s,to:o,width:a,...r})=>{const d=new URL(o.toString(),location.origin),l={};n&&(l.height=Mr(n)),a&&(l.width=Mr(a));const c={alignItems:"inherit",color:"inherit",cursor:"pointer",display:"inherit",flexDirection:"inherit",flexWrap:"inherit",gap:"inherit",justifyContent:"inherit",textDecoration:"none",...l,...s};return d.origin!==location.origin||rc.includes(d.pathname.split("/")[1]??"")?(0,i.jsx)("a",{href:d.href,rel:"noreferrer",style:c,target:"_blank",...r,children:e}):(0,i.jsx)(Kr.N_,{replace:t,style:c,to:{pathname:w(ee.HEAVENT_APPLICATION_BASENAME)?d.pathname.replace(new RegExp(`^/${ee.HEAVENT_APPLICATION_BASENAME}`,"gm"),""):d.pathname,hash:d.hash,search:d.search},...r,children:e})};function hc(e){return(0,ac.A)(e)}gc.displayName="LinkWrapper";const pc=e=>{const n=e.iconStyle??"regular",t={};e.primaryColor&&(t["--fa-primary-color"]=e.primaryColor),e.secondaryColor&&(t["--fa-secondary-color"]=e.secondaryColor,t["--fa-secondary-opacity"]="1");const s=()=>(0,i.jsx)("i",{"aria-hidden":e["aria-hidden"]??!0,className:`fa-${n} fa-${e.icon} ${e.className||""}`,role:e.role,style:{...t,cursor:e.title?"help":"inherit"},title:e.title,onClick:e.to?void 0:e.onClick});return e.to?(0,i.jsx)(gc,{target:e.target,to:e.to,onClick:e.onClick,children:s()}):s()};function Ic(e){throw new Error("Didn't expect to get here")}function fc(){return{history:cs(),params:ls(),translate:os()}}const xc=e=>(0,de.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,de.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,de.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),_c=(0,de.memo)(function(){return(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(xc,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),jc={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primaryCustom500",border:"1px solid $primaryCustom500",color:"white","&:hover":{background:"$primaryCustom600",border:"1px solid $primaryCustom600"},"& .loader":{background:"$primaryCustom500",border:"1px solid $primaryCustom500"},"& .loader:hover":{background:"$primary600",border:"1px solid $primary600"}},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:"$grayCustom700","&:hover":{background:"$grayCustom50",color:"$grayCustom800"},"& .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:"$primaryCustom500",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primaryCustom600"},"& .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:"$gray50",border:"1px solid $gray50",color:"$gray400","&:hover":{background:"$gray50",border:"1px solid $gray50"},"& .loader":{background:"$gray50",border:"1px solid $gray50"},"& .loader:hover":{background:"$gray50",border:"1px solid $gray50"}}},{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"}},vc=Nr("button",jc),Sc=Nr("div",jc),yc=(0,de.forwardRef)(({children:e,className:n,color:t,css:s,disabled:o,featureFlags:a,isLoading:r,leftIcon:d,onClick:l,to:c,rightIcon:u,size:m,textAlign:g=(a?.isV4?"center":void 0),title:h,...p},I)=>{const f=!!d&&!e&&!u||!d&&!e&&!!u,x={className:`button ${n||""}`,color:t,css:{width:a?.isV4?"100%":void 0,...s,position:"relative"},disabled:o,iconOnly:f,size:m,title:h},_={children:e,color:t,leftIcon:d,isLoading:r,rightIcon:u,textAlign:g};return c&&!o?(0,i.jsx)(gc,{style:a?.isV4?{flex:"1"}:void 0,title:h,to:c,onClick:e=>{o||r||l&&l(e)},...p,children:(0,i.jsx)(Sc,{...x,ref:I,children:(0,i.jsx)(Cc,{..._})})}):(0,i.jsx)(vc,{...x,ref:I,type:"button",onClick:e=>{o||r||l&&l(e)},...p,children:(0,i.jsx)(Cc,{..._})})});yc.displayName="Button",yc.toString=()=>".button";const Cc=({children:e,color:n,isLoading:t,leftIcon:s,rightIcon:o,textAlign:a})=>(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(Xl,{children:(0,i.jsx)(pc,{icon:s})}),e&&(0,i.jsx)(Zr,{className:"h-button-content",css:{flex:"1"},textAlign:a,children:e}),o&&(0,i.jsx)(Xl,{children:(0,i.jsx)(pc,{icon:o})}),t&&(0,i.jsx)(Xl,{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)(xc,{color:n&&"primary"!==n&&"error"!==n?Lr.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]}),bc=e=>{const n={iconStyle:"solid"};switch(e.iconStyle){case"error":return(0,i.jsx)(pc,{className:"h-alert-icon",icon:"circle-exclamation",...n});case"warning":return(0,i.jsx)(pc,{className:"h-alert-icon",icon:"triangle-exclamation",...n});case"success":return(0,i.jsx)(pc,{className:"h-alert-icon",icon:"circle-check",...n});case"primary":case"gray":return(0,i.jsx)(pc,{className:"h-alert-icon",icon:"circle-info",...n});default:Ic(e.iconStyle)}},Ac=Nr(Xl,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i.h-alert-icon":{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning500",color:"$gray800","& i.h-alert-icon":{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success500",color:"$gray800","& i.h-alert-icon":{color:"$success500"}},primary:{background:"$primary50",border:"1px solid $primary500",color:"$gray800","& i.h-alert-icon":{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray500",color:"$gray800","& i.h-alert-icon":{color:"$gray500"}}}},defaultVariants:{alertStyle:"error"}}),Ec=Nr("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:"$textMd",fontWeight:"$medium",lineHeight:"1.55556"},smallcapsheading:{color:"$gray500",fontSize:"10px",lineHeigh:"24px",textTransform:"uppercase"},subheading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.5"},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"}}),wc=(0,de.forwardRef)(({children:e,...n},t)=>(0,i.jsx)(Ec,{ref:t,...n,children:e}));wc.displayName="Text";const $c=({min:e=2,max:n=6,textStyle:t="heading",children:s,...o})=>{n{const i=e?.parentElement;if(!i||t===n)return t;for(const e of Array(i.children))if(e[0]instanceof HTMLHeadingElement)return l(i,t+1);return l(i,t)},[n]);return(0,de.useEffect)(()=>d(`h${l(a.current?.parentElement,e)}`),[e,n]),(0,i.jsx)(wc,{ref:a,as:r,...o,textStyle:t,children:s})},Tc=e=>{const{translate:n}=fc();return(0,i.jsxs)(Ac,{alertStyle:e.alertStyle,"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(Xl,{align:"start",children:(0,i.jsx)(Zr,{height:"20px",width:"20px",children:(0,i.jsx)(bc,{iconStyle:e.alertStyle})})}),(0,i.jsx)(Xl,{align:"start",css:{flex:"1",gap:"2px"},direction:"column",children:e.children}),e.onClose&&(0,i.jsx)(yc,{"aria-label":n("fermer_62479"),color:"invisible",css:{height:"20px",padding:0,width:"20px","& i":{color:"$gray500"}},textAlign:"center",onClick:e.onClose,children:(0,i.jsx)(pc,{icon:"xmark"})})]})},zc=({children:e})=>(0,i.jsx)($c,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),Oc=({children:e})=>(0,i.jsx)(i.Fragment,{children:e}),Rc=e=>(0,i.jsxs)(Tc,{alertStyle:"error","aria-live":"assertive",children:[(0,i.jsx)(zc,{children:e.title}),(0,i.jsx)(Oc,{children:e.children})]});function Dc(e){return e?(0,Zo.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,sc.A)(e).map(e=>Dc(e)).flat():Dc(e)).flat()):[]}const Mc=e=>{const{translate:n}=fc(),{formRenderProps:{errors:t,submitErrors:s},showErrors:o}=(0,de.useContext)(tc),a=Dc((0,oc.A)({},t,s));return o&&f(a)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rc,{title:n("form_has_errors_14074"),children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:a.map((e,n)=>(0,i.jsx)("li",{children:e},n))})}),!0!==e.hideSpacer&&(0,i.jsx)(ic,{height:"6"})]}):null};function Pc(e,n){Object.values(n.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const kc=e=>{const n=(0,de.useRef)(null),{setShowErrors:t}=(0,de.useContext)(tc),s=()=>{const n=e.formRenderProps.handleSubmit();return n?.catch(e=>{console.debug("Form submission failed:",e)}),n},o=i=>(i?.preventDefault?.(),e.formRenderProps.invalid?(t(!0),e.formRenderProps.form.mutators.forceErrors?.(),setTimeout(()=>{e.customErrorRef&&e.customErrorRef.current?(e.customErrorRef.current.scrollIntoView(),e.customErrorRef.current.scrollTop=0):!e.hideDefaultErrors&&n.current&&(n.current.scrollIntoView(),n.current.scrollTop=0)},100),!e.formRenderProps.hasValidationErrors&&e.formRenderProps.hasSubmitErrors?s():void 0):s());return(0,i.jsxs)(Xl,{ref:n,as:"form",onSubmit:o,...Zl(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(Mc,{}),(0,i.jsx)("input",{style:{display:"none"},type:"submit",value:"Submit"}),e.render({...e.formRenderProps,handleSubmit:o})]})},Fc=e=>{const n=ss(ec),[t,s]=(0,de.useState)(!1);return(0,i.jsx)(ld.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??dd.A,mutators:{...e.mutators,...nc.A,forceErrors:Pc},render:n=>(0,i.jsx)(tc.Provider,{value:{formRenderProps:n,showErrors:t,setShowErrors:s},children:(0,i.jsx)(kc,{...(0,Qr.A)(e,["direction","align","justify","wrap","gap","css","height","width"]),customErrorRef:e.customErrorRef,formRenderProps:n,hideDefaultErrors:e.hideDefaultErrors,render:e.render})}),validate:t=>e.schema?n.validateForForm(e.schema)(t):"function"==typeof e.validate?e.validate(t):{},onSubmit:async(n,t,i)=>{s(!1);const o=await e.onSubmit(n,t,i);return Object.keys(o||{}).length>0&&s(!0),o}})};var Nc=t(9008);function Lc(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const Uc=(e,n=!0)=>{n&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()};function Vc(){const e=(0,de.useId)();return{inputId:`${e}input`,labelId:`${e}label`,descId:`${e}desc`,errorId:`${e}error`}}h(["user","userRegistration","userDelegation","userDocuments","event","organization","delegation","recipient","invitedBy","assignments","accreditations"]);const Bc=(e,n)=>{switch(n){case"user":return e("membre_45658");case"userDelegation":case"delegation":return e("Delegation");case"userDocuments":return e("Documents");case"event":return e("_v_nement_22345");case"organization":return e("organisation_71863");case"recipient":return e("destinataire_20445");case"invitedBy":return e("personne_qui_in_11448");case"assignments":return e("affectation_plural");case"accreditations":return e("accr_ditations_39450");case"preassign":return e("pr_affectation_12256");case"wishes":return e("souhaits_16217");case"blocks":return e("blocs_d_taill_s_61273");case"links":return e("liens_26418");case"email":return e("e_mail_13869")}},Wc=(e,n=[])=>n.map(({slug:n,name:t})=>[`${e}.${n}`,t]),Gc=(e,n)=>[[`${n}.leader.firstName`,e("pr_nom_du_respo_18803")],[`${n}.leader.lastName`,e("nom_du_responsa_41401")],[`${n}.leader.email`,e("e_mail_du_respo_05575")],[`${n}.leader.phone`,e("t_l_phone_du_re_17756")]],qc=(e,n)=>[[`${n}.firstName`,e("pr_nom_66988")],[`${n}.lastName`,e("Name")],[`${n}.name`,e("full_name")],[`${n}.email`,e("e_mail_13869")]],Hc=(e,n,t)=>[[`${n}.name`,e("_1_mission_16896",t)],[`${n}.range`,e("_1_cr_neau_99218",t)],[`${n}.dateLong`,e("_1_jour_62088",t)],[`${n}.slot.startTime`,e("_1_heure_de_20695",t)],[`${n}.slot.endTime`,e("_1_heure_de_70993",t)]],Yc=(e,n,t)=>[[`${n}.name`,e("_1_accr_dita_60981",t)],[`${n}.fullName`,e("_1_accr_dita_89325",t)],[`${n}.dateLong`,e("_1_jour_62088",t)]],Zc=e=>[["user.localId",e("id_sur_l_v_nem_01171")],["user.ticketId",e("num_ro_de_bille_41680")],["user.memberCode",e("code_membre_wee_67463")],["user.profile",e("profil_d_accr_d_02274")],["user.profileCategory",e("cat_gorie_du_pr_95638")],["user.qrcode",e("qr_code_du_bill_78196")]],Kc=(e,n,t,i)=>{switch(n){case"user":return[["user",[...qc(e,"user"),["user.id",e("id_du_membre_81110")],["user.organizationLocalId",e("id_sur_l_organi_45566")],["user.registrationDate",e("date_d_inscript_31369")],["user.registrationDatetime",e("date_et_heure_d_83806")],...i.has("userRegistration")?Zc(e):[],...Wc("user",t.usersCustomFields)]]];case"userRegistration":return[["user",Zc(e)]];case"userDelegation":return[["userDelegation",[["user.delegation.name",e("nom_de_la_d_l_g_28087")],...Gc(e,"user.delegation"),["user.delegation.spaceLink",e("lien_vers_l_esp_12557")]]]];case"userDocuments":return[["userDocuments",[["user.documents.assignments",e("Assignments")],["user.documents.planning",e("planning_63989")],["user.documents.planningList",e("planning_liste_09911")],["user.documents.planningDays",e("planning_par_j_55733")],["user.documents.badge",e("Badge")],["user.documents.certificate",e("attestation_de_92734")],...(t.customBadges??[]).map(({slug:e,name:n})=>[`user.documents.${e.toLowerCase()}`,n]),...Wc("user.documents",t.customDocuments)]]];case"event":return[["event",[["event.name",e("nom_de_l_v_nem_08711")],["event.id",e("id_de_l_v_neme_12637")],["event.startDate",e("date_de_d_but_43380")],["event.endDate",e("date_de_fin_86920")],...Wc("event",t.eventsCustomFields)]]];case"organization":return[["organization",[["organization.name",e("nom_de_l_organi_49583")],["organization.id",e("id_de_l_organis_81753")]]]];case"delegation":return[["delegation",[["delegation.name",e("nom_de_la_d_l_g_28087")],["delegation.id",e("id_de_la_d_l_ga_42888")],["delegation.category.name",e("cat_gorie_de_la_03242")],...Gc(e,"delegation"),["delegation.formLink",e("lien_vers_le_fo_15097")],["delegation.spaceLink",e("lien_vers_l_esp_12557")],...Wc("delegation",t.delegationsCustomFields)]]];case"recipient":return[["recipient",qc(e,"recipient")]];case"invitedBy":return[["invitedBy",qc(e,"invitedBy")]];case"assignments":{const n=e("Mission n°1");return[["assignments",[["positions",e("missions_63972")],["positionsCategories",e("cat_gories_de_m_55263")],["assignmentsDays",e("jours_d_affecta_53288")],["volunteerHours",e("heures_affect_e_34870")],["volunteerMinutes",e("minutes_affect_59494")],...Hc(e,"user.firstAssignment",e("premi_re_affect_52057")),...Hc(e,"user.lastAssignment",e("derni_re_affect_67044")),["user.positions.1.name",e("_1_nom_24701",n)],["user.positions.1.category.name",e("_1_cat_gorie_86762",n)],["user.positions.1.firstSlot.range",e("_1_premier_c_18598",n)],["user.positions.1.lastSlot.range",e("_1_dernier_c_73972",n)]]]]}case"accreditations":{const n=e("accr_ditation_n_26840");return[["accreditations",[["accreditationsText",e("accr_ditations_39450")],["accreditationsCategories",e("cat_gories_d_ac_73496")],["accreditationsSlots",e("cr_neaux_d_accr_44687")],["accreditationsDates",e("dates_des_accr_21145")],["accreditations.nodate",e("accr_ditations_34318")],["accreditationsSlots.nodate",e("cr_neaux_d_accr_82388")],...Yc(e,"user.firstAccreditationSlot",e("premier_cr_neau_83376")),...Yc(e,"user.lastAccreditationSlot",e("dernier_cr_neau_48142")),["user.accreditations.1.name",e("_1_nom_24701",n)],["user.accreditations.1.category.name",e("_1_cat_gorie_86762",n)],["user.accreditations.1.firstSlot.dateLong",e("_1_premier_j_44492",n)],["user.accreditations.1.lastSlot.dateLong",e("_1_dernier_j_85172",n)]]]]}case"preassign":return[["preassign",[["preassignPositions",e("missions_pr_af_02950")],["preassignCategories",e("cat_gories_pr_83825")]]]];case"wishes":return[["wishes",[["wishedPositions",e("missions_souhai_23225")],["wishedSlots",e("disponibilit_s_49923")],["wishedAccreditations",e("accr_ditations_74375")],["wishedAccreditationsDates",e("dates_des_accr_59339")]]]];case"assignmentsBlocks":return[["blocks",[["assignments",e("d_tail_des_affe_15729")],["assignmentsLight",e("d_tail_all_g_d_60251")]]]];case"accreditationsBlock":return[["blocks",[["accreditations",e("d_tail_des_accr_36727")]]]];case"formLink":return[["links",[["formLink",e("lien_vers_le_fo_15097")]]]];case"delegationsSpaceLink":return[["links",[["delegationsSpaceLink",e("lien_vers_l_esp_12557")]]]];case"eventUnregister":return[["links",[["user.eventUnregister",e("lien_de_d_sinsc_39363")],["user.accreditationsUnregister",e("lien_de_retrait")]]]];case"emailUnregister":return[["links",[["user.emailUnregister",e("lien_de_d_sabon_98323")]]]];case"teamInvite":return[["email",[["invitedBy",e("pr_nom_du_chef_64060")],["teamCode",e("code_de_l_quip_63602")]]]];case"loginCode":return[["email",[["code",e("code_de_connexi_57121")]]]];case"positionLeader":return[["email",[["position.name",e("Position")]]]];case"categoryLeader":return[["email",[["category.name",e("cat_gorie_00291")]]]]}};function Xc(e,n){const t=["userRegistration","userDelegation"];return["user","userDocuments",...n?["event"]:[],"organization",...n?["eventUnregister"]:[],...(()=>{switch(e){case ln.Campaign:return[...t,"delegation","recipient",...n?["assignments","accreditations","assignmentsBlocks","accreditationsBlock"]:[],"preassign","wishes","formLink","delegationsSpaceLink","emailUnregister"];case ln.VolunteerRegistration:return[...t,"delegation"];case ln.FormSubmit:return[...t,"delegation","assignments","accreditations","wishes","assignmentsBlocks","accreditationsBlock","formLink"];case ln.Assignments:return[...t,"delegation","assignments","preassign","wishes","assignmentsBlocks"];case ln.Refused:case ln.AccreditationsRefused:return[...t,"delegation","wishes"];case ln.Accreditations:return[...t,"delegation","accreditations","wishes","accreditationsBlock"];case ln.FormInvite:return["wishes","formLink","teamInvite"];case ln.DelegationFormInvite:return["userDelegation","delegation","invitedBy"];case ln.DelegationLeaderAssign:return[...t,"delegation","formLink","delegationsSpaceLink"];case ln.DelegationCategoryLeaderAssign:return[...t,"delegation","categoryLeader"];case ln.PositionLeaderAssign:return["positionLeader"];case ln.PositionCategoryLeaderAssign:return["categoryLeader"];case ln.Code:return["loginCode"];default:return[]}})()]}const Qc=["user.qrcode"];function Jc(e){return e.filter(({group:e,key:n})=>"blocks"!==e&&!Qc.includes(n))}function eu(e,n){const t=b(n).split(/\s+/).filter(e=>e.length>0);return n.includes("}")?[]:0===t.length?e:e.filter(e=>{const n=b(`${e.label} ${e.groupLabel} ${e.key}`);return t.every(e=>n.includes(e))})}function nu(e){return e.map((n,t)=>({id:`{${n.key}}`,text:`{${n.key}}`,variable:n,isFirstOfGroup:e[t-1]?.group!==n.group}))}const tu=(e,n)=>{const t=document.createElement("span");return t.className=e,void 0!==n&&(t.textContent=n),t},iu=/[\s\p{Ps}\p{Pi}"']/u;function su(e,n){const t=e.slice(0,n),i=t.lastIndexOf("\n")+1,s=t.lastIndexOf("{");if(si&&!iu.test(t.charAt(s-1))?null:{start:s,query:o}}function ou({variables:e,onChange:n}){const t=(0,de.useId)(),[i,s]=(0,de.useState)(null),[o,a]=(0,de.useState)(null),[r,d]=(0,de.useState)(0),l=(0,de.useRef)(null),c=(0,de.useMemo)(()=>e&&o?nu(eu(e,o.query)):[],[e,o]),u=c.length>0,m=Math.min(r,Math.max(c.length-1,0)),g=(0,de.useCallback)(e=>`${t}-${e}`,[t]);(0,de.useEffect)(()=>{d(0)},[o]);const h=(0,de.useCallback)(()=>{a(null)},[]),p=(0,de.useCallback)(n=>{if(!e)return;const t=n.selectionStart,i=null!==t&&t===n.selectionEnd?su(n.value,t):null;s(n),i?.start!==l.current&&(l.current=null),i&&i.start!==l.current?a(e=>e?.start===i.start&&e.query===i.query?e:i):a(null)},[e]),I=(0,de.useCallback)(e=>{const t=c[e];if(!i||!t)return;const s=function(e,n,t){const i=su(e,n);if(i){const s=`{${t}}`;return{text:e.slice(0,i.start)+s+e.slice(n),caret:i.start+s.length}}return{text:e,caret:n}}(i.value,i.selectionStart??i.value.length,t.variable.key);a(null),n(s.text),requestAnimationFrame(()=>{i.focus(),i.setSelectionRange(s.caret,s.caret)})},[i,c,n]),f=(0,de.useCallback)(e=>{if(!u)return!1;switch(e.key){case"ArrowDown":d((m+1)%c.length);break;case"ArrowUp":d((m-1+c.length)%c.length);break;case"Enter":case"Tab":I(m);break;case"Escape":l.current=o?.start??null,a(null);break;default:return!1}return e.preventDefault(),e.stopPropagation(),!0},[u,c.length,I,m,o]);return{activeIndex:m,element:i,isOpen:u,items:c,listId:t,inputProps:e?{"aria-activedescendant":u?g(m):void 0,"aria-autocomplete":"list","aria-controls":u?t:void 0,"aria-expanded":u,role:"combobox"}:{},getOptionId:g,close:h,onKeyDown:f,pick:I,setActiveIndex:d,update:p}}var au=t(4743),ru=t(7663);const du=({completion:e})=>{const{activeIndex:n,element:t,getOptionId:s,isOpen:o,items:a,listId:r,pick:d,setActiveIndex:l}=e,[c,u]=(0,de.useState)(null),{floatingStyles:m}=(0,au.we)({elements:{reference:t,floating:c},placement:"bottom-start",middleware:[(0,au.cY)(12),(0,au.UU)(),(0,au.BN)()],whileElementsMounted:ru.ll});return(0,de.useEffect)(()=>{o&&document.getElementById(s(n))?.scrollIntoView?.({block:"nearest"})},[o,n,s]),o&&t?(0,hd.createPortal)((0,i.jsx)(Zr,{ref:u,css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$lg",maxHeight:"300px",maxWidth:"420px",minWidth:"240px",overflowY:"auto",py:"$1",zIndex:"1000"},style:m,id:r,role:"listbox",onMouseDown:e=>{e.preventDefault()},children:a.map((e,t)=>(0,i.jsxs)(de.Fragment,{children:[e.isFirstOfGroup&&(0,i.jsx)(Zr,{css:{borderTop:0===t?"none":"1px solid $gray100",color:"$gray500",cursor:"default",fontSize:"$textXs",fontWeight:"$semiBold",padding:"$2 $3 $1"},role:"presentation",children:e.variable.groupLabel}),(0,i.jsxs)(Zr,{"aria-selected":t===n,css:{alignItems:"baseline",background:t===n?"$primary100":void 0,color:t===n?"$primary700":"$gray800",cursor:"pointer",display:"flex",gap:"$4",justifyContent:"space-between",padding:"$2 $3"},id:s(t),role:"option",onClick:()=>{d(t)},onMouseEnter:()=>{l(t)},children:[(0,i.jsx)(Zr,{css:{fontSize:"$textSm",whiteSpace:"nowrap"},children:e.variable.label}),(0,i.jsx)(Zr,{css:{color:"$gray500",fontSize:"$textXs",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.variable.key})]})]},e.id))}),document.body):null},lu=({children:e,id:n})=>e?(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",id:n,children:e}):null,cu=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,uu=({id:e,children:n,htmlFor:t,isClickable:s=!0})=>n?(0,i.jsx)("label",{htmlFor:t,id:e,style:{display:"block",cursor:"inherit",fontWeight:"$medium",marginBlockEnd:0},onClick:e=>{s||e.preventDefault()},children:(0,i.jsx)(Zr,{color:"gray700",fontWeight:"medium",children:n})}):null,mu=Nr("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 $primaryCustom500"},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"}}),gu=(0,de.forwardRef)(({height:e,cursor:n,css:t,icon:s,children:o,state:a,onClick:r,rightIcon:d,rightText:l,onRightIconClick:c,...u},m)=>(0,i.jsxs)(mu,{ref:m,className:"h-styled-input-container",css:t,cursor:n,height:e,state:a,onClick:e=>{r?.(e)},...u,children:[s&&(0,i.jsx)(Xl,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(pc,{icon:s})}),o,"error"===a&&(0,i.jsx)(Xl,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(pc,{icon:"circle-exclamation"})}),d&&(0,i.jsx)(Xl,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(pc,{icon:d})}),w(l)&&(0,i.jsx)(Zr,{css:{userSelect:"none"},font:"gray500 textSm regular",children:l})]}));gu.displayName="StyledInputContainer";const hu=(0,de.forwardRef)(({autoComplete:e,isEmail:n,shouldParseAsInt:t,css:s,label:o,description:a,hint:r,onRightIconClick:d,state:l,type:c,onChange:u,rightIcon:m,rightText:g,icon:h,treatIntNaNAsNull:p,variables:I,onBlur:f,onKeyDown:x,onSelect:_,...j},v)=>{const S=(0,de.useRef)(),y=(0,de.useRef)(),C=v??y,{inputId:b,descId:A,errorId:E}=Vc(),$=ou({variables:I,onChange:u});return(0,i.jsxs)(Xl,{ref:S,css:s,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:b,children:o}),(0,i.jsx)(lu,{id:A,children:a}),(o||a)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"text",icon:h,rightIcon:m,rightText:g,state:l,onClick:()=>C.current?.focus(),onRightIconClick:e=>{Uc(e),d?.(e)},children:(0,i.jsxs)(Zr,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%","&:disabled":{color:"$gray500"}},"& input::placeholder":{color:"search"===l?"$gray400":"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"search"===l?"$gray400":"$gray500",opacity:1}},children:[(0,i.jsx)("input",{ref:C,"aria-describedby":a?A:void 0,"aria-errormessage":"error"===l?E:void 0,"aria-invalid":"error"===l,autoComplete:e??"off",disabled:"disabled"===l,id:b,type:c??(n?"email":t?"number":"text"),onChange:e=>{if(n&&w(e.target.value))u(e.target.value.toLowerCase());else if(!0===t){const n=parseInt(e.target.value,10);isNaN(n)?u(p?null:0):u(n)}else u(e.target.value);$.update(e.currentTarget)},onSelect:e=>{$.update(e.currentTarget),_?.(e)},onKeyDown:e=>{$.onKeyDown(e)||x?.(e)},onBlur:()=>{$.close(),f?.()},...j,...$.inputProps}),(0,i.jsx)(du,{completion:$})]})}),(0,i.jsx)(cu,{id:E,state:l,children:r})]})});hu.displayName="TextInput";const pu=({autoComplete:e,hint:n,shouldParseAsInt:t,name:s,state:o,...a})=>{const r=(0,de.useCallback)(e=>{switch(e){case fn.City:return"address-level1";case fn.DateOfBirth:return"bday";case fn.FirstName:return"given-name";case fn.LastName:return"family-name";case fn.PostalCode:return"postal-code";case fn.Street:return"street-address";case fn.Country:case fn.Language:case fn.Nationality:case fn.Phone:case fn.Picture:case fn.Sex:default:return}},[]),d=(0,de.useMemo)(()=>s.startsWith("formRegister.userInfo.fields.")?r(s.split(".").pop())??e:e,[s,e,r]),l=(0,de.useCallback)(e=>{const s=Lc(e.meta);return(0,i.jsx)(hu,{autoComplete:d,hint:s?e.meta.error||e.meta.submitError:n,shouldParseAsInt:t??!1,state:s?"error":o,value:e.input.value,onBlur:e.input.onBlur,onChange:n=>{e.input.onChange(n)},onFocus:e.input.onFocus,...a})},[n,t,o,d,a]);return(0,i.jsx)(ld.D0,{name:s,parse:Nc.A,render:l})},Iu={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",ACCREDITATIONS_IMPORT_FORMATS:"heavent-accreditations-import-formats",ACCREDITATIONS_IMPORT_MAPPINGS:"heavent-accreditations-import-mappings",ACCREDITATIONS_IMPORT_MODE:"heavent-accreditations-import-mode",ACCREDITATIONS_IMPORT_PRESETS:e=>`heavent-accreditations-import-presets-${e}`,ACCREDITATIONS_PROFILES_IMPORT_FORMATS:"heavent-accreditations-profiles-import-formats",ACCREDITATIONS_PROFILES_IMPORT_MAPPINGS:"heavent-accreditations-profiles-import-mappings",ACCREDITATIONS_PROFILES_IMPORT_MODE:"heavent-accreditations-profiles-import-mode",ACCREDITATIONS_PROFILES_IMPORT_PRESETS:e=>`heavent-accreditations-profiles-import-presets-${e}`,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"};var fu;let xu=class{translationService;constructor(e){this.translationService=e}t(e,...n){return this.translationService.translate(e,...n)}};xu=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(fu=void 0!==ts&&ts)?fu:Object])],xu);var _u;let ju=class extends xu{translationService;constructor(e){super(e),this.translationService=e}oneOfMessage(e,n){return this.t("_1_doit_tre_70659",e,this.translationService.formatListValues(n.map(e=>this.t(e))))}};ju=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(_u=void 0!==ts&&ts)?_u:Object])],ju);var vu;function Su(e){return"string"==typeof e&&e.length>=16}function yu(e){return"string"==typeof e&&null!==e.match(/\d/)}function Cu(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function bu(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let Au=class extends ju{constructor(e){super(e)}signInSchema(){return Jl.Ik().shape({email:this.email()})}signInPasswordSchema(){return Jl.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return Jl.Ik().shape({code:this.code()})}emailSchema(){return Jl.Ik().shape({email:this.email()})}emailConfirmSchema(){return Jl.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return Jl.Ik().shape({email:this.email(),code:this.code()})}email(){return Jl.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return Jl.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 Jl.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return Jl.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return Jl.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return Su(this.parent.password)&&yu(this.parent.password)&&Cu(this.parent.password)&&bu(this.parent.password)})}};Au=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(vu=void 0!==ts&&ts)?vu:Object])],Au);var Eu;let wu=class extends Au{constructor(e){super(e)}step1Schema(){return Jl.Ik().shape({email:this.email()})}step2Schema(){return Jl.Ik().shape({email:this.email(),code:this.code()})}};wu=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Eu=void 0!==ts&&ts)?Eu:Object])],wu);var $u,Tu,zu,Ou=t(2302);function Ru(){return Ru=Object.assign?Object.assign.bind():function(e){for(var n=1;n(0,i.jsxs)(Xl,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(Du,{})}),(0,i.jsxs)(Xl,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(Xl,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(Xl,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(ic,{height:"7"})]}),ku=e=>(0,i.jsx)(Xl,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),Fu=e=>{const n=os(),t=cs(),s=ms(),o=ss(ec),a=ss(wu),{mutate:r}=function(e={}){return ds("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n insertedAt\n }\n}\n",e)}(),[d,l]=(0,de.useState)(null),[c,u]=(0,de.useState)(0),[m,g]=(0,de.useState)(0),[h,p]=(0,de.useState)(!1),[I,f]=(0,de.useState)(Date.now());return(0,i.jsx)(Pu,{link:(0,i.jsxs)(ku,{children:[(0,i.jsx)(Zr,{color:"gray500",children:n("vous_n_avez_pas_69078")}),(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(Wo.AUTH_SIGN_IN_EMAIL)},children:n("r_essayer_21582")})]}),children:(0,i.jsx)(Fc,{direction:"column",initialValues:{email:s.getItem(Iu.AUTH_EMAIL)||"",code:""},render:({handleSubmit:t,submitting:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("se_connecter_av_59438")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("saisissez_votre_01613")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(pu,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:c>0||h?"disabled":"active"}),c>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{autoComplete:"one-time-code",inputMode:"numeric",label:n("code_20843"),name:"code",pattern:"\\d*",placeholder:n("code_20843"),state:h?"disabled":void 0})]}),(0,i.jsx)(ic,{height:"6"}),h?(0,i.jsx)(yc,{textAlign:"center",onClick:e.onFailure,children:n("recommencer_14712")}):(0,i.jsx)(yc,{isLoading:s,textAlign:"center",onClick:t,children:n(0===c?"recevoir_le_cod_88633":"se_connecter_63820")})]}),validate:e=>0===c?o.validateForForm(a.step1Schema())(e):o.validateForForm(a.step2Schema())(e),width:1,onSubmit:async t=>{if(0!==c){const{user:i,callbacks:s}=d;return function({code:e,user:n,callbacks:t}){return new Promise((i,s)=>{n.sendCustomChallengeAnswer(e,{...t,onSuccess:(...e)=>{t.onSuccess(...e),i(e)},onFailure:e=>{t.onFailure(e),s({type:"FAILED",error:e})},customChallenge:(...e)=>{t.customChallenge&&t.customChallenge(...e),s({type:"RETRY"})}})}).then(([e])=>e.getIdToken().getJwtToken())}({code:t.code,user:i,callbacks:s}).then(e.onSuccess,e=>{if("RETRY"===e.type)return g(m+1),{code:n("le_code_n_est_p_95065",3-(m+1))};{let i;return function(e,n,t){!async function(e){await fetch(`${ee.HEAVENT_API_URL}/log/report`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}({message:"Could not auth",errorMessage:e,email:n,location:location.href,diff:Math.round((Date.now()-t)/1e3),userAgent:navigator.userAgent})}(e.message,t.email,I),p(!0),i=Jo.dw.fromMillis(Date.now()-I).as("minutes")>3?n("le_code_a_expir_45975"):n("le_code_n_est_p_12317"),{FORM_ERROR:i}}})}{await r({loginCodeEmail:{email:t.email,source:On.App}}),f(Date.now());const e=await async function(e,n,t){try{return await je(e,n,t)}catch(i){if(i!==ge)throw i;try{return await xe(e,ce().toString()),await je(e,n,t)}catch{throw new Error("Auth failure")}}}(t.email,Ou.A,Ou.A);l(e),u(1)}}})})},Nu=(0,de.forwardRef)(({css:e,hint:n,description:t,icon:s,state:o,onChange:a,label:r,onForgotPasswordClick:d,...l},c)=>{const u=os(),m=(0,de.useRef)(),[g,h]=(0,de.useState)("password"),{inputId:p,descId:I,errorId:f}=Vc();return(0,i.jsxs)(Xl,{ref:m,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),m.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(Xl,{gap:"3",width:1,children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(uu,{htmlFor:p,children:r})}),"function"==typeof d&&(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{d?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)(lu,{id:I,children:t}),(r||t)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"text",icon:s,rightIcon:"password"===g?"eye":"eye-slash",state:o,onRightIconClick:e=>{Uc(e),h("password"===g?"text":"password")},children:(0,i.jsx)(Zr,{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":t?I:void 0,"aria-errormessage":"error"===o?f:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:p,type:g,onChange:e=>{a(e.target.value)},...l})})}),(0,i.jsx)(cu,{id:f,state:o,children:n})]})});Nu.displayName="PasswordInput";const Lu=({name:e,autoComplete:n,hint:t,state:s,...o})=>(0,i.jsx)(ld.D0,{name:e,render:a=>{const r=Lc(a.meta);return(0,i.jsx)(Nu,{autoComplete:n??"current-password",hint:r?a.meta.error:t,name:e,state:r?"error":s,value:a.input.value,onBlur:a.input.onBlur,onChange:e=>{a.input.onChange(e)},onFocus:a.input.onFocus,...o})}});var Uu;let Vu=class extends Au{constructor(e){super(e)}step1Schema(){return Jl.Ik().shape({email:this.email()})}step2Schema(){return Jl.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};Vu=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Uu=void 0!==ts&&ts)?Uu:Object])],Vu);const Bu=Nr("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"}}}}),Wu=(0,de.forwardRef)((e,n)=>{const t={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(t.height=Mr(e.height)),e.width&&(t.width=Mr(e.width)),(0,i.jsx)(Bu,{role:"grid",...e,ref:n,css:{...t,...e.css}})});Wu.displayName="Grid";const Gu=e=>(0,i.jsxs)(Xl,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(Xl,{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)(pc,{icon:"check"})}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:e.children})]}),qu=e=>{const n=os();return(0,i.jsxs)(Wu,{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)(Gu,{isValid:Su(e.password),children:n("16_caract_res_m_52434")}),(0,i.jsx)(Gu,{isValid:yu(e.password),children:n("au_moins_un_chi_73862")}),(0,i.jsx)(Gu,{isValid:Cu(e.password),children:n("au_moins_une_ma_58302")}),(0,i.jsx)(Gu,{isValid:bu(e.password),children:n("au_moins_un_car_54396")})]})},Hu=e=>{const n=os(),t=cs(),s=ms(),o=ss(ec),a=ss(Vu),[r,d]=(0,de.useState)(0);return(0,i.jsx)(Pu,{link:(0,i.jsxs)(ku,{children:[(0,i.jsx)(Zr,{color:"gray500",children:n("vous_n_avez_pas_69078")}),(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(Wo.AUTH_SIGN_IN_EMAIL)},children:n("r_essayer_21582")})]}),children:(0,i.jsx)(Fc,{direction:"column",initialValues:{email:s.getItem(Iu.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:t,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("mot_de_passe_ou_17690")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("saisissez_votre_47959")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(pu,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:r>0?"disabled":"active"}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{autoComplete:"one-time-code",inputMode:"numeric",label:n("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:n("code_20843")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Lu,{autoComplete:"new-password",label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(qu,{password:s.password})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(yc,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_88633":"r_initialiser_l_12900")})]}),validate:e=>0===r?o.validateForForm(a.step1Schema())(e):o.validateForForm(a.step2Schema())(e),width:1,onSubmit:async n=>{0===r?(await Se(n.email),d(1)):e.onSuccess(await ye(n.email,n.code,n.password))}})})},Yu={Aso:{Aso:t(8301),HomeBackground:t(8144),Logo:t(0)},Blanks:{Accreditation:t(7008),Member:t(5594)},Maps:{GooglePlan:t(1416),GoogleSatellite:t(6954),IgnPlan:t(4025)},AvatarGroup:t(384),Background404:t(4236),FormPositionRanked:t(4628),FormPositionUnranked:t(1205),Google:t(1931),GoogleMaps:t(1446),Ign:t(9882),Login:t(2647),Login2x:t(2281),LogoWeezeventSquare:t(6041),NetflixWood:t(5095),UserProfile:t(8264),WeezConstruction:t(6400)},Zu={Alert:t(2630),Check:t(3780),DnsBlank:t(1037),DnsWrongDomain:t(8184),Done:t(8652),Done2:t(3574),FileBlank:t(7619),FileCSV:t(2006),FileJPG:t(6751),FilePDF:t(9848),FilePNG:t(6959),FileZIP:t(539),RecrewteerMarker:t(8798),Sad:t(5376),WeezeventBlankHandGlobe:t(2599),WeezeventBlankMessages:t(6687),WeezeventBlankPerson:t(7648),WeezeventBlankSwissArmyKnife:t(4362)};var Ku=t(7480);const Xu=h([gt.De,gt.En,gt.Es,gt.Fr,gt.Nl]);function Qu(e){return e===gt.En?"en-gb":e.toString().toLowerCase()}function Ju(e){if(w(e)){const n=(0,Ku.A)(e.trim().substring(0,2));return Xu.includes(n)?n:null}return null}function em(e,n){return n.has("lang")?Ju(n.get("lang"))||gt.En:e||Ju(navigator.language)||gt.En}gt.En.toLowerCase(),gt.Fr.toLowerCase(),gt.De.toLowerCase(),gt.Es.toLowerCase(),gt.Nl.toLowerCase();const nm=ee.EMAIL_FROM_NAME,tm=(ee.EMAIL_PICTURE_LINK,ee.EMAIL_FROM);function im(e){return e===gt.Fr?`${ee.HEAVENT_ASSETS_URL}/cgu/weezcrew-cgus-fr.pdf`:e===gt.Nl?`https://${ee.WEEZEVENT_DOMAIN}/nl/gebruiksvoorwaarden-diensten`:e===gt.Es?`https://${ee.WEEZEVENT_DOMAIN}/es/cgus`:`https://${ee.WEEZEVENT_DOMAIN}/en-gb/terms-of-use`}const sm=e=>{const{translate:n,history:t}=fc(),s=ss(Au),o=ss(ec),a=ms(),r=im(em(null,new URL(location.href).searchParams));return(0,i.jsx)(Pu,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ku,{children:[(0,i.jsx)(Zr,{color:"gray500",children:n("pas_encore_sur_13386")}),(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{t.push(Wo.AUTH_SIGN_UP_CREDENTIALS)},children:n("ouvrez_un_compt_91337")})]}),(0,i.jsx)(ku,{children:(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(r,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Fc,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("ravi_de_vous_re_24368")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("identifiez_vous_57743")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(pu,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Lu,{label:n("mot_de_passe_41738"),name:"password",placeholder:n("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{a.setItem(Iu.AUTH_EMAIL,o.email),t.push(Wo.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(yc,{isLoading:s,textAlign:"center",onClick:e,children:n("se_connecter_63820")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{a.setItem(Iu.AUTH_EMAIL,o.email),t.push(Wo.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"envelope"})}),(0,i.jsx)(Zr,{color:"gray700",children:n("se_connecter_av_59438")})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=Mu("Google")},children:[(0,i.jsx)(Zr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:Yu.Google})}),(0,i.jsx)(Zr,{color:"gray700",children:n("se_connecter_av_86208")})]})]}),validate:e=>o.validateForForm(s.signInPasswordSchema())(e),width:1,onSubmit:async t=>{try{return e.onSuccess(await ve(t.email,t.password)),{}}catch(e){const{code:t,message:i}=e??{};if("NotAuthorizedException"===t&&"Incorrect username or password."===i||"UserNotFoundException"===t&&"User does not exist."===i)return{email:n("adresse_e_mail_73393")};throw e}}})})};var om;let am=class extends Au{constructor(e){super(e)}step1Schema(){return Jl.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return Jl.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};am=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(om=void 0!==ts&&ts)?om:Object])],am);const rm=e=>{const{history:n,translate:t}=fc(),s=ss(ec),o=ss(am),[a,r]=(0,de.useState)(0),d=im(em(null,new URL(location.href).searchParams));return(0,i.jsx)(Pu,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ku,{children:[(0,i.jsx)(Zr,{color:"gray500",children:t("vous_avez_d_j_26391")}),(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{n.push(Wo.AUTH_SIGN_IN_EMAIL)},children:t("connectez_vous_14760")})]}),(0,i.jsx)(ku,{children:(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},onClick:()=>{window.open(d,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(ld.lV,{initialValues:{email:"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:s})=>(0,i.jsxs)("form",{style:{width:"100%"},onSubmit:e,children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("cr_er_un_compte_71423")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:t("utilisez_recrew_64841")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(pu,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:a>0?"disabled":"active"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Lu,{label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874"),state:a>0?"disabled":"active"}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(qu,{password:s.password}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{autoComplete:"one-time-code",inputMode:"numeric",label:t("code_re_u_par_e_75150"),name:"code",pattern:"\\d*",placeholder:t("code_20843")})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(yc,{isLoading:n,textAlign:"center",onClick:e,children:t(0===a?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=Mu("Google")},children:[(0,i.jsx)(Zr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:Yu.Google})}),(0,i.jsx)(Zr,{color:"gray700",children:t("s_inscrire_avec_54027")})]})]}),validate:e=>0===a?s.validateForForm(o.step1Schema())(e):s.validateForForm(o.step2Schema())(e),onSubmit:async n=>{0===a?(await Se(n.email),r(1)):e.onSuccess(await ye(n.email,n.code,n.password))}})})},dm=async e=>{await xa(wa,{token:e}),window.location.href=Wo.HOME},lm=e=>{e&&fs("Auth failure",e),window.location.href=Wo.AUTH_SIGN_IN},cm=()=>(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(Hu,{onSuccess:dm})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(sm,{onSuccess:dm})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(Fu,{onFailure:lm,onSuccess:dm})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(rm,{onSuccess:dm})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(gs,{path:Wo.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.AUTH_SIGN_IN_EMAIL})})]}),um=e=>((0,de.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",{})})),mm=()=>{const[,e]=location.search.substr(1).split("="),{data:n,loader:t}=rs("query Tokens($code: String!) {\n userTokens(code: $code) {\n accessToken\n idToken\n refreshToken\n email\n }\n}\n",{code:e},[],undefined);return(0,i.jsx)(um,{loader:t,onLoad:()=>{!function(e){const n=new le.p4({IdToken:new le.Yw({IdToken:e.idToken}),RefreshToken:new le.c9({RefreshToken:e.refreshToken}),AccessToken:new le.pD({AccessToken:e.accessToken})}),t=e.email.trim().toLowerCase();new le.TU({Username:t,Pool:pe()}).setSignInUserSession(n)}(n.userTokens),window.location.href=Wo.HOME}})},gm="www.partagetapassion.com",hm="registering.aso.fr",pm="billets.onepiecemarket.fr",Im=new Map([[1792,"evenements.handicap-international.fr"],[858,gm],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,hm],[3469,pm]]);function fm(e){(0,de.useEffect)(()=>{const n=document.title;return document.title=(t=location.host,`${w(i=e)?`${i} | `:""}${function(e){return e===gm?"Partage Ta Passion":e===pm?"One Piece":e===hm?"A.S.O.":nm}(t)}`),()=>{document.title=n};var t,i},[e])}function xm(e,n){const t=(0,de.useCallback)(e,n||[]);(0,de.useEffect)(()=>(document.addEventListener("click",t,!1),()=>{document.removeEventListener("click",t,!1)}),n||[])}function _m(e){const n=(0,de.useCallback)(n=>{"Esc"!==n.key&&"Escape"!==n.key||e()},[]);(0,de.useEffect)(()=>(document.addEventListener("keydown",n,!1),()=>{document.removeEventListener("keydown",n,!1)}),[])}const jm="h-dropdown-open";function vm(e,n){e.dispatchEvent(new CustomEvent(jm,{bubbles:!0,detail:{uuid:n??""}}))}const Sm=(0,de.createContext)({}),ym=e=>{const n=(0,de.useRef)(ce()),[t,s]=(0,de.useState)(e.isOpen??!1),[o,a]=(0,de.useState)(null),[r,d]=(0,de.useState)(null),l=(0,de.useCallback)(t=>{e.disabled||(s(t),e.onStateChange&&e.onStateChange(t),!0===t&&o&&vm(o,n.current))},[e.disabled,o,s,e.onStateChange]),c=(0,de.useCallback)(t=>{t.detail.uuid!==n.current&&!0!==e.doNotCloseOnOtherOpen&&l(!1)},[l]);return(0,de.useEffect)(()=>{e.isOpen!==t&&s(e.isOpen??!1)},[e.isOpen]),(0,de.useEffect)(()=>(document.addEventListener(jm,c),()=>{document.removeEventListener(jm,c)}),[c]),_m(()=>{l(!1)}),xm(()=>{l(!1)}),(0,i.jsx)(Sm.Provider,{value:{isOpen:t,referenceElement:o,popperElement:r,setIsOpen:l,setReferenceElement:a,setPopperElement:d},children:e.children})};function Cm(){return(0,de.useContext)(Sm)}const bm=Nr("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:"$primary500"}},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"}}),Am=({children:e,color:n,css:t,download:s,to:o,onClick:a,target:r,role:d})=>"disabled"!==n&&o?(0,i.jsx)(gc,{download:s,target:r,to:o,onClick:e=>a?.(e),children:(0,i.jsx)(bm,{color:n||"default",css:t,children:e})}):(0,i.jsx)(bm,{color:n||"default",css:t,role:d??"menuitem",tabIndex:o?void 0:"presentation"!==d?0:void 0,onClick:e=>a?.(e),children:e}),Em=({css:e,children:n,color:t,download:s,icon:o,isDisabled:a=!1,onClick:r,to:d,target:l})=>(0,i.jsx)(Am,{color:t,css:{cursor:a?"not-allowed":"pointer",opacity:a?"0.6":"inherit",...e},download:s,target:l,to:d,onClick:e=>{a||(vm(e.target),r?.(e))},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Xl,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(pc,{icon:o})}),(0,i.jsx)(Zr,{css:{flex:"1",ellipsis:""},children:n})]})}),wm=e=>{const{isOpen:n,referenceElement:t,popperElement:s,setPopperElement:o}=Cm(),{floatingStyles:a}=(0,au.we)({elements:{reference:t,floating:s},placement:e.placement,middleware:[(0,au.cY)(e.offset??8),(0,au.UU)(),(0,au.BN)()],whileElementsMounted:ru.ll}),r="match"===e.width?`${t?.getBoundingClientRect().width??240}px`:"number"==typeof e.width?`${e.width}px`:"fit-content",d=(0,i.jsx)(Xl,{ref:o,"aria-hidden":!n,"aria-orientation":e["aria-orientation"],css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$lg",display:n?"flex":"none",maxHeight:e.maxHeight?`${e.maxHeight}px`:void 0,overflowX:"hidden",overflowY:"auto",py:"$2",width:r,zIndex:"400",...e.css,...a,"&:empty":{opacity:0}},direction:"column",id:e.id,role:"menu",onClick:e=>Uc(e,!1),tabIndex:-1,children:e.children});return n?e.renderOnPortal?(0,hd.createPortal)(d,document.body):d:null},$m=e=>{const{isOpen:n,setIsOpen:t,setReferenceElement:s}=Cm(),o=e.children,a=e=>{Uc(e),t(!n),o.props.onClick?.(e)},r=(0,de.cloneElement)(de.Children.only(o),{ref(e){s(e)},onClick(e){e.preventDefault(),a(e)},onKeyPress(e){a(e)},tabIndex:0});return(0,i.jsx)(i.Fragment,{children:r})};var Tm=t(5315);function zm(e){try{if("#"!==e[0]||7!==e.length)return"black";{const n=parseInt(e.substring(1,3),16);return.299*n+.587*parseInt(e.substring(3,5),16)+.114*parseInt(e.substring(5),16)>150?"black":"white"}}catch{return"black"}}function Om(e,n){const t="#"===e[0]?1:0;return`rgba(${parseInt(e.substring(0+t,2+t),16)}, ${parseInt(e.substring(2+t,4+t),16)}, ${parseInt(e.substring(4+t),16)}, ${n>1?n/100:n})`}const Rm=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],Dm=Object.fromEntries(["gray","grayDark","primary","error","warning","success","blue","blueGray","blueLight","purple","purpleLight","purpleDark","pink","orange","redLight","redDark","green","greenDark","brown"].flatMap(e=>{const n={50:Lr.colors[`${e}50`].value,100:Lr.colors[`${e}100`].value,500:Lr.colors[`${e}500`].value,700:Lr.colors[`${e}700`].value};return[[e,n],[n[700],n]]}));function Mm(e,n=700){const t=Dm[e.toLowerCase()];if(t)return t;{const t=(0,Tm.KI)(e),i=((e,n=700)=>Rm.map(t=>{if(0===t)return{stop:t,tweak:100};if(1e3===t)return{stop:t,tweak:0};if(t===n)return{stop:t,tweak:e};{const i=Math.abs((t-n)/100),s=t[e,t.copy({l:n/100}).formatHex()]))}}const Pm={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function km(e){return w(e)&&(function(e){return/^#(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/g.test(e)}(e)||function(e){return Object.keys(Pm).includes(e)}(e))}function Fm(e,{higherIsBetter:n}={higherIsBetter:!0}){return e<=.2?n?Lr.colors.error500.value:Lr.colors.success500.value:e<=.7?Lr.colors.warning500.value:e<=1?n?Lr.colors.success500.value:Lr.colors.error500.value:Lr.colors.blueGray500.value}const Nm=Nr("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"}}),Lm=(0,de.forwardRef)((e,n)=>{const t=(0,de.useMemo)(()=>{const n=e.color||"gray",t=Mm(n);return"gray"===n?{background:"$gray100",color:"$gray700","& > .h-badge-left-icon":{color:"$gray500"},"& > .h-badge-count":{background:"$gray200"}}:"white"===n?{background:"white",border:"1px solid $gray300","& > .h-badge-count":{background:"$gray100"}}:"white-with-green-icon"===n?{background:"white",border:"1px solid $gray300","& > .h-badge-left-icon":{color:"$success500"}}:"orange"===n?{background:"$orange50",color:"$orange700","& > .h-badge-left-icon":{color:"$orange500"}}:{background:t[50],color:t[700],"& > .h-badge-left-icon":{color:t[500]},"& > .h-badge-count":{background:t[100]}}},[e.color]);return(0,i.jsxs)(Nm,{ref:n,color:e.color,css:{maxWidth:"100%",...t,...e.css},cursor:e.cursor,ellipsis:e.ellipsis,size:e.size,onClick:e.onClick,children:[e.leftIcon&&(0,i.jsx)(Xl,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:n=>{e.onLeftIconClick?.(n)},children:(0,i.jsx)(pc,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(Zr,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:n=>{e.onContentClick?.(n)},children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(Xl,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:n=>{e.onRightIconClick?.(n)},children:(0,i.jsx)(pc,{icon:e.rightIcon})}),("number"==typeof e.count||w(e.count))&&(0,i.jsx)(Xl,{align:"center",className:"h-badge-count",children:e.count})]})});Lm.displayName="Badge";const Um=Gr({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),Vm=(0,de.memo)(function(e){const n="circular"===e.variant?e.size:e.height,t="circular"===e.variant?e.size:e.width;return(0,i.jsx)(Zr,{css:{animation:`${Um} 1.5s ease-in-out 0.5s infinite`,background:"$gray200",borderRadius:"circular"===e.variant?"50%":e.borderRadius,color:"transparent",...e.css},height:n,width:t,children:e.children})});var Bm=t(7456),Wm=t(4757);const Gm=e=>(0,i.jsx)(Xl,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary500",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:e.onClick,children:e.children});function qm(e,n){"production"!==r.Production&&console.warn(`Component ${e} is deprecated, use ${n} instead.`)}const Hm=Nr("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 $primaryCustom600"}},checked:{background:"$primaryCustom600",border:"none",color:"white"},indeterminate:{background:"$primaryCustom600",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"}}),Ym=({shouldPreventDefault:e=!0,...n})=>{qm("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const t=t=>{e&&Uc(t),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked",t):n.onClick("checked",t))};return(0,i.jsxs)(Hm,{"aria-describedby":n.descId,"aria-labelledby":n.labelId,disabled:n.disabled,id:n.inputId,role:"checkbox",size:n.size,state:n.state,tabIndex:n.tabIndex??0,onClick:e=>t(e),onKeyDown:e=>{"Space"===e.code&&t(e)},onMouseDown:e=>{e.shiftKey&&Uc(e)},children:["checked"===n.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===n.state&&(0,i.jsx)("div",{})]})},Zm=({shouldPreventDefault:e=!0,...n})=>{qm("common-front/src/designSystem/components/checkbox.tsx","a new component following the pattern of common-front/src/designSystem/components/radioCard.tsx");const{descId:t,inputId:s,labelId:o}=Vc(),a=void 0!==n.subtext&&null!==n.subtext,r=t=>{e&&t.preventDefault(),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked",t):n.onClick("checked",t))};return(0,i.jsxs)(Xl,{css:{cursor:n.disabled?"not-allowed":"pointer",userSelect:"none",...n.css},tabIndex:0,onClick:r,onKeyDown:e=>{"Space"===e.code&&r(e)},children:[(0,i.jsx)(Xl,{css:{alignItems:"center",height:"md"===n.size?"23px":"20px"},children:(0,i.jsx)(Ym,{descId:t,disabled:n.disabled,inputId:s,labelId:o,shouldPreventDefault:!1,size:n.size,state:n.state,tabIndex:-1,onClick:Ou.A})}),(0,i.jsx)(ic,{width:"2"}),(0,i.jsxs)(Xl,{css:{flexDirection:"column",fontSize:"md"===n.size?"$3":"$2"},children:[(0,i.jsx)(uu,{htmlFor:s,id:o,children:(0,i.jsx)(Zr,{css:{color:n.disabled&&!a?"$gray300":"$gray800"},fontWeight:"medium",children:n.children})}),a&&(0,i.jsx)(Zr,{color:"gray500",id:t,children:n.subtext})]})]})},Km=({children:e,index:n,state:t,onToggle:s,...o})=>(0,i.jsxs)(i.Fragment,{children:[0!==n&&(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{align:"center",css:s?{cursor:"pointer",userSelect:"none"}:void 0,gap:"2",width:1,onClick:s,children:[s&&(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:t??"unchecked",onClick:Ou.A}),(0,i.jsx)(Zr,{"aria-label":e?.toString(),css:{flex:"1"},font:"gray600 textXs semiBold",role:"group",...o,children:e})]}),(0,i.jsx)(ic,{height:"2"})]});function Xm(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Xm).join(""):(0,de.isValidElement)(e)?Xm(e.props.children):""}const Qm=Nr("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"}}),Jm=({shouldPreventDefault:e=!0,...n})=>{qm("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const t=t=>{e&&Uc(t),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked"):n.onClick("checked"))};return(0,i.jsx)(Qm,{"aria-describedby":n.descId,"aria-labelledby":n.labelId,disabled:n.disabled,id:n.inputId,role:"radio",size:n.size,state:n.state,tabIndex:n.tabIndex??0,onClick:t,onKeyDown:e=>{"Space"===e.key&&t(e)},children:"checked"===n.state&&(0,i.jsx)("div",{})})},eg=({shouldPreventDefault:e=!0,...n})=>{qm("common-front/src/designSystem/components/radio.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button");const{inputId:t,descId:s,labelId:o}=Vc(),a="string"==typeof n.subtext&&n.subtext.length>0,r=t=>{e&&Uc(t),!0!==n.disabled&&("unchecked"!==n.state&&n.state?n.onClick("unchecked"):n.onClick("checked"))};return(0,i.jsxs)(Xl,{css:{...n.css,cursor:n.disabled?"not-allowed":"pointer",userSelect:"none"},tabIndex:0,onClick:e=>{r(e)},onKeyDown:e=>{"Space"===e.key&&r(e)},children:[(0,i.jsx)(Xl,{css:{alignItems:"center",height:"md"===n.size?"23px":"20px"},children:(0,i.jsx)(Jm,{descId:s,disabled:n.disabled,inputId:t,labelId:o,shouldPreventDefault:!1,size:n.size,state:n.state,tabIndex:-1,onClick:Ou.A})}),(0,i.jsx)(ic,{width:"2"}),(0,i.jsxs)(Xl,{css:{flexDirection:"column",fontSize:"md"===n.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(uu,{htmlFor:t,id:o,children:(0,i.jsx)(Zr,{css:{color:n.disabled&&!a?"$gray300":"$gray800"},fontWeight:"medium",children:n.children})}),n.subtext&&(0,i.jsx)(Zr,{color:"gray500",id:s,children:n.subtext})]})]})},ng=({badge:e,children:n,color:t,css:s,disabled:o,isCheckbox:a,isRadio:r,isSelected:d,onClick:l,subtext:c,value:u,...m})=>{const g=(0,de.useCallback)(()=>{o||l?.()},[o,l]),h=(0,de.useCallback)(e=>{"Enter"===e.key&&g?.()},[g]),p=(0,de.useMemo)(()=>Xm(n),[n]);return(0,i.jsxs)(Xl,{align:"center","aria-checked":a?d:void 0,"aria-label":p,"aria-selected":d,css:{cursor:o?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...s},gap:"3",role:"option",tabIndex:0,width:1,onClick:g,onKeyDown:h,...m,children:[a&&(0,i.jsx)(Ym,{disabled:o,shouldPreventDefault:!1,state:d?"checked":"unchecked",onClick:Ou.A}),r&&(0,i.jsx)(Jm,{shouldPreventDefault:!1,state:d?"checked":"unchecked",onClick:Ou.A}),(0,i.jsxs)(Xl,{align:"center",css:{flex:"1",overflow:"hidden"},gap:"2",children:[km(t)&&!e&&(0,i.jsx)(Zr,{css:{background:t,borderRadius:"16px",overflow:"hidden"},height:16,width:16}),km(t)&&e?(0,i.jsx)(Xl,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Lm,{color:t,children:n})}):(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",css:{ellipsis:!0},title:p,width:1,children:n}),w(c)&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),!a&&!r&&d&&(0,i.jsx)(Zr,{color:"primary500",children:(0,i.jsx)(pc,{icon:"check"})})]})};var tg=t(7231),ig=t(5664);function sg(e,n){if(0===e.length)return"unchecked";{const t=(0,tg.A)(e,n).length;return 0===t?"unchecked":t>=e.length?"checked":"indeterminate"}}function og(e,n,t){return"checked"===t?(0,Wm.A)(e,n):(0,Zo.A)(e.concat(n))}function ag(e){return de.Children.toArray(e).map(n=>{if("optgroup"===n.type)return[{id:(0,ig.A)(),type:"group",text:n.props.label}].concat(ag(n.props.children));if("option"===n.type)return{id:(0,ig.A)(),type:"option",text:n.props.children,value:n.props.value,badge:!0===n.props["data-badge"]||"true"===n.props["data-badge"],color:n.props["data-color"],disabled:n.props.disabled,radio:n.props["data-radio"],selected:n.props.selected,style:n.props.style,subtext:n.props["data-subtext"]};if(n.type===Symbol.for("react.fragment"))return ag(n.props.children);throw fs("Unexpected child type",n,e),new Error("Unexpected child type")}).flat()}function rg(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}var dg=t(9116);const lg=({children:e,createText:n,css:t,description:s,hint:o,icon:a,isCreateVisible:r,isSearchLoading:d,isSearchVisible:c,isSelectAllVisible:u,label:m,menuWidth:g,multiple:h,onChange:p,onClick:I,onCreateClick:x,placeholder:_,renderOnPortal:j,renderValue:v,searchElement:S,searchPlaceholder:y,state:C,triggerElem:A,values:E})=>{const{translate:T}=fc(),z=(0,de.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[O,R]=(0,de.useState)(!1),[D,M]=(0,de.useState)(""),{inputId:P,descId:k}=Vc(),{displayedChildren:F,allValues:N,valuesByGroup:L,childrenByRadio:U,valueToName:V,valueToText:B}=function(e,n){const t=(0,de.useMemo)(()=>ag(e),[e]),i=(0,de.useMemo)(()=>{const e=b(n||"");return t.filter(n=>""===e||"group"===n.type||b(Xm(n.text)).includes(e)).filter((e,n,t)=>{const i=t[n+1];return"option"===e.type||"option"===i?.type})},[t,n]),s=(0,de.useMemo)(()=>i.flatMap(e=>"option"===e.type?[e.value]:[]),[i]),o=(0,de.useMemo)(()=>{const e={};let n=null;for(const t of i)"group"===t.type?(n=[],e[t.id]=n):n&&!t.disabled&&$(t.radio)&&n.push(t.value);return e},[i]),a=(0,de.useMemo)(()=>(0,dg.A)((0,l.A)(i.filter(e=>"option"===e.type&&w(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[i]),r=(0,de.useMemo)(()=>rg(t),[t]),d=(0,de.useMemo)(()=>(0,dg.A)(r,Xm),[r]);return{displayedChildren:i,allValues:s,valuesByGroup:o,childrenByRadio:a,valueToName:r,valueToText:d}}(e,D),W=sg(N,E),G=(0,de.useMemo)(()=>v?v(E[0],V[E[0]]):V[E[0]],[v,E,V]);return(0,de.useEffect)(()=>{O||M("")},[O]),(0,i.jsxs)(Xl,{css:t,direction:"column",width:1,children:[m&&(0,i.jsx)(uu,{htmlFor:P,children:m}),s&&(0,i.jsx)(lu,{id:k,children:s}),(m||s)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(ym,{disabled:"disabled"===C,isOpen:O,onStateChange:e=>R(e),children:[(0,i.jsx)($m,{children:A||(0,i.jsx)(gu,{"aria-describedby":k,"aria-label":(m??_)+(B[E[0]]?` (currently: ${B[E[0]]})`:""),"aria-multiselectable":h,"aria-owns":F.map(e=>e.id).join(" "),"aria-placeholder":_,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none",cursor:"disabled"===C?"not-allowed":void 0},cursor:"disabled"===C?"default":"pointer",height:"fluid",icon:a,id:P,rightIcon:O?"chevron-up":"chevron-down",role:"listbox",state:C,children:f(E)?h?(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:E.map((e,n)=>(0,i.jsx)(Lm,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:n=>{Uc(n),p((0,Bm.A)(E,e))},children:V[e]},n))}):(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:B[E[0]],children:G})}):(0,i.jsx)(Zr,{color:"gray500",css:{flex:"1"},role:"presentation",children:_})})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:j,width:g??"match",children:(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsxs)(Xl,{css:{padding:"$3"},direction:"column",width:1,children:[c&&(0,i.jsxs)(i.Fragment,{children:[S||(0,i.jsx)(hu,{ref:z,icon:"magnifying-glass",placeholder:y||T("rechercher_50038"),state:"search",value:D,onChange:M}),(0,i.jsx)(ic,{height:"3"})]}),(0,i.jsx)(Zr,{css:{maxHeight:"250px",overflowY:"auto"},children:d?(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:40}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40})]}):F.map((e,n)=>{if("group"===e.type){const t=L[e.id]??[],s=!0===h&&f(t),o=sg(t,E);return(0,i.jsx)(Km,{id:e.id,index:n,state:s?o:void 0,onToggle:s?()=>{p(og(E,t,o))}:void 0,children:e.text},e.id)}{const t=e.value,s=e.selected??E.includes(t),o=e.radio,a=!0===h&&$(o),r=!0===h&&w(o);return(0,i.jsx)(ng,{badge:e.badge,color:e.color,css:e.style,disabled:e.disabled,id:e.id,isCheckbox:a,isRadio:r,isSelected:s,subtext:e.subtext,value:e.value,onClick:()=>{if(I)I(t,s);else if(h&&a)p(s?(0,Bm.A)(E,t):E.concat(t));else if(h&&r){const e=(0,Wm.A)(E,U[o]).concat(s?[]:[t]);p(e)}else p(s?[]:[t]),R(!1)},children:e.text},n)}})})]}),r&&(0,i.jsxs)(Gm,{onClick:()=>{x?.(),R(!1)},children:["+ ",n||T("cr_er_82895")]}),u&&(0,i.jsx)(Gm,{onClick:()=>{p(og(E,N,W))},children:T("checked"===W?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(cu,{state:C,children:o})]})},cg=e=>(0,i.jsx)(Xl,{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}),ug=(0,de.createContext)({}),mg=e=>{const[n,t]=(0,de.useState)(null);return(0,i.jsx)(ug.Provider,{value:{clickedRowIndex:n,setClickedRowIndex:t},children:e.children})},gg=({children:e,css:n,hideBorder:t,...s})=>(0,i.jsx)(mg,{children:(0,i.jsx)(Xl,{className:!0===t?"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"},...n},direction:"column",...s,children:e})}),hg="old",pg="new2025",Ig=(0,de.createContext)({});function fg(){return(0,de.useContext)(Ig)}function xg(e,n){return{flex:n?"1 1 0":e?"0 0 0":"1",minWidth:n?`${n}px`:e?`${e}px`:void 0}}const _g=(0,de.forwardRef)((e,n)=>(0,i.jsx)(Xl,{ref:n,align:"center",className:"table-cell",css:{...xg(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:n=>{e.onClick&&e.onClick(n)},...(0,Qr.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));_g.displayName="Cell";const jg=25,vg=h([25,50,100]);var Sg=t(7773);function yg(e){const n=window.matchMedia(e),[t,i]=(0,de.useState)(n.matches);return(0,de.useEffect)(()=>{const e=()=>i(n.matches);return n.addEventListener("change",e),()=>n.removeEventListener("change",e)},[t,e]),t}function Cg(){return yg(kr.mobile)}const bg=e=>(0,i.jsx)(yc,{color:"white",css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.disabled?"not-allowed":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}),Ag=e=>{const{translate:n}=fc(),t=Cg(),s=e.limit??jg,o=as(),a=e.offset/s,r=(0,Sg.A)(Math.max(0,a-2),Math.min(e.numberOfPages,a+3)),d=0===a,l=a===e.numberOfPages-1,c=Math.min(e.totalCount,(a+1)*s);return(0,i.jsxs)(_g,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(Zr,{css:{order:1,display:t?"none":void 0},width:150,children:!t&&e.showLimits&&(0,i.jsxs)(Xl,{align:"center",css:{inlineSize:"fit-content",overflow:"hidden"},gap:"4",children:[(0,i.jsx)(Xl,{css:{border:"1px solid $gray300",inlineSize:"fit-content",overflow:"hidden",borderRadius:"$1","& > button:first-child":{borderInlineStart:"none"}},children:vg.map((n,t)=>(0,i.jsx)(bg,{active:s===n,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(n)},children:n},t))}),e.itemName&&(0,i.jsx)(wc,{css:{width:150},children:n("_1_per_page_06128",e.itemName)})]})}),!t&&(e.totalCount>s?(0,i.jsxs)(Xl,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderInlineStart:"none"}},children:[(0,i.jsx)(bg,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(pc,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,Sg.A)(0,e.numberOfPages).map(n=>(0,i.jsx)(bg,{active:a===n,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(n*s),children:n+1},n)):(0,i.jsxs)(i.Fragment,{children:[!r.includes(0)&&(0,i.jsx)(bg,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!r.includes(1)&&(0,i.jsx)(bg,{active:!1,cursor:"default",disabled:!1,onClick:Ou.A,children:(0,i.jsx)(pc,{icon:"ellipsis"})}),r.map(n=>(0,i.jsx)(bg,{active:a===n,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(n*s),children:n+1},n)),!r.includes(e.numberOfPages-2)&&(0,i.jsx)(bg,{active:!1,cursor:"default",disabled:!1,onClick:Ou.A,children:(0,i.jsx)(pc,{icon:"ellipsis"})}),!r.includes(e.numberOfPages-1)&&(0,i.jsx)(bg,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*s),children:e.numberOfPages})]}),(0,i.jsx)(bg,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(pc,{icon:"arrow-right"})})]}):(0,i.jsx)(Zr,{css:{order:3}})),t&&(0,i.jsx)(Xl,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,inlineSize:"fit-content","& > button:first-child":{borderInlineStart:"none"}},children:(0,i.jsx)(bg,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(pc,{icon:"arrow-left"})})}),(0,i.jsx)(Zr,{css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},textAlign:t?"center":"end",width:150,children:t?[...o(n("page_1_of_2_92409"),(0,i.jsx)("b",{children:a+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:[...o(n(e.itemName?"_1_of_2_3_03566":"x_to_y_of_x","{1}",e.totalCount,e.itemName),(0,i.jsxs)("b",{children:[a*s+1,"–",c]}))]}),t&&(0,i.jsx)(Xl,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",inlineSize:"fit-content","& > button:first-child":{borderInlineStart:"none"}},children:(0,i.jsx)(bg,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(pc,{icon:"arrow-right"})})})]})},Eg=e=>{const{setClickedRowIndex:n}=(0,de.useContext)(ug);return(0,i.jsx)(Xl,{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:t=>{n?.(null),e.onMouseLeave?.(t)},children:e.children})},wg=e=>(0,i.jsx)(Eg,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),$g=({css:e,filters:n,headerCells:t,limit:s,numberOfPages:o,offset:a,rows:r,setLimit:d,setOffset:l,showLimits:c=!1,showPagination:u=!0,title:m,totalCount:g})=>{const{designSystem:h}=fg(),p=(c||u)&&"number"==typeof o&&"number"==typeof a&&"function"==typeof l&&(g??0)>0;return(0,i.jsxs)(Zr,{css:{...e},children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[m&&(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1"},fontSize:h===pg?"textMd":"textLg",fontWeight:"medium",children:m}),n]}),(0,i.jsxs)(gg,{role:"grid",children:[(0,i.jsx)(cg,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:t}),r,p&&(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{limit:s,numberOfPages:o,offset:a,setLimit:d,setOffset:l,showLimits:c,totalCount:g??0})})]})]})};var Tg=t(2499);function zg(){const e=os();return n=>(0,Tg.A)(n.map(n=>({value:n,translation:e(n)})),({translation:e})=>b(e)).map(({value:e,translation:n},t)=>(0,i.jsx)("option",{value:e,children:n},t))}var Og=t(4741);function Rg(e,n=500){return(0,de.useCallback)((0,Og.A)(e,n),[])}function Dg(e,n=500){const[t,i]=(0,de.useState)(e),[s,o]=(0,de.useState)(e),a=Rg(e=>{o(e)},n);return[t,s,e=>{i(e),a(e)}]}const Mg=e=>(0,i.jsx)(Xl,{align:"center",className:"table-header-cell",css:{...xg(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,Qr.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),Pg=e=>(0,i.jsx)(Xl,{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)(Vm,{borderRadius:"$1",height:1,width:1})}),kg=["weezevent.com","weeztix.com","kaboodle.com"];function Fg(e){return kg.includes(e.split("@")[1]??"")}function Ng(e){return["benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(e)}const Lg=e=>(0,i.jsxs)(ym,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)($m,{children:e.triggerElem||(0,i.jsx)(Xl,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(pc,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(wm,{placement:"bottom-end",children:e.children})]}),Ug=({css:e,children:n,hideIcon:t,to:s,...o})=>{const a=new URL(s.toString(),location.origin),r=t?void 0:["http:","https:"].includes(a.protocol)&&a.origin!==location.origin?"arrow-up-right-from-square":o.download?"arrow-down-to-bracket":void 0;return(0,i.jsx)(Xl,{align:"center",as:"span",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(gc,{to:a,...o,children:[n,r&&(0,i.jsx)(Zr,{as:"span",css:{marginInlineStart:"$1"},children:(0,i.jsx)(pc,{icon:r})})]})})};Ug.displayName="LinkText";const Vg=({children:e,css:n,gap:t,justify:s,width:o})=>(0,i.jsx)(_g,{width:o??100,children:(0,i.jsx)(Xl,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...n},gap:t??"6",height:1,justify:s,width:1,onClick:Uc,children:e})});var Bg;let Wg=class{translationService;constructor(e){this.translationService=e}now(){return Jo.c9.utc()}invalid(){return Jo.c9.invalid("Invalid")}toLocaleString(e,n){return e.toLocaleString(n,{locale:Qu(this.translationService.language)})}};function Gg(e){return e.infos?.billingAddress?.company||""}function qg(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function Hg(e){switch(e){case $n.Refunded:return{color:"warning",leftIcon:"rotate-left"};case $n.Paid:return{color:"success",leftIcon:"check"};case $n.Overdue:return{color:"error",leftIcon:"alarm-clock"};case $n.Waiting:return{color:"error",leftIcon:"xmark"};case $n.WrittenOff:return{color:"gray",leftIcon:"ban"};default:return Ic()}}var Yg;Wg=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Bg=void 0!==ts&&ts)?Bg:Object])],Wg),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"}(Yg||(Yg={}));const Zg=e=>{const n=os(),t=ss(Wg),{user:s}=ps(),o=new Intl.NumberFormat(s?.language.toLowerCase()||"fr",{style:"currency",currency:e.invoice.currency}),a=(r=e.invoice).isWrittenOff?$n.WrittenOff:r.isRefunded?$n.Refunded:r.paidAt?$n.Paid:r.insertedAte.markAsPaid?.(),children:n("marqu_e_comme_p_72620")}),!e.invoice.isRefunded&&(0,i.jsx)(Em,{icon:"rotate-left",onClick:()=>e.markAsRefunded?.(),children:n("marqu_e_comme_r_27551")}),!e.invoice.isWrittenOff&&(0,i.jsx)(Em,{icon:"ban",onClick:()=>e.markAsWrittenOff?.(),children:n("marqu_e_comme_i_89016")})]})})]})},Kg=Nr("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}}),Xg=Nr("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),Qg=Nr("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"}}}}),Jg=({buttons:e,children:n,onClose:t,role:s,size:o})=>{const a=Cg();return _m(t),qm("../../../../../components/modals/__deprecated/modal/modal.tsx","../../../../../components/modals/base/modal.tsx"),(0,hd.createPortal)((0,i.jsx)(Xl,{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:t,children:(0,i.jsxs)(Kg,{mobile:a,open:!0,role:s,size:o,onClick:e=>Uc(e,!1),onMouseDown:e=>Uc(e,!1),children:[(0,i.jsx)(Xg,{mobile:a,children:n}),e&&(0,i.jsx)(Qg,{mobile:a,children:e})]})}),document.body)};var eh=t(6666);const nh=e=>{const n=os(),{mutate:t,isLoading:s}=function(e={}){return ds("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:o}=rs("query QontoTransactions {\n backoffice {\n qontoTransactions {\n id\n label\n amount\n }\n }\n}\n",{},[],undefined);const[a,r]=(0,de.useState)(null);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Zr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(pc,{icon:"file-invoice"})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:n("marqu_e_une_fac_47139")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("s_lectionner_un_46296"),values:a?[a]:[],onChange:e=>{r((0,eh.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)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:!a,isLoading:s,onClick:async()=>{await t({invoiceId:e.invoiceId,transactionId:a}),e.reload()},children:n("marqu_e_comme_p_72620")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},th=e=>{const{mutate:n}=function(e={}){return ds("mutation BackofficeInvoiceMarkAsRefunded($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsRefunded(invoiceId: $invoiceId)\n}\n",e)}(),{mutate:t}=function(e={}){return ds("mutation BackofficeInvoiceMarkAsWrittenOff($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsWrittenOff(invoiceId: $invoiceId)\n}\n",e)}(),[s,o]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zg,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>o(!0),markAsRefunded:async()=>{await n({invoiceId:e.invoice.id}),e.reload()},markAsWrittenOff:async()=>{await t({invoiceId:e.invoice.id}),e.reload()},showColumn:e.showColumn}),s&&(0,i.jsx)(nh,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>o(!1)})]})},ih=()=>{const{history:e,translate:n}=fc(),t=ms(),s=zg(),{user:o}=ps(),[a,r,d]=Dg(""),[l,c]=(0,de.useState)([]),[u,m]=(0,de.useState)(jg),[g,h]=(0,de.useState)(0),{data:p,isLoading:I,reload:x}=rs("query BackofficeInvoices($name: String, $states: [InvoiceState!], $limit: Int, $offset: Int) {\n backoffice {\n invoices(name: $name, states: $states, limit: $limit, 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 isWrittenOff\n insertedAt\n infos\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{name:w(r)?r:void 0,states:f(l)?l:void 0,limit:u,offset:g},[],undefined);const[_,j]=(0,de.useState)(()=>{const e=t.getItem(Iu.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),v=(0,de.useCallback)(e=>{j(e),t.setItem(Iu.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[j]),S=(0,de.useCallback)(async e=>{try{const n=new URLSearchParams;e?n.set("date",e):f(l)&&n.set("states",l.join(","));const t=await fetch(`${ee.HEAVENT_API_URL}/invoice/all?${n}`,{method:"post",headers:{[re]:await fe()||""}}),{link:i}=await t.json();window.open(i,"_blank")}catch{window.alert(n("impossible_d_ex_55872"))}},[l]),y=e=>_.includes(e);return(0,i.jsx)(Zr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Xl,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:n("factures_03552")}),(0,i.jsx)(Zr,{children:(0,i.jsxs)(lg,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:_,onChange:v,children:[(0,i.jsx)("option",{value:"organization",children:n("organisation_71863")}),(0,i.jsx)("option",{value:"customerName",children:n("nom_du_client_28343")}),(0,i.jsx)("option",{value:"date",children:n("Date")}),(0,i.jsx)("option",{value:"paidAt",children:n("pay_e_le_92377")}),(0,i.jsx)("option",{value:"amount",children:n("montant_55595")}),(0,i.jsx)("option",{value:"amountTTC",children:n("montant_ttc_86677")}),(0,i.jsx)("option",{value:"state",children:n("State")}),(0,i.jsx)("option",{value:"transactionId",children:n("id_de_la_transa_98869")})]})}),(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.HOME)},children:"Home"}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(Em,{icon:"eye",onClick:()=>{e.push(Wo.BACKOFFICE_ORGANIZATIONS)},children:n("voir_les_organi_78756")}),(0,i.jsx)(Em,{icon:"file-export",onClick:()=>S(null),children:"Exporter les factures sélectionnées"}),(0,i.jsx)(Em,{icon:"file-export",onClick:()=>S("this-month"),children:n("exporter_les_fa_11017")}),(0,i.jsx)(Em,{icon:"file-export",onClick:()=>S("last-month"),children:n("exporter_les_fa_01571")}),(0,i.jsx)(Em,{icon:"file-export",onClick:()=>S("all"),children:n("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)($g,{filters:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("id_ou_nom_25064"),value:a,onChange:e=>{d(e),h(0)}})}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,values:l,onChange:c,children:s(fi)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("num_ro_de_factu_68150")}),y(Yg.Organization)&&(0,i.jsx)(Mg,{children:n("organisation_71863")}),y(Yg.CustomerName)&&(0,i.jsx)(Mg,{children:n("nom_du_client_28343")}),y(Yg.Date)&&(0,i.jsx)(Mg,{children:n("Date")}),y(Yg.PaidAt)&&(0,i.jsx)(Mg,{children:n("pay_e_le_92377")}),y(Yg.Amount)&&(0,i.jsx)(Mg,{children:n("montant_55595")}),y(Yg.AmountTTC)&&(0,i.jsx)(Mg,{children:n("montant_ttc_86677")}),y(Yg.State)&&(0,i.jsx)(Mg,{children:n("State")}),y(Yg.TransactionId)&&(0,i.jsx)(Mg,{children:n("id_de_la_transa_98869")}),Ng(o?.email||"")&&(0,i.jsx)(Mg,{width:100})]}),limit:u,numberOfPages:p.backoffice?.invoices.numberOfPages??0,offset:g,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:p.backoffice.invoices.nodes.map(e=>(0,i.jsx)(th,{invoice:e,reload:x,showColumn:y},e.id))}),setLimit:m,setOffset:h,showLimits:!0,title:n("liste_des_factu_86735"),totalCount:p.backoffice?.invoices.totalCount??0})]})})};function sh(e){const[n,t]=(0,de.useState)(e),[i,s]=(0,de.useState)(!1),o=(0,de.useMemo)(()=>{const e=Object.values(n).filter(e=>!0!==e.disabled),t=e.filter(e=>"checked"===e.state),i=t.map(e=>e.id),s=(0,Zo.A)(e.map(({state:e})=>e)),o=2===s.length?"indeterminate":"checked"===s[0]?"checked":"unchecked";return{numberOfSelected:t.length,selectAllState:o,selecteds:t,selectedsIds:i}},[n]),a=(0,de.useRef)(null),r=(0,de.useCallback)((e,n,i)=>{const o=a.current;t(t=>{const s=i&&o?function(e,n,t){const i=Object.keys(e),s=i.indexOf(n),o=i.indexOf(t);return-1===s||-1===o?[t]:i.slice(Math.min(s,o),Math.max(s,o)+1)}(t,o,e):[e];return{...t,...Object.fromEntries(s.flatMap(e=>{const i=t[e];return i&&!0!==i.disabled?[[e,{...i,state:n}]]:[]}))}}),a.current=e,"unchecked"===n&&s(!1)},[t,s]),d=(0,de.useCallback)(e=>{a.current=null,t(Object.fromEntries(Object.entries(n).filter(([e,n])=>!0!==n.disabled).map(([n,t])=>[n,{...t,state:e}]))),"unchecked"===e&&s(!1)},[n,t,s]);return{getSelectedsInput:(0,de.useCallback)((e,n)=>i?{ids:null,predicatesGroups:e??null,scope:n??null}:{ids:o.selectedsIds,predicatesGroups:null,scope:null},[i,o]),isAllSelected:i,numberOfSelected:o.numberOfSelected,selectAllState:o.selectAllState,selecteds:o.selecteds,selectedsIds:o.selectedsIds,setIsAllSelected:s,setStates:t,states:n,toggleRow:r,toggleSelectAll:d}}const oh=(0,de.createContext)({});function ah(){return(0,de.useContext)(oh)}var rh;let dh=class{countries;countriesCodes;phoneCodes;constructor(e){const n=e.translate.bind(e);this.countries=(0,Tg.A)([{phoneCode:"+93",code:"AF",name:n("afghanistan_59344"),nationality:n("afghan_10143"),emoji:"🇦🇫",language:["ps","ps-AR"],smsPrice:.27},{phoneCode:"+35818",code:"AX",name:n("_land_islands_92853"),nationality:n("_land_island_62794"),emoji:"🇦🇽"},{phoneCode:"+355",code:"AL",name:n("albania_07621"),nationality:n("albanian_82021"),emoji:"🇦🇱",language:["sq","sq-AL"],smsPrice:.12},{phoneCode:"+213",code:"DZ",name:n("algeria_37723"),nationality:n("algerian_97855"),emoji:"🇩🇿",language:"ar-DZ",smsPrice:.285},{phoneCode:"+1684",code:"AS",name:n("american_samoa_95023"),nationality:n("american_samoan_76272"),emoji:"🇦🇸"},{phoneCode:"+376",code:"AD",name:n("andorra_45150"),nationality:n("andorran_97838"),emoji:"🇦🇩",smsPrice:.52},{phoneCode:"+244",code:"AO",name:n("angola_15815"),nationality:n("angolan_91942"),emoji:"🇦🇴",smsPrice:.17},{phoneCode:"+1264",code:"AI",name:n("anguilla_53408"),nationality:n("anguillan_92612"),emoji:"🇦🇮"},{phoneCode:"+1268",code:"AG",name:n("antigua_and_bar_05164"),nationality:n("antiguan_or_bar_26833"),emoji:"🇦🇬"},{phoneCode:"+54",code:"AR",name:n("argentina_92219"),nationality:n("argentine_14780"),emoji:"🇦🇷",language:"es-AR",smsPrice:.11},{phoneCode:"+374",code:"AM",name:n("armenia_90330"),nationality:n("armenian_87788"),language:["hy","hy-AM"],emoji:"🇦🇲"},{phoneCode:"+297",code:"AW",name:n("aruba_62942"),nationality:n("aruban_18515"),emoji:"🇦🇼",smsPrice:.33},{phoneCode:"+61",code:"AU",name:n("australia_84647"),nationality:n("australian_83553"),emoji:"🇦🇺",language:"en-AU",smsPrice:.093},{phoneCode:"+43",code:"AT",name:n("austria_67457"),nationality:n("austrian_39761"),emoji:"🇦🇹",language:"de-AT",smsPrice:.066},{phoneCode:"+994",code:"AZ",name:n("azerbaijan_14476"),nationality:n("azerbaijani_az_92428"),emoji:"🇦🇿",language:"az-AZ",smsPrice:.39},{phoneCode:"+1242",code:"BS",name:n("bahamas_33701"),nationality:n("bahamian_86817"),emoji:"🇧🇸"},{phoneCode:"+973",code:"BH",name:n("bahrain_43417"),nationality:n("bahraini_76209"),emoji:"🇧🇭",language:"ar-BH",smsPrice:.12},{phoneCode:"+880",code:"BD",name:n("bangladesh_48531"),nationality:n("bangladeshi_66399"),emoji:"🇧🇩",smsPrice:.425},{phoneCode:"+1246",code:"BB",name:n("barbados_57235"),nationality:n("barbadian_02319"),emoji:"🇧🇧"},{phoneCode:"+375",code:"BY",name:n("belarus_97102"),nationality:n("belarusian_60742"),emoji:"🇧🇾",language:["be","be-BY"],smsPrice:.31},{phoneCode:"+32",code:"BE",name:n("belgium_21048"),nationality:n("belgian_00407"),emoji:"🇧🇪",language:["fr-BE","nl-BE"],smsPrice:.094},{phoneCode:"+501",code:"BZ",name:n("belize_94460"),nationality:n("belizean_90827"),emoji:"🇧🇿",language:"en-BZ",smsPrice:0},{phoneCode:"+229",code:"BJ",name:n("benin_88614"),nationality:n("beninese_benin_55987"),emoji:"🇧🇯",smsPrice:.04},{phoneCode:"+1441",code:"BM",name:n("bermuda_84448"),nationality:n("bermudian_berm_58878"),emoji:"🇧🇲"},{phoneCode:"+975",code:"BT",name:n("bhutan_12608"),nationality:n("bhutanese_34101"),emoji:"🇧🇹",smsPrice:.39},{phoneCode:"+591",code:"BO",name:n("bolivia_plurin_43912"),nationality:n("bolivian_98429"),emoji:"🇧🇴",language:["es-BO","qu-BO"],smsPrice:.38},{phoneCode:"+5997",code:"BQ",name:n("bonaire_sint_e_69605"),nationality:n("bonaire_07340"),emoji:"🇧🇶"},{phoneCode:"+387",code:"BA",name:n("bosnia_and_herz_91990"),nationality:n("bosnian_or_herz_88694"),emoji:"🇧🇦",language:["bs-BA","hr-BA","sr-BA"],smsPrice:.46},{phoneCode:"+267",code:"BW",name:n("botswana_49258"),nationality:n("motswana_botsw_32461"),emoji:"🇧🇼",smsPrice:.13},{phoneCode:"+55",code:"BR",name:n("brazil_03275"),nationality:n("brazilian_74116"),emoji:"🇧🇷",language:"pt-BR",smsPrice:.051},{phoneCode:"+246",code:"IO",name:n("british_indian_92949"),nationality:n("british_indian_08875"),emoji:"🇮🇴"},{phoneCode:"+673",code:"BN",name:n("brunei_darussal_84695"),nationality:n("bruneian_06218"),emoji:"🇧🇳",language:"ms-BN",smsPrice:.05},{phoneCode:"+359",code:"BG",name:n("bulgaria_97045"),nationality:n("bulgarian_79288"),emoji:"🇧🇬",language:["bg","bg-BG"],smsPrice:.16},{phoneCode:"+226",code:"BF",name:n("burkina_faso_55299"),nationality:n("burkinab_02690"),emoji:"🇧🇫",smsPrice:.032},{phoneCode:"+257",code:"BI",name:n("burundi_85561"),nationality:n("burundian_35605"),emoji:"🇧🇮",smsPrice:.05},{phoneCode:"+238",code:"CV",name:n("cabo_verde_28261"),nationality:n("cabo_verdean_88842"),emoji:"🇨🇻",smsPrice:.2},{phoneCode:"+855",code:"KH",name:n("cambodia_77971"),nationality:n("cambodian_19577"),emoji:"🇰🇭",smsPrice:.52},{phoneCode:"+237",code:"CM",name:n("cameroon_44200"),nationality:n("cameroonian_12953"),emoji:"🇨🇲",smsPrice:.024},{phoneCode:"+1",code:"CA",name:n("canada_52584"),nationality:n("canadian_90836"),emoji:"🇨🇦",language:["en-CA","fr-CA"],smsPrice:.03},{phoneCode:"+1345",code:"KY",name:n("cayman_islands_80923"),nationality:n("caymanian_07521"),emoji:"🇰🇾"},{phoneCode:"+236",code:"CF",name:n("central_african_74182"),nationality:n("central_african_89873"),emoji:"🇨🇫",smsPrice:.053},{phoneCode:"+235",code:"TD",name:n("chad_58721"),nationality:n("chadian_55061"),emoji:"🇹🇩",smsPrice:.035},{phoneCode:"+56",code:"CL",name:n("chile_06923"),nationality:n("chilean_69498"),emoji:"🇨🇱",language:"es-CL",smsPrice:.13},{phoneCode:"+86",code:"CN",name:n("china_40708"),nationality:n("chinese_12117"),emoji:"🇨🇳",language:["zh","zh-CN"],smsPrice:.055},{phoneCode:"+6189164",code:"CX",name:n("christmas_islan_46649"),nationality:n("christmas_islan_46649"),emoji:"🇨🇽"},{phoneCode:"+6189162",code:"CC",name:n("cocos_keeling_98180"),nationality:n("cocos_island_82627"),emoji:"🇨🇨"},{phoneCode:"+57",code:"CO",name:n("colombia_37632"),nationality:n("colombian_28222"),emoji:"🇨🇴",language:"es-CO",smsPrice:.033},{phoneCode:"+269",code:"KM",name:n("comoros_35439"),nationality:n("comoran_comori_49754"),emoji:"🇰🇲",smsPrice:.42},{phoneCode:"+242",code:"CG",name:n("congo_republic_97304"),nationality:n("congolese_04965"),emoji:"🇨🇬",smsPrice:.045},{phoneCode:"+243",code:"CD",name:n("congo_democrat_80102"),nationality:n("congolese_04965"),emoji:"🇨🇩",smsPrice:.2},{phoneCode:"+682",code:"CK",name:n("cook_islands_51542"),nationality:n("cook_island_99158"),emoji:"🇨🇰",smsPrice:.12},{phoneCode:"+506",code:"CR",name:n("costa_rica_57058"),nationality:n("costa_rican_17127"),emoji:"🇨🇷",language:"es-CR",smsPrice:.061},{phoneCode:"+225",code:"CI",name:n("c_te_d_ivoire_55380"),nationality:n("ivorian_01729"),emoji:"🇨🇮",smsPrice:.055},{phoneCode:"+385",code:"HR",name:n("croatia_52101"),nationality:n("croatian_62900"),emoji:"🇭🇷",language:["hr","hr-HR"],smsPrice:.13},{phoneCode:"+53",code:"CU",name:n("cuba_11922"),nationality:n("cuban_00956"),emoji:"🇨🇺",smsPrice:.08},{phoneCode:"+5999",code:"CW",name:n("cura_ao_46587"),nationality:n("cura_aoan_65055"),emoji:"🇨🇼"},{phoneCode:"+357",code:"CY",name:n("cyprus_86967"),nationality:n("cypriot_85282"),emoji:"🇨🇾",smsPrice:.083},{phoneCode:"+420",code:"CZ",name:n("czech_republic_57570"),nationality:n("czech_42120"),emoji:"🇨🇿",language:["cs","cs-CZ"],smsPrice:.08},{phoneCode:"+45",code:"DK",name:n("denmark_28356"),nationality:n("danish_44544"),emoji:"🇩🇰",language:["da","da-DK"],smsPrice:.06},{phoneCode:"+253",code:"DJ",name:n("djibouti_38156"),nationality:n("djiboutian_72034"),emoji:"🇩🇯",smsPrice:.12},{phoneCode:"+1767",code:"DM",name:n("dominica_13395"),nationality:n("dominican_54004"),emoji:"🇩🇲"},{phoneCode:["+1809","+1829","+1849"],code:"DO",name:n("dominican_repub_08891"),nationality:n("dominican_54004"),emoji:"🇩🇴",language:"es-DO"},{phoneCode:"+593",code:"EC",name:n("ecuador_25933"),nationality:n("ecuadorian_50591"),emoji:"🇪🇨",language:["es-EC","qu-EC"],smsPrice:.48},{phoneCode:"+20",code:"EG",name:n("egypt_61058"),nationality:n("egyptian_75798"),emoji:"🇪🇬",language:"ar-EG",smsPrice:.45},{phoneCode:"+503",code:"SV",name:n("el_salvador_37036"),nationality:n("salvadoran_02475"),emoji:"🇸🇻",language:"es-SV",smsPrice:.34},{phoneCode:"+240",code:"GQ",name:n("equatorial_guin_39570"),nationality:n("equatorial_guin_44537"),emoji:"🇬🇶",smsPrice:.21},{phoneCode:"+291",code:"ER",name:n("eritrea_67366"),nationality:n("eritrean_20355"),emoji:"🇪🇷",smsPrice:.045},{phoneCode:"+372",code:"EE",name:n("estonia_58256"),nationality:n("estonian_46354"),emoji:"🇪🇪",language:["et","et-EE"],smsPrice:.08},{phoneCode:"+251",code:"ET",name:n("ethiopia_72971"),nationality:n("ethiopian_03019"),emoji:"🇪🇹",smsPrice:.08},{phoneCode:"+500",code:"FK",name:n("falkland_island_59316"),nationality:n("falkland_island_15848"),emoji:"🇫🇰"},{phoneCode:"+298",code:"FO",name:n("faroe_islands_71549"),nationality:n("faroese_32806"),emoji:"🇫🇴",language:["fo","fo-FO"],smsPrice:.046},{phoneCode:"+679",code:"FJ",name:n("fiji_36369"),nationality:n("fijian_39649"),emoji:"🇫🇯",smsPrice:.21},{phoneCode:"+358",code:"FI",name:n("finland_07531"),nationality:n("finnish_24918"),emoji:"🇫🇮",language:["fi","fi-FI","se-FI","sv-FI"],smsPrice:.083},{phoneCode:"+33",code:"FR",name:n("france_26614"),nationality:n("french_86034"),emoji:"🇫🇷",language:["fr","fr-FR"],smsPrice:.045},{phoneCode:"+594",code:"GF",name:n("french_guiana_80598"),nationality:n("french_guianese_02041"),emoji:"🇬🇫",smsPrice:.17},{phoneCode:"+689",code:"PF",name:n("french_polynesi_50842"),nationality:n("french_polynesi_47751"),emoji:"🇵🇫",smsPrice:.18},{phoneCode:"+241",code:"GA",name:n("gabon_58286"),nationality:n("gabonese_62984"),emoji:"🇬🇦",smsPrice:.045},{phoneCode:"+220",code:"GM",name:n("gambia_93575"),nationality:n("gambian_30767"),emoji:"🇬🇲",smsPrice:.19},{phoneCode:"+995",code:"GE",name:n("georgia_93003"),nationality:n("georgian_79366"),emoji:"🇬🇪",language:["ka","ka-GE"]},{phoneCode:"+49",code:"DE",name:n("germany_31193"),nationality:n("german_36386"),emoji:"🇩🇪",language:["de","de-DE"],smsPrice:.089},{phoneCode:"+233",code:"GH",name:n("ghana_32464"),nationality:n("ghanaian_99745"),emoji:"🇬🇭",smsPrice:.033},{phoneCode:"+350",code:"GI",name:n("gibraltar_24360"),nationality:n("gibraltar_24360"),emoji:"🇬🇮",smsPrice:.076},{phoneCode:"+30",code:"GR",name:n("greece_28837"),nationality:n("greek_hellenic_39006"),emoji:"🇬🇷",language:["el","el-GR"],smsPrice:.061},{phoneCode:"+299",code:"GL",name:n("greenland_80916"),nationality:n("greenlandic_67508"),emoji:"🇬🇱",smsPrice:.036},{phoneCode:"+1473",code:"GD",name:n("grenada_04221"),nationality:n("grenadian_25686"),emoji:"🇬🇩"},{phoneCode:"+590",code:"GP",name:n("guadeloupe_95839"),nationality:n("guadeloupe_95839"),emoji:"🇬🇵"},{phoneCode:"+1671",code:"GU",name:n("guam_76384"),nationality:n("guamanian_guam_01132"),emoji:"🇬🇺"},{phoneCode:"+502",code:"GT",name:n("guatemala_49597"),nationality:n("guatemalan_60946"),emoji:"🇬🇹",language:"es-GT",smsPrice:.3},{phoneCode:["+441481","+447781","+447839","+447911"],code:"GG",name:n("guernsey_87507"),nationality:n("channel_island_53762"),emoji:"🇬🇬"},{phoneCode:"+224",code:"GN",name:n("guinea_20770"),nationality:n("guinean_42564"),emoji:"🇬🇳",smsPrice:.056},{phoneCode:"+245",code:"GW",name:n("guinea_bissau_80728"),nationality:n("bissau_guinean_66742"),emoji:"🇬🇼",smsPrice:.09},{phoneCode:"+592",code:"GY",name:n("guyana_92443"),nationality:n("guyanese_56902"),emoji:"🇬🇾",smsPrice:.3},{phoneCode:"+509",code:"HT",name:n("haiti_99471"),nationality:n("haitian_50142"),emoji:"🇭🇹",smsPrice:.3},{phoneCode:"+379",code:"VA",name:n("vatican_city_st_63732"),nationality:n("vatican_36370"),emoji:"🇻🇦"},{phoneCode:"+504",code:"HN",name:n("honduras_79402"),nationality:n("honduran_35392"),emoji:"🇭🇳",language:"es-HN",smsPrice:.267},{phoneCode:"+852",code:"HK",name:n("hong_kong_96239"),nationality:n("hong_kong_hong_64846"),emoji:"🇭🇰",language:"zh-HK",smsPrice:.079},{phoneCode:"+36",code:"HU",name:n("hungary_57981"),nationality:n("hungarian_magy_62212"),emoji:"🇭🇺",language:["hu","hu-HU"],smsPrice:.106},{phoneCode:"+354",code:"IS",name:n("iceland_79438"),nationality:n("icelandic_17689"),emoji:"🇮🇸",language:["is","is-IS"],smsPrice:.085},{phoneCode:"+91",code:"IN",name:n("india_39466"),nationality:n("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:n("indonesia_65003"),nationality:n("indonesian_29723"),emoji:"🇮🇩",language:["id","id-ID"],smsPrice:.464},{phoneCode:"+98",code:"IR",name:n("iran_76293"),nationality:n("iranian_persia_76791"),emoji:"🇮🇷",language:["fa","fa-IR"],smsPrice:.38},{phoneCode:"+964",code:"IQ",name:n("iraq_82027"),nationality:n("iraqi_31025"),emoji:"🇮🇶",language:"ar-IQ",smsPrice:.33},{phoneCode:"+353",code:"IE",name:n("ireland_62034"),nationality:n("irish_35774"),emoji:"🇮🇪",language:"en-IE",smsPrice:.065},{phoneCode:["+441624","+447524","+447624","+447924"],code:"IM",name:n("isle_of_man_64982"),nationality:n("manx_86314"),emoji:"🇮🇲"},{phoneCode:"+972",code:"IL",name:n("israel_20033"),nationality:n("israeli_69936"),emoji:"🇮🇱",language:["he","he-IL"],smsPrice:.3},{phoneCode:"+39",code:"IT",name:n("italy_14828"),nationality:n("italian_56623"),emoji:"🇮🇹",language:["it","it-IT"],smsPrice:.038},{phoneCode:"+1876",code:"JM",name:n("jamaica_55090"),nationality:n("jamaican_58881"),emoji:"🇯🇲",language:"en-JM"},{phoneCode:"+81",code:"JP",name:n("japan_61810"),nationality:n("japanese_82636"),emoji:"🇯🇵",language:["ja","ja-JP"],smsPrice:.08},{phoneCode:"+441534",code:"JE",name:n("jersey_78898"),nationality:n("channel_island_53762"),emoji:"🇯🇪"},{phoneCode:"+962",code:"JO",name:n("jordan_36280"),nationality:n("jordanian_41310"),emoji:"🇯🇴",language:"ar-JO",smsPrice:.39},{phoneCode:["+76","+77"],code:"KZ",name:n("kazakhstan_30541"),nationality:n("kazakhstani_ka_27277"),emoji:"🇰🇿",language:["kk","kk-KZ"]},{phoneCode:"+254",code:"KE",name:n("kenya_67944"),nationality:n("kenyan_92311"),emoji:"🇰🇪",language:["sw","sw-KE"],smsPrice:.3},{phoneCode:"+686",code:"KI",name:n("kiribati_25369"),nationality:n("i_kiribati_66745"),emoji:"🇰🇮",smsPrice:.036},{phoneCode:"+383",code:"XK",name:n("kosovo_44440"),nationality:n("kosovare_35920"),emoji:"🇽🇰",smsPrice:.12},{phoneCode:"+850",code:"KP",name:n("korea_democrat_48584"),nationality:n("north_korean_16553"),emoji:"🇰🇵",smsPrice:.045},{phoneCode:"+82",code:"KR",name:n("korea_republic_72269"),nationality:n("south_korean_89943"),emoji:"🇰🇷",language:["ko","ko-KR"],smsPrice:.029},{phoneCode:"+965",code:"KW",name:n("kuwait_22026"),nationality:n("kuwaiti_76148"),emoji:"🇰🇼",language:"ar-KW",smsPrice:.327},{phoneCode:"+996",code:"KG",name:n("kyrgyzstan_84406"),nationality:n("kyrgyzstani_ky_19120"),emoji:"🇰🇬",language:["ky","ky-KG"],smsPrice:.34},{phoneCode:"+856",code:"LA",name:n("lao_people_s_de_31069"),nationality:n("lao_laotian_28318"),emoji:"🇱🇦",smsPrice:.273},{phoneCode:"+371",code:"LV",name:n("latvia_73526"),nationality:n("latvian_53651"),emoji:"🇱🇻",language:["lv","lv-LV"],smsPrice:.057},{phoneCode:"+961",code:"LB",name:n("lebanon_49493"),nationality:n("lebanese_43182"),emoji:"🇱🇧",language:"ar-LB",smsPrice:.32},{phoneCode:"+266",code:"LS",name:n("lesotho_91086"),nationality:n("basotho_52532"),emoji:"🇱🇸",smsPrice:.35},{phoneCode:"+231",code:"LR",name:n("liberia_12077"),nationality:n("liberian_64388"),emoji:"🇱🇷",smsPrice:.3},{phoneCode:"+218",code:"LY",name:n("libya_26741"),nationality:n("libyan_35337"),emoji:"🇱🇾",language:"ar-LY",smsPrice:.38},{phoneCode:"+424",code:"LI",name:n("liechtenstein_56974"),nationality:n("liechtenstein_56974"),emoji:"🇱🇮",language:"de-LI"},{phoneCode:"+370",code:"LT",name:n("lithuania_95793"),nationality:n("lithuanian_94145"),emoji:"🇱🇹",language:["lt","lt-LT"],smsPrice:.06},{phoneCode:"+352",code:"LU",name:n("luxembourg_15613"),nationality:n("luxembourg_lux_47318"),emoji:"🇱🇺",language:["de-LU","fr-LU"],smsPrice:.1},{phoneCode:"+853",code:"MO",name:n("macao_74812"),nationality:n("macanese_chine_74224"),emoji:"🇲🇴",language:"zh-MO",smsPrice:.038},{phoneCode:"+389",code:"MK",name:n("macedonia_the_19021"),nationality:n("macedonian_20446"),emoji:"🇲🇰",language:["mk","mk-MK"],smsPrice:.095},{phoneCode:"+261",code:"MG",name:n("madagascar_57052"),nationality:n("malagasy_02353"),emoji:"🇲🇬",smsPrice:.029},{phoneCode:"+265",code:"MW",name:n("malawi_27143"),nationality:n("malawian_10093"),emoji:"🇲🇼",smsPrice:.3},{phoneCode:"+60",code:"MY",name:n("malaysia_54920"),nationality:n("malaysian_81474"),emoji:"🇲🇾",language:["ms","ms-MY"],smsPrice:.29},{phoneCode:"+960",code:"MV",name:n("maldives_67432"),nationality:n("maldivian_67878"),emoji:"🇲🇻",language:["dv","dv-MV"],smsPrice:.34},{phoneCode:"+223",code:"ML",name:n("mali_95091"),nationality:n("malian_malines_66005"),emoji:"🇲🇱",smsPrice:.055},{phoneCode:"+356",code:"MT",name:n("malta_73993"),nationality:n("maltese_52729"),emoji:"🇲🇹",language:["mt","mt-MT"],smsPrice:.08},{phoneCode:"+692",code:"MH",name:n("marshall_island_92726"),nationality:n("marshallese_30337"),emoji:"🇲🇭",smsPrice:.045},{phoneCode:"+596",code:"MQ",name:n("martinique_79541"),nationality:n("martiniquais_m_01923"),emoji:"🇲🇶"},{phoneCode:"+222",code:"MR",name:n("mauritania_77906"),nationality:n("mauritanian_68205"),emoji:"🇲🇷",smsPrice:.055},{phoneCode:"+230",code:"MU",name:n("mauritius_10801"),nationality:n("mauritian_09142"),emoji:"🇲🇺",smsPrice:.184},{phoneCode:["+262269","+262639"],code:"YT",name:n("mayotte_91167"),nationality:n("mahoran_45424"),emoji:"🇾🇹"},{phoneCode:"+52",code:"MX",name:n("mexico_21962"),nationality:n("mexican_80494"),emoji:"🇲🇽",language:"es-MX",smsPrice:.92},{phoneCode:"+691",code:"FM",name:n("micronesia_fed_39555"),nationality:n("micronesian_97912"),emoji:"🇫🇲",smsPrice:.045},{phoneCode:"+373",code:"MD",name:n("moldova_republ_08796"),nationality:n("moldovan_76486"),emoji:"🇲🇩"},{phoneCode:"+377",code:"MC",name:n("monaco_72117"),nationality:n("mon_gasque_mon_17281"),emoji:"🇲🇨",language:"fr-MC",smsPrice:.1},{phoneCode:"+976",code:"MN",name:n("mongolia_36757"),nationality:n("mongolian_33711"),emoji:"🇲🇳",language:["mn","mn-MN"],smsPrice:.33},{phoneCode:"+382",code:"ME",name:n("montenegro_78236"),nationality:n("montenegrin_68334"),emoji:"🇲🇪",smsPrice:.15},{phoneCode:"+1664",code:"MS",name:n("montserrat_38432"),nationality:n("montserratian_13585"),emoji:"🇲🇸"},{phoneCode:"+212",code:"MA",name:n("morocco_52420"),nationality:n("moroccan_14305"),emoji:"🇲🇦",language:"ar-MA"},{phoneCode:"+258",code:"MZ",name:n("mozambique_60988"),nationality:n("mozambican_68300"),emoji:"🇲🇿",smsPrice:.32},{phoneCode:"+95",code:"MM",name:n("myanmar_78678"),nationality:n("burmese_66869"),emoji:"🇲🇲",smsPrice:1.1},{phoneCode:"+264",code:"NA",name:n("namibia_19026"),nationality:n("namibian_01490"),emoji:"🇳🇦",smsPrice:.048},{phoneCode:"+674",code:"NR",name:n("nauru_16303"),nationality:n("nauruan_52578"),emoji:"🇳🇷",smsPrice:.21},{phoneCode:"+977",code:"NP",name:n("nepal_49088"),nationality:n("nepali_nepales_64761"),emoji:"🇳🇵",smsPrice:.35},{phoneCode:"+31",code:"NL",name:n("netherlands_38005"),nationality:n("dutch_netherla_42451"),emoji:"🇳🇱",language:["nl","nl-NL"],smsPrice:.095},{phoneCode:"+687",code:"NC",name:n("new_caledonia_14574"),nationality:n("new_caledonian_12113"),emoji:"🇳🇨",smsPrice:.1},{phoneCode:"+64",code:"NZ",name:n("new_zealand_61929"),nationality:n("new_zealander_71823"),emoji:"🇳🇿",language:["en-NZ","mi","mi-NZ"],smsPrice:.14},{phoneCode:"+505",code:"NI",name:n("nicaragua_14531"),nationality:n("nicaraguan_06649"),emoji:"🇳🇮",language:"es-NI",smsPrice:.17},{phoneCode:"+227",code:"NE",name:n("niger_59137"),nationality:n("nigerien_06144"),emoji:"🇳🇪",smsPrice:.067},{phoneCode:"+234",code:"NG",name:n("nigeria_77810"),nationality:n("nigerian_43407"),emoji:"🇳🇬",smsPrice:.47},{phoneCode:"+683",code:"NU",name:n("niue_97570"),nationality:n("niuean_70518"),emoji:"🇳🇺",smsPrice:.045},{phoneCode:"+6723",code:"NF",name:n("norfolk_island_62377"),nationality:n("norfolk_island_62377"),emoji:"🇳🇫"},{phoneCode:"+1670",code:"MP",name:n("northern_marian_94262"),nationality:n("northern_marian_82360"),emoji:"🇲🇵"},{phoneCode:"+47",code:"NO",name:n("norway_14236"),nationality:n("norwegian_50751"),emoji:"🇳🇴",language:["nb","nb-NO","nn-NO","se-NO"],smsPrice:.064},{phoneCode:"+968",code:"OM",name:n("oman_20900"),nationality:n("omani_15042"),emoji:"🇴🇲",language:"ar-OM",smsPrice:.21},{phoneCode:"+92",code:"PK",name:n("pakistan_59697"),nationality:n("pakistani_12622"),emoji:"🇵🇰",language:["ur","ur-PK"],smsPrice:.5},{phoneCode:"+680",code:"PW",name:n("palau_46088"),nationality:n("palauan_73033"),emoji:"🇵🇼",smsPrice:.1},{phoneCode:"+970",code:"PS",name:n("palestine_stat_33253"),nationality:n("palestinian_06829"),emoji:"🇵🇸",smsPrice:.35},{phoneCode:"+507",code:"PA",name:n("panama_16821"),nationality:n("panamanian_07882"),emoji:"🇵🇦",language:"es-PA",smsPrice:.17},{phoneCode:"+675",code:"PG",name:n("papua_new_guine_56959"),nationality:n("papua_new_guine_50302"),emoji:"🇵🇬",smsPrice:.2},{phoneCode:"+595",code:"PY",name:n("paraguay_66859"),nationality:n("paraguayan_50310"),emoji:"🇵🇾",language:"es-PY",smsPrice:.124},{phoneCode:"+51",code:"PE",name:n("peru_23048"),nationality:n("peruvian_85045"),emoji:"🇵🇪",language:["es-PE","qu-PE"],smsPrice:.31},{phoneCode:"+63",code:"PH",name:n("philippines_65361"),nationality:n("philippine_fil_40400"),emoji:"🇵🇭",language:["en-PH","tl","tl-PH"],smsPrice:.243},{phoneCode:"+64",code:"PN",name:n("pitcairn_59104"),nationality:n("pitcairn_island_58961"),emoji:"🇵🇳"},{phoneCode:"+48",code:"PL",name:n("poland_13527"),nationality:n("polish_26779"),emoji:"🇵🇱",language:["pl","pl-PL"],smsPrice:.036},{phoneCode:"+351",code:"PT",name:n("portugal_19698"),nationality:n("portuguese_08463"),emoji:"🇵🇹",language:["pt","pt-PT"],smsPrice:.025},{phoneCode:["+1787","+1939"],code:"PR",name:n("puerto_rico_88176"),nationality:n("puerto_rican_10401"),emoji:"🇵🇷",language:"es-PR"},{phoneCode:"+974",code:"QA",name:n("qatar_70548"),nationality:n("qatari_58016"),emoji:"🇶🇦",language:"ar-QA",smsPrice:.3},{phoneCode:"+262",code:"RE",name:n("r_union_34094"),nationality:n("r_unionese_r_u_86871"),emoji:"🇷🇪",smsPrice:.055},{phoneCode:"+40",code:"RO",name:n("romania_41618"),nationality:n("romanian_49647"),emoji:"🇷🇴",language:["ro","ro-RO"],smsPrice:.09},{phoneCode:"+7",code:"RU",name:n("russian_federat_68392"),nationality:n("russian_12506"),emoji:"🇷🇺",language:["ru","ru-RU","tt","tt-RU"],smsPrice:2.63},{phoneCode:"+250",code:"RW",name:n("rwanda_84901"),nationality:n("rwandan_47719"),emoji:"🇷🇼",smsPrice:.1},{phoneCode:"+590",code:"BL",name:n("saint_barth_lem_80830"),nationality:n("barth_lemois_35003"),emoji:"🇧🇱",smsPrice:.09},{phoneCode:"+290",code:"SH",name:n("saint_helena_a_39384"),nationality:n("saint_helenian_19012"),emoji:"🇸🇭",smsPrice:.1},{phoneCode:"+1869",code:"KN",name:n("saint_kitts_and_74455"),nationality:n("kittitian_or_ne_99867"),emoji:"🇰🇳"},{phoneCode:"+1758",code:"LC",name:n("saint_lucia_60679"),nationality:n("saint_lucian_97267"),emoji:"🇱🇨"},{phoneCode:"+590",code:"MF",name:n("saint_martin_f_87295"),nationality:n("saint_martinois_75974"),emoji:"🇸🇽"},{phoneCode:"+508",code:"PM",name:n("saint_pierre_an_55649"),nationality:n("saint_pierrais_60177"),emoji:"🇵🇲",smsPrice:.13},{phoneCode:"+1784",code:"VC",name:n("saint_vincent_a_23833"),nationality:n("saint_vincentia_81882"),emoji:"🇻🇨"},{phoneCode:"+685",code:"WS",name:n("samoa_25648"),nationality:n("samoan_97653"),emoji:"🇼🇸",smsPrice:.21},{phoneCode:"+378",code:"SM",name:n("san_marino_47437"),nationality:n("sammarinese_71553"),emoji:"🇸🇲",smsPrice:.045},{phoneCode:"+239",code:"ST",name:n("sao_tome_and_pr_10491"),nationality:n("s_o_tom_an_21489"),emoji:"🇸🇹",smsPrice:.045},{phoneCode:"+966",code:"SA",name:n("saudi_arabia_06433"),nationality:n("saudi_saudi_ar_22967"),emoji:"🇸🇦",language:"ar-SA",smsPrice:.215},{phoneCode:"+221",code:"SN",name:n("senegal_38099"),nationality:n("senegalese_64680"),emoji:"🇸🇳",smsPrice:.034},{phoneCode:"+381",code:"RS",name:n("serbia_45061"),nationality:n("serbian_68735"),emoji:"🇷🇸",smsPrice:.46},{phoneCode:"+248",code:"SC",name:n("seychelles_67712"),nationality:n("seychellois_69858"),emoji:"🇸🇨",smsPrice:.3},{phoneCode:"+232",code:"SL",name:n("sierra_leone_02995"),nationality:n("sierra_leonean_86179"),emoji:"🇸🇱",smsPrice:.4},{phoneCode:"+65",code:"SG",name:n("singapore_37928"),nationality:n("singaporean_41916"),emoji:"🇸🇬",language:"zh-SG",smsPrice:.064},{phoneCode:"+1721",code:"SX",name:n("sint_maarten_d_57391"),nationality:n("sint_maarten_82241"),emoji:"🇸🇽"},{phoneCode:"+421",code:"SK",name:n("slovakia_10924"),nationality:n("slovak_69840"),emoji:"🇸🇰",language:["sk","sk-SK"],smsPrice:.068},{phoneCode:"+386",code:"SI",name:n("slovenia_75447"),nationality:n("slovenian_slov_38562"),emoji:"🇸🇮",language:["sl","sl-SI"],smsPrice:.18},{phoneCode:"+677",code:"SB",name:n("solomon_islands_05259"),nationality:n("solomon_island_59052"),emoji:"🇸🇧",smsPrice:.155},{phoneCode:"+252",code:"SO",name:n("somalia_56358"),nationality:n("somali_somalia_97997"),emoji:"🇸🇴",smsPrice:.35},{phoneCode:"+27",code:"ZA",name:n("south_africa_61184"),nationality:n("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:n("south_georgia_a_39555"),nationality:n("south_georgia_o_65055"),emoji:"🇬🇸",smsPrice:.12},{phoneCode:"+211",code:"SS",name:n("south_sudan_88232"),nationality:n("south_sudanese_69140"),emoji:"🇸🇸"},{phoneCode:"+34",code:"ES",name:n("spain_40048"),nationality:n("spanish_74199"),emoji:"🇪🇸",language:["ca","ca-ES","es","es-ES","eu-ES","gl-ES"],smsPrice:.044},{phoneCode:"+94",code:"LK",name:n("sri_lanka_51563"),nationality:n("sri_lankan_09436"),emoji:"🇱🇰",smsPrice:.4},{phoneCode:"+249",code:"SD",name:n("sudan_18427"),nationality:n("sudanese_42330"),emoji:"🇸🇩",smsPrice:.322},{phoneCode:"+597",code:"SR",name:n("suriname_78561"),nationality:n("surinamese_38193"),emoji:"🇸🇷",smsPrice:.3},{phoneCode:"+4779",code:"SJ",name:n("svalbard_and_ja_38511"),nationality:n("svalbard_26353"),emoji:"🇸🇯"},{phoneCode:"+268",code:"SZ",name:n("swaziland_91614"),nationality:n("swazi_88825"),emoji:"🇸🇿",smsPrice:.3},{phoneCode:"+46",code:"SE",name:n("sweden_85663"),nationality:n("swedish_90836"),emoji:"🇸🇪",language:["se-SE","sv","sv-SE"],smsPrice:.098},{phoneCode:"+41",code:"CH",name:n("switzerland_07889"),nationality:n("swiss_23240"),emoji:"🇨🇭",language:["de-CH","fr-CH","it-CH"],smsPrice:.098},{phoneCode:"+963",code:"SY",name:n("syrian_arab_rep_72539"),nationality:n("syrian_06992"),emoji:"🇸🇾",language:["ar-SY","syr","syr-SY"],smsPrice:.37},{phoneCode:"+886",code:"TW",name:n("taiwan_provinc_87264"),nationality:n("chinese_taiwan_24003"),emoji:"🇹🇼",language:"zh-TW",smsPrice:.105},{phoneCode:"+992",code:"TJ",name:n("tajikistan_97104"),nationality:n("tajikistani_21375"),emoji:"🇹🇯",smsPrice:.38},{phoneCode:"+255",code:"TZ",name:n("tanzania_unite_52757"),nationality:n("tanzanian_71935"),emoji:"🇹🇿",smsPrice:.38},{phoneCode:"+66",code:"TH",name:n("thailand_97396"),nationality:n("thai_51972"),emoji:"🇹🇭",language:["th","th-TH"],smsPrice:.066},{phoneCode:"+670",code:"TL",name:n("timor_leste_95604"),nationality:n("timorese_87542"),emoji:"🇹🇱",smsPrice:.22},{phoneCode:"+228",code:"TG",name:n("togo_60267"),nationality:n("togolese_55079"),emoji:"🇹🇬",smsPrice:.03},{phoneCode:"+690",code:"TK",name:n("tokelau_79536"),nationality:n("tokelauan_89444"),emoji:"🇹🇰",smsPrice:.045},{phoneCode:"+676",code:"TO",name:n("tonga_96982"),nationality:n("tongan_52630"),emoji:"🇹🇴",smsPrice:.2},{phoneCode:"+1868",code:"TT",name:n("trinidad_and_to_31939"),nationality:n("trinidadian_or_65515"),emoji:"🇹🇹",language:"en-TT"},{phoneCode:"+216",code:"TN",name:n("tunisia_36732"),nationality:n("tunisian_19451"),emoji:"🇹🇳",language:"ar-TN",smsPrice:.35},{phoneCode:"+90",code:"TR",name:n("turkey_65699"),nationality:n("turkish_85889"),emoji:"🇹🇷",language:["tr","tr-TR"],smsPrice:.033},{phoneCode:"+993",code:"TM",name:n("turkmenistan_86069"),nationality:n("turkmen_63945"),emoji:"🇹🇲"},{phoneCode:"+1649",code:"TC",name:n("turks_and_caico_34033"),nationality:n("turks_and_caico_41685"),emoji:"🇹🇨"},{phoneCode:"+688",code:"TV",name:n("tuvalu_52410"),nationality:n("tuvaluan_49403"),emoji:"🇹🇻",smsPrice:.12},{phoneCode:"+256",code:"UG",name:n("uganda_42928"),nationality:n("ugandan_07085"),emoji:"🇺🇬",smsPrice:.3},{phoneCode:"+380",code:"UA",name:n("ukraine_86632"),nationality:n("ukrainian_77624"),emoji:"🇺🇦",language:["uk","uk-UA"],smsPrice:.26},{phoneCode:"+971",code:"AE",name:n("united_arab_emi_58689"),nationality:n("emirati_emiria_12413"),emoji:"🇦🇪",language:"ar-AE",smsPrice:.12},{phoneCode:"+44",code:"GB",name:n("united_kingdom_16783"),nationality:n("british_43680"),emoji:"🇬🇧",language:["cy","cy-GB","en","en-GB"],smsPrice:.078},{phoneCode:"+1",code:"US",name:n("united_states_o_43878"),nationality:n("american_36800"),emoji:"🇺🇸",language:"en-US",smsPrice:.03},{phoneCode:"+598",code:"UY",name:n("uruguay_21979"),nationality:n("uruguayan_28212"),emoji:"🇺🇾",language:"es-UY",smsPrice:.1},{phoneCode:"+998",code:"UZ",name:n("uzbekistan_27729"),nationality:n("uzbekistani_uz_10593"),emoji:"🇺🇿",language:["uz","uz-UZ"],smsPrice:.39},{phoneCode:"+678",code:"VU",name:n("vanuatu_82756"),nationality:n("ni_vanuatu_van_02924"),emoji:"🇻🇺",smsPrice:.21},{phoneCode:"+58",code:"VE",name:n("venezuela_boli_00470"),nationality:n("venezuelan_52634"),emoji:"🇻🇪",language:"es-VE",smsPrice:.31},{phoneCode:"+84",code:"VN",name:n("vietnam_82968"),nationality:n("vietnamese_55360"),emoji:"🇻🇳",language:["vi","vi-VN"],smsPrice:.27},{phoneCode:"+1284",code:"VG",name:n("virgin_islands_14222"),nationality:n("british_virgin_42963"),emoji:"🇻🇬"},{phoneCode:"+1340",code:"VI",name:n("virgin_islands_12516"),nationality:n("american_virgi_98088"),emoji:"🇻🇮"},{phoneCode:"+681",code:"WF",name:n("wallis_and_futu_93206"),nationality:n("wallisian_or_fu_60327"),emoji:"🇼🇫",smsPrice:.09},{phoneCode:"+212",code:"EH",name:n("western_sahara_02173"),nationality:n("sahrawi_sahraw_96671"),emoji:"🇪🇭",smsPrice:.053},{phoneCode:"+967",code:"YE",name:n("yemen_76340"),nationality:n("yemeni_26632"),emoji:"🇾🇪",language:"ar-YE",smsPrice:.23},{phoneCode:"+260",code:"ZM",name:n("zambia_50513"),nationality:n("zambian_85114"),emoji:"🇿🇲",smsPrice:.324},{phoneCode:"+263",code:"ZW",name:n("zimbabwe_70209"),nationality:n("zimbabwean_42291"),emoji:"🇿🇼",language:"en-ZW",smsPrice:.35}],({name:e})=>b(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>I(e))}countryCodeExists(e){return!!e&&void 0!==this.countries.find(n=>n.code===e)}getCountriesIdName(e){const n=this.getDefaultCountryValues(e).user.country;return(0,Tg.A)(this.countries.map(({code:e,name:n})=>({id:e,name:n})),({id:e,name:t})=>[e===n?1:2,b(t)])}getNationalitiesIdName(e){const n=this.getDefaultCountryValues(e).user.nationality;return(0,Tg.A)(this.countries.map(({code:e,nationality:n})=>({id:e,name:n})),({id:e,name:t})=>[e===n?1:2,b(t)])}getNationality(e){return this.countries.find(n=>n.code===e)?.nationality}getName(e){return this.countries.find(n=>n.code===e)?.name}getDefaultCountryValues(e){let n=this.countries.find(({code:n})=>n===e);if(!n){try{n=this.countries.find(e=>I(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}n||(n=this.countries.find(({code:e})=>"FR"===e))}const t=I(n.language||[]);return{user:{language:t.some(e=>e.toLowerCase().startsWith("fr"))?gt.Fr:t.some(e=>e.toLowerCase().startsWith("es"))?gt.Es:t.some(e=>e.toLowerCase().startsWith("de"))?gt.De:t.some(e=>e.toLowerCase().startsWith("nl"))?gt.Nl:gt.En,country:n.code,nationality:n.code},phone:{country:n.code,code:I(n.phoneCode)[0]??""}}}getSmsPriceByPhone(e){return this.countries.find(n=>I(n.phoneCode).some(n=>e.startsWith(n)))?.smsPrice}};function lh(e){return function(e){return!!e&&!Array.isArray(e)}(e)?e:Array.isArray(e)&&e.length>0?{operator:Kn.And,groups:[{operator:Kn.And,predicates:e}]}:{operator:Kn.And,groups:[]}}function ch(){return{operator:Kn.And,groups:[]}}function uh(e,n,t){return{...e,groups:e.groups.map((e,i)=>i===n?t(e):e)}}function mh(e,n,t){const i=e.groups[n];return i&&1===i.predicates.length&&0===t?gh(e,n):uh(e,n,e=>({...e,predicates:e.predicates.filter((e,n)=>n!==t)}))}function gh(e,n){return{...e,groups:e.groups.filter((e,t)=>t!==n)}}dh=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(rh=void 0!==ts&&ts)?rh:Object])],dh);const hh=["formsInsertedAt","campaignSentAt"];function ph(e){return hh.includes(e)}function Ih(e){return ph(e.slug)?{...e,value:e.value2,value2:e.value3,value3:e.value}:e}function fh(e){return ph(e.slug)?{...e,value:e.value3,value2:e.value,value3:e.value2}:e}var xh,_h,jh;const vh=[_n.Date,_n.Number,_n.Text,_n.Textarea],Sh=h([_n.Phone,_n.Select,_n.Text,_n.Textarea]);function yh(e,n){const t=new Map(n.map(e=>[e.slug,e]));return{operator:e.operator,groups:e.groups.map((e,n)=>({operator:e.operator,groupIndex:n,filtersPredicates:e.predicates.flatMap((e,i)=>{const s=t.get(e.slug);return s?[{filter:s,predicate:e,groupIndex:n,predicateIndex:i}]:[]})})).filter(e=>e.filtersPredicates.length>0)}}function Ch(e){return e.groups.flatMap(e=>e.filtersPredicates)}function bh(e,n){return f(e.values)?e.values.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:n(t)},e)):f(e.valuesGroups)?e.valuesGroups.map(({name:e,values:n},t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t)):[]}function Ah(e,n){return b(e.name).includes(b(n))||(!("number"!=typeof(t=n)||!isFinite(t))||"string"==typeof t&&parseInt(t,10).toString(10)===t)&&e.id===parseInt(n,10);var t}let Eh=class extends xu{countriesService;dateTimeService;constructor(e,n,t){super(t),this.countriesService=e,this.dateTimeService=n}filterPredicateToText(e){const{filter:n}=e,t=e.predicate&&Ih(e.predicate);if(!t)return"";{const i=Jo.c9.isDateTime(t.value)?t.value:w(t.value)?Jo.c9.fromISO(t.value,{zone:"utc",setZone:!0}):Jo.c9.invalid("Not valid predicate.value"),s=!i.isValid||n.fieldType!==Sn.DateTimeRange&&n.fieldType!==Sn.Datetime?i.isValid&&n.fieldType===Sn.Date?this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong):t.value:this.dateTimeService.toLocaleString(i,da.DateTime),o=Jo.c9.isDateTime(t.value2)?t.value2:w(t.value2)?Jo.c9.fromISO(t.value2,{zone:"utc",setZone:!0}):Jo.c9.invalid("Not valid predicate.value2"),a=!o.isValid||n.fieldType!==Sn.DateTimeRange&&n.fieldType!==Sn.Datetime?o.isValid&&n.fieldType===Sn.Date?this.dateTimeService.toLocaleString(o,da.DateOnly.MonthLong):t.value2:this.dateTimeService.toLocaleString(o,da.DateTime),r=t.value3;switch(t.operator){case Zn.Contains:return"condition"===n.slug?this.conditionFilterToString(e):"wishedPositions"===n.slug?this.t("mission_souhait_38008",a,this.valueToString(n,s)):"wishedPositionsCategories"===n.slug?this.t("cat_gorie_souha_24744",a,this.valueToString(n,s)):"isDelegationLeader"===n.slug?this.t("est_responsable_13012",this.valueToString(n,s)):this.t("_1_contient_2_40552",n.name,s);case Zn.NotContains:return this.t("_1_ne_contient_14612",n.name,s);case Zn.Is:if("isLeader"===n.slug)return this.t("est_responsable_19679");if("isPositionLeader"===n.slug)return this.t("est_responsable_27270");if("isPositionCategoryLeader"===n.slug)return this.t("est_responsable_72923");if("isDelegationLeader"===n.slug)return this.t("est_responsable_87662");if("privacy"===n.slug)return this.t("visibilit_est_12738");if("campaign"===n.slug)return this.campaignFilterToString(e);if("campaignReply"===n.slug)return this.campaignReplyFilterToString(e);if("condition"===n.slug)return this.t("champ_dont_un_a_44854");if("numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug)return this.t("_1_pour_la_jou_73174",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a);if(n.fieldType===Sn.Date)return this.t("_1_est_gal_43375",n.name,this.valueDateToString(t.valueDate));if(n.fieldType===Sn.Datetime||n.fieldType===Sn.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong):t.value;return this.t("_1_est_gal_43375",n.name,e)}return this.t("_1_est_gal_43375",n.name,this.valueToString(n,s));case Zn.IsNot:if("isLeader"===n.slug)return this.t("n_est_pas_respo_55625");if("isPositionLeader"===n.slug)return this.t("n_est_pas_respo_35508");if("isPositionCategoryLeader"===n.slug)return this.t("n_est_pas_respo_07811");if("isDelegationLeader"===n.slug)return this.t("n_est_pas_respo_91275");if("privacy"===n.slug)return this.t("visibilit_est_55411");if("condition"===n.slug)return this.t("champ_d_pendant_33676");if("numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug)return this.t("_1_pour_la_jou_61197",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a);if(n.fieldType===Sn.Date)return this.t("_1_n_est_pas_38478",n.name,this.valueDateToString(t.valueDate));if(n.fieldType===Sn.Datetime||n.fieldType===Sn.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong):t.value;return this.t("_1_n_est_pas_38478",n.name,e)}return this.t("_1_n_est_pas_38478",n.name,this.valueToString(n,s));case Zn.IsEmpty:return this.t("_1_est_vide_08225",n.name);case Zn.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",n.name);case Zn.IsValid:return this.t("_1_est_valide_45209",n.name);case Zn.IsNotValid:return this.t("_1_n_est_pas_v_05077",n.name);case Zn.GreaterThan:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_91055",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a):this.t("_1_est_plus_gr_93527",n.name,t.value);case Zn.GreaterThanEqual:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_41388",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a):this.t("_1_est_gal_ou_95771",n.name,t.value);case Zn.LessThan:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_99548",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a):this.t("_1_est_plus_pe_18306",n.name,t.value);case Zn.LessThanEqual:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_37455",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a):this.t("_1_est_gal_ou_39305",n.name,t.value);case Zn.Overlaps:return this.t("_1_chevauche_45834",n.name,s,a);case Zn.NotOverlaps:return this.t("_1_ne_chevauch_01846",n.name,s,a);case Zn.Engulfs:return this.t("_1_engloutis_32228",n.name,s,a);case Zn.NotEngulfs:return this.t("_1_n_engloutis_52951",n.name,s,a);case Zn.EngulfedBy:return this.t("_1_est_englout_36064",n.name,s,a);case Zn.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",n.name,s,a);case Zn.IsBefore:return this.t("_1_est_avant_l_83271",n.name,s);case Zn.IsAfter:return this.t("_1_est_apr_s_l_63712",n.name,s);case Zn.Between:return"numberOfAssignmentsPerDay"===n.slug||"volunteersMinutesDays"===n.slug?this.t("_1_pour_la_jou_66546",n.name,this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong),a,r):this.t("_1_est_entre_39871",n.name,s,a);case Zn.StartsWith:return this.t("_1_commence_pa_47720",n.name,s);case Zn.EndsWith:return this.t("_1_finit_par_65840",n.name,s);case Zn.ThisDayMonth:return this.t("_1_est_aujourd_09227",n.name);case Zn.Today:return this.t("_1_est_aujourd_42954",n.name);case Zn.IsInLast:return this.t("_1_est_dans_le_96995",n.name,s);case Zn.IsMoreThanAgo:return this.t("_1_est_il_y_a_01320",n.name,s);case Zn.IsInNext:return this.t("_1_est_dans_le_19106",n.name,s);case Zn.IsMoreThanAhead:return this.t("_1_est_dans_pl_88491",n.name,s);default:return Ic(t.operator)}}}getValues(e){return e.fieldType===_n.Sex?Mi.map(e=>({id:e,name:this.t(e)})):e.fieldType===_n.Language?e.fieldProperty===fn.Language?Xu.map(e=>({id:e,name:this.t(e)})):xi.map(e=>({id:e,name:this.t(e)})):e.fieldType===_n.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===_n.Country?this.countriesService.getCountriesIdName():e.fieldType===_n.Select&&f(e.values)?e.values.map(({id:e,value:n})=>({id:e,name:n})):[]}valueToString(e,n){const t=function(e){return f(e.values)?e.values:f(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return f(t)?I(n).map(e=>this.t(t.find(({id:n})=>n===e)?.name??e)).join(` ${this.t("ou_67404")} `):this.t(n)}valueDateToString(e){const n=[];return"number"==typeof e?.day&&-1!==e.day&&n.push(e.day),"number"==typeof e?.month&&-1!==e.month&&n.push(this.dateTimeService.toLocaleString(Jo.c9.now().set({month:e.month}),{month:"long"})),"number"==typeof e?.year&&-1!==e.year&&n.push(e.year),n.join(" ")}conditionFilterToString(e){if(e.predicate){const n=e.predicate.value.map(n=>e.filter.values?.find(e=>e.id===n)?.name??"");return 1===n.length?this.t("d_pend_du_champ_43516",n[0]):this.t("d_pend_des_cham_85348",n.join(", "))}return""}campaignFilterToString(e){if(e.predicate){const n=e.predicate.value.map(n=>e.filter.campaigns?.find(e=>e.id===n)?.name??"").join(", "),t=e.predicate.value2.map(e=>this.t(e)).join(", ");return this.t("a_re_u_un_messa_76546",n,t)}return""}campaignReplyFilterToString(e){if(e.predicate){const n=e.predicate.value.map(n=>e.filter.campaigns?.find(e=>e.id===n)?.name??"").join(", ");return this.t("la_r_ponse_des_14160",n,e.predicate.value2)}return""}customFieldsToFilters(e){return e.filter(({fieldType:e})=>[Sn.Address,Sn.Checkbox,Sn.Country,Sn.Date,Sn.Datetime,Sn.File,Sn.Language,Sn.Nationality,Sn.Number,Sn.Phone,Sn.Select,Sn.Sex,Sn.Text,Sn.Textarea,Sn.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:Sh.includes(e.fieldType),isSortable:!!vh.includes(e.fieldType)||e.fieldType===_n.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:e.fileType===vn.Picture?80:void 0,minWidth:e.fileType===vn.Picture?void 0:180}))}};Eh=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(xh=void 0!==dh&&dh)?xh:Object,"function"==typeof(_h=void 0!==Wg&&Wg)?_h:Object,"function"==typeof(jh=void 0!==ts&&ts)?jh:Object])],Eh);var wh=t(5582),$h=t(8389),Th=t(8047);const zh=({children:e,dateTime:n,...t})=>{const s=w(n)?n:n.toISO();return(0,i.jsx)(wc,{as:"time",dateTime:s,textStyle:"inherit",...t,children:e})};function Oh(e,n){const t={...n.formats?.localeFormat||da.DateOnly.MonthLong,...n.formats?.displayWeekday?{weekday:"long"}:{}},i=da.TimeOnly,s=n.language?{locale:Qu(n.language)}:{},o=e.start,a=e.end;return{startDateString:w(n.formats?.dateFormat)?o.toFormat(n.formats.dateFormat):o.toLocaleString(t,s),startTimeString:w(n.formats?.timeFormat)?o.toFormat(n.formats.timeFormat):o.toLocaleString(i,s),endDateString:w(n.formats?.dateFormat)?a.toFormat(n.formats.dateFormat):a.toLocaleString(t,s),endTimeString:w(n.formats?.timeFormat)?a.toFormat(n.formats.timeFormat):a.toLocaleString(i,s)}}function Rh(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function Dh(e){return e.flatMap(e=>{const n=e.range,t=Rh(n);return t>1?(0,Sg.A)(0,t).map(t=>{const i=n.start.plus({days:t}),s=i.startOf("day").equals(n.start.startOf("day"))?n.start:i.startOf("day"),o=i.endOf("day").equals(n.end.endOf("day"))?n.end:i.endOf("day");return{...e,range:Jo.IX.fromDateTimes(s,o)}}):[e]})}function Mh(e,n,t,i){const s=Math.ceil(t.endOf("day").diff(n.startOf("day"),"days").days),o=(0,Sg.A)(0,s).map(e=>n.startOf("day").set({hour:i}).plus({day:e}));return e.flatMap(e=>{const{start:n,end:t}=e.range,i=o.filter(e=>e>n&&e({...e,range:n}))})}function Ph(e){const n=e.filter(e=>e.isValid);if(f(n)){const e=[];for(const t of(0,Tg.A)(n,e=>e.start.toMillis())){const n=(0,eh.A)(e);n&&(n.abutsStart(t)||n.overlaps(t))?e[e.length-1]=n.union(t):e.push(t)}return e}return[]}function kh(e,n={}){const t=e.map(e=>e.start),i=t.reduce((e,n)=>Math.min(e,n.hour),n.minHour??8),s=i%2==0?i:i-1,o=e.map(e=>e.end),a=o.reduce((e,n)=>Math.max(e,n.hour),n.maxHour??20),r=a%2==0?a:a+1,d=(r-s)/2,l=(0,$h.A)(t,e=>e.toMillis()).startOf("day"),c=(0,Th.A)(o,e=>e.toMillis()).endOf("day"),u=Math.ceil(c.diff(l,"days").days);return{starts:t,ends:o,startHour:s,endHour:r,numberOfSlots:d,startDate:l,endDate:c,numberOfDays:u}}var Fh;let Nh=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,n={}){return function(e,n={}){const{startDateString:t,startTimeString:i,endDateString:s,endTimeString:o}=Oh(e,n),a=n?.formats?.separator??"–";return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?n.hideTime?`${t}${a}${s}`:n.hideDate?`${i}${a}${o}`:`${t} ${i}${a}${s} ${o}`:n.hideTime?`${t}`:n.hideDate?`${i}${a}${o}`:`${t} ${i}${a}${o}`}(e,{...n,language:this.translationService.language})}toComponents(e,n={}){return function(e,n={}){const{startDateString:t,startTimeString:s,endDateString:o,endTimeString:a}=Oh(e,n),r=n?.formats?.separator??"–";return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?n.hideTime?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zh,{dateTime:e.start.toISODate(),children:t}),r,(0,i.jsx)(zh,{dateTime:e.end.toISODate(),children:o})]}):n.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zh,{dateTime:e.start.toISOTime(),children:s}),r,(0,i.jsx)(zh,{dateTime:e.end.toISOTime(),children:s})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(zh,{dateTime:e.start,children:[t," ",s]}),r,(0,i.jsxs)(zh,{dateTime:e.end,children:[o," ",a]})]}):n.hideTime?(0,i.jsx)(zh,{dateTime:e.start.toISODate(),children:t}):n.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zh,{dateTime:e.start.toISOTime(),children:s}),"–",(0,i.jsx)(zh,{dateTime:e.end.toISOTime(),children:a})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(zh,{dateTime:e.start,children:[t," ",s]}),"–",(0,i.jsx)(zh,{dateTime:e.end,children:a})]})}(e,{...n,language:this.translationService.language})}toLocaleString(e,n,t){return e.toLocaleString(t,n)}};Nh=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Fh=void 0!==ts&&ts)?Fh:Object])],Nh);var Lh=t(6452);const Uh=/^\d{1,2}:\d{2}$/,Vh=/^\d{1,2}:\d{2}:\d{2}$/;function Bh(e){return w(e)&&(null!==e.match(Uh)||null!==e.match(Vh))}function Wh(e){if(Bh(e)){const[n="",t=""]=e.split(":");return[parseInt(n,10),parseInt(t,10)]}return null}function Gh(e,n,t,i={}){const s=w(n.name)?n.name:"",o=e.toDisplayString(n.range,i.interval?.options),a=(0,sc.A)([i.position?.includeName?t:"",s,i.slot?.includeRange||$(s)?o:"",i.position?.includeNameAtEnd?t:""]).join(" - ");return w(a)?a:t}function qh(e,n){return n.some(({id:n,range:t})=>e.id!==n&&t.overlaps(e.range))}function Hh(e,n){const t=e.toISODate();return n.filter(e=>e.range.start.toISODate()===t)}function Yh(e,n,t,i,s,o){const a=[],r=[],d=[],l=e=>Xh(e.position,o),c=(e,n)=>n.some(n=>n.engulfs(e.range)),u=f(s),m=f(i)||f(t)||f(n),g=u&&m?"both":u?"ranges":m?"positions":"none";e.forEach(e=>{const o=i.includes(e.id)||t.includes(e.position.id)||n.includes(e.positionCategory.id);"both"===g&&c(e,s)&&l(e)&&o||"ranges"===g&&c(e,s)&&l(e)||"positions"===g&&l(e)&&o?a.push(e):l(e)&&(0===s.length||c(e,s))?r.push(e):d.push(e)});const h=e=>e.range.start.toMillis();return{wishedPositionsSlots:(0,Tg.A)(a,h),possiblePositionsSlots:(0,Tg.A)(r,h),otherPositionsSlots:(0,Tg.A)(d,h)}}function Zh(e){return`${e.name}${w(e.acronym)?` (${e.acronym})`:""}`}function Kh(e,n){const t=n[e.customField.slug];return"boolean"==typeof t&&e.customField.fieldType===_n.Checkbox?t===e.conditionValue:e.customField.fieldType===_n.Select&&e.customField.canSelectMultiple&&f(t)?(0,tg.A)(e.conditionValue,t??[]).length>0:e.customField.fieldType===_n.Select&&"number"==typeof t&&e.conditionValue.includes(t)}function Xh(e,n){if(!f(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case Ge.Or:return e.conditionsCustomFields.some(e=>Kh(e,n));case Ge.And:return e.conditionsCustomFields.every(e=>Kh(e,n));default:return Ic(e.conditionsOperator)}}function Qh(e){return w(e.address)}function Jh(e){return Jr(e.latitude)&&Jr(e.longitude)}function ep(e){return Qh(e)||Jh(e)}function np(e){return(0,Tg.A)(Object.values(x(e,e=>e.position.name)).map(e=>{const n=e[0].positionCategory,t=e[0].position,i=e.map(e=>e.positionSlot.range.start.toMillis());return{id:t.id,category:n.name,text:w(t.acronym)?t.acronym:t.name,minDate:(0,Lh.A)(i),color:t.color,count:e.length,icon:t.icon}}),({category:e,text:n,minDate:t})=>[e.toLowerCase(),n.toLowerCase(),t])}function tp(e,n,t,i){return(0,wh.A)(n,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,wh.A)(t,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:w(e.acronym)?e.acronym:e.name}))).concat((0,wh.A)(i,e=>e.id).map(n=>{const t=w(n.position.acronym)?n.position.acronym:n.position.name,i=Gh(e,n,t,{interval:{options:{formats:{localeFormat:da.DateOnly.Numeric}}}});return{id:`s-${n.id}`,color:n.position.color,icon:n.position.icon,text:`${t} | ${i}`}}))}function ip(e){return`${e.name}${w(e.acronym)?` (${e.acronym})`:""}`}function sp(e){return op(e.map(({accreditationSlot:e})=>e))}function op(e){return(0,Tg.A)(Object.values(x(e,e=>e.accreditation.id)).map(e=>{const n=e[0].accreditationCategory,t=e[0].accreditation,i=e.map(e=>e.date?.toMillis()??1);return{id:t.id,category:n.name,index:t.index,text:w(t.acronym)?t.acronym:t.name,minDate:(0,Lh.A)(i),color:t.color,count:e.length,icon:t.icon}}),({category:e,index:n,text:t,minDate:i})=>[b(e),ap(n),b(t),i])}function ap(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function rp(e){return(0,Tg.A)(e,e=>[b(e.accreditationCategoryName||""),ap(e.index),b(e.name)])}var dp,lp,cp,up,mp,gp;function hp(e){switch(e){case cp.AccreditationsMatrix:case gp.AccreditationsMatrix:return"table-cells";case mp.Calendar:case gp.Calendar:return"chart-gantt";case up.Card:return"rectangle-list";case lp.List:case cp.List:case up.List:case mp.List:case gp.List:return"table";case mp.Map:case gp.Map:return"map-location";case lp.SlotsList:case mp.SlotsList:return"table";case lp.Table:return"table-cells";case lp.WeeklyCalendar:return"calendar";default:return Ic()}}function pp(e,n){switch(n){case cp.AccreditationsMatrix:case gp.AccreditationsMatrix:return e("matrice_des_acc_84939");case mp.Calendar:case gp.Calendar:return e("vue_planning_91663");case up.Card:return e("vue_grille_37962");case lp.List:case cp.List:case up.List:case mp.List:case gp.List:return e("vue_liste_56882");case mp.Map:case gp.Map:return e("vue_carte_79064");case lp.SlotsList:case mp.SlotsList:return e("vue_liste_cr_n_47406");case lp.Table:return e("vue_tableau_18026");case lp.WeeklyCalendar:return e("vue_calendrier_58086");default:return Ic()}}!function(e){e.Category="Category",e.Date="Date"}(dp||(dp={})),function(e){e.List="List",e.SlotsList="SlotsList",e.Table="Table",e.WeeklyCalendar="WeeklyCalendar"}(lp||(lp={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(cp||(cp={})),function(e){e.Card="Card",e.List="List"}(up||(up={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(mp||(mp={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List",e.Map="Map"}(gp||(gp={}));var Ip,fp,xp,_p;function jp(e,n){return n===cp.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsProfiles:!0,includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDescription:!1,includeDocuments:!1,includeLayout:!1,includeLeaders:!1,includeResources:!1,includeParent:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditations:e.includes(_p.Accreditations),includeAccreditationsProfiles:e.includes(_p.AccreditationsProfiles),includeAccreditationsSlots:!1,includeCampaigns:e.includes(_p.Campaigns),includeChildren:e.includes(_p.Events),includeCreatedBy:e.includes(_p.CreatedBy),includeDescription:e.includes(_p.Description),includeDocuments:e.includes(_p.Documents),includeLayout:e.includes(_p.DelegationsSpaceLayout),includeLeaders:e.includes(_p.Leaders)||e.includes(_p.CategoryLeaders),includeResources:e.includes(_p.FillingRate)||e.includes(_p.AssignedResources),includeParent:e.includes(_p.Parent),includeTags:e.includes(_p.Tags),includeUsedCustomFieldsFilled:e.includes(_p.UsedCustomFieldsFilled)}}!function(e){e.Accreditation="accreditation",e.AccreditationProfile="accreditation_profile",e.Accreditations="accreditations",e.AccreditationSlot="accreditationSlotId",e.AccreditationsProfiles="accreditationsProfiles",e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersDuplicateMembers="canLeadersDuplicateMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CategoryLeaders="categoryLeaders",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.DelegationsSpaceLayout="delegationsSpaceLayout",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.Parent="parent",e.PrivateNote="privateNote",e.ShowAllAccreditations="showAllAccreditations",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.Tags="tags",e.UsedCustomFieldsFilled="usedCustomFieldsFilled"}(_p||(_p={}));let vp=class extends Eh{constructor(e,n,t){super(e,n,t)}getDelegationsFilters(e,n,t,i){return(0,sc.A)([{slug:_p.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:Sn.Text,hideEmpty:!0},{slug:_p.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:Sn.Text},{slug:_p.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:Sn.Text},f(i)?{slug:_p.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,values:(0,Tg.A)(i,e=>b(e.name)),hideEmpty:!0}:null,{slug:"delegationState",name:this.t("State"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,values:si.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:_p.CategoryLeaders,name:this.t("responsables_de_22220"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,organizationId:e,eventId:n},{slug:_p.Leaders,name:this.t("responsables_de_03381"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,organizationId:e,eventId:n},{slug:"leadersEmailSend",name:this.t("les_responsable_08257"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:"deadlineDate",name:this.t("date_limite_d_i_79779"),category:this.t("d_l_gations_78318"),fieldType:Sn.Date},{slug:_p.MaxResources,name:this.t("MaxResources"),category:this.t("d_l_gations_78318"),fieldType:Sn.Number},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,organizationId:e,eventId:n,tagContext:ht.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:Sn.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:Sn.Number,hideEmpty:!0},{slug:_p.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersDuplicateMembers,name:this.t("CanLeadersDuplicateMembers"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_p.ShowAllAccreditations,name:this.t("ShowAllAccreditations"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},n?{slug:_p.DelegationsSpaceLayout,name:this.t("DelegationsSpaceLayout"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,eventId:n}:null,n?{slug:_p.Accreditation,name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,eventId:n}:null,n?{slug:_p.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,eventId:n}:null,n?{slug:_p.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,eventId:n}:null,{slug:_p.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:_p.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:Sn.Datetime,hideEmpty:!0},n?{slug:"parent",name:this.t("est_li_e_une_48471"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0}:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:_p.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(t)])}getDelegationsPossibleColumns(e,n){return[{slug:_p.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:en.Id,width:100},{slug:_p.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:en.Name,minWidth:240},{slug:_p.Description,name:this.t("Description"),minWidth:320},{slug:_p.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:en.Category,minWidth:240},{slug:_p.State,name:this.t("State"),minWidth:180},{slug:_p.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320},{slug:_p.Leaders,name:this.t("responsables_de_03381"),isSearchable:!0,minWidth:320},{slug:_p.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:_p.FormLink,name:this.t("FormLink"),minWidth:240},{slug:_p.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:_p.DelegationsSpaceLayout,name:this.t("DelegationsSpaceLayout"),minWidth:240},{slug:_p.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:_p.MaxResources,name:this.t("MaxResources"),minWidth:180,isSortable:!0,sortAttribute:en.MaxResources},{slug:_p.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:_p.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:_p.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:_p.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:_p.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:en.CreatedAt,minWidth:180},{slug:_p.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:_p.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:_p.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:_p.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:_p.CanLeadersDuplicateMembers,name:this.t("CanLeadersDuplicateMembers"),minWidth:180},{slug:_p.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:_p.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:_p.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:_p.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:_p.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:_p.ShowAllAccreditations,name:this.t("ShowAllAccreditations"),minWidth:180},{slug:_p.IsLocked,name:this.t("IsLocked"),minWidth:180},e?{slug:_p.Parent,name:this.t("d_l_gation_de_l_86100"),minWidth:320}:{slug:_p.Events,name:this.t("_v_nements_53672"),minWidth:320},...e?[{slug:_p.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:_p.AccreditationsProfiles,name:this.t("profils_d_accr_27825"),minWidth:320}]:[],{slug:_p.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:_p.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:_p.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(n)]}};function Sp(e){return"production"===r.Development?1===e:3136===e}function yp(){return"production"===r.Development?[14]:[66919,68131,68598,70260,74864,74866,74868]}vp=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Ip=void 0!==dh&&dh)?Ip:Object,"function"==typeof(fp=void 0!==Wg&&Wg)?fp:Object,"function"==typeof(xp=void 0!==ts&&ts)?xp:Object])],vp);const Cp="custom_document_";function bp(e){return`${Cp}${e}`}function Ap(e){return e.startsWith(Cp)}function Ep(e,n){return 0===e.length||f((0,tg.A)(e,I(n)))}function wp(e){return"production"===r.Development?1===e:2676===e}var $p,Tp,zp,Op;function Rp(e,n,t){return n===gp.AccreditationsMatrix?{includeAccreditationProfile:!1,includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeCustomDocuments:!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,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:n===gp.Map?{includeAccreditationProfile:!1,includeAccreditations:!1,includeAccreditationsMatrix:!1,includeAvailability:!1,includeComments:!1,includeCustomDocuments:!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,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:{includeAccreditationProfile:e.includes(Op.AccreditationProfile)||e.includes(Op.WishedAccreditationProfile),includeAccreditations:e.includes(Op.Accreditations)||e.includes(Op.AccreditationsCategories)||e.includes(Op.AccreditationsSlots)||e.includes(Op.WishedAccreditationSlots)||e.includes(Op.ScannedAccreditations)||e.includes("bracelet_a_delivrer"),includeAccreditationsMatrix:!1,includeAvailability:e.includes(Op.Availability),includeComments:e.includes(Op.Comments),includeCustomDocuments:e.some(Ap),includeDelegation:e.includes(Op.Delegations)||e.includes(Op.DelegationCategory)||e.includes(Op.DelegationBannerNumber),includeDuplicatedFrom:e.includes(Op.DuplicatedFrom),includeEmails:e.includes(Op.CampaignsStates),includeFormsUsersInfos:e.includes(Op.CompletedForms)||e.includes(Op.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at_"))||e.includes(Op.Availability)||e.includes(Op.TeamCode)||e.includes(Op.TeamMembers)||e.includes(Op.WishedAccreditationProfile),includeForms:e.includes(Op.CompletedForms)||e.includes(Op.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at_"))||e.includes(Op.Availability),includeNumberOfAccreditations:e.includes(Op.NumberOfAccreditations),includeNumberOfAssignments:e.includes(Op.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(Op.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(Op.NumberOfAvailableDays),includePicture:e.includes(Op.Name),includePositions:e.includes(Op.Positions)||e.includes(Op.PositionsCategories)||e.includes(Op.WishedPositions)||e.includes(Op.CheckedInPositions),includeRoles:e.includes(Op.Roles),includeTags:e.includes(Op.Tags),includeTeam:e.includes(Op.TeamCode)||e.includes(Op.TeamMembers),includeTraces:!1,includeVolunteerMinutes:e.includes(Op.VolunteerMinutes),includeWishedPositions:e.includes(Op.WishedPositions),includePreassignedPositions:e.includes(Op.PreassignedPositionsCategories)||e.includes(Op.PreassignedPositions),includeWeezeventChecklists:e.includes(Op.WeezaccessChecklists),includeWeezeventUrls:!0===t?.includeWeezeventUrls&&(e.includes(Op.WeezeventBarcodeId)||e.includes(Op.WeezeventShortTag))}}!function(e){e.AccreditationProfile="accreditation_profile",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.DelegationBannerNumber="delegation_banner_number",e.DelegationCategory="delegation_category",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.OrganizationLocalId="organization_local_id",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.WeezeventBarcodeVersion="weezevent_barcode_version",e.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationProfile="wished_accreditation_profile",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(Op||(Op={}));let Dp=class extends Eh{constructor(e,n,t){super(e,n,t)}getVolunteersFilters(e,n,t,i,s,{hasAccreditations:o,hasCampaigns:a,hasDelegations:r,hasForms:d,hasPositions:l,isWeezeventConnected:c}){return[...this.getBaseFilters(i),...this.getBarcodeFilters(),...this.getAvailabilitiesFilters(n,s),...l?this.getPositionsFilters(e,n,s):[],...o?this.getAccreditationsFilters(e,n,s):[],...r?this.getDelegationsFilters(e,n):[],...this.getSegmentsFilters(e,n,t,s),...d?this.getFormsFilters(n):[],...d?this.getTeamsFilters():[],...c?this.getWeezeventFilters(n):[],...this.getEmailsFilters(n,a),...this.getCommentsFilter(e,n),{slug:"tag",name:this.t("Tags"),category:this.t("autres_99130"),fieldType:Sn.Select,needLoading:!0,organizationId:e,eventId:n,tagContext:ht.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Sn.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:Sn.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Sn.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:Sn.Checkbox}]}getPositionMembersFilters(e,n,t,i){return[...this.getBaseFilters(t),...this.getAvailabilitiesFilters(n,i),...this.getPositionsFilters(e,n,i)]}getAccreditationMembersFilters(e,n,t,i,{hasDelegations:s}){return[...this.getBaseFilters(t),...this.getAccreditationsFilters(e,n,i),...s?this.getDelegationsFilters(e,n):[]]}getDelegationCategoryMembersFilters(e,n,t,i,s){return[...this.getBaseFilters(t),...this.getAccreditationsFilters(e,n,i),...s?this.getWeezeventFilters(n):[]]}getDelegationMembersFilters(e,n,t,i,s,o){return[...this.getBaseFilters(t),...s.slotDisplay===at.Hide?[]:this.getAvailabilitiesFilters(n,i),...this.getAccreditationsFilters(e,n,i),...s.positionDisplay===st.None?[]:this.getPositionMembersFilters(e,n,t,i),...o?this.getWeezeventFilters(n):[]]}getVolunteersPossibleColumns(e,n,t,i,{hasAccreditations:s,hasCampaigns:o,hasCustomDocuments:a,hasDelegations:r,hasForms:d,hasPositions:l,isWeezeventConnected:c}){return[...this.getBaseColumns(n,{forDelegationsSpace:!1}),...a?this.getCustomDocumentsColumns(i):[],...d?this.getFormsColumns(t):[],...l?this.getPositionsColumns():[],...c?this.getWeezeventColumns():[],...s?this.getAccreditationsColumns(e):[],...this.getAvailabilitiesColumns(),...r?this.getDelegationsColumns(e):[],...o?[{slug:Op.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320}]:[],{slug:Op.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:Op.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:Op.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e,{forDelegationsSpace:!1}),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e,n){return[...this.getBaseColumns(n,{forDelegationsSpace:!1}),...this.getAccreditationsColumns(e),...this.getDelegationsColumns(e)]}getDelegationCategoryMembersPossibleColumns(e,n,t,{hasCustomDocuments:i,isWeezeventConnected:s}){return[...this.getBaseColumns(n,{forDelegationsSpace:!1}),...i?this.getCustomDocumentsColumns(t):[],...this.getAccreditationsColumns(e),...this.getDelegationsColumns(e),...s?this.getWeezeventColumns():[],{slug:Op.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:Op.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,n,{customDocuments:t,forDelegationsSpace:i,isWeezeventConnected:s,positionDisplay:o,slotDisplay:a}){return[...this.getBaseColumns(n,{forDelegationsSpace:i}),...this.getCustomDocumentsColumns(t??[]),...this.getAccreditationsColumns(e),...o===st.None?[]:this.getPositionsColumns(),...a===at.Hide?[]:this.getAvailabilitiesColumns(),...s?this.getWeezeventColumns():[],{slug:Op.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e,{forDelegationsSpace:n}){return(0,sc.A)([{slug:Op.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:bt.Email,minWidth:180},n?null:{slug:Op.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:bt.Id,width:100},n?null:{slug:Op.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:bt.LocalId,width:100},n?null:{slug:Op.OrganizationLocalId,name:this.t("id_sur_l_organi_45566"),isSearchable:!0,isSortable:!0,sortAttribute:bt.OrganizationLocalId,width:100},n?null:{slug:Op.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},n?null:{slug:Op.WeezeventBarcodeVersion,name:this.t("version_du_code_15471"),minWidth:100},{slug:Op.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:bt.Name,minWidth:240},{slug:Op.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:bt.InsertedAt,width:240},n?null:{slug:Op.DuplicatedFrom,name:this.t("dupliqu_de_28582"),minWidth:240},...this.customFieldsToPossibleColumns(e)])}getAvailabilitiesColumns(){return[{slug:Op.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getCustomDocumentsColumns(e){return(0,Tg.A)(e,e=>b(e.name)).map(e=>({slug:bp(e.id),name:this.t("imprimer_1_75795",e.name),customDocument:e,minWidth:240}))}getFormsColumns(e){return[{slug:Op.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:Op.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,Tg.A)(e,e=>b(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:Op.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:bt.TeamCode,minWidth:180},{slug:Op.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:Op.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:Op.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:Op.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:Op.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:Op.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:Op.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:Op.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:bt.State,width:240},{slug:Op.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:Op.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:Op.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:Op.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(e){return(0,sc.A)([{slug:Op.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:Op.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:Op.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:bt.AccreditationState,width:240},{slug:Op.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:Op.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:Op.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320},{slug:Op.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),minWidth:240},{slug:Op.WishedAccreditationProfile,name:this.t("profil_d_accr_d_63000"),minWidth:240},wp(e)?{slug:"bracelet_a_delivrer",name:this.t("bracelet_d_li_50372")}:null])}getWeezeventColumns(){return[{slug:Op.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:Op.WeezeventPairedAt,name:this.t("appair_le_70213"),isSortable:!0,sortAttribute:bt.PairedAt,minWidth:180},{slug:Op.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(e){return(0,sc.A)([{slug:Op.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:bt.Delegation,minWidth:240},{slug:Op.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240},Sp(e)?{slug:Op.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),isSearchable:!0,width:100}:null])}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Date,hideEmpty:!0},{slug:Op.LocalId,name:this.t("id_sur_l_v_nem_01171"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Number,hideEmpty:!0},{slug:Op.OrganizationLocalId,name:this.t("id_sur_l_organi_45566"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Number,hideEmpty:!0},{slug:Op.DuplicatedFrom,name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getBarcodeFilters(){return[{slug:Op.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:Sn.Text,hideEmpty:!0},{slug:Op.WeezeventBarcodeVersion,name:this.t("version_du_code_15471"),category:"Weezevent",fieldType:Sn.Number,hideEmpty:!0}]}getAvailabilitiesFilters(e,n){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:Sn.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:Sn.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:Sn.Number,hideEmpty:!0}]}getPositionsFilters(e,n,t){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:Sn.Select,values:Ui.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:"positionSlotId",name:this.t("cr_neau_affect_50400_plural"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:Sn.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0,startAt:t.startAt,endAt:t.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0,startAt:t.startAt,endAt:t.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"numberOfPreAssignments",name:this.t("nombre_de_pr_a_86516"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:Sn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:Sn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:Sn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0,startAt:t.startAt,endAt:t.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:Sn.Datetime,useLocalZone:!0},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:Sn.Datetime,useLocalZone:!0},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:Sn.Select,values:Jt.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:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"differentPositions",name:this.t("les_missions_af_61709"),category:this.t("missions_63972"),fieldType:Sn.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,n,t){return(0,sc.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,values:Ht.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:Sn.Number,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"accreditation",name:this.t("accr_ditations_33155"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:"accreditationCategory",name:this.t("cat_gories_d_ac_37678"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,needLoading:!0,eventId:n},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:Sn.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:Sn.Date,startAt:t.startAt,endAt:t.endAt,hideEmpty:!0},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"differentAccreditations",name:this.t("les_accr_ditati_88638"),category:this.t("accr_ditations_39450"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:Op.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,needLoading:!0,eventId:n},{slug:Op.WishedAccreditationProfile,name:this.t("profil_d_accr_d_63000"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,needLoading:!0,eventId:n}])}getDelegationsFilters(e,n){return(0,sc.A)([{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,eventId:n},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,organizationId:e,eventId:n},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,needLoading:!0,eventId:n},Sp(e)?{slug:Op.DelegationBannerNumber,name:this.t("num_ro_de_bande_16203"),category:this.t("d_l_gations_78318"),fieldType:Sn.Number}:null,{slug:"hasBeenInvitedToDelegation",name:this.t("a_re_u_le_lien_34327"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox,hideEmpty:!0}])}getSegmentsFilters(e,n,t,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:Sn.Select,values:i.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==t),hideEmpty:!0},{slug:"usersSegments",name:this.t("fait_partie_de_44893"),category:this.t("vues_personnali_80652"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:n}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Sn.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Sn.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:Sn.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:Sn.Number,hideEmpty:!0},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:Sn.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:Op.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:Sn.Text},{slug:Op.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:Sn.Datetime,useLocalZone:!0},{slug:Op.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:Sn.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e,n){return(0,sc.A)([n?{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Sn.Campaign,needLoading:!0,eventId:e}:null,n?{slug:"campaignSentAt",name:this.t("date_d_envoi_de_84374"),category:this.t("e_mails_09850"),fieldType:Sn.Date,hideEmpty:!0,needLoading:!0,eventId:e}:null,{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:Sn.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:Sn.Select,values:ai.filter(e=>e!==rn.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"accreditationEmailSentAt",name:this.t("date_d_envoi_de_74383"),category:this.t("e_mails_09850"),fieldType:Sn.Date},{slug:"accreditationEmailState",name:this.t("statut_de_l_e_m_97776"),category:this.t("e_mails_09850"),fieldType:Sn.Select,values:ai.filter(e=>e!==rn.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:Sn.Checkbox,hideEmpty:!0},n?{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:Sn.Text,needLoading:!0,eventId:e}:null])}getCommentsFilter(e,n){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Sn.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Sn.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n}]}};Dp=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof($p=void 0!==dh&&dh)?$p:Object,"function"==typeof(Tp=void 0!==Wg&&Wg)?Tp:Object,"function"==typeof(zp=void 0!==ts&&ts)?zp:Object])],Dp);var Mp,Pp,kp,Fp;function Np(e){return{includeAccreditations:e.includes(Fp.Accreditations),includeCampaign:e.includes(Fp.Campaign),includeCustomField:e.includes(Fp.CustomField),includePositions:e.includes(Fp.Positions)}}!function(e){e.AccreditationSlot="accreditationSlotId",e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Frequency="frequency",e.Id="id",e.Name="name",e.PositionSlot="positionSlotId",e.Positions="positions",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(Fp||(Fp={}));let Lp=class extends Eh{constructor(e,n,t){super(e,n,t)}getWorkflowsFilters(e,n){return[{slug:Fp.State,name:this.t("State"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,values:Yi.map(e=>({id:e,name:this.t(e)}))},{slug:Fp.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,values:Zi.map(e=>({id:e,name:this.t(e)}))},{slug:Fp.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,values:Bi.map(e=>({id:e,name:this.t(e)}))},{slug:Fp.Frequency,name:this.t("Frequency"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,values:Wi.map(e=>({id:e,name:this.t(e)}))},{slug:Fp.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Fp.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:Sn.Datetime,hideEmpty:!0},...n?[{slug:Fp.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Fp.PositionSlot,name:this.t("cr_neau_affect_50400_plural"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n}]:[],{slug:Fp.Campaign,name:this.t("campagne_97871"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Fp.CustomField,name:this.t("CustomField"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n},{slug:Fp.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),category:this.t("automatisations_60045"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:n}]}getWorkflowsPossibleColumns(){return[{slug:Fp.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:Ot.Id},{slug:Fp.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:Ot.Name,minWidth:240},{slug:Fp.State,name:this.t("State"),minWidth:180},{slug:Fp.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:Fp.Action,name:this.t("action_44224"),minWidth:180},{slug:Fp.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:Fp.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Ot.CreatedAt,minWidth:180},{slug:Fp.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:Ot.VolunteersSegment,minWidth:320},{slug:Fp.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:Ot.ExecutedAt,minWidth:180},{slug:Fp.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:Fp.Positions,name:this.t("missions_63972"),minWidth:320},{slug:Fp.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:Fp.CustomField,name:this.t("CustomField"),minWidth:240},{slug:Fp.Frequency,name:this.t("Frequency"),minWidth:180}]}};Lp=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Mp=void 0!==dh&&dh)?Mp:Object,"function"==typeof(Pp=void 0!==Wg&&Wg)?Pp:Object,"function"==typeof(kp=void 0!==ts&&ts)?kp:Object])],Lp);var Up=t(9669);function Vp(e,n,t,i,s){const o=n.diff(e,"days").days;return(0,Up.A)((0,Sg.A)(0,o+1).map(n=>e.plus({days:n}).set({hour:s})),e=>i===it.AllDays||t.some(n=>n.contains(e)||n.start.startOf("day").equals(e.startOf("day"))||n.end.startOf("day").equals(e.startOf("day"))))}function Bp(e,n,t,i,s){const o=n.diff(e,"days").days;return(0,Sg.A)(0,o+1).flatMap(n=>{const i=e.plus({days:n});return t.map(e=>{const[n=0,t=0]=e.startTime.split(":").map(e=>parseInt(e,10)),[s=0,o=0]=e.endTime.split(":").map(e=>parseInt(e,10)),a=i.set({hour:n,minute:t});let r=i.set({hour:s,minute:o});return(ss===it.AllDays||i.some(n=>n.overlaps(e.interval)))}function Wp(e,n){return w(e)?`${e} (${n.toFormat("HH:mm")})`:n.toFormat("HH:mm")}function Gp(e,n,t){const i=e.filter(e=>!n.equals(sa(e)));return i.length===e.length&&t?[...e,aa(n)]:i.length===e.length||t?e:i}function qp(e,n,t,i={}){const s=w(n.name)?n.name:"",o=n.date?w(i?.date?.format)?n.date.toFormat(i?.date?.format??""):e.toLocaleString(n.date,i?.date?.localeFormat||da.DateOnly.Numeric):"",a=(0,sc.A)([i?.accreditation?.includeName?t:"",s,o,i?.accreditation?.includeNameAtEnd?t:""]).join(" - ");return w(a)?a:w(i?.defaultName)?i?.defaultName:t}function Hp(e){return(0,Tg.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}function Yp(e,n,t={}){return(0,Tg.A)(n,e=>b(e.name)).flatMap(n=>rp(n.accreditations).map(s=>{const o=t.useAccreditationDisplay&&s.accreditationDisplay===be.Radio?s.name:void 0,a=Hp(s.slots);return(0,i.jsx)("optgroup",{label:`${n.name} - ${ip(s)}`,children:a.map(n=>{const a=qp(e,n,ip(s),{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":o,disabled:!(!t.useIsBlocked||!n.isBlocked),value:n.id,children:a},n.id)})},s.id)}))}function Zp(e,n,t={}){return(0,Tg.A)(n,e=>b(e.name)).flatMap(n=>(0,Tg.A)(n.positions,e=>b(e.name)).map(s=>{const o=t.usePositionDisplay&&s.positionDisplay===Ln.Radio?`position-${s.id}`:void 0;return(0,i.jsx)("optgroup",{label:`${n.name} - ${Zh(s)}`,children:(0,Tg.A)(s.slots,e=>[e.range.start.toMillis(),e.name]).map(n=>{const t=Gh(e,n,Zh(s),{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{"data-radio":o,value:n.id,children:t},n.id)})},s.id)}))}const Kp=new WeakMap,Xp=(e,n,t,i)=>{let s=Kp.get(i);return s||(s=(async(e,n,t,i)=>{const s=await fe();if("createdBy"===i.slug&&i.organizationId){const{organization:e}=await function(e,n={}){return xa("query Admins($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n usersInfos(isResourceCreator: true) {\n nodes {\n userId\n email\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId},{token:s});i.values=e.usersInfos.nodes.map(({userId:e,email:n,name:t})=>({id:e,name:`${w(t)?t:"-"} - ${n}`})),i.needLoading=!1}else if("categoryLeaders"===i.slug&&i.organizationId){const{organization:e}=await function(e,n={}){return xa('query DelegationsSegmentsCategoryLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationCategoryLeader: true\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},{token:s});i.values=e.usersInfos.nodes,i.needLoading=!1}else if("leaders"===i.slug&&i.organizationId){const{organization:e}=await function(e,n={}){return xa('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',{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},{token:s});i.values=e.usersInfos.nodes,i.needLoading=!1}else if("delegationCategory"===i.slug&&i.organizationId){const{organization:e}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,level:i.eventId?kn.Event:kn.Organization,eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.delegationsCategories.nodes,e=>b(e.name)),i.needLoading=!1}else if("roles"===i.slug&&i.organizationId){const{organization:e}=await function(e,n={}){return xa("query UsersSegmentsRoles($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n roles {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId},{token:s});i.values=(0,Tg.A)(e.roles,e=>b(e.name)),i.needLoading=!1}else if("tag"===i.slug&&i.organizationId){const{organization:e}=await sr({organizationId:i.organizationId,eventId:i.eventId,context:i.tagContext},{token:s});i.values=(0,Tg.A)(e.tags.nodes,e=>b(e.name)),i.needLoading=!1}else if(i.slug===Fp.CustomField&&i.organizationId){const{organization:e}=await ir({organizationId:i.organizationId,eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.customFields.nodes,e=>b(e.name)),i.needLoading=!1}else if(i.slug===Fp.VolunteersSegment&&i.organizationId){const{organization:e}=await function(e,n={}){return xa("query WorkflowsSegmentsSegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n volunteersSegmentsFolders: segmentsFolders(\n level: $level\n eventId: $eventId\n segmentType: Volunteers\n ) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n\n delegationsSegmentsFolders: segmentsFolders(\n level: $level\n eventId: $eventId\n segmentType: Delegations\n ) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,level:i.eventId?kn.Event:kn.Organization,eventId:i.eventId},{token:s}),n=(e,n)=>(0,Tg.A)(n,e=>e.index).map(n=>({name:`${e} - ${n.name}`,values:(0,Tg.A)(n.segments,e=>e.index)}));i.valuesGroups=n(t.translate("membres_11310"),e.volunteersSegmentsFolders).concat(n(t.translate("d_l_gations_78318"),e.delegationsSegmentsFolders)),i.needLoading=!1}else if(i.eventId){if(["preassignedPosition","position","wishedPositions"].includes(i.slug)){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsPositions($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n acronym\n positionCategoryName\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(Object.entries(x(e.positions.nodes,e=>e.positionCategoryName)).map(([e,n])=>({name:n[0].positionCategoryName,values:(0,Tg.A)(n.map(e=>({id:e.id,name:`${Zh(e)} - ${e.positionCategoryName}`})),e=>b(e.name))})),({name:e})=>b(e)),i.needLoading=!1}else if("hasOtherEventPosition"===i.slug&&i.organizationId){const{organization:{positions:e}}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(Object.entries(x(e.nodes,e=>[e.event.id,e.positionCategoryName])).map(([e,n])=>({name:`${n[0].event.name}: ${n[0].positionCategoryName}`,values:(0,Tg.A)(n,e=>b(e.name))})),({name:e})=>b(e)),i.needLoading=!1}else if(["numberOfAssignments","positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(i.slug)){const{event:e}=await pr({eventId:i.eventId},{token:s});i.valuesGroups=function(e,n){return(0,Tg.A)(n,e=>b(e.name)).flatMap(n=>(0,Tg.A)(n.positions,e=>b(e.name)).map(t=>({id:t.id,name:`${n.name} - ${Zh(t)}`,values:(0,Tg.A)(t.slots,e=>[e.range.start.toMillis(),e.name]).map(n=>{const i=Gh(e,n,Zh(t),{position:{includeNameAtEnd:!0}});return{id:n.id,name:i}})})))}(n,e.positionsCategories),i.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(i.slug)){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsPositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.positionsCategories,e=>b(e.name)),i.needLoading=!1}else if("wishedSlotsCustom"===i.slug){const{event:n}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=((e,n)=>{const t=n.customSlotsPeriods.flatMap(e=>Bp(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,it.AllDays));return(0,Tg.A)(Object.values(x(t,({interval:e})=>e.start.startOf("day").toMillis())),e=>e[0].interval.start.startOf("day").toMillis()).map(n=>{const t=n[0].interval;return{name:e.toLocaleString(t.start.startOf("day"),da.DateOnly.WeekdayLongMonthLong),values:n.map(({name:e,interval:n})=>({id:n.toISO(),name:Wp(e,n)}))}})})(e,n),i.needLoading=!1}else if(i.slug==Op.AccreditationProfile||i.slug===Op.WishedAccreditationProfile){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n acronym\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(e.accreditationsProfilesCategories,e=>b(e.name)).map(e=>({name:e.name,values:(0,Tg.A)(e.accreditationsProfiles,e=>b(e.name)).map(n=>({id:n.id,name:`${ip(n)} - ${e.name}`}))})),i.needLoading=!1}else if("accreditation"===i.slug){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n acronym\n accreditationCategoryName\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(Object.entries(x(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,n])=>({name:n[0].accreditationCategoryName,values:(0,Tg.A)(n.map(e=>({id:e.id,name:`${ip(e)} - ${e.accreditationCategoryName}`})),e=>b(e.name))})),({name:e})=>b(e)),i.needLoading=!1}else if("hasOtherEventAccreditation"===i.slug&&i.organizationId){const{organization:{accreditations:e}}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(Object.entries(x(e.nodes,e=>e.accreditationCategoryName)).map(([e,n])=>({name:`${n[0].event.name}: ${n[0].accreditationCategoryName}`,values:(0,Tg.A)(n,e=>b(e.name))})),({name:e})=>b(e)),i.needLoading=!1}else if("accreditationCategory"===i.slug){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsAccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.accreditationsCategories,e=>b(e.name)),i.needLoading=!1}else if("positionsSegments"===i.slug){const{event:e}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Tg.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("accreditationsSegments"===i.slug){const{event:e}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Tg.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("delegationsSegments"===i.slug||"isDelegationLeader"===i.slug){const{event:e}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.valuesGroups=(0,Tg.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Tg.A)(e.segments,e=>e.index)})),i.needLoading=!1}else if("forms"===i.slug||"form"===i.slug||"formsInsertedAt"===i.slug){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsForms($eventId: EventId!) {\n event(id: $eventId) {\n forms {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.SegmentFormFragment]})}({eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.forms.nodes,e=>b(e.name)),i.needLoading=!1}else if("campaign"===i.slug||"campaignReply"===i.slug||"campaignSentAt"===i.slug){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsCampaigns($eventId: EventId!) {\n event(id: $eventId) {\n campaigns(states: [Done, Scheduled, Template]) {\n nodes {\n ...SegmentCampaign\n }\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.SegmentCampaignFragment]})}({eventId:i.eventId},{token:s});i.campaigns=(0,Tg.A)(e.campaigns.nodes,e=>b(e.name)),i.values=i.campaigns,i.needLoading=!1}else if("delegation"===i.slug){const{event:e}=await function(e,n={}){return xa("query VolunteersSegmentsDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.delegations.nodes,e=>b(e.name)),i.needLoading=!1}else if(["numberOfAccreditations","accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(i.slug)){const{event:n}=await hr({eventId:i.eventId,loadIsBlocked:!1},{token:s});i.valuesGroups=function(e,n){return(0,Tg.A)(n,e=>b(e.name)).flatMap(n=>rp(n.accreditations).map(t=>{const i=Hp(t.slots);return{id:t.id,name:`${n.name} - ${ip(t)}`,values:i.map(n=>{const i=qp(e,n,ip(t),{accreditation:{includeNameAtEnd:!0}});return{id:n.id,name:i}})}}))}(e,n.accreditationsCategories),i.needLoading=!1}else if(i.slug===Op.WeezaccessChecklists){const{event:e}=await function(e,n={}){return xa("query VolunteersWeezaccessChecklists($eventId: EventId!) {\n event(id: $eventId) {\n weezaccessChecklists {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.weezaccessChecklists,e=>b(e.name)),i.needLoading=!1}else if("commentWrittenBy"===i.slug){const{organization:e}=await function(e,n={}){return xa("query VolunteersSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n admins: usersInfos(isResourceCreator: true) {\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",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,eventId:i.eventId},{token:s});i.values=(0,Tg.A)((0,wh.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>b(e.nameOrEmail)).map(({id:e,nameOrEmail:n})=>({id:e,name:n})),i.needLoading=!1}else if(i.slug===_p.DelegationsSpaceLayout){const{event:e}=await function(e,n={}){return xa("query DelegationsSegmentsLayouts($eventId: EventId!) {\n event(id: $eventId) {\n delegationsSpaceLayouts {\n id\n name\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:i.eventId},{token:s});i.values=(0,Tg.A)(e.delegationsSpaceLayouts,e=>b(e.name)),i.needLoading=!1}}else if(i.organizationId)if("event"===i.slug){const{organization:e}=await function(e,n={}){return xa("query UsersSegmentsEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId},{token:s});i.values=(0,Tg.A)(e.events.nodes,e=>b(e.name)),i.needLoading=!1}else if("forms"===i.slug||"formsInsertedAt"===i.slug){const{organization:e}=await function(e,n={}){return xa("query UsersSegmentsForms($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n forms(level: Organization) {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.SegmentFormFragment]})}({organizationId:i.organizationId},{token:s});i.values=(0,Tg.A)(e.forms.nodes,e=>b(e.name)),i.needLoading=!1}else if("campaign"===i.slug){const{organization:e}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[Ko.SegmentCampaignFragment]})}({organizationId:i.organizationId},{token:s});i.campaigns=(0,Tg.A)(e.campaigns.nodes,e=>b(e.name)),i.values=i.campaigns,i.needLoading=!1}else if("positionCustomField"===i.slug||"accreditationCustomField"===i.slug){const{organization:e}=await ir({organizationId:i.organizationId,eventId:i.eventId,fieldTypes:[_n.Checkbox,_n.Select]},{token:s});i.values=(0,Tg.A)(e.customFields.nodes,e=>b(e.name)),i.needLoading=!1}else if("delegation"===i.slug){const{organization:e}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId},{token:s});i.valuesGroups=(0,Tg.A)(Object.entries(x(e.delegations.nodes,e=>e.event?.id||-1)).map(([n,t])=>({name:t[0].event?.name??e.name,values:(0,Tg.A)(t,e=>b(e.name))})),({name:e})=>b(e)),i.needLoading=!1}else if("usersSegments"===i.slug){const{organization:e}=await function(e,n={}){return xa("query VolunteersSegmentsUsersSegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, eventId: $eventId, segmentType: Volunteers) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:i.organizationId,level:kn.Organization},{token:s});i.valuesGroups=(0,Tg.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,Tg.A)(e.segments,e=>e.index)})),i.needLoading=!1}})(e,n,t,i).finally(()=>{Kp.delete(i)}),Kp.set(i,s)),s},Qp={boxShadow:"$xs",color:"$gray800"},Jp=e=>{const n=ss(Eh);return e.filterPredicate.filter.needLoading?(0,i.jsx)(Lm,{color:"white",css:Qp,leftIcon:"loader"}):e.isReadOnly?(0,i.jsx)(Lm,{color:"white",css:Qp,cursor:"default",ellipsis:!0,children:n.filterPredicateToText(e.filterPredicate)}):(0,i.jsx)(Lm,{color:"white",css:Qp,cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>e.onClick(e.filterPredicate),onRightIconClick:()=>e.onRemove(e.filterPredicate),children:n.filterPredicateToText(e.filterPredicate)})},eI=e=>{const n=os();return(0,i.jsx)(Zr,{color:"gray800",css:{textTransform:"uppercase",whiteSpace:"nowrap"},fontSize:"textXs",fontWeight:"medium",children:e.operator===Kn.Or?n("Or"):n("And")})},nI=e=>(0,i.jsx)(Xl,{align:"center",css:{background:"$gray100",borderRadius:"$1",maxWidth:"100%",minWidth:0,padding:"$1 $2"},gap:"2",wrap:"wrap",children:e.group.filtersPredicates.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[t>0&&(0,i.jsx)(eI,{operator:e.group.operator}),(0,i.jsx)(Jp,{filterPredicate:n,isReadOnly:e.isReadOnly,onClick:e.onClick,onRemove:e.onRemove})]},n.predicateIndex))}),tI=e=>{const n=os(),{filtersPredicates:t,clearNameCursors:s,setPredicates:o,setIsFilterOpen:a,setSelectedFilterPredicate:r,predicates:d}=ah(),l=(0,de.useMemo)(()=>Ch(t),[t]),c=(0,de.useMemo)(()=>(0,wh.A)(l,({filter:e})=>e.slug),[l]),u=(0,de.useCallback)(()=>{s(),o(ch())},[s,o]),m=(0,de.useCallback)(({groupIndex:e,predicateIndex:n})=>{r({groupIndex:e,predicateIndex:n}),a(!0)},[a,r]),g=(0,de.useCallback)(({groupIndex:e,predicateIndex:n})=>{s(),o(mh(d,e,n))},[d,s,o]);return function(e){const n=ss(Wg),t=ss(Nh),i=ss(ts),[s,o]=(0,de.useState)(!1);(0,de.useEffect)(()=>{const s=e.filter(({filter:e})=>e.needLoading);f(s)&&(o(!0),Promise.all(s.map(({filter:e})=>Xp(n,t,i,e))).then(()=>{o(!1)}))},[e])}(c),f(l)?(0,i.jsxs)(Xl,{align:"center",gap:"2",width:1,wrap:"wrap",children:[t.groups.map((n,s)=>(0,i.jsxs)(de.Fragment,{children:[s>0&&(0,i.jsx)(eI,{operator:t.operator}),(0,i.jsx)(nI,{group:n,isReadOnly:e.isReadOnly,onClick:m,onRemove:g})]},n.groupIndex)),!e.isReadOnly&&(0,i.jsx)(Zr,{color:"gray700",css:{cursor:"pointer",marginLeft:"$1"},fontWeight:"medium",onClick:u,children:n("r_initialiser_l_66835")})]}):null},iI=Nr("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative",padding:"$1","&:hover":{background:"$gray300"},"& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},"& > i":{color:"white"},"&:focus":{outline:"none"},"&:focus-visible":{border:"1px solid $success500",boxShadow:"0 0 0 4px rgba(16, 167, 77, 0.16)"},variants:{disabled:{true:{cursor:"not-allowed",background:"$gray100","&:hover":{background:"$gray100"},"&:focus-visible":{border:"1px solid $gray300",boxShadow:"0 0 0 4px rgba(206, 206, 206, 0.4)"},"& > i":{color:"$gray400"}}},size:{sm:{blockSize:"16px",inlineSize:"30px","& > div":{borderRadius:"12px",blockSize:"12px",inlineSize:"12px"},"& > i":{fontSize:"8px"}},md:{blockSize:"24px",inlineSize:"44px","& > div":{borderRadius:"20px",blockSize:"20px",inlineSize:"20px"},"& > i":{fontSize:"12px",paddingInlineStart:"2px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$success500","&:hover":{background:"$success600"}}}},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","&:hover":{background:"$gray100"}}}],defaultVariants:{size:"sm"}}),sI=e=>(0,i.jsxs)(iI,{"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:n=>{e.disabled||"Space"!==n.code||(n.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(pc,{height:"8",icon:"check",width:"8"}),(0,i.jsx)("div",{})]}),oI=e=>{const{inputId:n,descId:t,labelId:s}=Vc(),o=w(e.subtext);return(0,i.jsxs)(Xl,{align:"center","aria-keyshortcuts":e["aria-keyshortcuts"],css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:n=>{e.disabled||"Space"!==n.code||(n.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(sI,{descId:t,disabled:e.disabled,inputId:n,labelId:s,size:e.size,value:e.value,onChange:Ou.A}),(0,i.jsx)(ic,{width:"2"}),(0,i.jsxs)(Xl,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(uu,{htmlFor:n,id:s,children:(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:e.children})}),o&&(0,i.jsx)(Zr,{color:"gray500",id:t,children:e.subtext})]})]})};function aI(){return(0,de.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function rI(e,n){const t=aI(),i=(0,de.useCallback)(i=>{i.key===e&&(t&&i.metaKey||!t&&i.ctrlKey)&&n(i)},[e,n]);(0,de.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,n,i])}const dI=e=>{const{translate:n}=fc(),{columnsSearch:t,setColumnsSearch:s}=ah(),[o,a]=(0,de.useState)(""),r=(0,de.useMemo)(()=>w(o)?e.searchableColumns.filter(e=>b(e.name).includes(b(o))):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(wm,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Xl,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("rechercher_sur_85243")}),(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("filtrer_78031"),state:"search",value:o,onChange:a}),(0,i.jsx)(Xl,{direction:"column",gap:"3",children:r.map(({slug:e,name:n})=>(0,i.jsx)(Zm,{state:t.includes(e)?"checked":"unchecked",onClick:n=>{s(j(t,e,"checked"===n))},children:n},e))})]})})]})},lI=e=>{const n=os(),{isEditMode:t,massActions:s,name:o,possibleColumns:a,possibleRenderings:r,rendering:d,setAreColumnsOpen:l,setIsEditMode:c,setIsFilterOpen:u,setName:m,setNameDebounced:g,setRendering:h,setSelectedFilterPredicate:p}=ah(),I=aI(),x=e.showActions&&!!e.actions&&s.numberOfSelected>0,_=(0,de.useMemo)(()=>(0,Tg.A)(a.filter(e=>e.isSearchable),e=>e.name),[a]),j=(0,de.useMemo)(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return rI("e",(0,de.useCallback)(()=>{e.showEditMode&&c(!t)},[t,e.showEditMode,c])),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsxs)(Xl,{width:320,children:[(0,i.jsx)(hu,{autoFocus:!0,css:j,icon:"magnifying-glass",placeholder:e.searchPlaceholder??n("rechercher_50038"),value:o,onChange:e=>{m(e),g(e)}}),e.showSearchColumns&&(0,i.jsx)(dI,{searchableColumns:_})]}),x?(0,i.jsx)(Xl,{css:{flex:"1",justifyContent:"right"},gap:"4",children:e.actions}):(0,i.jsxs)(Xl,{css:{flex:"1"},gap:"4",children:[e.showFilters&&(0,i.jsx)(yc,{color:"gray",leftIcon:"bars-filter",onClick:()=>{p(null),u(!0)},children:n("filtres_64574")}),(0,i.jsx)(Zr,{css:{flex:"1"}}),e.controls,f(r)&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:hp(d),children:pp(n,d)})}),(0,i.jsx)(wm,{placement:"bottom-end",children:r.map(e=>(0,i.jsx)(Em,{icon:hp(e),onClick:()=>h(e),children:pp(n,e)},e))})]}),e.showEditColumns&&(0,i.jsx)(yc,{color:"white",leftIcon:"gear",onClick:()=>{l(!0)},children:n("_diter_les_colo_39630")}),e.showEditMode&&(0,i.jsx)(oI,{"aria-keyshortcuts":(I?"Meta":"Control")+"+E",value:t,onChange:c,children:n("mode_dition_93778")})]})]})},cI=e=>{const n=os(),{massActions:t}=ah(),s=(0,de.useCallback)(()=>{t.toggleSelectAll("unchecked"),t.setIsAllSelected(!1)},[t]),o=(0,de.useCallback)(()=>{t.setIsAllSelected(!0)},[t]);return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(pc,{icon:"circle-exclamation"})}),(0,i.jsx)(Zr,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:t.isAllSelected?e.allSelectedText:e.pageSelectedText}),t.isAllSelected?(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:s,children:n("effacer_la_s_le_85095")}):(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",onClick:o,children:e.selectAllText})]})},uI=e=>{const{limit:n,massActions:t,reload:s,showMassActions:o,totalCount:a}=ah(),r=o&&e.showSelectAll&&t.numberOfSelected===n&&a>n;return(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(lI,{actions:e.renderActions?.(t,a,s),controls:e.renderControls?.(),showActions:o,showEditColumns:e.showEditColumns??!1,showEditMode:e.showEditMode??!1,showFilters:e.showFilters??!1,showSearchColumns:e.showSearchColumns??!1}),e.showPredicatesBadges&&(0,i.jsx)(tI,{isReadOnly:!e.showFilters}),r&&(0,i.jsx)(cI,{allSelectedText:e.renderAllSelectedText?.(a)??"",pageSelectedText:e.renderPageSelectedText?.(n)??"",selectAllText:e.renderSelectAllText?.(a)??""})]})};var mI=t(1932),gI=t(3627),hI=t(4979);function pI(e,n){const{attributes:t,isDragging:i,listeners:s,setActivatorNodeRef:o,setNodeRef:a,transform:r,transition:d}=(0,gI.gl)({id:e,data:n}),l=hI.Ks.Translate.toString(r),c=(0,de.useMemo)(()=>({position:"relative",transform:l,transition:d,zIndex:i?1:void 0}),[l,d,i]);return{handleProps:(0,de.useMemo)(()=>({ref:o,...t,...s}),[o,t,s]),isDragging:i,setNodeRef:a,style:c}}const II=e=>{const{setNodeRef:n,style:t,handleProps:s}=pI(e.column.slug);return(0,i.jsxs)(Xl,{ref:n,css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",style:t,children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"grab"},...s,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name}),w(e.column.label)&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},title:e.column.label,width:1,children:e.column.label})]}),(0,i.jsx)(sI,{value:e.column.isSelected,onChange:e.onToggle})]})},fI=({children:e,css:n,onClose:t,returnToFallback:s,size:o})=>{const a=cs(),r=()=>{t?t():a.goBack(s??Wo.HOME)};return _m(r),qm("common-front/src/designSystem/components/rightPanels/__deprecated/rightPanel.tsx","common-front/src/designSystem/components/rightPanels/base/rightPanel.tsx"),(0,hd.createPortal)((0,i.jsx)(Xl,{css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"100",...n},"data-testid":"right-panel-backdrop",onClick:r,children:(0,i.jsxs)(Xl,{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=>Uc(e,!1),children:[(0,i.jsx)(Zr,{color:"gray500",css:{cursor:"pointer",fontSize:"$textMd",position:"absolute",right:"$space$6",top:"$space$6"},onClick:r,children:(0,i.jsx)("i",{className:"far fa-xmark"})}),e]})}),document.body)},xI=(0,de.forwardRef)((e,n)=>(0,i.jsx)(Xl,{ref:n,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));xI.displayName="RightPanelBody";const _I=e=>(0,i.jsx)(Zr,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children});var jI=t(3375),vI=t(8831);const SI=[vI.FN,vI.Mk],yI=e=>{const n=(0,jI.FR)((0,jI.MS)(jI.AN,{activationConstraint:{distance:4}}),(0,jI.MS)(jI.uN,{coordinateGetter:gI.JR})),t=(0,de.useCallback)(({active:n,over:t})=>{if(t&&n.id!==t.id){const i=e.ids.indexOf(n.id),s=e.ids.indexOf(t.id);-1!==i&&-1!==s&&e.onReorder(i,s)}},[e.ids,e.onReorder]);return(0,i.jsx)(jI.Mp,{collisionDetection:jI.fp,modifiers:SI,sensors:n,onDragEnd:t,children:(0,i.jsx)(gI.gB,{items:e.ids,strategy:gI._G,children:e.children})})},CI=e=>{const n=os(),[t,s]=(0,de.useState)(""),[o,a]=(0,de.useState)((0,Tg.A)(e.columns.map(n=>({...n,isSelected:e.initialSelectedColumns.includes(n.slug)})),[({slug:n})=>{const t=e.initialSelectedColumns.indexOf(n);return-1===t?e.columns.length:t},({name:e})=>e])),r=e=>{if(w(t)){const n=b(t);return b(e.name).includes(n)||w(e.label)&&b(e.label).includes(n)}return!0},d=o.filter(r).map(e=>e.slug);return(0,i.jsxs)(fI,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(xI,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:t,onChange:s}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_des_champ_00325")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(yI,{ids:d,onReorder:(e,n)=>{const t=o.map(e=>e.slug),i=d[e],s=d[n];void 0!==i&&void 0!==s&&a(S(o,t.indexOf(i),t.indexOf(s)))},children:(0,i.jsx)(Xl,{direction:"column",gap:"2",children:o.map((e,n)=>r(e)?(0,i.jsx)(II,{column:e,onToggle:()=>{((e,n)=>{a((0,mI.jM)(t=>{const i=t[n];i&&(i.isSelected=!e.isSelected)}))})(e,n)}},e.slug):null)})}),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(_I,{children:(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{onClick:()=>{e.onSave(o.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})})]})},bI=Jo.c9.fromObject({year:1920,month:1,day:1}),AI=Jo.c9.now();function EI(e){if(Jo.c9.isDateTime(e)&&e?.isValid)return e;if(w(e)){const n=Jo.c9.fromISO(e);return n.isValid?n:null}return null}const wI=["isLeader","isPositionLeader","isPositionCategoryLeader","isDelegationLeader"],$I=h([Zn.IsInLast,Zn.IsMoreThanAgo,Zn.IsInNext,Zn.IsMoreThanAhead]),TI=[Zn.Is,Zn.IsNot,Zn.GreaterThan,Zn.GreaterThanEqual,Zn.LessThan,Zn.LessThanEqual];function zI(e){const{slug:n,fieldType:t}=e;if("condition"===n)return"condition";if(wI.includes(n))return"leader";if("isAdmin"===n)return"admin";if("privacy"===n)return"privacy";if("isTeam"===n)return"team";if("wishedPositions"===n||"wishedPositionsCategories"===n)return"wishedPositions";if("numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n)return"numberPerDay";if("campaignReply"===n)return"campaignReply";switch(t){case Sn.Address:case Sn.Text:case Sn.Textarea:return"text";case Sn.Country:case Sn.Language:case Sn.Nationality:case Sn.Select:case Sn.Sex:return"select";case Sn.Checkbox:case Sn.Validation:return"checkbox";case Sn.Phone:return"phone";case Sn.Number:return"number";case Sn.DateTimeRange:return"dateTimeRange";case Sn.Date:return"date";case Sn.Datetime:return"datetime";case Sn.File:return"file";case Sn.Campaign:return"campaign";default:return"unknown"}}function OI(e){return"numberOfAccreditations"===e||"numberOfAssignments"===e}function RI(e){const n=e.slug,t=(e,t)=>({slug:n,operator:e,...t});switch(zI(e)){case"condition":case"leader":case"select":return t(Zn.Is,{value:[]});case"admin":case"privacy":case"team":case"unknown":return t(Zn.Is,{value:""});case"file":return t(Zn.IsEmpty,{value:""});case"wishedPositions":return t(Zn.Is,{value:[],value2:1});case"numberPerDay":return t(Zn.Is,{value:"",value2:"",value3:""});case"campaignReply":return t(Zn.Contains,{value:[],value2:""});case"campaign":return t(Zn.Is,{value:[],value2:[]});case"text":case"phone":return t(e.isEncrypted?Zn.IsEmpty:Zn.Contains,{value:""});case"checkbox":return t(Zn.Is,{value:!0});case"number":return t(Zn.Is,{value:"",value2:"",value3:OI(n)?[]:"",value4:""});case"dateTimeRange":return t(Zn.Contains,{value:"",value2:""});case"date":return fh(t(Zn.Is,{value:"",value2:"",value3:ph(n)?[]:void 0,valueDate:{day:-1,month:-1,year:-1}}));case"datetime":return t(Zn.Is,{value:"",value2:""})}}function DI(e){return null!==EI(e)}function MI(e){return Number.isInteger(e)&&e>=0}function PI(e){return"number"==typeof e}function kI(e){return null==e||""===e}function FI(e,n,t){return TI.includes(e.operator)?PI(n):e.operator!==Zn.Between||PI(n)&&PI(t)}function NI(e,n){const{operator:t,value:i,value2:s,value3:o,value4:a}=n;switch(zI(e)){case"condition":return t===Zn.Is||t===Zn.IsNot||f(i);case"leader":return t!==Zn.Contains||f(i);case"select":return t!==Zn.Is&&t!==Zn.IsNot||f(i);case"admin":case"privacy":case"team":case"file":case"checkbox":return!0;case"wishedPositions":return f(i)||t===Zn.IsEmpty||t===Zn.IsNotEmpty;case"numberPerDay":return DI(i)&&(TI.includes(t)||t===Zn.Between)&&FI(n,s,o);case"campaignReply":return f(i)&&(t===Zn.Contains&&w(s)||t===Zn.IsEmpty||t===Zn.IsNotEmpty);case"campaign":return f(i)&&f(s);case"text":case"phone":return t!==Zn.Contains&&t!==Zn.NotContains||w(i);case"number":return(OI(e.slug)||kI(o)&&kI(a)||DI(o)&&DI(a))&&FI(n,i,s);case"dateTimeRange":return DI(i)&&([Zn.Contains,Zn.NotContains,Zn.Is].includes(t)||DI(s));case"date":{const t=Ih(n);return function(e){const{operator:n,value:t,value2:i,valueDate:s}=e;return n===Zn.Is||n===Zn.IsNot?[s?.day,s?.month,s?.year].some(e=>"number"==typeof e&&-1!==e):n===Zn.IsBefore||n===Zn.IsAfter?DI(t):n===Zn.Between?DI(t)&&DI(i):!$I.includes(n)||MI(t)}(t)&&(!ph(e.slug)||f(t.value3))}case"datetime":return function(e){const{operator:n,value:t,value2:i}=e;return[Zn.Is,Zn.IsNot,Zn.IsBefore,Zn.IsAfter].includes(n)?DI(t):n===Zn.Between?DI(t)&&DI(i):!$I.includes(n)||MI(t)}(n);case"unknown":return!1}}const LI=Nr(Xl,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px",variants:{size:{sm:{},md:{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"},responsive:{"@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}}},defaultVariants:{size:"responsive"}}),UI=e=>{const n=(0,de.useMemo)(()=>Mm(e.color??""),[e.color]),t=(0,de.useMemo)(()=>pi.includes(e.icon)?hc(e.icon):e.icon,[e.icon]);return(0,i.jsx)(LI,{align:"center",css:{background:n[100],color:n[700],...e.css},justify:"center",role:"presentation",size:e.size,children:(0,i.jsx)(pc,{icon:t})})};function VI(){return yg(kr.desktop)}const BI=(0,de.forwardRef)(({shouldLightDismiss:e=!0,initialOpen:n=!1,isOpen:t,setIsOpen:s,onClose:o,children:a,...r},d)=>{const[l,c]=(0,de.useState)(n),u=(0,de.useRef)(null),m=t??l,g=s??c;return(0,de.useEffect)(()=>{const e=u.current;return m?function(e){e&&!e.open&&e.showModal()}(e):e?.close(),()=>{e?.close()}},[m]),(0,de.useEffect)(()=>{const n=u.current;function t(e){e.preventDefault(),e.stopPropagation(),r.onClose?.(),g(!1)}function i(e){const{target:n}=e;n instanceof Element&&"DIALOG"===n.nodeName&&t(e)}function s(e){"Escape"===e.code&&t(e)}return e&&n?.addEventListener("click",i),n?.addEventListener("keydown",s),()=>{e&&n?.removeEventListener("click",i),n?.removeEventListener("keydown",s)}},[e,g]),(0,de.useImperativeHandle)(d,()=>({close(){g(!1)},showModal(){g(!0)},isOpen:()=>m,addEventListener(e,n,t){u.current?.addEventListener(e,n,t)},removeEventListener(e,n,t){u.current?.removeEventListener(e,n,t)}}),[m,g]),(0,i.jsxs)(i.Fragment,{children:[false,(0,i.jsx)("dialog",{ref:u,"aria-describedby":r["aria-describedby"],"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],style:r.style,onClose:o,...r["aria-description"]?{"aria-description":r["aria-description"]}:{},children:a})]})});BI.displayName="Dialog";const WI=({children:e,labelId:n,isOpen:t,size:s,setIsOpen:o,...a})=>{const r=VI();return(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)(BI,{"aria-labelledby":n,"data-testid":"right-panel-body",isOpen:t,setIsOpen:o,style:{maxHeight:"none",maxWidth:"none",margin:"0 0 0 0",marginInlineStart:r?"auto":"0",height:"100%",border:"none",inlineSize:r?"sm"===s?"480px":"690px":"100%",top:0,padding:0},onClose:a.onClose,children:(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",boxShadow:"$shadowsXl",blockSize:"100%",flex:1},direction:"column",...a,children:e})})]})},GI=({heading:e,id:n,leftIcon:t,leftIconColor:s,leftIconBorder:o,setIsOpen:a,...r})=>(0,i.jsxs)(Xl,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Xl,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[t&&(0,i.jsx)(Xl,{align:"center",css:{border:o},justify:"center",children:(0,i.jsx)(UI,{color:s,icon:t})}),(0,i.jsx)(Xl,{css:{alignItems:"flex-start",flex:1},direction:"column",id:n,justify:"center",children:e})]}),(0,i.jsx)(Xl,{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)(yc,{color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>a(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]}),qI=e=>(0,i.jsx)(Xl,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),HI=e=>(0,i.jsx)(Xl,{as:"footer",css:{alignSelf:"stretch",background:"$white",borderBlockStart:"1px solid $gray200",marginBlockStart:"auto",padding:"$4 $6"},gap:"3",justify:"end",children:e.children});function YI(e){return{...e,groups:e.groups.map(e=>({...e,key:e.key??ce(),predicates:e.predicates.map(e=>({...e,key:e.key??ce()}))}))}}function ZI(e){return e?.key}const KI=e=>{const{setIsOpen:n}=Cm();return(0,i.jsxs)(ng,{isCheckbox:!1,isRadio:!1,isSelected:!1,value:e.filter.slug,onClick:()=>{e.onSelect(e.filter),n(!1)},children:[e.filter.name,w(e.filter.label)&&(0,i.jsxs)(Zr,{as:"span",color:"gray500",css:{marginLeft:"$1"},fontSize:"textXs",children:["(",e.filter.label,")"]})]})},XI=e=>{const n=os(),[t,s]=(0,de.useState)(""),o=(0,de.useMemo)(()=>{const n=b(t),i=w(t)?e.filters.filter(e=>b(e.name).includes(n)||w(e.label)&&b(e.label).includes(n)):e.filters;return Object.entries((0,l.A)(i,e=>e.category))},[e.filters,t]);return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"invisible",css:{paddingInline:0},leftIcon:"plus",children:e.text})}),(0,i.jsx)(wm,{css:{padding:0},placement:e.placement??"bottom-start",width:560,children:(0,i.jsxs)(Xl,{css:{padding:"$2"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(hu,{autoFocus:!0,icon:"magnifying-glass",placeholder:n("rechercher_un_f_22061"),value:t,onChange:s}),(0,i.jsx)(Zr,{css:{maxHeight:"360px",overflowY:"auto"},children:o.map(([n,t],o)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Km,{index:o,children:n}),t.map(n=>(0,i.jsx)(KI,{filter:n,onSelect:n=>{s(""),e.onSelect(n)}},n.slug))]},n))})]})})]})},QI=e=>{const n=os(),t=e.filter.campaigns??[],s=Array.isArray(e.predicate.value)?e.predicate.value:[],o=Array.isArray(e.predicate.value2)?e.predicate.value2:[],a=(0,Zo.A)(t.filter(({id:e})=>s.includes(e)).map(({campaignType:e})=>e)),r=(0,Zo.A)(["NotSent",...a.includes(Ue.Email)?ai.filter(e=>e!==rn.Queued):[],...a.includes(Ue.Sms)?Fi:[]]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_28439"),values:s,onChange:n=>{e.onChange({...e.predicate,value:n})},children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),s.length>0&&(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_62901"),values:o,onChange:n=>{e.onChange({...e.predicate,value2:n})},children:r.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})]})},JI=Nr("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),ef=Nr("div",{ellipsis:""}),nf=({autoComplete:e,children:n,css:t,label:s,description:o,shouldParseAsInt:a,shouldParseAsBoolean:r,onChange:d,hint:l,icon:c,state:u,value:m="",...g})=>{const h=(0,de.useMemo)(()=>rg(ag(n)),[n]),{inputId:p,descId:I,errorId:f}=Vc();return(0,i.jsxs)(Xl,{css:t,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:p,children:s}),(0,i.jsx)(lu,{id:I,children:o}),(s||o)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(gu,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(Xl,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(ef,{children:h[m.toString()]})}),(0,i.jsx)(Xl,{css:{color:"$gray500"},children:(0,i.jsx)(pc,{icon:"chevron-down"})}),(0,i.jsx)(JI,{"aria-describedby":o?I:void 0,"aria-errormessage":"error"===u?f:void 0,"aria-invalid":"error"===u,autoComplete:e??"off",css:{cursor:"disabled"===u?"not-allowed":"pointer"},disabled:"disabled"===u,id:p,value:m.toString(),onChange:e=>{d(a?parseInt(e.target.value,10):r?"true"===e.target.value:e.target.value)},...g,children:n})]}),(0,i.jsx)(cu,{id:f,state:u,children:l})]})},tf=e=>(0,i.jsx)(nf,{value:e.value,onChange:n=>{e.onChange(n)},children:e.operators.map(({operator:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),sf=e=>{const n=os(),t=e.filter.campaigns??[],{operator:s,value2:o}=e.predicate,a=Array.isArray(e.predicate.value)?e.predicate.value:[],r=(0,de.useMemo)(()=>[{operator:Zn.Contains,name:n("contient_34012")},{operator:Zn.IsEmpty,name:n("est_vide_96759")},{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}],[n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_un_28439"),values:a,onChange:n=>{e.onChange({...e.predicate,value:n})},children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),a.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:r,value:s,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),s===Zn.Contains&&(0,i.jsx)(hu,{value:o??"",onChange:n=>{e.onChange({...e.predicate,value2:n})}})]})]})},of=[Zn.Is,Zn.IsNot],af=e=>{const n=os(),t=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},!0!==e.filter.hideEmpty&&{operator:Zn.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),of.includes(e.predicate.operator)&&(0,i.jsxs)(nf,{shouldParseAsBoolean:!0,value:e.predicate.value??!0,onChange:n=>{e.onChange({...e.predicate,value:n})},children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]})]})},rf=e=>{const n=os(),t=e.filter.values??[],s=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("champ_dont_un_a_44854")},{operator:Zn.IsNot,name:n("champ_d_pendant_33676")},f(e.filter.values)&&{operator:Zn.Contains,name:n("d_pends_du_cham_39787")}]),[e.filter,n]),o=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:s,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),e.predicate.operator===Zn.Contains&&(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:o,onChange:n=>{e.onChange({...e.predicate,value:n})},children:t.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]})},df=({value:e,css:n,label:t,description:s,hint:o,icon:a,min:r,onChange:d,max:l,state:c,rightIcon:u,onRightIconClick:m,zone:g,...h})=>{const p=e?EI(e):null,I=p?.isValid?p.toFormat(ea):"",{inputId:f,descId:x,errorId:_}=Vc();return(0,i.jsxs)(Xl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:f,children:t}),(0,i.jsx)(lu,{id:x,children:s}),(t||s)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"default",icon:a,rightIcon:u,state:c,onRightIconClick:m,children:(0,i.jsx)(Zr,{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?x:void 0,"aria-errormessage":"error"===c?_:void 0,"aria-invalid":"error"===c,disabled:"disabled"===c,id:f,max:l?.toFormat(ea),min:r?.toFormat(ea),type:"date",value:I,onChange:e=>{w(e.target.value)?d(Jo.c9.fromFormat(e.target.value,ea,{zone:g||"UTC"})):d(Jo.c9.invalid("Invalid"))},...h})})}),(0,i.jsx)(cu,{id:_,state:c,children:o})]})};var lf=t(3551);const cf=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>Jo.c9.now().startOf("year"),[]);return(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsxs)(nf,{shouldParseAsInt:!0,value:e.value.day??-1,onChange:n=>{e.onChange({...e.value,day:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("jour_74089")}),(0,Sg.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]}),(0,i.jsxs)(nf,{shouldParseAsInt:!0,value:e.value.month??-1,onChange:n=>{e.onChange({...e.value,month:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("mois_10165")}),(0,Sg.A)(1,13).map(e=>(0,i.jsx)("option",{value:e,children:t.toLocaleString(s.set({month:e}),{month:"long"})},e))]}),(0,i.jsxs)(nf,{shouldParseAsInt:!0,value:e.value.year??-1,onChange:n=>{e.onChange({...e.value,year:n})},children:[(0,i.jsx)("option",{value:"-1",children:n("ann_e_38546")}),(0,lf.A)(1900,s.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]})};function uf(e){return $I.includes(e)}function mf(e,n){return uf(e)===uf(n)?{operator:n}:{operator:n,value:"",value2:""}}function gf(e){return[{operator:Zn.IsInLast,name:e("est_dans_les_n_05750")},{operator:Zn.IsMoreThanAgo,name:e("est_il_y_a_plus_04600")},{operator:Zn.IsInNext,name:e("est_dans_les_n_72234")},{operator:Zn.IsMoreThanAhead,name:e("est_dans_plus_d_94311")}]}const hf=h({day:-1,month:-1,year:-1}),pf=e=>{const n=os(),t=ph(e.filter.slug),s=Ih(e.predicate),{operator:o,value:a,value2:r,value3:d,valueDate:l}=s,c=t&&Array.isArray(d)?d:[],u=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},{operator:Zn.IsBefore,name:n("est_avant_le_16689")},{operator:Zn.IsAfter,name:n("est_apr_s_le_79703")},{operator:Zn.Between,name:n("est_entre_born_59665")},...gf(n),{operator:Zn.Today,name:n("est_aujourd_hui_82571")},{operator:Zn.ThisDayMonth,name:n("est_aujourd_hui_70881")},!0!==e.filter.hideEmpty&&{operator:Zn.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),m=n=>{e.onChange(fh({...s,...n}))};return(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:"campaignSentAt"===e.filter.slug?n("s_lectionner_un_28439"):n("s_lectionner_un_13356"),values:c,onChange:e=>{m({value3:e})},children:(e.filter.values||[]).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(!t||c.length>0)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:u,value:o,onChange:e=>{m(mf(o,e))}}),(o===Zn.Is||o===Zn.IsNot)&&(0,i.jsx)(cf,{value:l??hf,onChange:e=>{m({valueDate:e})}}),(o===Zn.IsBefore||o===Zn.IsAfter)&&(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:a??"",onChange:e=>{m({value:e})}}),o===Zn.Between&&(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:a??"",onChange:e=>{m({value:e})}}),(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:r??"",onChange:e=>{m({value2:e})}})]}),uf(o)&&(0,i.jsx)(hu,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:e=>{m({value:e})}})]})]})},If=({value:e,css:n,label:t,description:s,hint:o,icon:a,min:r,onChange:d,max:l,rightIcon:c,onRightIconClick:u,state:m,zone:g,...h})=>{const p=e?w(e)?Jo.c9.fromISO(e,{zone:"utc"}):e:null,I=p?.isValid?p.toFormat(na):"",{inputId:f,descId:x,errorId:_}=Vc();return(0,i.jsxs)(Xl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:f,children:t}),(0,i.jsx)(lu,{id:x,children:s}),(t||s)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"default",icon:a,rightIcon:c,state:m,onRightIconClick:u,children:(0,i.jsx)(Zr,{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?x:void 0,"aria-errormessage":"error"===m?_:void 0,"aria-invalid":"error"===m,disabled:"disabled"===m,id:f,max:l?.toFormat(na),min:r?.toFormat(na),type:"datetime-local",value:I,onChange:e=>{w(e.target.value)?d(Jo.c9.fromFormat(e.target.value,na,{zone:g||"UTC"})):d(Jo.c9.invalid("Invalid"))},...h})})}),(0,i.jsx)(cu,{id:_,state:m,children:o})]})},ff=e=>{const n=os(),{operator:t,value:s,value2:o}=e.predicate,a=(0,de.useMemo)(()=>e.filter.useLocalZone?ca():void 0,[e.filter]),r=e=>w(e)?Jo.c9.fromISO(e,{zone:a||"UTC"}):e??"",d=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},{operator:Zn.IsBefore,name:n("est_avant_le_16689")},{operator:Zn.IsAfter,name:n("est_apr_s_le_79703")},{operator:Zn.Between,name:n("est_entre_born_59665")},...gf(n),{operator:Zn.Today,name:n("est_aujourd_hui_82571")},!0!==e.filter.hideEmpty&&{operator:Zn.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),l=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:d,value:t,onChange:e=>{l(mf(t,e))}}),(t===Zn.Is||t===Zn.IsNot)&&(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{l({value:e})}}),(t===Zn.IsBefore||t===Zn.IsAfter)&&(0,i.jsx)(If,{value:r(s),zone:a,onChange:e=>{l({value:e})}}),t===Zn.Between&&(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(If,{value:r(s),zone:a,onChange:e=>{l({value:e})}}),(0,i.jsx)(If,{value:r(o),zone:a,onChange:e=>{l({value2:e})}})]}),uf(t)&&(0,i.jsx)(hu,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:s??"",onChange:e=>{l({value:e})}})]})},xf=[Zn.Contains,Zn.NotContains],_f=[Zn.Overlaps,Zn.NotOverlaps,Zn.Engulfs,Zn.NotEngulfs,Zn.EngulfedBy,Zn.NotEngulfedBy],jf=e=>{const n=os(),{operator:t,value:s,value2:o}=e.predicate,a=(0,de.useMemo)(()=>[{operator:Zn.Contains,name:n("contient_34012")},{operator:Zn.Is,name:n("contient_date_89885")},{operator:Zn.NotContains,name:n("ne_contient_pas_85399")},{operator:Zn.Overlaps,name:n("chevauche_49445")},{operator:Zn.NotOverlaps,name:n("ne_chevauche_pa_17307")},{operator:Zn.Engulfs,name:n("engloutis_42346")},{operator:Zn.NotEngulfs,name:n("n_engloutis_pas_42363")},{operator:Zn.EngulfedBy,name:n("est_englouti_pa_47852")},{operator:Zn.NotEngulfedBy,name:n("n_est_pas_englo_08733")}],[n]),r=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:a,value:t,onChange:e=>{r({operator:e})}}),xf.includes(t)&&(0,i.jsx)(If,{max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{r({value:e})}}),t===Zn.Is&&(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{r({value:e})}}),_f.includes(t)&&(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(If,{max:e.filter.endAt,min:e.filter.startAt,placeholder:n("d_but_41840"),value:s??"",onChange:e=>{r({value:e})}}),(0,i.jsx)(If,{max:e.filter.endAt,min:e.filter.startAt,placeholder:n("fin_60104"),value:o??"",onChange:e=>{r({value2:e})}})]})]})},vf=e=>{const n=os(),t=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("est_responsable_47377")},"isDelegationLeader"===e.filter.slug&&{operator:Zn.Contains,name:n("est_responsable_00281")},{operator:Zn.IsNot,name:n("n_est_pas_respo_55625")}]),[e.filter,n]),s=(0,de.useMemo)(()=>bh(e.filter,n),[e.filter,n]),o=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),e.predicate.operator===Zn.Contains&&(0,i.jsx)(lg,{hint:n("_1_s_lectionn_51286",o.length),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:o,onChange:n=>{e.onChange({...e.predicate,value:n})},children:s})]})},Sf=e=>{const n=os(),[t,s]=(0,de.useState)(!f(e.value)),o=(0,de.useMemo)(()=>bh(e.filter,n),[e.filter,n]);return(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",borderRadius:"$2",background:"$white",padding:"$4"},direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textSm",fontWeight:"medium",children:n("le_filtre_se_ba_92445")}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(eg,{state:t?"checked":"unchecked",onClick:()=>{s(!0),e.onChange([])},children:e.allText}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(eg,{state:t?"unchecked":"checked",onClick:()=>s(!1),children:e.someText}),!t&&(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:e.value,onChange:e.onChange,children:o})})]})]})]})},yf=[Zn.Is,Zn.IsNot,Zn.GreaterThan,Zn.GreaterThanEqual,Zn.LessThan,Zn.LessThanEqual],Cf=e=>null!==EI(e),bf=e=>{const n=os(),{slug:t}=e.filter,{operator:s,value:o,value2:a,value3:r,value4:d}=e.predicate,l=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},{operator:Zn.GreaterThan,name:n("plus_grand_que_28412")},{operator:Zn.GreaterThanEqual,name:n("_gal_ou_plus_gr_76897")},{operator:Zn.LessThan,name:n("plus_petit_que_35846")},{operator:Zn.LessThanEqual,name:n("_gal_ou_plus_pe_38400")},{operator:Zn.Between,name:n("est_entre_born_59665")},!0!==e.filter.hideEmpty&&{operator:Zn.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),[c,u]=(0,de.useState)(Cf(r)&&Cf(d)),m=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:l,value:s,onChange:e=>{m({operator:e})}}),yf.includes(s)&&(0,i.jsx)(hu,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:o??"",onChange:e=>{m({value:e})}}),s===Zn.Between&&(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(hu,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:o??"",onChange:e=>{m({value:e})}}),(0,i.jsx)(hu,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:e=>{m({value2:e})}})]}),"numberOfAssignmentsDays"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e),"checked"!==e&&m({value3:"",value4:""})},children:n("filtrer_sur_une_06420")}),c&&(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:r??"",onChange:e=>{m({value3:e})}}),(0,i.jsx)(df,{max:e.filter.endAt,min:e.filter.startAt,value:d??"",onChange:e=>{m({value4:e})}})]})]}),"numberOfAccreditations"===t&&(0,i.jsx)(Sf,{allText:n("sur_toutes_les_40684"),filter:e.filter,someText:n("sur_certaines_a_13180"),value:Array.isArray(r)?r:[],onChange:e=>{m({value3:e})}}),"numberOfAssignments"===t&&(0,i.jsx)(Sf,{allText:n("sur_toutes_les_97037"),filter:e.filter,someText:n("sur_certaines_m_74733"),value:Array.isArray(r)?r:[],onChange:e=>{m({value3:e})}})]})},Af=e=>{const n=os(),{operator:t,value:s,value2:o,value3:a}=e.predicate,r=(0,de.useMemo)(()=>[{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},{operator:Zn.GreaterThan,name:n("plus_grand_que_28412")},{operator:Zn.GreaterThanEqual,name:n("_gal_ou_plus_gr_76897")},{operator:Zn.LessThan,name:n("plus_petit_que_35846")},{operator:Zn.LessThanEqual,name:n("_gal_ou_plus_pe_38400")},{operator:Zn.Between,name:n("est_entre_born_59665")}],[n]),d=n=>{e.onChange({...e.predicate,...n})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(df,{label:n("jour_d_affectat_27334"),max:e.filter.endAt,min:e.filter.startAt,value:s??"",onChange:e=>{d({value:e})}}),(0,i.jsx)(tf,{operators:r,value:t,onChange:e=>{d({operator:e})}}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(hu,{min:0,shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:o??"",onChange:e=>{d({value2:e})}}),t===Zn.Between&&(0,i.jsx)(hu,{min:0,shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:e=>{d({value3:e})}})]})]})},Ef=e=>{const n=os(),t=(0,de.useMemo)(()=>{switch(e.kind){case"admin":return[{operator:Zn.Is,name:n("est_administrat_15766")},{operator:Zn.IsNot,name:n("n_est_pas_admin_58612")}];case"privacy":return[{operator:Zn.Is,name:n("Public")},{operator:Zn.IsNot,name:n("Private")}];case"team":return[{operator:Zn.Is,name:n("est_inscrit_en_86193")},{operator:Zn.IsNot,name:n("n_est_pas_inscr_25311")}];case"file":return[{operator:Zn.IsEmpty,name:n("est_vide_96759")},{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}]}},[e.kind,n]);return(0,i.jsx)(tf,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}})},wf=[Zn.Is,Zn.IsNot],$f=e=>{const n=os(),t=(0,de.useMemo)(()=>(0,sc.A)([{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},!0!==e.filter.hideEmpty&&{operator:Zn.IsEmpty,name:n("est_vide_96759")},!0!==e.filter.hideEmpty&&{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}]),[e.filter,n]),s=(0,de.useMemo)(()=>bh(e.filter,n),[e.filter,n]),o=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),wf.includes(e.predicate.operator)&&(0,i.jsx)(lg,{hint:n("_1_s_lectionn_51286",o.length),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:o,onChange:n=>{e.onChange({...e.predicate,value:n})},children:s})]})},Tf=[Zn.Contains,Zn.NotContains,Zn.StartsWith,Zn.EndsWith],zf=e=>{const n=os(),t=(0,de.useMemo)(()=>{const t=!0===e.filter.isEncrypted,i=!0!==e.filter.hideEmpty;return(0,sc.A)([!t&&{operator:Zn.Contains,name:n("contient_34012")},!t&&{operator:Zn.NotContains,name:n("ne_contient_pas_85399")},!t&&{operator:Zn.StartsWith,name:n("commence_par_11056")},!t&&{operator:Zn.EndsWith,name:n("finit_par_79657")},i&&{operator:Zn.IsEmpty,name:n("est_vide_96759")},i&&{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")},e.showIsValid&&{operator:Zn.IsValid,name:n("est_valide_72630")},e.showIsValid&&{operator:Zn.IsNotValid,name:n("n_est_pas_valid_75405")}])},[e.filter,e.showIsValid,n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:t,value:e.predicate.operator,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),Tf.includes(e.predicate.operator)&&(0,i.jsx)(hu,{value:e.predicate.value??"",onChange:n=>{e.onChange({...e.predicate,value:n})}})]})},Of=[Zn.Is,Zn.IsNot,Zn.Contains],Rf=e=>{const n=os(),t=(0,de.useMemo)(()=>[{operator:Zn.Is,name:n("est_25967")},{operator:Zn.IsNot,name:n("n_est_pas_97826")},{operator:Zn.Contains,name:n("est_le_choix_07450")},{operator:Zn.IsEmpty,name:n("est_vide_96759")},{operator:Zn.IsNotEmpty,name:n("n_est_pas_vide_45804")}],[n]),s=(0,de.useMemo)(()=>bh(e.filter,n),[e.filter,n]),{operator:o,value2:a}=e.predicate,r=Array.isArray(e.predicate.value)?e.predicate.value:[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf,{operators:t,value:o,onChange:n=>{e.onChange({...e.predicate,operator:n})}}),o===Zn.Contains&&(0,i.jsx)(hu,{shouldParseAsInt:!0,treatIntNaNAsNull:!0,value:a??"",onChange:n=>{e.onChange({...e.predicate,value2:n})}}),Of.includes(o)&&(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:n("s_lectionner_de_52380"),values:r,onChange:n=>{e.onChange({...e.predicate,value:n})},children:s})]})},Df=({filter:e,predicate:n,onChange:t})=>{const s=zI(e);switch(s){case"text":case"phone":return(0,i.jsx)(zf,{filter:e,predicate:n,showIsValid:"phone"===s,onChange:t});case"select":return(0,i.jsx)($f,{filter:e,predicate:n,onChange:t});case"checkbox":return(0,i.jsx)(af,{filter:e,predicate:n,onChange:t});case"number":return(0,i.jsx)(bf,{filter:e,predicate:n,onChange:t});case"date":return(0,i.jsx)(pf,{filter:e,predicate:n,onChange:t});case"datetime":return(0,i.jsx)(ff,{filter:e,predicate:n,onChange:t});case"dateTimeRange":return(0,i.jsx)(jf,{filter:e,predicate:n,onChange:t});case"condition":return(0,i.jsx)(rf,{filter:e,predicate:n,onChange:t});case"leader":return(0,i.jsx)(vf,{filter:e,predicate:n,onChange:t});case"admin":case"file":case"privacy":case"team":return(0,i.jsx)(Ef,{kind:s,predicate:n,onChange:t});case"wishedPositions":return(0,i.jsx)(Rf,{filter:e,predicate:n,onChange:t});case"numberPerDay":return(0,i.jsx)(Af,{filter:e,predicate:n,onChange:t});case"campaign":return(0,i.jsx)(QI,{filter:e,predicate:n,onChange:t});case"campaignReply":return(0,i.jsx)(sf,{filter:e,predicate:n,onChange:t});case"unknown":return null}},Mf=e=>{const n=os(),t=function(e){const n=ss(Wg),t=ss(Nh),i=ss(ts),[s,o]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{e.needLoading&&(o(!0),Xp(n,t,i,e).then(()=>{o(!1)}))},[e.needLoading]),s}(e.filter),s=e.showErrors&&!NI(e.filter,e.predicate),o=(0,de.useRef)(null);return(0,de.useEffect)(()=>{if(e.isSelected&&!t){const e=requestAnimationFrame(()=>{o.current?.scrollIntoView({block:"center"})});return()=>{cancelAnimationFrame(e)}}return Ou.A},[t]),(0,i.jsxs)(Xl,{ref:o,css:{background:"$white",border:"1px solid "+(s?"$error500":"$gray200"),borderRadius:"$2",boxShadow:"$xs",overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"4",width:1,children:[(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1"},fontSize:"textSm",fontWeight:"semiBold",children:e.filter.name}),(0,i.jsx)(yc,{"aria-label":n("Supprimer le filtre"),color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})]}),(0,i.jsx)(Xl,{css:{background:"$gray50",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:t?(0,i.jsx)(_c,{}):(0,i.jsx)(Df,{filter:e.filter,predicate:e.predicate,onChange:e.onChange})})]})},Pf=e=>{const n=os();return e.isFirst?(0,i.jsxs)(nf,{css:{width:"fit-content"},value:e.operator,onChange:e.onChange,children:[(0,i.jsx)("option",{value:Kn.And,children:n("And")}),(0,i.jsx)("option",{value:Kn.Or,children:n("Or")})]}):(0,i.jsx)(Zr,{color:"gray800",fontSize:"textSm",fontWeight:"medium",children:e.operator===Kn.Or?n("Or"):n("And")})},kf=e=>{const n=os();return(0,i.jsxs)(Xl,{css:{background:"$white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6"},gap:"4",width:1,children:[(0,i.jsxs)(Zr,{color:"gray900",css:{flex:"1"},fontSize:"textSm",fontWeight:"semiBold",children:[n("groupe_74342")," ",e.index+1]}),(0,i.jsx)(yc,{"aria-label":n("Supprimer le groupe"),color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})]}),(0,i.jsxs)(Xl,{align:"start",css:{padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[e.group.filtersPredicates.map(({filter:n,predicate:t,predicateIndex:s},o)=>(0,i.jsxs)(de.Fragment,{children:[o>0&&(0,i.jsx)(Pf,{isFirst:1===o,operator:e.group.operator,onChange:e.onOperatorChange}),(0,i.jsx)(Mf,{filter:n,isSelected:e.selectedFilterPredicate?.groupIndex===e.group.groupIndex&&e.selectedFilterPredicate.predicateIndex===s,predicate:t,showErrors:e.showErrors,onChange:n=>e.onChange(s,n),onDelete:()=>e.onDeletePredicate(s)})]},ZI(t)??s)),(0,i.jsx)(XI,{filters:e.filters,text:n("ajouter_un_filt_56907"),onSelect:e.onAdd})]})]})},Ff="filters-heading",Nf=e=>{const n=os(),[t,s]=(0,de.useState)(()=>YI(e.predicates)),o=e=>s(n=>YI(e(n))),a=(0,de.useMemo)(()=>yh(t,e.possibleFilters),[t,e.possibleFilters]),r=(0,de.useMemo)(()=>Ch(a).every(({filter:e,predicate:n})=>NI(e,n)),[a]),[d,l]=(0,de.useState)(!1),c=e=>o(n=>{return t=n,i=RI(e),{...t,groups:[...t.groups,{operator:Kn.And,predicates:[i]}]};var t,i});return(0,i.jsxs)(WI,{isOpen:!0,labelId:Ff,setIsOpen:n=>{n||e.onClose()},size:"md",children:[(0,i.jsx)(GI,{heading:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("filtres_64574")}),w(e.subtitle)&&(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:e.subtitle})]}),id:Ff,leftIcon:"sliders",leftIconColor:"gray",setIsOpen:()=>e.onClose()}),(0,i.jsx)(qI,{css:{alignItems:"stretch",flex:"1"},children:0===a.groups.length?(0,i.jsxs)(Xl,{align:"center",css:{background:"$white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs",flex:"1",padding:"$6"},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textSm",children:n("personnaliser_v_62048")}),(0,i.jsx)(XI,{filters:e.possibleFilters,placement:"bottom",text:n("ajouter_un_filt_56907"),onSelect:c})]}):(0,i.jsxs)(Xl,{align:"start",direction:"column",gap:"4",children:[a.groups.map((n,s)=>(0,i.jsxs)(de.Fragment,{children:[s>0&&(0,i.jsx)(Pf,{isFirst:1===s,operator:t.operator,onChange:e=>o(n=>function(e,n){return{...e,operator:n}}(n,e))}),(0,i.jsx)(kf,{filters:e.possibleFilters,group:n,index:s,selectedFilterPredicate:e.selectedFilterPredicate,showErrors:d,onAdd:e=>o(t=>{return i=t,s=n.groupIndex,o=RI(e),uh(i,s,e=>({...e,predicates:[...e.predicates,o]}));var i,s,o}),onChange:(e,t)=>o(i=>function(e,n,t,i){return uh(e,n,e=>({...e,predicates:e.predicates.map((e,n)=>n===t?i:e)}))}(i,n.groupIndex,e,t)),onDelete:()=>o(e=>gh(e,n.groupIndex)),onDeletePredicate:e=>o(t=>mh(t,n.groupIndex,e)),onOperatorChange:e=>o(t=>function(e,n,t){return uh(e,n,e=>({...e,operator:t}))}(t,n.groupIndex,e))})]},ZI(t.groups[n.groupIndex])??n.groupIndex)),(0,i.jsx)(XI,{filters:e.possibleFilters,text:n("ajouter_un_grou_76251"),onSelect:c})]})}),(0,i.jsxs)(HI,{children:[(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")}),(0,i.jsx)(yc,{onClick:()=>{var n;r?(e.onFilter((n=t,{...n,groups:n.groups.map(e=>({...(0,Rr.A)(e,"key"),predicates:e.predicates.map(e=>(0,Rr.A)(e,"key"))}))})),e.onClose()):l(!0)},children:e.buttonText||n("filtrer_78031")})]})]})},Lf=e=>{const n=os(),{areColumnsOpen:t,clearNameCursors:s,columns:o,isFilterOpen:a,possibleColumns:r,predicates:d,selectedFilterPredicate:l,setAreColumnsOpen:c,setColumns:u,setIsFilterOpen:m,setPredicates:g}=ah();return(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(Nf,{buttonText:e.filtersButtonText,possibleFilters:e.filters,predicates:d,selectedFilterPredicate:l,subtitle:e.filtersSubtitle,onClose:()=>{m(!1)},onFilter:e=>{s(),g(e)}}),t&&(0,i.jsx)(CI,{columns:r,initialSelectedColumns:o,saveButtonText:n("_diter_les_colo_39630"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_03763"),title:n("_dition_des_col_70300"),onClose:()=>{c(!1)},onSave:u})]})},Uf=(0,de.createContext)({});function Vf(){return(0,de.useContext)(Uf)}const Bf=Nr("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}}),Wf=e=>{const n=os(),{onClose:t}=Vf();return(0,i.jsxs)(Xl,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(yc,{color:"white",onClick:t,children:n("annuler_48254")}),"function"==typeof e.children?e.children(t):e.children]})},Gf=e=>(0,i.jsx)(Xl,{direction:"column",...Zl(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),qf=({icon:e,iconColor:n,children:t,subtitle:s,onClose:o})=>(0,i.jsxs)(Xl,{children:[(0,i.jsxs)(Xl,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(Xl,{align:"center",css:{border:"1px solid $gray200",borderRadius:"10px",boxShadow:"$xs",color:n||"$gray700",fontSize:"textMd",padding:"$3"},height:48,justify:"center",width:48,children:(0,i.jsx)(pc,{className:"fa-xl",icon:e})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:t}),w(s)&&(0,i.jsx)(Zr,{color:"gray500",children:s})]})]}),o&&(0,i.jsx)(Xl,{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)(pc,{className:"fa-xl",icon:"xmark"})})]}),Hf=({children:e})=>{const{isOpen:n,onClose:t}=Vf();return _m(t),qm("common-front/src/designSystem/components/modals/__deprecated/modal/modal.tsx","common-front/src/designSystem/components/modals/base/modal.tsx"),n?(0,hd.createPortal)((0,i.jsx)(Xl,{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:t,children:(0,i.jsx)(Bf,{onClick:e=>Uc(e,!1),children:e})}),document.body):null},Yf=e=>{const[n,t]=(0,de.useState)(e.isOpen??!1),s=(0,de.useCallback)(()=>{t(!1),e.onClose?.()},[t,e.onClose]);return(0,de.useEffect)(()=>{"boolean"==typeof e.isOpen&&t(e.isOpen)},[e.isOpen]),(0,i.jsx)(Uf.Provider,{value:{isOpen:n,onClose:s,setIsOpen:t},children:e.children})},Zf=e=>{const{setIsOpen:n}=Vf(),t=e.children,s=(0,de.useCallback)(e=>{Uc(e),n(!0),t.props.onClick?.(e)},[n,t]),o=(0,de.useMemo)(()=>(0,de.cloneElement)(de.Children.only(t),{onClick:s,onKeyPress:s,tabIndex:0}),[t,s]);return(0,i.jsx)(i.Fragment,{children:o})},Kf=e=>{const n=os(),t=w(e.content?.[0])?n(e.content[0]):n("ooops_on_a_un_p_56888"),s=((e,n)=>"accreditation_limit_reached"===n?.[0]?[e("_ditez_l_accr_d_66820")]:"delegation_slots_limit_reached"===n?.[0]?[e("la_limite_sur_l_75773")]:"delegation_accreditations_limit_reached"===n?.[0]?[e("la_limite_sur_l_43036")]:"delegation_categories_limit_reached"===n?.[0]?[e("la_limite_sur_l_49480")]:"delegation_profiles_limit_reached"===n?.[0]?[e("la_limite_sur_l_56747")]:"can_not_delete_paired"===n?.[0]?[e("ce_membre_est_d_53903")]:f(n)?n.map(e):[e("une_erreur_est_92333")])(n,e.content);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"triangle-exclamation",iconColor:"$error700",children:t}),(0,i.jsx)(Gf,{css:{color:"$gray500"},hideBorder:!0,children:(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[e.content?s.join(" "):e.children,w(e.requestUuid)&&(0,i.jsx)(wc,{css:{color:"$gray400",fontSize:"$textXs",userSelect:"text",wordBreak:"break-all"},children:n("r_f_rence_1_92505",e.requestUuid)})]})}),(0,i.jsx)(Wf,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(yc,{color:"error",onClick:e.onClose,children:n("fermer_62479")})})]})})},Xf=(0,de.createContext)({}),Qf=e=>{const[n,t]=(0,de.useState)(!1),[s,o]=(0,de.useState)([]),[a,r]=(0,de.useState)(void 0),d=(0,de.useCallback)((e,n)=>{e&&void 0!==n&&fs(n),t(e),o((Array.isArray(n)?n:[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[])),r(function(e){const n=e?.[pa];return"string"==typeof n?n:void 0}(n))},[t,o,r]),l=(0,de.useCallback)(()=>{t(!1),o([]),r(void 0)},[t,o,r]);return(0,i.jsxs)(Xf.Provider,{value:{isError:n,setIsError:d},children:[e.children,n&&(0,i.jsx)(Kf,{content:s,requestUuid:a,onClose:l})]})};function Jf(e){return{numberOfPages:(0,de.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,de.useMemo)(()=>e?.totalCount??0,[e])}}const ex=h([]),nx=e=>{const{isGridDirty:n,...t}=function(e){const{filters:n,initial:t,onChange:i}=e,[s,o]=(0,de.useState)(t.predicates),[a,r]=(0,de.useState)(t.columns),[d,l]=(0,de.useState)(t.columnsSearch),[c,u]=(0,de.useState)(t.rendering),[m,g]=(0,de.useState)(t.sort),[h,p]=(0,de.useState)(t.name||""),[I,f]=(0,de.useState)(t.name||""),[x,_]=(0,de.useState)(t.limit),[j,v]=(0,de.useState)(0),[S,y]=(0,de.useState)(!1),[C,b]=(0,de.useState)(!1),[A,E]=(0,de.useState)(!1),[w,$]=(0,de.useState)(null),T=(0,de.useCallback)(()=>{v(0)},[v]),z=Rg(e=>{f(e),T()}),O=(0,de.useCallback)(e=>{i?.setName?.(e),p(e)},[i?.setName,p]),R=(0,de.useCallback)(()=>{O(""),f(""),T()},[O,f,T]),D=(0,de.useCallback)(e=>{i?.setPredicates?.(e),o(e)},[i?.setPredicates,o]),M=(0,de.useCallback)(e=>{i?.setColumns?.(e),r(e)},[i?.setColumns,r]),P=(0,de.useCallback)(e=>{i?.setColumnsSearch?.(e),l(e)},[i?.setColumnsSearch,l]),k=(0,de.useCallback)(e=>{i?.setRendering?.(e),u(e)},[i?.setRendering,u]),F=(0,de.useCallback)(e=>{i?.setLimit?.(e),_(e),T()},[i?.setLimit,_,T]),N=(0,de.useCallback)(e=>{i?.setSort?.(e),g(e),v(0)},[i?.setSort,g,v]),L=(0,de.useMemo)(()=>yh(s,n),[s,n]),U=(0,de.useMemo)(()=>JSON.stringify(t.predicates),[t.predicates]),V=(0,de.useMemo)(()=>JSON.stringify(t.columns),[t.columns]),B=(0,de.useMemo)(()=>JSON.stringify(t.columnsSearch),[t.columnsSearch]),W=(0,de.useMemo)(()=>JSON.stringify(t.rendering),[t.rendering]),G=(0,de.useMemo)(()=>JSON.stringify(t.sort),[t.sort]),q=(0,de.useMemo)(()=>JSON.stringify(s)!==U||JSON.stringify(a)!==V||JSON.stringify(d)!==B||JSON.stringify(c)!==W||JSON.stringify(m)!==G,[U,s,V,a,B,d,W,c,G,m]);return{areColumnsOpen:A,clearNameCursors:R,columns:a,columnsSearch:d,filtersPredicates:L,isEditMode:S,isFilterOpen:C,isGridDirty:q,limit:x,name:h,nameDebounced:I,offset:j,predicates:s,rendering:c,selectedFilterPredicate:w,setAreColumnsOpen:E,setColumns:M,setColumnsSearch:P,setIsEditMode:y,setIsFilterOpen:b,setLimit:F,setName:O,setNameDebounced:z,setOffset:v,setPredicates:D,setRendering:k,setSelectedFilterPredicate:$,setSort:N,sort:m}}({filters:e.filters,initial:{columns:e.columns,columnsSearch:e.columnsSearch,limit:e.limit,name:e.name,predicates:e.predicates,rendering:e.rendering,sort:e.sort},onChange:{setColumns:e.setColumns,setColumnsSearch:e.setColumnsSearch,setLimit:e.setLimit,setName:e.setName,setPredicates:e.setPredicates,setRendering:e.setRendering,setSort:e.setSort}}),s=sh({}),o=function(e){const{massActions:n}=e,{columns:t,columnsSearch:i,limit:s,nameDebounced:o,offset:a,predicates:r,rendering:d,sort:l}=e.state,c=(0,de.useMemo)(()=>{const n=e.renderingLoaders?.(d);return null===n?{}:{columnsToIncludes:e.columnsToIncludes,getMassActionId:e.getMassActionId,loadDataList:e.loadDataList,loadDataListParams:e.loadDataListParams,loadRow:e.loadRow,loadRowParams:e.loadRowParams,...n}},[d,e.columnsToIncludes,e.getMassActionId,e.loadDataList,e.loadDataListParams,e.loadRow,e.loadRowParams,e.renderingLoaders]),u=(0,de.useMemo)(()=>c.columnsToIncludes?.(t,d)??{},[t,d,c.columnsToIncludes]),m=(0,de.useMemo)(()=>e.renderingParams?.(d)??{},[d,e.renderingParams]),[g,h]=(0,de.useState)(null),[p,I]=(0,de.useState)(!1),{setIsError:x}=(0,de.useContext)(Xf),_=(0,de.useRef)(0),j=(0,de.useCallback)(async()=>{const n=c.loadDataList;if(!n)return;const t=++_.current;I(!0);try{const g=await n({...u,...c.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:w(o)?o:null,columnsSearch:f(i)?i:null,predicatesGroups:r,limit:s,offset:a,sort:l,...m},{token:await fe()});t===_.current&&(h({loadDataList:n,rendering:d,result:g.data,rows:g.data.rows?.nodes??[]}),x(!1),I(!1))}catch(e){t===_.current&&x(!0,e)}},[i,u,s,o,a,r,d,m,x,I,h,l,e.organizationId,e.eventId,c.loadDataList,c.loadDataListParams]),v=!!c.loadDataList&&g?.loadDataList===c.loadDataList&&g.rendering===d,S=v?g.result:null,y=v?g.rows:ex,{numberOfPages:C,totalCount:b}=Jf(S?.rows),[A,E]=(0,de.useState)({}),$=(0,de.useRef)(0),T=(0,de.useCallback)(async n=>{const t=c.loadRow;if(!t)return;const i=$.current,s=()=>i!==$.current;E(e=>({...e,[n]:!0}));try{const i=(await t({...u,...c.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:n},{token:await fe()})).data.row;if(s())return;h(e=>e&&{...e,rows:e.rows.map(e=>e.id===n?i:e)})}catch(e){if(s())return;x(!0,e)}E(e=>({...e,[n]:!1}))},[u,E,x,e.organizationId,e.eventId,c.loadRow,c.loadRowParams]),z=(0,de.useCallback)(e=>c.getMassActionId?.(e)??e.id,[c.getMassActionId]);return(0,de.useEffect)(()=>(j(),()=>{_.current++,I(!1)}),[i,u,s,o,a,r,d,m,l,e.organizationId,e.eventId,c.loadDataList]),(0,de.useEffect)(()=>(E({}),()=>{$.current++}),[g?.result,d,c.loadRow]),(0,de.useEffect)(()=>{c.loadDataList&&(n.setStates(Object.fromEntries(y.map(e=>[`r${z(e)}`,{id:z(e),state:"unchecked"}]))),n.setIsAllSelected(!1))},[y,n.setStates,n.setIsAllSelected]),{data:y,getMassActionId:z,idToLoading:A,isLoading:p||!!c.loadDataList&&!v,loadDataResult:S,numberOfPages:C,reload:j,reloadRow:T,totalCount:b}}({columnsToIncludes:e.columnsToIncludes,eventId:e.eventId,getMassActionId:e.getMassActionId,loadDataList:e.loadDataList,loadDataListParams:e.loadDataListParams,loadRow:e.loadRow,loadRowParams:e.loadRowParams,massActions:s,organizationId:e.organizationId,renderingLoaders:e.renderingLoaders,renderingParams:e.renderingParams,state:t});return(0,i.jsxs)(oh.Provider,{value:{...t,...o,isSaveVisible:n,massActions:s,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,showMassActions:e.showMassActions??!1,showRowDropdown:e.showRowDropdown??!1,showRowEdit:e.showRowEdit??!1},children:[!1===e.showHeader?e.children:(0,i.jsxs)(Xl,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(uI,{renderActions:e.renderActions,renderAllSelectedText:e.renderAllSelectedText,renderControls:e.renderControls,renderPageSelectedText:e.renderPageSelectedText,renderSelectAllText:e.renderSelectAllText,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showPredicatesBadges:e.showPredicatesBadges,showSearchColumns:e.showSearchColumns,showSelectAll:e.showSelectAll}),e.children]}),(0,i.jsx)(Lf,{filters:e.filters,filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle})]})},tx={deserialize(e){const n=parseInt(e||"",10);return isNaN(n)?null:n},serialize:e=>e.toString(10)},ix={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},sx={deserialize:e=>w(e)&&Jo.c9.fromISO(e)?.isValid?Jo.c9.fromISO(e):null,serialize:e=>e.toISO()};function ox(e,n,t={}){const i=ms(),[s,o]=(0,de.useState)("function"==typeof t.deserialize?t.deserialize(i.getItem(e))||n:i.getItem(e)??n);return[s,(0,de.useCallback)(n=>{o(n),i.setItem(e,"function"==typeof t.serialize?t.serialize(n):n)},[e,o,i])]}const ax=e=>{return(0,i.jsxs)(Mg,{css:{cursor:"pointer",userSelect:"none",...e.css||{}},minWidth:e.minWidth,width:e.width,onClick:()=>{var n,t;e.setSort((n=e.sort,t=e.attribute,null===n||n.attribute!==t?{attribute:t,direction:ut.Asc}:n.direction===ut.Asc?{attribute:t,direction:ut.Desc}:null))},children:[e.children,(0,i.jsx)(ic,{width:"2"}),(0,i.jsx)(pc,{icon:(n=e.sort,t=e.attribute,null===n||n.attribute!==t?"arrow-down-arrow-up":n.direction===ut.Asc?"arrow-up":"arrow-down")})]});var n,t},rx=e=>{const n=!!e.paginationRow;return(0,i.jsx)(mg,{children:(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsxs)(Wu,{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:n?void 0:"$radii$2",borderEndStartRadius:n?void 0:"$radii$2"},"& .table-header-row, & .table-row":{borderLeft:"none",borderRight:"none"},...e.css},gridtemplaterows:"44px 1fr",children:[e.headerRow,(0,i.jsx)(Zr,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},dx=(0,de.createContext)({}),lx=e=>{const[n,t]=(0,de.useState)(!1),[s,o]=(0,de.useState)(null),[a,r]=(0,de.useState)(null),d=(0,de.useId)(),l=(0,de.useMemo)(()=>({isVisible:n,referenceElement:s,popperElement:a,tooltipId:d,setIsVisible:t,setReferenceElement:o,setPopperElement:r}),[n,s,a,d]);return(0,i.jsx)(dx.Provider,{value:l,children:e.children})};function cx(){return(0,de.useContext)(dx)}const ux=e=>{const{isVisible:n,tooltipId:t}=cx();if(n)return(0,i.jsx)(mx,{...e});{const n=(0,i.jsx)("div",{hidden:!0,id:t,role:"tooltip",children:e.children});return e.renderOnPortal?(0,hd.createPortal)(n,document.body):n}},mx=e=>{const{popperElement:n,referenceElement:t,setPopperElement:s,tooltipId:o}=cx(),{floatingStyles:a}=(0,au.we)({elements:{reference:t,floating:n},placement:e.placement,middleware:[(0,au.cY)(4),(0,au.UU)(),(0,au.BN)()],whileElementsMounted:ru.ll}),r=(0,i.jsx)(Xl,{ref:s,align:"center",css:{background:"$grayCustom900",borderRadius:"$1",color:location.origin===ee.HEAVENT_PUBLIC_URL.origin?"contrast-color(var(--colors-grayCustom900))":"white",display:"flex",px:"$3",py:"6px",zIndex:1e3,...a},id:o,justify:"center",role:"tooltip",children:e.children});return e.renderOnPortal?(0,hd.createPortal)(r,document.body):r},gx=e=>{const{setIsVisible:n,setReferenceElement:t,tooltipId:s}=cx(),o=(0,de.cloneElement)(de.Children.only(e.children),{ref:t,"aria-labelledby":s,"aria-describedby":s,onMouseEnter(){n(!0)},onMouseLeave(){n(!1)},onFocus(){n(!0)},onBlur(){n(!1)}});return(0,i.jsx)(Zr,{css:e.css,children:o})},hx=e=>{const{translate:n}=fc(),{getMassActionId:t,massActions:s,reload:o,reloadRow:a}=ah(),{showMassActions:r,showRowDropdown:d,showRowEdit:l}=e,c=s.states[`r${t(e.row)}`]?.state??"unchecked",u=(0,de.useCallback)(()=>{a(e.row.id)},[e.row.id,a]),m=d||l;return(0,i.jsxs)(Eg,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{vm(e.target)},children:[r&&(0,i.jsx)(_g,{justify:"center",width:48,children:(0,i.jsx)(Ym,{state:c,onClick:(n,i)=>{s.toggleRow(`r${t(e.row)}`,n,i.shiftKey)}})}),e.selectedColumns.map(n=>(0,i.jsx)(de.Fragment,{children:e.renderCell(n,e.row,u)},n.slug)),m&&(0,i.jsxs)(Vg,{justify:"center",children:[l&&e.getEditPath&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,o)]}),e.renderRowPanels?.(e.row,u)]})},px=e=>{const{columns:n,data:t,idToLoading:s,isLoading:o,limit:a,massActions:r,numberOfPages:d,offset:l,possibleColumns:c,setLimit:u,setOffset:m,setSort:g,sort:h,totalCount:p,...I}=ah(),f=e.showMassActions??I.showMassActions,x=e.showRowDropdown??I.showRowDropdown,_=e.showRowEdit??I.showRowEdit,j=(0,de.useMemo)(()=>n.flatMap(e=>(0,sc.A)([c.find(n=>n.slug===e)])),[n,c]);return(0,i.jsx)(Xl,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(rx,{"aria-busy":o,headerRow:(0,i.jsxs)(cg,{children:[f&&(0,i.jsx)(Mg,{justify:"center",width:48,children:(0,i.jsx)(Ym,{state:r.selectAllState,onClick:r.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(ax,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:g,sort:h,width:e.width,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Mg,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(x||_)&&(0,i.jsx)(Mg,{width:100})]}),paginationRow:(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{limit:a,numberOfPages:d,offset:l,setLimit:u,setOffset:m,showLimits:!0,totalCount:p})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):t.map(n=>s[n.id]?(0,i.jsx)(Pg,{},n.id):(0,i.jsx)(hx,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:n,selectedColumns:j,showMassActions:f,showRowDropdown:x,showRowEdit:_},n.id))})})};var Ix,fx,xx,_x;!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"}(_x||(_x={}));let jx=class extends Eh{constructor(e,n,t){super(e,n,t)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:Sn.Select,values:li.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:Sn.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:_x.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:Sn.Number},{slug:_x.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:Sn.Number}]}getPossibleColumns(){return[{slug:_x.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:Fn.Id,width:100},{slug:_x.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:_x.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:Fn.InsertedAt,width:200},{slug:_x.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:Fn.PeriodEndAt,width:200},{slug:_x.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:_x.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:_x.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:_x.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:_x.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180},{slug:_x.WeezeventOrganizationId,name:this.t("id_de_l_organis_67465"),isSortable:!0,sortAttribute:Fn.WeezeventOrganizationId,width:100}]}};function vx(e){switch(e){case In.Accreditation:return"badge-check";case In.Api:return"code-branch";case In.Beta:return"flask";case In.Community:return"people-group";case In.Criblage:return"filter";case In.CustomDocument:return"file";case In.Delegation:return"users";case In.Documents:return"file";case In.Eid:return"id-card";case In.KmlImport:return"cloud-arrow-up";case In.Languages:return"language";case In.Multiform:return"file-lines";case In.Skidata:return"person-skiing";case In.Sms:return"message";case In.Weezevent:return"ticket";case In.Zapier:return"bolt";default:return Ic()}}jx=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Ix=void 0!==dh&&dh)?Ix:Object,"function"==typeof(fx=void 0!==Wg&&Wg)?fx:Object,"function"==typeof(xx=void 0!==ts&&ts)?xx:Object])],jx);const Sx=(e,n)=>{n?.startsWith("/")||(console.warn(`Path '${n}' missing leading slash`),n="/"+n);const t=new P(ee.HEAVENT_PUBLIC_URL);return Im.has(e)&&(t.host=Im.get(e)),t.pathname+=n,t.href},yx=({organizationId:e,eventId:n,delegationId:t,formId:i,teamCode:s,query:o})=>{const a=new P(ee.HEAVENT_PUBLIC_URL);return Im.has(e)&&(a.host=Im.get(e)),a.pathname+=`${(()=>{if(t)return"number"==typeof n?vo.DELEGATION_FORM({organizationId:e,delegationId:t,eventId:n,formId:i}):vo.DELEGATION_FORM({organizationId:e,delegationId:t,formId:i});{const t="number"==typeof n?eo.EVENT_FORM({organizationId:e,eventId:n,formId:i}):Os.ORGANIZATION_FORM({organizationId:e,formId:i});return w(s)?`${t}/team/${s}`:t}})()}`,w(o?.email)&&a.searchParams.set("email",o.email),o?.preview&&a.searchParams.set("preview",o?.preview?.toString()),o?.previewState&&a.searchParams.set("state",o?.previewState?.toString()),a.href};var Cx;!function(e){e.QR="qr",e.Code39="code39"}(Cx||(Cx={}));const bx=(e,n)=>{const t=new P(ee.HEAVENT_API_URL);return t.pathname+=`/barcode/${n?.barcodeType??Cx.QR}`,t.searchParams.set("text",e),t.searchParams.set("color",n?.color??"000000"),n?.height&&t.searchParams.set("height",n?.height?.toString()),n?.width&&t.searchParams.set("width",n?.width?.toString()),t.href},Ax=({organizationId:e,eventId:n,lang:t,pathComponent:i,key:s,searchParams:o})=>{const a=new P(ee.HEAVENT_API_URL);return a.pathname+=n?`/export/organization/${e}/event/${n}/${i}`:`/export/organization/${e}/${i}`,w(s)&&a.searchParams.set("key",s),w(t)&&a.searchParams.set("lang",t),Object.entries(o??{}).forEach(([e,n])=>{a.searchParams.set(e,n)}),a.href};function Ex(e,n,t={}){const i=new P(ee.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${n}`;const s=new URLSearchParams(Object.entries(t).filter(([e,n])=>w(n)));for(const[e,n]of s)i.searchParams.set(e,n);return i.href}const wx=e=>new P(`https://${ee.HEAVENT_APP_URL.subdomain}.${ee.WEEZEVENT_DOMAIN}`,void 0,void 0,e);function $x(e,n){return wx("number"==typeof n?`ticket/O${e}/E${n}`:`ticket/O${e}`).href}function Tx(e,n){return wx("number"==typeof n?`access/O${e}/E${n}`:`access/O${e}`).href}function zx(e){return(n=wx(`access/O${e}/partners`)).searchParams.append("utm_source","weezcrew"),n.href;var n}function Ox(e,n){return wx(`access/O${e}/checkpoints/edit/${n}`).href}const Rx=e=>{const n=ss(Wg);return e.column.slug===_x.Id?(0,i.jsx)(_g,{width:e.column.width,children:e.row.id}):e.column.slug===_x.WeezeventOrganizationId?(0,i.jsx)(_g,{width:e.column.width,children:e.row.weezeventOrganizationId?(0,i.jsxs)(Ug,{to:$x(e.row.weezeventOrganizationId),children:["O",e.row.weezeventOrganizationId]}):""}):e.column.slug===_x.Name?(0,i.jsx)(_g,{css:{"& a":{color:"$primary500 !important"}},children:(0,i.jsx)(gc,{to:Os.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===_x.InsertedAt?(0,i.jsx)(_g,{width:e.column.width,children:n.toLocaleString(e.row.insertedAt,da.DateOnly.MonthLong)}):e.column.slug===_x.PeriodEndAt?(0,i.jsx)(_g,{width:e.column.width,children:n.toLocaleString(e.row.periodEndAt,da.DateOnly.MonthLong)}):e.column.slug===_x.Features?(0,i.jsx)(_g,{children:(0,i.jsx)(Xl,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(Lm,{leftIcon:vx(e),children:e},e))})}):e.column.slug===_x.NumberOfEvents?(0,i.jsx)(_g,{children:e.row.numberOfEvents}):e.column.slug===_x.NumberOfMembers?(0,i.jsx)(_g,{children:e.row.membersStats.numberOfMembers}):e.column.slug===_x.MembersLimit?(0,i.jsx)(_g,{children:e.row.membersLimit}):e.column.slug===_x.PricePerMember?(0,i.jsx)(_g,{children:e.row.pricePerMember}):(0,i.jsx)(_g,{})},Dx=e=>{const n=os(),{user:t}=ps(),{mutate:s,isLoading:o}=function(e={}){return ds("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:a,isLoading:r}=function(e={}){return ds("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),d=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(Lg,{children:[d.includes(t.id)?(0,i.jsx)(Em,{color:r?"disabled":"default",icon:"minus",onClick:async()=>{await a({organizationId:e.organization.id}),e.reload()},children:n("s_enlever_comme_18919")}):(0,i.jsx)(Em,{color:o?"disabled":"default",icon:"plus",onClick:async()=>{await s({organizationId:e.organization.id}),window.open(`${ee.HEAVENT_APP_URL}${Os.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:n("s_ajouter_comme_70404")}),(0,i.jsx)(Em,{icon:"pen",to:Wo.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:n("_diter_62574")})]})},Mx=()=>{const{history:e,translate:n}=fc(),t=ss(jx),[s,o]=ox(Iu.BACKOFFICE_SEARCH,"",{deserialize(e){const n=new URL(location.href).searchParams.get("q");return w(n)?n:e}}),[a,r]=ox(Iu.BACKOFFICE_COLUMNS,[_x.Id,_x.Name,_x.InsertedAt,_x.PeriodEndAt],ix),[d,l]=ox(Iu.BACKOFFICE_LIMIT,jg,tx),[c,u]=ox(Iu.BACKOFFICE_PREDICATES,[],ix),m=(0,de.useMemo)(()=>lh(c),[c]),[g,h]=ox(Iu.BACKOFFICE_SORT,null,ix);return(0,i.jsx)(Zr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Xl,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:n("organisations_26509")}),(0,i.jsx)(yc,{color:"white",leftIcon:"plus",to:Cs(Os.ORGANIZATIONS),children:n("cr_er_une_organ_06669")}),(0,i.jsx)(yc,{leftIcon:"house",onClick:()=>{e.push(Wo.HOME)},children:"WeezCrew"}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(wm,{placement:"bottom-end",children:(0,i.jsx)(Em,{icon:"eye",onClick:()=>{e.push(Wo.BACKOFFICE_INVOICES)},children:n("voir_les_factur_82290")})})]})]}),(0,i.jsx)(nx,{columns:a,columnsSearch:[],eventId:null,filters:t.getFilters(),limit:d,loadDataList:Md,loadRow:Dd,name:s,organizationId:null,possibleColumns:t.getPossibleColumns(),predicates:m,rendering:gp.List,setColumns:r,setLimit:l,setName:o,setPredicates:u,setSort:h,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:g,children:(0,i.jsx)(px,{getEditPath:e=>Wo.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,n)=>(0,i.jsx)(Rx,{column:e,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(Dx,{organization:e,reload:n})})})]})})},Px=Nr("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),kx=(0,de.forwardRef)((e,n)=>(0,i.jsx)(Zr,{ref:n,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(Px,{children:e.children})}));kx.displayName="CenteredContainer";const Fx=Nr("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"}}),Nx=e=>{const n=cs();return(0,i.jsxs)(Fx,{color:e.color,children:[(0,i.jsxs)(Xl,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(Zr,{css:{flexShrink:3},width:300}),(0,i.jsxs)(Xl,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(Zr,{className:"fsp-category",children:e.category}),(0,i.jsx)(Zr,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.heading})]}),(0,i.jsxs)(Xl,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(yc,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():n.goBack(e.fallbackClosePath||Wo.HOME)}})]})]}),(0,i.jsx)(Zr,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},Lx=({acceptCustomColours:e,css:n,footer:t,header:s,heading:o,subtitle:a,children:r,...d})=>(0,i.jsxs)(Xl,{as:Yl.Section,className:"card",css:{padding:"unset !important",bd:!0,inlineSize:"100%",backgroundColor:"$white","& .card":{backgroundColor:"$gray50","& .card__body":{padding:"$4 $5"}},...n},direction:"column",...d,children:[s||(o||a)&&(0,i.jsx)(Xl,{align:"center",as:Yl.Header,css:{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"},gap:"3",children:(0,i.jsxs)(Zr,{css:{flex:"1"},children:[o&&(0,i.jsx)($c,{css:e?{color:"$grayCustom900"}:void 0,children:o}),a&&(0,i.jsx)(wc,{css:e?{color:"$grayCustom500"}:void 0,textStyle:"subtitle",children:a})]})}),(0,i.jsx)(Xl,{className:"card__body",css:{gap:"$6",padding:"$6 $7","&:empty":{display:"none"}},direction:"column",children:r}),t&&(0,i.jsx)(Xl,{as:Yl.Footer,css:{borderBlockStart:"1px solid $gray200",padding:"$6","&:empty":{display:"none"}},gap:"3",children:t})]}),Ux=(0,de.createContext)({});function Vx(){return(0,de.useContext)(Ux)}const Bx=({name:e,children:n,...t})=>{const{isDisabled:s}=Vx();return(0,i.jsx)(ld.D0,{name:e,render:e=>{const o=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(Zm,{...t,disabled:s??t.disabled,state:o,onClick:()=>{e.input.onChange(!e.input.checked)},children:n})},type:"checkbox"})},Wx=(0,de.memo)(function({name:e,hint:n,state:t,...s}){return(0,i.jsx)(ld.D0,{name:e,render:({input:o,meta:a})=>{const r=a.data?.forceDisplayError&&a.invalid||a.touched&&a.invalid;return(0,i.jsx)(df,{hint:r?a.error:n,name:e,state:r?"error":t,value:o.value,onBlur:o.onBlur,onChange:o.onChange,onFocus:o.onFocus,...s})}})}),Gx=({value:e,onChange:n,...t})=>{const[s,o]=(0,de.useState)(e?.toString()??""),[a,r]=(0,de.useState)(e);return a!==e&&(o(e?.toString()??""),r(e)),(0,i.jsx)(hu,{value:s,onChange:e=>{const t=parseFloat(e);o(e),r(isNaN(t)?null:t),n(isNaN(t)?null:t)},...t})},qx=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(Gx,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),Hx=e=>(0,i.jsx)(Xl,{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 Yx;!function(e){e.Dark="dark",e.Normal="normal"}(Yx||(Yx={}));const Zx=({canSelect:e,centerHeader:n,children:t,disabled:s,footerActions:o,heading:a,header:r,headerStyle:d=Yx.Normal,headerActions:l,hideHeader:c,initialIsOpen:u,isCompleted:m,isOpen:g,isToggleable:h,onSelect:p,onToggle:I,stepNumber:f,subtitle:x,..._})=>{const j=os(),{descId:v}=Vc(),[S,y]=(0,de.useState)(u??!0),C=h?S:g,b=d===Yx.Dark;return(0,i.jsx)(Ux.Provider,{value:{isDisabled:s},children:(0,i.jsx)(Lx,{"aria-describedby":v,as:"fieldset",css:{borderRadius:b?"$1":void 0,overflow:"hidden","&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},..._.css},direction:"column",disabled:s,footer:!1!==C&&o,header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hx,{heading:a}),!c&&(0,i.jsxs)(Xl,{align:"center",as:"header",css:b?{background:C?"$gray900":"white",blockSize:"64px",cursor:e&&!C?"pointer":"default",padding:"$6 $6 $5 $6"}:n?{padding:"$7 $7 0 $7",textAlign:"center"}:!1!==C?{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"}:{padding:"$6 $7"},gap:"3",onClick:p,children:[b&&(0,i.jsx)(Xl,{align:"center",css:{background:m?"$success200":"white",border:m?"none":"1px solid $gray200",borderRadius:"32px",color:m?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:m?(0,i.jsx)(pc,{icon:"check"}):f}),(0,i.jsxs)(Zr,{css:{flex:"1"},children:[a&&(0,i.jsx)($c,{"aria-hidden":"true",css:b?C?{color:"white"}:void 0:{fontWeight:"$semiBold"},children:a}),x&&(0,i.jsx)(wc,{color:b?C?"white":"gray800":void 0,id:v,textStyle:"subtitle",children:x})]}),l&&(0,i.jsx)(Xl,{gap:"4",justify:"end",children:l}),h&&(0,i.jsx)(sI,{label:j("toggle_section_92160"),size:"md",value:S,onChange:e=>{y(e),I?.(e)}})]})]}),..._,children:!1!==C&&(0,i.jsx)(Xl,{css:{"&:has(> fieldset.fieldset--column)":{gap:"$9"}},direction:"column",children:t})})})},Kx=({name:e,hint:n,state:t,multiple:s,...o})=>{const{isDisabled:a}=Vx();return(0,i.jsx)(ld.D0,{name:e,render:r=>{const d=Lc(r.meta);return(0,i.jsx)(lg,{hint:d?r.meta.error:n,multiple:s,name:e,state:d?"error":a?"disabled":t,values:s?Array.isArray(r.input.value)?r.input.value:[]:"number"==typeof r.input.value||w(r.input.value)?[r.input.value]:[],onChange:e=>{s?r.input.onChange(e):f(e)?r.input.onChange(e[0]):r.input.onChange(null)},...o})}})},Xx=({css:e,label:n,description:t,state:s,icon:o,hint:a,rightIcon:r,rightText:d,onChange:l,value:c,variables:u,onBlur:m,onKeyDown:g,onSelect:h,...p})=>{const{inputId:I,descId:f,errorId:x}=Vc(),_=ou({variables:u,onChange:l});return(0,i.jsxs)(Xl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:I,children:n}),(0,i.jsx)(lu,{id:f,children:t}),(n||t)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"text",height:"fluid",icon:o,rightIcon:r,rightText:d,state:s,children:(0,i.jsxs)(Wu,{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":t?f:void 0,"aria-errormessage":"error"===s?x:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:I,value:c,onBlur:()=>{_.close(),m?.()},onChange:e=>{l(e.target.value),_.update(e.currentTarget)},onKeyDown:e=>{_.onKeyDown(e)||g?.(e)},onSelect:e=>{_.update(e.currentTarget),h?.(e)},...p,..._.inputProps}),(0,i.jsx)(du,{completion:_}),(0,i.jsxs)(Zr,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(cu,{id:x,state:s,children:a})]})},Qx=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(Xx,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Jx=e=>(0,i.jsx)(ld.D0,{name:e.name,render:n=>(0,i.jsx)(oI,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:n.input.value,onChange:n.input.onChange,children:e.children})}),e_=Jl.gl(e=>e&&Jo.c9.fromISO(e).isValid);var n_;let t_=class extends ju{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 Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:e_.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")).test("min-period-end-at",this.t("la_date_de_fin_63806"),function(){return Jo.c9.isDateTime(this.parent.periodEndAt)&&this.parent.periodEndAt.isValid&&this.parent.periodEndAt>Jo.c9.fromObject({year:2016})}),features:Jl.YO().of(Jl.Yj().oneOf(li,this.t("les_fonctionnal_36778"))),usersIds:Jl.YO().of(Jl.ai()),isBlocked:Jl.zM().required()})}updateOrganizationSchema(){return Jl.Ik().shape({organization:this.organizationInputSchema()})}};t_=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(n_=void 0!==ts&&ts)?n_:Object])],t_);const i_=Nr("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},grayCustom50:{color:"$grayCustom50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},grayCustom500:{color:"$grayCustom500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},grayCustom700:{color:"$grayCustom700"},gray800:{color:"$gray800"},grayCustom800:{color:"$grayCustom800"},gray900:{color:"$gray900"},grayCustom900:{color:"$grayCustom900"},grayDark50:{color:"$grayDark50"},grayDark100:{color:"$grayDark100"},grayDark500:{color:"$grayDark500"},grayDark700:{color:"$grayDark700"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primaryCustom500:{color:"$primaryCustom500"},primary600:{color:"$primary600"},primaryCustom600:{color:"$primaryCustom600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},primary950:{color:"$primary950"},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"},blueLight50:{color:"$blueLight50"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight500:{color:"$blueLight500"},blueLight600:{color:"$blueLight600"},blueLight700:{color:"$blueLight700"},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"},purpleLight50:{color:"$purpleLight50"},purpleLight100:{color:"$purpleLight100"},purpleLight500:{color:"$purpleLight500"},purpleLight700:{color:"$purpleLight700"},purpleDark50:{color:"$purpleDark50"},purpleDark100:{color:"$purpleDark100"},purpleDark500:{color:"$purpleDark500"},purpleDark700:{color:"$purpleDark700"},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"},orange50:{color:"$orange50"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange500:{color:"$orange500"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},redLight50:{color:"$redLight50"},redLight100:{color:"$redLight100"},redLight500:{color:"$redLight500"},redLight700:{color:"$redLight700"},redDark50:{color:"$redDark50"},redDark100:{color:"$redDark100"},redDark500:{color:"$redDark500"},redDark700:{color:"$redDark700"},green50:{color:"$green50"},green100:{color:"$green100"},green500:{color:"$green500"},green700:{color:"$green700"},greenDark50:{color:"$greenDark50"},greenDark100:{color:"$greenDark100"},greenDark500:{color:"$greenDark500"},greenDark700:{color:"$greenDark700"},brown50:{color:"$brown50"},brown100:{color:"$brown100"},brown500:{color:"$brown500"},brown700:{color:"$brown700"},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"}}),s_=(0,de.forwardRef)((e,n)=>(0,i.jsx)(i_,{...(0,Rr.A)(e,"font"),...Dr(e.font),ref:n,css:e.css}));s_.displayName="Span";const o_=h({"96dpi":{height:1587,width:1123}}),a_=h({"96dpi":{height:1122,width:793}}),r_=h({"96dpi":{height:559,width:396}}),d_=h({"96dpi":{height:323,width:204}}),l_=h({A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"},CB:{height:"53.98mm",width:"85.6mm"}}),c_=e=>{const n=e.event.volunteerRegistration,t=n.userInfo,s=(0,Tg.A)(n.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{background:`url(${ee.HEAVENT_ASSETS_URL}/badges/animaje/convention-2026-2-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsxs)(Zr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"334px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsx)(Zr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:t.fields?.phone?.internationalFormat||""}),(0,i.jsx)(Zr,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:bx(n.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Xl,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:s.map((e,n)=>(0,i.jsxs)(Zr,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(s_,{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]},n))})]}),(0,i.jsxs)(Xl,{css:{background:`url(${ee.HEAVENT_ASSETS_URL}/badges/animaje/convention-2026-3-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsxs)(Zr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"222px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsx)(Zr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:t.fields?.phone?.internationalFormat||""}),(0,i.jsx)(Zr,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:bx(n.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(Zr,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsxs)(Zr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]}),(0,i.jsxs)(Zr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[t.fields?.firstName?.value||""," ",t.fields?.lastName?.value||""]})]})]})};function u_(e,n,t){return e.filter(e=>{if(n?.isValid&&t?.isValid){const i=Jo.IX.fromDateTimes(n.startOf("day"),t.endOf("day"));return e.positionSlot.range.overlaps(i)}return!n?.isValid||e.positionSlot.range.start.startOf("day").equals(n.startOf("day"))})}const m_=[{selector:"p.h-small",css:{"font-size":"12px"}},{selector:"h2",css:{"font-size":"20px","font-weight":"600"}},{selector:"h3",css:{"font-size":"18px","font-weight":"600"}},{selector:"h4",css:{"font-size":"16px","font-weight":"600"}},{selector:"a",css:{color:Lr.colors.primary500.value}},{selector:"blockquote",css:{"border-left":`3px solid ${Lr.colors.gray200.value}`,"font-style":"italic","margin-left":"0","margin-right":"0","padding-left":"16px","padding-right":"16px"}},{selector:"blockquote p",css:{margin:"0","padding-bottom":"8px","padding-top":"8px"}}],g_=e=>e.replace(/-([a-z])/g,(e,n)=>n.toUpperCase());function h_(e){return function(e,n){return Object.fromEntries(e.map(({selector:e,css:t})=>[e.split(",").map(e=>`${n} ${e.trim()}`).join(", "),Object.fromEntries(Object.entries(t).map(([e,n])=>[g_(e),n]))]))}(m_,e)}const p_=e=>(0,i.jsx)(Zr,{className:"h-rich-text",css:{...h_("&"),"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0},"& figure":{margin:"auto","& img":{height:"auto",width:"100%"}},...e.css},dangerouslySetInnerHTML:{__html:e.text},width:1,onClick:e=>{const n=e.target;if(n){const t=n.closest("a");t&&(e.preventDefault(),window.open(t.getAttribute("href"),"_blank"))}}});function I_(e,n){return`https://www.google.com/maps/place/${e},${n}`}const f_=4427,x_=4848,__=e=>e===f_?{color:"#ff5501"}:e===x_?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},j_=e=>e===f_?{color:"white"}:e===x_?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},v_=e=>{const n=e.psuis[0].position,t=(0,Tg.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=n.leaders[0];return(0,i.jsxs)(Xl,{css:{background:`url(${o=e.eventId,o===f_?`${ee.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:o===x_?`${ee.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===o?`${ee.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsx)(Zr,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...j_(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(Zr,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:w(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{...j_(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:e.options.habits})})})}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...j_(e.eventId)},textAlign:"center",width:150,children:s.userInfo.name}),(0,i.jsx)(Zr,{css:{left:"46px",position:"absolute",top:"602px",...j_(e.eventId)},textAlign:"center",width:150,children:s.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Xl,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(Zr,{css:{fontSize:"28px",fontWeight:"700",...__(e.eventId)},textAlign:"center",children:n.name}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:{fontWeight:"700",textTransform:"uppercase",...__(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Xl,{css:{fontSize:"12px"},direction:"column",gap:"1",children:t.map((e,n)=>{const t=e.range.start;return(0,i.jsxs)(Zr,{children:[t.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," à"," ",t.toFormat("H'h'mm",{locale:"fr"})]},n)})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:{fontWeight:"700",textTransform:"uppercase",...__(e.eventId)},children:"Détail de la mission"}),(0,i.jsx)(ic,{height:"1"}),w(n.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:n.description})})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:{fontWeight:"700",textTransform:"uppercase",...__(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(ic,{height:"1"}),Qh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{fontSize:"12px"},children:n.address}),(0,i.jsx)(ic,{height:"1"})]}),(0,i.jsxs)(Xl,{gap:"3",width:1,children:[(0,i.jsx)(Zr,{height:180,width:1,children:(0,i.jsx)("a",{href:I_(n.latitude,n.longitude),style:{background:`url(${ee.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),w(n.fields?.cf45815?.url)&&(0,i.jsx)(Zr,{css:{background:`url(${n.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),w(n.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:{fontWeight:"700",textTransform:"uppercase",...__(e.eventId)},children:"Ton kit bénévole"}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:n.fields.cf44423.replace(/\n/g,"
")}})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:{fontWeight:"700",textTransform:"uppercase",...__(e.eventId)},children:"Un imprévu ?"}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{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},S_=[120785,134101],y_=e=>{const n=u_(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!S_.includes(e.id)),t=(0,Tg.A)(Object.entries(x(n,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:t.map(([n,t],s)=>(0,i.jsx)(v_,{eventId:e.event.id,options:e.options,psuis:t,userInfo:e.event.volunteerRegistration.userInfo},s))})},C_=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],b_={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"},A_=({css:e,name:n})=>(0,i.jsx)(Zr,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${b_[n]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),E_=({event:e})=>{const n=e.volunteerRegistration,t=n.userInfo,s=t.fields?.cf38222?.value,o=n.accreditationsUsersInfos.reduce((e,n)=>C_.includes(n.accreditation.name)?{...e,[n.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2026/bg_badge_recto.jpg) no-repeat",backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(Zr,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"221px"},children:`${t.fields?.firstName?.value||""} ${t.fields?.lastName?.value||""}`.trim().toUpperCase()}),(0,i.jsx)(Zr,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:t.fields.cf38077?.value}),(0,i.jsx)(Zr,{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)(A_,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(A_,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(A_,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(A_,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(A_,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(A_,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(Xl,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2026/bg_badge_verso.jpg) no-repeat",backgroundSize:"cover",position:"relative"},height:476,width:363})]})},w_=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],$_={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"},T_=({css:e,name:n})=>(0,i.jsx)(Zr,{css:{background:`url(${ee.HEAVENT_ASSETS_URL}/badges/hbc/lnh/${$_[n]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),z_=({event:e})=>{const n=e.volunteerRegistration,t=n.userInfo,s=t.fields?.cf38222?.value,o=n.accreditationsUsersInfos.reduce((e,n)=>w_.includes((n.accreditation?.name||"").toUpperCase())?{...e,[n.accreditation.name]:!0}:e,{});return(0,i.jsxs)(Xl,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:r_["96dpi"].height,width:r_["96dpi"].width,children:[(0,i.jsx)(Zr,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:w(t.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(Zr,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:t.id}),(0,i.jsx)(Zr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:t.fields?.lastName?.value||""}),(0,i.jsx)(Zr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:t.fields?.firstName?.value||""}),(0,i.jsx)(Zr,{css:{fontFamily:"$zuumeBold",fontSize:"25px",fontWeight:"700",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"261px"},children:t.fields.cf38077?.value}),(0,i.jsx)(Zr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:s}),o.TERRAIN&&(0,i.jsx)(T_,{css:{left:"45px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(T_,{css:{left:"96px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(T_,{css:{left:"149px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(T_,{css:{left:"201px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(T_,{css:{left:"253px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(T_,{css:{left:"306px"},name:"SALON PRESTIGE"})]})};function O_(e={}){const n=R(e.firstName||"").trim();return`${R(e.lastName||"").trim().toUpperCase()} ${n}`.trim()}const R_=(e,n)=>e.split(n).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function D_(e,n){if(w(e))return R_(e," ");if(w(n)){const[e=""]=n.split("@");return R_(e,".")}return""}const M_=[Lr.colors.success600.value,Lr.colors.blueGray600.value,Lr.colors.blueLight600.value,Lr.colors.purple600.value,Lr.colors.pink600.value,Lr.colors.warning600.value];function P_(e){const n=e.charCodeAt(0);return M_[n%M_.length]}const k_=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}},F_=e=>{const[n,t]=(0,de.useState)(w(e.image)?e.image:void 0);if((0,de.useEffect)(()=>{w(e.image)&&t(e.image)},[e.image]),w(n))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:n,style:{height:`${e.size}px`,width:`${e.size}px`,verticalAlign:"baseline"}})});{const n=D_(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:P_(n),color:"white",display:"flex",fontSize:`${k_(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:n})})}},N_=e=>{const n=e.event.volunteerRegistration.userInfo,t=n.fields.phone?.internationalFormat||"";return(0,i.jsxs)(Xl,{css:{background:`url(${ee.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"Plus Jakarta Sans",fontSize:"$textXs",fontWeight:"$regular",pageBreakBefore:"always",position:"relative"},direction:"column",height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsx)(Zr,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(F_,{email:n.email,image:n.fields?.picture?.url,name:n.name,size:40})}),(0,i.jsxs)(Xl,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(Zr,{css:{color:"$gray800",fontWeight:"600"},children:n.name}),(0,i.jsx)(Zr,{color:"gray800",children:t})]}),(0,i.jsx)(Zr,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(Xl,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},L_=Jo.IX.fromDateTimes(Jo.c9.fromObject({year:2026,month:5,day:22}).startOf("day"),Jo.c9.fromObject({year:2026,month:5,day:24}).endOf("day"));var U_;function V_(){return V_=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const n=ss(Wg),t=e.psui.position,s=t.category,o=e.psui.positionSlot,a=(0,Tg.A)((0,wh.A)(t.leaders.concat(s.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:n.toLocaleString(o.range.start,da.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Xl,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(B_,{})}),(0,i.jsxs)(Zr,{color:"gray800",children:[(0,i.jsx)(s_,{css:{fontWeight:"600"},children:t.name})," | De"," ",o.range.start.toFormat("H:mm")," à ",o.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(Xl,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(q_,{})}),(0,i.jsxs)(Zr,{color:"gray800",children:[(0,i.jsx)(s_,{css:{fontWeight:"600"},children:"Responsable : "}),a]})]}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{css:{color:"black"},children:(0,i.jsx)(p_,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:t.description})})]})},Y_=e=>{const n=e.event.volunteerRegistration,[t,s]=(0,Up.A)(n.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(L_));return(0,i.jsx)(i.Fragment,{children:f(t)&&(0,i.jsx)(N_,{event:e.event,title:"Planning P2N 2026",children:(0,Tg.A)(t,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)(H_,{psui:e},e.id))})})},Z_=e=>{const n=ss(Wg);return(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,Tg.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const t=e.positionSlot;return(0,i.jsxs)(Zr,{color:"gray800",children:[(0,i.jsx)(s_,{css:{fontWeight:"600",textTransform:"capitalize"},children:n.toLocaleString(t.range.start,{month:"long",day:"numeric",weekday:"long"})})," ","| De ",t.range.start.toFormat("H:mm")," à"," ",t.range.end.toFormat("H:mm")]},e.id)})]})},K_=e=>{const n=e.event.volunteerRegistration,[t,s]=(0,Up.A)(n.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(L_)),o=(0,Tg.A)(Object.entries(x(s,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:f(s)&&(0,i.jsx)(N_,{event:e.event,title:"Planning Montage/Démontage P2N 2026",children:o.map(([e,n],t)=>(0,i.jsx)(Z_,{psuis:n},t))})})},X_=e=>e.includes("BLEU_CLAIR")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",Q_=e=>{const n=e.event.volunteerRegistration,t=n.userInfo,s=n.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=t.fields?.cf1019?.value;return(0,i.jsx)(Xl,{css:{background:`url(${X_(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(Xl,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:o})})},J_=e=>e.includes("BLEU_CLAIR")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",ej=e=>{const n=e.event.volunteerRegistration,t=n.userInfo,s=n.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=(0,Zo.A)(n.positionsSlotsUsersInfos.map(e=>e.position.name)),a=s.includes("JAUNE")||s.includes("BLEU_CLAIR")?"black":"white",r=t.fields?.cf20600?.value??"",d=t.fields?.cf21104?.value??"",l=t.fields?.cf21129?.value??[];return(0,i.jsxs)(Xl,{css:{background:`url(${J_(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(Zr,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:bx(n.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(Zr,{css:{borderRadius:"107px",height:"107px",left:"131px",overflow:"hidden",position:"absolute",top:"127px",width:"107px"},children:t.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(Zr,{css:{color:a,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:t.name}),(0,i.jsx)(Xl,{css:{color:a,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:n.state===yt.NotApplicable||"Intervenant"===r?(0,i.jsx)(Zr,{textAlign:"center",width:1,children:d}):"Direction"===r?f(l)?l.map((e,n)=>(0,i.jsx)(Zr,{textAlign:"center",width:1,children:String(e)},n)):null:o.map((e,n)=>(0,i.jsx)(Zr,{textAlign:"center",width:1,children:e},n))}),(0,i.jsx)(Zr,{css:{color:a,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:r})]})},nj=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ej,{event:e.event}),(0,i.jsx)(Q_,{event:e.event})]}),tj=e=>{const n=e.psuis[0].position,t=(0,Tg.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=e.userInfo,o=n.leaders[0],a=n.leaders[1];return(0,i.jsxs)(Xl,{css:{background:`url(${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsx)(Zr,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:w(s.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:s.fields.picture.url,width:"100%"})}),(0,i.jsx)(Zr,{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)(Xl,{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)(Zr,{children:o.userInfo.firstName}),(0,i.jsx)(Zr,{children:o.userInfo.lastName}),(0,i.jsx)(Zr,{children:o.userInfo.phone?.internationalFormat})]}),a&&(0,i.jsxs)(Xl,{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)(Zr,{children:a.userInfo.firstName}),(0,i.jsx)(Zr,{children:a.userInfo.lastName}),(0,i.jsx)(Zr,{children:a.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Xl,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Xl,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:n.name}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zr,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Xl,{direction:"column",gap:"1",children:t.map((e,n)=>{const t=e.range.start,s=e.range.end,o=t.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(Zr,{css:{color:"#333333"},children:[t.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})," -"," ",o?s.toFormat("HH:mm"):s.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})]},n)})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:{fontSize:"16px",fontWeight:"900"},children:"Détails de ta mission :"}),(0,i.jsx)(ic,{height:"2"}),w(n.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:n.description})})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{children:n.address}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{height:180,width:1,children:(0,i.jsx)("a",{href:I_(n.latitude,n.longitude),style:{background:`url(${ee.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),w(n.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zr,{children:n.fields.cf38416})]})]})]})},ij=e=>{const n=u_(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisée"===e.name)),t=(0,Tg.A)(Object.entries(x(n,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:t.map(([n,t],s)=>(0,i.jsx)(tj,{eventId:e.event.id,psuis:t,userInfo:e.event.volunteerRegistration.userInfo},s))})},sj=e=>{const n=e.event.volunteerRegistration,t=n.userInfo;return(0,i.jsxs)(Xl,{css:{background:`url(${s=e.event.id,4183===s?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===s?`${ee.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsxs)(Xl,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(Zr,{children:t.fields?.firstName?.value||""}),(0,i.jsx)(Zr,{children:t.fields?.lastName?.value||""})]}),(0,i.jsxs)(Zr,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(s_,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",t.fields.cf21104?.value]}),(0,i.jsx)(Zr,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:bx(n.ticketId,{height:90,width:90}),width:"100%"})})]});var s},oj=e=>3376===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${ee.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,aj=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"},rj=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},dj=e=>{const n=e.vr.userInfo,t=e.positionSlotUserInfo.position,s=e.positionSlotUserInfo.positionSlot,o=t.leaders[0],a=t.leaders[1],r=3376===(d=e.eventId)?{color:"#2b2378",fontFamily:"$movement",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:3827===d?{color:"#434343",fontFamily:"$graphie",fontSize:"16px",fontWeight:"800",textTransform:"uppercase"}:3823===d?{color:"#1d2b71",fontFamily:"$archerBoldPro",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:3808===d?{color:"#161b4a",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:5233===d?{color:"#434343",fontFamily:"$roboto",fontSize:"18px",fontWeight:"800",textTransform:"uppercase"}:5158===d?{color:"#161b4a",fontFamily:"$acumin",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:5644===d||5341===d?{color:"#161b4a",fontFamily:"$chillax",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:{color:"black",fontFamily:"$atrament",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"};var d;return(0,i.jsxs)(Xl,{css:{background:`url(${oj(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsx)(Zr,{css:{color:5233===e.eventId?"white":"#333333",fontSize:"22px",fontWeight:"700",position:"absolute",right:"40px",textTransform:"uppercase",top:"136px"},children:n.name}),(0,i.jsxs)(Xl,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Zr,{css:aj(e.eventId),textAlign:"center",width:1,children:t.name}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:r,children:"Détails de la mission :"}),(0,i.jsx)(ic,{height:"2"}),w(t.description)&&(0,i.jsx)(Zr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:t.description})}),ep(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:r,children:"Lieu de mission :"}),Qh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{children:t.address})]}),Jh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{height:180,width:1,children:(0,i.jsx)("a",{href:I_(t.latitude,t.longitude),style:{background:`url(${ee.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:r,children:"À cette heure ci :"}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{fontWeight:"700"},children:s.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(Zr,{children:["De ",s.range.start.toFormat("H'h'mm")," à"," ",s.range.end.toFormat("H'h'mm")]})]}),o&&(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(Zr,{children:[o.userInfo.firstName," :"," ",o.userInfo.phone?.internationalFormat]}),a&&(0,i.jsxs)(Zr,{children:[a.userInfo.firstName," :"," ",a.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(ic,{height:"6"}),w(t.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:r,children:"Transports"}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{dangerouslySetInnerHTML:{__html:t.fields.cf38780.split("\n").join("
")}})]})]}),(0,i.jsx)(Zr,{css:{left:"53px",position:"absolute",...rj(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:bx(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},lj=e=>{const n=(0,de.useMemo)(()=>(0,Tg.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:n.map(n=>(0,i.jsx)(dj,{eventId:e.event.id,positionSlotUserInfo:n,vr:e.event.volunteerRegistration},n.positionSlot.id))})},cj="#e30613",uj="#26306b",mj={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vélo",cf25511:"Poste course à pied",cf25512:"Plan d'accès"},gj=Object.keys(mj),hj=e=>{const n=ss(Wg),t=e.positionSlotUserInfo.position,s=t.category,o=e.positionSlotUserInfo.positionSlot,a=s.leaders[0],r=gj.some(e=>w(t.fields[e]?.url)),d=r||"Restauration athlètes"===s.name||"Ravitaillement"===s.name||"Retrait des dossards"===s.name;return(0,i.jsxs)(Xl,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsxs)(Xl,{height:185,width:1,children:[(0,i.jsx)(Xl,{height:1,width:185,children:w(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(Xl,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(Xl,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(Xl,{justify:"between",width:1,children:[(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Zr,{css:{color:cj,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:w(t.acronym)?t.acronym:t.name}),(0,i.jsxs)(Zr,{css:{color:cj,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",s.name]})]}),d&&(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Zr,{css:{color:cj,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(Zr,{css:{color:uj,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:t.address})]})]}),d&&(0,i.jsxs)(Xl,{justify:"between",width:1,children:[(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{css:{color:uj,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(Zr,{css:{color:cj,fontSize:"16px",fontWeight:"500"},children:[t.latitude,", ",t.longitude]})]}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{css:{color:uj,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(Zr,{css:{color:cj,fontSize:"16px",fontWeight:"500",textAlign:"right",textTransform:"capitalize"},children:[n.toLocaleString(o.range.start,{month:"short",day:"numeric",weekday:"short"})," ","| ",o.range.start.toFormat("HH'h'mm")," -"," ",o.range.end.toFormat("HH'h'mm")]})]})]}),!d&&(0,i.jsx)(Xl,{width:1,children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{css:{color:cj,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(Zr,{css:{color:uj,fontSize:"16px",fontWeight:"500"},children:t.address})]})})]})})]}),(0,i.jsx)(Zr,{css:{background:cj},height:10,width:1}),(0,i.jsxs)(Xl,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zr,{css:{color:cj,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(Zr,{css:{color:uj,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(p_,{text:t.description})})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{background:cj},height:10,width:1}),(0,i.jsx)(Xl,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:gj.map(e=>{if(w(t.fields[e]?.url)){const n=mj[e];return(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Zr,{css:{color:cj,fontSize:"20px",fontWeight:"700"},children:n}),(0,i.jsx)(Zr,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:t.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(Xl,{align:"center",css:{background:cj,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problème ?"}),(0,i.jsxs)(Xl,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(Zr,{css:{color:uj,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),a&&(0,i.jsxs)(Zr,{css:{color:uj,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[a.userInfo.name," : ",a.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(Xl,{align:"center",css:{background:uj,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},pj=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((n,t)=>(0,i.jsx)(hj,{options:e.options,positionSlotUserInfo:n,userInfo:e.event.volunteerRegistration.userInfo},t))});function Ij(e,n,t,s){switch(e){case qe.Animajeconvention:return(0,i.jsx)(c_,{event:n});case qe.Asoassignment:return(0,i.jsx)(y_,{date:s,event:n,options:t});case qe.Hbcldc:return(0,i.jsx)(E_,{event:n});case qe.Hbclnh:return(0,i.jsx)(z_,{event:n});case qe.P2nassignment:return(0,i.jsx)(Y_,{event:n});case qe.P2nassignmentmontagedemontage:return(0,i.jsx)(K_,{event:n});case qe.Paris20km:return(0,i.jsx)(nj,{event:n});case qe.Paris20kmassignment:return(0,i.jsx)(ij,{date:s,event:n});case qe.Paris20kmcontremarque:return(0,i.jsx)(sj,{event:n});case qe.Playground:return(0,i.jsx)(lj,{event:n});case qe.T24assignment:return(0,i.jsx)(pj,{event:n,options:t});default:return Ic()}}function fj(e){switch(e){case qe.Animajeconvention:return"Animaje Convention";case qe.Asoassignment:return"Fiche d'affectation ASO";case qe.Hbcldc:return"Badge HBC Ligue des Champions";case qe.Hbclnh:return"Badge HBC LNH";case qe.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case qe.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/Démontage)";case qe.Paris20km:return"Badge 20km de Paris";case qe.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case qe.Paris20kmcontremarque:return"Contremarque 20km de Paris";case qe.Playground:return"Fiche d'affectation Playground";case qe.T24assignment:return"Fiche d'affectation T24";default:return Ic()}}function xj(e){return"number"==typeof e?.latitude&&"number"==typeof e?.longitude?{lat:e.latitude,lng:e.longitude}:void 0}function _j(e,n,t){const i=da.DateOnly.MonthLong;return n.equals(t)?e.toLocaleString(n,i):[e.toLocaleString(n,da.DateOnly.MonthShort),e.toLocaleString(t,da.DateOnly.MonthShort)].join(" - ")}function jj(e){switch(e){case gn.Archived:case gn.Done:return"error";case gn.Ongoing:return"success";case gn.Upcoming:return"purple";default:return Ic()}}function vj(e,n){const t=Jo.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return Jo.IX.fromDateTimes(e.startOf("day"),n.endOf("day")).contains(t)?t:e}const Sj=e=>{const{translate:n}=fc(),{mutate:t}=function(e={}){return ds("mutation BackofficeEventUnarchive($eventId: EventId!) {\n backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{width:100,children:e.event.id}),(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:eo.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{color:jj(e.event.state),children:n(e.event.state)})}),(0,i.jsx)(_g,{children:e.event.state===gn.Archived&&(0,i.jsx)(yc,{color:"invisible",onClick:async()=>{await t({eventId:e.event.id}),e.reload()},children:n("d_sarchiver_76082")})})]})},yj=Jo.c9.fromObject({year:2016}),Cj=e=>{const{history:n,translate:t}=fc(),s=zg(),o=ss(t_),a=ss(ec),{mutate:r}=function(e={}){return ds("mutation BackofficeOrganizationUpdate(\n $id: OrganizationId!\n $organization: BackofficeOrganizationInput!\n) {\n backofficeOrganizationUpdate(id: $id, organization: $organization) {\n id\n }\n}\n",e)}(),[d,l,c]=Dg(""),[u,m]=(0,de.useState)([]),[g,h]=(0,de.useState)({direction:ut.Asc,attribute:mn.Name}),[p,I]=(0,de.useState)(0),{data:x,isLoading:_,reload:j}=rs("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:w(l)?l:void 0,states:f(u)?u:void 0,sort:g,offset:p},[],undefined);const{numberOfPages:v,totalCount:S}=Jf(x.backoffice?.events),y=(0,de.useMemo)(()=>(0,wh.A)(ee.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),C=(0,de.useMemo)(()=>(0,Tg.A)(ei.map(e=>({value:e,name:fj(e)})),({name:e})=>e),[]),b=e=>{h(e),I(0)};return(0,i.jsx)(Fc,{height:1,hideDefaultErrors:!0,initialValues:{organization:o.organizationInputDefault(e.organization)},render:({form:n,handleSubmit:o,submitting:a})=>(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{isLoading:a,textAlign:"center",onClick:o,children:t("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:Wo.BACKOFFICE_ORGANIZATIONS,heading:t("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)(kx,{children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Lx,{children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(pu,{label:t("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Wx,{label:t("date_de_fin_de_17750"),min:yj,name:"organization.periodEndAt"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:li.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("badges_personna_27045"),multiple:!0,name:"organization.customBadges",children:C.map(({value:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("utilisateurs_ay_27051"),multiple:!0,name:"organization.usersIds",children:y.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:t("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{n.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Bx,{name:"organization.isBlocked",children:t("bloquer_l_organ_81103")})]})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("facturation_53594"),children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Jx,{name:"organization.useOldBilling",children:t("utilise_l_ancie_40491")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:t("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(qx,{label:t("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{children:t("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{children:t("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Qx,{label:t("commentaire_sur_40207"),name:"organization.billingComment"})]})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("Event"),children:(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(lg,{isSelectAllVisible:!0,multiple:!0,placeholder:t("State"),values:u,onChange:e=>{m(e),I(0)},children:s(di)})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:d,onChange:e=>{c(e),I(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{width:100,children:"ID"}),(0,i.jsx)(ax,{attribute:mn.Name,setSort:b,sort:g,children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(Mg,{children:t("State")}),(0,i.jsx)(Mg,{})]}),numberOfPages:v,offset:p,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):x.backoffice.events.nodes.map(n=>(0,i.jsx)(Sj,{event:n,organizationId:e.organization.id,reload:j},n.id)),setOffset:I,title:t("liste_des_v_ne_29929"),totalCount:S})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:a,textAlign:"center",onClick:o,children:t("mettre_jour_l_12499")})})]})}),validate:a.validateForForm(o.updateOrganizationSchema()),width:1,onSubmit:async t=>{await r({id:e.organization.id,organization:t.organization}),n.goBack(Wo.BACKOFFICE)}})},bj=()=>{const{organizationId:e}=ls(),{data:n,loader:t}=rs(fd,{organizationId:e},[Ko.OrganizationBackofficeFragment],undefined);return t||(0,i.jsx)(Cj,{organization:n.data.row})},Aj=()=>(fm(os()("back_office_83072")),(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(Mx,{})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(bj,{})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.BACKOFFICE_INVOICES,children:(0,i.jsx)(ih,{})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),Ej=Nr(Xl,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),wj=()=>(0,i.jsx)(Du,{}),$j=(0,de.forwardRef)((e,n)=>(0,i.jsxs)(Ej,{ref:n,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(Zr,{width:100}),(0,i.jsxs)(Xl,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(Xl,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)(wj,{})}),e.children]}),(0,i.jsx)(Xl,{justify:"end",width:100,children:(0,i.jsx)(yc,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));$j.displayName="OnboardingView";const Tj=["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 zj(e){return"string"!=typeof e||""===e.trim()||C(e.toLowerCase())===e}var Oj,Rj;const Dj=["country","code","number"];let Mj=class extends ju{countriesService;constructor(e,n){super(e),this.countriesService=n}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return Jl.Ik().shape({country:Jl.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:Jl.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:Jl.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return Jl.Ik().nullable().shape({country:Jl.Yj(),code:Jl.Yj(),number:Jl.Yj()})}};Mj=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Oj=void 0!==ts&&ts)?Oj:Object,"function"==typeof(Rj=void 0!==dh&&dh)?Rj:Object])],Mj);var Pj,kj,Fj;let Nj=class extends ju{countriesService;phoneInputService;constructor(e,n,t){super(t),this.countriesService=e,this.phoneInputService=n}organizationInputDefault(e){const n=this.countriesService.getDefaultCountryValues();return{name:"",adminFirstName:"",adminLastName:"",adminPhone:this.phoneInputService.phoneInputDefault(n),weezeventOrganizationId:e}}organizationInputSchema(e){let n=Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:Jl.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:Jl.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(n=n.shape({termsAccepted:Jl.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),n}createOrganizationSchema(e){return Jl.Ik().shape({organization:this.organizationInputSchema(e)})}organizationInfosInputDefault(e){const n=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??n.user.country,timeZone:e.timeZone??Jo.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:Jl.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:Jl.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 zj(this.parent.adminEmail)}),street:Jl.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:Jl.Yj().required(this.t("le_code_postal_43189")),city:Jl.Yj().required(this.t("la_ville_est_re_35239")),country:Jl.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:Jl.ai().nullable(),dateFormat:Jl.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:Jl.Yj().required(this.t("le_format_est_r_17097")),timeFormat:Jl.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return Jl.Ik().shape({organization:this.organizationInfosInputSchema()})}};Nj=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Pj=void 0!==dh&&dh)?Pj:Object,"function"==typeof(kj=void 0!==Mj&&Mj)?kj:Object,"function"==typeof(Fj=void 0!==ts&&ts)?Fj:Object])],Nj);var Lj,Uj,Vj;let Bj=class extends xu{countriesService;organizationInputService;translationService;constructor(e,n,t){super(t),this.countriesService=e,this.organizationInputService=n,this.translationService=t}eventInputDefault(e){const n=this.countriesService.getDefaultCountryValues();return{name:e?.name??"",description:e?.description??"",startAt:e?.startAt??Jo.c9.invalid("Invalid"),endAt:e?.endAt??Jo.c9.invalid("Invalid"),languages:e?.languages??[n.user.language],timeZone:e?.timeZone??Jo.c9.local().zoneName??"utc",country:e?.country??n.user.country,layer:e?.layer??Rn.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??{},isWeezticketSynchronized:e?.isWeezticketSynchronized??!0,isWeezaccessSynchronized:e?.isWeezaccessSynchronized??!1,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,delegationsSpaceLayoutId:e?.delegationsSpaceLayoutId??null,groupsAccesses:(e?.groupsAccesses??[]).map(({groupId:e,roleId:n})=>({groupId:e,roleId:n}))}}eventGroupAccessDefault(){return{groupId:null,roleId:null}}eventInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("nom_de_l_v_nem_58512")),description:Jl.Yj(),startAt:e_.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:e_.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 Jo.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Jo.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:Jl.YO().of(Jl.Yj().oneOf(Xu,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:Jl.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(Tj,this.t("le_fuseau_horai_37109")),latitude:Jl.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:Jl.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:Jl.ai().nullable(),dayStartTime:Jl.Yj().required(this.t("l_heure_laque_87748")),isWeezticketSynchronized:Jl.zM().required(),isWeezaccessSynchronized:Jl.zM().required(),usePositions:Jl.zM().required(),useAccreditations:Jl.zM().required(),useDelegations:Jl.zM().required(),useForms:Jl.zM().required(),useDocuments:Jl.zM().required(),useWorkflows:Jl.zM().required(),groupsAccesses:Jl.YO().of(Jl.Ik().shape({groupId:Jl.ai().nullable().required(this.t("vous_devez_s_le_78671")),roleId:Jl.ai().nullable().required(this.t("vous_devez_s_le_18837"))}))})}eventOrganizationInputSchema(e){return Jl.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(e){const n=this.eventInputSchema();return Jl.Ik().shape({event:e?n.shape({fields:e}):n})}};Bj=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Lj=void 0!==dh&&dh)?Lj:Object,"function"==typeof(Uj=void 0!==Nj&&Nj)?Uj:Object,"function"==typeof(Vj=void 0!==ts&&ts)?Vj:Object])],Bj);const Wj=e=>{if(0===e.names.length)return e.render(e.fields);const[n,...t]=e.names,s=n=>(0,i.jsx)(Wj,{fields:[...e.fields,n],names:t,render:e.render,subscription:e.subscription});return void 0===n?s(void 0):(0,i.jsx)(ld.D0,{name:n,render:s,subscription:e.subscription})};function Gj(e){return(0,i.jsx)(Wj,{fields:[],names:e.names,render:n=>e.render(n),subscription:e.subscription})}const qj=Nr("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"}}),Hj=e=>(0,i.jsx)(qj,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),Yj=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:e.height}),(0,i.jsx)(qj,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(ic,{height:e.height})]}),Zj=({value:e,onChange:n,css:t,label:s,state:o,description:a,hint:r,...d})=>{const l=os(),c=(0,de.useCallback)(e=>{e&&g(e.getBoundingClientRect().width)},[]),u=(0,de.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[m,g]=(0,de.useState)(200),[h,p]=(0,de.useState)(!1),[f,x]=(0,de.useState)(""),_=ss(dh),j=(0,de.useMemo)(()=>(0,Tg.A)(_.countries.flatMap(e=>I(e.phoneCode).map(n=>({...e,phoneCode:n}))),({name:e})=>C(e)),[]),v=(0,de.useMemo)(()=>j.find(({code:n,phoneCode:t})=>n===e.country&&t===e.code),[e.country,e.code]),S=(0,de.useMemo)(()=>j.filter(e=>!w(f)||e.name.toLowerCase().includes(f.trim().toLowerCase())||e.phoneCode.includes(f.trim())),[j,f]),y=(0,de.useMemo)(()=>S.map((t,s)=>(0,i.jsx)(Am,{onClick:()=>{n({...e,country:t.code,code:t.phoneCode}),x(""),p(!1)},children:(0,i.jsxs)(Xl,{gap:"2",width:1,children:[(0,i.jsx)(Zr,{children:t.emoji}),(0,i.jsx)(Zr,{css:{ellipsis:!0},children:t.name}),(0,i.jsx)(Zr,{color:"gray500",children:t.phoneCode})]})},s)),[S,e,n]),{inputId:b,descId:A,errorId:E}=Vc();return(0,i.jsxs)(Xl,{ref:c,css:t,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:b,children:s}),(0,i.jsx)(lu,{id:A,children:a}),(s||a)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{children:[(0,i.jsxs)(ym,{disabled:"disabled"===o,isOpen:h,onStateChange:e=>p(e),children:[(0,i.jsx)($m,{children:(0,i.jsx)(gu,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"},cursor:"disabled"===o?"not-allowed !important":void 0},cursor:"pointer",rightIcon:h?"chevron-up":"chevron-down",state:o,children:v&&(0,i.jsxs)(Zr,{width:1,children:[v.emoji," ",v.phoneCode]})})}),(0,i.jsx)(wm,{placement:"bottom-start",renderOnPortal:!0,width:m,children:(0,i.jsxs)(Xl,{direction:"column",height:Math.min(201,40*S.length+41),width:1,children:[(0,i.jsx)(Zr,{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:u,"aria-label":l("indicatif_t_l_p_02025"),placeholder:l("rechercher_un_p_04678"),type:"text",value:f,onChange:e=>{x(e.target.value)}})}),(0,i.jsx)(Hj,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Xl,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:y})]})})]}),(0,i.jsx)(gu,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:o,children:(0,i.jsx)(Zr,{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":a?A:void 0,"aria-errormessage":"error"===o?E:void 0,"aria-invalid":"error"===o,autoComplete:"tel-national",disabled:"disabled"===o,id:b,type:"tel",value:e.number,onChange:t=>{n({...e,number:t.target.value})},...d})})})]}),(0,i.jsx)(cu,{id:E,state:o,children:r})]})},Kj=(0,de.memo)(function({prefix:e,hint:n,state:t,...s}){const{isDisabled:o}=Vx(),a=`${e}country`,r=`${e}code`,d=`${e}number`;return(0,i.jsx)(Gj,{names:[a,r,d],render:([e,a,r])=>{const d=Lc(a.meta)||Lc(r.meta);return(0,i.jsx)(Zj,{hint:d?a.meta.error||r.meta.error:n,state:d?"error":o?"disabled":t,value:{country:e.input.value,code:a.input.value,number:r.input.value},onChange:n=>{e.input.onChange(n.country),a.input.onChange(n.code),r.input.onChange(n.number)},...s})}})}),Xj=(0,de.memo)(function(){const e=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)(pu,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Kj,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),Qj=()=>{const e=os(),{user:n}=ps();return(0,i.jsx)(Bx,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",im(em(n?.language,new URL(location.href).searchParams)),nm)}})})},Jj=e=>{const n=os(),t=Jo.c9.utc(),{event:s}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"event.startAt",onChange:n=>{n.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",n)}}),(0,i.jsx)(pu,{label:n("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsx)(Wx,{label:n("date_de_d_but_43380"),min:t,name:"event.startAt"}),(0,i.jsx)(Wx,{label:n("date_de_fin_86920"),min:s.startAt&&s.startAt.isValid?s.startAt:t,name:"event.endAt"})]})]})},ev=()=>{const{translate:e,params:{weezeventOrganizationId:n}}=fc(),t=ss(Bj),s=ss(Nj),o=ss(ec),{mutate:a}=function(e={}){return ds("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n eventOrganizationCreate(eventOrganization: $eventOrganization) {\n id\n organizationId\n }\n}\n",e)}({redirectOnSuccess:!0}),r=cs(),d=(0,de.useRef)(null),l=!!ps().user?.termsAcceptedAt;return(0,i.jsx)(Fc,{customErrorRef:d,height:1,initialValues:{event:t.eventInputDefault(),organization:s.organizationInputDefault(n)},render:({form:n,values:t,handleSubmit:s})=>(0,i.jsxs)($j,{ref:d,onClose:_e,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{centerHeader:!0,heading:e("dites_en_nous_u_13238"),subtitle:e("param_trer_votr_94121"),children:(0,i.jsx)(Jj,{form:n,values:t})}),(0,i.jsx)(Zx,{heading:e("_propos_de_vot_88855"),subtitle:e("ajouter_le_nom_69919"),children:(0,i.jsx)(Xj,{})}),(0,i.jsx)(Lx,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[!l&&(0,i.jsx)(Qj,{}),(0,i.jsx)(yc,{textAlign:"center",onClick:s,children:e("cr_er_l_v_neme_16731")})]})})]}),validate:o.validateForForm(t.eventOrganizationInputSchema(l)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:n,organizationId:t}}=await a({eventOrganization:e});r.push(eo.EVENT({organizationId:t,eventId:n}))}})},nv=()=>{const{data:e,loader:n}=rs("query HomeOrganizations {\n user {\n roles {\n organizationId\n }\n }\n}\n",{},[],undefined);const t=cs();return(0,i.jsx)(um,{loader:n,onLoad:()=>{const n=e.user?.roles?.[0]?.organizationId;n?t.replace(eo.EVENTS({organizationId:n})):t.replace(Wo.CREATE_EVENT_WITH_ORGANIZATION())}})},tv=()=>{const{translate:e,history:n}=fc(),t=ss(Nj),s=ss(ec),{mutate:o}=function(e={}){return ds("mutation OrganizationCreate($organization: OrganizationInput!) {\n organizationCreate(organization: $organization) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),a=(0,de.useRef)(null),{user:r}=ps(),d=!!r?.termsAcceptedAt;return(0,i.jsx)(Fc,{customErrorRef:a,height:1,hideDefaultErrors:!0,initialValues:{organization:t.organizationInputDefault()},render:({handleSubmit:t})=>(0,i.jsxs)($j,{ref:a,onClose:()=>n.goBack(Wo.BACKOFFICE),children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{centerHeader:!0,heading:e("_propos_de_vot_88855"),subtitle:e("ajouter_le_nom_69919"),children:(0,i.jsx)(Xj,{})}),(0,i.jsx)(Lx,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[!d&&(0,i.jsx)(Qj,{}),(0,i.jsx)(yc,{textAlign:"center",onClick:t,children:e("cr_er_l_organis_55358")})]})})]}),validate:s.validateForForm(t.createOrganizationSchema(d)),width:1,onSubmit:async e=>{const{organizationCreate:{id:t}}=await o({organization:e.organization});n.push(Os.ORGANIZATION({organizationId:t}))}})},iv={PLURAL:"custom-fields",SINGLE:"custom-field"},sv="usage",ov=e=>xs([iv.SINGLE,e]),av={CUSTOM_FIELDS:({eventId:e,...n})=>xs([e?eo.EVENT({...n,eventId:e}):Os.ORGANIZATION(n),iv.PLURAL]),CUSTOM_FIELDS_SEGMENT:({segmentId:e,...n})=>xs([av.CUSTOM_FIELDS(n),e]),CUSTOM_FIELD:({customFieldId:e,eventId:n,...t})=>xs([n?eo.EVENT({...t,eventId:n}):Os.ORGANIZATION(t),ov(e)]),CUSTOM_FIELD_USAGE:({customFieldId:e,...n})=>xs([av.CUSTOM_FIELDS_SEGMENT(n),sv,e]),CREATE:e=>Cs(av.CUSTOM_FIELDS(e)),UPDATE:e=>bs(av.CUSTOM_FIELD(e))},rv={PLURAL:"members",SINGLE:"member"},dv={PLURAL:"profiles",SINGLE:"profile"},lv="accreditations",cv="actions",uv="availabilities",mv="campaigns",gv="changes",hv="comments",pv="documents",Iv="events",fv="form",xv="forms",_v="history",jv="informations",vv="messages",Sv="positions",yv="scans",Cv="segments",bv=e=>xs([rv.SINGLE,e]),Av=e=>xs([dv.SINGLE,e]),Ev={USER_PROFILE:({userInfoId:e,...n})=>xs([Os.ORGANIZATION(n),Av(e)]),USER_PROFILES:e=>xs([Os.ORGANIZATION(e),dv.PLURAL]),ORGANIZATION_MEMBERS:e=>xs([Os.ORGANIZATION(e),rv.PLURAL]),MEMBERS:e=>xs(["delegationId"in e?vo.DELEGATION(e):"eventId"in e&&e.eventId?eo.EVENT(e):Ms.COMMUNITY(e),rv.PLURAL]),MEMBER:({userInfoId:e,...n})=>xs(["eventId"in n&&n.eventId?eo.EVENT(n):Ms.COMMUNITY(n),bv(e)]),MEMBER_INFORMATION:e=>xs([Ev.MEMBER(e),jv]),MEMBER_ACTIONS:e=>xs([Ev.MEMBER(e),cv]),MEMBER_AVAILABILITIES:e=>xs([Ev.MEMBER(e),uv]),MEMBER_COMMENTS:e=>xs([Ev.MEMBER(e),hv]),MEMBER_HISTORY:e=>xs([Ev.MEMBER(e),_v]),MEMBER_HISTORY_CHANGES:e=>xs([Ev.MEMBER(e),_v,gv]),MEMBER_HISTORY_CAMPAIGNS:e=>xs([Ev.MEMBER(e),_v,mv]),MEMBER_HISTORY_EVENTS:e=>xs([Ev.MEMBER(e),_v,Iv]),MEMBER_HISTORY_FORMS:e=>xs([Ev.MEMBER(e),_v,xv]),MEMBER_HISTORY_SCANS:e=>xs([Ev.MEMBER(e),_v,yv]),MEMBER_HISTORY_SEGMENTS:e=>xs([Ev.MEMBER(e),_v,Cv]),MEMBER_POSITIONS:e=>xs([Ev.MEMBER(e),Sv]),MEMBER_ACCREDITATIONS:e=>xs([Ev.MEMBER(e),lv]),MEMBER_FORMS:e=>xs([Ev.MEMBER(e),xv]),MEMBER_FORM:e=>xs([Ev.MEMBER(e),fv,e.formId]),MEMBER_FORM_EDIT:e=>bs(Ev.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>xs([Ev.MEMBER(e),vv]),MEMBER_DOCUMENTS:e=>xs([Ev.MEMBER(e),pv]),CREATE:e=>Cs(Ev.MEMBERS(e))};var wv,$v;function Tv(){return Tv=Object.assign?Object.assign.bind():function(e){for(var n=1;nfunction(e){return b(e).replace(/[\u2018\u2019]/g,"'")}(e));const Dv={[Ov]:{theme:{blueGray900:"#070F48",primary50:"#EBF1FD",primary100:"#D6E3FB",primary200:"#ABC8F7",primary300:"#79AEF4",primary400:"#3F94E9",primary500:"#337AC1",primary600:"#27619A",primary700:"#1B4876",primary800:"#103253",primary900:"#071C33"},icon:zv,logo:(0,i.jsx)(Zr,{css:{blockSize:"20px","& svg":{blockSize:"100%"}},children:(0,i.jsx)(function(e){return de.createElement("svg",Tv({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 30.445"},e),wv||(wv=de.createElement("defs",null,de.createElement("clipPath",{id:"logoFFSA_svg__a"},de.createElement("path",{fill:"none",d:"M0 0h180v30.445H0z","data-name":"Rectangle 1122"})))),$v||($v=de.createElement("g",{"data-name":"Groupe 2259"},de.createElement("path",{fill:"#fff",d:"M7.118.695.001 29.744h14.033l2.71-11.061H34.92l1.694-6.924H18.438l.884-3.612h21.172L42.327.695Z","data-name":"Trac\\xE9 2777"}),de.createElement("path",{fill:"#fff",d:"m44.737.695-7.111 29.05h14.013l2.717-11.061h18.17l1.7-6.924H56.063l.877-3.612h21.174l1.82-7.453Z","data-name":"Trac\\xE9 2778"}),de.createElement("g",{"data-name":"Groupe 2256"},de.createElement("g",{clipPath:"url(#logoFFSA_svg__a)","data-name":"Groupe 2255"},de.createElement("path",{fill:"#fff",d:"M88.784 19.972a3.36 3.36 0 0 0 .045 1.92c.588 1.746 3.564 2.12 6.17 2.12 2.311 0 5.921-.488 6.456-2.643.369-1.517-1.5-1.923-9-3.345-6.884-1.3-14.805-2.561-13.375-8.426C80.721 2.888 90.414.001 99.8.001c9.886 0 18.033 2.4 16.681 9.475H103.22c.521-1.091-.072-1.821-1.086-2.309a9.2 9.2 0 0 0-3.973-.737c-1.9 0-5.121.326-5.515 1.955-.254 2.067 6.142 2.518 12.3 3.664s12.068 3.052 10.768 8.386c-1.851 7.566-13.356 10.011-23.5 10.011-5.156 0-19.6-1.191-17.458-10.474Z","data-name":"Trac\\xE9 2779"}),de.createElement("path",{fill:"#fff",d:"m141.418 19.374-1.893-8.967h-.122l-6.605 8.967ZM134.962.693h13.7l9.472 29.05h-14.541l-.9-4.155h-14.478l-3.046 4.155h-14.1Z","data-name":"Trac\\xE9 2780"}),de.createElement("path",{fill:"#fff",d:"M162.238.531h5.983L161 30.018l-3.4-10.553Z","data-name":"Trac\\xE9 2781"}),de.createElement("path",{fill:"#d80019",d:"M161 30.019 168.221.532H180l-4.656 19.007S172.953 29.998 161 30.019","data-name":"Trac\\xE9 2782"}),de.createElement("path",{fill:"#004391",d:"M151.499.531h10.74l-4.64 18.93Z","data-name":"Trac\\xE9 2783"}))))))},{})})}};function Mv(e){return"production"===r.Development?ee.FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID?Dv[ee.FORCE_WHITE_LABEL_FOR_ORGANIZATION_ID]:void 0:Dv[e]}const Pv=e=>{const n=os();return(0,i.jsxs)(Xl,{align:"center",direction:"column",children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(pc,{icon:e.icon})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textMd",children:e.title||n("la_fonctionnali_59786")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle||n("si_vous_voulez_24448")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(yc,{to:`mailto:${ee.EMAIL_FROM}`,children:n("contacter_l_qu_16617")})]})},kv={PLURAL:"campaigns",SINGLE:"campaign"},Fv={CAMPAIGNS:kv.PLURAL,CAMPAIGN:e=>xs([kv.SINGLE,e])},Nv={CAMPAIGNS:({organizationId:e,eventId:n})=>xs([n?eo.EVENT({organizationId:e,eventId:n}):Ms.COMMUNITY({organizationId:e}),Fv.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:n})=>xs([Nv.CAMPAIGNS({organizationId:e}),n]),CAMPAIGN:({organizationId:e,eventId:n,campaignId:t})=>xs([n?eo.EVENT({organizationId:e,eventId:n}):Ms.COMMUNITY({organizationId:e}),Fv.CAMPAIGN(t)]),CAMPAIGN_DASHBOARD:e=>xs([Nv.CAMPAIGN(e),Ss.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...n})=>xs([Nv.CAMPAIGN(n),Ss.PREVIEW,e]),CREATE(e){const n=Cs(Nv.CAMPAIGNS(e));return e.options?`${n}/${e.options}`:n},CREATE_TEMPLATE:e=>xs([Cs(Nv.CAMPAIGNS(e)),"template"]),UPDATE:e=>bs(Nv.CAMPAIGN(e))},Lv={PLURAL:"workflows",SINGLE:"workflow"},Uv=e=>xs([Lv.SINGLE,e]),Vv={WORKFLOWS:({eventId:e,...n})=>xs([e?eo.EVENT({...n,eventId:e}):Ms.COMMUNITY(n),Lv.PLURAL]),WORKFLOWS_SEGMENT:({segmentId:e,...n})=>xs([Vv.WORKFLOWS(n),e]),WORKFLOW:({workflowId:e,eventId:n,...t})=>xs([n?eo.EVENT({...t,eventId:n}):Ms.COMMUNITY(t),Uv(e)]),WORKFLOW_DASHBOARD:e=>xs([Vv.WORKFLOW(e),Ss.DASHBOARD]),WORKFLOW_HISTORY:e=>xs([Vv.WORKFLOW(e),Ss.HISTORY]),CREATE:e=>Cs(Vv.WORKFLOWS(e)),UPDATE:e=>bs(Vv.WORKFLOW(e))},Bv=e=>{const n=(0,de.useRef)(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("details",{ref:n,open:e.showSection,onToggle:n=>{const t=n.currentTarget.open;t!==e.showSection&&(e.setShowSection(t),e.onToggle?.(t))},children:[(0,i.jsx)("summary",{style:{cursor:"pointer"},children:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(sI,{tabIndex:-1,value:e.showSection,onChange:Ou.A}),(0,i.jsx)(wc,{css:{fontWeight:"$medium"},children:e.toggle})]})}),(0,i.jsx)(Xl,{css:{marginBlockStart:"$5",borderBlockStart:"1px solid $gray200",paddingBlockStart:"$6","&:has(> .card)":{borderBlockStart:"unset",marginBlockStart:"$4",paddingBlockStart:"unset"}},direction:"column",gap:"3",children:e.children})]})})},Wv=({css:e,disabled:n,hideHeading:t,isOpen:s,isOpenToggleLabel:o,onToggle:a,...d})=>{const{descId:l}=Vc(),[c,u]=(0,de.useState)(s??!1);return"production"!==r.Production&&de.Children.toArray(d.children).filter(e=>["RadioText","Radio"].includes(e.type.name)).length>=2&&"radiogroup"!==d.role&&console.warn('This `` element contains multiple `` components, but does not have `role="radiogroup"` set; this may result in incorrect styling (i.e., too much vertical spacing).'),(0,i.jsx)(Ux.Provider,{value:{isDisabled:n},children:(0,i.jsxs)(Xl,{"aria-describedby":l,as:"fieldset",className:"fieldset--column",css:{border:"unset",padding:"unset",margin:"unset",'&[role="radiogroup"]':{gap:"$2","& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset","& > h2":{fontSize:"$textSm",color:"$gray700"},"& + div":{gap:"$3"}}},"&:disabled :is(input, select, textarea, datalist, button)":{cursor:"not-allowed !important"},...e},direction:"column",disabled:o?!c:void 0,gap:o?"5":"6",...d,children:[(0,i.jsx)(Hx,{heading:d.heading}),!t&&(0,i.jsxs)(Xl,{as:Yl.Header,css:{paddingBlockEnd:o?void 0:"$5",borderBlockEnd:o?void 0:"1px solid $gray200"},direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)($c,{"aria-hidden":"true",color:"gray800",textStyle:"heading",children:d.heading}),d.tooltip]}),d.subtitle&&(0,i.jsx)(wc,{id:l,textStyle:"subtitle",children:d.subtitle})]}),o?(0,i.jsx)(Bv,{setShowSection:u,showSection:c,toggle:o,onToggle:a,children:d.children}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Xl,{css:{gap:"$6",'&:not(role="radiogroup"):has(> fieldset.fieldset--column + fieldset.fieldset--column)':{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:d.children})})]})})};var Gv;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(Gv||(Gv={}));const qv=[Gv.Assignments,Gv.Badge,Gv.Certificate,Gv.UserHours,Gv.UserPlanning,Gv.UserPlanningDays,Gv.UserPlanningList];function Hv(e){switch(e){case an.AsoPaxManifest:return"PAX Manifest";case an.Assignments:return"Assignments";case an.Badge:return"Badge";case an.Certificate:return"Certificate";case an.CustomBadge:return"badges_personna_27045";case an.DelegationCalendar:return"planning_des_ac_44426";case an.Planning:return"planning_de_l_96909";case an.Position:return"fiche_de_missio_61604";case an.PositionPlanning:return"plannings_missi_53470";case an.PositionsVolunteersPlanning:return"planning_d_un_g_23684";case an.UserCustomDocument:return"document_person_69340";case an.UserHours:return"UserHours";case an.UserPlanning:return"UserPlanning";case an.UserPlanningDays:return"UserPlanningDays";case an.UserPlanningList:return"UserPlanningList";case an.UsersPictures:return"trombinoscope_11316";case an.VolunteersListing:return"liste_des_membr_89037";default:return Ic()}}const Yv=5e9,Zv=2e7;function Kv(e){let n=e;try{n=new URL(e).pathname}catch{}if(w(n)){const e=n.split(/[\\/]/).pop(),t=e.lastIndexOf(".");let i=e,s="";return t>=0&&(i=e.substring(0,t),s=e.substring(t+1).toLowerCase()),{path:n,name:i,extension:s}}return{path:"",name:"",extension:""}}const Xv=["jpg","png","jpeg","gif"];function Qv(e){const{extension:n}=Kv(e);return Xv.includes(n)}var Jv,eS;function nS(e){return I(e).flatMap(e=>{switch(e){case Jv.Archives:return["zip"];case Jv.Csv:return["csv"];case Jv.Gpx:return["gpx"];case Jv.Images:return["jpg","png","jpeg","gif"];case Jv.Kml:return["kml"];case Jv.Pdf:return["pdf"];case Jv.SmallImages:return["jpg","png","jpeg"];case Jv.Videos:return["mp4","mov","webm","mkv"];default:return Ic()}})}function tS(e){return Math.min(...I(e).flatMap(e=>{switch(e){case Jv.Archives:return Yv;case Jv.Csv:return Zv;case Jv.Images:case Jv.Pdf:return 2e7;case Jv.Kml:case Jv.Gpx:return 1/0;case Jv.SmallImages:return 2e6;case Jv.Videos:return 5e7;default:return Ic()}}))}function iS(e){return I(e).flatMap(e=>e===Jv.Images?"image/*":nS(e).map(e=>`.${e}`)).join(",")}!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",e[e.SmallImages=6]="SmallImages",e[e.Videos=7]="Videos"}(Jv||(Jv={})),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"}(eS||(eS={}));const sS=e=>{switch(e.toLowerCase()){case"csv":return eS.Csv;case"xls":case"xlsx":return eS.Excel;case"gif":return eS.Gif;case"jpg":case"jpeg":return eS.Jpeg;case"pdf":return eS.Pdf;case"png":return eS.Png;case"zip":return eS.Zip;default:return eS.Default}};async function oS(e,n,t,i){const s=await fe(),{name:o,extension:a}=Kv(n.name),r=`organization/${e}/${ce()}/${E(o)}.${a}`,{awsS3PostCredentials:{endpointUrl:d,policy:l,amzCredential:c,amzSignature:u,amzDate:m,amzSecurityToken:g}}=await function(e,n={}){return xa("query AwsS3PostCredentials($organizationId: OrganizationId!, $acl: String!, $key: String!) {\n awsS3PostCredentials(organizationId: $organizationId, acl: $acl, key: $key) {\n endpointUrl\n policy\n amzSignature\n amzCredential\n amzDate\n amzSecurityToken\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:e,acl:t,key:r},{token:s}),h=new FormData;return h.append("key",r),h.append("acl",t),h.append("success_action_status","201"),h.append("X-Amz-Credential",c),h.append("X-Amz-Algorithm","AWS4-HMAC-SHA256"),h.append("X-Amz-Date",m),g&&h.append("X-Amz-Security-Token",g),h.append("Policy",l),h.append("X-Amz-Signature",u),h.append("Content-Type",sS(a)),h.append("file",n),new Promise((e,s)=>{const o=new XMLHttpRequest;o.upload.onprogress=e=>{if(e.lengthComputable){const n=Math.round(e.loaded/e.total*100);i?.(n)}},o.onerror=()=>{s(new Error("Could not upload file to S3"))},o.onreadystatechange=()=>{if(4===o.readyState){const i=o.responseXML?.querySelector("Error Code");null!==i?(fs("Could not upload file to S3",{code:i?.textContent??"",message:o.responseXML?.querySelector("Error Message")?.textContent??""}),s(new Error("Could not upload file to S3"))):e({acl:t,key:r,name:n.name,size:n.size})}},o.open("POST",d,!0),o.send(h)})}const aS=e=>{switch(e.split(".").at(-1)){case"csv":return Zu.FileCSV;case"jpeg":case"jpg":return Zu.FileJPG;case"pdf":return Zu.FilePDF;case"png":return Zu.FilePNG;case"zip":return Zu.FileZIP;default:return Zu.FileBlank}};function rS(e,n){return`https://${n}.s3-eu-west-1.amazonaws.com/${e.key}`}function dS(e){return new Promise((n,t)=>{!function(e,t,i){const s=document.createElement("script");s.onload=()=>{n(!0)},s.onerror=()=>{i&&i()},s.src=e,document.body.appendChild(s)}(e,0,()=>{t(new Error(`Could not load ${e}`))})})}function lS(e,n,t){return 25===e?{transform:`translateX(${n}px) rotate(0.25turn)`,transformOrigin:"top left"}:50===e?{transform:"rotate(0.5turn)"}:75===e?{transform:`translateY(${t}px) rotate(0.75turn)`,transformOrigin:"top left"}:{}}const cS=Nr("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"}}}}),uS=Nr("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 mS;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(mS||(mS={}));const gS=e=>{const{translate:n}=fc(),t=(0,de.useRef)(null),[s,o]=(0,de.useState)(()=>w(e.fileUrl?.trim())?"pdf"===Kv(e.fileName).extension?mS.Pdf:mS.Image:mS.EmptyFile),[a,r]=(0,de.useState)(null),[d,l]=(0,de.useState)(null),[c,u]=(0,de.useState)(s!==mS.EmptyFile),[m,g]=(0,de.useState)(0),[h,p]=(0,de.useState)(100),I=(0,de.useRef)(!1),f=(0,de.useCallback)(()=>{u(!1),o(mS.EmptyFile)},[]);(0,de.useEffect)(()=>{let n=!1;if(s===mS.Pdf)(i=e.fileUrl,(void 0===window.pdfjsLib?dS("https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/build/pdf.min.js"):Promise.resolve(!0)).then(()=>window.pdfjsLib.getDocument(i))).then(e=>{n||l(e)}).catch(()=>{n||f()});else if(s===mS.Image){const i=new Image;i.onload=()=>{if(n||!t.current)return;const e=t.current.getBoundingClientRect(),s=Math.min(e.height/i.height,e.width/i.width);r(i),u(!1),p(s<1?100*(s-.1*s):100)},i.onerror=()=>{n||f()},i.src=e.fileUrl}var i;return()=>{n=!0}},[s,f,e.fileUrl]),(0,de.useEffect)(()=>{if(!d||!t.current)return;const e=t.current;let n=!1;const i=setTimeout(()=>{(async function(e,n,t,i,s){Array.from(n.childNodes).forEach(e=>{n.removeChild(e)});for(let o=1;o<=e.numPages;o++){const a=await e.getPage(o);if(s())return;const r=a.getViewport(t),d=document.createElement("div"),l=document.createElement("canvas"),c=l.getContext("2d"),u=lS(i,r.height,r.width);25===i||75===i?(d.style.height=`${r.width}px`,d.style.width=`${r.height}px`):(d.style.height=`${r.height}px`,d.style.width=`${r.width}px`),l.height=r.height,l.width=r.width,l.style.transform=u.transform||"",l.style.transformOrigin=u.transformOrigin||"",d.appendChild(l),n.appendChild(d),a.render({canvasContext:c,viewport:r})}})(d,e,h/100,m,()=>n).then(()=>{n||(I.current=!0,u(!1))})},I.current?200:0);return()=>{n=!0,clearTimeout(i)}},[d,m,h]);const x=a?a.height*(h/100):0,_=a?a.width*(h/100):0;return(0,i.jsxs)(Xl,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Zr,{ref:t,css:{height:"calc(100% - 50px)",overflow:"auto",padding:"10px",width:"100%",zIndex:"1","& > div":{margin:"auto",marginBottom:"20px"},"& > div:last-child":{marginBottom:"0"}}}),s===mS.Image&&a&&(0,i.jsx)(Zr,{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:a.src,style:{height:`${x}px`,width:`${_}px`,...lS(m,x,_)}})}),c&&(0,i.jsx)(Zr,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(_c,{})}),s===mS.EmptyFile&&(0,i.jsx)(Xl,{align:"center",css:{background:"white",fontSize:"22px",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"20"},justify:"center",children:n("aucun_fichier_77247")}),(0,i.jsxs)(Xl,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(cS,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:()=>{p(e=>Math.max(1,10*Math.floor((e-10)/10)))}}),(0,i.jsx)(uS,{max:"200",min:"1",step:"1",type:"range",value:h,onChange:e=>{p(parseInt(e.target.value,10))}}),(0,i.jsx)("i",{className:"fas fa-plus",onClick:()=>{p(e=>10*Math.ceil((e+10)/10))}})]}),(0,i.jsx)(cS,{rotate:!0,onClick:()=>{g(e=>e+25>=100?0:e+25)},children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})},hS=e=>{const{translate:n}=fc();return(0,hd.createPortal)((0,i.jsx)(Xl,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,onClick:e=>e.stopPropagation(),children:(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{"aria-label":n("download_47607"),color:"white",css:{flexShrink:0},download:e.name,leftIcon:"download",target:"_blank",to:e.url}),heading:e.name,onClose:e.onClose,children:(0,i.jsx)(gS,{fileName:e.name,fileUrl:e.url})})}),document.body)},pS=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),o=Cg(),a="public-read"===e.acl||w(e.document.url),r=w(e.document.url)?e.document.url:rS(e.document,ee.HEAVENT_AWS_UPLOADS_BUCKET),{designSystem:d}=fg();return(0,i.jsxs)(Xl,{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(d){case hg:return{padding:"$3","@tablet":{padding:"$3"}};case pg:return{padding:"$4 $6"};default:Ic()}})()},justify:"between",width:1,...o&&{onClick:()=>{!function(e,n){const t=document.createElement("a");t.href=e,t.target="_blank",t.download=n,t.click()}(r,e.document.name)}},...(0,Rr.A)(e,["acl","document","onDelete"]),children:[(0,i.jsxs)(Xl,{align:"center",css:{maxInlineSize:"80%"},gap:"4",children:[(0,i.jsx)("img",{src:aS(e.document.name),style:{color:"black"}}),(0,i.jsx)(wc,{css:{ellipsis:!0,wordBreak:"break-all",...(()=>{if(d===pg)return{fontWeight:"$medium"}})()},children:e.document.name})]}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsxs)(Xl,{gap:"2",children:[a&&(0,i.jsxs)(i.Fragment,{children:[!1===o&&(0,i.jsx)(yc,{"aria-label":n("view_48132"),color:"white",leftIcon:"eye",onClick:()=>{s(!0)}}),(0,i.jsx)(yc,{"aria-label":n("download_47607"),color:"white",download:e.document.name,leftIcon:"download",target:"_blank",to:r})]}),e.onDelete&&(0,i.jsx)(yc,{"aria-label":n("delete_file_40417"),color:"white",leftIcon:"trash-can",onClick:e.onDelete})]}),t&&(0,i.jsx)(hS,{name:e.document.name,url:r,onClose:()=>s(!1)})]})},IS=Nr("progress",{}),fS=e=>(0,i.jsx)(IS,{...e,children:e.children}),xS=({name:e,progress:n,...t})=>{const s=Math.min(100,Math.max(0,n)),{inputId:o}=Vc();return(0,i.jsxs)(Xl,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,gap:"2",...t,children:[(0,i.jsx)(uu,{htmlFor:o,children:e}),(0,i.jsxs)(fS,{id:o,max:"100",value:s,children:[s,"%"]})]})};var _S,jS=t(3112);let vS=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(Qu(this.translationService.language),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrEmpty(e,{prefix:n}={}){return"number"==typeof e?`${n??""}${e.toLocaleString()}`:""}toNumberOrInfinity(e,{prefix:n}={}){return`${n??""}${"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`}};vS=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(_S=void 0!==ts&&ts)?_S:Object])],vS),t(8181);var SS=t(9618);const yS=({allowCrop:e,onChange:n,hint:t,label:s,...o})=>{const a=os(),{isDisabled:r}=Vx(),d=(0,de.useRef)(null),[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(null),[g,h]=(0,de.useState)(!1),p=nS(Jv.Images),I=e=>{const n=e?.[0];if(n){const e=URL.createObjectURL(n),t=n.type,i=new FileReader;i.onload=i=>{m({src:e,type:(0,jS.h)(i.target?.result,t),name:n.name})},i.readAsArrayBuffer(n)}h(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:r?"not-allowed":"pointer"},disabled:r,height:126,justify:"center",width:126,onClick:()=>{d.current?.click()},onDragEnter:e=>{Uc(e),c(!0)},onDragLeave:e=>{Uc(e),c(!1)},onDragOver:e=>{Uc(e),l||c(!0)},onDrop:t=>{Uc(t),c(!1);const i=t.dataTransfer.files.item(0);i&&p.includes(Kv(i.name).extension)&&(e?I(t.dataTransfer.files):n(i))},children:(0,i.jsx)(Xl,{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)(pc,{icon:"plus"})})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray700",fontWeight:"medium",children:s}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray400",children:t})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:()=>{d.current?.click()},children:a("s_lectionner_un_50712")})})]}),(0,i.jsx)(Zr,{css:{display:"none"},children:(0,i.jsx)("input",{ref:d,accept:iS(Jv.Images),type:"file",onChange:t=>{t.target.files?.[0]&&(e?I(t.target.files):n(t.target.files[0]))},...o})})]}),e&&g&&u&&(0,i.jsx)(CS,{image:u,onChange:n,onClose:()=>h(!1)})]})},CS=({image:e,onChange:n,onClose:t})=>{const s=os(),o=(0,de.useRef)(null);return(0,de.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(Jg,{size:"md",onClose:t,children:(0,i.jsxs)(Xl,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(SS.IOb,{ref:o,className:"cropper",defaultSize:({imageSize:e,visibleArea:n})=>({width:(n||e).width,height:(n||e).height}),src:e.src,stencilProps:{aspectRatio:1}}),(0,i.jsx)(yc,{size:"lg",textAlign:"center",onClick:()=>{const i=o.current?.getCanvas();i&&i.toBlob(t=>{if(t){const i=new File([t],e.name,{lastModified:(new Date).getTime(),type:e.type});n(i)}},e.type,.95),t()},children:s("submit_21373")})]})})},bS="dragover",AS=({accept:e,allowCrop:n,"aria-describedby":t,capture:s,onChange:o,...a})=>{const{translate:r}=fc(),d=as(),{isDisabled:l}=Vx(),c=(0,de.useId)(),u=(0,de.useRef)(null),[m,g]=(0,de.useState)(void 0),[h,p]=(0,de.useState)(null),[I,x]=(0,de.useState)(!1),_=nS(e||[]),j=tS(e||[]),v=e=>{const n=e?.[0];if(n){const e=URL.createObjectURL(n),t=n.type,i=new FileReader;i.onload=i=>{p({src:e,type:(0,jS.h)(i.target?.result,t),name:n.name})},i.readAsArrayBuffer(n)}x(!0)},{designSystem:S}=(0,de.useContext)(Ig);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("input",{ref:u,accept:e?iS(e):void 0,"aria-describedby":[t,c].join(" "),capture:s,style:{display:"none"},type:"file",onChange:t=>{if(t.target.files?.[0])if(n){if(e!==Jv.Images)throw new Error("Crop enabled on non-image file uploader");v(t.target.files)}else o(t.target.files[0])},...a}),(0,i.jsxs)(Xl,{align:"center",className:m,css:{background:"$gray50",borderWidth:"1px",borderColor:"$gray200",borderRadius:"$2",cursor:l?"not-allowed":"pointer",padding:"$4",[`&.${bS}`]:{background:"$primary50",borderColor:"$gray200"},...(()=>{switch(S){case hg:return{borderStyle:"solid"};case pg:return{borderStyle:"dashed",[`&:hover, &:has( input:focus), &.${bS}`]:{borderStyle:"solid",borderColor:"$primary500"}};default:Ic()}})()},direction:"column",disabled:l,gap:"2",width:1,onClick:()=>u.current?.click(),onDragLeave:()=>{g(void 0)},onDragOver:e=>{Uc(e),g(bS)},onDrop:t=>{Uc(t),g(void 0);const i=t.dataTransfer.files.item(0);if(i&&(0===_.length||_.includes(Kv(i.name).extension)))if(n){if(e!==Jv.Images&&e!=Jv.SmallImages)throw new Error("Crop enabled on non-image file uploader");v(t.dataTransfer.files)}else o(i)},children:[(0,i.jsx)(Xl,{align:"center","aria-hidden":!0,css:{color:"$gray600",...(()=>{switch(S){case hg:return{background:"$gray100",borderRadius:"36px"};case pg:return;default:Ic()}})()},height:32,justify:"center",width:32,children:(0,i.jsx)(pc,{icon:"cloud-arrow-down"})}),(0,i.jsxs)(Xl,{css:{textAlign:"center"},direction:"column",justify:"center",wrap:"wrap",children:[(0,i.jsx)(wc,{textStyle:"subtitle",children:[...d(r("_1_ou_glisser_61813","{1}"),(0,i.jsx)(yc,{color:"invisible",css:{height:"auto",padding:0},id:"clickHereLink",type:"button",children:r("cliquez_ici_98447")}))]}),(0,i.jsx)(wc,{id:c,textStyle:"subtitle",children:[...d(r("_1_accept_2_30390","{1}","{2}"),f(_)?_.map((e,n,{length:t})=>(0,i.jsxs)(de.Fragment,{children:[n>0?t-1!==n?", ":" & ":"",(0,i.jsxs)("code",{children:[".",e]})]},e)):r("all_file_format_50211"),j!==1/0?vS.bytesToMegabytes(j):r("no_55268"))]})]})]}),n&&I&&h&&(0,i.jsx)(CS,{image:h,onChange:o,onClose:()=>x(!1)})]})};var ES;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(ES||(ES={}));const wS=({acl:e,css:n,descId:t,description:s,errorId:o,inputId:a,label:r,labelId:d,hint:l,onChange:c,organizationId:u,state:m,value:g,...h})=>{const{translate:p}=fc(),[I,f]=(0,de.useState)(g?ES.File:ES.Uploader),[x,_]=(0,de.useState)(""),[j,v]=(0,de.useState)(0);return(0,i.jsxs)(Xl,{"aria-live":"polite",css:n,direction:"column",gap:"1",width:1,children:[(r||s)&&(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(uu,{htmlFor:a,id:d,children:r}),(0,i.jsx)(lu,{id:t,children:s})]}),I===ES.File&&g?(0,i.jsx)(pS,{acl:e,"aria-label":p("delete_uploaded_14711"),document:g,id:a,role:"button",onDelete:()=>{c(null),f(ES.Uploader)}}):I===ES.Uploading?(0,i.jsx)(xS,{"aria-busy":!0,"aria-describedby":t,"aria-label":p("uploading_file_46483"),id:a,name:x,progress:j}):(0,i.jsx)(AS,{"aria-describedby":t,"aria-errormessage":o,"aria-invalid":"error"===m,"aria-label":p("upload_file_97740"),id:a,onChange:async n=>{f(ES.Uploading),_(n.name),v(0);try{if(n.size>tS(h.accept||[]))throw _(""),alert(p("file_is_too_lar_57859")),new Error;const t=await oS(u,n,e,v);c({...t,file:n}),f(ES.File)}catch{f(ES.Uploader)}},...h}),(0,i.jsx)(cu,{state:m,children:l})]})},$S=e=>{const n=os();return(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(Zr,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",n("facultatif_76747"),")"]})]})},TS=(0,de.createContext)({}),zS=Nr("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),OS=Nr("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{color:{white:{},primary:{}},selected:{true:{borderRadius:"6px",boxShadow:"$sm"}}},compoundVariants:[{color:"white",selected:!0,css:{background:"white",color:"$gray700"}},{color:"primary",selected:!0,css:{background:"$primaryCustom500",color:"white"}}]}),RS=e=>(0,i.jsx)(TS.Provider,{value:{color:e.color??"white",selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(zS,{css:e.css,children:e.children})}),DS=e=>{const{color:n,selectedItem:t,onChange:s}=(0,de.useContext)(TS);return(0,i.jsx)(OS,{color:n,selected:t===e.item,onClick:()=>{s(e.item)},children:e.children})};var MS=t(7785),PS=t(8790),kS=(t(1036),t(6585)),FS=t(2230),NS=t(2910),LS=t(456);const US=["primary","gray","white"];function VS(e){const n=BS[e].border?1:0;return`${12-n}px ${32-n}px`}const BS={primary:{backgroundColor:Lr.colors.primary500.value,color:"white"},gray:{backgroundColor:Lr.colors.gray100.value,color:Lr.colors.gray800.value},white:{backgroundColor:"white",border:`1px solid ${Lr.colors.gray300.value}`,color:Lr.colors.gray700.value}},WS=/^#[0-9a-f]{6}$/i,GS="linkButton";function qS(e,n){if(e.isCollapsed){const t=e.getFirstPosition(),i=t.textNode?.getAttribute("linkHref")??t.nodeBefore?.getAttribute("linkHref")??t.nodeAfter?.getAttribute("linkHref");return i?[(0,PS.Pyf)(t,"linkHref",i,n)]:[]}const t=[];for(const i of e.getRanges())for(const e of i.getItems())e.is("$textProxy")&&e.hasAttribute("linkHref")&&t.push(n.createRangeOn(e));return t}function HS(e,n,t){for(const i of n)t?e.setAttribute(GS,t,i):e.removeAttribute(GS,i)}class YS extends PS.uBz{pendingVariant;refresh(){const e=this.editor.model.document.selection,n=this.editor.commands.get("link");this.value=e.getAttribute(GS)??void 0,this.isEnabled=n.isEnabled}execute({variant:e}={}){const n=this.editor,t=n.model,i=qS(t.document.selection,t);0!==i.length?t.change(n=>{HS(n,i,e)}):e&&(this.pendingVariant=e,n.plugins.get(PS.Frm)._showUI(!0))}applyPendingVariant(){const e=this.pendingVariant;if(this.pendingVariant=void 0,!e)return;const n=this.editor.model,t=qS(n.document.selection,n);n.change(n=>{HS(n,t,e)})}}class ZS extends PS.k_1{static get pluginName(){return"LinkButton"}static get requires(){return[PS.N_E]}init(){const e=this.editor,n=e.model;n.schema.extend("$text",{allowAttributes:GS}),n.schema.setAttributeProperties(GS,{isFormatting:!0,copyOnEnter:!0});const t=(e,n)=>{const t=e.createAttributeElement("a",{class:`button button-${n}`},{priority:5});return e.setCustomProperty("link",!0,t),t};e.conversion.for("downcast").add(e=>{e.on(`attribute:${GS}`,(e,n,i)=>{if(!n.item.is("selection")&&!i.schema.isInline(n.item))return;const s=i.writer,o=n.item.is("selection")?s.document.selection.getFirstRange():i.mapper.toViewRange(n.range);if(n.attributeOldValue&&s.unwrap(o,t(s,n.attributeOldValue)),n.attributeNewValue){if(!i.consumable.consume(n.item,`attribute:${GS}`))return;s.wrap(o,t(s,n.attributeNewValue))}},{priority:PS.vxe.high-1})}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",classes:"button"},model:{key:GS,value:e=>function(e){for(const n of e){const e=US.find(e=>n===`button-${e}`);if(e)return e}return"primary"}(e.getClassNames())}}),n.document.registerPostFixer(e=>{let t=!1;for(const i of n.document.differ.getChanges()){const n="attribute"===i.type?i.range:"insert"===i.type?e.createRange(i.position,i.position.getShiftedBy(i.length)):null;if(n)for(const i of n.getItems())i.hasAttribute(GS)&&!i.hasAttribute("linkHref")&&(e.removeAttribute(GS,i),t=!0)}return t});const i=new YS(e);e.commands.add(GS,i),this.listenTo(e.commands.get("link"),"execute",()=>{i.applyPendingVariant()},{priority:"low"}),e.plugins.get("ContextualBalloon").on("change:visibleView",(e,n,t)=>{t||(i.pendingVariant=void 0)}),e.ui.componentFactory.add(GS,n=>{const t=e.config.get("linkButton").labels,s=(0,PS.yul)(n),o=new PS.pMc;for(const e of US){const n=new PS.e_y({label:t[e],variant:e,withText:!0,role:"menuitemradio"});n.bind("isOn").to(i,"value",n=>n===e),o.add({type:"button",model:n})}o.add({type:"separator"});const a=new PS.e_y({label:t.remove,withText:!0});return a.bind("isEnabled").to(i,"value",e=>void 0!==e),o.add({type:"button",model:a}),(0,PS.OaJ)(s,o),s.buttonView.set({label:t.button,withText:!0,tooltip:!0}),s.bind("isEnabled").to(i),this.listenTo(s,"execute",n=>{const t=n.source;e.execute(GS,{variant:t.variant}),e.editing.view.focus()}),s})}}class KS extends PS.k_1{static get pluginName(){return"VariablesMention"}static get requires(){return[PS.PXQ]}init(){const e=this.editor,n=e.commands.get("mention");this.listenTo(n,"execute",(n,t)=>{const i=t[0];if("{"!==i.marker)return;n.stop();const s=e.model,o=s.document.selection,a="string"==typeof i.mention?i.mention:i.mention.id;s.change(e=>{const n=new Map(o.getAttributes());n.delete("mention"),s.insertContent(e.createText(a,n),i.range??o.getFirstRange())})},{priority:"high"})}}const XS=Wr({".ck.ck-mentions":{maxWidth:"420px"},".ck.ck-mentions .ck-button.rich-editor-variable-item":{alignItems:"stretch",background:"transparent !important",borderRadius:"0 !important",boxShadow:"none !important",color:"$gray800 !important",cursor:"pointer",display:"flex",flexDirection:"column",padding:"0 !important",width:"100%"},".ck.ck-mentions .rich-editor-variable-item-group":{borderTop:"1px solid $gray100",color:"$gray500",cursor:"default",fontSize:"$textXs",fontWeight:"$semiBold",padding:"$2 $3 $1"},".ck.ck-mentions .ck-list__item:first-child .rich-editor-variable-item-group":{borderTop:"none"},".ck.ck-mentions .rich-editor-variable-item-row":{alignItems:"baseline",display:"flex",gap:"$4",justifyContent:"space-between",padding:"$2 $3"},".ck.ck-mentions .rich-editor-variable-item:hover .rich-editor-variable-item-row":{background:"$gray100"},".ck.ck-mentions .ck-mentions__item_focused .rich-editor-variable-item-row":{background:"$primary100",color:"$primary700"},".ck.ck-mentions .rich-editor-variable-item-label":{fontSize:"$textSm",whiteSpace:"nowrap"},".ck.ck-mentions .rich-editor-variable-item-key":{color:"$gray500",fontSize:"$textXs",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),QS=({buttonColor:e,buttons:n,css:t,label:s,description:o,state:a,initialValue:r,onChange:d,onBlur:l,onFocus:c,hint:u,placeholder:m,value:g,variables:h,...p})=>{const{translate:I,params:{organizationId:f}}=fc(),{language:x}=ss(ts),_=(0,de.useRef)(h),[j]=(0,de.useState)(void 0!==h),[v]=(0,de.useState)(!0===n);(0,de.useEffect)(()=>{_.current=h},[h]);const S=(0,de.useRef)(void 0),y=()=>{fe().then(e=>{S.current=e})};(0,de.useEffect)(y,[]),j&&XS();const C=(0,de.useMemo)(()=>[{color:"white",label:I("blanc_36425")},{color:Lr.colors.gray800.value,label:I("gris_fonc_51159")},{color:Lr.colors.gray400.value,label:I("gris_clair_52465")},{color:Lr.colors.primary900.value,label:I("bleu_fonc_40491")},{color:Lr.colors.primary500.value,label:I("bleu_41949")},{color:Lr.colors.error700.value,label:I("rouge_fonc_45023")},{color:Lr.colors.error500.value,label:I("rouge_75079")},{color:Lr.colors.warning300.value,label:I("jaune_53503")},{color:Lr.colors.warning600.value,label:I("orange_64132")},{color:Lr.colors.success700.value,label:I("vert_fonc_37265")},{color:Lr.colors.success500.value,label:I("vert_27018")},{color:Lr.colors.purple700.value,label:I("violet_fonc_77270")},{color:Lr.colors.purple500.value,label:I("violet_54005")},{color:Lr.colors.pink700.value,label:I("rose_fonc_98996")},{color:Lr.colors.pink500.value,label:I("rose_49360")}],[]);return(0,i.jsxs)(Xl,{css:t,direction:"column",width:1,children:[(0,i.jsx)(uu,{children:s}),(0,i.jsx)(lu,{children:o}),(s||o)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{css:{"--ck-border-radius":"$radii$1","--ck-color-toolbar-background":"$colors$gray100","& .ck.ck-toolbar":{borderColor:"error"===a?"$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:"$primary100",color:"$primary500"}}},"& .ck.ck-content":{borderColor:"error"===a?"$error500 !important":"$gray300 !important",borderStyle:"solid",borderWidth:"1px",borderTop:"none !important",color:"$gray800",minHeight:"100px",px:"$3","&.ck-editor__editable.ck-focused":{boxShadow:"none"},"& a.button":{borderRadius:"$1",display:"inline-block",fontWeight:"$semiBold",textDecoration:"none"},...Object.fromEntries(US.map(n=>{const t=function(e,n){return"primary"===e&&n&&WS.test(n)?{backgroundColor:n,color:"white"===zm(n.toLowerCase())?"white":Lr.colors.gray800.value}:BS[e]}(n,e);return["primary"===n?"& a.button:not(.button-gray):not(.button-white)":`& a.button.button-${n}`,{background:t.backgroundColor,border:t.border??"none",color:t.color,padding:VS(n)}]}))},"& .ck.ck-editor__editable > .ck-placeholder::before":{color:"$gray500"},...h_("& .ck.ck-content")},width:1,children:(0,i.jsx)(MS.aF,{config:{licenseKey:"GPL",plugins:[PS.C1k,PS.Y0,PS.yN4,PS.uwK,PS.LcX,PS.rwA,PS.DZT,PS._V3,PS.uXn,PS.BRX,PS.J20,PS.N_E,PS.B8B,PS.PXQ,PS.fzL,PS.fTX,PS.z2z,...j?[KS]:[],...v?[ZS]:[]],linkButton:v?{labels:{button:I("bouton"),primary:I("principal"),gray:I("gris"),white:I("blanc_36425"),remove:I("retirer_le_bout")}}:void 0,mention:j?{feeds:[{marker:"{",dropdownLimit:Number.MAX_SAFE_INTEGER,feed:e=>nu(eu(_.current??[],e)),itemRenderer:e=>function(e){const n=tu("rich-editor-variable-item"),t=tu("rich-editor-variable-item-row");return e.isFirstOfGroup&&n.append(tu("rich-editor-variable-item-group",e.variable.groupLabel)),t.append(tu("rich-editor-variable-item-label",e.variable.label),tu("rich-editor-variable-item-key",e.variable.key)),n.append(t),n}(e)}]}:void 0,translations:[kS.A,FS.A,NS.A,LS.A],placeholder:m,fontColor:{colors:C},fontBackgroundColor:{colors:C},language:x.toString().toLowerCase(),simpleUpload:{uploadUrl:`${ee.HEAVENT_API_URL}/image/upload?organizationId=${f}`,headers:()=>({[re]:S.current??""})},heading:{options:[{model:"headingParagraphSmall",view:{name:"p",classes:"h-small"},title:I("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"}]},toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link",...v?["linkButton"]:[],"imageUpload","|","undo","redo"],shouldNotGroupWhenFull:!0}},data:r,disabled:"disabled"===a,editor:PS.aRV,onBlur:()=>{l?.()},onChange:(e,n)=>{d(n.getData())},onFocus:()=>{y(),c?.()},...p})}),(0,i.jsx)(cu,{state:a,children:u})]})},JS=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,parse:Nc.A,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(QS,{hint:a?o.meta.error:n,initialValue:o.input.value,name:e,state:a?"error":t,onChange:e=>{o.input.onChange(e)},...s})}}),ey=["user","userDocuments","event","delegation"];function ny(e,{delegationsCustomFields:n=!0,eventsCustomFields:t=!0,usersCustomFields:i=!0}={}){const{translate:s,params:{organizationId:o,eventId:a,formId:r}}=fc(),d="form"===i?r:void 0,[l,c]=(0,de.useState)(null),u=e.join(","),m=e.some(e=>ey.includes(e)),g=Array.isArray(i)?i.join(","):i;return(0,de.useEffect)(()=>{let e=!1;return m&&o&&fe().then(e=>function(e,n={}){return xa("query TemplateVariables($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId) {\n organization(id: $organizationId) {\n customBadges\n\n usersCustomFields: customFields(eventId: $eventId, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n\n eventsCustomFields: customFields(variety: Event) {\n nodes {\n slug\n name\n }\n }\n\n delegationsCustomFields: customFields(eventId: $eventId, variety: Delegation) {\n nodes {\n slug\n name\n }\n }\n\n # The form renders its texts with the definitions of its fields only.\n form: formMaybe(id: $formId) {\n elements {\n customField {\n slug\n }\n\n conditionCustomField {\n slug\n }\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:o,eventId:a,formId:d},{token:e})).then(n=>{e||c(n)},()=>{}),()=>{e=!0}},[m,o,a,d]),(0,de.useMemo)(()=>{const o=l?.organization,a=o?.usersCustomFields.nodes??[],r="form"===i?(o?.form?.elements??[]).flatMap(e=>[e.customField?.slug,e.conditionCustomField?.slug].filter(e=>!!e)):Array.isArray(i)?i:null;return function(e,n,t={}){const i=new Set,s=[],o=new Set(n);for(const n of o)for(const[a,r]of Kc(e,n,t,o)){const n=Bc(e,a);for(const[e,t]of r)i.has(e)||(i.add(e),s.push({key:e,label:t,group:a,groupLabel:n}))}return[...new Set(s.map(({group:e})=>e))].flatMap(e=>s.filter(n=>n.group===e))}(s,e,{customBadges:(o?.customBadges??[]).map(e=>({slug:e,name:fj(e)})),customDocuments:o?.event?.customDocuments,delegationsCustomFields:n?o?.delegationsCustomFields.nodes:[],eventsCustomFields:t?o?.eventsCustomFields.nodes:[],usersCustomFields:r?a.filter(({slug:e})=>r.includes(e)):i?a:[]})},[l,u,n,t,g])}const ty=({value:e,css:n,label:t,description:s,hint:o,icon:a,onChange:r,state:d,...l})=>{const c=w(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:m,errorId:g}=Vc();return(0,i.jsxs)(Xl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:u,children:t}),(0,i.jsx)(lu,{id:m,children:s}),(t||s)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"default",icon:a,state:d,children:(0,i.jsx)(Zr,{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?m:void 0,"aria-errormessage":"error"===d?g:void 0,"aria-invalid":"error"===d,disabled:"disabled"===d,id:u,type:"time",value:c,onChange:e=>{r(e.target.value)},...l})})}),(0,i.jsx)(cu,{id:g,state:d,children:o})]})},iy=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(ty,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),sy=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Bx,{name:`${e.prefix}hasCalendarInvite`,children:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[n("ajouter_une_inv_92123"),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{css:{cursor:"help"},children:(0,i.jsx)(Zr,{color:"gray500",children:(0,i.jsx)(pc,{icon:"circle-exclamation"})})}),(0,i.jsx)(ux,{placement:"top",children:n("un_fichier_ics_01663")})]})]})}),e.hasCalendarInvite&&(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(Xl,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(pu,{label:n("nom_de_l_v_nem_08711"),name:`${e.prefix}calendarInviteName`}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wx,{label:n("date_de_d_but_43380"),name:`${e.prefix}calendarInviteStartDate`}),(0,i.jsx)(iy,{label:n("heure_de_d_but_27566"),name:`${e.prefix}calendarInviteStartTime`})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wx,{label:n("date_de_fin_86920"),name:`${e.prefix}calendarInviteEndDate`}),(0,i.jsx)(iy,{label:n("heure_de_fin_95071"),name:`${e.prefix}calendarInviteEndTime`})]})]})})]})};function oy(e){navigator.clipboard.writeText(e)}function ay(){const[e,n]=(0,de.useState)(!1);return{isLoading:e,copy:(0,de.useCallback)(e=>{n(!0),oy(e),setTimeout(()=>n(!1),500)},[])}}const ry=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(null),[o,a]=(0,de.useState)(null),r=(0,de.useMemo)(()=>e.customFields.find(e=>e.slug===t),[e.customFields,t]),d=(0,de.useMemo)(()=>r&&o?`{user.fieldUpdate.${r.slug}.${o}}`:"",[e.customFields,r,o]),{isLoading:l,copy:c}=ay();return(0,i.jsx)(Zx,{as:"div",heading:n("s_lectionner_un_93801"),hideHeader:!0,children:(0,i.jsxs)(Xl,{direction:"column",gap:"5",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(wc,{children:n("s_lectionner_un_93801")}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsxs)(nf,{value:t??"-1",onChange:e=>{s(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:n("s_lectionner_un_01451")}),e.customFields.map(e=>(0,i.jsxs)("option",{value:e.slug,children:[e.name,w(e.label)&&` (${e.label})`]},e.slug))]}),(0,i.jsx)(pc,{icon:"arrow-right"}),r?.fieldType===_n.Select?(0,i.jsxs)(nf,{state:t?"active":"disabled",value:o??"-1",onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:n("select_value_61735")}),r.values.map(({id:e,value:n},t)=>(0,i.jsx)("option",{value:e,children:n},t))]}):(0,i.jsxs)(nf,{state:t?"active":"disabled",value:o??"-1",onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:"-1",children:n("select_value_61735")}),(0,i.jsx)("option",{value:"true",children:n("true_65165")}),(0,i.jsx)("option",{value:"false",children:n("false_74637")})]})]})]}),o&&(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(wc,{children:n("variable_ins_49519")}),(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(Zr,{css:{flex:"1",bd:!0,borderRadius:"$1",padding:"$2 $3",background:"$white"},children:(0,i.jsx)(wc,{css:{cursor:l?"progress":"copy"},onClick:()=>c(d),children:d})}),(0,i.jsx)(yc,{isLoading:l,onClick:()=>c(d),children:n("copier_75889")})]})]})]})})},dy=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),a=ny(Xc(ln.Campaign,!!s)),r=(0,de.useMemo)(()=>Jc(a),[a]),[d,l]=(0,de.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:o("sujet_36033"),name:"campaign.subject",variables:r}),(0,i.jsxs)(Xl,{direction:"column",gap:"8",children:[(0,i.jsxs)(Wv,{heading:o("contenu_29668"),hideHeading:!0,children:[(0,i.jsxs)(RS,{selectedItem:e.values.textOrHtml,onChange:n=>{e.form.change("textOrHtml",n)},children:[(0,i.jsx)(DS,{item:"text",children:o("contenu_en_vers_04808")}),(0,i.jsx)(DS,{item:"html",children:o("contenu_parti_04631")})]}),"text"===e.values.textOrHtml&&(0,i.jsx)(JS,{buttonColor:e.emailsSenders.find(({id:n})=>n===e.values.campaign.emailSenderId)?.buttonColor,buttons:!0,hint:(0,i.jsx)(Zr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:o("vous_pouvez_ajo_23408")}}),label:o("contenu_29668"),name:"campaign.text",variables:a}),"html"===e.values.textOrHtml&&(0,i.jsx)(Qx,{hint:(0,i.jsx)(Zr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:o("vous_pouvez_ajo_23408")}}),label:o("code_html_60711"),name:"campaign.html",variables:a})]}),f(e.customFields)&&(0,i.jsx)(Wv,{heading:o("attribution_d_u_18785"),isOpen:!1,isOpenToggleLabel:o("je_souhaite_cr_46006"),subtitle:o("cr_ez_une_varia_07170"),children:(0,i.jsx)(ry,{customFields:e.customFields})}),(0,i.jsxs)(Wv,{heading:o("_metteur_de_l_e_26879"),subtitle:o("personnaliser_v_65980"),children:[(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)($S,{children:o("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t))},children:e.emailsSenders.map(n=>(0,i.jsx)("option",{value:n.id,children:`${n.name} ${n.id===e.emailSenderId?o("_metteur_par_d_03442"):n.isValidToSendEmail?"":o("_e_mail_non_con_07618")}`},n.id))}),(0,i.jsx)(pu,{isEmail:!0,label:(0,i.jsx)($S,{children:o("adresse_de_r_po_86181")}),name:"campaign.replyTo"})]}),(0,i.jsxs)(Wv,{heading:o("pi_ce_s_jointe_82370"),subtitle:o("int_grer_dans_v_73429"),tooltip:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{css:{cursor:"help"},children:(0,i.jsx)(Zr,{color:"gray500",children:(0,i.jsx)(pc,{icon:"circle-exclamation"})})}),(0,i.jsx)(ux,{placement:"bottom",children:o("si_vos_pi_ces_j_95233")})]}),children:[e.canCustomDocuments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Kx,{isSearchVisible:!0,label:o("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)),qv.map(e=>(0,i.jsx)("option",{value:e,children:o(e)},e))]}),e.hasDuplicatedMembers&&(0,i.jsx)(Bx,{name:"campaign.includeDuplicateMembersAttachments",children:o("inclure_les_doc_76200")})]}),d.map(n=>(0,i.jsx)(wS,{acl:"public-read",organizationId:t,value:n,onChange:()=>{const t=(0,Bm.A)(d,n);l(t),e.form.change("campaign.documents",t)}},n.key)),(0,i.jsx)(wS,{acl:"public-read",label:o("fichier_personn_20046"),organizationId:t,value:null,onChange:n=>{const t=[...d,(0,Rr.A)(n,"file")];l(t),e.form.change("campaign.documents",t)}})]})]}),(0,i.jsx)(sy,{hasCalendarInvite:e.values.campaign.hasCalendarInvite,prefix:"campaign."})]})},ly=[" ","@","£","$","¥","è","é","ù","ì","ò","Ç","Ø","ø","Å","å","Æ","æ","ß","É","!",'"',"#","¤","%","&","'","(",")","*","+",",","-",".","/","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","ä","ö","ñ","ü","à"],cy=["^","{","}","\\","|","[","]","~","€","\n"],uy=ly.concat(cy);function my(e,n){const t=n?145:160,i=Array.from(e??"").reduce((e,n)=>ly.includes(n)?e+1:cy.includes(n)?e+2:e,0);return i<=t?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const gy=e=>(0,i.jsx)(ld.D0,{name:e.name,render:n=>{const t=n.input.checked?"checked":"unchecked";return(0,i.jsx)(eg,{disabled:e.disabled,size:e.size,state:t,subtext:e.subtext,onClick:()=>{n.input.onChange(e.value)},children:e.children})},type:"radio",value:e.value}),hy=e=>{const{params:{eventId:n},translate:t}=fc(),s=ny(["user","userRegistration","userDelegation","userDocuments",...(o=!!n)?["event"]:[],"organization","delegation","recipient",...o?["eventUnregister"]:[]]);var o;const a=(0,de.useMemo)(()=>Jc(s),[s]),r=e.formRenderProps.values,{numberOfCharacters:d,numberOfSms:l}=my(r.campaign.text,r.customSender);return(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Wv,{heading:t("voulez_vous_per_07528"),name:"customSender",role:"radiogroup",children:[(0,i.jsx)(gy,{name:"customSender",value:!1,children:t("non_je_souhait_47056")}),(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:t("custom_sender_90460"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"customSender",value:!0,children:t("oui_je_souhait_40974")}),e.formRenderProps.values.customSender&&(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(pu,{hint:t("doit_commencer_93759"),name:"campaign.sender",placeholder:t("_metteur_du_mes_17005")})})]})]}),(0,i.jsx)(Qx,{hint:(0,i.jsx)(Zr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(Xl,{justify:"between",children:[(0,i.jsx)(Zr,{children:t("contenu_29668")}),(0,i.jsx)(Zr,{color:"gray500",children:t("_1_caract_re_04414",d,l)})]}),name:"campaign.text",variables:a})]})},py=e=>{const n=os();return(0,i.jsx)(Wv,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:n("contenu_29668"),hideHeading:!0,children:e.formRenderProps.values.campaign.campaignType===Ue.Email?(0,i.jsx)(dy,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,customFields:e.customFields,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formRenderProps.form,hasDuplicatedMembers:e.hasDuplicatedMembers,values:e.formRenderProps.values}):(0,i.jsx)(hy,{formRenderProps:e.formRenderProps})})},Iy=e=>(0,i.jsx)(kc,{direction:"column",formRenderProps:e.formRenderProps,render:e.render}),fy=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(0),r=ss(ec),d=de.Children.toArray(e.children),[l,c]=(0,de.useState)(!1);return l?(0,i.jsx)(Zx,{heading:n("r_capitulaif_76565"),children:e.summaryStep}):(0,i.jsx)(ld.lV,{initialValues:e.initialValues,initialValuesEqual:dd.A,mutators:{...nc.A,forceErrors:Pc},render:n=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ld.Pc,{subscription:{dirtyFields:!0},children:({dirtyFields:e})=>Object.keys(e).map((e,n)=>(0,i.jsx)(ld.D0,{name:e,render:()=>null,subscription:{}},n))}),d.map((r,d)=>{const l=o>=d||e.isEdit&&n.valid;if("string"==typeof r||"number"==typeof r||"boolean"==typeof r||!("props"in r))throw new Error("Invalid step passed to wizard");return(0,i.jsxs)(tc.Provider,{value:{formRenderProps:n,showErrors:t,setShowErrors:s},children:[(0,i.jsx)(Zx,{canSelect:l,footerActions:r.props.actions?.(n),headerStyle:Yx.Dark,heading:r.props.heading,isCompleted:o>d,isOpen:o===d,stepNumber:d+1,onSelect:()=>{l&&(s(!1),a(d))},children:(0,de.cloneElement)(r,{formRenderProps:n})}),(0,i.jsx)(ic,{height:"6"})]},d)})]}),validate:e=>r.validateForForm(d[o].props.schema)(e),onSubmit:async(n,t)=>{if(o===d.length-1){const i=await e.onSubmit(n,t);return i?(s(!0),e.containerRef&&e.containerRef.current&&(e.containerRef.current.scrollIntoView(),e.containerRef.current.scrollTop=0),i):void c(!0)}return s(!1),void a(o+1)}})},xy=e=>{const n=(0,de.useRef)(null),t=(0,de.useCallback)(e=>{e&&(n.current=e,setTimeout(()=>{e.style.right=Lr.space[6].value},100))},[]),s=(0,de.useCallback)(()=>{n.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,hd.createPortal)((0,i.jsxs)(Xl,{ref:t,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)(Xl,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(pc,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(Zr,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(Xl,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:s,children:(0,i.jsx)(pc,{icon:"xmark"})})]}),document.body)},_y=2e3,jy=(0,de.createContext)({}),vy=e=>{const n=os(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)({color:"success",text:""}),r=(0,de.useCallback)(()=>{setTimeout(()=>{s(!1)},1200)},[s]),d=(0,de.useCallback)(e=>{s(!0),a("string"==typeof e?{text:e}:e),setTimeout(r,Jo.dw.fromObject({seconds:5}).toMillis())},[s,a,r]),{mutate:l}=function(e={}){return ds("mutation AccreditationsImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n accreditationsImportResult(organizationId: $organizationId, eventId: $eventId, jobId: $jobId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),c=(0,de.useRef)(null),u=(0,de.useCallback)((e,t,i)=>{c.current=window.setInterval(async()=>{const{accreditationsImportResult:{state:s}}=await l({jobId:e,organizationId:t,eventId:i});s===we.Done&&(clearInterval(c.current),d({color:"success",text:n("votre_import_es_60265")}))},_y)},[]),{mutate:m}=function(e={}){return ds("mutation AccreditationsProfilesImportResult(\n $jobId: JobId!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n accreditationsProfilesImportResult(\n organizationId: $organizationId\n eventId: $eventId\n jobId: $jobId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),g=(0,de.useRef)(null),h=(0,de.useCallback)((e,t,i)=>{g.current=window.setInterval(async()=>{const{accreditationsProfilesImportResult:{state:s}}=await m({jobId:e,organizationId:t,eventId:i});s===we.Done&&(clearInterval(g.current),d({color:"success",text:n("votre_import_es_60265")}))},_y)},[]),{mutate:p}=function(e={}){return ds("mutation DelegationsImportResult(\n $jobId: JobId!\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)}(),I=(0,de.useRef)(null),f=(0,de.useCallback)((e,t,i)=>{I.current=window.setInterval(async()=>{const{delegationsImportResult:{state:s,event:o}}=await p({jobId:e,organizationId:t,eventId:i});s===Je.Done&&(clearInterval(I.current),d({color:"success",text:n("votre_import_es_98992",o.name)}))},_y)},[]),{mutate:x}=function(e={}){return ds("mutation EventDocumentsExportResult(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $jobId: JobId!\n) {\n eventDocumentsExportResult(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n jobId: $jobId\n ) {\n state\n url\n }\n}\n",e)}(),_=(0,de.useRef)(null),j=(0,de.useCallback)((e,t,i)=>{_.current=window.setInterval(async()=>{const{eventDocumentsExportResult:s}=await x({jobId:e,organizationId:t,eventId:i});s.state===pn.Done&&(clearInterval(_.current),d({color:"success",text:n("l_export_de_vos_38257",s.url)}))},_y)},[]),{mutate:v}=function(e={}){return ds("mutation EventsImportResult($jobId: JobId!, $organizationId: OrganizationId!) {\n eventsImportResult(jobId: $jobId, organizationId: $organizationId) {\n state\n }\n}\n",e)}(),S=(0,de.useRef)(null),y=(0,de.useCallback)((e,t)=>{S.current=window.setInterval(async()=>{const{eventsImportResult:{state:i}}=await v({jobId:e,organizationId:t});i===un.Done&&(clearInterval(S.current),d({color:"success",text:n("votre_import_es_60265")}))},_y)},[]),{mutate:C}=function(e={}){return ds("mutation ExportResult($jobId: JobId!, $organizationId: OrganizationId!, $eventId: EventId) {\n exportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n url\n }\n}\n",e)}(),b=(0,de.useRef)(null),A=(0,de.useCallback)((e,t,i)=>{b.current=window.setInterval(async()=>{const{exportResult:s}=await C({jobId:e,organizationId:t,eventId:i});s.state===pn.Done&&(clearInterval(b.current),d({color:"success",text:n("votre_export_es_96069",s.url)}))},_y)},[]),{mutate:E}=function(e={}){return ds("mutation FilesImportResult($jobId: JobId!, $organizationId: OrganizationId!, $eventId: EventId) {\n filesImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),w=(0,de.useRef)(null),$=(0,de.useCallback)((e,t,i)=>{w.current=window.setInterval(async()=>{const{filesImportResult:{state:s,event:o}}=await E({jobId:e,organizationId:t,eventId:i});s===jn.Done&&(clearInterval(w.current),d({color:"success",text:o?n("votre_import_es_11791",o.name):n("votre_import_es_10672")}))},_y)},[]),{mutate:T}=function(e={}){return ds("mutation PositionsImportResult(\n $jobId: JobId!\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)}(),z=(0,de.useRef)(null),O=(0,de.useCallback)((e,t,i)=>{z.current=window.setInterval(async()=>{const{positionsImportResult:{state:s,event:o}}=await T({jobId:e,organizationId:t,eventId:i});s===Bn.Done&&(clearInterval(z.current),d({color:"success",text:n("votre_import_es_11848",o.name)}))},_y)},[]),{mutate:R}=function(e={}){return ds("mutation VolunteersImportResult(\n $jobId: JobId!\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)}(),D=(0,de.useRef)(null),M=(0,de.useCallback)((e,t,i,s)=>{D.current=window.setInterval(async()=>{const{volunteersImportResult:{state:o,event:a}}=await R({jobId:e,organizationId:t,eventId:i,delegationId:s});o===Ct.Done&&(clearInterval(D.current),d({color:"success",text:a?n("votre_import_es_37822",a.name):n("votre_import_es_14145")}))},_y)},[]);return(0,i.jsx)(jy.Provider,{value:{checkAccreditationsImport:u,checkAccreditationsProfilesImport:h,checkDelegationsImport:f,checkDocumentsExport:j,checkEventsImport:y,checkExport:A,checkFilesImport:$,checkPositionsImport:O,checkVolunteersImport:M,showNotification:d},children:(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(xy,{color:o.color??"success",text:o.text,onClose:r}),e.children]})})};function Sy(){return(0,de.useContext)(jy)}var yy,Cy=t(5526);const by=/^[a-z][a-z0-9]{2,10}$/i;var Ay;!function(e){e.Accreditations="accreditations",e.Delegations="delegations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}(Ay||(Ay={}));let Ey=class extends ju{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,n,t,i){const s=this.campaignInputDefault(e,n,t,i);return{campaign:s,recipients:s.sendToEveryone?Ay.Everyone:f(s.states)?Ay.States:f(s.segmentsIds)?Ay.Segments:f(s.delegationsIds)?Ay.Delegations:f(s.accreditationsCategoriesIds)||f(s.accreditationsIds)||f(s.accreditationsSlotsIds)?Ay.Accreditations:f(s.positionsCategoriesIds)||f(s.positionsIds)||f(s.positionsSlotsIds)?Ay.Positions:Ay.Users,customSender:w(t?.sender),textOrHtml:w(t?.html)?"html":"text"}}campaignStep1Fields(){return{name:Jl.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:Jl.Yj().required(this.t("le_type_de_camp_96559")).oneOf(Qt,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return Jl.Ik().shape({campaign:Jl.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:Jl.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!w(this.parent.sender)||by.test(this.parent.sender)}),text:Jl.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return w(this.parent.text)||w(this.parent.html)}).test("only-valid-characters","",function(){if(this.parent.campaignType===Ue.Email)return!0;{const t=(n=this.parent.text,new Set(Array.from(n??"").filter(e=>!uy.includes(e))));return!(t.size>0)||this.createError({message:e.translationService.translate("les_caract_res_84839",Array.from(t).join(", "))})}var n}).test("max-length",this.t("le_contenu_ne_p_25416"),function(){return this.parent.campaignType===Ue.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:Jl.Yj().when("campaignType",{is:Ue.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:Jl.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return w(this.parent.text)||w(this.parent.html)}),replyTo:Jl.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return zj(this.parent.replyTo)}),documents:Jl.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==Ue.Email||!f(this.parent.documents)||(0,Cy.A)(this.parent.documents,e=>e.size)<2e7}),emailSenderId:Jl.ai().nullable(),attachments:Jl.YO().of(Jl.Yj()),includeDuplicateMembersAttachments:Jl.zM().required(),hasCalendarInvite:Jl.zM().required(),calendarInviteName:Jl.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:e_.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:Jl.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:e_.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:Jl.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return Jl.Ik().shape({campaign:Jl.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,n=function(){return this.parent.state!==Le.Draft&&this.parent.state!==Le.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.delegationsIds.length||0!==this.parent.usersInfosIds.length||0!==this.parent.segmentsIds.length||this.createError({message:e.translationService.translate("vous_devez_s_le_80552")})};return{sendToEveryone:Jl.zM().required(this.t("requis_75853")),states:Jl.YO().of(Jl.Yj()).test("non-empty","",n),positionsCategoriesIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),positionsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),positionsSlotsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),tagsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),accreditationsCategoriesIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),accreditationsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),accreditationsSlotsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),delegationsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),usersInfosIds:Jl.YO().of(Jl.ai()).test("non-empty","",n),segmentsIds:Jl.YO().of(Jl.ai()).test("non-empty","",n)}}campaignStep3Schema(){return Jl.Ik().shape({campaign:Jl.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:e_.when("scheduleType",{is:Fe.Datetime,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:Jl.Yj().when("scheduleType",{is:Fe.Datetime,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))}),scheduleAnchor:Jl.Yj().when("scheduleType",{is:Fe.Anchor,then:e=>e.required(this.t("d_but_fin_est_r_67120")).oneOf(Zt,this.t("d_but_fin_est_r_67120"))}),scheduleOffsetDays:Jl.ai().when("scheduleType",{is:Fe.Anchor,then:e=>e.required(this.t("le_nombre_de_jo_27562")).min(0,this.t("le_nombre_de_jo_62798"))}),scheduleBeforeAfter:Jl.Yj().when("scheduleType",{is:Fe.Anchor,then:e=>e.required(this.t("avant_apr_s_est_31173")).oneOf(Kt,this.t("avant_apr_s_est_31173"))}),scheduleSendTime:Jl.Yj().when("scheduleType",{is:Fe.Anchor,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 Jl.Ik().shape({campaign:Jl.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return Jl.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return Jl.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,n,t,i){let s=t?.segmentsIds??[],o=t?.usersInfosIds??[];if(w(i))try{const e=JSON.parse(a(i));e.segmentId&&(s=[e.segmentId]),f(e.usersInfosIds)&&(o=e.usersInfosIds)}catch{}const r=!f(s)&&!f(o)&&(t?.sendToEveryone??!1);return{name:t?.name??"",state:t?t.scheduleType!==Fe.NoSchedule&&t.state===Le.Draft?Le.Scheduled:t.state:e?Le.Template:Le.Draft,campaignType:t?.campaignType??Ue.Email,sender:t?.sender??"",text:t?.text??"",subject:t?.subject??"",html:t?.html??"",replyTo:t?.replyTo??"",sendToEveryone:r,states:t?.states??[],positionsCategoriesIds:t?.positionsCategoriesIds??[],positionsIds:t?.positionsIds??[],positionsSlotsIds:t?.positionsSlotsIds??[],tagsIds:t?.tagsIds??[],accreditationsCategoriesIds:t?.accreditationsCategoriesIds??[],accreditationsIds:t?.accreditationsIds??[],accreditationsSlotsIds:t?.accreditationsSlotsIds??[],delegationsIds:t?.delegationsIds??[],usersInfosIds:o,segmentsIds:s,scheduledAtDate:t?.scheduledAt??void 0,scheduledAtTime:t?.scheduledAt?.toFormat("HH:mm")??void 0,documents:t?.documents??[],emailSenderId:t?.emailSenderId??n,attachments:t?.attachments??[],includeDuplicateMembersAttachments:t?.includeDuplicateMembersAttachments??!1,hasCalendarInvite:t?.hasCalendarInvite??!1,calendarInviteName:t?.calendarInviteName??null,calendarInviteStartDate:t?.calendarInviteStartDate??null,calendarInviteStartTime:t?.calendarInviteStartTime??null,calendarInviteEndDate:t?.calendarInviteEndDate??null,calendarInviteEndTime:t?.calendarInviteEndTime??null,scheduleType:t?.scheduleType??Fe.NoSchedule,scheduleAnchor:t?.scheduleAnchor??Pe.EventStart,scheduleOffsetDays:t?.scheduleOffsetDays??0,scheduleBeforeAfter:t?.scheduleBeforeAfter??ke.Before,scheduleSendTime:t?.scheduleSendTime??"00:00"}}};function wy(e,n,t){if("positionCategoryId"in t){const i=e.usersPositionsCategories.some(e=>"ANY"===t.positionCategoryId?n===e.roleId:n===e.roleId&&e.positionCategoryId===t.positionCategoryId);if("positionId"in t){const s=e.usersPositions.some(e=>n===e.roleId&&e.positionId===t.positionId);return i||s}return i}return"delegationCategoryId"in t?e.usersDelegationsCategories.some(e=>"ANY"===t.delegationCategoryId?n===e.roleId:n===e.roleId&&e.delegationCategoryId===t.delegationCategoryId):"eventId"in t&&e.usersEvents.some(e=>"ANY"===t.eventId?n===e.roleId:n===e.roleId&&e.eventId===t.eventId)}function $y(e,n,t){const i=t?e.roles.filter(n=>"positionCategoryId"in t||"positionId"in t?n.accessLevel===rt.Position?wy(e,n.id,t):n.accessLevel===rt.Organization||n.accessLevel===rt.Event:"delegationCategoryId"in t?n.accessLevel===rt.DelegationCategory?wy(e,n.id,t):n.accessLevel===rt.Organization||n.accessLevel===rt.Event:"eventId"in t&&(n.accessLevel===rt.Event?wy(e,n.id,t):n.accessLevel===rt.Organization)):e.roles;return n.map(e=>i.some(n=>"1"===n.permissions[e]))}function Ty(e,n){return e.roles.filter(e=>e.accessLevel===rt.Organization).some(e=>"1"===e.permissions[n])}Ey=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(yy=void 0!==ts&&ts)?yy:Object])],Ey);const zy=(0,de.createContext)({}),Oy=e=>{const{params:{eventId:n}}=fc(),t=(0,de.useMemo)(()=>e.userPermissions.roles.some(e=>e.accessLevel===rt.Organization||e.accessLevel===rt.Event),[e.userPermissions]);return n?(0,i.jsx)(zy.Provider,{value:{hasEventRole:t,userPermissions:e.userPermissions,hasPermission:(n,t)=>function(e,n,t){return $y(e,[n],t)[0]??!1}(e.userPermissions,n,t),hasPermissions:(n,t)=>$y(e.userPermissions,n,t)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function Ry(){return(0,de.useContext)(zy)}var Dy=t(3371);class My extends Dy.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const Py=new My;var ky=t(8923);const Fy=(0,de.createContext)({}),Ny=e=>{const[n,t]=(0,de.useState)(e.numberOfWaitingAccreditations),[s,o]=(0,de.useState)(e.numberOfWaitingAssigments),[a,r]=(0,de.useState)(null),d=(0,de.useCallback)(async n=>{const t=(0,ky.A)(a,{id:e.event.id},n);await Py.events.put(t),r(t)},[e.event.id,a,r]),{hasEventRole:l,userPermissions:c,hasPermission:u,hasPermissions:m}=Ry();return(0,de.useEffect)(()=>{(async()=>{let n;try{const t=await Py.events.get(e.event.id);n=t??{id:e.event.id},t||await Py.events.put(n)}catch{n={id:e.event.id}}r(n)})()},[e.event]),a?.id!==e.event.id?(0,i.jsx)(_c,{}):(0,i.jsx)(Fy.Provider,{value:{hasEventRole:l,event:e.event,localEvent:a,numberOfWaitingAccreditations:n,numberOfWaitingAssigments:s,userPermissions:c,hasPermission:u,hasPermissions:m,setNumberOfWaitingAccreditations:t,setNumberOfWaitingAssigments:o,updateLocalEvent:d},children:e.children})};function Ly(){return(0,de.useContext)(Fy)}function Uy(e){return 1752===e}function Vy(e){return 4060===e}const By=(0,de.createContext)({});function Wy(){return(0,de.useContext)(By)}const Gy=({children:e,termsAccepted:n})=>{const{organizationId:t}=ls(),s=cs();return n||window.location.pathname.includes(Wo.ACCEPT_TERMS_AND_CONDITIONS(t))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(gs,{path:Wo.ACCEPT_TERMS_AND_CONDITIONS(t),state:s.location})},qy=(0,de.createContext)({}),Hy=e=>{const{history:n,params:{organizationId:t},translate:s}=fc(),{data:o,loader:a,reload:r}=rs('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(whereUserIsLeader: true, sort: { attribute: StartAt, direction: Desc }) {\n nodes {\n id\n name\n state\n fields\n weezticketEventId\n weezaccessEventId\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 intercomToken\n\n picture {\n url\n }\n }\n }\n}\n',{organizationId:t},[],undefined);const{update:d}=Wy(),[l,c]=(0,de.useState)(),[u,m]=(0,de.useState)(null),g=(0,de.useCallback)(async e=>{const n=(0,oc.A)(u,{id:t},e);await Py.organizations.put(n),m(n)},[t,u,m]),h=(0,de.useMemo)(()=>f(o.user?.roles??[]),[o.user]),p=(0,de.useMemo)(()=>(o.user?.roles??[]).some(e=>e.accessLevel===rt.Organization),[o.user]),I=(0,de.useMemo)(()=>o.organization?{organizationRoles:(0,Tg.A)(o.organization.roles.filter(e=>e.accessLevel===rt.Organization),e=>b(e.name)),eventRoles:(0,Tg.A)(o.organization.roles.filter(e=>e.accessLevel===rt.Event),e=>b(e.name)),delegationCategoryRoles:(0,Tg.A)(o.organization.roles.filter(e=>e.accessLevel===rt.DelegationCategory),e=>b(e.name)),positionRoles:(0,Tg.A)(o.organization.roles.filter(e=>e.accessLevel===rt.Position),e=>b(e.name))}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[o.organization]),x=(0,de.useCallback)(e=>!!o.organization&&function(e,n){return e.features.includes(n)}(o.organization,e),[o.organization]);return(0,de.useEffect)(()=>{o.organization&&(async()=>{let e=await Py.organizations.get(t);e||(e={id:t},await Py.organizations.put(e)),m(e)})()},[t,o.organization]),(0,de.useEffect)(()=>{d(o.user?.userInfo.intercomToken)},[o.user,d]),a||(a||o.organization?h?(0,i.jsx)(qy.Provider,{value:{hasOrganizationRole:p,localOrganization:u,organization:o.organization,roles:I,selectedEventId:l,user:o.user,hasPermission:e=>Ty(o.user,e),hasPermissions:e=>function(e,n){return n.map(n=>Ty(e,n))}(o.user,e),hasFeature:x,reload:r,setSelectedEventId:c,updateLocalOrganization:g},children:(0,i.jsx)(Gy,{termsAccepted:null!==o.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(Jg,{size:"sm",onClose:Ou.A,children:(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{children:s("vous_n_avez_pas_23261")}),(0,i.jsx)(yc,{color:"invisible",onClick:_e,children:s("se_d_connecter_74151")})]})}):(setTimeout(()=>{n.replace(Wo.HOME)},100),null))};function Yy(){return(0,de.useContext)(qy)}var Zy=t(7431);const Ky=()=>{const{translate:e}=fc(),n=ss(dh),[t,s]=(0,de.useState)(""),o=(0,de.useMemo)(()=>n.countries.filter(e=>"number"==typeof e.smsPrice),[n]),a=(0,de.useMemo)(()=>{if(w(t)){const e=b(t);return o.filter(n=>b(n.name).includes(e)||I(n.phoneCode).some(e=>e.includes(t)))}return o},[o,t]);return(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(Zr,{color:"primary500",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(Gf,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:t,onChange:s}),(0,i.jsxs)(gg,{children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:e("Country")}),(0,i.jsx)(Mg,{children:e("indicatif_40634")}),(0,i.jsx)(Mg,{children:e("prix_ht_10965")})]}),a.map(e=>{return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.name}),(0,i.jsx)(_g,{children:e.phoneCode}),(0,i.jsx)(_g,{children:(0,Zy.A)((n=e.smsPrice,n*(14/9)),3)})]},e.code);var n})]})]}),(0,i.jsx)(Wf,{})]})]})},Xy=e=>{const n=os(),{hasFeature:t}=Yy(),s=t(In.Sms);return(0,i.jsxs)(Wv,{heading:e.isTemplate?n("initialisation_84842"):n("initialisation_48904"),hideHeading:!0,children:[(0,i.jsx)(ud,{name:"campaign.campaignType",onChange:n=>{n===Ue.Sms?s?(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html","")):e.formRenderProps.form.change("campaign.campaignType",Ue.Email):(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html",""))}}),(0,i.jsx)(pu,{label:e.isTemplate?n("nom_de_votre_mo_02364"):n("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)(Wv,{heading:e.isTemplate?n("quel_type_de_mo_32965"):n("quel_type_de_ca_11960"),name:"input.mode",role:"radiogroup",children:[(0,i.jsx)(gy,{name:"campaign.campaignType",value:Ue.Email,children:n("e_mail_13869")}),(0,i.jsx)(gy,{disabled:!s,name:"campaign.campaignType",value:Ue.Sms,children:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{children:"SMS"}),(0,i.jsx)(Ky,{}),!s&&(0,i.jsx)(Zr,{color:"gray500",css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:n("contactez_nous_22980",ee.EMAIL_FROM,ee.EMAIL_FROM)},fontSize:"textXs"})]})})]})]})},Qy=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(nf,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Jy=e=>{const{translate:n}=fc(),{form:t,handleSubmit:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"campaign.scheduleType",onChange:e=>{t.change("campaign.state",e===Fe.NoSchedule?Le.Draft:Le.Scheduled)}}),(0,i.jsx)(Zr,{color:"gray800",children:n("quand_voulez_vo_96615")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"campaign.scheduleType",value:Fe.NoSchedule,children:n("je_souahite_l_e_46027")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"campaign.scheduleType",value:Fe.Datetime,children:n("je_souhaite_pro_98854")}),o.campaign.scheduleType===Fe.Datetime&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wx,{min:Jo.c9.local(),name:"campaign.scheduledAtDate",placeholder:n("choisissez_la_d_30578")}),(0,i.jsx)(iy,{hint:n("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:n("choisissez_l_he_55311")})]})]}),"event"===e.campaignType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"campaign.scheduleType",value:Fe.Anchor,children:n("je_souhaite_pro_99169")})]}),o.campaign.scheduleType===Fe.Anchor&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{width:80,children:(0,i.jsx)(pu,{min:0,name:"campaign.scheduleOffsetDays",shouldParseAsInt:!0})}),(0,i.jsx)(Zr,{children:n("jour_s_06841")}),(0,i.jsx)(Zr,{children:(0,i.jsxs)(Qy,{name:"campaign.scheduleBeforeAfter",children:[(0,i.jsx)("option",{value:ke.Before,children:n("avant_91154")}),(0,i.jsx)("option",{value:ke.After,children:n("apr_s_53238")})]})}),(0,i.jsx)(Zr,{children:n("le_95402")}),(0,i.jsx)(Zr,{children:(0,i.jsxs)(Qy,{name:"campaign.scheduleAnchor",children:[(0,i.jsx)("option",{value:Pe.EventStart,children:n("d_but_63192")}),(0,i.jsx)("option",{value:Pe.EventEnd,children:n("fin_33487")})]})}),(0,i.jsx)(Zr,{children:n("de_l_v_nement_01521")}),(0,i.jsx)(Zr,{children:(0,i.jsx)(iy,{name:"campaign.scheduleSendTime"})})]})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:s,children:n("suivant_r_cap_22677")})})]})},eC=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),[o,a]=(0,de.useState)(null),{mutate:r}=function(e={}){return ds("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:d,handleSubmit:l,submitting:c,values:u}=e.formRenderProps,m=(0,de.useMemo)(()=>{if(e.formRenderProps.values.campaign.campaignType===Ue.Email){const n=e.emailsSenders.find(n=>n.id===e.formRenderProps.values.campaign.emailSenderId);return n&&!n.isValidToSendEmail}return!1},[e.emailsSenders,e.formRenderProps.values.campaign.emailSenderId]);return(0,de.useEffect)(()=>{r({organizationId:t,eventId:s,campaign:e.formRenderProps.values.campaign}).then(e=>{a(e.campaignEstimate)})},[]),o?(0,i.jsxs)(i.Fragment,{children:[m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"error",children:(0,i.jsx)(Oc,{children:n("vous_ne_pouvez_33410")})}),(0,i.jsx)(ic,{height:"4"})]}),(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("nombre_de_desti_22505")}),(0,i.jsx)(Zr,{color:"gray800",children:n("_1_membre_49737",o.numberOfRecipients)})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("prix_total_03054")}),(0,i.jsx)(Zr,{color:"gray800",children:0===o.price?n("gratuit_13712"):`${o.price}€`})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(yc,{disabled:m,isLoading:c,onClick:()=>{u.campaign.state!==Le.Scheduled&&d.change("campaign.state",Le.InProgress),l()},children:u.campaign.state===Le.Scheduled?n("programmer_la_c_01938"):e.isEdit?n("mettre_jour_l_63945"):n("cr_er_et_envoye_81501")}),(0,i.jsx)(yc,{color:"white",isLoading:c,onClick:()=>{d.change("campaign.state",Le.Draft),l()},children:n("enregistrer_en_81222")})]})]}):(0,i.jsx)(_c,{})};var nC;function tC(){const{hasFeature:e,hasPermission:n}=Yy(),{event:t,hasPermission:i}=Ly();return(0,de.useMemo)(()=>{const s=e=>n(e)||(i?.(e)??!1),o=e(In.Accreditation)&&(t?.useAccreditations??!1),a=t?.useCampaigns??!0,r=e(In.Delegation)&&(t?.useDelegations??!0),d=(e(In.Documents)||e(In.CustomDocument))&&(t?.useDocuments??!1),l=t?.useForms??!0,c=t?.usePositions??!1,u=e(In.Weezevent)&&(t?.isWeezticketSynchronized??!1),m=t?.useWorkflows??!0;return{canAccreditationEdit:o&&s(nC.ACCREDITATION_EDIT),canAccreditationRead:o&&s(nC.ACCREDITATION_READ),canCampaignRead:a&&s(nC.CAMPAIGN_READ),canCampaignSend:a&&s(nC.CAMPAIGN_SEND),canCommentAdd:s(nC.COMMENT_ADD),canCommentRead:s(nC.COMMENT_READ),canCustomFieldEdit:s(nC.CUSTOM_FIELD_EDIT),canCustomFieldRead:s(nC.CUSTOM_FIELD_READ),canCustomFieldDecrypt:s(nC.CUSTOM_FIELD_DECRYPT),canDelegationEdit:r&&s(nC.DELEGATION_EDIT),canDelegationRead:r&&s(nC.DELEGATION_READ),canDelegationsSpaceParamRead:r&&s(nC.DELEGATIONS_SPACE_PARAM_READ),canDelegationsSpaceParamEdit:r&&s(nC.DELEGATIONS_SPACE_PARAM_EDIT),canDocumentEdit:d&&s(nC.DOCUMENT_EDIT),canDocumentRead:d&&s(nC.DOCUMENT_READ),canEmailEdit:s(nC.EMAIL_EDIT),canEventEdit:s(nC.EVENT_EDIT),canFormEdit:l&&s(nC.FORM_EDIT),canFormRead:l&&s(nC.FORM_READ),canMemberAccredit:o&&s(nC.MEMBER_ACCREDIT),canMemberAssign:c&&s(nC.MEMBER_ASSIGN),canMemberAssignmentStateEdit:c&&s(nC.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:s(nC.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:s(nC.MEMBER_CREATE),canMemberDelete:s(nC.MEMBER_DELETE),canMemberEdit:s(nC.MEMBER_EDIT),canOrganizationParamEdit:s(nC.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:s(nC.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:s(nC.ORGANIZATION_USER_EDIT),canOrganizationUserRead:s(nC.ORGANIZATION_USER_READ),canPositionEdit:c&&s(nC.POSITION_EDIT),canPositionRead:c&&s(nC.POSITION_READ),canPrint:s(nC.PRINT),canPrintConfigEdit:s(nC.PRINT_CONFIG_EDIT),canPrintConfigRead:s(nC.PRINT_CONFIG_READ),canSegmentEdit:s(nC.SEGMENT_EDIT),canTicketIdRegenerate:s(nC.TICKET_ID_REGENERATE),canWeezeventEdit:u&&s(nC.WEEZEVENT_EDIT),canWeezeventRead:u&&s(nC.WEEZEVENT_READ),canWorkflowEdit:m&&s(nC.WORKFLOW_EDIT),canWorkflowRead:m&&s(nC.WORKFLOW_READ)}},[e,t,n,i])}function iC(){const{hasFeature:e,hasPermission:n}=Yy();return(0,de.useMemo)(()=>{const t=e(In.Accreditation),i=e(In.Delegation),s=e(In.CustomDocument),o=e(In.Weezevent);return{canAccreditationEdit:t&&n(nC.ACCREDITATION_EDIT),canAccreditationRead:t&&n(nC.ACCREDITATION_READ),canCampaignRead:n(nC.CAMPAIGN_READ),canCampaignSend:n(nC.CAMPAIGN_SEND),canCommentAdd:n(nC.COMMENT_ADD),canCommentRead:n(nC.COMMENT_READ),canCustomFieldEdit:n(nC.CUSTOM_FIELD_EDIT),canCustomFieldRead:n(nC.CUSTOM_FIELD_READ),canCustomFieldDecrypt:n(nC.CUSTOM_FIELD_DECRYPT),canDelegationEdit:i&&n(nC.DELEGATION_EDIT),canDelegationRead:i&&n(nC.DELEGATION_READ),canDelegationsSpaceParamRead:i&&n(nC.DELEGATIONS_SPACE_PARAM_READ),canDelegationsSpaceParamEdit:i&&n(nC.DELEGATIONS_SPACE_PARAM_EDIT),canDocumentEdit:s&&n(nC.DOCUMENT_EDIT),canDocumentRead:s&&n(nC.DOCUMENT_READ),canEmailEdit:n(nC.EMAIL_EDIT),canEventEdit:n(nC.EVENT_EDIT),canFormEdit:n(nC.FORM_EDIT),canFormRead:n(nC.FORM_READ),canMemberAccredit:n(nC.MEMBER_ACCREDIT),canMemberAssign:n(nC.MEMBER_ASSIGN),canMemberAssignmentStateEdit:n(nC.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:n(nC.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:n(nC.MEMBER_CREATE),canMemberDelete:n(nC.MEMBER_DELETE),canMemberEdit:n(nC.MEMBER_EDIT),canOrganizationParamEdit:n(nC.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:n(nC.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:n(nC.ORGANIZATION_USER_EDIT),canOrganizationUserRead:n(nC.ORGANIZATION_USER_READ),canPositionEdit:n(nC.POSITION_EDIT),canPositionRead:n(nC.POSITION_READ),canPrint:n(nC.PRINT),canPrintConfigEdit:n(nC.PRINT_CONFIG_EDIT),canPrintConfigRead:n(nC.PRINT_CONFIG_READ),canSegmentEdit:n(nC.SEGMENT_EDIT),canTicketIdRegenerate:n(nC.TICKET_ID_REGENERATE),canWeezeventEdit:o&&n(nC.WEEZEVENT_EDIT),canWeezeventRead:o&&n(nC.WEEZEVENT_READ),canWorkflowEdit:n(nC.WORKFLOW_EDIT),canWorkflowRead:n(nC.WORKFLOW_READ)}},[e,n])}function sC(){const{eventId:e}=ls(),{canCustomFieldEdit:n}=iC(),{canCustomFieldEdit:t}=tC();return(0,de.useCallback)(i=>n||!!i.eventId&&i.eventId===e&&t,[n,t,e])}function oC({delegationsIds:e,eventId:n,hasSelected:t,level:s,nameDebounced:o,organizationId:a,reloadKey:r}){const[d,c]=(0,de.useState)(!0),[u,m]=(0,de.useState)(null),g=(0,de.useMemo)(()=>{const e=(0,Tg.A)((0,wh.A)((u?.list.nodes??[]).concat(u?.selected?.nodes??[]),e=>e.id),e=>b(e.name));return(0,Tg.A)(Object.entries((0,l.A)(e,e=>e.delegationCategory.name)),([e])=>b(e))},[u]),h=(0,de.useMemo)(()=>g.map(([e,n])=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e)),[g]);return(0,de.useEffect)(()=>{let i=!1;return(async()=>{c(!0);const{organization:r}=await Za({organizationId:a,level:s,eventId:n,hasSelected:t,name:w(o)?o:void 0,ids:e},{token:await fe()});i||(m(r),c(!1))})(),()=>{i=!0}},[a,s,n,o,r]),{delegationsOptions:h,isLoading:d}}!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",e[e.CUSTOM_FIELD_DECRYPT=32]="CUSTOM_FIELD_DECRYPT",e[e.WEEZEVENT_READ=33]="WEEZEVENT_READ",e[e.WEEZEVENT_EDIT=34]="WEEZEVENT_EDIT",e[e.DELEGATIONS_SPACE_PARAM_READ=35]="DELEGATIONS_SPACE_PARAM_READ",e[e.DELEGATIONS_SPACE_PARAM_EDIT=36]="DELEGATIONS_SPACE_PARAM_EDIT",e[e.PRINT_CONFIG_READ=37]="PRINT_CONFIG_READ",e[e.PRINT_CONFIG_EDIT=38]="PRINT_CONFIG_EDIT",e[e.PRINT=39]="PRINT",e[e.TICKET_ID_REGENERATE=40]="TICKET_ID_REGENERATE"}(nC||(nC={}));const aC=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),[o,a,r]=Dg(""),d="event"===e.campaignType,{delegationsOptions:l,isLoading:c}=oC({organizationId:t,level:d?kn.Event:kn.Organization,eventId:d?s:null,hasSelected:f(e.delegationsIds),delegationsIds:e.delegationsIds,nameDebounced:a});return(0,i.jsx)(Zr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Kx,{isSearchLoading:c,isSearchVisible:!0,multiple:!0,name:"campaign.delegationsIds",placeholder:n("ajouter_des_del"),searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_31213"),state:"search",value:o,onChange:r}),children:l})})},rC=e=>e.recipients===Ay.Delegations?(0,i.jsx)(aC,{campaignType:e.campaignType,delegationsIds:e.delegationsIds}):null,dC=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),[o,a]=(0,de.useState)(!0),[r,d]=(0,de.useState)(!0),[c,u]=(0,de.useState)([]),[m,g]=(0,de.useState)([]),[h,p]=(0,de.useState)(!1),[I,x]=(0,de.useState)([]);return(0,de.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&o){const e=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({eventId:t},{token:await fe()});u((0,Tg.A)(e.event.accreditationsCategories,e=>e.name)),g(Object.entries((0,l.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),p(f(e.event.accreditations.nodes.flatMap(e=>e.slots))),x(e.event.accreditations.nodes.map(e=>{const n=e.slots.map(n=>{const t=n.date?s.toLocaleString(n.date,da.DateOnly.MonthLong):"",i=n.date?`${n.name} - ${t} - ${e.name}`:`${n.name} - ${e.name}`;return{id:n.id,name:i}});return[e.name,n]})),a(!1),d(!1)}})()},[e.recipients,o]),e.recipients===Ay.Accreditations?(0,i.jsx)(Xl,{css:{marginLeft:"$2"},direction:"column",gap:"2",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsCategoriesIds",placeholder:n("ajouter_des_cat_17200"),children:c.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsIds",placeholder:n("ajouter_des_acc_26514"),children:m.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))}),h&&(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsSlotsIds",placeholder:n("ajouter_des_cr_25566"),children:I.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))})]})}):null},lC=e=>{const n=Yy(),t=Ly(),s=(0,de.useMemo)(()=>(n?.user?.roles.map(e=>e.type)||[]).concat(t?.userPermissions?.roles.map(e=>e.type)||[]),[n,t]);return(0,de.useMemo)(()=>"function"==typeof t?.hasPermissions&&f(I(e.permissions))?t.hasPermissions(I(e.permissions),e.scope).some(e=>e):!!f(I(e.permissions))&&n.hasPermissions(I(e.permissions)).some(e=>e),[e.permissions,e.scope,s,t])?(0,i.jsx)(i.Fragment,{children:e.children}):null},cC=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Nh),{hasEventRole:a}=Ly(),[r,d]=(0,de.useState)(!0),[c,u]=(0,de.useState)(!0),[m,g]=(0,de.useState)([]),[h,p]=(0,de.useState)([]),[I,f]=(0,de.useState)([]),[x,_]=(0,de.useState)([]);return(0,de.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&r){const e=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({organizationId:t,eventId:s},{token:await fe()});g((0,Tg.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,l.A)(e.event.positions.nodes,e=>e.positionCategoryName))),f(e.event.positions.nodes.map(e=>{const n=e.slots.map(n=>{const t=w(n.name)?`${n.name} - `:"",i=o.toDisplayString(n.range,{formats:{displayWeekday:!0}});return{id:n.id,name:`${t}${i} - ${e.name}`}});return[e.name,n]})),_(e.organization.tags.nodes),d(!1),u(!1)}})()},[e.recipients,r]),e.recipients===Ay.Positions?(0,i.jsx)(Xl,{css:{marginLeft:"$6"},direction:"column",gap:"2",children:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lC,{permissions:nC.CAMPAIGN_SEND,scope:{positionCategoryId:"ANY"},children:(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsCategoriesIds",placeholder:n("ajouter_des_cat_15537"),children:m.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})}),(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:n("ajouter_des_mis_44522"),children:h.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))}),(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsSlotsIds",placeholder:n("ajouter_des_cr_25566"),children:I.map(([e,n],t)=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t))}),a&&(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:n("ajouter_des_tag_57392"),children:x.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]})}):null},uC=e=>{const{translate:n,params:{eventId:t}}=fc(),[s,o]=(0,de.useState)(!0),[a,r]=(0,de.useState)(!0),[d,l]=(0,de.useState)([]);return(0,de.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({eventId:t},{token:await fe()});l(e.event.segmentsFolders),o(!1),r(!1)}})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsx)(Zr,{css:{marginLeft:"$6"},children:a?(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:n("ajouter_des_vue_58990"),children:d.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 mC({eventId:e,hasSelected:n,includePhone:t,nameDebounced:s,organizationId:o,populationsIds:a,reloadKey:r,userInfoIds:d}){const[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(null),g=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)((u?.usersInfos.nodes??[]).concat(u?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>b(e.name)),[u]),h=(0,de.useMemo)(()=>g.map(e=>(0,i.jsxs)("option",{value:e.id,children:[w(e.name)?e.name:"-"," (",t?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[g]);return(0,de.useEffect)(()=>{let i=!1;return(async()=>{c(!0);const{organization:r}=await function(e,n={}){return xa('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',{...n,variables:e,fragments:[]})}({organizationId:o,eventId:e,hasSelected:n,includePhone:t||!1,userInfoIds:d,name:w(s)?s:void 0,populationsIds:a},{token:await fe()});i||(m(r),c(!1))})(),()=>{i=!0}},[o,e,t,s,a,r]),{usersInfos:g,usersInfosOptions:h,isLoading:l}}const gC=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc(),[o,a,r]=Dg(""),{usersInfosOptions:d,isLoading:l}=mC({organizationId:n,eventId:t,includePhone:e.campaignType===Ue.Sms,hasSelected:f(e.usersInfosIds),nameDebounced:a,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsx)(Zr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Kx,{isSearchLoading:l,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:s("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",name:o,placeholder:s("rechercher_un_m_05904"),state:"search",onChange:r}),children:d})}):null},hC=e=>{const{translate:n}=fc(),{event:t,hasEventRole:s,hasPermission:o}=Ly(),{canAccreditationRead:a}=tC(),{form:r,values:d}=e.formRenderProps,l=t.usePositions,c=a,u=t.useDelegations&&o(nC.CAMPAIGN_SEND,{eventId:t.id});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"recipients",onChange:e=>{if("everyone"===e)r.change("campaign.sendToEveryone",!0),r.change("campaign.delegationsIds",[]),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.delegationsIds",[]),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.delegationsIds",[]),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.delegationsIds",[]),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.delegationsIds",[]),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)r.change("campaign.sendToEveryone",!1),r.change("campaign.delegationsIds",[]),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",[]);else{if("delegations"!==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",[]),r.change("campaign.segmentsIds",[])}}}),(0,i.jsx)(ud,{name:"campaign.sendToEveryone",onChange: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",[]),r.change("campaign.delegationsIds",[]))}}),(0,i.jsx)(ud,{name:"campaign.positionsCategoriesIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.positionsCategoriesIds.length>0&&r.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(ud,{name:"campaign.positionsIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.positionsIds.length>0&&r.change("campaign.positionsIds",[])}}),(0,i.jsx)(ud,{name:"campaign.positionsSlotsIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.positionsSlotsIds.length>0&&r.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(ud,{name:"campaign.tagsIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.tagsIds.length>0&&r.change("campaign.tagsIds",[])}}),(0,i.jsx)(ud,{name:"campaign.usersInfosIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.usersInfosIds.length>0&&r.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(ud,{name:"campaign.delegationsIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.delegationsIds.length>0&&r.change("campaign.delegationsIds",[])}}),(0,i.jsx)(ud,{name:"campaign.segmentsIds",onChange:()=>{d.campaign.sendToEveryone&&d.campaign.segmentsIds.length>0&&r.change("campaign.segmentsIds",[])}}),(0,i.jsxs)(Wv,{heading:n("_qui_voulez_vo_96064"),name:"recipients",role:"radiogroup",children:[o(nC.CAMPAIGN_SEND,{eventId:t.id})&&l&&(0,i.jsx)(gy,{name:"recipients",value:"everyone",children:n("_tous_vos_memb_31761")}),o(nC.CAMPAIGN_SEND,{eventId:t.id})&&l&&(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_m_11119"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"states",children:n("_certains_memb_35722")}),"states"===d.recipients&&(0,i.jsx)(Zr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:n("ajouter_des_sta_70922"),children:Ui.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})})]}),l&&(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_c_37426"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"positions",children:s?n("_certaines_cat_59188"):o(nC.CAMPAIGN_SEND,{positionCategoryId:"ANY"})?n("_certaines_cat_22161"):n("_certaines_mis_80674")}),(0,i.jsx)(cC,{recipients:d.recipients})]}),c&&(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_c_03754"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"accreditations",children:n("_certaines_cat_14293")}),(0,i.jsx)(dC,{recipients:d.recipients})]}),u&&(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specifier_les_d"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"delegations",children:n("a_certaines_del")}),(0,i.jsx)(rC,{campaignType:"event",delegationsIds:d.campaign.delegationsIds,recipients:d.recipients})]}),(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_m_11119"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"users",children:n("_certains_memb_91094")}),(0,i.jsx)(gC,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:d.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds})]}),(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specify_which_v_99730"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"segments",children:n("_certaines_vue_55512")}),(0,i.jsx)(uC,{recipients:d.recipients})]})]})]})},pC=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o]=(0,de.useState)(!0),[a,r]=(0,de.useState)(!0),[d,l]=(0,de.useState)([]);return(0,de.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[]})}({organizationId:t},{token:await fe()});l(e.organization.segmentsFolders),o(!1),r(!1)}})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsx)(Zr,{css:{marginLeft:"$6"},children:a?(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:n("ajouter_des_vue_58990"),children:d.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},IC=e=>{const n=os(),{canDelegationRead:t}=iC(),{form:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"recipients",onChange:e=>{if("everyone"===e)s.change("campaign.sendToEveryone",!0),s.change("campaign.delegationsIds",[]),s.change("campaign.usersInfosIds",[]),s.change("campaign.segmentsIds",[]);else if("users"===e)s.change("campaign.sendToEveryone",!1),s.change("campaign.delegationsIds",[]),s.change("campaign.segmentsIds",[]);else if("segments"===e)s.change("campaign.sendToEveryone",!1),s.change("campaign.delegationsIds",[]),s.change("campaign.usersInfosIds",[]);else{if("delegations"!==e)throw new Error(`Recipients ${e} is not possible`);s.change("campaign.sendToEveryone",!1),s.change("campaign.usersInfosIds",[]),s.change("campaign.segmentsIds",[])}}}),(0,i.jsx)(ud,{name:"campaign.sendToEveryone",onChange:e=>{e&&(s.change("campaign.segmentsIds",[]),s.change("campaign.usersInfosIds",[]),s.change("campaign.delegationsIds",[]))}}),(0,i.jsx)(ud,{name:"campaign.usersInfosIds",onChange:()=>{o.campaign.sendToEveryone&&o.campaign.usersInfosIds.length>0&&s.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(ud,{name:"campaign.delegationsIds",onChange:()=>{o.campaign.sendToEveryone&&o.campaign.delegationsIds.length>0&&s.change("campaign.delegationsIds",[])}}),(0,i.jsx)(ud,{name:"campaign.segmentsIds",onChange:()=>{o.campaign.sendToEveryone&&o.campaign.segmentsIds.length>0&&s.change("campaign.segmentsIds",[])}}),(0,i.jsxs)(Wv,{heading:n("_qui_voulez_vo_96064"),name:"recipients",role:"radiogroup",children:[(0,i.jsx)(gy,{name:"recipients",value:"everyone",children:n("_tous_vos_memb_83616")}),t&&(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:n("specifier_les_d"),hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"delegations",children:n("a_certaines_del")}),(0,i.jsx)(rC,{campaignType:"organization",delegationsIds:o.campaign.delegationsIds,recipients:o.recipients})]}),(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:"",hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"users",children:n("_certains_memb_91094")}),(0,i.jsx)(gC,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:o.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds})]}),(0,i.jsxs)(Wv,{css:{"& > div":{gap:"$2"}},heading:"",hideHeading:!0,children:[(0,i.jsx)(gy,{name:"recipients",value:"segments",children:n("_certaines_vue_55512")}),(0,i.jsx)(pC,{recipients:o.recipients})]})]})]})},fC=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{showNotification:a}=Sy(),r=ss(Ey),d=e.initialValues.campaign.state===Le.Template,l=(0,de.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.campaign.name):o(d?"cr_ation_d_un_m_50096":"cr_ation_d_une_80936"),[e.isEdit,e.initialValues,d]);fm(l);const c=[Le.Done,Le.InProgress].includes(e.initialValues.campaign.state),u=Nv.CAMPAIGNS({organizationId:t,eventId:s}),m=(0,de.useRef)(null);return(0,i.jsx)(Ig.Provider,{value:{designSystem:pg},children:(0,i.jsx)(Nx,{category:l,fallbackClosePath:u,heading:e.isEdit?e.initialValues.campaign.name:o(d?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)(kx,{ref:m,children:(0,i.jsxs)(fy,{containerRef:m,initialValues:e.initialValues,isEdit:e.isEdit,onSubmit:async t=>{await e.mutate(t.campaign),a(e.isEdit?o("la_campagne_a_50262"):o("la_campagne_a_02968")),n.goBack(u)},children:[(0,i.jsx)(Iy,{heading:o(d?"initialisation_84842":"initialisation_48904"),render:e=>(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[(0,i.jsx)(Xy,{formRenderProps:e,isSent:c,isTemplate:d}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:e.handleSubmit,children:o(d?"suivant_conte_33443":"suivant_conte_90603")})})]}),schema:r.campaignStep1Schema()}),(0,i.jsx)(Iy,{heading:o("contenu_29668"),render:n=>(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[(0,i.jsx)(py,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,customFields:e.customFields,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formRenderProps:n,hasDuplicatedMembers:e.hasDuplicatedMembers,isSent:c,isTemplate:d}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:n.submitting,onClick:n.handleSubmit,children:d?e.isEdit?o("mettre_jour_l_13576"):o("cr_er_le_mod_le_06346"):o(c?"mettre_jour_l_32694":"suivant_desti_10756")})})]}),schema:r.campaignStep2Schema()}),!d&&!c&&(0,i.jsx)(Iy,{heading:o("destinataires_19592"),render:n=>(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:["event"===e.campaignType?(0,i.jsx)(hC,{formRenderProps:n}):(0,i.jsx)(IC,{formRenderProps:n}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:n.handleSubmit,children:o("suivant_livra_97068")})})]}),schema:r.campaignStep3Schema()}),!d&&!c&&(0,i.jsx)(Iy,{heading:o("livraison_86944"),render:n=>(0,i.jsx)(Jy,{campaignType:e.campaignType,formRenderProps:n,timeZone:e.timeZone}),schema:r.campaignStep4Schema()}),!d&&!c&&(0,i.jsx)(Iy,{heading:o("r_capitulatif_a_79107"),render:n=>(0,i.jsx)(eC,{emailsSenders:e.emailsSenders,formRenderProps:n,isEdit:e.isEdit}),schema:r.createUpdateCampaignSchema()})]})})})})},xC=e=>{const{organizationId:n,eventId:t,options:s}=ls(),o=ss(Ey),{data:a,loader:r}=Pa({organizationId:n,eventId:t}),{mutate:d}=Da(),{event:l}=Ly();return r||(0,i.jsx)(fC,{campaignType:t?"event":"organization",canCustomDocuments:l?.useDocuments??!1,customDocuments:a.organization?.event?.customDocuments??[],customFields:a.organization.customFields.nodes,emailSenderId:a.organization?.event?.emailSender?.id??a.organization.emailSenderId,emailsSenders:a.organization.emailsSenders,hasDuplicatedMembers:a.organization?.event?.hasDuplicatedMembers??!1,initialValues:o.createUpdateCampaignValuesDefault(e.isTemplate,a.organization.event?.emailSender?.id??a.organization.emailSenderId,null,s),isEdit:!1,mutate:async e=>{const{campaignCreate:{id:i}}=await d({organizationId:n,eventId:t,campaign:e});return i},timeZone:a.organization?.event?.timeZone??a.organization.timeZone})},_C=()=>{const{organizationId:e,eventId:n,campaignId:t}=ls(),{data:s,loader:o}=rs("query CampaignEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $campaignId: CampaignId!\n) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n\n event(id: $eventId) {\n hasDuplicatedMembers\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:n,campaignId:t},[Ko.CustomFieldFragment,Ko.CreateCampaignEmailSenderFragment,Ko.CampaignEditFragment],undefined);const a=ss(Ey),{mutate:r}=Ma(),{event:d}=Ly();return o||(0,i.jsx)(fC,{campaignType:"event",canCustomDocuments:d.useDocuments,customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,emailSenderId:s.event.emailSender?.id,emailsSenders:s.organization.emailsSenders,hasDuplicatedMembers:s.event.hasDuplicatedMembers,initialValues:a.createUpdateCampaignValuesDefault(!1,s.event.emailSender?.id,s.event.campaign,null),isEdit:!0,mutate:async i=>{const{campaignUpdate:{id:s}}=await r({organizationId:e,eventId:n,campaignId:t,campaign:i});return s},timeZone:s.event.timeZone})},jC=()=>{const{organizationId:e,campaignId:n}=ls(),{data:t,loader:s}=rs("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 customFields(\n variety: UserInfo\n fieldTypes: [Checkbox, Select, Validation]\n onlyUpdatableByUrl: true\n ) {\n nodes {\n ...CustomField\n }\n }\n\n emailsSenders(isValidToSendEmail: true) {\n ...CreateCampaignEmailSender\n }\n }\n}\n",{organizationId:e,campaignId:n},[Ko.CampaignEditFragment,Ko.CustomFieldFragment,Ko.CreateCampaignEmailSenderFragment],undefined);const o=ss(Ey),{mutate:a}=Ma();return s||(0,i.jsx)(fC,{campaignType:"organization",canCustomDocuments:!1,customDocuments:[],customFields:t.organization.customFields.nodes,emailSenderId:t.organization.emailSenderId,emailsSenders:t.organization.emailsSenders,hasDuplicatedMembers:!1,initialValues:o.createUpdateCampaignValuesDefault(!1,t.organization.emailSenderId,t.organization.campaign,null),isEdit:!0,mutate:async t=>{const{campaignUpdate:{id:i}}=await a({organizationId:e,campaignId:n,campaign:t});return i},timeZone:t.organization.timeZone})},vC=({children:e,...n})=>(0,i.jsx)(wc,{as:"abbr",textStyle:"abbreviation",...n,children:e}),SC=e=>(0,i.jsx)(Xl,{as:Yl.Header,...Zl(e),css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7","& :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$displayXs",lineHeight:"32px"},...e.css},children:e.children}),yC=e=>(0,i.jsx)(Xl,{...Zl(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),CC=e=>(0,i.jsx)(SC,{align:"center",css:{paddingBlockEnd:"$4"},gap:"4",hideBorder:!0,children:e.isLoading?(0,i.jsx)(Pg,{}):(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[e.breadcrumbs,(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsxs)(Xl,{css:{alignItems:"center",alignSelf:"stretch",flex:"1"},gap:"4",children:[e.icon&&(0,i.jsx)(Xl,{align:"center",justify:"center",children:(0,i.jsx)(UI,{color:e.color??void 0,css:{inlineSize:"56px",blockSize:"56px"},icon:e.icon})}),(0,i.jsxs)(Xl,{css:{alignItems:"flex-start"},direction:"column",justify:"center",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)($c,{children:e.name}),w(e.acronym)&&(0,i.jsx)(vC,{css:{position:"relative",top:"6px"},children:e.acronym}),e.nameSuffix]}),e.subtext&&(0,i.jsx)(wc,{textStyle:"subtitle",children:e.subtext})]})]}),e.buttons]})]})}),bC=SC,AC=e=>(0,i.jsx)(Xl,{css:e.css,direction:"column",height:1,width:1,children:e.children}),EC=e=>{const n=us().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[e.disabled?(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"grayCustom500",css:{borderBottom:"unset",paddingBlock:"$3",fontWeight:"$medium"},children:e.children})}),(0,i.jsx)(ux,{placement:"top",children:e.disabledMessage})]}):(0,i.jsx)(gc,{replace:!0,to:e.path,children:(0,i.jsx)(Zr,{color:n?"primaryCustom500":"grayCustom500",css:{borderBottom:n?"2px solid $primaryCustom500":"unset",cursor:n?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:n?"$primaryCustom600":"$grayCustom800"},fontWeight:"$medium"},children:e.children})}),(0,i.jsx)(Zr,{width:24})]})},wC=e=>(0,i.jsxs)(Xl,{"aria-orientation":"horizontal",as:Yl.Nav,css:{borderBottom:"1px solid $gray200",...e.css},width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{flex:"1"}})}),e.children,(0,i.jsx)(Zr,{css:{flex:"1"}})]}),$C=e=>(0,i.jsx)(i.Fragment,{children:e.children});$C.displayName="TabPanel";const TC=e=>{const[n,t]=(0,Up.A)(de.Children.toArray(e.children),e=>(0,de.isValidElement)(e)&&e.type===$C);return(0,i.jsxs)(Xl,{direction:"column",width:1,...Zl(e),children:[t,(0,i.jsx)(Xr.dO,{children:n.map((e,n)=>(0,i.jsx)(Xr.qh,{path:e.props.path,children:e},n))})]})},zC=(0,de.createContext)({}),OC=e=>(0,i.jsx)(zC.Provider,{value:{...e},children:e.children}),RC=e=>(0,i.jsxs)(Zr,{css:{background:"white",bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),DC=Nr(Xl,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),MC=e=>{const{params:{organizationId:n,eventId:t}}=fc(),s=(0,de.useMemo)(()=>w(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),o=()=>(0,i.jsx)(Zr,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:s,children:s});return(0,i.jsxs)(DC,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(F_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[e.isClickDisabled?o():(0,i.jsx)(Ug,{to:e.clickPath??Ev.MEMBER_INFORMATION({organizationId:n,eventId:t,userInfoId:e.userInfo.id}),children:o()}),(0,i.jsx)(Zr,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(Zr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(Ug,{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)(Zr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(Ug,{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 PC(e){switch(e){case rn.Waiting:case rn.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case rn.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const kC=e=>{const{translate:n,params:{organizationId:t,eventId:s,campaignId:o}}=fc(),a=ss(Wg),{mutate:r}=$r(),{mutate:d}=fr();return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(MC,{userInfo:e.email.userInfo})}),(0,i.jsx)(_g,{children:e.email.sentAt?a.toLocaleString(e.email.sentAt.toLocal(),da.DateTime):""}),(0,i.jsxs)(_g,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Lm,{...PC(e.email.state),children:n(e.email.state)}),e.email.state===rn.Bounced&&w(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsx)(Lg,{children:(0,i.jsx)(Em,{icon:"paper-plane",onClick:async()=>{e.emailType?await d({organizationId:t,eventId:s,userInfoId:e.email.userInfo.id,emailType:e.emailType}):await r({organizationId:t,eventId:s,campaignId:o,selecteds:{ids:[e.email.userInfo.id]}}),e.reload()},children:n("r_envoyer_90741")})})})]})},FC=e=>{const{params:{organizationId:n,campaignId:t},translate:s}=fc(),[o,a,r]=Dg(""),[d,l]=(0,de.useState)(""),[c,u]=(0,de.useState)(0),{data:m,isLoading:g,reload:h}=rs("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:n,campaignId:t,name:w(a)?a:void 0,state:""!==d?d:void 0,offset:c},[Ko.EmailRecipientFragment],undefined);const p=zg();return(0,i.jsxs)(yC,{direction:"column",gap:"7",children:[(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsx)(RC,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(RC,{content:e.campaign.numberOfOpen??0,title:s("nombre_d_ouvert_84187")}),(0,i.jsx)(RC,{content:e.campaign.numberOfClick??0,title:s("nombre_de_clics_64232")})]}),(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:d,onChange:e=>{l(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),p(ai.filter(e=>e!==rn.Queued))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{r(e),u(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Mg,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Mg,{children:s("State")}),(0,i.jsx)(Mg,{width:100})]}),numberOfPages:m.organization?.campaign.emails.numberOfPages??0,offset:c,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:m.organization.campaign.emails.nodes.map((e,n)=>(0,i.jsx)(kC,{email:e,emailType:null,reload:h},n))}),setOffset:u,title:s("liste_des_desti_16448"),totalCount:m.organization?.campaign.emails.totalCount??0})]})},NC=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=fc(),[r,d,l]=Dg(""),{usersInfosOptions:c,isLoading:u}=mC({organizationId:s,eventId:o,hasSelected:!0,nameDebounced:d,userInfoIds:[a],populationsIds:e.populationsIds});return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7",...e.css},gap:"4",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_le_81451")}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",name:r,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:l}),values:[a],onChange:t=>{f(t)&&n.replace(e.getPath(t[0]))},children:c})}),w(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})]})};function LC(e){switch(e){case yt.Assigned:return{color:"success",leftIcon:"check"};case yt.Refused:return{color:"error",leftIcon:"xmark"};case yt.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case yt.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case yt.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return Ic()}}function UC(e){switch(e){case Re.Accredited:return{color:"success",leftIcon:"check"};case Re.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case Re.Refused:return{color:"error",leftIcon:"xmark"};case Re.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case Re.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return Ic()}}const VC=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{getVolunteersSegmentPath:a}=(0,de.useContext)(zC),r=(0,de.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:Eo.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:Eo.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:Eo.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]),d=(0,de.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:mo.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:mo.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.accreditation.id})}))),[e.campaign]),l=(0,de.useMemo)(()=>d.length+r.length,[d,r]);return(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:t("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(Zr,{color:"gray800",children:t("tous_vos_membre_30731")}):f(e.campaign.states)?(0,i.jsx)(Xl,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(Lm,{...LC(e),children:t(e)},e))}):f(e.campaign.usersInfos)?(0,i.jsx)(Xl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((t,a)=>(0,i.jsxs)(Zr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(Ev.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:t.id}))},children:[t.nameOrEmail,a!==e.campaign.usersInfos.length-1&&", "]},t.id))}):f(e.campaign.segments)?(0,i.jsx)(Xl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((t,s)=>(0,i.jsxs)(Zr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(a(t.id))},children:[t.name,s!==e.campaign.segments.length-1&&", "]},t.id))}):f(e.campaign.delegations)?(0,i.jsx)(Xl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.delegations.map((t,o)=>(0,i.jsxs)(Zr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(t.eventId?vo.DELEGATION({organizationId:s,eventId:t.eventId,delegationId:t.id}):vo.DELEGATION({organizationId:s,delegationId:t.id}))},children:[t.name,o!==e.campaign.delegations.length-1&&", "]},t.id))}):(0,i.jsx)(Xl,{css:{flex:"1"},gap:"1",wrap:"wrap",children:r.concat(d).map((e,t)=>(0,i.jsxs)(Zr,{color:w(e.link)?"primary500":"gray800",css:{cursor:w(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{w(e.link)&&n.push(e.link)},children:[e.name,t!==l-1?", ":""]},e.id))})]})},BC=e=>{const n=os(),t=(0,de.useCallback)(e=>{e&&(e.onload=()=>{const n=e.contentDocument?.body;if(n){const t=n.scrollHeight;e.style.height=`${t}px`,n.style.margin="0",n.style.overflow="hidden",e.parentElement&&(e.parentElement.style.height=`${t+64}px`)}})},[]);return(0,i.jsx)(Xl,{css:{background:"$gray50",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Xl,{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)(Xl,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("cr_e_par_16667")}),(0,i.jsx)(Zr,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("de_70487")}),(0,i.jsx)(Zr,{color:"gray800",children:e.from})]}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(VC,{campaign:e.to})}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(Xl,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("objet_86482")}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(Xl,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{css:{minHeight:"300px",marginTop:"$3","& iframe":{background:"white",border:"none",borderRadius:"$2",overflow:"hidden",width:"100%"}},width:1,children:(0,i.jsx)("iframe",{ref:t,srcDoc:e.content})}),(f(e.attachments)||f(e.documents))&&(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textXl semiBold",children:n("pi_ces_jointes_36761")}),(0,i.jsx)(Xl,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(Lm,{color:"white",size:"md",children:qv.includes(e)?n(e):ei.includes(e)?fj(e):e},e))}),(0,i.jsx)(Xl,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(pS,{acl:"public-read",document:e},e.id))})]})]})]})})},WC=()=>{const{params:{organizationId:e,eventId:n,campaignId:t,userInfoId:s}}=fc(),{data:o,loader:a}=Pd({organizationId:e,campaignId:t,userInfoId:s}),r=(0,de.useMemo)(()=>o.organization?.campaign.createdBy?`${o.organization.campaign.createdBy.name} (${o.organization.campaign.createdBy.email})`:null,[o.organization]),d=(0,de.useMemo)(()=>o.organization?.campaign.emailSender?`${o.organization.campaign.emailSender.fromName} (${o.organization.campaign.emailSender.fromEmail})`:ee.EMAIL_FROM,[o.organization]);return a||(0,i.jsx)(yC,{children:(0,i.jsx)(BC,{attachments:o.organization.campaign.attachments,content:o.organization.campaign.preview,createdBy:r,documents:o.organization.campaign.documents,from:d,subject:o.organization.campaign.subject,to:o.organization.campaign,userSelector:(0,i.jsx)(NC,{css:{border:"none",px:"$6"},getPath:i=>Nv.CAMPAIGN_PREVIEW({organizationId:e,eventId:n,campaignId:t,userInfoId:i})})})})},GC=({children:e,color:n,fontWeight:t,returnPathFallback:s})=>{const o=cs();return(0,i.jsxs)(Xl,{align:"center",css:{color:"primary"===n?"$primary500":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:t??"normal",padding:0},gap:"2",onClick:()=>o.goBack(s),children:[(0,i.jsx)(pc,{icon:"arrow-left"}),e]})},qC=e=>{const{translate:n,params:{organizationId:t,eventId:s,campaignId:o}}=fc(),{canCampaignSend:a}=tC();return(0,i.jsxs)(bC,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(GC,{returnPathFallback:Nv.CAMPAIGNS({organizationId:t,eventId:s})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.campaign.name}),a&&(0,i.jsx)(yc,{to:Nv.UPDATE({organizationId:t,eventId:s,campaignId:o}),children:n("_diter_la_campa_04069")})]})};function HC(e){switch(e){case It.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case It.Sent:case It.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const YC=e=>(0,i.jsx)(Zr,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),ZC=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"3",width:1,children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(Zr,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(Zr,{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)(Zr,{children:(0,i.jsx)(F_,{email:e.message.createdBy.email,image:e.message.createdBy.picture?.url,name:e.message.createdBy.name,size:40})})]}),e.message.replies.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"3",width:1,children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(F_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(Zr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(n)})]})]})]},t))]}),KC=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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,de.useState)(""),{numberOfCharacters:a,numberOfSms:r}=my(s,!1),d=w(s);return(0,i.jsxs)(Xl,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Xx,{label:(0,i.jsxs)(Xl,{justify:"between",children:[(0,i.jsx)(Zr,{children:n("contenu_de_la_r_08075")}),(0,i.jsx)(Zr,{color:"gray500",children:n("_1_caract_re_04414",a,r)})]}),value:s,onChange:o}),(0,i.jsx)(Xl,{justify:"end",children:(0,i.jsx)(yc,{disabled:!d,onClick:async()=>{await t({organizationId:e.organizationId,eventId:e.eventId,parentId:e.parentId,content:s}),e.reload()},children:n("envoyer_le_mess_41092")})})]})},XC=e=>{const n=os(),{data:t,loader:s,reload:o}=rs("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},[Ko.CreatedByFragment],undefined);const a=(0,de.useMemo)(()=>(0,Tg.A)([{text:e.text,replies:t.organization?.textMessage.replies??[],sentAt:e.textMessage.sentAt,createdBy:e.createdBy}].concat(t.organization?.textMessage.children??[]),e=>e.sentAt.toMillis()),[t.organization]);return(0,i.jsxs)(fI,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:n("r_ponse_de_1_77675",e.userInfo.name)}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(xI,{children:[a.map((n,t)=>(0,i.jsx)(ZC,{message:n,userInfo:e.userInfo},t)),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(_I,{children:(0,i.jsx)(KC,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:o})})]})]})},QC=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Wg),{mutate:a}=function(e={}){return ds("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)}(),[r,d]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Eg,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(MC,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)(_g,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(_g,{children:e.textMessage.sentAt?o.toLocaleString(e.textMessage.sentAt,da.DateTime):""}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{...HC(e.textMessage.state),children:n(e.textMessage.state)})}),(0,i.jsx)(_g,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(yc,{color:"white",size:"sm",onClick:async n=>{Uc(n),await a({organizationId:t,eventId:s,textMessageId:e.textMessage.id}),d(!0)},children:n("voir_la_reponse",e.textMessage.numberOfReplies)}):""})]}),r&&(0,i.jsx)(XC,{createdBy:e.createdBy,eventId:s,organizationId:t,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{d(!1)}})]})},JC=e=>{const{params:{organizationId:n,campaignId:t},translate:s}=fc(),[o,a,r]=Dg(""),[d,l]=(0,de.useState)(""),[c,u]=(0,de.useState)(""),[m,g]=(0,de.useState)(0),{data:h,isLoading:p}=rs("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:n,campaignId:t,name:w(a)?a:void 0,state:""!==d?d:void 0,replies:""!==c?c:void 0,offset:m},[Ko.CreatedByFragment,Ko.CampaignUserInfoFragment],undefined);const I=zg(),{numberOfPages:f,totalCount:x}=Jf(h.organization?.campaign.textMessages);return(0,i.jsxs)(yC,{direction:"column",gap:"7",children:[(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsx)(RC,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(RC,{content:e.campaign.numberOfDelivery??0,title:s("nombre_de_messa_93859")}),(0,i.jsx)(RC,{content:e.campaign.cost,title:s("co_t_de_la_camp_54312")})]}),(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:d,onChange:e=>{l(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),I(Fi)]})}),(0,i.jsx)(Zr,{width:240,children:(0,i.jsxs)(nf,{value:c,onChange:e=>{u(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("avec_et_sans_r_23765")}),I(ki)]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{r(e),g(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Mg,{children:s("Phone")}),(0,i.jsx)(Mg,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Mg,{children:s("State")}),(0,i.jsx)(Mg,{children:s("r_ponses_97000")})]}),numberOfPages:f,offset:m,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.organization.campaign.textMessages.nodes.map((n,t)=>(0,i.jsx)(QC,{createdBy:h.organization.campaign.createdBy,text:e.campaign.text,textMessage:n},t))}),setOffset:g,title:s("liste_des_desti_16448"),totalCount:x})]})},eb=()=>{const{params:{organizationId:e,eventId:n,campaignId:t,userInfoId:s}}=fc(),o=ss(Wg),{data:a,loader:r}=Pd({organizationId:e,campaignId:t,userInfoId:s}),d=a.organization?.campaign.sentAt?.setZone(Jo.c9.local().zone);return r||(0,i.jsx)(yC,{children:(0,i.jsx)(Xl,{css:{background:"$gray50",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",overflow:"hidden",paddingBottom:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(NC,{css:{border:"none",px:"$6"},getPath:i=>Nv.CAMPAIGN_PREVIEW({organizationId:e,eventId:n,campaignId:t,userInfoId:i})}),(0,i.jsx)(Zr,{css:{px:"$6"},children:(0,i.jsx)(VC,{campaign:a.organization.campaign})}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",height:"1px",px:"$6"}}),(0,i.jsxs)(Xl,{css:{px:"$6"},gap:"3",width:1,children:[a.organization.campaign.createdBy&&(0,i.jsx)(Zr,{children:(0,i.jsx)(F_,{email:a.organization.campaign.createdBy.email,image:a.organization.campaign.createdBy.picture?.url,name:a.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(a.organization.campaign.createdBy||d)&&(0,i.jsxs)(Xl,{gap:"3",width:1,children:[a.organization.campaign.createdBy&&(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:a.organization.campaign.createdBy.name}),d&&(0,i.jsx)(Zr,{color:"gray500",children:o.toLocaleString(d,da.DateTime)})]}),(0,i.jsx)(Zr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:a.organization.campaign.preview}})]})]})]})})})},nb=()=>{const{params:{organizationId:e,eventId:n,campaignId:t},translate:s}=fc(),{data:o,loader:a}=rs("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:n,campaignId:t},[],undefined);const r=(0,de.useMemo)(()=>o.organization?n?o.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:o.organization.usersInfos.nodes[0].id:-1,[n,o.organization]);fm(`${o.organization?.campaign.name??""} ${s("campagne_97871")}`);const d=i=>({organizationId:i?":organizationId":e,eventId:n?i?":eventId":n:void 0,campaignId:i?":campaignId":t}),l=e=>({...d(e),userInfoId:e?":userInfoId":r}),c=xs([Nv.CAMPAIGN(d(!1)),Ss.PREVIEW]);return a||(0,i.jsxs)(AC,{children:[(0,i.jsx)(qC,{campaign:o.organization.campaign}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:Nv.CAMPAIGN_DASHBOARD(d(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(EC,{basePath:c,disabled:!r,disabledMessage:s("vous_devez_avoir_2345"),path:Nv.CAMPAIGN_PREVIEW(l(!1)),children:s("aper_u_25595")})]}),(0,i.jsx)($C,{path:Nv.CAMPAIGN_DASHBOARD(d(!0)),children:o.organization?.campaign.campaignType===Ue.Email?(0,i.jsx)(FC,{campaign:o.organization?.campaign}):(0,i.jsx)(JC,{campaign:o.organization?.campaign})}),(0,i.jsx)($C,{path:Nv.CAMPAIGN_PREVIEW(l(!0)),children:o.organization?.campaign.campaignType===Ue.Email?(0,i.jsx)(WC,{}):(0,i.jsx)(eb,{})})]})]})},tb=()=>{const{organizationId:e,eventId:n}=ls();return(0,i.jsx)(OC,{getVolunteersSegmentPath:t=>Wo.VOLUNTEERS_SEGMENT(e,n,t),isOrganizationCampaign:!1,children:(0,i.jsx)(nb,{})})},ib=()=>{const{organizationId:e}=ls();return(0,i.jsx)(OC,{getVolunteersSegmentPath:n=>Wo.COMMUNITY_USERS_SEGMENT(e,n),isOrganizationCampaign:!0,children:(0,i.jsx)(nb,{})})};function sb(e){switch(e){case nn.Expired:return{color:"error",leftIcon:"clock"};case nn.Full:return{color:"error",leftIcon:"hundred-points"};case nn.Locked:return{color:"error",leftIcon:"lock-keyhole"};case nn.Ongoing:return{color:"success",leftIcon:"check"};default:return Ic()}}var ob;let ab=class extends ju{constructor(e){super(e)}createUpdateDelegationValuesDefault(e,n){return{delegation:this.delegationInputDefault(e,n),selectedAccreditationsSlotsIds:[]}}delegationInputDefault(e,n){const t=n?.forms&&n?.parentDelegation?n.forms.find(e=>e.name===n.parentDelegation?.form.name):null,i=e?.formId??t?.id??null,s=f(n?.delegationsCategories)&&n?.parentDelegation?n.delegationsCategories.find(e=>e.name===n.parentDelegation?.delegationCategory.name):null;let o=e?.delegationCategoryId??s?.id??n?.delegationCategoryId;return Number.isInteger(o)||(o=null),{...this.getDefaultAccreditations(e),delegationCategoryId:o,parentId:e?.parentId??n?.parentId??null,name:e?.name??"",description:e?.description??"",leadersIds:e?.leadersIds??n?.parentDelegation?.leadersIds??[],formId:i,deadlineDate:e?.deadlineDate??null,maxResources:e?.maxResources??null,showInDelegationSpace:e?.showInDelegationSpace??!0,showFormLinkInDelegationSpace:e?.showFormLinkInDelegationSpace??!0,delegationsSpaceLayoutId:e?.delegationsSpaceLayoutId??null,columns:e?.columns??n?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersDuplicateMembers:e?.canLeadersDuplicateMembers??!1,canLeadersEditColumns:e?.canLeadersEditColumns??!0,canLeadersEditCustomFields:e?.canLeadersEditCustomFields??!0,canLeadersEditMembers:e?.canLeadersEditMembers??!0,canLeadersImportMembers:e?.canLeadersImportMembers??!1,canLeadersSeeHiddenAccreditationsSlots:e?.canLeadersSeeHiddenAccreditationsSlots??!1,privateNote:e?.privateNote??n?.parentDelegation?.privateNote??"",addDefaultAccreditationsByAvailability:e?.addDefaultAccreditationsByAvailability??!1,showAllAccreditations:e?.showAllAccreditations??!1,tagsIds:e?.tagsIds??n?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[],accreditationsProfiles:e?.accreditationsProfiles??[]}}delegationInputSchema(){return Jl.Ik().shape({parentId:Jl.ai().nullable(),name:Jl.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:Jl.Yj(),delegationCategoryId:Jl.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:Jl.YO().of(Jl.ai()),formId:Jl.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:e_.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:Jl.ai().min(0).nullable(),showInDelegationSpace:Jl.zM().required(),showFormLinkInDelegationSpace:Jl.zM().required(),delegationsSpaceLayoutId:Jl.ai().nullable(),columns:Jl.YO().of(Jl.Yj()).when("delegationsSpaceLayoutId",{is:e=>"number"==typeof e&&e>0,otherwise:e=>e.required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605"))}),canLeadersAddMembers:Jl.zM().required(),canLeadersDeleteMembers:Jl.zM().required(),canLeadersEditColumns:Jl.zM().required(),canLeadersEditMembers:Jl.zM().required(),canLeadersEditCustomFields:Jl.zM().required(),canLeadersImportMembers:Jl.zM().required(),canLeadersSeeHiddenAccreditationsSlots:Jl.zM().required(),privateNote:Jl.Yj(),accreditations:Jl.YO().of(Jl.Ik().shape({accreditationCategoryId:Jl.ai().required(),accreditationId:Jl.ai().required(),maxResources:Jl.gl().nullable(),willAutoAccredit:Jl.zM().required()})),accreditationsSlots:Jl.YO().of(Jl.Ik().shape({accreditationCategoryId:Jl.ai().required(),accreditationId:Jl.ai().required(),accreditationSlotId:Jl.ai().required(),isDefault:Jl.zM().required(),maxResources:Jl.gl().nullable()})),accreditationsProfiles:Jl.YO().of(Jl.Ik().shape({accreditationProfileId:Jl.ai().required(),maxResources:Jl.gl().nullable(),willAutoAccredit:Jl.zM().required()})),campaignsIds:Jl.YO().of(Jl.ai()),customDocumentsSlugs:Jl.YO().of(Jl.gl()),usedCustomFieldsIds:Jl.YO().of(Jl.ai())})}delegationUpdateFieldsSchema(e){return Jl.Ik().shape({fields:e})}createUpdateDelegationSchema(e){const n=this.delegationInputSchema();return Jl.Ik().shape({delegation:e?n.shape({fields:e}):n})}adminAddSchema(){return Jl.Ik().shape({usersInfosIds:Jl.YO().of(Jl.ai())})}getDefaultAccreditations(e){let n=e?.accreditationsCategories||[],t=e?.accreditations||[];const i=e?.accreditationsSlots||[];return f(i)&&(n=(0,wh.A)(n.concat(i.map(e=>({accreditationCategoryId:e.accreditationCategoryId,maxResources:null}))),e=>e.accreditationCategoryId)),f(i)&&(t=(0,wh.A)(t.concat(i.map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),e=>e.accreditationId)),{accreditationsCategories:n,accreditations:t,accreditationsSlots:i}}};ab=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(ob=void 0!==ts&&ts)?ob:Object])],ab);var rb=t(2662);const db=/^[0-9]{11}$/i,lb=Jo.c9.now().year-2e3;function cb(e){if(w(e)&&db.test(e)){const n=(0,rb.A)(e.substring(0,2),10);let t=(0,rb.A)(e.substring(0,9),10);const i=(0,rb.A)(e.substring(9),10);return n<=lb&&(t=2e9+t),i===97-t%97}return!1}const ub=/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/,mb={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},gb=h([_n.Checkbox,_n.Select,_n.Validation]);function hb(e,n){switch(n){case Ke.Accreditation:return e("accr_ditations_39450");case Ke.Delegation:return e("d_l_gations_78318");case Ke.Event:return e("Event");case Ke.Position:return e("missions_63972");case Ke.UserInfo:return e("membres_11310");default:return Ic()}}function pb(e){return w(e.label)?`${e.name} (${e.label})`:e.name}function Ib(e){return e.fieldType===_n.Select&&e.canSelectMultiple}const fb=["default","regex"],xb=["all","numbers","noSymbols","uppercase","lowercase"],_b=["any","past","between"];function jb(e){switch(e.fieldType){case _n.Text:return e.fieldSubtype===xn.Freeform?"text":null;case _n.Textarea:return"text";case _n.Number:return"number";case _n.Date:case _n.Datetime:return e.fieldProperty===fn.DateOfBirth?null:"date";default:return null}}function vb(e){switch(e){case"text":return{mode:"default",allowedCharacters:"all"};case"date":return{range:"any"};default:return{}}}const Sb=[{key:"addressPostalCodeCustomFieldId",fieldType:_n.Text},{key:"addressCityCustomFieldId",fieldType:_n.Text},{key:"addressCountryCustomFieldId",fieldType:_n.Country}];function yb(e,n){return n.organizationId===e.organizationId&&n.variety===e.variety&&(!n.eventId||n.eventId===e.eventId)}const Cb=[_n.Checkbox,_n.Country,_n.Language,_n.Nationality,_n.Select];var bb,Ab,Eb;let wb=class{countriesService;dateTimeService;translationService;constructor(e,n,t){this.countriesService=e,this.dateTimeService=n,this.translationService=t}getValueString(e,n,t={}){switch(e.fieldType){case _n.Text:return this.getTextValue(e,n);case _n.Textarea:case _n.Time:case _n.Address:return n[e.slug]||"";case _n.Sex:return this.getSexValue(e,n);case _n.Language:return this.getLanguageValue(e,n);case _n.Nationality:return this.getNationalityValue(e,n);case _n.Country:return this.getCountryValue(e,n);case _n.Select:return this.getSelectValue(e,n);case _n.Checkbox:case _n.Validation:return this.getBooleanValue(e,n);case _n.Date:return this.getDateValue(e,n,t.dateFormat);case _n.Datetime:return this.getDatetimeValue(e,n,t.datetimeFormat);case _n.File:return"name"===t.fileReturnValue?n[e.slug]?.name||"":n[e.slug]?.url||"";case _n.Phone:return this.getPhoneValue(e,n);case _n.Number:return this.getIntValue(e,n);default:return Ic(e.fieldType)}}getValue(e,n){return n[e.slug]}getSelectValues(e,n){const t=I(this.getValue(e,n)??[]);return(0,sc.A)(t.map(n=>e.values.find(e=>e.id===n)?.value))}getSelectCustomFieldValues(e,n){const t=I(this.getValue(e,n)??[]);return(0,sc.A)(t.map(n=>e.values.find(e=>e.id===n)))}getTextValue(e,n){const t=this.getValue(e,n);return w(t)?function(e,n){return"firstName"===e.slug||"lastName"===e.slug?R(n):e.fieldSubtype===xn.Avs?function(e){const n=e.replace(/\D/g,"");return 13===n.length&&n.startsWith("756")?`756.${n.substring(3,7)}.${n.substring(7,11)}.${n.substring(11)}`:e}(n):e.fieldSubtype===xn.Iban?function(e){const n=e.toUpperCase().trim().replace(/\s+/g,"");return ub.test(n)&&n.length===mb[n.substring(0,2)]?n.match(/.{1,4}/g).join(" "):e}(n):n}(e,t):t||""}getSexValue(e,n){return this.translationService.translate(this.getValue(e,n)??"")}getLanguageValue(e,n){return this.translationService.translate(this.getValue(e,n)??"")}getNationalityValue(e,n){return this.countriesService.getNationality(this.getValue(e,n)??"")??""}getCountryValue(e,n){return this.countriesService.getName(this.getValue(e,n)??"")??""}getBooleanValue(e,n){const t=this.getValue(e,n);return!0===t?this.translationService.translate("oui_54361"):!1===t?this.translationService.translate("non_33516"):""}getDateValue(e,n,t){let i=this.getValue(e,n);return w(i)&&(i=Jo.c9.fromISO(i,{zone:"utc"})),Jo.c9.isDateTime(i)&&i.isValid?w(t)?i.toFormat(t):this.dateTimeService.toLocaleString(i,da.DateOnly.MonthLong):""}getDatetimeValue(e,n,t){let i=this.getValue(e,n);return w(i)&&(i=Jo.c9.fromISO(i,{zone:"utc"})),Jo.c9.isDateTime(i)&&i.isValid?w(t)?i.toFormat(t):this.dateTimeService.toLocaleString(i,da.DateTime):""}getPhoneValue(e,n){return this.getValue(e,n)?.internationalFormat??""}getIntValue(e,n){return this.getValue(e,n)?.toString()??""}getSelectValue(e,n){const t=I(this.getValue(e,n)??[]);return(0,sc.A)(t.map(n=>e.values.find(e=>e.id===n)?.value)).join(", ")}};wb=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(bb=void 0!==dh&&dh)?bb:Object,"function"==typeof(Ab=void 0!==Wg&&Wg)?Ab:Object,"function"==typeof(Eb=void 0!==ts&&ts)?Eb:Object])],wb);const $b=h([_n.Country,_n.Language,_n.Nationality,_n.Select]);function Tb(e,n,t){if(e.hasCondition&&e.conditionCustomField){const i=t.find(n=>n.id===e.conditionCustomField.id);if(i){if(Tb(i,n,t)){const t=n[e.conditionCustomField.slug];return"boolean"==typeof t&&e.conditionCustomField.fieldType===_n.Checkbox?t===e.conditionValue:!(!$b.includes(e.conditionCustomField.fieldType)||!f(e.conditionValue))&&(0,tg.A)(I(t),e.conditionValue).length>0}return!1}return!1}return!0}var zb;const Ob=["key","name","acl"];let Rb=class extends ju{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const n=w(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return Jl.Ik().shape({key:Jl.Yj().required(n),name:Jl.Yj().required(n),acl:Jl.Yj().required(n)})}documentInputSchemaNotRequired(){return Jl.Ik().shape({key:Jl.Yj(),name:Jl.Yj(),acl:Jl.Yj()})}};Rb=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(zb=void 0!==ts&&ts)?zb:Object])],Rb);var Db,Mb,Pb,kb,Fb;const Nb=da.DateOnly.Numeric,Lb=Xu.concat(xi);let Ub=class extends ju{countriesService;dateTimeService;documentInputService;phoneInputService;translationService;constructor(e,n,t,i,s){super(s),this.countriesService=e,this.dateTimeService=n,this.documentInputService=t,this.phoneInputService=i,this.translationService=s}fieldsUpdateInputDefault(e,n,t,i){return Object.fromEntries(n.map(n=>{const s=this.getFieldValue(e,n);return[n.slug,s??this.fieldUpdateInputDefault(n,t,i)]}))}getValidationRuleError(e,n,t){switch(jb(e)){case"text":return w(n)?this.textValidationRuleError(e.name,e.validationRules,n):null;case"number":return"number"==typeof n?this.numberValidationRuleError(e.name,e.validationRules,n):null;case"date":{const i=w(n)||Jo.c9.isDateTime(n)?la(n):null;return i?.isValid?this.dateValidationRuleError(e.name,e.validationRules,i,t):null}default:return null}}changedFieldsSchema(e,n,t){return Jl.Ik().shape(Object.fromEntries(e.filter(({slug:e})=>!(0,dd.A)(t[e],n[e])).map(e=>[e.slug,this.fieldSchema(e,!1)])))}fieldSchema(e,n){const t=n=>n.test("validation-rules","",(n,t)=>{const i=this.getValidationRuleError(e,n);return!i||t.createError({message:i})}),i=(i,s)=>{const o=()=>t(i()),a=()=>t(s());if(e.conditionCustomField)return Jl.Ik().when(e.conditionCustomField.slug,([t])=>n&&(e.conditionCustomField.fieldType===_n.Checkbox&&t===e.conditionValue||$b.includes(e.conditionCustomField.fieldType)&&f(e.conditionValue)&&(0,tg.A)(I(t),e.conditionValue).length>0)?o():a());{let e;return e=n?o():a(),e}};switch(e.fieldType){case _n.File:return i(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case _n.Phone:return i(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case _n.Text:case _n.Textarea:case _n.Time:case _n.Address:return e.fieldProperty===fn.Eid?i(()=>Jl.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"),e=>!(!w(e)||12!==e.length||!e.startsWith("********"))||cb(e)),()=>Jl.Yj()):e.fieldSubtype!==xn.Freeform?i(()=>Jl.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),n=>{if(w(n)&&12===n.length&&n.startsWith("********"))return!0;switch(e.fieldSubtype){case xn.Eid:return cb(n);case xn.Avs:return function(e){if(w(e)){const n=e.replace(/\D/g,"");if(13===n.length&&n.startsWith("756")){const e=n.substring(0,12).split("").reduce((e,n,t)=>t%2==0?e+Number(n):e+3*Number(n),0)%10;return(0===e?0:10-e)===Number(n[12])}return!1}return!1}(n);case xn.Iban:return function(e){if(w(e)){const n=e.toUpperCase().trim().replace(/\s+/g,"");if(ub.test(n)){const e=n.substring(0,2);if(n.length===mb[e]){const e=`${n.substring(4)}${n.substring(0,4)}`;let t="";for(const n of e)t=/[A-Z]/.test(n)?`${t}${n.charCodeAt(0)-55}`:`${t}${n}`;return BigInt(t)%97n==1n}return!1}return!1}return!1}(n);case xn.Freeform:return!0;default:return Ic(e.fieldSubtype)}}),()=>Jl.Yj()):i(()=>Jl.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>Jl.Yj());case _n.Number:return i(()=>Jl.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>Jl.ai().nullable());case _n.Checkbox:return i(()=>Jl.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>Jl.zM());case _n.Validation:return i(()=>Jl.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)),()=>Jl.zM());case _n.Select:return e.canSelectMultiple?i(()=>Jl.YO().of(Jl.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>Jl.YO().of(Jl.ai())):i(()=>Jl.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)),()=>Jl.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case _n.Date:case _n.Datetime:return e.fieldProperty===fn.DateOfBirth?i(()=>e_.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)).test("valid-date-of-birth",this.t("la_date_de_nais_19129"),e=>!(!Jo.c9.isDateTime(e)||!e.isValid)&&e>=bI&&e<=AI),()=>Jl.gl().nullable().test("valid-date-of-birth",this.t("la_date_de_nais_19129"),e=>!Jo.c9.isDateTime(e)||!e.isValid||e>=bI&&e<=AI)):i(()=>e_.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>Jl.gl().nullable());case _n.Sex:return i(()=>Jl.Yj().oneOf(Mi,this.oneOfMessage(e.name,Mi)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>Jl.Yj().oneOf(Mi,this.oneOfMessage(e.name,Mi)));case _n.Language:return i(()=>Jl.Yj().oneOf(Lb,this.oneOfMessage(e.name,Lb)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>Jl.Yj().oneOf(Lb,this.oneOfMessage(e.name,Lb)));case _n.Nationality:case _n.Country:return i(()=>Jl.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)),()=>Jl.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return Ic(e.fieldType)}}textValidationRuleError(e,n,t){if("regex"===n.mode)return w(n.regex)&&!new RegExp(n.regex).test(t)?n.regexMessage||this.t("_1_n_a_pas_le_68593",e):null;if(n.noLeadingTrailingSpaces&&t!==t.trim())return this.t("_1_ne_doit_pas_16247",e);if(n.noSpaces&&/\s/.test(t))return this.t("_1_ne_doit_pas_30149",e);if("number"==typeof n.minLength&&t.lengthn.maxLength)return this.t("_1_doit_conten_24426",e,n.maxLength);switch(n.allowedCharacters){case"numbers":return/^[0-9.,]*$/.test(t)?null:this.t("_1_ne_doit_con_32219",e);case"noSymbols":return/^[\p{L}\p{N}\s]*$/u.test(t)?null:this.t("_1_ne_doit_con_83191",e);case"uppercase":return t===t.toLocaleUpperCase()?null:this.t("_1_ne_doit_con_44580",e);case"lowercase":return t===t.toLocaleLowerCase()?null:this.t("_1_ne_doit_con_13605",e);default:return null}}numberValidationRuleError(e,n,t){return"number"==typeof n.min&&tn.max?this.t("_1_doit_tre_i_05381",e,n.max):null}dateValidationRuleError(e,n,t,i){const s=t.toISODate();if("past"===n.range)return s>Jo.c9.now().setZone(i??t.zone).toISODate()?this.t("_1_doit_tre_u_03177",e):null;if("between"===n.range){const t=n.start?la(n.start):null,i=n.end?la(n.end):null;return t?.isValid&&si.toISODate()?this.t("_1_doit_tre_c_56697",e,t?this.dateTimeService.toLocaleString(t,Nb):"",i?this.dateTimeService.toLocaleString(i,Nb):""):null}return null}fieldUpdateInputDefault(e,n,t){switch(e.fieldType){case _n.Checkbox:case _n.Validation:return!!t&&void 0;case _n.File:return this.documentInputService.documentInputDefault();case _n.Phone:return this.phoneInputService.phoneInputDefault(n);case _n.Select:return e.canSelectMultiple?[]:void 0;case _n.Address:case _n.Date:case _n.Datetime:case _n.Language:case _n.Number:case _n.Sex:case _n.Text:case _n.Textarea:case _n.Time:return;case _n.Country:return n.user.country;case _n.Nationality:return n.user.nationality;default:return Ic(e.fieldType)}}getFieldValue(e,n){const t=e[n.slug];return n.fieldType===_n.Phone&&t?(0,Qr.A)(t,Dj):n.fieldType===_n.File?(0,Qr.A)(t,Ob):n.fieldType===_n.Date&&t?Jo.c9.fromISO(t,{zone:"UTC"}):t}};Ub=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Db=void 0!==dh&&dh)?Db:Object,"function"==typeof(Mb=void 0!==Wg&&Wg)?Mb:Object,"function"==typeof(Pb=void 0!==Rb&&Rb)?Pb:Object,"function"==typeof(kb=void 0!==Mj&&Mj)?kb:Object,"function"==typeof(Fb=void 0!==ts&&ts)?Fb:Object])],Ub);const Vb=(0,de.forwardRef)(({borderRadius:e,size:n,value:t,onChange:s,...o},a)=>{const r=(0,de.useMemo)(()=>e??4,[e]),d=(0,de.useMemo)(()=>n??24,[n]),l=(0,de.useMemo)(()=>(0,Og.A)(e=>{s(e)},500),[s]);return(0,i.jsx)(Zr,{css:{background:t,borderRadius:`${r}px`,height:`${d}px`,overflow:"hidden",width:`${d}px`,"& input":{background:"transparent",border:"none",borderRadius:"$1",cursor:"pointer",height:`${d}px`,padding:"0",width:`${d}px`,"&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"$1",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:a,type:"color",value:t,onChange:e=>{l(e.target.value)},...o})})});Vb.displayName="ColorPicker";const Bb=({onChange:e,css:n,label:t,description:s,value:o,hint:a,state:r,initialValue:d,icon:l,...c})=>{const u=os(),m=(0,de.useRef)(null),{inputId:g,descId:h,errorId:p}=Vc();return(0,i.jsxs)(Xl,{css:n,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:g,isClickable:!1,children:t}),(0,i.jsx)(lu,{id:h,children:s}),(t||s)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(gu,{cursor:"default",icon:l,state:r,onClick:()=>{m.current?.click()},children:[(0,i.jsxs)(Xl,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(Vb,{ref:m,"aria-describedby":s?h:void 0,"aria-errormessage":"error"===r?p:void 0,"aria-invalid":"error"===r,id:g,value:o,onChange:e,...c}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsx)(Zr,{"aria-hidden":!0,color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:Uc,children:(0,i.jsx)("input",{disabled:"disabled"===r,id:g,type:"text",value:o,onChange:n=>{e(n.target.value)},...c})})]}),d&&o!==d&&(0,i.jsx)(yc,{color:"invisible",css:{color:"$primary500"},onClick:n=>{Uc(n),e(d)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(cu,{id:p,state:r,children:a})]})},Wb=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(Bb,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onChange:e=>{o.input.onChange(e)},...s})}}),Gb=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=o.meta.data?.forceDisplayError&&o.meta.invalid||o.meta.touched&&o.meta.invalid;return(0,i.jsx)(If,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),qb=({onChange:e,prefix:n,state:t,withFileField:s,...o})=>{const a=`${n}key`,r=`${n}name`,d=`${n}acl`,l=s?`${n}file`:void 0;return(0,i.jsx)(Gj,{names:[a,r,d,l],render:n=>{const[s,a,r,d]=n;let l=null;w(s.input.value)&&w(a.input.value)&&w(r.input.value)&&(l={key:s.input.value,name:a.input.value,acl:r.input.value});const{invalid:c,hint:u}=(0,sc.A)(n).reduce((e,n)=>e.invalid?e:Lc(n.meta)?{invalid:!0,hint:n.meta.error||n.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(wS,{hint:u,state:c?"error":t,value:l,onChange:n=>{s.input.onChange(n?.key??""),s.input.onBlur(),a.input.onChange(n?.name??""),a.input.onBlur(),r.input.onChange(n?.acl??""),r.input.onBlur(),d&&(d.input.onChange(n?.file),d.input.onBlur(),n?.file&&e?.(n.file))},...o})}})},Hb=Nr("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary100",color:"$primary500"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),Yb=({css:e,label:n,description:t,value:s,height:o,renderOnPortal:a,onChange:r,...d})=>{const l=os(),[c,u]=(0,de.useState)(!1),m=(0,de.useMemo)(()=>(0,Tg.A)(pi.map(e=>({value:e,name:l(e)})),e=>e.name),[]);return(0,i.jsxs)(Xl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(uu,{children:n}),(0,i.jsx)(lu,{children:t}),(n||t)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(ym,{isOpen:c,onStateChange:u,children:[(0,i.jsx)($m,{children:(0,i.jsx)(gu,{cursor:"pointer",icon:hc(s),rightIcon:c?"chevron-up":"chevron-down",...d,children:(0,i.jsx)(Zr,{css:{flex:"1"},children:l(s)})})}),(0,i.jsx)(wm,{maxHeight:300,placement:"bottom",renderOnPortal:a,width:"match",children:(0,i.jsx)(Xl,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:m.map(e=>(0,i.jsx)(Hb,{active:s===e.value,onClick:()=>{u(!1),r(e.value)},children:(0,i.jsx)(pc,{icon:hc(e.value)})},e.value))})})]})]})},Zb=({name:e,hint:n,state:t,...s})=>(0,i.jsx)(ld.D0,{name:e,render:o=>{const a=Lc(o.meta);return(0,i.jsx)(Yb,{hint:a?o.meta.error:n,name:e,state:a?"error":t,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Kb=e=>{const n=os(),[t,s]=(0,de.useState)(!1);return(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(0,i.jsx)(Zr,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",cursor:e.allowCrop?"pointer":void 0},height:126,width:126,onClick:e.allowCrop?()=>s(!0):void 0,children:(0,i.jsx)("img",{src:e.url,style:{objectFit:"cover",inlineSize:"100%",blockSize:"100%"}})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray400",children:e.hint})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:n("supprimer_43083")})]}),e.allowCrop&&t&&(0,i.jsx)(CS,{image:{name:e.url.split("/").pop().split(".").join("-cropped."),src:`${e.url}?cacheblock=true`},onChange:e.onChange,onClose:()=>s(!1)})]})},Xb=e=>(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(Xl,{height:64,width:64,children:(0,i.jsx)(xc,{color:Lr.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray400",children:e.hint})]})]})]}),Qb=({allowCrop:e,value:n,onChange:t,label:s,hint:o,organizationId:a,...r})=>{const[d,l]=(0,de.useState)(n?ES.File:ES.Uploader),c=async e=>{l(ES.Uploading);try{const n=await oS(a,e,"public-read");t(n),l(ES.File)}catch{l(ES.Uploader)}};return d===ES.File&&n?(0,i.jsx)(Kb,{allowCrop:e,hint:o,label:s,url:rS(n,ee.HEAVENT_AWS_UPLOADS_BUCKET),onChange:c,onDelete:()=>{t(null),l(ES.Uploader)}}):d===ES.Uploading?(0,i.jsx)(Xb,{hint:o,label:s}):(0,i.jsx)(yS,{allowCrop:e,hint:o,label:s,onChange:c,...r})},Jb=({prefix:e,...n})=>{const t=`${e}key`,s=`${e}name`,o=`${e}acl`;return(0,i.jsx)(Gj,{names:[t,s,o],render:([e,t,s])=>{let o=null;return w(e.input.value)&&w(t.input.value)&&w(s.input.value)&&(o={key:e.input.value,name:t.input.value,acl:s.input.value}),(0,i.jsx)(Qb,{value:o,onChange:n=>{e.input.onChange(n?.key??""),t.input.onChange(n?.name??""),s.input.onChange(n?.acl??"")},...n})}})};function eA(e,n){const t=ss(dh),s=zg();return(0,de.useMemo)(()=>e?e.fieldType===_n.Country?t.getCountriesIdName(n).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e)):e.fieldType===_n.Language?e.fieldProperty===fn.Language?s(Xu):s(xi):e.fieldType===_n.Nationality?t.getNationalitiesIdName(n).map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e)):e.fieldType===_n.Sex?s(Mi):e.values.map(({id:n,value:t,color:s})=>(0,i.jsx)("option",{"data-badge":e.listType===zn.Badge,"data-color":e.listType===zn.Default?void 0:s,value:n,children:t},n)):(0,i.jsx)(i.Fragment,{}),[e,n])}const nA=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=ss(Rb),o=ss(Mj),a=eA(e.customField),r=(0,de.useMemo)(()=>Yi.filter(e=>e!==Rt.Error),[]);if((0,de.useEffect)(()=>{if(e.slug===Ae.Acronym||e.slug===Ae.Address||e.slug===Ae.Color||e.slug===Ae.Description||e.slug===Ae.Icon||e.slug===Ae.Name||e.slug===Un.Acronym||e.slug===Un.Address||e.slug===Un.Color||e.slug===Un.Description||e.slug===Un.Icon||e.slug===Un.Name||e.slug===Xe.Description||e.slug===Xe.Name||e.customField?.fieldType===_n.Address||e.customField?.fieldType===_n.Country||e.customField?.fieldType===_n.Language||e.customField?.fieldType===_n.Nationality||e.customField?.fieldType===_n.Sex||e.customField?.fieldType===_n.Text||e.customField?.fieldType===_n.Textarea||e.customField?.fieldType===_n.Time)"string"!=typeof e.value&&e.change(e.name,"");else if(e.slug===Ae.AutoAccredit||e.slug===Ae.WeezeventIsSynchronized||e.slug===Ye.Privacy||e.slug===Xe.IsLocked||e.slug===Xe.ShowInDelegationSpace||e.slug===Xe.CanLeadersAddMembers||e.slug===Xe.CanLeadersEditCustomFields||e.slug===Xe.CanLeadersEditMembers||e.slug===Xe.CanLeadersDeleteMembers||e.slug===Xe.CanLeadersDuplicateMembers||e.slug===Xe.CanLeadersEditColumns||e.slug===Xe.CanLeadersImportMembers||e.slug===Xe.CanLeadersSeeHiddenAccreditationsSlots||e.slug===Xe.ShowAllAccreditations||e.slug===Xe.ShowFormLinkInDelegationSpace||e.slug===Un.WeezeventIsSynchronized||e.customField?.fieldType===_n.Checkbox||e.customField?.fieldType===_n.Validation)"boolean"!=typeof e.value&&e.change(e.name,!1);else if(e.slug===Ae.Category||e.slug===Xe.Category||e.slug===Un.Category)"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id);else if(e.slug===Ae.Index||e.slug===Ae.Latitude||e.slug===Ae.Longitude||e.slug===Un.Latitude||e.slug===Un.Longitude||e.slug===Un.Zoom||e.slug===Xe.MaxResources||e.customField?.fieldType===_n.Number)"number"!=typeof e.value&&e.change(e.name,0);else if(e.slug===Ae.Tag||e.slug===Un.Tag||e.slug===Xe.Campaigns||e.slug===Xe.Documents||e.slug===Xe.Tag||e.slug===Un.Traces)Array.isArray(e.value)||e.change(e.name,[]);else if(e.slug===Xe.DeadlineDate||e.customField?.fieldType===_n.Date||e.customField?.fieldType===_n.Datetime)Jo.c9.isDateTime(e.value)||w(e.value)||e.change(e.name,Jo.c9.invalid("Invalid"));else if(e.customField?.fieldType===_n.File)null!==e.value&&"object"==typeof e.value||e.change(e.name,s.documentInputDefault());else if(e.customField?.fieldType===_n.Phone)null!==e.value&&"object"==typeof e.value||e.change(e.name,o.basePhoneInputDefault());else if(e.customField?.fieldType===_n.Select)e.customField.canSelectMultiple&&!Array.isArray(e.value)?e.change(e.name,[]):e.customField.canSelectMultiple||"number"==typeof e.value||e.change(e.name,"");else if(e.slug===Xe.Form){const n=e.forms[0];"number"!=typeof e.value&&n&&e.change("massEdit.value",n.id)}else e.slug===Xe.DelegationsSpaceLayout?"number"!=typeof e.value&&f(e.delegationsSpaceLayouts)&&e.change("massEdit.value",e.delegationsSpaceLayouts[0].id):e.slug===Un.Layer?ji.includes(e.value)||e.change("massEdit.value",Rn.Google):e.slug===Tt.State?r.includes(e.value)||e.change("massEdit.value",r[0]):e.slug===Tt.Frequency&&(Wi.includes(e.value)||e.change("massEdit.value",wt.Every10Minutes))},[e.customField,e.slug]),e.slug===Ae.Acronym||e.slug===Un.Acronym||e.slug===Ae.Address||e.slug===Un.Address||e.customField?.fieldType===_n.Address||e.customField?.fieldType===_n.Text)return(0,i.jsx)(pu,{name:e.name});if(e.slug===Ae.AutoAccredit||e.slug===Ae.WeezeventIsSynchronized||e.slug===Xe.IsLocked||e.slug===Xe.ShowFormLinkInDelegationSpace||e.slug===Xe.ShowInDelegationSpace||e.slug===Xe.CanLeadersAddMembers||e.slug===Xe.CanLeadersEditCustomFields||e.slug===Xe.CanLeadersEditMembers||e.slug===Xe.CanLeadersDeleteMembers||e.slug===Xe.CanLeadersDuplicateMembers||e.slug===Xe.CanLeadersEditColumns||e.slug===Xe.CanLeadersImportMembers||e.slug===Xe.CanLeadersSeeHiddenAccreditationsSlots||e.slug===Xe.ShowAllAccreditations||e.slug===Un.WeezeventIsSynchronized||e.customField?.fieldType===_n.Checkbox||e.customField?.fieldType===_n.Validation)return(0,i.jsxs)(Qy,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]});if(e.slug===Ye.Privacy)return(0,i.jsxs)(Qy,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("Private")}),(0,i.jsx)("option",{value:"false",children:n("Public")})]});if(e.slug===Ae.Category||e.slug===Xe.Category||e.slug===Un.Category)return(0,i.jsx)(Kx,{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===Ae.Color||e.slug===Un.Color)return(0,i.jsx)(Wb,{name:e.name});if(e.slug===Ae.Description||e.slug===Xe.Description||e.slug===Un.Description)return(0,i.jsx)(Zr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(JS,{name:e.name})});if(e.slug===Ae.Icon||e.slug===Un.Icon)return(0,i.jsx)(Zb,{name:e.name});if(e.slug===Ae.Latitude||e.slug===Un.Latitude)return(0,i.jsx)(qx,{name:e.name});if(e.slug===Ae.Longitude||e.slug===Un.Longitude)return(0,i.jsx)(qx,{name:e.name});if(e.slug===Ae.Name||e.slug===Un.Name||e.slug===Tt.Name)throw new Error("Should not happen");return e.slug===Tt.State?(0,i.jsx)(Qy,{name:e.name,children:r.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}):e.slug===Tt.Frequency?(0,i.jsx)(Qy,{name:e.name,children:Wi.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}):e.slug===Xe.Campaigns?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Xe.Documents?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))}):e.slug===Ae.Tag||e.slug===Un.Tag||e.slug===Xe.Tag?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Un.Traces?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Ae.Index||e.slug===Xe.MaxResources||e.slug===Un.Zoom||e.customField?.fieldType===_n.Number?(0,i.jsx)(pu,{name:e.name,shouldParseAsInt:!0}):e.customField?.fieldType===_n.Country?(0,i.jsx)(Kx,{isSearchVisible:!0,name:e.name,children:a}):e.slug===Xe.DeadlineDate||e.customField?.fieldType===_n.Date?(0,i.jsx)(Wx,{name:e.name}):e.customField?.fieldType===_n.Datetime?(0,i.jsx)(Gb,{name:e.name}):e.customField?.fieldType===_n.File?e.customField.fileType===vn.Picture?(0,i.jsx)(Jb,{allowCrop:!0,organizationId:t,prefix:`${e.name}.`}):(0,i.jsx)(qb,{accept:[Jv.Images,Jv.Pdf],acl:"private",organizationId:t,prefix:`${e.name}.`}):e.customField?.fieldType===_n.Language?(0,i.jsxs)(Qy,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:n("s_lectionnez_un_31086")}),a]}):e.customField?.fieldType===_n.Nationality?(0,i.jsx)(Kx,{isSearchVisible:!0,name:e.name,children:a}):e.customField?.fieldType===_n.Phone?(0,i.jsx)(Kj,{prefix:`${e.name}.`}):e.customField?.fieldType===_n.Select?e.customField.canSelectMultiple?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:e.name,children:a}):(0,i.jsx)(Kx,{isSearchVisible:!0,name:e.name,placeholder:n("s_lectionnez_un_44130"),children:a}):e.customField?.fieldType===_n.Sex?(0,i.jsxs)(Qy,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:n("s_lectionnez_un_43620")}),a]}):e.customField?.fieldType===_n.Textarea?(0,i.jsx)(Qx,{name:e.name}):e.customField?.fieldType===_n.Time?(0,i.jsx)(iy,{name:e.name}):e.slug===Xe.Form?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Xe.DelegationsSpaceLayout?(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.delegationsSpaceLayouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):e.slug===Un.Layer?(0,i.jsxs)(Qy,{name:e.name,children:[(0,i.jsx)("option",{value:Rn.Google,children:"Plan"}),(0,i.jsx)("option",{value:Rn.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:Rn.IgnPlan,children:"IGN Plan"})]}):null},tA=e=>(0,i.jsxs)(Lx,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)($c,{css:{flex:"1",textTransform:"uppercase"},textStyle:"smallcapsheading",children:e.title}),e.buttons]}),e.children]});function iA(e){return(0,Tg.A)(e,e=>b(e.name))}function sA(e){const n=(0,l.A)(e,e=>e.category.id);return iA((0,wh.A)(e.map(e=>e.category),e=>e.id)).map(e=>({category:e,items:(0,Tg.A)(n[e.id],e=>b(e.name))}))}function oA(e,n){switch(e){case _n.Text:case _n.Textarea:return"text";case _n.Checkbox:return"square-check";case _n.Validation:return"check";case _n.Select:return"population"===n?"users":"list-ul";case _n.Date:return"calendar";case _n.Datetime:return"calendar-day";case _n.Time:return"clock";case _n.File:return"file";case _n.Phone:return"phone";case _n.Language:return"language";case _n.Number:return"00";case _n.Sex:return"venus-mars";case _n.Nationality:case _n.Country:return"flag";case _n.Address:return"map-location";default:return Ic()}}function aA(e){return(0,Tg.A)(Object.entries((0,l.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,n])=>[{id:ce(),elementType:yn.Section,isMandatory:null,section:e,text:null,hasCondition:!1,conditionValue:!1,conditionCustomField:null,customField:null}].concat(n.map(e=>({id:ce(),elementType:yn.Field,isMandatory:null,section:null,text:null,hasCondition:!1,conditionValue:!1,conditionCustomField:null,customField:e}))))}function rA(e,n=e=>e.id){return sA(e).map(({category:e,items:t})=>(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{"data-subtext":e.label,value:n(e),children:e.name},e.id))},e.id))}const dA=/^\{user\.(.+)\}$/,lA=e=>{const{translate:n}=fc(),t=e.customFields.find(n=>n.id===e.customFieldValues.customFieldId),s=!0===e.canLinkToField&&t?.fieldType!==_n.Select,o=s&&(e.customFieldValues.fromField??(w(e.customFieldValues.value)&&dA.test(e.customFieldValues.value.trim()))),a=(0,de.useMemo)(()=>t?e.customFields.filter(e=>e.fieldType===t.fieldType&&e.id!==t.id):[],[e.customFields,t]),r=(0,de.useMemo)(()=>rA(e.customFields),[e.customFields]),d=(0,de.useMemo)(()=>rA(a,e=>`{user.${e.slug}}`),[a]),l=t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nA,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:t,delegationsSpaceLayouts:[],forms:[],name:`${e.field}.value`,slug:t.slug,tags:[],traces:[],value:e.customFieldValues.value}),Ib(t)&&(0,i.jsx)(Bx,{name:`${e.field}.addValues`,children:n("ajouter_les_val_22996")})]}),c=n=>{n!==o&&(e.change(`${e.field}.fromField`,n),e.change(`${e.field}.value`,void 0),e.change(`${e.field}.addValues`,!1))};return(0,i.jsx)(tA,{buttons:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(ux,{placement:"top",children:n("supprimer_43083")})]}),title:n("champ_de_formul_73221",e.index+1),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Kx,{isSearchVisible:!0,label:n("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:n("s_lectionner_un_48159")}),r]}),t&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("nouvelle_valeur_39039",t.name)}),s?(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(eg,{state:o?"unchecked":"checked",onClick:()=>c(!1),children:n("saisir_une_nouv_92931")}),!o&&(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},direction:"column",gap:"1",children:l}),(0,i.jsx)(eg,{state:o?"checked":"unchecked",onClick:()=>c(!0),children:n("lier_un_autre_51509")}),o&&(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Kx,{isSearchVisible:!0,name:`${e.field}.value`,placeholder:n("choisir_un_cham_67587"),children:d})})]}):l]})]})})},cA=e=>{const n=os();return(0,i.jsx)(Xl,{direction:"column",gap:"3",children:f(e.values)?(0,i.jsxs)(i.Fragment,{children:[e.values.map((n,t)=>{const s=`${e.name}[${t}]`;return(0,i.jsx)(Xl,{direction:"column",children:(0,i.jsx)(Xl,{gap:"3",children:(0,i.jsx)(lA,{canLinkToField:e.canLinkToField,change:e.change,customFieldValues:n,customFields:e.customFields,field:s,index:t,remove:()=>{e.change(e.name,y(e.values,t))}})})},t)}),(0,i.jsx)(yc,{color:"invisible",css:{"::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:n("ajouter_un_nouv_22370")})]}):(0,i.jsx)(Lx,{align:"center",css:{background:"$gray50",textAlign:"center"},gap:"2",children:(0,i.jsxs)(Xl,{align:"center",css:{textAlign:"center"},direction:"column",gap:"2",children:[(0,i.jsx)(wc,{css:{fontWeight:"$medium"},children:n("aucun_champ_est_98607")}),(0,i.jsx)(yc,{color:"invisible",css:{inlineSize:"fit-content","::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:n("_lier_un_champ_52842")})]})})})},uA=e=>(0,i.jsx)(Xl,{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)(Xl,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(pc,{icon:e.icon})})}),mA=e=>{const n=os(),t=ss(ec),s=Vc();return(0,i.jsx)(Jg,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(Fc,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:t=>{const{handleSubmit:o,submitting:a}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:e.icon})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{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)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",id:s.descId,textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Xl,{css:{overflowY:"auto"},direction:"column",children:"function"==typeof e.children?e.children(t):e.children}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:a,onClick:o,children:e.buttonText}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},validate:n=>e.schema?t.validateForForm(e.schema)(n):{},onSubmit:e.onSubmit})})},gA=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(mA,{buttonText:n("cr_er_82895"),icon:"tag",initialValues:{name:""},title:n("cr_er_un_tag_59505"),onClose:e.onClose,onSubmit:async n=>{const{tagCreate:i}=await t({organizationId:e.organizationId,tag:n.name});e.onSuccess(i),e.onClose()},children:(0,i.jsx)(pu,{label:n("nom_du_tag_95054"),name:"name"})})},hA=e=>{const n=os(),[t,s]=(0,de.useState)(e.tags),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)($S,{children:n("tags_79499")}),multiple:!0,name:`${e.name}tagsIds`,onCreateClick:()=>{a(!0)},children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),o&&(0,i.jsx)(gA,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:n=>{s([...t,n]),e.change(`${e.name}tagsIds`,[...e.tagsIds,n.id])}})]})},pA=({formattedAddressProps:e,getAddress:n,hint:t,latitudeProps:s,longitudeProps:o,onPlaceChange:a,state:r,...d})=>{const l=os(),c=(0,de.useRef)(null),u=(0,de.useRef)({getAddress:n,onPlaceChange:a});u.current={getAddress:n,onPlaceChange:a};const m=Lc(e.meta);return(0,de.useEffect)(()=>{const n=new google.maps.places.Autocomplete(c.current,{types:["geocode"]});n.addListener("place_changed",()=>{const t=n.getPlace();if(t.geometry?.location){const n=t.geometry.location.lat(),i=t.geometry.location.lng();e.input.onChange(u.current.getAddress?.(t)??t.formatted_address),s?.input.onChange(n),o?.input.onChange(i),u.current.onPlaceChange?.(t)}})},[]),(0,i.jsx)(hu,{ref:c,hint:m?e.meta.error||e.meta.submitError:t,placeholder:l("indiquez_un_lie_85634"),state:m?"error":r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...d})},IA=({addressName:e,latitudeName:n,longitudeName:t,...s})=>(0,i.jsx)(Gj,{names:[e,n,t],render:([e,n,t])=>(0,i.jsx)(pA,{formattedAddressProps:e,latitudeProps:n,longitudeProps:t,...s})});function fA(e,n){const t=n=>e.address_components?.find(({types:e})=>e.includes(n)),i=t("country")?.short_name;return{street:e.name,postalCode:t("postal_code")?.long_name,city:t("locality")?.long_name,countryCode:n.countryCodeExists(i)?i:void 0}}const xA=e=>{const{translate:n}=fc(),t=ss(dh),s=ss(Ub),o=eA(e.field,e.countryCode),a=e.isMandatory?e.field.name:(0,i.jsx)($S,{children:e.field.name}),r=`${e.prefix}${e.field.slug}`,d=e.field.description,l=(0,de.useMemo)(()=>r.startsWith("formRegister.userInfo.fields."),[r]),c=function({change:e,field:n,prefix:t}){const i=ss(dh),s=(0,ld.mN)();return(0,de.useMemo)(()=>{const o=function(e){return e.fieldProperty===fn.Street?{isCity:!1,postalCode:"postalCode",city:"city",country:"country",latitude:"latitude",longitude:"longitude"}:e.fieldProperty===fn.BirthCity?{isCity:!0,postalCode:"birthPostalCode",city:null,country:"birthCountry",latitude:null,longitude:null}:e.addressPostalCodeCustomField||e.addressCityCustomField||e.addressCountryCustomField?{isCity:!1,postalCode:e.addressPostalCodeCustomField?.slug??null,city:e.addressCityCustomField?.slug??null,country:e.addressCountryCustomField?.slug??null,latitude:null,longitude:null}:null}(n);if(o){const n=(n,i,o=!1)=>{if(n&&void 0!==i){const a=`${t}${n}`;(o||s.getFieldState(a))&&e(a,i)}};return{getAddress(e){const n=fA(e,i);return(o.isCity?n.city:n.street)??e.formatted_address??""},onPlaceChange(e){const t=fA(e,i);n(o.postalCode,t.postalCode),n(o.city,t.city),n(o.country,t.countryCode),n(o.latitude,e.geometry?.location?.lat(),!0),n(o.longitude,e.geometry?.location?.lng(),!0)}}}return{}},[e,i,n,s,t])}(e);if((0,de.useEffect)(()=>{e.display||e.change(r,s.fieldUpdateInputDefault(e.field,t.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case _n.Text:return(0,i.jsx)(pu,{description:d,disabled:e.disabled,label:a,name:r});case _n.Textarea:return(0,i.jsx)(Qx,{description:d,disabled:e.disabled,label:a,name:r});case _n.Checkbox:return(0,i.jsx)(Bx,{disabled:e.disabled,name:r,subtext:d,children:a});case _n.Validation:return(0,i.jsx)(Bx,{disabled:e.disabled,name:r,subtext:(0,i.jsxs)(i.Fragment,{children:[w(d)&&(0,i.jsx)("span",{children:d}),w(d)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(Ug,{css:{color:"$primary500"},download:e.field.document.name,to:e.field.document.url,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:n("consulter_le_do_69928")})]}),children:a});case _n.Select:return e.field.canSelectMultiple?(0,i.jsx)(Kx,{description:d,disabled:e.disabled,isSearchVisible:!0,isSelectAllVisible:!0,label:a,multiple:!0,name:r,children:o}):(0,i.jsx)(Kx,{description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case _n.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(Wx,{autoComplete:l?"bday":void 0,description:d,disabled:e.disabled,label:a,max:AI,min:bI,name:r}):(0,i.jsx)(Wx,{description:d,disabled:e.disabled,label:a,name:r});case _n.Datetime:return(0,i.jsx)(Gb,{description:d,disabled:e.disabled,label:a,name:r});case _n.Time:return(0,i.jsx)(iy,{description:d,disabled:e.disabled,label:a,name:r});case _n.Phone:return(0,i.jsx)(Kj,{description:d,disabled:e.disabled,label:a,prefix:`${r}.`});case _n.Number:return(0,i.jsx)(pu,{description:d,disabled:e.disabled,label:a,name:r,shouldParseAsInt:!0});case _n.Sex:return(0,i.jsxs)(Qy,{autoComplete:l?"sex":void 0,description:d,disabled:e.disabled,label:a,name:r,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:n("choisir_une_val_00277")}),o]});case _n.Language:return(0,i.jsx)(Kx,{autoComplete:l?"language":void 0,description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case _n.Nationality:return(0,i.jsx)(Kx,{description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case _n.Address:return(0,i.jsx)(IA,{addressName:r,autoComplete:l?"street-address":void 0,description:d,disabled:e.disabled,label:a,...c});case _n.Country:return(0,i.jsx)(Kx,{autoComplete:l?"country":void 0,description:d,disabled:e.disabled,isSearchVisible:!0,label:a,name:r,placeholder:n("choisir_une_val_00277"),children:o});case _n.File:return e.field.fileType===vn.Picture?(0,i.jsx)(Jb,{allowCrop:!0,disabled:e.disabled,hint:d,label:a,organizationId:e.organizationId,prefix:`${r}.`}):(0,i.jsx)(qb,{accept:[Jv.Images,Jv.Pdf,Jv.Videos],acl:e.fileAcl??"private",description:d,disabled:e.disabled,label:a,organizationId:e.organizationId,prefix:`${r}.`});default:return Ic(e.field.fieldType)}},_A=e=>{const n=os(),[t,s]=(0,de.useState)(""),o=(0,de.useMemo)(()=>{if(w(t)){const n=b(t);return e.customFields.filter(e=>b(e.name).includes(n)||w(e.label)&&b(e.label).includes(n))}return e.customFields},[e.customFields,t]),a=(0,de.useMemo)(()=>sA(o),[o]);return(0,i.jsxs)(Xl,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_c_86475"),state:"search",value:t,onChange:s}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zr,{css:{maxHeight:"300px",overflowY:"auto"},children:a.map(({category:t,items:s},o)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Km,{index:o,children:t.name}),s.map(t=>t.conditionCustomField&&!e.selectedCustomFieldsIds.has(t.conditionCustomField.id)?(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsxs)(Xl,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(Ym,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:Ou.A}),(0,i.jsx)(Zr,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:t.name,children:t.name})]},t.id)}),(0,i.jsx)(ux,{placement:"top-start",children:n("ce_champ_d_pend_31209",t.conditionCustomField?.name)})]},t.id):(0,i.jsx)(ng,{isCheckbox:!0,isRadio:!1,isSelected:e.selectedCustomFieldsIds.has(t.id),subtext:t.label,value:t.id,onClick:()=>{e.toggle(t)},children:t.name},t.id))]},t.id))})]})},jA=e=>{const{translate:n}=fc();return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("ajouter_97327")})}),(0,i.jsx)(wm,{placement:"top-start",width:400,children:(0,i.jsx)(_A,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},vA=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("aucun_champ_per_21094")}),(0,i.jsx)(jA,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},SA=e=>{const{params:{organizationId:n}}=fc(),t=(0,de.useMemo)(()=>e.customFields.filter(n=>e.usedCustomFieldsIds.includes(n.id)),[e.customFields,e.usedCustomFieldsIds]),s=(0,de.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),o=(0,de.useCallback)(n=>{s.has(n.id)?e.change(`${e.prefix}usedCustomFieldsIds`,e.usedCustomFieldsIds.filter(e=>e!==n.id)):e.change(`${e.prefix}usedCustomFieldsIds`,[...e.usedCustomFieldsIds,n.id])},[e.prefix,e.usedCustomFieldsIds,s]);return(0,i.jsx)(Xl,{children:f(e.usedCustomFieldsIds)?(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:[t.map(s=>{const a=Tb(s,e.fields,t),r=(0,i.jsx)(xA,{change:e.change,display:a,field:s,fileAcl:"public-read",isMandatory:!1,organizationId:n,prefix:`${e.prefix}fields.`});return a?(0,i.jsxs)(Xl,{align:"end",gap:"3",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:r}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",onClick:()=>o(s)})]},s.id):(0,i.jsx)(de.Fragment,{children:r},s.id)}),(0,i.jsx)(jA,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})]}):(0,i.jsx)(vA,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})})};function yA(e){return(0,Tg.A)(e,e=>b(e.name)).filter(e=>f(e.accreditationsProfiles)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Tg.A)(e.accreditationsProfiles,e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))}const CA=e=>(0,i.jsx)(Xl,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),bA=e=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Xl,{align:"center",css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$medium"},gap:"3",children:e.category}),(0,i.jsx)(Xl,{direction:"column",gap:"3",children:e.children})]}),AA=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>ip(e.accreditation),[e.accreditation]),[s,o]=(0,de.useState)(!0),a=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{cursor:a?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{o(!s),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(pc,{icon:s?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:t}),e.badge]}),e.displayNumberOfSlots&&(0,i.jsx)(Zr,{color:"gray500",children:n("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&s)&&(0,i.jsx)(Xl,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},EA=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(e.maxResources);return(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(Zr,{css:{cursor:"pointer"},children:(0,i.jsx)(pc,{icon:"gear"})})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"badge-check",children:n("ajout_d_un_quot_09767",e.name)}),(0,i.jsx)(Gf,{children:(0,i.jsx)(hu,{hint:n("laissez_vide_po_88385"),label:n("quel_quota_voul_63115"),min:1,rightIcon:"xmark",shouldParseAsInt:!0,value:t||"",onChange:s,onRightIconClick:()=>s(null)})}),(0,i.jsx)(Wf,{children:s=>(0,i.jsx)(yc,{onClick:()=>{e.onChange(t),s()},children:n("ajouter_le_quot_40849")})})]})]})};function wA(e,n,t,i){const s=(0,Zo.A)(n.map(e=>e.accreditationId)).map(t=>e.accreditations.find(e=>e.accreditationId===t)??{accreditationCategoryId:n.find(e=>e.accreditationId===t).accreditationCategoryId,accreditationId:t,maxResources:null,willAutoAccredit:!0});i(`${t}accreditationsCategories`,(0,Zo.A)(n.map(e=>e.accreditationCategoryId)).map(n=>e.accreditationsCategories.find(e=>e.accreditationCategoryId===n)??{accreditationCategoryId:n,maxResources:null})),i(`${t}accreditations`,s),i(`${t}accreditationsSlots`,n)}const $A=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(void 0),o=`${e.prefix}accreditationsSlots`,a=(0,de.useCallback)(n=>{e.change(o,(0,mI.jM)(e.delegationAccreditations.accreditationsSlots,t=>{t.forEach(t=>{e.slotsIds.includes(t.accreditationSlotId)&&(t.maxResources=n)})})),s(n)},[o,e.slotsIds,e.delegationAccreditations,e.change,s]),r=(0,de.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.find(n=>n.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.delegationAccreditations.accreditationsSlots]),d=r?.isDefault??!1,l=r?.isVisible??!0,c=(0,de.useCallback)(()=>{e.change(o,(0,mI.jM)(e.delegationAccreditations.accreditationsSlots,n=>{n.forEach(n=>{e.selectedSlotsIds.includes(n.accreditationSlotId)&&(d?(n.isDefault=!1,n.isVisible=!0):n.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[o,e.selectedSlotsIds,e.delegationAccreditations,e.change,d]),u=(0,de.useCallback)(()=>{e.change(o,(0,mI.jM)(e.delegationAccreditations.accreditationsSlots,n=>{n.forEach(n=>{e.selectedSlotsIds.includes(n.accreditationSlotId)&&(l?(n.isDefault=!0,n.isVisible=!1):n.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[o,e.selectedSlotsIds,e.delegationAccreditations,e.change,l]),m=(0,de.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,Wm.A)(e.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),wA(e.delegationAccreditations,e.delegationAccreditations.accreditationsSlots.filter(n=>!e.selectedSlotsIds.includes(n.accreditationSlotId)),e.prefix,e.change)},[e.selectedSlotsIds,e.selectedAccreditationsSlotsIds,e.delegationAccreditations,e.prefix,e.change]);return f(e.selectedSlotsIds)?(0,i.jsxs)(Xl,{gap:"3",onClick:Uc,children:[(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(Zr,{fontSize:"textXs",children:(0,i.jsx)(pc,{icon:"badge"})}),(0,i.jsx)(Zr,{fontWeight:"medium",children:n(d?"ne_pas_pr_coch_91856":"pr_cocher_par_18369")})]}),(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(Zr,{fontSize:"textXs",children:(0,i.jsx)(pc,{icon:l?"eye-slash":"eye"})}),(0,i.jsx)(Zr,{fontWeight:"medium",children:n(l?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(Zr,{fontWeight:"medium",children:n("total_07173")}),(0,i.jsx)(Zr,{width:100,children:(0,i.jsx)(hu,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:t??"",onChange:a,onRightIconClick:()=>a(void 0)})})]}),(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:m,children:[(0,i.jsx)(Zr,{fontSize:"textXs",children:(0,i.jsx)(pc,{icon:"trash-can"})}),(0,i.jsx)(Zr,{fontWeight:"medium",children:n("supprimer_43083")})]})]}):(0,i.jsxs)(Xl,{align:"center",gap:"6",onClick:Uc,children:[(0,i.jsx)(Jx,{name:`${e.prefix}accreditations[${e.accreditationIndex}].willAutoAccredit`,children:n("attribuer_autom_13895")}),e.hasSlots&&(0,i.jsx)(EA,{maxResources:e.accreditationInput.maxResources,name:e.accreditation.name,onChange:n=>{e.change(`${e.prefix}accreditations[${e.accreditationIndex}].maxResources`,n)}})]})},TA=e=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.findIndex(n=>n.accreditationSlotId===e.slot.id),[e.delegationAccreditations.accreditationsSlots,e.slot]),o=e.delegationAccreditations.accreditationsSlots[s],a=`${e.prefix}accreditationsSlots[${s}].`,r=o?.isDefault?"checked":"unchecked",d=(0,de.useMemo)(()=>e.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.selectedAccreditationsSlotsIds]),l=(0,de.useCallback)(n=>{e.change(`${a}isDefault`,"checked"===n),"checked"===n&&e.delegationAccreditations.accreditationsSlots.forEach((n,t)=>{n.accreditationSlotId!==o.accreditationSlotId&&n.accreditationId===o.accreditationId&&e.change(`${e.prefix}accreditationsSlots[${t}].isDefault`,!1)}),"unchecked"===n&&e.change(`${a}isVisible`,!0)},[a,o,e.delegationAccreditations,e.change]),c=(0,de.useCallback)(n=>{e.change(`${a}isDefault`,"checked"===n),"unchecked"===n&&e.change(`${a}isVisible`,!0)},[a,e.change]),u=(0,de.useCallback)(n=>{e.change("selectedAccreditationsSlotsIds",j(e.selectedAccreditationsSlotsIds,e.slot.id,"checked"===n))},[e.slot,e.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(Eg,{children:[e.displaySelectedCheckbox&&(0,i.jsx)(_g,{width:48,children:(0,i.jsx)(Ym,{state:d,onClick:u})}),(0,i.jsx)(_g,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,da.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(_g,{children:w(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(_g,{children:e.accreditationDisplay===be.Radio?(0,i.jsx)(eg,{state:r,onClick:l,children:n("pr_cocher_par_18369")}):(0,i.jsx)(Zm,{state:r,onClick:c,children:n("pr_cocher_par_18369")})}),(0,i.jsx)(_g,{width:100,children:(0,i.jsx)(yc,{color:"white",disabled:!o.isDefault,leftIcon:o.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${a}isVisible`,!o.isVisible)}})}),(0,i.jsx)(_g,{width:130,children:(0,i.jsx)(pu,{min:0,name:`${a}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})},zA=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.delegationAccreditations.accreditations.findIndex(n=>n.accreditationId===e.accreditation.id),[e.delegationAccreditations.accreditations,e.accreditation]),s=(0,de.useMemo)(()=>e.delegationAccreditations.accreditations[t],[t,e.delegationAccreditations.accreditations]),o=(0,de.useMemo)(()=>Hp(e.slots.filter(n=>n.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),a=(0,de.useMemo)(()=>o.map(e=>e.id),[o]),r=(0,de.useMemo)(()=>{if(e.accreditation.hasSlots){const n=(0,Zo.A)(o.map(n=>e.selectedAccreditationsSlotsIds.includes(n.id)));return 2===n.length?"indeterminate":n[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.selectedAccreditationsSlotsIds,o]),d=(0,de.useMemo)(()=>a.filter(n=>e.selectedAccreditationsSlotsIds.includes(n)),[e.selectedAccreditationsSlotsIds,a]),l=(0,de.useCallback)(n=>{"checked"===n?e.change("selectedAccreditationsSlotsIds",(0,Zo.A)(e.selectedAccreditationsSlotsIds.concat(a))):e.change("selectedAccreditationsSlotsIds",(0,Wm.A)(e.selectedAccreditationsSlotsIds,a))},[e.selectedAccreditationsSlotsIds,e.change,a]);return(0,i.jsx)(AA,{accreditation:e.accreditation,badge:"number"==typeof s.maxResources&&(0,i.jsx)(Lm,{color:"primary",leftIcon:"badge-check",children:n("quota_sur_l_acc_12936",s.maxResources)}),displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:o.length,renderActions:()=>(0,i.jsx)($A,{accreditation:e.accreditation,accreditationIndex:t,accreditationInput:s,change:e.change,delegationAccreditations:e.delegationAccreditations,hasSlots:e.accreditation.hasSlots,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,selectedSlotsIds:d,slotsIds:a}),children:(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[e.accreditation.hasSlots&&(0,i.jsx)(Mg,{width:48,children:(0,i.jsx)(Ym,{state:r,onClick:l})}),(0,i.jsx)(Mg,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Mg,{children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(Mg,{children:n("s_lection_par_d_61556")}),(0,i.jsx)(Mg,{width:100,children:n("Privacy")}),(0,i.jsx)(Mg,{width:130,children:n("total_07173")})]}),o.map((n,t)=>(0,i.jsx)(TA,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,delegationAccreditations:e.delegationAccreditations,displaySelectedCheckbox:e.accreditation.hasSlots,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slot:n},`${n.id}-${t}`))]})})},OA=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.delegationAccreditations.accreditationsCategories.findIndex(n=>n.accreditationCategoryId===e.category.id),[e.delegationAccreditations.accreditationsCategories,e.category]),s=(0,de.useMemo)(()=>e.delegationAccreditations.accreditationsCategories[t],[t,e.delegationAccreditations.accreditationsCategories]),o=(0,de.useMemo)(()=>rp(e.accreditations.filter(n=>n.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(bA,{category:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{children:e.category.name}),"number"==typeof s.maxResources&&(0,i.jsx)(Lm,{color:"primary",leftIcon:"badge-check",children:n("quota_sur_la_ca_14699",s.maxResources)}),(0,i.jsx)(EA,{maxResources:s.maxResources,name:e.category.name,onChange:n=>{e.change(`${e.prefix}accreditationsCategories[${t}].maxResources`,n)}})]}),children:o.map((n,t)=>(0,i.jsx)(zA,{accreditation:n,change:e.change,delegationAccreditations:e.delegationAccreditations,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slots:e.slots},`${n.id}-${t}`))})},RA=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.delegationAccreditations.accreditationsCategories.map(e=>e.accreditationCategoryId),[e.delegationAccreditations.accreditationsCategories]),s=(0,de.useMemo)(()=>e.delegationAccreditations.accreditations.map(e=>e.accreditationId),[e.delegationAccreditations.accreditations]),o=(0,de.useMemo)(()=>e.delegationAccreditations.accreditationsSlots.map(e=>e.accreditationSlotId),[e.delegationAccreditations.accreditationsSlots]),a=(0,de.useMemo)(()=>(0,Tg.A)(e.accreditationCategories.filter(e=>t.includes(e.id)),e=>b(e.name)),[e.accreditationCategories,t]),r=(0,de.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>s.includes(e.id)),[e.accreditationCategories,s]),d=(0,de.useMemo)(()=>r.flatMap(e=>e.slots).filter(e=>o.includes(e.id)),[r,o]);return f(a)?(0,i.jsx)(CA,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:a.map(n=>(0,i.jsx)(OA,{accreditations:r,category:n,change:e.change,delegationAccreditations:e.delegationAccreditations,prefix:e.prefix,selectedAccreditationsSlotsIds:e.selectedAccreditationsSlotsIds,slots:d},n.id))}):(0,i.jsx)(Xl,{css:{background:"$gray50",bd:!0,padding:"$6"},justify:"center",children:n("aucune_accr_dit_27643")})},DA=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.accreditationsProfiles.findIndex(n=>n.accreditationProfileId===e.accreditationProfile.id),[e.accreditationProfile,e.accreditationsProfiles]),s=(0,de.useMemo)(()=>e.accreditationsProfiles[t],[t,e.accreditationsProfiles]);return(0,i.jsx)(AA,{accreditation:e.accreditationProfile,badge:!e.hideActions&&"number"==typeof s.maxResources&&(0,i.jsx)(Lm,{color:"primary",leftIcon:"badge-check",children:n("quota_sur_le_pr_57811",s.maxResources)}),displayNumberOfSlots:!1,displaySlots:!1,numberOfSlots:0,renderActions:e.hideActions?void 0:()=>(0,i.jsxs)(Xl,{align:"center",gap:"6",children:[(0,i.jsx)(Jx,{name:`${e.prefix}accreditationsProfiles[${t}].willAutoAccredit`,children:n("attribuer_autom_13895")}),(0,i.jsx)(EA,{maxResources:s.maxResources,name:e.accreditationProfile.name,onChange:n=>{e.change(`${e.prefix}accreditationsProfiles[${t}].maxResources`,n)}})]})})},MA=e=>{const n=(0,de.useMemo)(()=>e.category.accreditationsProfiles.filter(n=>e.accreditationsProfiles.some(e=>e.accreditationProfileId===n.id)),[e.category.accreditationsProfiles,e.accreditationsProfiles]);return(0,i.jsx)(bA,{category:e.category.name,children:n.map(n=>(0,i.jsx)(DA,{accreditationProfile:n,accreditationsProfiles:e.accreditationsProfiles,change:e.change,hideActions:e.hideActions,prefix:e.prefix},n.id))})},PA=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.accreditationsProfilesCategories.filter(n=>n.accreditationsProfiles.some(n=>e.accreditationsProfiles.some(e=>e.accreditationProfileId===n.id))),e=>b(e.name)),[e.accreditationsProfilesCategories,e.accreditationsProfiles]);return f(e.accreditationsProfiles)?(0,i.jsx)(CA,{css:{border:"1px solid $gray200",borderRadius:"$1"},children:t.map(n=>(0,i.jsx)(MA,{accreditationsProfiles:e.accreditationsProfiles,category:n,change:e.change,hideActions:e.hideActions,prefix:e.prefix},n.id))}):(0,i.jsx)(Xl,{css:{background:"$gray50",bd:!0,padding:"$6"},justify:"center",children:n("aucun_profil_d_18230")})},kA=({accreditationsProfilesCategories:e,allAccreditationCategories:n,change:t,values:s})=>{const{translate:o}=fc(),a=ss(Wg),r=(0,de.useMemo)(()=>yA(e),[e]),d=(0,de.useMemo)(()=>s.delegation.accreditationsProfiles.map(e=>e.accreditationProfileId),[s.delegation.accreditationsProfiles]),l=(0,de.useCallback)(e=>{const n=e.filter(e=>!s.delegation.accreditationsProfiles.some(n=>n.accreditationProfileId===e)),i=s.delegation.accreditationsProfiles.filter(n=>e.includes(n.accreditationProfileId)).concat(n.map(e=>({accreditationProfileId:e,willAutoAccredit:!0})));t("delegation.accreditationsProfiles",i)},[t,s.delegation.accreditationsProfiles]),c=(0,de.useMemo)(()=>Yp(a,n),[a,n]),u=(0,de.useMemo)(()=>new Map(n.flatMap(e=>e.accreditations.flatMap(n=>n.slots.map(t=>[t.id,{accreditationCategoryId:e.id,accreditationId:n.id}])))),[n]),m=(0,de.useMemo)(()=>s.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[s.delegation.accreditationsSlots]),g=(0,de.useCallback)(e=>{const{accreditationsSlots:n}=s.delegation,i=e.filter(e=>!n.some(n=>n.accreditationSlotId===e)),o=n.filter(n=>e.includes(n.accreditationSlotId)).concat(i.flatMap(e=>{const n=u.get(e);return n?[{...n,accreditationSlotId:e,isDefault:!1,isVisible:!0}]:[]}));wA(s.delegation,o,"delegation.",t)},[t,u,s.delegation]),h=(0,de.useMemo)(()=>s.delegation.accreditationsSlots.some(({isDefault:e})=>e),[s]);return(0,i.jsxs)(Xl,{direction:"column",children:[f(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:o("liste_des_profi_98974")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(PA,{accreditationsProfiles:s.delegation.accreditationsProfiles,accreditationsProfilesCategories:e,change:t,prefix:"delegation."}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:o("ajouter_des_pro_61834")}),values:d,onChange:l,children:r}),(0,i.jsx)(ic,{height:"7"})]}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:o("liste_des_accr_46997")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(RA,{accreditationCategories:n,change:t,delegationAccreditations:s.delegation,prefix:"delegation.",selectedAccreditationsSlotsIds:s.selectedAccreditationsSlotsIds}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:o("AddAccreditations")}),values:m,onChange:g,children:c}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:o("attribution_des_59896")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Jx,{name:"delegation.addDefaultAccreditationsByAvailability",children:o("s_lectionner_pa_51634")})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:o("affichage_des_a_55224")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Jx,{name:"delegation.showAllAccreditations",subtext:o("afficher_galem_82855"),children:o("ShowAllAccreditations")})]})},FA=({disabled:e,...n})=>{const{descId:t}=Vc();return(0,i.jsx)(Ux.Provider,{value:{isDisabled:e},children:(0,i.jsxs)(Xl,{"aria-describedby":t,as:"fieldset",className:"fieldset--row",css:{border:"unset",padding:"unset",margin:"unset","&:disabled :is(input, select, button)":{cursor:"not-allowed !important"},"& + &":{borderBlockStart:"1px solid $gray200",marginBlockStart:"$5",paddingBlockStart:"$5"},"& fieldset.fieldset--column":{gap:"$2","& header":{paddingBlockEnd:"unset",borderBlockEnd:"unset !important","& > div > :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$textSm !important",fontWeight:"$medium !important"}}}},direction:"row",gap:"7",...n,children:[(0,i.jsx)(Hx,{heading:n.heading}),(0,i.jsxs)(Xl,{as:Yl.Header,direction:"row",gap:"1",width:280,children:[(0,i.jsx)($c,{"aria-hidden":"true",color:"gray800",css:{fontSize:"$textSm"},textStyle:"subheading",children:n.heading}),(0,i.jsx)(wc,{id:t,textStyle:"subtitle",children:n.subtitle})]}),(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:n.children})]})})},NA=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=ss(Dp),[o,a]=(0,de.useState)(!1),r=(0,de.useMemo)(()=>s.getDelegationMembersPossibleColumns(t,e.customFields,{forDelegationsSpace:!0,isWeezeventConnected:!0,positionDisplay:st.Position,slotDisplay:at.Custom}),[t,s,e.customFields]),d=(0,de.useMemo)(()=>(0,sc.A)(e.columns.map(e=>r.find(n=>n.slug===e))),[r,e.columns]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Xl,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:n("liste_des_colon_20101")}),(0,i.jsxs)(Xl,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(Xl,{direction:"column",gap:"2",children:d.map(n=>(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(Zr,{color:"gray700",css:{flex:"1"},children:n.name}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change(`${e.prefix}columns`,(0,Bm.A)(e.columns,n.slug))}})]},n.slug))}),(0,i.jsx)(yc,{color:"invisible",leftIcon:"gear",onClick:()=>{a(!0)},children:n("_diter_les_colo_39630")})]})]}),o&&(0,i.jsx)(CI,{columns:r,initialSelectedColumns:e.columns,saveButtonText:n("_diter_62574"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_96096"),title:n("_dition_des_col_70300"),onClose:()=>a(!1),onSave:n=>{e.change(`${e.prefix}columns`,n)}})]})},LA=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!!e.values.delegation.delegationsSpaceLayoutId),o=(0,de.useCallback)(n=>{s(n),n?(e.change("delegation.campaignsIds",[]),e.change("delegation.customDocumentsSlugs",[])):e.change("delegation.delegationsSpaceLayoutId",null)},[s]);return(0,i.jsxs)(Xl,{direction:"column",children:["event"===e.delegationType&&(0,i.jsx)(FA,{heading:n("DelegationsSpaceLayout"),children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(oI,{value:t,onChange:o,children:n("utiliser_un_lay_31575")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Kx,{label:n("choisissez_le_l_54992"),name:"delegation.delegationsSpaceLayoutId",children:e.layouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(FA,{heading:n("liste_des_colon_20101"),children:(0,i.jsx)(NA,{change:e.change,columns:e.values.delegation.columns,customFields:e.customFields,prefix:"delegation."})}),(0,i.jsx)(FA,{heading:n("communication_05277"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("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)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("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))})]})})]})]})},UA=e=>{const n=os(),t=(0,de.useMemo)(()=>Jl.Ik().shape({name:Jl.Yj().required(n("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(mA,{buttonText:e.isEdit?n("renommer_42135"):n("cr_er_82895"),icon:"pen",initialValues:{name:e.initialName},schema:t,title:e.isEdit?n("renommer_1_40542",e.initialName):n("cr_er_une_nouve_72722"),onClose:e.onClose,onSubmit:async n=>{const t=await e.mutate(n.name);e.onClose(),e.onSuccess(t)},children:(0,i.jsx)(pu,{label:n("nom_de_la_cat_g_03860"),name:"name"})})},VA=e=>{const{mutate:n}=nl();return(0,i.jsx)(UA,{initialName:"",isEdit:!1,mutate:async t=>(await n({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:t}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},BA=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),[o,a]=(0,de.useState)(!1),[r,d,l]=Dg(""),{delegationsOptions:c,isLoading:u}=oC({organizationId:t,level:kn.Organization,hasSelected:!!e.parentId,delegationsIds:e.parentId?[e.parentId]:[],nameDebounced:d}),[m,g]=(0,de.useState)(iA(e.categories)),[h,p]=(0,de.useState)(!!e.initialParentId),I=(0,de.useCallback)(n=>{n||e.change("delegation.parentId",null),p(n)},[e.change,p]);return(0,i.jsxs)(i.Fragment,{children:["event"===e.delegationType&&e.hasOrganizationDelegations&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{value:h,onChange:I,children:n("lier_cette_d_l_78975")}),(0,i.jsx)(ic,{height:"6"})]}),h?(0,i.jsx)(Kx,{isSearchLoading:u,isSearchVisible:!0,label:n("_quelle_d_l_ga_70215"),name:"delegation.parentId",searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_31213"),state:"search",value:r,onChange:l}),children:c}):(0,i.jsx)(pu,{label:n("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>a(!0),children:m.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),o&&(0,i.jsx)(VA,{eventId:s,organizationId:t,onClose:()=>a(!1),onSuccess:n=>{g(iA([...m,n])),e.change("delegation.delegationCategoryId",n.id)}})]})},WA=e=>(0,i.jsx)(BA,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,hasOrganizationDelegations:e.hasOrganizationDelegations,parentId:e.parentId}),GA=e=>(0,i.jsx)(BA,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,hasOrganizationDelegations:!1,parentId:null}),qA=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{mutate:o}=Tl(),a=(0,de.useMemo)(()=>({email:"",formRegister:{forOther:!0,userInfo:{fields:{firstName:"",lastName:""}},sendNotificationEmail:!1}}),[]),r=(0,de.useMemo)(()=>Jl.Ik().shape({email:Jl.Yj().required(n("l_e_mail_est_re_04856")).email(n("l_e_mail_est_re_04856"))}),[]);return(0,i.jsx)(Fc,{height:1,initialValues:a,render:({handleSubmit:t,submitting:o})=>(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"user-plus",children:"Nouveau membre"}),(0,i.jsx)(Gf,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(pu,{isEmail:!0,label:n("Email"),name:"email"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("last_name")}),name:"formRegister.userInfo.fields.lastName"})]}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:(0,i.jsx)($S,{children:n("population_38615")}),multiple:e.canSelectMultiple,name:"formRegister.userInfo.fields.population",children:e.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),s&&(0,i.jsx)(Bx,{name:"formRegister.sendNotificationEmail",children:n("envoyer_l_email_75574")})]})}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:o,onClick:t,children:n("ajouter_le_memb_57505")})})]}),schema:r,width:1,onSubmit:async n=>{const{userInfoAdminCreate:{id:i}}=await o({organizationId:t,eventId:s,email:n.email,userInfo:n.formRegister.userInfo,sendNotificationEmail:n.formRegister.sendNotificationEmail});e.onUserCreate(i),e.onClose()}})},HA=e=>{const{params:{organizationId:n}}=fc(),{data:t}=rs('query CreateUserInfosLight($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n canSelectMultiple\n\n values {\n id\n value\n }\n }\n }\n}\n',{organizationId:n},[],undefined);return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsx)(qA,{canSelectMultiple:t.organization?.population.canSelectMultiple??!1,values:t.organization?.population.values??[],onClose:e.onClose,onUserCreate:e.onUserCreate})})},YA=e=>{const{translate:n,params:{organizationId:t}}=fc(),{canMemberCreate:s}=tC(),[o,a,r]=Dg(""),{usersInfosOptions:d,isLoading:l}=mC({organizationId:t,eventId:null,hasSelected:f(e.leadersIds),nameDebounced:a,reloadKey:e.reloadKey,userInfoIds:e.leadersIds}),[c,u]=(0,de.useState)(!1),m=(0,de.useCallback)(n=>{e.change("delegation.leadersIds",e.leadersIds.concat([n])),e.setRelodaKey(e=>e+1)},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(FA,{heading:n("reponsable_82458_plural"),children:(0,i.jsx)(Kx,{createText:n("cr_er_un_membre_38547"),isCreateVisible:s,isSearchLoading:l,isSearchVisible:!0,label:n("s_lectionnez_le_30900"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),state:"search",value:o,onChange:r}),onCreateClick:()=>u(!0),children:d})}),(0,i.jsx)(FA,{heading:n("droits_des_resp_01552"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Jx,{name:"delegation.showFormLinkInDelegationSpace",children:n("afficher_le_lie_05841")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersAddMembers",children:n("CanLeadersAddMembers")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersImportMembers",children:n("CanLeadersImportMembers")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersEditMembers",children:n("CanLeadersEditMembers")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersDeleteMembers",children:n("CanLeadersDeleteMembers")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersDuplicateMembers",children:n("CanLeadersDuplicateMembers")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersEditColumns",children:n("CanLeadersEditColumns")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersEditCustomFields",children:n("CanLeadersEditCustomFields")}),(0,i.jsx)(Jx,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:n("CanLeadersSeeHiddenAccreditationsSlots")})]})})]}),c&&(0,i.jsx)(HA,{isOpen:c,onClose:()=>u(!1),onUserCreate:m})]})},ZA=e=>{const n=os(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.forms,e=>e.name),[e.forms]),[s,o]=(0,de.useState)(!!e.initialValues.delegation.deadlineDate),[a,r]=(0,de.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(FA,{heading:n("Form"),children:(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("avec_quel_formu_60160"),name:"delegation.formId",placeholder:n("s_lectionnez_un_77066"),children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(FA,{heading:n("inscription_dan_16147"),children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:n("les_inscription_64653")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:s?"checked":"unchecked",onClick:()=>{o(!0)},children:n("oui_il_y_a_une_68479")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Wx,{name:"delegation.deadlineDate"}),(0,i.jsx)(ic,{height:"3"})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:s?"unchecked":"checked",onClick:()=>{o(!1),e.change("delegation.deadlineDate",null)},children:n("non_les_inscri_87979")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:n("les_inscription_76218")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:a?"checked":"unchecked",onClick:()=>{r(!0)},children:n("oui_il_y_a_une_02976")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(pu,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(ic,{height:"3"})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:a?"unchecked":"checked",onClick:()=>{r(!1),e.change("delegation.maxResources",null)},children:n("non_les_inscri_07566")})]})})]})},KA=e=>{const{translate:n}=fc();return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"triangle-exclamation",children:n("accr_ditations_34551")}),(0,i.jsx)(Gf,{children:(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:n("voulez_vous_met_24993")}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n("mettre_jour_l_69948")})})]})})},XA=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ny(["delegation"],{delegationsCustomFields:!1}),[a,r]=(0,de.useState)(0),d=(0,de.useMemo)(()=>w(e.initialValues.delegation.description)||w(e.initialValues.delegation.privateNote),[e.initialValues]),l=(0,de.useMemo)(()=>e.isEdit&&(f(e.initialValues.delegation.accreditationsSlots)||f(e.initialValues.delegation.accreditationsProfiles)||e.initialValues.delegation.showAllAccreditations),[e.initialValues,e.isEdit]),c=(0,de.useMemo)(()=>e.isEdit&&f(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),u=(0,de.useMemo)(()=>e.isEdit&&f(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),m=(0,de.useMemo)(()=>f(e.initialValues.delegation.tagsIds),[e.initialValues]),g=function(e,n,t){const i=ss(Wg),s=(0,de.useMemo)(()=>{const e=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,Wm.A)(e,i)},[n,t]);return(0,de.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(n=>s.includes(n.id)?[qp(i,n,e.name,{accreditation:{includeName:!0}})]:[]))),[s,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[h,p]=(0,de.useState)(!1),I=(0,de.useCallback)(()=>{f(g)?p(!0):e.handleSubmit()},[g,p,e.handleSubmit]),x=(0,de.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegation.name):n("cr_ation_d_une_07120"),[e.initialValues,e.isEdit]);fm(x);const _=(0,de.useRef)(null),j=(0,de.useCallback)(async n=>{if(_.current=n,!n)return;const{organization:i}=await qd({organizationId:t,delegationId:n},{token:await fe()}),s=i.delegations.nodes[0];s&&_.current===n&&(e.form.change("delegation.leadersIds",s.leadersIds),r(e=>e+1))},[t,e.form]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"delegation.parentId",onChange:j}),(0,i.jsx)(Nx,{button:e.isEdit?(0,i.jsx)(yc,{isLoading:e.submitting,onClick:I,children:n("mettre_jour_l_69948")}):null,category:x,color:"dark",fallbackClosePath:vo.DELEGATIONS({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.delegation.name:n("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)(kx,{ref:e.centeredContainerRef,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:n("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(WA,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,hasOrganizationDelegations:e.hasOrganizationDelegations,parentId:e.values.delegation.parentId}):(0,i.jsx)(GA,{categories:e.categories,change:e.form.change})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("param_tres_de_l_81810"),children:(0,i.jsx)(ZA,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("reponsable_82458_plural"),children:(0,i.jsx)(YA,{change:e.form.change,leadersIds:e.values.delegation.leadersIds,reloadKey:a,setRelodaKey:r})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("espace_d_l_gati_59251"),initialIsOpen:e.values.delegation.showInDelegationSpace,isToggleable:!0,subtitle:n("param_trer_les_35157"),onToggle:n=>{n||(e.form.change("delegation.delegationsSpaceLayoutId",null),e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",n)},children:(0,i.jsx)(LA,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,delegationType:e.delegationType,layouts:e.layouts,values:e.values})}),(0,i.jsx)(ic,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zx,{heading:n("accr_ditations_39450"),initialIsOpen:l,isToggleable:!0,subtitle:n("delegation_accreditations_desc"),onToggle:n=>{n||(e.form.change("delegation.accreditationsCategories",[]),e.form.change("delegation.accreditations",[]),e.form.change("delegation.accreditationsSlots",[]),e.form.change("delegation.accreditationsProfiles",[]),e.form.change("delegation.showAllAccreditations",!1))},children:(0,i.jsx)(kA,{accreditationsProfilesCategories:e.accreditationsProfilesCategories,allAccreditationCategories:e.accreditationsCategories,change:e.form.change,values:e.values})}),(0,i.jsx)(ic,{height:"5"})]}),(0,i.jsx)(Zx,{heading:n("champs_de_formu_64126"),initialIsOpen:c,isToggleable:!0,subtitle:n("ajouter_des_inf_57824"),onToggle:n=>{n||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,Rr.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(SA,{change:e.form.change,customFields:e.delegationCustomFields,fields:e.values.delegation.fields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("d_finir_la_vale_27863"),initialIsOpen:u,isToggleable:!0,subtitle:n("choisissez_une_24029"),onToggle:n=>{n||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(cA,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("description_et_59312"),initialIsOpen:d,isToggleable:!0,subtitle:n("ajoutez_une_des_54307"),onToggle:n=>{n||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:n("description_58935")}),name:"delegation.description",variables:o}),(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:n("note_priv_e_06303")}),name:"delegation.privateNote"})]})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("tags_79499"),initialIsOpen:m,isToggleable:!0,subtitle:n("ajouter_des_tag_35833"),onToggle:n=>{n||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(hA,{change:e.form.change,name:"delegation.",organizationId:t,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:e.submitting,textAlign:"center",onClick:I,children:e.isEdit?n("mettre_jour_l_69948"):n("cr_er_la_d_l_ga_53268")})})]})}),(0,i.jsx)(KA,{deletedAccreditationsSlots:g,handleSubmit:e.handleSubmit,isOpen:h,submitting:e.submitting,onClose:()=>{p(!1)}})]})},QA=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{showNotification:a}=Sy(),r=ss(ec),d=ss(Ub),l=ss(ab),c=(0,de.useRef)(null),u=(0,de.useCallback)(n=>r.validateForForm(l.createUpdateDelegationSchema(d.changedFieldsSchema(e.delegationCustomFields,e.initialValues.delegation.fields,n.delegation.fields)))(n),[e.delegationCustomFields,e.initialValues]);return(0,i.jsx)(Fc,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(XA,{...e,centeredContainerRef:c,form:n,handleSubmit:t,submitting:s,values:o}),validate:u,width:1,onSubmit:async i=>{await e.mutate({organizationId:s,eventId:o,delegation:i.delegation}),a(e.isEdit?t("la_d_l_gation_a_86694"):t("la_d_l_gation_a_01157")),n.goBack(vo.DELEGATIONS({organizationId:s,eventId:o}))}})},JA=e=>{try{if(w(e)&&!isNaN((0,rb.A)(e,10)))return{delegationCategoryId:(0,rb.A)(e,10)};if(w(e)){const n=JSON.parse(a(e));return{applyParentSettings:!0===n.applyParentSettings,parentId:n.parentId}}return{}}catch{return{}}},eE=()=>{const{params:{organizationId:e,eventId:n,options:t}}=fc(),s=ss(ab),{data:o,isLoading:a}=rs("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(\n eventId: $eventId\n variety: Delegation\n privacy: Public\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n\n # whether an event delegation can be linked to an organization one: a count, no rows\n delegations(level: Organization) {\n totalCount\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n }\n}\n",{organizationId:e,eventId:n},[Ko.CreatePositionTagsFragment,Ko.OrganizationCustomFieldsFragment,Ko.AttachCustomFieldFragment,Ko.CreateDelegationEventFragment],void 0),{mutate:r}=Gd(),{mutate:d}=nl(),[l,c]=(0,de.useState)(!0),[u,m]=(0,de.useState)({});return(0,de.useEffect)(()=>{(async()=>{if(o.organization){const{applyParentSettings:i,delegationCategoryId:a,parentId:r}=JA(t),l=r&&i?(await qd({organizationId:e,delegationId:r},{token:await fe()})).organization.delegations.nodes[0]??null:null,u=o.organization.delegationsCategories.nodes;if(r&&l&&!u.find(e=>e.name==l.delegationCategory.name)){const{delegationCategoryCreate:t}=await d({organizationId:e,eventId:n,delegationCategory:{name:l.delegationCategory.name}});u.push(t)}m(s.createUpdateDelegationValuesDefault(null,{delegationCategoryId:a,delegationsCategories:u,forms:o.event.forms.nodes,parentId:r,parentDelegation:l})),c(!1)}})()},[t,o]),a||l?(0,i.jsx)(_c,{}):(0,i.jsx)(QA,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfilesCategories:o.event.accreditationsProfilesCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:vo.DELEGATIONS({organizationId:e,eventId:n}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",forms:o.event.forms.nodes,initialValues:u,isEdit:!1,layouts:o.event.delegationsSpaceLayouts,mutate:r,hasOrganizationDelegations:o.organization.delegations.totalCount>0,tags:o.organization.tags.nodes})},nE=()=>{const{params:{organizationId:e,options:n}}=fc(),t=ss(ab),{data:s,loader:o}=rs("query DelegationOrganizationInfos($organizationId: OrganizationId!, $eventId: EventId) {\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},[Ko.CreatePositionTagsFragment,Ko.OrganizationCustomFieldsFragment,Ko.AttachCustomFieldFragment,Ko.CreateDelegationFormFragment],void 0),{mutate:a}=Gd(),r=(0,de.useMemo)(()=>{const{delegationCategoryId:e}=JA(n);return t.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return o||(0,i.jsx)(QA,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:Wo.COMMUNITY_DELEGATIONS(e),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:r,isEdit:!1,layouts:[],mutate:a,hasOrganizationDelegations:!1,tags:s.organization.tags.nodes})},tE=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=fc(),s=ss(ab),{data:o,loader:a}=rs("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(\n eventId: $eventId\n variety: Delegation\n privacy: Public\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n\n # whether the delegation can be linked to an organization one: a count, no rows\n delegations(level: Organization) {\n totalCount\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 delegationsSpaceLayoutId\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showAllAccreditations\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\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 accreditationsCategories {\n accreditationCategoryId\n maxResources\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 accreditationsProfiles {\n accreditationProfileId\n maxResources\n willAutoAccredit\n }\n }\n }\n}\n",{organizationId:e,eventId:n,delegationId:t},[Ko.CreatePositionTagsFragment,Ko.OrganizationCustomFieldsFragment,Ko.AttachCustomFieldFragment,Ko.CreateDelegationEventFragment],undefined);const{mutate:r}=Hd(),d=(0,de.useMemo)(()=>s.createUpdateDelegationValuesDefault(o.event?.delegation,null),[o.event]);return a||(0,i.jsx)(QA,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfilesCategories:o.event.accreditationsProfilesCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:vo.DELEGATION({organizationId:e,eventId:n,delegationId:t}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",forms:o.event.forms.nodes,initialValues:d,isEdit:!0,layouts:o.event.delegationsSpaceLayouts,mutate:async e=>await r({...e,delegationId:t}),hasOrganizationDelegations:o.organization.delegations.totalCount>0,tags:o.organization.tags.nodes})},iE=()=>{const{params:{organizationId:e,delegationId:n}}=fc(),t=ss(ab),{data:s,loader:o}=rs("query DelegationOrganizationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\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 showAllAccreditations\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersDuplicateMembers\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:n},[Ko.CreatePositionTagsFragment,Ko.OrganizationCustomFieldsFragment,Ko.AttachCustomFieldFragment,Ko.CreateDelegationFormFragment],undefined);const{mutate:a}=Hd(),r=(0,de.useMemo)(()=>t.createUpdateDelegationValuesDefault(s.organization?{...s.organization.delegation,parentId:null,delegationsSpaceLayoutId:null,accreditationsCategories:[],accreditations:[],accreditationsSlots:[],accreditationsProfiles:[]}:null,null),[s.organization]);return o||(0,i.jsx)(QA,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:Wo.COMMUNITY_DELEGATION(e,n),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:r,isEdit:!0,layouts:[],mutate:async e=>await a({...e,delegationId:n}),hasOrganizationDelegations:!1,tags:s.organization.tags.nodes})};function sE(e,n,t,i){const{getLocalOrganization:s,updateLocalOrganization:o}=function(e){const n=(0,de.useCallback)(async()=>{let n=await Py.organizations.get(e);return n||(n={id:e},await Py.organizations.put(n)),n},[e]),t=(0,de.useCallback)(async t=>{const i=await n(),s=(0,ky.A)(i,{id:e},t);return await Py.organizations.put(s),s},[e,n]);return{getLocalOrganization:n,updateLocalOrganization:t}}(e),[a,r]=(0,de.useState)(t),[d,l]=(0,de.useState)(!0),c=(0,de.useCallback)(async e=>{r(e),await o({[n]:e})},[n,r,o]);return(0,de.useEffect)(()=>{(async()=>{const e=await s();e[n]&&(i?.includes(e[n])??1)&&r(e[n]),l(!1)})()},[e,i,s,r,l]),[a,c,d]}function oE(e,n,t,i,s,o){const a=sE(t,i,s,o);return(0,de.useMemo)(()=>e?[n(e),Ou.A,!1]:a,[e,a])}function aE(e){return(0,de.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}var rE;let dE=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const n=Jo.dw.fromObject({minutes:e},{locale:Qu(this.translationService.language)}).shiftTo("hours","minutes");return 0===n.minutes?n.shiftTo("hours").toHuman({unitDisplay:"narrow"}):0===n.hours?n.shiftTo("minutes").toHuman({unitDisplay:"narrow"}):n.toHuman({unitDisplay:"narrow"})}};function lE(e,n,t){if(n.startsWith("form_inserted_at")){const i=parseInt(n.substring(17),10);if(isNaN(i))return"";{const n=t.find(({form:e})=>e?.id===i);return n?e.toLocaleString(n.insertedAt.toLocal(),da.DateTime):""}}return""}dE=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(rE=void 0!==ts&&ts)?rE:Object])],dE);const cE=e=>{const n=ss(wb),{isEditMode:t}=ah(),s=n.getValue(e.customField,e.fields),o=n.getValueString(e.customField,e.fields),a=!0===s?"checked":!1===s?"unchecked":"indeterminate";return t&&e.updatable?(0,i.jsxs)(_g,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary500"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Uc,children:[(0,i.jsx)(Zr,{className:"h-checkbox-cell-default",children:o}),(0,i.jsx)(Zr,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(Ym,{state:a,onClick:async n=>{await e.mutate("checked"===n,e.customField.slug),e.reload()}})})]}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:o})};class uE extends Error{}function mE(e,n){const t=ss(Ub);return(0,de.useCallback)(i=>{const s=t.getValidationRuleError(e,i);return s?Promise.reject(new uE(s)):n(i,e.slug)},[e,n])}const gE="h-update-cell-open",hE=e=>{const n=os(),t=(0,de.useRef)(ce()),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(e.initialValue),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(null),m=(0,de.useCallback)(e=>{r(e),u(null)},[]),g=(0,de.useCallback)(n=>{o(n),document.body.dispatchEvent(new CustomEvent(gE,{bubbles:!0,detail:{uuid:t.current}})),e.onStateChange?.(n)},[o,e.onStateChange]),h=(0,de.useCallback)(e=>{e.detail.uuid!==t.current&&o(!1)},[o]),p=(0,de.useCallback)(()=>{g(!1),m(e.initialValue)},[e.initialValue,g,m]),I=(0,de.useCallback)(async()=>{l(!0);try{await e.onSave(a)}catch(e){if(!(e instanceof uE))throw e;u(e.message)}finally{l(!1)}},[e.onSave,a]);return(0,de.useEffect)(()=>(document.addEventListener(gE,h),()=>{document.removeEventListener(gE,h)}),[h]),(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,isOpen:s,onStateChange:g,children:[(0,i.jsx)($m,{children:(0,i.jsx)(_g,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Uc,children:"function"==typeof e.renderValue?e.renderValue():e.renderValue})}),(0,i.jsxs)(wm,{css:{padding:"0",overflowBlock:"auto",maxBlockSize:"50vh"},placement:"bottom-start",width:380,children:[(0,i.jsx)(Xl,{css:{padding:"$4 $6"},onKeyDown:e=>{"Enter"===e.key&&I()},children:e.renderInput(a,r,c)}),(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:p,children:n("annuler_48254")}),(0,i.jsx)(yc,{isLoading:d,size:"sm",onClick:I,children:n("appliquer_05753")})]})]})]})},pE=e=>{const{isEditMode:n}=ah();return n&&e.updatable?(0,i.jsx)(hE,{column:e.column,initialValue:e.initialValue,renderInput:e.renderInput,renderValue:e.renderValue,onSave:async n=>{await e.mutate(n),e.reload()}}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"function"==typeof e.renderValue?e.renderValue():e.renderValue})},IE=e=>{const n=ss(wb),t=n.getValueString(e.customField,e.fields),s=(0,de.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return w(t)?Jo.c9.fromISO(t,{zone:"utc"}):t},[]),o=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(df,{hint:s,label:e.customField.name,state:w(s)?"error":"active",value:n,onChange:t}),renderValue:t,updatable:e.updatable})},fE=e=>{const n=ss(wb),t=n.getValueString(e.customField,e.fields),s=(0,de.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return w(t)?Jo.c9.fromISO(t,{zone:"utc"}):t},[]),o=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(If,{hint:s,label:e.customField.name,state:w(s)?"error":"active",value:n,onChange:t}),renderValue:t,updatable:e.updatable})},xE=e=>{const{params:{organizationId:n}}=fc(),t=ss(wb),s=t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),o=t.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),a=(0,de.useMemo)(()=>t.getValue(e.customField,e.fields),[e.customField,e.fields]),r=mE(e.customField,e.mutate),d=e.customField.fileType===vn.Picture,l=e.customField.fieldProperty===fn.Picture?e.avatarUser:void 0,{isEditMode:c}=ah(),u=!c&&(Qv(m=s)||"pdf"===Kv(m).extension);var m;const[g,h]=(0,de.useState)(!1);return(0,i.jsx)(pE,{column:e.column,initialValue:a,mutate:r,reload:e.reload,renderInput:(t,s)=>d?(0,i.jsx)(Qb,{allowCrop:!0,label:e.customField.name,organizationId:n,value:t,onChange:s}):(0,i.jsx)(wS,{accept:[Jv.Images,Jv.Pdf],acl:"private",label:e.customField.name,organizationId:n,value:t,onChange:s}),renderValue:()=>d?(w(o)||l)&&(0,i.jsx)(F_,{email:l?.email,image:o,name:l?.name,size:32}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ug,{css:{fontWeight:"$regular"},hideIcon:c||u,to:o,onClick:e=>{!u||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.stopPropagation(),h(!0))},children:s}),g&&(0,i.jsx)(hS,{name:s,url:o,onClose:()=>h(!1)})]}),updatable:e.updatable})},_E=e=>{const n=ss(wb),t=n.getValueString(e.customField,e.fields),s=(0,de.useMemo)(()=>n.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),o=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(hu,{hint:s,label:e.customField.name,shouldParseAsInt:!0,state:w(s)?"error":"active",value:n,onChange:t}),renderValue:t,updatable:e.updatable})},jE=e=>{const n=ss(wb),t=ss(Mj),s=n.getValueString(e.customField,e.fields),o=(0,de.useMemo)(()=>{const i=n.getValue(e.customField,e.fields),s=t.basePhoneInputDefault();return{country:i?.country||s.country,code:i?.code||s.code,number:i?.number||s.number}},[e.fields]),a=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:o,mutate:a,reload:e.reload,renderInput:(n,t)=>(0,i.jsx)(Zj,{label:e.customField.name,value:n,onChange:t}),renderValue:s,updatable:e.updatable})},vE=e=>(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{css:{background:e.color,borderRadius:"16px",flex:"0 0 auto",overflow:"hidden"},height:16,width:16}),(0,i.jsx)(Zr,{css:{clamp:2,minWidth:0,wordBreak:"break-word"},title:e.children,children:e.children})]});let SE=null;function yE(e,{fontSize:n,fontWeight:t}={}){SE||=document.createElement("canvas");const i=SE.getContext("2d");return i.font=`${t||"400"} ${n||"14px"} 'Open Sans`,i.measureText(e).width}const CE=({badge:e})=>(0,i.jsx)(Lm,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?pi.includes(e.icon)?hc(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),bE=({badges:e})=>(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Lm,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(wm,{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)(Xl,{children:(0,i.jsx)(CE,{badge:e})},e.id))})]}),AE=e=>{const[n,t]=(0,de.useState)(0),s=(0,de.useCallback)(e=>{e&&t(e.getBoundingClientRect().width)},[]),o=(0,de.useMemo)(()=>e.badges.some(e=>"number"==typeof e.count||"string"==typeof e.count),[e.badges]),a=(0,de.useMemo)(()=>e.badges.some(e=>!!e.icon),[e.badges]),r=(0,de.useMemo)(()=>(o?28:0)+(a?12:0)+20,[o,a]),d=(0,de.useMemo)(()=>{const n=e.badges.map(e=>({...e,textWidth:Math.floor(yE(e.text,{fontSize:"12px"}))+r}));return!0===e.doNotSort?n:(0,Tg.A)(n,({textWidth:e})=>e)},[r,e.badges,e.doNotSort]),[l,c]=(0,de.useMemo)(()=>{let e=37;const t=[],i=[];for(const s of d)e+=s.textWidth+8,ef(c),[c]);return(0,i.jsxs)(Xl,{ref:s,align:"center",css:{cursor:e.onClick?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:n=>{e.onClick&&f(d)&&(Uc(n),e.onClick())},children:[l.map(e=>(0,i.jsx)(CE,{badge:e},e.id)),u&&(e.onClick?(0,i.jsx)(Lm,{css:{cursor:"pointer"},size:"md",children:"+"+(d.length-l.length)}):(0,i.jsx)(bE,{badges:c}))]})},EE=e=>{const n=os(),t=ss(wb),s=(0,de.useMemo)(()=>{if(e.customField.canSelectMultiple){const n=t.getSelectCustomFieldValues(e.customField,e.fields);if(e.customField.listType==zn.Dot)return(0,i.jsx)(Xl,{align:"center",gap:"3",wrap:"wrap",children:n.map(({value:e,color:n},t)=>(0,i.jsx)(vE,{color:n||"",children:e},t))});{const t=n.map(({value:n,color:t})=>({id:n,color:e.customField.listType===zn.Badge?t||"":"gray",icon:null,text:n}));return(0,i.jsx)(AE,{badges:t})}}{const n=t.getValueString(e.customField,e.fields);if(w(n)){if(e.customField.listType===zn.Default)return n;{const s=t.getValue(e.customField,e.fields),o=e.customField.values.find(({id:e})=>e===s)?.color??"";return e.customField.listType===zn.Dot?(0,i.jsx)(vE,{color:o,children:n}):(0,i.jsx)(Lm,{color:o,children:n})}}return""}},[t,e.customField,e.fields]),o=(0,de.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?f(n)?n:[]:n||""},[t,e.customField,e.fields]),a=eA(e.customField),r=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:o,mutate:r,reload:e.reload,renderInput:(t,s)=>e.customField.canSelectMultiple?(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:t,onChange:s,children:a}):(0,i.jsx)(lg,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:n("choisir_une_val_00277"),renderOnPortal:!0,values:[t],onChange:e=>{f(e)&&s(e[0])},children:a}),renderValue:s,updatable:e.updatable})},wE=e=>{const n=ss(wb).getValueString(e.customField,e.fields),t=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:n,mutate:t,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(Xx,{hint:s,label:e.customField.name,state:w(s)?"error":"active",value:n,onChange:t,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),renderValue:n,updatable:e.updatable})},$E=e=>{const n=ss(wb).getValueString(e.customField,e.fields),t=mE(e.customField,e.mutate),{isEditMode:s}=ah(),o="string"==typeof e.clickPath&&(e.column.slug===fn.FirstName||e.column.slug===fn.LastName),a=o&&!s;return(0,i.jsx)(pE,{column:e.column,initialValue:n,mutate:t,reload:e.reload,renderInput:(n,t,s)=>(0,i.jsx)(hu,{autoFocus:!0,hint:s,label:e.customField.name,state:w(s)?"error":"active",value:n,onChange:t}),renderValue:()=>a?(0,i.jsx)(Ug,{to:e.clickPath,children:n}):(0,i.jsx)(Zr,{fontWeight:o?"medium":"inherit",children:n}),updatable:e.updatable})},TE=e=>{const n=ss(wb),t=n.getValueString(e.customField,e.fields),s=(0,de.useMemo)(()=>n.getValueString(e.customField,e.fields),[]),o=mE(e.customField,e.mutate);return(0,i.jsx)(pE,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(n,t)=>(0,i.jsx)(ty,{label:e.customField.name,value:n,onChange:t}),renderValue:t,updatable:e.updatable})},zE=e=>{const n=ss(wb);return e.customField?.fieldType===_n.Checkbox?(0,i.jsx)(cE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Date?(0,i.jsx)(IE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Phone?(0,i.jsx)(jE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Select||e.customField?.fieldType===_n.Country||e.customField?.fieldType===_n.Language||e.customField?.fieldType===_n.Sex||e.customField?.fieldType===_n.Nationality?(0,i.jsx)(EE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Text?(0,i.jsx)($E,{clickPath:e.clickPath,column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Textarea?(0,i.jsx)(wE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Number?(0,i.jsx)(_E,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.File?(0,i.jsx)(xE,{avatarUser:e.avatarUser,column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Datetime?(0,i.jsx)(fE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===_n.Time?(0,i.jsx)(TE,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)(_g,{children:e.customField?n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},OE=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{isEditMode:s}=ah(),{mutate:o}=ur(),a=(0,de.useCallback)(i=>o({organizationId:n,eventId:t,userInfoId:e.userInfo.id,email:i}),[e.userInfo,o]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.userInfo.email,mutate:a,reload:e.reload,renderInput:(n,t)=>(0,i.jsx)(hu,{isEmail:!0,label:e.column.name,value:n,onChange:t}),renderValue:()=>"string"!=typeof e.clickPath||s?(0,i.jsx)(Zr,{fontWeight:"medium",children:e.userInfo.email}):(0,i.jsx)(Ug,{to:e.clickPath,children:e.userInfo.email}),updatable:e.updatable})},RE=e=>{const{translate:n}=fc(),{isEditMode:t}=ah(),s=(0,de.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),o=(0,de.useCallback)(async n=>{await e.mutate(n.firstName,"firstName"),await e.mutate(n.lastName,"lastName"),e.reload()},[e.mutate,e.reload]);return t&&e.updatable?(0,i.jsx)(hE,{column:e.column,initialValue:s,renderInput:(e,t)=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(hu,{label:n("pr_nom_66988"),value:e.firstName,onChange:n=>{t({...e,firstName:n})}}),(0,i.jsx)(hu,{label:n("last_name"),value:e.lastName,onChange:n=>{t({...e,lastName:n})}})]}),renderValue:()=>(0,i.jsx)(MC,{clickPath:e.clickPath,isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:o}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(MC,{clickPath:e.clickPath,size:32,userInfo:e.userInfo})})};function DE(e,n){if(e){const t=(e.usersOrganizations||[]).map(e=>({id:`uo-${e.id}`,color:"gray",icon:e.role.type===dt.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat((e.usersEvents||[]).map(e=>({id:`ue-${e.id}`,color:"gray",icon:e.role.type===dt.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat((e.usersDelegations||[]).map(e=>({id:`ud-${e.id}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${n("responsable_de_70462")}`}))).concat((e.usersDelegationsCategories||[]).map(e=>({id:`udc-${e.id}`,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat((e.usersPositions||[]).map(e=>({id:`up-${e.id}`,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat((e.usersPositionsCategories||[]).map(e=>({id:`upc-${e.id}`,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`})));return(0,wh.A)(t,({text:e})=>e)}return[]}const ME=e=>{const n=os(),t=(0,de.useMemo)(()=>DE(e.userPermissions,n),[e.userPermissions]);return(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(AE,{badges:t,doNotSort:!0})})};function PE(e){return(0,Tg.A)(e.map(e=>({id:e.id,category:e.accreditationProfileCategory.name,text:w(e.acronym)?e.acronym:e.name,color:e.color,icon:e.icon})),({category:e,text:n})=>[b(e),b(n)])}const kE=e=>{const{translate:n}=fc(),{mutate:t}=Ta(),{isEditMode:s}=ah(),o=(0,de.useMemo)(()=>(0,sc.A)([e.volunteerRegistration.accreditationProfile?.id]),[e.volunteerRegistration]),[a,r]=(0,de.useState)(!0),[d,l]=(0,de.useState)(null),c=(0,de.useMemo)(()=>PE((0,sc.A)([e.volunteerRegistration.accreditationProfile])),[e.volunteerRegistration.accreditationProfile]),u=(0,de.useCallback)(async n=>{if(n&&a){const{event:n}=await function(e,n={}){return xa(Ca,{...n,variables:e,fragments:[]})}({eventId:e.eventId},{token:await fe()}),t=yA(n.accreditationsProfilesCategories);l(t),r(!1)}},[e.eventId,a]),m=(0,de.useCallback)(async n=>{_(n)?await t({eventId:e.eventId,massProfileUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Dn.Delete}}):await t({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:n[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Dn.Replace}}),e.reload()},[t,e.eventId,e.volunteerRegistration,e.reload]);return s&&e.updatable?(0,i.jsx)(hE,{column:e.column,css:{gap:"$2"},initialValue:o,renderInput:(e,t)=>a?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("profil_d_accr_d_02274"),multiple:!1,renderOnPortal:!0,values:e,onChange:t,children:d}),renderValue:()=>(0,i.jsx)(AE,{badges:c}),onSave:m,onStateChange:u}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:c})})},FE=({column:e,eventId:n,onClick:t,reload:s,updatable:o,volunteerRegistration:a})=>{const r=os(),{mutate:d}=Ra(),{mutate:l}=jr(),c=ss(Wg),{isEditMode:u}=ah(),[m,g]=(0,de.useState)(!0),[h,p]=(0,de.useState)(null),I=(0,de.useMemo)(()=>a?.accreditationsUsersInfos||[],[a]),x=(0,de.useMemo)(()=>sp(I),[I]),_=(0,de.useMemo)(()=>I.map(e=>e.accreditationSlot.id),[I]),j=(0,de.useCallback)(async e=>{if(e&&m){const{event:e}=await hr({eventId:n,loadIsBlocked:!0},{token:await fe()}),t=Yp(c,e.accreditationsCategories,{useAccreditationDisplay:!0,useIsBlocked:!0});p(t),g(!1)}},[c,n,m]),v=(0,de.useCallback)(async e=>{f(e)?await d({eventId:n,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[a.userInfo.id]},strategy:Dn.Replace}}):await l({eventId:n,massStateUpdate:{selecteds:{ids:[a.userInfo.id]},state:Re.WaitingAccreditation}}),s()},[n,a,d,s]);return u&&o?(0,i.jsx)(hE,{column:e,css:{gap:"$2"},initialValue:_,renderInput:(e,n)=>m?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:r("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:h}),renderValue:()=>(0,i.jsx)(AE,{badges:x,doNotSort:!0}),onSave:v,onStateChange:j}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(AE,{badges:x,doNotSort:!0,onClick:t})})},NE=e=>{const n=(0,de.useMemo)(()=>(0,wh.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)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},LE=e=>{const n=os(),{mutate:t}=Ar();return(0,i.jsx)(Xl,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await t({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"accreditation_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(Lm,{...UC(e.state),children:n(e.state)})})},UE=e=>{const n=os(),{isEditMode:t}=ah(),[s,o]=(0,de.useState)(!1),a=(0,de.useCallback)(e=>{t&&o(e)},[t,o]),r=(0,de.useCallback)(()=>{a(!1)},[a]);return t&&e.updatable?(0,i.jsx)(_g,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Uc,children:(0,i.jsxs)(ym,{isOpen:s,onStateChange:a,children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Xl,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Lm,{...UC(e.state),cursor:"text",children:n(e.state)}),s&&(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"chevron-down"})})]})}),(0,i.jsxs)(wm,{offset:2,placement:"bottom",width:240,children:[e.state!==Re.WaitingAccreditation&&(0,i.jsx)(LE,{close:r,eventId:e.eventId,reload:e.reload,state:Re.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==Re.NotApplicable&&(0,i.jsx)(LE,{close:r,eventId:e.eventId,reload:e.reload,state:Re.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Lm,{...UC(e.state),children:n(e.state)})})},VE=e=>{const n=ss(Wg),t=ss(Nh),s=(0,de.useMemo)(()=>function(e,n,t){return(0,Tg.A)((t||[]).flatMap(e=>(e.slots||[]).map(n=>({range:n.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map(t=>t.display===at.Calendar||t.display===at.DisplayDays?e.toLocaleString(t.range.start,da.DateOnly.Numeric):n.toDisplayString(t.range,{formats:{localeFormat:da.DateOnly.Numeric}}))}(n,t,e.volunteerRegistration.userInfo.formsUsersInfos).map((e,n)=>({id:n,color:"gray",icon:null,text:e})),[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:s,doNotSort:!0,onClick:e.onClick})})},BE=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.volunteerRegistration.delegationBannerNumber||0,[e.volunteerRegistration]),s=e.volunteerRegistration.delegationBannerNumber?.toString(10)||"",o=(0,de.useCallback)(n=>e.mutate(n,"banner_number"),[e.mutate]);return(0,i.jsx)(pE,{column:e.column,initialValue:t,mutate:o,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("num_ro_de_bande_16203"),shouldParseAsInt:!0,value:e,onChange:t}),renderValue:s,updatable:e.updatable})},WE=e=>{const{translate:n}=fc();return(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(Zr,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:bx(e.value,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"qrcode",children:n("code_barres_1_82428",e.name)}),(0,i.jsxs)(Gf,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(Zr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:bx(e.value,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Zr,{children:e.value})]}),(0,i.jsx)(Wf,{})]})]})},GE=e=>{const n=e.volunteerRegistration.ticketId;return(0,i.jsxs)(_g,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(WE,{name:e.volunteerRegistration.userInfo.nameOrEmail,size:30,value:e.volunteerRegistration.ticketId}),w(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(Ug,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:n}):n]})},qE=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:t,leftIcon:i}=PC(e.state);return{id:e.id,color:t,icon:i,text:`${e.campaign?.name??""} - ${n(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:t})})},HE=e=>{const n=(0,de.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==Be.Waiting),[e.volunteerRegistration]),t=(0,de.useMemo)(()=>np(n),[n]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:t,doNotSort:!0,onClick:e.onClick})})},YE=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)("");return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"print",children:n("impression_du_d_03836",e.customDocumentName)}),(0,i.jsxs)(Gf,{gap:"6",children:[(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("le_document_a_d_84754")}),(0,i.jsx)(Oc,{children:n("afin_de_r_dite_85227")})]}),(0,i.jsx)(Xx,{label:n("raison_de_l_imp_75064"),value:t,onChange:s})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:$(t),onClick:()=>e.onPrint(t),children:n("imprimer_le_doc_75788")})})]})})},ZE=()=>{const{mutate:e}=function(e={}){return ds("mutation VolunteersRegistrationsMassCustomDocumentPrint(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n $sort: VolunteersRegistrationsSort\n $customDocumentSlug: String!\n $reason: String!\n) {\n link: volunteersRegistrationsMassCustomDocumentPrint(\n eventId: $eventId\n selecteds: $selecteds\n sort: $sort\n customDocumentSlug: $customDocumentSlug\n reason: $reason\n )\n}\n",e)}();return(0,de.useCallback)(({language:n,onAfterPrint:t,...i})=>async function(t,s){const o=window.open("about:blank","_blank");if(!o)throw new Error("Could not open print window, it has probably been blocked");try{const t=await(async()=>{const{link:t}=await e(i);return Ex(t,"html",{lang:n})})(),a=await fetch(t,{method:"GET"});if(!a.ok)throw new Error(`Could not load document to print: ${a.status}`);const r=await a.text();o.document.write(r),o.document.close(),await Promise.all(Array.from(o.document.images).map(e=>new Promise(n=>{e.complete?n():(e.addEventListener("load",()=>n(),{once:!0}),e.addEventListener("error",()=>n(),{once:!0}))}))),await(o.document.fonts?.ready),o.addEventListener("afterprint",()=>{s?.(),o.close()},{once:!0}),o.focus(),o.print()}catch(e){throw o.close(),e}}(0,t),[e])},KE=e=>{const n=ZE(),t=(0,de.useMemo)(()=>!!e.customDocument&&Ep(e.customDocument.populationsIds??[],e.volunteerRegistration.userInfo.fields?.population),[e.customDocument,e.volunteerRegistration]),s=(0,de.useMemo)(()=>(e.volunteerRegistration.exportedCustomDocumentsSlugs??[]).includes(e.customDocument?.slug??"")&&(e.customDocument?.shouldRegenerateTicketIdOnDownload??!1),[e.customDocument,e.volunteerRegistration]),[o,a]=(0,de.useState)(!1),[r,d]=(0,de.useState)(!1),{name:l,clearName:c}=e.search,u=(0,de.useCallback)(()=>{l.startsWith("185")&&c()},[l,c]),m=(0,de.useCallback)(async(t="")=>{d(!0),a(!1);try{await n({eventId:e.eventId,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},customDocumentSlug:e.customDocument?.slug??"",reason:t,language:e.volunteerRegistration.userInfo.fields?.language,onAfterPrint:u})}catch(e){console.error(`Could not print custom document: ${String(e)}`)}finally{d(!1),e.reload()}},[n,u,e.customDocument,e.eventId,e.volunteerRegistration,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:t&&(0,i.jsx)(yc,{color:"white",css:{overflow:"hidden","& .h-button-content":{overflow:"hidden"}},isLoading:r,leftIcon:"print",size:"sm",onClick:()=>s?a(!0):m(),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name})})}),o&&(0,i.jsx)(YE,{customDocumentName:e.customDocument?.name??"",isOpen:o,onClose:()=>a(!1),onPrint:m})]})},XE=e=>{const{clearNameCursors:n,name:t}=ah();return(0,i.jsx)(KE,{column:e.column,customDocument:e.column.customDocument,eventId:e.eventId,reload:e.reload,search:{name:t,clearName:n},volunteerRegistration:e.volunteerRegistration})},QE=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{mutate:o}=Sr(),{mutate:a}=Ja(),{isEditMode:r}=ah(),d=(0,de.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),l=(0,de.useMemo)(()=>d?[d.id]:[],[d]),[c,u]=(0,de.useState)(!0),[m,g]=(0,de.useState)([]),h=(0,de.useCallback)(async e=>{if(e&&c){const{event:{delegations:e}}=await br({eventId:s},{token:await fe()});g(e.nodes),u(!1)}},[c]),p=(0,de.useCallback)(async n=>{f(n)?await o({eventId:s,delegationId:n[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]}}):d&&await a({organizationId:t,eventId:s,delegationId:d.id,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},deleteFromEvent:!1}),e.reload()},[s,e.volunteerRegistration]);return r&&e.updatable?(0,i.jsx)(hE,{column:e.column,css:{gap:"$2"},initialValue:l,renderInput:(e,t)=>c?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("Delegation"),renderOnPortal:!0,values:e,onChange:t,children:m.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),renderValue:()=>d?(0,i.jsx)(Lm,{cursor:"pointer",ellipsis:!0,title:d.name,children:d.name}):null,onSave:p,onStateChange:h}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:d&&(0,i.jsx)(Lm,{cursor:"pointer",ellipsis:!0,title:d.name,children:(0,i.jsx)(gc,{to:vo.DELEGATION({organizationId:t,eventId:s,delegationId:d.id}),children:d.name})})})},JE=e=>{const{params:{organizationId:n,eventId:t}}=fc(),s=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:s&&(0,i.jsx)(Lm,{cursor:"pointer",ellipsis:!0,title:s.name,children:(0,i.jsx)(gc,{to:vo.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:s.id}),children:s.name})})})},ew=e=>{const{history:n,params:{organizationId:t,eventId:s}}=fc(),o=(0,de.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name,onClick(){n.push(Ks.FORM_ELEMENTS({organizationId:t,eventId:s,formId:e.form.id}))}}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:o})})},nw=e=>{const n=(0,de.useMemo)(()=>function(e,n){const t=(0,Tg.A)((0,wh.A)(e.filter(e=>n.includes(e.accreditationCategoryId)),e=>e.accreditation.id),e=>e.accreditation.fields.cf50732).map(e=>e.accreditation.name.substring(9));return t[0]||""}((e.volunteerRegistration.accreditationsUsersInfos||[]).map(e=>({accreditationCategoryId:e.accreditationSlot.accreditationCategory.id,accreditation:e.accreditationSlot.accreditation})),[6870,5709]),[e.volunteerRegistration.accreditationsUsersInfos]);return(0,i.jsx)(_g,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:n})},tw=e=>{const n=os(),{mutate:t}=vr(),{mutate:s}=yr(),o=ss(Nh),{isEditMode:a}=ah(),r=(0,de.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),d=(0,de.useMemo)(()=>np(r),[r]),l=(0,de.useMemo)(()=>r.map(e=>e.positionSlot.id),[r]),[c,u]=(0,de.useState)(!0),[m,g]=(0,de.useState)([]),h=(0,de.useCallback)(async n=>{if(n&&c){const{event:n}=await pr({eventId:e.eventId},{token:await fe()});g(Zp(o,n.positionsCategories,{usePositionDisplay:!0})),u(!1)}},[c]),p=(0,de.useCallback)(async n=>{f(n)?await t({eventId:e.eventId,massAssign:{positionsSlotsIds:n,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Dn.Replace}}):await s({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:yt.WaitingAssignment}}),e.reload()},[e.eventId,e.volunteerRegistration,t,e.reload]);return a&&e.updatable?(0,i.jsx)(hE,{column:e.column,css:{gap:"$2"},initialValue:l,renderInput:(e,t)=>c?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:m}),renderValue:()=>(0,i.jsx)(AE,{badges:d,doNotSort:!0}),onSave:p,onStateChange:h}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:d,doNotSort:!0,onClick:e.onClick})})},iw=e=>{const n=(0,de.useMemo)(()=>(0,wh.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)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},sw=e=>{const n=(0,de.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},ow=e=>{const n=(0,de.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},aw=e=>{const n=(0,de.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),t=(0,de.useMemo)(()=>sp(n),[n]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:t,doNotSort:!0,onClick:e.onClick})})},rw=e=>(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:w(e.volunteerRegistration.shortTag)&&w(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(Ug,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),dw=(...e)=>({name:"canCommentFn",args:e}),lw=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),cw=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function uw(e){try{const n=await fe(),t=await function(e,n={}){return xa("query UserPermission($checks: [PermissionCheck!]!) {\n user {\n permission(checks: $checks)\n }\n}\n",{...n,variables:e,fragments:[]})}(e,{token:n});return t.user.permission}catch{return e.checks.map(e=>!1)}}const mw=new Map;function gw({checks:e}){const n=e.map(e=>[e,JSON.stringify(e)]),t=n.filter(([e,n])=>!mw.has(n));if(t.length>0){const e=uw({checks:t.map(([e,n])=>e)});t.forEach(([n,t],i)=>{mw.set(t,e.then(e=>e[i]??!1))})}return Promise.all(n.map(([e,n])=>mw.get(n)))}function hw({withCaching:e,checks:n}){const[{isLoading:t,permissions:i},s]=(0,de.useState)({isLoading:!0,permissions:new Array(n.length).fill(!1)}),o=e?gw:uw;return(0,de.useEffect)(()=>{o({checks:n}).then(e=>{s({isLoading:!1,permissions:e})},()=>{s({isLoading:!1,permissions:i})})},[]),{isLoading:t,permissions:i}}function pw(...e){const{isLoading:n,permissions:t}=hw({withCaching:!0,checks:e});return{isLoading:n,permissions:t}}const Iw=e=>{const n=os(),{mutate:t}=Ar();return(0,i.jsx)(Xl,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await t({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"volunteer_registration_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(Lm,{cursor:"pointer",...LC(e.state),children:n(e.state)})})},fw=e=>{const{permissions:[n,t],isLoading:s}=function(...e){const{isLoading:n,permissions:t}=hw({withCaching:!1,checks:e});return{isLoading:n,permissions:t}}(lw(e.eventId,yt.PreAssigned,e.volunteerRegistrationId),lw(e.eventId,yt.Assigned,e.volunteerRegistrationId));return s?null:(0,i.jsxs)(i.Fragment,{children:[t&&e.state!==yt.WaitingAssignment&&(0,i.jsx)(Iw,{close:e.close,eventId:e.eventId,reload:e.reload,state:yt.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),n&&(0,i.jsx)(Iw,{close:e.close,eventId:e.eventId,reload:e.reload,state:yt.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),t&&e.state!==yt.Refused&&(0,i.jsx)(Iw,{close:e.close,eventId:e.eventId,reload:e.reload,state:yt.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),t&&e.state!==yt.NotApplicable&&(0,i.jsx)(Iw,{close:e.close,eventId:e.eventId,reload:e.reload,state:yt.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},xw=e=>{const n=os(),{isEditMode:t}=ah(),[s,o]=(0,de.useState)(!1),a=(0,de.useCallback)(e=>{t&&o(e)},[t,o]),r=(0,de.useCallback)(()=>{a(!1)},[a]);return t&&e.updatable?(0,i.jsx)(_g,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary500"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Uc,children:(0,i.jsxs)(ym,{isOpen:s,onStateChange:a,children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Xl,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(Lm,{...LC(e.state),cursor:"text",ellipsis:!0,children:n(e.state)}),s&&(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"chevron-down"})})]})}),(0,i.jsx)(wm,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(fw,{close:r,...e})})]})}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Lm,{...LC(e.state),children:n(e.state)})})},_w=e=>{const n=(0,de.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:t})})},jw=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{isEditMode:r}=ah(),{mutate:d}=Ar(),l=(0,de.useMemo)(()=>e.volunteerRegistration.teams||[],[e.volunteerRegistration]),c=(0,de.useMemo)(()=>l.map(({teamCode:t})=>({id:t,color:"gray",icon:null,text:t,onClick:r?void 0:()=>{n.push(Wo.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,o,a,e.volunteerRegistration.userInfo.id,t))}})),[l,r]),[u,...m]=l;return void 0!==u&&0===m.length&&r?(0,i.jsx)(hE,{column:e.column,css:{gap:"$2"},initialValue:u.teamCode,renderInput:(e,n)=>(0,i.jsx)(hu,{label:t("code_quipe_14296"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(AE,{badges:c}),onSave:async n=>{await d({eventId:o,volunteerRegistrationId:e.volunteerRegistration.id,slug:"team_code",value:n}),e.reload()}}):(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:c})})},vw=e=>{const{params:{organizationId:n,eventId:t}}=fc(),s=(0,de.useMemo)(()=>(0,Tg.A)(e.teamMembers,e=>b(e.name)),[e.teamMembers]);return(0,i.jsx)(Xl,{children:s.map((e,s)=>(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{css:{cursor:"pointer",position:"relative",left:-4*s+"px"},children:(0,i.jsx)(gc,{to:Ev.MEMBER_INFORMATION({organizationId:n,eventId:t,userInfoId:e.id}),children:(0,i.jsx)(F_,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(ux,{placement:"top",children:e.name})]},e.id))})},Sw=e=>{const n=(0,de.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(vw,{teamMembers:n})})},yw=e=>{const n=(0,de.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},Cw=e=>{const n=(0,de.useMemo)(()=>PE((e.volunteerRegistration.userInfo.formsUsersInfos??[]).flatMap(e=>e.accreditationProfile?[e.accreditationProfile]:[])),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n,doNotSort:!0})})},bw=e=>{const n=(0,de.useMemo)(()=>op(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n,doNotSort:!0,onClick:e.onClick})})},Aw=e=>{const n=ss(Nh),t=(0,de.useMemo)(()=>tp(n,e.volunteerRegistration?.positionsCategories||[],e.volunteerRegistration?.positions||[],e.volunteerRegistration?.positionsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:t,onClick:e.onClick})})},Ew=e=>{const{history:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Wg),a=ss(dE),r=(0,de.useMemo)(()=>function(e,n){return n.flatMap(n=>n.form?[`${n.form.name} : ${e.toLocaleString(n.insertedAt.toLocal(),da.DateTime)}`]:[]).join(", ")}(o,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:d}=Ar(),l=(0,de.useCallback)((n,t)=>d({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:t,value:n}),[e.eventId,e.row,d]),c=e.row.userInfo;switch(e.column.slug){case Op.AccreditationProfile:return(0,i.jsx)(kE,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAccredit,volunteerRegistration:e.row});case Op.Accreditations:return(0,i.jsx)(FE,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAccredit,volunteerRegistration:e.row,onClick:w(e.accreditationsPanelPath)?()=>{n.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case Op.AccreditationsCategories:return(0,i.jsx)(NE,{column:e.column,volunteerRegistration:e.row});case Op.AccreditationState:return(0,i.jsx)(UE,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canMemberAccredit,volunteerRegistrationId:e.row.id});case Op.ScannedAccreditations:return(0,i.jsx)(aw,{column:e.column,volunteerRegistration:e.row,onClick:w(e.accreditationsPanelPath)?()=>{n.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case"bracelet_a_delivrer":return(0,i.jsx)(nw,{column:e.column,volunteerRegistration:e.row});case Op.Availability:return(0,i.jsx)(VE,{column:e.column,volunteerRegistration:e.row,onClick:w(e.availabilitiesPanelPath)?()=>{n.push(e.availabilitiesPanelPath)}:void 0});case Op.Comments:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:f(c.comments)?c.comments.map(e=>e.content).join("; "):""});case Op.CampaignsStates:return(0,i.jsx)(qE,{column:e.column,volunteerRegistration:e.row});case Op.CheckedInPositions:return(0,i.jsx)(HE,{column:e.column,volunteerRegistration:e.row,onClick:w(e.positionsPanelPath)?()=>{n.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Op.CompletedForms:return(0,i.jsx)(ew,{column:e.column,volunteerRegistration:e.row});case Op.FormsInsertedAt:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:r,children:r})});case Op.Delegations:return(0,i.jsx)(QE,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case Op.DelegationBannerNumber:return(0,i.jsx)(BE,{column:e.column,mutate:l,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,volunteerRegistration:e.row});case Op.DuplicatedFrom:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(MC,{size:32,userInfo:e.row.duplicatedFrom.userInfo}):null});case Op.DelegationCategory:return(0,i.jsx)(JE,{column:e.column,volunteerRegistration:e.row});case Op.Email:return(0,i.jsx)(OE,{clickPath:e.informationPanelPath??Ev.MEMBER_INFORMATION({organizationId:t,eventId:s,userInfoId:e.row.userInfo.id}),column:e.column,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:c});case Op.Id:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:c.id});case Op.LocalId:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case Op.OrganizationLocalId:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:c.localId});case Op.InsertedAt:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:o.toLocaleString(e.row.insertedAt.toLocal(),da.DateTime)});case Op.Name:return(0,i.jsx)(RE,{clickPath:e.informationPanelPath,column:e.column,mutate:l,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case Op.NumberOfAccreditations:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case Op.NumberOfAssignments:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case Op.NumberOfAssignmentsDays:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case Op.NumberOfAvailableDays:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case Op.Positions:return(0,i.jsx)(tw,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canMemberAssign,volunteerRegistration:e.row,onClick:w(e.positionsPanelPath)?()=>{n.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Op.PositionsCategories:return(0,i.jsx)(iw,{column:e.column,volunteerRegistration:e.row});case Op.PreassignedPositions:return(0,i.jsx)(sw,{column:e.column,volunteerRegistration:e.row});case Op.PreassignedPositionsCategories:return(0,i.jsx)(ow,{column:e.column,volunteerRegistration:e.row});case Op.Roles:return(0,i.jsx)(ME,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case Op.Tags:return(0,i.jsx)(_w,{column:e.column,volunteerRegistration:e.row});case Op.TeamCode:return(0,i.jsx)(jw,{column:e.column,reload:e.reloadRow,volunteerRegistration:e.row});case Op.TeamMembers:return(0,i.jsx)(Sw,{column:e.column,volunteerRegistration:e.row});case Op.VolunteerMinutes:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:a.minutesToHoursMinutesString(e.row.volunteerMinutes)});case Op.VolunteerRegistrationState:return(0,i.jsx)(xw,{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 Op.WishedAccreditationProfile:return(0,i.jsx)(Cw,{column:e.column,volunteerRegistration:e.row});case Op.WishedAccreditationSlots:return(0,i.jsx)(bw,{column:e.column,volunteerRegistration:e.row,onClick:w(e.accreditationsPanelPath)?()=>{n.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case Op.WishedPositions:return(0,i.jsx)(Aw,{column:e.column,volunteerRegistration:e.row,onClick:w(e.positionsPanelPath)?()=>{n.push(`${e.positionsPanelPath}/wished`)}:void 0});case Op.WeezaccessChecklists:return(0,i.jsx)(yw,{column:e.column,volunteerRegistration:e.row});case Op.WeezeventBarcodeId:return(0,i.jsx)(GE,{column:e.column,volunteerRegistration:e.row});case Op.WeezeventBarcodeVersion:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.ticketIdVersion});case Op.WeezeventPairedAt:return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.pairedAt?.isValid?o.toLocaleString(e.row.pairedAt.toLocal(),da.DateTime):""});case Op.WeezeventShortTag:return(0,i.jsx)(rw,{column:e.column,volunteerRegistration:e.row});default:return Object.values(Op).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)(_g,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:lE(o,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):Ap(e.column.slug)?(0,i.jsx)(XE,{column:e.column,eventId:e.eventId,reload:e.reloadRow,volunteerRegistration:e.row}):(0,i.jsx)(zE,{avatarUser:e.row.userInfo,clickPath:e.informationPanelPath??Ev.MEMBER_INFORMATION({organizationId:t,eventId:s,userInfoId:e.row.userInfo.id}),column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:l,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},ww=({title:e,subtitle:n})=>(0,i.jsx)(Eg,{css:{height:"fit-content"},children:(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(uA,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n})]})})}),$w=(0,de.createContext)({}),Tw=e=>{const{mutate:n}=Ra(),{mutate:t}=Tr(),[s,o]=(0,de.useState)(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),a=(0,de.useMemo)(()=>s.map(({id:e})=>e),[s]),[r,d]=(0,de.useState)(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[l,c]=(0,de.useState)(e.volunteerRegistration.accreditationsSlots),u=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(s.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[s]),m=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(r.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[r]),g=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(l.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[l]),h=(0,de.useMemo)(()=>(0,wh.A)(s.map(e=>e.accreditation),e=>e.id),[s]),p=(0,de.useMemo)(()=>(0,wh.A)(r.map(e=>e.accreditation),e=>e.id),[r]),I=(0,de.useMemo)(()=>(0,wh.A)(l.map(e=>e.accreditation),e=>e.id),[l]),f=(0,de.useCallback)(async t=>{await n({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:Dn.Delete}}),o(e=>e.filter(e=>e.id!==t)),d(e=>e.filter(e=>e.id!==t))},[e.eventId,e.userInfoId,o,d]),x=(0,de.useCallback)(async n=>{await t({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:Dn.Delete}}),c(e=>e.filter(e=>e.id!==n))},[e.eventId,e.delegationId,e.userInfoId]),_=(0,de.useCallback)(async t=>{await n({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:Dn.Add}});const i=l.find(e=>e.id===t);o(e=>[...e,i])},[e.eventId,e.volunteerRegistration,l,o]),j=(0,de.useCallback)(n=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===n).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)($w.Provider,{value:{assignSlot:_,assignedAccreditations:h,assignedCategories:u,assignedSlots:s,assignedSlotsIds:a,canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,deleteAssignedSlot:f,deleteWishedSlot:x,scannedAccreditations:p,scannedCategories:m,scannedSlots:r,wishedAccreditations:I,wishedCategories:g,wishedSlots:l,getScannedAt:j},children:e.children})};function zw(){return(0,de.useContext)($w)}const Ow=e=>{const{translate:n}=fc(),t=ss(Wg),{assignSlot:s,assignedSlotsIds:o,canMemberAccredit:a,canWishedAccreditationsEdit:r,defaultHiddenAccreditationsSlotsIds:d,deleteAssignedSlot:l,deleteWishedSlot:c,getScannedAt:u}=zw(),[m,g]=(0,de.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&a?(0,i.jsx)(Xl,{css:{flex:"1",px:"$4"},justify:"end",children:m?(0,i.jsx)(Vm,{borderRadius:"$1",height:20,children:n("retirer_05155")}):(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{g(!0),await l(e.accreditationSlotId)},children:n("retirer_05155")})}):"wished"===e.state&&a?(0,i.jsx)(Xl,{css:{flex:"1",px:"$4"},justify:"end",children:o.includes(e.accreditationSlotId)?(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:"success500",children:(0,i.jsx)(pc,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:n("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(yc,{isLoading:m,size:"sm",onClick:async()=>{g(!0),await s(e.accreditationSlotId),g(!1)},children:n("ajouter_97327")})}):"wished"!==e.state||!r||e.isBlocked||d.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(Xl,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(Zr,{css:{ellipsis:!0},children:t.toLocaleString(u(e.accreditationSlotId),da.DateTime)})}):(0,i.jsx)(Xl,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(Xl,{css:{flex:"1",px:"$4"},justify:"end",children:m?(0,i.jsx)(Vm,{borderRadius:"$1",height:20,children:n("retirer_05155")}):(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{g(!0),await c(e.accreditationSlotId)},children:n("retirer_05155")})})},Rw=e=>{const n=ss(Wg),{canDeleteCheckedIn:t,canMemberAccredit:s,canWishedAccreditationsEdit:o,scannedSlots:a}=zw(),r="assigned"===e.state&&s||"scanned"===e.state||"wished"===e.state&&(s||o),d=w(e.slot.name)?e.slot.name:"-",l=(0,de.useMemo)(()=>e.slot.isBlocked?e.slot.isBlocked:!t&&a.some(n=>n.id===e.slot.id),[t,e.slot,a]);return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,da.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:d,width:1,children:d})}),r&&(0,i.jsx)(Ow,{accreditationSlotId:e.slot.id,isBlocked:l,state:e.state})]})},Dw=e=>{const{translate:n}=fc(),{assignedSlots:t,canDeleteCheckedIn:s,canMemberAccredit:o,canWishedAccreditationsEdit:a,scannedSlots:r,wishedSlots:d}=zw(),l=(0,de.useMemo)(()=>(0,Tg.A)(("assigned"===e.state?t:"scanned"===e.state?r:d).filter(n=>n.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[t,r,d,e.accreditation,e.state]),c=(0,de.useMemo)(()=>!s&&r.some(n=>n.id===e.accreditation.hiddenSlotId),[s,e.accreditation,r]),u="assigned"===e.state&&o||"scanned"===e.state||"wished"===e.state&&(o||a);return(0,i.jsx)(AA,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:l.length,renderActions:!e.accreditation.hasSlots&&u?()=>(0,i.jsx)(Ow,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:c,state:e.state}):void 0,children:(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Mg,{children:n("nom_du_cr_neau_54351")}),u&&(0,i.jsx)(Mg,{children:"scanned"===e.state&&n("scann_e_le_27812")})]}),l.map(n=>(0,i.jsx)(Rw,{slot:n,state:e.state},n.id))]})})},Mw=e=>{const{assignedAccreditations:n,scannedAccreditations:t,wishedAccreditations:s}=zw(),o=(0,de.useMemo)(()=>rp(("assigned"===e.state?n:"scanned"===e.state?t:s).filter(n=>n.accreditationCategoryId===e.category.id)),[n,s,e.category,e.state]);return(0,i.jsx)(bA,{category:e.category.name,children:o.map(n=>(0,i.jsx)(Dw,{accreditation:n,state:e.state},n.id))})},Pw=e=>{const n=os(),{assignedCategories:t,scannedCategories:s,wishedCategories:o}=zw(),a="assigned"===e.state?t:"scanned"===e.state?s:o;return(0,i.jsx)(CA,{children:f(a)?a.map(n=>(0,i.jsx)(Mw,{category:n,state:e.state},n.id)):(0,i.jsx)(ww,{title:n("no_accreditations")})})},kw=e=>{const{translate:n}=fc();return(0,i.jsx)(Tw,{canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:n("accr_ditations_04710",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(xI,{css:{padding:"0"},children:(0,i.jsxs)(TC,{height:1,children:[(0,i.jsxs)(wC,{center:!0,children:[(0,i.jsx)(EC,{path:`${e.basePath}/assigned`,children:n("attribu_es_48167")}),(0,i.jsx)(EC,{path:`${e.basePath}/wished`,children:n("souhait_es_78101")}),(0,i.jsx)(EC,{path:`${e.basePath}/scanned`,children:n("scann_es_13169")})]}),(0,i.jsx)($C,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Pw,{state:"assigned"})}),(0,i.jsx)($C,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Pw,{state:"wished"})}),(0,i.jsx)($C,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(Pw,{state:"scanned"})})]})})]})})};function Fw(e,n){return{name:n("commentaire_r_12290"),slug:`form${e}`,fieldType:_n.Textarea,listType:zn.Default,values:[]}}const Nw=Nr(Zr,{overflow:"hidden",textOverflow:"ellipsis",color:"$gray500",fontSize:"$textSm",fontWeight:"$regular","@tablet":{fontSize:"$textSm"}}),Lw=e=>{const n=ss(wb);switch(e.field.fieldType){case _n.File:{const t=n.getValue(e.field,e.fields);return t?(0,i.jsx)(pS,{acl:"public-read",document:t}):(0,i.jsx)(Nw,{children:"-"})}case _n.Phone:{const t=n.getValueString(e.field,e.fields);return(0,i.jsx)(Nw,{children:w(t)?(0,i.jsx)(Ug,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${t}`,children:t}):"-"})}case _n.Select:{const t=n.getSelectCustomFieldValues(e.field,e.fields);return(0,i.jsx)(Xl,{align:"center",gap:"3",wrap:"wrap",children:t.map(({value:n,color:t},s)=>e.field.listType===zn.Dot?(0,i.jsx)(vE,{color:t||"",children:n},s):(0,i.jsx)(Lm,{color:e.field.listType===zn.Badge?t||"":"gray",children:n},s))})}default:{const t=n.getValueString(e.field,e.fields);return(0,i.jsx)(Nw,{children:w(t)?URL.canParse(t)?(0,i.jsx)(Ug,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:t,children:t}):t:"-"})}}},Uw=e=>(0,i.jsx)(Zr,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),Vw=e=>(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Uw,{children:e.field.name}),(0,i.jsx)(Lw,{field:e.field,fields:e.fields})]}),Bw=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===yn.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),s=(0,de.useMemo)(()=>e.form.elements.filter(n=>n.elementType===yn.Field?Tb(n.customField,e.userInfo.fields,t):n.elementType===yn.Section&&Tb(n,e.userInfo.fields,t)),[t,e.form.elements,e.userInfo.fields]),o="all"!==e.form.id?Fw(e.form.id,n):null;return(0,i.jsxs)(Xl,{css:e.css,direction:"column",children:[s.map((n,t)=>{switch(n.elementType){case yn.Field:return(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Vw,{field:n.customField,fields:e.userInfo.fields}),t!==s.length-1&&(0,i.jsx)(ic,{height:"6"})]},n.id);case yn.Section:return(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n.section}),t!==s.length-1&&(0,i.jsx)(ic,{height:"4"})]},n.id);case yn.Text:return null;default:return Ic(n.elementType)}}),o&&w(e.userInfo.fields[o.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("inscription_en_49989")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Vw,{field:o,fields:e.userInfo.fields})]})]})},Ww=e=>{const{data:n,loader:t}=rs("query DelegationMemberRightPanel(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n id\n name\n email\n fields\n picture {\n url\n }\n\n formUserInfo(formId: $formId) {\n insertedAt\n form {\n ...FormMemberRegistration\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,userInfoId:e.userInfoId,formId:e.delegation.form.id},[Ko.FormMemberRegistrationFragment],undefined);return(0,i.jsx)(fI,{returnToFallback:e.returnPathFallback,size:"md",children:t||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(YC,{children:(0,i.jsx)(MC,{areContactLinksEnabled:!0,isClickDisabled:!0,size:48,userInfo:n.organization.userInfo})}),(0,i.jsx)(xI,{css:{background:"$gray50",py:"$6"},children:(0,i.jsx)(Lx,{children:(0,i.jsx)(Bw,{form:n.organization.userInfo.formUserInfo.form,userInfo:n.organization.userInfo})})})]})})},Gw=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eg,{state:e.isChecked?"checked":"unchecked",onClick:e.onClick,children:e.text}),e.isChecked&&e.children&&(0,i.jsx)(Xl,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"4",children:e.children})]}),qw=e=>{const{translate:n}=fc(),{mutate:t}=nr(),[s,o]=(0,de.useState)(We.CheckInOut),[a,r]=(0,de.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[d,l]=(0,de.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[c,u]=(0,de.useState)(e.positionSlotUserInfo.breakTime),[m,g]=(0,de.useState)(!1),h=(0,de.useMemo)(()=>ca(),[]),p=s===We.Reset||a?.isValid&&d?.isValid&&d>a||a?.isValid&&!d?.isValid;return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"sliders",children:n("mise_jour_du_76261")}),(0,i.jsxs)(Gf,{gap:"2",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_87607")}),(0,i.jsxs)(Gw,{isChecked:s===We.CheckInOut,text:n("mettre_jour_l_00128"),onClick:()=>{o(We.CheckInOut)},children:[(0,i.jsx)(If,{hint:n("date_et_heure_d_93417"),rightIcon:"xmark",value:a,zone:h,onChange:r,onRightIconClick:()=>r(null)}),(0,i.jsx)(If,{hint:n("date_et_heure_d_65738"),rightIcon:"xmark",value:d,zone:h,onChange:l,onRightIconClick:()=>l(null)}),(0,i.jsx)(hu,{hint:n("temps_de_pause_00051"),shouldParseAsInt:!0,value:c,onChange:u})]}),(0,i.jsx)(Gw,{isChecked:s===We.Reset,text:n("remettre_z_ro_11572"),onClick:()=>{o(We.Reset)}})]}),(0,i.jsx)(Wf,{children:o=>(0,i.jsx)(yc,{disabled:!p,isLoading:m,onClick:async()=>{g(!0),await t({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:c,checkInAt:a?.toUTC(),checkOutAt:d?.toUTC(),strategy:s,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),o()},children:n("mettre_jour_85141")})})]})})},Hw=e=>{const{translate:n}=fc(),{mutate:t}=nr(),{mutate:s}=vr(),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(Em,{icon:"circle-check",onClick:()=>a(!0),children:n("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==Be.Waiting&&(0,i.jsx)(Em,{icon:"arrows-rotate",onClick:async()=>{await t({eventId:e.psui.eventId,checkIn:{strategy:We.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:n("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(Em,{color:"red",icon:"user-xmark",onClick:async()=>{await s({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlotId],selecteds:{ids:[e.psui.userInfoId]},strategy:Dn.Delete}}),e.onDelete(e.psui.id)},children:n("d_saffecter_du_47122")})]}),(0,i.jsx)(qw,{isOpen:o,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),a(!1)}})]})},Yw=e=>{const{translate:n}=fc(),t=ss(Wg),s=ss(dE),o=ss(Nh),{mutate:a}=nr(),r=Cg(),d=(0,de.useMemo)(()=>{const n=e.positionSlotUserInfo.positionSlot;return w(n.name)?`${n.name} - ${o.toDisplayString(n.range)}`:o.toDisplayString(n.range)},[e.positionSlotUserInfo.positionSlot]),l=()=>(0,i.jsxs)(Xl,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(UI,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:d})]})]});return(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(gc,{to:Eo.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:l()}):l(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===Be.CheckedOut?(0,i.jsx)(Lm,{leftIcon:"clock",children:n("temps_total_79448",s.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===Be.CheckedIn?(0,i.jsx)(Lm,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:n("point_le_1_63576",t.toLocaleString(e.positionSlotUserInfo.checkInAt.toLocal(),r?da.ShortDateTime:da.DateTime))}):(0,i.jsx)(Lm,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:n("non_point_42145")}),(0,i.jsxs)(Xl,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===Be.Waiting&&(0,i.jsx)(yc,{size:"sm",onClick:async()=>{await a({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:We.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:n("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===Be.CheckedIn&&(0,i.jsx)(yc,{color:"white",size:"sm",onClick:async()=>{await a({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:We.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:n("d_pointer_25328")}),(0,i.jsx)(Hw,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},Zw=(0,de.createContext)({}),Kw=e=>{const{data:n}=tr({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[t,s]=(0,de.useState)(e.volunteerRegistration.positionsSlotsUsersInfos),o=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(t.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[t]),a=(0,de.useCallback)(e=>{s(n=>n.filter(n=>n.id!==e))},[s]),r=(0,de.useCallback)(async n=>{const i=t.find(e=>e.id===n),{event:{volunteerRegistration:{positionSlotUserInfo:o}}}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[Ko.UserPositionSlotUserInfoFragment]})}({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,positionSlotId:i.positionSlot.id},{token:await fe()});s(e=>e.map(e=>e.id===n?o:e))},[e.eventId,e.volunteerRegistration,t,s]);return(0,i.jsx)(Zw.Provider,{value:{assignedCategories:o,assignedPsuis:t,canCheckIn:e.canCheckIn,canDelete:e.canDelete,formsUsersInfos:n.organization?.userInfo.formsUsersInfos??[],onAssignedPsuiDelete:a,reloadCheckIn:r},children:e.children})};function Xw(){return(0,de.useContext)(Zw)}const Qw=()=>{const{assignedCategories:e,assignedPsuis:n,canCheckIn:t,canDelete:s,onAssignedPsuiDelete:o,reloadCheckIn:a}=Xw(),r=(0,de.useMemo)(()=>(0,l.A)(n,e=>e.positionCategory.id),[n]);return(0,i.jsx)(CA,{children:e.map(e=>{const n=r[e.id]??p;return(0,i.jsx)(bA,{category:e.name,children:n.map(e=>(0,i.jsx)(Yw,{canCheckIn:"function"==typeof t?t(e.positionCategoryId,e.position.id):t,canDelete:s(e.positionCategoryId,e.position.id),positionSlotUserInfo:e,reloadCheckIn:a,onDelete:o},e.id))},e.id)})})},Jw=e=>(0,i.jsxs)(Xl,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Zr,{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??Zu.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),w(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Xl,{justify:"center",children:e.button})]})]}),e$=({message:e,title:n})=>(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n}),(0,i.jsx)(Oc,{children:e})]});function n$(e,n,t,i){return(0,Tg.A)(e.map(e=>{const s=e.positions.map((s,o)=>({name:s.name,category:s.category.name,range:s.range?n.toDisplayString(s.range):"-",path:Eo.POSITION({organizationId:t,eventId:i,positionId:s.id}),form:e.form,rank:o+1})),o=e.positionsCategories.map((s,o)=>({name:s.name,category:"",range:s.range?n.toDisplayString(s.range):"-",path:Eo.POSITION_CATEGORY({organizationId:t,eventId:i,positionCategoryId:s.id}),form:e.form,rank:o+1})),a=e.positionsSlots.map((n,s)=>({name:n.position.name,category:n.positionCategory.name,range:n.nameOrRange,path:Eo.POSITION({organizationId:t,eventId:i,positionId:n.position.id}),form:e.form,rank:s+1}));return s.concat(o).concat(a)}).flat(),[e=>e.form.name,(e,n)=>n])}const t$=({editDisabled:e,eventId:n,form:t,organizationId:s})=>{const o=cs();return(0,i.jsx)(Lm,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||o.push(Ks.FORM_ELEMENTS({organizationId:s,eventId:n??void 0,formId:t.id}))},children:t.name})},i$=({canMemberAssign:e,editPath:n,formsUsersInfos:t,isEditDisabled:s=!1})=>{const{history:o,params:{organizationId:a,eventId:r},translate:d}=fc(),l=ss(Nh),c=(0,de.useMemo)(()=>n$(t,l,a,r),[t]),u=Cg();return(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[s&&(0,i.jsx)(e$,{message:d("you_are_already_assigned_to_missions"),title:d("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)($g,{filters:e&&w(n)&&(0,i.jsx)(yc,{color:"white",disabled:s,size:"sm",to:n,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:d("nom_de_la_missi_64605")}),!u&&(0,i.jsx)(Mg,{children:d("Date")}),!u&&(0,i.jsx)(Mg,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:f(c)?c.map((e,n)=>(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"start",direction:"column",gap:"1",justify:"center",children:[w(e.category)&&(0,i.jsx)(Zr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray900 textSm medium",onClick:()=>{o.push(e.path)},children:e.name}),e.form.positionRanking===Cn.Ranked&&(0,i.jsx)(Zr,{color:"gray500",children:d("choix_n_1_00613",e.rank)}),u&&(0,i.jsx)(Zr,{color:"gray500",children:e.range})]}),!u&&(0,i.jsx)(_g,{children:e.range}),!u&&(0,i.jsx)(_g,{children:(0,i.jsx)(t$,{editDisabled:s,eventId:r,form:e.form,organizationId:a})})]},n)):(0,i.jsx)(Eg,{css:{height:"200px"},children:(0,i.jsx)(_g,{children:(0,i.jsx)(Jw,{title:d("aucune_mission_61179")})})})}),setOffset:Ou.A,title:d("missions_souhai_23225"),totalCount:0})]})},s$=()=>{const{formsUsersInfos:e}=Xw();return(0,i.jsx)(Xl,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(i$,{canMemberAssign:!1,formsUsersInfos:e})})},o$=e=>{const{translate:n}=fc();return(0,i.jsx)(Kw,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:n("missions_de_1_99317",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(xI,{css:{padding:"0"},children:(0,i.jsxs)(TC,{height:1,children:[(0,i.jsxs)(wC,{center:!0,children:[(0,i.jsx)(EC,{path:`${e.basePath}/assigned`,children:n("attribu_es_48167")}),(0,i.jsx)(EC,{path:`${e.basePath}/wished`,children:n("souhait_es_78101")})]}),(0,i.jsx)($C,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Qw,{})}),(0,i.jsx)($C,{path:`${e.basePath}/wished`,children:(0,i.jsx)(s$,{})})]})})]})})},a$=(0,de.createContext)({}),r$=e=>{const{data:n,loader:t}=rs("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},[Ko.UserInfoTeamRightPanelFragment],undefined);const{mutate:s}=vr(),[o,a]=(0,de.useState)([]),r=(0,de.useMemo)(()=>{const e=o.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(n=>({...n,position:(0,Qr.A)(e,["id","name","icon","color"])}))))),n=o.flatMap(e=>e.positions.flatMap(e=>e.slots.map(n=>({...n,position:(0,Qr.A)(e,["id","name","icon","color"])})))),t=o.flatMap(e=>e.positionsSlots);return(0,wh.A)(e.concat(n).concat(t),e=>e.id)},[o]),d=(0,de.useMemo)(()=>(0,wh.A)(o.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[o]),l=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(r.concat(d),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[r,d]),c=(0,de.useMemo)(()=>Object.fromEntries(o.map(e=>{const n=(0,Zo.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,n]})),[o]),u=(0,de.useMemo)(()=>Object.fromEntries(o.map(e=>{const n=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,n]})),[o]),m=(0,de.useCallback)(async(n,t)=>{await s({eventId:e.eventId,massAssign:{positionsSlotsIds:[t],selecteds:{ids:[n]},strategy:Dn.Add}});const{event:i}=await function(e,n={}){return xa("query TeamRightPanelMember($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...UserInfoTeamRightPanel\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:n},{token:await fe()});a(e=>e.map(e=>e.userInfo.id===n?i.volunteerRegistration:e))},[e.eventId,a]);return(0,de.useEffect)(()=>{a(n.event?.team?.members??[])},[n.event,a]),(0,i.jsx)(a$.Provider,{value:{allSlots:l,form:n.event?.team?.form,loader:t,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:o,assign:m},children:e.children})};function d$(){return(0,de.useContext)(a$)}const l$=e=>{const{translate:n}=fc(),{assign:t,memberIdToAssignedSlotsIds:s,memberIdToWishedSlotsIds:o}=d$(),[a,r]=(0,de.useState)(!1),d=!0===s[e.member.userInfo.id]?.includes(e.slot.id),l=!0===o[e.member.userInfo.id]?.includes(e.slot.id);return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(MC,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)(_g,{justify:"end",children:d?(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:"success500",children:(0,i.jsx)(pc,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:n("d_j_affect_71706")})]}):l?(0,i.jsx)(yc,{isLoading:a,size:"sm",onClick:()=>{r(!0),t(e.member.userInfo.id,e.slot.id)},children:n("affecter_94255")}):(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:"error500",children:(0,i.jsx)(pc,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:n("non_souhait_46147")})]})})]})},c$=e=>{const{translate:n}=fc(),{members:t}=d$(),s=ss(Nh),o=(0,de.useMemo)(()=>Gh(s,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Xl,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(UI,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(Zr,{color:"gray500",children:o})]})]}),(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("full_name")}),(0,i.jsx)(Mg,{})]}),t.map(n=>(0,i.jsx)(l$,{member:n,slot:e.slot},n.userInfo.id))]})]})},u$=()=>{const{allSlots:e}=d$();return(0,i.jsx)(Xl,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(c$,{slot:e},e.id))})},m$=e=>{const{translate:n}=fc(),{form:t,loader:s}=d$();return(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{children:n("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:n("formulaire_1_39637",t?.name)})]})}),(0,i.jsx)(xI,{css:{background:"$gray50",py:"$6"},children:s||(0,i.jsx)(u$,{})})]})},g$=e=>(0,i.jsx)(r$,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(m$,{...e})}),h$=({editPath:e,eventId:n,organizationId:t,formsUsersInfos:s,showEditButton:o,isEditDisabled:a=!1})=>{const{translate:r}=fc(),d=ss(Wg),l=ss(Nh),c=(0,de.useMemo)(()=>(0,Tg.A)(s.flatMap(e=>e.slots.map(n=>({range:n.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[s]),u=Cg(),m=(0,de.useCallback)((e,n)=>{switch(n){case at.Calendar:case at.DisplayDays:return(0,i.jsx)(Zr,{children:d.toLocaleString(e.start,da.DateOnly.MonthLong)});case at.Display:case at.Custom:return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{css:{lineHeight:"20px"},children:l.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(Zr,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:l.toDisplayString(e,{hideDate:!0})})]});case at.Hide:return null;default:return Ic()}},[]);return(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[a&&(0,i.jsx)(e$,{message:r("you_are_already_assigned_to_missions"),title:r("availabilities_can_no_longer_be_changed")}),(0,i.jsx)($g,{filters:o&&(0,i.jsx)(yc,{color:"white",disabled:a,size:"sm",to:e,children:r("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:r("Date")}),!u&&(0,i.jsx)(Mg,{children:r("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:f(c)?c.map((e,s)=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:m(e.range,e.display)}),!u&&(0,i.jsx)(_g,{children:(0,i.jsx)(t$,{editDisabled:a,eventId:n,form:e.form,organizationId:t})})]},s)):(0,i.jsx)(Eg,{css:{height:"200px"},children:(0,i.jsx)(_g,{children:(0,i.jsx)(Jw,{title:r("aucune_disponib_15602")})})})}),setOffset:Ou.A,title:r("disponibilit_s_49923"),totalCount:0})]})},p$=e=>{const n=os(),{data:t,loader:s}=xr({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[o],isLoading:a}=pw(cw({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(fI,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(YC,{children:n("disponibilit_s_49923")}),(0,i.jsx)(xI,{children:s||a?s:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(h$,{editPath:Wo.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:t.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:o}),(0,i.jsx)(ic,{height:"6"})]})})]})},I$=e=>{const{history:n,params:{organizationId:t}}=fc();return(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(kw,{basePath:e.accreditationsPanelPath,canDeleteCheckedIn:e.canDeleteCheckedIn,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:e.canWishedAccreditationsEdit,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegation?.id,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),n.goBack(e.returnPathFallback)}})}),(0,i.jsx)(Xr.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(p$,{delegationId:e.delegation?.id,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),e.informationPanelPath&&e.delegation&&(0,i.jsx)(Xr.qh,{path:e.informationPanelPath,children:(0,i.jsx)(Ww,{delegation:e.delegation,organizationId:t,returnPathFallback:e.informationPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(Xr.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(o$,{basePath:e.positionsPanelPath,canCheckIn:e.canCheckIn,canDelete:e.canDeletePosition,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),n.goBack(e.returnPathFallback)}})}),(e.teamsPanelsPath||[]).map((t,s)=>{const o=e.volunteerRegistration.teams?.[s];return o?(0,i.jsx)(Xr.qh,{path:t,children:(0,i.jsx)(g$,{eventId:e.eventId,teamCode:o.teamCode,onClose:()=>{e.reloadRow(),n.goBack(e.returnPathFallback)}})},s):null})]})},f$=e=>{const n=os(),[t,s]=(0,de.useState)(!1),o=(0,de.useCallback)(async()=>{let n=!0;return s(!0),await e.onDelete(),n&&s(!1),()=>{n=!1}},[e.onDelete,t,s]);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(Xl,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(pc,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&I(e.subtext).map((e,n)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:e})]},n)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{color:"error",isLoading:t,onClick:o,children:e.buttonText}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},x$=e=>(0,i.jsx)(Zr,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),_$=Nr("div",{display:"flex",flexDirection:"column","& + &":{borderTop:"1px solid $gray100"}}),j$=e=>de.Children.toArray(e).some(e=>(0,de.isValidElement)(e)&&e.type===de.Fragment?j$(e.props.children):Boolean(e)),v$=e=>j$(e.children)?(0,i.jsxs)(_$,{"aria-label":e.title,role:"group",children:[w(e.title)&&(0,i.jsx)(x$,{children:e.title}),e.children]}):null,S$=e=>{const{translate:n,params:{eventId:t,delegationId:s}}=fc(),{mutate:o}=Ir(),[a,r]=(0,de.useState)(1),[d,l]=(0,de.useState)(!1);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"clone",children:n("dupliquer_un_me_90016")}),(0,i.jsx)(Gf,{children:(0,i.jsx)(hu,{label:n("nombre_de_copie_37518"),min:1,shouldParseAsInt:!0,value:a,onChange:r})}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:d,onClick:async()=>{l(!0),await o({eventId:t,delegationId:s,selecteds:{ids:[e.userInfoId]},numberOfCopies:a}),e.onClose(),e.reload()},children:n("dupliquer_1_94438",e.name)})})]})})},y$=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),{user:a}=ps(),{mutate:r}=_r(),{mutate:d}=Ja(),{mutate:l}=or(),[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(!1),[h,p]=(0,de.useState)(!1),I=(0,de.useMemo)(()=>e.customDocuments.filter(n=>Ep(n.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),x=s&&e.canMemberAccredit&&e.accreditationState===Re.WaitingAccreditation,_=s&&e.showDocumentsDownload&&void 0!==e.member.links&&f(e.allowedCustomDocuments),j=_?e.allowedCustomDocuments.map((t,s)=>{const o=I.find(e=>e.slug===t);return o?(0,i.jsx)(Em,{download:`${e.member.nameOrEmail}-${o.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:Ex(e.member.links?.userCustomDocumentLinks[t],"pdf",{lang:a?.language}),children:n("t_l_charger_1_80752",o.name)},s):ei.includes(t)?(0,i.jsx)(Em,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:Ex(e.member.links?.userCustomBadgeLinks[t],"pdf",{lang:a?.language}),children:n("t_l_charger_1_80752",fj(t))},s):null}):[];return x||_||e.canDuplicate||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(v$,{children:x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Em,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,selecteds:{ids:[e.member.id]}}),e.reload()},children:n("valider_les_acc_80801")}),(0,i.jsx)(Em,{icon:"badge-check",to:Wo.ACCREDIT(t,s,e.member.id),children:n("accr_diter_70543")})]}):null}),(0,i.jsx)(v$,{children:j}),(0,i.jsxs)(v$,{children:[e.canDuplicate&&(0,i.jsx)(Em,{icon:"clone",onClick:()=>u(!0),children:n("dupliquer_28256")}),e.canDelete&&(0,i.jsx)(Em,{color:"red",icon:"user-xmark",onClick:()=>g(!0),children:n("retirer_de_la_d_64963")})]}),(0,i.jsx)(v$,{children:e.showDeleteFromEvent&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>p(!0),children:n("delete_from_eve_69290")})})]}),m&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_sur_d_88752")],text:n("suppression_de_73669",e.member.nameOrEmail),onClose:()=>g(!1),onDelete:async()=>{await d({organizationId:t,eventId:s,delegationId:o,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),e.canDuplicate&&c&&(0,i.jsx)(S$,{name:e.member.nameOrEmail,reload:e.reload,userInfoId:e.member.id,onClose:()=>u(!1)}),h&&e.volunteerRegistrationId&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:[n("are_you_sure_yo_46668")],text:n("suppression_de_73669",e.member.nameOrEmail),onClose:()=>p(!1),onDelete:async()=>{await l({eventId:s,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null},C$=({displayName:e,isAddDeleteVisible:n,isResetVisible:t,massEditFieldInput:s,reset:o,strategy:a,change:r})=>{const{translate:d}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:d("que_souhaitez_v_87607")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:o||a!==Dn.Replace?"unchecked":"checked",onClick:()=>{r("massEdit.reset",!1),r("massEdit.strategy",Dn.Replace)},children:d("remplacer_les_v_78885")}),!o&&a===Dn.Replace&&s,(0,i.jsx)(ic,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eg,{state:o||a!==Dn.Add?"unchecked":"checked",onClick:()=>{r("massEdit.reset",!1),r("massEdit.strategy",Dn.Add)},children:d("ajouter_des_val_80159")}),!o&&a===Dn.Add&&s,(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:o||a!==Dn.Delete?"unchecked":"checked",onClick:()=>{r("massEdit.reset",!1),r("massEdit.strategy",Dn.Delete)},children:d("supprimer_des_v_96120")}),!o&&a===Dn.Delete&&s,(0,i.jsx)(ic,{height:"3"})]}),t&&(0,i.jsx)(eg,{state:o?"checked":"unchecked",onClick:()=>r("massEdit.reset",!0),children:d("r_initialiser_42983",e)})]})},b$=e=>{const n=os(),t=ss(Ub),s=(0,de.useMemo)(()=>(0,Tg.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),o=(0,de.useMemo)(()=>(0,Tg.A)([...s.map(e=>({slug:e.slug,name:e.name,label:e.label})),...e.properties.map(e=>({slug:e,name:n(e),label:null}))],e=>e.name.toLowerCase()),[s,e.properties]);return(0,i.jsx)(Jg,{size:"md",onClose:e.onClose,children:(0,i.jsx)(ld.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:Dn.Replace}},initialValuesEqual:dd.A,render:({form:t,handleSubmit:a,submitting:r,values:d})=>{const{reset:l,slug:c,strategy:u}=d.massEdit,m=o.find(e=>e.slug===c),g=s.find(e=>e.slug===c),h=w(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(nA,{campaigns:e.campaigns,categories:e.categories,change:t.change,customDocuments:e.customDocuments,customField:g,delegationsSpaceLayouts:e.delegationsSpaceLayouts,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:d.massEdit.value})})]}):null,p=c===Ae.Tag||c===Xe.Campaigns||c===Xe.Documents||!0===g?.canSelectMultiple,I=c!==Ae.Category&&c!==Ye.Category&&c!==Xe.Category&&c!==Un.Category&&c!==Un.Layer&&c!==Un.Zoom&&c!==Ae.WeezeventIsSynchronized&&c!==Ye.Privacy&&c!==Xe.Form&&c!==Xe.IsLocked&&c!==Xe.ShowFormLinkInDelegationSpace&&c!==Xe.ShowInDelegationSpace&&c!==Xe.CanLeadersAddMembers&&c!==Xe.CanLeadersEditCustomFields&&c!==Xe.CanLeadersEditMembers&&c!==Xe.CanLeadersDeleteMembers&&c!==Xe.CanLeadersDuplicateMembers&&c!==Xe.CanLeadersEditColumns&&c!==Xe.CanLeadersImportMembers&&c!==Xe.CanLeadersSeeHiddenAccreditationsSlots&&c!==Xe.ShowAllAccreditations&&c!==Un.WeezeventIsSynchronized&&c!==Tt.Frequency&&c!==Tt.State;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"sliders"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("_dition_de_la_v_67585")}),(0,i.jsx)(ic,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("quel_est_le_cha_81138"),name:"massEdit.slug",placeholder:n("s_lectionnez_un_82446"),children:o.map(e=>(0,i.jsx)("option",{value:e.slug,children:pb(e)},e.slug))}),m&&(0,i.jsx)(C$,{change:t.change,displayName:m.name,isAddDeleteVisible:p,isResetVisible:I,massEditFieldInput:h,reset:l,strategy:u}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:(f=d.massEdit,x=g,!(f.reset||!x||x.fieldType!==_n.Select||x.canSelectMultiple||"number"==typeof f.value&&!isNaN(f.value))),isLoading:r,onClick:a,children:n("modifier_la_val_07602")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]});var f,x},validate:e=>{const n=s.find(n=>n.slug===e.massEdit.slug),i=n&&!e.massEdit.reset?t.getValidationRuleError(n,e.massEdit.value):null;return i?{massEdit:{value:i}}:{}},onSubmit:async n=>{const t=(await e.mutate(n.massEdit)).numberOfEdited;e.onSuccess(t),e.onClose()}})})},A$=e=>{const{data:n,isLoading:t}=rs("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: Position\n sort: { attribute: Name, direction: Asc }\n ) {\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},[Ko.MassEditCustomFieldFragment],undefined);const s=(0,de.useMemo)(()=>bi.filter(e=>e!==Un.Name),[]);return(0,i.jsx)(b$,{campaigns:[],categories:n.event?.positionsCategories??[],customDocuments:[],customFields:n.organization?.customFields.nodes??p,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:n.organization?.tags.nodes??[],traces:n.event?.traces??[],onClose:e.onClose,onSuccess:e.onSuccess})},E$=e=>{const{data:n,isLoading:t}=rs("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: Accreditation\n sort: { attribute: Name, direction: Asc }\n ) {\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},[Ko.MassEditCustomFieldFragment],undefined);const s=(0,de.useMemo)(()=>Gt.filter(e=>e!==Ae.Name),[]);return(0,i.jsx)(b$,{campaigns:[],categories:n.event?.accreditationsCategories??[],customDocuments:[],customFields:n.organization?.customFields.nodes??p,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:n.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},w$=e=>{const{data:n,isLoading:t}=rs("query AccreditationsProfilesMassEditInfos($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n }\n }\n}\n",{eventId:e.eventId},[],undefined);const s=(0,de.useMemo)(()=>qt.filter(e=>e!==$e.Name),[]);return(0,i.jsx)(b$,{campaigns:[],categories:n.event?.accreditationsProfilesCategories??[],customDocuments:[],customFields:p,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},$$=e=>{const{data:n,isLoading:t}=(s={organizationId:e.organizationId},rs(ja,s,[],undefined));var s;const o=(0,de.useMemo)(()=>ni.filter(e=>e!==Ye.Label&&e!==Ye.Name),[]);return(0,i.jsx)(b$,{campaigns:[],categories:n.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:p,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},T$=e=>{const{data:n,isLoading:t}=(s={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},rs(va,s,[Ko.MassEditCustomFieldFragment],undefined));var s;const o=(0,de.useMemo)(()=>ii.filter(e=>e!==Xe.Name&&e!==Xe.Columns&&e!==Xe.Parent),[]);return(0,i.jsx)(b$,{campaigns:n.organization?.campaigns.nodes??[],categories:n.organization?.delegationsCategories.nodes??[],customDocuments:n.organization?.event?.customDocuments??[],customFields:n.organization?.customFields.nodes??p,delegationsSpaceLayouts:n.organization?.event?.delegationsSpaceLayouts??[],forms:n.organization?.forms.nodes??[],isLoading:t,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:n.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},z$=e=>{const{data:n,isLoading:t}=rs("query UsersInfosMassEditInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ko.MassEditCustomFieldFragment],undefined);return(0,i.jsx)(b$,{campaigns:[],categories:[],customDocuments:[],customFields:n.organization?.customFields.nodes??p,delegationsSpaceLayouts:[],forms:[],isLoading:t,mutate:e.mutate,properties:p,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},O$=e=>(0,i.jsx)(b$,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,delegationsSpaceLayouts:[],forms:[],isLoading:!1,mutate:e.mutate,properties:p,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess}),R$=e=>{const n=(0,de.useMemo)(()=>qi.filter(n=>n!==Tt.Name&&(e.canAccessBackoffice||n!==Tt.Frequency)),[e.canAccessBackoffice]);return(0,i.jsx)(b$,{campaigns:[],categories:[],customDocuments:[],customFields:p,delegationsSpaceLayouts:[],forms:[],isLoading:!1,mutate:e.mutate,properties:n,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})};var D$;let M$=class extends ju{translationService;constructor(e){super(e),this.translationService=e}step1Schema(){return Jl.Ik().shape({[this.inputName]:Jl.Ik().shape(this.step1Fields())})}step2Schema(){return Jl.Ik().shape({[this.inputName]:Jl.Ik().shape(this.step2Fields())})}schema(){return Jl.Ik().shape({...this.step1Fields(),...this.step2Fields()})}strategyField(e=vi){return Jl.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(e,this.t("la_strat_gie_es_82287"))}};M$=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(D$=void 0!==ts&&ts)?D$:Object])],M$);var P$;let k$=class extends M${translationService;inputName="massAccredit";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsSlotsIds:Jl.YO().of(Jl.ai()).required(this.t("vous_devez_s_le_72138")).when("accreditationProfile",{is:e=>!e,then:e=>e.min(1,this.t("vous_devez_s_le_72138"))})}}};k$=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(P$=void 0!==ts&&ts)?P$:Object])],k$);const F$=e=>(0,hd.createPortal)((0,i.jsx)(Zr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),N$=({children:e,handleSubmit:n,nextText:t,prefix:s,strategies:o})=>{const a=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:a("que_souhaitez_v_87607")}),o.map(({label:e,value:n})=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:`${s}strategy`,value:n,children:e})]},n)),e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),e]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:n,children:t})})]})},L$=e=>{const n=os();return(0,i.jsx)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_accr_25709"),prefix:"massAccredit.",strategies:[{label:n("ajouter_des_acc_17744"),value:Dn.Add},{label:n("remplacer_les_a_92733"),value:Dn.Replace},{label:n("supprimer_des_a_04246"),value:Dn.Delete}]})};var U$=t(9120);const V$=e=>(0,Tg.A)(e,e=>e.toMillis()),B$=Nr("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:"$primary500",color:"white"}}},isSelected:{true:{background:"$primary500",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary500",color:"white",cursor:"pointer"}}]}),W$=({datesToTitle:e,disabledDates:n,firstDayOfMonth:t,max:s,min:o,onChange:a,startHour:r,values:d})=>{const l=os(),c=ss(Wg),u=(0,de.useMemo)(()=>t.minus({day:t.weekday-1}),[t]),m=(0,de.useMemo)(()=>t.endOf("month"),[t]),g=(0,de.useMemo)(()=>{const e=m.plus({day:7-m.weekday});return Math.ceil(e.diff(u,"days").days)},[m]),h=(0,de.useMemo)(()=>(0,Sg.A)(0,g).map(e=>{const i=u.plus({day:e}).set({hour:r||0}),a=i.toMillis(),l=d.some(e=>e.toMillis()===a),c=!!f(n)&&n.some(e=>e.toMillis()===a);return{day:i,isSelected:l,isDisabled:c,isSelectable:!c&&i.month===t.month&&i>=o&&i<=s}}),[u,g,d,n,r]),p=(0,de.useMemo)(()=>!h.some(({isSelectable:e,isSelected:n})=>e&&!n),[h]),I=(0,de.useCallback)(()=>{a(p?[]:h.flatMap(({day:e,isSelectable:n,isSelected:t})=>n||t?[e]:[]))},[h,p,a]);return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:c.toLocaleString(t,{month:"long",year:"numeric"})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Wu,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,Sg.A)(0,7).map(e=>{const n=u.plus({day:e});return(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:c.toLocaleString(n,{weekday:"short"})},e)})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Wu,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:h.map(({day:n,isSelected:t,isSelectable:s},o)=>(0,i.jsx)(B$,{isSelectable:s,isSelected:t,title:e?.[n.toMillis()],onClick:e=>{if(s&&t)a(V$((0,U$.A)(d,[n],e=>e.toMillis())));else if(s&&!t){const t=d.findLast(e=>et.plus({day:e+1}));a(V$([...d,...i]))}else a(V$([...d,n]))}},children:n.day},o))}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(yc,{color:"white",textAlign:"center",onClick:I,children:l(p?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})};function G$(e,n,t){const i=t-n;return i<=0?e("quota_atteint_12838"):e("quota_1_2_23970",n,t,i)}const q$=e=>{const{translate:n}=fc();return(0,de.useMemo)(()=>{const t=e.getAssignedMaxRemaining(e.slotId);return t?t.remaining<=0?(0,i.jsx)(Lm,{color:"error",leftIcon:"circle-xmark",size:"sm",children:G$(n,t.assignedResources,t.maxResources)}):(0,i.jsx)(Lm,{color:"white",size:"sm",children:G$(n,t.assignedResources,t.maxResources)}):null},[e.slotId,e.getAssignedMaxRemaining,n])},H$=e=>{const{translate:n}=fc(),{minDate:t,maxDate:s,numberOfMonths:o,totalDaysDiff:a}=(0,de.useMemo)(()=>function(e){const n=e.filter(e=>e.date?.isValid),t=(0,$h.A)(n.map(e=>e.date),e=>e.toMillis()),i=(0,Th.A)(n.map(e=>e.date),e=>e.toMillis()),s=Math.ceil(i.endOf("month").diff(t.startOf("month"),"months").months),o=Math.ceil(i.diff(t,"days").days);return{minDate:t,maxDate:i,numberOfMonths:s,totalDaysDiff:o}}(e.slots),[e.slots]),r=(0,de.useMemo)(()=>e.slots.flatMap(n=>n.date?.isValid&&e.accreditationsSlotsIds.includes(n.id)?[n.date]:[]),[e.slots,e.accreditationsSlotsIds]),d=(0,de.useMemo)(()=>(0,Sg.A)(0,a).flatMap(n=>{const i=t.plus({day:n});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[t,a,e.slots]),l=(0,de.useMemo)(()=>Object.fromEntries(e.slots.flatMap(t=>{const i=e.slotIdToDas?.[t.id];return t.date?.isValid&&"number"==typeof i?.maxResources?[[t.date.toMillis(),G$(n,i.assignedResources,i.maxResources)]]:[]})),[e.slotIdToDas,e.slots,n]);return(0,i.jsx)(Xl,{gap:"4",wrap:"wrap",children:(0,Sg.A)(0,o).map(n=>{const a=t.plus({month:n}).startOf("month"),c=0===n?t:a,u=n===o-1?s:a.endOf("month"),m=r.filter(e=>e.startOf("month").equals(a));return(0,i.jsx)(W$,{datesToTitle:l,disabledDates:d,firstDayOfMonth:a,max:u,min:c,values:m,onChange:n=>{e.onChange(function(e,n,t,i){const s=(0,Wm.A)(e,n.flatMap(e=>e.date?.isValid&&t.equals(e.date.startOf("month"))?[e.id]:[]));return n.flatMap(e=>i.some(n=>e.date?.isValid&&n.startOf("day").equals(e.date.startOf("day")))?[e.id]:[]).concat(s)}(e.accreditationsSlotsIds,e.slots,a,n))}},n)})})},Y$=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return f(t)?(0,i.jsx)(H$,{...e,slots:t}):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})},Z$=e=>{const{translate:n}=fc(),t=ss(vS),s=(0,de.useMemo)(()=>ip(e.accreditation),[e.accreditation]),o=(0,de.useMemo)(()=>e.das?.assignedResources??e.slot.assignedResources,[e.das,e.slot]),a=(0,de.useMemo)(()=>e.das?.maxResources??e.slot.maxResources,[e.das,e.slot]),r=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===r)},children:[(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:r,onClick:Ou.A}),(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Xl,{css:{px:"$3"},width:310,children:(0,i.jsx)(Lm,{color:o>=(a||1/0)?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",o,t.toNumberOrInfinity(a))})})]})},K$=e=>{const n=os(),t=ss(Wg),s=ss(vS),o=(0,de.useMemo)(()=>e.das?.assignedResources??e.slot.assignedResources,[e.das,e.slot]),a=(0,de.useMemo)(()=>e.das?.maxResources??e.slot.maxResources,[e.das,e.slot]),r=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Eg,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===r)},children:[(0,i.jsx)(_g,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:r,onClick:Ou.A}):(0,i.jsx)(Jm,{shouldPreventDefault:!1,state:r,onClick:Ou.A})}),(0,i.jsx)(_g,{children:w(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(_g,{children:e.slot.date?.isValid?t.toLocaleString(e.slot.date,da.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{color:o>=(a||1/0)?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",o,s.toNumberOrInfinity(a))})})]})},X$=e=>{const n=os(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.slots.filter(n=>n.accreditation.id===e.accreditation.id),e=>(0,sc.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),s=(0,de.useMemo)(()=>t.map(e=>e.id),[t]),o=(0,de.useMemo)(()=>Object.fromEntries(e.delegationAccreditationsSlots.map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),a=(0,de.useMemo)(()=>{const n=(0,tg.A)(e.accreditationsSlotsIds,s);return n.length===s.length?"checked":0===n.length?"unchecked":"indeterminate"},[s,e.accreditationsSlotsIds]),r=(0,de.useCallback)((n,t)=>{if(e.accreditation.accreditationDisplay===be.Radio){const i=(0,Wm.A)(e.accreditationsSlotsIds,s).concat(t?[n]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",j(e.accreditationsSlotsIds,n,t))},[e.accreditation,e.accreditationsSlotsIds,e.change,s]),d=(0,de.useCallback)(n=>{e.change("massAccredit.accreditationsSlotsIds",n)},[e.change]),l=e.accreditation.accreditationDisplay===be.List||e.strategy===Dn.Delete,c=t[0];return e.accreditation.hasSlots?(0,i.jsx)(AA,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:t.length,children:e.accreditation.accreditationDisplay===be.Calendar?(0,i.jsx)(Xl,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(Y$,{accreditationsSlotsIds:e.accreditationsSlotsIds,slots:t,onChange:d})}):(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{justify:"center",width:48,children:l&&(0,i.jsx)(Ym,{state:a,onClick:n=>{"checked"===n?e.change("massAccredit.accreditationsSlotsIds",(0,Zo.A)(e.accreditationsSlotsIds.concat(s))):e.change("massAccredit.accreditationsSlotsIds",(0,Wm.A)(e.accreditationsSlotsIds,s))}})}),(0,i.jsx)(Mg,{children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(Mg,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Mg,{})]}),t.map(n=>(0,i.jsx)(K$,{accreditationsSlotsIds:e.accreditationsSlotsIds,das:o[n.id]??null,shouldDisplayList:l,slot:n,onClick:r},n.id))]})}):c?(0,i.jsx)(Z$,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,das:o[c.id]??null,slot:c,onClick:r}):null},Q$=e=>{const n=(0,de.useMemo)(()=>rp(e.accreditations.filter(n=>n.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(bA,{category:e.category.name,children:n.map(n=>(0,i.jsx)(X$,{accreditation:n,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,slots:e.slots,strategy:e.strategy},n.id))})},J$=e=>{const n=os();return(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)($m,{children:(0,i.jsx)(Zr,{children:(0,i.jsxs)(yc,{color:e.color,leftIcon:"bars-filter",children:[n("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(wm,{placement:"bottom-end",width:385,children:(0,i.jsxs)(Xl,{direction:"column",onChange:Uc,children:[(0,i.jsxs)(Xl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:n("r_initialiser_77538")}),(0,i.jsx)(yc,{size:"sm",onClick:e.apply,children:n("appliquer_05753")})]})]})})]})},eT=e=>{const n=os(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(e.excludeEmpty?"checked":"unchecked"),[r,d]=(0,de.useState)(e.excludeFull?"checked":"unchecked"),[l,c]=(0,de.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(Xl,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_65646"),value:e.name,onChange:n=>{e.setName(n)}})}),(0,i.jsxs)(J$,{apply:()=>{e.setExcludeEmpty("checked"===o),e.setExcludeFull("checked"===r),e.setExcludePast("checked"===l),s(!1)},color:"white",isOpen:t,numberOfAppliedFilters:u,reinit:()=>{e.setExcludeEmpty(!1),a("unchecked"),e.setExcludeFull(!1),d("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(Zm,{state:o,onClick:a,children:n("cacher_les_cr_n_76382")}),(0,i.jsx)(Zm,{state:r,onClick:d,children:n("cacher_les_cr_n_31908")}),(0,i.jsx)(Zm,{state:l,onClick:c,children:n("masquer_les_cr_05336")})]})]})},nT=e=>{const n=os(),[t,s,o]=Dg(""),[a,r]=(0,de.useState)(!1),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(!1),{data:m,loader:g}=rs("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 delegation: delegationMaybe(id: $delegationId) {\n accreditationsSlots {\n accreditationSlotId\n assignedResources\n maxResources\n }\n }\n\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 accreditationId\n name\n assignedResources\n maxResources\n date\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n accreditationCategoryName\n name\n accreditationDisplay\n hasSlots\n color\n icon\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:w(s)?s:void 0,excludeEmpty:a,excludeFull:d,excludePast:c},[],undefined);const h=(0,de.useMemo)(()=>(m.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[m.event]),p=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(h.map(e=>e.accreditationCategory),e=>e.id),e=>b(e.name)),[h]),I=(0,de.useMemo)(()=>(0,wh.A)(h.map(e=>e.accreditation),e=>e.id),[h]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eT,{excludeEmpty:a,excludeFull:d,excludePast:c,name:t,setExcludeEmpty:r,setExcludeFull:l,setExcludePast:u,setName:o}),(0,i.jsx)(ic,{height:"6"}),g||(0,i.jsx)(CA,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:p.map(n=>(0,i.jsx)(Q$,{accreditations:I,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:n,change:e.change,delegationAccreditationsSlots:m.event.delegation?.accreditationsSlots??[],slots:h,strategy:e.values.massAccredit.strategy},n.id))}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:w(e.buttonText)?e.buttonText:n(e.values.massAccredit.strategy===Dn.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===Dn.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},tT=({eventId:e,numberOfSelected:n,onClose:t,onSuccess:s,selecteds:o})=>{const a=os(),r=ss(k$),{mutate:d}=Ra();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:a("Accreditation"),heading:a("accr_diter_les_48281"),onClose:t,children:(0,i.jsx)(kx,{children:(0,i.jsxs)(fy,{initialValues:{massAccredit:{selecteds:o,strategy:Dn.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await d({eventId:e,massAccredit:n.massAccredit})).numberOfMembers;s(a("_1_membres_ont_05068",i)),t()},children:[(0,i.jsx)(Iy,{heading:a("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(L$,{handleSubmit:e}),schema:r.step1Schema()}),(0,i.jsx)(Iy,{heading:a("accr_ditations_39450"),render:({form:t,handleSubmit:s,submitting:o,values:a})=>(0,i.jsx)(nT,{change:t.change,delegationId:null,eventId:e,handleSubmit:s,numberOfSelected:n,submitting:o,values:a}),schema:r.step2Schema()})]})})})})},iT=e=>{const{history:n,translate:t}=fc(),{mutate:s,isLoading:a}=$r(),[r,d]=(0,de.useState)([]),l=f(r);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"people-group"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:t("SendCampaign")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:t("campagne_97871"),values:r,onChange:d,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)(ic,{height:"2"}),(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{const t=o(JSON.stringify({usersInfosIds:e.selecteds.ids}));n.push(Nv.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:t}))},children:t("cr_er_une_nouve_86635")})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:!l,isLoading:a,onClick:async()=>{if(f(r)){const n=e.campaigns.find(e=>e.id===r[0]),i=(await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,selecteds:e.selecteds,campaignId:r[0]})).numberOfMembers;e.onSuccess(t("la_campagne_1_62015",n.name,i)),e.onClose()}},children:t("envoyer_26609")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},sT=e=>{const{data:n}=rs("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?kn.Event:kn.Organization,eventId:e.eventId},[],undefined);return(0,i.jsx)(iT,{campaigns:n.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})},oT=e=>{const{translate:n}=fc(),{user:t}=ps(),{data:s,isLoading:o}=rs("query MassCustomDocumentPrintCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n id\n name\n slug\n shouldRegenerateTicketIdOnDownload\n }\n }\n}\n",{eventId:e.eventId},[],undefined);const a=ZE(),r=(0,de.useMemo)(()=>(0,wh.A)(s.event?.customDocuments??[],e=>e.slug).map(e=>({name:e.name,slug:e.slug,shouldRegenerateTicketIdOnDownload:(s.event?.customDocuments??[]).some(n=>n.slug===e.slug&&n.shouldRegenerateTicketIdOnDownload)})),[s.event]),[d,l]=(0,de.useState)(null),[c,u]=(0,de.useState)(""),m=r.find(e=>e.slug===d),g=e.numberOfSelected>50,[h,p]=(0,de.useState)(null),I=!g&&!!m?.shouldRegenerateTicketIdOnDownload,x=I&&(h??0)>0,_=o||g||!m||I&&null===h||x&&$(c.trim());return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"print",children:n("imprimer_un_document")}),(0,i.jsxs)(Gf,{gap:"5",children:[g&&(0,i.jsx)(Tc,{alertStyle:"error",children:(0,i.jsx)(Oc,{children:n("vous_ne_pouvez_pas_imprimer_plus",50)})}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("quel_document_voulez_vous_imprimer"),renderOnPortal:!0,values:d?[d]:[],onChange:e=>{f(e)&&(l(e[0]),p(null))},children:r.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))}),I&&m&&(0,i.jsx)(aT,{customDocumentSlug:m.slug,eventId:e.eventId,selecteds:e.selecteds,onLoad:p},m.slug),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"warning",children:(0,i.jsx)(Oc,{children:n("membres_ont_deja_imprime_ce_document",h)})}),(0,i.jsx)(Xx,{label:n("raison_de_l_imp_75064"),value:c,onChange:u})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:_,leftIcon:"print",onClick:()=>{m&&(a({eventId:e.eventId,selecteds:e.selecteds,sort:e.sort,customDocumentSlug:m.slug,reason:c,language:t?.language}).then(e.onSuccess).catch(e=>{console.error(`Could not print custom documents: ${String(e)}`)}),e.onClose())},children:n("print_37582")})})]})})},aT=e=>{const{data:n,isLoading:t}=rs("query MassCustomDocumentPrintReprintsCount(\n $eventId: EventId!\n $customDocumentSlug: String!\n $selecteds: MassActionSelectedsInput!\n) {\n event(id: $eventId) {\n customDocumentReprintsCount(customDocumentSlug: $customDocumentSlug, selecteds: $selecteds)\n }\n}\n",{eventId:e.eventId,customDocumentSlug:e.customDocumentSlug,selecteds:e.selecteds},[],undefined);return(0,de.useEffect)(()=>{t||e.onLoad(n.event.customDocumentReprintsCount)},[t,n]),null};var rT;let dT=class extends ju{translationService;constructor(e){super(e),this.translationService=e}default(e){return{...e,groupId:void 0,customDocumentId:void 0,eventDocumentId:void 0,zplDocumentId:void 0}}schema(){const e=this;return Jl.Ik().shape({input:Jl.Ik().shape({groupId:Jl.Yj().required(this.t("le_lieu_d_impre_60407")),customDocumentId:Jl.ai().nullable(),eventDocumentId:Jl.ai().nullable(),zplDocumentId:Jl.ai().nullable()}).test({name:"exactly-one-document",test:({customDocumentId:n,eventDocumentId:t,zplDocumentId:i},s)=>1===[n,t,i].filter(Boolean).length||s.createError({message:e.t("a_wristband_to_25340"),path:"input.zplDocumentId"})})})}};dT=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(rT=void 0!==ts&&ts)?rT:Object])],dT);const lT=e=>(0,i.jsx)(Xl,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),cT=({handleSubmit:e,isLoading:n=!1,isSubmitDisabled:t=!1,setIsOpen:s,submitStyle:o,submitText:a,...r})=>{const{translate:d}=fc();return(0,i.jsxs)(Xl,{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)(Xl,{align:"center",gap:"4",justify:"end",children:[(0,i.jsx)(yc,{color:"white",onClick:()=>s(!1),children:d("annuler_48254")}),(0,i.jsx)(yc,{color:o,disabled:t,isLoading:n,onClick:()=>e(),children:a??d("submit_21373")})]}),r.children]})},uT=({heading:e,leftIcon:n,leftIconColor:t,leftIconBorder:s,leftIconCss:o,setIsOpen:a,...r})=>{const{translate:d}=fc();return(0,i.jsxs)(Xl,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Xl,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[n&&(0,i.jsx)(Xl,{align:"center",css:{padding:"$3",bd:!0,border:s,...o},justify:"center",children:(0,i.jsx)(Xl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(pc,{className:"fa-xl",color:t,icon:n})})}),(0,i.jsx)(Xl,{css:{alignItems:"flex-start",flex:1},direction:"column",justify:"center",children:e})]}),(0,i.jsx)(Xl,{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)(yc,{"aria-label":d("close_dialog_50926"),color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>a(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]})},mT=({children:e,descId:n,labelId:t,isOpen:s,size:o,setIsOpen:a,...r})=>(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)(BI,{"aria-describedby":n,"aria-labelledby":t,"data-testid":"modal-body",isOpen:s,setIsOpen:a,style:{border:"none",borderRadius:"var(--radii-3)",padding:0,inlineSize:"70vw",blockSize:"fit-content",maxWidth:"688px"},onClose:r.onClose,children:(0,i.jsx)(Xl,{align:"center",direction:"column",...r,children:e})})]}),gT=({eventId:e,selecteds:n,sort:t,isOpen:s,setIsOpen:o})=>{const{translate:a}=fc(),r=ss(dT),{data:d,isLoading:l}=rs("query MassPrintGroupsAndDocuments($eventId: EventId!) {\n event(id: $eventId) {\n printerGroups {\n __typename\n\n ... on PrinterGroupList {\n nodes {\n id\n name\n }\n }\n\n ... on PrinterGroupError {\n message\n }\n }\n zplDocuments {\n nodes {\n id\n name\n }\n }\n }\n}\n",{eventId:e},[],undefined);const{mutate:c}=function(e={}){return ds("mutation VolunteersRegistrationsMassPrint($eventId: EventId!, $input: MassPrintInput!) {\n count: volunteersRegistrationsMassPrint(eventId: $eventId, input: $input)\n}\n",e)}(),u=Vc(),m=(0,de.useRef)(null),g=l?null:d.event.printerGroups,h="PrinterGroupError"===g?.__typename,p="PrinterGroupError"===g?.__typename?g.message:0===g?.nodes.length?a("no_printing_loc_73059"):void 0;return(0,i.jsx)(Fc,{css:{dialog:{overflow:"visible"},footer:{borderBottomLeftRadius:"$3",borderBottomRightRadius:"$3"},header:{borderTopLeftRadius:"$3",borderTopRightRadius:"$3"}},customErrorRef:m,initialValues:{input:r.default({selecteds:n,sort:t})},render:({handleSubmit:e,submitting:n})=>(0,i.jsx)(hT,{disabled:l||n||h,ids:u,isOpen:s,setIsOpen:o,onSubmit:()=>{l||n||h||e()},children:l?(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:"100%",children:[(0,i.jsx)(Vm,{borderRadius:"$1",css:{marginTop:"$6"},height:40,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",css:{marginTop:"$6"},height:40,width:1})]}):(0,i.jsxs)(Zr,{width:"100%",children:[(0,i.jsx)(Zr,{ref:m,children:(0,i.jsx)(Ig.Provider,{value:{designSystem:pg},children:(0,i.jsx)(Mc,{})})}),(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[p&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:a("incomplete_prin_64421")}),(0,i.jsx)(Oc,{children:p})]}),(0,i.jsx)(Kx,{label:a("wristband_to_pr_39675"),name:"input.zplDocumentId",children:d.event.zplDocuments.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Kx,{label:a("printing_locati_10729"),name:"input.groupId",state:h?"disabled":void 0,children:("PrinterGroupList"===g?.__typename?g.nodes:[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})}),schema:r.schema(),onSubmit:async({input:n},t)=>{if(!t.getState().invalid)try{await c({eventId:e,input:n})}finally{o(!1)}}})},hT=({children:e,disabled:n,ids:t,isOpen:s,onSubmit:o,setIsOpen:a})=>{const{translate:r}=fc();return(0,i.jsxs)(mT,{descId:t.descId,isOpen:s,labelId:t.labelId,role:"dialog",setIsOpen:a,size:"md",onClose:()=>{a(!1)},children:[(0,i.jsx)(uT,{heading:(0,i.jsx)($c,{id:t.labelId,children:r("imprimer_un_bra_94539")}),id:t.labelId,leftIcon:"hand-back-fist",leftIconColor:"gray800",setIsOpen:a}),(0,i.jsx)(lT,{css:{backgroundColor:"white"},id:t.descId,children:e}),(0,i.jsx)(cT,{handleSubmit:o,isSubmitDisabled:n,setIsOpen:a,submitText:r("print_37582")})]})},pT=e=>{const{translate:n}=fc(),t=ss(k$),{mutate:s}=Tr();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("Accreditation"),heading:n("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)(kx,{css:{py:"$7"},children:(0,i.jsxs)(fy,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:Dn.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massAccredit:n.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(L$,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("accr_ditations_39450"),render:({form:t,handleSubmit:s,values:o,submitting:a})=>(0,i.jsx)(nT,{buttonText:o.massAccredit.strategy===Dn.Delete?n("supprimer_les_a_93519"):n("update_desired_accreditations"),change:t.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:s,numberOfSelected:e.numberOfSelected,submitting:a,values:o}),schema:t.step2Schema()})]})})})})};var IT;let fT=class extends M${translationService;inputName="massProfileUpdate";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField([Dn.Replace,Dn.Delete])}}step2Fields(){return{accreditationProfileId:Jl.ai().nullable().when("strategy",{is:e=>e!==Dn.Delete,then:e=>e.required(this.t("vous_devez_s_le_07918"))})}}};fT=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(IT=void 0!==ts&&ts)?IT:Object])],fT);const xT=e=>{const n=os();return(0,i.jsx)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_62774"),prefix:"massProfileUpdate.",strategies:[{label:n("remplacer_le_pr_39873"),value:Dn.Replace},{label:n("supprimer_le_pr_54358"),value:Dn.Delete}]})},_T=e=>{const n=os(),{data:t,loader:s}=rs("query MassWishedProfileUpdateProfiles($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsProfiles {\n accreditationProfile {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId},[],void 0),{accreditationProfileId:o,strategy:a}=e.values.massProfileUpdate,r=a===Dn.Delete,d=(0,de.useMemo)(()=>(t.event?.delegation.accreditationsProfiles??[]).map(e=>e.accreditationProfile),[t.event]),l=(0,de.useMemo)(()=>Object.values(x(d,e=>e.accreditationProfileCategory.id)).map(e=>({...e[0].accreditationProfileCategory,accreditationsProfiles:e})),[d]),c=(0,de.useMemo)(()=>yA(l),[l]);return s||(0,i.jsxs)(i.Fragment,{children:[!r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("profil_d_accr_d_63000"),multiple:!1,placeholder:n("s_lectionner_un_45763"),values:(0,sc.A)([o]),onChange:n=>{e.change("massProfileUpdate.accreditationProfileId",n[0]??null)},children:c}),(0,i.jsx)(ic,{height:"7"})]}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(r?"supprimer_le_pr_87965":"mettre_jour_l_05683",e.numberOfSelected)})})]})},jT=e=>{const{translate:n}=fc(),t=ss(fT),{mutate:s}=zr();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("Accreditation"),heading:n("mettre_jour_l_03244"),onClose:e.onClose,children:(0,i.jsx)(kx,{css:{py:"$7"},children:(0,i.jsxs)(fy,{initialValues:{massProfileUpdate:{accreditationProfileId:null,selecteds:e.selecteds,strategy:Dn.Replace}},isEdit:!1,onSubmit:async n=>{await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,massProfileUpdate:n.massProfileUpdate}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(xT,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("profil_d_accr_d_02274"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(_T,{change:n.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:t,numberOfSelected:e.numberOfSelected,submitting:s,values:o}),schema:t.step2Schema()})]})})})})},vT=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),{mutate:a}=qa(),{mutate:r}=_r(),{mutate:d}=Ja(),[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(!1),[g,h]=(0,de.useState)(!1),[p,I]=(0,de.useState)(!1),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),[S,y]=(0,de.useState)(!1),[C,b]=(0,de.useState)(!1),A=e.massActions.getSelectedsInput(e.predicates,e.scope),E=e.massActions.isAllSelected?e.totalCount:e.massActions.numberOfSelected,w=e.showAccreditationsValidate||e.showCustomDocumentsPrint||f(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[e.canMemberEdit&&(0,i.jsx)(yc,{color:"invisible-gray",leftIcon:"pen",onClick:()=>c(!0),children:n("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(yc,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>m(!0),children:n("_diter_les_accr_41957")}),e.showWishedProfileEdit&&(0,i.jsx)(yc,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>h(!0),children:n("_diter_le_profi_54032")}),e.showAccreditationsEdit&&(0,i.jsx)(yc,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>I(!0),children:n("_diter_les_accr_86042")}),w&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"invisible-gray",rightIcon:"chevron-down",children:n("plus_77692")})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(Em,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,selecteds:A}),e.onMassEditSuccess()},children:n("valider_les_acc_80801")}),e.showPrint&&(0,i.jsx)(Em,{icon:"hand-back-fist",onClick:()=>y(!0),children:n("imprimer_un_bra_94539")}),e.showCustomDocumentsPrint&&(0,i.jsx)(Em,{icon:"print",onClick:()=>b(!0),children:n("imprimer_un_document")}),f(e.campaigns)&&(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>_(!0),children:n("SendCampaign")}),e.showDelete&&(0,i.jsx)(Em,{color:"red",icon:"user-xmark",onClick:()=>v(!0),children:n("retirer_de_la_d_64963")})]})]}),l&&(0,i.jsx)(O$,{customFields:e.customFields,mutate:e=>a({organizationId:t,eventId:s,delegationId:o,massEdit:e}),selecteds:A,onClose:()=>c(!1),onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)(pT,{delegationId:o,eventId:s,numberOfSelected:E,organizationId:t,selecteds:A,onClose:()=>m(!1),onSuccess:e.onMassEditSuccess}),g&&(0,i.jsx)(jT,{delegationId:o,eventId:s,numberOfSelected:E,organizationId:t,selecteds:A,onClose:()=>h(!1),onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(tT,{eventId:s,numberOfSelected:E,selecteds:A,onClose:()=>I(!1),onSuccess:e.onMassEditSuccess}),x&&(0,i.jsx)(iT,{campaigns:e.campaigns,canCreate:!1,delegationId:o,eventId:s,organizationId:t,selecteds:A,onClose:()=>_(!1),onSuccess:e.onMassEditSuccess}),j&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_sur_d_29974"),text:n("suppression_de_57689",E),onClose:()=>v(!1),onDelete:async()=>{await d({organizationId:t,eventId:s,delegationId:o,selecteds:A,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}}),C&&(0,i.jsx)(oT,{eventId:s,numberOfSelected:E,selecteds:A,sort:e.sort,onClose:()=>b(!1),onSuccess:e.onMassEditSuccess}),S&&(0,i.jsx)(gT,{eventId:s,isOpen:S,selecteds:A,setIsOpen:y,sort:e.sort})]})},ST=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(e.selectedSlotsIds),[o,a]=(0,de.useState)(e.selectedProfilesIds),[r,d]=(0,de.useState)(e.rendering),[l,c]=(0,de.useState)(e.showAccreditations),[u,m]=(0,de.useState)(e.showProfiles),[g,h]=(0,de.useState)(e.showQuota);return(0,i.jsxs)(Xl,{direction:"column",onChange:Uc,children:[(0,i.jsxs)(Xl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(oI,{value:l,onChange:c,children:n("afficher_les_ac_56952")}),l&&(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:t,onChange:s,children:e.accreditationsOptions}),e.accreditationsProfilesOptions&&(0,i.jsx)(oI,{value:u,onChange:m,children:n("afficher_les_pr_62371")}),e.accreditationsProfilesOptions&&u&&(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("profils_d_accr_27825"),multiple:!0,renderOnPortal:!0,values:o,onChange:a,children:e.accreditationsProfilesOptions}),(0,i.jsxs)(nf,{label:n("grouper_les_acc_40252"),value:r,onChange:d,children:[(0,i.jsx)("option",{value:dp.Category,children:n("cat_gorie_00291")}),(0,i.jsx)("option",{value:dp.Date,children:n("Date")})]}),!e.hideQuotaOption&&(0,i.jsx)(oI,{value:g,onChange:h,children:n("afficher_les_qu_20761")})]}),(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:n("r_initialiser_77538")}),(0,i.jsx)(yc,{size:"sm",onClick:()=>{e.setShowAccreditations(l),e.setSelectedSlotsIds(t),e.setShowProfiles(u),e.setSelectedProfilesIds(o),e.setRendering(r),e.hideQuotaOption||e.setShowQuota(g),e.close()},children:n("appliquer_05753")})]})]})};function yT(e){const n=CT(e);return(0,Tg.A)((0,wh.A)(e,e=>e.accreditationCategory.id).map(e=>({...e.accreditationCategory,accreditations:n.filter(n=>n.accreditationCategory.id===e.accreditationCategory.id)})),e=>b(e.name))}function CT(e){return rp((0,wh.A)(e,e=>e.accreditation.id).map(n=>({...n.accreditation,accreditationCategory:n.accreditationCategory,slots:Hp(e.filter(e=>e.accreditation.id===n.accreditation.id))})))}function bT(e){return(0,Tg.A)((0,wh.A)(e.map(e=>e.accreditationProfileCategory),e=>e.id),e=>b(e.name)).map(n=>(0,i.jsx)("optgroup",{label:n.name,children:(0,Tg.A)(e.filter(e=>e.accreditationProfileCategory.id===n.id),e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n.id))}function AT(e,n){return e.flatMap(e=>{const t=e.slots.map(e=>e.id),i=_(n)?e.slots.length:(0,tg.A)(t,n).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function ET(e,n,t){const i=e.flatMap(e=>e.slots.filter(e=>_(n)||n.includes(e.id)));return t===dp.Category?i:(0,Tg.A)(i,e=>e.date?.isValid?e.date.toMillis():Number.POSITIVE_INFINITY)}const wT=e=>{const{translate:n}=fc(),t=(0,de.useRef)(null),s=ss(Wg),o=ss(vS),a=(0,de.useMemo)(()=>(0,wh.A)((0,Tg.A)(e.slots.flatMap(e=>e.date?.isValid?[e.date]:[]),e=>e.toMillis()),e=>e.toMillis()),[e.filteredAccreditations]),r=(0,de.useMemo)(()=>(0,dg.A)((0,l.A)(e.slots,e=>e.date?.isValid?e.date.toMillis():"nodate"),e=>e.length),[e.slots]),d=(0,de.useMemo)(()=>Yp(s,e.allCategories),[s,e.allCategories]),c=(0,de.useMemo)(()=>f(e.allAccreditationsProfiles)?bT(e.allAccreditationsProfiles):null,[e.allAccreditationsProfiles]),[u,m]=(0,de.useState)(!1),g=(0,de.useCallback)(()=>{e.setShowAccreditations(!0),e.setSelectedSlotsIds([]),e.setShowProfiles(!0),e.setSelectedProfilesIds([]),e.setRendering(dp.Category),e.hideQuotaOption||e.setShowQuota(!1)},[e.hideQuotaOption,e.setRendering,e.setSelectedProfilesIds,e.setSelectedSlotsIds,e.setShowAccreditations,e.setShowProfiles,e.setShowQuota]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{ref:t,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(Xl,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},gap:"3",width:1,children:!e.hideOptions&&(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,isOpen:u,onStateChange:m,children:[(0,i.jsx)($m,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"bars-filter",size:"sm",children:n("filtres_64574")})})}),(0,i.jsx)(wm,{placement:"bottom-start",width:385,children:(0,i.jsx)(ST,{accreditationsOptions:d,accreditationsProfilesOptions:c,close:()=>m(!1),hideQuotaOption:e.hideQuotaOption,rendering:e.rendering,reset:g,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setRendering:e.setRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:e.setShowQuota,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:e.showQuota})})]})}),(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{t.current?.requestFullscreen()}}),e.showQuota&&(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200",height:"32px"},width:1}),e.data.map(n=>e.renderLeftColumn(n))]}),(0,i.jsx)(Xl,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:[f(e.accreditationsProfiles)&&(0,i.jsx)(Xl,{css:{background:"$gray700",borderRight:"1px solid $gray200",color:"white",fontSize:"$textSm",fontWeight:"$medium",px:"$4",textAlign:"center",textTransform:"uppercase",width:`calc(${e.accreditationsProfiles.length} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:n("profils_09110")}),e.rendering===dp.Category&&e.filteredAccreditations.map(n=>{const t=w(n.acronym)?n.acronym:n.name;return(0,i.jsxs)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${n.numberOfSlots} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t,width:1,children:t}),(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n.accreditationCategory.name,width:1,children:n.accreditationCategory.name})]},n.id)}),e.rendering===dp.Date&&a.map(n=>{const t=n.toMillis(),o=r[t],a=s.toLocaleString(n,da.DateOnly.MonthLong);return(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${o} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:a,width:1,children:a})},t)}),e.rendering===dp.Date&&(r.nodate??0)>0&&(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${r.nodate} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",width:1,children:"-"})})]}),(0,i.jsxs)(Xl,{css:{height:"$cellHeightSm"},children:[e.accreditationsProfiles.map(n=>(0,i.jsxs)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n.name,width:1,children:n.name}),(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n.accreditationProfileCategory.name,width:1,children:n.accreditationProfileCategory.name})]},n.id)),e.slots.map(n=>{const t=e.rendering===dp.Category?n.name||"-":w(n.accreditation.acronym)?n.accreditation.acronym:n.accreditation.name,o=n.date?.isValid?s.toLocaleString(n.date,da.DateOnly.Numeric):"-";return(0,i.jsxs)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t,width:1,children:t}),e.rendering===dp.Category&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:o,width:1,children:o}),e.rendering===dp.Date&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n.accreditationCategory.name,width:1,children:n.accreditationCategory.name})]},n.id)})]}),e.showQuota&&(0,i.jsxs)(Xl,{height:32,children:[e.accreditationsProfiles.map(t=>{const s=t.maxResources??Number.POSITIVE_INFINITY,a=t.assignedResources/s;return(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",width:`${e.cellWidth}px`},height:1,justify:"center",children:(0,i.jsx)(Lm,{color:Fm(a,{higherIsBetter:!1}),size:"sm",children:n("_1_2_membres_04485",t.assignedResources,o.toNumberOrInfinity(s))})},t.id)}),e.slots.map(t=>{const s=t.maxResources??Number.POSITIVE_INFINITY,a=t.assignedResources/s;return(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",width:`${e.cellWidth}px`},height:1,justify:"center",children:(0,i.jsx)(Lm,{color:Fm(a,{higherIsBetter:!1}),size:"sm",children:n("_1_2_membres_04485",t.assignedResources,o.toNumberOrInfinity(s))})},t.id)})]}),e.data.map(n=>e.renderRow(n))]})})]}),(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},$T=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),s=(0,de.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),o=(0,de.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]),a=(0,de.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlotId]:[]),[e.vr]),r=(0,de.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.accreditationProfileId?[e.accreditationSlotId]:[]),[e.vr]);return(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[e.accreditationsProfiles.map(t=>{const s=e.vr.accreditationProfileId===t.id,o=e.vr.wishedAccreditationProfileId===t.id,a=e.isEditMode&&("assigned"===e.editMode&&s||"wished"===e.editMode&&o),r=e.isEditMode&&("assigned"===e.editMode&&!s||"wished"===e.editMode&&!o);return(0,i.jsxs)(Xl,{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:[a&&(0,i.jsx)(Xl,{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.deleteAccreditationProfile(e.vr.userInfo.id,t.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(pc,{icon:"trash-can"})}),r&&(0,i.jsx)(Xl,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationProfile(e.vr.userInfo.id,t.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(pc,{icon:"plus"})}),s?(0,i.jsx)(Xl,{align:"center",className:r||a?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(pc,{icon:"check"})}):o?(0,i.jsx)(Xl,{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)(Zr,{font:"gray800 textXs medium",children:n("souhait_19593")})}):null]},t.id)}),e.slots.map(d=>{const l=t.includes(d.id),c=s.includes(d.id),u=o.includes(d.id),m=r.includes(d.id),g=e.isEditMode&&!d.isBlocked&&!m&&(e.canDeleteCheckedIn||!a.includes(d.id))&&("assigned"===e.editMode&&(l||c)||"wished"===e.editMode&&u),h=e.isEditMode&&!d.isBlocked&&("assigned"===e.editMode&&!l&&!c||"wished"===e.editMode&&!u);return(0,i.jsxs)(Xl,{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:[g&&(0,i.jsx)(Xl,{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,d.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(pc,{icon:"trash-can"})}),h&&(0,i.jsx)(Xl,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary100",bd:"primary500 1",color:"$primary500",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,d.id),e.reloadRow(e.vr.id)},children:(0,i.jsx)(pc,{icon:"plus"})}),l||c?(0,i.jsx)(Xl,{align:"center",className:h||g?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(pc,{icon:m?"layer-group":l?"bolt-auto":"check"})}):u?(0,i.jsx)(Xl,{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)(Zr,{font:"gray800 textXs medium",children:n("souhait_e_52100")})}):null]},d.id)})]})},TT=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>yT(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,de.useMemo)(()=>CT(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,de.useMemo)(()=>e.showAccreditations?AT(s,e.selectedSlotsIds):[],[s,e.selectedSlotsIds,e.showAccreditations]),a=(0,de.useMemo)(()=>ET(o,e.selectedSlotsIds,e.rendering),[o,e.selectedSlotsIds,e.rendering]),r=(0,de.useMemo)(()=>(0,Tg.A)(e.allAccreditationsProfiles.filter(n=>e.showProfiles&&(_(e.selectedProfilesIds)||e.selectedProfilesIds.includes(n.id))),e=>[b(e.accreditationProfileCategory.name),b(e.name)]),[e.allAccreditationsProfiles,e.selectedProfilesIds,e.showProfiles]),d=(0,de.useCallback)(n=>e.isRowLoading(n.id)?(0,i.jsx)(Pg,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},n.userInfo.id):(0,i.jsx)($T,{accreditationsProfiles:r,addAccreditationProfile:e.addAccreditationProfile,addAccreditationSlot:e.addAccreditationSlot,canDeleteCheckedIn:e.canDeleteCheckedIn,deleteAccreditationProfile:e.deleteAccreditationProfile,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slots:a,vr:n},n.userInfo.id),[e.addAccreditationProfile,e.addAccreditationSlot,e.deleteAccreditationProfile,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,r,a]);return(0,i.jsx)(Xl,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(_c,{}):_(e.members)||_(o)&&_(r)?(0,i.jsx)(Xl,{css:{background:"white",border:"1px solid $gray200"},height:400,children:_(e.members)?(0,i.jsx)(Jw,{imageSrc:Yu.Blanks.Member,title:n("aucun_membre_ne_07054")}):f(e.selectedSlotsIds)||f(e.selectedProfilesIds)||!e.showAccreditations||!e.showProfiles?(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(yc,{color:"white",leftIcon:"broom-wide",onClick:()=>{e.setShowAccreditations(!0),e.setSelectedSlotsIds([]),e.setShowProfiles(!0),e.setSelectedProfilesIds([])},children:n("remettre_les_fi_83263")})}):(0,i.jsx)(Jw,{imageSrc:Yu.Blanks.Accreditation,title:n("aucune_accr_dit_97505")})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(wT,{accreditationsProfiles:r,allAccreditations:s,allAccreditationsProfiles:e.allAccreditationsProfiles,allCategories:t,cellWidth:120,data:e.members,filteredAccreditations:o,hideOptions:e.hideOptions,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:n=>(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(MC,{isClickDisabled:!!e.getInformationPanelPath,size:32,userInfo:n.userInfo})},n.userInfo.id),renderRow:d,rendering:e.rendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setRendering:e.setRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:e.setShowQuota,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:e.showQuota,slots:a,totalCount:e.totalCount})})})},zT=e=>{const{params:{organizationId:n,eventId:t,delegationId:s}}=fc(),{data:o,idToLoading:a,isEditMode:r,isLoading:d,limit:l,numberOfPages:c,offset:u,reloadRow:m,setLimit:g,setOffset:h,totalCount:p}=ah(),{mutate:I}=Tr(),{mutate:f}=zr(),{data:x,isLoading:_,reload:j}=rs("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsProfiles {\n assignedResources\n maxResources\n\n accreditationProfile {\n ...AccreditationProfileMatrix\n }\n }\n\n allAccreditationsSlots(onlyVisible: true) {\n assignedResources\n maxResources\n\n accreditationSlot {\n ...AccreditationSlotMatrix\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:s},[Ko.AccreditationProfileMatrixFragment,Ko.AccreditationSlotMatrixFragment],undefined);const v=(0,de.useMemo)(()=>(x.event?.delegation.allAccreditationsSlots??[]).map(e=>({...e.accreditationSlot,assignedResources:e.assignedResources,maxResources:e.maxResources})),[x]),S=(0,de.useMemo)(()=>(x.event?.delegation.accreditationsProfiles??[]).map(e=>({...e.accreditationProfile,assignedResources:e.assignedResources,maxResources:e.maxResources})),[x]),y=(0,de.useCallback)(e=>a[e]??!1,[a]),C=(0,de.useCallback)(async(i,o)=>{await f({organizationId:n,eventId:t,delegationId:s,massProfileUpdate:{accreditationProfileId:o,selecteds:{ids:[i]},strategy:Dn.Replace}}),e.matrixShowQuota&&j()},[j,s,t,f,n,e.matrixShowQuota]),b=(0,de.useCallback)(async(i,o)=>{await I({organizationId:n,eventId:t,delegationId:s,massAccredit:{accreditationsSlotsIds:[o],selecteds:{ids:[i]},strategy:Dn.Add}}),e.matrixShowQuota&&j()},[j,s,t,I,n,e.matrixShowQuota]),A=(0,de.useCallback)(async(i,o)=>{await f({organizationId:n,eventId:t,delegationId:s,massProfileUpdate:{accreditationProfileId:o,selecteds:{ids:[i]},strategy:Dn.Delete}}),e.matrixShowQuota&&j()},[j,s,t,f,n,e.matrixShowQuota]),E=(0,de.useCallback)(async(i,o)=>{await I({organizationId:n,eventId:t,delegationId:s,massAccredit:{accreditationsSlotsIds:[o],selecteds:{ids:[i]},strategy:Dn.Delete}}),e.matrixShowQuota&&j()},[j,s,t,I,n,e.matrixShowQuota]);return(0,i.jsx)(TT,{addAccreditationProfile:C,addAccreditationSlot:b,allAccreditationsProfiles:S,allAccreditationsSlots:v,canDeleteCheckedIn:!1,deleteAccreditationProfile:A,deleteAccreditationSlot:E,editMode:"wished",getInformationPanelPath:e.getInformationPanelPath,hideOptions:e.hideOptions,isEditMode:r,isLoading:d||_,isRowLoading:y,limit:l,members:o,numberOfPages:c,offset:u,reloadRow:m,rendering:e.matrixRendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:g,setOffset:h,setRendering:e.setMatrixRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setMatrixShowAccreditations,setShowProfiles:e.setMatrixShowProfiles,setShowQuota:e.setMatrixShowQuota,showAccreditations:e.matrixShowAccreditations,showProfiles:e.matrixShowProfiles,showQuota:e.matrixShowQuota,totalCount:p})},OT=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),a=ss(Dp),r=ms(),[d,l,c]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.columns??[],t,"eventDelegationMembers.columns",e.columns),u=(0,de.useMemo)(()=>e.canEditColumns||e.delegationsSpaceLayoutTab?d:e.columns,[d,e.canEditColumns,e.columns,e.delegationsSpaceLayoutTab]),[m,g,h]=sE(t,"eventDelegationMembers.limit",jg),[I,x,j]=sE(t,"eventDelegationMembers.predicates",[]),v=(0,de.useMemo)(()=>lh(I),[I]),S=(0,de.useMemo)(()=>e.delegationsSpaceLayoutTab?.rendering===gp.List&&f(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds)?lh([{slug:"accreditationSlotId",operator:Zn.Is,value:e.delegationsSpaceLayoutTab.infos.accreditationsSlotsIds}]):v,[e.delegationsSpaceLayoutTab,v]),[y,C,b]=oE(e.delegationsSpaceLayoutTab,e=>e.rendering,t,"eventDelegationMembers.rendering",gp.List),[A,E,w]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixRendering||dp.Category,t,"eventDelegationMembers.matrixRendering",dp.Category),[$,T,z]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.accreditationsSlotsIds||[],t,"eventDelegationMembers.selectedSlotsIds",[]),[O,R,D]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.accreditationsProfilesIds||[],t,"eventDelegationMembers.selectedProfilesIds",[]),[M,P,k]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowAccreditations??!0,t,"eventDelegationMembers.matrixShowAccreditations",!0),[F,N,L]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowProfiles??!0,t,"eventDelegationMembers.matrixShowProfiles",!0),[U,V,B]=oE(e.delegationsSpaceLayoutTab,e=>e.infos?.matrixShowQuota??!1,t,"eventDelegationMembers.matrixShowQuota",!1),[W,G,q]=sE(t,"eventDelegationMembers.sort",null),{data:H,isLoading:Y}=rs("query EventDelegationMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, 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 id\n numberOfDelegationsAccreditationsSlots\n numberOfDelegationsAccreditationsProfiles\n\n accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n accreditationSlotId\n }\n\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n id\n positionDisplay\n slotDisplay\n\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:s,delegationId:o,privacy:e.customFieldsPrivacy},[Ko.SegmentCustomFieldFragment,Ko.CustomDocumentPopulationFragment],undefined);const Z=c||h||j||b||w||z||D||k||L||B||q||Y,K=(0,de.useMemo)(()=>e.customFieldsPrivacy===He.All?H.organization?.customFields.nodes??[]:(0,wh.A)((0,sc.A)((H.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(H.event?.delegation.columnsCustomFields||[])),e=>e.slug),[e.customFieldsPrivacy,H.organization,H.event]),X=aE(K),Q=(0,de.useMemo)(()=>H.event?a.getDelegationMembersFilters(t,s,K,H.event,H.event.delegation.form,H.event.isWeezeventConnected):[],[s,K,H.event]),J=(0,de.useMemo)(()=>H.event?a.getDelegationMembersPossibleColumns(t,K,{customDocuments:e.showCustomDocumentsColumns?H.event.customDocuments:[],forDelegationsSpace:e.forDelegationsSpace,isWeezeventConnected:H.event.isWeezeventConnected,positionDisplay:H.event.delegation.form.positionDisplay,slotDisplay:H.event.delegation.form.slotDisplay}):[],[e.forDelegationsSpace,e.showCustomDocumentsColumns,t,K,H.event]),ne=(0,de.useMemo)(()=>(H.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[H.event]),te=(0,de.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(y):e.showEditMode,[e.showEditMode,y]),ie=(0,de.useMemo)(()=>_(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds||[]),[e.delegationsSpaceLayoutTab]),se=(0,de.useMemo)(()=>_(e.delegationsSpaceLayoutTab?.infos?.accreditationsSlotsIds||[]),[e.delegationsSpaceLayoutTab]),oe=(0,de.useMemo)(()=>e.delegationsSpaceLayoutTab?void 0:[gp.List,gp.AccreditationsMatrix],[e.delegationsSpaceLayoutTab]),ae=3695!==t&&(H.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0,re=(H.event?.delegation.numberOfDelegationsAccreditationsProfiles??0)>0,le=window.location.origin===ee.HEAVENT_PUBLIC_URL.origin?n=>`${window.location.origin}${vo.DELEGATION_MEMBER_INFORMATION({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id})}`:void 0;return(0,de.useEffect)(()=>{r.setItem(Iu.DELEGATIONS_SPACE_TAB,"members")},[]),Z?(0,i.jsx)(_c,{}):(0,i.jsx)(nx,{columns:u,columnsSearch:[],columnsToIncludes:Rp,eventId:s,filters:Q,getMassActionId:e=>e.userInfo.id,limit:m,loadDataList:wr,loadDataListParams:{delegationId:o,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:Er,loadRowParams:{delegationId:o,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:J,possibleRenderings:oe,predicates:S,renderActions:(n,t,s)=>(0,i.jsx)(vT,{campaigns:e.campaigns,canMemberEdit:e.canMemberEdit,customFields:K,deleteFromEvent:e.deleteFromEvent,massActions:n,predicates:S,scope:{delegationId:o},showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showCustomDocumentsPrint:e.showCustomDocumentsColumns&&f(H.event.customDocuments),showDelete:e.canMemberDelete,showPrint:e.showPrint,showWishedAccreditationsEdit:ae,showWishedProfileEdit:re,sort:W,totalCount:t,onMassEditSuccess:s}),renderAllSelectedText:e=>n("les_1_membres_71180",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_45277",e),rendering:y,setColumns:l,setLimit:g,setPredicates:x,setRendering:C,setSort:G,showEditColumns:y===gp.List&&e.canEditColumns,showEditMode:te,showFilters:ie,showMassActions:e.canMemberEdit||e.canMemberAccredit,showPredicatesBadges:se,showRowDropdown:!0,showRowEdit:e.canMemberEdit,showSearchColumns:!1,showSelectAll:!0,sort:W,children:y===gp.AccreditationsMatrix?(0,i.jsx)(zT,{getInformationPanelPath:le,hideOptions:!!e.delegationsSpaceLayoutTab,matrixRendering:A,matrixShowAccreditations:M,matrixShowProfiles:F,matrixShowQuota:U,selectedProfilesIds:O,selectedSlotsIds:$,setMatrixRendering:E,setMatrixShowAccreditations:P,setMatrixShowProfiles:N,setMatrixShowQuota:V,setSelectedProfilesIds:R,setSelectedSlotsIds:T}):(0,i.jsx)(px,{getEditPath:e.getEditPath,renderCell:(n,a,r)=>(0,i.jsx)(Ew,{accreditationsPanelPath:vo.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:a.userInfo.id}),availabilitiesPanelPath:vo.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:a.userInfo.id}),canChangeDelegation:!1,canMemberAccredit:e.canMemberAccredit,canMemberAssign:!1,column:n,customField:X.get(n.slug),eventId:s,informationPanelPath:le?.(a),positionsPanelPath:vo.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:a.userInfo.id}),reloadRow:r,row:a}),renderRowDropdown:(n,t)=>(0,i.jsx)(y$,{accreditationState:n.accreditationState,allowedCustomDocuments:e.customBadges,canDelete:e.canMemberDelete&&n.canDelete,canDuplicate:e.canDuplicateMembers,canMemberAccredit:e.canMemberAccredit,customDocuments:H.event?.customDocuments??p,deleteFromEvent:e.deleteFromEvent,member:n.userInfo,reload:t,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:n.id}),renderRowPanels:(n,a)=>(0,i.jsx)(I$,{accreditationsPanelPath:vo.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),availabilitiesPanelPath:vo.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),canCheckIn:!1,canDeleteCheckedIn:!1,canDeletePosition:()=>!1,canMemberAccredit:e.canMemberAccredit,canWishedAccreditationsEdit:!0,defaultHiddenAccreditationsSlotsIds:ne,delegation:H.event.delegation,eventId:s,informationPanelPath:vo.DELEGATION_MEMBER_INFORMATION({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),organizationId:t,positionsPanelPath:vo.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:s,delegationId:o,slug:e.delegationsSpaceLayoutTab?.slug,userInfoId:n.userInfo.id}),reloadRow:a,returnPathFallback:e.delegationsSpaceLayoutTab?vo.DELEGATION_TAB({organizationId:t,eventId:s,slug:e.delegationsSpaceLayoutTab?.slug,delegationId:o}):vo.DELEGATION_MEMBERS({organizationId:t,eventId:s,delegationId:o}),volunteerRegistration:n})})})};var RT,DT,MT;function PT(e){return{includeComments:e.includes("comments"),includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeDuplicatedFrom:e.includes("duplicatedFrom"),includeEmails:e.includes("campaigns_states"),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 kT=class extends Eh{constructor(e,n,t){super(e,n,t)}getOrganizationUsersFilters(e,n,t){return[...this.getBaseFilters(t.customFields.nodes),...this.getEventsFilters(e),...this.getFormsFilters(e),...this.getPositionsFilters(),...this.getDelegationsFilters(e),...this.getEmailsFilters(e),...this.getCommentsFilters(e),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:Sn.Select,needLoading:!0,organizationId:e,tagContext:ht.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:Sn.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:Sn.Select,values:t.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==n),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_administrat_15766"),category:this.t("autres_99130"),fieldType:Sn.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:Sn.Checkbox},{slug:"roles",name:this.t("r_les_61679"),category:this.t("autres_99130"),fieldType:Sn.Select,needLoading:!0,organizationId:e}]}getDelegationMembersFilters(e){return this.getBaseFilters(e)}getOrganizationUsersPossibleColumns(e){return[...this.getBaseColumns(),{slug:"duplicatedFrom",name:this.t("dupliqu_de_28582"),minWidth:240},{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:St.InsertedAt,width:230},{slug:"last_seen_at",name:this.t("date_de_derni_r_38795"),isSortable:!0,sortAttribute:St.LastSeenAt,width:230},{slug:"campaigns_states",name:this.t("statut_des_camp_25280"),minWidth:320},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"comments",name:this.t("commentaires_96492"),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:St.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,isSortable:!0,sortAttribute:St.Email,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:St.Id,width:100},{slug:"local_id",name:this.t("id_sur_l_organi_45566"),isSearchable:!0,isSortable:!0,sortAttribute:St.LocalId,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Text,hideEmpty:!0},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Date,hideEmpty:!0},{slug:"id",name:this.t("id_51738"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Number,hideEmpty:!0},{slug:"local_id",name:this.t("id_sur_l_organi_45566"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Number,hideEmpty:!0},{slug:"lastSeenAt",name:this.t("date_de_derni_r_38795"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Datetime},{slug:"duplicatedFrom",name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:Sn.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:Sn.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:Sn.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:Sn.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:Sn.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:Sn.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:Sn.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:Sn.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:Sn.Checkbox,hideEmpty:!0}]}getCommentsFilters(e){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:Sn.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:Sn.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e}]}};kT=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(RT=void 0!==dh&&dh)?RT:Object,"function"==typeof(DT=void 0!==Wg&&Wg)?DT:Object,"function"==typeof(MT=void 0!==ts&&ts)?MT:Object])],kT);const FT=e=>{const{history:n,params:{organizationId:t}}=fc(),s=(0,de.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name,onClick(){n.push(eo.EVENT({organizationId:t,eventId:e.id}))}})),[e.user]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:s})})},NT=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=ss(Wg),{mutate:o}=rr(),a=(0,de.useCallback)((n,i)=>o({organizationId:t,userInfoId:e.row.id,slug:i,value:n}),[e.row,o]),r=(0,de.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),d=(0,de.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${s.toLocaleString(e.insertedAt.toLocal(),da.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),l=(0,de.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),c=(0,de.useMemo)(()=>(0,wh.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]),u=(0,de.useMemo)(()=>(e.row.emails??[]).map(e=>{const{color:t,leftIcon:i}=PC(e.state);return{id:e.id,color:t,icon:i,text:`${e.campaign?.name??""} - ${n(e.state)}`}}),[e.row.emails]),m=(0,de.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)(RE,{clickPath:e.informationPanelPath,column:e.column,mutate:a,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"local_id"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId}):"duplicatedFrom"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(MC,{size:32,userInfo:e.row.duplicatedFrom}):null}):"email"===e.column.slug?(0,i.jsx)(OE,{clickPath:e.informationPanelPath??Ev.MEMBER_INFORMATION({organizationId:t,userInfoId:e.row.id}),column:e.column,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"events"===e.column.slug?(0,i.jsx)(FT,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:r})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:d,children:d})}):"delegations"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:l})}):"delegations_categories"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:c})}):"inserted_at"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:s.toLocaleString(e.row.insertedAt.toLocal(),da.DateTime)}):"last_seen_at"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.lastSeenAt?.isValid?s.toLocaleString(e.row.lastSeenAt.toLocal(),da.DateTime):""}):"campaigns_states"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:u})}):"tags"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:m})}):"comments"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:f(e.row.comments)?e.row.comments.map(e=>e.content).join("; "):""}):"roles"===e.column.slug?(0,i.jsx)(ME,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(zE,{avatarUser:e.row,clickPath:e.informationPanelPath??Ev.MEMBER_INFORMATION({organizationId:t,userInfoId:e.row.id}),column:e.column,customField:e.customField,fields:e.row.fields,mutate:a,reload:e.reloadRow,updatable:e.updatable})},LT=e=>{const{params:{organizationId:n}}=fc();return(0,i.jsx)(Xr.dO,{children:e.informationPanelPath&&e.delegation&&(0,i.jsx)(Xr.qh,{path:e.informationPanelPath,children:(0,i.jsx)(Ww,{organizationId:n,delegation:e.delegation,userInfoId:e.userInfo.id,returnPathFallback:e.informationPanelPath})})})},UT=e=>{const{translate:n,params:{organizationId:t,delegationId:s}}=fc(),o=ss(kT),a=ms(),[r,d,l]=sE(t,"organizationDelegationMembers.columns",e.columns),[c,u,m]=sE(t,"organizationDelegationMembers.limit",jg),[g,h,I]=sE(t,"organizationDelegationMembers.predicates",[]),f=(0,de.useMemo)(()=>lh(g),[g]),[x,_,j]=sE(t,"organizationDelegationMembers.sort",null),{data:v,isLoading:S}=rs("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 id\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n id\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,privacy:e.canCustomFieldRead?He.All:He.Public,delegationId:s},[Ko.SegmentCustomFieldFragment],undefined);const y=l||m||I||j||S,C=(0,de.useMemo)(()=>e.canCustomFieldRead?v.organization?.customFields.nodes??[]:(0,sc.A)((v.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(v.organization?.delegation.columnsCustomFields??[])),[v.organization]),b=aE(C),A=(0,de.useMemo)(()=>o.getDelegationMembersFilters(C),[C]),E=(0,de.useMemo)(()=>o.getDelegationMembersPossibleColumns(C),[C]);return(0,de.useEffect)(()=>{a.setItem(Iu.DELEGATIONS_SPACE_TAB,"members")},[]),y?(0,i.jsx)(_c,{}):(0,i.jsx)(nx,{columns:e.canEditColumns?r:e.columns,columnsSearch:[],columnsToIncludes:PT,eventId:null,filters:A,limit:c,loadDataList:dr,loadDataListParams:{delegationId:s},loadRow:ar,organizationId:t,possibleColumns:E,predicates:f,renderActions:(n,t,o)=>(0,i.jsx)(vT,{campaigns:e.campaigns,canMemberEdit:e.canMemberEdit,customFields:C,deleteFromEvent:!1,massActions:n,predicates:f,scope:{delegationId:s},showAccreditationsEdit:!1,showAccreditationsValidate:!1,showCustomDocumentsPrint:!1,showDelete:e.canMemberDelete,showPrint:!1,showWishedAccreditationsEdit:!1,showWishedProfileEdit:!1,sort:x,totalCount:t,onMassEditSuccess:o}),renderAllSelectedText:e=>n("les_1_membres_71180",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_45277",e),rendering:gp.List,setColumns:d,setLimit:u,setPredicates:h,setSort:_,showEditColumns:e.canEditColumns,showEditMode:e.showEditMode,showFilters:!0,showMassActions:!0,showPredicatesBadges:!0,showRowDropdown:!0,showRowEdit:e.canMemberEdit,showSearchColumns:!1,showSelectAll:!0,sort:x,children:(0,i.jsx)(px,{getEditPath:e.getEditPath,renderCell:(n,o,a)=>(0,i.jsx)(NT,{column:n,customField:b.get(n.slug),informationPanelPath:s?`${window.location.origin}${vo.DELEGATION_MEMBER_INFORMATION({organizationId:t,delegationId:s,userInfoId:o.id})}`:void 0,reloadRow:a,row:o,updatable:e.canMemberEdit}),renderRowDropdown:(n,t)=>(0,i.jsx)(y$,{accreditationState:null,allowedCustomDocuments:e.customBadges,canDelete:e.canMemberDelete,canDuplicate:!1,canMemberAccredit:!1,customDocuments:p,deleteFromEvent:!1,member:n,reload:t,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null}),renderRowPanels:e=>(0,i.jsx)(LT,{delegation:v.organization.delegation,informationPanelPath:vo.DELEGATION_MEMBER_INFORMATION({organizationId:t,delegationId:s,userInfoId:e.id}),userInfo:e})})})},VT=e=>(0,i.jsx)(Xl,{align:"end",css:{background:"gray"===e.background?"$gray50":"none",borderRight:"1px solid $gray200",overflow:"hidden",px:"$4"},direction:"column",height:1,justify:"center",width:1,children:e.children}),BT=(0,de.createContext)({});function WT(){return(0,de.useContext)(BT)}const GT=e=>{const{translate:n}=fc(),t=ss(vS),{accreditationIdToOpen:s,accreditationIdToValues:o,accreditationKeyToStats:a,accreditationValueKeyToStats:r,dates:d,hasNoDate:l,hasScanned:c,showTotal:u}=WT(),m=a[`a${e.accreditation.id}__no_date`],g=o[e.accreditation.id]||[],h=f(g),p=s[e.accreditation.id]??!0,{assignedTotal:I,scannedTotal:x}=(0,de.useMemo)(()=>{const n=(0,sc.A)(d.map(n=>a[`a${e.accreditation.id}__${n.toSQLDate()}`]));return{assignedTotal:(0,Cy.A)(n,e=>e.assigned??0)+(l?m?.assigned??0:0),scannedTotal:(0,Cy.A)(n,e=>e.scanned??0)+(l?m?.scanned??0:0)}},[a,m,d,l,e.accreditation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[d.map(s=>{const o=`a${e.accreditation.id}__${s.toSQLDate()}`,r=a[o];return e.accreditation.hasDateSlots?(0,i.jsxs)(VT,{background:"none",children:[(0,i.jsxs)(Zr,{children:[r?.assigned??0,t.toNumberOrInfinity(r?.max,{prefix:"/"})]}),c&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:r?.scanned?n("_1_scann_e_19753",r.scanned):"-"})]},s.toISO()):(0,i.jsx)(VT,{background:"none"},s.toISO())}),l&&(e.accreditation.hasDateSlots?(0,i.jsx)(VT,{background:"none"}):(0,i.jsxs)(VT,{background:"none",children:[(0,i.jsxs)(Zr,{children:[m?.assigned??0,t.toNumberOrInfinity(m?.max,{prefix:"/"})]}),c&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:m?.scanned?n("_1_scann_e_19753",m.scanned):"-"})]})),u&&(0,i.jsxs)(VT,{background:"none",children:[(0,i.jsxs)(Zr,{children:[I,t.toNumberOrEmpty(e.accreditation.maxResources,{prefix:"/"})]}),c&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:x>0?n("_1_scann_e_19753",x):"-"})]})]}),p&&h&&g.map(({id:t})=>{const s=r[`a${e.accreditation.id}__${t}__no_date`];return(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[d.map(s=>{const o=`a${e.accreditation.id}__${t}__${s.toSQLDate()}`,a=r[o];return e.accreditation.hasDateSlots?(0,i.jsxs)(VT,{background:"none",children:[(0,i.jsx)(Zr,{children:a?.assigned??0}),c&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:a?.scanned?n("_1_scann_e_19753",a.scanned):"-"})]},s.toISO()):(0,i.jsx)(VT,{background:"none"},s.toISO())}),l&&(e.accreditation.hasDateSlots?(0,i.jsx)(VT,{background:"none"}):(0,i.jsxs)(VT,{background:"none",children:[(0,i.jsx)(Zr,{children:s?.assigned??0}),c&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:s?.scanned?n("_1_scann_e_19753",s.scanned):"-"})]})),u&&(0,i.jsx)(VT,{background:"none"})]},t)})]})},qT=e=>{const{translate:n}=fc(),t=ss(vS),{categoryIdToAccreditations:s,categoryIdToOpen:o,categoryKeyToStats:a,dates:r,hasNoDate:d,hasScanned:l,showTotal:c}=WT(),u=(0,de.useMemo)(()=>s[e.category.id]??p,[s,e.category.id]),m=o[e.category.id]??!0,g=a[`c${e.category.id}__no_date`],{assignedTotal:h,scannedTotal:I}=(0,de.useMemo)(()=>{const n=(0,sc.A)(r.map(n=>a[`c${e.category.id}__${n.toSQLDate()}`]));return{assignedTotal:(0,Cy.A)(n,e=>e.assigned??0)+(d?g?.assigned??0:0),scannedTotal:(0,Cy.A)(n,e=>e.scanned??0)+(d?g?.scanned??0:0)}},[a,r,d,g,e.category]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:[r.map(t=>{const s=`c${e.category.id}__${t.toSQLDate()}`,o=a[s];return(0,i.jsxs)(VT,{background:"gray",children:[(0,i.jsx)(Zr,{children:o?.assigned??0}),l&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:o?.scanned?n("_1_scann_e_19753",o.scanned):"-"})]},t.toISO())}),d&&(0,i.jsxs)(VT,{background:"gray",children:[(0,i.jsx)(Zr,{children:g?.assigned??0}),l&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:g?.scanned?n("_1_scann_e_19753",g.scanned):"-"})]}),c&&(0,i.jsxs)(VT,{background:"gray",children:[(0,i.jsxs)(Zr,{children:[h,t.toNumberOrEmpty(e.category.maxResources,{prefix:"/"})]}),l&&(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray500 textXs regular",textAlign:"end",width:1,children:I>0?n("_1_scann_e_19753",I):"-"})]})]}),m?u.map(e=>(0,i.jsx)(GT,{accreditation:e},e.id)):null]})},HT=e=>{const{translate:n}=fc(),{categories:t,categoryIdToAccreditations:s,customFields:o,links:a,setLinks:r}=WT(),[d,l]=(0,de.useState)(a),c=(0,de.useMemo)(()=>(0,Tg.A)(o,e=>b(e.name)).filter(e=>!e.canSelectMultiple).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id)),[o]),u=(0,de.useCallback)((e,n)=>{l((0,mI.jM)(t=>{const i=t[e];i&&(i.customFieldSlug=n)}))},[l]),m=(0,de.useCallback)((e,n)=>{l((0,mI.jM)(t=>{const i=t[e];i&&(i.accreditationsIds=n)}))},[l]),g=d.every(e=>""!==e.customFieldSlug&&f(e.accreditationsIds));return(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:n("ventiler_les_st_00770")}),(0,i.jsx)(xI,{css:{padding:"$6"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[d.map((e,o)=>(0,i.jsxs)(Xl,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$5 $6 $4 $6"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textMd medium",children:n("liaison_n_1_48160",o+1)}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>l(y(d,o))})]}),(0,i.jsxs)(Xl,{css:{padding:"$4 $6 $6 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("CustomField"),values:[e.customFieldSlug],onChange:e=>{f(e)&&u(o,e[0])},children:c}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("accr_ditations_39450"),multiple:!0,values:e.accreditationsIds,onChange:e=>m(o,e),children:t.map(e=>{const n=s[e.id]??p;return(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)})})]})]},o)),(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>l([...d,{accreditationsIds:[],customFieldSlug:""}]),children:n("ajouter_une_lia_43639")})]})}),(0,i.jsx)(_I,{children:(0,i.jsxs)(Xl,{gap:"3",justify:"end",width:1,children:[(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")}),(0,i.jsx)(yc,{disabled:!g,onClick:()=>{r(d),e.onClose()},children:n("ventiler_10014")})]})})]})},YT=e=>{const{accreditationIdToOpen:n,accreditationIdToValues:t,setAccreditationIdToOpen:s}=WT(),o=t[e.accreditation.id]||[],a=f(o),r=n[e.accreditation.id]??!0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",cursor:a?"pointer":"default",height:"$cellHeightSm",paddingLeft:"$6",paddingRight:"$4",userSelect:"none"},gap:"2",onClick:()=>{a&&s(n=>({...n,[e.accreditation.id]:!(n[e.accreditation.id]??1)}))},children:[(0,i.jsx)(Zr,{css:{visibility:a?"visible":"hidden"},children:(0,i.jsx)(pc,{icon:r?"chevron-up":"chevron-right"})}),(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsx)(Xl,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,wrap:"wrap",children:(0,i.jsx)(Zr,{color:"gray800",title:e.accreditation.name,children:e.accreditation.name})})]}),r&&a&&o.map(({id:e,value:n})=>(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",paddingLeft:"88px",paddingRight:"$4",userSelect:"none"},gap:"2",children:n},e))]})},ZT=e=>{const{categoryIdToAccreditations:n,categoryIdToOpen:t,setCategoryIdToOpen:s}=WT(),o=(0,de.useMemo)(()=>n[e.category.id]??p,[n,e.category.id]),a=t[e.category.id]??!0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",cursor:"pointer",height:"$cellHeightSm",px:"$4",userSelect:"none"},gap:"2",onClick:()=>s(n=>({...n,[e.category.id]:!(n[e.category.id]??1)})),children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:a?"chevron-up":"chevron-right"})}),(0,i.jsx)(Zr,{css:{textTransform:"uppercase"},font:"gray800 textXs medium",children:e.category.name})]}),a?o.map(e=>(0,i.jsx)(YT,{accreditation:e},e.id)):null]})},KT=()=>{const{translate:e}=fc(),{categories:n,links:t,hideOptions:s}=WT(),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:!s&&(0,i.jsx)(yc,{color:"white",size:"sm",onClick:()=>a(!0),children:`${e("ventiler_par_ch_78972")} (${t.length})`})}),n.map(e=>(0,i.jsx)(ZT,{category:e},e.id))]}),o&&(0,i.jsx)(HT,{onClose:()=>a(!1)})]})},XT=e=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(e.slots.flatMap(e=>e.date?.isValid?[e.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),[e.slots]),o=(0,de.useMemo)(()=>e.slots.some(e=>!e.date?.isValid),[e.slots]),a=(0,de.useMemo)(()=>e.slots.some(e=>(e.scannedResources??0)>0),[e.slots]),r=(0,de.useMemo)(()=>e.showTotal&&(f(s)||e.categories.some(e=>"number"==typeof e.maxResources)||e.accreditations.some(e=>"number"==typeof e.maxResources)),[s,e.accreditations,e.categories,e.showTotal]),d=(0,de.useMemo)(()=>(0,Tg.A)(e.categories,e=>b(e.name)),[e.categories]),[c,u]=(0,de.useState)({}),[m,g]=(0,de.useState)({}),h=(0,de.useMemo)(()=>(0,l.A)(rp(e.accreditations),e=>e.accreditationCategoryId),[e.accreditations]),p=(0,de.useMemo)(()=>Object.fromEntries(e.accreditations.map(n=>{const t=e.links.find(e=>e.accreditationsIds.includes(n.id));if(t){const i=(0,Tg.A)(e.customFields.find(e=>e.slug===t.customFieldSlug)?.values??[],e=>b(e.value));return[n.id,i]}return[n.id,[]]})),[e.accreditations,e.customFields,e.links]),I=(0,de.useMemo)(()=>(0,dg.A)((0,l.A)(e.slots,e=>{const n=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return`c${e.accreditationCategoryId}__${n}`}),e=>({assigned:(0,Cy.A)(e,e=>e.assignedResources),scanned:(0,Cy.A)(e,e=>e.scannedResources??0)})),[e.slots]),x=(0,de.useMemo)(()=>Object.fromEntries(e.slots.map(e=>{const n=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return[`a${e.accreditationId}__${n}`,{assigned:e.assignedResources,max:e.maxResources,scanned:e.scannedResources??0}]})),[e.slots]),_=(0,de.useMemo)(()=>Object.fromEntries(e.slots.flatMap(e=>Object.entries(e.resourcesByFields).flatMap(([n,t])=>{const i=e.date?.isValid?e.date.startOf("day").toSQLDate():"no_date";return t.map(({customFieldValueId:n,assignedResources:t,scannedResources:s})=>[`a${e.accreditationId}__${n}__${i}`,{assigned:t,scanned:s}])}))),[e.slots]);return(0,i.jsx)(BT.Provider,{value:{accreditationKeyToStats:x,accreditationValueKeyToStats:_,accreditationIdToOpen:m,accreditationIdToValues:p,categories:d,categoryIdToAccreditations:h,categoryIdToOpen:c,categoryKeyToStats:I,customFields:e.customFields,dates:s,hasNoDate:o,hasScanned:a,hideOptions:e.hideOptions,links:e.links,showTotal:r,setAccreditationIdToOpen:g,setCategoryIdToOpen:u,setLinks:e.setLinks},children:(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsx)(KT,{}),(0,i.jsx)(Xl,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsxs)(Xl,{css:{height:"$cellHeightSm"},children:[s.map(e=>(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:t.toLocaleString(e,da.DateOnly.MonthShort)})},e.toISO())),o&&(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",textAlign:"center",children:n("tout_l_v_nemen_70929")})}),r&&(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},justify:"center",width:120,children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("total_07173")})})]}),d.map(e=>(0,i.jsx)(qT,{category:e},e.id))]})})]})})},QT=e=>{const n=VI(),t=(0,de.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),s=(0,de.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(yc,{color:"white",disabled:t,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(n?{week:1}:{day:1}))}}),(0,i.jsx)(Zr,{width:160,children:(0,i.jsx)(df,{...e})}),(0,i.jsx)(yc,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(n?{week:1}:{day:1}))}})]})},JT=(0,de.createContext)({}),ez=e=>{const{days:n,interval:t}=(0,de.useContext)(JT),s=n[0],o=n[6]??n[0],a=(0,de.useMemo)(()=>(e.startAt??Jo.c9.max(s,t.start)).startOf("day"),[e.startAt,s,t]),r=(0,de.useMemo)(()=>(e.endAt??Jo.c9.min(o,t.end)).endOf("day"),[e.endAt,o,t]),d=(0,de.useMemo)(()=>"number"==typeof e.startHour&&e.startHour>0&&e.startAt?.isValid&&e.startAt.hour{const e=Math.max(a.diff(s,"days").days+1,1);return d?e-1:e},[d,a,s]),c=(0,de.useMemo)(()=>{const e=Math.min(Math.ceil(r.diff(s,"days").days)+1,8);return d?e-1:e},[d,r,s]);return a>o||r{const n=(0,de.useMemo)(()=>{if("week"===e.display){const n=e.date.startOf("week");return[n,...(0,Sg.A)(1,7).map(e=>n.plus({day:e}))]}return[e.date]},[e.date]),t=(0,de.useMemo)(()=>Jo.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[s,o]=(0,de.useState)(300),a=(0,de.useCallback)(e=>{if(e){const n=Math.max(Math.ceil(e.getBoundingClientRect().height),300);o(n)}},[e.date,o]),r=e.showBorder?{bd:!0,overflow:"hidden"}:{};return(0,i.jsx)(JT.Provider,{value:{days:n,interval:t},children:(0,i.jsxs)(Xl,{css:{...r,...e.css},direction:"column",children:[(0,i.jsx)(Xl,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:n.map(e=>(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(Zr,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(Xl,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:s,width:1,children:[(0,i.jsx)(Wu,{css:{flex:"1","& > div:last-child":{borderRight:"none"}},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",gridtemplaterows:"1fr",width:1,children:n.map((e,n)=>(0,i.jsx)(Xl,{css:{background:t.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${n+1} / ${n+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(Wu,{ref:a,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})]})]})})},tz=e=>(0,i.jsxs)(Xl,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:e.icon})}),(0,i.jsx)(Zr,{css:{flex:"1"},fontSize:"textXs",children:e.text}),(0,i.jsx)(Xl,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]}),iz=t.p+"img/unavailableCell-148d1ec075614a0e294d.png",sz=Nr(Zr,{alignItems:"center",color:"$gray900",display:"flex",height:"40px",justifyContent:"center",variants:{border:{gray100:{borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100"},gray200:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200"}}},defaultVariants:{border:"gray100"}}),oz=Nr(Zr,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",display:"flex",gap:"$2",height:"48px",px:"$4",width:"200px"}),az=Nr(Zr,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),rz=Nr(Zr,{background:`url(${iz}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),dz=e=>{const{translate:n}=fc();return(0,i.jsx)(Eg,{children:(0,i.jsxs)(_g,{children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(MC,{userInfo:e.userInfo})}),(0,i.jsx)(Xl,{align:"center",gap:"3",children:e.isAssigned?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:"success500",children:(0,i.jsx)(pc,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:e.assignedText})]}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(wm,{placement:"bottom-end",children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e.onDelete,children:e.deleteText})})]})]}):(0,i.jsx)(yc,{size:"sm",onClick:e.onAdd,children:n("ajouter_97327")})})]})})},lz=e=>{const{translate:n}=fc();return(0,i.jsx)(Xl,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"badge-check"})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:n("attribu_es_48167")}),(0,i.jsx)(Zr,{children:e.stats.assignedResources})]}),(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"hand-holding-heart"})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:n("souhait_es_78101")}),(0,i.jsx)(Zr,{children:e.stats.wishedResources})]}),void 0!==e.stats.scannedResources&&(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"scanner-gun"})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:n("scann_es_13169")}),(0,i.jsx)(Zr,{children:e.stats.scannedResources})]})]})})},cz=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(e.stats),[r,d]=(0,de.useState)((0,Tg.A)(e.members,e=>b(e.userInfo.name))),[l,c]=(0,de.useState)({}),u=(0,de.useCallback)(async n=>{s(!0),c(e=>({...e,[n]:!0}));const{member:t,stats:i}=await e.reloadMember(n);d(e=>e.flatMap(e=>e.userInfo.id===n?t?[t]:[]:[e])),a(i),c(e=>({...e,[n]:!1})),s(!1)},[e.reloadMember,s,a,c,d]),m=(0,de.useCallback)(async n=>{c(e=>({...e,[n]:!0})),await e.add(n),await u(n)},[e.add,u,c]),g=(0,de.useCallback)(async n=>{c(e=>({...e,[n]:!0})),await e.delete(n),await u(n)},[e.delete,u,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(YC,{children:e.name}),(0,i.jsxs)(xI,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)(lz,{isLoading:t,stats:o}),(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(sz,{children:n("nom_du_membre_69353")})}),r.map(n=>l[n.userInfo.id]?(0,i.jsx)(Pg,{bx:!0},n.id):(0,i.jsx)(dz,{assignedText:e.assignedText,deleteText:e.deleteText,isAssigned:e.isAssigned(n),userInfo:n.userInfo,onAdd:()=>m(n.userInfo.id),onDelete:()=>g(n.userInfo.id)},n.id))]})]})]})},uz=e=>{const{params:{eventId:n,delegationId:t},translate:s}=fc(),{mutate:o}=Ra(),a=(0,de.useMemo)(()=>`${e.accreditation.name}${w(e.accreditationSlot.name)?` - ${e.accreditationSlot.name}`:""}`,[e.accreditation,e.accreditationSlot]),r=(0,de.useCallback)(n=>n.accreditationsUsersInfos.some(n=>n.accreditationSlotId===e.accreditationSlotId),[e.accreditationSlotId]),d=(0,de.useCallback)(async i=>{const{event:s}=await function(e,n={}){return xa("query CalendarAccreditationSlotMember(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationSlotId: AccreditationsSlotId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...AccreditationSlotStats\n }\n\n delegationMaybe(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.AccreditationSlotStatsFragment,Ko.DelegationAccreditationSlotStatsFragment,Ko.VolunteerRegistrationDelegationAccreditationSlotFragment]})}({eventId:n,delegationId:t,accreditationSlotId:e.accreditationSlotId,userInfoId:i},{token:await fe()}),o=s.member.accreditationsSlots.some(n=>n.id===e.accreditationSlotId);return{member:r(s.member)||o?s.member:null,stats:s.delegationMaybe?.accreditationSlot??s.accreditationSlot}},[e.accreditationSlotId,t,n,r]),l=(0,de.useCallback)((t,i)=>o({eventId:n,massAccredit:{accreditationsSlotsIds:[e.accreditationSlotId],selecteds:{ids:[t]},strategy:i}}),[n,o,e.accreditationSlotId]),c=(0,de.useCallback)(e=>l(e,Dn.Add),[l]),u=(0,de.useCallback)(e=>l(e,Dn.Delete),[l]);return(0,i.jsx)(cz,{add:c,assignedText:s("d_j_attribu_e_06450"),delete:u,deleteText:s("retirer_l_accr_62187"),isAssigned:r,members:e.volunteersRegistrations,name:a,reloadMember:d,stats:e.stats})},mz=e=>{const{data:n,loader:t}=rs("query AccreditationSlotMembers($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...AccreditationSlotStats\n date\n name\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n}\n",{eventId:e.eventId,accreditationSlotId:e.accreditationSlotId},[Ko.AccreditationSlotStatsFragment,Ko.VolunteerRegistrationDelegationAccreditationSlotFragment],undefined);return(0,i.jsx)(fI,{size:"md",onClose:e.onClose,children:t||(0,i.jsx)(uz,{accreditation:n.event.accreditationSlot.accreditation,accreditationSlot:n.event.accreditationSlot,accreditationSlotId:e.accreditationSlotId,stats:n.event.accreditationSlot,volunteersRegistrations:n.event.accreditationSlot.volunteersRegistrations})})},gz=e=>{const{data:n,loader:t}=rs("query DelegationAccreditationSlotMembers(\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 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},[Ko.DelegationAccreditationSlotStatsFragment,Ko.VolunteerRegistrationDelegationAccreditationSlotFragment],undefined);return(0,i.jsx)(fI,{size:"md",onClose:e.onClose,children:t||(0,i.jsx)(uz,{accreditation:n.event.delegation.accreditationSlot.accreditation,accreditationSlot:n.event.delegation.accreditationSlot.accreditationSlot,accreditationSlotId:e.accreditationSlotId,stats:n.event.delegation.accreditationSlot,volunteersRegistrations:n.event.delegation.accreditationSlot.volunteersRegistrations})})},hz=e=>{const{translate:n,params:{eventId:t,delegationId:s}}=fc(),[o,a]=(0,de.useState)(e.stats),r=(0,de.useMemo)(()=>Mm(e.accreditation.color),[e.accreditation]),d=(0,de.useMemo)(()=>({background:r[50],border:`1px solid ${r[500]}`,color:r[700]}),[r]),l=(0,de.useMemo)(()=>`${e.accreditation.name}${w(e.accreditationSlot.name)?` - ${e.accreditationSlot.name}`:""}`,[e.accreditation,e.accreditationSlot]),c=(0,de.useCallback)(async()=>{if(s){const{event:{delegation:n}}=await Ka({eventId:t,delegationId:s,accreditationSlotId:e.accreditationSlot.id},{token:await fe()});a(n.accreditationSlot)}else{const{event:{accreditationSlot:n}}=await function(e,n={}){return xa("query AccreditationSlotStats($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n assignedResources\n maxResources\n scannedResources\n wishedResources\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({eventId:t,accreditationSlotId:e.accreditationSlot.id},{token:await fe()});a(n)}},[e.accreditationSlot,a]),[u,m]=(0,de.useState)(!1),g=o.maxResources?`/${o.maxResources}`:"",h=`${o.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"start",css:{...d,borderRadius:"$1",cursor:e.canMemberAccredit?"pointer":"default",minHeight:"32px",padding:"$2"},direction:"column",gap:"2",width:1,onClick:()=>{e.canMemberAccredit&&m(!0)},children:[(0,i.jsx)(Zr,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:l}),(0,i.jsx)(tz,{background:r[100],count:h,icon:"badge-check",text:n("attribu_es_48167")}),e.showWished&&"number"==typeof o.wishedResources&&(0,i.jsx)(tz,{background:r[100],count:o.wishedResources,icon:"hand-holding-heart",text:n("souhait_es_78101")}),"number"==typeof o.scannedResources&&(0,i.jsx)(tz,{background:r[100],count:o.scannedResources,icon:"scanner-gun",text:n("scann_es_13169")})]}),e.canMemberAccredit&&u?s?(0,i.jsx)(gz,{accreditationSlotId:e.accreditationSlot.id,delegationId:s,eventId:t,onClose:()=>(m(!1),c())}):(0,i.jsx)(mz,{accreditationSlotId:e.accreditationSlot.id,eventId:t,onClose:()=>(m(!1),c())}):null]})},pz=e=>{const n=VI(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,ap(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),s=(0,de.useMemo)(()=>(0,Tg.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,ap(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),o=(0,de.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(nz,{css:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:n?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[t.map(n=>(0,i.jsx)(ez,{children:(0,i.jsx)(hz,{accreditation:n.accreditation,accreditationSlot:n.accreditationSlot,canMemberAccredit:e.canMemberAccredit,showWished:!o[n.accreditationId],stats:n})},n.accreditationSlot.id)),s.map(n=>(0,i.jsx)(ez,{endAt:n.accreditationSlot.date,startAt:n.accreditationSlot.date,children:(0,i.jsx)(hz,{accreditation:n.accreditation,accreditationSlot:n.accreditationSlot,canMemberAccredit:e.canMemberAccredit,showWished:!o[n.accreditationId],stats:n})},n.accreditationSlot.id))]})},Iz=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o]=(0,de.useState)(""),[a,r]=oE(e.delegationsSpaceLayoutTab,e=>e.rendering,t,"eventDelegationAccreditations.rendering",lp.WeeklyCalendar,[lp.Table,lp.WeeklyCalendar]),[d,l]=(0,de.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,de.useMemo)(()=>d?.isValid?d:e.event.startAt,[e.event,d]),[u,m]=(0,de.useState)(null),g=(0,de.useMemo)(()=>{const n=b(s||""),t=e.delegationsSpaceLayoutTab?.infos.accreditationsSlotsIds;return e.event.delegation.allAccreditationsSlots.filter(e=>{const i=!w(n)||b(e.accreditation.name).includes(n)||b(e.accreditationSlot.name).includes(n)||a===lp.Table&&b(e.accreditationCategory.name).includes(n),s=!u?.isValid||!!e.accreditationSlot.date?.isValid&&u.toSQLDate()===e.accreditationSlot.date.toSQLDate(),o=!f(t)||t.includes(e.accreditationSlotId);return i&&s&&o})},[e.delegationsSpaceLayoutTab,e.event,s,a,u]),h=(0,de.useMemo)(()=>g.map(e=>({accreditationCategoryId:e.accreditationCategory.id,accreditationId:e.accreditationSlot.accreditationId,date:e.accreditationSlot.date,assignedResources:e.assignedResources,maxResources:e.maxResources,resourcesByFields:e.resourcesByFields,scannedResources:e.scannedResources})),[g]),p=(0,de.useMemo)(()=>{const n=g.map(e=>e.accreditationId);return e.event.delegation.allAccreditations.filter(e=>n.includes(e.accreditationId))},[e.event,g]),I=(0,de.useMemo)(()=>p.map(e=>({id:e.accreditation.id,accreditationCategoryId:e.accreditation.accreditationCategoryId,index:e.accreditation.index,name:e.accreditation.name,color:e.accreditation.color,icon:e.accreditation.icon,hasDateSlots:e.accreditation.hasDateSlots,maxResources:e.maxResources})),[p]),x=(0,de.useMemo)(()=>{const n=g.map(e=>e.accreditationCategoryId);return e.event.delegation.allAccreditationsCategories.filter(e=>n.includes(e.accreditationCategoryId)).map(e=>({id:e.accreditationCategory.id,name:e.accreditationCategory.name,maxResources:e.maxResources}))},[g,e.event]),_=(0,de.useMemo)(()=>!e.delegationsSpaceLayoutTab,[e.delegationsSpaceLayoutTab]),j=(0,de.useMemo)(()=>w(e.delegationsSpaceLayoutTab?.infos.customFieldSlug)&&f(I)?[{accreditationsIds:I.map(e=>e.id),customFieldSlug:e.delegationsSpaceLayoutTab.infos.customFieldSlug}]:[],[e.delegationsSpaceLayoutTab,I]);return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Xl,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_65646"),value:s,onChange:o})}),(0,i.jsx)(Zr,{css:{flex:"1"}}),a===lp.WeeklyCalendar&&(0,i.jsx)(QT,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:l}),a===lp.Table&&(0,i.jsx)(Zr,{width:160,children:(0,i.jsx)(df,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:m})}),_&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:hp(a),children:pp(n,a)})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(Em,{icon:hp(lp.WeeklyCalendar),onClick:()=>r(lp.WeeklyCalendar),children:pp(n,lp.WeeklyCalendar)}),(0,i.jsx)(Em,{icon:hp(lp.Table),onClick:()=>r(lp.Table),children:pp(n,lp.Table)})]})]})]}),a===lp.Table?(0,i.jsx)(XT,{accreditations:I,categories:x,customFields:e.organization.customFields.nodes,hideOptions:!0,links:j,setLinks:Ou.A,showTotal:!0,slots:h}):(0,i.jsx)(pz,{accreditations:p,accreditationsSlots:g,canMemberAccredit:e.canMemberAccredit,event:e.event,selectedDay:c})]})},fz=()=>{const e=os();return(0,i.jsx)(Xl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(Zr,{height:250,width:1,children:(0,i.jsx)(Jw,{title:e("aucune_accr_dit_27643")})})})},xz=e=>{const{params:{organizationId:n,eventId:t,delegationId:s}}=fc(),{data:o,loader:a}=rs("query DelegationAccreditations(\n $organizationId : OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n organization(id: $organizationId){\n customFields(eventId: $eventId, fieldTypes: [Select], variety: UserInfo, privacy: Public){\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n delegation(id: $delegationId) {\n minAccreditationSlotDate\n\n allAccreditationsCategories {\n accreditationCategoryId\n maxResources\n\n accreditationCategory {\n id\n name\n }\n }\n\n allAccreditations {\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 hasDateSlots\n }\n }\n\n allAccreditationsSlots(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",{organizationId:n,eventId:t,delegationId:s,onlyVisible:e.onlyVisible},[Ko.ConditionCustomFieldFragment,Ko.DelegationAccreditationSlotStatsFragment],undefined);return a||(_(o.event?.delegation.allAccreditationsSlots)?(0,i.jsx)(fz,{}):(0,i.jsx)(Iz,{canMemberAccredit:e.canMemberAccredit,delegationsSpaceLayoutTab:e.delegationsSpaceLayoutTab,event:o.event,organization:o.organization}))},_z=e=>{const{params:{organizationId:n,eventId:t,delegationId:s},translate:o}=fc(),{mutate:a,isLoading:r}=Qa(),d=(0,de.useMemo)(()=>e.customDocuments.filter(n=>n.slug===e.slug),[e.customDocuments,e.slug]),l=(0,de.useMemo)(()=>f(d)?d.map(e=>e.name).join(", "):ei.includes(e.slug)?fj(e.slug):null,[d,e.slug]),c=f(d);return l?(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(pc,{icon:"file-lines"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 textSm medium",children:l}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",isLoading:r,leftIcon:"download",onClick:()=>a({organizationId:n,eventId:t,delegationId:s,documentsExport:{badgeType:c?null:e.slug,customDocumentSlug:c?e.slug:null,documentType:c?an.UserCustomDocument:an.CustomBadge,language:gt.Fr,oneFile:!1,segmentsIds:[],strategy:sn.OnePerPage}})})})}),(0,i.jsx)(ux,{placement:"top",children:o("recevoir_les_do_31669")})]})]}):null},jz=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("documents_dispo_46996")}),(0,i.jsx)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(n=>(0,i.jsx)(_z,{customDocuments:e.customDocuments,slug:n},n))})]})},vz=e=>{const{designSystem:n}=fg(),t=n===pg?Xl:Zr;return(0,i.jsx)(Xl,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(Xl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Xl,{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)($c,{css:{flex:"1",alignContent:"center"},children:e.title}),e.rightIcon&&(0,i.jsx)(Zr,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:n=>{e.rightIconClick?.(n)},children:(0,i.jsx)(pc,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(t,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e.children})]})})},Sz=({css:e,title:n,children:t})=>(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n}),(0,i.jsx)(Xl,{css:{bd:!0,padding:"$4",...e},direction:"column",children:t})]}),yz=({children:e,...n})=>Cg()?(0,i.jsx)(Sz,{...n,children:e}):(0,i.jsx)(vz,{...n,children:e});var Cz,bz,Az,Ez=t(9567),wz=t(9385);const $z=/(\{([\w\.]+)\})/g,Tz=/^user\.(accreditations|accreditationsSlots|firstAccreditationSlot|lastAccreditationSlot|positions|assignments|firstAssignment|lastAssignment)\./,zz=/^\d+$/,Oz="nodate",Rz=Number.MAX_SAFE_INTEGER;let Dz=class{fieldService;dateTimeService;intervalService;constructor(e,n,t){this.fieldService=e,this.dateTimeService=n,this.intervalService=t}renderText(e,n={},t="HTML"){const i=n.separator??"
",s=n.delegation?this.getDelegation(n.delegation,n):n.volunteerRegistration?.delegation?this.getDelegation(n.volunteerRegistration.delegation,n):void 0,o=this.getFormats(n),a=n.assignments?this.getAssignments(n.assignments,o):void 0,r=e=>"HTML"===t?function(e,n){return new u(e.map(e=>(0,c.A)(e)).join(n),e.join(n))}(e,i):e.join(i),d=n.accreditations?this.getAccreditations(n.accreditations,o,n):void 0,l={organization:n.organization||void 0,event:n.event?this.getEvent(n.event,n):void 0,delegation:s,team:s,invitedBy:n?.invitedBy?this.getUser(n.invitedBy,null,n):void 0,recipient:n?.recipient?this.getUser(n.recipient,null,n):void 0,user:n.userInfo?{...this.getUser(n.userInfo,s,n),...this.getUserAccreditations(d??[]),...this.getUserAssignments(a??[])}:void 0,...a?this.getAssignmentsVariables(a,r):{},...d?this.getAccreditationsVariables(d,r,n):{},...n.extraInfos};return("ZPL"===t?(0,Ez.A)(e,{interpolate:/{([\s\S]+?)}/g})(l):this.replaceVariables(e,g(l),t)).replace($z,(e,i,s)=>m(this.getDocumentLink(s,n),"ZPL"===t?"TEXT":t))}getDocumentLink(e,n){if(Tz.test(e))return"";const[t,i,s,o]=e.split("."),a=n?.userInfo?{lang:this.getLanguage(n.userInfo)}:{};if(8===o?.length?a.date=o:16===o?.length&&(a.date=o.substring(0,8),a.endDate=o.substring(8)),n.userInfo?.links){const t=n.userInfo.links;return e.includes("planningDays")?Ex(t.userPlanningDaysLink,"pdf",a):e.includes("planningList")?Ex(t.userPlanningListLink,"pdf",a):e.includes("planning")?Ex(t.userPlanningLink,"pdf",a):e.includes("assignments")?Ex(t.userAssignmentsLink,"pdf",a):e.includes("paris20kmassignment")&&t?.userCustomBadgeLinks[qe.Paris20kmassignment]?Ex(t.userCustomBadgeLinks[qe.Paris20kmassignment],"pdf",a):""}return""}replaceVariables(e,n,t){return e.replace($z,(e,i,s)=>{const o=Object.hasOwn(n,s)?n[s]:void 0;return void 0===o||Array.isArray(o)?e:m(o,t)})}getDelegation(e,n){const t=n.customFields||[],i=this.getFields(e.fields,t);return{...e,...i,leader:{email:e.leaders?.[0]?.email??"",firstName:e.leaders?.[0]?.firstName??"",lastName:e.leaders?.[0]?.lastName??"",phone:e.leaders?.[0]?.phone?.internationalFormat??""},formLink:yx({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.id,formId:e.formId}),spaceLink:Sx(e.organizationId,ys(Os.ORGANIZATION_DELEGATIONS({organizationId:e.organizationId})))}}getEvent(e,n){const t=n.customFields||[],i=this.getFields(e.fields,t),s=n.organization?.dateFormat??"yyyy-MM-dd";return{id:e.id,name:e.name,...i,startDate:e.startAt?.toFormat(s)??"",endDate:e.endAt?.toFormat(s)??""}}getFormats(e){return{date:e.organization?.dateFormat||"yyyy-MM-dd",datetime:e.organization?.datetimeFormat||"yyyy-MM-dd HH:mm",time:e.organization?.timeFormat||"HH:mm"}}getAssignments(e,n){return(0,Tg.A)(e,e=>e.positionSlot.range.start.toMillis()).map(({id:e,position:t,positionSlot:i})=>{const s=i.range.start,o=i.range.end,a={id:t.category.id,name:t.category.name};return{acronym:t.acronym??"",category:a,date:s.toFormat(n.date),dateKey:s.toFormat("yyyyMMdd"),dateLong:this.dateTimeService.toLocaleString(s,da.DateOnly.WeekdayLongMonthLong),endDate:o.toFormat(n.date),endDatetime:o.toFormat(n.datetime),id:e,leaders:this.getLeaders((0,wh.A)(t.category.leaders.concat(t.leaders),e=>e.userInfo.id)),name:t.name,position:{acronym:t.acronym??"",address:t.address??"",category:a,color:t.color,description:new u(t.description??""),id:t.id,name:t.name},range:this.intervalService.toDisplayString(i.range,{formats:{displayWeekday:!0}}),slot:{durationHours:(0,Zy.A)(i.timeDifferenceMinutes/60,1),durationMinutes:i.timeDifferenceMinutes,endTime:o.toFormat(n.time),id:i.id,name:i.name,startTime:s.toFormat(n.time)},startDate:s.toFormat(n.date),startDatetime:s.toFormat(n.datetime)}})}getAssignmentsVariables(e,n){const t=Object.fromEntries(Object.values(x(e,e=>e.dateKey)).map(e=>[`positions.${e[0].dateKey}`,n((0,Tg.A)((0,Zo.A)(e.map(({position:e})=>e.name))))])),i=(0,Cy.A)(e,({slot:e})=>e.durationMinutes);return{assignmentsDays:(0,wh.A)(e,({dateKey:e})=>e).map(({dateLong:e})=>e).join(", "),positionsCategories:(0,Tg.A)((0,Zo.A)(e.map(({position:e})=>e.category.name))).join(", "),positions:(0,Tg.A)((0,Zo.A)(e.map(({position:e})=>e.name))).join(", "),volunteerMinutes:i,volunteerHours:(0,Zy.A)(i/60,1),...t}}getAccreditations(e,n,t){const i=!!t.organization&&Sp(t.organization.id);return(0,Tg.A)(e,e=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date.toMillis():Rz).map(({accreditation:e,accreditationCategory:t,accreditationSlot:s})=>{const o=s.date?.isValid??!1,a=n=>qp(this.dateTimeService,s,e.name,{accreditation:{includeName:n},date:{localeFormat:da.DateOnly.WeekdayLongMonthLong}});return{accreditation:{acronym:e.acronym??"",address:e.address??"",color:e.color,description:new u(e.description??""),icon:e.icon,id:e.id,name:e.name},acronym:e.acronym??"",category:{id:t.id,name:t.name},date:o?s.date.toFormat(n.date):"",dateKey:o?s.date.toFormat("yyyyMMdd"):Oz,dateLong:o?this.dateTimeService.toLocaleString(s.date,da.DateOnly.WeekdayLongMonthLong):"",displayName:a(!i),fullName:a(!0),hasDate:o,name:e.name,slot:{id:s.id,name:s.name}}})}getAccreditationsVariables(e,n,t){const[i,s]=(0,Up.A)(e,({hasDate:e})=>e),o=Object.values(x(i,({dateKey:e})=>e)),a=Object.fromEntries(o.map(e=>[`accreditations.${e[0].dateKey}`,n((0,Tg.A)((0,Zo.A)(e.map(({name:e})=>e))))])),r=Object.fromEntries(o.map(e=>[`accreditationsSlots.${e[0].dateKey}`,n(e.map(({fullName:e})=>e))]));return{accreditationsCategories:n((0,Tg.A)((0,Zo.A)(e.map(({category:e})=>e.name)))),accreditationsDates:n((0,wh.A)(i,({dateKey:e})=>e).map(({dateLong:e})=>e)),accreditationsText:n((0,Tg.A)((0,Zo.A)(e.map(({name:e})=>e)))),accreditationsSlots:n((0,Tg.A)(e.map(({displayName:e})=>e))),[`accreditations.${Oz}`]:n((0,Tg.A)((0,Zo.A)(s.map(({name:e})=>e)))),[`accreditationsSlots.${Oz}`]:n((0,Tg.A)((0,Zo.A)(s.map(({fullName:e})=>e)))),omFonction:this.getOmFonction(t),...a,...r}}getUserAccreditations(e){const n=this.getDistinct(e,e=>e.accreditation.id,(e,n,t)=>({...e.accreditation,category:e.category,firstSlot:n,lastSlot:t}),e=>this.getLastAccreditationSlot(e));return{accreditations:this.toKeyedItems(n,({acronym:e})=>e),accreditationsSlots:this.toKeyedItems(e),firstAccreditationSlot:e[0],lastAccreditationSlot:this.getLastAccreditationSlot(e)}}getUserAssignments(e){const n=this.getDistinct(e,e=>e.position.id,(e,n,t)=>({...e.position,firstSlot:n,lastSlot:t}),eh.A);return{positions:this.toKeyedItems(n,({acronym:e})=>e),assignments:this.toKeyedItems(e),firstAssignment:e[0],lastAssignment:(0,eh.A)(e)}}getDistinct(e,n,t,i){return(0,wh.A)(e,n).map(s=>{const o=e.filter(e=>n(e)===n(s));return t(s,s,i(o))})}getLastAccreditationSlot(e){return(0,wz.A)(e,({hasDate:e})=>e)??(0,eh.A)(e)}toKeyedItems(e,n){const t={};if(n)for(const i of e){const e=E(n(i),{replacer:A.Underscore});!w(e)||zz.test(e)||Object.hasOwn(t,e)||(t[e]=i)}return{...t,...Object.fromEntries(e.map((e,n)=>[`${n+1}`,e]))}}getOmFonction(e){return e.organization&&3953===e.organization.id?(e.accreditations??[]).find(e=>50851===e.accreditation.fields.cf74460)?.accreditation.name??e.userInfo?.fields?.cf73819?.value??"":""}getLeaders(e){return e.map(({userInfo:e})=>({email:e.email,firstName:e.firstName??"",lastName:e.lastName??"",name:e.name,phone:e.phone?.internationalFormat??""}))}getUser(e,n,t){const i=t.customFields||[],s=this.getFields(e.fields,i),o=this.getLanguage(e),a=o?{lang:o.toString()}:{},r=e.links?Ex(e.links.userAssignmentsLink,"pdf",a):"",d=e.links?Ex(e.links.userPlanningLink,"pdf",a):"",l=e.links?Ex(e.links.userPlanningListLink,"pdf",a):"",c=e.links?Ex(e.links.userPlanningDaysLink,"pdf",a):"",m=e.links?{assignments:r,badge:Ex(e.links.userBadgeLink,"pdf",a),certificate:Ex(e.links.userCertificateLink,"pdf",a),planning:d,planningList:l,planningDays:c,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,n])=>[e.toLowerCase(),Ex(n,"pdf",a)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,n])=>[e,Ex(n,"pdf",a)]))}:{},g=t.volunteerRegistration?.ticketId??"",h=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",p=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",I=new u(`
\n \n
`);return{id:e.id,organizationLocalId:e.localId,localId:t.volunteerRegistration?.localId||"",email:e.email,...s,firstName:h,lastName:p,ticketId:g,qrcode:I,memberCode:t.volunteerRegistration?.weezevent?.memberCode||"",name:O_({firstName:h,lastName:p}),registrationDate:e.registrationDate?.toFormat(t.organization?.dateFormat??"yyyy-MM-dd")??"",registrationDatetime:e.registrationDate?.toFormat(t.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:t.event?r:"",documents:m,team:n,delegation:{...n,name:n?.name??"",leader:{email:n?.leader?.email??"",firstName:n?.leader?.firstName??"",lastName:n?.leader?.lastName??"",phone:n?.leader?.phone??""},spaceLink:n?.spaceLink??""},weezevent:{barcode:g,qrcode:I,identificationNumber:""},profile:t.volunteerRegistration?.accreditationProfile?.name??"",profileCategory:t.volunteerRegistration?.accreditationProfile?.accreditationProfileCategory.name??""}}getFields(e,n){return e.isExpanded?Object.fromEntries(Object.entries(e).flatMap(([e,{label:n,value:t}])=>{const i=f(t)?t.join(", "):w(t)?t:"";return(0,sc.A)([[e,i],w(n)?[E(n,{replacer:A.Underscore}),i]:null])})):Object.fromEntries(n.flatMap(n=>{const t=this.fieldService.getValueString(n,e);return(0,sc.A)([[n.slug,t],w(n.label)?[E(n.label,{replacer:A.Underscore}),t]:null])}))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};Dz=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Cz=void 0!==wb&&wb)?Cz:Object,"function"==typeof(bz=void 0!==Wg&&Wg)?bz:Object,"function"==typeof(Az=void 0!==Nh&&Nh)?Az:Object])],Dz);const Mz=({description:e})=>{const n=os();return(0,i.jsx)(yz,{title:n("description_58935"),children:w(e)?(0,i.jsx)(p_,{text:e}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_descript_25737")})})},Pz=Nr("div",{display:"flex",flexDirection:"column",gap:"$1","@tablet":{flexDirection:"row",gap:"$3",justifyContent:"space-between"},variants:{isField:{true:{"@tablet":{alignItems:"center"}}}}}),kz=Nr("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontSize:"inherit",fontWeight:"inherit"},variants:{isField:{true:{"@tablet":{flex:"1"}}}}}),Fz=Nr("div",{alignItems:"flex-start",color:"$gray500",display:"flex",flexDirection:"column",minWidth:0,overflowWrap:"anywhere","@tablet":{color:"inherit",display:"block",overflowWrap:"normal"},variants:{isField:{true:{"@tablet":{alignItems:"normal",display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"300px"}}}}}),Nz=({label:e,children:n})=>(0,i.jsxs)(Pz,{children:[(0,i.jsx)(kz,{children:e}),(0,i.jsx)(Fz,{children:n})]}),Lz=({customField:e,fields:n})=>(0,i.jsxs)(Pz,{isField:!0,children:[(0,i.jsx)(kz,{isField:!0,children:e.name}),(0,i.jsx)(Fz,{isField:!0,children:(0,i.jsx)(Lw,{field:e,fields:n})})]}),Uz=e=>(0,i.jsx)(Hj,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),Vz=Nr("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),Bz=({children:e,...n})=>(0,i.jsx)(Vz,{...n,children:e}),Wz=Nr("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),Gz=({children:e,...n})=>(0,i.jsx)(Wz,{...n,children:e}),qz=Nr("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),Hz=({children:e,...n})=>(0,i.jsx)(qz,{...n,children:e}),Yz=Nr("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),Zz=({children:e,...n})=>(0,i.jsx)(Yz,{...n,children:e}),Kz=({privateNote:e})=>{const n=os();return(0,i.jsx)(yz,{title:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(pc,{icon:"lock"}),(0,i.jsx)(Zr,{children:n("note_priv_e_06303")})]}),children:w(e)?(0,i.jsx)(p_,{text:e}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_note_pri_86832")})})};var Xz;let Qz=class extends ju{constructor(e){super(e)}associateTagsIdsSchema(){return Jl.Ik().shape({tagsIds:Jl.YO().of(Jl.ai())})}};Qz=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Xz=void 0!==ts&&ts)?Xz:Object])],Qz);const Jz=e=>{const n=os(),t=ss(Qz),[s,o]=(0,de.useState)(e.tags),[a,r]=(0,de.useState)(!1);return(0,i.jsx)(mA,{buttonText:n("enregistrer_06519"),icon:"tag",initialValues:{tagsIds:e.tagsIds},schema:t.associateTagsIdsSchema(),size:"md",subtitle:e.subtitle,title:n("ajout_d_un_ou_p_17767"),onClose:e.onClose,onSubmit:async n=>{e.onSave(n.tagsIds)},children:({form:n,values:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,multiple:!0,name:"tagsIds",onCreateClick:()=>{r(!0)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.name))}),a&&(0,i.jsx)(gA,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e=>{o([...s,e]),n.change("tagsIds",[...t.tagsIds,e.id])}})]})})},eO=e=>{const{data:n,loader:t}=(s={organizationId:e.organizationId},rs(ya,s,[],undefined));var s;return t?null:(0,i.jsx)(Jz,{organizationId:e.organizationId,subtitle:e.subtitle,tags:n.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},nO=e=>{const n=os(),{organizationId:t}=ls(),[s,o]=(0,de.useState)(!1);return"associateTags"in e?(0,i.jsxs)(yz,{rightIcon:"pen",rightIconClick:()=>{o(!0)},title:n("tags_79499"),children:[f(e.tags)?(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Lm,{children:e.name},e.id))}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_tag_ajout_63348")}),s&&(0,i.jsx)(eO,{organizationId:t,subtitle:e.modalSubtitle,tagsIds:e.tags.map(({id:e})=>e),onClose:()=>{o(!1)},onSave:async n=>{await e.associateTags(n),e.reload(),o(!1)}})]}):(0,i.jsx)(yz,{title:n("tags_79499"),children:f(e.tags)?(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(Lm,{children:e.name},e.id))}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_tag_ajout_63348")})})};var tO=t(6502),iO=t(2716);const sO=e=>{qm("common-front/src/designSystem/components/__deprecated/progressGauge.tsx","common-front/src/designSystem/components/progressGauge.tsx");const n=(0,de.useMemo)(()=>(0,iO.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),t=(0,de.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),s=(0,de.useMemo)(()=>{const e=(0,tO.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,iO.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(t<=1?t:1))},[t]);return(0,i.jsxs)(Zr,{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:n(void 0),fill:Lr.colors.gray100.value}),(0,i.jsx)("path",{d:s(void 0),fill:Fm(t)})]})}),(0,i.jsxs)(Xl,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})},oO=({label:e,number:n})=>(0,i.jsxs)(Xl,{children:[(0,i.jsx)(Zr,{textAlign:"start",children:e}),(0,i.jsx)(Zr,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(Zr,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:n})]}),aO=({delegation:e})=>{const{translate:n}=fc(),{hasFeature:t}=Yy();return(0,i.jsx)(yz,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsxs)(Xl,{css:{justifyContent:"space-between"},direction:"column",height:1,children:[(0,i.jsx)(Zr,{css:{margin:"auto"},children:(0,i.jsx)(sO,{count:e.numberOfResources,total:e.maxResources??1/0})}),(0,i.jsx)(Xl,{direction:"column",gap:"4",children:t(In.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:n("dont_76603")}),(0,i.jsxs)(Xl,{color:"gray500",css:{fontSize:"$textSm",fontWeight:"$medium",lineHeight:"20px",justifyContent:"space-between"},direction:"column",gap:"2",children:[(0,i.jsx)(oO,{label:n("membres_accr_di_73664"),number:e.numberOfMembersAccredited}),(0,i.jsx)(oO,{label:n("membres_en_atte_57336"),number:e.numberOfMembersWaitingAccreditation}),(0,i.jsx)(oO,{label:n("membres_refus_31757"),number:e.numberOfMembersRefusedAccreditation})]})]})})]})})},rO={DESIGN:"design",LAYOUTS:{PLURAL:"layouts",SINGLE:"layout"}},dO="delegations-space",lO={DELEGATIONS_SPACE:e=>xs([eo.EVENT(e),dO]),DELEGATIONS_SPACE_DESIGN:e=>xs([lO.DELEGATIONS_SPACE(e),rO.DESIGN]),DELEGATIONS_SPACE_LAYOUTS:e=>xs([lO.DELEGATIONS_SPACE(e),rO.LAYOUTS.PLURAL]),DELEGATIONS_SPACE_LAYOUTS_CREATE:e=>Cs(lO.DELEGATIONS_SPACE_LAYOUTS(e)),DELEGATIONS_SPACE_LAYOUTS_UPDATE:e=>bs(xs([lO.DELEGATIONS_SPACE(e),rO.LAYOUTS.SINGLE,e.delegationsSpaceLayoutId]))},cO=({delegation:e})=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),a=ss(Wg),{canDelegationRead:r}=iC(),d=(0,de.useMemo)(()=>yx({organizationId:t,eventId:s,delegationId:o,formId:e.form.id}),[t,s,o,e.form.id]),l=(0,de.useMemo)(()=>Sx(t,vo.DELEGATION({organizationId:t,eventId:s,delegationId:o})),[t,s,o]);return(0,i.jsx)(yz,{title:n("param_tres_78420"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Nz,{label:n("cat_gorie_00291"),children:(0,i.jsx)(Ug,{to:vo.DELEGATION_CATEGORY({organizationId:t,eventId:s,delegationCategoryId:e.category.id}),children:e.category.name})}),(0,i.jsx)(Uz,{direction:"horizontal"}),r&&e.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nz,{label:n("d_l_gation_pare_68507"),children:(0,i.jsx)(Xl,{align:"center",css:{color:"$primary500",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(gc,{to:vo.DELEGATION({organizationId:t,delegationId:e.parent.id}),children:(0,i.jsx)(Lm,{color:"white",cursor:"pointer",size:"md",children:e.parent.name})})})}),(0,i.jsx)(Uz,{direction:"horizontal"})]}),(0,i.jsx)(Nz,{label:n("State"),children:(0,i.jsx)(Zr,{color:"gray800",children:(0,i.jsx)(Lm,{color:"success",children:n(e.state)})})}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Nz,{label:n("date_limite_d_i_79779"),children:(0,i.jsx)(Zr,{color:"gray800",children:e.deadlineDate?a.toLocaleString(e.deadlineDate,da.DateOnly.MonthLong):"-"})}),e.delegationsSpaceLayout&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Nz,{label:n("DelegationsSpaceLayout"),children:(0,i.jsx)(Ug,{to:lO.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:t,eventId:s,delegationsSpaceLayoutId:e.delegationsSpaceLayout.id}),children:e.delegationsSpaceLayout.name})})]}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Nz,{label:n("Form"),children:(0,i.jsx)(Ug,{css:{color:"$primary500"},to:d,children:e.form.name})}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Nz,{label:n("DelegationSpaceLink"),children:(0,i.jsx)(Ug,{css:{color:"$primary500"},to:l,children:n("portail_d_l_gat_06817")})})]})})},uO=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),a=ss(Dz),{mutate:r}=Va(),d=(0,de.useMemo)(()=>w(e.delegation.description)?a.renderText(e.delegation.description,{delegation:e.delegation}):"",[e.delegation]),l=(0,de.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]);return(0,i.jsx)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsx)(Xl,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)(aO,{delegation:e.delegation})}),(0,i.jsx)(Xl,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)(cO,{delegation:e.delegation})})]}),f(l)&&(0,i.jsx)(yz,{title:n("champs_de_formu_64126"),children:(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:l.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Lz,{customField:n,fields:e.delegation.fields})]},n.slug))})}),(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(yz,{title:n("reponsable_82458_plural"),children:f(e.delegation.leaders)?e.delegation.leaders.map((e,n)=>(0,i.jsxs)(de.Fragment,{children:[0!==n&&(0,i.jsx)(Yj,{height:"4"}),(0,i.jsx)(MC,{userInfo:e})]},e.id)):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_reponsabl_38504")})}),(0,i.jsx)(nO,{associateTags:e=>r({organizationId:t,eventId:s,massEdit:{reset:!1,selecteds:{ids:[o]},slug:Xe.Tag,strategy:Dn.Replace,value:e}}),modalSubtitle:n("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mz,{description:d}),(0,i.jsx)(Kz,{privateNote:e.delegation.privateNote})]})]})]})})},mO=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=fc(),{data:s,loader:o,reload:a}=el({organizationId:e,eventId:n,delegationId:t});return o||(0,i.jsx)(uO,{customFields:s.organization.customFields.nodes,delegation:s.organization.delegation,reload:a})},gO=({children:e,isCurrent:n,to:t})=>{const s=n?"$primary500":"$gray500";return t?(0,i.jsx)(Ug,{css:{color:s},to:t,children:e}):(0,i.jsx)(Zr,{as:"span",css:{color:s},children:e})},hO=({css:e,children:n})=>{const t=de.Children.toArray(n).filter(de.isValidElement);return(0,i.jsx)(Xl,{align:"center",as:"nav",css:{color:"$gray300",fontSize:"$textSm",fontWeight:"$medium","& i":{fontSize:"12px"},...e},gap:"2",children:t.map((e,n)=>(0,i.jsxs)(de.Fragment,{children:[n>0&&(0,i.jsx)(pc,{icon:"chevron-right",role:"presentation"}),e]},e.key??n))})},pO=e=>{switch(e){case IO.Event:return{color:"success",leftIcon:"calendar"};case IO.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return Ic()}};var IO;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}(IO||(IO={}));const fO=({state:e,userInfo:n,onClick:t})=>{const s=os(),o=w(n.name);return(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},onClick:t,children:[(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:e,onClick:Ou.A}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsx)(F_,{email:n.email,image:n.picture?.url,name:n.name,size:40}),(0,i.jsx)(ic,{width:"4"}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Zr,{ellipsis:!0,color:"gray700",children:o?n.name:n.email}),o&&(0,i.jsx)(Zr,{ellipsis:!0,color:"gray500",children:n.email})]}),n.source&&(0,i.jsx)(Zr,{children:(0,i.jsx)(Lm,{...pO(n.source),leftIconStyle:"solid",children:n.source===IO.Event?s("_v_nement_22345"):s("d_l_gation_pare_68507")})})]})},xO=({availableMembers:e,select:n,usersInfosIds:t})=>(0,i.jsx)(i.Fragment,{children:e.map(e=>{const s=t.includes(e.id)?"checked":"unchecked";return(0,i.jsx)(fO,{state:s,userInfo:e,onClick:()=>{n(e.id)}},e.id)})}),_O=({delegationId:e,nameOrEmail:n,organizationId:t,usersInfosIds:s,select:o})=>{const{data:a,loader:r}=Dl({organizationId:t,excludedDelegationId:e,name:w(n)?n:null});return r||(0,i.jsx)(xO,{availableMembers:a.organization.usersInfos.nodes,select:o,usersInfosIds:s})},jO=({delegationId:e,eventId:n,nameOrEmail:t,usersInfosIds:s,select:o})=>{const{data:a,loader:r}=rs("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:n,delegationId:e,name:w(t)?t:null},[Ko.ExistingVolunteerFragment],undefined);const d=(0,de.useMemo)(()=>{if(a.event){const e=a.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:IO.Event})),n=e.map(({id:e})=>e),t=a.event.delegation.parentUsersInfos.flatMap(e=>n.includes(e.id)?[]:[{...e,source:IO.ParentDelegation}]);return e.concat(t)}return[]},[a.event]);return r||(0,i.jsx)(xO,{availableMembers:d,select:o,usersInfosIds:s})},vO=({delegationId:e,eventId:n,organizationId:t,onClose:s,reload:o})=>{const a=os(),r=ss(ab),[d,l,c]=Dg(""),{mutate:u}=Sr(),{mutate:m}=Nl();return(0,i.jsx)(mA,{buttonText:a("ajouter_un_memb_33261"),icon:"sliders",initialValues:{usersInfosIds:[]},schema:r.adminAddSchema(),size:"md",subtitle:a(n?"ajouter_un_memb_95658":"ajouter_un_memb_89696"),title:a("add_member_to_delegation"),onClose:s,onSubmit:async i=>{n?await u({eventId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}):await m({organizationId:t,delegationId:e,selecteds:{ids:i.usersInfosIds}}),s(),o()},children:({form:s,values:o})=>{const r=e=>{s.change("usersInfosIds",v(o.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:a("rechercher_un_m_05904"),value:d,onChange:c}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:n?(0,i.jsx)(jO,{delegationId:e,eventId:n,nameOrEmail:l,select:r,usersInfosIds:o.usersInfosIds}):(0,i.jsx)(_O,{delegationId:e,nameOrEmail:l,organizationId:t,select:r,usersInfosIds:o.usersInfosIds})})]})}})},SO=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{showNotification:o}=Sy(),{mutate:a}=Xd();return(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_66412"),text:n("suppression_de_73669",e.delegation.name),onClose:e.onClose,onDelete:async()=>{await a({organizationId:t,eventId:s,selecteds:{ids:[e.delegation.id]}}),o(n("la_d_l_gation_31201",e.delegation.name)),e.onSuccess()}})},yO=e=>{const{params:{organizationId:n,eventId:t,delegationId:s},translate:o}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:vo.DELEGATIONS({organizationId:n,eventId:t}),children:o("d_l_gations_78318")}),(0,i.jsx)(gO,{to:vo.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name}),(0,i.jsx)(gO,{isCurrent:!0,to:vo.DELEGATION({organizationId:n,eventId:t,delegationId:s}),children:e.delegation.name})]})},CO=({delegation:e,reload:n})=>{const{history:t,translate:s,params:{organizationId:o,eventId:a,delegationId:r}}=fc(),d=ss(vS),{user:l}=ps(),{showNotification:c}=Sy(),{canDelegationEdit:u,canMemberAccredit:m,canMemberCreate:g}=tC(),{mutate:h}=Yd(),{mutate:p}=_r(),{mutate:I}=Va(),{mutate:f}=Qd(),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),S=e.lockedAt?.isValid;return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsx)(yO,{delegation:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[g&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:s("ajouter_un_memb_33261")})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(Em,{icon:"user-plus",onClick:()=>{t.push(Ev.CREATE({organizationId:o,eventId:a,delegationId:r}))},children:s("ajouter_un_nouv_29283")}),(0,i.jsx)(Em,{icon:"user-group",onClick:e=>{vm(e.target),v(!0)},children:s("ajouter_des_mem_06922")})]})]}),u&&(0,i.jsx)(yc,{to:bs(vo.DELEGATION({organizationId:o,eventId:a,delegationId:e.id})),children:s("_diter_la_d_l_g_30300")}),(u||m)&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[a&&(0,i.jsx)(Em,{download:`${e.name}-delegation-calendar`,icon:"arrow-down-to-bracket",target:"_blank",to:Ex(e.links.delegationCalendarLink,"pdf",{lang:l?.language}),children:s("t_l_charger_le_85972")}),m&&a&&(0,i.jsx)(Em,{icon:"check",onClick:async()=>{await p({eventId:a,delegationId:e.id,selecteds:{scope:{delegationId:e.id}}}),n()},children:s("valider_les_acc_80801")}),u&&(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>(async()=>{await f({organizationId:o,eventId:a,selecteds:{ids:[r]}}),c(s("l_e_mail_d_invi_08417"))})(),children:s("envoyer_l_e_mai_17491")}),u?S?(0,i.jsx)(Em,{icon:"lock-keyhole-open",onClick:async()=>{await I({organizationId:o,eventId:a,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Xe.IsLocked,strategy:Dn.Replace,value:!1}}),n()},children:s("d_verrouiller_67042")}):(0,i.jsx)(Em,{icon:"lock-keyhole",onClick:async()=>{await I({organizationId:o,eventId:a,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Xe.IsLocked,strategy:Dn.Replace,value:!0}}),n()},children:s("verrouiller_24528")}):null,u&&(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{delegationDuplicate:n}=await h({organizationId:o,eventId:a,delegationId:e.id});t.push(bs(vo.DELEGATION({organizationId:o,eventId:a,delegationId:n.id})))},children:s("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:u&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{_(!0)},children:s("supprimer_43083")})})]})]}),x&&(0,i.jsx)(SO,{delegation:e,onClose:()=>_(!1),onSuccess:()=>t.replace(a?vo.DELEGATIONS({organizationId:o,eventId:a}):Wo.COMMUNITY_DELEGATIONS(o))}),j&&(0,i.jsx)(vO,{delegationId:e.id,eventId:a,organizationId:o,reload:n,onClose:()=>{v(!1)}})]}),name:e.name,nameSuffix:S&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"lock-keyhole"})})}),(0,i.jsx)(ux,{placement:"top",children:s("cette_d_l_gatio_29556")})]}),subtext:s("_1_2_membres_04485",e.numberOfResources,d.toNumberOrInfinity(e.maxResources))})};var bO=t(6349);const AO=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),EO=()=>({border:{display:!1},grid:{color:Lr.colors.gray100.value}}),wO=({datasets:e,labels:n,options:t})=>{const s=(0,de.useId)(),o=(0,de.useRef)(null),a={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:EO()}};return(0,de.useEffect)(()=>{o.current&&o.current.destroy(),o.current=new bO.Ay(document.getElementById(s),{type:"bar",options:(0,oc.A)(a,t),data:{labels:n,datasets:e}})},[e,n,t]),(0,i.jsx)(Zr,{height:1,width:1,children:(0,i.jsx)("canvas",{id:s})})},$O=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>Hp(e.slots),[e.slots]),o=(0,de.useMemo)(()=>e.accreditation.hasSlots?s.map(e=>qp(t,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[s,e.accreditation]),a=(0,de.useMemo)(()=>{const t=s.some(e=>"number"==typeof e.maxResources),i=s.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,sc.A)([e.accreditation.willAutoAccredit?null:{label:n("souhait_es_78101"),data:s.map(e=>e.wishedResources),backgroundColor:t?s.map(e=>e.assignedResources+e.wishedResources<=(e.maxResources??1/0)?Lr.colors.primary400.value:Om(Lr.colors.primary400.value,.5)):Lr.colors.primary400.value},{label:n("affect_es_00048"),data:s.map(e=>e.assignedResources),backgroundColor:t?s.map(e=>e.assignedResources<=(e.maxResources??1/0)?Lr.colors.primary500.value:Om(Lr.colors.error500.value,.7)):Lr.colors.primary500.value},{label:n("scann_es_13169"),data:s.map(e=>e.scannedResources),backgroundColor:Lr.colors.primary900.value},t?{label:n("maximum_56225"),data:s.map(e=>e.maxResources??1/0),backgroundColor:Lr.colors.gray200.value}:null,i?{label:n("total_attribu_e_97130"),data:s.map(e=>e.delegationsTotalResources??0),backgroundColor:Lr.colors.gray400.value}:null])},[s]);return(0,i.jsx)(wO,{datasets:a,labels:o,options:{scales:{y:{...EO(),ticks:{precision:0},...AO(n("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...AO(n(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},TO=e=>{const n=(0,de.useMemo)(()=>e.event.delegation.allAccreditationsSlots.filter(n=>n.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)(yz,{title:e.accreditation.name,children:(0,i.jsx)(Zr,{height:380,width:1,children:(0,i.jsx)($O,{accreditation:e.accreditation,slots:n})})})},zO=e=>{const n=(0,de.useMemo)(()=>rp((0,wh.A)(e.event.delegation.allAccreditations.map(e=>{const n=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:n}}),e=>e.id)),[e.event]);return(0,i.jsx)(Xl,{direction:"column",gap:"4",children:f(n)?n.map(n=>(0,i.jsx)(TO,{accreditation:n,event:e.event},n.id)):(0,i.jsx)(fz,{})})},OO=()=>{const{params:{eventId:e,delegationId:n}}=fc(),{data:t,loader:s}=rs("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n allAccreditations {\n accreditationId\n willAutoAccredit\n\n accreditation {\n id\n name\n accreditationCategoryName\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n allAccreditationsSlots {\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:n},[],undefined);return s||(0,i.jsx)(zO,{event:t.event})},RO=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),{hasFeature:a}=Yy(),{canAccreditationRead:r,canCustomFieldRead:d,canDocumentRead:l,canMemberAccredit:c,canMemberDelete:u,canMemberEdit:m,canPrint:g}=tC(),h=(0,de.useMemo)(()=>e.organization.allowDelegationSpaceDownload||f(e.organization.delegation.customDocuments??[]),[e.organization]),p=(0,de.useMemo)(()=>g&&!!e.organization.delegation.event?.weezticketEventId&&!!e.organization.delegation.event?.numberOfZplDocuments,[g,e.organization]),I=(0,de.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),x=(0,de.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),_=e=>({organizationId:e?":organizationId":t,eventId:s?e?":eventId":s:void 0,delegationId:e?":delegationId":o});return fm(e.organization.delegation.name),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CO,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:vo.DELEGATION_DASHBOARD(_(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:vo.DELEGATION_MEMBERS(_(!1)),children:n("membres_125561",e.organization.delegation.numberOfResources)}),s&&a(In.Accreditation)&&(0,i.jsx)(EC,{path:vo.DELEGATION_ACCREDITATIONS(_(!1)),children:n("accr_ditations_39450")}),s&&a(In.Accreditation)&&(0,i.jsx)(EC,{path:vo.DELEGATION_REPORTING(_(!1)),children:"Reporting"}),s&&h&&(0,i.jsx)(EC,{path:vo.DELEGATION_DOCUMENTS(_(!1)),children:n("Documents")})]}),(0,i.jsx)($C,{path:vo.DELEGATION_DASHBOARD(_(!0)),children:(0,i.jsx)(mO,{})}),(0,i.jsx)($C,{path:vo.DELEGATION_MEMBERS(_(!0)),children:s?(0,i.jsx)(yC,{children:(0,i.jsx)(OT,{campaigns:e.organization.delegation.campaigns,canDuplicateMembers:m,canEditColumns:!0,canMemberAccredit:c,canMemberDelete:u,canMemberEdit:m,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:He.All,deleteFromEvent:!1,forDelegationsSpace:!1,getEditPath:n=>Wo.EDIT_USER_FORM(t,s,n.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!r,showAccreditationsEdit:c,showAccreditationsValidate:c,showCustomDocumentsColumns:l,showDeleteFromEvent:u,showDocumentsDownload:!0,showEditMode:m,showPrint:p})}):(0,i.jsx)(yC,{children:(0,i.jsx)(UT,{campaigns:e.organization.delegation.campaigns,canCustomFieldRead:d,canEditColumns:!0,canMemberDelete:u,canMemberEdit:m,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>Wo.COMMUNITY_EDIT_USER(t,e.id),showDocumentsDownload:!0,showEditMode:m})})}),(0,i.jsx)($C,{path:vo.DELEGATION_ACCREDITATIONS(_(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(xz,{canMemberAccredit:c,onlyVisible:!r})})}),(0,i.jsx)($C,{path:vo.DELEGATION_REPORTING(_(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(OO,{})})}),(0,i.jsx)($C,{path:vo.DELEGATION_DOCUMENTS(_(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(jz,{customDocuments:x,delegationsSpaceCustomBadges:I})})})]})]})},DO=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=fc(),{data:s,loader:o,reload:a}=rs("query Delegation(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\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 delegationCategory {\n id\n name\n }\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 numberOfZplDocuments\n weezticketEventId\n }\n\n links {\n delegationCalendarLink\n }\n }\n }\n}\n",{organizationId:e,eventId:n,delegationId:t},[Ko.OrganizationCustomFieldsFragment],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:vo.DELEGATION({organizationId:":organizationId",eventId:n?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(gs,{path:vo.DELEGATION_DASHBOARD({organizationId:e,eventId:n,delegationId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(RO,{organization:s.organization,reload:a})})]})},MO=({backgroundColor:e,button:n,iconColor:t,value:s,icon:o,text:a})=>(0,i.jsxs)(Xl,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Xl,{css:{borderBottom:n?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uA,{color:t??"primary",icon:o}),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(Zr,{color:"gray500",children:a}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:s})]}),n&&(0,i.jsx)(Xl,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:n})]}),PO=e=>{const n=os(),[t,s,o]=Dg(""),{data:a,loader:r}=rs("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:w(s)?s:void 0},[Ko.LeaderUserInfoFragment],undefined);const[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(null),[m,g]=(0,de.useState)(null),{floatingStyles:h}=(0,au.we)({elements:{reference:c,floating:m},placement:"bottom-start",middleware:[(0,au.cY)(8),(0,au.UU)(),(0,au.BN)()],whileElementsMounted:ru.ll}),p=(0,de.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),I=(0,de.useMemo)(()=>{const n=n=>void 0!==e.currentLeaders.find(e=>e.userInfo.id===n),t=(a.event?.collaborators??[]).map(({userInfo:e})=>e.id);return(a.event?.collaborators??[]).map(({userInfo:e})=>({...e,isAdmin:!0,isDisabled:n(e.id)})).concat((a.event?.volunteersRegistrations.nodes??[]).filter(({userInfo:e})=>!t.includes(e.id)).map(({userInfo:e})=>({...e,isAdmin:!1,isDisabled:n(e.id)})))},[a.event,e.currentLeaders]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{ref:u,onClick:e=>{Uc(e),l(!d)},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_17775"),value:t,onChange:o})}),(0,i.jsx)(Xl,{ref:g,css:{background:"white",border:"1px solid $gray100",borderRadius:"$2",boxShadow:"$md",display:d?"flex":"none",maxHeight:"360px",overflowY:"auto",py:"$2",zIndex:1e3,...h},direction:"column",width:p,onClick:e=>{Uc(e)},children:r||I.map(t=>(0,i.jsxs)(Xl,{align:"center",css:{cursor:t.isDisabled?"initial":"pointer",padding:"10px $4",userSelect:"none","&:hover":{background:t.isDisabled?"inherit":"$primary100"}},gap:"3",children:[(0,i.jsx)(MC,{badge:t.isAdmin&&(0,i.jsx)(Lm,{color:"primary",children:n("administrateur_38490")}),disabled:t.isDisabled,userInfo:t}),!t.isDisabled&&(0,i.jsx)(yc,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(t)}})]},t.id))})]})},kO=e=>{const n=os();return(0,i.jsxs)(Xl,{align:"center",gap:"5",children:[(0,i.jsx)(Zr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(MC,{userInfo:e.leader.userInfo})}),(0,i.jsx)(Zr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(nf,{shouldParseAsInt:!0,value:e.leader.role.id,onChange:n=>{e.onRoleChange(n)},children:e.roles.map((e,t)=>(0,i.jsx)("option",{value:e.id,children:n(e.name)},t))})}),(0,i.jsx)(Zr,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(pc,{icon:"trash-can"})})]})},FO=e=>{const n=os(),[t,s]=(0,de.useState)(e.currentLeaders),o=e.roles[0];return(0,i.jsxs)(Jg,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("modification_de_24714")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("les_responsable_92946")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(PO,{currentLeaders:t,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{s(t.concat([{userInfo:e,role:o}]))}}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:t.map((n,o)=>(0,i.jsx)(kO,{leader:n,roles:e.roles,onDelete:()=>{s((0,Bm.A)(t,n))},onRoleChange:n=>{s((0,mI.jM)(t=>{t[o].role=e.roles.find(e=>e.id===n)}))}},n.userInfo.id))}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{onClick:()=>{e.onSave(t.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:n("enregistrer_06519")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},NO=({leaders:e})=>{const{translate:n}=fc(),{designSystem:t}=fg(),s=t===pg?({children:e})=>(0,i.jsx)(Xl,{direction:"column",width:1,children:e}):({children:e})=>(0,i.jsx)(i.Fragment,{children:e});return f(e)?(0,i.jsx)(s,{children:e.map((e,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(Yj,{height:"4"}),(0,i.jsx)(MC,{badge:(0,i.jsx)(Lm,{color:"gray",children:n(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_reponsabl_38504")})},LO=e=>{const{translate:n,params:t,params:{organizationId:s,eventId:o}}=fc(),{canPositionEdit:a,canDelegationEdit:r}=tC(),d=(0,de.useMemo)(()=>(t.positionId||t.positionCategoryId)&&a||(t.delegationId||t.delegationCategoryId)&&r,[r,a,t]),[l,c]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yz,{rightIcon:d?"pen":void 0,rightIconClick:()=>{c(!0)},title:n("reponsable_82458_plural"),children:(0,i.jsx)(NO,{leaders:e.leaders})}),d&&l&&(0,i.jsx)(FO,{currentLeaders:e.leaders,eventId:o,organizationId:s,roles:e.roles,onClose:()=>{c(!1)},onSave:async n=>{await e.onSave(n),e.reload()}})]})},UO=e=>{const n=os();return"onSave"in e?(0,i.jsx)(LO,{...e}):(0,i.jsx)(yz,{title:n("reponsable_82458_plural"),children:(0,i.jsx)(NO,{leaders:e.leaders})})},VO=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=fc(),[a,r,d]=Dg(""),[l,c]=(0,de.useState)(0),{data:u,isLoading:m}=rs("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:t,eventId:s,level:s?kn.Event:kn.Organization,delegationCategoryId:o,name:w(r)?r:void 0,offset:l},[],undefined);const{numberOfPages:g,totalCount:h}=Jf(u.organization?.delegations);return(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_31213"),value:a,onChange:d})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("nom_de_la_d_l_g_28087")}),(0,i.jsx)(Mg,{children:n("State")})]}),numberOfPages:g,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):u.organization.delegations.nodes.map(o=>(0,i.jsxs)(Eg,{css:{cursor:"pointer"},onClick:()=>{e.push(vo.DELEGATION({organizationId:t,eventId:s,delegationId:o.id}))},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:o.name})}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{...sb(o.state),children:n(o.state)})})]},o.id)),setOffset:c,title:n("liste_des_d_l_g_86270"),totalCount:h})},BO=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=fc(),{roles:a}=Yy(),{mutate:r}=function(e={}){return ds("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)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{gap:"6",width:1,children:[(0,i.jsx)(MO,{text:n("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(MO,{text:n("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(Xl,{children:(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(VO,{})})}),s&&(0,i.jsx)(Xl,{children:(0,i.jsx)(UO,{leaders:e.delegationCategory.leaders,reload:e.reload,roles:a.delegationCategoryRoles,onSave:e=>r({organizationId:t,eventId:s,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:Dn.Replace}})})})]})})},WO=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_35330")],text:n("suppression_de_73669",e.delegationCategory.name),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id}),e.onSuccess()}})},GO=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:vo.DELEGATIONS({organizationId:n,eventId:t}),children:s("d_l_gations_78318")}),(0,i.jsx)(gO,{isCurrent:!0,to:vo.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:e.category.id}),children:e.category.name})]})},qO=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{canDelegationEdit:a}=tC(),{mutate:r}=function(e={}){return ds("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,l]=(0,de.useState)(!1);return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsx)(GO,{category:e.category}),buttons:(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(yc,{color:"white",onClick:()=>n.push(vo.DELEGATION_CATEGORY_UPDATE({organizationId:s,eventId:o,delegationCategoryId:e.category.id})),children:t("_diter_62574")}),a&&(0,i.jsx)(yc,{onClick:()=>{n.push(o?Wo.CREATE_DELEGATION(s,o,e.category.id):Wo.COMMUNITY_CREATE_DELEGATION(s,e.category.id))},children:t("ajouter_une_d_l_79133")}),a&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:t}}=await r({organizationId:s,eventId:o,delegationCategoryId:e.category.id});n.push(vo.DELEGATION_CATEGORY({organizationId:s,eventId:o,delegationCategoryId:t}))},children:t("dupliquer_28256")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:t("supprimer_43083")})})]})]}),d&&(0,i.jsx)(WO,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{l(!1)},onSuccess:()=>{n.replace(vo.DELEGATIONS({organizationId:s,eventId:o}))}})]}),name:e.category.name,subtext:t("_1_d_l_gation_80027_plural",e.category.numberOfDelegations)})},HO=()=>{const{translate:e,params:{organizationId:n,eventId:t,delegationCategoryId:s}}=fc(),o=ss(Dp),a=ss(kT),{canDocumentRead:r,canMemberAccredit:d,canMemberDelete:l,canMemberEdit:c}=tC(),[u,m,g]=sE(n,"delegationCategoryMembers.columns",["name","delegations"]),[h,p,I]=sE(n,"delegationCategoryMembers.limit",jg),[x,_,j]=sE(n,"delegationCategoryMembers.predicates",[]),v=(0,de.useMemo)(()=>lh(x),[x]),[S,y,C]=sE(n,"delegationCategoryMembers.sort",null),{data:b,isLoading:A}=rs("query DelegationCategoryMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $loadCustomDocuments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n customDocuments @include(if: $loadCustomDocuments) {\n ...CustomDocumentPopulation\n }\n }\n }\n}\n",{organizationId:n,eventId:t,loadCustomDocuments:!!t&&r},[Ko.SegmentCustomFieldFragment,Ko.CustomDocumentPopulationFragment],undefined);const E=g||I||j||C||A,w=(0,de.useMemo)(()=>b.organization?.customFields.nodes??[],[b.organization]),$=aE(w),T=(0,de.useMemo)(()=>b.organization?t?o.getDelegationCategoryMembersFilters(n,t,w,b.organization.event,b.organization?.event?.isWeezeventConnected??!1):a.getDelegationMembersFilters(w):[],[t,w]),z=(0,de.useMemo)(()=>t?o.getDelegationCategoryMembersPossibleColumns(n,w,b.organization?.event?.customDocuments??[],{hasCustomDocuments:r,isWeezeventConnected:b.organization?.event?.isWeezeventConnected??!1}):a.getDelegationMembersPossibleColumns(w),[n,t,w,b,r]);return E?(0,i.jsx)(_c,{}):(0,i.jsx)(yC,{children:(0,i.jsx)(nx,{columns:u,columnsSearch:[],columnsToIncludes:t?Rp:PT,eventId:t,filters:T,getMassActionId:e=>t?e.userInfo.id:e.id,limit:h,loadDataList:t?wr:dr,loadDataListParams:{delegationCategoryId:s,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:t?Er:ar,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:n,possibleColumns:z,predicates:v,renderActions:(e,n,o)=>(0,i.jsx)(vT,{campaigns:[],canMemberEdit:c,customFields:w,deleteFromEvent:!1,massActions:e,predicates:v,scope:{delegationCategoryId:s},showAccreditationsEdit:!1,showAccreditationsValidate:!!t&&d,showCustomDocumentsPrint:!!t&&r&&f(b.organization?.event?.customDocuments??[]),showDelete:!!t&&l,showPrint:!1,showWishedAccreditationsEdit:!1,showWishedProfileEdit:!1,sort:S,totalCount:n,onMassEditSuccess:o}),renderAllSelectedText:n=>e("les_1_membres_80039",n),renderPageSelectedText:n=>e("les_1_membres_00895",n),renderSelectAllText:n=>e("s_lectionner_le_81345",n),rendering:gp.List,setColumns:m,setLimit:p,setPredicates:_,setSort:y,showEditColumns:!0,showEditMode:c,showFilters:!0,showMassActions:c,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,showSelectAll:!0,sort:S,children:(0,i.jsx)(px,{renderCell:(e,n,s)=>t?(0,i.jsx)(Ew,{canChangeDelegation:!0,canMemberAccredit:!0,canMemberAssign:!1,column:e,customField:$.get(e.slug),eventId:t,reloadRow:s,row:n}):(0,i.jsx)(NT,{column:e,customField:$.get(e.slug),reloadRow:s,row:n,updatable:!0})})})})},YO=e=>{const{translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=fc(),a=e=>({organizationId:e?":organizationId":t,eventId:s?e?":eventId":s:void 0,delegationCategoryId:e?":delegationCategoryId":o}),r=e.organization.delegationCategory;return(0,i.jsxs)(AC,{children:[(0,i.jsx)(qO,{category:r,reload:e.reload}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:vo.DELEGATION_CATEGORY_DASHBOARD(a(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:vo.DELEGATION_CATEGORY_MEMBERS(a(!1)),children:n("membres_125561",r.numberOfResources)})]}),(0,i.jsx)($C,{path:vo.DELEGATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(BO,{delegationCategory:r,reload:e.reload})}),(0,i.jsx)($C,{path:vo.DELEGATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)(HO,{})})]})]})},ZO=e=>{const{params:{organizationId:n,eventId:t,delegationCategoryId:s}}=fc(),{data:o,loader:a,reload:r}=rs("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:n,delegationCategoryId:s},[Ko.LeaderInfosFragment],undefined);return a||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:vo.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(gs,{path:vo.DELEGATION_CATEGORY_DASHBOARD({organizationId:n,eventId:t,delegationCategoryId:s}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(YO,{organization:o.organization,reload:r})})]})},KO=()=>{const e=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"primary",children:(0,i.jsx)(Oc,{children:e("votre_import_es_05273")})}),(0,i.jsx)(ic,{height:"6"})]})};var XO;let QO=class extends ju{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return Jl.Ik().shape({acl:Jl.Yj().required(e),key:Jl.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>sS(Kv(e).extension)===eS.Zip),name:Jl.Yj().required(e),file:Jl.gl().test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(XO=void 0!==ts&&ts)?XO:Object])],QO);var JO,eR,nR;let tR=class extends ju{documentInputService;archiveInputService;constructor(e,n,t){super(t),this.documentInputService=e,this.archiveInputService=n}default(){return{input:{archive:this.documentInputService.documentInputDefault(),fieldId:-1}}}schema(){return Jl.Ik().shape({input:Jl.Ik().shape({archive:this.archiveInputService.schema(),fieldId:Jl.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};tR=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(JO=void 0!==Rb&&Rb)?JO:Object,"function"==typeof(eR=void 0!==QO&&QO)?eR:Object,"function"==typeof(nR=void 0!==ts&&ts)?nR:Object])],tR);const iR=()=>{const{translate:e,params:{organizationId:n}}=fc();return(0,i.jsx)(Zx,{heading:e("votre_fichier_d_51776"),subtitle:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("s_lectionnez_vo_27155",vS.bytesToGigabytes(Yv),vS.bytesToMegabytes(2e7))}}),children:(0,i.jsx)(qb,{accept:Jv.Archives,acl:"private",organizationId:n,prefix:"input.archive.",withFileField:!0})})},sR=({customFields:e})=>{const n=os();return(0,i.jsx)(Zx,{heading:n("correspondance_10480"),subtitle:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:n("_ditez_la_corre_24969")}}),children:(0,i.jsxs)(Qy,{label:n("sur_quel_champ_17516"),name:"input.fieldId",children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionnez_un_82446")}),e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})},oR=({customFileFields:e})=>(0,i.jsx)(sR,{customFields:e}),aR=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,rR=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),s=ss(tR),o=ss(ec),a=(0,de.useRef)(null),{data:r,loader:d}=rs("query FilesImportCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFileFields: customFields(eventId: $eventId, variety: UserInfo, fieldTypes: [File]) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n}\n",{organizationId:n,eventId:t},[Ko.CustomFieldImportFragment],undefined);const{mutate:l}=function(e={}){return ds("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}=Sy();return d||(0,i.jsx)(Fc,{customErrorRef:a,height:1,initialValues:{input:s.default().input},render:({form:s,handleSubmit:o,submitting:d,values:l})=>(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{isLoading:d,onClick:o,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:t?Wo.VOLUNTEERS(n,t):Ms.COMMUNITY_USERS({organizationId:n}),heading:e("nouvel_import_48306"),children:(0,i.jsxs)(kx,{ref:a,children:[s.getState().submitSucceeded&&(0,i.jsx)(KO,{}),(0,i.jsx)(Mc,{}),(0,i.jsxs)(Xl,{direction:"column",gap:"5",children:[(0,i.jsx)(iR,{}),l.input.archive?.file&&aR(s)&&(0,i.jsx)(oR,{customFileFields:r.organization.customFileFields.nodes})]})]})}),validate:o.validateForForm(s.schema()),onSubmit:async({input:e})=>{const i=(e=>{const n={...e.archive};return delete n.file,{...e,archive:n}})(e);try{const{jobId:e}=await l({organizationId:n,eventId:t,input:i});a.current&&(a.current.scrollTop=0),c(e,n,t)}catch{}}})},dR=e=>{const{translate:n}=fc(),{data:t}=Xa({organizationId:e.organizationId}),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)([]),d=(0,de.useMemo)(()=>(0,Tg.A)((t.organization?.events.nodes??[]).filter(n=>n.id!==e.eventId),e=>b(e.name)),[t.organization,e.eventId]);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"clone",children:n("dupliquer_vers_48809")}),(0,i.jsxs)(Gf,{gap:"6",children:[(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("toutes_les_info_60876")}),(0,i.jsx)(Oc,{children:n("certains_param_76352")})]}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("sur_quel_v_nem_94155"),renderOnPortal:!0,values:a,onChange:r,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:_(a),isLoading:s,onClick:async()=>{const n=a[0];void 0!==n&&(o(!0),await e.onSuccess(n),e.onClose())},children:n("dupliquer_28256")})})]})})},lR=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{canFormEdit:o}=iC(),{showNotification:a}=Sy(),{mutate:r}=function(e={}){return ds("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)}(),{mutate:d}=function(e={}){return ds("mutation FormDelete($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n formDelete(organizationId: $organizationId, eventId: $eventId, formId: $formId) {\n id\n }\n}\n",e)}(),[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(!1),g=(0,de.useCallback)(n=>r({organizationId:t,eventId:s,formId:e.form.id,newEventId:n}),[s,r,t,e.form]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(Ug,{to:Ks.FORM_ELEMENTS({organizationId:t,eventId:s,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(Zr,{color:"gray500",children:[n("nombre_de_champ_91879")," ",(0,i.jsx)(s_,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(lC,{permissions:nC.FORM_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[e.canDuplicate&&(0,i.jsx)(Em,{icon:"clone",onClick:async n=>{Uc(n),await r({organizationId:t,eventId:s,formId:e.form.id}),e.reload()},children:n("dupliquer_28256")}),o&&s&&e.canDuplicate&&(0,i.jsx)(Em,{icon:"clone",onClick:()=>c(!0),children:n("dupliquer_sur_u_11076")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{Uc(e),m(!0)},children:n("supprimer_43083")})})]})]})})]}),l&&(0,i.jsx)(dR,{eventId:s,organizationId:t,onClose:()=>c(!1),onSuccess:g}),u&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_75358"),text:n("suppression_de_73669",e.form.name),onClose:()=>m(!1),onDelete:async()=>{await d({organizationId:t,eventId:s,formId:e.form.id}),a(n("le_formulaire_76783",e.form.name)),e.reload()}})]})};var cR;let uR=class extends ju{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return Jl.Ik().shape({form:this.formInputSchema()})}};uR=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(cR=void 0!==ts&&ts)?cR:Object])],uR);const mR=e=>{const n=os(),t=ss(uR),{mutate:s}=function(e={}){return ds("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)(mA,{buttonText:n("cr_er_le_formul_42369"),icon:"sliders",initialValues:{form:t.formInputDefault()},schema:t.createFormSchema(),size:"md",title:n("nouveau_formula_44488"),onClose:e.onClose,onSubmit:async n=>{const{formCreate:t}=await s({organizationId:e.organizationId,eventId:e.eventId,form:n.form});e.onSuccess(t.id)},children:(0,i.jsx)(pu,{label:n("nom_du_formulai_14952"),name:"form.name"})})},gR=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{canFormEdit:a}=tC(),[r,d]=(0,de.useState)(e.isCreateOpen);return(0,i.jsxs)(bC,{gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:t("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),a&&e.canCreateNewForm&&(0,i.jsx)(yc,{onClick:()=>{d(!0)},children:t("cr_er_un_formul_78352")}),r&&(0,i.jsx)(mR,{eventId:o,organizationId:s,onClose:()=>{d(!1)},onSuccess:e=>{n.push(Ks.FORM_ELEMENTS({organizationId:s,eventId:o,formId:e}))}})]})},hR=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:72,width:1})]}),pR=e=>{const{translate:n}=fc(),{event:t}=Ly(),{hasFeature:s}=Yy();fm(`${t?.name??n("communaut_20896")} ${n("Form_plural")}`);const[o,a]=(0,de.useState)(""),r=(0,de.useMemo)(()=>w(o)?e.forms.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.id.toString(10)===o):e.forms,[e.forms,o]),d=(0,de.useMemo)(()=>0===e.forms.length||s(In.Multiform),[e.forms]);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(gR,{canCreateNewForm:d,isCreateOpen:e.isCreateOpen,isSearchVisible:f(e.forms),name:o,setName:a}),(0,i.jsx)(yC,{children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(hR,{})]}):0===e.forms.length?(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Jw,{subtitle:n("cr_er_vos_formu_26049"),title:n("aucun_formulair_74743")})}):(0,i.jsxs)(i.Fragment,{children:[!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("vous_avez_attei_23858")}),(0,i.jsx)(Oc,{children:n("votre_abonnemen_18069")})]}),(0,i.jsx)(ic,{height:"7"})]}),r.map(n=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(lR,{canDuplicate:d,form:n,reload:e.reload}),(0,i.jsx)(ic,{height:"3"})]},n.id))]})})]})},IR=e=>{const{organizationId:n,eventId:t}=ls(),{data:s,isLoading:o,reload:a}=al({organizationId:n,level:kn.Event,eventId:t}),r=(0,de.useMemo)(()=>(0,Tg.A)(s.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[s.organization]);return(0,i.jsx)(pR,{forms:r,isCreateOpen:e.isCreateOpen,isLoading:o,reload:a})},fR=e=>{const{organizationId:n}=ls(),{data:t,isLoading:s,reload:o}=al({organizationId:n,level:kn.Organization}),a=(0,de.useMemo)(()=>(0,Tg.A)(t.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[t.organization]);return(0,i.jsx)(pR,{forms:a,isCreateOpen:e.isCreateOpen,isLoading:s,reload:o})};var xR=t(5848);const _R=e=>{const{translate:n}=fc(),{isLoading:t,copy:s}=ay(),o=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("script",{async:!0,defer:!0,src:`https://${ee.HEAVENT_PUBLIC_URL.subdomain}.${ee.WEEZEVENT_DOMAIN}/weez.js`,type:"text/javascript"}),(0,i.jsx)("a",{className:"weezevent-widget-integration grootlink","data-iframe-background":"transparent","data-type":"groot",href:e.link,children:"WeezCrew"})]});return(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[e.alert,(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)($c,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.iframeLabel}),(0,i.jsx)(Zr,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)("code",{style:{overflowWrap:"anywhere"},children:(0,xR.qV)((0,i.jsx)(o,{}))})})]}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:t,leftIcon:"copy",onClick:()=>s((0,xR.qV)((0,i.jsx)(o,{}))),children:n("copier_75889")})})]})]})},jR=e=>{const{translate:n}=fc(),{isLoading:t,copy:s}=ay();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"end",gap:"5",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)($c,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.heading}),(0,i.jsx)(Zr,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)(Ug,{css:{inlineSize:"max-content",fontWeight:"normal",textDecoration:"underline",display:"inline-block",maxWidth:"40vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"top","& a":{display:"inline !important"}},hideIcon:!0,to:e.link,children:e.link})})]}),(0,i.jsx)(yc,{isLoading:t,leftIcon:"copy",onClick:()=>s(e.link),children:n("copier_75889")})]}),(0,i.jsxs)(Xl,{align:"center",css:{bd:!0,borderRadius:"$1",padding:"$6 $8"},direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{align:"center",direction:"column",children:[(0,i.jsx)($c,{children:n("qr_code_60722")}),(0,i.jsx)(wc,{textStyle:"subtitle",children:e.qrCodeDescription})]}),(0,i.jsx)(Zr,{height:120,width:120,children:(0,i.jsx)("img",{height:"100%",src:bx(e.link,{height:120,width:120}),width:"100%"})}),(0,i.jsx)(yc,{download:"qr-code",to:bx(e.link,{height:120,width:120}),children:n("t_l_charger_le_18439")})]})]})},vR=({children:e,isActive:n,onClick:t,replace:s=!0,to:o})=>{const a=us(),r=n?.(a.pathname)??a.pathname===o;return(0,i.jsx)(Xl,{align:"center",css:{borderBottom:r?"2px solid $primary500":"2px solid transparent",borderTop:"2px solid transparent",color:r?"$primary500":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(gc,{height:1,replace:s,to:o,width:1,onClick:async()=>{t&&await t()},children:e})})},SR=e=>(0,i.jsx)(Xl,{as:Yl.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),yR=()=>{const{translate:e,params:n}=fc();return(0,i.jsxs)(SR,{height:1,width:1,children:[(0,i.jsx)(vR,{to:Ks.FORM_ELEMENTS(n),children:e("champs_91671")}),(0,i.jsx)(vR,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:Ks.FORM_PARAMETERS_GENERAL(n),children:e("param_tres_78420")}),(0,i.jsx)(vR,{to:Ks.FORM_INTEGRATION(n),children:e("int_gration_10662")}),(0,i.jsx)(vR,{to:Ks.FORM_EMAILS(n),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(vR,{to:Ks.FORM_PREVIEW(n),children:e("aper_u_25595")})]})},CR=e=>{const{translate:n}=fc(),{canFormEdit:t}=tC();return(0,i.jsx)(Nx,{button:t&&e.button,category:n("cr_ation_d_un_f_67278"),color:"dark",heading:e.title,onClose:e.onClose,children:(0,i.jsxs)(Wu,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(yR,{}),(0,i.jsx)(Zr,{css:{overflowY:"auto"},children:e.children})]})})},bR=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=fc(),{data:a}=rl({organizationId:t,formId:o});fm(a.organization?.form.name??"");const r=yx({organizationId:t,eventId:s,formId:o});return(0,i.jsx)(CR,{title:a.organization?.form.name??"-",onClose:()=>{e.push(Ks.FORMS({organizationId:t,eventId:s}))},children:(0,i.jsx)(Xl,{justify:"center",width:1,children:(0,i.jsxs)(Xl,{css:{paddingBlockStart:"$8"},gap:"8",width:"$container",children:[(0,i.jsx)(Xl,{direction:"column",gap:"6",children:(0,i.jsx)(jR,{heading:n("FormLink"),link:r,qrCodeDescription:n("facilitez_la_co_59826")})}),(0,i.jsx)(Xl,{direction:"column",gap:"6",children:(0,i.jsx)(_R,{alert:(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("comment_marche_73229")}),(0,i.jsx)(Oc,{children:n("ce_code_va_vous_31197")})]}),heading:n("iframe_27513"),iframeLabel:n("code_html_pour_12471"),link:r})})]})})})},AR=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=fc(),{data:a}=rl({organizationId:t,formId:o});fm(a.organization?.form.name??"");const[r,d]=(0,de.useState)("opened"),l=yx({organizationId:t,eventId:s,formId:o,query:{preview:!0,previewState:r}});return(0,i.jsx)(CR,{title:a.organization?.form.name??"-",onClose:()=>{e.push(Ks.FORMS({organizationId:t,eventId:s}))},children:(0,i.jsxs)(Xl,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(Xl,{direction:"column",width:"$container",children:[(0,i.jsx)(ic,{height:"8"}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textLg semiBold",children:n("aper_u_du_formu_51076")}),(0,i.jsx)(Zr,{color:"gray500",children:n("pr_visualiser_v_58073")})]}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:r,onChange:e=>{d(e)},children:[(0,i.jsx)("option",{value:"opened",children:n("Opened")}),(0,i.jsx)("option",{value:"closed",children:n("cl_tur_79063")}),(0,i.jsx)("option",{value:"blocked",children:n("acc_s_r_fus_68875")})]})})]})]}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:l,style:{border:"none"},width:"100%"})})]})})},ER=e=>{const{history:n,translate:t}=fc();return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"triangle-exclamation",children:t("changements_non_17558")}),(0,i.jsx)(Gf,{children:(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:t("voulez_vous_qui_84408")}),(0,i.jsx)(Zr,{color:"gray500",children:t("des_donn_es_ne_27178")})]})}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{color:"error",onClick:()=>n.goBack(e.fallbackPath),children:t("quitter_sans_sa_28486")})})]})})},wR=e=>(0,hd.createPortal)((0,i.jsx)(Zr,{css:{background:"$gray50",inset:0,position:"fixed",zIndex:"100"},children:e.children}),document.body),$R=Nr("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary500",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary500",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary500",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary600"},"& > .h-button-dropdown-content:hover":{background:"$primary600",border:"1px solid $primary600",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary600",border:"1px solid $primary600"}},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"}}),TR=(0,de.forwardRef)((e,n)=>{const{history:t}=fc();return(0,i.jsxs)($R,{color:e.color,size:e.size,children:[(0,i.jsx)(Xl,{ref:n,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:n=>{e.onClick&&e.onClick(n),w(e.path)&&t.push(e.path)},children:e.children}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xl,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(pc,{icon:"chevron-down"})})}),(0,i.jsx)(wm,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});TR.displayName="ButtonDropdown";var zR,OR;let RR=class extends ju{documentInputService;constructor(e,n){super(n),this.documentInputService=e}customFieldInputDefault(e,n){const t=e?.customFieldCategoryId??n[0]?.id;if(void 0===t)throw new Error("No custom fields category to put the new field in");const i=e?.fieldType??_n.Text,s=e?.fieldSubtype??xn.Freeform;return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:t,description:e?.description??"",variety:e?.variety??Ke.UserInfo,fieldType:i,fieldSubtype:s,listType:e?.listType??zn.Default,fileType:e?.fileType??vn.Default,isPrivate:e?.isPrivate??!1,values:f(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,canBeUpdatedByUrl:e?.canBeUpdatedByUrl??!1,validationRules:{...vb(jb({fieldType:i,fieldSubtype:s,fieldProperty:e?.fieldProperty})),...e?.validationRules},addressPostalCodeCustomFieldId:e?.addressPostalCodeCustomFieldId??null,addressCityCustomFieldId:e?.addressCityCustomFieldId??null,addressCountryCustomFieldId:e?.addressCountryCustomFieldId??null}}customFieldInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_du_champ_17959")),label:Jl.Yj(),customFieldCategoryId:Jl.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:Jl.Yj().required(this.t("le_type_est_req_41180")).oneOf(ui,this.t("le_type_est_req_41180")),fieldSubtype:Jl.Yj().required(this.t("le_sous_type_es_85221")).oneOf(ci,this.t("le_sous_type_es_85221")),listType:Jl.Yj().required(this.t("le_style_des_op_46016")).oneOf(_i,this.t("le_style_des_op_46016")),fileType:Jl.Yj().required(this.t("l_affichage_du_11344")).oneOf(mi,this.t("l_affichage_du_11344")),isPrivate:Jl.zM().nullable(),hasCondition:Jl.zM().nullable(),values:Jl.YO().when("fieldType",{is:_n.Select,then:e=>e.of(Jl.Ik().shape({id:Jl.ai(),value:Jl.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:Jl.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:Jl.gl(),canSelectMultiple:Jl.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:Jl.zM().required(),canBeUpdatedByUrl:Jl.zM().required(),validationRules:Jl.Ik().required().when(["fieldType","fieldSubtype"],([e,n])=>this.validationRulesSchema(e,n)),addressPostalCodeCustomFieldId:Jl.ai().nullable(),addressCityCustomFieldId:Jl.ai().nullable(),addressCountryCustomFieldId:Jl.ai().nullable()})}validationRulesSchema(e,n){const t=()=>Jl.ai().nullable().integer(this.t("ce_nombre_doit_35487")),i=e=>t().min(e,this.t("ce_nombre_doit_66066",e)),s=(e,n)=>e.when(n,([e],n)=>"number"==typeof e?n.min(e,this.t("le_maximum_doit_04562")):n);switch(jb({fieldType:e,fieldSubtype:n})){case"text":return Jl.Ik().shape({mode:Jl.Yj().oneOf([...fb]),minLength:i(0),maxLength:s(i(1),"minLength"),allowedCharacters:Jl.Yj().oneOf([...xb]),regex:Jl.Yj().when("mode",{is:"regex",then:e=>e.required(this.t("l_expression_r_88693")).test("valid-regex",this.t("l_expression_r_68347"),e=>function(e){try{return new RegExp(e??""),!0}catch{return!1}}(e))}),regexMessage:Jl.Yj().when("mode",{is:"regex",then:e=>e.required(this.t("le_message_d_er_84907"))})});case"number":return Jl.Ik().shape({min:t(),max:s(t(),"min")});case"date":return Jl.Ik().shape({range:Jl.Yj().oneOf([..._b]),start:e_.nullable().when("range",{is:"between",then:e=>e.required(this.t("la_date_de_d_bu_05030"))}),end:e_.nullable().when("range",{is:"between",then:e=>e.required(this.t("la_date_de_fin_32246"))}).test("end-after-start",this.t("la_date_de_fin_21930"),function(e){const n=this.parent.start;return!n||!e||la(e)>=la(n)})});default:return Jl.Ik()}}createUpdateCustomFieldSchema(){return Jl.Ik().shape({customField:this.customFieldInputSchema()})}};RR=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(zR=void 0!==Rb&&Rb)?zR:Object,"function"==typeof(OR=void 0!==ts&&ts)?OR:Object])],RR);const DR=({name:e,...n})=>(0,i.jsx)(ld.D0,{name:e,render:e=>(0,i.jsx)(Vb,{value:e.input.value,onChange:n=>{e.input.onChange(n)},...n})}),MR=e=>{const{user:n}=ps(),{setNodeRef:t,style:s,handleProps:o}=pI(e.value.id);return(0,i.jsxs)(Xl,{ref:t,align:"center",gap:"4",style:s,children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...o,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),e.isEdit&&(a=n.email,["ben.goldsworthy@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(a))&&(0,i.jsx)(Zr,{css:{width:"fit-content"},fontSize:"textXs",textAlign:"center",children:e.value.id}),e.showColor&&(0,i.jsx)(Zr,{children:(0,i.jsx)(DR,{borderRadius:16,name:`customField.values[${e.index}].color`,size:16})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{name:`customField.values[${e.index}].value`})}),(0,i.jsx)(Zr,{color:"gray500",css:{cursor:"pointer"},onClick:e.onDelete,children:(0,i.jsx)(pc,{icon:"trash-can"})})]});var a},PR=e=>{const n=os(),t=(0,de.useCallback)((n,t)=>{e.change("customField.values",S(e.values,n,t))},[e.values,e.change]),s=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("valeurs_de_la_l_43599")}),(0,i.jsxs)(Xl,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[s?(0,i.jsx)(yI,{ids:e.values.map(e=>e.id),onReorder:t,children:(0,i.jsx)(Xl,{direction:"column",gap:"3",children:e.values.map((n,t)=>(0,i.jsx)(MR,{index:t,isEdit:e.isEdit,showColor:e.showColor,value:n,onDelete:()=>{e.change("customField.values",y(e.values,t))}},n.id))})}):e.values.map((e,n)=>(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{name:`customField.values[${n}].value`})},n)),(0,i.jsxs)(Zr,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:()=>{const n=Math.min(0,...e.values.map(e=>e.id??0))-1;e.change("customField.values",e.values.concat([{id:n,value:""}]))},children:["+ ",n("ajouter_une_nou_98358")]})]})]})},kR=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>({organizationId:e.organizationId,eventId:e.eventId,variety:e.customField.variety}),[e.customField.variety,e.eventId,e.organizationId]),s=n=>(0,Tg.A)(e.linkableCustomFields.filter(e=>function(e,n,t){return yb(e,n)&&n.fieldType===Sb.find(e=>e.key===t).fieldType}(t,e,n)),e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:pb(e)},e.id));return(o={fieldType:e.customField.fieldType,fieldProperty:e.fieldProperty}).fieldType===_n.Address&&o.fieldProperty===fn.Custom?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("champs_li_s_63973"),subtitle:n("quand_une_adres_32686"),children:(0,i.jsxs)(FA,{heading:n("champs_li_s_63973"),children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("code_postal_40328"),name:"customField.addressPostalCodeCustomFieldId",placeholder:n("aucun_93456"),children:s("addressPostalCodeCustomFieldId")}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("ville_67740"),name:"customField.addressCityCustomFieldId",placeholder:n("aucun_93456"),children:s("addressCityCustomFieldId")}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("Country"),name:"customField.addressCountryCustomFieldId",placeholder:n("aucun_93456"),children:s("addressCountryCustomFieldId")})]})})]}):null;var o},FR=Nr("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:"$primary50",border:"1px solid $primary500",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary500",border:"1px solid $primary500"}}}},defaultVariants:{state:"unchecked"}}),NR=e=>(qm("common-front/src/designSystem/components/radioRow.tsx","common-front/src/designSystem/components/radioCard.tsx for card-style radio buttons, or create a new component following that pattern for other styles of radio button"),(0,i.jsxs)(FR,{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)(pc,{icon:"check"})})]})),LR=({description:e,label:n,name:t,value:s})=>{const{inputId:o,descId:a}=Vc();return(0,i.jsx)(ld.D0,{name:t,render:t=>{const r=t.input.checked?"checked":"unchecked";return(0,i.jsx)(NR,{descId:a,inputId:o,state:r,onClick:()=>{t.input.onChange(s)},children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(uu,{htmlFor:o,children:(0,i.jsx)(Zr,{children:n})}),e&&(0,i.jsx)(Zr,{fontWeight:"regular",id:a,children:e})]})})},type:"radio",value:s})},UR="customField.validationRules",VR=e=>{const{translate:n}=fc(),t=jb({...e.customField,fieldProperty:e.fieldProperty});if(null===t)return null;{const s=e.customField.validationRules,o=e.customField.validationRules;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsxs)(Zx,{heading:n("r_gles_de_valid_33082"),subtitle:n("les_valeurs_sai_90911"),children:["text"===t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(FA,{heading:n("type_de_r_gles_26838"),children:[(0,i.jsx)(LR,{label:n("r_gles_par_d_fa_31067"),name:`${UR}.mode`,value:"default"}),(0,i.jsx)(LR,{description:n("la_valeur_doit_29705"),label:n("expression_r_gu_99597"),name:`${UR}.mode`,value:"regex"})]}),"regex"===s.mode?(0,i.jsxs)(FA,{heading:n("expression_r_gu_99597"),children:[(0,i.jsx)(pu,{label:n("expression_r_gu_99597"),name:`${UR}.regex`,placeholder:"^[A-Z]{2}[0-9]{4}$"}),(0,i.jsx)(pu,{label:n("message_d_erreu_68530"),name:`${UR}.regexMessage`})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(FA,{heading:n("espaces_22926"),children:[(0,i.jsx)(Bx,{name:`${UR}.noLeadingTrailingSpaces`,children:n("pas_d_espace_au_17159")}),(0,i.jsx)(Bx,{name:`${UR}.noSpaces`,children:n("aucun_espace_57608")})]}),(0,i.jsx)(FA,{heading:n("nombre_de_carac_58931"),children:(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{label:n("minimum_26731"),name:`${UR}.minLength`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{label:n("maximum_56225"),name:`${UR}.maxLength`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})}),(0,i.jsx)(FA,{heading:n("caract_res_auto_81544"),children:(0,i.jsxs)(Qy,{label:n("caract_res_auto_81544"),name:`${UR}.allowedCharacters`,children:[(0,i.jsx)("option",{value:"all",children:n("tous_les_caract_05992")}),(0,i.jsx)("option",{value:"numbers",children:n("chiffres_unique_20331")}),(0,i.jsx)("option",{value:"noSymbols",children:n("pas_de_symboles_28799")}),(0,i.jsx)("option",{value:"uppercase",children:n("majuscules_uniq_62106")}),(0,i.jsx)("option",{value:"lowercase",children:n("minuscules_uniq_30465")})]})})]})]}),"number"===t&&(0,i.jsx)(FA,{heading:n("valeur_22437"),children:(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{label:n("minimum_26731"),name:`${UR}.min`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{label:n("maximum_56225"),name:`${UR}.max`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})}),"date"===t&&(0,i.jsxs)(FA,{heading:n("dates_accept_es_28396"),children:[(0,i.jsx)(LR,{label:n("toutes_les_date_15702"),name:`${UR}.range`,value:"any"}),(0,i.jsx)(LR,{label:n("dates_pass_es_u_19138"),name:`${UR}.range`,value:"past"}),(0,i.jsx)(LR,{label:n("entre_deux_date_48809"),name:`${UR}.range`,value:"between"}),"between"===o.range&&(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(Wx,{label:n("d_but_41840"),name:`${UR}.start`})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(Wx,{label:n("fin_60104"),name:`${UR}.end`})})]})]})]})]})}};var BR;!function(e){e.Basic="Basic",e.Advanced="Advanced"}(BR||(BR={}));const WR=e=>{const{translate:n}=fc(),{showNotification:t}=Sy(),s=ss(RR),o=zg(),a=ss(ec),{mutate:r}=function(e={}){return ds("mutation CustomFieldCategoryCreate(\n $organizationId: OrganizationId!\n $category: CustomFieldsCategoryInput!\n) {\n customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n id\n name\n }\n}\n",e)}(),{canCustomFieldEdit:d}=iC(),l=(0,de.useRef)(null);fm((0,de.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.customField.name):n("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]));const c=(0,de.useMemo)(()=>(0,Tg.A)(e.organization.customFields.nodes.filter(n=>n.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,m]=(0,de.useState)(iA(e.organization.customFieldsCategories.nodes)),[g,h]=(0,de.useState)(e.initialValues.customField.fieldType),[p,I]=(0,de.useState)(e.initialValues.customField.hasCondition),[x,_]=(0,de.useState)(c.find(n=>n.id===e.initialValues.customField.conditionCustomFieldId)),[j,v]=(0,de.useState)(e.isEdit&&((S=e.initialValues.customField).variety!==Ke.UserInfo||w(S.label)||S.fieldSubtype!==xn.Freeform||S.listType!==zn.Default||S.fileType!==vn.Default||S.isEncrypted||S.canBeUpdatedByUrl||!0===S.isPrivate||!0===S.hasCondition||function(e){const n=e,t=e,i=e;return"regex"===n.mode||!0===n.noLeadingTrailingSpaces||!0===n.noSpaces||"number"==typeof n.minLength||"number"==typeof n.maxLength||void 0!==n.allowedCharacters&&"all"!==n.allowedCharacters||"number"==typeof t.min||"number"==typeof t.max||void 0!==i.range&&"any"!==i.range}(S.validationRules)||Sb.some(({key:e})=>S[e]))?BR.Advanced:BR.Basic);var S;const[y,C]=(0,de.useState)(!1),b=j===BR.Advanced,A=!e.isFromForm,E=x?.fieldType===_n.Checkbox,$=eA(x);return(0,i.jsx)(Fc,{customErrorRef:l,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:s,submitting:a,values:S})=>{const w=()=>{Sb.forEach(({key:e})=>{t.change(`customField.${e}`,null)})},T=(n,i)=>{t.batch(()=>{t.change("customField.fieldType",n),t.change("customField.fieldSubtype",i),t.change("customField.validationRules",vb(jb({fieldType:n,fieldSubtype:i,fieldProperty:e.fieldProperty}))),w()})},z=(S.customField.variety===Ke.Delegation||S.customField.variety===Ke.UserInfo)&&g===_n.Text,O=e.isEdit||S.customField.fieldSubtype!==xn.Freeform,R=(S.customField.variety===Ke.Delegation||S.customField.variety===Ke.UserInfo)&&g!==_n.Validation&&!0!==e.isFromForm,D=c.filter(n=>function(e,n){return n.id!==e.id&&yb(e,n)&&Cb.includes(n.fieldType)}({organizationId:e.organizationId,eventId:e.customFieldEventId,variety:S.customField.variety},n)),M=(S.customField.variety===Ke.Delegation||S.customField.variety===Ke.UserInfo)&&f(D),P=b&&S.customField.fieldType===_n.Text,k=b&&S.customField.fieldType===_n.Select,F=b&&S.customField.fieldType===_n.File,N=e.isEdit&&!0===e.initialValues.customField.canSelectMultiple&&!0!==S.customField.canSelectMultiple,L=S.customField.variety===Ke.UserInfo&&gb.includes(g);return(0,i.jsx)(Nx,{button:e.isEdit?(0,i.jsx)(yc,{isLoading:a,onClick:s,children:n("mettre_jour_85141")}):null,category:e.isEdit?n("CustomFieldUpdate"):n("CustomFieldCreate"),color:"dark",heading:e.isEdit?e.initialValues.customField.name:n("nouveau_champ_p_27686"),onClose:e.onClose,children:(0,i.jsxs)(kx,{ref:l,children:[(0,i.jsx)(ud,{name:"customField.fieldType",onChange:e=>{h(e),e===_n.Validation&&t.change("customField.isPrivate",!1)}}),(0,i.jsx)(ud,{name:"customField.variety",onChange:()=>{t.batch(()=>{w(),t.change("customField.hasCondition",!1),t.change("customField.conditionCustomFieldId",null)}),_(void 0)}}),(0,i.jsx)(ud,{name:"customField.fieldSubtype",onChange:e=>{t.change("customField.isEncrypted",e!==xn.Freeform)}}),(0,i.jsx)(ud,{name:"customField.hasCondition",onChange:e=>{t.change("customField.conditionCustomFieldId",D[0]?.id??null),I(e)}}),(0,i.jsx)(ud,{name:"customField.conditionCustomFieldId",onChange:e=>{const n=D.find(n=>n.id===e);n&&(t.change("customField.conditionValue",n.fieldType===_n.Checkbox||[]),_(n))}}),(0,i.jsx)(Mc,{}),(0,i.jsxs)(Zx,{heading:n("informations_su_14015"),children:[(0,i.jsxs)(FA,{heading:n("initialisation_38640"),children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("type_de_cr_atio_50953")}),(0,i.jsxs)(RS,{selectedItem:j,onChange:e=>{v(e)},children:[(0,i.jsx)(DS,{item:BR.Basic,children:n("basique_25478")}),(0,i.jsx)(DS,{item:BR.Advanced,children:n("avanc_08814")})]})]}),b&&A&&(0,i.jsxs)(Qy,{label:n("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:Ke.Accreditation,children:n("accr_ditations_39450")}),(0,i.jsx)("option",{value:Ke.Delegation,children:n("d_l_gations_78318")}),!e.eventId&&(0,i.jsx)("option",{value:Ke.Event,children:n("Event")}),(0,i.jsx)("option",{value:Ke.Position,children:n("missions_63972")}),(0,i.jsx)("option",{value:Ke.UserInfo,children:n("membres_11310")})]}),(0,i.jsx)(Kx,{isCreateVisible:d,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{C(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(FA,{heading:n("nom_du_champ_48329"),children:[(0,i.jsx)(pu,{hint:n("titre_de_la_que_69079"),label:n("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)(pu,{hint:n("sous_titre_de_l_90967"),label:(0,i.jsx)($S,{children:n("sous_titre_97472")}),name:"customField.description"}),b&&(0,i.jsx)(pu,{hint:n("nom_technique_u_74183"),label:(0,i.jsx)($S,{children:n("label_08243")}),name:"customField.label"})]}),(0,i.jsxs)(FA,{heading:n("type_de_champ_47485"),children:[(0,i.jsx)(nf,{label:n("type_35427"),state:e.isEdit?"disabled":"active",value:S.customField.fieldType,onChange:e=>{T(e,S.customField.fieldSubtype)},children:o(ui)}),P&&(0,i.jsx)(nf,{label:n("sous_type_de_ch_73883"),state:e.isEdit?"disabled":"active",value:S.customField.fieldSubtype,onChange:e=>{T(S.customField.fieldType,e)},children:o(ci)}),k&&(0,i.jsx)(Qy,{label:n("style_des_optio_82329"),name:"customField.listType",children:o(_i)}),F&&(0,i.jsx)(Qy,{label:n("affichage_du_fi_79168"),name:"customField.fileType",children:o(mi)}),g===_n.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PR,{change:t.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,showColor:S.customField.listType!==zn.Default,values:S.customField.values}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("est_ce_qu_il_es_10680")}),(0,i.jsx)(Bx,{name:"customField.canSelectMultiple",children:n("oui_il_est_pos_25233")})]}),N&&(0,i.jsx)(Tc,{alertStyle:"warning",children:(0,i.jsx)(Oc,{children:n("les_valeurs_mul_56587")})})]}),g===_n.Validation&&(0,i.jsx)(qb,{accept:[Jv.Images,Jv.Pdf],acl:"public-read",label:(0,i.jsx)($S,{children:n("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."})]}),b&&z&&(0,i.jsx)(FA,{heading:n("chiffrement_des_84602"),children:(0,i.jsx)(Jx,{disabled:O,name:"customField.isEncrypted",subtext:n("seuls_les_4_der_85542"),children:n("les_donn_es_son_85588")})}),b&&L&&(0,i.jsx)(FA,{heading:n("modification_pa_97786"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("la_valeur_de_ce_49938")}),(0,i.jsx)(Bx,{name:"customField.canBeUpdatedByUrl",children:n("oui_la_valeur_72738")})]})})]}),b&&(R||M)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsxs)(Zx,{heading:n("affichage_du_ch_62974"),children:[R&&(0,i.jsx)(FA,{heading:n("Privacy"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("ce_champ_est_il_98722")}),(0,i.jsx)(Bx,{name:"customField.isPrivate",children:n("oui_le_champ_n_99925")})]})}),M&&(0,i.jsxs)(FA,{heading:n("d_pendance_du_c_85763"),children:[(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("l_affichage_de_99189")}),(0,i.jsx)(Bx,{name:"customField.hasCondition",children:n("oui_le_champ_d_00513")})]}),p&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:D.map(e=>(0,i.jsx)("option",{value:e.id,children:pb(e)},e.id))}),x&&(E?(0,i.jsxs)(Qy,{label:n("pour_quelle_val_60529",x.name),name:"customField.conditionValue",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]}):(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("pour_quelle_val_60529",x.name),multiple:!0,name:"customField.conditionValue",children:$},x.id))]})]})]})]}),b&&(0,i.jsx)(VR,{customField:S.customField,fieldProperty:e.fieldProperty}),b&&(0,i.jsx)(kR,{customField:S.customField,eventId:e.customFieldEventId,fieldProperty:e.fieldProperty,linkableCustomFields:e.organization.addressLinksCustomFields.nodes,organizationId:e.organizationId}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:a,onClick:s,children:(0,i.jsx)(Zr,{textAlign:"center",children:e.isEdit?n("mettre_jour_l_31784"):n("cr_er_le_champ_05516")})})}),y&&(0,i.jsx)(UA,{initialName:"",isEdit:!1,mutate:async n=>{const{customFieldCategoryCreate:t}=await r({organizationId:e.organizationId,category:{name:n}});return t},onClose:()=>{C(!1)},onSuccess:e=>{m(iA([...u,e])),t.change("customField.customFieldCategoryId",e.id)}})]})})},validate:a.validateForForm(s.createUpdateCustomFieldSchema()),width:1,onSubmit:async i=>{const{customField:s}=await e.mutate({organizationId:e.organizationId,eventId:e.eventId,customField:{...i.customField,description:i.customField.description||"",values:i.customField.values.map(e=>(e.id??0)<0?{...e,id:void 0}:e)}});t(e.isEdit?n("le_champ_person_31517"):n("le_champ_person_90348")),e.onClose(),e.onSuccess(s)}})},GR=e=>{const n=ss(RR),{data:t,loader:s}=rs("query OrganizationInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ko.CreateCustomFieldInfosFragment],undefined);const{mutate:o}=function(e={}){return ds("mutation CustomFieldCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customField: CustomFieldInput!\n) {\n customField: customFieldCreate(\n organizationId: $organizationId\n eventId: $eventId\n customField: $customField\n ) {\n id\n slug\n eventId\n name\n label\n fieldType\n listType\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 color\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return s||(0,i.jsx)(WR,{customFieldEventId:e.eventId,customFieldId:null,eventId:e.eventId,fieldProperty:fn.Custom,initialValues:{customField:n.customFieldInputDefault(null,t.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:o,organization:t.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},qR=e=>{const n=ss(RR),{data:t,loader:s}=rs("query CustomFieldToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customFieldId: CustomFieldId!\n) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n\n customField(id: $customFieldId) {\n eventId\n name\n label\n customFieldCategoryId\n description\n variety\n fieldType\n fieldSubtype\n fieldProperty\n listType\n fileType\n isPrivate\n hasCondition\n conditionCustomFieldId\n canSelectMultiple\n conditionValue\n isSelectV2\n isEncrypted\n canBeUpdatedByUrl\n validationRules\n addressPostalCodeCustomFieldId\n addressCityCustomFieldId\n addressCountryCustomFieldId\n\n document {\n acl\n name\n key\n }\n\n values {\n id\n value\n color\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,customFieldId:e.customFieldId},[Ko.CreateCustomFieldInfosFragment],undefined);const{mutate:o}=function(e={}){return ds("mutation CustomFieldUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $customFieldId: CustomFieldId!\n $customField: CustomFieldInput!\n) {\n customField: customFieldUpdate(\n organizationId: $organizationId\n eventId: $eventId\n customFieldId: $customFieldId\n customField: $customField\n ) {\n id\n slug\n eventId\n name\n label\n fieldType\n listType\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 color\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return s||(0,i.jsx)(WR,{customFieldEventId:t.organization.customField.eventId,customFieldId:e.customFieldId,eventId:e.eventId,fieldProperty:t.organization.customField.fieldProperty,initialValues:{customField:n.customFieldInputDefault(t.organization.customField,t.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:t.organization.customField.isSelectV2,mutate:n=>o({...n,customFieldId:e.customFieldId}),organization:t.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},HR=()=>{const{history:e,params:{organizationId:n,eventId:t}}=fc();return(0,i.jsx)(GR,{eventId:t,organizationId:n,onClose:()=>{e.goBack(av.CUSTOM_FIELDS({organizationId:n,eventId:t}))},onSuccess:Ou.A})},YR=()=>{const{history:e,params:{organizationId:n,eventId:t,customFieldId:s}}=fc();return(0,i.jsx)(qR,{customFieldId:s,eventId:t,organizationId:n,onClose:()=>{e.goBack(av.CUSTOM_FIELDS({organizationId:n,eventId:t}))},onSuccess:Ou.A})},ZR=e=>{const n=os(),[t,s]=(0,de.useState)(e.initialName);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"sliders"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("nouvelle_sectio_88105")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("ajouter_des_sec_58545")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(hu,{label:n("nom_de_la_secti_38728"),value:t,onChange:s}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{onClick:()=>{e.onAdd(t),e.onClose()},children:w(e.initialName)?n("renommer_la_sec_00650"):n("cr_er_la_sectio_96175")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},KR=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ny(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:e.customFieldsSlugs}),[o,a]=(0,de.useState)(e.initialText);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"sliders"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("champ_texte_lib_91587")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("ajouter_des_cha_68672")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(QS,{initialValue:o,variables:s,onChange:a})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{onClick:()=>{e.onAdd(o),e.onClose()},children:w(e.initialText)?n("mettre_jour_l_69246"):n("ajouter_le_cham_74670")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},XR=(0,de.memo)(function(e){const{translate:n,params:{organizationId:t}}=fc(),s=sC(),[o,a]=(0,de.useState)(!1),{setNodeRef:r,style:d,handleProps:l}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{ref:r,align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",style:d,children:[e.canEdit&&(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...l,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(pc,{icon:"split"})})}),(0,i.jsx)(ux,{placement:"top",children:n("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(Zr,{color:"gray500",children:n(e.field.fieldType)})]}),e.canEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{value:e.isMandatory,onChange:n=>{e.toggleIsMandatory(e.index,n)},children:n("obligatoire_35326")}),(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("supprimer_le_ch_99740")})]}),e.showEdit&&s(e.field)&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_le_champ_78018")})]})]})]})]}),o&&(0,i.jsx)(wR,{children:(0,i.jsx)(qR,{customFieldId:e.field.id,eventId:e.field.eventId,organizationId:t,onClose:()=>a(!1),onSuccess:e.updateCustomField})})]})}),QR=(0,de.memo)(function(e){const{setNodeRef:n,style:t,handleProps:s}=pI(e.elementId);return(0,i.jsx)(XR,{...e,handleProps:s,setNodeRef:n,style:t})}),JR=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:pb(e)},e.id)),[e.conditionCustomFields]),s=e.conditionCustomFields.find(n=>n.id===e.conditionCustomFieldId),o=eA(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("champ_sur_leque_68198"),renderOnPortal:!0,values:e.conditionCustomFieldId?[e.conditionCustomFieldId]:[],onChange:n=>{f(n)?e.setConditionCustomFieldId(n[0]):e.setConditionCustomFieldId(null)},children:t}),s&&(0,i.jsx)(i.Fragment,{children:s.fieldType===_n.Checkbox?(0,i.jsxs)(nf,{label:n("pour_quelle_val_60529",s.name),shouldParseAsBoolean:!0,value:e.conditionValue,onChange:e.setConditionValue,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("pour_quelle_val_60529",s.name),multiple:!0,renderOnPortal:!0,values:e.conditionValue,onChange:e.setConditionValue,children:o},s.id)})]})},eD=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(e.element.conditionCustomFieldId),[o,a]=(0,de.useState)(e.element.conditionValue),r=null!==t&&("boolean"==typeof o||f(o));return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"split",children:n("ajouter_une_con_66324")}),(0,i.jsx)(Gf,{gap:"4",children:(0,i.jsx)(JR,{conditionCustomFieldId:t,conditionCustomFields:e.conditionCustomFields,conditionValue:o,setConditionCustomFieldId:n=>{const t=e.conditionCustomFields.find(e=>e.id===n);t&&(a(t.fieldType===_n.Checkbox||[]),s(n))},setConditionValue:a})}),(0,i.jsxs)(Wf,{hideCancelButton:!0,children:[(0,i.jsx)(yc,{disabled:!r,onClick:()=>{e.onConditionAdd(e.index,t,o),e.onClose()},children:n("ajouter_une_con_66324")}),(0,i.jsx)(yc,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:n("supprimer_la_co_57888")})]})]})})},nD=(0,de.memo)(function(e){const n=os(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1),r=(0,de.useMemo)(()=>e.conditionCustomFields.find(n=>n.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]),{setNodeRef:d,style:l,handleProps:c}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{ref:d,align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",style:l,children:[e.canEdit&&(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...c,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Xl,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Zr,{fontWeight:"semiBold",children:e.element.section||""}),r&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(pc,{icon:"split"})})}),(0,i.jsx)(ux,{placement:"top",children:n("cette_section_d_50768",r.name)})]})]}),e.canEdit&&(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"split",size:"sm",onClick:()=>a(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("ajouter_une_con_66324")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(ux,{placement:"top",children:n("supprimer_43083")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("renommer_42135")})]})]})]}),t&&(0,i.jsx)(ZR,{initialName:e.element.section||"",onAdd:n=>{e.onRename(e.index,n)},onClose:()=>{s(!1)}}),o&&(0,i.jsx)(eD,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>a(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})}),tD=(0,de.memo)(function(e){const{setNodeRef:n,style:t,handleProps:s}=pI(e.element.id);return(0,i.jsx)(nD,{...e,handleProps:s,setNodeRef:n,style:t})}),iD=(0,de.memo)(function(e){const n=os(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1),r=(0,de.useMemo)(()=>e.conditionCustomFields.find(n=>n.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]),{setNodeRef:d,style:l,handleProps:c}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{ref:d,align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",style:l,children:[e.canEdit&&(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...c,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Xl,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(p_,{text:e.element.text||""})}),r&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(pc,{icon:"split"})})}),(0,i.jsx)(ux,{placement:"top",children:n("ce_texte_d_pend_87251",r.name)})]})]}),e.canEdit&&(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"split",size:"sm",onClick:()=>a(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("ajouter_une_con_66324")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(ux,{placement:"top",children:n("supprimer_43083")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]})]})]}),t&&(0,i.jsx)(KR,{customFieldsSlugs:e.customFieldsSlugs,initialText:e.element.text||"",onAdd:n=>{e.onEdit(e.index,n)},onClose:()=>s(!1)}),o&&(0,i.jsx)(eD,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>a(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})}),sD=(0,de.memo)(function(e){const{setNodeRef:n,style:t,handleProps:s}=pI(e.element.id);return(0,i.jsx)(iD,{...e,handleProps:s,setNodeRef:n,style:t})}),oD=e=>{const{canFormEdit:n}=tC(),t=(0,de.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),s=(0,de.useMemo)(()=>e.customFields.filter(e=>[_n.Checkbox,_n.Country,_n.Language,_n.Nationality,_n.Select].includes(e.fieldType)),[e.customFields]),o=e.elements.map(e=>e.id).join(","),a=(0,de.useMemo)(()=>e.elements.map(e=>e.id),[o]);return(0,i.jsx)(yI,{ids:a,onReorder:e.onReorder,children:(0,i.jsx)(Xl,{direction:"column",gap:"3",width:1,children:e.elements.map((o,a)=>{switch(o.elementType){case yn.Field:{const s=t[o.customFieldId];return s?(0,i.jsx)(QR,{canEdit:n,elementId:o.id,field:s,index:a,isMandatory:o.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},o.id):null}case yn.Section:return(0,i.jsx)(tD,{canEdit:n,conditionCustomFields:s,element:o,index:a,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},o.id);case yn.Text:return(0,i.jsx)(sD,{canEdit:n,conditionCustomFields:s,customFieldsSlugs:e.customFieldsSlugs,element:o,index:a,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},o.id);default:return Ic(o.elementType)}})})})},aD=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{canCustomFieldEdit:o}=tC(),[a,r]=(0,de.useState)(!1),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(e.customFields),h=(0,de.useMemo)(()=>new Set(e.elements.flatMap(e=>e.elementType===yn.Field?[e.customFieldId]:[])),[e.elements]),p=(0,de.useMemo)(()=>{const n=new Map(m.map(e=>[e.id,e.slug]));return e.elements.flatMap(e=>e.elementType===yn.Field?[e.customFieldId,e.conditionCustomFieldId].flatMap(e=>{const t=e?n.get(e):void 0;return t?[t]:[]}):[])},[m,e.elements]),I=p.join(","),f=(0,de.useMemo)(()=>p,[I]),x=(0,de.useCallback)((n,t)=>{e.setElements(e=>S(e,n,t))},[e.setElements]),_=(0,de.useCallback)(n=>{h.has(n.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==n.id)):e.setElements([...e.elements,{id:ce(),elementType:yn.Field,customFieldId:n.id,section:null,text:null,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,h]),j=(0,de.useCallback)((n,t)=>{e.setElements((0,mI.jM)(e=>{e[n].isMandatory=t}))},[e.setElements]),v=(0,de.useCallback)(n=>{e.setElements([...e.elements,{id:ce(),elementType:yn.Section,customFieldId:null,section:n,text:null,isMandatory:null,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),y=(0,de.useCallback)((n,t)=>{e.setElements((0,mI.jM)(e=>{e[n].section=t}))},[e.setElements]),C=(0,de.useCallback)(n=>{e.setElements([...e.elements,{id:ce(),elementType:yn.Text,customFieldId:null,section:null,text:n,isMandatory:null,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),b=(0,de.useCallback)((n,t)=>{e.setElements((0,mI.jM)(e=>{e[n].text=t}))},[e.setElements]),A=(0,de.useCallback)(n=>{e.setElements((0,mI.jM)(e=>{e.splice(n,1)}))},[e.setElements]),E=(0,de.useCallback)(e=>{g(n=>n.map(n=>n.id===e.id?e:n))},[]),w=(0,de.useCallback)((n,t,i)=>{e.setElements((0,mI.jM)(e=>{e[n].hasCondition=!0,e[n].conditionCustomFieldId=t,e[n].conditionValue=i}))},[e.setElements]),$=(0,de.useCallback)(n=>{e.setElements((0,mI.jM)(e=>{e[n].hasCondition=!1,e[n].conditionCustomFieldId=null,e[n].conditionValue=!1}))},[e.setElements]);return(0,i.jsxs)(i.Fragment,{children:[0===e.elements.length?(0,i.jsx)(Zr,{height:.5,width:1,children:(0,i.jsx)(Jw,{subtitle:n("ajouter_des_cha_37944"),title:n("aucun_champ_ou_18338")})}):(0,i.jsx)(oD,{customFields:m,customFieldsSlugs:f,elements:e.elements,fieldsToggleMandatory:j,sectionOnRename:y,textOnEdit:b,updateCustomField:E,onConditionAdd:w,onConditionDelete:$,onDelete:A,onReorder:x}),(0,i.jsxs)(lC,{permissions:nC.FORM_EDIT,children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:o?(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"pen-field",onClick:()=>{u(!0)},children:n("cr_eer_un_champ_08883")}),children:n("ajouter_des_cha_35843")}):(0,i.jsx)(yc,{children:n("ajouter_des_cha_35843")})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(_A,{customFields:m,selectedCustomFieldsIds:h,toggle:_})})]}),(0,i.jsx)(yc,{color:"white",onClick:()=>{r(!0)},children:n("ajouter_une_sec_90063")}),(0,i.jsx)(yc,{color:"white",onClick:()=>{l(!0)},children:n("ajouter_un_cham_31151")})]})]}),a&&(0,i.jsx)(ZR,{initialName:"",onAdd:v,onClose:()=>{r(!1)}}),d&&(0,i.jsx)(KR,{customFieldsSlugs:f,initialText:"",onAdd:C,onClose:()=>{l(!1)}}),c&&(0,i.jsx)(wR,{children:(0,i.jsx)(GR,{eventId:s,isFromForm:!0,organizationId:t,onClose:()=>u(!1),onSuccess:async n=>{g([...m,n]),setTimeout(()=>{_(n),e.onSave()}),u(!1)}})})]})},rD=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:76,width:1})]}),dD=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=fc(),{data:a,isLoading:r}=rs("query FormElements($organizationId: OrganizationId!, $eventId: EventId, $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:t,eventId:s,formId:o},[Ko.FormCustomFieldsFragment,Ko.FormElementsElementFragment],undefined);fm(a.organization?.form.name??"");const{mutate:d,isLoading:l}=function(e={}){return ds("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,de.useState)([]),[m,g]=(0,de.useState)(""),h=(0,de.useCallback)(async()=>{await d({organizationId:t,eventId:s,formId:o,elements:c.map((e,n)=>({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:n}))}),g(JSON.stringify(c))},[d,c]),[p,I]=(0,de.useState)(!1),f=(0,de.useCallback)(()=>{JSON.stringify(c)===m?e.push(Ks.FORMS({organizationId:t,eventId:s})):I(!0)},[c,m]);return(0,de.useEffect)(()=>{u(a.organization?.form.elements??[]),g(JSON.stringify(a.organization?.form.elements??[]))},[a.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:l,onClick:h,children:n("enregistrer_06519")}),title:a.organization?.form.name??"-",onClose:f,children:(0,i.jsx)(Xl,{justify:"center",width:1,children:(0,i.jsxs)(Xl,{direction:"column",width:"$container",children:[(0,i.jsx)(ic,{height:"8"}),r?(0,i.jsx)(rD,{}):(0,i.jsx)(aD,{customFields:a.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:h}),(0,i.jsx)(ic,{height:"8"})]})})}),(0,i.jsx)(ER,{fallbackPath:Ks.FORMS({organizationId:t,eventId:s}),isOpen:p,onClose:()=>{I(!1)}})]})},lD=e=>(0,i.jsx)(Eg,{css:{background:e.isSelected?"$primary50":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle})]})});var cD;let uD=class extends ju{constructor(e){super(e)}emailTemplateDefault(e,n,t,i,s){const o=this.emailTypeToDefault(e,n,i,s);return t&&(o.subject=t.subject,o.content=t.content),{useDefault:t?.useDefault??!0,emailType:e,emailSenderId:t?.emailSenderId,attachments:t?.attachments??[],hasCalendarInvite:t?.hasCalendarInvite??!1,calendarInviteName:t?.calendarInviteName??null,calendarInviteStartDate:t?.calendarInviteStartDate??null,calendarInviteStartTime:t?.calendarInviteStartTime??null,calendarInviteEndDate:t?.calendarInviteEndDate??null,calendarInviteEndTime:t?.calendarInviteEndTime??null,...o}}emailTemplateSchema(){return Jl.Ik().shape({useDefault:Jl.zM().required(""),emailType:Jl.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(ri,this.t("le_type_d_e_mai_84281")),subject:Jl.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:Jl.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===ln.Code)||this.parent.content.includes("{code}")})}),attachments:Jl.YO().of(Jl.Yj()),hasCalendarInvite:Jl.zM().required(),calendarInviteName:Jl.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:e_.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:Jl.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:e_.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:Jl.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})})}updateEmailTemplateSchema(){return Jl.Ik().shape({emailTemplate:this.emailTemplateSchema()})}emailTypeToDefault(e,n,t,i){switch(e){case ln.Accreditations:return this.accreditationsDefault();case ln.AccreditationsRefused:return this.accreditationsRefusedDefault();case ln.Assignments:return this.assignmentsDefault();case ln.Code:return this.codeDefault(t,i);case ln.FormInvite:return this.formInviteDefault();case ln.FormSubmit:return this.formSubmitDefault(t);case ln.NotifyLeaders:return this.notifyLeadersDefault(n);case ln.DelegationCategoryLeaderAssign:return this.delegationCategoryLeaderAssign(n);case ln.DelegationFormInvite:return this.delegationFormInviteDefault();case ln.DelegationLeaderAssign:return this.delegationLeaderAssign();case ln.PositionCategoryLeaderAssign:return this.positionCategoryLeaderAssignDefault(n);case ln.PositionLeaderAssign:return this.positionLeaderAssign(n);case ln.Refused:return this.refusedDefault();case ln.VolunteerRegistration:return this.volunteerRegistrationDefault();case ln.Campaign:case ln.AccreditationsImport:case ln.AccreditationsProfilesImport:case ln.DelegationsImport:case ln.EventsImport:case ln.FilesImport:case ln.Documents:case ln.EventInvite:case ln.Export:case ln.MembersImport:case ln.NewMember:case ln.OrganizationInvite:case ln.PositionsImport:throw new Error("Impossible to change this email");default:return Ic()}}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,n){return{subject:e&&!n?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,nm)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",nm,e.href,nm)}}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",nm,e.href,nm)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",nm,e.href,nm)}}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")}}};function mD(e,n){const t=n=>e.organization.emailsSenders.find(e=>e.id===n);return n?t(n)?.buttonColor:e.organization.event?.emailSender?e.organization.event.emailSender.buttonColor:t(e.organization.emailSenderId)?.buttonColor}uD=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(cD=void 0!==ts&&ts)?cD:Object])],uD);const gD=e=>{const{history:n,translate:t}=fc(),{organization:s}=Yy(),{event:o}=Ly(),{data:a,loader:r}=tl({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType}),{mutate:d,isLoading:l}=il(),c=ss(uD),u=ss(ec),m=ny(Xc(e.emailType,!!e.eventId)),g=(0,de.useMemo)(()=>Jc(m),[m]),h=o?.useDocuments&&(e.emailType===ln.Accreditations||e.emailType===ln.Assignments||e.emailType===ln.FormSubmit&&e.eventId),p=e.emailType===ln.Accreditations||e.emailType===ln.Assignments||e.emailType===ln.FormSubmit||e.emailType===ln.VolunteerRegistration;return r||(0,i.jsx)(Fc,{direction:"column",initialValues:{emailTemplate:c.emailTemplateDefault(e.emailType,ee.HEAVENT_APP_URL,a.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:o,values:r})=>(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)($c,{children:t("contenu_de_l_e_19848")}),(0,i.jsx)(Bx,{name:"emailTemplate.useDefault",children:t("utiliser_le_mod_93521")}),!r.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:t("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject",variables:g}),(0,i.jsx)(Kx,{hint:t("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)($S,{children:t("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:(a.organization?.emailsSenders??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(JS,{buttonColor:mD(a,r.emailTemplate.emailSenderId),buttons:!0,hint:(0,i.jsx)(Zr,{css:{"& a":{color:"$primary500"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:t("contenu_de_l_e_19848"),name:"emailTemplate.content",variables:m}),f(a.organization.customFields.nodes)&&(0,i.jsx)(Wv,{heading:t("attribution_d_u_18785"),isOpen:!1,isOpenToggleLabel:t("je_souhaite_cr_46006"),subtitle:t("cr_ez_une_varia_07170"),children:(0,i.jsx)(ry,{customFields:a.organization.customFields.nodes})}),h&&(0,i.jsxs)(Kx,{isSearchVisible:!0,label:t("pi_ce_s_jointe_82370"),multiple:!0,name:"emailTemplate.attachments",children:[(a.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:fj(e)},e)),qv.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))]}),p&&(0,i.jsx)(sy,{hasCalendarInvite:r.emailTemplate.hasCalendarInvite,prefix:"emailTemplate."})]}),(0,i.jsx)(lC,{permissions:nC.EMAIL_EDIT,children:(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:l,onClick:o,children:t("enregistrer_le_77369")})})})]}),validate:u.validateForForm(c.updateEmailTemplateSchema()),width:1,onSubmit:async n=>{await d({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailTemplate:n.emailTemplate})}})},hD=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,formId:o}}=fc(),{data:a}=rl({organizationId:t,formId:o});fm(a.organization?.form.name??"");const[r,d]=(0,de.useState)(ln.FormSubmit);return(0,i.jsx)(CR,{title:a.organization?.form.name??"-",onClose:()=>{e.push(Ks.FORMS({organizationId:t,eventId:s}))},children:(0,i.jsx)(Xl,{justify:"center",width:1,children:(0,i.jsxs)(Xl,{direction:"column",width:"$container",children:[(0,i.jsx)(ic,{height:"8"}),(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(lD,{isSelected:r===ln.FormSubmit,subtitle:n("cet_e_mail_est_29404"),title:n("remplissage_du_09925"),onClick:()=>d(ln.FormSubmit)}),(0,i.jsx)(lD,{isSelected:r===ln.Code,subtitle:n("cet_e_mail_est_49525"),title:n("code_20843"),onClick:()=>d(ln.Code)}),s&&(0,i.jsx)(lD,{isSelected:r===ln.FormInvite,subtitle:n("cet_email_est_e_46197"),title:n("invitation_d_un_88753"),onClick:()=>d(ln.FormInvite)})]})]}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Xl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(gD,{emailType:r,eventId:s,formId:o,organizationId:t,source:null})})]}),(0,i.jsx)(ic,{height:"8"})]})})})};var pD;let ID=class extends ju{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return Jl.Ik().shape({segmentsIds:Jl.YO().of(Jl.ai())})}updateFormParametersBroadcastSchema(){return Jl.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};ID=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(pD=void 0!==ts&&ts)?pD:Object])],ID);const fD=({children:e,isActive:n,replace:t=!0,to:s})=>{const o=us(),a=n?.(o.pathname)??o.pathname===s;return(0,i.jsx)(Zr,{css:{background:a?"$primary50":"transparent",borderRadius:"6px",color:a?"$primary500":"$gray500",cursor:a?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(gc,{replace:t,to:s,children:e})})},xD=e=>(0,i.jsx)(Xl,{"aria-orientation":"vertical",as:Yl.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),_D=e=>{const{translate:n,params:t}=fc(),{hasFeature:s}=Yy(),{event:o}=Ly();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Wu,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(Zr,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(xD,{children:[(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_GENERAL(t),children:n("g_n_ral_64953")}),(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_DESIGN(t),children:n("design_15043")}),t.eventId&&(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),t.eventId&&o.usePositions&&(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_MISSIONS(t),children:n("missions_63972")}),t.eventId&&o.useAccreditations&&s(In.Accreditation)&&(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_BROADCAST(t),children:n("diffusion_56689")}),(0,i.jsx)(fD,{to:Ks.FORM_PARAMETERS_STATE(t),children:n("cl_turer_88223")})]})}),(0,i.jsx)(Zr,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(ER,{fallbackPath:Ks.FORMS({organizationId:t.organizationId,eventId:t.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function jD(e,n,t){const{history:i,params:{organizationId:s,eventId:o}}=fc(),[a,r]=(0,de.useState)(!1),[d,l]=(0,de.useState)(JSON.stringify(e)),c=(0,de.useCallback)(()=>{const e=JSON.stringify(n);d===e?i.push(Ks.FORMS({organizationId:s,eventId:o})):r(!0)},[d,n]),u=(0,de.useCallback)(()=>{r(!1)},[r]),m=(0,de.useCallback)(()=>{t(),l(JSON.stringify(n))},[t,n]);return(0,de.useEffect)(()=>{l(JSON.stringify(e))},[e]),{isNotSavedModalOpen:a,onClose:c,onNotSavedClose:u,onSave:m}}const vD=e=>{const n=os(),{isNotSavedModalOpen:t,onClose:s,onNotSavedClose:o,onSave:a}=jD(e.initialValues,e.values,e.handleSubmit),[r,d]=(0,de.useState)(f(e.initialValues.form.segmentsIds)),l=(0,de.useMemo)(()=>f(e.eventSegments)&&f(e.organizationSegments)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("optgroup",{label:n("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:n("vues_de_l_organ_32624"),children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}):f(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):f(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(0,de.useEffect)(()=>{d(f(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:a,children:n("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(_D,{isNotSavedOpen:t,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("diffusion_du_fo_47764")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnalisez_l_57514")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("_qui_s_adresse_82507")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:r?"unchecked":"checked",onClick:()=>{d(!1),e.change("form.segmentsIds",[])},children:n("_tout_le_monde_35921")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:r?"checked":"unchecked",onClick:()=>{d(!0)},children:n("_certaines_vue_55512")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{children:[(0,i.jsx)(ic,{width:"6"}),(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:l})]}),(0,i.jsx)(Yj,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:n("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},SD=e=>{const{params:{organizationId:n,eventId:t,formId:s}}=fc(),o=ss(ec),a=ss(ID),{mutate:r,isLoading:d}=function(e={}){return ds("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)}(),l=(0,de.useMemo)(()=>({form:a.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:l,render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(vD,{change:n.change,eventSegments:e.eventSegments,handleSubmit:t,initialValues:l,isMutateLoading:d,loader:e.loader,name:e.form?.name??"",organizationSegments:e.organizationSegments,values:s}),validate:o.validateForForm(a.updateFormParametersBroadcastSchema()),width:1,onSubmit:e=>r({organizationId:n,eventId:t,formId:s,form:e.form})})},yD=()=>{const{params:{organizationId:e,formId:n}}=fc(),{data:t,loader:s}=rs("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:n},[],undefined);return fm(t.organization?.form.name??""),(0,i.jsx)(SD,{eventSegments:p,form:t.organization?.form,loader:s,organizationSegments:t.organization?.segments??p})},CD=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("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:n,formId:t},[],undefined);return fm(s.organization?.form.name??""),(0,i.jsx)(SD,{eventSegments:s.event?.segments??p,form:s.organization?.form,loader:o,organizationSegments:s.organization?.segments??p})};var bD,AD;function ED(e){return"production"===r.Development&&ee.HIGHLIGHT_CUSTOM_COLOURS?{blueGray900:"#ff03ee",primary50:"#ffbbfa",primary100:"#ecbbe9",primary200:"#d8bbd7",primary300:"#c4bbc3",primary400:"#b37eaf",primary500:"#9cff66",primary600:"#61fc0d",primary700:"#b35bad",primary800:"#b32eaa",primary900:"#b30da7"}:{blueGray900:e?.blueGray900??Lr.colors.blueGray900.value,primary50:e?.primary50??Lr.colors.primary50.value,primary100:e?.primary100??Lr.colors.primary100.value,primary200:e?.primary200??Lr.colors.primary200.value,primary300:e?.primary300??Lr.colors.primary300.value,primary400:e?.primary400??Lr.colors.primary400.value,primary500:e?.primary500??Lr.colors.primary500.value,primary600:e?.primary600??Lr.colors.primary600.value,primary700:e?.primary700??Lr.colors.primary700.value,primary800:e?.primary800??Lr.colors.primary800.value,primary900:e?.primary900??Lr.colors.primary900.value,primaryCustom500:e?.primary500??Lr.colors.primary500.value,primaryCustom600:e?.primary600??Lr.colors.primary600.value}}function wD(e){return"production"===r.Development&&ee.HIGHLIGHT_CUSTOM_COLOURS?{grayCustom50:"#fabbf6",grayCustom500:"#fa5aef",grayCustom700:"#ff3df2",grayCustom800:"#fc23ee",grayCustom900:"#ff03ee",primaryCustom500:"#9cff66",primaryCustom600:"#61fc0d"}:{grayCustom50:e?.grayCustom50??Lr.colors.gray50.value,grayCustom500:e?.grayCustom500??Lr.colors.gray500.value,grayCustom700:e?.grayCustom700??Lr.colors.gray700.value,grayCustom800:e?.grayCustom800??Lr.colors.gray800.value,grayCustom900:e?.grayCustom900??Lr.colors.gray900.value,primaryCustom500:e?.primaryCustom500??Lr.colors.primary500.value,primaryCustom600:e?.primaryCustom600??Lr.colors.primary600.value}}let $D=class extends ju{documentInputService;constructor(e,n){super(n),this.documentInputService=e}designInputDefault(e,n){return{banner:n?.banner??e?.banner??this.documentInputService.documentInputDefault(),logo:n?.logo??e?.logo??this.documentInputService.documentInputDefault(),colors:wD(n?.colors??e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:wD(e?.colors)}}};var TD;$D=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(bD=void 0!==Rb&&Rb)?bD:Object,"function"==typeof(AD=void 0!==ts&&ts)?AD:Object])],$D),function(e){e.Background="background",e.Titles="titles",e.Subtitles="subtitles",e.Text="text"}(TD||(TD={}));const zD=({initialValues:e,customiseableColorsToShow:n=Object.values(TD)})=>{const{translate:t}=fc();return(0,i.jsxs)(Wv,{heading:t("charte_graphiqu_02725"),children:[n.includes(TD.Background)&&(0,i.jsx)(FA,{heading:t("couleur_de_fond_75677"),children:(0,i.jsx)(Wb,{initialValue:e?.grayCustom50??Lr.colors.gray50.value,label:t("couleur_de_fond_75677"),name:"design.colors.grayCustom50"})}),n.some(e=>[TD.Titles,TD.Subtitles,TD.Text].includes(e))&&(0,i.jsx)(FA,{heading:t("textes_07935"),children:(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:[n.includes(TD.Text)&&(0,i.jsx)(Wb,{initialValue:e?.grayCustom800??Lr.colors.gray800.value,label:t("couleur_du_text_32021"),name:"design.colors.grayCustom800"}),n.includes(TD.Titles)&&(0,i.jsx)(Wb,{initialValue:e?.grayCustom900??Lr.colors.gray900.value,label:t("couleur_des_tit_58918"),name:"design.colors.grayCustom900"}),n.includes(TD.Subtitles)&&(0,i.jsx)(Wb,{initialValue:e?.grayCustom500??Lr.colors.gray500.value,label:t("couleur_des_sou_18968"),name:"design.colors.grayCustom500"})]})}),(0,i.jsx)(FA,{heading:t("boutons_35604"),children:(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Wb,{initialValue:e?.primaryCustom500??Lr.colors.primary500.value,label:t("couleur_des_bou_24410"),name:"design.colors.primaryCustom500"}),(0,i.jsx)(Wb,{initialValue:e?.primaryCustom600??Lr.colors.primary600.value,label:t("couleur_des_bou_16515"),name:"design.colors.primaryCustom600"})]})})]})},OD=e=>{const{params:{organizationId:n},translate:t}=fc();return(0,i.jsxs)(Wv,{heading:e.heading,hideHeading:e.hideHeading,children:[e.showLogo&&(0,i.jsx)(FA,{heading:t("logo_18191"),children:(0,i.jsx)(Jb,{hint:t("nous_recommando_20904"),label:t("s_lectionnez_un_82734"),organizationId:n,prefix:"design.logo."})}),(0,i.jsx)(FA,{heading:t("banni_re_86634"),children:(0,i.jsx)(Jb,{hint:t("taille_de_l_ima_84109"),label:t("s_lectionnez_un_82734"),organizationId:n,prefix:"design.banner."})})]})},RD=()=>{const{translate:e}=fc();return(0,i.jsxs)(Wv,{heading:e("design_du_formu_57145"),subtitle:e("personnalisez_l_27035"),children:[(0,i.jsx)(OD,{heading:e("banni_re_du_for_40749"),hideHeading:!0,showLogo:!1}),(0,i.jsx)(zD,{customiseableColorsToShow:[TD.Titles,TD.Background]})]})},DD=e=>{const n=os(),{isNotSavedModalOpen:t,onClose:s,onNotSavedClose:o,onSave:a}=jD(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:a,children:n("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(_D,{isNotSavedOpen:t,onNotSavedClose:o,children:e.loader||(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(RD,{})})})})},MD=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("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 ...DesignColors\n }\n }\n }\n}\n",{organizationId:e,formId:t},[Ko.DesignColorsFragment],undefined);fm(s.organization?.form.name??"");const a=ss($D),{mutate:r,isLoading:d}=function(e={}){return ds("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)}(),l=(0,de.useMemo)(()=>({design:a.formParametersDesignInputDefault(s.organization?.form.design)}),[s.organization]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:l,render:({handleSubmit:n,values:t})=>(0,i.jsx)(DD,{handleSubmit:n,initialValues:l,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",organizationId:e,values:t}),width:1,onSubmit:i=>r({organizationId:e,eventId:n,formId:t,design:i.design})})};var PD;let kD=class extends ju{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||"",successTitle:e?.successTitle||"",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,ticketUrl:e?.ticketUrl||""}}formParametersGeneralInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:Jl.zM().required(),setAssignmentStateToWaiting:Jl.zM().required(),setAccreditationStateToWaiting:Jl.zM().required(),description:Jl.Yj(),successTitle:Jl.Yj(),successMessage:Jl.Yj(),areTeamsAllowed:Jl.zM().required(),maxTeamMembers:Jl.ai().nullable(),teamMemberFillFullForm:Jl.zM().required(),informationTitle:Jl.Yj(),registerButtonText:Jl.Yj(),ticketUrl:Jl.Yj().test("valid-ticket-url",this.t("le_lien_doit_co_30275"),e=>!w(e)||e.startsWith("https://"))})}updateFormParametersGeneralSchema(){return Jl.Ik().shape({form:this.formParametersGeneralInputSchema()})}};kD=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(PD=void 0!==ts&&ts)?PD:Object])],kD);const FD=e=>{const n=os(),[t,s]=(0,de.useState)(!1),o=t||f(e.values),a=(0,de.useCallback)(n=>{s(n),n||e.change(e.name,[])},[e.name,e.change]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("d_finir_la_vale_27863")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("choisissez_une_24029")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(oI,{value:o,onChange:a,children:n("je_souhaite_d_f_72912")}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(cA,{...e})]})]})},ND=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ny([...t?["event"]:[],"organization"],{eventsCustomFields:!1}),o=ny(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),{isNotSavedModalOpen:a,onClose:r,onNotSavedClose:d,onSave:l}=jD(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:l,children:n("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(_D,{isNotSavedOpen:a,onNotSavedClose:d,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"hasWeezTicketForm",onChange:n=>{n||e.change("form.ticketUrl","")}}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("initialisation_29288")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_27381")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nom_du_formulai_14952"),name:"form.name"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("affectation_des_81808")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Bx,{name:"form.setAssignmentStateToWaiting",children:n("les_membres_ser_52180")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("accr_ditation_d_48426")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Bx,{name:"form.setAccreditationStateToWaiting",children:n("les_membres_ser_34727")})]}),(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("param_trage_de_41992")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("donner_la_possi_56694")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:n("inscriptions_mu_35073")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Jx,{name:"form.allowMultiProfiles",children:n("autoriser_les_i_26880")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:n("remplissages_mu_72343")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Jx,{name:"form.canRefill",subtext:n("permet_aux_memb_26701"),children:n("autoriser_les_m_44818")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:n("inscriptions_en_77739")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Jx,{name:"form.areTeamsAllowed",children:n("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Jx,{name:"form.teamMemberFillFullForm",children:n("tous_les_membre_59937")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(FD,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_de_l_tap_00197")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_68212")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(pu,{name:"form.emailTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("description_de_80800")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("la_description_13257")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(JS,{name:"form.description",variables:s}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_de_l_tap_92536")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_66470")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(pu,{name:"form.informationTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_du_bouton_05866")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_02611")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(pu,{name:"form.registerButtonText"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("texte_de_l_tap_59788")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_10000")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(pu,{name:"form.successTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("message_de_succ_99510")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_55334")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(JS,{name:"form.successMessage",variables:o}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("int_gration_10662")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Tc,{alertStyle:"primary",children:[(0,i.jsx)(zc,{children:n("comment_l_int_g_52949")}),(0,i.jsx)(Oc,{children:n("le_widget_sera_08013")})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Jx,{name:"hasWeezTicketForm",children:n("ajouter_un_widg_55295")}),e.values.hasWeezTicketForm&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Qx,{label:n("lien_vers_le_wi_55308"),name:"form.ticketUrl"})]})]}),(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("_dition_des_inf_90758")}),(0,i.jsx)(Zr,{color:"gray500",children:n("donner_la_possi_56683")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("espace_membre_06532")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Jx,{name:"form.isEditableInMemberSpace",children:n("permettre_aux_m_40630")})]})})})},LD=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("query FormParametersGeneral($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n organization(id: $organizationId) {\n customFields(\n eventId: $eventId\n variety: UserInfo\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n isWeezeventConnected\n }\n\n form(id: $formId) {\n name\n setAssignmentStateToWaiting\n setAccreditationStateToWaiting\n allowMultiProfiles\n canRefill\n description\n successTitle\n successMessage\n areTeamsAllowed\n maxTeamMembers\n teamMemberFillFullForm\n emailTitle\n informationTitle\n registerButtonText\n isEditableInMemberSpace\n ticketUrl\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,eventId:n,formId:t},[Ko.MassEditCustomFieldFragment],undefined);fm(s.organization?.form.name??"");const a=ss(ec),r=ss(kD),{mutate:d,isLoading:l}=function(e={}){return ds("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=(0,de.useMemo)(()=>{const e=r.formParametersGeneralInputDefault(s.organization?.form);return{form:e,hasWeezTicketForm:w(e.ticketUrl)}},[s.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(ND,{change:e.change,customFields:s.organization?.customFields.nodes??[],handleSubmit:n,initialValues:c,isMutateLoading:l,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1,loader:o,name:s.organization?.form.name??"",values:t}),validate:a.validateForForm(r.updateFormParametersGeneralSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:{...i.form,description:i.form.description||"",successMessage:i.form.successMessage||""}})})})};var UD;let VD=class extends ju{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||An.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt?.toLocal()||null}}formParametersStateInputSchema(){return Jl.Ik().shape({state:Jl.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(hi,this.t("cl_turer_le_for_10541")),closedMessage:Jl.Yj(),closedAt:e_.when("state",{is:An.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 Jl.Ik().shape({form:this.formParametersStateInputSchema()})}};VD=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(UD=void 0!==ts&&ts)?UD:Object])],VD);const BD=e=>{const{translate:n,params:{eventId:t}}=fc(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:a,onSave:r}=jD(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:r,children:n("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(_D,{isNotSavedOpen:s,onNotSavedClose:a,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"form.state",onChange:n=>{n!==An.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("cl_turer_le_for_46483")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("choisir_si_le_f_14519")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(gy,{name:"form.state",value:An.Open,children:n("ne_pas_cl_turer_46870")}),(0,i.jsx)(ic,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gy,{name:"form.state",value:An.CloseWhenEventDone,children:n("cl_turer_le_for_61719")}),(0,i.jsx)(ic,{height:"3"})]}),(0,i.jsx)(gy,{name:"form.state",value:An.Closed,children:n("cl_turer_le_for_10120")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.state",value:An.ClosedAt,children:n("cl_turer_le_for_19176")}),e.values.form.state===An.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{children:[(0,i.jsx)(ic,{width:"6"}),(0,i.jsx)(Gb,{name:"form.closedAt",zone:ca()})]})]}),e.values.form.state!==An.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{hint:n("ce_message_sera_03472"),label:n("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},WD=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("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:t},[],undefined);fm(s.organization?.form.name??"");const a=ss(ec),r=ss(VD),{mutate:d,isLoading:l}=function(e={}){return ds("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=(0,de.useMemo)(()=>({form:r.formParametersStateInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(BD,{change:e.change,handleSubmit:n,initialValues:c,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",values:t}),validate:a.validateForForm(r.updateFormParametersStateSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})},GD="custom-document",qD="documents",HD="position",YD="user",ZD="preview",KD=({userInfoId:e,...n})=>xs([QD.DOCUMENTS(n),YD,e]),XD=({positionId:e,...n})=>xs([QD.DOCUMENTS(n),HD,e]),QD={DOCUMENTS:e=>xs([eo.EVENT(e),qD]),CREATE_CUSTOM_DOCUMENT:e=>Cs(QD.DOCUMENTS(e)),EDIT_CUSTOM_DOCUMENT:({customDocumentId:e,...n})=>bs(xs([eo.EVENT(n),GD,e])),USER_CUSTOM_DOCUMENT:({customDocumentId:e,...n})=>xs([KD(n),GD,e]),USER_CUSTOM_DOCUMENT_PREVIEW:e=>xs([QD.USER_CUSTOM_DOCUMENT(e),ZD]),USER_CUSTOM_DOCUMENT_HISTORY:e=>xs([QD.USER_CUSTOM_DOCUMENT(e),Ss.HISTORY]),USER_PLANNING:e=>xs([KD(e),"planning"]),USER_PLANNING_LIST:e=>xs([KD(e),"planning-list"]),USER_PLANNING_DAYS:e=>xs([KD(e),"planning-days"]),USER_ASSIGNMENTS:e=>xs([KD(e),"assignments"]),USER_BADGE:({badgeType:e,...n})=>xs([KD(n),"badge",e]),USER_CERTIFICATE:e=>xs([KD(e),"certificate"]),USER_HOURS:e=>xs([KD(e),"hours"]),USERS_LISTING:({segmentId:e,...n})=>xs([QD.DOCUMENTS(n),"users-listing",e]),POSITIONS_PLANNING:({segmentId:e,...n})=>xs([QD.DOCUMENTS(n),"positions-planning",e]),POSITIONS_VOLUNTEERS_PLANNING:({segmentId:e,...n})=>xs([QD.DOCUMENTS(n),"positions-volunteers-planning",e]),USERS_PICTURES:({segmentId:e,...n})=>xs([QD.DOCUMENTS(n),"users-pictures",e]),POSITION_SHEET:e=>xs([XD(e),"sheet"]),POSITION_PLANNING:e=>xs([XD(e),"planning"]),ASO_PAX_MANIFEST:({accreditationSlotId:e,...n})=>xs([QD.DOCUMENTS(n),"aso-pax-manifest",e]),DELEGATION_CALENDAR:({delegationId:e,...n})=>xs([QD.DOCUMENTS(n),"delegation",e,"calendar"])},JD={PLURAL:"accreditation-profile-categories",SINGLE:"accreditation-profile-category"},eM={PLURAL:"accreditation-profiles",SINGLE:"accreditation-profile"},nM=e=>xs([JD.SINGLE,e]),tM=e=>xs([eM.SINGLE,e]),iM={ACCREDITATIONS_PROFILES_IMPORT:e=>xs([eo.EVENT(e),eM.PLURAL,vs.IMPORT]),ACCREDITATIONS_PROFILE_CREATE:({accreditationProfileCategoryId:e,...n})=>xs([eo.EVENT(n),eM.PLURAL,vs.CREATE,...e?[e]:[]]),ACCREDITATIONS_PROFILES:e=>xs([eo.EVENT(e),eM.PLURAL]),ACCREDITATIONS_PROFILES_SEGMENT:({segmentId:e,...n})=>xs([iM.ACCREDITATIONS_PROFILES(n),e]),ACCREDITATIONS_PROFILES_SEGMENT_PROFILE_PANEL_ACCREDITATIONS:({accreditationProfileId:e,...n})=>xs([iM.ACCREDITATIONS_PROFILES_SEGMENT(n),"accreditation-profile-panel",e,Ss.ACCREDITATIONS]),ACCREDITATIONS_PROFILE:({accreditationProfileId:e,...n})=>xs([eo.EVENT(n),tM(e)]),ACCREDITATIONS_PROFILE_DASHBOARD:e=>xs([iM.ACCREDITATIONS_PROFILE(e),Ss.DASHBOARD]),ACCREDITATIONS_PROFILE_MEMBERS:e=>xs([iM.ACCREDITATIONS_PROFILE(e),Ss.MEMBERS]),ACCREDITATIONS_PROFILE_CATEGORY:({accreditationProfileCategoryId:e,...n})=>xs([eo.EVENT(n),nM(e)]),ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD:e=>xs([iM.ACCREDITATIONS_PROFILE_CATEGORY(e),Ss.DASHBOARD]),ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS:e=>xs([iM.ACCREDITATIONS_PROFILE_CATEGORY(e),Ss.MEMBERS]),ACCREDITATIONS_PROFILE_EDIT:({accreditationProfileId:e,...n})=>xs([eo.EVENT(n),tM(e),vs.EDIT])};function sM(e,n,t){return(0,sc.A)([t.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:Ev.CREATE({organizationId:n})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:Ms.COMMUNITY_USERS({organizationId:n})},t.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:Wo.CREATE_EVENT(n)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${Os.ORGANIZATION({organizationId:n})}/events`},t.canCustomFieldEdit?{icon:"text",text:e("cr_eer_un_champ_08883"),link:av.CREATE({organizationId:n})}:null,t.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:av.CUSTOM_FIELDS({organizationId:n})}:null,t.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Ks.CREATE({organizationId:n})}:null,t.canFormEdit?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Ks.FORMS({organizationId:n})}:null,t.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:Wo.COMMUNITY_CREATE_DELEGATION(n)}:null,t.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:vo.DELEGATIONS({organizationId:n})}:null,t.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:Nv.CREATE({organizationId:n})}:null,t.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:Nv.CAMPAIGNS({organizationId:n})}:null,t.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:Vv.CREATE({organizationId:n})}:null,t.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:Vv.WORKFLOWS({organizationId:n})}:null])}function oM(e,n,t,i){return(0,sc.A)([i.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:Ev.CREATE({organizationId:n,eventId:t})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:Wo.VOLUNTEERS(n,t)},i.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:Wo.CREATE_EVENT(n)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${Os.ORGANIZATION({organizationId:n})}/events`},i.canCustomFieldEdit?{icon:"text",text:e("cr_eer_un_champ_08883"),link:av.CREATE({organizationId:n,eventId:t})}:null,i.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:av.CUSTOM_FIELDS({organizationId:n,eventId:t})}:null,i.canPositionEdit?{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:Wo.CREATE_POSITION(n,t)}:null,i.canPositionRead?{icon:"sitemap",text:e("voir_les_missio_71964"),link:Eo.POSITIONS({organizationId:n,eventId:t})}:null,i.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Ks.CREATE({organizationId:n,eventId:t})}:null,i.canFormRead?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Ks.FORMS({organizationId:n,eventId:t})}:null,i.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:Wo.CREATE_ACCREDITATION(n,t)}:null,i.canAccreditationRead?{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:mo.ACCREDITATIONS({organizationId:n,eventId:t})}:null,i.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_un_profil_01464"),link:iM.ACCREDITATIONS_PROFILE_CREATE({organizationId:n,eventId:t})}:null,i.canAccreditationRead?{icon:"badge-check",text:e("voir_les_profil_55935"),link:iM.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t})}:null,i.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:Wo.CREATE_DELEGATION(n,t)}:null,i.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:vo.DELEGATIONS({organizationId:n,eventId:t})}:null,i.canDelegationsSpaceParamEdit?{icon:"brush",text:e("cr_er_un_layout_13164"),link:lO.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:n,eventId:t})}:null,i.canDelegationsSpaceParamRead?{icon:"brush",text:e("voir_les_layout_36965"),link:lO.DELEGATIONS_SPACE_LAYOUTS({organizationId:n,eventId:t})}:null,i.canCustomDocumentEdit?{icon:"file",text:e("cr_er_un_docume_92512"),link:QD.CREATE_CUSTOM_DOCUMENT({organizationId:n,eventId:t})}:null,i.canDocumentRead?{icon:"file",text:e("voir_les_docume_33988"),link:QD.DOCUMENTS({organizationId:n,eventId:t})}:null,i.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:Nv.CREATE({organizationId:n,eventId:t})}:null,i.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:Nv.CAMPAIGNS({organizationId:n,eventId:t})}:null,i.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:Vv.CREATE({organizationId:n,eventId:t})}:null,i.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:Vv.WORKFLOWS({organizationId:n,eventId:t})}:null])}function aM(e){switch(e.segmentType){case lt.Accreditations:return e.eventId?Wo.ACCREDITATIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case lt.AccreditationsProfiles:return e.eventId?iM.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:e.organizationId,eventId:e.eventId,segmentId:e.id}):"";case lt.Campaigns:return Nv.CAMPAIGNS_SEGMENT({organizationId:e.organizationId,segmentId:e.id});case lt.CustomFields:return av.CUSTOM_FIELDS_SEGMENT({organizationId:e.organizationId,eventId:e.eventId??void 0,segmentId:e.id});case lt.Delegations:return e.eventId?Wo.DELEGATIONS_SEGMENT(e.organizationId,e.eventId,e.id):Wo.COMMUNITY_DELEGATIONS_SEGMENT(e.organizationId,e.id);case lt.Events:return Wo.EVENTS_SEGMENT(e.organizationId,e.id);case lt.Positions:return e.eventId?Wo.POSITIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case lt.Volunteers:return e.eventId?Wo.VOLUNTEERS_SEGMENT(e.organizationId,e.eventId,e.id):Wo.COMMUNITY_USERS_SEGMENT(e.organizationId,e.id);case lt.Workflows:return Vv.WORKFLOWS_SEGMENT({organizationId:e.organizationId,eventId:e.eventId??void 0,segmentId:e.id});default:return Ic(e.segmentType)}}const rM=e=>(0,i.jsx)(Ug,{css:{"&:hover":{textDecoration:"none"}},hideIcon:!0,to:e.link,width:1,onClick:()=>{e.onClose()},children:(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,width:1,children:[e.avatar,e.icon&&(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(pc,{icon:e.icon})}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:e.children})]})}),dM=e=>(0,i.jsx)(Xl,{css:{px:"$4"},children:(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:e.children})}),lM=e=>(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(dM,{children:e.title}),e.children]}),cM="h-open-omnibar",uM=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{hasFeature:o}=Yy(),a=iC(),r=tC(),d=(0,de.useMemo)(()=>({...r,canCustomDocumentEdit:o(In.CustomDocument)&&r.canDocumentEdit}),[r,o]),l=sC(),[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(!1),[h,p,I]=Dg(""),[x,j]=(0,de.useState)([]),[v,S]=(0,de.useState)([]),[y,C]=(0,de.useState)([]),[A,E]=(0,de.useState)([]),[$,T]=(0,de.useState)([]),[z,O]=(0,de.useState)([]),[R,D]=(0,de.useState)([]),[M,P]=(0,de.useState)([]),[k,F]=(0,de.useState)([]),[N,L]=(0,de.useState)([]),[U,V]=(0,de.useState)([]),[B,W]=(0,de.useState)([]),[G,q]=(0,de.useState)([]),[H,Y]=(0,de.useState)([]),[Z,K]=(0,de.useState)(s?oM(n,t,s,d):sM(n,t,a)),X=(0,de.useMemo)(()=>_(Z)&&_(x)&&_(v)&&_(y)&&_(A)&&_($)&&_(z)&&_(R)&&_(M)&&_(k)&&_(N)&&_(U)&&_(B)&&_(G)&&_(H),[Z,x,v,y,A,$,z,R,M,k,N,U,B,G,H]),Q=(0,de.useCallback)(()=>{K(s?oM(n,t,s,d):sM(n,t,a)),j([]),S([]),C([]),E([]),T([]),O([]),D([]),P([]),F([]),L([]),V([]),W([]),q([]),Y([])},[t,s,a,d,K,j,S,C,E,T,O,D,P,F,L,V,W,q,Y]),J=(0,de.useCallback)(e=>{Uc(e),g(!1),I(""),Q(),u(e=>!e)},[u,g,I,Q]),ee=(0,de.useCallback)(()=>{u(!1)},[u]);return rI("k",J),_m(ee),xm(ee),(0,de.useEffect)(()=>(document.addEventListener(cM,J),()=>{document.removeEventListener(cM,J)}),[J]),(0,de.useEffect)(()=>{(async()=>{if(w(p)){if(g(!0),s){const{organization:e,event:i}=await function(e,n={}){return xa('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, name: $name, limit: 5) {\n nodes {\n id\n eventId\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\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 accreditationsProfiles(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 customDocuments {\n id\n name\n }\n\n delegations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n delegationsSpaceLayouts(name: $name) {\n id\n name\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 teams(name: $name, limit: 5) {\n nodes {\n teamCode\n }\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',{...n,variables:e,fragments:[]})}({organizationId:t,eventId:s,name:p},{token:await fe()});K(oM(n,t,s,d).filter(e=>b(e.text).includes(b(p)))),j(i.volunteersRegistrations.nodes.map(e=>e.userInfo)),S(r.canEventEdit?e.events.nodes:[]),C(e.customFields.nodes.filter(l)),E(r.canPositionRead?i.positions.nodes:[]),T(r.canFormRead?i.forms.nodes:[]),O(r.canDocumentEdit?i.customDocuments.filter(e=>b(e.name).includes(b(p))).slice(0,5):[]),D(r.canAccreditationRead?i.accreditations.nodes:[]),P(r.canAccreditationRead?i.accreditationsProfiles.nodes:[]),F(r.canDelegationRead?i.delegations.nodes:[]),L(r.canDelegationsSpaceParamEdit?i.delegationsSpaceLayouts:[]),V(r.canCampaignRead?i.campaigns.nodes:[]),W(r.canWorkflowRead?i.workflows.nodes:[]),q(i.segments),Y(r.canMemberAssign?i.teams.nodes:[])}else{const{organization:e}=await function(e,n={}){return xa("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 accreditationsProfiles(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 eventId\n name\n }\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",{...n,variables:e,fragments:[]})}({organizationId:t,name:p},{token:await fe()});K(sM(n,t,a).filter(e=>b(e.text).includes(b(p)))),j(e.usersInfos.nodes),S(e.events.nodes),C(a.canCustomFieldRead?e.customFields.nodes:[]),E(a.canPositionRead?e.positions.nodes:[]),T(a.canFormRead?e.forms.nodes:[]),O([]),D(a.canAccreditationRead?e.accreditations.nodes:[]),P(a.canAccreditationRead?e.accreditationsProfiles.nodes:[]),F(a.canDelegationRead?e.delegations.nodes:[]),L([]),V(a.canCampaignRead?e.campaigns.nodes:[]),W(a.canWorkflowRead?e.workflows.nodes:[]),q(e.segments)}g(!1)}else Q()})()},[t,s,a,r,d,l,p,g,K,j,S,C,E,T,O,D,P,F,L,V,W,q,Y,Q]),c&&("organization"===e.level&&!s||"event"===e.level&&s)?(0,hd.createPortal)((0,i.jsx)(Xl,{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)(Xl,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>Uc(e),children:[(0,i.jsx)(Zr,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(hu,{autoFocus:!0,css:{borderBottom:"1px solid $gray200","& .h-styled-input-container":{border:"none"}},height:"fluid",icon:"magnifying-glass",placeholder:n("rechercher_un_m_45772"),value:h,onChange:I})}),(0,i.jsx)(Xl,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:m?(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:36}),(0,i.jsx)(Vm,{borderRadius:"$1",height:36}),(0,i.jsx)(Vm,{borderRadius:"$1",height:36})]}):X?(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(Xl,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(pc,{icon:"magnifying-glass"})}),(0,i.jsx)(Zr,{font:"gray900 textSm semiBold",children:n("aucun_r_sultat_73664",p)})]}):(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[f(Z)&&(0,i.jsx)(lM,{title:n("actions_rapides_42479"),children:Z.map((e,n)=>(0,i.jsx)(rM,{icon:e.icon,link:e.link,onClose:ee,children:e.text},n))}),f(x)&&(0,i.jsx)(lM,{title:n("membres_11310"),children:x.map(e=>(0,i.jsx)(rM,{avatar:(0,i.jsx)(F_,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:Ev.MEMBER_INFORMATION({organizationId:t,eventId:s,userInfoId:e.id}),onClose:ee,children:e.name},e.id))}),f(v)&&(0,i.jsx)(lM,{title:n("Event"),children:v.map(e=>(0,i.jsx)(rM,{icon:"cake-candles",link:eo.EVENT({organizationId:t,eventId:e.id}),onClose:ee,children:e.name},e.id))}),f(y)&&(0,i.jsx)(lM,{title:n("champs_de_formu_64126"),children:y.map(e=>(0,i.jsx)(rM,{icon:"text",link:av.UPDATE({organizationId:t,eventId:e.eventId??void 0,customFieldId:e.id}),onClose:ee,children:e.name},e.id))}),f(A)&&(0,i.jsx)(lM,{title:n("missions_63972"),children:A.map(e=>(0,i.jsx)(rM,{icon:"sitemap",link:Eo.POSITION({organizationId:t,eventId:s,positionId:e.id}),onClose:ee,children:e.name},e.id))}),f($)&&(0,i.jsx)(lM,{title:n("Form_plural"),children:$.map(e=>(0,i.jsx)(rM,{icon:"file-lines",link:Ks.FORM_ELEMENTS({organizationId:t,eventId:s,formId:e.id}),onClose:ee,children:e.name},e.id))}),f(z)&&(0,i.jsx)(lM,{title:n("documents_perso_87374"),children:z.map(e=>(0,i.jsx)(rM,{icon:"file",link:QD.EDIT_CUSTOM_DOCUMENT({organizationId:t,eventId:s,customDocumentId:e.id}),onClose:ee,children:e.name},e.id))}),f(R)&&(0,i.jsx)(lM,{title:n("accr_ditations_39450"),children:R.map(e=>(0,i.jsx)(rM,{icon:"badge-check",link:mo.ACCREDITATION({organizationId:t,eventId:s,accreditationId:e.id}),onClose:ee,children:e.name},e.id))}),f(M)&&(0,i.jsx)(lM,{title:n("profils_d_accr_27825"),children:M.map(e=>(0,i.jsx)(rM,{icon:"badge-check",link:iM.ACCREDITATIONS_PROFILE({organizationId:t,eventId:s,accreditationProfileId:e.id}),onClose:ee,children:e.name},e.id))}),f(k)&&(0,i.jsx)(lM,{title:n("d_l_gations_78318"),children:k.map(e=>(0,i.jsx)(rM,{icon:"users",link:vo.DELEGATION({organizationId:t,eventId:s,delegationId:e.id}),onClose:ee,children:e.name},e.id))}),f(N)&&(0,i.jsx)(lM,{title:n("layouts_27757"),children:N.map(e=>(0,i.jsx)(rM,{icon:"brush",link:lO.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:t,eventId:s,delegationsSpaceLayoutId:e.id}),onClose:ee,children:e.name},e.id))}),f(U)&&(0,i.jsx)(lM,{title:n("Campaigns"),children:U.map(e=>(0,i.jsx)(rM,{icon:"paper-plane",link:Nv.CAMPAIGN_DASHBOARD({organizationId:t,eventId:s,campaignId:e.id}),onClose:ee,children:e.name},e.id))}),f(B)&&(0,i.jsx)(lM,{title:n("automatisations_60045"),children:B.map(e=>(0,i.jsx)(rM,{icon:"hand-sparkles",link:Vv.WORKFLOW({organizationId:t,eventId:s,workflowId:e.id}),onClose:ee,children:e.name},e.id))}),f(G)&&(0,i.jsx)(lM,{title:n("vues_personnali_80652"),children:G.map(e=>(0,i.jsx)(rM,{link:aM(e),onClose:ee,children:e.name},e.id))}),f(H)&&(0,i.jsx)(lM,{title:n("_quipes_18817"),children:H.map(e=>(0,i.jsx)(rM,{link:Wo.TEAM_ASSIGNMENT(t,s,e.teamCode),onClose:ee,children:e.teamCode},e.teamCode))})]})})]})}),document.body):null},mM=(0,de.memo)(function(){const{translate:e}=fc(),{pathname:n}=us(),{organization:t,selectedEventId:s}=Yy(),[o,a]=(0,de.useState)(!1),r=n===eo.EVENTS({organizationId:t.id})||null!==n.match(/\/events/)||null!==n.match(/\/event\/\d+/),d=(0,Tg.A)(t.events.nodes.filter(e=>e.state===gn.Ongoing||e.state===gn.Upcoming),e=>e.name),l=t.events.nodes.find(e=>e.id===s);return(0,i.jsxs)(ym,{onStateChange:a,children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Xl,{align:"center","aria-expanded":o,"aria-label":e("ouvrir_la_liste_52670"),"aria-selected":o,css:{blockSize:"100%",color:"white",opacity:r?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},gap:"2",role:"button",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),document.getElementById("events-menu")?.focus()},children:[l?l.name:e("_v_nements_53672"),o?(0,i.jsx)(pc,{icon:"angle-up"}):(0,i.jsx)(pc,{icon:"angle-down"})]})}),(0,i.jsxs)(wm,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:d.map(e=>(0,i.jsx)(Am,{to:eo.EVENT({organizationId:t.id,eventId:e.id}),onClick:e=>{vm(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(Hj,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Am,{to:eo.EVENTS({organizationId:t.id}),onClick:e=>{vm(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})});var gM,hM;function pM(){return pM=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const{translate:n,params:{eventId:t}}=fc(),{organization:s}=Yy(),o=(0,de.useMemo)(()=>t?s.events.nodes.find(e=>e.id===t):void 0,[t,s]),a=$x(e.weezeventOrganizationId,o?.weezticketEventId),r=Tx(e.weezeventOrganizationId,o?.weezaccessEventId),d=(l=e.weezeventOrganizationId,wx(`pay/#!/${l}`).href);var l;return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xl,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(pc,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Xl,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("passer_75488")}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(gc,{to:a,children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(Zr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(CM,{})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("billetterie_53780")})]})]})}),(0,i.jsx)(gc,{to:r,children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(Zr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(IM,{})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(gc,{to:d,children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(Zr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(jM,{})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},AM=({to:e,children:n,isActive:t,onClick:s})=>{const{pathname:o}=us(),a=t?t(o):e===o;return(0,i.jsx)(Xl,{"aria-selected":a,css:{alignItems:"center",blockSize:"100%",color:"white",cursor:"pointer",opacity:a?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},height:1,role:"menuitem",children:(0,i.jsx)(gc,{height:1,to:e,width:1,onClick:s,children:n})})},EM=(0,de.memo)(function(){const{translate:e,params:{organizationId:n}}=fc(),{organization:t,user:s,updateLocalOrganization:o,hasOrganizationRole:a}=Yy(),{canShow:r,show:d}=Wy(),{canCustomFieldRead:c}=iC(),{data:u}=ll({}),[m,g]=(0,de.useState)(!1),h=(0,de.useMemo)(()=>{const e=(0,l.A)(u.user?.roles??[],e=>e.organizationId);return(0,Tg.A)((u.organizations||[]).filter(n=>f(e[n.id])),e=>e.name)},[u.organizations,u.user]);return(0,i.jsxs)(Xl,{align:"center",css:{background:"$blueGray900",color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(Xl,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(gc,{height:1,to:eo.EVENTS({organizationId:n}),children:Mv(n)?.logo??(0,i.jsx)(Du,{})})}),(0,i.jsx)(Xl,{"aria-label":e("menu_de_l_organ_58508"),as:Yl.Nav,height:1,children:(0,i.jsxs)(Xl,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(mM,{}),c&&(0,i.jsx)(AM,{isActive:e=>e.startsWith(av.CUSTOM_FIELDS({organizationId:n})),to:av.CUSTOM_FIELDS({organizationId:n}),onClick:async()=>await o({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")}),a&&(0,i.jsx)(AM,{isActive:e=>e.startsWith(Ms.COMMUNITY({organizationId:n})),to:Ms.COMMUNITY_USERS({organizationId:n}),children:e("communaut_20896")}),(0,i.jsx)(AM,{isActive:e=>e.startsWith(Wo.ORGANIZATION_PARAMETERS(n)),to:Wo.ORGANIZATION_PARAMETERS_PROFILE(n),children:e("param_tres_78420")})]})}),(0,i.jsxs)(Xl,{align:"center",gap:"6",justify:"end",width:300,children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Xl,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",role:"button",onClick:()=>{window.open("https://upmoon.app/weezevent?labels=weezcrew","_blank")},children:(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(pc,{icon:"megaphone"})})}),r&&(0,i.jsx)(Xl,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",role:"button",onClick:d,children:(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(pc,{icon:"messages-question"})})}),"number"==typeof t.weezeventOrganizationId&&(0,i.jsx)(bM,{weezeventOrganizationId:t.weezeventOrganizationId})]}),(0,i.jsxs)(ym,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:m,onStateChange:g,children:[(0,i.jsx)($m,{children:(0,i.jsxs)(Xl,{align:"center","aria-expanded":m,"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)(F_,{email:s.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:32}),(0,i.jsxs)(Zr,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},fontWeight:"semiBold",children:s.userInfo.firstName||s.email}),(0,i.jsx)(Zr,{css:{ellipsis:!0},fontSize:"textXs",children:t.name})]}),(0,i.jsx)("div",{children:m?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(wm,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)(Am,{children:(0,i.jsxs)(Xl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(F_,{email:s.email,image:s.userInfo.picture?.url,name:s.userInfo.name,size:32}),(0,i.jsxs)(Zr,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},fontWeight:"semiBold",children:s.userInfo.name||s.email}),w(s.userInfo.name)&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},children:s.email})]})]})}),(0,i.jsx)(Hj,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Xl,{as:Yl.Nav,direction:"column",role:"menubar",children:[h.map(({id:e,name:n})=>(0,i.jsx)(Am,{onClick:async()=>{await o({eventsSegmentId:null}),location.href=`${ee.HEAVENT_APP_URL.pathname}${eo.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:n},e)),(0,i.jsx)(Hj,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Am,{to:Wo.ORGANIZATION_PARAMETERS_PROFILE(n),onClick:()=>{g(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Am,{to:Wo.ORGANIZATION_PARAMETERS_INFOS(n),onClick:()=>{g(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")})}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Am,{to:Wo.ORGANIZATION_PARAMETERS_TEAM(n),onClick:()=>{g(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")})}),(0,i.jsx)(Hj,{color:"gray100",direction:"horizontal"}),Fg(s.email)&&(0,i.jsx)(Am,{to:Wo.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)(Am,{color:"red",onClick:_e,children:e("se_d_connecter_74151")})]})]})]})]})]})}),wM=[1033,1538,1787,2574,2954,3059,3854,3900].concat([1823,2659]),$M=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=us(),{organization:o}=Yy(),[a,r]=(0,de.useState)(!1),d=function(e){return Math.ceil(e.periodEndAt.diff(Jo.c9.utc(),"days").days)}(o),l=(c=d)>0&&c<=15;var c;const u=o.invoices.length>0,m=(0,de.useCallback)(()=>{r(!0)},[r]);if((0,de.useEffect)(()=>(document.addEventListener(fa,m),()=>{document.removeEventListener(fa,m)}),[]),o.isBlocked&&!s.pathname.endsWith($s))return(0,i.jsx)(gs,{path:Os.IS_BLOCKED(Os.ORGANIZATION({organizationId:t}))});if(!o.isBlocked&&s.pathname.endsWith($s))return(0,i.jsx)(gs,{path:Os.ORGANIZATION({organizationId:t})});if(d<=0&&!s.pathname.endsWith(Ts))return(0,i.jsx)(gs,{path:Os.IS_EXPIRED(Os.ORGANIZATION({organizationId:t}))});if(d>0&&s.pathname.endsWith(Ts))return(0,i.jsx)(gs,{path:Os.ORGANIZATION({organizationId:t})});{const s=u&&!wM.includes(t),c=64+(a?40:0)+(l||s?64:0);return(0,i.jsxs)(Xl,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[a&&(0,i.jsxs)(Xl,{align:"center",css:{background:"$primary100",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(Zr,{}),(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",children:n("une_nouvelle_ve_69718")}),(0,i.jsx)(yc,{color:"invisible",css:{height:"auto",padding:0},type:"button",onClick:()=>{window.location.reload()},children:n("cliquez_pour_re_36838")})]}),(0,i.jsx)(Zr,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{r(!1)},children:(0,i.jsx)(pc,{icon:"xmark"})})]}),l&&!s&&(0,i.jsx)(Xl,{align:"center",css:{background:"$primary500",color:"white"},dangerouslySetInnerHTML:{__html:`

${n("trial_remaining_days",d,`${ee.EMAIL_FROM}`,nm)}

`},height:64,justify:"center",width:1}),s&&(0,i.jsx)(Xl,{align:"center",css:{background:"$primary500",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:n("sauf_erreur_de_03325",o.invoices[0].url,o.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(Zr,{as:Yl.Header,height:64,width:1,children:(0,i.jsx)(EM,{})}),(0,i.jsx)(Zr,{as:Yl.Main,css:{height:`calc(100% - ${c}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(uM,{level:"organization"})]})}};var TM,zM,OM,RM,DM;let MM=class extends ju{countriesService;documentInputService;fieldInputService;phoneInputService;constructor(e,n,t,i,s){super(e),this.countriesService=n,this.documentInputService=t,this.fieldInputService=i,this.phoneInputService=s}userInfoUpdateInputDefault(e,n,t={}){const i=this.countriesService.getDefaultCountryValues(t.countryCode);return{id:e?.id??null,fields:this.fieldInputService.fieldsUpdateInputDefault(e?.fields||{},n,i,t.checkboxDefaultEmpty)}}updateUserInfoChangedFieldsSchema(e,n,t){return Jl.Ik().shape({userInfo:Jl.Ik().shape({fields:this.fieldInputService.changedFieldsSchema(e,n,t)})})}formUserInfoInputSchema(e){return Jl.Ik().shape({fields:Jl.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:n})=>[n.slug,this.fieldInputService.fieldSchema(n,e)])))})}userInfoProfileInputDefault(e){const n=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.language??e.userInfo?.fields?.language??n.user.language??gt.En,picture:e.userInfo.fields.picture?(0,Qr.A)(e.userInfo.fields.picture,Ob):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,Qr.A)(e.userInfo.fields.phone,Dj):this.phoneInputService.phoneInputDefault(n)}}}userInfoFields(){return{fields:Jl.Ik().shape({firstName:Jl.Yj().nullable(),lastName:Jl.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:Jl.Yj().required(this.t("les_langues_doi_27712")).oneOf(Xu,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return Jl.Ik().shape({email:Jl.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateProfileSchema(){return Jl.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,Rr.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return Jl.Ik().shape({firstName:Jl.Yj().nullable(),lastName:Jl.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:Jl.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return Jl.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};MM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(TM=void 0!==ts&&ts)?TM:Object,"function"==typeof(zM=void 0!==dh&&dh)?zM:Object,"function"==typeof(OM=void 0!==Rb&&Rb)?OM:Object,"function"==typeof(RM=void 0!==Ub&&Ub)?RM:Object,"function"==typeof(DM=void 0!==Mj&&Mj)?DM:Object])],MM);var PM;let kM=class extends ju{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||Jo.c9.invalid("Invalid"),startTime:"",endDate:e||Jo.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,n){const t=n.plus({day:1}).endOf("day");return Jl.Ik().shape({startDate:e_.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()),n=>n>=e),startTime:Jl.Yj().required(this.t("heure_de_d_but_90785")),endDate:e_.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,n)=>Jo.c9.isDateTime(n.parent.startDate)&&n.parent.startDate.isValid&&Jo.c9.isDateTime(n.parent.endDate)&&n.parent.endDate.isValid&&n.parent.endDate>=n.parent.startDate).test("before-event-end-date",this.t("la_date_de_fin_49125",n.toLocaleString()),e=>e<=t),endTime:Jl.Yj().required(this.t("l_heure_de_fin_78626"))})}};kM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(PM=void 0!==ts&&ts)?PM:Object])],kM);var FM,NM;let LM=class extends ju{translationService;volunteerRegistrationSlotInputService;constructor(e,n){super(e),this.translationService=e,this.volunteerRegistrationSlotInputService=n}slotsFields(e,n,t,i,s){switch(e){case at.Display:case at.DisplayDays:case at.Calendar:case at.Custom:return{slots:Jl.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(t,i)).min(s?0:n,this.t("vous_devez_ajou_68961",n))};case at.Hide:return{};default:return Ic()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return f(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,n,t){if(e===Cn.Ranked){if(n===st.Category)return{positionsCategoriesIds:Jl.YO().of(Jl.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const n=(0,sc.A)((e||[]).filter(e=>-1!==e));return f(n)&&(0,Zo.A)(n).length===n.length})};if(n===st.Position)return{positionsIds:Jl.YO().of(Jl.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const n=(0,sc.A)((e||[]).filter(e=>-1!==e));return f(n)&&(0,Zo.A)(n).length===n.length})};if(n===st.Slot)return{positionsSlotsIds:Jl.YO().of(Jl.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const n=(0,sc.A)((e||[]).filter(e=>-1!==e));return f(n)&&(0,Zo.A)(n).length===n.length})};throw new Error("Should not happen")}switch(n){case st.Category:return{positionsCategoriesIds:Jl.YO().of(Jl.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_32044"))};case st.Position:return{positionsIds:Jl.YO().of(Jl.ai().typeError(this.t("s_lectionner_un_26253"))).min(t?0:1,this.t("vous_devez_s_le_89603"))};case st.Slot:return{positionsSlotsIds:Jl.YO().of(Jl.ai()).min(t?0:1,this.t("vous_devez_s_le_89603"))};case st.None:return{};default:return Ic()}}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationProfileId:e.accreditationProfileId,accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationProfileFields(e,n){return e&&f(n)?{accreditationProfileId:Jl.ai().required(this.t("vous_devez_s_le_07918"))}:{}}accreditationsFields(e,n,t){if(n)return{};switch(e){case tt.Accreditation:return{accreditationsSlotsIds:Jl.YO().of(Jl.ai().typeError(this.t("s_lectionner_un_96571"))).min(t?0:1,this.t("vous_devez_s_le_72138"))};case tt.None:return{};default:return Ic()}}userInfoAccreditationsSchema(e){return Jl.Ik().shape({userInfo:Jl.Ik().shape({accreditations:Jl.YO().of(Jl.Ik().shape({formId:Jl.ai().required(),...this.accreditationsFields(e,null)}))})})}adminAddSchema(){return Jl.Ik().shape({usersInfosIds:Jl.YO().of(Jl.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:Jl.zM().required()})}};LM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(FM=void 0!==ts&&ts)?FM:Object,"function"==typeof(NM=void 0!==kM&&kM)?NM:Object])],LM);var UM,VM,BM,WM,GM;let qM=class extends ju{fieldInputService;userInfoInputService;volunteerRegistrationInputService;volunteerRegistrationSlotInputService;constructor(e,n,t,i,s){super(e),this.fieldInputService=n,this.userInfoInputService=t,this.volunteerRegistrationInputService=i,this.volunteerRegistrationSlotInputService=s}formRegisterInputDefault(e,n,t,i){return{autoAccredit:!1,forOther:i.forOther,positionsSlotsIds:i.team?.positionsSlotsIds??[],positionsIds:i.team?.positionsIds??[],positionsCategoriesIds:i.team?.positionsCategoriesIds??[],accreditationProfileId:null,accreditationsSlotsIds:(i.delegationAccreditationsSlots??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(n,t,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.team?.slots??(i.slotDisplay===at.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:[]),source:e}}formRegisterInformationsSchema(e){return Jl.Ik().shape({formRegister:Jl.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,n,t,i){return Jl.Ik().shape({formRegister:Jl.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,n,t,i)})})}formRegisterPositionsSchema(e,n){return Jl.Ik().shape({formRegister:Jl.Ik().shape({...this.volunteerRegistrationInputService.wishedPositionsFields(e,n)})})}formRegisterAccreditationsSchema(e,n,t,i){const s=function(e){return Object.values(e.reduce((e,n)=>{const t=e[n.customField.slug];return t?{...e,[n.customField.slug]:{accreditationsSlotsIds:t.accreditationsSlotsIds.concat(n.accreditationsSlotsIds),customField:n.customField,isMandatory:t.isMandatory||n.isMandatory}}:{...e,[n.customField.slug]:{accreditationsSlotsIds:n.accreditationsSlotsIds,customField:n.customField,isMandatory:n.isMandatory}}},{}))}(t);return Jl.Ik().shape({formRegister:Jl.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:Jl.Ik().shape({fields:Jl.Ik().shape(Object.fromEntries(s.map(e=>{const t=e.isMandatory&&f((0,tg.A)(e.accreditationsSlotsIds,n));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,t)]})))})})})}formRegisterSchema(e,{accreditationDisplay:n,areSectionsDisabled:t,delegationAccreditationsProfiles:i,delegationId:s,eventEndDate:o,eventStartDate:a,minNumberOfSlots:r,positionDisplay:d,positionRanking:l,slotDisplay:c}){return Jl.Ik().shape({email:Jl.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:Jl.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(c,r,a,o,t?.isWishedAssignmentsDisabled),...this.volunteerRegistrationInputService.wishedPositionsFields(l,d,t?.isWishedAssignmentsDisabled),...this.volunteerRegistrationInputService.accreditationsFields(n,s,t?.isWishedAccreditationsDisabled),...this.volunteerRegistrationInputService.accreditationProfileFields(s,i)})})}};qM=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(UM=void 0!==ts&&ts)?UM:Object,"function"==typeof(VM=void 0!==Ub&&Ub)?VM:Object,"function"==typeof(BM=void 0!==MM&&MM)?BM:Object,"function"==typeof(WM=void 0!==LM&&LM)?WM:Object,"function"==typeof(GM=void 0!==kM&&kM)?GM:Object])],qM);const HM=e=>{const n=(0,de.useMemo)(()=>e.elements.flatMap(e=>e.elementType===yn.Field?(0,sc.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]).map(n=>Sp(e.organizationId)&&yp().includes(n.id)&&f(e.asoBannersColors)?{...n,values:n.values.filter(({id:n})=>e.asoBannersColors?.includes(n))}:n),[e.elements]),t=(0,de.useMemo)(()=>Object.fromEntries(n.map(e=>[e.id,e])),[n]);return(0,i.jsx)(Zr,{children:e.elements.map((s,o)=>{switch(s.elementType){case yn.Field:{const a=t[s.customField.id];if(!a)return null;const r=Tb(a,e.values,n);return(0,i.jsxs)(de.Fragment,{children:[r&&0!==o&&(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(xA,{change:e.change,countryCode:e.countryCode,disabled:Rv.includes(a.id),display:r,field:a,isMandatory:!0===s.isMandatory,organizationId:e.organizationId,prefix:e.prefix},o)]},o)}case yn.Section:return Tb(s,e.values,n)?(0,i.jsx)(de.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(s.section,o):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:"5"})]}):0!==o&&(0,i.jsx)(ic,{height:"8"}),(0,i.jsx)(Zr,{font:"grayCustom900 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(s.section,"TEXT"):s.section})]})},o):null;case yn.Text:return Tb(s,e.values,n)?(0,i.jsx)(de.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==o&&(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(p_,{text:"function"==typeof e.renderText?e.renderText(s.text):s.text})]})},o):null;default:return Ic(s.elementType)}})})},YM=e=>{const n=os();return(0,i.jsxs)(Jg,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yc,{onClick:e.onClose,children:n("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",width:1,children:(0,i.jsx)(uA,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",width:1,children:n("informations_su_86120",e.name)}),(0,i.jsx)(ic,{height:"7"}),w(e.description)&&(0,i.jsxs)(Xl,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:n("description_58935")}),(0,i.jsx)(p_,{text:e.description})]}),(0,i.jsx)(ic,{height:"4"})]})},ZM=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),o=(0,de.useMemo)(()=>w(e.profile.description)&&e.showDescription,[e.profile,e.showDescription]),a=(0,de.useMemo)(()=>(e.delegationAccreditationsProfiles||[]).find(({accreditationProfileId:n})=>n===e.profile.id),[e.delegationAccreditationsProfiles,e.profile]),r=(0,de.useCallback)(()=>"number"==typeof a?.maxResources?{assignedResources:a.assignedResources,maxResources:a.maxResources,remaining:a.maxResources-a.assignedResources}:null,[a]),d=(0,de.useMemo)(()=>!!a&&a.isFull&&e.alreadyAssignedProfileId!==e.profile.id,[e.alreadyAssignedProfileId,a,e.profile]),l=(0,de.useMemo)(()=>(0,i.jsx)(q$,{getAssignedMaxRemaining:r,slotId:e.profile.id}),[r,e.profile]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AA,{accreditation:e.profile,badge:l,displayNumberOfSlots:!1,displaySlots:!1,numberOfSlots:0,renderActions:()=>o&&(0,i.jsx)(yc,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),s(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>(0,i.jsx)(Jm,{disabled:d,shouldPreventDefault:!1,state:e.profile.id===e.accreditationProfileId?"checked":"unchecked",onClick:Ou.A}),onClick:()=>{d||e.setAccreditationProfileId(e.profile.id===e.accreditationProfileId?null:e.profile.id)}}),t&&(0,i.jsx)(YM,{description:e.profile.description,name:e.profile.name,onClose:()=>s(!1)})]})},KM=e=>{const{translate:n}=fc(),t=(0,de.useCallback)(n=>{e.change(`${e.prefix}accreditationProfileId`,n)},[e.prefix,e.change]);return(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{font:"gray800 textMd semiBold",children:n("quel_profil_vou_78626")}),(0,i.jsx)(Xl,{css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"3",children:e.accreditationsProfiles.map(n=>(0,i.jsx)(ZM,{accreditationProfileId:e.accreditationProfileId,alreadyAssignedProfileId:e.alreadyAssignedProfileId,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,profile:n,setAccreditationProfileId:t,showDescription:e.options.showAccreditationDescription},n.id))})]})},XM=e=>{const{translate:n}=fc(),t=ss(Wg);return(0,i.jsx)(i.Fragment,{children:f(e.slots)?e.slots.map(n=>(0,i.jsx)(Zm,{disabled:e.getDisabled(n.id),state:e.accreditationsSlotsIds.includes(n.id)?"checked":"unchecked",onClick:t=>{e.onChange(j(e.accreditationsSlotsIds,n.id,"checked"===t))},children:(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},children:qp(t,n,e.accreditation.name,{date:{localeFormat:da.DateOnly.WeekdayLongMonthLong}})}),(0,i.jsx)(q$,{getAssignedMaxRemaining:e.getAssignedMaxRemaining,slotId:n.id})]})},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},QM=e=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:f(e.slots)?e.slots.map(n=>(0,i.jsx)(eg,{disabled:e.getDisabled(n.id),state:e.accreditationsSlotsIds.includes(n.id)?"checked":"unchecked",onClick:t=>{const i=[...e.accreditationsSlotsIds.filter(e=>!s.includes(e)),..."checked"===t?[n.id]:[]];e.onChange(i)},children:(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},children:qp(t,n,e.accreditation.name,{date:{localeFormat:da.DateOnly.WeekdayLongMonthLong}})}),(0,i.jsx)(q$,{getAssignedMaxRemaining:e.getAssignedMaxRemaining,slotId:n.id})]})},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},JM=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]),s=(0,de.useMemo)(()=>e.accreditation.accreditationDisplay===be.List&&e.slots.every(n=>e.accreditationsSlotsIds.includes(n.id)),[e.accreditation,e.accreditationsSlotsIds,e.slots]),o=(0,de.useCallback)(()=>{s?e.onChange((0,Wm.A)(e.accreditationsSlotsIds,t)):e.onChange((0,Zo.A)(e.accreditationsSlotsIds.concat(t)))},[s,e.accreditationsSlotsIds,e.onChange,t]);return e.accreditation.accreditationDisplay===be.List?(0,i.jsx)(Xl,{css:{borderTop:"1px solid $gray200",padding:"$4"},children:(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:o,children:n(s?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})}):null},eP=e=>{const{params:{organizationId:n},translate:t}=fc(),[s,o]=(0,de.useState)(!1),a=(0,de.useMemo)(()=>w(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),r=(0,de.useMemo)(()=>{const n=e.accreditation.hasSlots?e.slots.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&f(e.accreditation.formCustomFields)&&f((0,tg.A)(n,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,e.slots]),d=(0,de.useMemo)(()=>Object.fromEntries(e.delegationAccreditationsSlots.map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),l=(0,de.useCallback)(e=>{const n=d[e];return"number"==typeof n?.maxResources?{assignedResources:n.assignedResources,maxResources:n.maxResources,remaining:n.maxResources-n.assignedResources}:null},[d]),c=(0,de.useCallback)(n=>{const t=d[n];return!!t&&t.isFull&&t.willAutoAccredit&&!e.alreadyAssignedSlotsIds.includes(n)},[e.alreadyAssignedSlotsIds,d]),u=(0,de.useMemo)(()=>e.accreditation.hasSlots?null:(0,i.jsx)(q$,{getAssignedMaxRemaining:l,slotId:e.accreditation.hiddenSlotId}),[l,e.accreditation]),m=(0,de.useCallback)(n=>{e.change(`${e.prefix}accreditationsSlotsIds`,n)},[e.prefix,e.change]),g=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AA,{accreditation:e.accreditation,badge:u,displayFormCustomFields:r,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>a&&(0,i.jsx)(yc,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(!0)},children:t("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(Ym,{disabled:c(e.accreditation.hiddenSlotId),shouldPreventDefault:!1,state:g,onClick:Ou.A}),onClick:()=>{e.accreditation.hasSlots||c(e.accreditation.hiddenSlotId)||e.change(`${e.prefix}accreditationsSlotsIds`,j(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===g))},children:(0,i.jsxs)(Xl,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===be.Calendar?(0,i.jsx)(Y$,{accreditationsSlotsIds:e.accreditationsSlotsIds,slotIdToDas:d,slots:e.slots,onChange:m}):(0,i.jsxs)(Xl,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsx)(Xl,{css:{padding:"$4"},direction:"column",gap:"3",children:e.accreditation.accreditationDisplay===be.Radio?(0,i.jsx)(QM,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,getAssignedMaxRemaining:l,getDisabled:c,slots:e.slots,onChange:m}):(0,i.jsx)(XM,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,getAssignedMaxRemaining:l,getDisabled:c,slots:e.slots,onChange:m})}),(0,i.jsx)(JM,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slots:e.slots,onChange:m})]}):null,r&&(0,i.jsx)(Xl,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.formCustomFields.map(({customField:t,isMandatory:s})=>(0,i.jsx)(xA,{change:e.change,display:!0,field:t,isMandatory:s,organizationId:n,prefix:`${e.prefix}userInfo.fields.`},t.id))})]})}),s&&(0,i.jsx)(YM,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>o(!1)})]})},nP=e=>{const{translate:n}=fc();return(0,i.jsx)(bA,{category:e.category.name,children:f(e.accreditations)?e.accreditations.map(n=>(0,i.jsx)(eP,{accreditation:n,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.accreditationIdToSelectableSlots[n.id]??p},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},tP=e=>{const{translate:n}=fc();return(0,i.jsx)(CA,{css:{background:"transparent",padding:"0"},children:f(e.categories)?(0,i.jsxs)(i.Fragment,{children:[e.categories.map(n=>(0,i.jsx)(nP,{accreditationIdToSelectableSlots:e.accreditationIdToSelectableSlots,accreditations:e.categoryIdToSelectableAccreditations[n.id]??p,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,category:n,change:e.change,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix},n.id)),e.showAutoAccredit&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:n("attribution_des_59896")}),(0,i.jsx)(Jx,{name:`${e.prefix}autoAccredit`,children:n("attribuer_les_a_75431")})]})]}):f(e.delegationAccreditationsProfiles)?null:(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},iP=(0,de.memo)(e=>{const{accreditationIdToSelectableSlots:n,categoryIdToSelectableAccreditations:t,selectableCategories:s,selectableProfiles:o}=(0,de.useMemo)(()=>{const n=Ph(e.slots.map(oa)),t=e.event.accreditationsProfilesCategories.flatMap(n=>n.accreditationsProfiles.filter(n=>function(e,n,t){return n.some(n=>n.accreditationProfileId===e.id&&(t===n.accreditationProfileId||!n.isFull))}(n,e.delegationAccreditationsProfiles,e.alreadyAssignedProfileId))),i=e.event.accreditationsCategories.flatMap(t=>t.accreditations.flatMap(t=>t.slots.filter(t=>function(e,n,t,i,s,o){const a=t.slotDisplay===at.Hide||t.accreditationFilter===ot.None||!e.date||n.some(n=>ra(n,e.date)),r=t.showFullAccreditation||o.includes(e.id),d=t.accreditationDisplay!==tt.None&&!t.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===t.displayedAccreditationsSlotsIds.length||t.displayedAccreditationsSlotsIds.includes(e.id))&&(r||!e.isFull),l=i.some(n=>n.accreditationSlotId===e.id&&(r||!n.isFull&&!e.isFull));return!s.includes(e.id)&&!e.isBlocked&&a&&(d||l)}(t,n,e.options,e.delegationAccreditationsSlots,e.scannedSlotsIds,e.alreadyAssignedSlotsIds)))),s=i.map(e=>e.id),o=(0,dg.A)((0,l.A)(i,e=>e.accreditationId),e=>(0,Tg.A)(e,e=>(0,sc.A)([e.date?.toMillis(),b(e.name)]))),a=e.event.accreditationsCategories.flatMap(n=>n.accreditations.filter(n=>function(e,n,t,i,s){return i.accreditationDisplay!==tt.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&Xh(e,t)&&e.slots.some(e=>n.includes(e.id))||s.some(i=>i.accreditationId===e.id&&Xh(e,t)&&e.slots.some(e=>n.includes(e.id)))}(n,s,e.userInfosFields,e.options,e.delegationAccreditationsSlots))),r=a.map(e=>e.id),d=(0,dg.A)((0,l.A)(a,e=>e.accreditationCategoryId),e=>rp(e)),c=(0,Tg.A)(e.event.accreditationsCategories.filter(n=>function(e,n,t,i){return t.accreditationDisplay!==tt.None&&!t.hiddenAccreditationsCategoriesIds.includes(e.id)&&(0===t.displayedAccreditationsCategoriesIds.length||t.displayedAccreditationsCategoriesIds.includes(e.id))&&e.accreditations.some(e=>n.includes(e.id))||i.some(t=>t.accreditationCategoryId===e.id&&e.accreditations.some(e=>n.includes(e.id)))}(n,r,e.options,e.delegationAccreditationsSlots)),e=>b(e.name));return{selectableCategories:c,selectableProfiles:t,categoryIdToSelectableAccreditations:d,accreditationIdToSelectableSlots:o}},[e.alreadyAssignedProfileId,e.alreadyAssignedSlotsIds,e.delegationAccreditationsProfiles,e.delegationAccreditationsSlots,e.event.accreditationsCategories,e.event.accreditationsProfilesCategories,e.options,e.scannedSlotsIds,e.slots,e.userInfosFields]);return(0,de.useEffect)(()=>{const n=e.event.accreditationsCategories.flatMap(n=>n.accreditations.filter(n=>!Xh(n,e.userInfosFields)).flatMap(e=>e.slots.map(e=>e.id))),t=e.accreditationsSlotsIds.filter(t=>!n.includes(t)||e.alreadyAssignedSlotsIds.includes(t));t.length!==e.accreditationsSlotsIds.length&&e.change(`${e.prefix}accreditationsSlotsIds`,t)},[e.accreditationsSlotsIds,e.alreadyAssignedSlotsIds,e.event.accreditationsCategories,e.userInfosFields]),f(o)||f(e.delegationAccreditationsSlots)||e.options.accreditationDisplay===tt.Accreditation?(0,i.jsxs)(Xl,{direction:"column",gap:"9",children:[f(e.delegationAccreditationsProfiles)&&(0,i.jsx)(KM,{accreditationProfileId:e.accreditationProfileId,accreditationsProfiles:o,alreadyAssignedProfileId:e.alreadyAssignedProfileId,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,options:e.options,prefix:e.prefix}),(0,i.jsx)(tP,{accreditationIdToSelectableSlots:n,accreditationsSlotsIds:e.accreditationsSlotsIds,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,categories:s,categoryIdToSelectableAccreditations:t,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles,delegationAccreditationsSlots:e.delegationAccreditationsSlots,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit})]}):null}),sP=e=>{const[n,t]=(0,de.useState)(!1),s=w(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}positionsCategoriesIds`,j(e.positionsCategoriesIds,e.category.id,"checked"===n))},children:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{children:e.category.name}),s&&(0,i.jsx)(Zr,{onClick:e=>{Uc(e),t(!0)},children:(0,i.jsx)(pc,{icon:"circle-info"})})]})}),n&&(0,i.jsx)(YM,{description:e.category.description,name:e.category.name,onClose:()=>{t(!1)}})]})},oP=e=>{const{translate:n}=fc();return(0,i.jsx)(i.Fragment,{children:f(e.categories)?e.categories.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(sP,{category:n,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},aP=e=>{const[n,t]=(0,de.useState)(!1),s=w(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zm,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}positionsIds`,j(e.positionsIds,e.position.id,"checked"===n))},children:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{children:e.position.name}),s&&(0,i.jsx)(Zr,{onClick:e=>{Uc(e),t(!0)},children:(0,i.jsx)(pc,{icon:"circle-info"})})]})}),n&&(0,i.jsx)(YM,{description:e.position.description,name:e.position.name,onClose:()=>{t(!1)}})]})},rP=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),o=w(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),o&&(0,i.jsx)(Zr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(pc,{icon:"circle-info"})})]}),(0,i.jsx)(ic,{height:"2"}),f(e.positions)?e.positions.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(aP,{change:e.change,options:e.options,position:n,positionsIds:e.positionsIds,prefix:e.prefix})]},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),t&&(0,i.jsx)(YM,{description:e.category.description,name:e.category.name,onClose:()=>{s(!1)}})]})},dP=e=>{const{translate:n}=fc();return(0,i.jsx)(i.Fragment,{children:f(e.categories)?e.categories.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(rP,{category:n,change:e.change,options:e.options,positions:e.categoryIdToSelectablePositions[n.id]??p,positionsIds:e.positionsIds,prefix:e.prefix})]},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},lP=e=>{const n=os(),t=VI(),s=(0,de.useMemo)(()=>e.categories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[f(s)?t?(0,i.jsxs)(lg,{isSearchVisible:!0,label:n("souhait_n_1_47211",e.index+1),values:[e.positionsCategoriesIds?.[e.index]??-1],onChange:n=>{f(n)&&e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,n[0])},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(nf,{label:n("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsCategoriesIds?.[e.index]??-1,onChange:n=>{e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,n)},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(ic,{height:"4"})]})},cP=e=>{const{translate:n}=fc(),t=VI(),s=(0,de.useMemo)(()=>e.categories.map(n=>{const t=e.categoryIdToSelectablePositions[n.id]??p;return(0,i.jsx)("optgroup",{label:n.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n.id)}),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[f(s)?t?(0,i.jsxs)(lg,{isSearchVisible:!0,label:n("souhait_n_1_47211",e.index+1),values:[e.positionsIds?.[e.index]??-1],onChange:n=>{f(n)&&e.change(`${e.prefix}positionsIds[${e.index}]`,n[0])},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(nf,{label:n("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsIds?.[e.index]??-1,onChange:n=>{e.change(`${e.prefix}positionsIds[${e.index}]`,n)},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),s]}):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(ic,{height:"4"})]})},uP=e=>{const{translate:n}=fc(),t=ss(Nh),s=VI(),o=(0,de.useMemo)(()=>{const n=e.categories.map(n=>{const t=e.categoryIdToSelectablePositions[n.id]??p;return{...n,positions:t.map(n=>{const t=e.positionIdToSelectableSlots[n.id]??p;return{...n,slots:t}})}});return Zp(t,n)},[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[f(o)?s?(0,i.jsxs)(lg,{isSearchVisible:!0,label:n("souhait_n_1_47211",e.index+1),values:[e.positionsSlotsIds?.[e.index]??-1],onChange:n=>{f(n)&&e.change(`${e.prefix}positionsSlotsIds[${e.index}]`,n[0])},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),o]}):(0,i.jsxs)(nf,{label:n("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsSlotsIds?.[e.index]??-1,onChange:n=>{e.change(`${e.prefix}positionsSlotsIds[${e.index}]`,n)},children:[(0,i.jsx)("option",{value:-1,children:n("choisir_une_mis_90627")}),o]}):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(ic,{height:"4"})]})},mP=e=>{const{translate:n}=fc();return(0,i.jsx)(i.Fragment,{children:f(e.categories)?(0,Sg.A)(0,e.options.positionLimit).map(n=>e.options.positionDisplay===st.Category?(0,i.jsx)(lP,{categories:e.categories,change:e.change,index:n,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},n):e.options.positionDisplay===st.Position?(0,i.jsx)(cP,{categories:e.categories,categoryIdToSelectablePositions:e.categoryIdToSelectablePositions,change:e.change,index:n,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix},n):e.options.positionDisplay===st.Slot?(0,i.jsx)(uP,{categories:e.categories,categoryIdToSelectablePositions:e.categoryIdToSelectablePositions,change:e.change,index:n,options:e.options,positionIdToSelectableSlots:e.positionIdToSelectableSlots,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix},n):null):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})};function gP(e){const n=ss(Nh),t=(0,de.useMemo)(()=>n.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=w(e.name);return{isRenamed:i,finalName:i?e.name:t,rangeString:t}}const hP=e=>{const{translate:n}=fc(),{rangeString:t,finalName:s,isRenamed:o}=gP(e.slot),a=e.position.positionDisplay===Ln.Radio,r=a?eg:Zm,d=(0,de.useMemo)(()=>e.position.slots.map(e=>e.id),[e.position.slots]),l=(0,de.useMemo)(()=>{if(e.options.willAutoAssign){const n=e.allSlots.filter(n=>e.positionsSlotsIds.includes(n.id)&&(!a||!d.includes(n.id)));return qh(e.slot,n)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds,a,d]);return(0,i.jsxs)(de.Fragment,{children:[0!==e.index&&(0,i.jsx)(ic,{height:"3"}),l?(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(r,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?t:void 0,onClick:Ou.A,children:s})})}),(0,i.jsx)(ux,{placement:"top-start",children:n("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(r,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?t:void 0,onClick:n=>{const t="checked"===n;a?e.change(`${e.prefix}positionsSlotsIds`,[...e.positionsSlotsIds.filter(e=>!d.includes(e)),...t?[e.slot.id]:[]]):e.change(`${e.prefix}positionsSlotsIds`,j(e.positionsSlotsIds,e.slot.id,t))},children:s})]},e.slot.id)},pP=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),o=w(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),o&&(0,i.jsx)(Zr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(pc,{icon:"circle-info"})})]}),(0,i.jsx)(ic,{height:"2"}),f(e.slots)?e.slots.map((n,t)=>(0,i.jsx)(hP,{allSlots:e.allSlots,change:e.change,index:t,options:e.options,position:e.position,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:n},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),t&&(0,i.jsx)(YM,{description:e.position.description,name:e.position.name,onClose:()=>{s(!1)}})]})},IP=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),o=w(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),o&&(0,i.jsx)(Zr,{color:"gray700",onClick:()=>{s(!0)},children:(0,i.jsx)(pc,{icon:"circle-info"})})]}),f(e.positions)?e.positions.map(n=>(0,i.jsx)(pP,{allSlots:e.allSlots,change:e.change,options:e.options,position:n,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.positionIdToSelectableSlots[n.id]??p},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")}),t&&(0,i.jsx)(YM,{description:e.category.description,name:e.category.name,onClose:()=>{s(!1)}})]})},fP=e=>{const{translate:n}=fc();return(0,i.jsx)(i.Fragment,{children:f(e.categories)?e.categories.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(IP,{allSlots:e.allSlots,category:n,change:e.change,options:e.options,positionIdToSelectableSlots:e.positionIdToSelectableSlots,positions:e.categoryIdToSelectablePositions[n.id]??p,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix},n.id)]},n.id)):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,subtitle:n("this_may_be_bec_43194"),title:n("no_items_are_cu_47996")})})},xP=(0,de.memo)(e=>{const{categoryIdToSelectablePositions:n,positionIdToSelectableSlots:t,selectableCategories:s,selectableSlots:o}=(0,de.useMemo)(()=>{const n=Ph(e.slots.map(oa)),t=e.event.positionsCategories.flatMap(t=>t.positions.flatMap(t=>t.slots.filter(t=>function(e,n,t){return!t.hiddenPositionsSlotsIds.includes(e.id)&&(0===t.displayedPositionsSlotsIds.length||t.displayedPositionsSlotsIds.includes(e.id))&&(t.showFullPosition||!e.isFull)&&(t.slotDisplay===at.Hide||t.positionFilter===ot.None||n.some(n=>n.engulfs(e.range)))}(t,n,e.options)))),i=t.map(e=>e.id),s=(0,dg.A)((0,l.A)(t,e=>e.positionId),e=>(0,Tg.A)(e,e=>[e.range.start.toMillis(),e.nameOrRange])),o=e.event.positionsCategories.flatMap(n=>n.positions.filter(n=>function(e,n,t,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&(0===i.hiddenPositionsTagsIds.length||_((0,tg.A)(i.hiddenPositionsTagsIds,e.tagsIds)))&&(0===i.displayedPositionsTagsIds.length||f((0,tg.A)(i.displayedPositionsTagsIds,e.tagsIds)))&&Xh(e,t)&&e.slots.some(e=>n.includes(e.id))}(n,i,e.userInfoFields,e.options))),a=o.map(e=>e.id),r=(0,dg.A)((0,l.A)(o,e=>e.positionCategoryId),e=>(0,Tg.A)(e,e=>b(e.name))),d=(0,Tg.A)(e.event.positionsCategories.filter(n=>function(e,n,t){return!t.hiddenPositionsCategoriesIds.includes(e.id)&&(0===t.displayedPositionsCategoriesIds.length||t.displayedPositionsCategoriesIds.includes(e.id))&&e.positions.some(e=>n.includes(e.id))}(n,a,e.options)),e=>b(e.name));return{selectableCategories:d,selectableSlots:t,categoryIdToSelectablePositions:r,positionIdToSelectableSlots:s}},[e.event.positionsCategories,e.options,e.slots,e.userInfoFields]);if((0,de.useEffect)(()=>{const n=e.event.positionsCategories.flatMap(n=>n.positions.filter(n=>!Xh(n,e.userInfoFields)).map(e=>e.id));if(f(n)){const t=e.event.positionsCategories.flatMap(e=>e.positions.filter(e=>n.includes(e.id)).flatMap(e=>e.slots.map(e=>e.id))),i=e.positionsIds.filter(e=>!n.includes(e)),s=e.positionsSlotsIds.filter(e=>!t.includes(e));i.length!==e.positionsIds.length&&e.change(`${e.prefix}positionsIds`,i),s.length!==e.positionsSlotsIds.length&&e.change(`${e.prefix}positionsSlotsIds`,s)}},[e.event.positionsCategories,e.positionsIds,e.positionsSlotsIds,e.userInfoFields]),e.options.positionRanking===Cn.Ranked)return(0,i.jsx)(mP,{categories:s,categoryIdToSelectablePositions:n,change:e.change,options:e.options,positionIdToSelectableSlots:t,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix});switch(e.options.positionDisplay){case st.Category:return(0,i.jsx)(oP,{categories:s,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case st.Position:return(0,i.jsx)(dP,{categories:s,categoryIdToSelectablePositions:n,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case st.Slot:return(0,i.jsx)(fP,{allSlots:o,categories:s,categoryIdToSelectablePositions:n,change:e.change,options:e.options,positionIdToSelectableSlots:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix});case st.None:return null;default:return Ic(e.options.positionDisplay)}}),_P=e=>{const n=(0,de.useMemo)(()=>Wh(e.dayStartTime)?.[0]??0,[e.dayStartTime]),[t,s]=(0,de.useMemo)(()=>Vp(e.startAt,e.endAt,e.ranges,e.daysDisplay,n),[e.startAt,e.endAt,e.ranges,e.daysDisplay,n]),o=(0,de.useMemo)(()=>(0,$h.A)(t,e=>e.toMillis()),[t]),a=(0,de.useMemo)(()=>(0,Th.A)(t,e=>e.toMillis()),[t]),r=(0,de.useMemo)(()=>o?.isValid&&a?.isValid?Math.ceil(a.endOf("month").diff(o.startOf("month"),"months").months):0,[o,a]),d=(0,de.useCallback)((n,t)=>{const i=e.currentSlots.filter(e=>e.startDate.year!==n.year||e.startDate.month!==n.month).concat(t.map(e=>aa(Jo.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return o?.isValid&&a?.isValid&&r>0?(0,i.jsx)(Xl,{gap:"6",wrap:"wrap",children:(0,Sg.A)(0,r).map(t=>{const l=o.plus({month:t}).startOf("month"),c=0===t?o:l,u=t===r-1?a:l.endOf("month"),m=e.currentSlots.flatMap(e=>e.startDate.year===l.year&&e.startDate.month===l.month?[e.startDate.startOf("day").set({hour:n||0})]:[]);return(0,i.jsx)(W$,{disabledDates:s,firstDayOfMonth:l,max:u,min:c,startHour:n,values:m,onChange:e=>{d(l,e)}},t)})}):null},jP=e=>{const{intervals:n,minDate:t,maxDate:s,numberOfMonths:o}=(0,de.useMemo)(()=>{const n=e.intervalsGrouped.flatMap(([e,n])=>n.map(({interval:e})=>e)),t=(0,$h.A)(n,e=>e.start.toMillis()).start.startOf("day"),i=(0,Th.A)(n,e=>e.end.toMillis()).end.endOf("day"),s=Math.ceil(i.endOf("month").diff(t.startOf("month"),"months").months);return{intervals:n,minDate:t,maxDate:i,numberOfMonths:s}},[e.intervalsGrouped]),a=n.flatMap(n=>e.isSelected(n)?[n.start.startOf("day")]:[]);return(0,i.jsx)(Xl,{gap:"6",wrap:"wrap",children:(0,Sg.A)(0,o).map(r=>{const d=t.plus({month:r}).startOf("month"),l=0===r?t:d,c=r===o-1?s:d.endOf("month"),u=a.filter(e=>e.month===d.month&&e.year===d.year);return(0,i.jsx)(W$,{firstDayOfMonth:d,max:c,min:l,values:u,onChange:t=>{((t,i)=>{e.setSelectedBatch(n.flatMap(e=>{if(e.start.startOf("month").equals(t)){const n=i.some(n=>n.equals(e.start.startOf("day")));return[{interval:e,isSelected:n}]}return[]}))})(d,t)}},r)})})},vP=e=>{const[n,t]=(0,de.useState)(e.intervals.some(({interval:n})=>e.isSelected(n))?"checked":"unchecked"),s=(0,de.useCallback)(()=>{const i="checked"===n?"unchecked":"checked";t(i),"unchecked"===i&&e.intervals.forEach(({interval:n})=>{e.setSelected(n,!1)})},[e.intervals,n,t,e.setSelected]);return(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:s,children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(pc,{icon:"checked"===n?"chevron-down":"chevron-right"})}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:e.day})]}),"checked"===n&&(0,i.jsx)(Xl,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:n,interval:t},s)=>(0,i.jsx)(Zm,{state:e.isSelected(t)?"checked":"unchecked",onClick:n=>{e.setSelected(t,"checked"===n)},children:Wp(n,t)},s))})]})},SP=e=>(0,i.jsx)(Xl,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervalsGrouped.map(([n,[{name:t,interval:s}]],o)=>{const a=`${t} ${s.toFormat("HH:mm")}`.trim(),r=`${n} ${e.hideNameDates?"":`(${a})`}`.trim();return(0,i.jsx)(Zm,{state:e.isSelected(s)?"checked":"unchecked",onClick:n=>{e.setSelected(s,"checked"===n)},children:r},o)})}),yP=({customSlotPeriod:e,daysDisplay:n,event:t,isSelected:s,setSelected:o,setSelectedBatch:a})=>{const r=ss(Wg),d=(0,de.useMemo)(()=>Bp(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,n),[e,t,n]),l=(0,de.useMemo)(()=>(0,Tg.A)(Object.entries(x(d,({interval:e})=>r.toLocaleString(e.start.startOf("day"),da.DateOnly.WeekdayLongMonthLong))),([e,[{interval:n}]])=>n.start.startOf("day").toMillis()),[d]);return(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[w(e.name)&&(0,i.jsx)(Zr,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===l.length?null:e.displayAsCalendar?(0,i.jsx)(jP,{intervalsGrouped:l,isSelected:s,setSelectedBatch:a}):(0,i.jsx)(SP,{hideNameDates:e.hideNameDates,intervalsGrouped:l,isSelected:s,setSelected:o}):l.map(([e,n],t)=>(0,i.jsx)(vP,{day:e,intervals:n,isSelected:s,setSelected:o},t))]})},CP=e=>{const n=(0,de.useMemo)(()=>e.customSlotsPeriods.flatMap(n=>Bp(n.startDate??e.event.startAt,n.endDate??e.event.endAt,n.customSlots,e.event.ranges,e.daysDisplay)).map(({interval:e})=>e),[e.customSlotsPeriods,e.event,e.daysDisplay]),[t,s]=(0,de.useState)(Object.fromEntries(n.map(n=>{const t=e.currentSlots.some(e=>sa(e).equals(n));return[n.toISO(),t]}))),o=(0,de.useCallback)(e=>!0===t[e.toISO()],[t]),a=(0,de.useCallback)((n,t)=>{const i=n.toISO();s(e=>({...e,[i]:t})),e.change(`${e.prefix}slots`,Gp(e.currentSlots,n,t))},[e.currentSlots,s]),r=(0,de.useCallback)(n=>{const t=n.reduce((e,{interval:n,isSelected:t})=>{const i=n.toISO();return s(e=>({...e,[i]:t})),Gp(e,n,t)},e.currentSlots);e.change(`${e.prefix}slots`,t)},[e.currentSlots,s]),d=(0,de.useMemo)(()=>e.elements.flatMap(e=>e.elementType===yn.Field?(0,sc.A)([e.customField,e.conditionCustomField]):e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(Xl,{direction:"column",gap:"6",children:e.customSlotsPeriods.map(n=>Tb(n,e.userInfoFields,d)?(0,i.jsx)(yP,{customSlotPeriod:n,daysDisplay:e.daysDisplay,event:e.event,isSelected:o,setSelected:a,setSelectedBatch:r},n.id):null)})},bP=e=>{const{translate:n}=fc(),[t]=(0,de.useMemo)(()=>Vp(e.startAt,e.endAt,e.ranges,e.daysDisplay,Wh(e.dayStartTime)?.[0]??0),[e.startAt,e.endAt,e.ranges,e.daysDisplay,e.dayStartTime]),s=(0,de.useMemo)(()=>t.filter(n=>(e.blockedSlots??[]).some(e=>ra(e,n))),[e.blockedSlots,t]),o=ss(Wg),[a,r]=(0,de.useState)(Object.fromEntries(t.map((n,t)=>{const i=Jo.IX.fromDateTimes(n,n.plus({day:1}));return[`day${t}`,void 0!==e.currentSlots.find(e=>sa(e).equals(i))]})));return(0,i.jsx)(i.Fragment,{children:t.map((t,d)=>{const l=s.includes(t);return(0,i.jsxs)(de.Fragment,{children:[0!==d&&(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{disabled:l,state:a[`day${d}`]?"checked":"unchecked",onClick:n=>{r({...a,[`day${d}`]:"checked"===n}),e.change(`${e.prefix}slots`,Gp(e.currentSlots,Jo.IX.fromDateTimes(t,t.plus({day:1})),"checked"===n))},children:l?(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(wc,{children:o.toLocaleString(t,da.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(ux,{placement:"right",children:n("vous_avez_d_j_92810")})]}):o.toLocaleString(t,da.DateOnly.WeekdayLongMonthLong)})]},d)})})};var AP=t(3088);const EP=e=>{const n=os();return(0,i.jsx)(tA,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:n("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(Xl,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(Wx,{label:n("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(iy,{label:n("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(Wx,{label:n("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(iy,{label:n("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},wP=e=>{const n=os(),t=ss(kM),s=(0,de.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(AP.ED,{name:`${e.prefix}slots`,children:({fields:o})=>(0,i.jsxs)(i.Fragment,{children:[o.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[0!==t&&(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(EP,{index:t,max:s,min:e.min,prefix:`${n}.`,remove:()=>{o.remove(t)}})]},t)),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{o.push(t.volunteersRegistrationsSlotInputDefault(e.min))},children:n("ajouter_une_dis_96540")})]})})},$P=(0,de.memo)(e=>{switch(e.slotDisplay){case at.Display:return(0,i.jsx)(wP,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case at.DisplayDays:return(0,i.jsx)(bP,{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 at.Calendar:return(0,i.jsx)(_P,{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 at.Custom:return(0,i.jsx)(CP,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,elements:e.elements,event:e.event,prefix:e.prefix,userInfoFields:e.userInfoFields});case at.Hide:return null;default:return Ic(e.slotDisplay)}}),TP=e=>(0,i.jsx)(Zx,{disabled:e.disabled,heading:e.heading,hideHeader:e.hideHeader,children:(0,i.jsx)(Xl,{direction:"column",children:e.children})}),zP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Dz),a=(0,de.useMemo)(()=>w(e.form.description)?o.renderText(e.form.description,{event:e.event,organization:e.organization}):"",[e.event,e.form.description,e.organization]),r=(0,de.useMemo)(()=>s&&e.form.slotDisplay!==at.Hide,[e.form,s]),d=(0,de.useMemo)(()=>s&&e.form.positionDisplay!==st.None,[e.form,s]),l=(0,de.useMemo)(()=>s&&(e.form.accreditationDisplay!==tt.None||f(e.delegationAccreditationsSlots)||f(e.delegationAccreditationsProfiles)),[e.delegationAccreditationsProfiles,e.delegationAccreditationsSlots,e.form,s]),c=(0,de.useMemo)(()=>e.userInfo?.volunteerRegistration?.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlotId]:[])??[],[e.userInfo]),u=function(e,n=300){const[t,i]=(0,de.useState)(e),s=Rg(i,n);return(0,de.useEffect)(()=>{s(e)},[e]),t}(e.values.formRegister.userInfo.fields);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(TP,{hideHeader:!0,children:[w(a)&&(0,i.jsx)(p_,{text:a}),(0,i.jsx)(pu,{isEmail:!0,label:n("Email"),name:"email"})]}),(0,i.jsx)(TP,{heading:w(e.form.informationTitle)?e.form.informationTitle:n("informations_pe_37892"),children:e.disabled?(0,i.jsx)(Bw,{form:e.form,userInfo:e.userInfo}):(0,i.jsx)(HM,{asoBannersColors:e.asoBannersColors,change:e.change,elements:e.form.elements,organizationId:t,prefix:"formRegister.userInfo.fields.",values:e.values.formRegister.userInfo.fields})}),r&&e.event&&(0,i.jsxs)(TP,{heading:w(e.form.slotTitle)?e.form.slotTitle:n("disponibilit_s_49923"),children:[w(e.form.slotSubtitle)&&(0,i.jsx)(p_,{text:e.form.slotSubtitle}),e.areSectionsDisabled?.isWishedAssignmentsDisabled?(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("no_longer_modif_99663")}),(0,i.jsx)(Oc,{children:n("you_are_already_assigned_to_missions")})]}):(0,i.jsx)($P,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,elements:e.form.elements,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay,userInfoFields:u})]}),d&&e.event&&(0,i.jsxs)(TP,{heading:w(e.form.positionTitle)?e.form.positionTitle:n("missions_souhai_23225"),children:[w(e.form.positionSubtitle)&&(0,i.jsx)(p_,{text:e.form.positionSubtitle}),e.areSectionsDisabled?.isWishedAssignmentsDisabled?(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("no_longer_modif_99663")}),(0,i.jsx)(Oc,{children:n("you_are_already_assigned_to_missions")})]}):(0,i.jsx)(xP,{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:u})]}),l&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(TP,{heading:w(e.form.accreditationTitle)?e.form.accreditationTitle:n("accr_ditations_74375"),children:[w(e.form.accreditationSubtitle)&&(0,i.jsx)(p_,{text:e.form.accreditationSubtitle}),e.areSectionsDisabled?.isWishedAccreditationsDisabled?(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("no_longer_modif_99663")}),(0,i.jsx)(Oc,{children:n("you_are_already_assigned_to_accreditations")})]}):(0,i.jsx)(iP,{accreditationProfileId:e.values.formRegister.accreditationProfileId,accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,alreadyAssignedProfileId:e.alreadyAssignedProfileId,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,change:e.change,delegationAccreditationsProfiles:e.delegationAccreditationsProfiles??p,delegationAccreditationsSlots:e.delegationAccreditationsSlots??p,displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",scannedSlotsIds:c,showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:u})]})})]})},OP=e=>{const n=ss(qM),t=(0,de.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===yn.Field?[e.customField]:[]),[e.organization]);return(0,de.useEffect)(()=>{const i=n.formRegisterInputDefault(bn.Admin,null,t,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditationsSlots: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,fields:{...i.userInfo.fields,...e.values.formRegister.userInfo.fields}}}})},[e.organization]),(0,i.jsx)(Lx,{children:(0,i.jsx)(zP,{alreadyAssignedProfileId:null,alreadyAssignedSlotsIds:p,change:e.change,delegationAccreditationsProfiles:e.organization.delegation?.accreditationsProfiles??p,delegationAccreditationsSlots:e.organization.delegation?.accreditationsSlots??p,event:e.organization.event,form:e.organization.form,organization:e.organization,showAutoAccredit:!0,showEmail:!1,values:e.values})})},RP=e=>{const{translate:n,params:{delegationId:t}}=fc();return(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(pu,{isEmail:!0,label:n("Email"),name:"email"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("last_name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!t&&(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("param_tres_du_m_69378")}),(0,i.jsx)(Zr,{color:"gray500",children:n("s_lectionnez_le_16209")})]}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:(0,i.jsx)($S,{children:n("population_38615")}),multiple:e.population.canSelectMultiple,name:"formRegister.userInfo.fields.population",children:e.population.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(lg,{isSearchVisible:!0,label:(0,i.jsx)($S,{children:n("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)(lg,{isSearchVisible:!0,label:(0,i.jsx)($S,{children:n("Form")}),state:f(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))})]})]})},DP=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,delegationId:a}}=fc(),r=ss(qM),d=ss(ec),l=(0,de.useRef)(null),{mutate:c,isLoading:u}=Tl(),{mutate:m}=function(e={}){return ds("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)}(),[g,h]=(0,de.useState)(null),I=(0,de.useMemo)(()=>g?.form.elements.filter(e=>e.elementType===yn.Field)??[],[g]),[x,_]=(0,de.useState)({email:"",formRegister:r.formRegisterInputDefault(bn.Admin,null,p,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditationsSlots:p,eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:at.Hide,team:null})}),j=(0,de.useMemo)(()=>r.formRegisterSchema(I,{slotDisplay:g?.form.slotDisplay??at.Hide,minNumberOfSlots:g?.form.minNumberOfSlots??1,eventStartDate:g?.event?.startAt??Jo.c9.now(),eventEndDate:g?.event?.endAt??Jo.c9.now(),positionRanking:g?.form.positionRanking??Cn.Unranked,positionDisplay:g?.form.positionDisplay??st.None,accreditationDisplay:g?.form.accreditationDisplay??tt.None,delegationId:g?.delegation?.id,delegationAccreditationsProfiles:g?.delegation?.accreditationsProfiles??[]}),[I,r,g]),v=(0,de.useCallback)(e=>d.validateForForm(j)(e),[j]),S=(0,de.useCallback)(async t=>{g?await m({organizationId:s,eventId:o,delegationId:g.delegation?.id,formId:g.form.id,email:t.email,formRegister:t.formRegister}):await c({organizationId:s,eventId:o,email:t.email,userInfo:t.formRegister.userInfo,sendNotificationEmail:t.formRegister.sendNotificationEmail}),n.push(e.closePath)},[e.closePath,g]),y=e.organization.delegations.nodes,C=e.organization.forms.nodes,[b,A]=(0,de.useState)(!1),[E,w]=(0,de.useState)([]),[$,T]=(0,de.useState)([]),z=(0,de.useCallback)(async e=>{if(T(e),f(e)){A(!0);const{organization:n}=await $l({organizationId:s,eventId:o,formId:e[0]},{token:await fe()});h(n),A(!1)}else h(null)},[o,s]),O=(0,de.useCallback)(async e=>{if(w(e),f(e)){const n=y.find(n=>n.id===e[0]);T([n.formId]),A(!0);const{organization:t}=await $l({organizationId:s,delegationId:e[0],eventId:o,formId:n.formId},{token:await fe()});h(t),A(!1)}else h(null)},[y,s,o]);return fm(t("cr_ation_d_un_m_98624")),(0,de.useEffect)(()=>{a&&O([a])},[a,O]),(0,i.jsx)(Fc,{customErrorRef:l,height:1,hideDefaultErrors:!0,initialValues:x,render:({form:n,handleSubmit:s,values:a})=>(0,i.jsx)(Nx,{category:t("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,heading:t("nouveau_membre_94535"),children:(0,i.jsx)(kx,{ref:l,children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Mc,{hideSpacer:!0}),(0,i.jsx)(Zx,{heading:t("informations_su_05921"),children:(0,i.jsx)(RP,{delegations:y,delegationsIds:E,forms:C,formsIds:$,population:e.organization.population,setDelegationsIds:O,setFormsIds:z})}),b&&(0,i.jsx)(Lx,{css:{minHeight:"200px"},children:(0,i.jsx)(_c,{})}),!b&&g&&(0,i.jsx)(OP,{change:n.change,organization:g,setInitialValues:_,values:a}),(0,i.jsx)(Lx,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[o&&(0,i.jsx)(Bx,{name:"formRegister.sendNotificationEmail",children:t("envoyer_l_email_75574")}),(0,i.jsx)(yc,{isLoading:u,textAlign:"center",onClick:s,children:t("ajouter_le_memb_57505")})]})})]})})}),validate:v,width:1,onSubmit:S})},MP=()=>{const{params:{organizationId:e,eventId:n,delegationId:t}}=fc(),{data:s,loader:o}=rs('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 canSelectMultiple\n\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:n,level:n?kn.Event:kn.Organization},[],undefined);return o||(0,i.jsx)(DP,{closePath:t?vo.DELEGATION_MEMBERS({organizationId:e,eventId:n,delegationId:t}):n?Wo.VOLUNTEERS(e,n):Ms.COMMUNITY_USERS({organizationId:e}),organization:s.organization})};var PP;let kP=class extends ju{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return Jl.Ik().shape({content:Jl.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return Jl.Ik().shape({comment:this.commentInputSchema()})}};function FP(e){return e.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\+\+(.+?)\+\+/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1")}kP=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(PP=void 0!==ts&&ts)?PP:Object])],kP);const NP=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_55928"),text:n("suppression_d_u_90124"),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,eventId:e.eventId,commentId:e.commentId}),e.onSuccess()}})},LP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{mutate:o}=function(e={}){return ds("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)}(),[a,r]=(0,de.useState)(e.comment.content),[d,l]=(0,de.useState)(!1),c=w(a);return(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(Zr,{color:"gray500",css:{cursor:"pointer"},children:(0,i.jsx)(pc,{icon:"pen"})})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"message",children:n("mise_jour_du_59845")}),(0,i.jsx)(Gf,{children:(0,i.jsx)(Xx,{label:n("commentaire_08754"),value:a,onChange:r})}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:!c,isLoading:d,onClick:async()=>{l(!0),await o({organizationId:t,eventId:s,commentId:e.comment.id,comment:{content:a}}),e.reload()},children:n("mettre_jour_85141")})})]})]})},UP=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Wg),{user:a}=ps(),[r,d]=(0,de.useState)(!1),l=e.comment.event,c=e.comment.writtenBy;return(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(F_,{email:c.email,image:c.userInfo.picture?.url,name:c.userInfo.name,size:40}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:c.userInfo.nameOrEmail}),(0,i.jsx)(Zr,{color:"gray500",children:o.toLocaleString(e.comment.insertedAt.toLocal(),da.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray500",children:"•"}),(0,i.jsx)(Zr,{color:"gray500",children:l?.name??n("communaut_20896")})]}),c.id===a?.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray500",children:"•"}),(0,i.jsx)(LP,{comment:e.comment,reload:e.reload})]}),(0,i.jsxs)(lC,{permissions:nC.COMMENT_ADD,children:[(0,i.jsx)(Zr,{color:"gray500",children:"•"}),(0,i.jsx)(Zr,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{d(!0)},children:(0,i.jsx)(pc,{icon:"trash-can"})})]})]}),(0,i.jsx)(Zr,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},dangerouslySetInnerHTML:{__html:FP(e.comment.content)}})]}),r&&(0,i.jsx)(NP,{commentId:e.comment.id,eventId:s,organizationId:t,onClose:()=>{d(!1)},onSuccess:e.reload})]})},VP=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc(),a=ss(kP),r=ss(ec),{data:d,loader:l,reload:c}=Rl({organizationId:n,userInfoId:s}),{mutate:u,isLoading:m}=Ol(),[g,h]=(0,de.useState)(1),p=(0,de.useCallback)(()=>{h(g+1),c()},[g,h,c]);return(0,i.jsx)(Fc,{direction:"column",hideDefaultErrors:!0,initialValues:{comment:a.commentInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[l||(d.organization?.userInfo.comments??[]).map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(UP,{comment:n,reload:p,showEvent:e.showEvent})]},t)),(0,i.jsxs)(lC,{permissions:nC.COMMENT_ADD,children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Qx,{label:o("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(yc,{isLoading:m,onClick:n,children:(0,i.jsx)(Zr,{textAlign:"center",width:1,children:o("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(ic,{height:"8"})]}),validate:r.validateForForm(a.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:n,eventId:t,userInfoId:s,comment:e.comment}),p()}},g)},BP=({canEdit:e,editPath:n,formsUsersInfos:t,isEditDisabled:s=!1})=>{const{params:{organizationId:o,eventId:a},translate:r}=fc(),d=ss(Wg),l=(0,de.useMemo)(()=>(0,Tg.A)(t.filter(e=>f(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,Tg.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),ap(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[t]),c=Cg();return(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[s&&(0,i.jsx)(e$,{message:r("you_are_already_assigned_to_accreditations"),title:r("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)($g,{filters:e&&(0,i.jsx)(yc,{color:"white",disabled:s,size:"sm",to:n,children:r("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:r("AccreditationName")}),!c&&(0,i.jsx)(Mg,{children:r("cr_neau_11117")}),!c&&(0,i.jsx)(Mg,{children:r("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:f(l)?l.flatMap((e,n)=>e.accreditationsSlots.map((t,r)=>(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Zr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:t.accreditationCategory.name}),(0,i.jsx)(Ug,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:mo.ACCREDITATION({organizationId:o,eventId:a,accreditationId:t.accreditation.id}),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:t.accreditation.name,width:1,children:t.accreditation.name})})]}),!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_g,{children:qp(d,t,"")}),(0,i.jsx)(_g,{children:(0,i.jsx)(t$,{editDisabled:s,eventId:a,form:e.form,organizationId:o})})]})]},`${n}-${r}`))):(0,i.jsx)(Eg,{css:{height:"200px"},children:(0,i.jsx)(_g,{children:(0,i.jsx)(Jw,{title:r("aucune_accr_dit_56501")})})})}),setOffset:Ou.A,title:r("accr_ditations_74375"),totalCount:0})]})},WP=e=>{const n=ss(Wg),t=(0,de.useMemo)(()=>{const n=Mm(e.aui.accreditation.color);return{background:n[50],color:n[700]}},[e.aui]);return(0,i.jsx)(i.Fragment,{children:e.renderAccreditation((0,i.jsxs)(Xl,{css:{...t,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(Zr,{children:qp(n,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(Zr,{fontSize:"textXs",children:(0,i.jsx)(pc,{icon:"bolt-auto"})})]}),(0,i.jsx)(Zr,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},GP=e=>{const n=VI(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),ap(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),s=(0,de.useMemo)(()=>(0,Tg.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),ap(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(nz,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:n?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[t.map(n=>(0,i.jsx)(ez,{children:(0,i.jsx)(WP,{aui:n,renderAccreditation:e.renderAccreditation})},n.id)),s.map(n=>(0,i.jsx)(ez,{endAt:n.accreditationSlot.date,startAt:n.accreditationSlot.date,children:(0,i.jsx)(WP,{aui:n,renderAccreditation:e.renderAccreditation})},n.id))]})},qP=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),a=ss(Wg),{mutate:r}=Ra(),{mutate:d}=function(e={}){return ds("mutation AccreditationsSlotsUsersInfosCheckIn(\n $eventId: EventId!\n $checkIn: AccreditationSlotCheckInInput!\n) {\n accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),l=(0,de.useMemo)(()=>qp(a,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"center",gap:"3",children:[(0,i.jsx)(UI,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.aui.accreditationCategory.name}),(0,i.jsx)(Ug,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:mo.ACCREDITATION({organizationId:t,eventId:s,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),l!==e.aui.accreditation.name&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},title:l,width:1,children:l})]})]}),(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",children:[e.aui.state===Be.Waiting&&(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:"warning500",children:(0,i.jsx)(pc,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:n("pas_encore_scan_88057")})]}),e.aui.state===Be.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:"success500",children:(0,i.jsx)(pc,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:n("scann_e_01567")})]}),(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?a.toLocaleString(e.aui.checkInAt.toLocal(),da.DateTime):""})]})]}),(0,i.jsx)(_g,{children:e.aui.isAutoAccredit&&(0,i.jsx)(Zr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"check"})})}),(0,i.jsx)(_g,{children:e.aui.isWorkflow&&(0,i.jsx)(Zr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"check"})})}),(0,i.jsx)(_g,{children:e.aui.accreditationProfile?e.aui.accreditationProfile.name:"-"}),(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Zr,{children:e.aui.createdBy?.name||e.aui.createdBy?.email||"-"}),(0,i.jsx)(Zr,{color:"gray500",children:a.toLocaleString(e.aui.insertedAt.toLocal(),da.DateTime)})]}),e.canMemberAccredit&&(0,i.jsxs)(Vg,{justify:"end",width:200,children:[e.aui.state===Be.Waiting&&(0,i.jsx)(yc,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.aui.eventId,checkIn:{strategy:We.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(Lg,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:async()=>{await r({eventId:s,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[o]},strategy:Dn.Delete}}),e.reload()},children:n("d_saffecter_du_47122")})})]})]})},HP=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(n=>!e.selectedDay?.isValid||!!n.accreditationSlot.date?.isValid&&n.accreditationSlot.date.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),e=>[e.accreditationCategory.name.toLowerCase(),ap(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(gg,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("Accreditation")}),(0,i.jsx)(Mg,{children:n("scann_e_le_27812")}),(0,i.jsx)(Mg,{children:n("affect_e_automa_74071")}),(0,i.jsx)(Mg,{children:n("ajout_via_une_69544")}),(0,i.jsx)(Mg,{children:n("ajout_via_un_p_85925")}),(0,i.jsx)(Mg,{children:n("ajout_e_par_71330")}),e.canMemberAccredit&&(0,i.jsx)(Mg,{width:200})]}),t.map(n=>(0,i.jsx)(qP,{aui:n,canMemberAccredit:e.canMemberAccredit,reload:e.reload},n.id))]})},YP=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(vj(e.event.startAt,e.event.endAt)),[o,a]=(0,de.useState)(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Xl,{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)(Xl,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Zr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)($c,{children:e.title}),e.subtitle&&(0,i.jsx)(wc,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Xl,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(QT,{max:e.event.endAt,min:e.event.startAt,value:t,onChange:s}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(Zr,{width:160,children:(0,i.jsx)(df,{rightIcon:"xmark",value:o,onChange:a,onRightIconClick:()=>a(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:e.accreditationsDisplay,onChange:e.setAccreditationsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:n("Calendar")}),(0,i.jsx)("option",{value:"list",children:n("List")})]})}),e.actions]})]}),"calendar"===e.accreditationsDisplay?(0,i.jsx)(GP,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:t}):(0,i.jsx)(HP,{canMemberAccredit:e.canMemberAccredit,event:e.event,reload:e.reload,selectedDay:o})]})})};function ZP(e,n,t={}){const{localEvent:i,updateLocalEvent:s}=Ly(),[o,a]=(0,de.useState)("function"==typeof t.deserialize?t.deserialize(i?.[e])||n:i?.[e]??n);return[o,(0,de.useCallback)(async n=>{a(n),await s({[e]:"function"==typeof t.serialize?t.serialize(n):n})},[e,a,s])]}const KP=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc(),[a,r]=ZP("user.accreditations.display","calendar");return(0,i.jsx)(YP,{...e,accreditationsDisplay:a,actions:(0,i.jsx)(lC,{permissions:nC.MEMBER_ACCREDIT,children:(0,i.jsx)(yc,{to:Wo.EDIT_ACCREDIT(n,t,s),children:o("_diter_les_accr_86042")})}),canMemberAccredit:e.canMemberAccredit,setAccreditationsDisplay:r})},XP=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc(),{canMemberAccredit:a}=tC(),r=(0,de.useMemo)(()=>f(e.organization.userInfo.formsUsersInfos.filter(e=>f(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[f(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(KP,{canMemberAccredit:a,event:e.event,reload:e.reload,renderAccreditation:(e,s)=>(0,i.jsx)(gc,{style:{width:"100%"},to:mo.ACCREDITATION({organizationId:n,eventId:t,accreditationId:s}),children:e}),subtitle:o("visualisez_tout_53227"),title:o("accr_ditations_33155")}),r&&(0,i.jsx)(BP,{canEdit:a,editPath:Wo.EDIT_USER_ACCREDITATIONS(n,t,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(ic,{height:"8"})]})},QP=()=>{const{organizationId:e,eventId:n,userInfoId:t}=ls(),{data:s,loader:o,reload:a}=Oa({organizationId:e,eventId:n,userInfoId:t});return o||(0,i.jsx)(XP,{event:s.event,organization:s.organization,reload:a})},JP=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{organization:a,hasFeature:r}=Yy(),{event:d,hasEventRole:l}=Ly(),{canDocumentRead:c,canMemberAccredit:u,canMemberAssignmentStateEdit:m,canMemberEdit:g,canMemberDelete:h}=tC(),{mutate:p,isLoading:I}=fr(),{mutate:x,isLoading:_}=yr(),{mutate:j,isLoading:v}=yr(),{mutate:S,isLoading:y}=yr(),{mutate:C}=Ja(),{mutate:b}=or(),{mutate:A,isLoading:E}=jr(),{mutate:w,isLoading:$}=jr(),[T,z]=(0,de.useState)(!1),[O,R]=(0,de.useState)(!1),D=(0,de.useMemo)(()=>(0,Tg.A)(e.customDocuments.filter(n=>Ep(n.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),{permissions:[M]}=pw(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),P=c&&(e.links&&(e.state===yt.Assigned||f(a.customBadges))||f(D)),k=P&&e.state===yt.Assigned&&d.usePositions,F=l&&g&&d.useDelegations&&r(In.Delegation)&&e.delegation,N={lang:e.userInfo.language};return(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(M||m)&&(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("affectation")}),m&&(e.state===yt.Assigned||e.state===yt.Refused||e.state===yt.NotApplicable||e.state===yt.PreAssigned)&&(0,i.jsx)(yc,{color:"white",isLoading:_,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:yt.WaitingAssignment}}),e.reload()},children:o("changer_le_stat_90266")}),m&&(e.state===yt.Assigned||e.state===yt.WaitingAssignment||e.state===yt.NotApplicable||e.state===yt.PreAssigned)&&(0,i.jsx)(yc,{color:"white",isLoading:v,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await j({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:yt.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),m&&(e.state===yt.WaitingAssignment||e.state===yt.Assigned)&&(0,i.jsx)(yc,{color:"white",isLoading:y,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await S({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:yt.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),M&&e.state===yt.Assigned&&(0,i.jsx)(yc,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:Wo.EDIT_ASSIGNMENT(t,s,e.userInfo.id),children:o("_diter_les_affe_42283")}),M&&(e.state===yt.WaitingAssignment||e.state===yt.PreAssigned)&&(0,i.jsx)(yc,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:Wo.ASSIGNMENT(t,s,e.userInfo.id),children:o("affecter_94255")}),M&&e.teams.map(e=>e.state===yt.WaitingAssignment?(0,i.jsx)(yc,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:Wo.TEAM_ASSIGNMENT(t,s,e.teamCode),children:o("affecter_l_qui_12468",e.teamCode)},e.teamCode):null),M&&e.state===yt.Assigned&&(0,i.jsx)(yc,{color:"white",isLoading:I,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:t,eventId:s,userInfoId:e.userInfo.id,emailType:ln.Assignments})},children:o("r_envoyer_l_e_65315")}),M&&e.state===yt.Refused&&(0,i.jsx)(yc,{color:"white",isLoading:I,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:t,eventId:s,userInfoId:e.userInfo.id,emailType:ln.Refused})},children:o("r_envoyer_l_e_06733")})]}),u&&(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Accreditation")}),(e.accreditationState===Re.NotApplicable||e.accreditationState===Re.Refused||e.accreditationState===Re.Accredited||e.accreditationState===Re.AutoAccredited)&&(0,i.jsx)(yc,{color:"white",isLoading:$,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await w({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Re.WaitingAccreditation}}),e.reload()},children:o("changer_le_stat_20528")}),(e.accreditationState===Re.Accredited||e.accreditationState===Re.AutoAccredited||e.accreditationState===Re.WaitingAccreditation||e.accreditationState===Re.NotApplicable)&&(0,i.jsx)(yc,{color:"white",isLoading:$,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await w({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Re.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),(e.accreditationState===Re.WaitingAccreditation||e.accreditationState===Re.Accredited||e.accreditationState===Re.AutoAccredited)&&(0,i.jsx)(yc,{color:"white",isLoading:E,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:Re.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),e.accreditationState===Re.Accredited&&(0,i.jsx)(yc,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:Wo.EDIT_ACCREDIT(t,s,e.userInfo.id),children:o("_diter_les_accr_86042")}),(e.accreditationState===Re.AutoAccredited||e.accreditationState===Re.WaitingAccreditation)&&(0,i.jsx)(yc,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:Wo.ACCREDIT(t,s,e.userInfo.id),children:o("accr_diter_70543")}),(e.accreditationState===Re.Accredited||e.accreditationState===Re.AutoAccredited)&&(0,i.jsx)(yc,{color:"white",isLoading:I,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await p({organizationId:t,eventId:s,userInfoId:e.userInfo.id,emailType:ln.Accreditations})},children:o("r_envoyer_l_e_24677")})]}),P&&(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Documents")}),k&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userAssignmentsLink,"pdf",N),children:o("t_l_charger_la_82882")}),(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userPlanningLink,"pdf",N),children:o("t_l_charger_le_74660")}),(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userPlanningDaysLink,"pdf",N),children:o("t_l_charger_le_43587")}),(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userPlanningListLink,"pdf",N),children:o("t_l_charger_le_58518")}),(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userHoursLink,"pdf",N),children:o("t_l_charger_les_98537")}),(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userBadgeLink,"pdf",N),children:o("t_l_charger_le_53240")}),(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userCertificateLink,"pdf",N),children:o("t_l_charger_l_a_02386")})]}),a.customBadges.map(n=>(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userCustomBadgeLinks[n],"pdf",N),children:o("t_l_charger_1_80752",fj(n))},n)),D.map((n,t)=>(0,i.jsx)(yc,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:Ex(e.links.userCustomDocumentLinks[n.slug],"pdf",N),children:o("t_l_charger_1_80752",n.name)},t))]}),h&&(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),F&&(0,i.jsx)(yc,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>z(!0),children:o("retirer_de_la_d_64963")}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>R(!0),children:o("d_sinscrire_de_06416")})]}),F&&T&&(0,i.jsx)(f$,{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:()=>z(!1),onDelete:async()=>{await C({organizationId:a.id,eventId:s,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),n.push(Wo.VOLUNTEERS(t,s))}}),O&&(0,i.jsx)(f$,{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:()=>R(!1),onDelete:async()=>{await b({eventId:s,selecteds:{ids:[e.userInfo.id]}}),n.push(Wo.VOLUNTEERS(t,s))}}),(0,i.jsx)(ic,{height:"8"})]})},ek=()=>{const{params:{eventId:e,userInfoId:n}}=fc(),{data:t,loader:s,reload:o}=rs("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 teams {\n teamCode\n state\n }\n\n userInfo {\n ...UserInfoOverlay\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n }\n }\n }\n}\n",{eventId:e,userInfoId:n},[Ko.CustomDocumentPopulationFragment,Ko.UserInfoOverlayFragment,Ko.UserInfoLinksFragment],undefined);if(s)return s;{const e=t.event.volunteerRegistration;return(0,i.jsx)(JP,{accreditationState:e.accreditationState,customDocuments:t.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:o,state:e.state,teams:e.teams,userInfo:e.userInfo})}},nk=e=>{const{history:n,params:{organizationId:t},translate:s}=fc(),{mutate:o}=function(e={}){return ds("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n id\n }\n}\n",e)}(),[a,r]=(0,de.useState)(!1);return(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>r(!0),children:s("supprimer_43083")}),a&&(0,i.jsx)(f$,{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:()=>r(!1),onDelete:async()=>{await o({organizationId:t,userInfoId:e.userInfo.id}),n.push(Ms.COMMUNITY_USERS({organizationId:t}))}})]})},tk=()=>{const{params:{organizationId:e,userInfoId:n}}=fc(),{data:t,loader:s}=rs("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n }\n }\n}\n",{organizationId:e,userInfoId:n},[Ko.UserInfoOverlayFragment],undefined);return s||(0,i.jsx)(nk,{userInfo:t.organization.userInfo})},ik=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),a=ss(Ey),r=ss(Wg),{mutate:d}=Da(),{data:l}=Pa({organizationId:t,eventId:s,userInfoId:o}),c=(0,de.useMemo)(()=>{const t=a.createUpdateCampaignValuesDefault(!1,l.organization?.event?.emailSender?.id??l.organization?.emailSenderId,null,null),i=l.organization?.userInfo?.name||"",s=r.toLocaleString(Jo.c9.now(),da.FullDateTime);return{...t,campaign:{...t.campaign,name:e.campaignType===Ue.Sms?n("sms_1_le_2_25252",i,s):n("e_mail_1_le_21805",i,s),campaignType:e.campaignType,state:Le.InProgress,sendToEveryone:!1,usersInfosIds:[o]}}},[e.campaignType,l.organization]);return(0,i.jsx)(Fc,{initialValues:c,render:t=>(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:e.campaignType===Ue.Sms?n("envoi_d_un_sms_22148"):n("envoi_d_un_emai_99336")}),(0,i.jsx)(xI,{css:{padding:"$6"},children:e.campaignType===Ue.Email?(0,i.jsx)(dy,{canCustomDocuments:e.canCustomDocuments,customDocuments:l.organization?.event?.customDocuments??[],customFields:p,emailSenderId:l.organization?.event?.emailSender?.id??l.organization?.emailSenderId,emailsSenders:l.organization?.emailsSenders??[],form:t.form,hasDuplicatedMembers:!1,values:t.values}):(0,i.jsx)(hy,{formRenderProps:t})}),(0,i.jsx)(_I,{children:(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")}),(0,i.jsx)(yc,{isLoading:t.submitting,onClick:t.handleSubmit,children:n("envoyer_26609")})]})})]}),onSubmit:async n=>{await d({organizationId:t,eventId:s,campaign:n.campaign}),e.onClose()}})},sk=e=>{const n=os(),t=ss(Au),{mutate:s}=ur();return(0,i.jsx)(mA,{buttonText:n("modifier_l_adre_94026"),icon:"pen",initialValues:{email:e.email},schema:t.emailSchema(),title:n("modification_de_69462"),onClose:e.onClose,onSubmit:async n=>{await s({email:n.email,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId}),e.onClose(),e.onSuccess()},children:(0,i.jsx)(pu,{label:n("adresse_e_mail_60930"),name:"email"})})},ok=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{hasFeature:o}=Yy(),{event:a}=Ly(),[r,d]=(0,de.useState)(!1),[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(!1),g=I(e.userInfo.population).join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(F_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("Email")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Lm,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(wm,{placement:"bottom-start",children:[(0,i.jsx)(Em,{icon:"copy",onClick:()=>{oy(e.userInfo.email)},children:n("copier_1_59210",e.userInfo.email)}),e.canEmailEdit&&(0,i.jsx)(Em,{icon:"pen",onClick:()=>{d(!0)},children:n("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(Em,{icon:"at",onClick:()=>c(!0),children:n("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("t_l_phone_31755")}),w(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Lm,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(wm,{placement:"bottom-start",children:[(0,i.jsx)(Em,{color:"default",icon:"copy",onClick:()=>oy(e.userInfo.phone.internationalFormat),children:n("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(gc,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(Em,{color:"default",icon:"phone",children:n("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),o(In.Sms)&&(0,i.jsx)(Em,{icon:"phone",onClick:()=>m(!0),children:n("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(Zr,{color:"gray500",children:"-"})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(Zr,{color:"gray500",children:w(g)?g:"-"})]}),e.showPositions&&e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("status_d_affect_75769")}),(0,i.jsx)(Xl,{children:(0,i.jsx)(Lm,{...LC(e.assignmentState),children:n(e.assignmentState)})})]})}),e.showAccreditations&&e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("statut_d_accr_d_75527")}),(0,i.jsx)(Xl,{children:(0,i.jsx)(Lm,{...UC(e.accreditationState),children:n(e.accreditationState)})})]})})]})]})]}),r&&(0,i.jsx)(sk,{email:e.userInfo.email,eventId:s,organizationId:t,userInfoId:e.userInfo.id,onClose:()=>{d(!1)},onSuccess:e.reload}),l&&(0,i.jsx)(ik,{campaignType:Ue.Email,canCustomDocuments:!!s&&a?.useDocuments,onClose:()=>c(!1)}),u&&(0,i.jsx)(ik,{campaignType:Ue.Sms,canCustomDocuments:!1,onClose:()=>m(!1)})]})},ak=()=>(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(0,i.jsx)(Vm,{size:88,variant:"circular"}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(Vm,{borderRadius:"$1",height:48,width:1})]})]}),rk=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),{canCampaignSend:a}=tC(),r=ss(Wg),{mutate:d}=$r(),l=e.campaign.sentAt?.setZone(Jo.c9.local().zone),c=(0,de.useMemo)(()=>e.campaign.campaignType===Ue.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,de.useMemo)(()=>e.campaign.campaignType===Ue.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Ug,{to:Nv.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}),children:e.campaign.name}),l&&(0,i.jsx)(Zr,{color:"gray500",children:n("envoy_e_le_1_31494",r.toLocaleString(l,da.DateOnly.MonthLong),r.toLocaleString(l,da.TimeOnly))})]})}),(0,i.jsxs)(_g,{width:150,children:[(0,i.jsx)(Zr,{width:22,children:e.campaign.campaignType===Ue.Email?(0,i.jsx)(pc,{icon:"at"}):(0,i.jsx)(pc,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)(_g,{width:200,children:[c&&(0,i.jsx)(Lm,{...PC(c),children:n(c)}),u&&(0,i.jsx)(Lm,{...HC(u),children:n(u)})]}),(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{css:{ellipsis:!0},children:e.campaign.event?.name??n("communaut_20896")})}),a&&(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsx)(Lg,{children:(0,i.jsx)(Em,{icon:"paper-plane",onClick:async()=>{await d({organizationId:t,eventId:s,campaignId:e.campaign.id,selecteds:{ids:[o]}})},children:n("r_envoyer_90741")})})})]})},dk=()=>{const{translate:e,params:{organizationId:n,userInfoId:t}}=fc(),{canCampaignSend:s}=tC(),{data:o,isLoading:a,reload:r}=rs("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:n,userInfoId:t},[],undefined);return(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(Mg,{width:150,children:e("type_35427")}),(0,i.jsx)(Mg,{width:200,children:e("State")}),(0,i.jsx)(Mg,{children:e("_v_nement_22345")}),s&&(0,i.jsx)(Mg,{width:100})]}),a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):o.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(rk,{campaign:e,reload:r},e.id))]})},lk=e=>{const n=ss(Wg);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"clock",subtitle:n.toLocaleString(e.history.insertedAt.toLocal(),da.DateTime),children:e.actionLabel}),(0,i.jsx)(Gf,{css:{overflowY:"auto"},children:(0,i.jsx)(Xl,{direction:"column",gap:"2",children:e.history.details.map((e,n)=>(0,i.jsx)(Zr,{css:{wordBreak:"break-word"},children:e},n))})})]})})},ck=e=>{const{translate:n}=fc(),t=ss(Wg),s=e.history.data?.email??null,[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{width:320,children:"workflow"===e.history.executedBy?(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$primary100",borderRadius:"32px",color:"$primary600",flexShrink:0,height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(pc,{icon:"bolt"})}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("automatisation_94272")})]}):e.history.user?(0,i.jsx)(MC,{isClickDisabled:!0,size:32,userInfo:e.history.user}):w(s)?(0,i.jsxs)(Xl,{align:"center",css:{overflow:"hidden"},gap:"3",children:[(0,i.jsx)(F_,{email:s,size:32}),(0,i.jsx)(Zr,{css:{ellipsis:""},font:"gray800 textSm medium",title:s,children:s})]}):"-"}),(0,i.jsx)(_g,{width:200,children:e.getActionLabel(e.history.action)}),(0,i.jsxs)(_g,{children:[f(e.history.details)?(0,i.jsx)(Zr,{css:{clamp:2,cursor:"pointer",whiteSpace:"pre-line",wordBreak:"break-word","&:hover":{color:"$primary700"}},role:"button",tabIndex:0,onClick:()=>a(!0),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a(!0))},children:e.history.details.join("\n")}):"-",o&&(0,i.jsx)(lk,{actionLabel:e.getActionLabel(e.history.action),history:e.history,onClose:()=>a(!1)})]}),(0,i.jsx)(_g,{width:200,children:t.toLocaleString(e.history.insertedAt.toLocal(),da.DateTime)})]})},uk=e=>{const{translate:n}=fc();return e.isLoading||0!==e.totalCount?(0,i.jsx)($g,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{width:320,children:n("utilisateur_41699")}),(0,i.jsx)(Mg,{width:200,children:n("action_44224")}),(0,i.jsx)(Mg,{children:n("d_tails_96248")}),(0,i.jsx)(Mg,{width:200,children:n("Date")})]}),numberOfPages:e.numberOfPages,offset:e.offset,rows:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):e.histories.map(n=>(0,i.jsx)(ck,{getActionLabel:e.getActionLabel,history:n},n.id)),setOffset:e.setOffset,totalCount:e.totalCount}):(0,i.jsx)(Jw,{title:n("aucun_historiqu_42893")})},mk=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),[o,a]=(0,de.useState)(0),{data:r,isLoading:d}=rs("query UserHistoryChanges(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n histories(eventId: $eventId, offset: $offset, limit: 25) {\n nodes {\n ...HistoryRow\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:n,userInfoId:s,eventId:t,offset:o},[Ko.HistoryRowFragment],undefined);const{numberOfPages:l,totalCount:c}=Jf(r.organization?.userInfo.histories);return(0,i.jsx)(uk,{getActionLabel:n=>e(`history_users_infos_${n}`),histories:r.organization?.userInfo.histories.nodes??[],isLoading:d,numberOfPages:l,offset:o,setOffset:a,totalCount:c})},gk=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=ss(Wg),o=(0,de.useMemo)(()=>Object.values((0,l.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const n=e[0].position;return{id:n.id,text:w(n.acronym)?n.acronym:n.name,color:n.color,count:e.length,icon:n.icon}}),[e.vr]),a=(0,de.useMemo)(()=>Object.values((0,l.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const n=e[0].accreditation;return{id:n.id,text:w(n.acronym)?n.acronym:n.name,color:n.color,count:e.length,icon:n.icon}}),[e.vr]);return(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ug,{to:eo.EVENT({organizationId:t,eventId:e.vr.event.id}),children:e.vr.event.name}),(0,i.jsx)(Zr,{color:"gray500",children:n("inscrit_le_1_12018",s.toLocaleString(e.vr.insertedAt.toLocal(),da.DateTime))})]}),(0,i.jsx)(_g,{children:(0,i.jsx)(AE,{badges:o})}),(0,i.jsx)(_g,{children:(0,i.jsx)(AE,{badges:a})}),(0,i.jsx)(_g,{children:e.vr.delegation&&(0,i.jsx)(Lm,{ellipsis:!0,children:e.vr.delegation.name})})]})},hk=()=>{const{translate:e,params:{organizationId:n,userInfoId:t}}=fc(),{data:s,isLoading:o}=rs("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:n,userInfoId:t},[],undefined);return(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Mg,{children:e("missions_63972")}),(0,i.jsx)(Mg,{children:e("accr_ditations_39450")}),(0,i.jsx)(Mg,{children:e("Delegation")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):s.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(gk,{vr:e},e.id))]})},pk=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=ss(Wg);return(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Ug,{to:Ks.FORM_PARAMETERS_GENERAL({organizationId:t,eventId:e.fui.event?.id,formId:e.fui.form.id}),children:e.fui.form.name}),(0,i.jsx)(Zr,{color:"gray500",children:n("rempli_le_1_29292",s.toLocaleString(e.fui.insertedAt.toLocal(),da.DateTime))})]}),(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{css:{ellipsis:!0},children:e.fui.event?.name??n("communaut_20896")})})]})},Ik=()=>{const{translate:e,params:{organizationId:n,userInfoId:t}}=fc(),{data:s,isLoading:o}=rs("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos {\n id\n insertedAt\n\n form {\n id\n name\n }\n\n event {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:n,userInfoId:t},[],undefined);return(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:e("nom_du_formulai_14952")}),(0,i.jsx)(Mg,{children:e("_v_nement_22345")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):s.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(pk,{fui:e},e.id))]})},fk=e=>{const n=ss(Wg),{organization:t}=Yy(),s=(0,de.useMemo)(()=>Jo.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?Jo.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),o=e.weezeventWebhook.checklist?Ox(t.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:o,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)(_g,{children:n.toLocaleString(s,{...da.DateTime,weekday:"long"})}),(0,i.jsx)(_g,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},xk=()=>{const{translate:e,params:{eventId:n,userInfoId:t}}=fc(),{data:s,isLoading:o}=rs('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:n,userInfoId:t},[],undefined);return(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:e("liste_de_contr_79815")}),(0,i.jsx)(Mg,{children:e("Date")}),(0,i.jsx)(Mg,{children:e("op_rateur_30804")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):s.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(fk,{weezeventWebhook:e},e.id))]})},_k=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{data:o,isLoading:a}=rs("query UserHistorySegments(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n segmentsFolders(segmentType: Volunteers, eventId: $eventId, level: $level) {\n id\n name\n\n segments {\n id\n name\n isIn(userInfoId: $userInfoId)\n }\n }\n }\n}\n",{organizationId:n,level:t?kn.Event:kn.Organization,eventId:t,userInfoId:s},[],undefined);return(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:e("dossier_00726")}),(0,i.jsx)(Mg,{children:e("vue_97139")}),(0,i.jsx)(Mg,{width:100,children:e("fait_parti_67171")})]}),a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):o.organization.segmentsFolders.flatMap(e=>e.segments.map(s=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.name}),(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:t?Wo.VOLUNTEERS_SEGMENT(n,t,s.id):Wo.COMMUNITY_USERS_SEGMENT(n,s.id),children:s.name})}),(0,i.jsx)(_g,{width:100,children:s.isIn&&(0,i.jsx)(pc,{icon:"check"})})]},s.id)))]})},jk=e=>{const{translate:n,params:t}=fc(),{hasOrganizationRole:s}=Yy(),{hasEventRole:o}=Ly(),{canAccreditationRead:a,canCampaignRead:r,canDelegationRead:d,canFormRead:l}=tC(),c={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},u=e.isEvent&&e.isWeezeventConnected&&(a||d);return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(Zr,{css:{px:"$6"},font:"gray900 textMd semiBold",children:n("historique_06296")}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$6"},children:[(s||o)&&(0,i.jsx)(EC,{path:Ev.MEMBER_HISTORY_CHANGES(t),children:n("historique_06296")}),(s||o)&&(0,i.jsx)(EC,{path:Ev.MEMBER_HISTORY_EVENTS(t),children:n("Event")}),r&&(0,i.jsx)(EC,{path:Ev.MEMBER_HISTORY_CAMPAIGNS(t),children:n("Campaigns")}),l&&(0,i.jsx)(EC,{path:Ev.MEMBER_HISTORY_FORMS(t),children:n("Form_plural")}),u&&(0,i.jsx)(EC,{path:Ev.MEMBER_HISTORY_SCANS(t),children:"Scans"}),(s||o)&&(0,i.jsx)(EC,{path:Ev.MEMBER_HISTORY_SEGMENTS(t),children:n("vues_50543")})]}),(s||o)&&(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY_CHANGES(c),children:(0,i.jsx)(mk,{})}),(s||o)&&(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY_EVENTS(c),children:(0,i.jsx)(hk,{})}),r&&(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY_CAMPAIGNS(c),children:(0,i.jsx)(dk,{})}),l&&(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY_FORMS(c),children:(0,i.jsx)(Ik,{})}),u&&(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY_SCANS(c),children:(0,i.jsx)(xk,{})}),(s||o)&&(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY_SEGMENTS(c),children:(0,i.jsx)(_k,{})})]})]})},vk=e=>{const{translate:n}=fc(),t=ss(Wg),[s,o]=(0,de.useState)(!0),a=(0,de.useCallback)(async()=>{const n=!s;o(n),await Py.forms.put({id:e.form.id,isOpenInUserOverlay:n})},[s,o]),r=e.canEdit&&!1!==e.form.isEditableInMemberSpace;return(0,de.useEffect)(()=>{(async()=>{o((await Py.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:a,children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:s?"chevron-up":"chevron-down"})}),(0,i.jsxs)(Xl,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(Lm,{color:"success",size:"sm",children:n("rempli_le_1_29292",t.toLocaleString(e.filledAt.toLocal(),da.DateTime))}):(0,i.jsx)(Lm,{color:"error",size:"sm",children:n("non_rempli_80877")}):null]}),r&&(0,i.jsx)(yc,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:n("_diter_62574")})]}),s&&(0,i.jsx)(Bw,{css:{borderTop:"1px solid $gray200",padding:"$6"},form:e.form,userInfo:e.userInfo})]})},Sk=e=>(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(pc,{icon:e.icon}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),yk=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc();return(0,i.jsx)(Sk,{icon:"people-group",title:t("d_l_gations_78318"),children:(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:e.delegations.map(e=>{const t=o?e.name:e.event?`${e.event.name} : ${e.name}`:e.name;return(0,i.jsx)(Lm,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{n.push(e.event?vo.DELEGATION({organizationId:s,eventId:e.event.id,delegationId:e.id}):Wo.COMMUNITY_DELEGATION(s,e.id))},children:t},e.id)})})})},Ck=e=>{const{history:n,translate:t}=fc(),s=ss(Wg),[o,a]=(0,de.useState)(!1),r=(0,de.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),d=(0,de.useMemo)(()=>f(e.profilePrivateFields)?e.profilePrivateFields:r.map(e=>e.slug),[r,e.profilePrivateFields]),l=(0,de.useMemo)(()=>(0,Tg.A)(r.filter(n=>d.includes(n.slug)&&Tb(n,e.userInfo.fields,e.customFields)),({slug:e})=>d.indexOf(e)),[e.customFields,r,d]),c=(0,de.useCallback)(async n=>{await e.profilePrivateFieldsUpdate(n),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Sk,{icon:"lock-keyhole",title:t("informations_pr_15873"),children:[l.map(n=>(0,i.jsx)(Vw,{field:n,fields:e.userInfo.fields},n.slug)),(0,i.jsx)(Zr,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:t("inscrit_le_1_12018",s.toLocaleString(e.insertedAt.toLocal(),da.DateTime))}),(0,i.jsx)(lC,{permissions:nC.MEMBER_EDIT,children:(0,i.jsx)(TR,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Em,{icon:"gear",onClick:()=>{a(!0)},children:t("g_rer_les_champ_00431")})}),onClick:()=>n.push(e.getEditUserFormPath("private")),children:t("_diter_62574")})})]}),o&&(0,i.jsx)(CI,{columns:r,css:{zIndex:"210"},initialSelectedColumns:d,saveButtonText:t("mettre_jour_85141"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_69296"),title:t("gestion_des_cha_66775"),onClose:()=>{a(!1)},onSave:c})]})},bk=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(pc,{icon:"users-viewfinder"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(MC,{size:32,userInfo:e}),f(e.delegations)&&(0,i.jsx)(Xl,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(Lm,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},Ak=({team:{organizationId:e,eventId:n,formId:t,teamCode:s,teamMembers:o}})=>{const{history:a,translate:r}=fc(),d=yx({organizationId:e,eventId:n,formId:t,teamCode:s}),{isLoading:l,copy:c}=ay(),u=(0,de.useCallback)(()=>{c(yx({organizationId:e,eventId:n,formId:t,teamCode:s}))},[e,n,t,s]);return(0,i.jsxs)(Sk,{icon:"user-group",title:r("_quipe_76857"),children:[w(s)&&(0,i.jsx)(Xl,{gap:"2",children:(0,i.jsx)(Lm,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{a.push(Wo.TEAM_ASSIGNMENT(e,n,s))},children:s})}),o.map(e=>(0,i.jsx)(MC,{size:32,userInfo:e},e.id)),(0,i.jsxs)(Xl,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(gc,{to:d,children:r("lien_d_invitati_45319")}),(0,i.jsx)(yc,{color:"white",isLoading:l,rightIcon:"copy",size:"sm",onClick:u})]})]})};function Ek(e,{locale:n}={}){const t=e.amount/100;return new Intl.NumberFormat(n,{style:"currency",currency:"USD",minimumFractionDigits:e.currencyDecimalPlaces,maximumFractionDigits:e.currencyDecimalPlaces}).formatToParts(t).map(n=>"currency"===n.type?e.currencySymbol:n.value).join("")}const wk=e=>{const{translate:n,params:{eventId:t,userInfoId:s}}=fc(),{canTicketIdRegenerate:o}=tC(),a=ss(Wg),{mutate:r}=zl(),[d,l]=(0,de.useState)(!1),c=(0,de.useMemo)(()=>w(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&Jo.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?a.toLocaleString(Jo.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),da.DateTime):"-",[e.volunteerRegistration]),u=(0,de.useMemo)(()=>e.volunteerRegistration.pairedAt?.isValid?a.toLocaleString(e.volunteerRegistration.pairedAt.toLocal(),da.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{css:{padding:"$5 $6"},direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(pc,{icon:"memo-circle-info"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("informations_22954")})]}),(0,i.jsxs)(Xl,{align:e.isWeezeventConnected?"center":"start",direction:e.isWeezeventConnected?"row":"column",gap:"5",children:[(0,i.jsx)(WE,{name:e.nameOrEmail,size:64,value:e.volunteerRegistration.ticketId}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("TicketId")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Lm,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(wm,{placement:"bottom-start",children:[(0,i.jsx)(Em,{icon:"copy",onClick:()=>{oy(e.volunteerRegistration.ticketId)},children:n("copier_75889")}),e.isWeezeventConnected&&w(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(gc,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(Em,{icon:"arrow-up-right-from-square",children:n("ouvrir_dans_wee_97529")})}),e.isWeezeventConnected&&w(e.volunteerRegistration.weezeventAccessUrl)&&(0,i.jsx)(gc,{to:e.volunteerRegistration.weezeventAccessUrl,children:(0,i.jsx)(Em,{icon:"arrow-up-right-from-square",children:n("ouvrir_dans_wee_22181")})}),e.isWeezeventConnected&&w(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(gc,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(Em,{icon:"arrow-up-right-from-square",children:n("ouvrir_dans_wee_14636")})}),o&&(0,i.jsx)(Em,{icon:"repeat",onClick:()=>l(!0),children:n("r_g_n_rer_le_co_81294")})]})]})]}),e.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("num_ro_de_puce_50039")}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:w(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("derni_re_synchr_59823")}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:c})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("appair_le_70213")}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:u})]})]})]})]}),e.isWeezeventConnected&&f(e.volunteerRegistration.weezeventPayBalances)&&(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",padding:"$5 $6"},direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(pc,{icon:"money-bill"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("solde_cashless_67316")})]}),(0,i.jsx)(Xl,{gap:"9",children:e.volunteerRegistration.weezeventPayBalances.map((e,n)=>(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:e.currencyName}),(0,i.jsx)(Zr,{color:"gray800",children:Ek(e)})]},n))})]})]}),d&&(0,i.jsx)(f$,{buttonText:n("r_g_n_rer_37440"),subtext:[n("_tes_vous_s_r_d_57752"),n("cela_rendra_l_a_42228")],text:n("r_g_n_rer_le_co_81294"),onClose:()=>l(!1),onDelete:async()=>{await r({eventId:t,selecteds:{ids:[s]}}),e.reload()}})]})},$k=e=>{const{translate:n,params:{eventId:t,userInfoId:s}}=fc(),{organization:o}=Yy(),{event:a}=Ly(),{canMemberEdit:r}=tC(),[d,l]=(0,de.useState)(""),[c,u]=(0,de.useState)(e.initialShowNotFilled),m=(0,de.useCallback)(n=>{u(n),e.setShowNotFilled(n)},[e.setShowNotFilled,u]),g=(0,de.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),h=(0,de.useMemo)(()=>(0,Tg.A)(e.forms.filter(e=>!(!c&&void 0===g[e.id])&&(!w(d)||e.name.toLowerCase().includes(d.toLowerCase().trim()))),[e=>void 0!==g[e.id]?1:2,e=>e.name]),[e.forms,g,d,c]),p=(0,de.useMemo)(()=>f(e.delegations)&&(!t||a?.useDelegations),[a,t,e.delegations]),I=(0,de.useMemo)(()=>e.formsUsersInfos.filter(e=>w(e.teamCode)),[e.formsUsersInfos]),x=(0,de.useMemo)(()=>!f(I)||!t||a?.useForms,[I,t,a]),_=(0,de.useMemo)(()=>e.usersInfos.filter(e=>e.id!==s),[e.usersInfos,s]),j=(0,de.useMemo)(()=>DE(e.userPermissions,n),[e.userPermissions,o]);return(0,i.jsxs)(Xl,{gap:"6",width:1,children:[(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(wk,{isWeezeventConnected:e.isWeezeventConnected,nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:d,onChange:l})}),(0,i.jsx)(Zm,{state:c?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:n("afficher_les_fo_84832")})]}),(0,i.jsx)(Xl,{direction:"column",gap:"3",children:0===h.length?(0,i.jsx)(Xl,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(Jw,{button:(0,i.jsx)(lC,{permissions:nC.MEMBER_EDIT,children:(0,i.jsx)(yc,{to:e.getEditUserFormPath("all"),children:n("_diter_les_cham_66020")})}),title:n("aucun_formulair_41857")})}):h.map(n=>(0,i.jsx)(vk,{canEdit:r,filledAt:g[n.id],form:n,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==n.id,userInfo:e.userInfo},n.id))})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:348,children:[!e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(wk,{isWeezeventConnected:e.isWeezeventConnected,nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),f(j)&&(0,i.jsx)(Sk,{icon:"shield",title:n("r_les_61679"),children:(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:j.map(e=>(0,i.jsx)(CE,{badge:e},e.id))})}),f(_)&&(0,i.jsx)(bk,{usersInfos:_}),p&&(0,i.jsx)(yk,{delegations:e.delegations}),x&&I.map((e,n)=>(0,i.jsx)(Ak,{team:e},n)),(0,i.jsx)(Ck,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},Tk=()=>{const{organizationId:e,eventId:n,userInfoId:t}=ls(),{localEvent:s,updateLocalEvent:o}=Ly(),{mutate:a}=function(e={}){return ds("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:r,loader:d,reload:l}=rs("query UserInformationsEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 pairedAt\n weezeventAccessUrl\n weezeventPayUrl\n weezeventTicketUrl\n\n delegation {\n ...DelegationUserProfile\n }\n\n weezeventPayBalances {\n amount\n currencyDecimalPlaces\n currencyName\n currencySymbol\n }\n }\n }\n}\n",{organizationId:e,eventId:n,userInfoId:t},[Ko.CustomFieldWithConditionFragment,Ko.UserInfoOverlayFragment,Ko.UserAllPermissionsFragment,Ko.FormUserInfoUserProfileFragment,Ko.FormUserOverlayFragment,Ko.DelegationUserProfileFragment],undefined);const c=(0,de.useMemo)(()=>(0,Tg.A)(r.event?.forms.nodes??[],e=>e.name),[r.event]),u=(0,de.useMemo)(()=>(0,sc.A)([r.event?.volunteerRegistration.delegation]),[r.event]);return d||(0,i.jsx)($k,{customFields:r.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:r.organization?.userInfo.formsUsersInfos??p,getEditUserFormPath:i=>Wo.EDIT_USER_FORM(e,n,t,i),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:r.event.volunteerRegistration.insertedAt,isWeezeventConnected:r.event.isWeezeventConnected,profilePrivateFields:r.event.profilePrivateFields,profilePrivateFieldsUpdate:e=>a({eventId:n,profilePrivateFields:e}),reload:l,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:r.organization.userInfo,userPermissions:r.organization.userInfo,usersInfos:r.organization.userInfo.user.usersInfos,volunteerRegistration:r.event?.volunteerRegistration})},zk=()=>{const{params:{organizationId:e,userInfoId:n},translate:t}=fc(),{localOrganization:s,updateLocalOrganization:o}=Yy(),{mutate:a}=function(e={}){return ds("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:r,loader:d,reload:l}=rs("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:n},[Ko.CustomFieldWithConditionFragment,Ko.FormUserOverlayFragment,Ko.UserInfoOverlayFragment,Ko.UserAllPermissionsFragment,Ko.DelegationUserProfileFragment,Ko.FormUserInfoUserProfileFragment],undefined);const c=(0,de.useMemo)(()=>{if(r.organization){const e=aA(r.organization.customFields.nodes),n={id:"all",name:t("tous_les_champs_57939"),elements:e};return(0,Tg.A)(r.organization.forms.nodes,e=>e.name).concat([n])}return[]},[r.organization,t]);return d||(0,i.jsx)($k,{customFields:r.organization.customFields.nodes,delegations:r.organization.userInfo.delegations,forms:c,formsUsersInfos:r.organization?.userInfo.formsUsersInfos??p,getEditUserFormPath:t=>Wo.COMMUNITY_EDIT_USER_FORM(e,n,t),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:r.organization.userInfo.insertedAt,isWeezeventConnected:!1,profilePrivateFields:r.organization.profilePrivateFields,profilePrivateFieldsUpdate:n=>a({organizationId:e,profilePrivateFields:n}),reload:l,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:r.organization.userInfo,userPermissions:r.organization.userInfo,usersInfos:r.organization.userInfo.user.usersInfos,volunteerRegistration:null})},Ok=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Nh),{mutate:o}=nr(),a=(0,de.useMemo)(()=>ca(),[]),[r,d]=(0,de.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),l=(0,de.useMemo)(()=>r.every(e=>e.checkInAt?.isValid&&e.checkOutAt?.isValid&&e.checkOutAt>e.checkInAt||e.checkInAt?.isValid&&!e.checkOutAt?.isValid||!e.checkInAt?.isValid&&!e.checkOutAt?.isValid),[r]),c=(0,de.useCallback)((e,n,t)=>{d((0,mI.jM)(i=>{i.forEach(i=>{i.id===e&&(i[n]=t||void 0)})}))},[r,d]);return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"sliders",children:n("mettre_jour_d_54198")}),(0,i.jsx)(Gf,{gap:"4",children:r.map(e=>(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Zr,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(s_,{fontWeight:"regular",children:Gh(s,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsx)(If,{rightIcon:"xmark",value:e.checkInAt,zone:a,onChange:n=>{c(e.id,"checkInAt",n)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)(If,{rightIcon:"xmark",value:e.checkOutAt,zone:a,onChange:n=>{c(e.id,"checkOutAt",n)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(hu,{shouldParseAsInt:!0,value:e.breakTime,onChange:n=>{c(e.id,"breakTime",n)}})]})]},e.id))}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:!l,onClick:async()=>{await Promise.all(r.map(e=>o({eventId:t,checkIn:{strategy:We.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:n("mettre_jour_85141")})})]})})},Rk=e=>{const{translate:n}=fc(),t=ss(Nh),s=(0,de.useMemo)(()=>{const n=Mm(e.psui.position.color);return{background:n[50],color:n[700]}},[e.psui]);return(0,i.jsx)(i.Fragment,{children:e.renderPosition((0,i.jsxs)(Xl,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(Zr,{children:e.psui.positionSlot.name}),(0,i.jsx)(Zr,{children:t.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===Be.CheckedOut&&(0,i.jsx)(pc,{icon:"stopwatch",title:n("d_pointer_25328")}),e.psui.state===Be.CheckedIn&&(0,i.jsx)(pc,{icon:"timer",title:n("pointer_80927")})]}),(0,i.jsx)(Zr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},Dk=e=>{const n=VI(),[t]=Wh(e.dayStartTime),s=(0,de.useMemo)(()=>Mh(e.assignments.map(e=>({...e,range:e.positionSlot.range})),e.startAt,e.endAt,t),[e.assignments,e.startAt,e.endAt,t]);return(0,i.jsx)(nz,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:n?"week":"day",maxDate:e.endAt,minDate:e.startAt,children:s.map((n,s)=>(0,i.jsx)(ez,{endAt:n.range.start,startAt:n.range.start,startHour:t,children:(0,i.jsx)(Rk,{psui:n,renderPosition:e.renderPosition,startHour:t})},s))})},Mk=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{hasPermission:o}=Ry(),a=ss(Wg),r=ss(dE),d=ss(Nh),{mutate:l}=nr(),c=(0,de.useMemo)(()=>Gh(d,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=o(nC.MEMBER_ASSIGN),m=o(nC.POSITION_READ,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"center",gap:"3",children:[(0,i.jsx)(UI,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.psui.positionCategory.name}),(0,i.jsx)(Ug,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:Eo.POSITION({organizationId:t,eventId:s,positionId:e.psui.position.id}),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)(_g,{children:e.psui.state===Be.CheckedOut?(0,i.jsx)(Lm,{leftIcon:"clock",children:n("temps_total_79448",r.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===Be.CheckedIn?(0,i.jsx)(Lm,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:n("point_le_1_63576",a.toLocaleString(e.psui.checkInAt.toLocal(),da.DateTime))}):(0,i.jsx)(Lm,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:n("non_point_42145")})}),(0,i.jsx)(_g,{children:e.psui.isAutoAssign&&(0,i.jsx)(Zr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"check"})})}),(0,i.jsx)(_g,{children:e.psui.isWorkflow&&(0,i.jsx)(Zr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"check"})})}),(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(Zr,{children:e.psui.createdBy?.name||e.psui.createdBy?.email||"-"}),(0,i.jsx)(Zr,{color:"gray500",children:a.toLocaleString(e.psui.insertedAt.toLocal(),da.DateTime)})]}),(0,i.jsxs)(Vg,{justify:"end",width:200,children:[m&&(e.psui.state===Be.Waiting?(0,i.jsx)(yc,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.psui.eventId,checkIn:{strategy:We.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:n("pointer_80927")}):e.psui.state===Be.CheckedIn?(0,i.jsx)(yc,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.psui.eventId,checkIn:{strategy:We.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:n("d_pointer_25328")}):null),(0,i.jsx)(Hw,{canCheckIn:m,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},Pk=e=>{const{translate:n}=fc(),{hasPermission:t}=Ry(),s=t(nC.POSITION_READ),o=(0,de.useMemo)(()=>e.assignments.filter(n=>!e.selectedDay?.isValid||n.positionSlot.range.contains(e.selectedDay)||n.positionSlot.range.start.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()||n.positionSlot.range.end.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),[e.assignments,e.selectedDay]);return(0,i.jsxs)(gg,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("Position")}),(0,i.jsx)(Mg,{children:n("statut_du_point_52451")}),(0,i.jsx)(Mg,{children:n("affect_e_automa_74071")}),(0,i.jsx)(Mg,{children:n("ajout_via_une_69544")}),(0,i.jsx)(Mg,{children:n("ajout_e_par_71330")}),s&&(0,i.jsx)(Mg,{width:200})]}),o.map(n=>(0,i.jsx)(Mk,{psui:n,reload:e.reload},n.id))]})},kk=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc(),[a,r]=(0,de.useState)(vj(e.event.startAt,e.event.endAt)),[d,l]=(0,de.useState)(null),[c,u]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{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)(Xl,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Zr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)($c,{children:e.title}),e.subtitle&&(0,i.jsx)(wc,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Xl,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(QT,{max:e.event.endAt,min:e.event.startAt,value:a,onChange:r}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(Zr,{width:160,children:(0,i.jsx)(df,{rightIcon:"xmark",value:d,onChange:l,onRightIconClick:()=>l(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{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")})]})}),e.canMemberAssign&&(0,i.jsx)(yc,{to:Wo.EDIT_ASSIGNMENT(n,t,s),children:o("_diter_les_affe_42283")}),e.canMemberAssign&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(wm,{placement:"bottom-end",children:(0,i.jsx)(Em,{icon:"circle-check",onClick:()=>u(!0),children:o("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(Dk,{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)(Pk,{assignments:e.assignments,reload:e.reload,selectedDay:d})]}),Ok&&(0,i.jsx)(Ok,{assignments:e.assignments,isOpen:c,onClose:()=>u(!1),onSuccess:()=>e.reload()})]})},Fk=e=>{const[n,t]=ZP("user.positions.display","calendar");return(0,i.jsx)(kk,{...e,positionsDisplay:n,setPositionsDisplay:t})},Nk=e=>{const n=os(),t=ss(Nh),{mutate:s,isLoading:o}=vr(),a=w(e.slot.name)?`${e.slot.name} - ${t.toDisplayString(e.slot.range)}`:t.toDisplayString(e.slot.range);return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.slot.position.name}),(0,i.jsx)(_g,{children:a}),(0,i.jsx)(_g,{justify:"end",width:200,children:(0,i.jsx)(yc,{color:"white",isLoading:o,size:"sm",onClick:async()=>{await s({eventId:e.eventId,massAssign:{strategy:Dn.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:n("affecter_94255")})})]})},Lk=e=>{const{params:{eventId:n,userInfoId:t},translate:s}=fc(),[o,a,r]=Dg(""),[d,l]=(0,de.useState)(0),[c,u]=(0,de.useState)(null),m=(0,de.useCallback)(e=>{u(e),l(0)},[u,l]),{data:g,isLoading:h}=rs("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:n,userInfoId:t,name:w(a)?a:void 0,offset:d,sort:c},[],undefined);const{numberOfPages:p,totalCount:I}=Jf(g.event?.volunteerRegistration.availablePositionsSlots),x=g.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_une_69998"),value:o,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:qn.Position,setSort:m,sort:c,children:s("nom_de_la_missi_64605")}),(0,i.jsx)(ax,{attribute:qn.Range,setSort:m,sort:c,children:s("cr_neau_11117")}),(0,i.jsx)(Mg,{width:200})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):f(x)?x.map(t=>(0,i.jsx)(Nk,{eventId:n,reload:e.reload,slot:t,userInfoId:e.userInfoId},t.id)):(0,i.jsx)(Eg,{css:{height:"200px"},children:(0,i.jsx)(Jw,{title:s("aucune_mission_03533")})}),setOffset:l,title:s("missions_dispon_68881"),totalCount:I})},Uk=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),a=ss(Nh),r=(0,de.useMemo)(()=>{const n=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?a.toDisplayString(e.range):"-",path:Eo.POSITION({organizationId:t,eventId:s,positionId:e.id})})),i=e.volunteerRegistration.preassignPositionsCategories.map(e=>({name:e.name,range:e.range?a.toDisplayString(e.range):"-",path:Eo.POSITION_CATEGORY({organizationId:t,eventId:s,positionCategoryId:e.id})}));return n.concat(i)},[e.volunteerRegistration]);return f(r)?(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:o("nom_de_la_missi_64605")}),(0,i.jsx)(Mg,{children:o("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:r.map((e,t)=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{n.push(e.path)},children:e.name})}),(0,i.jsx)(_g,{children:e.range})]},t))}),setOffset:Ou.A,title:o("pr_affectation_68999"),totalCount:0}):null},Vk=e=>{const{translate:n}=fc(),t=ss(dE);return(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("nombre_d_heures_46954")}),(0,i.jsx)(Zr,{font:"gray900 displaySm semiBold",children:t.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("nombre_de_missi_80367")}),(0,i.jsx)(Zr,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},Bk=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc(),{canMemberAssign:a}=tC(),r=(0,de.useMemo)(()=>(0,Tg.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[f(r)&&(0,i.jsx)(Fk,{assignments:r,canMemberAssign:a,event:e.event,reload:()=>{e.reload(),r.length<=1&&e.reloadHeader()},renderPosition:(e,s)=>(0,i.jsx)(gc,{style:{width:"100%"},to:Eo.POSITION({organizationId:n,eventId:t,positionId:s}),children:e}),subtitle:o("visualisez_tout_59046"),title:o("missions_affect_97811")}),(0,i.jsx)(Uk,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(i$,{canMemberAssign:a,editPath:Wo.EDIT_USER_MISSIONS(n,t,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(lC,{permissions:nC.MEMBER_ASSIGN,children:(0,i.jsx)(Lk,{reload:e.reload,userInfoId:s})}),f(r)&&(0,i.jsx)(Vk,{numberOfAssignments:r.length,volunteerRegistration:e.event.volunteerRegistration})]})},Wk=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{data:o,loader:a,reload:r}=tr({organizationId:n,eventId:t,userInfoId:s});return a||(0,i.jsx)(Bk,{event:o.event,organization:o.organization,reload:r,reloadHeader:e.reload})},Gk=()=>{const{params:{organizationId:e,eventId:n,userInfoId:t}}=fc(),{data:s,loader:o}=xr({organizationId:e,eventId:n,userInfoId:t}),{permissions:[a],isLoading:r}=pw(cw({eventId:n,userInfoId:t}));return o||r?o:(0,i.jsx)(i.Fragment,{children:s.event.hasFormWithSlotDisplay&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(h$,{editPath:Wo.EDIT_USER_SLOTS(e,n,t),eventId:n,formsUsersInfos:s.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:a})})})},qk=e=>{const{params:n,translate:t}=fc(),{data:s,isLoading:o,reload:a}=rs('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',n,[Ko.UserInfoOverlayFragment],undefined);const r=(0,de.useMemo)(()=>s.organization?.userInfo.numberOfComments??0,[s.organization]),d={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};fm(s.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:l,delegationId:c,organizationId:u,userInfoId:m}}=fc(),{permissions:[g,h],isLoading:p}=pw(dw({eventId:l,organizationId:u,userInfoId:m}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:l,organizationId:u,userInfoId:m})),I=o||p;return(0,i.jsxs)(AC,{children:[(0,i.jsx)(bC,{hideBorder:!0,children:I?(0,i.jsx)(ak,{}):(0,i.jsx)(ok,{accreditationState:s.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:s.organization?.userInfo.volunteerRegistration?.state,canEmailEdit:h,populationFieldName:s.organization?.populationField.name||"",reload:a,showAccreditations:e.showAccreditations,showPositions:e.showPositions,userInfo:s.organization.userInfo})}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:Ev.MEMBER_INFORMATION(n),children:t("informations_22954")}),e.showAvailabilities&&(0,i.jsx)(EC,{path:Ev.MEMBER_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),e.showPositions&&(0,i.jsx)(EC,{path:Ev.MEMBER_POSITIONS(n),children:t("missions_63972")}),e.showAccreditations&&(0,i.jsx)(EC,{path:Ev.MEMBER_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(EC,{path:Ev.MEMBER_ACTIONS(n),children:t("actions_21689")}),g&&(0,i.jsx)(EC,{path:Ev.MEMBER_COMMENTS(n),children:t("commentaires_97857",r)}),(0,i.jsx)(EC,{basePath:Ev.MEMBER_HISTORY(n),path:Ev.MEMBER_HISTORY_CHANGES(n),children:t("historique_06296")})]}),(0,i.jsx)($C,{path:Ev.MEMBER_INFORMATION(d),children:e.isEvent?(0,i.jsx)(yC,{children:(0,i.jsx)(Tk,{})}):(0,i.jsx)(yC,{children:(0,i.jsx)(zk,{})})}),e.showAvailabilities&&(0,i.jsx)($C,{path:Ev.MEMBER_AVAILABILITIES(d),children:(0,i.jsx)(yC,{children:(0,i.jsx)(Gk,{})})}),e.showPositions&&(0,i.jsx)($C,{path:Ev.MEMBER_POSITIONS(d),children:(0,i.jsx)(yC,{children:(0,i.jsx)(Wk,{reload:a})})}),e.showAccreditations&&(0,i.jsx)($C,{path:Ev.MEMBER_ACCREDITATIONS(d),children:(0,i.jsx)(yC,{children:(0,i.jsx)(QP,{})})}),e.showActions&&(0,i.jsx)($C,{path:Ev.MEMBER_ACTIONS(d),children:e.isEvent?(0,i.jsx)(yC,{children:(0,i.jsx)(ek,{})}):(0,i.jsx)(yC,{children:(0,i.jsx)(tk,{})})}),g&&(0,i.jsx)($C,{path:Ev.MEMBER_COMMENTS(d),children:(0,i.jsx)(yC,{children:(0,i.jsx)(VP,{showEvent:!0})})}),(0,i.jsx)($C,{path:Ev.MEMBER_HISTORY(d),children:(0,i.jsx)(yC,{children:(0,i.jsx)(jk,{isEvent:e.isEvent,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1})})})]})]})},Hk=()=>{const{canAccreditationRead:e,canDocumentRead:n,canMemberAccredit:t,canMemberAssign:s,canMemberAssignmentStateEdit:o,canMemberAvailabilitiesEdit:a,canMemberDelete:r,canPositionRead:d}=tC(),l=n||t||s||o||r,c=e||d||a;return(0,i.jsx)(qk,{isEvent:!0,showAccreditations:e,showActions:l,showAvailabilities:c,showPositions:d})},Yk=()=>(0,i.jsx)(qk,{isEvent:!1,showAccreditations:!1,showActions:!0,showAvailabilities:!1,showPositions:!1});var Zk=t(6301);function Kk(e=[]){const n=String.fromCharCode(65+(0,Zk.A)(25));return!1===e.includes(n)?n:Kk(e)}function Xk(e=[]){const n=(0,Zk.A)(9);return!1===e.includes(n)?n:Xk(e)}const Qk=["Q","O","I","L"],Jk=[0,1];function eF(e=10){const n=(0,Sg.A)(0,e-1).map(()=>{return e=Qk,n=Jk,0===(0,Zk.A)(1)?Kk(e):Xk(n).toString();var e,n}).join("");return`${Kk(Qk)}${n}`}const nF=e=>{const n=os(),t=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)(Yj,{height:"4"}),(0,i.jsx)(pu,{hint:n("d_finissez_votr_19710"),label:n("code_quipe_14296"),name:t,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(t,eF())}}),(0,i.jsx)(ic,{height:"9"})]})},tF=e=>{const{history:n,params:{eventId:t},translate:s}=fc(),o=(0,de.useMemo)(()=>(0,Tg.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(Xl,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(Xl,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(Xl,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:t?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(TC,{children:[(0,i.jsxs)(wC,{children:[o.map(n=>(0,i.jsx)(EC,{path:e.getTabPath(n.id),children:n.name},n.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(Xl,{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)(Xl,{align:"center",css:{width:"100%","@desktop":{width:t?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(yc,{isLoading:e.isLoading,onClick:e.handleSubmit,children:s("mettre_jour_85141")}),(0,i.jsx)(Zr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>n.goBack(e.returnPathFallback),children:s("annuler_48254")})]})})]})},iF=({banner:e,change:n,customFields:t,formIdToInsertedAt:s,forms:o,getEditUserFormPath:a,handleSubmit:r,isLoading:d,returnPathFallback:l,showAllAndPrivate:c,showIsFilled:u,userInfo:m,values:g})=>{const{translate:h,params:{organizationId:p}}=fc(),I=ss(Wg),f=(0,de.useMemo)(()=>t.filter(e=>e.isPrivate).map(e=>({id:ce(),elementType:yn.Field,isMandatory:null,section:null,text:null,hasCondition:!1,conditionValue:!1,conditionCustomField:null,customField:e})),[t]),x=(0,de.useMemo)(()=>aA(t),[t]),_=(0,de.useCallback)((e,n)=>(0,i.jsxs)(i.Fragment,{children:[0!==n&&(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Hj,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(tF,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EC,{path:a("all"),children:h("tous_les_champs_57939")}),(0,i.jsx)(EC,{path:a("private"),children:h("champs_priv_s_84670")})]}):void 0,forms:o,getTabPath:a,handleSubmit:r,isLoading:d,returnPathFallback:l,title:h("mise_jour_de_17055",m.nameOrEmail),children:[o.map(e=>{const t=s[e.id];return(0,i.jsxs)($C,{path:a(e.id),children:[(0,i.jsx)(ic,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textMd semiBold",children:h("statut_du_formu_08195")}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsxs)(nf,{shouldParseAsBoolean:!0,state:t?"disabled":"active",value:g.filledFormsIds.includes(e.id),onChange:t=>{n("filledFormsIds",j(g.filledFormsIds,e.id,t))},children:[(0,i.jsx)("option",{value:"true",children:t?h("rempli_le_1_29292",I.toLocaleString(t,da.DateTime)):h("rempli_78674")}),(0,i.jsx)("option",{value:"false",children:h("non_rempli_80877")})]})})]}),(0,i.jsx)(ic,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(nF,{change:n,form:e})]}),(0,i.jsx)(HM,{change:n,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:_,values:g.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)($C,{path:a("all"),children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(HM,{change:n,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:_,values:g.userInfo.fields})]}),c&&(0,i.jsxs)($C,{path:a("private"),children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(HM,{change:n,elements:f,organizationId:p,prefix:"userInfo.fields.",renderSection:_,values:g.userInfo.fields})]})]})},sF=[_n.Address,_n.Text,_n.Textarea,_n.Time],oF=({banner:e,customFields:n,country:t,formIdToInsertedAt:s,formIdToTeamCode:o,forms:a,from:r,getEditUserFormPath:d,showAllAndPrivate:l,showIsFilled:c,userInfo:u})=>{const{organizationId:m,eventId:g,delegationId:h}=ls(),p=cs(),I=ss(MM),f=ss(ec),{mutate:x,isLoading:_}=function(e={}){return ds("mutation UserInfoUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userId: UserId!\n $userInfo: UsersInfoInput!\n $filledFormsIds: [FormId!]\n $memberSpaceFormId: 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 memberSpaceFormId: $memberSpaceFormId\n ) {\n id\n }\n}\n",e)}(),j=(0,de.useMemo)(()=>Object.keys(s).map(e=>parseInt(e,10)),[s]),v=(0,de.useMemo)(()=>Object.fromEntries(Object.entries(o).map(([e,n])=>[`f${e}`,n])),[o]),S=(0,de.useMemo)(()=>({filledFormsIds:j,formKeyToTeamCode:v,userInfo:I.userInfoUpdateInputDefault(u,n,{checkboxDefaultEmpty:!0,countryCode:t})}),[j,v,u,n,t]),y=(0,de.useCallback)(e=>f.validateForForm(I.updateUserInfoChangedFieldsSchema(n,S.userInfo.fields,e.userInfo.fields))(e),[n,S]);return(0,i.jsx)(Fc,{direction:"column",height:1,hideDefaultErrors:!0,initialValues:S,render:({form:t,handleSubmit:o,values:p})=>(0,i.jsx)(iF,{banner:e,change:t.change,customFields:n,formIdToInsertedAt:s,forms:a,getEditUserFormPath:d,handleSubmit:o,isLoading:_,returnPathFallback:"app"===r?g?Wo.VOLUNTEERS(m,g):Ms.COMMUNITY_USERS({organizationId:m}):h?vo.DELEGATION_MEMBERS({organizationId:m,eventId:g,delegationId:h}):Ev.MEMBER({organizationId:m,eventId:g,userInfoId:u.id}),showAllAndPrivate:l,showIsFilled:c,userInfo:u,values:p}),validate:y,width:1,onSubmit:async e=>{const t=e.userInfo.fields;n.forEach(e=>{sF.includes(e.fieldType)&&!t[e.slug]?t[e.slug]="":e.fieldType!==_n.File||t[e.slug]||(t[e.slug]=null)}),await x({organizationId:m,eventId:g,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===r?Wo.VOLUNTEERS(m,g):Ev.MEMBER({organizationId:m,eventId:g,userInfoId:u.id}))}})},aF=({country:e,data:n,forms:t,getEditFormPath:s})=>{const{params:{organizationId:o,eventId:a,userInfoId:r}}=fc(),d=(0,de.useMemo)(()=>n.organization?.userInfo.formsUsersInfos??[],[n.organization]),l=(0,de.useMemo)(()=>d.map(e=>e.formId),[d]),c=(0,de.useMemo)(()=>Object.fromEntries(d.map(e=>[e.formId,e.insertedAt])),[d]),u=(0,de.useMemo)(()=>a?Object.fromEntries(d.map(e=>[e.formId,e.teamCode])):{},[a,d]);return(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:[Wo.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),Wo.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId")],children:(0,i.jsx)(oF,{country:e,customFields:n.organization.customFields.nodes,formIdToInsertedAt:c,formIdToTeamCode:u,forms:t,from:"app",getEditUserFormPath:s,showAllAndPrivate:!0,showIsFilled:!0,userInfo:n.organization.userInfo})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:a?Wo.EDIT_USER_FORM(o,a,r,l?.[0]??"all"):Wo.COMMUNITY_EDIT_USER_FORM(o,r,l?.[0]??"all"),replace:!0})})]})},rF=()=>{const{params:{organizationId:e,eventId:n,delegationId:t,userInfoId:s}}=fc(),o=cs(),{data:a,loader:r}=rs("query UpdateUserInfosEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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:n,userInfoId:s},[Ko.CustomFieldWithConditionFragment,Ko.UpdateUserFormFragment],undefined);return r||(a.organization.userInfo.isEditable??1)||o.push(Wo.DASHBOARD(e,n)),r||(0,i.jsx)(aF,{country:a.event.country,data:a,forms:t?a.event.forms.nodes.filter(e=>f(e.delegationsIds)&&e.delegationsIds.includes(t)):a.event.forms.nodes,getEditFormPath:t=>Wo.EDIT_USER_FORM(e,n,s,t)})},dF=()=>{const{organizationId:e,delegationId:n,userInfoId:t}=ls(),{data:s,loader:o}=rs("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:t},[Ko.CustomFieldWithConditionFragment,Ko.UpdateUserFormFragment],undefined);return o||(0,i.jsx)(aF,{country:s.organization.country,data:s,forms:n?s.organization.forms.nodes.filter(e=>f(e.delegationsIds)&&e.delegationsIds.includes(n)):s.organization.forms.nodes,getEditFormPath:n=>Wo.COMMUNITY_EDIT_USER_FORM(e,t,n)})},lF=(0,de.createContext)({}),cF=({children:e,...n})=>(0,i.jsx)(lF.Provider,{value:{shouldShowModeSelection:Boolean(n.createCard||n.upsertCard||n.updateCard),...n},children:e});function uF(){return(0,de.useContext)(lF)}var mF,gF=t(4809);let hF=class extends ju{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:ea,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return Jl.Ik().shape({acl:Jl.Yj().required(e),delimiter:Jl.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!gF.BAD_DELIMITERS.includes(e)),key:Jl.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>sS(Kv(e).extension)===eS.Csv),name:Jl.Yj().required(e),newline:Jl.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:Jl.Yj().optional(),formats:Jl.Ik().shape({timeFormat:Jl.Yj().optional(),dateFormat:Jl.Yj().optional(),datetimeFormat:Jl.Yj().optional()}),file:Jl.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=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(mF=void 0!==ts&&ts)?mF:Object])],hF);var pF,IF,fF;let xF=class extends ju{static{pF=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===wn.Update?[pF.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,n){super(n),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:wn.Upsert}}}schema(){return Jl.Ik().shape({input:Jl.Ik().shape({csv:this.csvInputService.schema(),mode:Jl.Yj().oneOf(Ii,this.t("le_mode_d_impor_75706"))})})}};xF=pF=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(IF=void 0!==hF&&hF)?IF:Object,"function"==typeof(fF=void 0!==ts&&ts)?fF:Object])],xF);var _F,jF;let vF=class extends xF{csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:wn.Upsert,tag:""}}}schema(){return Jl.Ik().shape({input:Jl.Ik().shape({csv:this.csvInputService.schema(),mappings:Jl.YO().of(Jl.Yj().nullable()),presets:Jl.YO().of(Jl.Ik().shape({customFieldId:Jl.ai().positive(this.t("le_choix_du_typ_07079")),value:Jl.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:Jl.Yj().oneOf(Ii,this.t("le_mode_d_impor_75706")),tag:Jl.Yj().required("a_tag_must_be_s_23274")})})}settingsStepSchema(){return Jl.Ik().shape({input:Jl.Ik().shape({csv:this.csvInputService.schema()})})}mappingStepSchema(){return Jl.Ik().shape({input:Jl.Ik().shape({mappings:Jl.YO().of(Jl.Yj().nullable()),presets:Jl.YO().of(Jl.Ik().shape({customFieldId:Jl.ai().positive(this.t("le_choix_du_typ_07079")),value:Jl.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:Jl.Yj().oneOf(Ii,this.t("le_mode_d_impor_75706")),tag:Jl.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,n){super(e,n),this.csvInputService=e}};vF=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(_F=void 0!==hF&&hF)?_F:Object,"function"==typeof(jF=void 0!==ts&&ts)?jF:Object])],vF);var SF,yF,CF;let bF=class extends vF{static{SF=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...vF.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===wn.Update?[SF.IMPORT_COLUMNS_DEFAULT.Id]:[SF.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,n){super(e,n),this.csvInputService=e}};bF=SF=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(yF=void 0!==hF&&hF)?yF:Object,"function"==typeof(CF=void 0!==ts&&ts)?CF:Object])],bF);const AF=e=>{const{params:{organizationId:n},translate:t}=fc(),{data:s,loader:o}=er({organizationId:n}),a=Vc(),r=(0,de.useMemo)(()=>e.formRenderProps.values.input.csv.file,[e.formRenderProps.values.input.csv]),d=(0,de.useMemo)(()=>{const n=localStorage.getItem(Iu[`${e.localStorageKeyPrefix}_FORMATS`]);return n?JSON.parse(n):n},[e.localStorageKeyPrefix]),l=(0,de.useMemo)(()=>{const n=n=>e.formRenderProps.values.input.csv.formats?.[n]===s.organization?.[n]?(0,i.jsx)(Lm,{css:{textTransform:"uppercase"},children:t("from_organisati_25675")}):d?.[n]===e.formRenderProps.values.input.csv.formats?.[n]&&(0,i.jsx)(Lm,{css:{textTransform:"uppercase"},children:t("from_saved_22150")});return{datetime:n("datetimeFormat"),date:n("dateFormat"),timeBadge:n("timeFormat")}},[s.organization,d,e.formRenderProps.values.input.csv.formats]),c=as(),u=[e.ImportInputService.IMPORT_COLUMNS_DEFAULT.Id];window.location.origin===ee.HEAVENT_PUBLIC_URL.origin&&u.push(bF.IMPORT_COLUMNS_DEFAULT.TicketId);const m=Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).filter(e=>!u.includes(e));let g=[...m,...e.customFields.map(e=>e.slug.startsWith("cf")?`${e.name} [${e.slug}]`:e.name)],h=0;if(f(e.additionalCategories))for(const n of e.additionalCategories){if(n.fields.some(e=>!e.slug.startsWith("accreditation_slot_")&&!e.slug.startsWith("accreditation_profile_")))throw new Error("Unhandled category type");g=[...g,...n.fields.map(e=>`${e.name} [${e.slug}]`)],h+=n.fields.length}const p=[g,new Array(m.length+e.customFields.length+h)].map(e=>e.map(e=>{return`${n=e,n.includes(",")||n.includes('"')||n.includes("\n")||n.includes(" ")?'"'+n.replace(/"/g,'""')+'"':n}`;var n}).join(",")).join("\n"),I=`data:text/csv;charset=utf-8,${encodeURIComponent(p)}`;return o||(0,i.jsxs)(Xl,{direction:"column",gap:"8",children:[(0,i.jsx)(Wv,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:t("choix_du_fichie_30517"),subtitle:[...c(t("s_lectionnez_vo_53506","{1}"),(0,i.jsx)(Ug,{css:{color:"$primary600"},download:`export-${e.sampleFilename?mc(e.sampleFilename):"sample-file"}.csv`,to:I,children:t("t_l_charger_un_46976")}))],children:(0,i.jsx)(qb,{...a,accept:Jv.Csv,acl:"private",organizationId:n,prefix:"input.csv.",withFileField:!0,onChange:n=>e.onChange(n,e.formRenderProps)})}),(0,i.jsxs)(Wv,{heading:t("param_tres_du_f_01675"),isOpenToggleLabel:t("afficher_les_pa_96893"),subtitle:t("personnaliser_s_29361"),children:[(0,i.jsxs)(FA,{heading:t("type_de_carat_r_62356"),children:[(0,i.jsx)(pu,{hint:t("laissez_ce_cham_07837"),label:t("d_limitateur_77701"),name:"input.csv.delimiter",state:r?"disabled":void 0}),(0,i.jsx)(pu,{hint:t("leave_blank_if_02058"),label:t("caract_re_d_ch_56847"),name:"input.csv.quoteChar",state:r?"disabled":void 0}),(0,i.jsxs)(Qy,{hint:t("leave_blank_if_02058"),label:t("caract_re_de_re_71491"),name:"input.csv.newline",state:r?"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)(FA,{heading:t("type_de_format_68432"),children:[(0,i.jsx)(pu,{label:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[t("format_d_heure_46798"),l.timeBadge]}),name:"input.csv.formats.timeFormat",state:r?"disabled":void 0}),(0,i.jsx)(pu,{label:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[t("format_de_date_82059"),l.date]}),name:"input.csv.formats.dateFormat",state:r?"disabled":void 0}),(0,i.jsx)(pu,{label:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[t("format_de_date_24474"),l.datetime]}),name:"input.csv.formats.datetimeFormat",state:r?"disabled":void 0})]})]})]})},EF=Nr("input",{blockSize:"fit-content",inlineSize:"fit-content"}),wF=(0,de.forwardRef)((e,n)=>(0,i.jsx)(EF,{ref:n,type:"radio",...e}));wF.displayName="Radio";const $F=({children:e,css:n,icon:t,subtext:s,...o})=>{const{inputId:a,descId:r,labelId:d}=Vc(),l=(0,de.useRef)(null);return(0,i.jsx)(Xl,{css:{bd:!0,flexGrow:"1",margin:"-1px",cursor:"pointer",'&:has( input[type="radio"]:checked)':{border:"2px solid $primary500"},...n},onClick:()=>l.current?.click(),children:(0,i.jsx)(Xl,{css:{border:"1px solid transparent",padding:"$4",'&:has( input[type="radio"]:checked)':{border:"none"}},children:(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Xl,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(UI,{css:{color:"$gray800",background:"unset"},icon:t})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(uu,{htmlFor:a,id:d,children:(0,i.jsx)(wc,{css:{fontSize:"$textSm",fontWeight:"$medium"},children:e})}),s&&(0,i.jsx)(wc,{id:r,children:s})]}),(0,i.jsx)(Xl,{css:{flex:"1"}})]}),(0,i.jsx)(wF,{ref:l,"aria-describedby":r,"aria-labelledby":d,id:a,...o})]})})})},TF=({name:e,value:n,...t})=>(0,i.jsx)(ld.D0,{name:e,render:({input:e})=>(0,i.jsx)($F,{checked:e.checked,name:e.name,value:n,onChange:e.onChange,...t,children:t.children}),type:"radio",value:n}),zF=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>[{id:-1,name:n("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,t])=>({name:w(n(e))?n(e):e,slug:t,id:parseInt((0,ig.A)())}))},...e.categories].map(n=>({...n,fields:(0,Tg.A)(n.fields,n=>{const t=n.name.toLowerCase(),i=n.slug.toLowerCase(),s=e.column.name.toLowerCase(),o=Math.min(M(t,s),M(i,s));return o{const s=Object.values(e.defaultFields).find(e=>e===n);return s&&e.requiredFieldSlugs.includes(s)?(0,i.jsx)("strong",{children:t}):t},[e.defaultFields,e.requiredFieldSlugs]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hu,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(pc,{icon:"arrow-right"}),(0,i.jsx)(Kx,{isSearchVisible:!0,multiple:!1,name:`input.mappings.${e.column.index}`,placeholder:n("s_lectionnez_un_12007"),renderValue:s,children:t.map(n=>(0,i.jsx)("optgroup",{label:n.name,children:n.fields.map(n=>(0,i.jsx)("option",{style:{fontWeight:e.requiredFieldSlugs.includes(n.slug)?"bold":"inherit",opacity:e.values.includes(n.slug)?.5:1},value:n.slug,children:n.name},n.id))},n.id))})]})},OF=Nr("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),RF=Nr("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),DF=Nr("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),MF=e=>{const{translate:n}=fc();return(0,i.jsxs)(OF,{children:[(0,i.jsx)(RF,{children:n("titres_de_vos_c_31388")}),(0,i.jsx)(DF,{children:n("champs_de_formu_64126")}),e.columns.map((n,t)=>(0,i.jsx)(zF,{categories:e.categories,column:{name:n,index:t},defaultFields:e.defaultFields,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values},t))]})},PF=e=>{const{translate:n}=fc(),{alertDescriptionKey:t}=uF(),{formRenderProps:{values:{input:{mappings:s}}}}=(0,de.useContext)(tc),o=(0,de.useMemo)(()=>Object.entries(e.defaultFields).filter(([n,t])=>e.requiredFieldSlugs.includes(t)&&!s.includes(t)).map(([e,t])=>w(n(e))?n(e):e),[e.defaultFields,e.requiredFieldSlugs,s]),a=as();return(0,i.jsxs)(Wv,{css:{"& > header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"5",heading:n("donn_es_de_mapp_98874"),subtitle:n("s_lectionnez_le_13978"),children:[f(o)&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("required_field_46113",o.length)}),(0,i.jsx)(Oc,{children:[...a(n(t,"{1}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:o.map(e=>(0,i.jsx)("li",{children:e},e))}))]})]}),(0,i.jsx)(MF,{...e})]})},kF=({file:e,onToggle:n,...t})=>{const s=os();return(0,i.jsx)(Wv,{heading:s("attribution_d_u_50979"),isOpen:f(t.values)??!1,isOpenToggleLabel:s("attribuer_autom_74319"),subtitle:s("d_finissez_dire_31742"),onToggle:n,children:(0,i.jsx)(FA,{heading:s("liste_des_champ_94862"),children:(0,i.jsx)(cA,{name:"input.presets",...t})})})},FF=(e,n)=>{switch(n.type){case"LOADING":return{isLoading:!0,columns:void 0,errors:void 0};case"SUCCESS":return{isLoading:!1,columns:n.columns,errors:void 0};case"ERROR":return{isLoading:!1,columns:void 0,errors:n.errors}}};function NF(e){const{translate:n}=fc(),{isLoading:t,columns:s,errors:o}=((e,n)=>{const[t,i]=(0,de.useReducer)(FF,{isLoading:!0,columns:void 0,errors:void 0});return(0,de.useEffect)(()=>{i({type:"LOADING"}),(0,gF.parse)(e,{preview:1,...n,complete:({data:e,errors:n})=>{n.filter(e=>"UndetectableDelimiter"!==e.code).length?i({type:"ERROR",errors:n}):i({type:"SUCCESS",columns:e[0]??p})}})},[e]),t})(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}),a=(0,de.useMemo)(()=>{const n=sA(e.customFields).map(({category:e,items:n})=>({id:e.id,name:e.name,fields:n.map(e=>e.fieldType===_n.File?{...e,name:`${e.name} (URL)`}:e)}));return e.additionalCategories?n.concat(e.additionalCategories):n},[e.additionalCategories,e.customFields]);return t||o?null:(0,i.jsxs)(i.Fragment,{children:[e.additionalOptions&&(0,i.jsx)(Wv,{heading:n("param_tres_d_im_18876"),children:e.additionalOptions}),(0,i.jsx)(PF,{categories:a,columns:s,defaultFields:e.defaultFields,modeSelection:e.modeSelection,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values.input.mappings}),f(e.customFields)&&(0,i.jsx)(kF,{change:e.form.change,customFields:e.customFields,file:e.file,values:e.values.input.presets,onToggle:e.onToggle})]})}const LF=e=>{const{params:{organizationId:n},translate:t}=fc(),{createCard:s,upsertCard:o,updateCard:a,shouldShowModeSelection:r}=uF();return(0,i.jsxs)(Xl,{direction:"column",gap:"8",children:[r&&(0,i.jsx)(Wv,{heading:t("type_d_action_d_35533"),name:"input.mode",role:"radiogroup",subtitle:t("s_lectionnez_la_32551"),children:(0,i.jsxs)(Xl,{gap:"4",justify:"evenly",children:[s&&(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(TF,{icon:"user-plus",name:"input.mode",subtext:s.description,value:wn.Create,children:s.heading})}),o&&(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(TF,{icon:"user-pen",name:"input.mode",subtext:o.description,value:wn.Upsert,children:o.heading})}),a&&(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(TF,{icon:"arrows-rotate",name:"input.mode",subtext:a.description,value:wn.Update,children:a.heading})})]})}),e.formRenderProps.values.input.csv?.file&&VF(e.formRenderProps.form)&&(0,i.jsx)(NF,{additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,customFields:e.customFields,defaultFields:e.ImportInputService.IMPORT_COLUMNS_DEFAULT,file:e.formRenderProps.values.input.csv.file,form:e.formRenderProps.form,requiredFieldSlugs:e.ImportInputService.IMPORT_COLUMNS_REQUIRED(e.formRenderProps.values.input.mode),values:e.formRenderProps.values,onToggle:t=>{if(!e.formRenderProps.values.input.csv.file)throw new Error("No file in input!");try{t?e.formRenderProps.form.change("input.presets",JSON.parse(localStorage.getItem(Iu[`${e.localStorageKeyPrefix}_PRESETS`](n))??"[]")):e.formRenderProps.form.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${String(e)}`)}}}),(0,i.jsxs)(Wv,{heading:t("identify_your_i_87636"),subtitle:t("by_default_you_75833"),children:[(0,i.jsx)(pu,{label:t("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!e.isTagInputDisabled&&(0,i.jsx)(hu,{label:t("specify_an_impo_41868"),onChange:n=>{w(n)?e.formRenderProps.form.change("input.tag",`${e.importTagPrefix}-csv-${n}`):e.formRenderProps.form.change("input.tag",`${e.importTagPrefix}-csv-${Jo.c9.now().toFormat(ta)}`)}})]})]})},UF=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{align:"center",css:{alignSelf:"center",maxInlineSize:"640px"},direction:"column",gap:"8",children:[(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"4",children:[(0,i.jsx)(Xl,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(UI,{css:{color:"$gray800",background:"unset"},icon:"party-horn"})}),(0,i.jsxs)(Xl,{css:{textAlign:"center"},direction:"column",gap:"1",children:[(0,i.jsx)($c,{children:n("l_importation_e_12369")}),(0,i.jsx)(wc,{textStyle:"subtitle",children:n("_la_fin_du_pro_00757")})]})]}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{onClick:()=>window.location.reload(),children:n("nouvel_import_48306")}),e.returnLink]})]})},VF=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,BF=/\[(cf[0-9]+|accreditation_slot_[0-9]+)\]$/,WF=/\[accreditation_slot_([0-9]+)\]$/,GF=(e,n)=>Math.abs(e.length-n.length)<=1&&(0===e.length||0===n.length||e.charCodeAt(0)===n.charCodeAt(0)||e.charCodeAt(e.length-1)===n.charCodeAt(n.length-1)),qF=(e,n)=>e.IMPORT_COLUMNS_REQUIRED(n.mode).every(e=>n.mappings.includes(e)),HF=(e,n,t)=>n.formatListValues(e.IMPORT_COLUMNS_REQUIRED(t.mode).filter(e=>!t.mappings.includes(e)),"conjunction"),YF=e=>{const{params:{organizationId:n,eventId:t,delegationId:s},translate:o}=fc(),{shouldShowModeSelection:a}=uF();fm(e.heading);const r=ss(ts),{data:d}=er({organizationId:n}),l=ms(),c=ss(e.ImportInputService),u=(0,de.useRef)(null),m=(0,de.useMemo)(()=>((e,n,t)=>{let i;const s=()=>i??=((e,n,t)=>{const i=e.IMPORT_COLUMNS_DEFAULT,s=new Map,o=new Map;for(const[e,n]of Object.entries(i)){const t=e.toLowerCase(),a=String(n).toLowerCase();o.has(t)||o.set(t,i[e]),s.has(a)||s.set(a,i[n])}const a=new Map,r=new Map;for(const e of n){const n=e.slug.toLowerCase(),t=e.name.toLowerCase();a.has(n)||a.set(n,e.slug),r.has(t)||r.set(t,e.slug)}const d=new Map,l=new Map,c=[];let u=0;for(const[e,n]of(t??p).entries()){const t=[];c.push(t);for(const i of n.fields){const n={slug:i.slug,name:i.name,categoryIndex:e,order:u++};t.push(n);const s=String(i.id);d.has(s)||d.set(s,n);const o=l.get(i.name.length);o?o.push(n):l.set(i.name.length,[n])}}return{defaultBySlug:s,defaultByName:o,customFieldBySlug:a,customFieldByName:r,accreditationsById:d,accreditationsByLength:l,accreditationsByCategory:c,hasAccreditations:c.length>0}})(e,n,t),o=e=>{const n=s(),t=(e=>BF.exec(e)?.[1])(e);if(t){const i=t.toLowerCase();return n.defaultBySlug.has(i)?n.defaultBySlug.get(i)??null:t.startsWith("accreditation_slot_")&&n.hasAccreditations?(e=>{const n=s(),t=WF.exec(e)?.[1];if(void 0===t)return null;const i=n.accreditationsById.get(t);if(i)return i.slug;const o=e.split(" [accreditation_slot_").at(0)??e,a=n.accreditationsByLength.get(o.length)?.find(e=>e.name===o);if(a)return a.slug;let r;for(let e=o.length-1;e<=o.length+1;e++){const t=n.accreditationsByLength.get(e);if(t)for(const e of t)r&&e.order>r.order||GF(e.name,o)&&M(e.name,o)<2&&(r=e)}return r?.slug??null})(e):n.customFieldBySlug.has(i)?n.customFieldBySlug.get(i)??null:n.customFieldByName.get(e.toLowerCase())??null}const i=e.toLowerCase();return n.defaultByName.has(i)?n.defaultByName.get(i)??null:n.customFieldByName.get(i)??null};let a=null,r=[];return{matchColumn:o,getAutomaticMappings(e){const n=e.join("\0");return n===a||(a=n,r=e.map(o)),r}}})(e.ImportInputService,e.customFields,e.additionalCategories),[e.ImportInputService,e.customFields,e.additionalCategories]),[g,h]=(0,de.useState)(!1),I=(0,de.useMemo)(()=>{try{const n={dateFormat:d.organization.dateFormat,datetimeFormat:d.organization.datetimeFormat,timeFormat:d.organization.timeFormat},t=JSON.parse(l.getItem(Iu[`${e.localStorageKeyPrefix}_FORMATS`])??"{}");return{...n,...t}}catch{return null}},[d.organization]),f=(0,de.useMemo)(()=>{const n=l.getItem(Iu[`${e.localStorageKeyPrefix}_FORMATS`]);return n?JSON.parse(n):n},[e.localStorageKeyPrefix]),x=(0,de.useMemo)(()=>{const n=c.default(I).input;let t=n.mode;if(a)try{t=l.getItem(Iu[`${e.localStorageKeyPrefix}_MODE`])??wn.Upsert}catch(e){console.debug(`LocalStorage not available: ${String(e)}`)}return{input:{...n,mode:t,tag:`${e.importTagPrefix}-csv-${Jo.c9.now().toFormat(ta)}`}}},[c,I,a,e.localStorageKeyPrefix,e.importTagPrefix]),_=ss(vF),j=(0,de.useCallback)((t,i)=>{(0,gF.parse)(t,{delimiter:i.values.input.csv.delimiter,preview:1,newline:i.values.input.csv.newline,quoteChar:i.values.input.csv.quoteChar,complete:({data:n,errors:t})=>{if(!t.length||1===t.length&&"UndetectableDelimiter"===t[0]?.code){const t=n[0]??p,s=m.getAutomaticMappings(t);let o={};try{o=JSON.parse(l.getItem(Iu[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${String(e)}`)}const a=t.map((e,n)=>void 0!==o[e]?o[e]:s[n]??null);if(i.form.change("input.mappings",a),e.skipMappingIfAllColumnsMatch){const n=new Set([...Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT),...e.customFields.map(e=>e.slug),...(e.additionalCategories??[]).flatMap(e=>e.fields.map(e=>e.slug))]);h(a.every(e=>w(e)&&n.has(e))&&qF(e.ImportInputService,{mode:i.values.input.mode,mappings:a.filter(w)}))}}}});try{i.form.change("input.presets",JSON.parse(l.getItem(Iu[`${e.localStorageKeyPrefix}_PRESETS`](n))??"[]"))}catch(e){console.debug(`LocalStorage not available: ${String(e)}`)}},[m,l,n,a,e.ImportInputService,e.importTagPrefix,e.localStorageKeyPrefix,e.skipMappingIfAllColumnsMatch]);return(0,i.jsx)(Ig.Provider,{value:{designSystem:pg},children:(0,i.jsx)(Nx,{category:o("nouvel_import_48306"),color:"dark",fallbackClosePath:e.closePath,heading:e.heading,children:(0,i.jsx)(kx,{ref:u,children:(0,i.jsxs)(fy,{containerRef:u,initialValues:x,isEdit:!1,summaryStep:(0,i.jsx)(UF,{returnLink:e.returnLink}),onSubmit:async({input:i})=>{if(!qF(e.ImportInputService,i))return{[Ql.Ym]:o("you_have_not_ma_46806",HF(e.ImportInputService,r,i))};(t=>{const i=t.csv.file;if(!i)throw new Error("No file in input!");(0,gF.parse)(i,{delimiter:t.csv.delimiter,preview:1,newline:t.csv.newline,quoteChar:t.csv.quoteChar,complete:({data:n,errors:i})=>{if(!i.length)try{const i=n[0]??p,s=m.getAutomaticMappings(i),o=JSON.parse(l.getItem(Iu[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}"),a={};for(const[e,n]of t.mappings.entries()){const t=i[e];void 0!==t&&(n?a[t]=n:delete o[t],w(s[e])&&!a[t]&&(a[t]=null))}l.setItem(Iu[`${e.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...o,...a}))}catch(e){console.debug(`LocalStorage not available: ${String(e)}`)}}});try{const i=JSON.parse(l.getItem(Iu[`${e.localStorageKeyPrefix}_PRESETS`](n))??"[]");l.setItem(Iu[`${e.localStorageKeyPrefix}_PRESETS`](n),JSON.stringify([...new Map([...i,...t.presets].map(e=>[e.customFieldId,e])).values()])),l.setItem(Iu[`${e.localStorageKeyPrefix}_FORMATS`],JSON.stringify(t.csv.formats?Object.fromEntries(Object.entries(t.csv.formats).filter(([e,n])=>w(n))):{})),a&&l.setItem(Iu[`${e.localStorageKeyPrefix}_MODE`],t.mode)}catch(e){console.debug(`LocalStorage not available: ${String(e)}`)}})(i);const d=(e=>{const n={...e.csv};return delete n.file,{...e,csv:n}})(i);try{const{jobId:i}=await e.mutate({organizationId:n,eventId:t,delegationId:s,input:d});e.checkImport(i,n,t)}catch{}},children:[(0,i.jsx)(Iy,{actions:n=>(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{disabled:!VF(n.form),onClick:n.handleSubmit,children:o("suivant_donn_08625")}),f&&(0,i.jsx)(yc,{color:"invisible-gray",onClick:()=>{l.removeItem(Iu[`${e.localStorageKeyPrefix}_FORMATS`]),window.location.reload()},children:o("clear_saved_set_61259")})]}),heading:o("choix_du_fichie_30517"),render:n=>(0,i.jsx)(AF,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,customFields:e.customFields,formRenderProps:n,localStorageKeyPrefix:e.localStorageKeyPrefix,sampleFilename:e.sampleFilename,onChange:j}),schema:_.settingsStepSchema()}),!g&&(0,i.jsx)(Iy,{actions:e=>(0,i.jsx)(yc,{type:"submit",onClick:e.handleSubmit,children:o("importer_90688")}),heading:o("donn_es_impor_12371"),render:n=>(0,i.jsx)(LF,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,customFields:e.customFields,formRenderProps:n,importTagPrefix:e.importTagPrefix,isTagInputDisabled:e.isTagInputDisabled,localStorageKeyPrefix:e.localStorageKeyPrefix}),schema:c.mappingStepSchema()})]})})})})},ZF=({accreditations:e,accreditationsProfiles:n,closePath:t,customFields:s})=>{const{params:{organizationId:o,eventId:a},translate:r}=fc(),d=ss(Wg),{mutate:l}=function(e={}){return ds("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:c}=Sy(),u=(0,de.useMemo)(()=>((e,n)=>n.map(n=>({id:n.id,name:n.name,fields:n.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:qp(e,t,n.name,{accreditation:{includeNameAtEnd:!0}})}))})))(d,e).concat((e=>Object.values(x(e,e=>e.accreditationProfileCategory.id)).map(e=>({id:e[0].accreditationProfileCategory.id,name:e[0].accreditationProfileCategory.name,fields:e.map(e=>({id:e.id,slug:`accreditation_profile_${e.id}`,name:e.name}))})))(n)),[e,n,d]);return(0,i.jsx)(cF,{alertDescriptionKey:"to_add_a_member_56912",createCard:{heading:r("ajouter_un_memb_78965"),description:r("cr_e_un_nouveau_57873")},updateCard:{heading:r("mettre_jour_d_10088"),description:r("aucun_membre_se_13414")},upsertCard:{heading:r("ajouter_et_mett_05009"),description:r("si_plusieurs_me_88818")},children:(0,i.jsx)(YF,{ImportInputService:bF,additionalCategories:u,checkImport:c,closePath:t,customFields:s,heading:r("import_de_membr_48618"),importTagPrefix:"volunteers",localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:l,returnLink:(0,i.jsx)(Ug,{to:a?Wo.VOLUNTEERS(o,a):Ms.COMMUNITY_USERS({organizationId:o}),children:r("revenir_aux_mem_33379")})})})},KF=()=>{const{params:{organizationId:e}}=fc(),{data:n,loader:t}=kd({organizationId:e,variety:Ke.UserInfo});return t||(0,i.jsx)(ZF,{accreditations:p,accreditationsProfiles:p,closePath:Ms.COMMUNITY_USERS({organizationId:e}),customFields:n.organization.customFields.nodes})},XF=()=>{const{params:{organizationId:e,eventId:n}}=fc(),{data:t,loader:s}=kd({organizationId:e,variety:Ke.UserInfo,eventId:n});return s||(0,i.jsx)(ZF,{accreditations:t.organization.event?.accreditations.nodes??p,accreditationsProfiles:t.organization.event?.accreditationsProfiles.nodes??p,closePath:Wo.VOLUNTEERS(e,n),customFields:t.organization.customFields.nodes})};function QF(e){switch(e){case Rt.Active:return{color:"success",leftIcon:"play"};case Rt.Error:return{color:"error",leftIcon:"triangle-exclamation"};case Rt.Paused:return{color:"warning",leftIcon:"pause"};default:return Ic()}}const JF=[Xe.CanLeadersAddMembers,Xe.CanLeadersDeleteMembers,Xe.CanLeadersDuplicateMembers,Xe.CanLeadersEditColumns,Xe.CanLeadersEditCustomFields,Xe.CanLeadersEditMembers,Xe.CanLeadersImportMembers,Xe.CanLeadersSeeHiddenAccreditationsSlots];function eN(e,n){switch(e){case Dt.VolunteersSegment:return n===Et.SetCustomField||n===Et.AddAccreditations||n===Et.DeleteAccreditations;case Dt.DelegationsSegment:return n===Et.SetCustomField||n===Et.LockDelegation||n===Et.UnlockDelegation||n===Et.AddDelegationPermissions||n===Et.DeleteDelegationPermissions;case Dt.Assigned:case Dt.FormSubmit:return!1;default:return Ic()}}function nN(e){switch(e){case wt.EveryMinute:return 1;case wt.Every2Minutes:return 2;case wt.Every5Minutes:return 5;case wt.Every10Minutes:return 10;default:return Ic()}}var tN;const iN=[zt.Admins,zt.DelegationsCategoriesLeaders,zt.DelegationsLeaders,zt.UsersInfosIds],sN=Hi.filter(e=>e!==zt.Admins&&e!==zt.DelegationsCategoriesLeaders),oN=e=>(e.trigger===Dt.VolunteersSegment||e.trigger===Dt.DelegationsSegment)&&e.action===Et.SendCampaign;let aN=class extends ju{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??Rt.Active,frequency:e?.frequency??wt.Every10Minutes,trigger:e?.trigger??Dt.VolunteersSegment,action:e?.action??Et.SetCustomField,data:(0,ky.A)({recipients:zt.View},e?.data??{}),onExit:e?.onExit??$t.Revert}}workflowInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),state:Jl.Yj().required(this.t("le_statut_est_r_13164")).oneOf(Yi,this.t("le_statut_est_r_13164")),action:Jl.Yj().required(this.t("l_action_est_re_08934")).oneOf(Bi,this.t("l_action_est_re_08934")),trigger:Jl.Yj().required(this.t("le_d_clencheur_32555")).oneOf(Zi,this.t("le_d_clencheur_32555")),data:Jl.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==Dt.Assigned||f(this.parent.data.positionsCategoriesIds)||f(this.parent.data.positionsIds)||f(this.parent.data.positionsSlotsIds)||f(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==Dt.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("delegations-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==Dt.DelegationsSegment||Number.isInteger(this.parent.data.delegationsSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==Dt.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return!oN(this.parent)||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return!oN(this.parent)||(this.parent.trigger===Dt.DelegationsSegment?iN:sN).includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return!oN(this.parent)||this.parent.data.recipients!==zt.UsersInfosIds||f(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return(this.parent.trigger!==Dt.VolunteersSegment&&this.parent.trigger!==Dt.DelegationsSegment||this.parent.action!==Et.SetCustomField)&&(this.parent.trigger!==Dt.FormSubmit||this.parent.action!==Et.CreateDelegation)||Number.isInteger(this.parent.data.customFieldId)}).test("duplicate-member-custom-fields-valid",this.t("le_champ_lier_69891"),function(){return this.parent.action!==Et.DuplicateMember||(this.parent.data.customFields||[]).every(e=>!0!==e.fromField||w(e.value))}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger===Dt.Assigned?f(this.parent.data.accreditationsSlotsIds):this.parent.trigger!==Dt.VolunteersSegment||this.parent.action!==Et.AddAccreditations&&this.parent.action!==Et.DeleteAccreditations||f(this.parent.data.accreditationsSlotsIds)||"number"==typeof this.parent.data.accreditationProfileId}).test("positions-slots-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==Dt.VolunteersSegment||this.parent.action!==Et.AddPositions&&this.parent.action!==Et.DeletePositions||f(this.parent.data.positionsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==Dt.FormSubmit||this.parent.action!==Et.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==Dt.VolunteersSegment||this.parent.action!==Et.AddEvent||Number.isInteger(this.parent.data.eventId)}).test("permissions-valid",this.t("les_permissions_82998"),function(){return this.parent.trigger!==Dt.DelegationsSegment||this.parent.action!==Et.AddDelegationPermissions&&this.parent.action!==Et.DeleteDelegationPermissions||f(this.parent.data.permissions)&&this.parent.data.permissions.every(e=>JF.includes(e))}),onExit:Jl.Yj().required(this.t("l_action_de_fin_64764")).oneOf(Gi,this.t("l_action_de_fin_64764"))})}};aN=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(tN=void 0!==ts&&ts)?tN:Object])],aN);const rN=e=>(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(UI,{color:"gray",icon:e.icon}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:e.children})]}),dN=e=>{const{translate:n,params:{eventId:t}}=fc(),{hasFeature:s}=Yy(),{event:o}=Ly(),a=(!o||o.useCampaigns)&&(e.workflow.trigger===Dt.VolunteersSegment||e.workflow.trigger===Dt.DelegationsSegment),r=e.workflow.trigger===Dt.VolunteersSegment||e.workflow.trigger===Dt.DelegationsSegment,d=e.workflow.trigger===Dt.DelegationsSegment,l=!!t&&s(In.Accreditation)&&(o?.useAccreditations??!1)&&(e.workflow.trigger===Dt.Assigned||e.workflow.trigger===Dt.VolunteersSegment),c=!!t&&s(In.Accreditation)&&(o?.useAccreditations??!1)&&e.workflow.trigger===Dt.VolunteersSegment,u=!!t&&(o?.usePositions??!1)&&e.workflow.trigger===Dt.VolunteersSegment,m=s(In.Delegation)&&e.workflow.trigger===Dt.FormSubmit,g=!t&&e.workflow.trigger===Dt.VolunteersSegment,h=!!t&&e.workflow.trigger===Dt.VolunteersSegment;return(0,i.jsx)(rN,{category:n("action_s_lectio_18617"),icon:"lasso-sparkles",title:n("alors_automatiq_16268"),children:(0,i.jsxs)(Kx,{isSearchVisible:!0,name:"workflow.action",placeholder:n("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[a&&(0,i.jsx)("option",{value:Et.SendCampaign,children:n("SendCampaign")}),r&&(0,i.jsx)("option",{value:Et.SetCustomField,children:n("SetCustomField")}),l&&(0,i.jsx)("option",{value:Et.AddAccreditations,children:n("AddAccreditations")}),c&&(0,i.jsx)("option",{value:Et.DeleteAccreditations,children:n("DeleteAccreditations")}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("option",{value:Et.AddPositions,children:n("AddPositions")}),(0,i.jsx)("option",{value:Et.DeletePositions,children:n("DeletePositions")})]}),m&&(0,i.jsx)("option",{value:Et.CreateDelegation,children:n("cr_er_une_d_l_g_23035")}),g&&(0,i.jsx)("option",{value:Et.AddEvent,children:n("AddEvent")}),h&&(0,i.jsx)("option",{value:Et.DuplicateMember,children:n("DuplicateMember")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("option",{value:Et.LockDelegation,children:n("LockDelegation")}),(0,i.jsx)("option",{value:Et.UnlockDelegation,children:n("UnlockDelegation")}),(0,i.jsx)("option",{value:Et.AddDelegationPermissions,children:n("AddDelegationPermissions")}),(0,i.jsx)("option",{value:Et.DeleteDelegationPermissions,children:n("DeleteDelegationPermissions")})]})]})})},lN=()=>{const{translate:e,params:{eventId:n}}=fc(),{data:t}=rs("query WorkflowAccreditationsProfiles($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\n id\n name\n }\n }\n }\n}\n",{eventId:n},[],void 0),s=(0,de.useMemo)(()=>yA(t.event?.accreditationsProfilesCategories??[]),[t.event]);return(0,i.jsx)(Kx,{isSearchVisible:!0,label:e("profil_d_accr_d_02274"),multiple:!1,name:"workflow.data.accreditationProfileId",placeholder:e("s_lectionner_un_45763"),children:s})},cN=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),{data:o}=gr({eventId:t,loadIsBlocked:!1}),a=(0,de.useMemo)(()=>Yp(s,o.event?.accreditationsCategories??[]),[o.event,s]);return(0,i.jsxs)(rN,{category:n("liste_des_accr_02647"),icon:"badge-check",title:n("les_accr_ditati_19289"),children:[(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.isProfileVisible?n("accr_ditations_39450"):void 0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",placeholder:"Sélectionner des accréditations",children:a}),e.isProfileVisible&&(0,i.jsx)(lN,{})]})},uN=()=>{const{translate:e,params:{organizationId:n}}=fc(),{data:t}=rs("query WorkflowEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:n},[],undefined);return(0,i.jsx)(rN,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(Kx,{isSearchVisible:!0,name:"workflow.data.eventId",placeholder:e("choisir_un_v_n_58535"),children:(t.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},mN=()=>{const{translate:e,params:{eventId:n}}=fc(),t=ss(Nh),{data:s}=rs(Aa,{eventId:n},[],undefined);const o=(0,de.useMemo)(()=>Zp(t,s.event?.positionsCategories??[]),[s.event,t]);return(0,i.jsx)(rN,{category:e("liste_des_missi_82050"),icon:"sitemap",title:e("les_cr_neaux_su_85944"),children:(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:e("choisir_un_cr_n_50945"),children:o})})},gN=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o,a]=Dg(""),r=e.workflow.trigger===Dt.DelegationsSegment,{usersInfosOptions:d,isLoading:l}=mC({organizationId:t,eventId:null,hasSelected:f(e.workflow.data.usersInfosIds),nameDebounced:o,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(rN,{category:n("destinataires_19592"),icon:"users",title:n("aux_membres_sui_99877"),children:[(0,i.jsxs)(Kx,{name:"workflow.data.recipients",children:[!r&&(0,i.jsx)("option",{value:zt.View,children:n("aux_membres_de_71046")}),(0,i.jsx)("option",{value:zt.DelegationsLeaders,children:n("aux_responsable_38147")}),r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("option",{value:zt.DelegationsCategoriesLeaders,children:n("aux_responsable_63918")}),(0,i.jsx)("option",{value:zt.Admins,children:n("aux_administrat_40273")})]}):(0,i.jsx)("option",{value:zt.PositionsLeaders,children:n("aux_responsable_85620")}),(0,i.jsx)("option",{value:zt.UsersInfosIds,children:n("_certains_memb_91094")})]}),e.workflow.data.recipients===zt.UsersInfosIds&&(0,i.jsx)(Kx,{isSearchLoading:l,isSearchVisible:!0,label:n("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",name:s,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:a}),children:d})]})},hN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{data:o}=rs("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:t,eventId:s,level:s?kn.Event:kn.Organization,formId:e.workflow.data.formId},[],undefined);const a=(0,de.useMemo)(()=>o.organization?.delegations.nodes??[],[o.organization]),r=(0,de.useMemo)(()=>(o.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===_n.Text?[e.customField]:[]),[o.organization]);return(0,i.jsxs)(rN,{category:n("liste_des_d_l_g_86270"),icon:"users",title:n("la_d_l_gation_s_46776"),children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("d_l_gation_ut_74409"),name:"workflow.data.delegationId",placeholder:n("choisir_une_d_l_57897"),children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("champ_utilise_04526"),name:"workflow.data.customFieldId",placeholder:n("choisir_un_cham_05690"),children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},pN=e=>{const{translate:n}=fc();return(0,i.jsx)(rN,{category:n("liste_des_droit_83212"),icon:"user-shield",title:(e.workflow.action,Et.AddDelegationPermissions,n("les_droits_suiv_96404")),children:(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.permissions",placeholder:n("choisir_des_dro_64167"),children:JF.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))})})},IN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{data:o}=rs("query WorkflowDelegationsSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, segmentType: Delegations, eventId: $eventId) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:s,level:s?kn.Event:kn.Organization},[],undefined);return(0,i.jsx)(rN,{category:n("liste_des_d_l_g_86270"),icon:"people-group",title:n("une_vue_parmi_l_98342"),children:(0,i.jsx)(Kx,{isSearchVisible:!0,name:"workflow.data.delegationsSegmentId",placeholder:n("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))})})},fN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{data:o}=Ul({organizationId:t,eventId:s,variety:Ke.UserInfo}),a=(0,de.useMemo)(()=>o.organization?.customFields.nodes??[],[o.organization]),r=(0,de.useMemo)(()=>rA(a.filter(e=>e.fieldType===_n.Text)),[a]);return(0,i.jsx)(rN,{category:n("param_tres_du_n_85818"),icon:"user",title:n("on_duplique_le_59761"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Kx,{hint:n("si_le_champ_ne_73587"),isSearchVisible:!0,label:n("e_mail_du_nouve_23523"),name:"workflow.data.emailSourceCustomFieldId",children:[(0,i.jsx)("option",{value:"-1",children:n("garder_l_e_mail_42832")}),r]}),(0,i.jsx)(cA,{canLinkToField:!0,change:e.change,customFields:a,name:"workflow.data.customFields",values:e.workflow.data.customFields||[]})]})})},xN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{data:o}=rs("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:t,eventId:s,level:s?kn.Event:kn.Organization},[],undefined);return(0,i.jsx)(rN,{category:n("liste_des_formu_69259"),icon:"file-lines",title:n("un_formulaire_p_61128"),children:(0,i.jsx)(Kx,{isSearchVisible:!0,name:"workflow.data.formId",placeholder:n("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))})})};function _N(e,n){switch(n){case Et.SetCustomField:return e("remettre_l_anci_37071");case Et.AddAccreditations:return e("supprimer_les_a_39948");case Et.DeleteAccreditations:return e("ajouter_les_acc_34000");case Et.AddPositions:return e("d_saffecter_des_98543");case Et.DeletePositions:return e("r_affecter_aux_53313");case Et.LockDelegation:return e("UnlockDelegation");case Et.UnlockDelegation:return e("LockDelegation");case Et.AddDelegationPermissions:return e("retirer_les_dro_34459");case Et.DeleteDelegationPermissions:return e("remettre_les_dr_74368");default:return""}}function jN(e,n){return n===Dt.DelegationsSegment?e("quand_la_d_l_ga_62267"):e("quand_le_membre_90818")}const vN=e=>{const{translate:n}=fc();return(0,i.jsx)(rN,{category:n("finalisation_94065"),icon:"hand-sparkles",title:jN(n,e.workflow.trigger),children:(0,i.jsxs)(Kx,{name:"workflow.onExit",placeholder:n("choisir_une_act_51814"),children:[(0,i.jsx)("option",{value:$t.Revert,children:_N(n,e.workflow.action)}),(0,i.jsx)("option",{value:$t.Keep,children:n("ne_rien_faire_76456")})]})})},SN=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Nh),{data:o}=rs("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:t},[],undefined);const a=(0,de.useMemo)(()=>(0,Tg.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o.event]),r=(0,de.useMemo)(()=>(0,Tg.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Tg.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]),d=(0,de.useMemo)(()=>(o.event?.positionsCategories??[]).flatMap(e=>(0,Tg.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Tg.A)(e.slots,e=>e.range.start.toMillis()).map(n=>{const t=Gh(s,n,e.name,{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{value:n.id,children:t},n.id)})},e.id))),[o.event]),l=(0,de.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)(rN,{category:n("liste_des_missi_82050"),icon:"sitemap",title:n("une_mission_par_94044"),children:[(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_18005"),multiple:!0,name:"workflow.data.positionsCategoriesIds",placeholder:n("choisir_une_cat_82874"),state:e.isEdit?"disabled":"active",children:a}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_40348"),multiple:!0,name:"workflow.data.positionsIds",placeholder:n("choisir_une_mis_90627"),state:e.isEdit?"disabled":"active",children:r}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_82271"),multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:n("choisir_un_cr_n_50945"),state:e.isEdit?"disabled":"active",children:d}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("est_affect_u_31860"),multiple:!0,name:"workflow.data.positionsSegmentsIds",placeholder:n("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:l})]})},yN=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{data:s}=rs("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:n,eventId:t,level:t?kn.Event:kn.Organization},[],undefined);return(0,i.jsx)(rN,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(Kx,{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))})})},CN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{data:o}=Ul({organizationId:t,eventId:s,variety:e.workflow.trigger===Dt.DelegationsSegment?Ke.Delegation:Ke.UserInfo}),a=(0,de.useMemo)(()=>o.organization?.customFields.nodes??[],[o.organization]),r=(0,de.useMemo)(()=>rA(a),[a]),d=a.find(n=>n.id===e.workflow.data.customFieldId);return(0,i.jsxs)(rN,{category:n("liste_des_champ_94862"),icon:"text",title:n("le_champ_suivan_27303"),children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("CustomField"),name:"workflow.data.customFieldId",placeholder:n("choisir_un_cham_67587"),children:r}),d&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("nouvelle_valeur_39039",d.name)}),(0,i.jsx)(nA,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:d,delegationsSpaceLayouts:[],forms:[],name:"workflow.data.customFieldValue",slug:d.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue}),Ib(d)&&(0,i.jsx)(Bx,{name:"workflow.data.addValues",children:n("ajouter_les_val_22996")})]})]})},bN=e=>{const{translate:n,params:{eventId:t}}=fc(),{hasFeature:s}=Yy(),{event:o}=Ly(),a=!!t&&(o?.usePositions??!1)&&(o?.useAccreditations??!1)&&s(In.Accreditation),r=(o?.useForms??!0)&&(o?.useDelegations??!0)&&s(In.Delegation),d=(o?.useDelegations??!0)&&s(In.Delegation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"workflow.trigger",onChange:n=>{n===Dt.Assigned?e.change("workflow.action",Et.AddAccreditations):n===Dt.FormSubmit?e.change("workflow.action",Et.CreateDelegation):e.change("workflow.action",Et.SetCustomField),e.change("workflow.data.customFieldId",void 0),e.change("workflow.data.customFieldValue",void 0),e.change("workflow.data.recipients",n===Dt.DelegationsSegment?zt.DelegationsLeaders:zt.View)}}),(0,i.jsx)(rN,{category:n("initialisation_38640"),icon:"hand-sparkles",title:n("quand_18117"),children:(0,i.jsxs)(Kx,{isSearchVisible:!0,name:"workflow.trigger",placeholder:n("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[a&&(0,i.jsx)("option",{value:Dt.Assigned,children:n("un_membre_est_a_48435")}),r&&(0,i.jsx)("option",{value:Dt.FormSubmit,children:n("FormSubmit")}),(0,i.jsx)("option",{value:Dt.VolunteersSegment,children:n("VolunteersSegment")}),d&&(0,i.jsx)("option",{value:Dt.DelegationsSegment,children:n("DelegationsSegment")})]})})]})},AN=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{data:o}=rs("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:t,eventId:s,level:s?kn.Event:kn.Organization},[],undefined);return(0,i.jsx)(rN,{category:n("liste_des_membr_89037"),icon:"user-group",title:n("une_vue_parmi_l_98342"),children:(0,i.jsx)(Kx,{isSearchVisible:!0,name:"workflow.data.volunteersSegmentId",placeholder:n("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))})})},EN=()=>(0,i.jsx)(Xl,{height:32,justify:"center",width:1,children:(0,i.jsx)(Zr,{css:{borderRight:"1px solid $gray200"},height:1})}),wN=e=>{const{translate:n}=fc(),t=e.workflow.data,s=e.workflow.trigger===Dt.VolunteersSegment,o=e.workflow.trigger===Dt.DelegationsSegment,a=e.workflow.trigger===Dt.Assigned,r=e.workflow.trigger===Dt.FormSubmit,d=e.workflow.trigger===Dt.VolunteersSegment&&"number"==typeof t.volunteersSegmentId||e.workflow.trigger===Dt.Assigned&&(f(t.positionsCategoriesIds)||f(t.positionsIds)||f(t.positionsSlotsIds)||f(t.positionsSegmentsIds))||e.workflow.trigger===Dt.FormSubmit&&"number"==typeof t.formId||e.workflow.trigger===Dt.DelegationsSegment&&"number"==typeof t.delegationsSegmentId,l=d&&(e.workflow.trigger===Dt.VolunteersSegment||e.workflow.trigger===Dt.DelegationsSegment)&&e.workflow.action===Et.SendCampaign,c=l&&"number"==typeof e.workflow.data.campaignId,u=d&&(e.workflow.trigger===Dt.VolunteersSegment||e.workflow.trigger===Dt.DelegationsSegment)&&e.workflow.action===Et.SetCustomField,m=d&&e.workflow.action===Et.AddAccreditations,g=d&&e.workflow.action===Et.DeleteAccreditations,h=d&&e.workflow.action===Et.AddPositions,p=d&&e.workflow.action===Et.DeletePositions,I=d&&e.workflow.action===Et.CreateDelegation,x=d&&e.workflow.action===Et.AddEvent,_=d&&e.workflow.action===Et.DuplicateMember,j=d&&(e.workflow.action===Et.LockDelegation||e.workflow.action===Et.UnlockDelegation),v=d&&(e.workflow.action===Et.AddDelegationPermissions||e.workflow.action===Et.DeleteDelegationPermissions),S=e.workflow.trigger===Dt.VolunteersSegment&&(u||m||g||h||p)||e.workflow.trigger===Dt.DelegationsSegment&&(u||j||v),y=j||v||l||u||m||h||p||I||x;return(0,i.jsxs)(Xl,{align:"center",direction:"column",children:[(0,i.jsx)(Mc,{}),e.workflow.state===Rt.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{alertStyle:"warning",width:"min($container, 100%)",children:[(0,i.jsx)(zc,{children:n("une_erreur_est_38715")}),(0,i.jsx)(Oc,{children:e.workflow.data.errorMessage})]}),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(Xl,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("d_but_41840")})}),(0,i.jsx)(EN,{}),(0,i.jsx)(bN,{change:e.change,isEdit:e.isEdit,workflow:e.workflow}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(AN,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(IN,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(SN,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(xN,{isEdit:e.isEdit})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(dN,{isEdit:e.isEdit,workflow:e.workflow})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(yN,{})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(gN,{workflow:e.workflow})]}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(CN,{change:e.change,workflow:e.workflow})]}),(m||g)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(cN,{isProfileVisible:e.workflow.trigger===Dt.VolunteersSegment})]}),(h||p)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(mN,{})]}),I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(hN,{workflow:e.workflow})]}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(uN,{})]}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(fN,{change:e.change,workflow:e.workflow})]}),v&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(pN,{workflow:e.workflow})]}),S&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(vN,{workflow:e.workflow})]}),y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EN,{}),(0,i.jsx)(Xl,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("fin_60104")})})]})]})},$N=(0,de.forwardRef)((e,n)=>{const{history:t,translate:s,params:{organizationId:o,eventId:a}}=fc(),{user:r}=ps(),d=zg(),[l,c]=(0,de.useState)(!1),u=(0,de.useCallback)(()=>{JSON.stringify(e.workflow)===e.initialValuesString?t.goBack(Vv.WORKFLOWS({organizationId:o,eventId:a})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nx,{button:(0,i.jsx)(lC,{permissions:nC.WORKFLOW_EDIT,children:(0,i.jsx)(yc,{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)(Xl,{height:1,children:[(0,i.jsxs)(Xl,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:s("param_tres_de_l_25166")}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(pu,{label:s("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(Qy,{label:s("State"),name:"workflow.state",children:d(Yi.filter(e=>e!==Rt.Error))}),(0,i.jsxs)(Qy,{label:s("Frequency"),name:"workflow.frequency",state:Fg(r.email)?void 0:"disabled",children:[(0,i.jsx)("option",{value:wt.Every10Minutes,children:s(wt.Every10Minutes)}),(0,i.jsx)("option",{value:wt.Every5Minutes,children:s(wt.Every5Minutes)}),(0,i.jsx)("option",{value:wt.Every2Minutes,children:s(wt.Every2Minutes)}),(0,i.jsx)("option",{value:wt.EveryMinute,children:s(wt.EveryMinute)})]})]})]}),(0,i.jsx)(Xl,{ref:n,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(wN,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(ER,{fallbackPath:Vv.WORKFLOWS({organizationId:o,eventId:a}),isOpen:l,onClose:()=>c(!1)})]})});$N.displayName="UpdateWorkflowForm";const TN=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{showNotification:a}=Sy(),r=(0,de.useRef)(null),d=ss(ec),l=ss(aN),[c,u]=(0,de.useState)(""),m=(0,de.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.name??""):t("cr_ation_d_une_01202"),[e.initialValues]);return fm(m),(0,de.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(Fc,{customErrorRef:r,height:1,initialValues:{workflow:e.initialValues},render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)($N,{ref:r,category:m,change:n.change,handleSubmit:t,hasBeenExecuted:e.hasBeenExecuted,initialValuesString:c,isEdit:e.isEdit,name:e.initialValues.name,submitting:s,workflow:o.workflow}),validate:e=>d.validateForForm(l.workflowInputSchema())(e.workflow),width:1,onSubmit:async i=>{await e.mutate(i.workflow),a(e.isEdit?t("l_automatisatio_62036"):t("l_automatisatio_19124")),n.push(Vv.WORKFLOWS({organizationId:s,eventId:o}))}})},zN=()=>{const{params:{organizationId:e,eventId:n}}=fc(),t=ss(aN),{mutate:s}=function(e={}){return ds("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,de.useMemo)(()=>t.workflowInputDefault(),[]);return(0,i.jsx)(TN,{hasBeenExecuted:!1,initialValues:o,isEdit:!1,mutate:t=>s({organizationId:e,eventId:n,workflow:t})})},ON=()=>{const{params:{organizationId:e,eventId:n,workflowId:t}}=fc(),s=ss(aN),{mutate:o}=function(e={}){return ds("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:a,loader:r}=rs("query WorkflowToEdit($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 onExit\n\n data {\n accreditationProfileId\n accreditationsSlotsIds\n addValues\n campaignId\n customFieldId\n customFieldValue\n customFields\n delegationId\n delegationsSegmentId\n emailSourceCustomFieldId\n errorMessage\n eventId\n formId\n permissions\n positionsCategoriesIds\n positionsIds\n positionsSegmentsIds\n positionsSlotsIds\n recipients\n usersInfosIds\n volunteersSegmentId\n }\n }\n }\n}\n",{organizationId:e,workflowId:t},[],undefined);const d=(0,de.useMemo)(()=>s.workflowInputDefault(a.organization?.workflow),[a.organization]);return r||(0,i.jsx)(TN,{hasBeenExecuted:a.organization?.workflow.hasBeenExecuted,initialValues:d,isEdit:!0,mutate:i=>o({organizationId:e,eventId:n,workflowId:t,workflow:i})})},RN=(0,de.createContext)({});function DN(){return(0,de.useContext)(RN)}var MN;let PN=class extends ju{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,n){return{name:n?.name??"",segmentType:e}}};PN=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(MN=void 0!==ts&&ts)?MN:Object])],PN);const kN=e=>{const n=os(),{eventId:t,organizationId:s,segmentType:o,reloadSegments:a}=DN(),{mutate:r}=function(e={}){return ds("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:d}=function(e={}){return ds("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)}(),l=ss(PN);return(0,i.jsx)(mA,{buttonText:e.isEdit?n("mettre_jour_l_05529"):n("cr_er_le_dossie_71150"),icon:"text",initialValues:{segmentFolder:l.segmentFolderInputDefault(o,e.segmentFolder)},size:"md",subtitle:n("classez_vos_vue_39895"),title:n("nom_du_dossier_95781"),onClose:e.onClose,onSubmit:async n=>{e.isEdit&&e.segmentFolder?await d({organizationId:s,eventId:t,segmentFolderId:e.segmentFolder.id,name:n.segmentFolder.name}):await r({organizationId:s,eventId:t,segmentFolder:n.segmentFolder}),a(),e.onClose()},children:(0,i.jsx)(pu,{label:n("nom_du_dossier_95781"),name:"segmentFolder.name"})})},FN=e=>{const n={type:"segment",segmentId:e.segment.id},{setNodeRef:t,style:s,handleProps:o}=pI(`s-${e.segment.id}`,n),[a,r]=(0,de.useState)(!1),d=(0,de.useCallback)(n=>{e.setSegmentsFolders((0,mI.jM)(t=>{const i=t[e.segmentFolderIndex]?.segments[e.index];i&&(i.name=n)}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),l=(0,de.useCallback)(()=>e.setSegmentsFolders(n=>n.map(n=>({...n,segments:n.segments.filter(n=>n.id!==e.segment.id)}))),[e.segment,e.setSegmentsFolders]);return(0,i.jsxs)(Xl,{ref:t,css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",align:"center",style:s,children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"pointer"},...o,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),a?(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{value:e.segment.name,onChange:d})}):(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(yc,{color:"white",leftIcon:a?"check":"pen",size:"sm",onClick:()=>r(!a)}),(0,i.jsx)(yc,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:l})]})},NN=e=>{const[n,t]=(0,de.useState)(!1),s={type:"segmentFolder",segmentFolderId:e.segmentFolder.id},{setNodeRef:o,style:a,handleProps:r}=pI(`sf-${e.segmentFolder.id}`,s),d={type:"segmentFolderSegments",segmentFolderId:e.segmentFolder.id},{setNodeRef:l}=(0,jI.zM)({id:`drop-sf-${e.segmentFolder.id}`,data:d}),c=(0,de.useCallback)(n=>{e.setSegmentsFolders((0,mI.jM)(t=>{const i=t[e.index];i&&(i.name=n)}))},[e.index,e.setSegmentsFolders]);return(0,i.jsxs)(Xl,{ref:o,css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm"},direction:"column",style:a,children:[(0,i.jsxs)(Xl,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...r,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),n?(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{value:e.segmentFolder.name,onChange:c})}):(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(yc,{color:"white",leftIcon:n?"check":"pen",size:"sm",onClick:()=>t(!n)}),(0,i.jsx)(yc,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(n=>n.filter(n=>n!==e.segmentFolder))}})]}),(0,i.jsx)(gI.gB,{items:e.segmentFolder.segments.map(e=>`s-${e.id}`),strategy:gI._G,children:(0,i.jsx)(Xl,{ref:l,css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$4"},direction:"column",gap:"2",children:e.segmentFolder.segments.map((n,t)=>(0,i.jsx)(FN,{canDelete:e.segmentFolder.segments.length>1,index:t,segment:n,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},n.id))})})]})},LN=[vI.FN,vI.Mk];function UN(e){return e?.data.current}function VN(e,n){return"segment"===n.type?e.findIndex(e=>e.segments.some(e=>e.id===n.segmentId)):e.findIndex(e=>e.id===n.segmentFolderId)}const BN=e=>{const n=os(),{segmentsFolders:t}=DN(),{mutate:s,isLoading:o}=function(e={}){return ds("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)}(),[a,r]=(0,de.useState)(t.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),d=(0,de.useCallback)(async()=>{await s({organizationId:e.organizationId,eventId:e.eventId,segmentType:e.segmentType,segmentsFolders:a.map(e=>({...e,id:!e.id||e.id<0?void 0:e.id}))}),e.onClose(),e.onSuccess()},[e.organizationId,e.eventId,e.segmentType,a]),l=function(e,n){const t=(0,jI.FR)((0,jI.MS)(jI.AN,{activationConstraint:{distance:4}}),(0,jI.MS)(jI.uN,{coordinateGetter:gI.JR})),i=(0,de.useRef)(null),s=(0,de.useCallback)(n=>{const t=UN(n.active);if("segmentFolder"===t?.type)return(0,jI.fp)({...n,droppableContainers:n.droppableContainers.filter(e=>"segmentFolder"===UN(e)?.type)});const i=n.droppableContainers.filter(e=>"segment"===UN(e)?.type),[s]=(0,jI.TT)({...n,droppableContainers:n.droppableContainers.filter(e=>"segmentFolderSegments"===UN(e)?.type)});if(s){const t=VN(e,UN(n.droppableContainers.find(e=>e.id===s.id))),o=i.filter(n=>e[t]?.segments.some(e=>e.id===UN(n).segmentId));return o.length>0?(0,jI.fp)({...n,droppableContainers:o}):[s]}return(0,jI.fp)({...n,droppableContainers:i})},[e]),o=(0,de.useCallback)(()=>{i.current=e},[e]),a=(0,de.useCallback)(({active:e,over:t})=>{const i=UN(e),s=UN(t);"segment"===i?.type&&s&&"segmentFolder"!==s.type&&n((0,mI.jM)(e=>{const n=VN(e,i),t=VN(e,s),o=e[n],a=e[t];if(o&&a&&n!==t){const e=o.segments.findIndex(e=>e.id===i.segmentId),[n]=-1===e?[]:o.segments.splice(e,1);if(n){const e="segment"===s.type?a.segments.findIndex(e=>e.id===s.segmentId):-1;a.segments.splice(-1===e?a.segments.length:e,0,n)}}}))},[n]),r=(0,de.useCallback)(({active:e,over:t})=>{i.current=null;const s=UN(e),o=UN(t);s&&o&&e.id!==t.id&&("segmentFolder"===s.type&&"segmentFolder"===o.type?n(e=>S(e,VN(e,s),VN(e,o))):"segment"===s.type&&"segment"===o.type&&n((0,mI.jM)(e=>{const n=e[VN(e,s)];if(!n)return;const t=n.segments.findIndex(e=>e.id===s.segmentId),i=n.segments.findIndex(e=>e.id===o.segmentId);-1!==i&&(n.segments=S(n.segments,t,i))})))},[n]),d=(0,de.useCallback)(()=>{i.current&&(n(i.current),i.current=null)},[n]);return{collisionDetection:s,modifiers:LN,sensors:t,onDragCancel:d,onDragEnd:r,onDragOver:a,onDragStart:o}}(a,r);return(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{isLoading:o,onClick:d,children:n("enregistrer_06519")}),category:n("vues_personnali_80652"),heading:n("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)(kx,{css:{background:"white"},children:[(0,i.jsxs)(Xl,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(Zr,{font:"gray900 textLg semiBold",children:n("organisation_de_95776")}),(0,i.jsx)(yc,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,$h.A)(a,e=>e.id)?.id??0,0);r([...a,{id:e-1,name:n("nouveau_dossier_94479"),segments:[]}])},children:n("nouveau_dossier_94479")})]}),(0,i.jsx)(Yj,{height:"5"}),(0,i.jsx)(jI.Mp,{...l,children:(0,i.jsx)(gI.gB,{items:a.map(e=>`sf-${e.id}`),strategy:gI._G,children:(0,i.jsx)(Xl,{direction:"column",gap:"6",width:1,children:a.map((e,n)=>(0,i.jsx)(NN,{canDelete:a.length>1,index:n,segmentFolder:e,setSegmentsFolders:r},e.id))})})})]})})},WN=e=>{const n=os(),{eventId:t,organizationId:s,segmentsFolders:o,reloadSegments:a}=DN(),{mutate:r}=function(e={}){return ds("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)(mA,{buttonText:n("d_placer_la_vue_27440"),icon:"sliders",initialValues:{segmentFolderId:e.segment.segmentFolderId},size:"md",title:n("d_placer_la_vue_55115",e.segment.name),onClose:e.onClose,onSubmit:async n=>{await r({organizationId:s,eventId:t,segmentId:e.segment.id,segmentFolderId:n.segmentFolderId}),a(),e.onClose()},children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:n("vers_quel_dossi_86452")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{css:{overflowY:"auto"},direction:"column",gap:"3",children:o.map(e=>(0,i.jsx)(LR,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},GN=e=>{const{translate:n}=fc(),{eventId:t,organizationId:s,segmentsFolders:o,reloadSegments:a}=DN(),{mutate:r,isLoading:d}=function(e={}){return ds("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)}(),[l,c]=(0,de.useState)(e.segment.name),[u,m]=(0,de.useState)(e.segment.segmentFolderId),[g,h]=(0,de.useState)(e.segment.description||void 0),p=w(l);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"gear",subtitle:n("mettez_jour_l_55467"),children:n("mise_jour_de_80873")}),(0,i.jsxs)(Gf,{gap:"4",children:[(0,i.jsx)(hu,{label:n("nom_de_la_vue_66415"),value:l,onChange:c}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{f(e)&&m(e[0])},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Xx,{label:n("Description"),value:g,onChange:h})]}),(0,i.jsx)(Wf,{children:()=>(0,i.jsx)(yc,{disabled:!p,isLoading:d,onClick:async()=>{await r({organizationId:s,eventId:t,description:g,name:l,segmentFolderId:u,segmentId:e.segment.id}),a()},children:n("mettre_jour_85141")})})]})})},qN=Nr("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary500",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:"$primary50",borderRadius:"$1",color:"$primary500","& .count":{background:"$primary500",color:"white"},"& .count, & .count-admin":{background:"$primary500",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary500"}}}}}),HN=(0,de.memo)(function(e){const{history:n,translate:t}=fc(),{canSegmentEdit:s,eventId:o,organizationId:a,segmentId:r,getSegmentPath:d,onSegmentClick:l,reloadSegments:c}=DN(),{mutate:u}=function(e={}){return ds("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:m}=function(e={}){return ds("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:g}=function(e={}){return ds("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:h}=function(e={}){return ds("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,I]=(0,de.useState)(!1),[f,x]=(0,de.useState)(!1),[_,j]=(0,de.useState)(!1);return(0,i.jsxs)(qN,{selected:e.segment.id===r,onClick:()=>{l(e.segment.id),n.push(d(e.segment.id))},onMouseLeave:e=>{vm(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:Uc,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(wm,{offset:0,placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>I(!0),children:t("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(Em,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await h({organizationId:a,eventId:o,segmentId:e.segment.id}),c()},children:t("d_placer_vers_l_49863")}),e.canMoveUpDown&&(0,i.jsx)(Em,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await g({organizationId:a,eventId:o,segmentId:e.segment.id}),c()},children:t("d_placer_vers_l_52432")}),e.canMoveFolder&&(0,i.jsx)(Em,{icon:"folder",onClick:()=>x(!0),children:t("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{await m({organizationId:a,eventId:o,segmentId:e.segment.id}),c()},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:e.canDelete&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>j(!0),children:t("supprimer_43083")})})]})]})}),p&&(0,i.jsx)(GN,{segment:e.segment,onClose:()=>{I(!1)}}),f&&(0,i.jsx)(WN,{segment:e.segment,onClose:()=>{x(!1)}}),_&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_38950"),text:t("suppression_de_73669",e.segment.name),onClose:()=>{j(!1)},onDelete:async()=>{await u({organizationId:a,eventId:o,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(Tc,{alertStyle:"warning",children:(0,i.jsx)(Oc,{children:t("cette_vue_est_u_58409")})})})]})}),YN=e=>{const n=os(),{canSegmentEdit:t,eventId:s,organizationId:o,reloadSegments:a,segmentType:r}=DN(),{mutate:d}=function(e={}){return ds("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:l}=function(e={}){return ds("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 ds("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)}(),{mutate:u}=function(e={}){return ds("mutation SegmentFolderDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentFolderId: SegmentsFolderId!\n $newEventId: EventId!\n) {\n segmentFolderDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n newEventId: $newEventId\n )\n}\n",e)}(),[m,g]=(0,de.useState)(!1),[h,p]=(0,de.useState)(!1),[I,f]=(0,de.useState)(!1),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),S=(0,de.useCallback)(async()=>{const n=!I;f(n),await Py.segmentsFolders.put({id:e.segmentFolder.id,isOpen:n})},[I,e.segmentFolder.id]),y=(0,de.useCallback)(n=>u({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id,newEventId:n}),[o,s,e.segmentFolder,u]),C=(0,de.useMemo)(()=>w(e.search)?e.segmentFolder.segments.filter(n=>Ah(n,e.search)):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,de.useEffect)(()=>{(async()=>{f((await Py.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:S,children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(pc,{icon:I?"chevron-down":"chevron-right"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),t&&(0,i.jsx)(Zr,{className:"ellipsis",onClick:Uc,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xl,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(pc,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(wm,{offset:0,placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>g(!0),children:n("renommer_42135")}),(0,i.jsx)(Em,{icon:"gear",onClick:()=>_(!0),children:n("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Em,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await l({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),a()},children:n("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Em,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),a()},children:n("d_placer_vers_l_49863")}),!!s&&e.canDeleteSegmentFolder&&(0,i.jsx)(Em,{icon:"clone",onClick:()=>v(!0),children:"Dupliquer sur un autre événement"})]}),(0,i.jsx)(v$,{children:e.canDeleteSegmentFolder&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>p(!0),children:n("supprimer_43083")})})]})]})})]}),C.length>0&&I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{direction:"column",gap:"1",children:C.map((n,t)=>(0,i.jsx)(HN,{canDelete:e.canDeleteSegment,canMoveFolder:e.canDeleteSegmentFolder,canMoveUpDown:e.segmentFolder.segments.length>1,isFirst:0===t,isLast:t===e.segmentFolder.segments.length-1,segment:n,onDelete:e.onSegmentDelete},n.id))})]}),(0,i.jsx)(ic,{height:"5"})]}),m&&(0,i.jsx)(kN,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{g(!1)}}),h&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_13885"),text:n("suppression_de_73669",e.segmentFolder.name),onClose:()=>{p(!1)},onDelete:async()=>{await d({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),a()}}),x&&(0,hd.createPortal)((0,i.jsx)(Zr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(BN,{eventId:s,organizationId:o,segmentType:r,onClose:()=>{_(!1)},onSuccess:()=>(a(),e.onSegmentDelete())})}),document.body),j&&(0,i.jsx)(dR,{eventId:s,organizationId:o,onClose:()=>v(!1),onSuccess:y})]})},ZN=e=>{const n=os(),{canSegmentEdit:t,segmentsFolders:s}=DN(),[o,a]=(0,de.useState)(!1),r=(0,de.useMemo)(()=>s.flatMap(e=>e.segments).length>1,[s]),[d,l]=(0,de.useState)(""),c=(0,de.useMemo)(()=>w(d)?s.filter(e=>e.segments.some(e=>Ah(e,d))):s,[s,d]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Wu,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(Xl,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(Xl,{align:"center",children:(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:n("vues_personnali_80652")})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:d,onChange:l})}),(0,i.jsx)(ic,{height:"4"}),c.map((n,t)=>(0,i.jsx)(YN,{canDeleteSegment:r,canDeleteSegmentFolder:s.length>1,isFirst:0===t,isLast:t===s.length-1,search:d,segmentFolder:n,onSegmentDelete:e.onSegmentDelete},n.id))]}),t&&(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{a(!0)},children:[(0,i.jsx)(pc,{icon:"plus"}),(0,i.jsx)(Zr,{color:"gray700",fontWeight:"medium",children:n("nouveau_dossier_94479")})]})]}),o&&(0,i.jsx)(kN,{isEdit:!1,onClose:()=>{a(!1)}})]})},KN=()=>{const{history:e,translate:n}=fc(),{columns:t,columnsSearch:s,predicates:o,rendering:a,sort:r}=ah(),{columnsExport:d,eventId:l,getSegmentPath:c,infos:u,organizationId:m,reloadSegments:g,segment:h,segmentId:p,segmentType:I,segmentsFolders:x,setIsSaveSegmentVisible:_}=DN(),j=(0,de.useCallback)(()=>{_(!1)},[_]),{mutate:v,isLoading:S}=function(e={}){return ds("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:y,isLoading:C}=function(e={}){return ds("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)}(),[b,A]=(0,de.useState)(!1),[E,$]=(0,de.useState)(""),[T,z]=(0,de.useState)(()=>{const e=x.find(e=>e.segments.find(e=>e.id===p))?.id??x[0]?.id;if(void 0===e)throw new Error("No segments folder to save the segment in");return e}),[O,R]=(0,de.useState)(h.description||void 0),D=!b||w(E);return(0,i.jsx)(Yf,{isOpen:!0,onClose:j,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"floppy-disk",subtitle:n("sauvegarder_vos_15289"),children:n("enregistrer_une_52986")}),(0,i.jsxs)(Gf,{children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("que_souhaitez_v_33936")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(eg,{css:{"& label > div > div":{fontWeight:"$regular"}},state:b?"unchecked":"checked",onClick:()=>{A(!1)},children:n("enregistrer_les_31603").split("{1}").map((e,n)=>1===n?(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(s_,{fontWeight:"medium",children:h.name}),e]},n):(0,i.jsx)(de.Fragment,{children:e},n))}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(eg,{css:{"& label > div > div":{fontWeight:"$regular"}},state:b?"checked":"unchecked",onClick:()=>{A(!0)},children:n("cr_er_une_nouve_37002")}),b&&(0,i.jsx)(Zr,{css:{marginLeft:"$6"},children:(0,i.jsx)(hu,{hint:n("cette_vue_sera_83858"),placeholder:n("nom_de_votre_no_21748"),value:E,onChange:$})})]})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("dans_quel_dossi_07643"),renderOnPortal:!0,shouldParseAsInt:!0,values:[T],onChange:e=>{f(e)&&z(e[0])},children:x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Xx,{label:n("Description"),placeholder:n("entrer_une_desc_74340"),value:O,onChange:R})]}),(0,i.jsx)(Wf,{children:()=>(0,i.jsx)(yc,{disabled:!D,isLoading:C||S,onClick:async()=>{const n={segmentType:I,name:E,description:O,predicatesGroups:o,columns:t,columnsExport:d,columnsSearch:s,sort:r,rendering:a,infos:u};if(b){const{segmentCreate:{id:t}}=await y({organizationId:m,eventId:l,segmentFolderId:T,segment:n});await g(),e.push(c(t))}else await v({organizationId:m,eventId:l,segmentFolderId:T,segmentId:p,segment:n}),g()},children:n("enregistrer_06519")})})]})})},XN=e=>{const{segment:n}=e,{massActions:t,reload:s}=ah(),[o,a]=(0,de.useState)(n.columnsExport),[r,d]=(0,de.useState)(n.infos),l=(0,de.useMemo)(()=>JSON.stringify(n.columnsExport),[n]),c=(0,de.useMemo)(()=>JSON.stringify(n.infos),[n]),u=(0,de.useMemo)(()=>JSON.stringify(o)!==l||JSON.stringify(r)!==c,[o,l,r,c]),[m,g]=(0,de.useState)(!1),h=(0,de.useCallback)(()=>{t.toggleSelectAll("unchecked"),s()},[t,s]);return(0,i.jsx)(RN.Provider,{value:{areSegmentsOpen:e.areSegmentsOpen,canSegmentEdit:e.canSegmentEdit,columnsExport:o,eventId:e.eventId,filters:e.filters,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:r,isSaveSegmentVisible:m,isSegmentDirty:u,onMassEditSuccess:h,onSegmentClick:e.onSegmentClick,organizationId:e.organizationId,reloadSegments:e.reloadSegments,segment:n,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:e.segmentsFolders,setAreSegmentsOpen:e.setAreSegmentsOpen,setColumnsExport:a,setInfos:d,setIsSaveSegmentVisible:g,setSegmentCount:e.setSegmentCount},children:e.children})},QN=e=>{const{areSegmentsOpen:n,hideSegments:t,isSaveSegmentVisible:s}=DN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{height:1,width:1,children:[!0!==t&&n&&(0,i.jsx)(Zr,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(ZN,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),s&&(0,i.jsx)(KN,{})]})},JN=e=>{const[n,t]=(0,de.useState)(e.segmentsFolders),s=(0,de.useMemo)(()=>n.flatMap(e=>e.segments),[n]),o=(0,de.useMemo)(()=>s.find(n=>n.id===e.segmentId),[e.segmentId,s]),[a,r]=(0,de.useState)(e.initialSegmentsOpen??!0),d=(0,de.useCallback)(n=>{e.onSegmentsToggle?.(n),r(n)},[r]),l=(0,de.useCallback)((e,i)=>{t((0,mI.jM)(n,n=>{n.forEach(n=>{n.segments.forEach(n=>{n.id===e&&(n.count=i)})})}))},[n,t]);return(0,de.useEffect)(()=>{t(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(nx,{columns:o.columns,columnsSearch:o.columnsSearch,columnsToIncludes:e.columnsToIncludes,eventId:e.eventId??null,filters:e.filters,filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,getMassActionId:e.getMassActionId,limit:e.initialLimit,loadDataList:e.loadDataList,loadDataListParams:e.loadDataListParams,loadRow:e.loadRow,loadRowParams:e.loadRowParams,organizationId:e.organizationId,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:o.predicatesGroups,rendering:o.rendering,renderingLoaders:e.renderingLoaders,renderingParams:e.renderingParams,setLimit:e.setLimit,showHeader:!1,showMassActions:e.showMassActions,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,sort:o.sort,children:(0,i.jsx)(XN,{areSegmentsOpen:a,canSegmentEdit:e.canSegmentEdit,eventId:e.eventId,filters:e.filters,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,organizationId:e.organizationId,reloadSegments:e.reload,segment:o,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:n,setAreSegmentsOpen:d,setSegmentCount:l,onSegmentClick:e.onSegmentClick,children:(0,i.jsx)(QN,{onSegmentDelete:e.onSegmentDelete,children:e.children})})},o.id)},eL=e=>{const n=os(),{isSaveVisible:t}=ah(),{canSegmentEdit:s,isSegmentDirty:o,setIsSaveSegmentVisible:a}=DN();return(0,i.jsx)(lI,{actions:e.actions,controls:(0,i.jsxs)(i.Fragment,{children:[s&&(t||o)&&(0,i.jsx)(yc,{color:"invisible",onClick:()=>{a(!0)},children:n("enregistrer_la_22884")}),e.controls]}),searchPlaceholder:e.searchPlaceholder,showActions:e.showActions,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:s,showSearchColumns:e.showSearchColumns})},nL=e=>{const{limit:n,massActions:t}=ah(),{canSegmentEdit:s,segment:o}=DN(),a=s&&t.numberOfSelected===n&&o.count>n;return(0,i.jsxs)(Xl,{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)(tI,{isReadOnly:!s}),a&&e.selectSegment]})},tL=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{showNotification:o}=Sy(),{mutate:a}=Vl();return(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:(0,sc.A)([n("_tes_vous_s_r_d_94890"),e.workflow.trigger===Dt.Assigned?n("cela_supprimera_60220"):null]),text:n("suppression_de_73669",e.workflow.name),onClose:e.onClose,onDelete:async()=>{await a({organizationId:t,eventId:s,selecteds:{ids:[e.workflow.id]}}),o(n("l_automatisatio_64405",e.workflow.name)),e.onSuccess()}})},iL=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{mutate:a}=Bl(),{mutate:r}=Gl(),[d,l]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"play",isDisabled:e.workflow.state===Rt.Paused,onClick:async()=>{await r({organizationId:s,eventId:o,selecteds:{ids:[e.workflow.id]}}),e.reload()},children:t("ex_cuter_54158")}),(0,i.jsx)(Em,{icon:"pen",to:Vv.UPDATE({organizationId:s,eventId:o,workflowId:e.workflow.id}),children:t("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:t}}=await a({organizationId:s,eventId:o,workflowId:e.workflow.id});n.push(Vv.UPDATE({organizationId:s,eventId:o,workflowId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{l(!0),vm(e.target)},children:t("supprimer_43083")})})]}),d&&(0,i.jsx)(tL,{workflow:e.workflow,onClose:()=>l(!1),onSuccess:e.reload})]})},sL=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{massActions:s,predicates:o}=ah(),{onMassEditSuccess:a,segment:r}=DN(),{showNotification:d}=Sy(),{user:l}=ps(),{mutate:c}=Vl(),{mutate:u}=Ha(),{mutate:m}=Gl(),[g,h]=(0,de.useState)(!1),[p,I]=(0,de.useState)(!1),f=s.getSelectedsInput(o,null),x=s.isAllSelected?r.count:s.numberOfSelected;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>h(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"play",onClick:async()=>{const{numberOfExecuted:i}=await m({organizationId:n,eventId:t,selecteds:f});d(e("_1_automatisat_96943",i)),a()},children:e("ex_cuter_54158")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>I(!0),children:e("supprimer_43083")})})]})]}),g&&(0,i.jsx)(R$,{canAccessBackoffice:Fg(l.email),mutate:e=>u({organizationId:n,eventId:t,massEdit:e}),selecteds:f,onClose:()=>h(!1),onSuccess:n=>{d(e("_1_automatisat_35589",n)),a()}}),p&&(0,i.jsx)(f$,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_04998")],text:e("suppression_de_41301",x),onClose:()=>I(!1),onDelete:async()=>{await c({organizationId:n,eventId:t,selecteds:f}),d(e("_1_automatisat_45105",x)),a()}})]})},oL=e=>{const n=ss(Wg);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.insertedAt.toLocal(),da.DateTime)})},aL=e=>{const n=w(e.createdBy?.name),t=(n?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:t,width:1,children:t}),n&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})},rL=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{mutate:s}=Ha(),o=(0,de.useCallback)(async i=>(await s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.workflowId]},slug:e.property,strategy:Dn.Replace,value:i}}),!0),[n,t,e.workflowId,e.property,s]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:o,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable??!0})},dL=e=>{const{translate:n}=fc(),{user:t}=ps();return(0,i.jsx)(rL,{column:e.column,initialValue:e.workflow.frequency,property:Tt.Frequency,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(nf,{label:n("Frequency"),value:e,onChange:t,children:Wi.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),renderValue:n(e.workflow.frequency),updatable:Fg(t.email),workflowId:e.workflow.id})},lL=({children:e,isEditMode:n,title:t,updatable:s})=>n&&s?(0,i.jsx)(Zr,{css:{clamp:2},font:"gray900 textSm medium",title:t,width:1,children:t}):(0,i.jsx)(i.Fragment,{children:e}),cL=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{isEditMode:o}=ah(),a=e.workflow.name;return(0,i.jsx)(rL,{column:e.column,initialValue:a,property:Tt.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_de_l_automa_04883"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Ug,{to:Vv.WORKFLOW({organizationId:t,eventId:s,workflowId:e.workflow.id}),children:(0,i.jsx)(Zr,{css:{clamp:2},title:a,children:a})})}),workflowId:e.workflow.id})},uL=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>Yi.filter(e=>e!==Rt.Error),[]),s=e.workflow.data.errorMessage||"";return(0,i.jsx)(rL,{column:e.column,initialValue:e.workflow.state,property:Tt.State,reload:e.reload,renderInput:(e,s)=>(0,i.jsx)(nf,{label:n("State"),value:e,onChange:s,children:t.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),renderValue:()=>(0,i.jsxs)(Xl,{align:"start",direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(Lm,{...QF(e.workflow.state),children:n(e.workflow.state)}),e.workflow.state===Rt.Error&&(0,i.jsx)(Zr,{css:{ellipsis:!0},title:s,width:1,children:s})]}),workflowId:e.workflow.id})},mL=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Wg),a=ss(Nh),r=(0,de.useMemo)(()=>f(e.row.accreditationsSlots)?op(e.row.accreditationsSlots):[],[e.column]),d=(0,de.useMemo)(()=>f(e.row.positionsSlots)?tp(a,[],[],e.row.positionsSlots):[],[e.column]);return e.column.slug===Fp.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===Fp.Name?(0,i.jsx)(cL,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Fp.State?(0,i.jsx)(uL,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Fp.Trigger?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:n(e.row.trigger)}):e.column.slug===Fp.Action?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:n(e.row.action)}):e.column.slug===Fp.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===Fp.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===Fp.VolunteersSegment?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.segment?(0,i.jsx)(Ug,{to:e.row.segment.segmentType===lt.Delegations?Wo.DELEGATIONS_SEGMENT(t,s,e.row.segment.id):Wo.VOLUNTEERS_SEGMENT(t,s,e.row.segment.id),children:e.row.segment.name}):"-"}):e.column.slug===Fp.ExecutedAt?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?o.toLocaleString(e.row.executedAt.toLocal(),da.DateTime):"-"}):e.column.slug===Fp.Accreditations?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:r,doNotSort:!0})}):e.column.slug===Fp.Positions?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:d,doNotSort:!0})}):e.column.slug===Fp.Campaign?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(Ug,{to:Nv.CAMPAIGN({organizationId:t,eventId:s,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===Fp.Frequency?(0,i.jsx)(dL,{column:e.column,reload:e.reload,workflow:e.row}):e.column.slug===Fp.CustomField?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},gL=e=>{const{translate:n,params:{organizationId:t,segmentId:s}}=fc(),{areSegmentsOpen:o,hideSegments:a,segment:r,setAreSegmentsOpen:d,setSegmentCount:l}=DN(),{data:c}=rs("query SegmentHeader($organizationId: OrganizationId!, $segmentId: SegmentId!) {\n organization(id: $organizationId) {\n segment(id: $segmentId) {\n count(shouldCompute: true)\n }\n }\n}\n",{organizationId:t,segmentId:r.id},[],undefined);return(0,de.useEffect)(()=>{r.id===s&&l(r.id,c.organization?.segment.count??r.count)},[s,r,c.organization,l]),(0,i.jsx)(bC,{children:(0,i.jsxs)(Xl,{align:"center",gap:"4",width:1,children:[!a&&(0,i.jsx)(Xl,{css:{cursor:"pointer",padding:"$2"},onClick:()=>d(!o),children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"sidebar"})})}),(0,i.jsx)(ux,{placement:"top",children:n(o?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(Zr,{children:r.name}),r.isUsedInWorkflow&&(0,i.jsx)(Lm,{color:"white",leftIcon:"bolt-auto",children:n("utilis_e_dans_u_46582")})]}),r.description&&(0,i.jsx)(Zr,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:r.description})]}),e.children]})})},hL=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc();return(0,i.jsx)(gL,{children:(0,i.jsx)(lC,{permissions:nC.WORKFLOW_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{e.push(Vv.CREATE({organizationId:t,eventId:s}))},children:n("cr_er_une_autom_91246")})})})},pL=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{limit:o,reload:a}=ah(),{segment:r}=DN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hL,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(sL,{}),searchPlaceholder:n("rechercher_une_30575"),showActions:e.canWorkflowEdit,showEditColumns:e.canSegmentEdit,showEditMode:e.canWorkflowEdit,showSearchColumns:!1}),selectSegment:(0,i.jsx)(cI,{allSelectedText:n("les_1_automat_58612",r.count,r.name),pageSelectedText:n("les_1_automat_30472",o),selectAllText:n("s_lectionner_le_71777",r.count,r.name)})}),(0,i.jsx)(px,{getEditPath:e=>Vv.UPDATE({organizationId:t,eventId:s,workflowId:e.id}),renderCell:(e,n)=>(0,i.jsx)(mL,{column:e,reload:a,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(iL,{reload:n,workflow:e})})]})]})},IL=e=>{const{translate:n,params:{organizationId:t,eventId:s,segmentId:o}}=fc(),a=ss(Lp),r=(0,de.useMemo)(()=>a.getWorkflowsFilters(t,s),[a,t,s]),d=(0,de.useMemo)(()=>a.getWorkflowsPossibleColumns(),[a]),l=(0,de.useMemo)(()=>({level:s?kn.Event:kn.Organization}),[s]);return(0,i.jsx)(JN,{canSegmentEdit:e.canSegmentEdit,columnsToIncludes:Np,eventId:s,filters:r,filtersButtonText:n("filtrer_les_aut_25902"),filtersSubtitle:n("appliquer_des_f_55705"),getSegmentPath:e=>Vv.WORKFLOWS_SEGMENT({organizationId:t,eventId:s,segmentId:e}),initialLimit:e.initialLimit??jg,initialSegmentsOpen:e.initialSegmentsOpen??!0,loadDataList:Wl,loadDataListParams:l,organizationId:t,possibleColumns:d,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:lt.Workflows,segmentsFolders:e.segmentsFolders,setLimit:e.setLimit,showMassActions:e.canWorkflowEdit,showRowDropdown:e.canWorkflowEdit,showRowEdit:e.canWorkflowEdit,onSegmentClick:e.onSegmentClick,onSegmentDelete:e.onSegmentDelete,onSegmentsToggle:e.onSegmentsToggle,children:(0,i.jsx)(pL,{canSegmentEdit:e.canSegmentEdit,canWorkflowEdit:e.canWorkflowEdit})})};function fL(e){return(0,de.useMemo)(()=>e.flatMap(e=>e.segments).map(e=>e.id),[e])}const xL=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=fc(),{event:{name:o},localEvent:a,updateLocalEvent:r}=Ly(),{canSegmentEdit:d,canWorkflowEdit:l}=tC();fm(`${o} ${s("automatisations_60045")}`);const{data:c,loader:u,reload:m}=ql({organizationId:n,eventId:t,level:kn.Event}),g=(0,de.useMemo)(()=>c.organization?.segmentsFolders??[],[c.organization]),h=fL(g);return u||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Vv.WORKFLOWS_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(IL,{canSegmentEdit:d,canWorkflowEdit:l,initialLimit:a?.workflowsLimit,initialSegmentsOpen:a?.areWorkflowsSegmentsOpen,reload:m,segmentsFolders:g,setLimit:e=>{r({workflowsLimit:e})},onSegmentClick:e=>{r({workflowsSegmentId:e})},onSegmentDelete:async()=>{await r({workflowsSegmentId:null}),e.replace(Vv.WORKFLOWS({organizationId:n,eventId:t}))},onSegmentsToggle:async e=>{await r({areWorkflowsSegmentsOpen:e})}})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Vv.WORKFLOWS_SEGMENT({organizationId:n,eventId:t,segmentId:a?.workflowsSegmentId&&h.includes(a.workflowsSegmentId)?a.workflowsSegmentId:h[0]}),replace:!0})})]})},_L=()=>{const{history:e,params:{organizationId:n},translate:t}=fc(),{organization:s,localOrganization:o,updateLocalOrganization:a}=Yy(),{canSegmentEdit:r,canWorkflowEdit:d}=iC();fm(`${s.name} ${t("automatisations_60045")}`);const{data:l,loader:c,reload:u}=ql({organizationId:n,level:kn.Organization}),m=(0,de.useMemo)(()=>l.organization?.segmentsFolders??[],[l.organization]),g=fL(m);return c||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Vv.WORKFLOWS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(IL,{canSegmentEdit:r,canWorkflowEdit:d,initialLimit:o?.workflowsLimit,initialSegmentsOpen:o?.areWorkflowsSegmentsOpen,reload:u,segmentsFolders:m,setLimit:e=>{a({workflowsLimit:e})},onSegmentClick:e=>{a({workflowsSegmentId:e})},onSegmentDelete:async()=>{await a({workflowsSegmentId:null}),e.replace(Vv.WORKFLOWS({organizationId:n}))},onSegmentsToggle:async e=>{await a({areWorkflowsSegmentsOpen:e})}})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Vv.WORKFLOWS_SEGMENT({organizationId:n,segmentId:o?.workflowsSegmentId&&g.includes(o.workflowsSegmentId)?o.workflowsSegmentId:g[0]}),replace:!0})})]})},jL=e=>(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(Xl,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(Xl,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),vL=e=>(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:e.label}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:e.children})]}),SL=({workflow:e})=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Wg),a=ss(Nh),r=e=>o.toLocaleString(e.toLocal(),da.DateTime),d=w(e.createdBy.name)?e.createdBy.name:e.createdBy.email,l=(0,de.useMemo)(()=>f(e.accreditationsSlots)?op(e.accreditationsSlots):[],[e.accreditationsSlots]),c=(0,de.useMemo)(()=>f(e.positionsSlots)?tp(a,[],[],e.positionsSlots):[],[e.positionsSlots]),u=(0,de.useMemo)(()=>e.segment?e.segment.segmentType===lt.Delegations?s?Wo.DELEGATIONS_SEGMENT(t,s,e.segment.id):Wo.COMMUNITY_DELEGATIONS_SEGMENT(t,e.segment.id):s?Wo.VOLUNTEERS_SEGMENT(t,s,e.segment.id):Wo.COMMUNITY_USERS_SEGMENT(t,e.segment.id):null,[e.segment,t,s]),m=(0,de.useMemo)(()=>(e.data.customFields||[]).flatMap(n=>{const t=e.customFields?.find(({id:e})=>e===n.customFieldId);return t?[{name:t.name,value:n.value}]:[]}),[e.data.customFields,e.customFields]);return(0,i.jsx)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[e.state===Rt.Error&&(0,i.jsxs)(Tc,{alertStyle:"error",children:[(0,i.jsx)(zc,{children:n("une_erreur_est_38715")}),(0,i.jsx)(Oc,{children:e.data.errorMessage})]}),(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(e.trigger===Dt.VolunteersSegment||e.trigger===Dt.DelegationsSegment)&&e.segment&&(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:e.trigger===Dt.DelegationsSegment?n("nombre_de_d_l_g_65603"):n("nombre_de_membr_42906")}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayMd",fontWeight:"medium",children:e.segment.count})]}),(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("Frequency")}),(0,i.jsxs)(Zr,{color:"gray900",fontWeight:"medium",children:[(0,i.jsx)(Zr,{as:"span",fontSize:"displayMd",children:nN(e.frequency)}),(0,i.jsx)(Zr,{as:"span",fontSize:"textXl",children:n("min_74949")})]})]})]}),(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(yz,{css:{borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},hideTitleBorder:!0,title:n("informations_g_79325"),children:(0,i.jsxs)(Xl,{gap:"7",wrap:"wrap",children:[(0,i.jsx)(vL,{label:n("cr_e_par_30622"),children:(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$1",padding:"$1 $2 $1 6px"},gap:"2",children:[(0,i.jsx)(F_,{email:e.createdBy.email,image:e.createdBy.picture?.url,name:e.createdBy.name,size:16}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:d})]})}),(0,i.jsx)(vL,{label:n("date_de_cr_atio_00749"),children:r(e.insertedAt)}),(0,i.jsx)(vL,{label:n("derni_re_ex_cut_36102"),children:e.executedAt?.isValid?r(e.executedAt):"-"}),(0,i.jsx)(vL,{label:n("State"),children:(0,i.jsx)(Lm,{...QF(e.state),children:n(e.state)})})]})}),(0,i.jsx)(yz,{css:{borderTop:"none",borderTopLeftRadius:"0",borderTopRightRadius:"0"},hideTitleBorder:!0,title:n("d_tails_de_l_au_28745"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(vL,{label:n("initialisation_38640"),children:n(e.trigger)}),(e.trigger===Dt.VolunteersSegment||e.trigger===Dt.DelegationsSegment)&&(0,i.jsx)(vL,{label:n("vue_s_lectionn_21556"),children:e.segment&&u?(0,i.jsx)(Ug,{to:u,children:e.segment.name}):"-"}),e.trigger===Dt.FormSubmit&&(0,i.jsx)(vL,{label:n("Form"),children:e.form?(0,i.jsx)(Ug,{to:Ks.FORM({organizationId:t,eventId:s,formId:e.form.id}),children:e.form.name}):"-"}),f(e.positionsCategories)&&(0,i.jsx)(vL,{label:n("cat_gories_24533"),children:(0,i.jsx)(Xl,{direction:"column",gap:"1",children:e.positionsCategories.map(e=>(0,i.jsx)(Ug,{to:Eo.POSITION_CATEGORY({organizationId:t,eventId:s,positionCategoryId:e.id}),children:e.name},e.id))})}),f(e.positions)&&(0,i.jsx)(vL,{label:n("missions_63972"),children:(0,i.jsx)(Xl,{direction:"column",gap:"1",children:e.positions.map(e=>(0,i.jsx)(Ug,{to:Eo.POSITION({organizationId:t,eventId:s,positionId:e.id}),children:e.name},e.id))})}),f(e.triggerPositionsSlots)&&(0,i.jsx)(vL,{label:n("cr_neaux_33401"),children:(0,i.jsx)(Xl,{direction:"column",gap:"1",children:e.triggerPositionsSlots.map(e=>(0,i.jsx)(Zr,{children:Gh(a,e,e.position.name,{position:{includeName:!0}})},e.id))})}),f(e.positionsSegments)&&(0,i.jsx)(vL,{label:n("vues_50543"),children:(0,i.jsx)(Xl,{direction:"column",gap:"1",children:e.positionsSegments.map(e=>(0,i.jsx)(Zr,{children:e.name},e.id))})}),(0,i.jsx)(vL,{label:n("action_44224"),children:n(e.action)}),e.action===Et.SendCampaign&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vL,{label:n("campagne_97871"),children:e.campaign?(0,i.jsx)(Ug,{to:Nv.CAMPAIGN({organizationId:t,eventId:s,campaignId:e.campaign.id}),children:e.campaign.name}):"-"}),(0,i.jsx)(vL,{label:n("destinataires_19592"),children:e.data.recipients===zt.DelegationsLeaders?n("aux_responsable_38147"):e.data.recipients===zt.PositionsLeaders?n("aux_responsable_85620"):e.data.recipients===zt.UsersInfosIds?n("_certains_memb_91094"):e.data.recipients===zt.Admins?n("aux_administrat_40273"):e.data.recipients===zt.DelegationsCategoriesLeaders?n("aux_responsable_63918"):n("aux_membres_de_71046")}),f(e.usersInfos)&&(0,i.jsx)(vL,{label:n("liste_des_membr_89037"),children:(0,i.jsx)(Xl,{direction:"column",gap:"1",children:e.usersInfos.map(e=>(0,i.jsx)(Zr,{children:w(e.name)?e.name:e.email},e.id))})})]}),e.action===Et.SetCustomField&&(0,i.jsx)(vL,{label:e.customField?n("nouvelle_valeur_39039",e.customField.name):n("CustomField"),children:e.customField?(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Lw,{field:e.customField,fields:{[e.customField.slug]:e.data.customFieldValue}}),e.data.addValues&&(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:n("ajouter_les_val_22996")})]}):"-"}),(e.action===Et.AddAccreditations||e.action===Et.DeleteAccreditations)&&(0,i.jsx)(vL,{label:n("accr_ditations_39450"),children:f(l)?(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:l.map(e=>(0,i.jsx)(CE,{badge:e},e.id))}):"-"}),e.accreditationProfile&&(0,i.jsx)(vL,{label:n("profil_d_accr_d_63000"),children:e.accreditationProfile.name}),(e.action===Et.AddPositions||e.action===Et.DeletePositions)&&(0,i.jsx)(vL,{label:n("cr_neaux_33401"),children:f(c)?(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:c.map(e=>(0,i.jsx)(CE,{badge:e},e.id))}):"-"}),e.action===Et.CreateDelegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(vL,{label:n("d_l_gation_ut_74409"),children:e.delegation?(0,i.jsx)(Ug,{to:vo.DELEGATION({organizationId:t,eventId:s,delegationId:e.delegation.id}),children:e.delegation.name}):"-"}),(0,i.jsx)(vL,{label:n("champ_utilise_04526"),children:e.customField?.name??"-"})]}),e.action===Et.AddEvent&&(0,i.jsx)(vL,{label:n("_v_nement_22345"),children:e.addedEvent?(0,i.jsx)(Ug,{to:eo.EVENT({organizationId:t,eventId:e.addedEvent.id}),children:e.addedEvent.name}):"-"}),e.action===Et.DuplicateMember&&(0,i.jsx)(vL,{label:n("champs_91671"),children:f(m)?(0,i.jsx)(Xl,{direction:"column",gap:"1",children:m.map(({name:e,value:n})=>(0,i.jsxs)(Zr,{children:[e," : ",n]},e))}):"-"}),e.action===Et.DuplicateMember&&(0,i.jsx)(vL,{label:n("e_mail_du_nouve_23523"),children:e.emailSourceCustomField?.name??n("e_mail_du_membr_16089")}),(e.action===Et.AddDelegationPermissions||e.action===Et.DeleteDelegationPermissions)&&(0,i.jsx)(vL,{label:n("droits_73696"),children:f(e.data.permissions)?(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:e.data.permissions.map(e=>(0,i.jsx)(Lm,{children:n(e)},e))}):"-"}),eN(e.trigger,e.action)&&(0,i.jsx)(vL,{label:jN(n,e.trigger),children:e.onExit===$t.Revert?_N(n,e.action):n("ne_rien_faire_76456")})]})})]})]})})},yL=()=>{const{translate:e,params:{organizationId:n,workflowId:t}}=fc(),[s,o]=(0,de.useState)(0),{data:a,isLoading:r}=rs("query WorkflowHistories($organizationId: OrganizationId!, $workflowId: WorkflowId!, $offset: Int) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n histories(offset: $offset, limit: 25) {\n nodes {\n ...HistoryRow\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:n,workflowId:t,offset:s},[Ko.HistoryRowFragment],undefined);const{numberOfPages:d,totalCount:l}=Jf(a.organization?.workflow.histories);return(0,i.jsx)(yC,{children:(0,i.jsx)(uk,{getActionLabel:n=>e(`history_workflows_${n}`),histories:a.organization?.workflow.histories.nodes??[],isLoading:r,numberOfPages:d,offset:s,setOffset:o,totalCount:l})})},CL=({reload:e,workflow:n})=>{const{history:t,params:{organizationId:s,eventId:o,workflowId:a},translate:r}=fc(),{mutate:d}=Bl(),{mutate:l}=Gl(),[c,u]=(0,de.useState)(!1);return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:Vv.WORKFLOWS({organizationId:s,eventId:o}),children:r("automatisations_60045")}),(0,i.jsx)(gO,{isCurrent:!0,to:Vv.WORKFLOW({organizationId:s,eventId:o,workflowId:a}),children:n.name})]}),buttons:(0,i.jsxs)(lC,{permissions:nC.WORKFLOW_EDIT,children:[(0,i.jsx)(yc,{to:Vv.UPDATE({organizationId:s,eventId:o,workflowId:a}),children:r("_diter_62574")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"play",isDisabled:n.state===Rt.Paused,onClick:async()=>{await l({organizationId:s,eventId:o,selecteds:{ids:[a]}}),e()},children:r("ex_cuter_54158")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:e}}=await d({organizationId:s,eventId:o,workflowId:a});t.push(Vv.UPDATE({organizationId:s,eventId:o,workflowId:e}))},children:r("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),u(!0)},children:r("supprimer_43083")})})]})]}),c&&(0,i.jsx)(tL,{workflow:n,onClose:()=>u(!1),onSuccess:()=>t.replace(Vv.WORKFLOWS({organizationId:s,eventId:o}))})]}),name:n.name})},bL=e=>{const{params:{organizationId:n,eventId:t,workflowId:s},translate:o}=fc();fm(e.workflow.name);const a=e=>({organizationId:e?":organizationId":n,eventId:t?e?":eventId":t:void 0,workflowId:e?":workflowId":s});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(CL,{reload:e.reload,workflow:e.workflow}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:Vv.WORKFLOW_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:Vv.WORKFLOW_HISTORY(a(!1)),children:o("historique_06296")})]}),(0,i.jsx)($C,{path:Vv.WORKFLOW_DASHBOARD(a(!0)),children:(0,i.jsx)(SL,{workflow:e.workflow})}),(0,i.jsx)($C,{path:Vv.WORKFLOW_HISTORY(a(!0)),children:(0,i.jsx)(yL,{})})]})]})},AL=()=>{const{params:{organizationId:e,eventId:n,workflowId:t}}=fc(),{data:s,loader:o,reload:a}=rs("query Workflow($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n id\n name\n state\n trigger\n action\n frequency\n onExit\n executedAt\n insertedAt\n\n createdBy {\n email\n name\n picture {\n url\n }\n }\n\n data {\n addValues\n customFields\n customFieldValue\n errorMessage\n permissions\n recipients\n }\n\n accreditationProfile {\n id\n name\n }\n\n accreditationsSlots {\n ...AccreditationSlotVolunteerRegistration\n }\n\n addedEvent {\n id\n name\n }\n\n campaign {\n id\n name\n }\n\n customField {\n id\n name\n slug\n fieldType\n listType\n\n values {\n id\n value\n color\n }\n }\n\n customFields {\n id\n name\n }\n\n emailSourceCustomField {\n id\n name\n }\n\n delegation {\n id\n name\n }\n\n form {\n id\n name\n }\n\n positions {\n id\n name\n }\n\n positionsCategories {\n id\n name\n }\n\n positionsSegments {\n id\n name\n }\n\n positionsSlots {\n id\n name\n range\n\n position {\n id\n acronym\n color\n icon\n name\n }\n }\n\n segment {\n id\n name\n segmentType\n count(shouldCompute: true)\n }\n\n triggerPositionsSlots {\n id\n name\n range\n\n position {\n id\n name\n }\n }\n\n usersInfos {\n id\n name\n email\n }\n }\n }\n}\n",{organizationId:e,workflowId:t},[Ko.AccreditationSlotVolunteerRegistrationFragment],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Vv.WORKFLOW({organizationId:":organizationId",eventId:n?":eventId":void 0,workflowId:":workflowId"}),children:(0,i.jsx)(gs,{path:Vv.WORKFLOW_DASHBOARD({organizationId:e,eventId:n,workflowId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(bL,{reload:a,workflow:s.organization.workflow})})]})};var EL,wL,$L;let TL=class extends Eh{constructor(e,n,t){super(e,n,t)}getCampaignsFilters(e){return[{slug:"state",name:this.t("State"),category:this.t("Campaigns"),fieldType:Sn.Select,values:Xt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:Sn.Select,values:Qt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:Sn.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:Sn.Date,hideEmpty:!0}]}};TL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(EL=void 0!==dh&&dh)?EL:Object,"function"==typeof(wL=void 0!==Wg&&Wg)?wL:Object,"function"==typeof($L=void 0!==ts&&ts)?$L:Object])],TL);const zL=()=>{const{translate:e,history:n,params:{organizationId:t}}=fc();return(0,i.jsx)(gL,{children:(0,i.jsx)(lC,{permissions:nC.CAMPAIGN_SEND,children:(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>{n.push(Nv.CREATE_TEMPLATE({organizationId:t}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{n.push(Nv.CREATE({organizationId:t}))},children:e("cr_er_une_campa_96023")})})})};function OL(e){switch(e){case Le.Draft:return{color:"gray",leftIcon:"pen-ruler"};case Le.Done:return{color:"success",leftIcon:"check"};case Le.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case Le.Scheduled:return{color:"primary",leftIcon:"calendar"};case Le.Template:return{color:"purple",leftIcon:"paper-plane"};default:return Ic()}}const RL=e=>{const{history:n,translate:t}=fc(),{showNotification:s}=Sy(),{mutate:o}=function(e={}){return ds("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:a}=function(e={}){return ds("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:r}=function(e={}){return ds("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)}(),[d,l]=(0,de.useState)(!1),c=e.campaign.state===Le.Draft||e.campaign.state===Le.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>{n.push(Nv.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:t("_diter_62574")}),c&&(0,i.jsx)(Em,{icon:"paper-plane",onClick:async()=>{await a({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),e.reload()},children:t("envoyer_26609")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:t}}=await o({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});n.push(Nv.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),l(!0)},children:t("supprimer_43083")})})]}),d&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_58075"),text:t("suppression_de_73669",e.campaign.name),onClose:()=>{l(!1)},onDelete:async()=>{await r({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),s(t("la_campagne_1_92813",e.campaign.name)),e.reload()}})]})},DL=e=>{const{translate:n}=fc(),t=ss(Wg),s=e.campaign.sentAt?.setZone(Jo.c9.local().zone);return(0,i.jsxs)(Eg,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{vm(e.target)},children:[(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Ug,{to:Nv.CAMPAIGN_DASHBOARD({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===Le.Done&&s&&(0,i.jsx)(Zr,{color:"gray500",children:n("envoy_e_le_1_90336",t.toLocaleString(s,da.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===Le.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(Zr,{color:"gray500",children:n("programm_e_le_58279",t.toLocaleString(e.campaign.scheduledAt,da.DateOnly.MonthLong),t.toLocaleString(e.campaign.scheduledAt,da.TimeOnly))})]})}),(0,i.jsxs)(_g,{css:{flex:"0 150px"},children:[(0,i.jsx)(Zr,{width:22,children:e.campaign.campaignType===Ue.Email?(0,i.jsx)(pc,{icon:"at"}):(0,i.jsx)(pc,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)(_g,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)(_g,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===Ue.Email?n("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)(_g,{css:{flex:"0 150px"},children:(0,i.jsx)(Lm,{...OL(e.campaign.state),children:n(e.campaign.state)})}),(0,i.jsx)(Vg,{justify:"end",children:e.canCampaignSend&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",to:Nv.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(RL,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function ML(e,n){(0,de.useEffect)(()=>{let t=null;return e.some(e=>e.state===Le.InProgress)&&(t=window.setInterval(n,3e4)),()=>{t&&clearInterval(t)}},[e])}const PL=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canCampaignSend:t}=iC(),{data:s,isLoading:o,limit:a,numberOfPages:r,offset:d,reload:l,setLimit:c,setOffset:u,setSort:m,sort:g,totalCount:h}=ah();return ML(s,l),(0,i.jsx)(Xl,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(rx,{"aria-busy":o,headerRow:(0,i.jsxs)(cg,{children:[(0,i.jsx)(ax,{attribute:Ne.Name,setSort:m,sort:g,children:e("nom_de_la_campa_45063")}),(0,i.jsx)(ax,{attribute:Ne.Type,setSort:m,sort:g,width:150,children:e("type_35427")}),(0,i.jsx)(Mg,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(Mg,{width:150,children:e("co_t_68998")}),(0,i.jsx)(ax,{attribute:Ne.State,css:{flex:"0 150px"},setSort:m,sort:g,children:e("State")}),(0,i.jsx)(Mg,{width:100})]}),paginationRow:(0,i.jsx)(wg,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ag,{limit:a,numberOfPages:r,offset:d,setLimit:c,setOffset:u,showLimits:!0,totalCount:h})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{}),(0,i.jsx)(Pg,{})]}):s.map(e=>(0,i.jsx)(DL,{campaign:e,canCampaignSend:t,eventId:null,organizationId:n,reload:l},e.id))})})},kL=()=>{const e=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zL,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{searchPlaceholder:e("rechercher_une_69554"),showActions:!1,showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(PL,{})]})]})},FL=e=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=fc(),{localOrganization:a,updateLocalOrganization:r}=Yy(),{canSegmentEdit:d}=iC(),l=ss(TL);return(0,i.jsx)(JN,{canSegmentEdit:d,filters:l.getCampaignsFilters(e.organization.admins.nodes),filtersButtonText:t("filtrer_les_cam_97457"),filtersSubtitle:t("appliquer_des_f_57442"),getSegmentPath:e=>Nv.CAMPAIGNS_SEGMENT({organizationId:s,segmentId:e}),initialLimit:a?.campaignsLimit??jg,initialSegmentsOpen:a?.areCampaignsSegmentsOpen??!0,loadDataList:Nd,organizationId:s,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:lt.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({campaignsLimit:e})},onSegmentClick:e=>{r({campaignsSegmentId:e})},onSegmentDelete:async()=>{await r({campaignsSegmentId:null}),n.replace(Nv.CAMPAIGNS({organizationId:s}))},onSegmentsToggle:async e=>{await r({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(kL,{})})},NL=()=>{const{params:{organizationId:e},translate:n}=fc();fm(`${n("communaut_20896")} ${n("Campaigns")}`);const{localOrganization:t}=Yy(),{data:s,loader:o,reload:a}=rs("query CampaignsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n admins: usersInfos(isResourceCreator: true) {\n nodes {\n userId\n nameOrEmail\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Campaigns) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[Ko.SegmentsFoldersSegmentsFragment],undefined);const r=(0,de.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Nv.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(FL,{organization:s.organization,reload:a})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Nv.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:t?.campaignsSegmentId&&r.includes(t.campaignsSegmentId)?t?.campaignsSegmentId:r[0]}),replace:!0})})]})},LL=()=>{const{translate:e,params:{organizationId:n}}=fc(),{updateLocalOrganization:t}=Yy(),{canCampaignRead:s,canFormRead:o,canDelegationRead:a,canWorkflowRead:r}=iC();return(0,i.jsxs)(SR,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)(vR,{replace:!1,to:Ms.COMMUNITY_DASHBOARD({organizationId:n}),children:e("tableau_de_bord_24627")}),(0,i.jsx)(vR,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:Ms.COMMUNITY_USERS({organizationId:n}),onClick:()=>t({usersSegmentId:null}),children:e("vos_membres_38104")}),s&&(0,i.jsx)(vR,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:Nv.CAMPAIGNS({organizationId:n}),onClick:()=>t({campaignsSegmentId:null}),children:e("Campaigns")}),o&&(0,i.jsx)(vR,{isActive:e=>e.endsWith("/forms")||e.endsWith("/forms/create"),replace:!1,to:Ks.FORMS({organizationId:n}),children:e("Form_plural")}),a&&(0,i.jsx)(vR,{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:Wo.COMMUNITY_DELEGATIONS(n),children:e("d_l_gations_78318")}),r&&(0,i.jsx)(vR,{isActive:e=>e.endsWith("/workflows")||null!==e.match(/\/community\/workflows\/\d+/)||null!==e.match(/\/community\/workflow\/\d+/),replace:!1,to:Vv.WORKFLOWS({organizationId:n}),children:e("automatisations_60045")})]})},UL=e=>(0,i.jsx)($M,{children:(0,i.jsxs)(Wu,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(LL,{}),(0,i.jsx)(Zr,{css:{overflowY:"auto"},children:e.children})]})}),VL=({percent:e,prospectivePercent:n})=>(0,i.jsxs)(Zr,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(Zr,{css:{background:Fm(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==n&&(0,i.jsx)(Zr,{css:{background:Fm(n),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*n+"%"},height:1})]}),BL=()=>{const e=os(),{organizationId:n}=ls(),t=cs(),{data:s,loader:o}=rs("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:n},[],undefined);const a=ss(Nh);return o||(0,i.jsxs)(Xl,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(ic,{height:"9"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(ic,{height:"9"}),(0,i.jsxs)(Xl,{gap:"6",width:1,children:[(0,i.jsx)(MO,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:s.organization.events.nodes.length}),(0,i.jsx)(MO,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:s.organization.numberOfUsersInfos})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Mg,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Mg,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(Mg,{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,Zy.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(Eg,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{t.push(eo.EVENT({organizationId:n,eventId:e.id}))},children:[(0,i.jsx)(_g,{children:e.name}),(0,i.jsx)(_g,{children:e.range?a.toDisplayString(e.range):"-"}),(0,i.jsx)(_g,{width:200,children:e.numberOfPositions}),(0,i.jsx)(_g,{children:e.resources>0?(0,i.jsxs)(Xl,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(VL,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(Zr,{color:"gray700",width:40,children:[s," %"]})]}):"-"})]},e.id)})}),setOffset:Ou.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(ic,{height:"9"})]})};function WL(e,n,t){const[i,s]=(0,de.useState)(null);return(0,de.useCallback)(async()=>{if(i)return i;{const i=await e(n,{token:await fe()}),o=t(i);return s(o),o}},[i,e,n])}const GL=(0,de.createContext)({}),qL=e=>{const n=WL(Ba,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},e=>e.organization.campaigns.nodes),t=WL(Ba,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},e=>e.organization.event?.customDocuments??[]),s=WL(Ba,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},e=>e.organization.delegationsCategories.nodes),o=WL(Ba,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},e=>e.organization.event?.delegationsSpaceLayouts??[]),a=WL(Ba,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},e=>e.organization.forms.nodes),r=WL(Ba,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?kn.Event:kn.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(GL.Provider,{value:{getCampaigns:n,getCustomDocuments:t,getDelegationsCategories:s,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getDelegationsSpaceLayouts:o,getForms:a,getTags:r},children:e.children})};function HL(){return(0,de.useContext)(GL)}const YL=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(Dn.Add),[d,l]=(0,de.useState)([]),[c,u]=(0,de.useState)(e.roles[0]?.id??null),[m,g,h]=Dg(""),{usersInfosOptions:p,isLoading:I}=mC({organizationId:t,eventId:null,hasSelected:f(d),nameDebounced:g,userInfoIds:d}),x=f(d);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"user-gear",children:n("_diter_les_resp_29588")}),(0,i.jsxs)(Gf,{gap:"6",children:[(0,i.jsxs)(nf,{label:n("que_souhaitez_v_87607"),value:a,onChange:r,children:[(0,i.jsx)("option",{value:Dn.Add,children:n("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:Dn.Replace,children:n("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:Dn.Delete,children:n("supprimer_des_r_69379")})]}),(0,i.jsx)(lg,{isSearchLoading:I,isSearchVisible:!0,label:n("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),state:"search",value:m,onChange:h}),values:d,onChange:l,children:p}),e.showRoleSelect&&a!==Dn.Delete&&(0,i.jsx)(nf,{label:n("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)(Wf,{children:(0,i.jsx)(yc,{disabled:!x,isLoading:s,onClick:async()=>{o(!0),await e.onSuccess(a,d.map(e=>({userInfoId:e,roleId:c}))),e.onClose(),o(!1)},children:n("_diter_62574")})})]})})};var ZL;let KL=class extends M${translationService;inputName="massAccreditationsProfiles";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsProfiles:Jl.YO().of(Jl.Ik().shape({accreditationProfileId:Jl.ai().required(),maxResources:Jl.gl().nullable(),willAutoAccredit:Jl.zM().required()})).required(this.t("vous_devez_s_le_98277")).min(1,this.t("vous_devez_s_le_98277"))}}};KL=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(ZL=void 0!==ts&&ts)?ZL:Object])],KL);const XL=e=>{const n=os();return(0,i.jsx)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_accr_25709"),prefix:"massAccreditationsProfiles.",strategies:[{label:n("ajouter_des_pro_03108"),value:Dn.Add},{label:n("remplacer_les_p_03034"),value:Dn.Replace},{label:n("supprimer_des_p_90440"),value:Dn.Delete}]})},QL=e=>{const n=os(),{data:t,loader:s}=mr({eventId:e.eventId}),{accreditationsProfiles:o,strategy:a}=e.values.massAccreditationsProfiles,r=(0,de.useMemo)(()=>t.event?.accreditationsProfilesCategories??[],[t.event]),d=(0,de.useMemo)(()=>yA(r),[r]),l=(0,de.useMemo)(()=>o.map(e=>e.accreditationProfileId),[o]),c=(0,de.useCallback)(n=>{const t=n.filter(e=>!o.some(n=>n.accreditationProfileId===e)),i=o.filter(e=>n.includes(e.accreditationProfileId)).concat(t.map(e=>({accreditationProfileId:e,willAutoAccredit:!0})));e.change("massAccreditationsProfiles.accreditationsProfiles",i)},[o,e.change]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PA,{accreditationsProfiles:o,accreditationsProfilesCategories:r,change:e.change,hideActions:a===Dn.Delete,prefix:"massAccreditationsProfiles."}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("ajouter_des_pro_61834")}),values:l,onChange:c,children:d}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(a===Dn.Add?"ajouter_les_pro_81094":a===Dn.Replace?"remplacer_les_p_72074":"supprimer_les_p_65703",e.numberOfSelected)})})]})},JL=e=>{const n=os(),t=ss(KL),{mutate:s}=function(e={}){return ds("mutation DelegationsMassAccreditationsProfilesEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $massAccreditationsProfiles: MassDelegationsAccreditationsProfilesInput!\n) {\n numberOfDelegations: delegationsMassAccreditationsProfilesEdit(\n organizationId: $organizationId\n eventId: $eventId\n massAccreditationsProfiles: $massAccreditationsProfiles\n )\n}\n",e)}();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("d_l_gations_78318"),heading:n("_diter_les_prof_19479"),onClose:e.onClose,children:(0,i.jsx)(kx,{children:(0,i.jsxs)(fy,{initialValues:{massAccreditationsProfiles:{accreditationsProfiles:[],selecteds:e.selecteds,strategy:Dn.Add}},isEdit:!1,onSubmit:async t=>{const i=(await s({organizationId:e.organizationId,eventId:e.eventId,massAccreditationsProfiles:t.massAccreditationsProfiles})).numberOfDelegations;e.onSuccess(n("les_profils_d_a_85146",i)),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(XL,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("profils_d_accr_27825"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(QL,{change:n.change,eventId:e.eventId,handleSubmit:t,numberOfSelected:e.numberOfSelected,submitting:s,values:o}),schema:t.step2Schema()})]})})})})};var eU;let nU=class extends M${translationService;inputName="massAccreditationsSlots";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{accreditationsSlots:Jl.YO().of(Jl.Ik().shape({accreditationCategoryId:Jl.ai().required(),accreditationId:Jl.ai().required(),accreditationSlotId:Jl.ai().required(),isDefault:Jl.zM().required(),isVisible:Jl.zM().required(),maxResources:Jl.gl().nullable()})).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};nU=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(eU=void 0!==ts&&ts)?eU:Object])],nU);const tU=e=>{const n=os();return(0,i.jsx)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_accr_25709"),prefix:"massAccreditationsSlots.",strategies:[{label:n("ajouter_des_acc_17744"),value:Dn.Add},{label:n("remplacer_les_a_92733"),value:Dn.Replace},{label:n("supprimer_des_a_04246"),value:Dn.Delete}]})},iU="massAccreditationsSlots.",sU=e=>{const n=os(),t=ss(Wg),{data:s,loader:o}=rs("query DelegationsMassAccreditationsSlotsEvent($eventId: EventId!) {\n event(id: $eventId) {\n ...EventAccreditations\n }\n}\n",{eventId:e.eventId},[Ko.EventAccreditationsFragment],undefined);const{massAccreditationsSlots:a}=e.values,{strategy:r}=a,d=(0,de.useMemo)(()=>s.event?.accreditationsCategories??[],[s.event]),l=(0,de.useMemo)(()=>Yp(t,d),[t,d]),c=(0,de.useMemo)(()=>new Map(d.flatMap(e=>e.accreditations.flatMap(n=>n.slots.map(t=>[t.id,{accreditationCategoryId:e.id,accreditationId:n.id}])))),[d]),u=(0,de.useMemo)(()=>a.accreditationsSlots.map(e=>e.accreditationSlotId),[a.accreditationsSlots]),m=(0,de.useCallback)(n=>{const{accreditationsSlots:t}=a,i=n.filter(e=>!t.some(n=>n.accreditationSlotId===e)),s=t.filter(e=>n.includes(e.accreditationSlotId)).concat(i.flatMap(e=>{const n=c.get(e);return n?[{...n,accreditationSlotId:e,isDefault:!1,isVisible:!0}]:[]}));wA(a,s,iU,e.change)},[a,e.change,c]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(RA,{accreditationCategories:d,change:e.change,delegationAccreditations:a,prefix:iU,selectedAccreditationsSlotsIds:e.values.selectedAccreditationsSlotsIds}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,triggerElem:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("AddAccreditations")}),values:u,onChange:m,children:l}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(r===Dn.Add?"ajouter_les_acc_92457":r===Dn.Replace?"remplacer_les_a_11676":"supprimer_les_a_19773",e.numberOfSelected)})})]})},oU=e=>{const n=os(),t=ss(nU),{mutate:s}=function(e={}){return ds("mutation DelegationsMassAccreditationsSlotsEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $massAccreditationsSlots: MassDelegationsAccreditationsSlotsInput!\n) {\n numberOfDelegations: delegationsMassAccreditationsSlotsEdit(\n organizationId: $organizationId\n eventId: $eventId\n massAccreditationsSlots: $massAccreditationsSlots\n )\n}\n",e)}();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("d_l_gations_78318"),heading:n("_diter_les_accr_86042"),onClose:e.onClose,children:(0,i.jsx)(kx,{children:(0,i.jsxs)(fy,{initialValues:{massAccreditationsSlots:{accreditationsCategories:[],accreditations:[],accreditationsSlots:[],selecteds:e.selecteds,strategy:Dn.Add},selectedAccreditationsSlotsIds:[]},isEdit:!1,onSubmit:async t=>{const i=(await s({organizationId:e.organizationId,eventId:e.eventId,massAccreditationsSlots:t.massAccreditationsSlots})).numberOfDelegations;e.onSuccess(n("les_accr_ditati_58186",i)),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(tU,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("accr_ditations_39450"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(sU,{change:n.change,eventId:e.eventId,handleSubmit:t,numberOfSelected:e.numberOfSelected,submitting:s,values:o}),schema:t.step2Schema()})]})})})})},aU=e=>{const{setNodeRef:n,style:t,handleProps:s}=pI(e.column.slug);return(0,i.jsxs)(Xl,{ref:n,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,style:t,children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"grab"},...s,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Zr,{color:"gray800",children:e.column.name})]})},rU=e=>(0,i.jsx)(yI,{ids:e.selectedColumns.map(e=>e.slug),onReorder:(n,t)=>{e.setSelectedColumns(S(e.selectedColumns,n,t))},children:(0,i.jsx)(Xl,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",children:e.selectedColumns.map(e=>(0,i.jsx)(aU,{column:e},e.slug))})}),dU=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Dp),{data:a}=rs("query MassColumnsCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:t,eventId:s},[Ko.OrganizationCustomFieldsFragment],undefined);const{mutate:r,isLoading:d}=Va(),l=(0,de.useMemo)(()=>o.getDelegationMembersPossibleColumns(t,a.organization?.customFields.nodes??[],{forDelegationsSpace:!1,isWeezeventConnected:!0,positionDisplay:st.Position,slotDisplay:at.Custom}),[t,o,a.organization]),[c,u]=(0,de.useState)(""),m=(0,de.useMemo)(()=>l.filter(e=>!w(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[l,c]),[g,h]=(0,de.useState)([]);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"line-columns",children:n("_diter_les_colo_38837")}),(0,i.jsxs)(Gf,{gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("quelles_colonne_05047")}),f(g)&&(0,i.jsx)(rU,{selectedColumns:g,setSelectedColumns:h}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("ajouter_des_col_04043")})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(Xl,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Zr,{css:{px:"$3"},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(Zr,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:m.map(e=>(0,i.jsx)(ng,{isCheckbox:!0,isRadio:!1,isSelected:g.includes(e),value:e.slug,onClick:()=>{h(n=>j(n,e,!n.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:d,onClick:async()=>{const i=(await r({organizationId:t,eventId:s,massEdit:{reset:!1,selecteds:e.selecteds,slug:Xe.Columns,strategy:Dn.Replace,value:g.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(n("les_colonnes_de_83023",i)),e.onClose()},children:n("mettre_jour_85141")})})]})})},lU=e=>{const{translate:n}=fc(),{mutate:t,isLoading:s}=function(e={}){return ds("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,a]=(0,de.useState)([]),[r,d]=(0,de.useState)([]),{data:l}=rs("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?kn.Organization:kn.Event,eventId:o[0]},[],undefined);const c=(!!e.eventId||f(o))&&f(r);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"clone"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("cela_liera_vos_60643")})]}),(0,i.jsx)(ic,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("_v_nement_22345"),values:o,onChange:a,children:(l.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(ic,{height:"4"})]}),(e.eventId||f(o))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(lg,{isSearchVisible:!0,label:n("formulaire_ut_59771"),values:r,onChange:d,children:(l.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:!c,isLoading:s,onClick:async()=>{const i=(await t({organizationId:e.organizationId,eventId:e.eventId,massMove:{eventId:e.eventId?null:o[0],formId:r[0],selecteds:e.selecteds}})).numberOfDelegations;e.onSuccess(n("_1_d_l_gations_15078",i)),e.onClose()},children:n("copier_75889")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},cU=()=>{const e=os(),{canDelegationEdit:n}=tC(),{massActions:t,predicates:s}=ah(),{eventId:o,onMassEditSuccess:a,organizationId:r,segment:d}=DN(),{showNotification:l}=Sy(),{mutate:c}=Va(),{mutate:u}=function(e={}){return ds("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:m}=Qd(),{mutate:g}=Xd(),[h,p]=(0,de.useState)(!1),[I,f]=(0,de.useState)(!1),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),[S,y]=(0,de.useState)(!1),[C,b]=(0,de.useState)(!1),[A,E]=(0,de.useState)(!1),$=t.getSelectedsInput(s,null),T=t.isAllSelected?d.count:t.numberOfSelected,z=(0,de.useCallback)(e=>{w(e)&&l(e),a()},[a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[n&&(0,i.jsx)(Em,{icon:"clone",onClick:()=>f(!0),children:e(o?"copier_dans_la_91936":"copier_dans_un_20230")}),n&&(0,i.jsx)(Em,{icon:"user-gear",onClick:()=>_(!0),children:e("_diter_les_resp_29588")}),n&&(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>(async()=>{const n=(await m({organizationId:r,eventId:o,selecteds:$})).numberOfDelegations;z(e("l_e_mail_d_invi_63545",n))})(),children:e("envoyer_l_e_mai_17491")}),n&&(0,i.jsx)(Em,{icon:"line-columns",onClick:()=>v(!0),children:e("_diter_les_colo_38837")}),n&&o&&(0,i.jsx)(Em,{icon:"badge-check",onClick:()=>b(!0),children:e("_diter_les_accr_86042")}),n&&o&&(0,i.jsx)(Em,{icon:"badge-check",onClick:()=>y(!0),children:e("_diter_les_prof_19479")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>E(!0),children:e("supprimer_43083")})})]})]}),h&&(0,i.jsx)(T$,{eventId:o,mutate:e=>c({organizationId:r,eventId:o,massEdit:e}),organizationId:r,selecteds:$,onClose:()=>{p(!1)},onSuccess:n=>{z(e("_1_d_l_gations_08105",n))}}),I&&(0,i.jsx)(lU,{eventId:o,organizationId:r,selecteds:$,onClose:()=>{f(!1)},onSuccess:a}),x&&(0,i.jsx)(YL,{roles:[],showRoleSelect:!1,onClose:()=>_(!1),onSuccess:async(n,t)=>{const i=(await u({organizationId:r,eventId:o,massLeaders:{leaders:t,strategy:n,selecteds:$}})).numberOfDelegations;z(e("les_responsable_32087",i))}}),C&&o&&(0,i.jsx)(oU,{eventId:o,numberOfSelected:T,organizationId:r,selecteds:$,onClose:()=>b(!1),onSuccess:z}),S&&o&&(0,i.jsx)(JL,{eventId:o,numberOfSelected:T,organizationId:r,selecteds:$,onClose:()=>y(!1),onSuccess:z}),j&&(0,i.jsx)(dU,{selecteds:$,onClose:()=>v(!1),onSuccess:z}),A&&(0,i.jsx)(f$,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",T),onClose:()=>{E(!1)},onDelete:async()=>{const n=(await g({organizationId:r,eventId:o,selecteds:$})).numberOfDelegations;z(e("_1_d_l_gations_40887",n))}})]})},uU=e=>{const n=os(),t=ss(vS);return(0,i.jsxs)(Xl,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(Zr,{children:n("_1_2_membres_04485",e.assignedResources,t.toNumberOrInfinity(e.resources))}),(0,i.jsx)(VL,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},mU=e=>{const n=(0,de.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)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},gU=(0,i.jsx)(_c,{});function hU(e){const[n,t]=(0,de.useState)(!0),[i,s]=(0,de.useState)(null);return(0,de.useEffect)(()=>{e().then(e=>{s(e),t(!1)},()=>{t(!1)})},[]),{isLoading:n,loader:n?gU:null,result:i}}const pU=e=>{const n=os(),{getDelegationsSpaceLayouts:t}=HL(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("DelegationsSpaceLayout")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{label:n("DelegationsSpaceLayout"),renderOnPortal:!0,shouldParseAsInt:!0,values:"number"==typeof e.value?[e.value]:[],onChange:n=>{f(n)?e.setValue(n[0]):e.setValue(null)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},IU=e=>{const{eventId:n,organizationId:t}=DN(),{mutate:s}=Va();return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:t,eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:e.property,strategy:Dn.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},fU=e=>(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationsSpaceLayout?.id,property:Xe.DelegationsSpaceLayout,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(pU,{setValue:n,value:e}),renderValue:e.delegation.delegationsSpaceLayout?e.delegation.delegationsSpaceLayout.name:"-"}),xU=e=>{const{translate:n,params:{organizationId:t}}=fc(),s="number"==typeof e.value?e.value:null,[o,a,r]=Dg(""),{delegationsOptions:d,isLoading:l}=oC({organizationId:t,level:kn.Organization,hasSelected:null!==s,delegationsIds:null!==s?[s]:[],nameDebounced:a});return(0,i.jsx)(lg,{isSearchLoading:l,isSearchVisible:!0,label:n("d_l_gation_de_l_86100"),renderOnPortal:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_31213"),state:"search",value:o,onChange:r}),shouldParseAsInt:!0,values:null!==s?[s]:[],onChange:n=>{f(n)?e.setValue(n[0]):e.setValue(null)},children:d})},_U=e=>{const{params:{organizationId:n}}=fc(),{isEditMode:t}=ah();return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.parent?.id,property:Xe.Parent,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(xU,{setValue:n,value:e}),renderValue:()=>e.delegation.parent?(0,i.jsx)(lL,{isEditMode:t,title:e.delegation.parent.name,updatable:!0,children:(0,i.jsx)(Ug,{to:vo.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:e.delegation.parent.name})}):""})},jU=e=>{const n=(0,de.useMemo)(()=>(e.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[e.delegation]),t=(0,de.useMemo)(()=>op(n),[n]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:t,doNotSort:!0})})},vU=e=>{const n=(0,de.useMemo)(()=>PE((e.delegation.accreditationsProfiles||[]).map(e=>e.accreditationProfile)),[e.delegation]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n,doNotSort:!0})})},SU=e=>{const{translate:n}=fc(),{getCampaigns:t}=HL(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("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))})},yU=e=>{const n=(0,de.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:n.map(e=>e.id),property:Xe.Campaigns,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(SU,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(AE,{badges:t})})},CU=e=>{const{translate:n}=fc(),{getDelegationsCategories:t}=HL(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("Category")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(nf,{label:n("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))})},bU=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{isEditMode:s}=ah();return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:Xe.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(CU,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:s,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(Ug,{to:vo.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},AU=e=>{const n=(0,de.useMemo)(()=>(0,Tg.A)(e.delegation.delegationCategory.leaders,e=>b(e.userInfo.nameOrEmail)).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.delegation]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},EU=e=>{const n=os(),t=ss(Wg);return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:Xe.DeadlineDate,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(df,{label:n("date_limite_d_i_79779"),value:e,onChange:t}),renderValue:e.delegation.deadlineDate?t.toLocaleString(e.delegation.deadlineDate,da.DateOnly.MonthLong):"-"})},wU=e=>{const n=os();return(0,i.jsx)(Jg,{buttons:(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("fermer_62479")}),size:"md",onClose:e.onClose,children:(0,i.jsx)(Xl,{css:{overflowY:"auto"},direction:"column",gap:"2",children:(0,i.jsx)(p_,{text:e.text})})})},$U={clamp:"2",wordBreak:"break-word"},TU=e=>{const{isEditMode:n}=ah(),[t,s]=(0,de.useState)(!1),o=(0,de.useMemo)(()=>(e.text||"").replace(/<\/(p|div|li|ul|ol|h[1-6]|blockquote|tr)\s*>/gi," ").replace(/<(br|hr)\s*\/?>/gi," ").replace(/<[^>]*>/g,"").replace(/&(#\d+|#x[0-9a-f]+|[a-z]+);/gi,(e,n)=>n.startsWith("#x")||n.startsWith("#X")?String.fromCodePoint(parseInt(n.slice(2),16)):n.startsWith("#")?String.fromCodePoint(parseInt(n.slice(1),10)):T[n.toLowerCase()]??e).replace(/\s+/g," ").trim(),[e.text]),a=!w(o),r=(0,de.useCallback)(async n=>{await e.mutate(n),e.reload()},[e.mutate,e.reload]),d=(0,de.useCallback)(()=>a?"-":(0,i.jsx)(Zr,{css:$U,children:o}),[a,o]);return n&&e.updatable?(0,i.jsx)(hE,{column:e.column,initialValue:e.text||"",renderInput:(n,t)=>(0,i.jsx)(Zr,{css:{overflow:"hidden auto"},width:1,onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:(0,i.jsx)(QS,{initialValue:n,label:e.column.name,onChange:t})}),renderValue:d,onSave:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_g,{css:{border:"2px solid transparent",cursor:a?"default":"pointer"},minWidth:e.column.minWidth,width:e.column.width,onClick:e=>{a||(Uc(e),s(!0))},children:d()}),t&&(0,i.jsx)(wU,{text:e.text,onClose:()=>{s(!1)}})]})},zU=e=>{const{eventId:n,organizationId:t}=DN(),{mutate:s}=Va(),o=(0,de.useCallback)(i=>s({organizationId:t,eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:Xe.Description,strategy:Dn.Replace,value:i}}),[t,n,e.delegation.id,s]);return(0,i.jsx)(TU,{column:e.column,mutate:o,reload:e.reload,text:e.delegation.description,updatable:!0})},OU=e=>{const{translate:n}=fc(),{getCustomDocuments:t}=HL(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("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))})},RU=e=>{const n=(0,de.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:n.map(e=>e.slug),property:Xe.Documents,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(OU,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(AE,{badges:t})})},DU=e=>{const n=os(),{getForms:t}=HL(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("Form")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(nf,{label:n("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))})},MU=e=>(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:Xe.Form,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(DU,{setValue:n,value:e}),renderValue:e.delegation.form.name}),PU=e=>{const n=os();return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:Xe.IsLocked,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(nf,{label:n("IsLocked"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.delegation.lockedAt?.isValid?n("oui_54361"):n("non_33516")})},kU=e=>{const n=(0,de.useMemo)(()=>(0,Tg.A)(e.delegation.leaders,e=>b(e.nameOrEmail)).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},FU=e=>{const n=os(),t=ss(vS);return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:Xe.MaxResources,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("MaxResources"),shouldParseAsInt:!0,value:e,onChange:t}),renderValue:t.toNumberOrInfinity(e.delegation.maxResources)})},NU=e=>{const{translate:n}=fc(),{isEditMode:t}=ah(),{getShowPath:s}=HL();return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:Xe.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_de_la_d_l_g_28087"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:t,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(Ug,{to:s(e.delegation.id),children:(0,i.jsx)(Zr,{css:{clamp:2},title:e.delegation.name,children:e.delegation.name})})})})},LU=e=>{const n=os();return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(t,s)=>(0,i.jsxs)(nf,{label:e.label,shouldParseAsBoolean:!0,value:t,onChange:s,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.value?n("oui_54361"):n("non_33516")})},UU=e=>{const{translate:n}=fc(),{getTags:t}=HL(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("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))})},VU=e=>{const n=(0,de.useMemo)(()=>e.delegation.tags||[],[e.delegation]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(IU,{column:e.column,delegation:e.delegation,initialValue:n.map(e=>e.id),property:Xe.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(UU,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(AE,{badges:t})})},BU=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{mutate:o}=Va(),a=(0,de.useCallback)((n,t)=>o({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:t,strategy:Dn.Replace,value:n}}),[e.row,o]),r=(0,de.useMemo)(()=>yx({organizationId:t,eventId:s,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),d=(0,de.useMemo)(()=>Sx(t,vo.DELEGATION({organizationId:t,eventId:s,delegationId:e.row.id})),[e.row]);return e.column.slug===_p.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===_p.Name?(0,i.jsx)(NU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.Description?(0,i.jsx)(zU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.DelegationCategory?(0,i.jsx)(bU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.State?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Lm,{...sb(e.row.state),children:n(e.row.state)})}):e.column.slug===_p.Leaders?(0,i.jsx)(kU,{column:e.column,delegation:e.row}):e.column.slug===_p.CategoryLeaders?(0,i.jsx)(AU,{column:e.column,delegation:e.row}):e.column.slug===_p.Form?(0,i.jsx)(MU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.FormLink?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ug,{to:r,children:r})}):e.column.slug===_p.DelegationSpaceLink?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ug,{to:d,children:d})}):e.column.slug===_p.DeadlineDate?(0,i.jsx)(EU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.MaxResources?(0,i.jsx)(FU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.AssignedResources?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(uU,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===_p.Tags?(0,i.jsx)(VU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.FillingRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===_p.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===_p.ShowInDelegation?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("ShowInDelegationSpace"),property:Xe.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===_p.CanLeadersAddMembers?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersAddMembers"),property:Xe.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===_p.CanLeadersDeleteMembers?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersDeleteMembers"),property:Xe.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===_p.CanLeadersDuplicateMembers?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersDuplicateMembers"),property:Xe.CanLeadersDuplicateMembers,reload:e.reloadRow,value:e.row.canLeadersDuplicateMembers}):e.column.slug===_p.CanLeadersEditColumns?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersEditColumns"),property:Xe.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===_p.CanLeadersEditMembers?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersEditMembers"),property:Xe.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===_p.CanLeadersEditCustomFields?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersEditCustomFields"),property:Xe.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===_p.CanLeadersImportMembers?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersImportMembers"),property:Xe.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===_p.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("CanLeadersSeeHiddenAccreditationsSlots"),property:Xe.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===_p.ShowFormLinkInDelegationSpace?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("afficher_le_lie_05841"),property:Xe.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===_p.DelegationsSpaceLayout?(0,i.jsx)(fU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.ShowAllAccreditations?(0,i.jsx)(LU,{column:e.column,delegation:e.row,label:n("ShowAllAccreditations"),property:Xe.ShowAllAccreditations,reload:e.reloadRow,value:e.row.showAllAccreditations}):e.column.slug===_p.IsLocked?(0,i.jsx)(PU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===_p.Accreditations?(0,i.jsx)(jU,{column:e.column,delegation:e.row}):e.column.slug===_p.AccreditationsProfiles?(0,i.jsx)(vU,{column:e.column,delegation:e.row}):e.column.slug===_p.Campaigns?(0,i.jsx)(yU,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.Documents?(0,i.jsx)(RU,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(mU,{column:e.column,delegation:e.row}):e.column.slug===_p.Parent?(0,i.jsx)(_U,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===_p.UsedCustomFieldsFilled?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:n(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(zE,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:a,reload:e.reloadRow,updatable:!0})},WU=e=>{const{history:n,translate:t}=fc(),{getEditPath:s}=HL(),{mutate:o}=Yd(),[a,r]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",to:s(e.delegation.id),children:t("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegation.id});n.push(s(t.id))},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:async()=>{r(!0)},children:t("supprimer_43083")})})]}),a&&(0,i.jsx)(SO,{delegation:e.delegation,onClose:()=>{r(!1)},onSuccess:e.reload})]})},GU=e=>{const{getEditPath:n}=HL(),t=aE(e.customFields);return(0,i.jsx)(px,{getEditPath:e=>n(e.id),renderCell:(n,s,o)=>(0,i.jsx)(BU,{column:n,customField:t.get(n.slug),eventId:e.eventId,organizationId:e.organizationId,reloadRow:o,row:s}),renderRowDropdown:(n,t)=>(0,i.jsx)(WU,{delegation:n,eventId:e.eventId,organizationId:e.organizationId,reload:t})})},qU=()=>{const{history:e,translate:n,params:{organizationId:t}}=fc();return(0,i.jsx)(gL,{children:(0,i.jsx)(lC,{permissions:nC.DELEGATION_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.COMMUNITY_CREATE_DELEGATION(t))},children:n("cr_er_une_d_l_g_23035")})})})},HU=e=>{const{translate:n,params:{organizationId:t}}=fc(),{canDelegationEdit:s,canSegmentEdit:o}=iC(),{limit:a}=ah(),{segment:r}=DN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qU,{}),0===e.numberOfDelegations?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(Xl,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Jw,{title:n("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(cU,{}),searchPlaceholder:n("rechercher_une_31213"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)(cI,{allSelectedText:n("les_1_d_l_gat_04594",r.count,r.name),pageSelectedText:n("les_1_d_l_gat_27248",a),selectAllText:n("s_lectionner_le_71777",r.count,r.name)})}),(0,i.jsx)(GU,{customFields:e.customFields,eventId:null,organizationId:t})]})]})},YU={level:kn.Organization},ZU=e=>{const{history:n,params:{organizationId:t,segmentId:s},translate:o}=fc();fm(`${o("communaut_20896")} ${o("d_l_gations_78318")}`);const{localOrganization:a,updateLocalOrganization:r}=Yy(),{canDelegationEdit:d,canSegmentEdit:l}=iC(),c=ss(vp),u=(0,de.useMemo)(()=>c.getDelegationsFilters(t,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,t]),m=(0,de.useMemo)(()=>c.getDelegationsPossibleColumns(null,e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(qL,{eventId:null,getEditPath:e=>bs(vo.DELEGATION({organizationId:t,delegationId:e})),getShowPath:e=>vo.DELEGATION({organizationId:t,delegationId:e}),organizationId:t,children:(0,i.jsx)(JN,{canSegmentEdit:l,columnsToIncludes:jp,filters:u,filtersButtonText:o("filtrer_les_d_l_04628"),filtersSubtitle:o("appliquer_des_f_65318"),getSegmentPath:e=>Wo.COMMUNITY_DELEGATIONS_SEGMENT(t,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:a?.delegationsLimit??jg,initialSegmentsOpen:a?.areDelegationsSegmentsOpen??!0,loadDataList:Zd,loadDataListParams:YU,loadRow:Kd,organizationId:t,possibleColumns:m,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:lt.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({delegationsLimit:e})},showMassActions:d,showRowDropdown:d,showRowEdit:d,onSegmentClick:e=>{r({delegationsSegmentId:e})},onSegmentDelete:async()=>{await r({delegationsSegmentId:null}),n.replace(Wo.COMMUNITY_DELEGATIONS(t))},onSegmentsToggle:async e=>{await r({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(HU,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},KU=()=>{const{history:e,params:{organizationId:n}}=fc(),{localOrganization:t}=Yy(),{data:s,loader:o,reload:a}=rs("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:n},[Ko.SegmentCustomFieldFragment,Ko.SegmentsFoldersSegmentsFragment],undefined);const r=(0,de.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(ZU,{organization:s.organization,reload:a})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{onLoad:()=>{const i=t?.delegationsSegmentId&&r.includes(t.delegationsSegmentId)?t?.delegationsSegmentId:r[0];e.replace(Wo.COMMUNITY_DELEGATIONS_SEGMENT(n,i))}})})]})},XU=()=>{const{hasFeature:e}=Yy();return e(In.Delegation)?(0,i.jsx)(KU,{}):(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Pv,{icon:"people-group"})})},QU=e=>{const n=os(),{isLoading:t,copy:s}=ay();return(0,i.jsxs)(Zr,{children:[(0,i.jsx)(Zr,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(hu,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:Ou.A}),(0,i.jsx)(yc,{color:e.buttonColor,isLoading:t,leftIcon:"copy",onClick:()=>s(e.link),children:n("copier_75889")})]})]})},JU=Nr("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"}}),eV=({isOpen:e,onClose:n,link:t})=>{const s=os(),o=as();return(0,i.jsx)(Yf,{isOpen:e,onClose:n,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"plug-circle-bolt",subtitle:s("exporter_votre_81734"),onClose:n,children:s("export_de_votre_02014")}),(0,i.jsx)(Gf,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{css:{marginBottom:"$5"},children:(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:s("limites_des_exp_03687")}),(0,i.jsx)(Oc,{children:(0,i.jsxs)(JU,{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)(QU,{buttonColor:"primary",css:{fontWeight:500},link:t,title:s("lien_d_api_pour_98778")}),(0,i.jsx)(QU,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${t}")`,title:s("import_de_la_vu_17175")})]})})]})})},nV=e=>{const n=os(),[t,s]=(0,de.useState)(hn.Excel),[o,a]=(0,de.useState)("unchecked");return(0,i.jsx)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"file-xls",subtitle:n("exporter_votre_28801"),children:n("exporter_vos_me_10045")}),(0,i.jsxs)(Gf,{gap:"3",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("parameters_de_votre_export")}),(0,i.jsxs)(Xl,{direction:"column",gap:"5",children:[(0,i.jsxs)(nf,{label:n("format_de_lexport"),value:t,onChange:s,children:[(0,i.jsx)("option",{value:hn.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:hn.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(Zm,{state:o,onClick:a,children:n("inclure_dans_l_65554")})]})]}),(0,i.jsx)(Wf,{children:()=>(0,i.jsx)(yc,{onClick:()=>{e.requestExport(t,"checked"===o),e.onClose()},children:n("recevoir_l_expo_53392")})})]})})},tV=({organizationKey:e})=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=fc(),{user:a}=ps(),{columns:r}=ah(),{segment:d}=DN(),{mutate:l}=function(e={}){return ds("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,de.useState)(!1),[m,g]=(0,de.useState)(!1),{checkExport:h}=Sy();return(0,i.jsxs)(gL,{children:[(0,i.jsx)(lC,{permissions:nC.MEMBER_CREATE,children:(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"file-import",onClick:()=>{n.push(Wo.COMMUNITY_VOLUNTEERS_IMPORT(s))},children:t("importer_via_un_61623")}),path:Ev.CREATE({organizationId:s}),children:t("ajouter_un_memb_33261")})}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(lC,{permissions:nC.MEMBER_CREATE,children:(0,i.jsx)(Em,{icon:"merge",onClick:()=>{n.push(Wo.COMMUNITY_USERS_DUPLICATES(s))},children:t("g_rer_les_doubl_39469")})}),(0,i.jsx)(Em,{icon:"plug-circle-bolt",onClick:e=>{vm(e.target),u(!0)},children:t("exporter_via_l_09843")}),(0,i.jsx)(Em,{icon:"file-xls",onClick:e=>{vm(e.target),g(!0)},children:t("exporter_en_exc_51862")}),(0,i.jsx)(lC,{permissions:nC.MEMBER_CREATE,children:(0,i.jsx)(Em,{icon:"file-import",onClick:()=>{n.push(Wo.COMMUNITY_FILES_IMPORT(s))},children:t("importer_des_do_55420")})})]})]}),(0,i.jsx)(eV,{isOpen:c,link:Ax({organizationId:s,eventId:void 0,lang:a?.language,pathComponent:`members/${o}`,key:e}),onClose:()=>{u(!1)}}),(0,i.jsx)(nV,{isOpen:m,requestExport:async(e,n)=>{const{jobId:t}=await l({organizationId:s,segmentId:d.id,format:e,includeFiles:n,columns:r});h(t,s)},showIncludeFiles:!0,onClose:()=>{g(!1)}})]})},iV=e=>{const{params:{organizationId:n}}=fc(),t=aE(e.customFields);return(0,i.jsx)(px,{getEditPath:e=>Wo.COMMUNITY_EDIT_USER(n,e.id),renderCell:(e,n,s)=>(0,i.jsx)(NT,{column:e,customField:t.get(e.slug),reloadRow:s,row:n,updatable:!0})})};var sV;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(sV||(sV={}));const oV=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.level??(e.eventId?kn.Event:kn.Both),[e.eventId,e.level]),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(null),[d,l,c]=Dg("");(0,de.useEffect)(()=>{(async()=>{if(o(!0),e.resource===sV.Delegations){const{organization:n}=await Za({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:t,name:w(l)?l:void 0,ids:e.ids},{token:await fe()});r(n)}else if(e.resource===sV.DelegationsCategories){const{organization:n}=await function(e,n={}){return xa('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',{...n,variables:e,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:t,name:w(l)?l:void 0,ids:e.ids},{token:await fe()});r(n)}else if(e.resource===sV.Positions){const{organization:n}=await function(e,n={}){return xa(Sa,{...n,variables:e,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:w(l)?l:void 0,ids:e.ids},{token:await fe()});r(n)}else if(e.resource===sV.PositionsCategories){const{organization:n}=await function(e,n={}){return xa('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',{...n,variables:e,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:w(l)?l:void 0,ids:e.ids},{token:await fe()});r(n)}o(!1)})()},[t,l,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,de.useMemo)(()=>{if(a){const n=(0,Tg.A)((0,wh.A)(a.list.nodes.concat(a.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return t!==kn.Both&&e.eventId?n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values(x(n,e=>e.event?.id??-1)).map(e=>{const n=e[0];return(0,i.jsx)("optgroup",{label:n.event?.name??a.name,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n.event?.id??-1)})}return(0,i.jsx)(i.Fragment,{})},[e.eventId,t,a]);return(0,i.jsx)(lg,{isSearchLoading:s,isSearchVisible:!0,menuWidth:e.menuWidth,renderOnPortal:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:d,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},aV=e=>{const{translate:n,params:{organizationId:t}}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:e.accessScope===Ce.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(Ce.DelegationCategory),children:n("r_le_sur_une_ca_31475")}),e.accessScope===Ce.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(oV,{hasSelected:!0,ids:[e.resourceId],level:kn.Event,menuWidth:600,organizationId:t,resource:sV.DelegationsCategories,onChange:n=>{f(n)&&e.setResourceId(n[0])}})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(nf,{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))})})]})]})]})},rV=e=>{const{translate:n,params:{organizationId:t}}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:e.accessScope===Ce.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(Ce.Delegation),children:n("r_le_sur_une_d_10967")}),e.accessScope===Ce.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(oV,{hasSelected:!0,ids:[e.resourceId],level:kn.Both,organizationId:t,resource:sV.Delegations,onChange:n=>{f(n)&&e.setResourceId(n[0])}})})]})]})},dV=e=>{const{translate:n}=fc(),{organization:t}=Yy(),s=(0,de.useMemo)(()=>(0,Tg.A)(t.events.nodes,e=>b(e.name)).map(e=>{const n=3444===t.id?`${e.name} (${e.fields.cf61867})`:e.name;return(0,i.jsx)("option",{value:e.id,children:n},e.id)}),[t.events]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:e.accessScope===Ce.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(Ce.Event),children:n("r_le_sur_un_v_89523")}),e.accessScope===Ce.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(lg,{isSearchVisible:!0,menuWidth:600,renderOnPortal:!0,shouldParseAsInt:!0,values:[e.resourceId],onChange:n=>{f(n)&&e.setResourceId(n[0])},children:s})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(nf,{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))})})]})]})]})},lV=e=>{const{translate:n,params:{organizationId:t}}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:e.accessScope===Ce.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(Ce.PositionCategory),children:n("r_le_sur_une_ca_13181")}),e.accessScope===Ce.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(oV,{hasSelected:!0,ids:[e.resourceId],menuWidth:600,organizationId:t,resource:sV.PositionsCategories,onChange:n=>{f(n)&&e.setResourceId(n[0])}})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(nf,{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))})})]})]})]})},cV=e=>{const{translate:n,params:{organizationId:t}}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:e.accessScope===Ce.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(Ce.Position),children:n("r_le_sur_une_mi_92313")}),e.accessScope===Ce.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(oV,{hasSelected:!0,ids:[e.resourceId],menuWidth:600,organizationId:t,resource:sV.Positions,onChange:n=>{f(n)&&e.setResourceId(n[0])}})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(nf,{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))})})]})]})]})},uV=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]}),mV=e=>{const{translate:n,params:{organizationId:t}}=fc(),{organization:s,roles:o}=Yy(),{mutate:a,isLoading:r}=function(e={}){return ds("mutation UserAccessMassCreate(\n $organizationId: OrganizationId!\n $massAccessCreate: MassAccessCreateInput!\n) {\n numberOfEdited: userAccessMassCreate(\n organizationId: $organizationId\n massAccessCreate: $massAccessCreate\n )\n}\n",e)}(),{data:d,isLoading:l}=rs('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:t},[],undefined);const[c,u]=(0,de.useState)(Ce.Organization),[m,g]=(0,de.useState)(o.organizationRoles[0].id),[h,p]=(0,de.useState)(-1),I=e=>{e===Ce.Organization?g(o.organizationRoles[0].id):e===Ce.Event?(g(o.eventRoles[0].id),p(s.events.nodes[0].id)):e===Ce.Delegation?(g(-1),p(d.organization.delegations.nodes[0].id)):e===Ce.DelegationCategory?(g(o.delegationCategoryRoles[0].id),p(d.organization.delegationsCategories.nodes[0].id)):e===Ce.Position?(g(o.positionRoles[0].id),p(d.organization.positions.nodes[0].id)):e===Ce.PositionCategory&&(g(o.positionRoles[0].id),p(d.organization.positionsCategories.nodes[0].id)),u(e)};return(0,i.jsxs)(Yf,{isOpen:e.isOpen,onClose:e.onClose,children:[!e.hideTrigger&&(0,i.jsx)(Zf,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("ajouter_un_r_le_19073")})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"user-lock",children:n("ajouter_un_r_le_19073")}),(0,i.jsx)(Gf,{children:l?(0,i.jsx)(uV,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eg,{state:c===Ce.Organization?"checked":"unchecked",onClick:()=>I(Ce.Organization),children:n("r_le_sur_l_orga_15663")}),c===Ce.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(nf,{shouldParseAsInt:!0,value:m,onChange:g,children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),f(s.events.nodes)&&(0,i.jsx)(dV,{accessScope:c,eventRoles:o.eventRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g}),f(d.organization?.delegations.nodes)&&(0,i.jsx)(rV,{accessScope:c,resourceId:h,setAccessScope:I,setResourceId:p}),f(d.organization?.delegationsCategories.nodes)&&(0,i.jsx)(aV,{accessScope:c,delegationCategoryRoles:o.delegationCategoryRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g}),f(d.organization?.positions.nodes)&&(0,i.jsx)(cV,{accessScope:c,positionRoles:o.positionRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g}),f(d.organization?.positionsCategories.nodes)&&(0,i.jsx)(lV,{accessScope:c,positionCategoryRoles:o.positionRoles,resourceId:h,roleId:m,setAccessScope:I,setResourceId:p,setRoleId:g})]})}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:r,onClick:async()=>{const n=(await a({organizationId:t,massAccessCreate:{resourceId:c===Ce.Organization?t:h,roleId:c===Ce.Delegation?void 0:m,scope:c,selecteds:{ids:e.usersInfosIds}}})).numberOfEdited;e.onSuccess?.(n),e.onClose()},children:n("ajouter_97327")})})]})]})},gV=e=>{const n=os(),{mutate:t,isLoading:s}=Sr(),{mutate:o,isLoading:a}=Nl(),[r,d]=(0,de.useState)([]),[l,c]=(0,de.useState)([]);return(0,de.useEffect)(()=>{(async()=>{if(e.eventId){const n=await br({eventId:e.eventId},{token:await fe()});d(n.event.delegations.nodes)}else{const n=await function(e,n={}){return xa("query MassDelegationAddOrganizationDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{...n,variables:e,fragments:[]})}({organizationId:e.organizationId},{token:await fe()});d(n.organization.delegations.nodes)}})()},[e.organizationId,e.eventId]),(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"people-group"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("ajouter_des_mem_60880")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("Delegation"),values:l,onChange:c,children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:s||a,onClick:async()=>{if(f(l)){let i;const s=r.find(e=>e.id===l[0]);i=e.eventId?(await t({eventId:e.eventId,selecteds:e.selecteds,delegationId:l[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,delegationId:l[0]})).numberOfMembers,e.onSuccess(n("_1_membres_ont_51715",i,s.name)),e.onClose()}},children:n("ajouter_97327")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},hV=e=>{const{translate:n}=fc(),{mutate:t,isLoading:s}=function(e={}){return ds("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:a}=function(e={}){return ds("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:r}=al({organizationId:e.organizationId,level:e.eventId?kn.Event:kn.Organization,eventId:e.eventId}),d=(0,de.useMemo)(()=>r.organization?.forms.nodes??[],[r.organization]),[l,c]=(0,de.useState)([]),u=f(l);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"people-group"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("ajouter_des_mem_81812")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("Form"),values:l,onChange:c,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:!u,isLoading:s||a,onClick:async()=>{if(f(l)){let i;const s=d.find(e=>e.id===l[0]);i=e.eventId?(await t({eventId:e.eventId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers,e.onSuccess(n("le_formulaire_11679",s.name,i)),e.onClose()}},children:n("ajouter_97327")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},pV=e=>{const n=os(),{mutate:t,isLoading:s}=function(e={}){return ds("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:a}=function(e={}){return ds("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:r}=al({organizationId:e.organizationId,level:e.eventId?kn.Event:kn.Organization,eventId:e.eventId}),d=(0,de.useMemo)(()=>r.organization?.forms.nodes??[],[r.organization]),[l,c]=(0,de.useState)([]),u=f(l);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("marquer_un_form_10633")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("Form"),values:l,onChange:c,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Tc,{alertStyle:"error",children:(0,i.jsx)(Oc,{children:e.eventId?n("cette_action_su_82938"):n("cette_action_su_88097")})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{color:"error",disabled:!u,isLoading:s||a,onClick:async()=>{if(f(l)){let i;const s=d.find(e=>e.id===l[0]);i=e.eventId?(await t({eventId:e.eventId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:l[0]})).numberOfMembers,e.onSuccess(n("le_formulaire_87510",s.name,i)),e.onClose()}},children:n("marquer_comme_n_20227")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})};var IV;let fV=class extends ju{constructor(e){super(e)}massAddEventInputSchema(){return Jl.Ik().shape({massAddEvent:Jl.Ik().shape({eventId:Jl.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return Jl.Ik().shape({eventId:Jl.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};fV=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(IV=void 0!==ts&&ts)?IV:Object])],fV);const xV=e=>{const n=os(),t=ss(fV),{mutate:s}=function(e={}){return ds("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:a}=Xa({organizationId:e.organizationId}),[r,d]=(0,de.useState)(""),l=(0,de.useMemo)(()=>w(r)?(o.organization?.events.nodes??[]).filter(e=>e.name.trim().toLowerCase().includes(r.trim().toLowerCase())):o.organization?.events.nodes??[],[o.organization,r]);return(0,i.jsxs)(mA,{buttonText:n("ajouter_le_memb_03343",e.numberOfSelected),icon:"sliders",initialValues:{massAddEvent:{eventId:null,selecteds:e.selecteds}},schema:t.massAddEventInputSchema(),size:"md",title:n("ajouter_les_mem_13940"),onClose:e.onClose,onSubmit:async t=>{const i=l.find(e=>e.id===t.massAddEvent.eventId),o=(await s({organizationId:e.organizationId,massAddEvent:t.massAddEvent})).numberOfMembers;e.onSuccess(n("_1_membres_ont_83814",o,i.name)),e.onClose()},children:[(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:r,onChange:d}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:n("sur_quel_v_nem_31606")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{css:{overflowY:"auto"},direction:"column",gap:"3",children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$2",height:54}),(0,i.jsx)(Vm,{borderRadius:"$2",height:54})]}):l.map(e=>(0,i.jsx)(LR,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},_V=e=>{const n=os(),{data:t,loader:s}=rs("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},[],undefined);const{mutate:o}=Ld(),[a,r]=(0,de.useState)(null);return(0,i.jsxs)(mA,{buttonText:n("fusionner_les_92573",e.numbersOfSelected),icon:"sliders",initialValues:{},size:"md",title:n("fusion_de_membr_34256"),onClose:e.onClose,onSubmit:async()=>{null!==a&&(await o({organizationId:e.organizationId,eventId:e.eventId,mainUserInfoId:a,toMergeUsersInfosIds:e.usersInfosIds.filter(e=>e!==a)}),e.onSuccess(n("_1_membres_ont_74574",e.usersInfosIds.length)),e.onClose())},children:[(0,i.jsx)(Tc,{alertStyle:"gray",children:(0,i.jsx)(Oc,{children:n("toutes_les_info_39932",e.numbersOfSelected)})}),"number"==typeof t.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Tc,{alertStyle:"warning",children:(0,i.jsx)(Oc,{children:n("if_you_merge_me_62641")})})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("quel_membre_sou_80665")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:s||t.organization.usersInfos.nodes.map((e,t)=>{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)(de.Fragment,{children:[0!==t&&(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{r(e.id)},children:[(0,i.jsx)(Jm,{shouldPreventDefault:!1,state:a===e.id?"checked":"unchecked",onClick:Ou.A}),(0,i.jsx)(F_,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:w(e.name)?e.name:"-"}),(0,i.jsx)(Zr,{color:"gray500",children:e.email}),(0,i.jsx)(Xl,{gap:"2",wrap:"wrap",children:s.map(e=>(0,i.jsxs)(de.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(Lm,{css:{height:"fit-content"},leftIcon:"badge-check",children:n("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(Lm,{css:{height:"fit-content"},leftIcon:"location-dot",children:n("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},jV=e=>{const{translate:n,params:{organizationId:t}}=fc(),{showNotification:s}=Sy(),{canOrganizationUserEdit:o}=iC(),{mutate:a}=qa(),{mutate:r}=function(e={}){return ds("mutation UsersInfosMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:d}=Yy(),{data:l}=rs("query UsersActions($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hasDelegations\n hasEvents\n hasForms\n }\n}\n",{organizationId:t},[],undefined);const[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(!1),[h,p]=(0,de.useState)(!1),[I,f]=(0,de.useState)(!1),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),[S,y]=(0,de.useState)(!1),[C,b]=(0,de.useState)(!1),[A,E]=(0,de.useState)(!1),$=e.massActions.getSelectedsInput(e.predicates,null),T=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,z=(0,de.useCallback)(n=>{w(n)&&s(n),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>{u(!0)},children:n("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsxs)(v$,{title:n("gestion_des_mem_51660"),children:[(0,i.jsx)(Em,{icon:"plus",isDisabled:!l.organization?.hasEvents,onClick:()=>g(!0),children:n("ajouter_1_membr_25541",T)}),(0,i.jsx)(Em,{icon:"merge",onClick:()=>p(!0),children:n("fusionner_les_m_37150")}),o&&(0,i.jsx)(Em,{icon:"shield",onClick:()=>f(!0),children:n("ajouter_un_r_le_82872",T)})]}),(0,i.jsx)(v$,{title:n("accr_ditations_39450"),children:d(In.Delegation)&&(0,i.jsx)(Em,{icon:"people-group",isDisabled:!l.organization?.hasDelegations,onClick:()=>v(!0),children:l.organization?.hasDelegations?n("ajouter_1_mem_86218",T):n("cette_organisat_48937")})}),(0,i.jsxs)(v$,{title:n("communication_05277"),children:[(0,i.jsx)(Em,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>y(!0),children:n("ajouter_1_mem_52947",T)}),(0,i.jsx)(Em,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>b(!0),children:n("marquer_un_form_10633")}),(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>E(!0),children:n("SendCampaign")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>_(!0),children:n("supprimer_43083")})})]})]}),c&&(0,i.jsx)(z$,{mutate:e=>a({organizationId:t,massEdit:e}),organizationId:t,selecteds:$,onClose:()=>{u(!1)},onSuccess:e=>{z(n("_1_membres_ont_07596",e))}}),m&&(0,i.jsx)(xV,{numberOfSelected:T,organizationId:t,selecteds:$,onClose:()=>{g(!1)},onSuccess:z}),h&&(0,i.jsx)(_V,{eventId:null,numbersOfSelected:T,organizationId:t,usersInfosIds:e.massActions.selectedsIds,onClose:()=>p(!1),onSuccess:z}),I&&(0,i.jsx)(mV,{isOpen:!0,usersInfosIds:e.massActions.selectedsIds,onClose:()=>f(!1),onSuccess:e=>{z(n("le_r_le_a_t_a_95295",e))}}),x&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_65177"),n("cette_action_es_45424")],text:n("suppression_de_57689",T),onClose:()=>_(!1),onDelete:async()=>{const e=(await r({organizationId:t,selecteds:$})).numberOfMembers;z(n("_1_membres_ont_13170",e))}}),S&&(0,i.jsx)(hV,{eventId:null,organizationId:t,selecteds:$,onClose:()=>y(!1),onSuccess:z}),C&&(0,i.jsx)(pV,{eventId:null,organizationId:t,selecteds:$,onClose:()=>b(!1),onSuccess:z}),j&&(0,i.jsx)(gV,{eventId:null,organizationId:t,selecteds:$,onClose:()=>v(!1),onSuccess:z}),A&&(0,i.jsx)(sT,{eventId:null,organizationId:t,selecteds:$,onClose:()=>E(!1),onSuccess:z})]})},vV=({customFields:e,organizationKey:n})=>{const t=os(),{canMemberEdit:s,canSegmentEdit:o}=iC(),{limit:a,massActions:r,predicates:d,reload:l}=ah(),{onMassEditSuccess:c,segment:u}=DN();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tV,{organizationKey:n,reload:l}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(jV,{massActions:r,predicates:d,showOnlyMassEdit:!1,totalNumberOfMembers:u.count,onMassEditSuccess:c}),searchPlaceholder:t("rechercher_un_m_05904"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)(cI,{allSelectedText:t("les_1_membres_56748",u.count,u.name),pageSelectedText:t("les_1_membres_00895",a),selectAllText:t("s_lectionner_le_71777",u.count,u.name)})}),(0,i.jsx)(iV,{customFields:e})]})]})},SV=e=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=fc(),{localOrganization:a,updateLocalOrganization:r}=Yy(),{canMemberEdit:d,canSegmentEdit:l}=iC(),c=ss(kT),u=(0,de.useMemo)(()=>c.getOrganizationUsersFilters(s,o,e.organization),[e.organization]),m=(0,de.useMemo)(()=>c.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(JN,{canSegmentEdit:l,columnsToIncludes:PT,filters:u,filtersButtonText:t("filtrer_les_mem_49255"),filtersSubtitle:t("appliquer_des_f_48814"),getSegmentPath:e=>Wo.COMMUNITY_USERS_SEGMENT(s,e),initialLimit:a?.usersLimit??jg,initialSegmentsOpen:a?.areUsersSegmentsOpen??!0,loadDataList:dr,loadRow:ar,organizationId:s,possibleColumns:m,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:lt.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{r({usersLimit:e})},showMassActions:d,showRowEdit:d,onSegmentClick:e=>{r({usersSegmentId:e})},onSegmentDelete:async()=>{await r({usersSegmentId:null}),n.replace(Ms.COMMUNITY_USERS({organizationId:s}))},onSegmentsToggle:async e=>{await r({areUsersSegmentsOpen:e})},children:(0,i.jsx)(vV,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},yV=()=>{const{params:{organizationId:e},translate:n}=fc();fm(`${n("communaut_20896")} ${n("membres_11310")}`);const{localOrganization:t}=Yy(),{data:s,loader:o,reload:a}=rs("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:He.All},[Ko.SegmentCustomFieldFragment,Ko.SegmentsFoldersSegmentsFragment],undefined);const r=(0,de.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(SV,{organization:s.organization,reload:a})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.COMMUNITY_USERS_SEGMENT(e,t?.usersSegmentId&&r.includes(t.usersSegmentId)?t?.usersSegmentId:r[0]),replace:!0})})]})},CV=e=>{const{translate:n,params:{organizationId:t}}=fc(),s=ss(wb),{mutate:o,isLoading:a}=Ld(),r=(0,de.useMemo)(()=>Object.fromEntries(e.displayColumns.flatMap(n=>{const t=e.customFields.find(e=>e.slug===n);return t?[[n,t]]:[]})),[e.customFields,e.displayColumns]);return(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yc,{color:"primary",isLoading:a,size:"sm",onClick:async()=>{await o({organizationId:t,mainUserInfoId:e.selectedId,toMergeUsersInfosIds:e.usersInfos.map(({id:e})=>e).filter(n=>n!==e.selectedId)}),e.onSuccess()},children:n("fusionner_04498")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("nom_du_membre_69353")}),e.displayColumns.map(e=>{const t=r[e];return"delegations"===e?(0,i.jsx)(Mg,{children:n("d_l_gations_78318")},e):t?(0,i.jsx)(Mg,{children:t.name},e):null}),(0,i.jsx)(Mg,{children:n("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(n=>(0,i.jsxs)(Eg,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(n.id)},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(MC,{userInfo:n})}),e.displayColumns.map(e=>{const t=r[e];return"delegations"===e?(0,i.jsx)(_g,{gap:"2",wrap:"wrap",children:n.delegations.map(e=>{const n=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(Lm,{children:n},e.id)})},e):t?(0,i.jsx)(_g,{children:s.getValueString(t,n.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)(_g,{children:(0,i.jsx)(Jm,{shouldPreventDefault:!1,state:e.selectedId===n.id?"checked":"unchecked",onClick:Ou.A})})]},n.id)),setOffset:Ou.A,title:e.usersInfos[0].name,totalCount:0})},bV=e=>{const{translate:n,params:{organizationId:t}}=fc(),{localOrganization:s,updateLocalOrganization:o}=Yy(),a=e.organization.customFields.nodes,[r,d]=(0,de.useState)(e.organization.possibleDuplicates),[l,c]=(0,de.useState)(Object.fromEntries(r.map(({id:e,usersInfos:n})=>[e,n[0].id]))),[u,m]=(0,de.useState)(!1),g=r.length??0,[h,p]=(0,de.useState)(s?.duplicatesColumns||[]),I=(0,de.useMemo)(()=>(0,Tg.A)([...a.map(e=>({name:e.name,slug:e.slug})),{name:n("d_l_gations_78318"),slug:"delegations"}],e=>e.name),[a]),f=(0,de.useCallback)(async e=>{p(e),await o({duplicatesColumns:e})},[p]),[x,_]=(0,de.useState)(""),j=(0,de.useMemo)(()=>w(x)?r.filter(e=>e.usersInfos.some(e=>e.name.toLowerCase().includes(x.toLowerCase()))):r,[r,x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nx,{fallbackClosePath:Ms.COMMUNITY_USERS({organizationId:t}),heading:n("gestion_des_mem_14016"),children:(0,i.jsxs)(kx,{children:[(0,i.jsx)(Xl,{align:"center",justify:"between",children:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("liste_des_membr_20115")}),g>0&&(0,i.jsx)(Lm,{color:"warning",size:"sm",children:n("_1_doublon_pot_74382",g)})]}),(0,i.jsx)(Zr,{color:"gray500",children:n("s_lectionner_le_91896")})]})}),(0,i.jsx)(ic,{height:"6"}),0===g?(0,i.jsxs)(gg,{children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("nom_du_membre_69353")}),(0,i.jsx)(Mg,{children:n("membre_principa_09597")})]}),(0,i.jsx)(Eg,{css:{height:"400px"},children:(0,i.jsx)(_g,{css:{height:"100%"},children:(0,i.jsx)(Jw,{subtitle:"",title:n("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",justify:"between",children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{placeholder:n("rechercher_un_m_05904"),value:x,onChange:_})}),(0,i.jsx)(yc,{color:"white",leftIcon:"gear",onClick:()=>{m(!0)},children:n("_diter_les_colo_39630")})]}),(0,i.jsx)(ic,{height:"6"}),j.map(({id:e,usersInfos:n})=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(CV,{customFields:a,displayColumns:h,selectedId:l[e],usersInfos:n,onSelect:n=>{c(t=>({...t,[e]:n}))},onSuccess:()=>{d(n=>n.filter(n=>n.id!==e))}}),(0,i.jsx)(ic,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(CI,{columns:I,initialSelectedColumns:h,saveButtonText:n("_diter_62574"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_96096"),title:n("_dition_des_col_70300"),onClose:()=>{m(!1)},onSave:f})]})},AV=()=>{const{params:{organizationId:e}}=fc(),{data:n,loader:t}=rs("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},[Ko.CustomFieldWithConditionFragment],undefined);return t||(0,i.jsx)(bV,{organization:n.organization})},EV=()=>{const{translate:e,params:{organizationId:n}}=fc();fm(e("communaut_20896"));const{hasFeature:t}=Yy(),{canDelegationEdit:s,canDelegationRead:o,canFormRead:a,canWorkflowEdit:r,canWorkflowRead:d}=iC();return t(In.Community)?(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Ms.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(BL,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(AV,{})}),(0,i.jsx)(Xr.qh,{path:[Ev.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),Ev.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(MP,{})}),(0,i.jsx)(Xr.qh,{path:Ms.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(yV,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),children:(0,i.jsx)($M,{children:(0,i.jsx)(dF,{})})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Nv.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(xC,{isTemplate:!0})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Nv.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(xC,{isTemplate:!1})}),(0,i.jsx)(Xr.qh,{path:Nv.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(jC,{})}),(0,i.jsx)(Xr.qh,{path:Nv.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(NL,{})})}),(0,i.jsx)(Xr.qh,{path:Nv.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(ib,{})})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(fR,{isCreateOpen:!0})})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(fR,{isCreateOpen:!1})})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(dD,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(LD,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(MD,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(yD,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(WD,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(bR,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(hD,{})}),a&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(AR,{})}),(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(KF,{})}),(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(rR,{})}),(0,i.jsx)(Xr.qh,{path:Ev.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(Yk,{})})}),s&&(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(nE,{})}),s&&(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(iE,{})}),o&&(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(UL,{children:(0,i.jsx)(XU,{})})}),o&&(0,i.jsx)(Xr.qh,{path:vo.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(ZO,{isEvent:!1})})}),o&&(0,i.jsx)(Xr.qh,{path:Wo.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(UL,{children:(0,i.jsx)(DO,{})})}),r&&(0,i.jsx)(Xr.qh,{path:Vv.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(zN,{})}),r&&(0,i.jsx)(Xr.qh,{path:Vv.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(ON,{})}),d&&(0,i.jsx)(Xr.qh,{path:Vv.WORKFLOW({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(AL,{})})}),d&&(0,i.jsx)(Xr.qh,{path:Vv.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(UL,{children:(0,i.jsx)(_L,{})})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Ms.COMMUNITY_USERS({organizationId:n}),replace:!0})})]}):(0,i.jsx)(UL,{children:(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Pv,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};var wV,$V,TV;let zV=class extends Eh{constructor(e,n,t){super(e,n,t)}getCustomFieldsFilters(e,n,t){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Select,values:(0,Tg.A)(t.customFieldsCategories.nodes,e=>b(e.name)),hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Select,values:ui.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Select,values:(0,Tg.A)(ti.filter(e=>!n||e!==Ke.Event).map(e=>({id:e,name:hb(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"condition",name:this.t("condition_61066"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Select,values:t.customFields.nodes},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"hasValidationRules",name:this.t("r_gles_de_valid_33082"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Checkbox,hideEmpty:!0},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:Sn.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:Ze.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:Ze.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:Ze.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:Ze.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:Ze.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:Ze.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:Ze.CreatedAt,minWidth:180}]}};zV=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(wV=void 0!==dh&&dh)?wV:Object,"function"==typeof($V=void 0!==Wg&&Wg)?$V:Object,"function"==typeof(TV=void 0!==ts&&ts)?TV:Object])],zV);const OV=(0,de.createContext)({}),RV=e=>{const n=WL(Ua,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)(OV.Provider,{value:{getCustomFieldsCategories:n},children:e.children})},DV=e=>{const{translate:n}=fc(),{getCustomFieldsCategories:t}=(0,de.useContext)(OV),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("Category")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(nf,{label:n("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))})},MV=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{mutate:s}=La();return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:Dn.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},PV=e=>(0,i.jsx)(MV,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:Ye.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(DV,{setValue:n,value:e}),renderValue:e.customField.category.name}),kV=e=>{const{translate:n}=fc();return(0,i.jsx)(MV,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:Ye.Label,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{name:n("label_08243"),value:e,onChange:t}),renderValue:e.customField.label||""})},FV=e=>{const{translate:n}=fc();return(0,i.jsx)(MV,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:Ye.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_du_champ_48329"),value:e,onChange:t}),renderValue:()=>(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Zr,{color:"gray800",css:{clamp:2,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:n("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},NV=e=>{const{history:n,params:{eventId:t}}=fc(),s=e.customField.variety===Ke.UserInfo&&e.customField.numberOfTimesUsed>0;return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:s?(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{n.push(av.CUSTOM_FIELD_USAGE({organizationId:e.organizationId,eventId:t,segmentId:e.segmentId,customFieldId:e.customField.id}))},children:e.customField.numberOfTimesUsed}):e.customField.numberOfTimesUsed})},LV=e=>{const{translate:n}=fc();return(0,i.jsx)(MV,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:Ye.Privacy,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(nf,{label:n("Privacy"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("Private")}),(0,i.jsx)("option",{value:"false",children:n("Public")})]}),renderValue:()=>e.customField.isPrivate?(0,i.jsx)(Lm,{color:"gray",leftIcon:"lock",children:n("Private")}):(0,i.jsx)(Lm,{color:"primary",leftIcon:"globe",children:n("Public")})})},UV=e=>{const{translate:n}=fc();return"id"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(FV,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(kV,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(PV,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Xl,{children:[(0,i.jsx)(Zr,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(pc,{icon:oA(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(ic,{width:"2"}),(0,i.jsx)(Zr,{color:"gray800",children:n(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(NV,{column:e.column,customField:e.row,organizationId:e.organizationId,segmentId:e.segmentId}):"state"===e.column.slug?(0,i.jsx)(LV,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===Ke.UserInfo?`{user.${e.row.slug}}`:e.row.variety===Ke.Event?`{event.${e.row.slug}}`:e.row.variety===Ke.Delegation?`{delegation.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:hb(n,e.row.variety)}):"isEncrypted"===e.column.slug?(0,i.jsx)(_g,{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)(aL,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(_g,{})},VV=e=>{const{history:n,translate:t,params:{eventId:s}}=fc(),{showNotification:o}=Sy(),[a,r]=(0,de.useState)(!1),{mutate:d}=Bd(),{mutate:l}=Vd(),[c,u]=(0,de.useState)(!1),m=e.customField.fieldType!==_n.Select||e.customField.isSelectV2;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{isOpen:a,onStateChange:r,children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Am,{onClick:t=>{vm(t.target),n.push(av.UPDATE({organizationId:e.organizationId,eventId:s,customFieldId:e.customField.id}))},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(pc,{icon:"pen"}),t("_diter_62574")]})}),m&&(0,i.jsx)(Am,{onClick:async t=>{vm(t.target);const{customFieldsMassDuplicate:i}=await d({organizationId:e.organizationId,eventId:s,selecteds:{ids:[e.customField.id]}});e.reload(),n.push(av.UPDATE({organizationId:e.organizationId,eventId:s,customFieldId:i[0].id}))},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(pc,{icon:"clone"}),t("dupliquer_28256")]})})]}),(0,i.jsx)(v$,{children:e.customField.canDelete&&(0,i.jsx)(Am,{color:"red",onClick:()=>{r(!1),u(!0)},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(pc,{icon:"trash-can"}),t("supprimer_43083")]})})})]}),c&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_96670"),text:t("suppression_de_73669",e.customField.name),onClose:()=>{u(!1)},onDelete:async()=>{await l({organizationId:e.organizationId,eventId:s,selecteds:{ids:[e.customField.id]}}),o(t("le_champ_1_43589",e.customField.name)),e.reload()}})]})},BV=()=>{const{translate:e,params:{eventId:n}}=fc(),{massActions:t,predicates:s}=ah(),{onMassEditSuccess:o,organizationId:a,segment:r}=DN(),{showNotification:d}=Sy(),{mutate:l}=La(),{mutate:c}=Bd(),{mutate:u}=Vd(),[m,g]=(0,de.useState)(!1),[h,p]=(0,de.useState)(!1),I=t.getSelectedsInput(s,null),f=t.isAllSelected?r.count:t.numberOfSelected,x=(0,de.useCallback)(e=>{w(e)&&d(e),o()},[o]),_=(0,de.useCallback)(async()=>{const t=(await c({organizationId:a,eventId:n,selecteds:I})).customFieldsMassDuplicate.length;x(e("_1_champs_ont_57847",t))},[c,x,a,n,I,e]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>g(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"clone",onClick:_,children:e("dupliquer_28256")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>p(!0),children:e("supprimer_43083")})})]})]}),m&&(0,i.jsx)($$,{mutate:e=>l({organizationId:a,eventId:n,massEdit:e}),organizationId:a,selecteds:I,onClose:()=>g(!1),onSuccess:n=>x(e("_1_champs_pers_55120",n))}),h&&(0,i.jsx)(f$,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",f),onClose:()=>p(!1),onDelete:async()=>{const t=(await u({organizationId:a,eventId:n,selecteds:I})).numberOfCustomFields;x(e("_1_champs_pers_68086",t))}})]})},WV=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc();return(0,i.jsx)(gL,{children:(0,i.jsx)(lC,{permissions:nC.CUSTOM_FIELD_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{e.push(av.CREATE({organizationId:t,eventId:s}))},children:n("cr_er_un_champ_31226")})})})},GV=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,customFieldId:o}}=fc(),{data:a,loader:r}=rs("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:t,customFieldId:o},[],undefined);const d=a.organization?.customField;return(0,i.jsx)(fI,{returnToFallback:av.CUSTOM_FIELDS({organizationId:t,eventId:s}),size:"sm",children:r?(0,i.jsx)(xI,{children:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(YC,{children:n("nombre_d_utilis_58389")}),(0,i.jsxs)(xI,{children:[(0,i.jsx)(ic,{height:"9"}),(0,i.jsxs)(Xl,{align:"center",direction:"column",children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(pc,{icon:oA(d.fieldType,d.fieldProperty)})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:d.name})]}),(0,i.jsx)(ic,{height:"9"}),d.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_de_missio_27210",d.positions.length)}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{direction:"column",gap:"6",children:d.positions.map(n=>(0,i.jsxs)(Zr,{css:{cursor:"pointer"},onClick:()=>{e.push(Eo.POSITION({organizationId:t,eventId:n.event.id,positionId:n.id}))},children:[(0,i.jsx)(Zr,{color:"gray800",children:n.event.name}),(0,i.jsx)(Zr,{color:"gray500",children:n.name})]},n.id))}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("liste_des_formu_84836",d.forms.length)}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{direction:"column",gap:"6",children:d.forms.map(t=>{const s=t.event?t.event.name:n("communaut_20896");return(0,i.jsxs)(Zr,{css:{cursor:"pointer"},onClick:()=>{e.push(Ks.FORM({organizationId:t.organization.id,eventId:t.event?.id,formId:t.id}))},children:[(0,i.jsx)(Zr,{color:"gray800",children:s}),(0,i.jsx)(Zr,{color:"gray500",children:t.name})]},t.id)})}),(0,i.jsx)(ic,{height:"9"})]})]})})},qV=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=fc(),{canCustomFieldEdit:o,canSegmentEdit:a}=tC();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WV,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(BV,{}),searchPlaceholder:e("rechercher_un_c_49598"),showActions:o,showEditColumns:a,showEditMode:o,showSearchColumns:!1})}),(0,i.jsx)(px,{getEditPath:e=>av.UPDATE({organizationId:n,eventId:t,customFieldId:e.id}),renderCell:(e,t,o)=>(0,i.jsx)(UV,{column:e,organizationId:n,reloadRow:o,row:t,segmentId:s}),renderRowDropdown:(e,t)=>(0,i.jsx)(VV,{customField:e,organizationId:n,reload:t})}),(0,i.jsx)(Xr.dO,{children:(0,i.jsx)(Xr.qh,{path:av.CUSTOM_FIELD_USAGE({organizationId:":organizationId",eventId:t?":eventId":void 0,segmentId:":segmentId",customFieldId:":customFieldId"}),children:(0,i.jsx)(GV,{})})})]})]})},HV=e=>{const{translate:n,params:{organizationId:t,eventId:s,segmentId:o}}=fc(),{canCustomFieldEdit:a,canSegmentEdit:r}=tC(),d=ss(zV),l=(0,de.useMemo)(()=>d.getCustomFieldsFilters(t,s,e.organization),[e.organization,t,s]),c=(0,de.useMemo)(()=>d.getCustomFieldsPossibleColumns(),[]),u=(0,de.useMemo)(()=>({level:s?kn.Event:kn.Organization}),[s]);return(0,i.jsx)(RV,{organizationId:t,children:(0,i.jsx)(JN,{canSegmentEdit:r,eventId:s,filters:l,filtersButtonText:n("filtrer_les_cha_91574"),filtersSubtitle:n("appliquer_des_f_27562"),getSegmentPath:e=>av.CUSTOM_FIELDS_SEGMENT({organizationId:t,eventId:s,segmentId:e}),initialLimit:e.initialLimit??jg,initialSegmentsOpen:e.initialSegmentsOpen??!0,loadDataList:Ya,loadDataListParams:u,loadRow:Ud,organizationId:t,possibleColumns:c,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:lt.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e.setLimit,showMassActions:a,showRowDropdown:a,showRowEdit:a,onSegmentClick:e.onSegmentClick,onSegmentDelete:e.onSegmentDelete,onSegmentsToggle:e.onSegmentsToggle,children:(0,i.jsx)(qV,{})})})},YV=lh([{operator:Zn.Is,slug:"condition",value:[]}]);function ZV(e){return(0,de.useMemo)(()=>e.flatMap(e=>e.segments).map(e=>e.id),[e])}const KV=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=fc(),{event:{name:o},localEvent:a,updateLocalEvent:r}=Ly();fm(`${o} ${s("champs_de_formu_64126")}`);const{data:d,loader:l,reload:c}=Wd({organizationId:n,eventId:t,level:kn.Event,predicatesGroups:YV}),u=ZV(d.organization?.segmentsFolders??[]);return l||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:av.CUSTOM_FIELDS_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(HV,{initialLimit:a?.customFieldsLimit,initialSegmentsOpen:a?.areCustomFieldsSegmentsOpen,organization:d.organization,reload:c,setLimit:e=>{r({customFieldsLimit:e})},onSegmentClick:e=>{r({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await r({customFieldsSegmentId:null}),e.replace(av.CUSTOM_FIELDS({organizationId:n,eventId:t}))},onSegmentsToggle:async e=>{await r({areCustomFieldsSegmentsOpen:e})}})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:av.CUSTOM_FIELDS_SEGMENT({organizationId:n,eventId:t,segmentId:a?.customFieldsSegmentId&&u.includes(a.customFieldsSegmentId)?a.customFieldsSegmentId:u[0]}),replace:!0})})]})},XV=()=>{const{history:e,params:{organizationId:n},translate:t}=fc(),{localOrganization:s,updateLocalOrganization:o}=Yy();fm(t("champs_de_formu_64126"));const{data:a,loader:r,reload:d}=Wd({organizationId:n,level:kn.Organization,predicatesGroups:YV}),l=ZV(a.organization?.segmentsFolders??[]);return r||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:av.CUSTOM_FIELDS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(HV,{initialLimit:s?.customFieldsLimit,initialSegmentsOpen:s?.areCustomFieldsSegmentsOpen,organization:a.organization,reload:d,setLimit:e=>{o({customFieldsLimit:e})},onSegmentClick:e=>{o({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await o({customFieldsSegmentId:null}),e.replace(av.CUSTOM_FIELDS({organizationId:n}))},onSegmentsToggle:async e=>{await o({areCustomFieldsSegmentsOpen:e})}})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:av.CUSTOM_FIELDS_SEGMENT({organizationId:n,segmentId:s?.customFieldsSegmentId&&l.includes(s.customFieldsSegmentId)?s.customFieldsSegmentId:l[0]}),replace:!0})})]})};var QV;let JV=class extends ju{constructor(e){super(e)}delegationCategoryInputDefault(e){return{name:e.name,banners:e.banners}}};JV=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(QV=void 0!==ts&&ts)?QV:Object])],JV);var eB;let nB=class extends ju{constructor(e){super(e)}delegationCategoryBannerInputDefault(){return{bannerType:-1,bannerVehicleType:De.Car,min:1,max:10}}};nB=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(eB=void 0!==ts&&ts)?eB:Object])],nB);const tB=e=>{const{translate:n}=fc(),t=ss(nB),s=zg(),o=(0,de.useMemo)(()=>(e.bannersCustomFields?.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e.toString(10),children:n},e))},e.id)),[e.bannersCustomFields]);return(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.values.map((t,a)=>{const r=`${e.prefix}[${a}].`;return(0,i.jsxs)(Xl,{align:"start",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"4",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("type_de_bandeau_34965"),name:`${r}bannerType`,children:o}),(0,i.jsx)(Qy,{label:n("type_de_v_hicul_88166"),name:`${r}bannerVehicleType`,children:s(Yt)})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:n("commence_par_la_30514"),min:0,name:`${r}min`,shouldParseAsInt:!0}),(0,i.jsx)(pu,{label:n("jusqu_la_vale_40572"),min:0,name:`${r}max`,shouldParseAsInt:!0})]})]}),(0,i.jsx)(Xl,{align:"end",css:{paddingTop:"$6"},children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",onClick:()=>{e.change(e.prefix,e.values.filter((e,n)=>n!==a))}})})]},a)}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.prefix,[...e.values,t.delegationCategoryBannerInputDefault()])},children:n("ajouter_un_band_94873")})})]})},iB=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,delegationCategoryId:o}}=fc(),{showNotification:a}=Sy(),r=ss(JV),{data:d,loader:l}=rs("query DelegationCategoryToEdit(\n $organizationId: OrganizationId!\n $delegationCategoryId: DelegationsCategoryId!\n $loadBannersCustomFields: Boolean!\n $bannersCustomFieldsIds: [CustomFieldId!]!\n) {\n organization(id: $organizationId) {\n customFields(ids: $bannersCustomFieldsIds) @include(if: $loadBannersCustomFields) {\n nodes {\n id\n name\n\n values {\n id\n value\n }\n }\n }\n\n delegationCategory(id: $delegationCategoryId) {\n id\n name\n\n banners {\n bannerType\n bannerVehicleType\n min\n max\n }\n }\n }\n}\n",{organizationId:t,delegationCategoryId:o,loadBannersCustomFields:Sp(t),bannersCustomFieldsIds:Sp(t)?yp():[]},[],undefined);const{mutate:c}=function(e={}){return ds("mutation DelegationCategoryUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $delegationCategory: DelegationsCategoryUpdateInput!\n) {\n delegationCategoryUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}(),u=(0,de.useMemo)(()=>f(d.organization?.delegationCategory.banners),[d.organization]);return fm(n("mise_jour_de_17055",d.organization?.delegationCategory.name)),l||(0,i.jsx)(Fc,{height:1,initialValues:{delegationCategory:r.delegationCategoryInputDefault(d.organization.delegationCategory)},render:({form:e,handleSubmit:a,submitting:r,values:l})=>(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{isLoading:r,onClick:a,children:n("mettre_jour_l_94846")}),category:n("mise_jour_de_17055",d.organization.delegationCategory.name),color:"dark",fallbackClosePath:vo.DELEGATION_CATEGORY({organizationId:t,eventId:s,delegationCategoryId:o}),heading:d.organization.delegationCategory.name,children:(0,i.jsxs)(kx,{children:[(0,i.jsx)(Zx,{heading:n("informations_su_03761"),children:(0,i.jsx)(pu,{label:n("nom_de_la_cat_g_03860"),name:"delegationCategory.name"})}),Sp(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("bandeaux_v_hicu_49859"),initialIsOpen:u,isToggleable:!0,onToggle:n=>{n||e.change("delegationCategory.banners",[])},children:(0,i.jsx)(tB,{bannersCustomFields:d.organization.customFields,change:e.change,prefix:"delegationCategory.banners",values:l.delegationCategory.banners})})]}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:r,textAlign:"center",onClick:a,children:n("mettre_jour_l_94846")})})]})}),width:1,onSubmit:async i=>{await c({organizationId:t,eventId:s,delegationCategoryId:o,delegationCategory:i.delegationCategory}),a(n("la_cat_gorie_a_28053")),e.goBack(vo.DELEGATION_CATEGORY({organizationId:t,eventId:s,delegationCategoryId:o}))}})},sB=e=>{const{translate:n}=fc();return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("lier_un_champ_p_01331")})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(_A,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},oB=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("aucun_champ_per_72101")}),(0,i.jsx)(sB,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},aB=e=>{const{canFormEdit:n}=tC(),t=(0,de.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(yI,{ids:e.formCustomFieldsValues.map(e=>e.id),onReorder:e.onReorder,children:(0,i.jsx)(Xl,{css:{bd:!0},direction:"column",width:1,children:e.formCustomFieldsValues.map((s,o)=>(0,i.jsx)(QR,{canEdit:n,css:{border:"none",borderBottom:"1px solid $gray200",borderRadius:"0",boxShadow:"none","&:last-child":{borderBottom:"none"}},elementId:s.id,field:t[s.customFieldId],index:o,isMandatory:s.isMandatory,showEdit:!1,toggleIsMandatory:e.toggleMandatory,updateCustomField:Ou.A,onDelete:e.onDelete},s.id))})})},rB=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),s=(0,de.useCallback)(n=>{e.change(`${e.prefix}formCustomFields`,n)},[e.prefix,e.change]),o=(0,de.useCallback)(n=>{t.has(n.id)?s(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==n.id)):s([...e.formCustomFieldsValues,{id:ce(),customFieldId:n.id,isMandatory:!0}])},[e.formCustomFieldsValues,t,s]),a=(0,de.useCallback)((n,t)=>{s(S(e.formCustomFieldsValues,n,t))},[e.formCustomFieldsValues,s]),r=(0,de.useCallback)((n,t)=>{s((0,mI.jM)(e.formCustomFieldsValues,e=>{e[n].isMandatory=t}))},[e.formCustomFieldsValues,s]),d=(0,de.useCallback)(n=>{s((0,mI.jM)(e.formCustomFieldsValues,e=>{e.splice(n,1)}))},[e.formCustomFieldsValues,s]);return(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsx)(Xl,{width:280,children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("champs_personna_17489")})}),(0,i.jsx)(Xl,{css:{flex:"1"},children:f(e.formCustomFieldsValues)?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(aB,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:r,onDelete:d,onReorder:a}),(0,i.jsx)(sB,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:t,toggle:o})]}):(0,i.jsx)(oB,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:t,toggle:o})})]})},dB=e=>{const{params:{organizationId:n}}=fc(),t=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),s=(0,de.useMemo)(()=>(0,l.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(Xl,{direction:"column",children:[t.map((t,o)=>{const a=s[t.id];return(0,i.jsxs)(de.Fragment,{children:[0!==o&&(0,i.jsx)(Yj,{height:"5"}),(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsx)(Xl,{width:280,children:(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:t.name})}),(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",gap:"4",children:a.map(t=>(0,i.jsx)(xA,{change:e.change,display:!0,field:t,fileAcl:"public-read",isMandatory:!1,organizationId:n,prefix:`${e.prefix}fields.`},t.id))})]})]},t.id)}),f(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)(Yj,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(rB,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},lB=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc(),o=ss(Bj),{organization:a}=Yy(),r=(0,de.useMemo)(()=>(0,Tg.A)(e.groups,e=>b(e.name)),[e.groups]),d=(0,de.useCallback)(n=>{const t=e.groupsAccesses.filter((e,t)=>t!==n&&e.groupId).map(({groupId:e})=>e);return r.filter(e=>!t.includes(e.id)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},[r,e.groupsAccesses]),l=(0,de.useMemo)(()=>(0,Tg.A)(a.roles.filter(e=>e.accessLevel===rt.Event),e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[a.roles]);return _(r)?(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:t("vous_n_avez_pas_50446")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:t("un_groupe_donne_90412")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(yc,{color:"white",onClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_GROUPS(s))},children:t("cr_er_un_groupe_03956")})]}):(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.groupsAccesses.map((n,s)=>(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("acc_s_n_1_17158",s+1)}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("groupe_74342"),name:`event.groupsAccesses[${s}].groupId`,renderOnPortal:!0,shouldParseAsInt:!0,children:d(s)})}),(0,i.jsx)(Zr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"arrow-right"})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Kx,{label:t("r_le_59302"),name:`event.groupsAccesses[${s}].roleId`,renderOnPortal:!0,shouldParseAsInt:!0,children:l})}),(0,i.jsx)(Zr,{css:{paddingTop:"$6"},children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("event.groupsAccesses",y(e.groupsAccesses,s))}})})]})]},s)),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("event.groupsAccesses",e.groupsAccesses.concat([o.eventGroupAccessDefault()]))},children:t("ajouter_un_grou_74184")})})]})},cB=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc(),o=ss(dh),a=(0,de.useMemo)(()=>Tj.map((e,n)=>(0,i.jsx)("option",{value:e,children:e},n)),[]);return(0,i.jsxs)(Xl,{direction:"column",children:[e.showEmailSender&&(0,i.jsx)(FA,{heading:t("_metteur_94615"),children:(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:t("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsxs)(FA,{heading:t("langues"),children:[(0,i.jsx)(ud,{name:"event.languages",onChange:n=>{!e.hasLanguagesFeature&&n.length>1&&e.change("event.languages",[(0,eh.A)(n)])}}),(0,i.jsx)(Kx,{label:t("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:Xu.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})]}),(0,i.jsx)(FA,{heading:t("heure_28539"),children:(0,i.jsxs)(Wu,{gap:"6",gridtemplatecolumns:"1fr 1fr",children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("fuseau_horaire_14654"),name:"event.timeZone",children:a}),(0,i.jsx)(iy,{label:t("heure_laquell_13491"),name:"event.dayStartTime"})]})}),(0,i.jsx)(FA,{heading:t("localisation_38416"),children:(0,i.jsxs)(Wu,{gap:"6",gridtemplatecolumns:"1fr 1fr",children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("Country"),name:"event.country",children:o.getCountriesIdName().map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsxs)(Qy,{label:t("Layer"),name:"event.layer",children:[(0,i.jsx)("option",{value:Rn.Google,children:t("plan_24242")}),(0,i.jsx)("option",{value:Rn.GoogleSatellite,children:t("satellite_64364")}),(0,i.jsx)("option",{value:Rn.IgnPlan,children:t("plan_ign_03240")})]}),(0,i.jsx)(qx,{label:(0,i.jsx)($S,{children:t("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(qx,{label:(0,i.jsx)($S,{children:t("longitude_par_d_28326")}),name:"event.longitude"})]})}),f(e.delegationsSpaceLayouts)&&(0,i.jsx)(FA,{heading:t("espace_d_l_gati_13152"),children:(0,i.jsx)(Kx,{label:(0,i.jsx)($S,{children:t("layout_de_l_esp_40392")}),name:"event.delegationsSpaceLayoutId",children:e.delegationsSpaceLayouts.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),e.weezeventOrganizationId&&(0,i.jsx)(FA,{heading:t("weezevent"),children:(0,i.jsxs)(Wu,{gap:"3",gridtemplatecolumns:"1fr 1fr",children:[(0,i.jsx)(Jx,{name:"event.isWeezticketSynchronized",children:t("synchroniser_av")}),(0,i.jsx)(Jx,{name:"event.isWeezaccessSynchronized",children:t("WeezeventIsSynchronized")})]})}),(0,i.jsx)(FA,{heading:t("modules_activ_s_07626"),children:(0,i.jsxs)(Wu,{gap:"3",gridtemplatecolumns:"1fr 1fr",children:[(0,i.jsx)(Jx,{name:"event.usePositions",children:t("missions_63972")}),(0,i.jsx)(Jx,{name:"event.useAccreditations",children:t("accr_ditations_39450")}),(0,i.jsx)(Jx,{name:"event.useDelegations",children:t("d_l_gations_78318")}),(0,i.jsx)(Jx,{name:"event.useForms",children:t("Form_plural")}),(0,i.jsx)(Jx,{name:"event.useCampaigns",children:t("Campaigns")}),(0,i.jsx)(Jx,{name:"event.useDocuments",children:t("Documents")}),(0,i.jsx)(Jx,{name:"event.useWorkflows",children:t("automatisations_60045")})]})})]})},uB=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc(),o=ss(Bj),a=ss(ec),r=ss(Ub),{hasFeature:d,reload:l}=Yy(),{canOrganizationUserEdit:c}=iC(),u=(0,de.useRef)(null),m=(0,de.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),g=(0,de.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&&"number"!=typeof e.initialValues.delegationsSpaceLayoutId),[e.initialValues]),h=(0,de.useMemo)(()=>f(e.initialValues.groupsAccesses),[e.initialValues]),I=(0,de.useMemo)(()=>e.isEdit&&f(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),x=(0,de.useMemo)(()=>w(e.initialValues.description),[e.initialValues]),_=(0,de.useMemo)(()=>!!e.isEdit&&f(e.initialValues.tagsIds),[e.isEdit,e.initialValues]),j=(0,de.useCallback)(n=>a.validateForForm(o.createUpdateEventSchema(r.changedFieldsSchema(e.eventCustomFields,m.event.fields,n.event.fields)))(n),[e.eventCustomFields,m]);return(0,i.jsx)(Fc,{customErrorRef:u,height:1,initialValues:m,initialValuesEqual:()=>!0,render:({form:n,handleSubmit:o,values:a})=>(0,i.jsx)(Nx,{button:e.isEdit&&(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:o,children:t("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:eo.EVENTS({organizationId:s}),heading:e.isEdit?t("mise_jour_de_17055",e.initialValues.name):t("cr_ation_d_un_94106"),children:(0,i.jsxs)(kx,{ref:u,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:t("dites_en_nous_u_13238"),subtitle:t("param_trer_votr_94121"),children:(0,i.jsx)(Jj,{form:n,values:a})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("options_avanc_e_12396"),initialIsOpen:g,isToggleable:!0,subtitle:t("param_trer_l_m_66748"),children:(0,i.jsx)(cB,{change:n.change,delegationsSpaceLayouts:e.delegationsSpaceLayouts,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:d(In.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("groupes_34813"),initialIsOpen:h,isToggleable:!0,subtitle:t("donner_acc_s_41454"),onToggle:e=>{e||n.change("event.groupsAccesses",[])},children:(0,i.jsx)(lB,{change:n.change,groups:e.organization.groups.nodes,groupsAccesses:a.event.groupsAccesses||p})})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("champs_de_formu_64126"),initialIsOpen:I,isToggleable:!0,subtitle:t("ajouter_des_inf_87361"),onToggle:e=>{e||n.change("event.fields",{})},children:(0,i.jsx)(dB,{change:n.change,customFields:e.eventCustomFields,formCustomFields:p,formCustomFieldsValues:p,prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("Description"),initialIsOpen:x,isToggleable:!0,subtitle:t("ajouter_une_des_44242"),onToggle:e=>{e||n.change("event.description","")},children:(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:t("description_58935")}),name:"event.description"})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zx,{heading:t("tags_79499"),initialIsOpen:_,isToggleable:!0,subtitle:t("ajouter_des_tag_23887"),onToggle:e=>{e||n.change("event.tagsIds",[])},children:(0,i.jsx)(hA,{change:n.change,name:"event.",organizationId:s,tags:e.organization.tags.nodes,tagsIds:a.event.tagsIds})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,textAlign:"center",onClick:o,children:e.isEdit?t("mettre_jour_l_28846"):t("cr_er_l_v_neme_16731")})})]})}),validate:j,width:1,onSubmit:async t=>{const i=await e.mutate({organizationId:s,event:c?t.event:{...t.event,groupsAccesses:null}});l(),e.isEdit?n.goBack(eo.EVENT({organizationId:s,eventId:i})):n.replace(eo.EVENT({organizationId:s,eventId:i}))}})},mB=()=>{const e=ss(Bj),{params:{organizationId:n},translate:t}=fc();fm(t("cr_er_l_v_neme_16731"));const{data:s,loader:o}=rs("query EventCreateInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n}\n",{organizationId:n},[Ko.CreateUpdateEventInfosFragment],undefined);const{mutate:a,isLoading:r}=function(e={}){return ds("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)(uB,{delegationsSpaceLayouts:p,eventCustomFields:s.organization?.eventCustomFields.nodes??p,initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:r,mutate:async e=>{const{eventCreate:{id:n}}=await a(e);return n},organization:s.organization})},gB=()=>{const e=ss(Bj),{params:{organizationId:n,eventId:t},translate:s}=fc(),{data:o,loader:a}=rs("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 isWeezticketSynchronized\n isWeezaccessSynchronized\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n delegationsSpaceLayoutId\n\n groupsAccesses {\n groupId\n roleId\n }\n\n delegationsSpaceLayouts {\n id\n name\n }\n }\n}\n",{organizationId:n,eventId:t},[Ko.CreateUpdateEventInfosFragment],undefined);fm(`${s("mettre_jour_l_28846")}: ${o.event?.name}`);const{mutate:r,isLoading:d}=function(e={}){return ds("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 a||(0,i.jsx)(uB,{delegationsSpaceLayouts:o.event?.delegationsSpaceLayouts??p,eventCustomFields:o.organization?.eventCustomFields.nodes??p,initialValues:e.eventInputDefault(o.event),isEdit:!0,isMutateLoading:d,mutate:async e=>{const{eventUpdate:{id:n}}=await r({...e,eventId:t});return n},organization:o.organization})};var hB,pB,IB;let fB=class extends vF{static{hB=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...vF.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",IsWeezticketSynchronized:"isWeezticketSynchronized",IsWeezaccessSynchronized:"isWeezaccessSynchronized",UseAccreditations:"useAccreditations",UseCampaigns:"useCampaigns",UseDelegations:"useDelegations",UseDocuments:"useDocuments",UseForms:"useForms",UsePositions:"usePositions",UseWorkflows:"useWorkflows"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===wn.Update?[hB.IMPORT_COLUMNS_DEFAULT.Id]:[],hB.IMPORT_COLUMNS_DEFAULT.Name,hB.IMPORT_COLUMNS_DEFAULT.StartAt,hB.IMPORT_COLUMNS_DEFAULT.EndAt];constructor(e,n){super(e,n),this.csvInputService=e}};fB=hB=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(pB=void 0!==hF&&hF)?pB:Object,"function"==typeof(IB=void 0!==ts&&ts)?IB:Object])],fB);const xB=()=>{const{params:{organizationId:e},translate:n}=fc(),{mutate:t}=function(e={}){return ds("mutation EventsImport($organizationId: OrganizationId!, $input: MappableImportInput!) {\n jobId: eventsImport(organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkEventsImport:s}=Sy(),o=(0,de.useCallback)((e,n)=>s(e,n),[s]),{data:a,loader:r}=kd({organizationId:e,variety:Ke.Event});return r||(0,i.jsx)(cF,{alertDescriptionKey:"to_add_an_event_37885",children:(0,i.jsx)(YF,{ImportInputService:fB,checkImport:o,closePath:eo.EVENTS({organizationId:e}),customFields:a.organization.customFields.nodes,heading:n("import_events_60816"),importTagPrefix:"events",localStorageKeyPrefix:"EVENTS_IMPORT",mutate:t,returnLink:(0,i.jsx)(Ug,{to:eo.EVENTS({organizationId:e}),children:n("revenir_aux_v_65215")})})})};var _B,jB,vB,SB;function yB(e){return{includeCreatedBy:e.includes(SB.CreatedBy),includeDescription:e.includes(SB.Description),includeNumberOfMembers:e.includes(SB.NumberOfMembers)||e.includes(SB.NumberOfMembersAccredited)||e.includes(SB.NumberOfMembersAssigned)}}!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",e.WeezaccessEventId="weezaccessEventId",e.WeezticketEventId="weezticketEventId"}(SB||(SB={}));let CB=class extends Eh{constructor(e,n,t){super(e,n,t)}getEventsFilters(e,n){return[{slug:"name",name:this.t("nom_de_l_v_nem_08711"),category:this.t("Event"),fieldType:Sn.Text,hideEmpty:!0},{slug:SB.Description,name:this.t("Description"),category:this.t("Event"),fieldType:Sn.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:Sn.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:Sn.Date,hideEmpty:!0},{slug:"state",name:this.t("State"),category:this.t("Event"),fieldType:Sn.Select,values:[{id:gn.Ongoing,name:this.t(gn.Ongoing)},{id:gn.Upcoming,name:this.t(gn.Upcoming)},{id:gn.Done,name:this.t(gn.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:Sn.Select,needLoading:!0,organizationId:e,tagContext:ht.Events},{slug:SB.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("Event"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:SB.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("Event"),fieldType:Sn.Datetime,hideEmpty:!0},...this.customFieldsToFilters(n)]}getEventPossibleColumns(e,n){return[{slug:SB.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:mn.Id,width:100},{slug:SB.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:mn.Name,minWidth:240},{slug:SB.Description,name:this.t("Description"),minWidth:320},{slug:SB.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:mn.StartAt,minWidth:180},{slug:SB.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:mn.EndAt,minWidth:180},{slug:SB.State,name:this.t("State"),minWidth:180},{slug:SB.Tags,name:this.t("tags_79499"),minWidth:320},{slug:SB.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:SB.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:SB.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180},{slug:SB.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:SB.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:mn.CreatedAt,minWidth:180},...n.isWeezeventConnected?[{slug:SB.WeezticketEventId,name:this.t("id_de_levenemen"),minWidth:180},{slug:SB.WeezaccessEventId,name:this.t("id_de_l_v_neme_87336"),minWidth:180}]:[]].concat(this.customFieldsToPossibleColumns(e))}};CB=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(_B=void 0!==dh&&dh)?_B:Object,"function"==typeof(jB=void 0!==Wg&&Wg)?jB:Object,"function"==typeof(vB=void 0!==ts&&ts)?vB:Object])],CB);const bB=e=>{const n=os(),t=ss(Wg);return(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:n("date_de_l_v_ne_69973")}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:_j(t,e.event.startAt,e.event.endAt)})]})},AB=e=>{const n=os();return(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:n("State")}),(0,i.jsx)(Xl,{children:(0,i.jsx)(Lm,{color:jj(e.event.state),children:n(e.event.state)})})]})},EB=e=>{const n=os(),{mutate:t}=function(e={}){return ds("mutation EventsMassArchive(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:s}=Yy();return(0,i.jsx)(f$,{buttonText:n("archiver_26131"),subtext:n("_tes_vous_s_r_d_76724"),text:n("archivage_de_31255",e.event.name),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,selecteds:{ids:[e.event.id]}}),s(),e.onSuccess()}})};var wB;let $B=class extends ju{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,includeCustomFields:!0,includeDelegations:!0,includeEmailsTemplates:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),startAt:e_.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:e_.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 Jo.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Jo.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:Jl.zM(),includeCustomDocuments:Jl.zM(),includeCustomFields:Jl.zM(),includeDelegations:Jl.zM(),includeEmailsTemplates:Jl.zM(),includeForms:Jl.zM(),includePositions:Jl.zM(),includeSegments:Jl.zM(),includeTemplates:Jl.zM(),includeWorkflows:Jl.zM()})}};$B=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(wB=void 0!==ts&&ts)?wB:Object])],$B);const TB=e=>{const n=os(),t=ss($B),s=ss(ec),{mutate:o,isLoading:a}=function(e={}){return ds("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n eventDuplicate(eventId: $eventId, options: $options) {\n id\n }\n}\n",e)}(),{organization:r,reload:d}=Yy(),[l,c]=(0,de.useState)(!1),u=(0,de.useMemo)(()=>r.events.nodes.filter(n=>n.id!==e.event.id),[r.events.nodes]),m=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(ld.lV,{initialValues:{options:t.eventDuplicateInputDefault(e.event)},initialValuesEqual:dd.A,render:({form:t,handleSubmit:s,invalid:o,values:r})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"options.startAt",onChange:e=>{const n=e.plus({days:m});n.equals(r.options.endAt)||t.change("options.endAt",n)}}),(0,i.jsx)(ud,{name:"options.endAt",onChange:e=>{const n=e.minus({days:m});n.equals(r.options.startAt)||t.change("options.startAt",n)}}),(0,i.jsx)(qf,{icon:"clone",children:n("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(Gf,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(oI,{value:l,onChange:e=>{c(e),e||t.change("options.eventId",null)},children:n("dupliquer_les_d_77458")}),l?(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("_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)(pu,{label:n("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(Xl,{gap:"5",children:[(0,i.jsx)(Wx,{label:n("nouvelle_date_d_75723"),min:Jo.c9.utc(),name:"options.startAt"}),(0,i.jsx)(Wx,{label:n("nouvelle_date_d_93958"),min:Jo.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_40297")}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsxs)(Xl,{gap:"5",children:[(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includePositions",children:n("missions_63972")})}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeAccreditations",children:n("accr_ditations_39450")})})]}),(0,i.jsxs)(Xl,{gap:"5",children:[(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeForms",children:n("Form_plural")})}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeDelegations",children:n("d_l_gations_78318")})})]}),(0,i.jsxs)(Xl,{gap:"5",children:[(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeSegments",children:n("vues_personnali_80652")})}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeCustomDocuments",children:n("documents_perso_87374")})})]}),(0,i.jsxs)(Xl,{gap:"5",children:[(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeTemplates",children:n("mod_les_de_camp_58182")})}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeWorkflows",children:n("automatisations_60045")})})]}),(0,i.jsxs)(Xl,{gap:"5",children:[(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeEmailsTemplates",children:n("mod_les_d_e_mai_23121")})}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(Bx,{name:"options.includeCustomFields",children:n("champs_de_formu_64126")})})]})]})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:o,isLoading:a,onClick:s,children:n("dupliquer_28256")})})]}),validate:e=>s.validateForForm(t.eventDuplicateSchema())(e.options),onSubmit:async n=>{await o({eventId:e.event.id,options:n.options}),d(),e.reload(),e.onClose()}})},zB=e=>{const{params:{organizationId:n},translate:t}=fc(),{canEventEdit:s}=iC(),[o,a]=(0,de.useState)(!1),[r,d]=(0,de.useState)(!1),l=(0,de.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)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Xl,{css:{flex:"1"},children:(0,i.jsx)(Ug,{to:Wo.VOLUNTEERS(n,e.event.id),children:e.event.name})}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(bB,{event:e.event}),(0,i.jsx)(AB,{event:e.event}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:t("tags_79499")}),(0,i.jsx)(AE,{badges:l})]})]}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{to:Wo.VOLUNTEERS(n,e.event.id),children:t("voir_l_v_nemen_72358")}),s&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",to:Wo.EDIT_EVENT(n,e.event.id),children:t("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:e=>{vm(e.target),a(!0)},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),d(!0)},children:t("archiver_26131")})})]})]})]})]}),(0,i.jsx)(Yf,{isOpen:o,onClose:()=>{a(!1)},children:(0,i.jsx)(Hf,{children:(0,i.jsx)(TB,{event:e.event,reload:e.reload,onClose:()=>{a(!1)}})})}),r&&(0,i.jsx)(EB,{event:e.event,organizationId:n,onClose:()=>d(!1),onSuccess:e.reload})]})},OB=()=>{const{translate:e}=fc();return(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Xl,{css:{flex:"1"},children:(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(Xl,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:e("State")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(Xl,{width:200})]})},RB=()=>{const{data:e,isLoading:n,limit:t,numberOfPages:s,offset:o,reload:a,setLimit:r,setOffset:d,totalCount:l}=ah();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{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:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(OB,{}),(0,i.jsx)(OB,{}),(0,i.jsx)(OB,{})]}):e.map(e=>(0,i.jsx)(zB,{event:e,reload:a},e.id))}),(0,i.jsx)(wg,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)(Ag,{limit:t,numberOfPages:s,offset:o,setLimit:r,setOffset:d,showLimits:!0,totalCount:l})})]})},DB=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canEventEdit:t}=iC();return(0,i.jsx)(gL,{children:t&&(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"file-import",to:eo.EVENTS_IMPORT({organizationId:n}),onClick:e=>vm(e.target),children:e("importer_via_un_61623")}),path:Wo.CREATE_EVENT(n),children:e("cr_er_un_v_nem_28126")})})},MB=e=>{const{params:{organizationId:n}}=fc(),{mutate:t}=Wa(),s=(0,de.useCallback)(i=>t({organizationId:n,massEdit:{reset:!1,selecteds:{ids:[e.event.id]},slug:cn.Description,strategy:Dn.Replace,value:i}}),[n,e.event.id,t]);return(0,i.jsx)(TU,{column:e.column,mutate:s,reload:e.reload,text:e.event.description,updatable:!0})},PB=e=>{const{params:{organizationId:n}}=fc(),{mutate:t}=Wa();return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:i=>t({organizationId:n,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:Dn.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},kB=e=>{const{translate:n}=fc(),t=ss(Wg);return(0,i.jsx)(PB,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:cn.EndAt,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(df,{label:n("date_de_fin_86920"),value:e,onChange:t}),renderValue:t.toLocaleString(e.event.endAt,da.DateOnly.WeekdayLongMonthLong),updatable:!0})},FB=e=>{const{translate:n,params:{organizationId:t}}=fc(),{isEditMode:s}=ah();return(0,i.jsx)(PB,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:cn.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_de_l_v_nem_08711"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:s,title:e.event.name,updatable:!0,children:(0,i.jsx)(Ug,{to:eo.EVENT({organizationId:t,eventId:e.event.id}),children:(0,i.jsx)(Zr,{css:{clamp:2},title:e.event.name,children:e.event.name})})}),updatable:!0})},NB=e=>{const{translate:n}=fc(),t=ss(Wg);return(0,i.jsx)(PB,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:cn.StartAt,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(df,{label:n("date_de_d_but_43380"),value:e,onChange:t}),renderValue:t.toLocaleString(e.event.startAt,da.DateOnly.WeekdayLongMonthLong),updatable:!0})},LB=(0,de.createContext)({}),UB=e=>{const n=WL(sr,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(LB.Provider,{value:{getTags:n},children:e.children})},VB=e=>{const{translate:n}=fc(),{getTags:t}=(0,de.useContext)(LB),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("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))})},BB=e=>{const n=(0,de.useMemo)(()=>e.event.tags||[],[e.event]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(PB,{column:e.column,eventId:e.event.id,initialValue:n.map(e=>e.id),property:cn.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(VB,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(AE,{badges:t}),updatable:!0})},WB=e=>{const{organization:n}=Yy();return"number"==typeof n.weezeventOrganizationId&&"number"==typeof e.weezeventEventId?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ug,{to:e.getHref(n.weezeventOrganizationId,e.weezeventEventId),children:e.weezeventEventId})}):(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},GB=e=>{const{translate:n}=fc(),{mutate:t}=Wa(),s=(0,de.useCallback)((n,i)=>t({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:Dn.Replace,value:n}}),[e.row,t]);return e.column.slug===SB.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===SB.Name?(0,i.jsx)(FB,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===SB.Description?(0,i.jsx)(MB,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===SB.StartAt?(0,i.jsx)(NB,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===SB.EndAt?(0,i.jsx)(kB,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===SB.Tags?(0,i.jsx)(BB,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===SB.State?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Lm,{color:jj(e.row.state),children:n(e.row.state)})}):e.column.slug===SB.NumberOfMembers?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===SB.NumberOfMembersAccredited?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===SB.NumberOfMembersAssigned?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):e.column.slug===SB.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===SB.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===SB.WeezticketEventId?(0,i.jsx)(WB,{column:e.column,getHref:$x,weezeventEventId:e.row.weezticketEventId}):e.column.slug===SB.WeezaccessEventId?(0,i.jsx)(WB,{column:e.column,getHref:Tx,weezeventEventId:e.row.weezaccessEventId}):(0,i.jsx)(zE,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:!0})},qB=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"clone",onClick:e=>{vm(e.target),o(!0)},children:n("dupliquer_28256")}),(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),r(!0)},children:n("archiver_26131")})]}),(0,i.jsx)(Yf,{isOpen:s,onClose:()=>{o(!1)},children:(0,i.jsx)(Hf,{children:(0,i.jsx)(TB,{event:e.event,reload:e.reload,onClose:()=>{o(!1)}})})}),a&&(0,i.jsx)(EB,{event:e.event,organizationId:t,onClose:()=>r(!1),onSuccess:e.reload})]})},HB=e=>{const{params:{organizationId:n}}=fc(),t=aE(e.customFields);return(0,i.jsx)(px,{getEditPath:e=>Wo.EDIT_EVENT(n,e.id),renderCell:(e,s,o)=>(0,i.jsx)(GB,{column:e,customField:t.get(e.slug),organizationId:n,reloadRow:o,row:s}),renderRowDropdown:(e,n)=>(0,i.jsx)(qB,{event:e,reload:n})})},YB=e=>{const{translate:n}=fc(),{canEventEdit:t}=iC(),{rendering:s}=ah(),o=t&&s===up.List,a=t&&s===up.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(DB,{}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{searchPlaceholder:n("rechercher_un_40024"),showActions:t,showEditColumns:o,showEditMode:a,showSearchColumns:!1})}),s===up.List?(0,i.jsx)(HB,{customFields:e.customFields}):(0,i.jsx)(RB,{})]})]})},ZB=e=>e===up.Card?{includeCreatedBy:!1,includeDescription:!1,includeNumberOfMembers:!1,sort:{attribute:mn.StartAt,direction:ut.Desc}}:{},KB=e=>{const{history:n,translate:t,params:{organizationId:s,segmentId:o}}=fc(),{localOrganization:a,organization:r,updateLocalOrganization:d}=Yy(),{canEventEdit:l,canSegmentEdit:c}=iC(),u=ss(CB),m=(0,de.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),g=(0,de.useMemo)(()=>u.getEventsFilters(s,m),[s,m]),h="number"==typeof r.weezeventOrganizationId,p=(0,de.useMemo)(()=>u.getEventPossibleColumns(m,{isWeezeventConnected:h}),[m,h]);return(0,i.jsx)(UB,{organizationId:s,children:(0,i.jsx)(JN,{canSegmentEdit:c,columnsToIncludes:yB,filters:g,filtersButtonText:t("filtrer_les_v_48869"),filtersSubtitle:t("appliquer_des_f_84816"),getSegmentPath:e=>Wo.EVENTS_SEGMENT(s,e),initialLimit:a?.eventsLimit??jg,initialSegmentsOpen:a?.areEventsSegmentsOpen??!0,loadDataList:sl,loadRow:ol,organizationId:s,possibleColumns:p,possibleRenderings:[up.Card,up.List],reload:e.reload,renderingParams:ZB,segmentId:o,segmentType:lt.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{d({eventsLimit:e})},showRowDropdown:l,showRowEdit:l,onSegmentClick:e=>{d({eventsSegmentId:e})},onSegmentDelete:async()=>{await d({eventsSegmentId:null}),n.replace(eo.EVENTS({organizationId:s}))},onSegmentsToggle:async e=>{await d({areEventsSegmentsOpen:e})},children:(0,i.jsx)(YB,{customFields:m})})})},XB=()=>{const{params:{organizationId:e},translate:n}=fc();fm(n("events_23531"));const{localOrganization:t}=Yy(),{data:s,loader:o,reload:a}=rs("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},[Ko.SegmentCustomFieldFragment,Ko.SegmentsFoldersSegmentsFragment],undefined);const r=(0,de.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(KB,{organization:s.organization,reload:a})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.EVENTS_SEGMENT(e,t?.eventsSegmentId&&r.includes(t.eventsSegmentId)?t.eventsSegmentId:r[0]),replace:!0})})]})},QB=()=>{const{params:{organizationId:e},translate:n}=fc(),{loader:t,data:s}=rs("query EventsMobile($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n }\n }\n }\n}\n",{organizationId:e},[],undefined);return t||(f(s.organization.events.nodes)?(0,i.jsx)(gs,{path:Wo.DASHBOARD_EVENT_SWITCH(e,s.organization.events.nodes[0].id),replace:!0}):(0,i.jsx)(Zr,{children:n("no_events_found_69870")}))},JB={PLURAL:"print-triggers",SINGLE:"print-trigger"},eW=e=>xs([JB.SINGLE,e]),nW={PRINT_TRIGGERS:e=>xs([eo.EVENT(e),JB.PLURAL]),PRINT_TRIGGER:({printTriggerId:e,...n})=>xs([eo.EVENT({...n}),eW(e)]),CREATE:e=>Cs(nW.PRINT_TRIGGERS(e)),UPDATE:e=>bs(nW.PRINT_TRIGGER(e))};var tW;let iW=class extends ju{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return Jl.Ik().shape({customFieldId:Jl.ai().required(this.t("le_champ_person_80074")),conditionValue:Jl.gl().required(this.t("la_condition_es_66568"))})}};iW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(tW=void 0!==ts&&ts)?tW:Object])],iW);var sW;let oW=class extends ju{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return Jl.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return Jl.Ik().shape({name:Jl.Yj(),maxResources:Jl.ai().nullable(),date:e_.typeError(this.t("la_date_est_inv_22002")).nullable()})}};oW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(sW=void 0!==ts&&ts)?sW:Object])],oW);var aW,rW,dW;let lW=class extends ju{accreditationsCustomFieldInput;accreditationsSlotInput;constructor(e,n,t){super(e),this.accreditationsCustomFieldInput=n,this.accreditationsSlotInput=t}createUpdateAccreditationValuesDefault(e,n,t){const i=this.accreditationInputDefault(e,n,t);return{accreditation:i,hasNumberOfDaysLimit:"number"==typeof i.numberOfDaysLimit}}accreditationInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:Jl.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:Jl.Yj(),privateNote:Jl.Yj(),acronym:Jl.Yj(),color:Jl.Yj().required(this.t("la_couleur_est_95740")),icon:Jl.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(pi,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:Jl.zM().required(),address:Jl.Yj().nullable(),latitude:Jl.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:Jl.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:Jl.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:Jl.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(ji,this.t("le_fond_de_cart_48524")),slots:Jl.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:Jl.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Wt,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,n)=>e!==be.Calendar||f(n.parent.slots)&&n.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:Jl.ai().notRequired(),accreditationsCustomFields:Jl.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:Jl.YO(),tagsIds:Jl.YO().of(Jl.ai())})}createUpdateAccreditationSchema(e){const n=this.accreditationInputSchema();return Jl.Ik().shape({accreditation:e?n.shape({fields:e}):n})}accreditationInputDefault(e,n,t){let i=n?.accreditationCategoryId??t;return Number.isInteger(i)||(i=null),{accreditationCategoryId:i,name:n?.name??"",description:n?.description??"",privateNote:n?.privateNote??"",acronym:n?.acronym??"",color:n?.color??Lr.colors.primary500.value,icon:n?.icon??En.BadgeCheck,weezeventIsSynchronized:n?.weezeventIsSynchronized??!0,willAutoAccredit:n?.willAutoAccredit??!1,address:n?.address??null,latitude:n?.latitude??null,longitude:n?.longitude??null,zoom:n?.zoom??sd,layer:n?.layer??e,accreditationDisplay:n?.accreditationDisplay??be.List,numberOfDaysLimit:n?.numberOfDaysLimit??null,slots:(0,Tg.A)(n?.slots??[],e=>(0,sc.A)([e.date?.toMillis(),e.name])),conditionsOperator:n?.conditionsOperator??Ge.And,accreditationsCustomFields:n?.accreditationsCustomFields??[],tagsIds:n?.tagsIds??[],fields:n?.fields??{},formCustomFields:n?.formCustomFields??[]}}};lW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(aW=void 0!==ts&&ts)?aW:Object,"function"==typeof(rW=void 0!==iW&&iW)?rW:Object,"function"==typeof(dW=void 0!==oW&&oW)?dW:Object])],lW);const cW=e=>{const n=os(),t=e.customFields.find(n=>n.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:`${e.field}customFieldId`,onChange:n=>{const t=e.customFields.find(e=>e.id===n);e.change(`${e.field}conditionValue`,t?.fieldType===_n.Select?[]:"")}}),(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:n("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsxs)(Kx,{isSearchVisible:!0,label:n("CustomField"),name:`${e.field}customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:n("s_lectionnez_un_62064")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Zr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"arrow-right"})}),(0,i.jsxs)(Zr,{css:{flex:"1"},children:[t?.fieldType===_n.Checkbox&&(0,i.jsxs)(Qy,{label:n("accessible_seul_31434"),name:`${e.field}conditionValue`,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"",children:n("s_lectionnez_un_44130")}),(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]}),t?.fieldType===_n.Select&&(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("accessible_seul_31434"),multiple:!0,name:`${e.field}conditionValue`,children:t.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),(0,i.jsx)(Zr,{css:{paddingTop:"$6"},children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},uW=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc();return 0===e.customFields.length?(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:t("vous_n_avez_pas_62142")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:t("pour_ajouter_de_74432")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(yc,{color:"white",onClick:()=>{n.push(av.CUSTOM_FIELDS({organizationId:s}))},children:t("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.customFieldsValues.map((n,s)=>{const o=s===e.customFieldsValues.length-1,a=`${e.name}[${s}].`;return(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(cW,{change:e.change,customFieldValue:n,customFields:e.customFields,field:a,index:s,onRemove:()=>{e.change(e.name,e.customFieldsValues.filter((e,n)=>n!==s))}}),e.customFieldsValues.length>1&&!o?0===s?(0,i.jsx)(Zr,{css:{width:"fit-content"},children:(0,i.jsxs)(Qy,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:Ge.And,children:t(Ge.And)}),(0,i.jsx)("option",{value:Ge.Or,children:t(Ge.Or)})]})}):(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:t(e.conditionsOperator)}):null]},s)}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:t("ajouter_une_con_66324")})})]})},mW=()=>{const{translate:e}=fc();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Jx,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},gW=e=>{const{mutate:n}=function(e={}){return ds("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)(UA,{initialName:"",isEdit:!1,mutate:async t=>(await n({eventId:e.eventId,accreditationCategory:{name:t}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},hW=e=>{const{mutate:n}=function(e={}){return ds("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)(UA,{initialName:e.accreditationCategory.name,isEdit:!0,mutate:async t=>(await n({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id,accreditationCategory:{name:t}})).accreditationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},pW=e=>{const{translate:n,params:{eventId:t}}=fc(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(iA(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:n("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"accreditation.accreditationCategoryId",onCreateClick:()=>{o(!0)},children:a.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wb,{label:n("Color"),name:"accreditation.color"}),(0,i.jsx)(Zb,{label:n("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:n("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Jx,{name:"accreditation.weezeventIsSynchronized",children:n("WeezeventIsSynchronized")})]}),s&&(0,i.jsx)(gW,{eventId:t,onClose:()=>{o(!1)},onSuccess:n=>{r(iA([...a,n])),e.change("accreditation.accreditationCategoryId",n.id)}})]})},IW=e=>{const n=os(),[t,s]=(0,de.useState)(Jo.c9.invalid("Invalid")),[o,a]=(0,de.useState)(0),r=(0,de.useMemo)(()=>e.slots.map((e,n)=>({...e,index:n})),[e.slots]),d=(0,de.useMemo)(()=>{const n=Jo.IX.fromDateTimes(t.startOf("day"),t.endOf("day"));return t.isValid?r.filter(i=>e.matchDateFilter(i,t,n)):r},[t,r,e.matchDateFilter]),l=(0,de.useMemo)(()=>d.slice(o,10+o),[o,d]),c=(0,de.useMemo)(()=>Math.ceil(d.length/10),[d]),u=(0,de.useMemo)(()=>d.length,[d]);return(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textMd medium",children:n("liste_de_vos_cr_37612")}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(df,{max:e.event.endAt,min:e.event.startAt,value:t,onChange:e=>{s(e),a(0)}})})]}),(0,i.jsxs)(Xl,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[l.map(n=>e.renderSlot(n)),(0,i.jsx)(Ag,{limit:10,numberOfPages:c,offset:o,setOffset:a,totalCount:u})]}),(0,i.jsxs)(Zr,{css:{cursor:"pointer"},font:"primary500 textSm medium",onClick:e.onNewSlot,children:["+ ",n("ajouter_un_cr_n_63607")]})]})},fW=e=>{const n=os(),{user:t}=ps();return(0,i.jsx)(mA,{buttonText:n("r_p_ter_28960"),icon:"sliders",initialValues:{value:1,unit:e.showHours?"hour":"day"},size:"md",title:n("r_p_ter_le_cr_n_68038"),onClose:e.onClose,onSubmit:async n=>{e.onSubmit(n.value,n.unit),e.onClose()},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(Zr,{children:[n("r_p_ter_pour_le_06048"),gt.Fr!==t?.language&&" "+n("prochain_e_s_04262")]}),(0,i.jsx)(Zr,{width:100,children:(0,i.jsx)(Qy,{name:"value",shouldParseAsInt:!0,children:(0,Sg.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),gt.Fr===t?.language&&(0,i.jsx)(Zr,{children:n("prochain_e_s_04262")}),(0,i.jsx)(Zr,{width:120,children:(0,i.jsxs)(Qy,{name:"unit",children:[e.showHours&&(0,i.jsx)("option",{value:"hour",children:n("heures_17899")}),(0,i.jsx)("option",{value:"day",children:n("jours_43822")}),(0,i.jsx)("option",{value:"week",children:n("semaines_53228")})]})})]})})},xW=e=>{const n=os(),t=ss(oW);return(0,i.jsx)(mA,{buttonText:n("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:t.createAccreditationSlotSchema(),size:"md",subtitle:n(""),title:n("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async n=>{await e.onSuccess((0,Qr.A)(n.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:t})=>(0,i.jsxs)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(pu,{label:n("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Wx,{label:n("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{t.change("slot.date",null)}})]})})},_W=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>w(e.slot.name)?e.slot.name:n("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,de.useMemo)(()=>{const i=e.slot.date?.isValid?t.toLocaleString(e.slot.date,da.DateOnly.WeekdayLongMonthLong):"",s=e.slot.maxResources?n("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,sc.A)([s,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[a,r]=(0,de.useState)(e.initialIsEditOpen),[d,l]=(0,de.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Zr,{color:"gray500",children:o})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("dupliquer_28256")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{l(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(ux,{placement:"top",children:n(u?"des_membres_son_92320":"supprimer_43083")})]})]}),a&&(0,i.jsx)(xW,{event:e.event,slot:e.slot,onClose:()=>{r(!1)},onSuccess:async n=>{e.updateSlots(n,e.index)}}),d&&(0,i.jsx)(fW,{showHours:!1,onClose:()=>{l(!1)},onSubmit:(n,t)=>{e.onRepeat(e.slot,n,t)}})]})},jW=e=>{const n=os(),t=ss(oW),[s,o]=(0,de.useState)(-1),a=(0,de.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),r=(0,de.useCallback)((n,t)=>{const i=[...e.values.accreditation.slots];i[t]=n,e.change("accreditation.slots",i)},[e.values.accreditation.slots,e.change]),d=(0,de.useCallback)((e,n)=>!!e.date?.isValid&&e.date.startOf("day")===n.startOf("day"),[]),l=(0,de.useCallback)(()=>{e.change("accreditation.slots",e.values.accreditation.slots.concat([t.accreditationsSlotInputDefault()])),o(e.values.accreditation.slots.length)},[e.values.accreditation.slots,e.change]),c=(0,de.useCallback)(n=>{e.change("accreditation.slots",[...e.values.accreditation.slots,{name:n.name,date:n.date,maxResources:n.maxResources}])},[e.values.accreditation.slots,e.change]),u=(0,de.useCallback)((n,t,i)=>{const s=function(e,n,t){if(e.date?.isValid)return(0,Sg.A)(1,n+1).map(n=>{if("day"===t){const t=e.date.plus({day:n});return{name:e.name,date:t,maxResources:e.maxResources}}if("week"===t){const t=e.date.plus({week:n});return{name:e.name,date:t,maxResources:e.maxResources}}throw new Error("Wrong unit")});throw new Error("Can not repeat slot with wrong date")}(n,t,i);e.change("accreditation.slots",e.values.accreditation.slots.concat(s))},[e.values.accreditation.slots,e.change]),m=(0,de.useCallback)(n=>{e.change("accreditation.slots",y(e.values.accreditation.slots,n))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(IW,{event:e.event,matchDateFilter:d,renderSlot:n=>(0,i.jsx)(_W,{event:e.event,index:n.index,initialIsEditOpen:n.index===s,remove:m,slot:n,updateSlots:r,onDuplicate:c,onRepeat:u},n.index),slots:e.values.accreditation.slots,onNewSlot:l}),(0,i.jsx)(Yj,{height:"5"}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("type_d_affichag_09962")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("comment_souhait_62602")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gy,{name:"accreditation.accreditationDisplay",value:be.List,children:n("afficher_sous_f_71276")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"accreditation.accreditationDisplay",value:be.Radio,children:n("afficher_sous_f_61997")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"accreditation.accreditationDisplay",value:be.Calendar,children:n("afficher_sous_f_15380")})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"5"}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("blocage_de_l_ac_17590")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("est_ce_qu_il_y_67585")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(eg,{state:e.values.hasNumberOfDaysLimit?"unchecked":"checked",onClick:n=>{e.change("hasNumberOfDaysLimit","checked"!==n),e.change("accreditation.numberOfDaysLimit",null)},children:n("non_33516")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:e.values.hasNumberOfDaysLimit?"checked":"unchecked",onClick:n=>{e.change("hasNumberOfDaysLimit","checked"===n)},children:n("oui_54361")}),e.values.hasNumberOfDaysLimit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(Xl,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(Zr,{width:80,children:(0,i.jsx)(pu,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(Zr,{children:n("jours_avant_la_74918")})]})]})]})]})]})},vW=e=>(0,i.jsx)(Gj,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:([n,t,s])=>(0,i.jsx)(gd,{center:e.center,coordinatesFieldsProps:{latitudeProps:n,longitudeProps:t,zoomProps:s},layer:e.layer,point:e.point,traces:e.traces})}),SW=111320,yW=e=>e*Math.PI/180;function CW([e,n],[t,i]){const s=yW(t-e),o=yW(i-n),a=Math.sin(s/2)**2+Math.cos(yW(e))*Math.cos(yW(t))*Math.sin(o/2)**2;return 12742e3*Math.asin(Math.sqrt(a))}const bW=e=>`${(e/1e3).toFixed(2)} km`,AW=e=>(0,i.jsxs)(Xl,{gap:"2",justify:"between",children:[(0,i.jsx)(Zr,{color:"gray500",children:e.label}),(0,i.jsx)(Zr,{color:"gray800",children:e.value})]}),EW=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>e.traces.flatMap(n=>{const t=function(e,n,t){if(e.length<2)return null;const i=n===ft.Backward?e.slice().reverse():e,s=function(e){let n,t=0;return e.map(([,,e])=>("number"==typeof e&&(void 0===n||n-e>=5?n=e:e-n>=5&&(t+=e-n,n=e)),t))}(i),o=Math.cos(yW(t.latitude)),a=([e,n])=>[(n-t.longitude)*SW*o,(e-t.latitude)*SW];let r=0,d=1/0,l=0,c=0;for(let e=0;ee.startAt&&n?t.toLocaleString(function(e,n,t){const i=t.distanceFromStart+t.distanceFromFinish,s=t.totalEffort>0?t.effortFromStart/t.totalEffort:0;return e.plus({seconds:Math.round(i/1e3*n*s)})}(e.startAt,n,i),da.ShortDateTime):null,[t]);return(0,i.jsx)(Xl,{direction:"column",gap:"4",children:s.map(({trace:e,projection:t})=>{const s=o(e,e.firstRunnerPace,t),a=o(e,e.lastRunnerPace,t);return(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$3 $4"},direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{css:{color:e.color},children:(0,i.jsx)(pc,{icon:"route"})}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:e.name})]}),t.distanceToTrace>50&&(0,i.jsx)(Zr,{color:"warning700",children:n("le_point_est_78274",Math.round(t.distanceToTrace))}),(0,i.jsx)(AW,{label:n("distance_depuis_55700"),value:bW(t.distanceFromStart)}),(0,i.jsx)(AW,{label:n("distance_jusqu_19272"),value:bW(t.distanceFromFinish)}),t.totalClimb>0&&(0,i.jsx)(AW,{label:n("d_nivel_positi_53034"),value:`${Math.round(t.climbFromStart)} m / ${Math.round(t.totalClimb)} m`}),s&&(0,i.jsx)(AW,{label:n("passage_estim_18732"),value:s}),a&&(0,i.jsx)(AW,{label:n("passage_estim_81350"),value:a})]},e.id)})})},wW=e=>{const n=os(),t=e.traces.filter(n=>e.tracesIds.includes(n.id)),s=ad(e.point);return(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("apparence_75510")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsxs)(Qy,{label:n("Layer"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:Rn.Google,children:"Plan"}),(0,i.jsx)("option",{value:Rn.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:Rn.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Qy,{label:(0,i.jsx)($S,{children:n("Zoom")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,Sg.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)(ic,{height:"6"}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:(0,i.jsx)($S,{children:n("Traces")}),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)(ic,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("localisation_38416")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(IA,{addressName:`${e.name}address`,label:(0,i.jsx)($S,{children:n("Address")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(qx,{label:(0,i.jsx)($S,{children:n("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(qx,{label:(0,i.jsx)($S,{children:n("longitude_01695")}),name:`${e.name}longitude`})]}),s&&t.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(EW,{point:s,traces:t})]})]}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(vW,{center:(o=e.center,"number"==typeof o?.latitude&&"number"==typeof o?.longitude?{latitude:o.latitude,longitude:o.longitude}:void 0),layer:e.layer,point:s,prefix:e.name,traces:t})})]});var o},$W=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{showNotification:a}=Sy(),r=ss(lW),d=ss(ec),l=ss(Ub),c=(0,de.useRef)(null),u=(0,de.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditation.name):o("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);fm(u);const{areSlotsOpen:m,isLocalisationOpen:g,areConditionsOpen:h,areCustomFieldsOpen:p,isPrivateNoteOpen:I,areTagsOpen:x}=(0,de.useMemo)(()=>{const n=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&f(n.slots),isLocalisationOpen:e.isEdit&&(w(n.address)||"number"==typeof n.latitude||"number"==typeof n.longitude),areConditionsOpen:e.isEdit&&f(n.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(f(Object.keys(n.fields))||f(n.formCustomFields)),isPrivateNoteOpen:e.isEdit&&w(n.privateNote),areTagsOpen:e.isEdit&&f(n.tagsIds)}},[e.initialValues,e.isEdit]),_=(0,de.useCallback)(n=>d.validateForForm(r.createUpdateAccreditationSchema(l.changedFieldsSchema(e.accreditationCustomFields,e.initialValues.accreditation.fields,n.accreditation.fields)))(n),[e.accreditationCustomFields,e.initialValues]);return(0,i.jsx)(Fc,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:a,submitting:r,values:d})=>(0,i.jsx)(Nx,{button:e.isEdit?(0,i.jsx)(yc,{isLoading:r,onClick:a,children:o("mettre_jour_l_92576")}):null,category:u,color:"dark",fallbackClosePath:mo.ACCREDITATIONS({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.accreditation.name:o("nouvelle_accr_d_32707"),children:(0,i.jsxs)(kx,{ref:c,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:o("informations_su_35382"),children:(0,i.jsx)(pW,{change:n.change,event:e.event})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("automatisation_47772"),subtitle:o("attribuer_autom_55909"),children:(0,i.jsx)(mW,{})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("cr_neaux_33401"),initialIsOpen:m,isToggleable:!0,subtitle:o("ajouter_les_dif_76832"),onToggle:e=>{e||n.change("accreditation.slots",[])},children:(0,i.jsx)(jW,{change:n.change,event:e.event,values:d})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("localisation_38416"),initialIsOpen:g,isToggleable:!0,subtitle:o("indiquez_la_loc_61935"),onToggle:t=>{t||(n.change("accreditation.layer",e.event.layer),n.change("accreditation.zoom",sd),n.change("accreditation.address",null),n.change("accreditation.latitude",null),n.change("accreditation.longitude",null))},children:(0,i.jsx)(wW,{center:null,layer:d.accreditation.layer,name:"accreditation.",point:d.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("conditions_77756"),initialIsOpen:h,isToggleable:!0,subtitle:o("ajoutez_des_con_94296"),onToggle:e=>{e||n.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(uW,{change:n.change,conditionsOperator:d.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:d.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("champs_de_formu_64126"),initialIsOpen:p,isToggleable:!0,subtitle:o("ajouter_des_inf_14221"),onToggle:e=>{e||(n.change("accreditation.formCustomFields",[]),n.change("accreditation.fields",{}))},children:(0,i.jsx)(dB,{change:n.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:d.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("note_priv_e_06303"),initialIsOpen:I,isToggleable:!0,subtitle:o("ajoutez_une_not_89122"),onToggle:e=>{e||n.change("accreditation.privateNote","")},children:(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:o("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("tags_79499"),initialIsOpen:x,isToggleable:!0,subtitle:o("ajouter_des_tag_77298"),onToggle:e=>{e||n.change("accreditation.tagsIds",[])},children:(0,i.jsx)(hA,{change:n.change,name:"accreditation.",organizationId:t,tags:e.tags,tagsIds:d.accreditation.tagsIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:r,onClick:a,children:(0,i.jsx)(Zr,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_92576"):o("cr_er_l_accr_di_16123")})})})]})}),validate:_,width:1,onSubmit:async i=>{const r=await e.mutate({eventId:s,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,Rr.A)(e,["index"]))}});a(e.isEdit?o("l_accr_ditation_24401"):o("l_accr_ditation_25694")),e.isEdit?n.goBack(mo.ACCREDITATION({organizationId:t,eventId:s,accreditationId:r})):n.replace(mo.ACCREDITATION({organizationId:t,eventId:s,accreditationId:r}))}})},TW=()=>{const{organizationId:e,eventId:n,options:t}=ls(),s=ss(lW),{data:o,loader:a}=rs("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(\n eventId: $eventId\n variety: Accreditation\n privacy: All\n ) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n }\n}\n",{organizationId:e,eventId:n},[Ko.ConditionsCustomFieldsFragment,Ko.FormCustomFieldsFragment,Ko.CreatePositionTagsFragment,Ko.AttachCustomFieldFragment,Ko.CreateAccreditationEventFragment],void 0),{mutate:r}=function(e={}){return ds("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n id\n }\n}\n",e)}(),d=w(t)?parseInt(t,10):null;return a||(0,i.jsx)($W,{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,d),isEdit:!1,mutate:async e=>(await r(e)).accreditationCreate.id,tags:o.organization.tags.nodes})},zW=()=>{const{organizationId:e,eventId:n,accreditationId:t}=ls(),s=ss(lW),{data:o,loader:a}=rs("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(\n eventId: $eventId\n variety: Accreditation\n privacy: All\n ) {\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:n,accreditationId:t},[Ko.ConditionsCustomFieldsFragment,Ko.FormCustomFieldsFragment,Ko.CreatePositionTagsFragment,Ko.AttachCustomFieldFragment,Ko.CreateAccreditationEventFragment],undefined);const{mutate:r}=function(e={}){return ds("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 a||(0,i.jsx)($W,{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 r({...e,accreditationId:t})).accreditationUpdate.id,tags:o.organization.tags.nodes})};var OW,RW,DW;let MW=class extends vF{static{OW=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...vF.IMPORT_COLUMNS_DEFAULT,AccreditationName:"accreditationName",AccreditationCategoryName:"accreditationCategoryName",SlotName:"slotName",SlotDate:"slotDate",MaxResources:"slotMaxResources",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",ConditionsOperator:"conditionsOperator",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===wn.Update?[OW.IMPORT_COLUMNS_DEFAULT.Id]:[],OW.IMPORT_COLUMNS_DEFAULT.AccreditationName,OW.IMPORT_COLUMNS_DEFAULT.AccreditationCategoryName];constructor(e,n){super(e,n),this.csvInputService=e}};MW=OW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(RW=void 0!==hF&&hF)?RW:Object,"function"==typeof(DW=void 0!==ts&&ts)?DW:Object])],MW);const PW=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{mutate:s}=function(e={}){return ds("mutation AccreditationsImport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $input: MappableImportInput!\n) {\n jobId: accreditationsImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkAccreditationsImport:o}=Sy(),a=(0,de.useCallback)((e,n,t)=>o(e,n,t),[o]),{data:r,loader:d}=kd({organizationId:e,variety:Ke.Accreditation});return d||(0,i.jsx)(cF,{alertDescriptionKey:"pour_ajouter_un_26814",children:(0,i.jsx)(YF,{ImportInputService:MW,checkImport:a,closePath:mo.ACCREDITATIONS({organizationId:e,eventId:n}),customFields:r.organization.customFields.nodes,heading:t("accreditations_66464"),importTagPrefix:"accreditations",localStorageKeyPrefix:"ACCREDITATIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Ug,{to:mo.ACCREDITATIONS({organizationId:e,eventId:n}),children:t("back_to_accredi_24412")})})})};var kW,FW,NW,LW;function UW(e,n){return n===lp.Table||n===lp.WeeklyCalendar?{includeConditions:!1,includeCustomFields:n===lp.Table,includeCreatedBy:!1,includeDescription:!1,includeResources:!0,includeTags:!1}:{includeConditions:e.includes(LW.Conditions),includeCustomFields:!1,includeCreatedBy:e.includes(LW.CreatedBy),includeDescription:e.includes(LW.Description),includeResources:!1,includeTags:e.includes(LW.Tags)}}!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.MaxResources="maxResources",e.AssignedResources="resources",e.Slot="slot",e.SlotDate="slotDate",e.SlotName="slotName",e.ScannedResources="scannedResources",e.WishedResources="wishedResources",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(LW||(LW={}));let VW=class extends Eh{constructor(e,n,t){super(e,n,t)}getAccreditationsFilters(e,n){return(0,sc.A)([{slug:"name",name:this.t("AccreditationName"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:LW.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text},{slug:LW.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text},f(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,values:(0,Tg.A)(e.accreditationsCategories,e=>b(e.name)),hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:Sn.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:Sn.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:ht.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,values:pi.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:Sn.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:Sn.Number,hideEmpty:!0},{slug:LW.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:LW.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:Sn.Datetime,hideEmpty:!0},e.isWeezeventConnected?{slug:LW.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),category:this.t("accr_ditations_39450"),fieldType:Sn.Number}:null,...this.customFieldsToFilters(n)])}getAccreditationsPossibleColumns(e,{isWeezeventConnected:n}){const t=[{slug:LW.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Oe.Id,width:100},{slug:LW.Name,name:this.t("AccreditationName"),isSearchable:!0,isSortable:!0,sortAttribute:Oe.Name,minWidth:240},{slug:LW.Description,name:this.t("Description"),minWidth:320},{slug:LW.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:Oe.Category,minWidth:240},{slug:LW.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:LW.SlotDate,name:this.t("Date"),minWidth:180,isSortable:!0,sortAttribute:ze.Date},{slug:LW.AssignedResources,name:this.t("membres_11310"),minWidth:320},{slug:LW.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:LW.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:LW.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:LW.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:LW.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:LW.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:Oe.Acronym,minWidth:180},{slug:LW.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:LW.Icon,name:this.t("ic_ne_55554"),width:80},{slug:LW.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:LW.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:LW.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:LW.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Oe.CreatedAt,minWidth:180},{slug:LW.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:LW.Index,name:this.t("Index"),isSortable:!0,sortAttribute:Oe.Index,width:200}];return n&&t.push({slug:LW.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:LW.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),t.concat(this.customFieldsToPossibleColumns(e))}};VW=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(kW=void 0!==dh&&dh)?kW:Object,"function"==typeof(FW=void 0!==Wg&&Wg)?FW:Object,"function"==typeof(NW=void 0!==ts&&ts)?NW:Object])],VW);const BW=e=>{const{params:{eventId:n}}=fc(),{mutate:t}=Fa(),s=(0,de.useCallback)(async i=>{const s=I(e.property);for(const o of s){const a=1===s.length?i:i[o];await t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditationId]},slug:o,strategy:Dn.Replace,value:a}})}return!0},[e.accreditationId,e.property,t]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},WW=e=>{const{translate:n}=fc();return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:Ae.Acronym,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("Acronym"),value:e,onChange:t}),renderValue:e.accreditation.acronym||""})},GW=(0,de.createContext)({}),qW=e=>{const n=WL(yd,{eventId:e.eventId},e=>e.event.accreditationsCategories),t=WL(sr,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(GW.Provider,{value:{getAccreditationsCategories:n,getTags:t},children:e.children})};function HW(){return(0,de.useContext)(GW)}const YW=e=>{const n=os(),{getAccreditationsCategories:t}=HW(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("Category")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(nf,{label:n("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))})},ZW=e=>{const{organizationId:n,eventId:t}=ls(),{isEditMode:s}=ah(),o=e.accreditationCategory.name;return(0,i.jsx)(BW,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:Ae.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(YW,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.accreditationCategory.id}),children:o})})})},KW=e=>{const{translate:n}=fc();return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:Ae.Color,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Bb,{label:n("Color"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Xl,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{oy(e.accreditation.color)}})}),(0,i.jsx)(ux,{placement:"top",children:e.accreditation.color})]})})})};function XW(e,n,t){return n.fieldType===_n.Select?f(t)?(0,sc.A)(t.map(e=>n.values.find(n=>n.id===e)?.value)).join(", "):"":e(!0===t?"true":"false")}const QW=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),s=(0,de.useMemo)(()=>t.map((e,t)=>({id:t,color:"gray",icon:null,text:`${e.customField.name} : ${XW(n,e.customField,e.conditionValue)}`})),[t]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:s})})},JW=e=>{const{params:{eventId:n}}=fc(),{mutate:t}=Fa(),s=(0,de.useCallback)(i=>t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditation.id]},slug:Ae.Description,strategy:Dn.Replace,value:i}}),[n,e.accreditation.id,t]);return(0,i.jsx)(TU,{column:e.column,mutate:s,reload:e.reload,text:e.accreditation.description,updatable:!0})},eG=e=>{const{translate:n}=fc();return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:Ae.Icon,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Yb,{label:n("Icon"),renderOnPortal:!0,value:e,onChange:t}),renderValue:()=>(0,i.jsx)(pc,{icon:hc(e.accreditation.icon)})})},nG=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>({[Ae.Color]:e.accreditation.color,[Ae.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:t,property:[Ae.Color,Ae.Icon],reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Bb,{label:n("Color"),value:e[Ae.Color],onChange:n=>{t({...e,[Ae.Color]:n})}}),(0,i.jsx)(Yb,{label:n("Icon"),renderOnPortal:!0,value:e[Ae.Icon],onChange:n=>{t({...e,[Ae.Icon]:n})}})]}),renderValue:()=>(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon})})},tG=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{isEditMode:o}=ah(),a=e.accreditation.name;return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:Ae.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("AccreditationName"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION({organizationId:t,eventId:s,accreditationId:e.accreditation.id}),children:(0,i.jsx)(Zr,{css:{clamp:2},title:a,children:a})})})})},iG=e=>{const{translate:n}=fc(),{getTags:t}=HW(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("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))})},sG=e=>{const n=(0,de.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:n.map(e=>e.id),property:Ae.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(iG,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(AE,{badges:t})})},oG=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),{mutate:o}=zd(),a=(0,de.useMemo)(()=>e.accreditationSlot.date?s.toLocaleString(e.accreditationSlot.date,da.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),r=(0,de.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:Jo.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(pE,{column:e.column,initialValue:r,mutate:async n=>o({eventId:t,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Qr.A)(e.accreditationSlot,["id","name","maxResources"]),date:n}}),reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(df,{label:n("Date"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Zr,{color:"gray900",css:{ellipsis:!0,textTransform:"capitalize"},title:a,width:1,children:a}),updatable:!0})},aG=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{isEditMode:o}=ah(),{mutate:a}=zd(),r=(0,de.useMemo)(()=>w(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async n=>a({eventId:s,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,Qr.A)(e.accreditationSlot,["id","date","maxResources"]),name:n}}),reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_du_cr_neau_54351"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:o,title:r,updatable:!0,children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION_SLOT({organizationId:t,eventId:s,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:(0,i.jsx)(Zr,{css:{clamp:2},title:r,children:r})})}),updatable:!0})},rG=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const n=Ox(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ug,{to:n,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},dG=e=>{const n=os(),t=ss(wb);return e.column.slug===LW.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===LW.Category?(0,i.jsx)(ZW,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.accreditation.id,column:e.column,reload:e.reload}):e.column.slug===LW.Name?(0,i.jsx)(tG,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.Description?(0,i.jsx)(JW,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.SlotName?e.row.isHidden?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(aG,{accreditationSlot:e.row,column:e.column,reload:e.reload}):e.column.slug===LW.SlotDate?e.row.isHidden?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(oG,{accreditationSlot:e.row,column:e.column,reload:e.reload}):e.column.slug===LW.MaxResources||e.column.slug===LW.AssignedResources?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(uU,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===LW.Tags?(0,i.jsx)(sG,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.Conditions?(0,i.jsx)(QW,{accreditation:e.row.accreditation,column:e.column}):e.column.slug===LW.Address?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.address}):e.column.slug===LW.Latitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.latitude}):e.column.slug===LW.Longitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.longitude}):e.column.slug===LW.Acronym?(0,i.jsx)(WW,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.Color?(0,i.jsx)(KW,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.Icon?(0,i.jsx)(eG,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.IconColor?(0,i.jsx)(nG,{accreditation:e.row.accreditation,column:e.column,reload:e.reload}):e.column.slug===LW.FillingRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===LW.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.accreditation.createdBy}):e.column.slug===LW.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===LW.WeezeventIsSynchronized?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.accreditation.weezeventIsSynchronized?n("oui_54361"):n("non_33516")}):e.column.slug===LW.WeezeventChecklistId?(0,i.jsx)(rG,{accreditationSlot:e.row,column:e.column,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.customField?t.getValueString(e.customField,e.row.accreditation.fields,{fileReturnValue:"name"}):""})},lG=e=>{const{translate:n,params:{eventId:t}}=fc(),{reloadRow:s}=ah(),{mutate:o}=zd(),[a,r]=(0,de.useState)(!1);return e.accreditationSlot.isHidden?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",onClick:()=>r(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),a&&(0,i.jsx)(xW,{event:e.event,slot:{...e.accreditationSlot,maxResources:e.accreditationSlot.maxResources,assignedResources:e.accreditationSlot.assignedResources},onClose:()=>{r(!1)},onSuccess:async n=>{await o({eventId:t,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:n}),s(e.accreditationSlot.id)}})]})},cG=e=>{const{canAccreditationEdit:n}=tC(),t=aE(e.customFields);return(0,i.jsx)(px,{renderCell:(n,s,o)=>(0,i.jsx)(dG,{column:n,customField:t.get(n.slug),reload:o,row:s,weezeventOrganizationId:e.weezeventOrganizationId}),renderRowDropdown:n=>(0,i.jsx)(lG,{accreditationSlot:n,event:e.event}),showMassActions:!1,showRowDropdown:n,showRowEdit:!1})},uG=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{columns:a}=ah(),{user:r}=ps(),{data:d,isLoading:l}=rs("query AccreditationsHeader($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:s},[],undefined);const{mutate:c}=function(e={}){return ds("mutation AccreditationsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: accreditationsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[u,m]=(0,de.useState)(!1),[g,h]=(0,de.useState)(!1),[p,I]=(0,de.useState)(!1),{checkExport:f}=Sy(),[x,_]=(0,de.useState)(!1);return(0,i.jsxs)(gL,{children:[(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"file-import",to:mo.ACCREDITATIONS_IMPORT({organizationId:t,eventId:s}),onClick:e=>vm(e.target),children:o("importer_via_un_61623")}),path:Wo.CREATE_ACCREDITATION(t,s),children:o("cr_er_une_accr_33475")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{isOpen:u,onStateChange:m,children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"plus",onClick:()=>{m(!1),_(!0)},children:o("cr_er_une_cat_g_20051")})}),(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"plug-circle-bolt",onClick:e=>{vm(e.target),h(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(Em,{icon:"file-xls",onClick:e=>{vm(e.target),I(!0)},children:o("exporter_en_exc_51862")})]})]})]})}),x&&(0,i.jsx)(gW,{eventId:s,onClose:()=>{_(!1)},onSuccess:e=>{n.push(mo.ACCREDITATION_CATEGORY({organizationId:t,eventId:s,accreditationCategoryId:e.id}))}}),!l&&(0,i.jsx)(eV,{isOpen:g,link:Ax({organizationId:t,eventId:s,lang:r?.language,pathComponent:"accreditations",key:d.event.key}),onClose:()=>{h(!1)}}),!l&&(0,i.jsx)(nV,{isOpen:p,requestExport:async n=>{const{jobId:i}=await c({organizationId:t,eventId:s,segmentId:e.segment.id,format:n,columns:a});f(i,t,s)},showIncludeFiles:!1,onClose:()=>{I(!1)}})]})},mG=e=>{const{translate:n}=fc();return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:Ae.AutoAccredit,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Zm,{state:e?"checked":"unchecked",onClick:e=>{t("checked"===e)},children:n("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?n("oui_54361"):n("non_33516")})},gG=e=>(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:Ae.Index,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(hu,{min:1,shouldParseAsInt:!0,value:e,onChange:n}),renderValue:e.accreditation.index?.toString(10)??"-"}),hG=e=>{const{translate:n}=fc();return(0,i.jsx)(BW,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:Ae.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(nf,{label:n("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.accreditation.weezeventIsSynchronized?n("oui_54361"):n("non_33516")})},pG=e=>{const{mutate:n}=Fa(),t=(0,de.useCallback)((t,i)=>n({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:Dn.Replace,value:t}}),[e.row,n]);return e.column.slug===LW.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===LW.Category?(0,i.jsx)(ZW,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===LW.Name?(0,i.jsx)(tG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.Description?(0,i.jsx)(JW,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.SlotName||e.column.slug===LW.SlotDate?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===LW.MaxResources||e.column.slug===LW.AssignedResources?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(uU,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===LW.Tags?(0,i.jsx)(sG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.Conditions?(0,i.jsx)(QW,{accreditation:e.row,column:e.column}):e.column.slug===LW.Address?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===LW.Latitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===LW.Longitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===LW.Acronym?(0,i.jsx)(WW,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.Color?(0,i.jsx)(KW,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.Icon?(0,i.jsx)(eG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.IconColor?(0,i.jsx)(nG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.FillingRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===LW.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===LW.AutoAccredit?(0,i.jsx)(mG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.WeezeventIsSynchronized?(0,i.jsx)(hG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===LW.WeezeventChecklistId?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===LW.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===LW.Index?(0,i.jsx)(gG,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(zE,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:t,reload:e.reloadRow,updatable:!0})};function IG(){const{history:e,params:{organizationId:n,eventId:t}}=fc(),{mutate:i}=function(e={}){return ds("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n id\n }\n}\n",e)}();return(0,de.useCallback)(async s=>{const{accreditationDuplicate:o}=await i({eventId:t,accreditationId:s});e.push(Wo.EDIT_ACCREDITATION(n,t,o.id))},[n,t,i])}const fG=e=>{const{translate:n,params:{eventId:t}}=fc(),{showNotification:s}=Sy(),{mutate:o}=Cd();return(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:(0,sc.A)([n("_tes_vous_s_r_d_79068"),e.accreditation.assignedResources>0?n("_1_membre_est_95699",e.accreditation.assignedResources):null]),text:n("suppression_de_73669",e.accreditation.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:t,selecteds:{ids:[e.accreditation.id]}}),s(n("l_accr_ditation_25253",e.accreditation.name)),e.onSuccess()}})},xG=e=>{const n=os(),t=IG(),[s,o]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",to:Wo.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:n("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{await t(e.accreditation.id)},children:n("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{o(!0),vm(e.target)},children:n("supprimer_43083")})})]}),s&&(0,i.jsx)(fG,{accreditation:e.accreditation,onClose:()=>{o(!1)},onSuccess:e.reload})]})},_G=e=>{const{params:{organizationId:n,eventId:t}}=fc(),s=aE(e.customFields);return(0,i.jsx)(px,{getEditPath:e=>Wo.EDIT_ACCREDITATION(n,t,e.id),renderCell:(e,n,o)=>(0,i.jsx)(pG,{column:e,customField:s.get(e.slug),eventId:t,reloadRow:o,row:n}),renderRowDropdown:(e,s)=>(0,i.jsx)(xG,{accreditation:e,eventId:t,organizationId:n,reload:s})})},jG=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{canMemberAccredit:s}=tC(),{columns:o,predicates:a,rendering:r}=ah(),d=(0,de.useMemo)(()=>UW(o,r),[o,r]),{data:l}=Od({...d,organizationId:n,eventId:t,predicatesGroups:a,onlyWithDate:!0});return(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",width:1,children:(0,i.jsx)(nz,{css:{border:"1px solid $gray200"},date:e.selectedDay,display:"week",maxDate:e.endAt,minDate:e.startAt,children:(l.event?.accreditationsSlots.nodes??[]).map(e=>(0,i.jsx)(ez,{endAt:e.date,startAt:e.date,children:(0,i.jsx)(hz,{accreditation:e.accreditation,accreditationSlot:e,canMemberAccredit:s,showWished:!0,stats:e})},e.id))})})},vG=()=>{const e=os(),{massActions:n,predicates:t}=ah(),{eventId:s,onMassEditSuccess:o,organizationId:a,segment:r}=DN(),{showNotification:d}=Sy(),{mutate:l}=Fa(),{mutate:c}=Cd(),[u,m]=(0,de.useState)(!1),[g,h]=(0,de.useState)(!1),p=n.getSelectedsInput(t,null),I=n.isAllSelected?r.count:n.numberOfSelected,f=(0,de.useCallback)(e=>{w(e)&&d(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>{m(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(wm,{placement:"bottom-end",children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{h(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)(E$,{eventId:s,mutate:e=>l({eventId:s,massEdit:e}),organizationId:a,selecteds:p,onClose:()=>{m(!1)},onSuccess:n=>{f(e("_1_accr_ditati_22872",n))}}),g&&(0,i.jsx)(f$,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_31111")],text:e("suppression_de_42723",I),onClose:()=>{h(!1)},onDelete:async()=>{const n=(await c({eventId:s,selecteds:p})).numberOfAccreditations;f(e("_1_accr_ditati_88237",n))}})]})},SG=()=>{const{params:{organizationId:e,eventId:n}}=fc(),{columns:t,predicates:s,rendering:o}=ah(),{infos:a,setInfos:r}=DN(),d=(0,de.useMemo)(()=>UW(t,o),[t,o]),{data:l}=Od({...d,organizationId:e,eventId:n,predicatesGroups:s,customFieldsSlugs:(a.accreditationsTableLinks||[]).map(e=>e.customFieldSlug)}),c=(0,de.useMemo)(()=>(0,wh.A)(l.event?.accreditationsSlots.nodes??[],e=>e.accreditationCategory.id).map(e=>e.accreditationCategory),[l.event]),u=(0,de.useMemo)(()=>(0,wh.A)(l.event?.accreditationsSlots.nodes??[],e=>e.accreditation.id).map(e=>e.accreditation),[l.event]),m=(0,de.useMemo)(()=>a.accreditationsTableLinks||[],[a]),g=(0,de.useCallback)(e=>{r({...a,accreditationsTableLinks:e})},[a,r]);return(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",width:1,children:(0,i.jsx)(XT,{accreditations:u,categories:c,customFields:l.organization?.customFields?.nodes??p,links:m,setLinks:g,showTotal:!1,slots:l.event?.accreditationsSlots.nodes??p})})},yG=e=>{const n=os(),{canAccreditationEdit:t,canSegmentEdit:s}=tC(),{limit:o,rendering:a}=ah(),{infos:r,segment:d,setInfos:l}=DN(),c=(0,de.useMemo)(()=>Jo.c9.isDateTime(r?.accreditationsCalendarSelectedDay)&&r?.accreditationsCalendarSelectedDay?.isValid?r.accreditationsCalendarSelectedDay:Jo.c9.fromISO(r?.accreditationsCalendarSelectedDay)?.isValid?Jo.c9.fromISO(r.accreditationsCalendarSelectedDay,{zone:"utc"}):e.event.startAt,[r]),u=(0,de.useCallback)(e=>{l({...r,accreditationsCalendarSelectedDay:e})},[r,l]),m=a!==lp.Table&&a!==lp.WeeklyCalendar&&s,g=a!==lp.Table&&a!==lp.WeeklyCalendar&&t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uG,{segment:d}),0===e.event.numberOfAccreditations?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Jw,{subtitle:"",title:n("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(vG,{}),controls:a===lp.WeeklyCalendar&&(0,i.jsx)(QT,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:u}),searchPlaceholder:n("rechercher_une_65646"),showActions:t,showEditColumns:m,showEditMode:g,showSearchColumns:s}),selectSegment:(0,i.jsx)(cI,{allSelectedText:n("les_1_accr_di_20650",d.count,d.name),pageSelectedText:n("les_1_accr_di_60244",o),selectAllText:n("s_lectionner_le_71777",d.count,d.name)})}),a===lp.SlotsList?(0,i.jsx)(cG,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.weezeventOrganizationId}):a===lp.List?(0,i.jsx)(_G,{customFields:e.customFields}):a===lp.Table?(0,i.jsx)(SG,{}):(0,i.jsx)(jG,{endAt:e.event.endAt,selectedDay:c,startAt:e.event.startAt})]})]})},CG={async loadDataList(e,n){const{event:t}=await function(e,n={}){return xa(Id,{...n,variables:e,fragments:[Ko.ConditionCustomFieldFragment,Ko.AccreditationsAccreditationSlotFragment]})}(e,n);return{data:{rows:t.accreditationsSlots}}},async loadRow(e,n){const{event:t}=await function(e,n={}){return xa("query AccreditationsAccreditationSlot(\n $eventId: EventId!\n $id: AccreditationsSlotId!\n $customFieldsSlugs: [CustomFieldSlug!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $id) {\n ...AccreditationsAccreditationSlot\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.AccreditationsAccreditationSlotFragment]})}(e,n);return{data:{row:t.accreditationSlot}}}},bG=e=>e===lp.SlotsList?CG:e===lp.List?{}:null,AG=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=Ly(),{canAccreditationEdit:c}=tC(),u=ss(VW),m=(0,de.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),g=(0,de.useMemo)(()=>u.getAccreditationsFilters(e.event,m),[m,e.event]),h=(0,de.useMemo)(()=>u.getAccreditationsPossibleColumns(m,{isWeezeventConnected:e.event.isWeezeventConnected}),[m,e.event]);return(0,i.jsx)(qW,{eventId:o,organizationId:s,children:(0,i.jsx)(JN,{canSegmentEdit:r(nC.SEGMENT_EDIT),columnsToIncludes:UW,eventId:o,filters:g,filtersButtonText:t("filtrer_les_acc_57840"),filtersSubtitle:t("appliquer_des_f_18351"),getSegmentPath:e=>Wo.ACCREDITATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:d?.accreditationsLimit??jg,initialSegmentsOpen:d?.areAccreditationsSegmentsOpen??!0,loadDataList:vd,loadRow:Sd,organizationId:s,possibleColumns:h,possibleRenderings:[lp.List,lp.SlotsList,lp.Table,lp.WeeklyCalendar],reload:e.reload,renderingLoaders:bG,segmentId:a,segmentType:lt.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({accreditationsLimit:e})},showMassActions:c,showRowDropdown:c,showRowEdit:c,onSegmentClick:e=>{l({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await l({accreditationsSegmentId:null}),n.replace(mo.ACCREDITATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(yG,{customFields:m,event:e.event,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},EG=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s},localEvent:o}=Ly();fm(`${s} ${t("accr_ditations_39450")}`);const{data:a,loader:r,reload:d}=rs("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, variety: Accreditation) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\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:n},[Ko.SegmentCustomFieldFragment,Ko.SegmentsFoldersSegmentsFragment],undefined);const l=(0,de.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(AG,{event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.ACCREDITATIONS_SEGMENT(e,n,o?.accreditationsSegmentId&&l.includes(o.accreditationsSegmentId)?o?.accreditationsSegmentId:l[0]),replace:!0})})]})},wG=()=>{const{hasFeature:e}=Yy();return e(In.Accreditation)?(0,i.jsx)(EG,{}):(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Pv,{icon:"badge-check"})})},$G=[{name:"accreditationsCategoriesIds",type:"ids",resource:"accreditationsCategories",multiple:!0},{name:"accreditationsIds",type:"ids",resource:"accreditations",multiple:!0}],TG=[{name:"date",type:"date"},{name:"endDate",type:"date",requires:"date"}],zG=[{name:"sortAttribute",type:"enum",values:Vi,multiple:!1,allowOtherValues:!0},{name:"sortDirection",type:"enum",values:Pi,multiple:!1,defaultValue:ut.Asc,requires:"sortAttribute"}],OG={name:"delimiter",type:"delimiter"},RG={path:"assignments",params:[OG,{name:"state",type:"enum",values:Ui,multiple:!1},{name:"date",type:"date"},{name:"includeLeaders",type:"boolean"},{name:"slugs",type:"slugs",variety:Ke.UserInfo,emptyMeans:"all"},{name:"positionCategoryId",type:"ids",resource:"positionsCategories",multiple:!1},{name:"positionId",type:"ids",resource:"positions",multiple:!1},...zG]},DG={path:"accreditations",feature:In.Accreditation,params:[OG,{name:"date",type:"date"},{name:"states",type:"enum",values:Ht,multiple:!0},{name:"slugs",type:"slugs",variety:Ke.UserInfo,emptyMeans:"all"},...$G,{name:"accreditationsSlotsIds",type:"ids",resource:"accreditationsSlots",multiple:!0},...zG]},MG={path:"accreditations-matrix",feature:In.Accreditation,params:[OG,...TG,{name:"slugs",type:"slugs",variety:Ke.UserInfo,emptyMeans:"none"},...$G]},PG={path:"accreditations-slots",feature:In.Accreditation,params:[OG,{name:"includeMembers",type:"boolean"},...$G]},kG={path:"positions",params:[OG,{name:"includeMembers",type:"boolean"},{name:"slugs",type:"slugs",variety:Ke.Position,emptyMeans:"all",extraSlugs:["description"]}]},FG={path:"delegations-matrix",feature:In.Delegation,params:[OG,...TG,{name:"columns",type:"enum",values:["wished","assigned","quota","scanned"],multiple:!0},...$G]},NG=[RG,DG,MG,PG,kG,FG];function LG(e){return Object.fromEntries(e.params.map(e=>[e.name,"enum"===e.type&&void 0!==e.defaultValue?e.defaultValue:void 0]))}function UG(e,n){const t=Object.fromEntries(e.params.map(e=>{return[e.name,(t=n[e.name],Array.isArray(t)?t.length>0?t.join(","):null:"boolean"==typeof t?t?"true":null:"number"==typeof t?Number.isFinite(t)?t.toString():null:w(t)?t:null)];var t}));return Object.fromEntries(e.params.flatMap(e=>{const n=t[e.name]??null,i=void 0===e.requires||null!==t[e.requires];return null!==n&&i?[[e.name,n]]:[]}))}function VG(){const{params:{organizationId:e,eventId:n}}=fc(),{user:t}=ps();return async(i,s)=>{const o=Ax({organizationId:e,eventId:n,lang:t?.language,pathComponent:i.path,searchParams:UG(i,s)}),a=await fetch(o,{method:"POST",headers:{[re]:await fe()??""}});if(a.ok){const{url:e}=await a.json();location.href=e}}}const BG=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s},translate:o}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:mo.ACCREDITATIONS({organizationId:n,eventId:t}),children:o("accr_ditations_39450")}),(0,i.jsx)(gO,{to:mo.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.accreditation.accreditationCategoryId}),children:e.accreditation.accreditationCategoryName}),(0,i.jsx)(gO,{isCurrent:!0,to:mo.ACCREDITATION({organizationId:n,eventId:t,accreditationId:s}),children:e.accreditation.name})]})},WG=({accreditation:e})=>{const{history:n,params:{organizationId:t,eventId:s,accreditationId:o},translate:a}=fc(),r=IG(),d=VG(),[l,c]=(0,de.useState)(!1);return(0,i.jsx)(CC,{acronym:e.acronym,breadcrumbs:(0,i.jsx)(BG,{accreditation:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(yc,{to:Wo.EDIT_ACCREDITATION(t,s,o),children:a("_diter_l_accr_d_26424")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",onClick:()=>d(DG,{accreditationsIds:[o]}),children:a("exporter_les_me_63676")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>await r(e.id),children:a("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),c(!0)},children:a("supprimer_43083")})})]})]})}),l&&(0,i.jsx)(fG,{accreditation:e,onClose:()=>c(!1),onSuccess:()=>n.replace(mo.ACCREDITATIONS({organizationId:t,eventId:s}))})]}),color:e.color,icon:e.icon,name:e.name,subtext:e.hasSlots?a("creneau",e.numberOfSlots):void 0})},GG=({accreditationCategoryId:e,accreditationCategoryName:n,accreditationName:t,color:s,customFields:o,fields:a,icon:r,numberOfDaysLimit:d,weezeventChecklistId:l,weezeventOrganizationId:c})=>{const{params:{organizationId:u,eventId:m,accreditationId:g},translate:h}=fc(),p="number"==typeof c&&"number"==typeof l;return(0,i.jsx)(yz,{css:{flex:"2 1"},title:h("param_tres_78420"),children:(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(Zz,{children:[(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:h("cat_gorie_00291")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION_CATEGORY({organizationId:u,eventId:m,accreditationCategoryId:e}),children:n})})]}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:h("Accreditation")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION({organizationId:u,eventId:m,accreditationId:g}),children:t})})]})]}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:h("Color")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(Zr,{css:{background:s,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:h("ic_ne_55554")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(pc,{icon:hc(r)})})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:h("Deadline")}),(0,i.jsx)(Gz,{children:h("_1_jours_avant_40282",d)})]})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:h("WeezeventChecklistId")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(Ug,{to:Ox(c,l),children:l})})]})]}),o.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Lz,{customField:e,fields:a})]},e.slug))]})})})},qG=Nr("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),HG=Nr("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),YG=({customFields:e})=>{const n=Cg(),t=os();return(0,i.jsx)(yz,{title:t("conditions_77756"),children:f(e)?e.map(({customField:e,conditionValue:s},o)=>(0,i.jsxs)(de.Fragment,{children:[0!==o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:"4"})]})]}),(0,i.jsx)(qG,{children:e.name}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(HG,{children:XW(t,e,s)})]},o)):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_conditio_36491")})})},ZG=({assignedResources:e,maxResources:n})=>{const t=os();return(0,i.jsx)(yz,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsx)(Xl,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(Zr,{css:{margin:"auto"},children:(0,i.jsx)(sO,{count:e,total:n??1/0})})})})},KG=({location:e,location:{zoom:n,layer:t,traces:s,address:o}})=>{const a=os(),r=ep(e);return(0,i.jsx)(yz,{css:{border:r&&!Qh?"none":"1px solid $gray200",overflow:"hidden",padding:r?0:"$4","@tablet":{border:"1px solid $gray200",padding:0,"& .h-detail-box-content":{padding:r?"0":"$6"}}},title:a("localisation_38416"),children:r?(0,i.jsxs)(i.Fragment,{children:[Jh(e)&&(0,i.jsx)(Zr,{height:380,width:1,children:(0,i.jsx)(gd,{initialZoom:n,layer:t,point:ad(e),traces:s})}),Qh(e)&&(0,i.jsx)(Zr,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:o})]}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:a("aucune_localisa_78216")})})},XG=()=>{const{params:{eventId:e,accreditationId:n}}=fc(),{data:t,loader:s}=rs("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n ...AccreditationChart\n }\n }\n}\n",{eventId:e,accreditationId:n},[Ko.AccreditationChartFragment],undefined);return s||(0,i.jsx)(yz,{title:"Reporting",children:(0,i.jsx)(Zr,{height:380,width:1,children:(0,i.jsx)($O,{accreditation:t.event.accreditation,slots:t.event.accreditation.slots})})})},QG="both",JG="delegationAccreditation",eq="slot",nq=({limitSource:e})=>{const n=os();return e===JG?(0,i.jsx)(pc,{icon:"people-group",title:n("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pc,{icon:"badge-check",title:n("limite_fix_e_po_40573")}),e===QG&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(nq,{limitSource:JG})]})]})},tq=({event:e,slot:n,reload:t})=>{const{history:s,params:{organizationId:o,eventId:a,accreditationId:r},translate:d}=fc(),l=ss(Wg),c=ss(vS),{assignedResources:u,maxResources:m,percent:g}=((e,n)=>{const t=n?.assignedResources??0,s=n?.wishedResources??0,o=n?.maxResources??1/0,a=1/0,r=t>=o,d=o-t,l=o-s,c=1/0,u=1/0,m=d===c?QG:ds.push(mo.ACCREDITATION_SLOT({organizationId:o,eventId:a,accreditationId:r,accreditationSlotId:n.id})),children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:w(n.name)?n.name:"-"})}),(0,i.jsx)(_g,{children:n.date?l.toLocaleString(n.date,da.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(Zr,{children:d("_1_2_membres_04485",u,c.toNumberOrInfinity(m))}),m&&(0,i.jsx)(VL,{percent:g})]})}),(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>{f(!0)},children:d("_diter_62574")}),(0,i.jsx)(Em,{color:n.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{_(!0)},children:d("supprimer_43083")})]})})]}),I&&(0,i.jsx)(xW,{event:e,slot:n,onClose:()=>{f(!1)},onSuccess:async e=>{await h({eventId:a,accreditationSlotId:n.id,accreditationSlot:e}),t()}}),x&&(0,i.jsx)(f$,{buttonText:d("supprimer_43083"),subtext:[d("_tes_vous_s_r_d_48876")],text:d("suppression_de_73669",qp(l,n,"")),onClose:()=>{_(!1)},onDelete:async()=>{await p({eventId:a,accreditationSlotId:n.id}),t()}})]})},iq=()=>{const{translate:e,params:{eventId:n,accreditationId:t}}=fc(),[s,o,a]=Dg(""),[r,d]=ZP("accreditation.slots.date",Jo.c9.invalid("Invalid"),sx),[l,c]=(0,de.useState)(0),[u,m]=ZP("accreditation.slots.sort",null),{data:g,isLoading:h,reload:p}=rs("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:n,accreditationId:t,name:w(o)?o:void 0,date:r?.isValid?r:void 0,offset:l,sort:u},[],undefined);const{numberOfPages:I,totalCount:f}=Jf(g.event?.accreditationsSlots),x=(0,de.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:a})}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(df,{max:g.event?.endAt,min:g.event?.startAt,value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:ze.Name,setSort:x,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(ax,{attribute:ze.Date,setSort:x,sort:u,children:e("Date")}),(0,i.jsx)(Mg,{children:e("remplissage_75916")}),(0,i.jsx)(Mg,{width:100})]}),numberOfPages:I,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):g.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(tq,{event:g.event,reload:p,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:f})},sq=()=>{const{organizationId:e,eventId:n,accreditationId:t}=ls(),{canAccreditationEdit:s}=tC(),{data:o,loader:a,reload:r}=rs("query AccreditationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 numberOfDaysLimit\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:n,accreditationId:t},[Ko.CustomFieldWithConditionFragment],undefined);const{mutate:d}=Fa();return a||(0,i.jsx)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(XG,{}),o.event.accreditation.hasSlots&&(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(iq,{})}),(0,i.jsxs)(Xl,{gap:"6",width:1,children:[!o.event.accreditation.hasSlots&&(0,i.jsx)(ZG,{assignedResources:o.event.accreditation.assignedResources,maxResources:o.event.accreditation.maxResources}),(0,i.jsx)(GG,{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,numberOfDaysLimit:o.event.accreditation.numberOfDaysLimit})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(YG,{customFields:o.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(nO,{...s?{associateTags:e=>d({eventId:n,massEdit:{reset:!1,selecteds:{ids:[t]},slug:Ae.Tag,strategy:Dn.Replace,value:e}}),reload:r}:{},tags:o.event.accreditation.tags}),(0,i.jsx)(Kz,{privateNote:o.event.accreditation.privateNote})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mz,{description:o.event.accreditation.description}),(0,i.jsx)(KG,{location:o.event.accreditation})]})]})]})})},oq=e=>{const{translate:n}=fc(),t=ss(Nh),{data:s}=rs("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},[],undefined);const o=(0,de.useMemo)(()=>(s.event?.positions.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(n=>(0,i.jsx)("option",{value:n.id,children:Gh(t,n,e.name,{position:{includeNameAtEnd:!0}})},n.id))},e.id)),[s.event]),{mutate:a}=nr(),[r,d]=(0,de.useState)([]),[l,c]=(0,de.useState)(We.CheckInOut),[u,m]=(0,de.useState)(null),[g,h]=(0,de.useState)(null),[p,I]=(0,de.useState)(0),[x,_]=(0,de.useState)(!1),j=(0,de.useMemo)(()=>ca(),[]),v=f(r)&&(l===We.Reset||l===We.BreakTime||l===We.CheckIn&&u?.isValid||l===We.CheckOut&&g?.isValid||u?.isValid&&g?.isValid&&g>u||u?.isValid&&!g?.isValid);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"sliders",children:n("mise_jour_du_76261")}),(0,i.jsxs)(Gf,{gap:"5",children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("pour_quel_cr_ne_94965"),multiple:!0,values:r,onChange:d,children:o}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_87607")}),(0,i.jsxs)(Gw,{isChecked:l===We.CheckInOut,text:n("mettre_jour_l_00128"),onClick:()=>c(We.CheckInOut),children:[(0,i.jsx)(If,{hint:n("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:j,onChange:m,onRightIconClick:()=>m(null)}),(0,i.jsx)(If,{hint:n("date_et_heure_d_65738"),rightIcon:"xmark",value:g,zone:j,onChange:h,onRightIconClick:()=>h(null)}),(0,i.jsx)(hu,{hint:n("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:I})]}),(0,i.jsx)(Gw,{isChecked:l===We.CheckIn,text:n("mettre_jour_l_12738"),onClick:()=>c(We.CheckIn),children:(0,i.jsx)(If,{hint:n("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:j,onChange:m,onRightIconClick:()=>m(null)})}),(0,i.jsx)(Gw,{isChecked:l===We.CheckOut,text:n("mettre_jour_l_31683"),onClick:()=>c(We.CheckOut),children:(0,i.jsx)(If,{hint:n("date_et_heure_d_65738"),rightIcon:"xmark",value:g,zone:j,onChange:h,onRightIconClick:()=>h(null)})}),(0,i.jsx)(Gw,{isChecked:l===We.BreakTime,text:n("mettre_jour_l_68723"),onClick:()=>c(We.BreakTime),children:(0,i.jsx)(hu,{css:{maxWidth:"110px"},hint:n("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:I})}),(0,i.jsx)(Gw,{isChecked:l===We.Reset,text:n("remettre_z_ro_11572"),onClick:()=>c(We.Reset)})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:!v,isLoading:x,onClick:async()=>{_(!0);try{const t=(await a({eventId:e.eventId,checkIn:{breakTime:p,checkInAt:u?.toUTC(),checkOutAt:g?.toUTC(),strategy:l,positionsSlotsIds:r,selecteds:e.selecteds}})).numberOfMembers;e.onSuccess(n("le_pointage_de_04632",t)),e.onClose()}catch{_(!1)}},children:n("mettre_jour_85141")})})]})})},aq=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc(),{user:o}=ps(),{checkDocumentsExport:a}=Sy(),{data:r}=rs("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n name\n slug\n }\n }\n}\n",{eventId:t},[],undefined);const{mutate:d}=Qa(),[l,c]=(0,de.useState)(an.Assignments),[u,m]=(0,de.useState)(Jo.c9.invalid("Invalid")),[g,h]=(0,de.useState)(!1),[p,I]=(0,de.useState)(!1),x=(0,de.useMemo)(()=>(0,wh.A)(r.event?.customDocuments??[],e=>e.slug),[r.event]),_=l===an.Assignments||l===an.UserHours||l===an.UserPlanning||l===an.UserPlanningList;return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"file",children:s("exporter_un_doc_23130")}),(0,i.jsxs)(Gf,{gap:"5",children:[(0,i.jsx)(Tc,{alertStyle:"gray",children:(0,i.jsx)(Oc,{children:s("l_e_mail_peut_m_13253")})}),(0,i.jsxs)(lg,{isSearchVisible:!0,label:s("quel_document_v_81798"),renderOnPortal:!0,values:[l],onChange:e=>{f(e)&&c(e[0])},children:[x.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:an.Assignments,children:s("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:an.UserPlanning,children:s("UserPlanning")}),(0,i.jsx)("option",{value:an.UserPlanningList,children:s("UserPlanningList")}),(0,i.jsx)("option",{value:an.UserPlanningDays,children:s("UserPlanningDays")}),(0,i.jsx)("option",{value:an.Certificate,children:s("Certificate")}),(0,i.jsx)("option",{value:an.UserHours,children:s("UserHours")})]}),_&&(0,i.jsx)(df,{label:s("exportez_vos_do_87332"),value:u,onChange:m}),(0,i.jsx)(Zm,{state:g?"checked":"unchecked",onClick:e=>{h("checked"===e)},children:s("fusionner_les_d_64130")})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:p,onClick:async()=>{I(!0);const i=x.map(e=>e.slug),s=i.includes(l)?an.UserCustomDocument:l,r=i.includes(l)?l:void 0,{jobId:c}=await d({organizationId:n,eventId:t,documentsExport:{documentType:s,customDocumentSlug:r,segmentsIds:[],selecteds:e.selecteds,language:o.language,oneFile:g,date:u}});a(c,n,t),e.onSuccess(),e.onClose()},children:s("exporter_59120")})})]})})},rq=e=>{const{translate:n}=fc(),{mutate:t,isLoading:s}=Ta(),{data:o}=mr({eventId:e.eventId}),a=(0,de.useMemo)(()=>o.event?.accreditationsProfilesCategories??[],[o.event]),r=(0,de.useMemo)(()=>a.flatMap(e=>e.accreditationsProfiles),[a]),d=(0,de.useMemo)(()=>yA(a),[a]),[l,c]=(0,de.useState)([]),u=f(l);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"badge-check"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("ajouter_un_prof_36857")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("profil_d_accr_d_02274"),multiple:!1,values:l,onChange:c,children:d}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:!u,isLoading:s,onClick:async()=>{if(f(l)){const i=r.find(e=>e.id===l[0]),s=(await t({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:l[0],selecteds:e.selecteds,strategy:Dn.Replace}})).numberOfMembers;e.onSuccess(n("le_profil_d_acc_64681",i.name,s)),e.onClose()}},children:n("ajouter_97327")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},dq=e=>{const n=os(),{mutate:t,isLoading:s}=jr(),[o,a]=(0,de.useState)(Re.WaitingAccreditation);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"sliders"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("mettre_jour_l_44471")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(nf,{label:n("nouveau_statut_57871"),value:o,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{value:Re.NotApplicable,children:n(Re.NotApplicable)}),(0,i.jsx)("option",{value:Re.Refused,children:n(Re.Refused)}),(0,i.jsx)("option",{value:Re.WaitingAccreditation,children:n(Re.WaitingAccreditation)})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:s,onClick:async()=>{const i=(await t({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(n("le_statut_d_acc_85658",i,n(o))),e.onClose()},children:n("modifier_le_sta_94473")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})};var lq;let cq=class extends M${translationService;inputName="massAssign";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField()}}step2Fields(){return{positionsSlotsIds:Jl.YO().of(Jl.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};cq=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(lq=void 0!==ts&&ts)?lq:Object])],cq);const uq=e=>{const n=os();return(0,i.jsx)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_affec_68075"),prefix:"massAssign.",strategies:[{label:n("ajouter_des_aff_57793"),value:Dn.Add},{label:n("remplacer_les_a_43030"),value:Dn.Replace},{label:n("supprimer_des_a_59880"),value:Dn.Delete}]})},mq=e=>{const n=os(),t=ss(Nh),s=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Eg,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===s)},children:[(0,i.jsx)(_g,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:s,onClick:Ou.A}):(0,i.jsx)(Jm,{shouldPreventDefault:!1,state:s,onClick:Ou.A})}),(0,i.jsx)(_g,{css:{textTransform:"capitalize"},children:t.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)(_g,{children:w(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},gq=e=>{const n=os(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.slots.filter(n=>n.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),s=(0,de.useMemo)(()=>t.map(e=>e.id),[t]),o=(0,de.useMemo)(()=>{const n=(0,tg.A)(e.positionsSlotsIds,s);return n.length===s.length?"checked":0===n.length?"unchecked":"indeterminate"},[s,e.positionsSlotsIds]),a=e.position.positionDisplay===Ln.List||e.strategy===Dn.Delete,r=(0,de.useCallback)((n,t)=>{if(a)e.change("massAssign.positionsSlotsIds",j(e.positionsSlotsIds,n,t));else{const i=(0,Wm.A)(e.positionsSlotsIds,s).concat(t?[n]:[]);e.change("massAssign.positionsSlotsIds",i)}},[a,e.positionsSlotsIds,e.change,s]);return(0,i.jsx)(AA,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:t.length,children:(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{justify:"center",width:48,children:a&&(0,i.jsx)(Ym,{state:o,onClick:n=>{"checked"===n?e.change("massAssign.positionsSlotsIds",(0,Zo.A)(e.positionsSlotsIds.concat(s))):e.change("massAssign.positionsSlotsIds",(0,Wm.A)(e.positionsSlotsIds,s))}})}),(0,i.jsx)(Mg,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Mg,{children:n("nom_du_cr_neau_54351")}),(0,i.jsx)(Mg,{})]}),t.map(n=>(0,i.jsx)(mq,{positionsSlotsIds:e.positionsSlotsIds,shouldDisplayList:a,slot:n,onClick:r},n.id))]})})},hq=e=>{const n=(0,de.useMemo)(()=>(0,Tg.A)(e.positions.filter(n=>n.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(bA,{category:e.category.name,children:n.map(n=>(0,i.jsx)(gq,{change:e.change,position:n,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots,strategy:e.strategy},n.id))})},pq=e=>{const n=os(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(e.segmentId),[r,d]=(0,de.useState)(e.excludeFull?"checked":"unchecked"),[l,c]=(0,de.useState)(e.excludePast?"checked":"unchecked"),[u,m]=(0,de.useState)(e.filterAvailabilities?"checked":"unchecked"),[g,h]=(0,de.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)(Xl,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),value:e.name,onChange:n=>{e.setName(n)}})}),(0,i.jsxs)(J$,{apply:()=>{e.setExcludeFull("checked"===r),e.setExcludePast("checked"===l),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===g),e.setSegmentId(o),s(!1)},color:"white",isOpen:t,numberOfAppliedFilters:p,reinit:()=>{e.setExcludeFull(!1),d("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setFilterAvailabilities(!1),m("unchecked"),e.setFilterWished(!1),h("unchecked"),e.setSegmentId(-1),a(-1),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsxs)(nf,{label:n("vues_personnali_80652"),shouldParseAsInt:!0,value:o,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{value:-1,children:n("vue_personnalis_97654")}),e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,i.jsx)(Zm,{state:r,onClick:d,children:n("masquer_les_cr_14425")}),(0,i.jsx)(Zm,{state:l,onClick:c,children:n("masquer_les_cr_05336")}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:n("filtres_sur_les_73833")}),(0,i.jsx)(Zm,{state:u,onClick:m,children:n("filtrer_selon_l_74774")}),(0,i.jsx)(Zm,{state:g,onClick:h,children:n("filtrer_selon_l_76350")})]})]})},Iq=e=>{const n=os(),[t,s,o]=Dg(""),[a,r]=ZP("massAssign.filters.segmentId",-1),[d,l]=ZP("massAssign.filters.excludeFull",!1),[c,u]=ZP("massAssign.filters.excludePast",!1),[m,g]=ZP("massAssign.filters.filterAvailabilities",!1),[h,I]=ZP("massAssign.filters.filterWished",!1),{data:f,loader:x}=rs("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 positionDisplay\n }\n\n positionCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,positionName:w(s)?s:void 0,segmentId:-1===a?void 0:a,excludeFull:d,excludePast:c,selecteds:e.selecteds,filterAvailabilities:m,filterWished:h},[],undefined);const _=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)((f.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[f.event]),j=(0,de.useMemo)(()=>(0,wh.A)((f.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[f.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pq,{excludeFull:d,excludePast:c,filterAvailabilities:m,filterWished:h,name:t,segmentId:a,segments:f.event?.segments??[],setExcludeFull:e=>{l(e)},setExcludePast:u,setFilterAvailabilities:g,setFilterWished:I,setName:o,setSegmentId:e=>{r(e)}}),(0,i.jsx)(ic,{height:"6"}),x||(0,i.jsx)(CA,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:_.map(n=>(0,i.jsx)(hq,{category:n,change:e.change,positions:j,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:f.event?.positionsSlots.nodes??p,strategy:e.values.massAssign.strategy},n.id))}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n(e.values.massAssign.strategy===Dn.Add?"affecter_les_1_56142":e.values.massAssign.strategy===Dn.Replace?"r_affecter_les_73080":"d_saffecter_les_98962",e.numberOfSelected)})})]})},fq=e=>{const n=os(),t=ss(cq),{mutate:s}=vr();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("affectation"),heading:n("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)(kx,{children:(0,i.jsxs)(fy,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:Dn.Add,positionsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await s({eventId:e.eventId,massAssign:t.massAssign})).numberOfMembers;e.onSuccess(n("_1_membres_ont_14333",i)),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(uq,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("affectation_plural"),render:n=>(0,i.jsx)(Iq,{change:n.form.change,eventId:e.eventId,handleSubmit:n.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:n.submitting,values:n.values}),schema:t.step2Schema()})]})})})})};var xq;let _q=class extends M${translationService;inputName="massAvailabilitiesUpdate";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(),formId:Jl.ai().required(this.t("le_formulaire_e_77404"))}}step2Fields(){return{slots:Jl.YO().of(Jl.Ik()).required(this.t("vous_devez_ajou_68961")).min(1,this.t("vous_devez_ajou_68961"))}}};_q=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(xq=void 0!==ts&&ts)?xq:Object])],_q);const jq=e=>{const{translate:n}=fc(),{data:t}=rs("query MassAvailabilitiesUpdateForms($eventId: EventId!) {\n event(id: $eventId) {\n forms(hasSlotDisplay: true) {\n nodes {\n id\n name\n slotDisplay\n }\n }\n }\n}\n",{eventId:e.eventId},[],undefined);const s=(0,de.useMemo)(()=>(t.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==at.Hide),[t.event]);return(0,i.jsx)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_dispo_94398"),prefix:"massAvailabilitiesUpdate.",strategies:[{label:n("ajouter_des_dis_72846"),value:Dn.Add},{label:n("remplacer_les_d_31752"),value:Dn.Replace},{label:n("supprimer_des_d_60814"),value:Dn.Delete}],children:(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("Form"),name:"massAvailabilitiesUpdate.formId",children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},vq=e=>{const{translate:n}=fc(),{data:t,loader:s}=rs("query MassAvailabilitiesUpdateSlots(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n form(id: $formId) {\n id\n name\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId)\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.values.massAvailabilitiesUpdate.formId},[Ko.FormElementDisplayFragment,Ko.FormSlotsOptionsFragment,Ko.FormRegisterCustomSlotPeriodFragment],undefined);return(0,i.jsxs)(i.Fragment,{children:[s||(0,i.jsx)($P,{change:e.change,currentSlots:e.values.massAvailabilitiesUpdate.slots,customSlotsPeriods:t.organization.form.customSlotsPeriods,daysDisplay:t.organization.form.daysDisplay,elements:t.organization.form.elements,event:t.event,prefix:"massAvailabilitiesUpdate.",slotDisplay:t.organization.form.slotDisplay,userInfoFields:{}}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n("mettre_jour_85141")})})]})},Sq=e=>{const{translate:n}=fc(),t=ss(_q),{mutate:s}=function(e={}){return ds("mutation VolunteersRegistrationsMassAvailabilitiesUpdate(\n $eventId: EventId!\n $massAvailabilitiesUpdate: MassAvailabilitiesUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAvailabilitiesUpdate(\n eventId: $eventId\n massAvailabilitiesUpdate: $massAvailabilitiesUpdate\n )\n}\n",e)}();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("disponibilit_s_49923"),heading:n("mettre_jour_l_84190"),onClose:e.onClose,children:(0,i.jsx)(kx,{children:(0,i.jsxs)(fy,{initialValues:{massAvailabilitiesUpdate:{selecteds:e.selecteds,strategy:Dn.Add,formId:null,slots:[]}},isEdit:!1,onSubmit:async t=>{const i=(await s({eventId:e.eventId,massAvailabilitiesUpdate:t.massAvailabilitiesUpdate})).numberOfMembers;e.onSuccess(n("_1_membres_ont_07596",i)),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:n})=>(0,i.jsx)(jq,{eventId:e.eventId,handleSubmit:n}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("disponibilit_s_49923"),render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(vq,{change:n.change,eventId:e.eventId,handleSubmit:t,organizationId:e.organizationId,submitting:s,values:o}),schema:t.step2Schema()})]})})})})},yq=e=>{const n=os(),{mutate:t,isLoading:s}=Ja(),[o,a]=(0,de.useState)([]),[r,d]=(0,de.useState)([]);return(0,de.useEffect)(()=>{(async()=>{const n=await br({eventId:e.eventId},{token:await fe()});a(n.event.delegations.nodes)})()},[e.eventId]),(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"error",icon:"people-group"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("retirer_des_mem_97655")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("Delegation"),values:r,onChange:d,children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{color:"error",isLoading:s,onClick:async()=>{if(f(r)){const i=o.find(e=>e.id===r[0]);await t({organizationId:e.organizationId,eventId:e.eventId,delegationId:r[0],selecteds:e.selecteds}),e.onSuccess(n("les_membres_ont_44616",i.name)),e.onClose()}},children:n("retirer_de_la_d_64963")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})};var Cq;let bq=class extends M${translationService;inputName="massPreAssign";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(),level:Jl.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(yi,this.t("le_niveau_est_r_81100"))}}step2Fields(){return{positionsCategoriesIds:Jl.YO().of(Jl.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==Pn.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:Jl.YO().of(Jl.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==Pn.Positions||this.parent.positionsIds.length>0})}}};bq=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Cq=void 0!==ts&&ts)?Cq:Object])],bq);const Aq=e=>{const n=os();return(0,i.jsxs)(N$,{handleSubmit:e.handleSubmit,nextText:n("suivant_pr_a_99182"),prefix:"massPreAssign.",strategies:[{label:n("ajouter_des_pr_46968"),value:Dn.Add},{label:n("remplacer_les_p_59777"),value:Dn.Replace}],children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:n("_quel_niveau_s_87878")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"massPreAssign.level",value:Pn.Categories,children:n("pr_affecter_su_68204")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"massPreAssign.level",value:Pn.Positions,children:n("pr_affecter_su_38603")})]})},Eq=e=>{const n=os();return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{css:{paddingRight:0},width:48,children:(0,i.jsx)(Ym,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:n=>{e.change("massPreAssign.positionsCategoriesIds",j(e.positionsCategoriesIds,e.category.id,"checked"===n))}})}),(0,i.jsx)(_g,{children:e.category.name}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},wq=e=>{const n=os(),[t,s,o]=Dg(""),{data:a,isLoading:r}=rs("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},[],undefined);const d=(0,de.useMemo)(()=>w(s)?(a.event?.positionsCategories??[]).filter(e=>e.name.trim().toLowerCase().includes(s.trim().toLowerCase())):a.event?.positionsCategories??[],[a.event?.positionsCategories,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_66722"),value:t,onChange:o})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{css:{paddingRight:0},width:48}),(0,i.jsx)(Mg,{children:n("nom_de_la_cat_g_03860")}),(0,i.jsx)(Mg,{})]}),numberOfPages:1,offset:0,rows:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):d.map(n=>(0,i.jsx)(Eq,{category:n,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},n.id)),setOffset:Ou.A,title:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{children:n("s_lectionner_le_58635")}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:n("les_membres_s_l_66443")})]}),totalCount:d.length??0}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:e.handleSubmit,children:n("pr_affecter_le_81533",e.numberOfSelected)})})]})},$q=e=>{const n=os();return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{css:{paddingRight:0},width:48,children:(0,i.jsx)(Ym,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:n=>{e.change("massPreAssign.positionsIds",j(e.positionsIds,e.position.id,"checked"===n))}})}),(0,i.jsxs)(_g,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(Zr,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)(_g,{children:(0,i.jsx)(Lm,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:n("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},Tq=e=>{const n=os(),[t,s,o]=Dg(""),[a,r]=(0,de.useState)(0),[d,l]=(0,de.useState)(null),{data:c,isLoading:u}=rs("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:w(s)?s:void 0,offset:a,sort:d},[],undefined);const{numberOfPages:m,totalCount:g}=Jf(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),value:t,onChange:e=>{r(0),o(e)}})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{css:{paddingRight:0},width:48}),(0,i.jsx)(ax,{attribute:Hn.Name,setSort:e=>{l(e),r(0)},sort:d,children:n("nom_de_la_missi_64605")}),(0,i.jsx)(Mg,{})]}),numberOfPages:m,offset:a,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):c.event.positions.nodes.map(n=>(0,i.jsx)($q,{change:e.change,position:n,positionsIds:e.values.massPreAssign.positionsIds},n.id)),setOffset:r,title:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{children:n("s_lectionner_le_26300")}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:n("les_membres_s_l_63510")})]}),totalCount:g}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{onClick:e.handleSubmit,children:n("pr_affecter_le_81533",e.numberOfSelected)})})]})},zq=e=>{const n=os(),t=ss(bq),{mutate:s}=Fl();return(0,i.jsx)(F$,{children:(0,i.jsx)(Nx,{category:n("pr_affectation_12256"),heading:n("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)(kx,{children:(0,i.jsxs)(fy,{initialValues:{massPreAssign:{level:Pn.Categories,selecteds:e.selecteds,strategy:Dn.Add,positionsIds:[],positionsCategoriesIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await s({eventId:e.eventId,massPreAssign:t.massPreAssign})).numberOfMembers;e.onSuccess(n("_1_membres_ont_49355",i)),e.onClose()},children:[(0,i.jsx)(Iy,{heading:n("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(Aq,{handleSubmit:e}),schema:t.step1Schema()}),(0,i.jsx)(Iy,{heading:n("pr_affectation_68999"),render:n=>n.values.massPreAssign.level===Pn.Categories?(0,i.jsx)(wq,{change:n.form.change,eventId:e.eventId,handleSubmit:n.handleSubmit,numberOfSelected:e.numberOfSelected,values:n.values}):(0,i.jsx)(Tq,{change:n.form.change,eventId:e.eventId,handleSubmit:n.handleSubmit,numberOfSelected:e.numberOfSelected,values:n.values}),schema:t.step2Schema()})]})})})})},Oq=e=>{const n=os(),{mutate:t,isLoading:s}=yr(),[o,a]=(0,de.useState)(yt.WaitingAssignment);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"sliders"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("mettre_jour_l_82143")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(nf,{label:n("nouveau_statut_57871"),value:o,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{value:yt.NotApplicable,children:n(yt.NotApplicable)}),(0,i.jsx)("option",{value:yt.Refused,children:n(yt.Refused)}),(0,i.jsx)("option",{value:yt.WaitingAssignment,children:n(yt.WaitingAssignment)})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:s,onClick:async()=>{const i=(await t({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(n("le_statut_d_aff_39000",i,n(o))),e.onClose()},children:n("modifier_le_sta_94473")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},Rq=e=>{const{translate:n,params:{eventId:t}}=fc(),{organization:s}=Yy(),{canAccreditationRead:o,canCampaignSend:a,canDelegationRead:r,canDocumentRead:d,canMemberAccredit:l,canMemberAssign:c,canMemberAvailabilitiesEdit:u,canMemberCreate:m,canMemberDelete:g,canMemberEdit:h,canPositionRead:p,canPrint:I,canTicketIdRegenerate:f}=tC(),{showNotification:x}=Sy(),{mutate:j}=qa(),{mutate:v}=Ir(),{mutate:S}=or(),{mutate:y}=_r(),{mutate:C}=zl(),{data:b,isLoading:A}=rs("query VolunteerActions($eventId: EventId!) {\n event(id: $eventId) {\n hasDelegations\n hasForms\n numberOfZplDocuments\n weezticketEventId\n\n customDocuments {\n id\n }\n }\n}\n",{eventId:t},[],undefined);const[E,$]=(0,de.useState)(!1),[T,z]=(0,de.useState)(!1),[O,R]=(0,de.useState)(!1),[D,M]=(0,de.useState)(!1),[P,k]=(0,de.useState)(!1),[F,N]=(0,de.useState)(!1),[L,U]=(0,de.useState)(!1),[V,B]=(0,de.useState)(!1),[W,G]=(0,de.useState)(!1),[q,H]=(0,de.useState)(!1),[Y,Z]=(0,de.useState)(!1),[K,X]=(0,de.useState)(!1),[Q,J]=(0,de.useState)(!1),[ee,ne]=(0,de.useState)(!1),[te,ie]=(0,de.useState)(!1),[se,oe]=(0,de.useState)(!1),[ae,re]=(0,de.useState)(!1),[le,ce]=(0,de.useState)(!1),[ue,me]=(0,de.useState)(!1),[ge,he]=(0,de.useState)(!1),pe=e.massActions.getSelectedsInput(e.predicates,e.scope),Ie=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,fe=(0,de.useCallback)(n=>{w(n)&&x(n),e.onMassEditSuccess()},[e.onMassEditSuccess]),xe=(0,de.useCallback)(async()=>{const e=(await v({eventId:t,selecteds:pe,numberOfCopies:1})).numberOfCreatedMembers;fe(n("_1_membres_ont_35202",e))},[t,v,fe,pe]),_e=(0,de.useCallback)(async()=>{const e=(await y({eventId:t,selecteds:pe})).numberOfMembers;fe(n("les_accr_ditati_80622",e))},[t,pe,fe]),je=h||u||p||o||r||f||g||d,ve=(0,de.useMemo)(()=>I&&!A&&!!b.event.weezticketEventId&&!!b.event.numberOfZplDocuments,[I,A,b]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{flex:"1"}}),h&&(0,i.jsx)(yc,{onClick:()=>{$(!0)},children:n("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&p&&c&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>M(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("affecter_1_me_24704",Ie)})]}),!e.showOnlyMassEdit&&o&&l&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"badge-check",onClick:()=>k(!0)})})}),(0,i.jsx)(ux,{placement:"top",children:n("accr_diter_1_13773",Ie)})]}),!e.showOnlyMassEdit&&je&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsxs)(v$,{title:n("gestion_des_mem_51660"),children:[h&&(0,i.jsx)(Em,{icon:"merge",onClick:()=>z(!0),children:n("fusionner_les_m_37150")}),m&&(0,i.jsx)(Em,{icon:"clone",onClick:xe,children:n("CanLeadersDuplicateMembers")}),u&&(0,i.jsx)(Em,{icon:"calendar",isDisabled:!b.event?.hasForms,onClick:()=>N(!0),children:n("mettre_jour_l_84190")})]}),(0,i.jsx)(v$,{title:n("affectation_plural"),children:p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Em,{icon:"wand-magic-sparkles",onClick:()=>R(!0),children:n("changer_le_stat_39694")}),(0,i.jsx)(Em,{icon:"wand-magic-sparkles",onClick:()=>B(!0),children:n("pr_affecter_1_62649",Ie)}),(0,i.jsx)(Em,{icon:"circle-check",onClick:()=>G(!0),children:n("mettre_jour_l_00128")})]})}),(0,i.jsxs)(v$,{title:n("accr_ditations_39450"),children:[o&&(0,i.jsx)(Em,{icon:"badge-check",onClick:()=>H(!0),children:n("changer_le_stat_27596")}),o&&l&&(0,i.jsx)(Em,{icon:"check",onClick:_e,children:n("valider_les_acc_80801")}),o&&l&&(0,i.jsx)(Em,{icon:"badge-check",onClick:()=>Z(!0),children:n("ajouter_un_prof_96916",Ie)}),o&&ve&&(0,i.jsx)(Em,{icon:"hand-back-fist",onClick:()=>me(!0),children:n("imprimer_un_bra_94539")}),r&&(0,i.jsx)(Em,{icon:"people-group",isDisabled:!b.event?.hasDelegations,onClick:()=>X(!0),children:n("ajouter_1_mem_86218",Ie)}),r&&h&&(0,i.jsx)(Em,{icon:"minus",isDisabled:!b.event?.hasDelegations,onClick:()=>J(!0),children:n("retirer_1_mem_57996",Ie)})]}),(0,i.jsxs)(v$,{title:n("communication_05277"),children:[h&&(0,i.jsx)(Em,{icon:"file-lines",isDisabled:!b.event?.hasForms,onClick:()=>ne(!0),children:n("ajouter_1_mem_52947",Ie)}),h&&(0,i.jsx)(Em,{icon:"file-lines",isDisabled:!b.event?.hasForms,onClick:()=>ie(!0),children:n("marquer_un_form_10633")}),a&&(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>oe(!0),children:n("SendCampaign")}),d&&(0,i.jsx)(Em,{icon:"file",onClick:()=>re(!0),children:n("exporter_un_doc_23130")}),d&&(0,i.jsx)(Em,{icon:"print",isDisabled:_(b.event?.customDocuments??[]),onClick:()=>ce(!0),children:n("imprimer_un_document")})]}),(0,i.jsxs)(v$,{children:[f&&(0,i.jsx)(Em,{color:"red",icon:"repeat",onClick:()=>he(!0),children:n("r_g_n_rer_les_c_44410")}),g&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>U(!0),children:n("d_sinscrire_de_06416")})]})]})]}),E&&(0,i.jsx)(z$,{eventId:t,mutate:e=>j({organizationId:s.id,eventId:t,massEdit:e}),organizationId:s.id,selecteds:pe,onClose:()=>$(!1),onSuccess:e=>{fe(n("_1_membres_ont_07596",e))}}),T&&(0,i.jsx)(_V,{eventId:t,numbersOfSelected:Ie,organizationId:s.id,usersInfosIds:pe.ids||[],onClose:()=>z(!1),onSuccess:fe}),O&&(0,i.jsx)(Oq,{eventId:t,selecteds:pe,onClose:()=>R(!1),onSuccess:fe}),D&&(0,i.jsx)(fq,{eventId:t,numberOfSelected:Ie,selecteds:pe,onClose:()=>M(!1),onSuccess:fe}),P&&(0,i.jsx)(tT,{eventId:t,numberOfSelected:Ie,selecteds:pe,onClose:()=>k(!1),onSuccess:fe}),F&&(0,i.jsx)(Sq,{eventId:t,numberOfSelected:Ie,organizationId:s.id,selecteds:pe,onClose:()=>N(!1),onSuccess:fe}),V&&(0,i.jsx)(zq,{eventId:t,numberOfSelected:Ie,selecteds:pe,onClose:()=>B(!1),onSuccess:fe}),W&&(0,i.jsx)(oq,{eventId:t,organizationId:s.id,selecteds:pe,onClose:()=>G(!1),onSuccess:fe}),L&&(0,i.jsx)(f$,{buttonText:n("d_sinscrire_27046"),subtext:[n("_tes_vous_s_r_d_46029")],text:n("d_sinscription_66971",Ie),onClose:()=>U(!1),onDelete:async()=>{const e=(await S({eventId:t,selecteds:pe})).numberOfMembers;fe(n("_1_membres_ont_85190",e))}}),q&&(0,i.jsx)(dq,{eventId:t,selecteds:pe,onClose:()=>H(!1),onSuccess:fe}),ee&&(0,i.jsx)(hV,{eventId:t,organizationId:s.id,selecteds:pe,onClose:()=>ne(!1),onSuccess:fe}),te&&(0,i.jsx)(pV,{eventId:t,organizationId:s.id,selecteds:pe,onClose:()=>ie(!1),onSuccess:fe}),Y&&(0,i.jsx)(rq,{eventId:t,selecteds:pe,onClose:()=>Z(!1),onSuccess:fe}),K&&(0,i.jsx)(gV,{eventId:t,organizationId:s.id,selecteds:pe,onClose:()=>X(!1),onSuccess:fe}),Q&&(0,i.jsx)(yq,{eventId:t,organizationId:s.id,selecteds:pe,onClose:()=>J(!1),onSuccess:fe}),se&&(0,i.jsx)(sT,{eventId:t,organizationId:s.id,selecteds:pe,onClose:()=>oe(!1),onSuccess:fe}),ae&&(0,i.jsx)(aq,{selecteds:pe,onClose:()=>re(!1),onSuccess:e.onMassEditSuccess}),le&&(0,i.jsx)(oT,{eventId:t,numberOfSelected:Ie,selecteds:pe,sort:e.sort,onClose:()=>ce(!1),onSuccess:e.onMassEditSuccess}),ue&&(0,i.jsx)(gT,{eventId:t,isOpen:ue,selecteds:pe,setIsOpen:me,sort:e.sort}),ge&&(0,i.jsx)(f$,{buttonText:n("r_g_n_rer_37440"),subtext:[n("_tes_vous_s_r_d_60491"),n("cela_rendra_les_60931")],text:n("r_g_n_rer_les_c_44410"),onClose:()=>he(!1),onDelete:async()=>{const{numberOfEdited:e}=await C({eventId:t,selecteds:pe});fe(n("les_codes_barre_03402",e))}})]})},Dq=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{hasFeature:o}=Yy(),a=ss(Dp),{canMemberEdit:r}=tC(),[d,l]=ZP("accreditationMembers.columns",[Op.Name,Op.Accreditations]),[c,u]=ZP("accreditationMembers.limit",jg),[m,g]=ZP("accreditationMembers.predicates",[]),h=(0,de.useMemo)(()=>lh(m),[m]),[p,I]=ZP("accreditationMembers.sort",null),{data:f}=Cr({organizationId:t,eventId:s,privacy:He.All,loadCustomDocuments:!1,loadForms:!1,loadSegments:!1}),x=(0,de.useMemo)(()=>f.organization?.customFields.nodes??[],[f.organization]),_=aE(x),j=(0,de.useMemo)(()=>f.event?a.getAccreditationMembersFilters(t,s,x,f.event,{hasDelegations:o(In.Delegation)}):[],[s,x,f.event]),v=(0,de.useMemo)(()=>a.getAccreditationMembersPossibleColumns(t,x),[t,x]),S=(0,de.useMemo)(()=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationProfileCategoryId:e.accreditationProfileCategoryId,accreditationProfileId:e.accreditationProfileId,accreditationSlotId:e.accreditationSlotId}),[e.accreditationCategoryId,e.accreditationId,e.accreditationProfileCategoryId,e.accreditationProfileId,e.accreditationSlotId]);return(0,i.jsx)(yC,{children:(0,i.jsx)(nx,{columns:d,columnsSearch:[],columnsToIncludes:Rp,eventId:s,filters:j,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:wr,loadDataListParams:{accreditationsCategoriesIds:"number"==typeof e.accreditationCategoryId?[e.accreditationCategoryId]:void 0,accreditationsIds:"number"==typeof e.accreditationId?[e.accreditationId]:void 0,accreditationsProfilesCategoriesIds:"number"==typeof e.accreditationProfileCategoryId?[e.accreditationProfileCategoryId]:void 0,accreditationsProfilesIds:"number"==typeof e.accreditationProfileId?[e.accreditationProfileId]:void 0,accreditationsSlotsIds:"number"==typeof e.accreditationSlotId?[e.accreditationSlotId]:void 0,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:Er,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:v,predicates:h,renderActions:(e,n,t)=>(0,i.jsx)(Rq,{massActions:e,predicates:h,scope:S,showOnlyMassEdit:!0,sort:p,totalNumberOfMembers:n,onMassEditSuccess:t}),renderAllSelectedText:e=>n("les_1_membres_31409",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_34300",e),rendering:gp.List,setColumns:l,setLimit:u,setPredicates:g,setSort:I,showEditColumns:!0,showEditMode:r,showFilters:!0,showMassActions:r,showPredicatesBadges:!0,showRowDropdown:r,showRowEdit:r,showSearchColumns:!1,showSelectAll:!0,sort:p,children:(0,i.jsx)(px,{renderCell:(e,n,t)=>(0,i.jsx)(Ew,{canChangeDelegation:!0,canMemberAccredit:!0,canMemberAssign:!0,column:e,customField:_.get(e.slug),eventId:s,reloadRow:t,row:n})})})})},Mq=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s},translate:o}=fc();fm(e.event.accreditation.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,accreditationId:e?":accreditationId":s});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(WG,{accreditation:e.event.accreditation}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:mo.ACCREDITATION_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:mo.ACCREDITATION_MEMBERS(a(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($C,{path:mo.ACCREDITATION_DASHBOARD(a(!0)),children:(0,i.jsx)(sq,{})}),(0,i.jsx)($C,{path:mo.ACCREDITATION_MEMBERS(a(!0)),children:(0,i.jsx)(Dq,{accreditationId:s})})]})]})},Pq=()=>{const{params:{organizationId:e,eventId:n,accreditationId:t}}=fc(),{data:s,loader:o}=rs("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n accreditationCategoryId\n accreditationCategoryName\n assignedResources\n hasSlots\n acronym\n color\n icon\n numberOfSlots\n }\n\n volunteersRegistrations(accreditationsIds: [$accreditationId]) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationId:t},[],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:mo.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(gs,{path:mo.ACCREDITATION_DASHBOARD({organizationId:e,eventId:n,accreditationId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(Mq,{event:s.event})})]})},kq=e=>{const n=os(),t=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",s=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(Wu,{css:{overflow:"hidden"},gridtemplatecolumns:`${t} 1fr ${s}`,gridtemplaterows:"88px 1fr 72px",height:1,width:1,children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(Xl,{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)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(ux,{placement:"top",children:e.isLeftPanelOpen?n("cacher_la_liste_66205"):n("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(Zr,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(Zr,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(Zr,{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)(Xl,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(pc,{icon:"sidebar"})})}),(0,i.jsx)(ux,{placement:"top",children:n("afficher_les_in_82197")})]})})})]})},Fq=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=fc(),r=ss(Wg),d=(0,de.useMemo)(()=>e.teams.find(n=>n.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),l=(0,de.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===a?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(Xl,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(Zr,{css:{position:"relative"},children:[(0,i.jsx)(F_,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(Xl,{align:"center",css:{background:Lr.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:Lr.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(pc,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(gc,{to:Ev.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:a}),children:(0,i.jsx)(Zr,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(Zr,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&d&&(0,i.jsx)(Lm,{leftIcon:"shield",children:t("chef_d_quipe_20641")}),e.delegation&&(0,i.jsx)(Lm,{cursor:"pointer",leftIcon:"building",onClick:()=>n.push(vo.DELEGATION({organizationId:s,eventId:o,delegationId:e.delegation.id})),children:e.delegation.name})]}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray500",children:r.toLocaleString(e.insertedAt,da.DateOnly.MonthLong)}),e.showTeam&&f(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray500",children:"•"}),(0,i.jsx)(Zr,{color:"gray500",children:t("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(Zr,{color:"gray500",children:"•"}),(0,i.jsx)(vw,{teamMembers:l})]})]})]}),e.showTabs&&(0,i.jsx)(Zr,{width:320,children:(0,i.jsxs)(RS,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:t=>{"preassign"!==t||e.isPreAssign?"affect"===t&&e.isPreAssign&&n.replace(Wo.ASSIGNMENT(s,o,a)):n.replace(Wo.PRE_ASSIGNMENT(s,o,a))},children:[(0,i.jsx)(DS,{item:"affect",children:t("affecter_94255")}),(0,i.jsx)(DS,{item:"preassign",children:t("pr_affecter_17434")})]})})]})},Nq=e=>{const n=os(),t=ss(Wg);return(0,i.jsxs)(Xl,{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)(F_,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(Zr,{children:n("inscrit_le_1_12018",t.toLocaleString(e.vr.insertedAt,da.DateOnly.MonthLong))})]})]})},Lq=()=>(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(Vm,{size:40,variant:"circular"}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]})]}),Uq=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),a=e.event?.delegations?.nodes??[],r=e.event?.segmentsFolders??[],d=e.event?.volunteersRegistrations.totalCount??0,l=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(Xl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Xl,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(GC,{color:"primary",returnPathFallback:mo.ACCREDITATIONS({organizationId:t,eventId:s}),children:o("retour_92202")}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(Lm,{color:"error",size:"sm",children:o("profil_restant",d)})]})]}),(0,i.jsxs)(Xl,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(Xl,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsxs)(nf,{label:o("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:ut.Desc,children:o("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:ut.Asc,children:o("du_plus_ancien_08999")})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:o("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:n=>{f(n)?e.setSegmentId((0,eh.A)(n)):e.setSegmentId(-1)},children:r.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)(lg,{isSelectAllVisible:!0,label:o("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:yt.WaitingAssignment,children:o(yt.WaitingAssignment)}),(0,i.jsx)("option",{value:yt.PreAssigned,children:o(yt.PreAssigned)}),(0,i.jsx)("option",{value:yt.Assigned,children:o(yt.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(lg,{isSelectAllVisible:!0,label:o("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:Re.WaitingAccreditation,children:o(Re.WaitingAccreditation)}),(0,i.jsx)("option",{value:Re.AutoAccredited,children:o(Re.AutoAccredited)}),(0,i.jsx)("option",{value:Re.Accredited,children:o(Re.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:o("Delegation")}),e.isLoading?(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:n=>{f(n)?e.setDelegationId((0,eh.A)(n)):e.setDelegationId(null)},children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lq,{}),(0,i.jsx)(Lq,{}),(0,i.jsx)(Lq,{})]}):l.map(t=>(0,i.jsx)(Nq,{displayBorder:!0,isSelected:t.userInfo.id===e.userInfoId,vr:t,onClick:()=>{n.push(e.getPath(t.userInfo.id))}},t.userInfo.id))})]})},Vq=e=>{const[n,t]=(0,de.useState)(e.isOpen??!0),s=(0,de.useCallback)(n=>{e.setIsOpen?.(n),t(n)},[e.setIsOpen,t]);return(0,de.useEffect)(()=>{"boolean"==typeof e.isOpen&&t(e.isOpen)},[e.isOpen]),(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{s(!n)},children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(pc,{icon:n?"chevron-down":"chevron-right"})}),(0,i.jsx)(Xl,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),n&&e.children]})},Bq=e=>{const n=os(),t=ss(Wg),[s,o]=ZP("assignment.rightPanel.areAccreditationsOpen",!0),a=(0,de.useMemo)(()=>function(e,n,t,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const s=qp(n,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:s,path:mo.ACCREDITATION({organizationId:t,eventId:i,accreditationId:e.accreditation.id})}}))}(e.formsUsersInfos,t,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(Vq,{isOpen:s,setIsOpen:o,title:n("accr_ditations_74375"),children:(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("accr_ditation_s_00595")})}),a.map((e,n)=>(0,i.jsx)(Eg,{children:(0,i.jsxs)(_g,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle})]})},n))]})})},Wq=e=>{const n=ss(Wg);return(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{justify:"between",children:[(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:n.toLocaleString(e.comment.insertedAt,{...da.DateTime,month:"numeric"})})]}),(0,i.jsx)(Xl,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},Gq=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{data:o,isLoading:a,reload:r}=Rl({organizationId:n,userInfoId:s}),{mutate:d,isLoading:l}=Ol(),[c,u]=(0,de.useState)(""),{permissions:[m]}=pw(dw({organizationId:n,eventId:t,userInfoId:s}));return(0,i.jsxs)(Xl,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[a?(0,i.jsx)(Vm,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):o.organization.userInfo.comments.map(e=>(0,i.jsx)(Wq,{comment:e},e.id)),m&&(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(Gf,{children:(0,i.jsx)(Xx,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(Wf,{children:o=>(0,i.jsx)(yc,{disabled:$(c),isLoading:l,onClick:async()=>{await d({organizationId:n,eventId:t,userInfoId:s,comment:{content:c}}),r(),o()},children:e("ajouter_97327")})})]})]})]})},qq=e=>{const n=os(),[t,s]=ZP("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(Vq,{isOpen:t,setIsOpen:s,title:e.title,children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Uw,{children:n("Email")}),(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(n=>(0,i.jsx)(Vw,{field:n,fields:e.userInfo.fields},n.id)),e.formsIds.map(t=>{const s=Fw(t,n);return w(e.userInfo.fields[s.slug])?(0,i.jsx)(Vw,{field:s,fields:e.userInfo.fields},s.slug):null})]})},Hq=e=>{const n=os(),t=ss(Nh),[s,o]=ZP("assignment.rightPanel.arePositionsOpen",!0),a=(0,de.useMemo)(()=>n$(e.formsUsersInfos,t,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(Vq,{isOpen:s,setIsOpen:o,title:n("missions_souhai_23225"),children:(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("mission_souhait_49168")})}),a.map((e,t)=>(0,i.jsx)(Eg,{children:(0,i.jsxs)(_g,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===Cn.Ranked&&(0,i.jsx)(Lm,{children:n("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(Zr,{color:"gray500",children:e.range})]})},t))]})})},Yq=e=>{const n=os(),t=ss(Wg),s=ss(Nh),[o,a]=ZP("assignment.rightPanel.areAvailabilitiesOpen",!0),r=(0,de.useMemo)(()=>(0,Tg.A)(e.formsUsersInfos.flatMap(e=>e.slots.map(n=>({display:e.form.slotDisplay,slot:n}))),({slot:e})=>e.range.start.toMillis()).map(({display:e,slot:n})=>e===at.Calendar||e===at.DisplayDays?t.toLocaleString(n.range.start,da.DateOnly.MonthLong):s.toDisplayString(n.range)),[t,s,e.formsUsersInfos]);return(0,i.jsx)(Vq,{isOpen:o,setIsOpen:a,title:n("disponibilit_s_49923"),children:(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("disponibilit_92461")})}),r.map((e,n)=>(0,i.jsx)(Eg,{children:(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:e})})},n))]})})},Zq=e=>{const n=os(),t=(0,de.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(Xl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(pc,{icon:"sidebar"})})}),(0,i.jsx)(ux,{placement:"top",children:n("cacher_les_info_51832")})]}),(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:n("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(Gq,{}),(0,i.jsx)(qq,{customFields:e.customFields,formsIds:t,title:n("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(Yq,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(Hq,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(Bq,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},Kq=(0,de.createContext)({}),Xq=e=>{const[n,t]=(0,de.useState)(e.accreditationProfileId),[s,o]=(0,de.useState)(e.accreditationsSlotsIds);return(0,i.jsx)(Kq.Provider,{value:{accreditationProfileId:n,accreditationsSlotsIds:s,alreadyAssignedProfileId:e.alreadyAssignedProfileId,alreadyAssignedSlotsIds:e.alreadyAssignedSlotsIds,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationProfileId:t,setAccreditationsSlotsIds:o},children:e.children})};function Qq(){return(0,de.useContext)(Kq)}const Jq=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{accreditationProfileId:a,accreditationsSlotsIds:r,showNextMember:d}=Qq(),{mutate:l,isLoading:c}=jr(),{mutate:u,isLoading:m}=Ra(),g=(0,de.useCallback)(()=>{e.isEdit?n.goBack(Wo.VOLUNTEERS(t,s)):d()},[e.isEdit,d]);return(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{m||c||(await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:Re.Refused}}),g())},children:o("refuser_92819")}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(yc,{color:"primary",isLoading:m,onClick:async()=>{m||c||(await u({eventId:s,massAccredit:{accreditationsSlotsIds:r,accreditationProfile:{accreditationProfileId:a},selecteds:{ids:[e.userInfoId]},strategy:Dn.Replace}}),g())},children:e.isEdit?o("mettre_jour_l_11622"):o("accr_diter_70543")}),(0,i.jsx)(yc,{color:"white",onClick:g,children:e.isEdit?o("annuler_48254"):o("accr_diter_plus_19053")})]})},eH=e=>{const{accreditationsSlotsIds:n,alreadyAssignedSlotsIds:t,setAccreditationsSlotsIds:s}=Qq(),o=(0,de.useMemo)(()=>Hp(e.accreditationsSlots.filter(n=>n.accreditationId===e.accreditation.id)),[e.accreditationsSlots,e.accreditation]),a=(0,de.useMemo)(()=>Object.fromEntries(o.map(e=>[e.id,e])),[o]),r=(0,de.useMemo)(()=>Object.fromEntries((e.delegationAccreditationsSlots||[]).map(e=>[e.accreditationSlotId,e])),[e.delegationAccreditationsSlots]),d=(0,de.useCallback)(e=>{const n=r[e],t=a[e];return(0,$h.A)((0,sc.A)(["number"==typeof t?.maxResources?{assignedResources:t.assignedResources,maxResources:t.maxResources,remaining:t.maxResources-t.assignedResources}:null,"number"==typeof n?.maxResources?{assignedResources:n.assignedResources,maxResources:n.maxResources,remaining:n.maxResources-n.assignedResources}:null]),e=>e.remaining)??null},[r,a]),l=(0,de.useCallback)(e=>{const n=r[e],i=a[e],s=!!n&&n.isFull&&!t.includes(e),o=!!i&&(i.isBlocked||i.isFull&&!t.includes(e));return s||o},[t,r,a]),c=(0,de.useMemo)(()=>e.accreditation.hasSlots?null:(0,i.jsx)(q$,{getAssignedMaxRemaining:d,slotId:e.accreditation.hiddenSlotId}),[d,e.accreditation]),u=n.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsx)(AA,{accreditation:e.accreditation,badge:c,displayNumberOfSlots:e.accreditation.hasSlots,displaySlots:e.accreditation.hasSlots,numberOfSlots:o.length,renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(Ym,{disabled:l(e.accreditation.hiddenSlotId),shouldPreventDefault:!1,state:u,onClick:Ou.A}),onClick:()=>{e.accreditation.hasSlots||l(e.accreditation.hiddenSlotId)||s(j(n,e.accreditation.hiddenSlotId,"unchecked"===u))},children:(0,i.jsx)(Xl,{css:{background:"white",padding:"$4"},children:e.accreditation.hasSlots?e.accreditation.accreditationDisplay===be.Calendar?(0,i.jsx)(Y$,{accreditationsSlotsIds:n,slotIdToDas:r,slots:o,onChange:s}):(0,i.jsxs)(Xl,{css:{background:"white",bd:!0},direction:"column",width:1,children:[(0,i.jsx)(Xl,{css:{padding:"$4"},direction:"column",gap:"3",children:e.accreditation.accreditationDisplay===be.Radio?(0,i.jsx)(QM,{accreditation:e.accreditation,accreditationsSlotsIds:n,getAssignedMaxRemaining:d,getDisabled:l,slots:o,onChange:s}):(0,i.jsx)(XM,{accreditation:e.accreditation,accreditationsSlotsIds:n,getAssignedMaxRemaining:d,getDisabled:l,slots:o,onChange:s})}),(0,i.jsx)(JM,{accreditation:e.accreditation,accreditationsSlotsIds:n,slots:o,onChange:s})]}):null})})},nH=e=>{const n=(0,de.useMemo)(()=>rp((0,wh.A)(e.accreditationsSlots.flatMap(n=>n.accreditationCategoryId===e.category.id?[n.accreditation]:[]),e=>e.id)),[e.accreditationsSlots,e.category]);return(0,i.jsx)(bA,{category:e.category.name,children:n.map(n=>(0,i.jsx)(eH,{accreditation:n,accreditationsSlots:e.accreditationsSlots,delegationAccreditationsSlots:e.delegation?.accreditationsSlots},n.id))})},tH=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>b(e.name)),[e.accreditationsSlots]);return(0,i.jsxs)(Xl,{css:{background:"white",bd:"gray200 2",padding:"$4 $5"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("accr_ditations_39450")}),(0,i.jsx)(CA,{css:{bd:"gray200 2"},children:t.map(n=>(0,i.jsx)(nH,{accreditationsSlots:e.accreditationsSlots,category:n,delegation:e.delegation},n.id))})]})},iH=e=>{const{accreditationProfileId:n,alreadyAssignedProfileId:t,setAccreditationProfileId:s}=Qq(),o=(0,de.useMemo)(()=>(0,Tg.A)(e.accreditationsProfiles.filter(n=>n.accreditationProfileCategoryId===e.category.id),e=>b(e.name)),[e.accreditationsProfiles,e.category]);return(0,i.jsx)(bA,{category:e.category.name,children:o.map(o=>(0,i.jsx)(ZM,{accreditationProfileId:n,alreadyAssignedProfileId:t,delegationAccreditationsProfiles:e.delegation?.accreditationsProfiles,profile:o,setAccreditationProfileId:s,showDescription:!1},o.id))})},sH=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(e.accreditationsProfiles.map(e=>e.accreditationProfileCategory),e=>e.id),e=>b(e.name)),[e.accreditationsProfiles]);return(0,i.jsxs)(Xl,{css:{background:"white",bd:"gray200 2",padding:"$4 $5"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("profils_d_accr_27825")}),(0,i.jsx)(CA,{css:{bd:"gray200 2"},children:t.map(n=>(0,i.jsx)(iH,{accreditationsProfiles:e.accreditationsProfiles,category:n,delegation:e.delegation},n.id))})]})},oH=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>e.event.accreditationsCategories.flatMap(e=>e.accreditations),[e.event.accreditationsCategories]),o=(0,de.useMemo)(()=>e.event.accreditationsProfilesCategories.flatMap(e=>e.accreditationsProfiles),[e.event.accreditationsProfilesCategories]),a=(0,de.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(n=>e.event.accreditationsCategories.find(e=>e.id===n).name).join(", "),[e.accreditationsCategoriesIds,e.event]),r=(0,de.useMemo)(()=>(e.accreditationsIds||[]).map(e=>s.find(n=>n.id===e).name).join(", "),[s,e.accreditationsIds]),d=(0,de.useMemo)(()=>(e.accreditationsProfilesIds||[]).map(e=>o.find(n=>n.id===e).name).join(", "),[o,e.accreditationsProfilesIds]),l=(0,de.useMemo)(()=>e.date?t.toLocaleString(e.date,da.DateOnly.MonthLong):"",[e.date]),c=(0,de.useMemo)(()=>e.segmentId?e.event.segments.find(n=>n.id===e.segmentId).name:"",[e.segmentId,e.event]),u=(0,de.useMemo)(()=>(e.tagsIds||[]).map(n=>e.organization.tags.nodes.find(e=>e.id===n).name).join(", "),[e.tagsIds,e.organization]);return w(a)||w(r)||w(d)||w(l)||w(c)||w(u)||e.excludeFull||e.excludePast||e.onlyDelegation?(0,i.jsxs)(Xl,{align:"center",gap:"3",wrap:"wrap",children:[w(a)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsCategoriesIds([]),children:n("cat_gories_1_42029",a)}),w(r)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsIds([]),children:n("accr_ditations_30765",r)}),w(d)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setAccreditationsProfilesIds([]),children:n("profils_d_accr_16603",d)}),w(l)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setDate(null),children:n("date_1_17337",l)}),w(c)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setSegmentId(null),children:n("vue_1_29260",c)}),w(u)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setTagsIds([]),children:n("tags_1_43158",u)}),e.excludeFull&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setExcludeFull(!1),children:n("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setExcludePast(!1),children:n("cr_neaux_dans_l_92999")}),e.onlyDelegation&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>e.setOnlyDelegation(!1),children:n("accr_ditations_07661")}),(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:n("r_initialiser_l_66835")})]}):null},aH=e=>{const n=os(),[t,s]=(0,de.useState)(e.accreditationsCategoriesIds),[o,a]=(0,de.useState)(e.accreditationsIds),[r,d]=(0,de.useState)(e.accreditationsProfilesIds),[l,c]=(0,de.useState)(e.date),[u,m]=(0,de.useState)(e.tagsIds),[g,h]=(0,de.useState)(e.segmentId?[e.segmentId]:[]),[I,x]=(0,de.useState)(e.onlyDelegation?"checked":"unchecked"),[_,j]=(0,de.useState)(e.excludeFull?"checked":"unchecked"),[v,S]=(0,de.useState)(e.excludePast?"checked":"unchecked"),y=(0,de.useMemo)(()=>(0,Tg.A)(e.event.accreditationsCategories,e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.event.accreditationsCategories]),C=(0,de.useMemo)(()=>{return n=e.event.accreditationsCategories,(0,Tg.A)(n,e=>b(e.name)).map(e=>{const n=rp(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)});var n},[e.event.accreditationsCategories]),A=(0,de.useMemo)(()=>yA(e.event.accreditationsProfilesCategories),[e.event.accreditationsProfilesCategories]);return(0,i.jsxs)(Xl,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(Xl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("liste_des_filtr_75605")}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_97056"),renderOnPortal:!0,values:t||p,onChange:s,children:y}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_92029"),renderOnPortal:!0,values:o||p,onChange:a,children:C}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_72321"),renderOnPortal:!0,values:r||p,onChange:d,children:A}),(0,i.jsx)(df,{max:e.event.endAt,min:e.event.startAt,placeholder:n("date_du_cr_neau_82295"),value:l,onChange:c}),(0,i.jsx)(lg,{isSearchVisible:!0,placeholder:n("s_lectionnez_un_19794"),renderOnPortal:!0,values:g,onChange:e=>{f(e)?h([(0,eh.A)(e)]):h([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||p,onChange:m,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Zm,{state:I,onClick:x,children:n("seulement_les_a_45276")}),(0,i.jsx)(Zm,{state:_,onClick:j,children:n("masquer_les_cr_14425")}),(0,i.jsx)(Zm,{state:v,onClick:S,children:n("masquer_les_cr_05336")})]}),(0,i.jsxs)(Xl,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:n("r_initialiser_77538")}),(0,i.jsx)(yc,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(t),e.setAccreditationsIds(o),e.setAccreditationsProfilesIds(r),e.setDate(l),e.setExcludeFull("checked"===_),e.setExcludePast("checked"===v),e.setOnlyDelegation("checked"===I),e.setSegmentId(f(g)?g[0]:null),e.setTagsIds(u),e.close()},children:n("appliquer_05753")})]})]})},rH=e=>{const n=os(),[t,s]=(0,de.useState)(!1),o=(0,de.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setAccreditationsProfilesIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setOnlyDelegation(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setAccreditationsProfilesIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setOnlyDelegation,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Xl,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,isOpen:t,onStateChange:s,children:[(0,i.jsx)($m,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"bars-filter",children:n("filtres_64574")})})}),(0,i.jsx)(wm,{placement:"bottom-end",width:385,children:(0,i.jsx)(aH,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(oH,{...e,reset:o})]})},dH=({event:e,organization:n})=>{const{eventId:t}=ls(),[s,o,a]=Dg(""),[r,d]=ZP("accredit.filters.accreditationsCategoriesIds",null),[l,c]=ZP("accredit.filters.accreditationsIds",null),[u,m]=ZP("accredit.filters.accreditationsProfilesIds",null),[g,h]=ZP("accredit.filters.date",null),[p,I]=ZP("accredit.filters.tagsIds",null),[x,_]=ZP("accredit.filters.segmentId",null),[j,v]=ZP("accredit.filters.excludeFull",!1),[S,y]=ZP("accredit.filters.excludePast",!1),[C,b]=ZP("accredit.filters.onlyDelegation",!0),{data:A,loader:E}=rs("query AccreditSlots(\n $eventId: EventId!\n $name: String\n $accreditationCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $accreditationsProfilesIds: [AccreditationsProfileId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n $delegationId: DelegationId\n) {\n event(id: $eventId) {\n accreditationsProfiles(\n name: $name\n ids: $accreditationsProfilesIds\n delegationId: $delegationId\n ) {\n nodes {\n ...AccreditationProfile\n }\n }\n\n accreditationsSlots(\n includeHidden: true\n name: $name\n accreditationsCategoriesIds: $accreditationCategoriesIds\n accreditationsIds: $accreditationsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n delegationId: $delegationId\n ) {\n nodes {\n ...AccreditationsSlot\n }\n }\n }\n}\n",{eventId:t,name:w(o)?o:void 0,accreditationCategoriesIds:f(r)?r:void 0,accreditationsIds:f(l)?l:void 0,accreditationsProfilesIds:f(u)?u:void 0,date:g,tagsIds:f(p)?p:void 0,segmentId:x,excludeFull:j,excludePast:S,delegationId:C?e.volunteerRegistration.delegation?.id:void 0},[Ko.AccreditationProfileFragment,Ko.AccreditationsSlotFragment],undefined);return(0,i.jsxs)(Xl,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",gap:"7",width:1,children:[(0,i.jsx)(rH,{accreditationsCategoriesIds:r,accreditationsIds:l,accreditationsProfilesIds:u,date:g,event:e,excludeFull:j,excludePast:S,name:s,onlyDelegation:C,organization:n,segmentId:x,setAccreditationsCategoriesIds:d,setAccreditationsIds:c,setAccreditationsProfilesIds:m,setDate:h,setExcludeFull:v,setExcludePast:y,setName:a,setOnlyDelegation:b,setSegmentId:_,setTagsIds:I,tagsIds:p}),E||(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[f(A.event.accreditationsProfiles.nodes)&&(0,i.jsx)(sH,{accreditationsProfiles:A.event.accreditationsProfiles.nodes,delegation:e.volunteerRegistration.delegation}),f(A.event.accreditationsSlots.nodes)&&(0,i.jsx)(tH,{accreditationsSlots:A.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})]})},lH=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=fc();fm(t("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[r,d]=ZP("accredit.isLeftPanelOpen",!0),[l,c]=ZP("accredit.isRightPanelOpen",!0),[u,m,g]=Dg(""),[h,I]=ZP("accredit.leftPanelDirection",ut.Desc),[x,_]=ZP("accredit.leftPanelSegmentId",-1),[j,v]=ZP("accredit.leftPanelDelegationId",null),[S,y]=ZP("accredit.leftPanelStates",[Re.AutoAccredited,Re.WaitingAccreditation]),{data:C,isLoading:b}=$a({eventId:o,accreditationStates:S,name:w(m)?m:void 0,segmentId:-1===x?void 0:x,delegationId:j||void 0,direction:h,loadDelegations:!0}),A=(0,de.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],t=e.findIndex(e=>e.userInfo.id===a),i=e[t+1]?.userInfo.id??e[0].userInfo.id;i===a?n.goBack(Wo.ACCREDIT(s,o,a)):n.replace(Wo.ACCREDIT(s,o,i))},[s,o,a,C.event]),E=e.event.volunteerRegistration,$=(0,de.useMemo)(()=>e.isEdit?E.accreditationProfileId:null,[e.isEdit,E]),T=(0,de.useMemo)(()=>{if(e.isEdit)return E.accreditationProfileId;{const e=(0,sc.A)(E.userInfo.formsUsersInfos.flatMap(e=>{const n=E.delegation?.accreditationsProfiles.find(n=>n.accreditationProfileId===e.accreditationProfileId);return"number"==typeof n?.maxResources&&n.assignedResources>=n.maxResources?[]:[e.accreditationProfileId]}));return f(e)?e[0]:null}},[e.isEdit,E]),z=(0,de.useMemo)(()=>E.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),[E]),O=(0,de.useMemo)(()=>[...z,...e.isEdit?[]:E.userInfo.formsUsersInfos.flatMap(e=>e.accreditationsSlots.flatMap(e=>{const n=E.delegation?.accreditationsSlots.find(n=>n.accreditationSlotId===e.id),t=n?.maxResources&&n?.assignedResources>=n?.maxResources;return e?.maxResources&&e?.assignedResources>=e?.maxResources||t?[]:[e.id]}))],[z,E,e.isEdit]);return(0,i.jsx)(Xq,{accreditationProfileId:T,accreditationsSlotsIds:O,alreadyAssignedProfileId:$,alreadyAssignedSlotsIds:z,isEdit:e.isEdit,showNextMember:A,children:(0,i.jsx)(kq,{buttons:(0,i.jsx)(Jq,{isEdit:e.isEdit,userInfoId:E.userInfo.id}),header:(0,i.jsx)(Fq,{badgeColorIcon:UC(E.accreditationState),delegation:E.delegation,insertedAt:E.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:p,userInfo:E.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(Uq,{accreditationStates:S,delegationId:j,direction:h,event:C.event,getPath:e=>Wo.ACCREDIT(s,o,e),isLoading:b,loadDelegations:!0,name:u,segmentId:x,setAccreditationStates:y,setDelegationId:v,setDirection:I,setName:g,setSegmentId:_,setStates:Ou.A,showAccreditationStates:!0,showStates:!1,states:p,userInfoId:E.userInfoId}),rightPanel:(0,i.jsx)(Zq,{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:d,setIsRightPanelOpen:c,children:(0,i.jsx)(dH,{event:e.event,organization:e.organization})})})},cH=e=>{const{organizationId:n,eventId:t,userInfoId:s}=ls(),{data:o,loader:a}=rs("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 accreditations {\n id\n name\n index\n }\n }\n\n accreditationsProfilesCategories {\n id\n name\n\n accreditationsProfiles {\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 accreditationProfileId\n insertedAt\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n delegation {\n id\n name\n\n accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n\n picture {\n url\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n accreditationProfileId\n\n accreditationsSlots {\n id\n maxResources\n assignedResources\n }\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:t,userInfoId:s},[Ko.FormsUsersInfosWishedFragment,Ko.CustomFieldWithConditionFragment,Ko.DelegationAccreditationProfileFragment,Ko.DelegationAccreditationSlotFragment],undefined);return a||(0,i.jsx)(lH,{event:o.event,isEdit:e.isEdit,organization:o.organization})},uH=()=>{const{translate:e,params:{eventId:n}}=fc(),[t,s,o]=Dg(""),[a,r]=(0,de.useState)(""),[d,l]=(0,de.useState)(0),{data:c,isLoading:u,reload:m}=rs("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:n,name:w(s)?s:void 0,state:""!==a?a:void 0,offset:d},[Ko.EmailRecipientFragment],undefined);const g=zg(),{numberOfPages:h,totalCount:p}=Jf(c.event?.emails);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:a,onChange:e=>{r(e),l(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),g(ai.filter(e=>e!==rn.Queued))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:t,onChange:e=>{o(e),l(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Mg,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Mg,{children:e("State")}),(0,i.jsx)(Mg,{width:100})]}),numberOfPages:h,offset:d,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(kC,{email:e,emailType:ln.Accreditations,reload:m},e.id)),setOffset:l,title:e("liste_des_envoi_14764"),totalCount:p})},mH=e=>{const n=os(),{mutate:t,isLoading:s}=function(e={}){return ds("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)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(uA,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("les_membres_pr_09143")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:s,onClick:async()=>{await t({eventId:e.eventId,sendAccreditationsEmails:e.sendAccreditationsEmails}),e.reload(),e.onClose()},children:n("confirmer_l_env_08749")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},gH=e=>{const n=os(),[t,s,o]=Dg(""),[a,r]=(0,de.useState)([]),{data:d}=Rd({eventId:e.eventId,usersInfosIds:a,name:w(s)?s:void 0}),l=(0,de.useMemo)(()=>(0,wh.A)((d.event?.volunteersRegistrations.nodes??[]).concat(d.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[d.event]),{mutate:c,isLoading:u}=function(e={}){return ds("mutation AccreditationsEmailsEstimate(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsEstimate(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}(),[m,g]=(0,de.useState)(Ee.Everyone),[h,p]=(0,de.useState)([]),I=m===Ee.Everyone||m===Ee.Accredited||m===Ee.Refused||m===Ee.Members&&f(a)||m===Ee.Segments&&f(h),x=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(uA,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("envoi_des_e_mai_83224")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("personnaliser_v_78340")}),(0,i.jsx)(ic,{height:"7"}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"error",children:(0,i.jsx)(Oc,{children:n("vous_ne_pouvez_69435")})}),(0,i.jsx)(ic,{height:"4"})]}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("que_souhaitez_v_01732")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(eg,{state:m===Ee.Everyone?"checked":"unchecked",onClick:()=>{g(Ee.Everyone)},children:n("tous_les_e_mail_50843")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:m===Ee.Accredited?"checked":"unchecked",onClick:()=>{g(Ee.Accredited)},children:n("tous_les_e_mail_02185")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:m===Ee.Refused?"checked":"unchecked",onClick:()=>{g(Ee.Refused)},children:n("tous_les_e_mail_41162")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:m===Ee.Members?"checked":"unchecked",onClick:()=>{g(Ee.Members)},children:n("_certains_memb_91094")}),m===Ee.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:t,onChange:o}),values:a,onChange:r,children:l.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:m===Ee.Segments?"checked":"unchecked",onClick:()=>{g(Ee.Segments)},children:n("uniquement_ce_54026")}),m===Ee.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,values:h,onChange:p,children:(d.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:x,isLoading:u,onClick:async()=>{if(I){const n={recipients:m,segmentsIds:h,usersInfosIds:a},{eventAccreditationsEmailsEstimate:t}=await c({eventId:e.eventId,sendAccreditationsEmails:n});e.onSuccess(t,n),e.onClose()}},children:n("envoyer_les_e_m_37846")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},hH=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{setNumberOfWaitingAccreditations:a}=Ly(),[r,d]=(0,de.useState)(!1),[l,c]=(0,de.useState)(null),[u,m]=(0,de.useState)(0),[g,h]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{a(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yC,{children:[(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsxs)(jL,{button:(0,i.jsx)(yc,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&n.push(Wo.ACCREDIT(t,s,e.event.waitingAccreditation.nodes[0].userInfoId))},children:o("accr_diter_les_48281")}),children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:o("membres_en_atte_52995")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(jL,{button:(0,i.jsx)(yc,{onClick:()=>{d(!0)},children:o("param_trer_et_e_31095")}),children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:o("e_mail_de_confi_84099_plural")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(ic,{height:"9"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:o("historique_des_71419")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:o("nombre_d_envois_95106")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:o("nombre_d_ouvert_84187")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:o("nombre_de_clics_64232")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(uH,{})]}),r&&(0,i.jsx)(gH,{emailSender:e.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{d(!1)},onSuccess:(e,n)=>{m(e),c(n),h(!0)}}),g&&(0,i.jsx)(mH,{eventId:s,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:l,onClose:()=>{h(!1)}})]})},pH=()=>{const e=os();return(0,i.jsxs)(bC,{direction:"column",children:[(0,i.jsx)(Zr,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(Zr,{color:"gray500",children:e("accr_diter_vos_35773")})]})},IH=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s},localEvent:o,updateLocalEvent:a}=Ly();fm(`${s} ${t("accr_ditations_39450")}`);const{data:r,loader:d,reload:l}=rs('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:n,direction:o?.["accredit.leftPanelDirection"]??ut.Desc},[],undefined);return(0,de.useEffect)(()=>{(async()=>{await Promise.all([a({"accredit.filters.accreditationsCategoriesIds":null}),a({"accredit.filters.accreditationsIds":null}),a({"accredit.filters.accreditationsProfilesIds":null}),a({"accredit.filters.date":null}),a({"accredit.filters.tagsIds":null}),a({"accredit.filters.segmentId":null}),a({"accredit.filters.excludeFull":!1})])})()},[]),d||(0,i.jsxs)(AC,{children:[(0,i.jsx)(pH,{}),(0,i.jsx)(hH,{event:r.event,organization:r.organization,reload:l})]})},fH=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_56396")],text:n("suppression_de_73669",e.accreditationCategory.name),onClose:e.onClose,onDelete:async()=>{await t({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id}),e.onSuccess()}})},xH=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:mo.ACCREDITATIONS({organizationId:n,eventId:t}),children:s("accr_ditations_39450")}),(0,i.jsx)(gO,{isCurrent:!0,to:mo.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.category.id}),children:e.category.name})]})},_H=({category:e,reload:n})=>{const{history:t,params:{organizationId:s,eventId:o},translate:a}=fc(),r=VG(),{mutate:d}=function(e={}){return ds("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,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(!1);return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsx)(xH,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(yc,{color:"white",onClick:()=>m(!0),children:a("_diter_62574")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{t.push(Wo.CREATE_ACCREDITATION(s,o,e.id))},children:a("add_accreditation")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",onClick:()=>r(DG,{accreditationsCategoriesIds:[e.id]}),children:a("exporter_les_me_63676")}),(0,i.jsx)(Em,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:n}}=await d({eventId:o,accreditationCategoryId:e.id});t.push(mo.ACCREDITATION_CATEGORY({organizationId:s,eventId:o,accreditationCategoryId:n}))},children:a("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:a("supprimer_43083")})})]})]})}),u&&(0,i.jsx)(hW,{accreditationCategory:e,eventId:o,onClose:()=>{m(!1)},onSuccess:n}),l&&(0,i.jsx)(fH,{accreditationCategory:e,eventId:o,onClose:()=>{c(!1)},onSuccess:()=>{t.replace(mo.ACCREDITATIONS({organizationId:s,eventId:o}))}})]}),name:e.name,subtext:a("accreditation",e.numberOfAccreditations)})},jH=e=>{const{setNodeRef:n,style:t,handleProps:s}=pI(e.accreditation.id);return(0,i.jsxs)(Xl,{ref:n,align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",style:t,children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"pointer"},...s,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.accreditation.name})]})},vH=e=>{const{translate:n,params:{eventId:t,accreditationCategoryId:s}}=fc(),{data:o,loader:a}=rs("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:t,accreditationCategoryId:s},[],undefined);const{mutate:r}=Fa(),[d,l]=(0,de.useState)([]),[c,u]=(0,de.useState)(!1),m=(0,de.useCallback)(async()=>{u(!0),await Promise.all(d.map((e,n)=>r({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:Ae.Index,strategy:Dn.Replace,value:n}}))),e.onClose(),e.onSuccess(),u(!1)},[t,d,u,r,e.onClose,e.onSuccess]),g=(0,de.useCallback)((e,n)=>{l(S(d,e,n))},[d,l]);return(0,de.useEffect)(()=>{l(rp(o.event?.accreditationCategory.accreditations??[]))},[o.event,l]),(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{isLoading:c,onClick:m,children:n("enregistrer_06519")}),category:n("liste_des_accr_02647"),heading:n("changer_l_ordre_11550"),onClose:e.onClose,children:a||(0,i.jsxs)(kx,{css:{background:"white "},children:[(0,i.jsx)(Zr,{font:"gray900 textLg semiBold",children:n("organisation_de_45058")}),(0,i.jsx)(Yj,{height:"5"}),(0,i.jsx)(yI,{ids:d.map(e=>e.id),onReorder:g,children:(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Xl,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textMd medium",children:o.event.accreditationCategory.name})}),(0,i.jsx)(Xl,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",children:d.map(e=>(0,i.jsx)(jH,{accreditation:e},e.id))})]})})]})})},SH=()=>{const{params:{organizationId:e,eventId:n,accreditationCategoryId:t},translate:s}=fc(),[o,a,r]=Dg(""),[d,l]=(0,de.useState)(0),[c,u]=(0,de.useState)({direction:ut.Asc,attribute:Oe.Index}),{data:m,isLoading:g,reload:h}=rs("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:n,accreditationCategoryId:t,name:w(a)?a:void 0,offset:d,sort:c},[],undefined);const{numberOfPages:p,totalCount:I}=Jf(m.event?.accreditations),[f,x]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($g,{filters:(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_une_65646"),value:o,onChange:r})}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"gear",onClick:()=>x(!0)})}),(0,i.jsx)(ux,{placement:"top",children:s("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:Oe.Name,setSort:u,sort:c,children:s("AccreditationName")}),(0,i.jsx)(ax,{attribute:Oe.Index,setSort:u,sort:c,children:s("Index")}),(0,i.jsx)(Mg,{children:s("number_of_slots_92461")}),(0,i.jsx)(Mg,{children:s("type_d_affichag_55093")})]}),numberOfPages:p,offset:d,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):0===m.event.accreditations.totalCount?(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(uA,{color:"primary",icon:"user-group"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):m.event.accreditations.nodes.map(t=>(0,i.jsxs)(Eg,{css:{userSelect:"none"},children:[(0,i.jsx)(_g,{css:{fontWeight:"$medium"},children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION({organizationId:e,eventId:n,accreditationId:t.id}),children:ip(t)})}),(0,i.jsx)(_g,{children:t.index??"-"}),(0,i.jsx)(_g,{children:t.numberOfSlots}),(0,i.jsx)(_g,{children:s(t.accreditationDisplay)})]},t.id)),setOffset:l,title:s("liste_des_accr_02647"),totalCount:I}),f&&(0,hd.createPortal)((0,i.jsx)(Zr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(vH,{onClose:()=>x(!1),onSuccess:h})}),document.body)]})},yH=()=>{const{translate:e,params:{eventId:n,accreditationCategoryId:t}}=fc(),{data:s,loader:o}=rs("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:n,accreditationCategoryId:t},[Ko.AccreditationChartFragment],undefined);const[a,r]=(0,de.useState)(),d=(0,de.useMemo)(()=>s.event?.accreditations?.nodes.find(e=>e.id==a),[a]);return o||(0,i.jsx)(yz,{select:(0,i.jsx)(Xl,{width:.5,children:(0,i.jsxs)(nf,{value:a??-1,onChange:e=>{r(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:ip(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(Xl,{gap:"4",width:1,children:(0,i.jsx)(Zr,{height:380,width:1,children:a&&d?(0,i.jsx)($O,{accreditation:d,slots:d.slots}):(0,i.jsx)(Jw,{title:e("vous_allez_retr_26787")})})})})},CH=()=>(0,i.jsx)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(Xl,{width:1,children:(0,i.jsx)(yH,{})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(SH,{})})]})}),bH=({event:e,reload:n})=>{const{params:{organizationId:t,eventId:s,accreditationCategoryId:o},translate:a}=fc();fm(e.accreditationCategory.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":s,accreditationCategoryId:e?":accreditationCategoryId":o});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(_H,{category:e.accreditationCategory,reload:n}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:mo.ACCREDITATION_CATEGORY_DASHBOARD(r(!1)),children:a("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:mo.ACCREDITATION_CATEGORY_MEMBERS(r(!1)),children:a("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($C,{path:mo.ACCREDITATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(CH,{})}),(0,i.jsx)($C,{path:mo.ACCREDITATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(Dq,{accreditationCategoryId:o})})]})]})},AH=()=>{const{params:{organizationId:e,eventId:n,accreditationCategoryId:t}}=fc(),{data:s,loader:o,reload:a}=rs("query AccreditationsCategory(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n id\n name\n assignedResources\n numberOfAccreditations\n }\n\n volunteersRegistrations(accreditationsCategoriesIds: [$accreditationCategoryId]) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationCategoryId:t},[],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:mo.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(gs,{path:mo.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:n,accreditationCategoryId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(bH,{event:s.event,reload:a})})]})};var EH;let wH=class extends ju{constructor(e){super(e)}createUpdateAccreditationProfileValuesDefault(e,n){return{accreditationProfile:this.accreditationProfileInputDefault(e,n)}}accreditationProfileInputSchema(){return Jl.Ik().shape({accreditationProfileCategoryId:Jl.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")),name:Jl.Yj().required(this.t("le_nom_de_l_acc_82676")),description:Jl.Yj(),acronym:Jl.Yj().nullable(),color:Jl.Yj().required(this.t("la_couleur_est_95740")),icon:Jl.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(pi,this.t("l_ic_ne_est_req_15843")),accreditationsSlotsIds:Jl.YO().of(Jl.ai()).min(1,this.t("vous_devez_s_le_34381"))})}createUpdateAccreditationProfileSchema(){return Jl.Ik().shape({accreditationProfile:this.accreditationProfileInputSchema()})}accreditationProfileInputDefault(e,n){let t=e?.accreditationProfileCategoryId??n;return Number.isInteger(t)||(t=null),{accreditationProfileCategoryId:t,name:e?.name??"",description:e?.description??"",acronym:e?.acronym??"",color:e?.color??Lr.colors.primary500.value,icon:e?.icon??En.BadgeCheck,accreditationsSlotsIds:e?.accreditationsSlotsIds??[]}}};wH=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(EH=void 0!==ts&&ts)?EH:Object])],wH);const $H=e=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>Hp(e.accreditation.slots.filter(n=>e.accreditationsSlotsIds.includes(n.id))),[e.accreditation.slots,e.accreditationsSlotsIds]);return(0,i.jsx)(AA,{accreditation:e.accreditation,displayNumberOfSlots:e.accreditation.hasSlots,displaySlots:e.accreditation.hasSlots,numberOfSlots:s.length,children:(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("date_du_cr_neau_82295")}),(0,i.jsx)(Mg,{children:n("nom_du_cr_neau_54351")})]}),s.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.date?t.toLocaleString(e.date,da.DateOnly.WeekdayShortMonthLong):"-"}),(0,i.jsx)(_g,{children:w(e.name)?e.name:"-"})]},e.id))]})})},TH=e=>{const n=(0,de.useMemo)(()=>rp(e.category.accreditations.filter(n=>n.slots.some(n=>e.accreditationsSlotsIds.includes(n.id)))),[e.accreditationsSlotsIds,e.category.accreditations]);return(0,i.jsx)(bA,{category:e.category.name,children:n.map(n=>(0,i.jsx)($H,{accreditation:n,accreditationsSlotsIds:e.accreditationsSlotsIds},n.id))})},zH=e=>(0,i.jsx)(CA,{css:{padding:"0"},children:e.categories.map(n=>(0,i.jsx)(TH,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:n},n.id))}),OH=e=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>Yp(t,e.accreditationsCategories),[e.accreditationsCategories]),o=(0,de.useMemo)(()=>iA(e.accreditationsCategories.filter(n=>n.accreditations.some(n=>n.slots.some(n=>e.accreditationsSlotsIds.includes(n.id))))),[e.accreditationsCategories,e.accreditationsSlotsIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$6"},width:1,children:f(e.accreditationsSlotsIds)?(0,i.jsx)(zH,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:o}):(0,i.jsxs)(Xl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$9 $7"},direction:"column",width:1,children:[(0,i.jsx)(UI,{color:"white",css:{background:"white",border:"1px solid $gray200",color:"$gray800"},icon:"badge-check",size:"md"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("aucune_accr_dit_40299")})]})}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"accreditationProfile.accreditationsSlotsIds",triggerElem:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",children:n("AddAccreditations")}),children:s})]})},RH=e=>{const{mutate:n}=function(e={}){return ds("mutation AccreditationProfileCategoryCreate(\n $eventId: EventId!\n $accreditationProfileCategory: AccreditationsProfilesCategoryInput!\n) {\n accreditationProfileCategoryCreate(\n eventId: $eventId\n accreditationProfileCategory: $accreditationProfileCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(UA,{initialName:"",isEdit:!1,mutate:async t=>(await n({eventId:e.eventId,accreditationProfileCategory:{name:t}})).accreditationProfileCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},DH=e=>{const{mutate:n}=function(e={}){return ds("mutation AccreditationProfileCategoryUpdate(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n $accreditationProfileCategory: AccreditationsProfilesCategoryInput!\n) {\n accreditationProfileCategoryUpdate(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n accreditationProfileCategory: $accreditationProfileCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(UA,{initialName:e.accreditationProfileCategory.name,isEdit:!0,mutate:async t=>(await n({eventId:e.eventId,accreditationProfileCategoryId:e.accreditationProfileCategory.id,accreditationProfileCategory:{name:t}})).accreditationProfileCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},MH=e=>{const{translate:n,params:{eventId:t}}=fc(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(iA(e.event.accreditationsProfilesCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:n("nom_de_votre_pr_36577"),name:"accreditationProfile.name"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"accreditationProfile.accreditationProfileCategoryId",onCreateClick:()=>o(!0),children:a.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("Acronym")}),name:"accreditationProfile.acronym"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wb,{label:n("Color"),name:"accreditationProfile.color"}),(0,i.jsx)(Zb,{label:n("ic_ne_55554"),name:"accreditationProfile.icon"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:n("description_58935")}),name:"accreditationProfile.description"}),s&&(0,i.jsx)(RH,{eventId:t,onClose:()=>o(!1),onSuccess:n=>{r(iA([...a,n])),e.change("accreditationProfile.accreditationProfileCategoryId",n.id)}})]})},PH=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{showNotification:a}=Sy(),r=ss(wH),d=ss(ec),l=(0,de.useRef)(null),c=(0,de.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditationProfile.name):o("cr_ation_d_un_p_06796"),[e.isEdit,e.initialValues,o]);return fm(c),(0,i.jsx)(Fc,{customErrorRef:l,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:a,submitting:r,values:d})=>(0,i.jsx)(Nx,{button:e.isEdit?(0,i.jsx)(yc,{isLoading:r,onClick:a,children:o("mettre_jour_l_81963")}):null,category:c,color:"dark",fallbackClosePath:iM.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.accreditationProfile.name:o("nouveau_profil_88612"),children:(0,i.jsxs)(kx,{ref:l,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:o("informations_su_10044"),children:(0,i.jsx)(MH,{change:n.change,event:e.event})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:o("accr_ditations_39450"),subtitle:o("s_lectionnez_le_99366"),children:(0,i.jsx)(OH,{accreditationsCategories:e.event.accreditationsCategories,accreditationsSlotsIds:d.accreditationProfile.accreditationsSlotsIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:r,onClick:a,children:(0,i.jsx)(Zr,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_26779"):o("cr_er_le_profil_04447")})})})]})}),validate:d.validateForForm(r.createUpdateAccreditationProfileSchema()),width:1,onSubmit:async i=>{await e.mutate({eventId:s,accreditationProfile:i.accreditationProfile}),a(e.isEdit?o("le_profil_d_acc_43644"):o("le_profil_d_acc_31514")),n.push(iM.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}))}})},kH=()=>{const{eventId:e,accreditationProfileCategoryId:n}=ls(),t=ss(wH),{data:s,loader:o}=rs("query AccreditationProfileEventInfos($eventId: EventId!) {\n event(id: $eventId) {\n ...CreateAccreditationProfileEvent\n }\n}\n",{eventId:e},[Ko.CreateAccreditationProfileEventFragment],undefined);const{mutate:a}=function(e={}){return ds("mutation AccreditationProfileCreate(\n $eventId: EventId!\n $accreditationProfile: AccreditationsProfileInput!\n) {\n accreditationProfileCreate(eventId: $eventId, accreditationProfile: $accreditationProfile) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(PH,{event:s.event,initialValues:t.createUpdateAccreditationProfileValuesDefault(null,n),isEdit:!1,mutate:async e=>(await a(e)).accreditationProfileCreate.id})},FH=()=>{const{eventId:e,accreditationProfileId:n}=ls(),t=ss(wH),{data:s,loader:o}=rs("query AccreditationProfileToEdit(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n ...CreateAccreditationProfileEvent\n\n accreditationProfile(id: $accreditationProfileId) {\n name\n description\n acronym\n color\n icon\n accreditationProfileCategoryId\n accreditationsSlotsIds\n }\n }\n}\n",{eventId:e,accreditationProfileId:n},[Ko.CreateAccreditationProfileEventFragment],undefined);const{mutate:a}=function(e={}){return ds("mutation AccreditationProfileUpdate(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n $accreditationProfile: AccreditationsProfileInput!\n) {\n accreditationProfileUpdate(\n eventId: $eventId\n accreditationProfileId: $accreditationProfileId\n accreditationProfile: $accreditationProfile\n ) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(PH,{event:s.event,initialValues:t.createUpdateAccreditationProfileValuesDefault(s.event.accreditationProfile,null),isEdit:!0,mutate:async e=>(await a({...e,accreditationProfileId:n})).accreditationProfileUpdate.id})};var NH,LH,UH;let VH=class extends vF{static{NH=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...vF.IMPORT_COLUMNS_DEFAULT,AccreditationProfileCategoryName:"accreditationProfileCategoryName",AccreditationProfileName:"accreditationProfileName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===wn.Update?[NH.IMPORT_COLUMNS_DEFAULT.Id]:[],NH.IMPORT_COLUMNS_DEFAULT.AccreditationProfileCategoryName,NH.IMPORT_COLUMNS_DEFAULT.AccreditationProfileName];constructor(e,n){super(e,n),this.csvInputService=e}};VH=NH=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(LH=void 0!==hF&&hF)?LH:Object,"function"==typeof(UH=void 0!==ts&&ts)?UH:Object])],VH);const BH=({accreditations:e})=>{const{params:{organizationId:n,eventId:t},translate:s}=fc(),o=ss(Wg),{mutate:a}=function(e={}){return ds("mutation AccreditationsProfilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $input: MappableImportInput!\n) {\n jobId: accreditationsProfilesImport(\n organizationId: $organizationId\n eventId: $eventId\n input: $input\n )\n}\n",e)}(),{checkAccreditationsProfilesImport:r}=Sy(),d=(0,de.useCallback)((e,n,t)=>r(e,n,t),[r]),l=(0,de.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(n=>({id:n.id,slug:`accreditation_slot_${n.id}`,name:qp(o,n,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(cF,{alertDescriptionKey:"pour_ajouter_un_18028",children:(0,i.jsx)(YF,{ImportInputService:VH,additionalCategories:l,checkImport:d,closePath:iM.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),customFields:p,heading:s("profils_d_accr_27825"),importTagPrefix:"accreditations-profiles",localStorageKeyPrefix:"ACCREDITATIONS_PROFILES_IMPORT",mutate:a,returnLink:(0,i.jsx)(Ug,{to:iM.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),children:s("retour_aux_prof_38933")})})})},WH=()=>{const{params:{eventId:e}}=fc(),{data:n,loader:t}=rs("query AccreditationsProfilesImportInfos($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n }\n}\n",{eventId:e},[Ko.AccreditationImportFragment],undefined);return t||(0,i.jsx)(BH,{accreditations:n.event.accreditations.nodes})};var GH,qH,HH,YH;function ZH(e){return{includeAccreditations:e.includes(YH.Accreditations),includeCreatedBy:e.includes(YH.CreatedBy),includeDescription:e.includes(YH.Description)}}!function(e){e.Accreditation="accreditation",e.Accreditations="accreditations",e.AccreditationProfile="accreditation_profile",e.AccreditationSlot="accreditationSlotId",e.Acronym="acronym",e.Category="category",e.Color="color",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Name="name"}(YH||(YH={}));let KH=class extends Eh{constructor(e,n,t){super(e,n,t)}getAccreditationsProfilesFilters(e){const n=this.t("profils_d_accr_27825");return[{slug:YH.Name,name:this.t("nom_08311"),category:n,fieldType:Sn.Text,hideEmpty:!0},{slug:YH.AccreditationProfile,name:this.t("profil_d_accr_d_02274"),category:n,fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},...f(e.accreditationsProfilesCategories)?[{slug:YH.Category,name:this.t("cat_gorie_00291"),category:n,fieldType:Sn.Select,values:(0,Tg.A)(e.accreditationsProfilesCategories,e=>b(e.name)),hideEmpty:!0}]:[],{slug:YH.Description,name:this.t("Description"),category:n,fieldType:Sn.Text},{slug:YH.Accreditation,name:this.t("Accreditation"),category:n,fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:YH.AccreditationSlot,name:this.t("cr_neaux_accr_d_70934"),category:n,fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:YH.Acronym,name:this.t("Acronym"),category:n,fieldType:Sn.Text},{slug:YH.Color,name:this.t("Color"),category:n,fieldType:Sn.Text,hideEmpty:!0},{slug:YH.Icon,name:this.t("ic_ne_55554"),category:n,fieldType:Sn.Select,values:pi.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:YH.CreatedBy,name:this.t("cr_e_par_30622"),category:n,fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:YH.CreatedAt,name:this.t("cr_e_le_02658"),category:n,fieldType:Sn.Datetime,hideEmpty:!0}]}getAccreditationsProfilesPossibleColumns(){return[{slug:YH.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:Te.Id},{slug:YH.Name,name:this.t("nom_08311"),isSearchable:!0,isSortable:!0,sortAttribute:Te.Name,minWidth:240},{slug:YH.Description,name:this.t("Description"),minWidth:320},{slug:YH.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:Te.Category,minWidth:200},{slug:YH.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:YH.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:160},{slug:LW.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:LW.Icon,name:this.t("ic_ne_55554"),width:80},{slug:LW.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:YH.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:YH.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Te.CreatedAt,minWidth:180}]}};KH=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(GH=void 0!==dh&&dh)?GH:Object,"function"==typeof(qH=void 0!==Wg&&Wg)?qH:Object,"function"==typeof(HH=void 0!==ts&&ts)?HH:Object])],KH);const XH=e=>{const{translate:n,params:{eventId:t}}=fc(),{showNotification:s}=Sy(),{mutate:o}=Ed();return(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_04327"),text:n("suppression_de_73669",e.accreditationProfile.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:t,selecteds:{ids:[e.accreditationProfile.id]}}),s(n("le_profil_d_acc_21890",e.accreditationProfile.name)),e.onSuccess()}})},QH=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{mutate:a}=wd(),[r,d]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",to:iM.ACCREDITATIONS_PROFILE_EDIT({organizationId:s,eventId:o,accreditationProfileId:e.accreditationProfile.id}),children:t("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{accreditationProfileDuplicate:{id:t}}=await a({eventId:o,accreditationProfileId:e.accreditationProfile.id});n.push(iM.ACCREDITATIONS_PROFILE_EDIT({organizationId:s,eventId:o,accreditationProfileId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{d(!0),vm(e.target)},children:t("supprimer_43083")})})]}),r&&(0,i.jsx)(XH,{accreditationProfile:e.accreditationProfile,onClose:()=>d(!1),onSuccess:e.reload})]})},JH=e=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>e.accreditationProfile.accreditationsSlots??[],[e.accreditationProfile]),o=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(s.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[s]),a=(0,de.useMemo)(()=>rp((0,wh.A)(s.map(e=>e.accreditation),e=>e.id)),[s]);return(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:n("accreditations",e.accreditationProfile.name)}),(0,i.jsx)(xI,{css:{padding:"0"},children:(0,i.jsx)(CA,{children:f(o)?o.map(e=>(0,i.jsx)(bA,{category:e.name,children:a.filter(n=>n.accreditationCategoryId===e.id).map(e=>{const o=(a=e.id,(0,Tg.A)(s.filter(e=>e.accreditationId===a),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]));var a;return(0,i.jsx)(AA,{accreditation:e,displayNumberOfSlots:!0,displaySlots:e.hasSlots,numberOfSlots:o.length,children:(0,i.jsxs)(gg,{hideBorder:!0,children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("cr_neau_11117")})}),o.map(n=>{const s=qp(t,n,e.name);return(0,i.jsx)(Eg,{children:(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:s,width:1,children:s})})},n.id)})]})},e.id)})},e.id)):(0,i.jsx)(ww,{title:n("no_accreditations")})})})]})},eY=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),{data:o,loader:a}=gr({eventId:t,loadIsBlocked:!1}),[r,d]=(0,de.useState)(!1),[l,c]=(0,de.useState)(Dn.Add),[u,m]=(0,de.useState)([]),g=(0,de.useMemo)(()=>o.event?Yp(s,o.event.accreditationsCategories):null,[s,o.event]),h=f(u);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"badge-check",children:n("accr_ditations_39450")}),(0,i.jsxs)(Gf,{gap:"6",children:[(0,i.jsxs)(nf,{label:n("que_souhaitez_v_87607"),value:l,onChange:c,children:[(0,i.jsx)("option",{value:Dn.Add,children:n("ajouter_des_acc_17744")}),(0,i.jsx)("option",{value:Dn.Replace,children:n("remplacer_les_a_92733")}),(0,i.jsx)("option",{value:Dn.Delete,children:n("supprimer_des_a_04246")})]}),a||(0,i.jsx)(lg,{isSearchVisible:!0,label:n("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:u,onChange:m,children:g})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:!h,isLoading:r,onClick:async()=>{d(!0),await e.onSuccess(l,u),e.onClose(),d(!1)},children:n("_diter_62574")})})]})})},nY=()=>{const{translate:e,params:{eventId:n}}=fc(),{massActions:t,predicates:s}=ah(),{onMassEditSuccess:o,segment:a}=DN(),{showNotification:r}=Sy(),{mutate:d}=Na(),{mutate:l}=za(),{mutate:c}=Ed(),[u,m]=(0,de.useState)(!1),[g,h]=(0,de.useState)(!1),[p,I]=(0,de.useState)(!1),f=t.getSelectedsInput(s,null),x=t.isAllSelected?a.count:t.numberOfSelected,_=(0,de.useCallback)(e=>{w(e)&&r(e),o()},[r,o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>m(!0),children:e("_diter_une_prop_26724")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"badge-check",onClick:()=>h(!0),children:e("_diter_les_accr_86042")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>I(!0),children:e("supprimer_43083")})})]})]}),u&&(0,i.jsx)(w$,{eventId:n,mutate:e=>d({eventId:n,massEdit:e}),selecteds:f,onClose:()=>m(!1),onSuccess:n=>_(e("_1_profils_d_a_11729",n))}),g&&(0,i.jsx)(eY,{onClose:()=>h(!1),onSuccess:async(t,i)=>{const{numberOfAccreditationsProfiles:s}=await l({eventId:n,massAccreditations:{accreditationsSlotsIds:i,strategy:t,selecteds:f}});_(e("_1_profils_d_a_11729",s))}}),p&&(0,i.jsx)(f$,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_06203")],text:e("suppression_de_76750",x),onClose:()=>I(!1),onDelete:async()=>{const t=(await c({eventId:n,selecteds:f})).numberOfAccreditationsProfiles;_(e("_1_profils_d_a_94525",t))}})]})},tY=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),{mutate:o}=za(),{isEditMode:a}=ah(),[r,d]=(0,de.useState)(!0),[l,c]=(0,de.useState)(null),u=(0,de.useMemo)(()=>e.accreditationProfile.accreditationsSlots??[],[e.accreditationProfile]),m=(0,de.useMemo)(()=>op(u),[u]),g=(0,de.useMemo)(()=>u.map(e=>e.id),[u]),h=(0,de.useCallback)(async e=>{if(e&&r){const{event:e}=await hr({eventId:t,loadIsBlocked:!1},{token:await fe()});c(Yp(s,e.accreditationsCategories)),d(!1)}},[s,t,r]),p=(0,de.useCallback)(async n=>{await o({eventId:t,massAccreditations:{accreditationsSlotsIds:n,selecteds:{ids:[e.accreditationProfile.id]},strategy:Dn.Replace}}),e.reload()},[t,e.accreditationProfile.id,e.reload,o]);return a&&e.updatable?(0,i.jsx)(hE,{column:e.column,css:{gap:"$2"},initialValue:g,renderInput:(e,t)=>r?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:l}),renderValue:()=>(0,i.jsx)(AE,{badges:m,doNotSort:!0}),onSave:p,onStateChange:h}):(0,i.jsx)(_g,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:m,doNotSort:!0,onClick:e.onClick})})},iY=e=>{const{params:{eventId:n}}=fc(),{mutate:t}=Na(),s=(0,de.useCallback)(async i=>{const s=I(e.property);for(const o of s){const a=1===s.length?i:i[o];await t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditationProfileId]},slug:o,strategy:Dn.Replace,value:a}})}return!0},[e.accreditationProfileId,e.property,t]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},sY=e=>{const{translate:n}=fc();return(0,i.jsx)(iY,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.acronym||"",property:$e.Acronym,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("Acronym"),value:e,onChange:t}),renderValue:e.accreditationProfile.acronym||""})},oY=e=>{const{translate:n,params:{eventId:t}}=fc(),{data:s,loader:o}=rs("query AccreditationsProfilesCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfilesCategories {\n id\n name\n }\n }\n}\n",{eventId:t},[],undefined);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("Category")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(nf,{label:n("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:(s.event.accreditationsProfilesCategories??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},aY=e=>{const{organizationId:n,eventId:t}=ls(),{isEditMode:s}=ah(),o=e.accreditationProfileCategory.name;return(0,i.jsx)(iY,{accreditationProfileId:e.accreditationProfileId,column:e.column,initialValue:e.accreditationProfileCategory.id,property:$e.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(oY,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(Ug,{to:iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:n,eventId:t,accreditationProfileCategoryId:e.accreditationProfileCategory.id}),children:o})})})},rY=e=>{const{translate:n}=fc();return(0,i.jsx)(iY,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.color,property:$e.Color,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Bb,{label:n("Color"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Xl,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{css:{background:e.accreditationProfile.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{oy(e.accreditationProfile.color)}})}),(0,i.jsx)(ux,{placement:"top",children:e.accreditationProfile.color})]})})})},dY=e=>{const{params:{eventId:n}}=fc(),{mutate:t}=Na(),s=(0,de.useCallback)(i=>t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.accreditationProfile.id]},slug:$e.Description,strategy:Dn.Replace,value:i}}),[n,e.accreditationProfile.id,t]);return(0,i.jsx)(TU,{column:e.column,mutate:s,reload:e.reload,text:e.accreditationProfile.description,updatable:e.updatable})},lY=e=>{const{translate:n}=fc();return(0,i.jsx)(iY,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.icon,property:$e.Icon,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Yb,{label:n("Icon"),renderOnPortal:!0,value:e,onChange:t}),renderValue:()=>(0,i.jsx)(pc,{icon:hc(e.accreditationProfile.icon)})})},cY=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>({[$e.Color]:e.accreditationProfile.color,[$e.Icon]:e.accreditationProfile.icon}),[e.accreditationProfile]);return(0,i.jsx)(iY,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:t,property:[$e.Color,$e.Icon],reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Bb,{label:n("Color"),value:e[$e.Color],onChange:n=>{t({...e,[$e.Color]:n})}}),(0,i.jsx)(Yb,{label:n("Icon"),renderOnPortal:!0,value:e[$e.Icon],onChange:n=>{t({...e,[$e.Icon]:n})}})]}),renderValue:()=>(0,i.jsx)(UI,{color:e.accreditationProfile.color,icon:e.accreditationProfile.icon})})},uY=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{isEditMode:o}=ah(),a=e.accreditationProfile.name;return(0,i.jsx)(iY,{accreditationProfileId:e.accreditationProfile.id,column:e.column,initialValue:e.accreditationProfile.name,property:$e.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_08311"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(Ug,{to:iM.ACCREDITATIONS_PROFILE({organizationId:t,eventId:s,accreditationProfileId:e.accreditationProfile.id}),children:(0,i.jsx)(Zr,{css:{clamp:2},title:a,children:a})})})})},mY=e=>e.column.slug===YH.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===YH.Name?(0,i.jsx)(uY,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===YH.Description?(0,i.jsx)(dY,{accreditationProfile:e.row,column:e.column,reload:e.reload,updatable:e.canAccreditationEdit}):e.column.slug===YH.Category?(0,i.jsx)(aY,{accreditationProfileCategory:e.row.accreditationProfileCategory,accreditationProfileId:e.row.id,column:e.column,reload:e.reload}):e.column.slug===YH.Accreditations?(0,i.jsx)(tY,{accreditationProfile:e.row,column:e.column,reload:e.reload,updatable:e.canAccreditationEdit,onClick:e.onAccreditationsClick}):e.column.slug===YH.Acronym?(0,i.jsx)(sY,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===YH.Color?(0,i.jsx)(rY,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===YH.Icon?(0,i.jsx)(lY,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===YH.IconColor?(0,i.jsx)(cY,{accreditationProfile:e.row,column:e.column,reload:e.reload}):e.column.slug===YH.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===YH.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):null,gY=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc(),[o,a]=(0,de.useState)(!1),[r,d]=(0,de.useState)(!1),[l,c]=(0,de.useState)(!1),{columns:u}=ah(),{segment:m}=DN(),{checkExport:g}=Sy(),{mutate:h}=function(e={}){return ds("mutation AccreditationsProfilesExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: accreditationsProfilesExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}();return(0,i.jsxs)(gL,{children:[(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"file-import",to:iM.ACCREDITATIONS_PROFILES_IMPORT({organizationId:t,eventId:s}),onClick:e=>vm(e.target),children:n("importer_via_un_61623")}),path:iM.ACCREDITATIONS_PROFILE_CREATE({organizationId:t,eventId:s}),children:n("cr_er_un_profil_01464")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{isOpen:o,onStateChange:a,children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"plus",onClick:()=>{a(!1),d(!0)},children:n("cr_er_une_cat_g_20051")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"file-xls",onClick:()=>{a(!1),c(!0)},children:n("exporter_en_exc_51862")})})]})]})}),(0,i.jsx)(nV,{isOpen:l,requestExport:async e=>{const{jobId:n}=await h({organizationId:t,eventId:s,segmentId:m.id,format:e,columns:u});g(n,t,s)},showIncludeFiles:!1,onClose:()=>{c(!1)}}),r&&(0,i.jsx)(RH,{eventId:s,onClose:()=>{d(!1)},onSuccess:n=>{e.push(iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:t,eventId:s,accreditationProfileCategoryId:n.id}))}})]})},hY=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{canAccreditationEdit:r,canSegmentEdit:d}=tC(),{limit:l}=ah(),{segment:c}=DN(),u=(0,de.useCallback)(e=>iM.ACCREDITATIONS_PROFILES_SEGMENT_PROFILE_PANEL_ACCREDITATIONS({organizationId:s,eventId:o,segmentId:a,accreditationProfileId:e}),[s,o,a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gY,{}),0===e.numberOfAccreditationsProfiles?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Jw,{subtitle:"",title:t("vous_n_avez_pas_24880")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(nY,{}),searchPlaceholder:t("rechercher_un_p_31010"),showActions:r,showEditColumns:d,showEditMode:r,showSearchColumns:d}),selectSegment:(0,i.jsx)(cI,{allSelectedText:t("les_1_profils_67546",c.count,c.name),pageSelectedText:t("les_1_profils_27968",l),selectAllText:t("s_lectionner_le_71777",c.count,c.name)})}),(0,i.jsx)(px,{getEditPath:e=>iM.ACCREDITATIONS_PROFILE_EDIT({organizationId:s,eventId:o,accreditationProfileId:e.id}),renderCell:(e,t,s)=>(0,i.jsx)(mY,{canAccreditationEdit:r,column:e,reload:s,row:t,onAccreditationsClick:()=>{n.push(u(t.id))}}),renderRowDropdown:(e,n)=>(0,i.jsx)(QH,{accreditationProfile:e,reload:n}),renderRowPanels:e=>(0,i.jsx)(Xr.qh,{path:u(e.id),children:(0,i.jsx)(JH,{accreditationProfile:e,onClose:()=>{n.goBack(iM.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:s,eventId:o,segmentId:a}))}})})})]})]})},pY=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=Ly(),{canAccreditationEdit:c}=tC(),u=ss(KH),m=(0,de.useMemo)(()=>u.getAccreditationsProfilesFilters(e.event),[u,e.event]),g=(0,de.useMemo)(()=>u.getAccreditationsProfilesPossibleColumns(),[u]);return(0,i.jsx)(JN,{canSegmentEdit:r(nC.SEGMENT_EDIT),columnsToIncludes:ZH,eventId:o,filters:m,filtersButtonText:t("filtrer_les_pro_86372"),filtersSubtitle:t("appliquer_des_f_18351"),getSegmentPath:e=>iM.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:s,eventId:o,segmentId:e}),hideSegments:0===e.event.numberOfAccreditationsProfiles,initialLimit:d?.accreditationsProfilesLimit??jg,initialSegmentsOpen:d?.areAccreditationsProfilesSegmentsOpen??!0,loadDataList:$d,loadRow:Td,organizationId:s,possibleColumns:g,possibleRenderings:[],reload:e.reload,segmentId:a,segmentType:lt.AccreditationsProfiles,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({accreditationsProfilesLimit:e})},showMassActions:c,showRowDropdown:c,showRowEdit:c,onSegmentClick:e=>{l({accreditationsProfilesSegmentId:e})},onSegmentDelete:async()=>{await l({accreditationsProfilesSegmentId:null}),n.replace(iM.ACCREDITATIONS_PROFILES({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({areAccreditationsProfilesSegmentsOpen:e})},children:(0,i.jsx)(hY,{numberOfAccreditationsProfiles:e.event.numberOfAccreditationsProfiles})})},IY=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s},localEvent:o}=Ly();fm(`${s} ${t("profils_d_accr_27825")}`);const{data:a,loader:r,reload:d}=rs("query AccreditationsProfilesSegments($eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n numberOfAccreditationsProfiles\n\n accreditationsProfilesCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: AccreditationsProfiles) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:n},[Ko.SegmentsFoldersSegmentsFragment],undefined);const l=(0,de.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:iM.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(pY,{event:a.event,reload:d})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:iM.ACCREDITATIONS_PROFILES_SEGMENT({organizationId:e,eventId:n,segmentId:o?.accreditationsProfilesSegmentId&&l.includes(o.accreditationsProfilesSegmentId)?o.accreditationsProfilesSegmentId:l[0]}),replace:!0})})]})},fY=()=>{const{hasFeature:e}=Yy();return e(In.Accreditation)?(0,i.jsx)(IY,{}):(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Pv,{icon:"badge-check"})})},xY=e=>{const{params:{organizationId:n,eventId:t,accreditationProfileId:s},translate:o}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:iM.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),children:o("profils_d_accr_27825")}),(0,i.jsx)(gO,{to:iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:n,eventId:t,accreditationProfileCategoryId:e.accreditationProfile.accreditationProfileCategory.id}),children:e.accreditationProfile.accreditationProfileCategory.name}),(0,i.jsx)(gO,{isCurrent:!0,to:iM.ACCREDITATIONS_PROFILE({organizationId:n,eventId:t,accreditationProfileId:s}),children:e.accreditationProfile.name})]})},_Y=({accreditationProfile:e})=>{const{history:n,params:{organizationId:t,eventId:s,accreditationProfileId:o},translate:a}=fc(),{mutate:r}=wd(),[d,l]=(0,de.useState)(!1);return(0,i.jsx)(CC,{acronym:e.acronym,breadcrumbs:(0,i.jsx)(xY,{accreditationProfile:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(yc,{to:iM.ACCREDITATIONS_PROFILE_EDIT({organizationId:t,eventId:s,accreditationProfileId:o}),children:a("_diter_62574")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{accreditationProfileDuplicate:{id:e}}=await r({eventId:s,accreditationProfileId:o});n.push(iM.ACCREDITATIONS_PROFILE_EDIT({organizationId:t,eventId:s,accreditationProfileId:e}))},children:a("dupliquer_28256")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),l(!0)},children:a("supprimer_43083")})})]})]})}),d&&(0,i.jsx)(XH,{accreditationProfile:e,onClose:()=>l(!1),onSuccess:()=>n.replace(iM.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}))})]}),color:e.color,icon:e.icon,name:e.name,subtext:a("accreditation",e.accreditationsSlots.length)})},jY=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc(),o=ss(Wg),a=(0,de.useMemo)(()=>(0,Tg.A)(e.accreditationsSlots,[e=>e.accreditation.name,e=>e.date?.toMillis()??0]),[e.accreditationsSlots]);return(0,i.jsx)($g,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:s("AccreditationName")}),(0,i.jsx)(Mg,{children:s("nom_du_cr_neau_54351")}),(0,i.jsx)(Mg,{children:s("cat_gorie_00291")})]}),rows:0===a.length?(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(uA,{color:"primary",icon:"badge-check"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):a.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{css:{fontWeight:"$medium"},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsx)(Ug,{to:mo.ACCREDITATION({organizationId:n,eventId:t,accreditationId:e.accreditation.id}),children:e.accreditation.name})]})}),(0,i.jsx)(_g,{children:w(e.name)||e.date?qp(o,e,e.accreditation.name,{date:{localeFormat:da.DateOnly.WeekdayLongMonthLong}}):"-"}),(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.accreditation.accreditationCategoryId}),children:e.accreditation.accreditationCategoryName})})]},e.id)),title:s("accr_ditations_39450"),totalCount:a.length})},vY=e=>{const{params:{organizationId:n,eventId:t,accreditationProfileId:s},translate:o}=fc();fm(e.event.accreditationProfile.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,accreditationProfileId:e?":accreditationProfileId":s});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(_Y,{accreditationProfile:e.event.accreditationProfile}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:iM.ACCREDITATIONS_PROFILE_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:iM.ACCREDITATIONS_PROFILE_MEMBERS(a(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($C,{path:iM.ACCREDITATIONS_PROFILE_DASHBOARD(a(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(jY,{accreditationsSlots:e.event.accreditationProfile.accreditationsSlots})})}),(0,i.jsx)($C,{path:iM.ACCREDITATIONS_PROFILE_MEMBERS(a(!0)),children:(0,i.jsx)(Dq,{accreditationProfileId:s})})]})]})},SY=()=>{const{params:{organizationId:e,eventId:n,accreditationProfileId:t}}=fc(),{data:s,loader:o}=rs("query AccreditationsProfile(\n $eventId: EventId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n accreditationProfile(id: $accreditationProfileId) {\n id\n name\n acronym\n color\n icon\n\n accreditationProfileCategory {\n id\n name\n }\n\n accreditationsSlots {\n id\n name\n date\n\n accreditation {\n id\n name\n acronym\n color\n icon\n accreditationCategoryId\n accreditationCategoryName\n }\n }\n }\n\n volunteersRegistrations(accreditationsProfilesIds: [$accreditationProfileId]) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationProfileId:t},[],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:iM.ACCREDITATIONS_PROFILE({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(gs,{path:iM.ACCREDITATIONS_PROFILE_DASHBOARD({organizationId:e,eventId:n,accreditationProfileId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(vY,{event:s.event})})]})},yY=e=>{const n=os(),{mutate:t}=function(e={}){return ds("mutation AccreditationProfileCategoryDelete(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n accreditationProfileCategoryDelete(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_01527")],text:n("suppression_de_73669",e.accreditationProfileCategory.name),onClose:e.onClose,onDelete:async()=>{await t({eventId:e.eventId,accreditationProfileCategoryId:e.accreditationProfileCategory.id}),e.onSuccess()}})},CY=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:iM.ACCREDITATIONS_PROFILES({organizationId:n,eventId:t}),children:s("profils_d_accr_27825")}),(0,i.jsx)(gO,{isCurrent:!0,to:iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:n,eventId:t,accreditationProfileCategoryId:e.category.id}),children:e.category.name})]})},bY=({category:e,reload:n})=>{const{history:t,params:{organizationId:s,eventId:o},translate:a}=fc(),{mutate:r}=function(e={}){return ds("mutation AccreditationProfileCategoryDuplicate(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n accreditationProfileCategoryDuplicate(\n eventId: $eventId\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n ) {\n id\n }\n}\n",e)}(),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(!1);return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsx)(CY,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(yc,{color:"white",onClick:()=>u(!0),children:a("_diter_62574")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{t.push(iM.ACCREDITATIONS_PROFILE_CREATE({organizationId:s,eventId:o,accreditationProfileCategoryId:e.id}))},children:a("cr_er_un_profil_01464")})}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"copy",onClick:async()=>{const{accreditationProfileCategoryDuplicate:{id:n}}=await r({eventId:o,accreditationProfileCategoryId:e.id});t.push(iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:s,eventId:o,accreditationProfileCategoryId:n}))},children:a("dupliquer_28256")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:a("supprimer_43083")})})]})]})}),c&&(0,i.jsx)(DH,{accreditationProfileCategory:e,eventId:o,onClose:()=>{u(!1)},onSuccess:n}),d&&(0,i.jsx)(yY,{accreditationProfileCategory:e,eventId:o,onClose:()=>{l(!1)},onSuccess:()=>{t.replace(iM.ACCREDITATIONS_PROFILES({organizationId:s,eventId:o}))}})]}),name:e.name,subtext:a("_1_profil_d_ac_37871",e.numberOfAccreditationsProfiles)})},AY=()=>{const{params:{organizationId:e,eventId:n,accreditationProfileCategoryId:t},translate:s}=fc(),[o,a,r]=Dg(""),[d,l]=(0,de.useState)(0),[c,u]=(0,de.useState)({direction:ut.Asc,attribute:Te.Name}),{data:m,isLoading:g}=rs("query AccreditationsProfilesCategoryProfiles(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId\n $name: String\n $offset: Int\n $sort: AccreditationsProfilesSort\n) {\n event(id: $eventId) {\n accreditationsProfiles(\n accreditationProfileCategoryId: $accreditationProfileCategoryId\n name: $name\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n acronym\n color\n icon\n\n accreditationsSlots {\n id\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,accreditationProfileCategoryId:t,name:w(a)?a:void 0,offset:d,sort:c},[],undefined);const{numberOfPages:h,totalCount:p}=Jf(m.event?.accreditationsProfiles);return(0,i.jsx)($g,{filters:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_un_p_37681"),value:o,onChange:r})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:Te.Name,setSort:u,sort:c,children:s("nom_08311")}),(0,i.jsx)(Mg,{children:s("Acronym")}),(0,i.jsx)(Mg,{children:s("number_of_slots_92461")})]}),numberOfPages:h,offset:d,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):0===m.event.accreditationsProfiles.totalCount?(0,i.jsxs)(Xl,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(uA,{color:"primary",icon:"badge-check"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:s("aucun_profil_d_17112")})]}):m.event.accreditationsProfiles.nodes.map(t=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{css:{fontWeight:"$medium"},children:(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(UI,{color:t.color,icon:t.icon,size:"sm"}),(0,i.jsx)(Ug,{to:iM.ACCREDITATIONS_PROFILE({organizationId:e,eventId:n,accreditationProfileId:t.id}),children:t.name})]})}),(0,i.jsx)(_g,{children:t.acronym||"-"}),(0,i.jsx)(_g,{children:t.accreditationsSlots.length})]},t.id)),setOffset:l,title:s("liste_des_profi_29615"),totalCount:p})},EY=({event:e,reload:n})=>{const{params:{organizationId:t,eventId:s,accreditationProfileCategoryId:o},translate:a}=fc();fm(e.accreditationProfileCategory.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":s,accreditationProfileCategoryId:e?":accreditationProfileCategoryId":o});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(bY,{category:e.accreditationProfileCategory,reload:n}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:iM.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD(r(!1)),children:a("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:iM.ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS(r(!1)),children:a("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($C,{path:iM.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(yC,{children:(0,i.jsx)(AY,{})})}),(0,i.jsx)($C,{path:iM.ACCREDITATIONS_PROFILE_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(Dq,{accreditationProfileCategoryId:o})})]})]})},wY=()=>{const{params:{organizationId:e,eventId:n,accreditationProfileCategoryId:t}}=fc(),{data:s,loader:o,reload:a}=rs("query AccreditationsProfilesCategory(\n $eventId: EventId!\n $accreditationProfileCategoryId: AccreditationsProfilesCategoryId!\n) {\n event(id: $eventId) {\n accreditationProfileCategory(id: $accreditationProfileCategoryId) {\n id\n name\n numberOfAccreditationsProfiles\n }\n\n volunteersRegistrations(\n accreditationsProfilesCategoriesIds: [$accreditationProfileCategoryId]\n ) {\n totalCount\n }\n }\n}\n",{eventId:n,accreditationProfileCategoryId:t},[],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),children:(0,i.jsx)(gs,{path:iM.ACCREDITATIONS_PROFILE_CATEGORY_DASHBOARD({organizationId:e,eventId:n,accreditationProfileCategoryId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(EY,{event:s.event,reload:a})})]})},$Y=e=>(0,i.jsx)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{gap:"6",width:1,children:[(0,i.jsx)(ZG,{assignedResources:e.accreditationSlot.assignedResources,maxResources:e.accreditationSlot.maxResources}),(0,i.jsx)(GG,{accreditationCategoryId:e.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.accreditationSlot.accreditation.name,color:e.accreditationSlot.accreditation.color,customFields:e.customFields,fields:e.accreditationSlot.accreditation.fields,icon:e.accreditationSlot.accreditation.icon,numberOfDaysLimit:e.accreditationSlot.accreditation.numberOfDaysLimit,weezeventChecklistId:e.accreditationSlot.weezeventChecklistId,weezeventOrganizationId:e.weezeventOrganizationId})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(YG,{customFields:e.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(nO,{tags:e.accreditationSlot.accreditation.tags}),(0,i.jsx)(Kz,{privateNote:e.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mz,{description:e.accreditationSlot.accreditation.description}),(0,i.jsx)(KG,{location:e.accreditationSlot.accreditation})]})]})]})}),TY=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s,accreditationSlotId:o},translate:a}=fc(),r=ss(Wg),d=(0,de.useMemo)(()=>qp(r,e.slot,e.slot.accreditation.name,{date:{localeFormat:da.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:mo.ACCREDITATIONS({organizationId:n,eventId:t}),children:a("accr_ditations_39450")}),(0,i.jsx)(gO,{to:mo.ACCREDITATION_CATEGORY({organizationId:n,eventId:t,accreditationCategoryId:e.slot.accreditation.accreditationCategoryId}),children:e.slot.accreditation.accreditationCategoryName}),(0,i.jsx)(gO,{to:mo.ACCREDITATION({organizationId:n,eventId:t,accreditationId:s}),children:e.slot.accreditation.name}),(0,i.jsx)(gO,{isCurrent:!0,to:mo.ACCREDITATION_SLOT({organizationId:n,eventId:t,accreditationId:s,accreditationSlotId:o}),children:d})]})},zY=e=>{const{history:n,params:{organizationId:t,eventId:s,accreditationId:o},translate:a}=fc(),{user:r}=ps(),d=VG(),{mutate:l}=Ad(),[c,u]=(0,de.useState)(!1),m=ss(Wg),g=(0,de.useMemo)(()=>qp(m,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:da.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsx)(CC,{acronym:e.slot.accreditation.acronym,breadcrumbs:(0,i.jsx)(TY,{slot:e.slot}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{to:Wo.EDIT_ACCREDITATION(t,s,o),children:a("_diter_62574")}),(0,i.jsx)(lC,{permissions:nC.ACCREDITATION_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",onClick:()=>d(DG,{accreditationsSlotsIds:[e.slot.id]}),children:a("exporter_les_me_63676")}),Sp(t)&&(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",target:"_blank",to:Ex(e.slot.links.asoPaxManifestLink,"pdf",{lang:r?.language}),children:"PAX Manifest"})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:e=>{vm(e.target),u(!0)},children:a("supprimer_43083")})})]})]})}),c&&(0,i.jsx)(f$,{buttonText:a("supprimer_43083"),subtext:[a("_tes_vous_s_r_d_48876")],text:a("suppression_de_73669",g),onClose:()=>u(!1),onDelete:async()=>{await l({eventId:s,accreditationSlotId:e.slot.id}),n.replace(mo.ACCREDITATION({organizationId:t,eventId:s,accreditationId:o}))}})]}),color:e.slot.accreditation.color,icon:e.slot.accreditation.icon,name:g})},OY=e=>{const{params:{organizationId:n,eventId:t,accreditationId:s,accreditationSlotId:o},translate:a}=fc();fm(qp(ss(Wg),e.event.accreditationSlot,e.event.accreditationSlot.name));const r=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,accreditationId:e?":accreditationId":s,accreditationSlotId:e?":accreditationSlotId":o});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(zY,{slot:e.event.accreditationSlot}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:mo.ACCREDITATION_SLOT_DASHBOARD(r(!1)),children:a("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:mo.ACCREDITATION_SLOT_MEMBERS(r(!1)),children:a("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)($C,{path:mo.ACCREDITATION_SLOT_DASHBOARD(r(!0)),children:(0,i.jsx)($Y,{accreditationSlot:e.event.accreditationSlot,customFields:e.organization.customFields.nodes,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)($C,{path:mo.ACCREDITATION_SLOT_MEMBERS(r(!0)),children:(0,i.jsx)(Dq,{accreditationSlotId:o})})]})]})},RY=()=>{const{params:{organizationId:e,eventId:n,accreditationId:t,accreditationSlotId:s}}=fc(),{data:o,loader:a}=rs("query AccreditationsSlot(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, 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 weezeventChecklistId\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 numberOfDaysLimit\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 links {\n asoPaxManifestLink\n }\n }\n\n volunteersRegistrations(accreditationsSlotsIds: [$accreditationSlotId]) {\n totalCount\n }\n }\n}\n",{organizationId:e,eventId:n,accreditationSlotId:s},[Ko.CustomFieldWithConditionFragment],undefined);return a||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:mo.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(gs,{path:mo.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:n,accreditationId:t,accreditationSlotId:s}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(OY,{event:o.event,organization:o.organization})})]})},DY=(0,de.createContext)({}),MY=e=>{const n=us(),[t,s]=(0,de.useState)(e.positionsIds),[o,a]=(0,de.useState)(e.positionsCategoriesIds),[r,d]=(0,de.useState)(e.positionsSlotsIds);return(0,i.jsx)(DY.Provider,{value:{isEdit:e.isEdit,isPreAssign:n.pathname.includes("pre-assignment"),positionsIds:t,positionsCategoriesIds:o,positionsSlotsIds:r,showNextVolunteer:e.showNextVolunteer,setPositionsIds:s,setPositionsCategoriesIds:a,setPositionsSlotsIds:d,teams:e.teams},children:e.children})};function PY(){return(0,de.useContext)(DY)}const kY=e=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc(),{isPreAssign:a,positionsIds:r,positionsCategoriesIds:d,positionsSlotsIds:l,showNextVolunteer:c}=PY(),{mutate:u,isLoading:m}=vr(),{mutate:g,isLoading:h}=Fl(),{mutate:p,isLoading:I}=function(e={}){return ds("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:_}=yr(),j=(0,de.useCallback)(()=>{e.isEdit?n.goBack(Wo.ASSIGNMENTS(t,s)):c()},[e.isEdit,c]);return(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{m||h||I||_||(await p({eventId:s,volunteerRegistrationId:e.volunteerRegistrationId}),j())},children:o("refuser_92819")}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(yc,{color:"primary",isLoading:m||h,onClick:async()=>{a?(!f(r)||m||h||I||_||(await g({eventId:s,massPreAssign:{level:Pn.Positions,positionsIds:r,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:Dn.Replace}}),j()),!f(d)||m||h||I||_||(await g({eventId:s,massPreAssign:{level:Pn.Categories,positionsIds:[],positionsCategoriesIds:d,selecteds:{ids:[e.userInfoId]},strategy:Dn.Replace}}),j())):m||h||I||_||(f(l)?await u({eventId:s,massAssign:{positionsSlotsIds:l,selecteds:{ids:[e.userInfoId]},strategy:Dn.Replace}}):await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:yt.WaitingAssignment}}),j())},children:e.isEdit?o("mettre_jour_l_30423"):o(a?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(yc,{color:"white",onClick:j,children:e.isEdit?o("annuler_48254"):o("affecter_plus_t_97778")})]})},FY=e=>{const[n,t]=(0,de.useState)(e.initialIsOpen);return(0,i.jsxs)(Xl,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:e.header}),(0,i.jsx)(yc,{color:"white",leftIcon:n?"chevron-up":"chevron-down",size:"sm",onClick:()=>{t(!n)}})]}),n&&(0,i.jsx)(Xl,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},NY=e=>{const n=os(),t=e.assignedResources/e.neededResources;return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(Xl,{align:"center",css:{padding:"$3 $5"},width:1,children:[e.isRadio?(0,i.jsx)(Jm,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Ou.A}):(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Ou.A}),(0,i.jsx)(ic,{width:"4"}),(0,i.jsx)(UI,{color:e.color,icon:e.icon}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[w(e.category)&&(0,i.jsx)(Zr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(ic,{width:"2"}),(0,i.jsx)(Zr,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(pc,{icon:"user-group"})}),(0,i.jsx)(ic,{width:"2"}),(0,i.jsxs)(Zr,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(ic,{width:"6"}),(0,i.jsx)(Zr,{width:120,children:(0,i.jsx)(VL,{percent:t})}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsxs)(Zr,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*t)),"%"]})]}),(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(Lm,{color:"warning",leftIcon:"triangle-exclamation",children:n("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},LY=e=>{const n=os(),t=ss(Nh),{positionsIds:s,positionsCategoriesIds:o,setPositionsIds:a,setPositionsCategoriesIds:r}=PY(),d=()=>{r(v(o,e.category.id))};return(0,i.jsx)(FY,{css:{background:"white"},header:(0,i.jsxs)(Xl,{align:"center",children:[(0,i.jsx)(Ym,{state:o.includes(e.category.id)?"checked":"unchecked",onClick:d}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:d,children:e.category.name}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsx)(Lm,{color:"warning",size:"md",children:n("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsx)(Zr,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(Xl,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)(NY,{assignedResources:e.assignedResources,color:e.color,icon:e.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:!1,subtitle:e.range?t.toDisplayString(e.range):"-",title:e.name,onClick:()=>{a(v(s,e.id))}},e.id))})})},UY=e=>{const n=os(),t=(0,de.useMemo)(()=>function(e,n,t,i,s,o){const{wishedPositionsSlots:a,possiblePositionsSlots:r,otherPositionsSlots:d}=Yh(e,n,t,i,s,o),l=new Set,c=e=>Object.values(x(e,e=>e.positionCategory.id)).flatMap(e=>{const n=Object.values(x(e,e=>e.position.id)).flatMap(e=>{const n=e[0].position;return l.has(n.id)?[]:(l.add(n.id),n)});return 0===n.length?[]:[{...e[0].positionCategory,positions:n}]});return{wishedPositionsCategories:c(a),possiblePositionsCategories:c(r),otherPositionsCategories:c(d)}}(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)(Zr,{font:"gray900 textMd medium",children:n("cat_gorie_mis_36044",t.wishedPositionsCategories.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cat_gories_ou_m_71206")}),(0,i.jsx)(ic,{height:"3"}),t.wishedPositionsCategories.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(LY,{category:e}),(0,i.jsx)(ic,{height:"3"})]},e.id)),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("autre_cat_gorie_21569",t.possiblePositionsCategories.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cat_gories_ou_m_50063")}),(0,i.jsx)(ic,{height:"3"}),t.possiblePositionsCategories.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(LY,{category:e}),(0,i.jsx)(ic,{height:"3"})]},e.id)),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("autre_cat_gorie_64824",t.otherPositionsCategories.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cat_gories_ou_m_74482")}),(0,i.jsx)(ic,{height:"3"}),t.otherPositionsCategories.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(LY,{category:e}),(0,i.jsx)(ic,{height:"3"})]},e.id))]})},VY=e=>{const{translate:n}=fc(),{isPreAssign:t,teams:s}=PY(),o=(0,de.useMemo)(()=>!t&&f(s)?s.flatMap(n=>n.members.flatMap(n=>n.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[n.userInfo]:[])):[],[t,s,e.positionSlotId]);return f(o)?(0,i.jsxs)(Xl,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(vw,{teamMembers:o}),(0,i.jsx)(Zr,{font:"gray800 textXs regular",children:n("_1_quipier_es_00024",o.length)})]}):null},BY=(e,n)=>{const t={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return w(n.name)?`${n.name} - ${e.toLocaleString(n.range,void 0,t)}`:e.toLocaleString(n.range,void 0,t)},WY=e=>e.position.positionDisplay===Ln.Radio,GY=e=>{const n=os(),t=ss(Nh),{positionsSlotsIds:s,setPositionsSlotsIds:o}=PY(),a=(0,de.useMemo)(()=>e.positionsSlots.filter(n=>e.state===yt.Assigned&&s.includes(n.id)),[e.state]),{wishedPositionsSlots:r,possiblePositionsSlots:d,otherPositionsSlots:l}=(0,de.useMemo)(()=>{const n=Yh(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),t=a.map(e=>e.id);return{wishedPositionsSlots:n.wishedPositionsSlots.filter(e=>!t.includes(e.id)),possiblePositionsSlots:n.possiblePositionsSlots.filter(e=>!t.includes(e.id)),otherPositionsSlots:n.otherPositionsSlots.filter(e=>!t.includes(e.id))}},[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]),c=(0,de.useMemo)(()=>{const e=r.concat(d).concat(l);return s.flatMap(n=>{const t=e.find(e=>e.id===n);return t?[t]:[]})},[r,d,l,s]),u=e=>WY(e)?c.filter(n=>n.position.id!==e.position.id):c,m=n=>{if(WY(n)){const t=e.positionsSlots.filter(e=>e.position.id===n.position.id).map(e=>e.id);o([...s.filter(e=>!t.includes(e)),...s.includes(n.id)?[]:[n.id]])}else o(v(s,n.id))};return(0,i.jsxs)(i.Fragment,{children:[e.state===yt.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("cr_neau_affect_50400",a.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(ic,{height:"3"}),a.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(NY,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:WY(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:qh(e,u(e)),subtitle:BY(t,e),teamMembers:(0,i.jsx)(VY,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(ic,{height:"3"})]},e.id)),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("creneau_souhaite",r.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cr_neaux_dont_l_10130")}),(0,i.jsx)(ic,{height:"3"}),r.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(NY,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:WY(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:qh(e,u(e)),subtitle:BY(t,e),teamMembers:(0,i.jsx)(VY,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(ic,{height:"3"})]},e.id)),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("autre_creneau_possible",d.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cr_neaux_dont_l_99850")}),(0,i.jsx)(ic,{height:"3"}),d.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(NY,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:WY(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:qh(e,u(e)),subtitle:BY(t,e),teamMembers:(0,i.jsx)(VY,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(ic,{height:"3"})]},e.id)),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("autre_creneau",l.length)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("cr_neaux_dont_l_25685")}),(0,i.jsx)(ic,{height:"3"}),l.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(NY,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isRadio:WY(e),isSelected:s.includes(e.id),neededResources:e.resources,overlaps:qh(e,u(e)),subtitle:BY(t,e),teamMembers:(0,i.jsx)(VY,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{m(e)}}),(0,i.jsx)(ic,{height:"3"})]},e.id))]})},qY=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>(e.positionsCategoriesIds||[]).map(n=>e.event.positionsCategories.find(e=>e.id===n).name).join(", "),[e.positionsCategoriesIds,e.event]),o=(0,de.useMemo)(()=>(e.positionsIds||[]).map(n=>e.event.positions.nodes.find(e=>e.id===n).name).join(", "),[e.positionsIds,e.event]),a=(0,de.useMemo)(()=>e.date?t.toLocaleString(e.date,da.DateOnly.MonthLong):"",[e.date]),r=(0,de.useMemo)(()=>e.segmentId?e.event.segments.find(n=>n.id===e.segmentId).name:"",[e.segmentId,e.event]),d=(0,de.useMemo)(()=>(e.tagsIds||[]).map(n=>e.organization.tags.nodes.find(e=>e.id===n).name).join(", "),[e.tagsIds,e.organization]);return w(s)||w(o)||w(a)||w(r)||w(d)||e.excludeFull||e.excludePast?(0,i.jsxs)(Xl,{align:"center",gap:"3",wrap:"wrap",children:[w(s)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:n("cat_gories_1_42029",s)}),w(o)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:n("missions_1_62834",o)}),w(a)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:n("date_1_17337",a)}),w(r)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:n("vue_1_29260",r)}),w(d)&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:n("tags_1_43158",d)}),e.excludeFull&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:n("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(Lm,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:n("cr_neaux_dans_l_92999")}),(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:n("r_initialiser_l_66835")})]}):null},HY=e=>{const n=os(),[t,s]=(0,de.useState)(e.positionsCategoriesIds),[o,a]=(0,de.useState)(e.positionsIds),[r,d]=(0,de.useState)(e.date),[l,c]=(0,de.useState)(e.segmentId?[e.segmentId]:[]),[u,m]=(0,de.useState)(e.tagsIds),[g,h]=(0,de.useState)(e.excludeFull?"checked":"unchecked"),[I,x]=(0,de.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Xl,{direction:"column",onChange:Uc,children:[(0,i.jsxs)(Xl,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("liste_des_filtr_75605")}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_97056"),renderOnPortal:!0,values:t||p,onChange:s,children:e.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_71859"),renderOnPortal:!0,values:o||p,onChange:a,children:e.event.positions.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(df,{max:e.event.endAt,min:e.event.startAt,placeholder:n("date_du_cr_neau_82295"),value:r,onChange:d}),(0,i.jsx)(lg,{isSearchVisible:!0,placeholder:n("s_lectionnez_un_19794"),renderOnPortal:!0,values:l,onChange:e=>{f(e)?c([(0,eh.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||p,onChange:m,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Zm,{state:g,onClick:h,children:n("masquer_les_cr_14425")}),(0,i.jsx)(Zm,{state:I,onClick:x,children:n("masquer_les_cr_05336")})]}),(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:n("r_initialiser_77538")}),(0,i.jsx)(yc,{size:"sm",onClick:()=>{e.setDate(r),e.setExcludeFull("checked"===g),e.setExcludePast("checked"===I),e.setPositionsCategoriesIds(t),e.setPositionsIds(o),e.setSegmentId(f(l)?l[0]:null),e.setTagsIds(u),e.close()},children:n("appliquer_05753")})]})]})},YY=e=>{const n=os(),[t,s]=(0,de.useState)(!1),o=(0,de.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)(Xl,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),value:e.name,onChange:e.setName}),(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,isOpen:t,onStateChange:s,children:[(0,i.jsx)($m,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"bars-filter",children:n("filtres_64574")})})}),(0,i.jsx)(wm,{placement:"bottom-end",width:385,children:(0,i.jsx)(HY,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(qY,{...e,reset:o})]})},ZY=e=>{const{eventId:n}=ls(),{isPreAssign:t}=PY(),[s,o,a]=Dg(""),[r,d]=ZP("assignment.filters.positionsCategoriesIds",null),[l,c]=ZP("assignment.filters.positionsIds",null),[u,m]=ZP("assignment.filters.date",null),[g,h]=ZP("assignment.filters.tagsIds",null),[p,I]=ZP("assignment.filters.segmentId",null),[x,_]=ZP("assignment.filters.excludeFull",!1),[j,v]=ZP("assignment.filters.excludePast",!1),{data:S,loader:y}=rs("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 name: $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 positionDisplay\n assignedResources\n resources\n range\n\n ...PositionPositionsCustomFields\n }\n }\n }\n }\n}\n",{eventId:n,name:w(o)?o:void 0,positionsCategoriesIds:f(r)?r:void 0,positionsIds:f(l)?l:void 0,date:u,tagsIds:f(g)?g:void 0,segmentId:p,excludeFull:x,excludePast:j},[Ko.PositionPositionsCustomFieldsFragment],undefined);return(0,i.jsxs)(Xl,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(YY,{date:u,event:e.event,excludeFull:x,excludePast:j,name:s,organization:e.organization,positionsCategoriesIds:r,positionsIds:l,segmentId:p,setDate:m,setExcludeFull:_,setExcludePast:v,setName:a,setPositionsCategoriesIds:d,setPositionsIds:c,setSegmentId:I,setTagsIds:h,tagsIds:g}),(0,i.jsx)(ic,{height:"7"}),y||(t?(0,i.jsx)(UY,{positionsSlots:S.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)(GY,{positionsSlots:S.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},KY=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,userInfoId:a}}=fc(),r=us().pathname.includes("pre-assignment"),{canMemberAssign:d}=tC();fm(t("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[l,c]=ZP("assignment.isLeftPanelOpen",!0),[u,m]=ZP("assignment.isRightPanelOpen",!0),[g,h,I]=Dg(""),[f,x]=ZP("assignment.leftPanelDirection",ut.Desc),[_,j]=ZP("assignment.leftPanelSegmentId",-1),[v,S]=ZP("assignment.leftPanelStates",[yt.WaitingAssignment,yt.PreAssigned]),{data:y,isLoading:C}=$a({eventId:o,states:v,name:w(h)?h:void 0,segmentId:-1===_?void 0:_,direction:f,loadDelegations:!1}),b=(0,de.useCallback)(()=>{const e=y.event?.volunteersRegistrations.nodes??[],t=e.findIndex(e=>e.userInfo.id===a),i=e[t+1]?.userInfo.id??e[0].userInfo.id;i===a?n.goBack(Wo.ASSIGNMENTS(s,o)):r?n.replace(Wo.PRE_ASSIGNMENT(s,o,i)):n.replace(Wo.ASSIGNMENT(s,o,i))},[r,s,o,a,y.event]),A=e.event.volunteerRegistration,E=(0,de.useMemo)(()=>A.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[A]),$=(0,de.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)(MY,{isEdit:e.isEdit,positionsCategoriesIds:A.preassignPositionsCategoriesIds,positionsIds:A.preassignPositionsIds,positionsSlotsIds:E,showNextVolunteer:b,teams:A.teams,children:(0,i.jsx)(kq,{buttons:(0,i.jsx)(kY,{isEdit:e.isEdit,userInfoId:A.userInfo.id,volunteerRegistrationId:A.id}),header:(0,i.jsx)(Fq,{badgeColorIcon:LC(A.state),delegation:A.delegation,insertedAt:A.insertedAt,isPreAssign:r,showTabs:d,showTeam:!0,teams:A.teams,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:l,isRightPanelOpen:u,leftPanel:(0,i.jsx)(Uq,{accreditationStates:p,delegationId:null,direction:f,event:y.event,getPath:e=>r?Wo.PRE_ASSIGNMENT(s,o,e):Wo.ASSIGNMENT(s,o,e),isLoading:C,loadDelegations:!1,name:g,segmentId:_,setAccreditationStates:Ou.A,setDelegationId:Ou.A,setDirection:x,setName:I,setSegmentId:j,setStates:S,showAccreditationStates:!1,showStates:!0,states:v,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(Zq,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!1,showWishedPositions:!0,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{m(!1)}}),setIsLeftPanelOpen:c,setIsRightPanelOpen:m,children:(0,i.jsx)(ZY,{event:e.event,organization:e.organization,state:A.state,userInfo:A.userInfo,...$})})})},XY=e=>{const{organizationId:n,eventId:t,userInfoId:s}=ls(),{data:o,loader:a}=rs("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 delegation {\n id\n name\n }\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:n,eventId:t,userInfoId:s},[Ko.FormsUsersInfosWishedFragment,Ko.CustomFieldWithConditionFragment,Ko.UserInfoTeamMemberFragment],undefined);return a||(0,i.jsx)(KY,{event:o.event,isEdit:e.isEdit,organization:o.organization})},QY=()=>{const{translate:e,params:{eventId:n}}=fc(),[t,s,o]=Dg(""),[a,r]=(0,de.useState)(""),[d,l]=(0,de.useState)(0),{data:c,isLoading:u,reload:m}=rs("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",{eventId:n,name:w(s)?s:void 0,state:""!==a?a:void 0,offset:d},[Ko.EmailRecipientFragment],undefined);const g=zg(),{numberOfPages:h,totalCount:p}=Jf(c.event?.emails);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:a,onChange:e=>{r(e),l(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),g(ai.filter(e=>e!==rn.Queued))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:t,onChange:e=>{o(e),l(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Mg,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Mg,{children:e("State")}),(0,i.jsx)(Mg,{width:100})]}),numberOfPages:h,offset:d,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):f(c.event.emails.nodes)?c.event.emails.nodes.map(e=>(0,i.jsx)(kC,{email:e,emailType:ln.Assignments,reload:m},e.id)):(0,i.jsx)(ww,{subtitle:e("vous_n_avez_pas_92612"),title:e("aucun_courriel_12121")}),setOffset:l,title:e("liste_des_envoi_52697"),totalCount:p})},JY=e=>{const n=os(),{mutate:t,isLoading:s}=function(e={}){return ds("mutation SendAssignmentsEmails(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(uA,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",textAlign:"center",children:n("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("les_membres_pr_53976")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:s,onClick:async()=>{await t({eventId:e.eventId,sendAssignmentsEmails:e.sendAssignmentsEmails}),e.reload(),e.onClose()},children:n("confirmer_l_env_08749")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},eZ=e=>{const n=os(),[t,s,o]=Dg(""),[a,r]=(0,de.useState)([]),{data:d}=Rd({eventId:e.eventId,usersInfosIds:a,name:w(s)?s:void 0}),{mutate:l,isLoading:c}=function(e={}){return ds("mutation AssignmentsEmailsEstimate(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,m]=(0,de.useState)(Me.Everyone),g=(0,de.useMemo)(()=>(0,wh.A)((d.event?.volunteersRegistrations.nodes??[]).concat(d.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[d.event]),[h,p]=(0,de.useState)([]),I=u===Me.Everyone||u===Me.Assigned||u===Me.Refused||u===Me.Members&&f(a)||u===Me.Segments&&f(h),x=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(uA,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("envoi_des_e_mai_81363")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("personnaliser_v_78340")}),(0,i.jsx)(ic,{height:"7"}),x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"error",children:(0,i.jsx)(Oc,{children:n("vous_ne_pouvez_69435")})}),(0,i.jsx)(ic,{height:"4"})]}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("que_souhaitez_v_01732")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(eg,{state:u===Me.Everyone?"checked":"unchecked",onClick:()=>{m(Me.Everyone)},children:n("tous_les_e_mail_39319")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:u===Me.Assigned?"checked":"unchecked",onClick:()=>{m(Me.Assigned)},children:n("tous_les_e_mail_42685")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:u===Me.Refused?"checked":"unchecked",onClick:()=>{m(Me.Refused)},children:n("tous_les_e_mail_41162")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:u===Me.Members?"checked":"unchecked",onClick:()=>{m(Me.Members)},children:n("_certains_memb_91094")}),u===Me.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_50038"),state:"search",value:t,onChange:o}),values:a,onChange:r,children:g.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:u===Me.Segments?"checked":"unchecked",onClick:()=>{m(Me.Segments)},children:n("uniquement_ce_54026")}),u===Me.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Zr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,values:h,onChange:p,children:(d.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:x,isLoading:c,onClick:async()=>{if(I){const n={recipients:u,segmentsIds:h,usersInfosIds:a},{eventAssignmentsEmailsEstimate:t}=await l({eventId:e.eventId,sendAssignmentsEmails:n});e.onSuccess(t,n),e.onClose()}},children:n("envoyer_les_e_m_37846")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},nZ=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc(),{localEvent:o,setNumberOfWaitingAssigments:a}=Ly(),{data:r,loader:d,reload:l}=rs('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:t,eventId:s,direction:o?.["assignment.leftPanelDirection"]??ut.Desc},[],undefined);const[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(null),[h,p]=(0,de.useState)(0),[I,f]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{r.event?.waitingAssignment&&a(r.event.waitingAssignment.totalCount)},[r]),d||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(yC,{children:[(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsxs)(jL,{button:(0,i.jsxs)(Xl,{gap:"3",children:[r.event.hasFormWithTeamsAllowed&&(0,i.jsx)(yc,{color:"white",disabled:0===r.event.waitingTeams.totalCount,onClick:()=>{e.push(Wo.TEAM_ASSIGNMENT(t,s,r.event.waitingTeams.nodes[0].teamCode))},children:n("affecter_les_q_17322")}),(0,i.jsx)(yc,{disabled:0===r.event.waitingAssignment.totalCount,onClick:()=>{e.push(Wo.ASSIGNMENT(t,s,r.event.waitingAssignment.nodes[0].userInfoId))},children:n("affecter_les_me_77160")})]}),children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("membre_en_atten_84228",r.event.waitingAssignment.totalCount)}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:r.event.waitingAssignment.totalCount})]}),(0,i.jsxs)(jL,{button:(0,i.jsx)(yc,{onClick:()=>{u(!0)},children:n("param_trer_et_e_31095")}),children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("e_mail_de_confi_84099",r.event.emailsStats.numberOfWaiting)}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:r.event.emailsStats.numberOfWaiting})]}),(0,i.jsxs)(jL,{button:(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.VOLUNTEERS(t,s))},children:n("voir_les_membre_27923")}),children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("membre_affect_05484",r.event.assigned.totalCount)}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:r.event.assigned.totalCount})]})]}),(0,i.jsx)(ic,{height:"9"}),(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:n("historique_des_68195")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{gap:"6",children:[(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("nombre_d_envois_95106")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:r.event.emailsStats.numberOfSent??0})]}),(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("nombre_d_ouvert_84187")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:r.event.emailsStats.numberOfOpen??0})]}),(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("nombre_de_clics_64232")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:r.event.emailsStats.numberOfClick??0})]})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(QY,{})]}),c&&(0,i.jsx)(eZ,{emailSender:r.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{u(!1)},onSuccess:(e,n)=>{p(e),g(n),f(!0)}}),I&&(0,i.jsx)(JY,{eventId:s,numberOfEmails:h,reload:l,sendAssignmentsEmails:m,onClose:()=>{f(!1)}})]})},tZ=()=>{const{translate:e}=fc();return(0,i.jsxs)(bC,{direction:"column",children:[(0,i.jsx)(Zr,{font:"blueGray900 textXl medium",children:e("mes_affectation_73224")}),(0,i.jsx)(Zr,{color:"gray500",children:e("affecter_vos_me")})]})},iZ=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc(),{localEvent:o}=Ly(),{data:a,loader:r}=rs('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"]??ut.Desc},[],undefined);return r||(0,i.jsx)(yC,{children:(0,i.jsx)(Xl,{gap:"3",children:(0,i.jsxs)(jL,{button:(0,i.jsx)(yc,{disabled:0===a.event.preAssigneds.totalCount,onClick:()=>{e.push(Wo.ASSIGNMENT(t,s,a.event.preAssigneds.nodes[0].userInfoId))},children:n("affecter_les_me_77160")}),children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:n("membre_en_atten_84228",a.event.preAssigneds.totalCount)}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:a.event.preAssigneds.totalCount})]})})})},sZ=()=>{const{translate:e,params:{eventId:n}}=fc(),{event:{name:t},hasPermission:s,updateLocalEvent:o}=Ly(),a=s(nC.MEMBER_ASSIGN,{eventId:n});return fm(`${t} ${e("mes_affectation_73224")}`),(0,de.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})])})()},[]),(0,i.jsxs)(AC,{children:[(0,i.jsx)(tZ,{}),a?(0,i.jsx)(nZ,{}):(0,i.jsx)(iZ,{})]})},oZ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,teamCode:a}}=fc(),r=a===e.team.teamCode,[d,l]=(0,de.useState)(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:r?"$primary100":"white",borderBottom:d?"none":"1px solid $gray200",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"4",onClick:()=>{n.push(Wo.TEAM_ASSIGNMENT(s,o,e.team.teamCode))},children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(Zr,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(Zr,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{Uc(e),l(!d)},children:(0,i.jsx)(pc,{icon:d?"chevron-down":"chevron-right"})})]}),d&&e.team.members.map((t,a)=>(0,i.jsx)(Nq,{displayBorder:a===e.team.members.length-1,isSelected:r,vr:t,onClick:()=>{n.push(Wo.TEAM_ASSIGNMENT(s,o,e.team.teamCode))}},t.userInfo.id))]})},aZ=e=>{const{params:{organizationId:n,eventId:t,teamCode:s},translate:o}=fc(),a=e.event?.teams.totalCount??0,r=e.event?.teams.nodes??[];return(0,i.jsxs)(Xl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Xl,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(GC,{color:"primary",returnPathFallback:Wo.TEAM_ASSIGNMENT(n,t,s),children:o("retour_92202")}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(Lm,{color:"error",size:"sm",children:o("_1_quipe_rest_49090",a)})]})]}),(0,i.jsxs)(Xl,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(ym,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(wm,{css:{paddingTop:"0"},placement:"bottom",children:(0,i.jsxs)(Xl,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsx)(hu,{label:o("nombre_de_membr_84892"),shouldParseAsInt:!0,value:e.numberOfMembers||"",onChange:e.setNumberOfMembers})]})})]})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Lq,{}),(0,i.jsx)(Lq,{}),(0,i.jsx)(Lq,{})]}):r.map(e=>(0,i.jsx)(oZ,{team:e},e.teamCode))})]})},rZ=()=>{const{translate:e,params:{eventId:n,teamCode:t}}=fc(),{positionsSlotsIds:s,showNextVolunteer:o}=PY(),{mutate:a,isLoading:r}=function(e={}){return ds("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:d,isLoading:l}=function(e={}){return ds("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(Xl,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{l||r||(await a({eventId:n,teamCode:t}),o())},children:e("refuser_l_quip_29246")}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(yc,{color:"primary",isLoading:l,onClick:async()=>{l||r||(await d({eventId:n,teamCode:t,assignment:{positionsSlotsIds:s}}),o())},children:e("affecter_l_qui_23291")}),(0,i.jsx)(yc,{color:"white",onClick:o,children:e("affecter_l_qui_37763")})]})},dZ=e=>{const n=os();return(0,i.jsx)(Xl,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(Zr,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]})})},lZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=(0,de.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(n=>n.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(Xl,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(pc,{icon:"sidebar"})})}),(0,i.jsx)(ux,{placement:"top",children:n("cacher_les_info_67266")})]}),(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:n("_propos_de_l_47506")})]}),e.team.members.map(t=>(0,i.jsx)(qq,{customFields:e.customFields,formsIds:[e.team.formId],title:n("informations_de_63884",t.userInfo.nameOrEmail),userInfo:t.userInfo},t.id)),(0,i.jsx)(Hq,{eventId:s,formsUsersInfos:o,organizationId:t}),(0,i.jsx)(Yq,{formsUsersInfos:o})]})},cZ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,teamCode:a}}=fc(),[r,d]=ZP("assignment.isLeftPanelOpen",!0),[l,c]=ZP("assignment.isRightPanelOpen",!0),[u,m,g]=Dg(""),[h,p]=ZP("teamAssignment.numberOfMembers",null),{data:I,isLoading:f}=rs("query TeamAssignmentWaitingTeams($eventId: EventId!, $name: String, $numberOfMembers: Int) {\n event(id: $eventId) {\n teams(name: $name, numberOfMembers: $numberOfMembers, state: WaitingAssignment) {\n nodes {\n teamCode\n\n members {\n ...VolunteerRegistrationWaitingAssignment\n }\n }\n\n totalCount\n }\n }\n}\n",{eventId:o,name:w(m)?m:void 0,numberOfMembers:"number"==typeof h&&h>0?h:void 0},[Ko.VolunteerRegistrationWaitingAssignmentFragment],undefined);const x=(0,de.useCallback)(()=>{const e=I.event?.teams.nodes??[],t=e.findIndex(e=>e.teamCode===a),i=e[t+1]?.teamCode??e[0].teamCode;i===a?n.goBack(Wo.ASSIGNMENTS(s,o)):n.replace(Wo.TEAM_ASSIGNMENT(s,o,i))},[s,o,a,I.event]),_=e.event.team,j=(0,de.useMemo)(()=>({wishedPositionsCategoriesIds:_.positionsCategoriesIds,wishedPositionsIds:_.positionsIds,wishedPositionsSlotsIds:_.positionsSlotsIds,wishedRanges:_.slots.map(({range:e})=>e)}),[_]);return fm(t("affectation_de_62702",_.teamCode)),(0,i.jsx)(MY,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:x,teams:[],children:(0,i.jsx)(kq,{buttons:(0,i.jsx)(rZ,{}),header:(0,i.jsx)(dZ,{team:_}),isEdit:!1,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(aZ,{event:I.event,isLoading:f,name:u,numberOfMembers:h,setName:g,setNumberOfMembers:p}),rightPanel:(0,i.jsx)(lZ,{customFields:e.event.formsCustomsFields,team:_,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:d,setIsRightPanelOpen:c,children:(0,i.jsx)(ZY,{event:e.event,organization:e.organization,state:yt.NotApplicable,userInfo:_.leaderUserInfo,...j})})})},uZ=()=>{const{params:{organizationId:e,eventId:n,teamCode:t}}=fc(),{data:s,loader:o}=rs("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:n,teamCode:t},[Ko.CustomFieldWithConditionFragment,Ko.FormsUsersInfosWishedFragment],undefined);return o||(0,i.jsx)(cZ,{event:s.event,organization:s.organization})},mZ=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=fc(),{event:{name:o},hasPermission:a}=Ly(),{canCampaignSend:r}=tC(),d=a(nC.CAMPAIGN_SEND,{eventId:t});fm(`${o} ${s("Campaigns")}`);const l=zg(),[c,u]=(0,de.useState)(""),[m,g]=(0,de.useState)(""),h=Rg(e=>{g(e),S()}),[p,I]=(0,de.useState)(""),[x,_]=(0,de.useState)(""),[j,v]=(0,de.useState)(0),S=()=>{v(0)},[y,C]=(0,de.useState)(null),{data:b,isLoading:A,reload:E}=rs("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:t,name:w(m)?m:void 0,states:""!==p?[p]:void 0,campaignType:""!==x?x:void 0,offset:j,sort:y},[Ko.CampaignListFragment],undefined);return ML(b.event?.campaigns.nodes??[],E),(0,i.jsxs)(AC,{children:[(0,i.jsxs)(bC,{children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:s("Campaigns")}),d?(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"paper-plane",onClick:()=>{e.push(Nv.CREATE_TEMPLATE({organizationId:n,eventId:t}))},children:s("cr_er_un_mod_le_20298")}),onClick:()=>{e.push(Nv.CREATE({organizationId:n,eventId:t}))},children:s("cr_er_une_campa_96023")}):r?(0,i.jsx)(yc,{to:Nv.CREATE({organizationId:n,eventId:t}),children:s("cr_er_une_campa_96023")}):null]}),(0,i.jsxs)(yC,{children:[(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(RC,{content:b.event?.doneCampaigns.totalCount??"-",title:s("nombre_de_campa_52133")}),(0,i.jsx)(RC,{content:b.event?.campaignsCost??"-",title:s("co_t_des_campag_08459")})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Xl,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:p,onChange:e=>{I(e),S()},children:[(0,i.jsx)("option",{value:"",children:s("toutes_les_camp_81617")}),l(Xt)]})}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(nf,{value:x,onChange:e=>{_(e),S()},children:[(0,i.jsx)("option",{value:"",children:s("sms_et_e_mail_94587")}),l(Qt)]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_une_69554"),value:c,onChange:e=>{u(e),h(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:Ne.Name,setSort:C,sort:y,children:s("nom_de_la_campa_45063")}),(0,i.jsx)(ax,{attribute:Ne.Type,css:{flex:"0 150px"},setSort:C,sort:y,children:s("type_35427")}),(0,i.jsx)(Mg,{css:{flex:"0 200px"},children:s("nombre_de_desti_21374")}),(0,i.jsx)(Mg,{css:{flex:"0 150px"},children:s("co_t_68998")}),(0,i.jsx)(ax,{attribute:Ne.State,css:{flex:"0 150px"},setSort:C,sort:y,children:s("State")}),(0,i.jsx)(Mg,{css:{flex:"0 100px"}})]}),numberOfPages:b.event?.campaigns.numberOfPages??0,offset:j,rows:A?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:f(b.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:b.event.campaigns.nodes.map(e=>(0,i.jsx)(DL,{campaign:e,canCampaignSend:r,eventId:t,organizationId:n,reload:E},e.id))}):(0,i.jsx)(ww,{title:s("no_campaigns")})}),setOffset:v,title:s("liste_des_campa_60034"),totalCount:b.event?.campaigns.totalCount??0})})]})]})},gZ=({organizationId:e,eventId:n,category:t,clickable:s})=>{const o=os();return(0,i.jsx)(Eg,{children:(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Xl,{gap:"3",justify:"between",children:[s?(0,i.jsx)(Ug,{to:Eo.POSITION_CATEGORY({organizationId:e,eventId:n,positionCategoryId:t.id}),children:t.name}):(0,i.jsx)(Zr,{color:"gray700",children:t.name}),(0,i.jsx)(Zr,{color:"gray700",children:o("_1_2_membres_04485",t.assignedResources,t.resources)})]}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(VL,{percent:t.assignedResources/t.resources})})]})})},t.id)},hZ=e=>(0,i.jsx)(Xl,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(gc,{to:e.path,width:1,children:[(0,i.jsx)(Xl,{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)(pc,{icon:"check"})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Zr,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(pc,{icon:"arrow-right"})})]})}),pZ=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(dE),{hasEventRole:a}=Ly(),{canCampaignSend:r,canFormEdit:d,canPositionEdit:l}=tC(),{data:c,loader:u}=rs("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},[],undefined);const m=(0,de.useMemo)(()=>c.event?(0,Tg.A)(c.event.positionsCategories,e=>e.name.toLowerCase()):[],[c.event]),g=!(!(a&&r&&d&&l&&c.event)||c.event.onboarding.isFirstCampaignCreated&&c.event.onboarding.isFirstFormCreated&&c.event.onboarding.isFirstPositionCreated);return u||(0,i.jsxs)(Xl,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:n("tableau_de_bord_24627")}),(0,i.jsx)(ic,{height:"7"}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(FY,{header:(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:n("vos_premiers_pa_81169")}),(0,i.jsx)(Zr,{color:"gray500",children:n("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(hZ,{isDone:c.event.onboarding.isFirstPositionCreated,path:Wo.CREATE_POSITION(t,s),subtitle:n("cr_er_une_nouve_43436"),title:n("cr_er_votre_pre_70209")}),(0,i.jsx)(hZ,{isDone:c.event.onboarding.isFirstFormCreated,path:Ks.FORMS({organizationId:t,eventId:s}),subtitle:n("cr_er_un_formul_31199"),title:n("cr_er_votre_pre_76199")}),(0,i.jsx)(hZ,{isDone:c.event.onboarding.isFirstCampaignCreated,path:Nv.CREATE({organizationId:t,eventId:s}),subtitle:n("communiquer_fac_26569"),title:n("envoyer_votre_p_47899")})]})}),(0,i.jsx)(ic,{height:"8"})]}),(0,i.jsxs)(Wu,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(Zr,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(MO,{button:(0,i.jsx)(yc,{to:Eo.POSITIONS({organizationId:t,eventId:s}),children:n("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:n("nombre_de_membr_60320",c.event.resources),value:c.event.resources})}),(0,i.jsx)(Zr,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(MO,{button:(0,i.jsx)(yc,{to:Eo.POSITIONS({organizationId:t,eventId:s}),children:n("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:n("nombre_de_missi_67304",c.event.numberOfPositions),value:c.event.numberOfPositions})}),(0,i.jsx)(Zr,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(MO,{button:(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.VOLUNTEERS(t,s))},children:n("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:n("nombre_de_membr_87779",c.event.assignmentsStats.numberOfAssigned),value:c.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(Zr,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(MO,{button:(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.ASSIGNMENTS(t,s))},children:n("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:n("nombre_de_membr_63555",c.event.assignmentsStats.numberOfWaitingAssignment),value:c.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(Xl,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("taux_de_remplis_11913")}),(0,i.jsxs)(Zr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===c.event.resources?"0":Math.round(c.event.assignedResources/c.event.resources*100),"%"]})]}),(0,i.jsx)(Zr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("temps_de_b_n_vo_87924")}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(c.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(Zr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray500",children:n("temps_de_b_n_vo_60725")}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(c.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(ic,{height:"8"}),a&&(0,i.jsx)(Zr,{css:{boxShadow:"$xs"},children:(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Mg,{children:n("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:m.length>0?m.map(e=>(0,i.jsx)(gZ,{category:e,clickable:!0,eventId:s,organizationId:t},e.id)):(0,i.jsx)(ww,{subtitle:n("vous_n_avez_pas_59681"),title:n("aucune_cat_gori_21347")})}),setOffset:Ou.A,title:n("liste_des_membr_59735"),totalCount:0})})]})};var IZ,fZ,xZ;let _Z=class extends vF{static{IZ=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...vF.IMPORT_COLUMNS_DEFAULT,Name:"name",CategoryName:"categoryName",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===wn.Update?[IZ.IMPORT_COLUMNS_DEFAULT.Id]:[],IZ.IMPORT_COLUMNS_DEFAULT.Name,IZ.IMPORT_COLUMNS_DEFAULT.CategoryName,IZ.IMPORT_COLUMNS_DEFAULT.FormId];default(e){const n=super.default(e);return n.input={...n.input},n}constructor(e,n){super(e,n),this.csvInputService=e}};_Z=IZ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(fZ=void 0!==hF&&hF)?fZ:Object,"function"==typeof(xZ=void 0!==ts&&ts)?xZ:Object])],_Z);const jZ=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{mutate:s}=function(e={}){return ds("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}=Sy(),a=(0,de.useCallback)((e,n,t)=>o(e,n,t),[o,n]),{data:r,loader:d}=kd({organizationId:e,variety:Ke.Delegation});return d||(0,i.jsx)(cF,{alertDescriptionKey:"to_add_a_team_51299",children:(0,i.jsx)(YF,{ImportInputService:_Z,checkImport:a,closePath:vo.DELEGATIONS({organizationId:e,eventId:n}),customFields:r.organization.customFields.nodes,heading:t("import_de_d_l_g_69356"),importTagPrefix:"delegations",localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Ug,{to:vo.DELEGATIONS({organizationId:e,eventId:n}),children:t("revenir_aux_d_l_15915")})})})},vZ=e=>{const{translate:n,params:{eventId:t}}=fc(),{canDelegationEdit:s,canMemberAccredit:o}=tC(),[a,r]=(0,de.useState)(e.delegationAccreditationSlot),d=(0,de.useMemo)(()=>Mm(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),l=(0,de.useMemo)(()=>({background:d[50],border:`1px solid ${d[500]}`,color:d[700]}),[d]),c=(0,de.useCallback)(async()=>{const{event:{delegation:n}}=await Ka({eventId:t,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},{token:await fe()});r(n.accreditationSlot)},[e.accreditationSlot,e.delegationId,r]),u=s&&o,[m,g]=(0,de.useState)(!1),h=a.maxResources?`/${a.maxResources}`:"",p=`${a.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{...l,borderRadius:"$1",cursor:u?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{u&&g(!0)},children:[(0,i.jsx)(tz,{background:d[100],count:p,icon:"badge-check",text:n("attribu_es_48167")}),(0,i.jsx)(tz,{background:d[100],count:a.wishedResources,icon:"hand-holding-heart",text:n("souhait_es_78101")}),(0,i.jsx)(tz,{background:d[100],count:a.scannedResources,icon:"scanner-gun",text:n("scann_es_13169")})]}),u&&m&&(0,i.jsx)(gz,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:t,onClose:()=>(g(!1),c())})]})},SZ=e=>{const n=(0,de.useMemo)(()=>(e.delegation.allAccreditationsSlots||[]).find(n=>n.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return n?(0,i.jsx)(vZ,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:n,delegationId:e.delegation.id}):null},yZ=e=>{const{translate:n}=fc(),{mutate:t}=Ta(),s=(0,de.useCallback)(n=>n.accreditationProfileId===e.accreditationProfileId,[e.accreditationProfileId]),o=(0,de.useCallback)(async n=>{const{event:t}=await function(e,n={}){return xa("query DelegationAccreditationProfileMember(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationProfile\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.DelegationAccreditationProfileStatsFragment,Ko.VolunteerRegistrationDelegationAccreditationProfileFragment]})}({eventId:e.eventId,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfileId,userInfoId:n},{token:await fe()}),i=t.member.wishedAccreditationProfileId===e.accreditationProfileId;return{member:s(t.member)||i?t.member:null,stats:t.delegation.accreditationProfile}},[e.accreditationProfileId,e.delegationId,e.eventId,s]),a=(0,de.useCallback)((n,i)=>t({eventId:e.eventId,massProfileUpdate:{accreditationProfileId:e.accreditationProfileId,selecteds:{ids:[n]},strategy:i}}),[t,e.accreditationProfileId,e.eventId]),r=(0,de.useCallback)(e=>a(e,Dn.Add),[a]),d=(0,de.useCallback)(e=>a(e,Dn.Delete),[a]);return(0,i.jsx)(cz,{add:r,assignedText:n("d_j_attribu_33932"),delete:d,deleteText:n("retirer_le_prof_47260"),isAssigned:s,members:e.volunteersRegistrations,name:e.name,reloadMember:o,stats:e.stats})},CZ=e=>{const{data:n,loader:t}=rs("query DelegationAccreditationProfileMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n\n accreditationProfile {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationProfile\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfileId},[Ko.DelegationAccreditationProfileStatsFragment,Ko.VolunteerRegistrationDelegationAccreditationProfileFragment],undefined);return(0,i.jsx)(fI,{size:"md",onClose:e.onClose,children:t||(0,i.jsx)(yZ,{accreditationProfileId:e.accreditationProfileId,delegationId:e.delegationId,eventId:e.eventId,name:n.event.delegation.accreditationProfile.accreditationProfile.name,stats:n.event.delegation.accreditationProfile,volunteersRegistrations:n.event.delegation.accreditationProfile.volunteersRegistrations})})},bZ=e=>{const{translate:n,params:{eventId:t}}=fc(),{canDelegationEdit:s,canMemberAccredit:o}=tC(),[a,r]=(0,de.useState)(e.delegationAccreditationProfile),d=(0,de.useMemo)(()=>Mm(e.accreditationProfile.color),[e.accreditationProfile]),l=(0,de.useMemo)(()=>({background:d[50],border:`1px solid ${d[500]}`,color:d[700]}),[d]),c=(0,de.useCallback)(async()=>{const{event:{delegation:n}}=await function(e,n={}){return xa("query DelegationAccreditationProfileStats(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationProfileId: AccreditationsProfileId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationProfile(id: $accreditationProfileId) {\n ...DelegationAccreditationProfileStats\n }\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.DelegationAccreditationProfileStatsFragment]})}({eventId:t,delegationId:e.delegationId,accreditationProfileId:e.accreditationProfile.id},{token:await fe()});r(n.accreditationProfile)},[e.accreditationProfile,e.delegationId,r]),u=s&&o,[m,g]=(0,de.useState)(!1),h=a.maxResources?`/${a.maxResources}`:"",p=`${a.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{...l,borderRadius:"$1",cursor:u?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,justify:"center",width:1,onClick:()=>{u&&g(!0)},children:[(0,i.jsx)(tz,{background:d[100],count:p,icon:"badge-check",text:n("attribu_es_48167")}),(0,i.jsx)(tz,{background:d[100],count:a.wishedResources,icon:"hand-holding-heart",text:n("souhait_es_78101")})]}),u&&m&&(0,i.jsx)(CZ,{accreditationProfileId:e.accreditationProfile.id,delegationId:e.delegationId,eventId:t,onClose:()=>(g(!1),c())})]})},AZ=e=>{const n=(0,de.useMemo)(()=>(e.delegation.accreditationsProfiles||[]).find(n=>n.accreditationProfileId===e.accreditationProfile.id),[e.delegation,e.accreditationProfile]);return n?(0,i.jsx)(bZ,{accreditationProfile:e.accreditationProfile,delegationAccreditationProfile:n,delegationId:e.delegation.id}):null},EZ=e=>(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:[e.accreditationsProfiles.map(n=>(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(AZ,{accreditationProfile:n,delegation:e.delegation})},n.id)),e.accreditationsSlots.map(n=>(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(SZ,{accreditationSlot:n,delegation:e.delegation})},n.id))]}),wZ=e=>{const{params:{organizationId:n,eventId:t}}=fc(),s=(0,de.useMemo)(()=>yT(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,de.useMemo)(()=>CT(e.allAccreditationsSlots),[e.allAccreditationsSlots]),a=(0,de.useMemo)(()=>e.showAccreditations?AT(o,e.selectedSlotsIds):[],[o,e.selectedSlotsIds,e.showAccreditations]),r=(0,de.useMemo)(()=>ET(a,e.selectedSlotsIds,e.matrixRendering),[a,e.matrixRendering,e.selectedSlotsIds]),d=(0,de.useMemo)(()=>(0,Tg.A)(e.allAccreditationsProfiles.filter(n=>e.showProfiles&&(_(e.selectedProfilesIds)||e.selectedProfilesIds.includes(n.id))),e=>[b(e.accreditationProfileCategory.name),b(e.name)]),[e.allAccreditationsProfiles,e.selectedProfilesIds,e.showProfiles]),l=(0,de.useMemo)(()=>r.map(e=>e.id),[r]),c=(0,de.useCallback)(e=>(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(Ug,{to:vo.DELEGATION({organizationId:n,eventId:t,delegationId:e.id}),children:e.name})},e.id),[n,t]),u=(0,de.useCallback)(e=>(0,i.jsx)(EZ,{accreditationsProfiles:d,accreditationsSlots:r,delegation:e},e.id),[r,l]);return(0,i.jsx)(Xl,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(_c,{}):(0,i.jsx)(wT,{accreditationsProfiles:d,allAccreditations:o,allAccreditationsProfiles:e.allAccreditationsProfiles,allCategories:s,cellWidth:200,data:e.delegations,filteredAccreditations:a,hideQuotaOption:!0,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:c,renderRow:u,rendering:e.matrixRendering,selectedProfilesIds:e.selectedProfilesIds,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setRendering:e.setMatrixRendering,setSelectedProfilesIds:e.setSelectedProfilesIds,setSelectedSlotsIds:e.setSelectedSlotsIds,setShowAccreditations:e.setShowAccreditations,setShowProfiles:e.setShowProfiles,setShowQuota:Ou.A,showAccreditations:e.showAccreditations,showProfiles:e.showProfiles,showQuota:!1,slots:r,totalCount:e.totalCount})})},$Z=()=>{const{params:{eventId:e}}=fc(),{infos:n,setInfos:t}=DN(),{data:s,isLoading:o,limit:a,numberOfPages:r,offset:d,setLimit:l,setOffset:c,totalCount:u}=ah(),{data:m,isLoading:g}=rs("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfiles(usedInDelegations: true) {\n nodes {\n ...AccreditationProfileMatrix\n }\n }\n\n accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[Ko.AccreditationProfileMatrixFragment,Ko.AccreditationSlotMatrixFragment],undefined);const h=(0,de.useMemo)(()=>n.delegationsMatrixSelectedSlotsIds||[],[n]),I=(0,de.useCallback)(e=>t(n=>({...n,delegationsMatrixSelectedSlotsIds:e})),[n,t]),f=(0,de.useMemo)(()=>n.delegationsMatrixSelectedProfilesIds||[],[n]),x=(0,de.useCallback)(e=>t(n=>({...n,delegationsMatrixSelectedProfilesIds:e})),[n,t]),_=(0,de.useMemo)(()=>n.delegationsMatrixShowAccreditations??!0,[n]),j=(0,de.useCallback)(e=>t(n=>({...n,delegationsMatrixShowAccreditations:e})),[t]),v=(0,de.useMemo)(()=>n.delegationsMatrixShowProfiles??!0,[n]),S=(0,de.useCallback)(e=>t(n=>({...n,delegationsMatrixShowProfiles:e})),[t]),y=(0,de.useMemo)(()=>n.volunteersMatrixRendering||dp.Category,[n]),C=(0,de.useCallback)(e=>t(n=>({...n,volunteersMatrixRendering:e})),[n,t]);return(0,i.jsx)(wZ,{allAccreditationsProfiles:m.event?.accreditationsProfiles.nodes??p,allAccreditationsSlots:m.event?.accreditationsSlots.nodes??p,delegations:s,isLoading:o||g,limit:a,matrixRendering:y,numberOfPages:r,offset:d,selectedProfilesIds:f,selectedSlotsIds:h,setLimit:l,setMatrixRendering:C,setOffset:c,setSelectedProfilesIds:x,setSelectedSlotsIds:I,setShowAccreditations:j,setShowProfiles:S,showAccreditations:_,showProfiles:v,totalCount:u})},TZ=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=fc(),{mutate:a,isLoading:r}=Ml(),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)([]),[m,g,h]=Dg(""),{delegationsOptions:p,isLoading:I}=oC({organizationId:n,level:kn.Organization,hasSelected:f(c),delegationsIds:c,nameDebounced:g}),[x,_]=(0,de.useState)(!0),j=!d||f(c),[v,S]=(0,de.useState)(!1);return(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"user-group",subtitle:s("ajoutez_une_d_l_54234"),children:s("cr_ation_d_une_07120")}),(0,i.jsxs)(Gf,{children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:s("que_souhaitez_v_87607")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(NR,{state:d?"unchecked":"checked",onClick:()=>l(!1),children:s("cr_er_une_nouve_45377")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(NR,{state:d?"checked":"unchecked",onClick:()=>l(!0),children:s("cr_er_une_d_l_g_37657")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(lg,{isSearchLoading:I,isSearchVisible:!0,label:s("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:s("rechercher_une_31213"),state:"search",value:m,onChange:h}),values:c,onChange:u,children:p}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(oI,{value:x,onChange:_,children:s("je_souhaite_app_69393")})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:!j,isLoading:v||r,onClick:async()=>{let i;S(!0);try{if(d&&f(c)){const e=c[0],{organization:s}=await qd({organizationId:n,delegationId:e},{token:await fe()}),r=s.delegations.nodes[0]?.leadersIds??[];f(r)&&await a({eventId:t,usersInfosIds:r,sendVolunteerRegistrationEmail:!1}),i=o(JSON.stringify({parentId:e,applyParentSettings:x}))}e.push(Wo.CREATE_DELEGATION(n,t,i))}finally{S(!1)}},children:s("suivant_62774")})})]})},zZ=()=>{const{history:e,params:{organizationId:n,eventId:t},translate:s}=fc(),{columns:o}=ah(),{segment:a}=DN(),{data:r}=rs("# Whether the organization has delegations, which an event delegation can be created from: a count,\n# no rows. The create delegation modal searches them\nquery ParentDelegationsCount($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n totalCount\n }\n }\n}\n",{organizationId:n},[],undefined);const{mutate:d}=function(e={}){return ds("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)}(),[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(!1),g=(r.organization?.delegations.totalCount??0)>0,{checkExport:h}=Sy();return(0,i.jsxs)(gL,{children:[(0,i.jsx)(lC,{permissions:nC.DELEGATION_EDIT,children:g?(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"file-import",to:Wo.EVENT_DELEGATIONS_IMPORT(n,t),onClick:e=>vm(e.target),children:s("importer_des_d_05454")}),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(TZ,{})]}):(0,i.jsx)(TR,{menu:(0,i.jsx)(Em,{icon:"file-import",to:Wo.EVENT_DELEGATIONS_IMPORT(n,t),onClick:e=>vm(e.target),children:s("importer_des_d_05454")}),path:Wo.CREATE_DELEGATION(n,t),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(lC,{permissions:nC.DELEGATION_EDIT,children:(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"plus",onClick:()=>{c(!0)},children:s("cr_er_une_cat_g_20051")})})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"file-xls",onClick:e=>{vm(e.target),m(!0)},children:s("exporter_en_exc_51862")})})]})]}),(0,i.jsx)(nV,{isOpen:u,requestExport:async e=>{const{jobId:i}=await d({organizationId:n,eventId:t,segmentId:a.id,format:e,columns:o});h(i,n,t)},showIncludeFiles:!1,onClose:()=>{m(!1)}}),l&&(0,i.jsx)(VA,{eventId:t,organizationId:n,onClose:()=>c(!1),onSuccess:i=>{e.push(vo.DELEGATION_CATEGORY({organizationId:n,eventId:t,delegationCategoryId:i.id}))}})]})},OZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{canDelegationEdit:o,canSegmentEdit:a}=tC(),{limit:r,rendering:d}=ah(),{segment:l}=DN(),c=a&&d===cp.List,u=o&&d===cp.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zZ,{}),0===e.numberOfDelegations?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(Zr,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(Jw,{title:n("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(cU,{}),searchPlaceholder:n("rechercher_une_31213"),showActions:o,showEditColumns:c,showEditMode:u,showSearchColumns:a}),selectSegment:(0,i.jsx)(cI,{allSelectedText:n("les_1_d_l_gat_04594",l.count,l.name),pageSelectedText:n("les_1_d_l_gat_27248",r),selectAllText:n("s_lectionner_le_71777",l.count,l.name)})}),d===cp.AccreditationsMatrix?(0,i.jsx)($Z,{}):(0,i.jsx)(GU,{customFields:e.customFields,eventId:s,organizationId:t})]})]})},RZ={level:kn.Event},DZ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=Ly(),{canDelegationEdit:c}=tC(),u=ss(vp),m=(0,de.useMemo)(()=>u.getDelegationsFilters(e.event.organizationId,o,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,o]),g=(0,de.useMemo)(()=>u.getDelegationsPossibleColumns(o,e.organization.customFields.nodes),[o,e.organization]);return(0,i.jsx)(qL,{eventId:o,getEditPath:e=>bs(vo.DELEGATION({organizationId:s,eventId:o,delegationId:e})),getShowPath:e=>vo.DELEGATION({organizationId:s,eventId:o,delegationId:e}),organizationId:s,children:(0,i.jsx)(JN,{canSegmentEdit:r(nC.SEGMENT_EDIT),columnsToIncludes:jp,eventId:o,filters:m,filtersButtonText:t("filtrer_les_d_l_04628"),filtersSubtitle:t("appliquer_des_f_65318"),getSegmentPath:e=>Wo.DELEGATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:d?.delegationsLimit??jg,initialSegmentsOpen:d?.areDelegationsSegmentsOpen??!0,loadDataList:Zd,loadDataListParams:RZ,loadRow:Kd,organizationId:s,possibleColumns:g,possibleRenderings:[cp.List,cp.AccreditationsMatrix],reload:e.reload,segmentId:a,segmentType:lt.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({delegationsLimit:e})},showMassActions:c,showRowDropdown:c,showRowEdit:c,onSegmentClick:e=>{l({delegationsSegmentId:e})},onSegmentDelete:async()=>{await l({delegationsSegmentId:null}),n.replace(vo.DELEGATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(OZ,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},MZ=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s},localEvent:o}=Ly();fm(`${s} ${t("d_l_gations_78318")}`);const{data:a,loader:r,reload:d}=rs("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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:n},[Ko.SegmentCustomFieldFragment,Ko.SegmentsFoldersSegmentsFragment],undefined);const l=(0,de.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(DZ,{event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.DELEGATIONS_SEGMENT(e,n,o?.delegationsSegmentId&&l.includes(o.delegationsSegmentId)?o.delegationsSegmentId:l[0]),replace:!0})})]})},PZ=()=>{const{hasFeature:e}=Yy();return e(In.Delegation)?(0,i.jsx)(MZ,{}):(0,i.jsx)(Xl,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(Pv,{icon:"people-group"})})};var kZ;let FZ=class extends ju{constructor(e){super(e)}delegationsSpaceLayoutTabInputDefault(){return{name:this.t("tab_sans_nom_50048"),description:"",slug:"",canDelete:!0,isVisible:!0,isPinned:!1,segmentType:lt.Volunteers,rendering:gp.List,infos:{matrixShowAccreditations:!0,matrixShowProfiles:!0}}}defaultDashboardTab(){return{name:this.t("tableau_de_bord_24627"),description:"",slug:Ss.DASHBOARD,canDelete:!1,isVisible:!0,isPinned:!0,segmentType:lt.Volunteers,rendering:gp.List,infos:{}}}defaultDocumentsTab(){return{name:this.t("Documents"),description:"",slug:Ss.DOCUMENTS,canDelete:!1,isVisible:!0,isPinned:!1,segmentType:lt.Volunteers,rendering:gp.List,infos:{}}}tabInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),description:Jl.Yj(),slug:Jl.Yj().required(this.t("l_url_est_requi_99475")).test("is-valid-slug",this.t("le_slug_ne_doit_10047"),e=>E(e)===e),canDelete:Jl.zM().required(),isVisible:Jl.zM().required(),isPinned:Jl.zM().required(),segmentType:Jl.Yj().oneOf([lt.Accreditations,lt.Volunteers],this.t("le_type_de_vue_62720")).required(this.t("le_type_de_vue_62720")),rendering:Jl.Yj().required(this.t("le_type_de_visu_51393"))})}};FZ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(kZ=void 0!==ts&&ts)?kZ:Object])],FZ);var NZ,LZ;let UZ=class extends ju{tabInput;constructor(e,n){super(e),this.tabInput=n}delegationSpaceLayoutInputDefault(e){return{name:e?.name??"",tabs:e?.tabs??[this.tabInput.defaultDashboardTab(),this.tabInput.defaultDocumentsTab()]}}delegationSpaceLayoutInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_du_layou_34851")),tabs:Jl.YO().of(this.tabInput.tabInputSchema())})}createUpdateDelegationSpaceLayout(){return Jl.Ik().shape({delegationsSpaceLayout:this.delegationSpaceLayoutInputSchema()})}};UZ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(NZ=void 0!==ts&&ts)?NZ:Object,"function"==typeof(LZ=void 0!==FZ&&FZ)?LZ:Object])],UZ);const VZ=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!0),{slug:o,canDelete:a,isVisible:r,isPinned:d,segmentType:l,rendering:c}=e.delegationsSpaceLayoutTab,u=(0,de.useMemo)(()=>l===lt.Volunteers?[gp.AccreditationsMatrix,gp.List]:[lp.Table,lp.WeeklyCalendar],[l]),m=(0,de.useMemo)(()=>e.customFields.filter(e=>e.fieldType===_n.Select&&!e.canSelectMultiple).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id)),[e.customFields]),g=(0,de.useCallback)(n=>{Uc(n),e.form.change(`${e.prefix}isVisible`,!r)},[r,e.form,e.prefix]),h=(0,de.useMemo)(()=>t&&r,[t,r]),I=a,x=a,_=a&&l===lt.Volunteers&&c===gp.List,j=a&&l===lt.Volunteers&&c===gp.AccreditationsMatrix,v=j,S=j,y=S&&f(e.accreditationsProfilesOptions),C=a&&(!S||!1!==e.delegationsSpaceLayoutTab.infos?.matrixShowAccreditations),b=y&&!1!==e.delegationsSpaceLayoutTab.infos?.matrixShowProfiles,A=a&&l===lt.Accreditations&&c===lp.Table&&f(e.delegationsSpaceLayoutTab.infos?.accreditationsSlotsIds),w=o===Ss.DOCUMENTS;return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",padding:"$3 $4"},gap:"2",onClick:()=>s(!h),children:[(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(pc,{icon:h?"chevron-down":"chevron-right"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textSm semiBold",children:e.delegationsSpaceLayoutTab.name}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",disabled:e.isDownDisabled,leftIcon:"chevron-down",size:"sm",onClick:n=>{Uc(n),e.moveDown(e.index)}})}),(0,i.jsx)(ux,{placement:"top",children:n("d_placer_vers_l_52432")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",disabled:e.isUpDisabled,leftIcon:"chevron-up",size:"sm",onClick:n=>{Uc(n),e.moveUp(e.index)}})}),(0,i.jsx)(ux,{placement:"top",children:n("d_placer_vers_l_49863")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:d?"thumbtack":"thumbtack-slash",size:"sm",onClick:n=>{Uc(n),e.onPin(e.index)}})}),(0,i.jsx)(ux,{placement:"top",children:n("arriver_sur_ce_15500")})]}),a?(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onDelete})}),(0,i.jsx)(ux,{placement:"top",children:n("supprimer_le_ta_78990")})]}):(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:r?"eye":"eye-slash",size:"sm",onClick:g})}),(0,i.jsx)(ux,{placement:"top",children:n(r?"cacher_le_tab_97084":"afficher_le_tab_00199")})]})]})]}),h&&(0,i.jsx)(Xl,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:(0,i.jsxs)(Xl,{css:{background:"white",bd:"gray200 2 xs",padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(ud,{name:`${e.prefix}name`,onChange:n=>{e.delegationsSpaceLayoutTab.canDelete&&!1===e.form.getFieldState(`${e.prefix}slug`).touched&&e.form.change(`${e.prefix}slug`,E(n))}}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:n("nom_du_tab_91688"),name:`${e.prefix}name`}),(0,i.jsx)(pu,{disabled:!a,label:n("url_72719"),name:`${e.prefix}slug`})]}),I&&(0,i.jsxs)(Qy,{label:n("type_de_vue_13048"),name:`${e.prefix}segmentType`,children:[(0,i.jsx)("option",{value:lt.Volunteers,children:n("membres_11310")}),(0,i.jsx)("option",{value:lt.Accreditations,children:n("accr_ditations_39450")})]}),x&&(0,i.jsx)(Kx,{label:n("type_de_visuali_85493"),name:`${e.prefix}rendering`,children:u.map(e=>(0,i.jsx)("option",{value:e,children:pp(n,e)},e))}),_&&(0,i.jsx)(NA,{change:e.form.change,columns:e.delegationsSpaceLayoutTab.infos?.columns??p,customFields:e.customFields,prefix:`${e.prefix}infos.`}),S&&(0,i.jsx)(Jx,{name:`${e.prefix}infos.matrixShowAccreditations`,children:n("afficher_les_ac_56952")}),C&&(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:(0,i.jsx)($S,{children:n("filtrer_pour_ce_14760")}),multiple:!0,name:`${e.prefix}infos.accreditationsSlotsIds`,children:e.accreditationsSlotsOptions}),y&&(0,i.jsx)(Jx,{name:`${e.prefix}infos.matrixShowProfiles`,children:n("afficher_les_pr_66300")}),b&&(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:(0,i.jsx)($S,{children:n("profils_d_accr_27825")}),multiple:!0,name:`${e.prefix}infos.accreditationsProfilesIds`,children:e.accreditationsProfilesOptions}),j&&(0,i.jsxs)(Qy,{label:(0,i.jsx)($S,{children:n("grouper_les_acc_40252")}),name:`${e.prefix}infos.matrixRendering`,children:[(0,i.jsx)("option",{value:dp.Category,children:n("cat_gorie_00291")}),(0,i.jsx)("option",{value:dp.Date,children:n("Date")})]}),v&&(0,i.jsx)(Jx,{name:`${e.prefix}infos.matrixShowQuota`,children:n("afficher_les_qu_20761")}),A&&(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("champ_personnal_96124"),name:`${e.prefix}infos.customFieldSlug`,children:m}),w&&(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("liste_des_docum_18767"),multiple:!0,name:`${e.prefix}infos.customDocumentsSlugs`,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})},BZ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(FZ),a=(0,de.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegationsSpaceLayout.name):n("cr_ation_d_un_l_62705"),[e.initialValues,e.isEdit]),r=(0,de.useCallback)(n=>{e.form.change("delegationsSpaceLayout.tabs",S(e.delegationsSpaceLayout.tabs,n,n+1))},[e.delegationsSpaceLayout,e.form]),d=(0,de.useCallback)(n=>{e.form.change("delegationsSpaceLayout.tabs",S(e.delegationsSpaceLayout.tabs,n,n-1))},[e.delegationsSpaceLayout,e.form]),l=(0,de.useCallback)(n=>{e.form.change("delegationsSpaceLayout.tabs",e.delegationsSpaceLayout.tabs.map((e,t)=>({...e,isPinned:t===n})))},[e.delegationsSpaceLayout.tabs,e.form]);return fm(a),(0,i.jsx)(Nx,{button:e.isEdit?(0,i.jsx)(yc,{isLoading:e.submitting,onClick:e.handleSubmit,children:n("mettre_jour_l_99541")}):null,category:a,color:"dark",fallbackClosePath:lO.DELEGATIONS_SPACE_LAYOUTS({organizationId:t,eventId:s}),heading:e.isEdit?e.initialValues.delegationsSpaceLayout.name:n("nouveau_layout_19257"),children:(0,i.jsxs)(kx,{ref:e.centeredContainerRef,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:n("informations_su_00505"),children:(0,i.jsx)(Xl,{direction:"column",gap:"6",width:1,children:(0,i.jsx)(pu,{label:n("nom_du_layout_81794"),name:"delegationsSpaceLayout.name"})})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:n("DelegationsSpaceLayout"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[e.delegationsSpaceLayout.tabs.map((n,t)=>(0,i.jsx)(VZ,{accreditationsProfilesOptions:e.accreditationsProfilesOptions,accreditationsSlotsOptions:e.accreditationsSlotsOptions,customDocuments:e.customDocuments,customFields:e.customFields,delegationsSpaceLayoutTab:n,form:e.form,index:t,isDownDisabled:t===e.delegationsSpaceLayout.tabs.length-1,isUpDisabled:0===t,moveDown:r,moveUp:d,prefix:`delegationsSpaceLayout.tabs[${t}].`,onDelete:()=>(n=>{e.form.change("delegationsSpaceLayout.tabs",y(e.delegationsSpaceLayout.tabs,n))})(t),onPin:l},t)),(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.form.change("delegationsSpaceLayout.tabs",[...e.delegationsSpaceLayout.tabs,o.delegationsSpaceLayoutTabInputDefault()])},children:n("ajouter_un_tab_01565")})]})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:e.submitting,textAlign:"center",onClick:e.handleSubmit,children:e.isEdit?n("mettre_jour_l_99541"):n("cr_er_le_layout_39460")})})]})})},WZ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{showNotification:a}=Sy(),r=ss(Wg),d=ss(ec),l=ss(UZ),c=(0,de.useRef)(null),u=(0,de.useMemo)(()=>Yp(r,e.accreditationsCategories),[e.accreditationsCategories]),m=(0,de.useMemo)(()=>bT(e.accreditationsProfiles),[e.accreditationsProfiles]);return(0,i.jsx)(Fc,{customErrorRef:c,height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:({form:n,handleSubmit:t,submitting:s,values:o})=>(0,i.jsx)(BZ,{accreditationsProfilesOptions:m,accreditationsSlotsOptions:u,centeredContainerRef:c,customDocuments:e.customDocuments,customFields:e.customFields,delegationsSpaceLayout:o.delegationsSpaceLayout,form:n,handleSubmit:t,initialValues:e.initialValues,isEdit:e.isEdit,submitting:s}),validate:d.validateForForm(l.createUpdateDelegationSpaceLayout()),width:1,onSubmit:async i=>{await e.mutate({eventId:o,delegationsSpaceLayout:i.delegationsSpaceLayout}),a(t("le_layout_a_t_59662")),n.goBack(lO.DELEGATIONS_SPACE_LAYOUTS({organizationId:s,eventId:o}))}})},GZ=()=>{const{params:{organizationId:e,eventId:n}}=fc(),t=ss(UZ),{data:s,loader:o}=rs("query DelegationsSpaceLayoutEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Public) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n date\n name\n }\n }\n }\n\n customDocuments {\n slug\n name\n }\n }\n}\n",{organizationId:e,eventId:n},[Ko.SegmentCustomFieldFragment],undefined);const{mutate:a}=function(e={}){return ds("mutation DelegationsSpaceLayoutCreate(\n $eventId: EventId!\n $delegationsSpaceLayout : DelegationsSpaceLayoutInput!\n)\n{\n delegationsSpaceLayoutCreate(eventId: $eventId, delegationsSpaceLayout: $delegationsSpaceLayout) {\n id\n }\n}\n",e)}(),r=(0,de.useMemo)(()=>s.event?{delegationsSpaceLayout:t.delegationSpaceLayoutInputDefault()}:{},[s]);return o||(0,i.jsx)(WZ,{accreditationsCategories:s.event.accreditationsCategories,accreditationsProfiles:s.event.accreditationsProfiles.nodes,customDocuments:s.event.customDocuments,customFields:s.organization.customFields.nodes,initialValues:r,isEdit:!1,mutate:a})},qZ=()=>{const{params:{organizationId:e,eventId:n,delegationsSpaceLayoutId:t}}=fc(),s=ss(UZ),{data:o,loader:a}=rs("query DelegationsSpaceLayoutToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, variety: UserInfo, privacy: Public) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n id\n name\n\n accreditationProfileCategory {\n id\n name\n }\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n date\n name\n }\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n delegationsSpaceLayout(id: $delegationsSpaceLayoutId) {\n name\n\n tabs {\n name\n description\n slug\n canDelete\n isVisible\n isPinned\n segmentType\n rendering\n infos\n }\n }\n }\n}\n",{organizationId:e,eventId:n,delegationsSpaceLayoutId:t},[Ko.SegmentCustomFieldFragment],undefined);const{mutate:r}=function(e={}){return ds("mutation DelegationsSpaceLayoutUpdate(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n $delegationsSpaceLayout: DelegationsSpaceLayoutInput!\n) {\n delegationsSpaceLayoutUpdate(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n delegationsSpaceLayout: $delegationsSpaceLayout\n ) {\n id\n }\n}\n",e)}(),d=(0,de.useMemo)(()=>o.event?{delegationsSpaceLayout:s.delegationSpaceLayoutInputDefault(o.event.delegationsSpaceLayout)}:{},[o]);return a||(0,i.jsx)(WZ,{accreditationsCategories:o.event.accreditationsCategories,accreditationsProfiles:o.event.accreditationsProfiles.nodes,customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,initialValues:d,isEdit:!0,mutate:async e=>r({...e,delegationsSpaceLayoutId:t})})};var HZ;let YZ=class extends ju{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault(),shouldRegenerateTicketIdOnDownload:e?.shouldRegenerateTicketIdOnDownload??!1}}customDocumentInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),slug:Jl.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:a_["96dpi"].height,pages:[this.getPageDefault()],width:a_["96dpi"].width}}getPageDefault(){return{id:ce(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[],segmentsIds:[]}}getContainerElementDefault(e,n,t){return{type:"container",id:e,inContainer:!!n,inGrid:"grid"===n?.type,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",t+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,segmentsIds:[],top:0,width:100,zIndex:1}}getGridElementDefault(e,n,t){return{type:"grid",id:e,inContainer:!!n,inGrid:"grid"===n?.type,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,columnGap:0,columns:2,conditionsCustomFields:[],elements:[],hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("grille_1_66496",t+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,rowGap:0,rows:2,segmentsIds:[],top:0,width:100,zIndex:1}}getImageElementDefault(e,n,t){return{type:"image",id:e,inContainer:!!n,inGrid:"grid"===n?.type,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",t+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,segmentsIds:[],top:0,width:100,zIndex:1}}getTextElementDefault(e,n,t){return{type:"text",id:e,inContainer:!!n,inGrid:"grid"===n?.type,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",t+1),text:"",color:"#1d2939",fontFamily:"Open Sans",fontSize:14,fontWeight:400,justify:"start",lineHeight:1.4,positionsSlotsIds:[],px:0,py:0,rotateDegree:0,segmentsIds:[],textTransform:"none",top:0,width:100,zIndex:1}}};YZ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(HZ=void 0!==ts&&ts)?HZ:Object])],YZ);const ZZ={Code39:"{user.code39}",Picture:"{user.picture}",QrCode:"{user.qrcode}",Skidata:"{user.skidata}"};function KZ(e){return Object.values(ZZ).includes(e)}function XZ(e){return`{user.${e}}`}function QZ(e){return KZ(e)&&e!==ZZ.Picture?null:e?.match(/^\{user\.([^{}\s]+)\}$/)?.[1]??null}function JZ(e){return"container"===e.type||"grid"===e.type}function eK(e){const n=e=>e.flatMap(e=>JZ(e)?[e].concat(n(e.elements)):[e]);return e.configuration.pages.flatMap(e=>n(e.elements))}function nK(e,n){const t=(e,i,s)=>{for(const o of i){if(o.id===n)return{ancestors:s,element:o,page:e};if(JZ(o)){const n=t(e,o.elements,[...s,o]);if(n)return n}}return null};for(const n of e.pages){const e=t(n,n.elements,[]);if(e)return e}return null}const tK=(e,n)=>e<=1?e*n:e;function iK(e,n,t){let i=n,s=t,o=n,a=t,r=null;for(const n of[...e.ancestors,e.element])"grid"===r?.type?(o=(i-r.columnGap*(r.columns-1))/r.columns,a=(s-r.rowGap*(r.rows-1))/r.rows):(o=tK(n.width,i),a=tK(n.height,s)),JZ(n)&&(i=o-2*((n.px||0)+n.borderSize),s=a-2*((n.py||0)+n.borderSize),r=n);return{height:Math.max(Math.round(a),2),width:Math.max(Math.round(o),2)}}function sK(e,n,t){return e.toSpliced(Math.min(Math.max(n,0),e.length),0,t)}function oK(e,n){return e.filter(e=>e.id!==n).map(e=>JZ(e)?{...e,elements:oK(e.elements,n)}:e)}function aK(e,n,t,i){return e.map(e=>JZ(e)?e.id===n?{...e,elements:sK(e.elements,t,i)}:{...e,elements:aK(e.elements,n,t,i)}:e)}function rK(e,n,t){const i=nK(e,n),s=e.pages.find(e=>e.id===t.pageId),o=t.parentId?nK(e,t.parentId):null,a=o?.element??null;if(!i||!s||t.parentId&&(!a||!JZ(a)||o.page.id!==t.pageId||a.id===n||o.ancestors.some(e=>e.id===n)))return e;let r={...i.element,inContainer:!!a,inGrid:"grid"===a?.type};return!a&&f(i.ancestors)&&(r={...r,...iK(i,e.width,e.height),left:i.ancestors[0].left,top:i.ancestors[0].top}),{...e,pages:e.pages.map(e=>{if(e.id!==i.page.id&&e.id!==t.pageId)return e;let s=e.id===i.page.id?oK(e.elements,n):e.elements;return e.id===t.pageId&&(s=a?aK(s,a.id,t.index,r):sK(s,t.index,r)),{...e,elements:s}})}}function dK(e,n,t){const i={...e,id:n,name:t};if(JZ(i)){const e=i.elements.map(e=>dK(e,ce(),e.name));return{...i,elements:e}}return i}function lK(e,n){return e===a_["96dpi"].height&&n===a_["96dpi"].width?"a4":e===r_["96dpi"].height&&n===r_["96dpi"].width?"a6":e===d_["96dpi"].height&&n===d_["96dpi"].width?"cb":"custom"}function cK(e){return e.hasConditions&&(f(e.accreditationsSlotsIds)||w(e.accreditationAcronym)||f(e.positionsSlotsIds)||f(e.segmentsIds)||f(e.conditionsCustomFields))}function uK(e,n,t,i,s,o){if(e.hasConditions){if(f(e.accreditationsSlotsIds))return f((0,tg.A)(e.accreditationsSlotsIds,n));if(w(e.accreditationAcronym)){const n=e.accreditationAcronym.split(",").map(e=>e.trim()).filter(w);return f((0,tg.A)(n,t))}return f(e.positionsSlotsIds)?f((0,tg.A)(e.positionsSlotsIds,i)):f(e.segmentsIds)?f((0,tg.A)(e.segmentsIds,s)):!f(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:n})=>"isEmpty"===n?$(o[e]?.rawValue):"isNotEmpty"===n?w(o[e]?.rawValue):"boolean"==typeof n?o[e]?.rawValue===n:!!Array.isArray(n)&&f((0,tg.A)(I(o[e]?.rawValue),n)))}return!0}const mK=(0,de.createContext)({}),gK=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),o=ss(Nh),a=ss(YZ),[r,d]=(0,de.useState)(e.initialCustomDocument),[l,c]=(0,de.useState)(null),[u,m]=(0,de.useState)(null),[g,h]=(0,de.useState)("parameters"),[p,I]=(0,de.useState)(100),[f,x]=(0,de.useState)(null),[_,j]=(0,de.useState)(null),v=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.name=e}))},[r,d]),S=(0,de.useCallback)((e,n)=>{d((0,mI.jM)(t=>{t.configuration.pages.forEach(t=>{t.id===u&&(t[e]=n)})}))},[u,d]),y=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.populationsIds=e}))},[d]),C=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.slug=E(e,{replacer:A.Empty})}))},[d]),b=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.configuration.bleed=e}))},[r,d]),$=(0,de.useCallback)((e,n)=>{d((0,mI.jM)(t=>{t.configuration.height=e,t.configuration.width=n}))},[r,d]),T=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.shouldRegenerateTicketIdOnDownload=e}))},[r,d]),z=(0,de.useCallback)(()=>{c(null),m(null)},[c,m]),O=(0,de.useCallback)(()=>eK(r).find(e=>e.id===l)||null,[r,l]),R=(0,de.useCallback)(()=>r.configuration.pages.find(e=>e.id===u)||null,[r,u]),D=(0,de.useCallback)(()=>{d((0,mI.jM)(e=>{e.configuration.pages.push(a.getPageDefault())}))},[d]),M=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.configuration.pages=n.configuration.pages.filter(n=>n.id!==e)}))},[d]),P=(0,de.useCallback)((e,n)=>{const t=ce();d((0,mI.jM)(i=>{e?eK(i).forEach(i=>{JZ(i)&&i.id===e.id&&i.elements.push(a[n](t,i,i.elements.length))}):i.configuration.pages.forEach(e=>{e.id===u&&e.elements.push(a[n](t,null,e.elements.length))})})),c(t)},[u,d,c]),k=(0,de.useCallback)(e=>{P(e,"getContainerElementDefault")},[P]),F=(0,de.useCallback)(e=>{P(e,"getGridElementDefault")},[P]),N=(0,de.useCallback)(e=>{P(e,"getImageElementDefault")},[P]),L=(0,de.useCallback)(e=>{P(e,"getTextElementDefault")},[P]),U=(0,de.useCallback)(e=>{d((0,mI.jM)(n=>{n.configuration.pages.forEach(n=>{n.elements=n.elements.filter(n=>n.id!==e)}),eK(n).forEach(n=>{JZ(n)&&(n.elements=n.elements.filter(n=>n.id!==e))})})),c(null)},[r,d,c]),V=(0,de.useCallback)(e=>{const t=ce();d((0,mI.jM)(i=>{eK(i).forEach(i=>{if(JZ(i)){const s=i.elements.find(n=>n.id===e);s&&i.elements.push(dK(s,t,n("copie_de_1_62900",s.name)))}}),i.configuration.pages.forEach(i=>{const s=i.elements.find(n=>n.id===e);s&&i.elements.push(dK(s,t,n("copie_de_1_62900",s.name)))})})),c(t)},[r,d,c]),B=(0,de.useCallback)(e=>{const t=ce();d((0,mI.jM)(i=>{const s=i.configuration.pages.find(n=>n.id===e);s&&i.configuration.pages.push(function(e,n,t){return{...e,id:n,name:t,elements:e.elements.map(e=>dK(e,ce(),e.name))}}(s,t,w(s.name)?n("copie_de_1_62900",s.name):""))}))},[]),W=(0,de.useCallback)((e,n)=>{c(e),m(n)},[r,c,m]),G=(0,de.useCallback)(e=>{m(e),c(null),h("design")},[c,m,h]),q=(0,de.useCallback)((e,n,t)=>{d((0,mI.jM)(i=>{const s=eK(i).find(n=>n.id===e);s&&(s[n]=t)}))},[r]),H=(0,de.useCallback)((e,n,t)=>{d((0,mI.jM)(i=>{const s=eK(i).find(n=>n.id===e);s&&(s.left+=n,s.top+=t)}))},[d]),Y=(0,de.useCallback)((e,n)=>{d(t=>({...t,configuration:rK(t.configuration,e,n)}))},[d]),Z=(0,de.useCallback)((e,n)=>{d((0,mI.jM)(t=>{const i=eK(t).find(n=>n.id===e);i&&Object.assign(i,n)}))},[d]),{data:K}=rs("query CustomDocumentConditions($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n\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: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{eventId:t},[],undefined);const X=(0,de.useMemo)(()=>Yp(s,K.event?.accreditationsCategories??[]),[K.event]),Q=(0,de.useMemo)(()=>Zp(o,K.event?.positionsCategories??[]),[K.event]),J=(0,de.useMemo)(()=>(K.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)),[K.event]);return(0,i.jsx)(mK.Provider,{value:{accreditationsOptions:X,addContainerElement:k,addGridElement:F,addImageElement:N,addPage:D,addTextElement:L,cleanSelecteds:z,customDocument:r,customFields:e.customFields,deleteElement:U,duplicateElement:V,duplicatePage:B,getSelectedElement:O,getSelectedPage:R,movingElementId:_,moveElement:Y,offsetElementPosition:H,population:e.population,positionsOptions:Q,removePage:M,segmentsOptions:J,selectElement:W,selectPage:G,selectedElementId:l,selectedPageId:u,setBleed:b,setDimensions:$,setElementBox:Z,setMovingElementId:j,setName:v,setPopulations:y,setShouldRegenerateTicketIdOnDownload:T,setSlug:C,setSnapGuides:x,setTab:h,setZoom:I,snapGuides:f,tab:g,updateElementProperty:q,updatePageProperty:S,zoom:p},children:e.children})};function hK(){return(0,de.useContext)(mK)}const pK=e=>{const{translate:n}=fc(),{addContainerElement:t,addGridElement:s,addImageElement:o,addTextElement:a}=hK();return(0,i.jsxs)(Xl,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{a(e.container)},children:[(0,i.jsx)(Xl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(pc,{icon:"text"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("Text")}),(0,i.jsx)(yc,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(Xl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(pc,{icon:"image"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("image_40624")}),(0,i.jsx)(yc,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{t(e.container)},children:[(0,i.jsx)(Xl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(pc,{icon:"chart-simple"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("conteneur_33078")}),(0,i.jsx)(yc,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(Xl,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(pc,{icon:"table-cells"})}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textSm medium",children:n("grille_01987")}),(0,i.jsx)(yc,{color:"white",leftIcon:"plus",size:"sm"})]})]})},IK=e=>{const{translate:n}=fc(),{accreditationsOptions:t,customFields:s,positionsOptions:o,segmentsOptions:a}=hK(),r=(0,de.useMemo)(()=>s.filter(e=>e.fieldType===_n.Checkbox||e.fieldType===_n.Select||e.fieldType===_n.Text||e.fieldType===_n.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),d=e.element.conditionsCustomFields||[],l=d.map(e=>e.slug),c=(n,t)=>{const i=(0,mI.jM)(d,e=>{e[t].value=n});e.updateProperty(e.elementId,"conditionsCustomFields",i)},u=s.filter(e=>l.includes(e.slug));return(0,i.jsx)(Vq,{css:{padding:"$4 $6"},title:n("condition_d_aff_68185"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(oI,{value:e.element.hasConditions,onChange:n=>{n||(e.updateProperty(e.elementId,"accreditationsSlotsIds",[]),e.updateProperty(e.elementId,"accreditationAcronym",""),e.updateProperty(e.elementId,"positionsSlotsIds",[]),e.updateProperty(e.elementId,"segmentsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",n)},children:n("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(Xl,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("afficher_en_fon_89756"),multiple:!0,values:e.element.accreditationsSlotsIds||p,onChange:n=>{e.updateProperty(e.elementId,"accreditationsSlotsIds",n)},children:t}),(0,i.jsx)(hu,{label:n("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:n=>{e.updateProperty(e.elementId,"accreditationAcronym",n)}}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("afficher_en_fon_19925"),multiple:!0,values:e.element.positionsSlotsIds||p,onChange:n=>{e.updateProperty(e.elementId,"positionsSlotsIds",n)},children:o}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("afficher_si_le_05366"),multiple:!0,values:e.element.segmentsIds||p,onChange:n=>{e.updateProperty(e.elementId,"segmentsIds",n)},children:a}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("afficher_en_fon_56078"),multiple:!0,values:l,onChange:n=>{const t=(0,Wm.A)(n,l),i=s.filter(e=>t.includes(e.slug)),o=(0,Wm.A)(l,n),a=d.filter(e=>!o.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===_n.Checkbox||e.fieldType===_n.Validation||(e.fieldType===_n.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",a)},children:r}),u.map((e,t)=>e.fieldType===_n.Checkbox||e.fieldType===_n.Validation?(0,i.jsxs)(nf,{label:n("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:d[t].value,onChange:e=>{c(e,t)},children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]},e.id):e.fieldType===_n.Text?(0,i.jsxs)(nf,{label:n("afficher_si_la_42654",e.name),value:d[t].value,onChange:e=>{c(e,t)},children:[(0,i.jsx)("option",{value:"isEmpty",children:n("est_vide_96759")}),(0,i.jsx)("option",{value:"isNotEmpty",children:n("n_est_pas_vide_45804")})]},e.id):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("afficher_si_la_42654",e.name),multiple:!0,values:d[t].value||p,onChange:e=>{c(e,t)},children:e.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))},e.id))]})]})})},fK=e=>{const{translate:n}=fc(),{updateElementProperty:t}=hK();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vq,{css:{padding:"$4 $6"},title:n("apparence_75510"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[!e.element.inGrid&&(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:n("largeur_54184"),rightText:e.element.width<=1?"%":"px",shouldParseAsInt:!0,value:e.element.width,onChange:n=>{e.element.isRatioLocked&&t(e.element.id,"height",Math.round(e.element.height*n/e.element.width)),t(e.element.id,"width",n)}}),(0,i.jsx)(hu,{label:n("hauteur_56576"),rightText:e.element.height<=1?"%":"px",shouldParseAsInt:!0,value:e.element.height,onChange:n=>{e.element.isRatioLocked&&t(e.element.id,"width",Math.round(e.element.width*n/e.element.height)),t(e.element.id,"height",n)}}),(0,i.jsx)(Zr,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:e.element.isRatioLocked?"primary":"white",leftIcon:e.element.isRatioLocked?"lock-keyhole":"lock-keyhole-open",onClick:()=>{t(e.element.id,"isRatioLocked",!e.element.isRatioLocked)}})}),(0,i.jsx)(ux,{placement:"top",children:e.element.isRatioLocked?n("ne_pas_pr_serve_68003"):n("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:n=>{t(e.element.id,"left",n)}}),(0,i.jsx)(hu,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:n=>{t(e.element.id,"top",n)}})]}),!e.element.inContainer&&(0,i.jsx)(hu,{hint:n("la_position_z_d_29473"),label:n("position_z_du_c_46647"),shouldParseAsInt:!0,value:e.element.zIndex,onChange:n=>{t(e.element.id,"zIndex",n)}}),("image"===e.element.type||"text"===e.element.type)&&!e.element.inContainer&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{value:e.element.hasRotate,onChange:n=>{t(e.element.id,"hasRotate",n)},children:n("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(hu,{label:n("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:n=>{t(e.element.id,"rotateDegree",n)}})]}),("container"===e.element.type||"grid"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{value:e.element.hasBackground,onChange:n=>{t(e.element.id,"hasBackground",n)},children:n("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(Bb,{label:n("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:n=>{t(e.element.id,"backgroundColor",n)}})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:n("taille_de_la_bo_84060"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderSize,onChange:n=>{t(e.element.id,"borderSize",n)}}),(0,i.jsx)(Bb,{label:n("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:n=>{t(e.element.id,"borderColor",n)}})]}),(0,i.jsx)(hu,{label:n("rayon_de_la_bor_26070"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderRadius,onChange:n=>{t(e.element.id,"borderRadius",n)}}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:n("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:n=>{t(e.element.id,"px",n)}}),(0,i.jsx)(hu,{label:n("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:n=>{t(e.element.id,"py",n)}})]})]})}),(0,i.jsx)(IK,{element:e.element,elementId:e.element.id,updateProperty:t})]})},xK=e=>{const{translate:n}=fc(),{getSelectedPage:t,selectPage:s,updateElementProperty:o}=hK();return(0,i.jsxs)(Xl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Xl,{css:{padding:"$2 $6"},children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(t().id)},children:n("retour_92202")})}),(0,i.jsxs)(Vq,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:[(0,i.jsx)(hu,{label:n("nom_08311"),value:e.container.name,onChange:n=>{o(e.container.id,"name",n)}}),(0,i.jsx)(pK,{container:e.container})]}),(0,i.jsxs)(Vq,{css:{padding:"$4 $6"},title:n("conteneur_33078"),children:[(0,i.jsxs)(nf,{label:n("direction_39738"),value:e.container.direction,onChange:n=>{o(e.container.id,"direction",n)},children:[(0,i.jsx)("option",{value:"column",children:n("de_haut_en_bas_72752")}),(0,i.jsx)("option",{value:"row",children:n("de_gauche_dro_21330")})]}),(0,i.jsx)(hu,{label:n("_cart_entre_les_62547"),rightText:"px",shouldParseAsInt:!0,value:e.container.gap,onChange:n=>{o(e.container.id,"gap",n)}}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("alignement_54247")}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsxs)(Xl,{children:[(0,i.jsx)(yc,{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)(yc,{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)(yc,{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)(Xl,{children:[(0,i.jsx)(yc,{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)(yc,{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)(yc,{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)(fK,{element:e.container})]})},_K=()=>{const{translate:e}=fc(),{getSelectedPage:n,updatePageProperty:t}=hK(),s=n();return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsxs)(Vq,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(hu,{label:e("nom_de_la_page_82146"),value:s.name||"",onChange:e=>{t("name",e)}}),(0,i.jsx)(pK,{container:null})]}),(0,i.jsx)(IK,{element:s,elementId:s.id,updateProperty:(e,n,i)=>{t(n,i)}})]})},jK=()=>{const{translate:e}=fc(),{getSelectedPage:n}=hK();return n()?(0,i.jsx)(_K,{}):(0,i.jsx)(Xl,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(Xl,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(Xl,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(pc,{icon:"hand-pointer"})}),(0,i.jsx)(Zr,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},vK=e=>{const{translate:n}=fc(),{getSelectedPage:t,selectPage:s,updateElementProperty:o}=hK();return(0,i.jsxs)(Xl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Xl,{css:{padding:"$2 $6"},children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(t().id)},children:n("retour_92202")})}),(0,i.jsxs)(Vq,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:[(0,i.jsx)(hu,{label:n("nom_08311"),value:e.grid.name,onChange:n=>{o(e.grid.id,"name",n)}}),(0,i.jsx)(pK,{container:e.grid})]}),(0,i.jsxs)(Vq,{css:{padding:"$4 $6"},title:n("grille_01987"),children:[(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:n("colonnes_73889"),shouldParseAsInt:!0,value:e.grid.columns,onChange:n=>{o(e.grid.id,"columns",Math.max(1,n))}}),(0,i.jsx)(hu,{label:n("lignes_66458"),shouldParseAsInt:!0,value:e.grid.rows,onChange:n=>{o(e.grid.id,"rows",Math.max(1,n))}})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:n("_cart_entre_les_90779"),rightText:"px",shouldParseAsInt:!0,value:e.grid.columnGap,onChange:n=>{o(e.grid.id,"columnGap",n)}}),(0,i.jsx)(hu,{label:n("_cart_entre_les_05132"),rightText:"px",shouldParseAsInt:!0,value:e.grid.rowGap,onChange:n=>{o(e.grid.id,"rowGap",n)}})]})]}),(0,i.jsx)(fK,{element:e.grid})]})},SK=e=>{const{translate:n,params:{organizationId:t}}=fc(),{hasFeature:s}=Yy(),{customFields:o,getSelectedPage:a,selectPage:r,updateElementProperty:d}=hK(),l=(0,de.useMemo)(()=>o.filter(e=>e.fieldType===_n.File&&e.fileType===vn.Picture&&XZ(e.slug)!==ZZ.Picture),[o]),c=QZ(e.image.source),u=KZ(e.image.source)||l.some(e=>e.slug===c)?e.image.source:"custom";return(0,i.jsxs)(Xl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Xl,{css:{padding:"$2 $6"},children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{r(a().id)},children:n("retour_92202")})}),(0,i.jsxs)(Vq,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:[(0,i.jsx)(hu,{label:n("nom_08311"),value:e.image.name,onChange:n=>{d(e.image.id,"name",n)}}),(0,i.jsxs)(nf,{label:n("source_16397"),value:u,onChange:n=>{d(e.image.id,"source","custom"===n?"":n)},children:[(0,i.jsx)("option",{value:ZZ.Picture,children:n("photo_de_profil_08618")}),l.map(e=>(0,i.jsx)("option",{value:XZ(e.slug),children:e.name},e.slug)),(0,i.jsx)("option",{value:ZZ.QrCode,children:n("qr_code_du_bill_78196")}),(0,i.jsx)("option",{value:ZZ.Code39,children:n("code_barres_du_74438")}),(s(In.Skidata)||u===ZZ.Skidata)&&(0,i.jsx)("option",{value:ZZ.Skidata,children:n("qr_code_skidata_53182")}),(0,i.jsx)("option",{value:"custom",children:n("fichier_ou_lien_26488")})]}),"custom"===u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(wS,{accept:Jv.SmallImages,acl:"public-read",label:n("File"),organizationId:t,value:null,onChange:n=>{if(n){const t=`https://${ee.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${n.key}`;d(e.image.id,"source",t)}}}),(0,i.jsx)(hu,{label:n("lien_de_l_image_40053"),placeholder:"https://",value:e.image.source||"",onChange:n=>{d(e.image.id,"source",n)}})]}),(0,i.jsx)(hu,{label:n("lien_68557"),value:e.image.link||"",onChange:n=>{d(e.image.id,"link",n)}})]}),(0,i.jsx)(fK,{element:e.image})]})},yK=()=>{const{translate:e}=fc(),{customDocument:n,population:t,setBleed:s,setDimensions:o,setName:a,setPopulations:r,setShouldRegenerateTicketIdOnDownload:d,setSlug:l}=hK(),c=n.configuration.height,u=n.configuration.width,m=lK(c,u),g=(0,de.useMemo)(()=>(0,Tg.A)(t.values,e=>e.value.toLowerCase()),[t]);return(0,i.jsxs)(Xl,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(hu,{label:e("nom_du_document_73868"),value:n.name,onChange:a}),(0,i.jsxs)(nf,{label:e("format_du_docum_28991"),value:m,onChange:e=>{"a4"===e?o(a_["96dpi"].height,a_["96dpi"].width):"a6"===e?o(r_["96dpi"].height,r_["96dpi"].width):"cb"===e?o(d_["96dpi"].height,d_["96dpi"].width):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"===m&&(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{hint:`${ed(n.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:n.configuration.width,onChange:e=>{o(c,e)}}),(0,i.jsx)(hu,{hint:`${ed(n.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:n.configuration.height,onChange:e=>{o(e,u)}})]}),n.configuration.bleed&&(0,i.jsx)(Zm,{state:n.configuration.bleed?"checked":"unchecked",onClick:e=>{s("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(hu,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:n.slug,onChange:l}),(0,i.jsx)(lg,{isSearchVisible:!0,label:e("lier_ce_documen_79055"),multiple:!0,values:n.populationsIds,onChange:r,children:g.map(e=>(0,i.jsx)("option",{value:e.id,children:e.value},e.id))}),(0,i.jsx)(Zm,{state:n.shouldRegenerateTicketIdOnDownload?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:e("r_g_n_rer_le_co_99491")})]})},CK=(0,Tg.A)(["Arial","Georgia"].concat(["Anton","Archivo","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Big Shoulders","Bricolage Grotesque","Bungee","Chivo","Cossette Texte","Cossette Titre","Fira Sans","Fraunces","Google Sans Flex","IBM Plex Sans","Inter","Jost","Kumbh Sans","Lato","League Gothic","Lexend Deca","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Plus Jakarta Sans","Poppins","Prompt","Raleway","Righteous","Roboto","Rubik","Saira","Ubuntu","Unbounded"]));function bK(){return(0,de.useMemo)(()=>CK.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const AK=e=>{const{translate:n}=fc(),{getSelectedPage:t,selectPage:s,updateElementProperty:o}=hK(),a=bK(),r=ny(["user","userRegistration","userDelegation","userDocuments","event","organization","delegation","assignments","accreditations"],{delegationsCustomFields:!1,eventsCustomFields:!1}),d=e.text.lineHeight||1.4,l=(0,Zy.A)(e.text.fontSize*d,2);return(0,i.jsxs)(Xl,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Xl,{css:{padding:"$2 $6"},children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(t().id)},children:n("retour_92202")})}),(0,i.jsx)(Vq,{css:{padding:"$4 $6"},title:n("initialisation_38640"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(hu,{label:n("nom_du_calque_77484"),value:e.text.name,onChange:n=>{o(e.text.id,"name",n)}}),(0,i.jsx)(Xx,{label:n("contenu_29668"),value:e.text.text,variables:r,onChange:n=>{o(e.text.id,"text",n)}})]})}),(0,i.jsx)(Vq,{css:{padding:"$4 $6"},title:n("typographie_11343"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:n=>{o(e.text.id,"fontFamily",n[0]||"Open Sans")},children:a}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(hu,{label:n("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:n=>{o(e.text.id,"fontSize",n)}}),(0,i.jsx)(Gx,{hint:n("soit_1_px_73099",l),label:n("hauteur_de_lign_08120"),value:d,onChange:n=>{o(e.text.id,"lineHeight",n)}})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Bb,{label:n("couleur_du_text_32021"),value:e.text.color,onChange:n=>{o(e.text.id,"color",n)}}),(0,i.jsxs)(nf,{label:n("graisse_de_la_p_41139"),shouldParseAsInt:!0,value:e.text.fontWeight,onChange:n=>{o(e.text.id,"fontWeight",n)},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)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("alignement_54247")}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsxs)(Xl,{children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"start"===e.text.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{o(e.text.id,"justify","start")}})}),(0,i.jsx)(ux,{placement:"top",children:n("aligner_gauch_04681")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"center"===e.text.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{o(e.text.id,"justify","center")}})}),(0,i.jsx)(ux,{placement:"top",children:n("centrer_39779")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"end"===e.text.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{o(e.text.id,"justify","end")}})}),(0,i.jsx)(ux,{placement:"top",children:n("aligner_droit_73883")})]})]}),(0,i.jsxs)(Xl,{children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"start"===e.text.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{o(e.text.id,"align","start")}})}),(0,i.jsx)(ux,{placement:"top",children:n("aligner_en_haut_69916")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"center"===e.text.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{o(e.text.id,"align","center")}})}),(0,i.jsx)(ux,{placement:"top",children:n("centrer_39779")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"end"===e.text.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{o(e.text.id,"align","end")}})}),(0,i.jsx)(ux,{placement:"top",children:n("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)(nf,{label:n("transformation_09363"),value:e.text.textTransform,onChange:n=>{o(e.text.id,"textTransform",n)},children:[(0,i.jsx)("option",{value:"none",children:n("aucune_76773")}),(0,i.jsx)("option",{value:"capitalize",children:n("capitaliser_76627")}),(0,i.jsx)("option",{value:"uppercase",children:n("majuscules_64521")}),(0,i.jsx)("option",{value:"lowercase",children:n("minuscules_02420")})]})]})}),(0,i.jsx)(fK,{element:e.text})]})},EK=()=>{const{translate:e}=fc(),{getSelectedElement:n,tab:t,setTab:s}=hK(),o=n();return"container"===o?.type?(0,i.jsx)(xK,{container:o}):"grid"===o?.type?(0,i.jsx)(vK,{grid:o}):"image"===o?.type?(0,i.jsx)(SK,{image:o}):"text"===o?.type?(0,i.jsx)(AK,{text:o}):(0,i.jsxs)(Xl,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(Xl,{css:{px:"$4"},children:(0,i.jsxs)(RS,{selectedItem:t,onChange:s,children:[(0,i.jsx)(DS,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(DS,{item:"design",children:e("design_15043")})]})}),"parameters"===t&&(0,i.jsx)(yK,{}),"design"===t&&(0,i.jsx)(jK,{})]})},wK=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(Zr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),$K={x:null,y:null},TK=(e,n)=>e<=1?e*n:e;function zK(e,n,t){return{height:TK(e.height,t),left:e.left,top:e.top,width:TK(e.width,n)}}function OK(e,n,t,i){const s=[{height:i,left:0,top:0,width:t}].concat(e.filter(e=>e.id!==n&&!e.hasRotate).map(e=>zK(e,t,i)));return{x:s.flatMap(e=>[e.left,e.left+e.width/2,e.left+e.width]),y:s.flatMap(e=>[e.top,e.top+e.height/2,e.top+e.height])}}function RK(e,n){let t=$K;return i=>{i.x===t.x&&i.y===t.y||(t=i,n(null===i.x&&null===i.y?null:{...i,pageId:e}))}}function DK(e,n,t){let i=null;return n.forEach(n=>{Math.abs(n-e)<=t&&(null===i||Math.abs(n-e){const n=DK(e,t,i);null!==n&&(null===s.guide||Math.abs(n-e){const r=e.clientX-i,d=e.clientY-s;a||!o&&Math.hypot(r,d){m(),o&&(a||t.onEnd(),function(){const e=e=>{e.stopPropagation()};window.addEventListener("click",e,{capture:!0,once:!0}),setTimeout(()=>{window.removeEventListener("click",e,{capture:!0})},0)}())},l=()=>{o&&!a&&(a=!0,t.onCancel())},c=e=>{"Escape"===e.key&&l()},u=()=>{l(),d()},m=()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",u),document.removeEventListener("keydown",c)};return window.addEventListener("pointermove",r),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",u),document.addEventListener("keydown",c),m}function kK(e,n){const{customDocument:t,offsetElementPosition:i,selectElement:s,setMovingElementId:o,setSnapGuides:a,zoom:r}=hK(),[d,l]=(0,de.useState)(null),c=(0,de.useRef)(null);(0,de.useEffect)(()=>()=>{c.current?.()},[]);const u=(0,de.useCallback)(d=>{if(e.inContainer||0!==d.button)return;const u=r/100,{height:m,pages:g,width:h}=t.configuration,p=g.find(e=>e.id===n)?.elements??[],I=zK(e,h,m),f=OK(p,e.id,h,m),x=RK(n,a);let _={left:0,top:0},j=!1;const v=()=>{j&&(j=!1,x($K),o(null))};c.current?.();const S=PK(d,3,{onStart:()=>{j=!0,s(e.id,n),o(e.id)},onMove:(n,t,i)=>{let s=e.left+n/u,o=e.top+t/u;if(i.altKey||e.hasRotate)x($K);else{const e=function(e,n,t){const i=MK(e.left,e.width,n.x,t),s=MK(e.top,e.height,n.y,t);return{guides:{x:i.guide,y:s.guide},left:e.left+i.delta,top:e.top+s.delta}}({...I,left:s,top:o},f,5/u);s=e.left,o=e.top,x(e.guides)}_={left:Math.round(s)-e.left,top:Math.round(o)-e.top},l(_)},onEnd:()=>{i(e.id,_.left,_.top),l(null),v()},onCancel:()=>{l(null),v()}});c.current=()=>{S(),v()}},[t,e,i,n,s,o,a,r]);return{cursor:e.inContainer?void 0:d?"grabbing":"move",left:e.left+(d?.left??0),onPointerDown:u,top:e.top+(d?.top??0)}}const FK=e=>{const{selectedElementId:n,selectElement:t}=hK(),s=kK(e.container,e.pageId);return(0,i.jsx)(Xl,{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",cursor:s.cursor,gap:`${e.container.gap}px`,left:`${s.left}px`,outline:n===e.container.id?"2px solid $primary500":"",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:`${s.top}px`,touchAction:e.container.inContainer?void 0:"none",zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.inGrid?1:e.container.height,justify:e.container.justify,width:e.container.inGrid?1:e.container.width,wrap:"wrap",onClick:n=>{Uc(n),t(e.container.id,e.pageId)},onPointerDown:s.onPointerDown,children:e.container.elements.map(n=>(0,i.jsx)(VK,{element:n,pageId:e.pageId},n.id))})},NK=e=>{const{selectedElementId:n,selectElement:t}=hK(),s=kK(e.grid,e.pageId);return(0,i.jsx)(Zr,{css:{backgroundColor:e.grid.hasBackground?e.grid.backgroundColor:"none",border:e.grid.borderSize>0?`${e.grid.borderSize}px solid ${e.grid.borderColor}`:"",borderRadius:e.grid.borderRadius>0?`${e.grid.borderRadius}px`:"0",columnGap:`${e.grid.columnGap}px`,cursor:s.cursor,display:"grid",gridTemplateColumns:`repeat(${e.grid.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${e.grid.rows}, minmax(0, 1fr))`,left:`${s.left}px`,outline:n===e.grid.id?"2px solid $primary500":"",overflow:"hidden",paddingBottom:`${e.grid.py||0}px`,paddingLeft:`${e.grid.px||0}px`,paddingRight:`${e.grid.px||0}px`,paddingTop:`${e.grid.py||0}px`,position:e.grid.inContainer?"static":"absolute",rowGap:`${e.grid.rowGap}px`,top:`${s.top}px`,touchAction:e.grid.inContainer?void 0:"none",zIndex:e.grid.zIndex},height:e.grid.inGrid?1:e.grid.height,width:e.grid.inGrid?1:e.grid.width,onClick:n=>{Uc(n),t(e.grid.id,e.pageId)},onPointerDown:s.onPointerDown,children:e.grid.elements.map(n=>(0,i.jsx)(VK,{element:n,pageId:e.pageId},n.id))})},LK=e=>{const{selectedElementId:n,selectElement:t}=hK(),s=kK(e.image,e.pageId);return(0,i.jsx)(Zr,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",cursor:s.cursor,left:`${s.left}px`,outline:n===e.image.id?"2px solid $primary500":"",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:`${s.top}px`,touchAction:e.image.inContainer?void 0:"none",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.inGrid?1:e.image.height,width:e.image.inGrid?1:e.image.width,onClick:n=>{Uc(n),t(e.image.id,e.pageId)},onPointerDown:s.onPointerDown,children:w(e.image.source)&&(0,i.jsx)("img",{draggable:!1,height:"100%",src:(o=e.image.source,QZ(o)?`${ee.HEAVENT_ASSETS_URL}/badges/profile.jpg`:o===ZZ.QrCode||o===ZZ.Skidata?bx(`https://${ee.WEEZEVENT_DOMAIN}`,{height:360,width:360}):o===ZZ.Code39?bx("12345678",{barcodeType:Cx.Code39,height:28,width:234}):o),width:"100%"})});var o},UK=e=>{const{selectedElementId:n,selectElement:t}=hK(),s=kK(e.text,e.pageId),o=FP(e.text.text);return(0,i.jsx)(Xl,{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,cursor:s.cursor,left:`${s.left}px`,lineHeight:e.text.lineHeight||1.4,outline:n===e.text.id?"2px solid $primary500":"",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:`${s.top}px`,touchAction:e.text.inContainer?void 0:"none",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:o},height:e.text.inGrid?1:e.text.height,justify:e.text.justify,width:e.text.inGrid?1:e.text.width,onClick:n=>{Uc(n),t(e.text.id,e.pageId)},onPointerDown:s.onPointerDown})},VK=e=>"container"===e.element.type?(0,i.jsx)(FK,{container:e.element,pageId:e.pageId}):"grid"===e.element.type?(0,i.jsx)(NK,{grid:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(LK,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(UK,{pageId:e.pageId,text:e.element}):null,BK=[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:1,y:0},{x:1,y:1},{x:0,y:1},{x:-1,y:1},{x:-1,y:0}],WK=1e4,GK=e=>0===e.x?"ns-resize":0===e.y?"ew-resize":e.x===e.y?"nwse-resize":"nesw-resize",qK=e=>{const{customDocument:n,setElementBox:t,setSnapGuides:s,zoom:o}=hK(),a=(0,de.useRef)(null),r=o/100,{height:d,pages:l,width:c}=n.configuration,u=zK(e.element,c,d),m=8/r;(0,de.useEffect)(()=>()=>{a.current?.()},[]);const g=n=>i=>{if(0!==i.button)return;const o=e.element,m=(0,Qr.A)(o,["height","left","top","width"]),g=OK(l.find(n=>n.id===e.pageId)?.elements??[],o.id,c,d),h=RK(e.pageId,s);a.current?.();const p=PK(i,0,{onMove:(e,i,s)=>{const a=function(e,n,t,i,s){const o=s.isRatioLocked&&e.width>0&&e.height>0,a=0!==n.x,r=0!==n.y&&(!o||0===n.x),d={...$K};let l=e.width+n.x*t,c=e.height+n.y*i;if(s.snapTargets){if(a){const t=1===n.x?e.left+l:e.left+e.width-l,i=DK(t,s.snapTargets.x,s.snapThreshold);null!==i&&(l+=n.x*(i-t),d.x=i)}if(r){const t=1===n.y?e.top+c:e.top+e.height-c,i=DK(t,s.snapTargets.y,s.snapThreshold);null!==i&&(c+=n.y*(i-t),d.y=i)}}if(o){const t=e.width/e.height;0!==n.x?c=l/t:l=c*t;const i=Math.max(1,10/l,10/c);l*=i,c*=i}else l=Math.max(10,l),c=Math.max(10,c);l=Math.round(l),c=Math.round(c);const u=-1===n.x?e.left+e.width-l:e.left,m=-1===n.y?e.top+e.height-c:e.top,g=-1===n.x?u:u+l,h=-1===n.y?m:m+c;return{box:{height:c,left:u,top:m,width:l},guides:{x:null!==d.x&&Math.abs(g-d.x)<=.5?d.x:null,y:null!==d.y&&Math.abs(h-d.y)<=.5?d.y:null}}}(u,n,e/r,i/r,{isRatioLocked:o.isRatioLocked||s.shiftKey,snapTargets:s.altKey?null:g,snapThreshold:5/r});t(o.id,a.box),h(a.guides)},onEnd:()=>{h($K)},onCancel:()=>{t(o.id,m),h($K)}});a.current=()=>{p(),h($K)}};return(0,i.jsx)(Zr,{css:{height:`${u.height}px`,left:`${u.left}px`,pointerEvents:"none",position:"absolute",top:`${u.top}px`,width:`${u.width}px`,zIndex:WK},children:BK.map(e=>(0,i.jsx)(Zr,{css:{background:"white",border:1/r+"px solid $primary500",cursor:GK(e),height:`${m}px`,left:`calc(${50*(e.x+1)}% - ${m/2}px)`,pointerEvents:"auto",position:"absolute",top:`calc(${50*(e.y+1)}% - ${m/2}px)`,touchAction:"none",width:`${m}px`},"data-testid":`resize-handle-${e.x}-${e.y}`,onClick:Uc,onPointerDown:g(e)},`${e.x},${e.y}`))})},HK=e=>{const{translate:n}=fc(),{customDocument:t,addPage:s,movingElementId:o,removePage:a,selectedElementId:r,selectedPageId:d,selectPage:l,snapGuides:c}=hK(),u=c?.pageId===e.page.id?c:null,m=e.page.elements.find(e=>e.id===r&&!e.hasRotate&&e.id!==o),g=t.configuration.pages.length>1,h=t.configuration.bleed?19:0;return(0,i.jsxs)(Xl,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(Xl,{align:"center",children:[(0,i.jsx)(Zr,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:n=>{Uc(n),l(e.page.id)},children:w(e.page.name)?e.page.name:n("page_1_33637",e.index+1)}),(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(yc,{color:"white",leftIcon:"plus",size:"sm",onClick:s}),(0,i.jsx)(yc,{color:"white",disabled:!g,leftIcon:"trash-can",size:"sm",onClick:()=>{a(e.page.id)}})]})]}),(0,i.jsxs)(Xl,{css:{background:"white",padding:`${h}px`,position:"relative"},height:2*h+t.configuration.height,width:2*h+t.configuration.width,children:[t.configuration.bleed&&(0,i.jsx)(wK,{}),(0,i.jsxs)(Xl,{css:{background:"white",outline:d===e.page.id?"2px solid $primary500":"",position:"relative",userSelect:"none"},height:t.configuration.height,width:t.configuration.width,onClick:n=>{Uc(n),l(e.page.id)},children:[e.page.elements.map(n=>(0,i.jsx)(VK,{element:n,pageId:e.page.id},n.id)),m&&(0,i.jsx)(qK,{element:m,pageId:e.page.id}),"number"==typeof u?.x&&(0,i.jsx)(Zr,{css:{background:"$primary500",left:`${u.x}px`,pointerEvents:"none",position:"absolute",top:0,zIndex:WK},height:1,width:"1px"}),"number"==typeof u?.y&&(0,i.jsx)(Zr,{css:{background:"$primary500",left:0,pointerEvents:"none",position:"absolute",top:`${u.y}px`,zIndex:WK},height:"1px",width:1})]})]})]})},YK={ArrowDown:{left:0,top:1},ArrowLeft:{left:-1,top:0},ArrowRight:{left:1,top:0},ArrowUp:{left:0,top:-1}},ZK=()=>{const{customDocument:e,cleanSelecteds:n,getSelectedElement:t,offsetElementPosition:s,setZoom:o,zoom:a}=hK();return(0,de.useEffect)(()=>{const e=e=>{const n=YK[e.key],i=t();if(n&&i&&!i.inContainer&&!((o=e.target)instanceof HTMLElement&&(o.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(o.tagName)||null!==o.closest('[aria-pressed="true"]')))){const t=e.shiftKey?10:1;e.preventDefault(),s(i.id,n.left*t,n.top*t)}var o};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t,s]),(0,i.jsxs)(Zr,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${a}%`},direction:"column",gap:"7",height:1,width:1,onClick:n,children:e.configuration.pages.map((e,n)=>(0,i.jsx)(HK,{index:n,page:e},e.id))}),(0,i.jsx)(Zr,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)(nf,{shouldParseAsInt:!0,value:a,onChange:o,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%)"})]})})]})},KK=e=>"page"===e.type?e.pageId:e.elementId;function XK(e,n){return"page"===e.type?"inside":e.canContain?n<.25?"before":n>.75?"after":"inside":n<.5?"before":"after"}function QK(e){return[e.id].concat(JZ(e)?e.elements.flatMap(QK):[])}const JK=(0,de.createContext)({activeId:null,dropTarget:null});const eX="$colors$primary500";function nX(e){const n=KK(e),{attributes:t,isDragging:i,listeners:s,setNodeRef:o}=(0,jI.PM)({data:e,disabled:"page"===e.type,id:n}),{setNodeRef:a}=(0,jI.zM)({data:e,id:n}),{dropTarget:r}=(0,de.useContext)(JK),d=(0,de.useCallback)(e=>{o(e),a(e)},[o,a]),l=r&&KK(r.row)===n?r.position:null,c="before"===l?`inset 0 2px 0 ${eX}`:"after"===l?`inset 0 -2px 0 ${eX}`:"inside"===l?`inset 0 0 0 2px ${eX}`:void 0;return{dragProps:"page"===e.type?{}:{...t,...s},dropBoxShadow:c,isDragging:i,setNodeRef:d}}const tX=e=>"container"===e.type?"column"===e.direction?"chart-simple-horizontal":"chart-simple":"grid"===e.type?"table-cells":"image"===e.type?"image":"text",iX=e=>{const{translate:n}=fc(),{deleteElement:t,duplicateElement:s,selectedElementId:o,selectElement:a}=hK(),{dragProps:r,dropBoxShadow:d,isDragging:l,setNodeRef:c}=nX({type:"element",canContain:JZ(e.element),elementId:e.element.id,pageId:e.pageId});return(0,i.jsxs)(Xl,{css:{opacity:l?.4:1},direction:"column",children:[(0,i.jsxs)(Xl,{ref:c,align:"center",css:{background:o===e.element.id?"$primary100":"none",borderRadius:"$1",boxShadow:d,color:o===e.element.id?"$primary500":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{a(e.element.id,e.pageId)},...r,children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:tX(e.element)})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Zr,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),cK(e.element)&&(0,i.jsx)(Zr,{title:n("affich_sous_co_68172"),children:(0,i.jsx)(pc,{icon:"filter"})}),(0,i.jsx)(Zr,{className:"h-duplicate",onClick:n=>{Uc(n),s(e.element.id)},children:(0,i.jsx)(pc,{icon:"copy"})}),(0,i.jsx)(Zr,{className:"h-delete",onClick:n=>{Uc(n),t(e.element.id)},children:(0,i.jsx)(pc,{icon:"trash-can"})})]}),JZ(e.element)&&(0,i.jsx)(Xl,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(n=>(0,i.jsx)(iX,{element:n,pageId:e.pageId},n.id))})]})},sX=e=>(0,i.jsxs)(Xl,{align:"center",css:{background:"$primary100",borderRadius:"$1",boxShadow:"$md",color:"$primary500",cursor:"grabbing",padding:"$2"},gap:"3",width:250,children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:tX(e.element)})}),(0,i.jsx)(Zr,{css:{ellipsis:!0,flex:"1"},fontSize:"textSm",fontWeight:"medium",children:e.element.name})]}),oX=e=>{const{translate:n}=fc(),{duplicatePage:t,selectedPageId:s,selectPage:o}=hK(),a=w(e.page.name)?e.page.name:n("page_1_33637",e.index+1),{dropBoxShadow:r,setNodeRef:d}=nX({type:"page",pageId:e.page.id});return(0,i.jsx)(Vq,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(Xl,{ref:d,align:"center",css:{background:s===e.page.id?"$primary100":"",borderRadius:"$1",boxShadow:r,color:s===e.page.id?"$primary500":"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary100",color:"$primary500","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:n=>{Uc(n),o(e.page.id)},children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"frame"})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:a}),cK(e.page)&&(0,i.jsx)(Zr,{title:n("affich_sous_co_68172"),children:(0,i.jsx)(pc,{icon:"filter"})}),(0,i.jsx)(Zr,{className:"h-duplicate",onClick:n=>{Uc(n),t(e.page.id)},children:(0,i.jsx)(pc,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(Xl,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(n=>(0,i.jsx)(iX,{element:n,pageId:e.page.id},n.id))})})},aX=()=>{const{customDocument:e}=hK(),{activeId:n,dndContextProps:t,dropTarget:s}=function(){const{customDocument:e,moveElement:n,selectedElementId:t,selectElement:i}=hK(),s=(0,jI.FR)((0,jI.MS)(jI.AN,{activationConstraint:{distance:4}}),(0,jI.MS)(jI.uN)),[o,a]=(0,de.useState)(null),[r,d]=(0,de.useState)(null),l=(0,de.useRef)(null),c=(0,de.useRef)(new Set),u=(0,de.useCallback)(e=>{const n=e=>e?`${KK(e.row)}-${e.position}`:null;n(l.current)!==n(e)&&(l.current=e,d(e))},[]),m=(0,de.useCallback)(()=>{c.current=new Set,a(null),u(null)},[u]),g=(0,de.useCallback)(e=>{const n=e.droppableContainers.filter(e=>!c.current.has(e.id));return e.pointerCoordinates?(0,jI.TT)({...e,droppableContainers:n}):(0,jI.fp)({...e,droppableContainers:n})},[]),h=(0,de.useCallback)(({active:n})=>{const t=nK(e.configuration,n.id);c.current=new Set(t?QK(t.element):[]),a(n.id)},[e]),p=(0,de.useCallback)(e=>{const n=(t=e.over,t?.data.current);var t;const i=function(e){const n=e.activatorEvent;if("number"==typeof n.clientY)return n.clientY+e.delta.y;{const n=e.active.rect.current.translated;return n?n.top+n.height/2:null}}(e);if(e.over&&n&&null!==i){const{height:t,top:s}=e.over.rect;u({position:XK(n,(i-s)/t),row:n})}else u(null)},[u]),I=(0,de.useCallback)(({active:s})=>{const o=s.id,a=l.current?function(e,n,t){const{position:i,row:s}=t,o=e=>e.filter(e=>e.id!==n);if("page"===s.type)return{index:0,pageId:s.pageId,parentId:null};const a=nK(e,s.elementId);if(!a)return null;const{ancestors:r,element:d,page:l}=a;if(JZ(d)){if("inside"===i)return{index:o(d.elements).length,pageId:l.id,parentId:d.id};if("after"===i&&o(d.elements).length>0)return{index:0,pageId:l.id,parentId:d.id}}const c=r.at(-1);return{index:o(c?c.elements:l.elements).findIndex(e=>e.id===d.id)+("after"===i?1:0),pageId:l.id,parentId:c?.id??null}}(e.configuration,o,l.current):null;m(),a&&(n(o,a),o===t&&i(o,a.pageId))},[e,n,m,t,i]);return{activeId:o,dndContextProps:{collisionDetection:g,sensors:s,onDragCancel:m,onDragEnd:I,onDragMove:p,onDragOver:p,onDragStart:h},dropTarget:r}}(),o=n?nK(e.configuration,n)?.element:null;return(0,i.jsxs)(jI.Mp,{...t,children:[(0,i.jsx)(JK.Provider,{value:{activeId:n,dropTarget:s},children:(0,i.jsx)(Xl,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,n)=>(0,i.jsx)(oX,{index:n,page:e},e.id))})}),(0,i.jsx)(jI.Hd,{dropAnimation:null,children:o&&(0,i.jsx)(sX,{element:o})})]})},rX=()=>{const{history:e,params:{organizationId:n,eventId:t,customDocumentId:s},translate:o}=fc(),{mutate:a,isLoading:r}=function(e={}){return ds("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:d}=hK(),l=(0,de.useMemo)(()=>JSON.stringify(d),[r]),[c,u]=(0,de.useState)(!1),m=(0,de.useCallback)(()=>{JSON.stringify(d)===l?e.goBack(QD.DOCUMENTS({organizationId:n,eventId:t})):u(!0)},[d,l]);return fm(o("mise_jour_de_17055",d.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{isLoading:r,onClick:async()=>{await a({eventId:t,customDocumentId:s,customDocument:d})},children:o("enregistrer_06519")}),category:o("document_person_69340"),color:"dark",heading:d.name,onClose:m,children:(0,i.jsxs)(Xl,{height:1,width:1,children:[(0,i.jsx)(Zr,{height:1,width:420,children:(0,i.jsx)(EK,{})}),(0,i.jsx)(Zr,{css:{flex:"1"},height:1,children:(0,i.jsx)(ZK,{})}),(0,i.jsx)(Zr,{height:1,width:340,children:(0,i.jsx)(aX,{})})]})}),(0,i.jsx)(ER,{fallbackPath:QD.DOCUMENTS({organizationId:n,eventId:t}),isOpen:c,onClose:()=>u(!1)})]})},dX=()=>{const{history:e,params:{organizationId:n,eventId:t,customDocumentId:s}}=fc(),{data:o,loader:a}=rs('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(\n eventId: $eventId\n variety: UserInfo\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\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 shouldRegenerateTicketIdOnDownload\n }\n }\n}\n',{organizationId:n,eventId:t,customDocumentId:s},[Ko.ConditionCustomFieldFragment],undefined);const r=ss(YZ);return a||o.event?.customDocument||e.replace(QD.DOCUMENTS({organizationId:n,eventId:t})),a||(0,i.jsx)(gK,{customFields:o.organization.customFields.nodes,initialCustomDocument:r.customDocumentInputDefault(o.event.customDocument),population:o.organization.population,children:(0,i.jsx)(rX,{})})},lX=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{mutate:a}=function(e={}){return ds("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n id\n }\n}\n",e)}(),r=ss(YZ),[d,l]=(0,de.useState)(""),[c,u]=(0,de.useState)(""),[m,g]=(0,de.useState)(!1),h=(0,de.useCallback)(e=>{l(e),m||u(E(e,{replacer:A.Empty}))},[m,l,u]),p=(0,de.useCallback)(e=>{w(e)?(u(E(e,{replacer:A.Empty})),g(!0)):(u(""),g(!1))},[u,g]);return(0,i.jsxs)(Yf,{isOpen:e.isOpen,children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(yc,{children:t("cr_er_un_docume_92512")})}),(0,i.jsxs)(Hf,{children:[(0,i.jsx)(qf,{icon:"file",children:t("nouveau_documen_36722")}),(0,i.jsxs)(Gf,{gap:"5",children:[(0,i.jsx)(hu,{label:t("nom_du_document_22604"),value:d,onChange:h}),(0,i.jsx)(hu,{hint:t("ne_doit_conteni_53122"),label:t("nom_de_la_varia_81999"),value:c,onChange:p})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{onClick:async()=>{const{customDocumentCreate:e}=await a({eventId:o,customDocument:{name:d,slug:c,populationsIds:[],configuration:r.getConfigurationDefault(),shouldRegenerateTicketIdOnDownload:!1}});n.push(QD.EDIT_CUSTOM_DOCUMENT({organizationId:s,eventId:o,customDocumentId:e.id}))},children:t("cr_er_le_docume_02657")})})]})]})},cX=e=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(Xl,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),uX=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{showNotification:a}=Sy(),{mutate:r}=function(e={}){return ds("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),{mutate:d}=function(e={}){return ds("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),[l,c]=(0,de.useState)(!1),u=lK(e.customDocument.configuration.height,e.customDocument.configuration.width),m=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(pc,{icon:"pen-ruler"})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(Ug,{css:{fontSize:"$textMd"},to:QD.USER_CUSTOM_DOCUMENT({organizationId:s,eventId:o,userInfoId:e.userInfoId,customDocumentId:e.customDocument.id}),children:e.customDocument.name}),(0,i.jsx)(Zr,{color:"gray500",children:t("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:t("populations_48141")}),(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:m,width:1,children:w(m)?m:"-"})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:t("format_54368")}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:"custom"===u?t("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(lC,{permissions:nC.DOCUMENT_EDIT,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{n.push(QD.EDIT_CUSTOM_DOCUMENT({organizationId:s,eventId:o,customDocumentId:e.customDocument.id}))}})}),(0,i.jsx)(ux,{placement:"top",children:t("_diter_62574")})]})}),(0,i.jsx)(lC,{permissions:nC.DOCUMENT_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{await r({eventId:o,customDocumentId:e.customDocument.id}),e.reload()},children:t("dupliquer_28256")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:t("supprimer_43083")})})]})]})})]}),l&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_81333"),text:t("suppression_de_73669",e.customDocument.name),onClose:()=>{c(!1)},onDelete:async()=>{await d({eventId:o,customDocumentId:e.customDocument.id}),a(t("le_document_1_14516",e.customDocument.name)),e.reload()}})]})},mX=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>(0,Tg.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]),s=(0,de.useMemo)(()=>Object.values((0,l.A)(t,e=>e.slug)).some(e=>e.length>1),[t]);return(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("plusieurs_docum_09566")}),(0,i.jsx)(Oc,{children:n("lorsque_plusieu_27447")})]}),(0,i.jsx)(cX,{title:n("documents_perso_87374"),children:t.map(n=>(0,i.jsx)(uX,{customDocument:n,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},n.id))})]})},gX=e=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{background:Lr.colors[`${e.color}100`],borderRadius:"$3",color:Lr.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(pc,{icon:e.icon})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(Ug,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(Lm,{color:"warning",size:"sm",children:n("le_document_n_e_47973")})]}),(0,i.jsx)(Zr,{color:"gray500",children:n("cr_par_1_69201","WeezCrew")})]}),w(e.variable)&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:e.count})]})]})},hX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc();return(0,i.jsx)(cX,{title:n("accr_ditations_39450"),children:(0,i.jsx)(gX,{color:"blueGray",count:e.numberOfAccreditationsSlots,disabled:0===e.numberOfAccreditationsSlots,icon:"list-ul",path:QD.ASO_PAX_MANIFEST({organizationId:t,eventId:s,accreditationSlotId:e.accreditationSlotId}),text:n("nombre_de_cr_ne_40593"),title:"PAX Manifest"})})},pX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc();return(0,i.jsx)(cX,{title:n("d_l_gations_78318"),children:(0,i.jsx)(gX,{color:"blueGray",count:e.numberOfDelegations,disabled:0===e.numberOfDelegations,icon:"sitemap",path:QD.DELEGATION_CALENDAR({organizationId:t,eventId:s,delegationId:e.delegationId}),text:n("nombre_de_d_l_g_45708"),title:n("planning_des_ac_44426")})})},IX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{event:o}=Ly();return(0,i.jsxs)(cX,{title:n("_v_nement_22345"),children:[(0,i.jsx)(gX,{color:"pink",icon:"list-ul",path:QD.USERS_LISTING({organizationId:t,eventId:s,segmentId:e.volunteersSegmentId}),text:n("nombre_de_membr_87049"),title:n("liste_des_membr_89037")}),o.usePositions&&(0,i.jsx)(gX,{color:"purple",icon:"calendar-day",path:QD.POSITIONS_VOLUNTEERS_PLANNING({organizationId:t,eventId:s,segmentId:e.positionsSegmentId}),text:n("nombre_de_missi_56719"),title:n("planning_d_un_g_23684")}),o.usePositions&&(0,i.jsx)(gX,{color:"purple",icon:"calendar-day",path:QD.POSITIONS_PLANNING({organizationId:t,eventId:s,segmentId:e.positionsSegmentId}),text:n("nombre_de_missi_56719"),title:n("planning_de_l_96909")}),(0,i.jsx)(gX,{color:"purple",icon:"image",path:QD.USERS_PICTURES({organizationId:t,eventId:s,segmentId:e.volunteersSegmentId}),text:"",title:n("trombinoscope_11316")})]})},fX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{organization:o}=Yy();return(0,i.jsxs)(cX,{title:n("membres_11310"),children:[(0,i.jsx)(gX,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:QD.USER_ASSIGNMENTS({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(gX,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:QD.USER_PLANNING({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserPlanning"),variable:"planning"}),(0,i.jsx)(gX,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:QD.USER_PLANNING_LIST({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(gX,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:QD.USER_PLANNING_DAYS({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(gX,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:QD.USER_CERTIFICATE({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("Certificate"),variable:"certificate"}),(0,i.jsx)(gX,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:QD.USER_BADGE({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId,badgeType:"generic"}),text:n("nombre_de_membr_87049"),title:n("BadgeCheck"),variable:"badge"}),(0,i.jsx)(gX,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:QD.USER_HOURS({organizationId:t,eventId:s,userInfoId:e.assignedUserInfoId}),text:n("nombre_de_membr_87049"),title:n("UserHours"),variable:"hours"}),o.customBadges.map(o=>(0,i.jsx)(gX,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:QD.USER_BADGE({organizationId:t,eventId:s,userInfoId:e.userInfoId,badgeType:o}),text:n("nombre_de_membr_87049"),title:fj(o),variable:o.toLowerCase()},o))]})},xX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc();return(0,i.jsxs)(cX,{title:n("missions_63972"),children:[(0,i.jsx)(gX,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:QD.POSITION_SHEET({organizationId:t,eventId:s,positionId:e.positionId}),text:n("nombre_de_fiche_03009"),title:n("fiche_de_missio_00324")}),(0,i.jsx)(gX,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:QD.POSITION_PLANNING({organizationId:t,eventId:s,positionId:e.positionId}),text:n("nombre_de_missi_56719"),title:n("planning_d_une_64581")})]})},_X=e=>{const{params:{organizationId:n}}=fc(),{hasFeature:t}=Yy(),{event:s}=Ly(),o=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[t(In.CustomDocument)&&f(e.event.customDocuments)&&(0,i.jsx)(mX,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:o}),s.usePositions&&(0,i.jsx)(fX,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:o}),s.usePositions&&(0,i.jsx)(xX,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),Sp(n)&&(0,i.jsx)(hX,{accreditationSlotId:e.event.accreditationsSlots.nodes[0]?.id??-1,numberOfAccreditationsSlots:e.event.accreditationsSlots.totalCount}),s.useDelegations&&(0,i.jsx)(pX,{delegationId:e.event.delegations.nodes[0]?.id??-1,numberOfDelegations:e.event.delegations.totalCount}),(0,i.jsx)(IX,{positionsSegmentId:e.event.positionSegment.id,volunteersSegmentId:e.event.volunteerSegment.id})]})},jX=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(Vm,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(Vm,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(Vm,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(Vm,{borderRadius:"$2",height:74,width:1})]})]}),vX=e=>{const{translate:n,params:{eventId:t}}=fc(),{hasFeature:s}=Yy(),{event:{name:o}}=Ly(),{canDocumentEdit:a}=tC();fm(`${o} ${n("Documents")}`);const{data:r,isLoading:d,reload:l}=rs('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 accreditationsSlots(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n delegations(limit: 1) {\n nodes {\n id\n }\n\n totalCount\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 volunteerSegment: segment(segmentType: Volunteers) {\n id\n }\n\n positionSegment: segment(segmentType: Positions) {\n id\n }\n }\n}\n',{eventId:t},[],undefined);return(0,i.jsxs)(AC,{children:[(0,i.jsxs)(bC,{gap:"3",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray900 displayXs semiBold",children:n("Documents")}),(0,i.jsx)(Zr,{color:"gray500",children:n("retrouver_et_pe_99652")})]}),s(In.CustomDocument)&&a&&(0,i.jsx)(lX,{isOpen:e.isCreateOpen})]}),(0,i.jsx)(yC,{children:s(In.Documents)?d?(0,i.jsx)(jX,{}):(0,i.jsx)(_X,{event:r.event,reload:l}):(0,i.jsx)(Xl,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(Pv,{icon:"folders"})})})]})},SX=e=>{const n=e.asoPaxManifest.event.accreditationSlot,t=n.accreditation,[s,o]=n.name.split("-"),a=n.date?.toFormat("dd/MM/yyyy")??"";return(0,i.jsxs)(Xl,{css:{background:"white",color:"black",fontSize:"12px",pageBreakBefore:"always",padding:"32px 68px"},direction:"column",height:a_["96dpi"].height,width:a_["96dpi"].width,children:[(0,i.jsx)(Zr,{textAlign:"center",width:1,children:"PAX MANIFEST"}),(0,i.jsx)(ic,{height:"9"}),(0,i.jsxs)(Xl,{align:"center",css:{background:"black",color:"white",fontSize:"20px"},height:38,justify:"center",width:1,children:[t.name," - ",a]}),(0,i.jsxs)(Xl,{css:{padding:"24px 36px 28px 36px"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{width:1,children:[(0,i.jsx)(Zr,{css:{fontWeight:"700"},width:142,children:"Aircraft Type :"}),(0,i.jsx)(Zr,{width:140,children:"<>"}),(0,i.jsx)(Zr,{css:{fontWeight:"700"},width:132,children:"Flight number :"}),(0,i.jsx)(Zr,{children:"<>"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{width:1,children:[(0,i.jsx)(Zr,{css:{fontWeight:"700"},width:142,children:"Departure Airport :"}),(0,i.jsx)(Zr,{width:140,children:s}),(0,i.jsx)(Zr,{width:140,children:a}),(0,i.jsx)(Zr,{css:{flex:"1"},textAlign:"end",children:"<>"})]}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{width:1,children:[(0,i.jsx)(Zr,{css:{fontWeight:"700"},width:142,children:"Arrival Airport :"}),(0,i.jsx)(Zr,{width:140,children:o}),(0,i.jsx)(Zr,{width:140,children:a}),(0,i.jsx)(Zr,{css:{flex:"1"},textAlign:"end",children:"<>"})]})]}),(0,i.jsx)(Zr,{css:{background:"black"},height:7,width:1}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsxs)(Xl,{css:{border:"1px solid black"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"black",color:"white",fontWeight:"700"},height:40,width:1,children:[(0,i.jsx)(Zr,{css:{px:"$1"},width:35,children:"N°"}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:"Last name"}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:"First name"}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:"Passport number"}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:"Passport expire date"}),(0,i.jsx)(Zr,{css:{px:"$1"},width:85,children:"Nationality"})]}),n.volunteersRegistrations.map((e,n)=>{const t=Jo.c9.fromISO(e.userInfo.fields?.cf54609?.rawValue),s=Jo.c9.isDateTime(t)&&t.isValid?t.toFormat("dd/MM/yyyy"):"";return(0,i.jsxs)(Xl,{align:"center",css:{background:n%2==0?"#d9d9d9":"white",borderTop:0===n?"none":"1px solid black"},height:20,width:1,children:[(0,i.jsx)(Zr,{css:{px:"$1"},width:35,children:n+1}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.lastName?.value?.toUpperCase()}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.firstName?.value}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:e.userInfo.fields?.cf54607?.value}),(0,i.jsx)(Zr,{css:{flex:"1",px:"$1"},children:s}),(0,i.jsx)(Zr,{css:{px:"$1"},width:85,children:e.userInfo.fields?.nationality?.rawValue})]},e.id)})]}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsxs)(Xl,{css:{paddingRight:"48px"},gap:"9",justify:"end",width:1,children:[(0,i.jsx)(Zr,{children:"Passengers"}),(0,i.jsx)(Zr,{children:`${n.volunteersRegistrations.length}/${n.maxResources}`})]})]})},yX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{user:o}=ps(),{checkDocumentsExport:a}=Sy(),[r,d]=(0,de.useState)([e.segmentsFolders[0].segments[0].id]),[l,c]=(0,de.useState)(e.languages[0]),[u,m]=(0,de.useState)(Jo.c9.invalid("Invalid")),[g,h]=(0,de.useState)(sn.OnePerPage),[p,I]=(0,de.useState)(!1),f=(0,de.useMemo)(()=>e.showStrategy&&!e.badgeType,[e.badgeType,e.showStrategy]);return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(Xl,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary500",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(pc,{icon:"envelope"})})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",dangerouslySetInnerHTML:{__html:n("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Tc,{alertStyle:"gray",children:(0,i.jsx)(Oc,{children:n("l_e_mail_peut_m_13253")})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("vue_s_personna_35768"),multiple:!0,placeholder:n("s_lectionnez_un_53633"),values:r,onChange:d,children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))},e.id))}),e.languages.length>1&&(0,i.jsx)(nf,{label:n("Language"),placeholder:n("Language"),value:l,onChange:e=>{c(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(df,{label:n("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:u,onChange:m}),f&&(0,i.jsx)(nf,{label:n("strat_gie_44389"),value:g,onChange:e=>h(e),children:oi.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(Zm,{state:p?"checked":"unchecked",onClick:e=>{I("checked"===e)},children:n("fusionner_les_d_64130")}),(0,i.jsx)(hu,{label:n("Email"),state:"disabled",value:o?.email??"",onChange:Ou.A})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{isLoading:e.isSendLoading,onClick:async()=>{const n=await e.onSend(r,l,p,g,u.isValid?u:void 0);a(n,t,s),e.onClose()},children:n("envoyer_26609")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},CX=e=>{const n=os(),{mutate:t,isLoading:s}=Qa(),[o,a]=(0,de.useState)(!1);return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:QD.DOCUMENTS({organizationId:e.organizationId,eventId:e.eventId}),children:n("Documents")}),(0,i.jsx)(gO,{isCurrent:!0,children:e.title})]}),buttons:(0,i.jsxs)(i.Fragment,{children:[e.extraButton,(0,i.jsx)(lC,{permissions:nC.DOCUMENT_READ,children:(0,i.jsx)(yc,{isLoading:s,onClick:()=>a(!0),children:n("param_trer_l_ex_83342")})}),o&&(0,i.jsx)(yX,{badgeType:e.badgeType,endAt:e.endAt,isSendLoading:s,languages:e.languages,segmentsFolders:e.segmentsFolders,showDate:e.showDate,showStrategy:e.showStrategy,startAt:e.startAt,title:n("envoi_de_vos_do_32953"),onClose:()=>a(!1),onSend:async(n,i,s,o,a)=>{const{jobId:r}=await t({organizationId:e.organizationId,eventId:e.eventId,documentsExport:{documentType:e.documentType,badgeType:e.badgeType,customDocumentSlug:e.customDocumentSlug,segmentsIds:n,language:i,oneFile:s,strategy:o,date:a}});return r}})]}),name:e.title})},bX=e=>(0,i.jsx)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",justifyContent:"center",padding:"$7",overflowX:"hidden",overflowY:"auto",...e.css},height:1,children:(0,i.jsx)(Xl,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})}),AX=e=>{const{history:n,translate:t,params:{eventId:s,accreditationSlotId:o}}=fc(),a=ss(Wg),{data:r,isLoading:d}=gr({eventId:s,loadIsBlocked:!1}),l=(0,de.useMemo)(()=>Yp(a,r.event?.accreditationsCategories??[]),[a,r.event]);return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_l_a_28765")}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchLoading:d,isSearchVisible:!0,values:[o],onChange:t=>{f(t)&&n.replace(e.getPath(t[0]))},children:l})}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})},EX=()=>{const{params:{organizationId:e,eventId:n,accreditationSlotId:t}}=fc(),{user:s}=ps(),{event:o}=Ly(),{data:a,loader:r}=rs("query AsoPaxManifestDocument($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n ...DocumentAsoPaxManifest\n\n event(id: $eventId) {\n languages\n\n segmentsFolders(segmentType: Accreditations) {\n id\n name\n\n segments {\n id\n name\n rendering\n }\n }\n }\n}\n",{eventId:n,accreditationSlotId:t},[Ko.DocumentAsoPaxManifestFragment],undefined);const d=(0,de.useMemo)(()=>(a.event?.segmentsFolders??[]).map(e=>({...e,segments:e.segments.filter(e=>"SlotsList"===e.rendering)})),[a.event]);return fm(`${o.name} PAX Manifest`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.AsoPaxManifest,eventId:n,languages:a.event?.languages??[],organizationId:e,segmentsFolders:d,title:"PAX Manifest"}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},direction:"column",width:1,children:[(0,i.jsx)(AX,{downloadPath:Ex(a.event?.accreditationSlot?.links?.asoPaxManifestLink,"pdf",{lang:s?.language}),getPath:t=>QD.ASO_PAX_MANIFEST({organizationId:e,eventId:n,accreditationSlotId:t})}),(0,i.jsx)(bX,{width:1,children:(0,i.jsx)(SX,{asoPaxManifest:a})})]})})]})};var wX=t(8962),$X=t.n(wX);const TX=(e,n)=>"base64"===n?new Promise((n,t)=>{const i=new FileReader;i.onload=()=>{n(i.result?.toString()??"")},i.onerror=t,i.readAsDataURL(e)}):new Promise((n,t)=>{const i=new FileReader;i.onload=()=>{const e=new Uint8Array(i.result);n($X().detect(e)||"UTF-8")},i.onerror=t,i.readAsArrayBuffer(e)}).then(n=>new Promise((t,i)=>{const s=new FileReader;s.onload=()=>t(s.result?.toString()??""),s.onerror=i,s.readAsText(e,n)})),zX=({css:e,label:n,description:t,icon:s,hint:o,maxSize:a,state:r,value:d,placeholder:l,accept:c,format:u,onChange:m,...g})=>{const h=os(),p=(0,de.useRef)(null),{inputId:I,descId:f,errorId:x}=Vc(),[_,j]=(0,de.useState)(""),v=(0,de.useMemo)(()=>w(_),[_]);return(0,i.jsxs)(Xl,{css:e,direction:"column",width:1,children:[(0,i.jsx)(uu,{htmlFor:I,isClickable:!1,children:n}),(0,i.jsx)(lu,{id:f,children:t}),(n||t)&&(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gu,{cursor:"pointer",icon:s,rightIcon:"file",state:r,onClick:()=>{p.current?.click()},children:(0,i.jsxs)(Zr,{color:w(d?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[w(d?.name)?d.name:l,(0,i.jsx)("input",{ref:p,accept:iS(c),"aria-describedby":t?f:void 0,"aria-errormessage":"error"===r?x:void 0,"aria-invalid":"error"===r,id:I,type:"file",onChange:async e=>{const n=e.target.files?.[0];n&&("number"==typeof a&&n.size>a?j(h("le_fichier_ne_d_59049",vS.bytesToMegabytes(a))):(j(""),m({name:n.name,content:await TX(n,u)})))},...g})]})}),(0,i.jsx)(cu,{id:x,state:v?"error":r,children:v?_:o})]})};var OX=t(3514);function RX(e){return{color:km(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const DX=e=>{const n=os();return e.options.showInformations?(0,i.jsxs)(Xl,{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)(Zr,{css:{...RX(e.options),textAlign:"center"},width:1,children:w(e.informationsTitle)?e.informationsTitle:n("informations_22954")}),w(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:e.renderText(e.informationsContent)})})})]}):null},MX=e=>(0,i.jsx)(Xl,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),PX=e=>{const n=os(),t=ss(Wg),s=e.startDate,o=s.plus({week:1}).minus({day:1}),a=km(e.options.headerColor)?e.options.headerColor:"white",r=e.options.showInformations;return(0,i.jsxs)(Xl,{css:{color:km(e.options.textColor)?e.options.textColor:"$gray800",background:w(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:a_["96dpi"].width,width:a_["96dpi"].height,children:[(0,i.jsxs)(Xl,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{color:a,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:n("r_capitulatif_74015",e.delegationCalendar.delegation.name)}),(0,i.jsx)(Zr,{css:{color:a,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:n("du_1_au_2_12974",t.toLocaleString(s,da.DateOnly.MonthLong),t.toLocaleString(o,da.DateOnly.MonthLong))})]}),(0,i.jsxs)(Xl,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[r&&(0,i.jsx)(MX,{children:(0,i.jsx)(DX,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText})}),(0,i.jsx)(Xl,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(Zr,{width:1,children:e.children})})]})]})},kX=e=>{const n=(0,de.useMemo)(()=>Mm(e.das.accreditation.color),[e.das]),t=(0,de.useMemo)(()=>({background:n[50],border:`1px solid ${n[500]}`,color:n[700]}),[n]);return(0,i.jsxs)(Xl,{align:"start",css:{...t,borderRadius:"$1",minHeight:"32px",padding:"$1 $2"},direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Zr,{css:{fontSize:"10px"},children:["x",e.das.assignedResources]}),(0,i.jsx)(Zr,{fontSize:"textXs",fontWeight:"medium",children:e.das.accreditation.name})]})},FX=e=>(0,i.jsx)(PX,{delegationCalendar:e.delegationCalendar,document:e.document,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(nz,{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.delegationCalendar.endAt,minDate:e.delegationCalendar.startAt,children:e.accreditationsSlotsDates.map((e,n)=>(0,i.jsx)(ez,{endAt:e.accreditationSlot.date,startAt:e.accreditationSlot.date,children:(0,i.jsx)(kX,{das:e})},n))})}),NX=e=>{const{minDate:n,numberOfWeeks:t}=(0,de.useMemo)(()=>{const n=(0,Lh.A)(e.accreditationsSlotsDates.map(e=>e.accreditationSlot.date)).startOf("week"),t=(0,OX.A)(e.accreditationsSlotsDates.map(e=>e.accreditationSlot.date)).endOf("week");return{minDate:n,numberOfWeeks:Math.ceil(t.diff(n,"weeks").weeks)}},[e.accreditationsSlotsDates]);return(0,i.jsx)(i.Fragment,{children:(0,Sg.A)(0,t).map(t=>(0,i.jsx)(FX,{accreditationsSlotsDates:e.accreditationsSlotsDates,delegationCalendar:e.delegationCalendar,document:e.document,options:e.options,renderText:e.renderText,startDate:n.plus({week:t})},t))})},LX=e=>{const n=ss(Dz),t=e.delegationCalendar.delegation,s=(0,de.useMemo)(()=>t.allAccreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid&&e.assignedResources>0).filter(n=>{if(e.date?.isValid&&e.endDate?.isValid){const t=Jo.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return Jo.IX.fromDateTimes(n.accreditationSlot.date.startOf("day"),n.accreditationSlot.date.endOf("day")).overlaps(t)}return!e.date?.isValid||n.accreditationSlot.date.startOf("day").equals(e.date.startOf("day"))}),[e.date,e.endDate,t]),o=e=>n.renderText(e,{delegation:t});return f(s)?(0,i.jsx)(NX,{accreditationsSlotsDates:s,delegationCalendar:e.delegationCalendar,document:e.eventDocument,options:e.options,renderText:o}):(0,i.jsx)(PX,{delegationCalendar:e.delegationCalendar,document:e.eventDocument,options:e.options,renderText:o,startDate:e.delegationCalendar.startAt})},UX=15e5,VX=e=>{const n=os();return(0,i.jsx)(lC,{permissions:nC.DOCUMENT_EDIT,children:(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowX:"hidden",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:n("param_tres_de_l_11729")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("s_lectionnez_le_59909")}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Xl,{direction:"column",gap:"3",width:1,children:e.children})]})})};function BX(e,n,t,i){const{canDocumentEdit:s}=tC(),{mutate:o}=function(e={}){return ds("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)}(),[a,r]=(0,de.useState)({...n,...e}),[d,l]=(0,de.useState)(i.informations2Content||""),[c,u]=(0,de.useState)(i.informations2Title||""),[m,g]=(0,de.useState)(i.informationsContent||""),[h,p]=(0,de.useState)(i.informationsTitle||""),[I,f]=(0,de.useState)(i.signature||""),[x,_]=(0,de.useState)(i.title||""),j=(0,de.useCallback)((0,Og.A)(async(e,n,a,r,d,l,c)=>{s&&await o({eventId:t,id:i.id,eventDocument:{options:e,informations2Content:n,informations2Title:a,informationsContent:r,informationsTitle:d,signature:l,title:c}})},200),[t,i.id,s]);return{eventDocument:{options:a,informations2Content:d,informations2Title:c,informationsContent:m,informationsTitle:h,signature:I,title:x},informations2Content:d,informations2Title:c,informationsContent:m,informationsTitle:h,options:a,signature:I,title:x,setInformations2Content:async e=>{l(e),await j(a,e,c,m,h,I,x)},setInformations2Title:async e=>{u(e),await j(a,d,e,m,h,I,x)},setInformationsContent:async e=>{g(e),await j(a,d,c,e,h,I,x)},setInformationsTitle:async e=>{p(e),await j(a,d,c,m,e,I,x)},setOptions:async e=>{const n={...a,...e};r(n),await j(n,d,c,m,h,I,x)},setSignature:async e=>{f(e),await j(a,d,c,m,h,e,x)},setTitle:async e=>{_(e),await j(a,d,c,m,h,I,e)}}}const WX=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,delegationId:a}}=fc(),[r,d,l]=Dg(""),{delegationsOptions:c,isLoading:u}=oC({organizationId:s,level:kn.Event,eventId:o,hasSelected:!0,delegationsIds:[a],nameDebounced:d});return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_la_06126")}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),state:"search",value:r,onChange:l}),values:[a],onChange:t=>{f(t)&&n.replace(e.getPath(t[0]))},children:c})}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})},GX=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ny(["delegation"],{delegationsCustomFields:!1}),{user:a}=ps(),{eventDocument:r,informationsContent:d,informationsTitle:l,options:c,setInformationsContent:u,setInformationsTitle:m,setOptions:g}=BX(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",showInformations:!1,subtitleColor:"#1d2939",textColor:"#1d2939",titleFontFamily:"Open Sans"},s,{id:e.data.event.document.id,title:e.data.event.document.title,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),h=bK();return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:c.background,onChange:e=>{g({background:e})}}),w(c.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{g({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(nf,{label:"Police",value:c.fontFamily,onChange:e=>{g({fontFamily:e})},children:h}),(0,i.jsx)(nf,{label:n("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{g({titleFontFamily:e})},children:h}),(0,i.jsx)(Bb,{label:n("couleur_du_text_32021"),value:c.textColor,onChange:e=>{g({textColor:e})}}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{g({headerColor:e})}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(oI,{value:c.showInformations,onChange:e=>{g({showInformations:e})},children:n("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(hu,{label:n("titre_de_la_sec_41575"),value:l,onChange:e=>{m(e)}}),(0,i.jsx)(QS,{initialValue:d,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{u(e)}})]})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(WX,{downloadPath:Ex(e.data.event.delegation.links.delegationCalendarLink,"pdf",{lang:a?.language}),getPath:e=>QD.DELEGATION_CALENDAR({organizationId:t,eventId:s,delegationId:e})}),(0,i.jsx)(bX,{children:(0,i.jsx)(LX,{delegationCalendar:e.data.event,eventDocument:r,options:c})})]})]})},qX=()=>{const{translate:e,params:{organizationId:n,eventId:t,delegationId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query DelegationCalendarDocument(\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n event(id: $eventId) {\n languages\n\n segmentsFolders(segmentType: Delegations) {\n id\n name\n\n segments {\n id\n name\n }\n }\n\n ...DocumentDelegationCalendar\n }\n}\n",{eventId:t,delegationId:s,onlyVisible:!Uy(n)},[Ko.DocumentDelegationCalendarFragment],undefined);return fm(`${o.name} ${e("planning_des_ac_44426")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.DelegationCalendar,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("planning_des_ac_44426")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(GX,{data:a})})]})};var HX=t(7957);const YX=e=>{const n=os();return(0,i.jsx)(Xl,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:n("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},ZX=e=>{const n=os(),t=ss(Wg),s=(0,l.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(Xl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(YX,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Xl,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{children:[(0,i.jsx)(sz,{width:240,children:n("jour_87026")}),(0,i.jsx)(sz,{width:720,children:t.toLocaleString(e.startDate,da.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(Xl,{children:[(0,i.jsx)(sz,{width:240,children:n("cr_neaux_33401")}),(0,Sg.A)(0,6).map(n=>{const t=e.startDate.plus({hour:2*n}),s=t.plus({hour:2}),o=Jo.IX.fromDateTimes(t,s);return(0,i.jsx)(sz,{width:120,children:o.toFormat("HH:mm")},n)})]}),e.positions.map((n,t)=>{const o=s[n.id]??[];return(0,i.jsxs)(de.Fragment,{children:[(0,i.jsxs)(Xl,{children:[(0,i.jsx)(sz,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},textAlign:"start",width:1,children:n.name})}),(0,Sg.A)(0,6).map(e=>(0,i.jsx)(sz,{css:{height:"48px"},width:120},e))]}),o.map(n=>{const s=n.range.start.diff(e.startDate).shiftTo("hours","minutes"),o=n.range.end.diff(n.range.start).shiftTo("hours","minutes"),a=264+60*s.hours+s.minutes,r=112+48*t,d=60*o.hours+o.minutes,l=`${w(n.name)?`${n.name} - `:""}${n.range.toFormat("HH:mm")}`;return(0,i.jsx)(Xl,{align:"center",css:{background:n.position.color,borderRadius:"$1",color:zm(n.position.color),fontSize:"$textXs",height:"32px",left:`${a}px`,position:"absolute",top:`${r}px`,width:`${d}px`},children:(0,i.jsx)(Zr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:l,width:1,children:l})},n.id)})]},n.id)})]})]})},KX=e=>{const n=(0,de.useMemo)(()=>{const n=Dh(e.event.positionsSlots.nodes);if(f(n)){const t=kh(n.map(e=>e.range));let i;return i=8!==t.startHour||20!==t.endHour?n.flatMap(e=>{const n=e.range;return n.start.hour<12&&n.end.hour>=12?[{...e,range:Jo.IX.fromDateTimes(n.start,n.start.set({hour:12,minute:0}))},{...e,range:Jo.IX.fromDateTimes(n.end.set({hour:12,minute:0}),n.end)}]:[e]}):n,i.filter(n=>!e.date?.isValid||n.range.start.startOf("day").equals(e.date.startOf("day")))}return[]},[e.event,e.date]),t=(0,de.useMemo)(()=>f(n)?kh(n.map(e=>e.range)):null,[n]),s=t&&(8!==t.startHour||20!==t.endHour);return(0,i.jsx)(i.Fragment,{children:t?(0,Sg.A)(0,t.numberOfDays).map((o,a)=>(0,Sg.A)(0,s?2:1).map((r,d)=>{const l=t.startDate.plus({day:o}).set({hour:s?0===d?0:12:8}),c=s?0===d?l.set({hour:12}):l.plus({day:1}).startOf("day"):l.set({hour:20}),u=Jo.IX.fromDateTimes(l,c),m=n.filter(e=>e.range.overlaps(u)),g=(0,Tg.A)((0,wh.A)(m.map(e=>e.position),e=>e.id),e=>e.name);return f(m)?(0,HX.A)(g,11).map((n,t)=>(0,i.jsx)(ZX,{eventName:e.event.name,hideHeader:e.hideHeader,positions:n,segmentName:e.event.segment.name,slots:m,startDate:l},`${a}-${d}-${t}`)):null})):!0!==e.hideHeader?(0,i.jsx)(YX,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},XX=e=>{const{history:n,translate:t,params:{segmentId:s}}=fc();return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_la_43833")}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchVisible:!0,values:[s],onChange:t=>{f(t)&&n.replace(e.getPath(t[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))})}),w(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})]})},QX=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query PositionsPlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n event(id: $eventId) {\n ...DocumentPositionsPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:t,segmentId:s},[Ko.DocumentPositionsPlanningFragment,Ko.EventPositionsExportFragment],undefined);return fm(`${o.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(CX,{documentType:an.Planning,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(yC,{children:r||(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(XX,{getPath:e=>QD.POSITIONS_PLANNING({organizationId:n,eventId:t,segmentId:e}),segmentsFolders:a.event.segmentsFolders}),(0,i.jsx)(bX,{width:1,children:(0,i.jsx)(Zr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(KX,{event:a.event})})})]})})]})};var JX;function eQ(){return eQ=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>Rh(e.slots.map(({range:e})=>e).reduce((e,n)=>e.union(n),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start,a=n=>(0,Tg.A)(Hh(n,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(Xl,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(YX,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Xl,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{children:[(0,i.jsx)(sz,{width:200,children:n("jours_88317")}),(0,Sg.A)(0,s).map(n=>{const s=o.plus({days:n}),a=Hh(s,e.slots);return(0,i.jsx)(sz,{width:(a.length||1)*tQ,children:t.toLocaleString(s,da.DateOnly.MonthShort)},n)})]}),(0,i.jsxs)(Xl,{children:[(0,i.jsx)(sz,{width:200,children:n("missions_63972")}),(0,Sg.A)(0,s).map(n=>{const t=o.plus({days:n}),s=(0,Tg.A)(Object.values(x(Hh(t,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)(rz,{css:{height:"40px"},width:tQ},n):s.map(({position:e,numberOfSlots:t})=>{const s=w(e.acronym)?e.acronym:e.name;return(0,i.jsx)(sz,{width:t*tQ,children:(0,i.jsx)(Zr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:s,width:1,children:s})},`${n}-${e.id}`)})})]}),(0,i.jsxs)(Xl,{children:[(0,i.jsx)(sz,{width:200,children:n("cr_neaux_33401")}),(0,Sg.A)(0,s).map(e=>{const n=o.plus({days:e}),t=a(n);return 0===t.length?(0,i.jsx)(rz,{css:{height:"40px"},width:tQ},e):t.map(n=>(0,i.jsx)(sz,{width:tQ,children:n.range.toFormat("HH:mm",{separator:"-"})},`${e}-${n.id}`))})]}),e.volunteersRegistrations.map(e=>{const n=e.userInfo;return(0,i.jsxs)(Xl,{children:[(0,i.jsxs)(oz,{width:200,children:[(0,i.jsx)(F_,{email:n.email,image:n.picture?.url,name:n.name,size:24}),(0,i.jsx)(Zr,{css:{flex:"1",ellipsis:""},title:n.name,children:n.name})]}),(0,Sg.A)(0,s).map(n=>{const t=o.plus({days:n}),s=a(t);return 0===s.length?(0,i.jsx)(rz,{width:tQ},n):s.map(t=>{const s=`${n}-${t.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===t.id)?(0,i.jsx)(az,{width:tQ,children:(0,i.jsx)(Zr,{children:(0,i.jsx)(nQ,{})})},s):(0,i.jsx)(rz,{width:tQ},s)})})]},e.id)})]})]})},sQ=e=>{const n=(0,Tg.A)(Dh(e.event.positionsSlots.nodes),e=>e.range.start),t=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,HX.A)(n,8).map((n,s)=>{const o=n.map(e=>e.id),a=t.filter(e=>{const n=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return(0,tg.A)(o,n).length>0});return(0,HX.A)(a,10).map((t,o)=>(0,i.jsx)(iQ,{eventName:e.event.name,segmentName:e.event.segment.name,slots:n,volunteersRegistrations:t},`${s}-${o}`))})})},oQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n ...DocumentPositionsVolunteersPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:t,segmentId:s},[Ko.DocumentPositionsVolunteersPlanningFragment,Ko.EventPositionsExportFragment],undefined);return fm(`${o.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(CX,{documentType:an.PositionsVolunteersPlanning,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(yC,{children:r||(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(XX,{getPath:e=>QD.POSITIONS_VOLUNTEERS_PLANNING({organizationId:n,eventId:t,segmentId:e}),segmentsFolders:a.event.segmentsFolders}),(0,i.jsx)(bX,{children:(0,i.jsx)(Zr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(sQ,{event:a.event})})})]})})]})},aQ=e=>{const n=km(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Xl,{css:{color:km(e.options.textColor)?e.options.textColor:"$gray800",background:w(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${a_["96dpi"].height}px`,pageBreakBefore:"always"},direction:"column",width:a_["96dpi"].width,children:[(0,i.jsxs)(Xl,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{color:n,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(Zr,{css:{color:n,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(Xl,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},rQ=e=>{const n=os(),t=ss(wb),s=(0,de.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),o=(0,de.useMemo)(()=>Object.fromEntries(s.flatMap(n=>{const t=e.customFields.find(e=>e.slug===n);return t?[[n,t]]:[]})),[s,e.customFields]),a=(0,de.useMemo)(()=>(0,Tg.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{css:{height:"32px"},children:s.map(e=>{const t=o[e];return"email"===e?(0,i.jsx)(Mg,{children:n("Email")},e):"fullName"===e?(0,i.jsx)(Mg,{children:n("full_name")},e):t?.fileType===vn.Picture?(0,i.jsx)(Mg,{width:80,children:t.name},e):"teamCode"===e?(0,i.jsx)(Mg,{children:n("code_quipe_14296")},e):"delegationName"===e?(0,i.jsx)(Mg,{children:n("Delegation")},e):t?(0,i.jsx)(Mg,{children:t.name},e):(0,i.jsx)(Mg,{},e)})}),a.map(e=>{const n=e.userInfo;return(0,i.jsx)(Eg,{css:{height:"28px"},children:s.map(s=>{const a=o[s];if("email"===s)return(0,i.jsx)(_g,{children:n.email},s);if("fullName"===s)return(0,i.jsx)(Mg,{css:{color:"$gray800"},children:n.name},s);if(a?.fileType===vn.Picture){const e=t.getValueString(a,n.fields),o=a.fieldProperty===fn.Picture;return(0,i.jsx)(_g,{width:80,children:(w(e)||o)&&(0,i.jsx)(F_,{email:o?n.email:null,image:e,name:o?n.name:null,size:32})},s)}return"teamCode"===s?(0,i.jsx)(_g,{children:e.teams.map(e=>e.teamCode).join(", ")},s):"delegationName"===s?(0,i.jsx)(_g,{children:e.delegation?.name??""},s):a?(0,i.jsx)(_g,{children:t.getValueString(a,n.fields)},s):(0,i.jsx)(_g,{},s)})},n.id)})]})},dQ=e=>{const n=os(),t=e.documentUsersListing.organization.customFields.nodes,s=(0,de.useMemo)(()=>(0,Tg.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),o=(0,de.useMemo)(()=>(0,HX.A)(s,30),[s]),a=e.documentUsersListing.event.segment;return f(s)?(0,i.jsx)(i.Fragment,{children:o.map((o,r)=>(0,i.jsx)(aQ,{headerTitle1:w(e.eventDocument.title)?e.eventDocument.title:n("liste_des_membr_89037"),headerTitle2:`${a.name} (${s.length})`,options:e.options,children:(0,i.jsx)(Xl,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(rQ,{customFields:t,slugsToDisplay:e.options.slugsToDisplay,volunteers:o})})},r))}):(0,i.jsx)(aQ,{headerTitle1:w(e.eventDocument.title)?e.eventDocument.title:n("liste_des_membr_89037"),headerTitle2:a.name,options:e.options})},lQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{user:o}=ps(),{eventDocument:a,options:r,title:d,setOptions:l,setTitle:c}=BX(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=bK();return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),w(r.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(hu,{label:n("titre_du_docume_33508"),value:d,onChange:e=>{c(e)}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(nf,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:u}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsxs)(lg,{isSearchVisible:!0,label:n("champs_affich_17945"),multiple:!0,placeholder:n("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{l({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:n("Email")}),(0,i.jsx)("option",{value:"fullName",children:n("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:n("code_quipe_14296")}),(0,i.jsx)("option",{value:"delegationName",children:n("Delegation")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(XX,{downloadPath:Ex(e.data.event.segment.links.usersListingLink,"pdf",{lang:o?.language}),getPath:e=>QD.USERS_LISTING({organizationId:t,eventId:s,segmentId:e}),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(bX,{width:1,children:(0,i.jsx)(dQ,{documentUsersListing:e.data,eventDocument:a,options:r})})]})]})},cQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("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:n,eventId:t,segmentId:s},[Ko.DocumentUsersListingFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.VolunteersListing,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(lQ,{data:a,eventId:t})})]})},uQ=e=>{const n=ss(wb),t=(0,de.useMemo)(()=>e.customFields.find(n=>n.slug===e.options.customFieldSlug),[e.customFields,e.options.customFieldSlug]);return(0,i.jsx)(Xl,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(s=>{const o=s.userInfo,a=D_(o.name,o.email);return(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(Zr,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:w(o.picture?.url)?(0,i.jsx)("img",{height:"100%",src:o.picture.url,width:"100%"}):(0,i.jsx)(Xl,{align:"center",css:{background:P_(a)},height:1,justify:"center",width:1,children:(0,i.jsx)(Zr,{font:"white displaySm medium",children:a})})}),(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.lastName,children:(o.lastName||"-").toUpperCase()}),(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.firstName,children:o.firstName||"-"}),t&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0,fontSize:"9px"},title:n.getValueString(t,o.fields)||"-",children:n.getValueString(t,o.fields)||"-"}),e.options.showPhone&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0,fontSize:"9px"},title:o.phone?.internationalFormat||"-",children:o.phone?.internationalFormat||"-"})]})]},o.id)})})},mQ=e=>{const n=os(),t=e.documentUsersPictures.event.volunteersRegistrations.nodes,s=(0,de.useMemo)(()=>(0,HX.A)(t,48),[t]),o=e.documentUsersPictures.event.segment;return f(t)?(0,i.jsx)(i.Fragment,{children:s.map((s,a)=>(0,i.jsx)(aQ,{headerTitle1:w(e.eventDocument.title)?e.eventDocument.title:n("trombinoscope_11316"),headerTitle2:`${o.name} (${t.length})`,options:e.options,children:(0,i.jsx)(uQ,{customFields:e.documentUsersPictures.organization.customFields.nodes,options:e.options,vrs:s})},a))}):(0,i.jsx)(aQ,{headerTitle1:w(e.eventDocument.title)?e.eventDocument.title:n("trombinoscope_11316"),headerTitle2:o.name,options:e.options})},gQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{user:o}=ps(),{eventDocument:a,options:r,title:d,setOptions:l,setTitle:c}=BX(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=bK();return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),w(r.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(hu,{label:n("titre_du_docume_33508"),value:d,onChange:e=>{c(e)}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(nf,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:u}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("champ_suppl_men_12652"),placeholder:n("champ_suppl_men_12652"),values:r.customFieldSlug?[r.customFieldSlug]:[],onChange:e=>{f(e)?l({customFieldSlug:e[0]}):l({customFieldSlug:null})},children:e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))}),r.showPhone&&(0,i.jsx)(oI,{value:r.showPhone,onChange:e=>{l({showPhone:e})},children:n("afficher_le_num_37843")})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(XX,{downloadPath:Ex(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:o?.language}),getPath:e=>QD.USERS_PICTURES({organizationId:t,eventId:s,segmentId:e}),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(bX,{children:(0,i.jsx)(mQ,{documentUsersPictures:e.data,eventDocument:a,options:r})})]})]})},hQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,segmentId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("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:n,eventId:t,segmentId:s},[Ko.DocumentUsersPicturesFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.UsersPictures,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(gQ,{data:a})})]})};var pQ=t(1184);const IQ=e=>e.options.showQrCode?(0,i.jsxs)(Xl,{align:"center",css:{background:e.isAso?"transparent":"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Zr,{css:{...RX(e.options),textAlign:"center"},width:1,children:e.isAso?"QR Code pour valider ma présence":e.isEtapeTour?"QR Code de présence":"QR Code"}),(0,i.jsx)(Xl,{align:"center",css:{background:e.isAso?"white":"transparent",borderRadius:e.isAso?"$1":"none"},height:112,justify:"center",width:112,children:(0,i.jsx)(Zr,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:bx(e.ticketId,{height:90,width:90}),width:"100%"})})})]}):null,fQ=e=>{const n=os(),t=e.psuis[0].position,s=e.userInfo,o=168===e.organizationId,a=573===e.organizationId,r=858===e.organizationId,d=3676===e.organizationId,l=306===e.organizationId,c=km(e.options.headerColor)?e.options.headerColor:"white",u={color:km(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:o?"22px":"24px",fontWeight:o?"500":"800",lineHeight:o?"34px":void 0,textAlign:"center"},m=RX(e.options),g=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,h=(0,wh.A)(t.leaders.concat(t.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Xl,{css:{color:km(e.options.textColor)?e.options.textColor:"$gray800",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px","@media print":{breakBefore:"page"},"@media screen":{backgroundColor:t.color,backgroundImage:w(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${a_["96dpi"].height}px))`,width:`${a_["96dpi"].width}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(Zr,{css:{backgroundColor:t.color,backgroundImage:w(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"fixed",left:"0",top:"0",height:l_.A4.height,width:l_.A4.width,zIndex:"-1","@media screen":{display:"none"}}}),(0,i.jsxs)(Xl,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:l?"end":"center",width:568,children:[(0,i.jsxs)(Xl,{align:l?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Zr,{css:{color:c,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:w(e.document.title)?e.document.title:n("Assignments")}),(0,i.jsx)(Zr,{css:{color:c,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:s.name})]}),l&&(0,i.jsx)(Zr,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(ic,{height:l?"4":"7"}),(0,i.jsxs)(Xl,{css:{paddingLeft:r?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[g&&(0,i.jsxs)(MX,{isAso:r,children:[(0,i.jsx)(DX,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:r,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Zr,{css:{...m,textAlign:"center"},width:1,children:w(e.document.informations2Title)?e.document.informations2Title:n("informations_se_69499")}),w(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(IQ,{isAso:r,isEtapeTour:d,options:e.options,ticketId:e.volunteerRegistration.ticketId}),r&&e.options.showLeaders&&h[0]&&(0,i.jsxs)(Zr,{css:{position:"absolute",textAlign:"center",top:"710px"},width:1,children:[(0,i.jsx)(Zr,{css:{...RX(e.options),marginBottom:"$1",textAlign:"center"},width:1,children:"TON RESPONSABLE"}),h[0].userInfo.name,(0,i.jsx)("br",{}),h[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(Xl,{css:{alignSelf:"start",border:"2px solid transparent",background:r?void 0:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"32px 40px"},direction:"column",children:[a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{...u,fontSize:"12px",fontWeight:"700"},children:t.category.name}),(0,i.jsx)(ic,{height:"1"})]}),(0,i.jsx)(Zr,{css:u,width:1,children:t.name}),e.children]})]})]})},xQ=e=>{const n=os(),t=ss(wb),s=ss(Dz),o=ss(ts),a=e.psuis[0].position,r=(0,Tg.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),d=168===e.organizationId,l=573===e.organizationId,c=858===e.organizationId,u=2695===e.organizationId,m=426===e.organizationId,g=3618===e.organizationId,h=3676===e.organizationId,p=4372===e.organizationId,I=RX(e.options),f=(0,wh.A)(a.leaders.concat(a.category.leaders),e=>e.userInfo.id),x="both"===e.options.leadersData||"email"===e.options.leadersData,_="both"===e.options.leadersData||"phone"===e.options.leadersData,j=n=>s.renderText(n,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(fQ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:j,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!l&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Zr,{css:{color:km(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[n("ton_responsable_16222",f.length)," ",f.map(e=>(0,sc.A)([e.userInfo.name,x?e.userInfo.email:"",_?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(ic,{height:"7"}),!c&&(0,i.jsxs)(Xl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Zr,{css:I,children:u?"Horaire":h?"Rendez-vous":p?"Détail de la conférence":n("date_de_ta_miss_18706")}),(0,i.jsx)(Xl,{direction:"column",gap:"1",children:r.map((e,n)=>{const t=e.range.start,s=e.range.end,a=t.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(Zr,{children:[w(e.name)?`${e.name} | `:"",(0,i.jsx)(s_,{css:{textTransform:"capitalize"},children:t.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(s_,{css:{textTransform:"capitalize"},children:a?s.toFormat("HH:mm"):s.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})]},n)})})]}),c&&(0,i.jsxs)(Xl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Zr,{css:I,children:"Rendez-vous"}),(0,i.jsx)(Xl,{direction:"column",gap:"1",children:r.map((e,n)=>(0,i.jsxs)(Zr,{children:[(0,i.jsx)(s_,{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"),")"]},n))})]}),(0,i.jsxs)(Xl,{direction:"column",children:[w(a.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Zr,{css:I,children:u?"Consignes du poste":n("description_de_15187")}),(0,i.jsx)(Zr,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(p_,{text:a.description})})]})]}),ep(a)&&(0,i.jsxs)(Xl,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{css:I,children:l?"Point de rendez-vous":m?"Lieu du poste":n("lieu_de_rendez_30016")}),Qh(a)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{children:a.address})]}),Jh(a)&&(l||u||g)&&(0,i.jsxs)(Zr,{children:["Point GPS : ",a.latitude,", ",a.longitude]}),Jh(a)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsxs)(Xl,{gap:"3",width:1,children:[(0,i.jsx)(Zr,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:I_(a.latitude,a.longitude),style:{background:`url(${ee.HEAVENT_API_URL}/image/event/${e.eventId}/position/${a.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),d&&w(a.fields?.cf44697?.url)&&(0,i.jsx)(Zr,{css:{background:`url(${a.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),l&&w(a.fields?.cf46814?.url)&&(0,i.jsx)(Zr,{css:{background:`url(${a.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&w(a.fields?.cf45815?.url)&&(0,i.jsx)(Zr,{css:{background:`url(${a.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),l&&w(a.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{children:a.fields.cf46813})]})]})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Zr,{css:I,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(Zr,{children:["Nous sommes là pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(s_,{fontWeight:"bold",children:[f[0]?.userInfo.name," :"," ",f[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(n=>{const s=t.getValueString(n,a.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(n.id)&&w(s)?(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(Zr,{css:I,children:n.name}),n.fieldType===_n.File?Qv(t.getValueString(n,a.fields,{fileReturnValue:"name"}))?(0,i.jsx)(Zr,{css:{background:`url(${s}) no-repeat`,backgroundPositionX:"left",backgroundSize:"contain"},height:180,width:1}):(0,i.jsx)(Zr,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:s,rel:"noreferrer",target:"_blank",children:s})}):(0,i.jsx)(Zr,{css:{wordBreak:"break-word","& a":{color:"inherit"}},dangerouslySetInnerHTML:{__html:(0,pQ.A)(s,{nl2br:!0,target:"_blank"})}})]})]},n.id):null}),w(e.document.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(p_,{text:j(e.document.signature)})})})]}),c&&w(a.fields?.cf24781?.url)&&(0,i.jsxs)(fQ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:j,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{css:{color:km(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:{background:`url(${a.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:300,width:1})]}),h&&w(a.fields?.cf75967?.url)&&(0,i.jsxs)(fQ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:j,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{css:{color:km(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Plan)"}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{css:{background:`url(${a.fields.cf75967.url}) no-repeat`,backgroundSize:"contain"},height:300,width:1})]}),u&&(0,i.jsx)(fQ,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:j,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(Zr,{css:{background:"url(https://assets.recrewteer.com/badges/velotour/condition_2026.png) no-repeat",backgroundSize:"contain"},height:601})})]})},_Q=e=>{const n=e.assignmentsInfos.event.volunteerRegistration,t=(0,de.useMemo)(()=>u_(n.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())),[n,e.date,e.endDate]),s=(0,de.useMemo)(()=>(0,Tg.A)(Object.entries(x(t,e=>e.position.id)),([e,n])=>(0,Lh.A)(n.map(e=>e.positionSlot.range.start.toMillis()))),[t]);return(0,i.jsx)(i.Fragment,{children:s.map(([t,s],o)=>(0,i.jsx)(xQ,{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:n},o))})},jQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ny(["user","userRegistration","userDelegation","delegation"],{delegationsCustomFields:!1,usersCustomFields:!1}),{eventDocument:a,informations2Content:r,informations2Title:d,informationsContent:l,informationsTitle:c,options:u,signature:m,title:g,setInformations2Content:h,setInformations2Title:p,setInformationsContent:I,setInformationsTitle:x,setOptions:_,setSignature:j,setTitle:v}=BX(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}),S=bK(),y=(0,de.useMemo)(()=>(0,Tg.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:u.background,onChange:e=>{_({background:e})}}),w(u.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{_({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(hu,{label:n("titre_du_docume_33508"),value:g,onChange:e=>{v(e)}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(nf,{label:"Police",value:u.fontFamily,onChange:e=>{_({fontFamily:e})},children:S}),(0,i.jsx)(nf,{label:n("police_des_titr_37497"),value:u.titleFontFamily,onChange:e=>{_({titleFontFamily:e})},children:S}),(0,i.jsx)(Bb,{label:n("couleur_du_titr_08509"),value:u.titleColor,onChange:e=>{_({titleColor:e})}}),(0,i.jsx)(Bb,{label:n("couleur_des_sou_18968"),value:u.subtitleColor,onChange:e=>{_({subtitleColor:e})}}),(0,i.jsx)(Bb,{label:n("couleur_du_text_32021"),value:u.textColor,onChange:e=>{_({textColor:e})}}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:u.headerColor,onChange:e=>{_({headerColor:e})}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(oI,{value:u.showInformations,onChange:e=>{_({showInformations:e})},children:n("afficher_la_sec_84744")}),u.showInformations&&(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(hu,{label:n("titre_de_la_sec_41575"),value:c,onChange:e=>{x(e)}}),(0,i.jsx)(QS,{initialValue:l,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{I(e)}})]}),(0,i.jsx)(oI,{value:u.showInformations2,onChange:e=>{_({showInformations2:e})},children:n("afficher_la_sec_67554")}),u.showInformations2&&(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(hu,{label:n("titre_de_la_sec_41575"),value:d,onChange:e=>{p(e)}}),(0,i.jsx)(QS,{initialValue:r,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{h(e)}})]}),(0,i.jsx)(oI,{value:u.showQrCode,onChange:e=>{_({showQrCode:e})},children:n("afficher_le_qr_15635")}),(0,i.jsx)(oI,{value:u.showLeaders,onChange:e=>{_({showLeaders:e})},children:n("afficher_les_re_08705")}),u.showLeaders&&(0,i.jsx)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)(nf,{label:n("donn_es_des_res_45809"),value:u.leadersData,onChange:e=>{_({leadersData:e})},children:[(0,i.jsx)("option",{value:"both",children:n("afficher_le_num_37296")}),(0,i.jsx)("option",{value:"phone",children:n("afficher_unique_41829")}),(0,i.jsx)("option",{value:"email",children:n("afficher_unique_97964")}),(0,i.jsx)("option",{value:"none",children:n("afficher_aucune_38167")})]})}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(QS,{initialValue:m,label:n("signature_67521"),variables:o,onChange:e=>{j(e)}}),f(y)&&(0,i.jsx)(lg,{label:n("liste_des_champ_40847"),multiple:!0,values:u.positionCustomFields,onChange:e=>{_({positionCustomFields:e})},children:y.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>QD.USER_ASSIGNMENTS({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(bX,{children:(0,i.jsx)(_Q,{assignmentsInfos:e.data,eventDocument:a,options:u})})]})]})},vQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("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:n,eventId:t,userInfoId:s},[Ko.DocumentUserAssignmentsFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.Assignments,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("fiches_d_affect_98583")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(jQ,{data:a})})]})},SQ=e=>{const n=os(),t=ss(Nh),s=e.options.format===Nn.A4Portrait?l_.A4:e.options.format===Nn.A5Portrait?l_.A5:l_.A6,o=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(Zr,{width:s.width,children:[(0,i.jsxs)(Xl,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:s.height,width:1,children:[(0,i.jsx)(Zr,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(Xl,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(F_,{email:o.userInfo.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:96}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:o.userInfo.nameOrEmail}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textLg",children:w(e.options.name)?e.options.name:n("membre_45658")})]}),(0,i.jsx)(Zr,{css:{flex:"1"}}),w(e.options.logo?.content)&&(0,i.jsx)(Xl,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(ic,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(Zr,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(Xl,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:s.height,width:1,children:[w(e.options.logo?.content)&&(0,i.jsx)(Xl,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(ic,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:n("affectation_plural")}),(0,i.jsx)(ic,{height:"2"}),o.positionsSlotsUsersInfos.map(({position:e,positionSlot:s},o)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:n("affectation_n_78121",o+1)}),(0,i.jsxs)(Zr,{color:"gray800",children:[e.name," :"," ",t.toDisplayString(s.range)]}),(0,i.jsx)(ic,{height:"2"})]},o))]}),w(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:n("renseigements_c_00093")}),(0,i.jsx)(Zr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},yQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{options:o,setOptions:a}=BX(e.data.event.document.options,{format:Nn.A6Portrait,logo:{name:"",content:""},color:Lr.colors.gray900.value,name:"",infos:"",showAssignments:!0},s,{id:e.data.event.document.id}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(nf,{label:"Format",value:o.format,onChange:e=>{a({format:e})},children:[(0,i.jsx)("option",{value:Nn.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:Nn.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:Nn.A6Portrait,children:"A6"})]}),(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("logo_18191"),maxSize:UX,placeholder:n("logo_18191"),value:o.logo,onChange:e=>{a({logo:e})}}),w(o.logo?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({logo:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(Bb,{label:n("couleur_de_fond_75677"),value:o.color,onChange:e=>{a({color:e})}}),(0,i.jsx)(hu,{hint:n("ce_nom_sera_sit_11616"),label:n("nom_du_badge_36141"),placeholder:n("membre_45658"),value:o.name,onChange:e=>{a({name:e})}}),(0,i.jsx)(Xx,{label:n("renseigements_c_00093"),placeholder:n("ex_contact_d_11070"),value:o.infos,onChange:e=>{a({infos:e})}}),(0,i.jsx)(Zm,{state:o.showAssignments?"checked":"unchecked",onClick:e=>{a({showAssignments:"checked"===e})},children:n("afficher_les_af_46643")})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(r.links?.userBadgeLink??"","pdf",{lang:r.language}),getPath:e=>QD.USER_BADGE({organizationId:t,eventId:s,userInfoId:e,badgeType:"generic"})}),(0,i.jsx)(bX,{children:(0,i.jsx)(SQ,{badgeDocumentFragment:e.data.event,options:o,showPageSeparator:!0})})]})]})},CQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s},[Ko.DocumentUserBadgeFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("BadgeCheck")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.Badge,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(yQ,{data:a})})]})},bQ=e=>{const n=os(),t=ss(Wg),s=ss(Nh),o=(0,de.useMemo)(()=>(0,Tg.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),a=Jo.c9.local(),r=e.certificateDocumentFragment.volunteerRegistration.userInfo,d=w(r.dateOfBirth)&&Jo.c9.fromISO(r.dateOfBirth).isValid,l=w(r.street)&&w(r.city)&&w(r.postalCode);return(0,i.jsxs)(Xl,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[w(e.options.header.content)&&(0,i.jsx)(Zr,{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)(Zr,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:n("attestation_de_92734")}),(0,i.jsxs)(Xl,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(Zr,{color:"gray800",fontWeight:"semiBold",children:[n("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(Zr,{css:{"& > span":{fontWeight:"$semiBold"}},children:[n("certifie_que_13123")," ",(0,i.jsx)("span",{children:r.name}),(0,i.jsx)("br",{}),d&&(0,i.jsxs)(i.Fragment,{children:[n("n_e_le_14393")," ",(0,i.jsx)("span",{children:t.toLocaleString(Jo.c9.fromISO(r.dateOfBirth),da.DateOnly.MonthLong)}),(0,i.jsx)("br",{})]}),l&&(0,i.jsxs)(i.Fragment,{children:[n("demeurant_78485")," ",(0,i.jsx)("span",{children:w(r.street)?r.street:""}),(0,i.jsx)("br",{}),n("commune_48881")," ",(0,i.jsx)("span",{children:w(r.city)?r.city:""}),(0,i.jsx)("br",{}),n("code_postal_74563")," ",(0,i.jsx)("span",{children:w(r.postalCode)?r.postalCode:""})]})]}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"semiBold",children:n("a_t_b_n_vole_58773")}),(0,i.jsx)(Zr,{dangerouslySetInnerHTML:{__html:o.map(({position:e,positionSlot:n})=>`${e.name} : ${s.toDisplayString(n.range)}`).join("
")}}),(0,i.jsxs)(Zr,{color:"gray800",css:{whiteSpace:"pre-wrap","& > span":{fontWeight:"$semiBold"}},children:[(0,i.jsx)("span",{children:n("nom_et_adresse_96441")}),(0,i.jsx)("br",{}),e.options.address]}),w(e.options.infos)&&(0,i.jsx)(Zr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(Zr,{color:"gray800",children:n("atteste_sur_l_h_37408")}),(0,i.jsxs)(Wu,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray800",children:n("signature_67521")}),w(e.options.signature.content)&&(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(Zr,{color:"gray800",children:n("fait_1_39349",e.options.place)}),(0,i.jsx)(Zr,{color:"gray800",children:t.toLocaleString(a,da.DateOnly.MonthLong)})]})]})},AQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{options:o,setOptions:a}=BX(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}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsx)(hu,{label:n("full_name"),placeholder:"Antoine Dupont",value:o.name,onChange:e=>{a({name:e})}}),(0,i.jsx)(hu,{label:n("fonction_68322"),placeholder:n("pr_sident_30600"),value:o.title,onChange:e=>{a({title:e})}}),(0,i.jsx)(Xx,{label:n("nom_et_adresse_81953"),value:o.address,onChange:e=>{a({address:e})}}),(0,i.jsx)(Xx,{label:n("informations_su_09057"),value:o.infos,onChange:e=>{a({infos:e})}}),(0,i.jsx)(hu,{label:n("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:o.place,onChange:e=>{a({place:e})}}),(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",hint:n("taille_de_l_ima_12660","682x260px"),label:n("en_t_te_11987"),maxSize:UX,placeholder:n("en_t_te_11987"),value:o.header,onChange:e=>{a({header:e})}}),w(o.header?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({header:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("signature_67521"),maxSize:UX,placeholder:n("signature_67521"),value:o.signature,onChange:e=>{a({signature:e})}}),w(o.signature?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{a({signature:{name:"",content:""}})},children:n("r_initialiser_77538")})]})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(r.links?.userCertificateLink??"","pdf",{lang:r.language}),getPath:e=>QD.USER_CERTIFICATE({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(bX,{children:(0,i.jsx)(bQ,{certificateDocumentFragment:e.data.event,options:o})})]})]})},EQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("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:n,eventId:t,userInfoId:s},[Ko.OrganizationCertificateDefaultFragment,Ko.DocumentUserCertificateFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("Certificate")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.Certificate,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(AQ,{data:a})})]})},wQ=e=>{const{translate:n,params:{organizationId:t,eventId:s,badgeType:o}}=fc(),{options:a,setOptions:r}=BX(e.event.document.options,o===qe.T24assignment?{logo:{name:"",content:""}}:{habits:""},s,{id:e.event.document.id}),d=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[o===qe.Asoassignment&&(0,i.jsx)(VX,{children:(0,i.jsx)(QS,{initialValue:a.habits,label:"Habitudes",onChange:e=>{r({habits:e})}})}),o===qe.T24assignment&&(0,i.jsx)(VX,{children:(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("logo_18191"),maxSize:UX,placeholder:n("logo_18191"),value:a.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(d.links?.userCustomBadgeLinks?.[o]||"","pdf",{lang:d.fields?.language?.rawValue}),getPath:e=>QD.USER_BADGE({organizationId:t,eventId:s,userInfoId:e,badgeType:o})}),(0,i.jsx)(bX,{children:Ij(o,e.event,a,null)})]})]})},$Q=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s,badgeType:o}}=fc(),{data:a,loader:r}=rs("query UserCustomBadgeDocument(\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customBadge: CustomBadge!\n) {\n event(id: $eventId) {\n ...DocumentUserCustomBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s,customBadge:o},[Ko.DocumentUserCustomBadgeFragment,Ko.EventVolunteersExportFragment],undefined);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{badgeType:o,documentType:an.CustomBadge,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:o===qe.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",fj(o))}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(wQ,{event:a.event})})]})},TQ=e=>{const n=os(),t=ss(Wg),s=ss(dE),o=(0,de.useMemo)(()=>e.psuis.filter(n=>n.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),a=(0,de.useMemo)(()=>(0,Cy.A)(o,e=>e.timeDifferenceMinutes),[o]);return(0,i.jsxs)(Xl,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Zr,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:t.toLocaleString(e.day,da.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(gg,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(cg,{css:{height:"32px"},children:[(0,i.jsx)(Mg,{children:n("nom_de_la_missi_64605")}),(0,i.jsxs)(Mg,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(Zr,{children:n("d_but_41840")}),(0,i.jsx)(Zr,{css:{fontSize:"8px"},children:n("_point_missi_66864")})]}),(0,i.jsxs)(Mg,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(Zr,{children:n("fin_60104")}),(0,i.jsx)(Zr,{css:{fontSize:"8px"},children:n("_point_missi_66864")})]}),(0,i.jsx)(Mg,{width:120,children:n("pause_46709")}),(0,i.jsx)(Mg,{width:120,children:n("total_07173")})]}),o.map((n,o)=>(0,i.jsxs)(Eg,{css:{height:"32px"},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:n.position.name})}),(0,i.jsxs)(_g,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(Zr,{children:n.checkInAt?.isValid?t.toLocaleString(n.checkInAt.setZone(e.timeZone),da.TimeOnly):"-"}),(0,i.jsx)(Zr,{css:{fontSize:"8px"},children:t.toLocaleString(n.positionSlot.range.start,da.TimeOnly)})]}),(0,i.jsxs)(_g,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(Zr,{children:n.checkOutAt?.isValid?t.toLocaleString(n.checkOutAt.setZone(e.timeZone),da.TimeOnly):"-"}),(0,i.jsx)(Zr,{css:{fontSize:"8px"},children:t.toLocaleString(n.positionSlot.range.end,da.TimeOnly)})]}),(0,i.jsx)(_g,{css:{color:"$gray500"},width:120,children:n.breakTime>0?s.minutesToHoursMinutesString(n.breakTime):"-"}),(0,i.jsx)(_g,{css:{color:"$gray500"},justify:"end",width:120,children:s.minutesToHoursMinutesString(n.timeDifferenceMinutes)})]},o)),(0,i.jsxs)(cg,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(Mg,{children:(0,i.jsx)(Zr,{font:"gray800 textXs semiBold",children:n("total_de_la_jou_73634")})}),(0,i.jsx)(Mg,{justify:"end",width:120,children:(0,i.jsx)(Zr,{font:"gray800 textXs semiBold",children:s.minutesToHoursMinutesString(a)})})]})]})]})},zQ=e=>{const n=os(),t=ss(dE),s=e.event.volunteerRegistration,o=s.userInfo,a=(0,de.useMemo)(()=>u_(s.positionsSlotsUsersInfos,e.date,null),[s.positionsSlotsUsersInfos]),r=(0,de.useMemo)(()=>(0,Tg.A)((0,wh.A)(a.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[a]),d=(0,de.useMemo)(()=>(0,Cy.A)(a,e=>e.timeDifferenceMinutes),[a]);return(0,i.jsx)(aQ,{headerTitle1:`${w(e.eventDocument.title)?e.eventDocument.title:n("UserHours")} ${o.name}`,headerTitle2:n("total_d_heures_11826",t.minutesToHoursMinutesString(d)),options:e.options,children:(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:r.map(n=>(0,i.jsx)(TQ,{day:n,psuis:a,timeZone:e.event.timeZone},n.toMillis()))})})},OQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{eventDocument:o,options:a,title:r,setOptions:d,setTitle:l}=BX(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},s,{id:e.event.document.id}),c=bK(),u=e.event.volunteerRegistration.userInfo,m=u.links?.userHoursLink??"";return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),w(a.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(hu,{label:n("titre_du_docume_33508"),value:r,onChange:e=>{l(e)}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(nf,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:c}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(m,"pdf",{lang:u.language}),getPath:e=>QD.USER_HOURS({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(bX,{children:(0,i.jsx)(zQ,{event:e.event,eventDocument:o,options:a})})]})]})},RQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUsersHours\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s},[Ko.DocumentUsersHoursFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("UserHours")}`),(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.UserHours,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:r||(0,i.jsx)(OQ,{event:a.event})})]})},DQ=e=>{const n=os(),t=ss(Wg),s=e.event.volunteerRegistration,o=s.userInfo,a=(0,de.useMemo)(()=>(0,$h.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[s.positionsSlotsUsersInfos]),r=(0,de.useMemo)(()=>(0,Th.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[s.positionsSlotsUsersInfos]),d=(0,de.useMemo)(()=>(0,Tg.A)(Object.entries(x(s.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e,n])=>n[0].positionSlot.range.start.startOf("day").toMillis()).map(([e,n])=>{const i=n[0],s=(0,Tg.A)(Object.values(x(n,e=>e.position.id)),e=>(0,Lh.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const n=e[0].position,t=(0,Tg.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===n.organizationId&&w(n.address)?` (${n.address})`:"";return`${n.name} : ${t}${i}`});return[t.toLocaleString(i.positionSlot.range.start.startOf("day"),da.DateOnly.WeekdayLongMonthLong),s]}),[s.positionsSlotsUsersInfos]);return(0,i.jsxs)(Xl,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[w(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(ic,{height:"7"})]}),(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Zr,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray800",children:n("p_riode_du_1_89633",t.toLocaleString(a,da.DateTime),t.toLocaleString(r,da.DateTime))}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Xl,{direction:"column",gap:"4",children:d.map(([e,n],t)=>(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(Xl,{direction:"column",children:n.map((e,n)=>(0,i.jsx)(Zr,{children:e},n))})]},t))})]})]})},MQ=e=>{const n=os(),t=e.event.volunteerRegistration,s=t.userInfo;return f(t.positionsSlotsUsersInfos)?(0,i.jsx)(DQ,{...e}):(0,i.jsxs)(Xl,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[w(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(ic,{height:"7"})]}),(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Zr,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray800",children:n("aucune_affectat_04761")})]})]})},PQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{options:o,setOptions:a}=BX(e.data.event.document.options,{logo:{name:"",content:""}},s,{id:e.data.event.document.id}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(VX,{children:(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("logo_18191"),maxSize:UX,placeholder:n("logo_18191"),value:o.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(r.links?.userPlanningDaysLink??"","pdf",{lang:r.language}),getPath:e=>QD.USER_PLANNING_DAYS({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(bX,{children:(0,i.jsx)(MQ,{event:e.data.event,options:o})})]})]})},kQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningDays\n ...EventVolunteersExport\n }\n}\n",{eventId:t,userInfoId:s},[Ko.DocumentUserPlanningDaysFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(CX,{documentType:an.UserPlanningDays,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(yC,{children:r||(0,i.jsx)(PQ,{data:a})})]})},FQ=e=>{const n=os(),t=ss(Wg),s=e.event.volunteerRegistration,o=s.userInfo,a=e.startDate?Jo.c9.max(e.startDate,e.event.startAt):e.event.startAt,r=e.startDate?Jo.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,d=km(e.options.headerColor)?e.options.headerColor:"white",l=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(Xl,{css:{color:km(e.options.textColor)?e.options.textColor:"$gray800",background:w(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:a_["96dpi"].width,width:a_["96dpi"].height,children:[(0,i.jsxs)(Xl,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{color:d,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:n("planning_indivi_05075",o.nameOrEmail)}),(0,i.jsx)(Zr,{css:{color:d,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:n("du_1_au_2_12974",t.toLocaleString(a,da.DateOnly.MonthLong),t.toLocaleString(r,da.DateOnly.MonthLong))})]}),(0,i.jsxs)(Xl,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[l&&(0,i.jsxs)(MX,{children:[(0,i.jsx)(DX,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(IQ,{isAso:!1,isEtapeTour:!1,options:e.options,ticketId:s.ticketId})]}),(0,i.jsx)(Xl,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(Zr,{width:1,children:e.children})})]})]})},NQ=e=>{const n=os(),t=ss(Nh),s=(0,de.useMemo)(()=>{const n=Mm(e.psui.position.color);return{background:n[50],color:n[700]}},[e.psui]),o=(0,de.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=Gh(t,e.psui.positionSlot,"",{interval:{options:i?{hideDate:!0}:{formats:{localeFormat:{day:"numeric",month:"numeric"}}}},slot:{includeRange:!0}});return o?`${s} ${n("j_1_51317")}`:s},[e.psui,o]);return(0,i.jsxs)(Xl,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(Zr,{css:{fontSize:"10px"},children:a}),(0,i.jsx)(Zr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},LQ=e=>(0,i.jsx)(FQ,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(nz,{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((n,t)=>(0,i.jsx)(ez,{endAt:n.range.start,startAt:n.range.start,startHour:e.startHour,children:(0,i.jsx)(NQ,{psui:n,startHour:e.startHour})},t))})}),UQ=e=>{const{minDate:n,numberOfWeeks:t}=(0,de.useMemo)(()=>{const n=(0,Lh.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),t=(0,OX.A)(e.assignments.map(e=>e.positionSlot.range.end)).endOf("week");return{minDate:n,numberOfWeeks:Math.ceil(t.diff(n,"weeks").weeks)}},[e.assignments]);return(0,i.jsx)(i.Fragment,{children:(0,Sg.A)(0,t).map(t=>(0,i.jsx)(LQ,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:n.plus({week:t}),startHour:e.startHour},t))})},VQ=e=>{const n=ss(Dz),[t]=(0,de.useMemo)(()=>Wh(e.event.dayStartTime),[e.event.dayStartTime]),s=(0,de.useMemo)(()=>{const n=Mh(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,t);return(0,Tg.A)(u_(n,e.date,e.endDate),e=>e.positionSlot.range.start.toMillis())},[e.event,t]),o=t=>n.renderText(t,{userInfo:e.event.volunteerRegistration.userInfo,volunteerRegistration:e.event.volunteerRegistration});return _(s)?(0,i.jsx)(FQ,{document:e.eventDocument,event:e.event,options:e.options,renderText:o}):(0,i.jsx)(UQ,{assignments:s,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:o,startHour:t})},BQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ny(["user","userRegistration","userDelegation","delegation"],{delegationsCustomFields:!1,usersCustomFields:!1}),{eventDocument:a,informationsTitle:r,informationsContent:d,options:l,setOptions:c,setInformationsTitle:u,setInformationsContent:m}=BX(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}),g=bK(),h=e.data.event?.volunteerRegistration.userInfo,p=h.links?.userPlanningLink??"";return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:l.background,onChange:e=>{c({background:e})}}),w(l.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{c({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(nf,{label:"Police",value:l.fontFamily,onChange:e=>{c({fontFamily:e})},children:g}),(0,i.jsx)(nf,{label:n("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{c({titleFontFamily:e})},children:g}),(0,i.jsx)(Bb,{label:n("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{c({subtitleColor:e})}}),(0,i.jsx)(Bb,{label:n("couleur_du_text_32021"),value:l.textColor,onChange:e=>{c({textColor:e})}}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{c({headerColor:e})}}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(oI,{value:l.showInformations,onChange:e=>{c({showInformations:e})},children:n("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(hu,{label:n("titre_de_la_sec_41575"),value:r,onChange:e=>{u(e)}}),(0,i.jsx)(QS,{initialValue:d,label:n("contenu_de_la_s_43102"),variables:o,onChange:e=>{m(e)}})]}),(0,i.jsx)(oI,{value:l.showQrCode,onChange:e=>{c({showQrCode:e})},children:n("afficher_le_qr_15635")})]}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(p,"pdf",{lang:h?.language}),getPath:e=>QD.USER_PLANNING({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(bX,{children:(0,i.jsx)(VQ,{event:e.data.event,eventDocument:a,options:l})})]})]})},WQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query UserPlanningDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanning\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:t,userInfoId:s},[Ko.DocumentUserPlanningFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("UserPlanning")}`),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(CX,{documentType:an.UserPlanning,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("plannings_indiv_80073")}),(0,i.jsx)(yC,{children:r||(0,i.jsx)(BQ,{data:a})})]})},GQ=e=>{const n=os(),t=ss(Nh);return(0,i.jsxs)(Xl,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textXl semiBold",children:n("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",children:n("plage_de_dates_08875")}),(0,i.jsx)(Zr,{color:"gray500",children:t.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(Xl,{gap:"1",children:[(0,i.jsx)(Zr,{color:"gray800",children:n("nombre_d_affect_01587")}),(0,i.jsx)(Zr,{color:"gray500",children:e.numberOfAssignments})]})]})};var qQ=t(791);const HQ=e=>{const n=os(),t=ss(Wg),s=ss(dE);return(0,i.jsx)(Xl,{css:{padding:"$6 $8"},children:(0,i.jsxs)(gg,{children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{css:{px:"$3"},children:n("nom_de_la_missi_64605")}),(0,i.jsx)(Mg,{css:{px:"$3"},width:380,children:n("Date")}),e.showHours&&(0,i.jsx)(Mg,{css:{px:"$3"},width:120,children:n("total_07173")})]}),e.assignments.map((n,o)=>{const a=f(n.slotsNames),r=(0,qQ.A)(n.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Eg,{css:{height:a?"54px":"44px"},children:[(0,i.jsx)(_g,{align:"center",css:{px:"$3"},children:(0,i.jsx)(Zr,{css:{clamp:"2"},font:"gray900 textSm medium",title:n.name,width:1,children:n.name})}),(0,i.jsxs)(_g,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[a&&(0,i.jsx)(Zr,{color:"gray900",width:1,children:n.slotsNames.join(", ")}),(0,i.jsxs)(Zr,{width:1,children:[(0,Ku.A)(t.toLocaleString(n.ranges[0].start,da.DateOnly.WeekdayShortMonthLong))," ",n.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),e.showHours&&(0,i.jsx)(_g,{css:{px:"$3"},width:120,children:s.minutesToHoursMinutesString(r)})]},o)})]})})},YQ=e=>{const n=(0,de.useMemo)(()=>{return n=u_(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate),(0,Tg.A)(Object.entries(x(n,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,n])=>{const t=(0,Tg.A)(n,e=>e.positionSlot.range.start.toMillis());return{name:n[0].position.name,ranges:t.map(e=>e.positionSlot.range),slotsNames:(0,sc.A)((0,Zo.A)(t.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis());var n},[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,HX.A)(n,20).map((n,t)=>{const s=n.flatMap(e=>e.ranges),o=(0,$h.A)(s.map(e=>e.start),e=>e.toMillis()),a=(0,Th.A)(s.map(e=>e.end),e=>e.toMillis()),r=Jo.IX.fromDateTimes(o,a);return(0,i.jsxs)(Xl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(GQ,{interval:r,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:n.flatMap(e=>e.ranges).length}),(0,i.jsx)(HQ,{assignments:n,showHours:e.options.showHours})]},t)})})},ZQ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{options:o,setOptions:a}=BX(e.data.event.document.options,{showHours:!0},s,{id:e.data.event.document.id}),r=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(VX,{children:(0,i.jsx)(Zm,{state:o.showHours?"checked":"unchecked",onClick:e=>{a({showHours:"checked"===e})},children:n("afficher_le_tot_23855")})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:Ex(r.links?.userPlanningListLink??"","pdf",{lang:r.language}),getPath:e=>QD.USER_PLANNING_LIST({organizationId:t,eventId:s,userInfoId:e})}),(0,i.jsx)(bX,{width:1,children:(0,i.jsx)(YQ,{event:e.data.event,options:o})})]})]})},KQ=()=>{const{translate:e,params:{organizationId:n,eventId:t,userInfoId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query UserPlanningListDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningList\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:t,userInfoId:s},[Ko.DocumentUserPlanningListFragment,Ko.EventVolunteersExportFragment],undefined);return fm(`${o.name} ${e("UserPlanningList")}`),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(CX,{documentType:an.UserPlanningList,endAt:a.event?.endAt,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,startAt:a.event?.startAt,title:e("plannings_indiv_97766")}),(0,i.jsx)(yC,{children:r||(0,i.jsx)(ZQ,{data:a})})]})};var XQ=t(6965);const QQ=e=>{const n=ss(Nh),t=(0,de.useMemo)(()=>{const n=e.slot.range.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.slot,e.startOfDay]),s=(0,de.useMemo)(()=>{const n=e.slot.range.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.slot,e.startOfDay]),o=(0,de.useMemo)(()=>Gh(n,e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsx)(Xl,{align:"center",css:{background:e.palette[50],border:`1px solid ${e.palette[500]}`,borderRadius:"$1",color:e.palette[700],fontSize:"10px",fontWeight:"500",gridColumnStart:t,gridColumnEnd:s,px:"$2"},height:20,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},width:1,children:o})},e.slot.id)},JQ=e=>{const n=(0,de.useMemo)(()=>e.slots.filter(n=>e.volunteerRegistration.positionsSlotsUsersInfos.some(e=>e.positionSlotId===n.id)),[e.slots,e.volunteerRegistration]);return(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",minHeight:"28px"},width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",color:"$gray700",fontSize:"12px",fontWeight:"500",px:"$4"},width:180,children:e.volunteerRegistration.userInfo.name}),(0,i.jsx)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",color:"$gray700",fontSize:"12px",fontWeight:"500",px:"$4"},width:150,children:e.volunteerRegistration.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(Xl,{css:{flex:"1",py:"2px",position:"relative"},children:(0,i.jsx)(Wu,{align:"center",css:{gridAutoFlow:"column",overflow:"hidden",rowGap:"2px"},gridtemplatecolumns:"repeat(1440, 1fr)",width:1,children:n.map(n=>(0,i.jsx)(QQ,{palette:e.palette,slot:n,startOfDay:e.startOfDay},n.id))})})]})},eJ=e=>{const n=os(),t=ss(Wg),s=km(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Xl,{css:{background:w(e.options.background?.content)?`url(${e.options.background.content})`:e.position.color,backgroundRepeat:"no-repeat",backgroundSize:"cover",padding:"$7"},direction:"column",gap:"7",height:o_["96dpi"].width,width:o_["96dpi"].height,children:[(0,i.jsxs)(Xl,{justify:"between",children:[(0,i.jsx)(Zr,{height:65,children:w(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsxs)(Xl,{align:"end",css:{paddingTop:"26px"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Zr,{css:{color:s,fontSize:"13px",fontWeight:"700"},children:n("planning_missio_08082",e.position.name)}),(0,i.jsx)(Zr,{css:{color:s,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(e.day,da.DateOnly.WeekdayLongMonthLong)})]})]}),(0,i.jsx)(Xl,{css:{background:"white",borderRadius:"$1",flex:"1",overflow:"hidden"},direction:"column",children:(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsxs)(Xl,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200"},width:180}),(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200"},width:150}),(0,i.jsx)(Xl,{css:{flex:"1"},children:(0,i.jsxs)(Wu,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(Zr,{css:{gridColumn:"span 60"}}),(0,Sg.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Xl,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,XQ.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.volunteersRegistrations.map(n=>(0,i.jsx)(JQ,{palette:e.palette,slots:e.slots,startOfDay:e.startOfDay,volunteerRegistration:n},n.id))]})})]})},nJ=e=>{const n=e.event.position,t=(0,de.useMemo)(()=>{const n=Wh(e.event.dayStartTime);return n?.[0]??0},[e.event.dayStartTime]),s=(0,de.useMemo)(()=>Mm(n.color),[n.color]),o=(0,de.useMemo)(()=>Mh(n.slots,e.event.startAt,e.event.endAt,t).filter(n=>{if(e.date?.isValid&&e.endDate?.isValid){const t=Jo.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return n.range.overlaps(t)}return!e.date?.isValid||n.range.start.startOf("day").equals(e.date.startOf("day"))}),[e.date,e.endDate,e.event,n,t]),a=(0,de.useMemo)(()=>Math.ceil(e.event.endAt.plus({day:1}).diff(e.event.startAt,"days").days),[e.event.startAt,e.event.endAt]);return(0,i.jsx)(i.Fragment,{children:(0,Sg.A)(0,a).map(a=>{const r=e.event.startAt.plus({day:a}).set({hour:t}),d=Jo.IX.fromDateTimes(r,r.plus({day:1})),l=o.filter(e=>d.engulfs(e.range));if(f(l)){const o=l.map(e=>e.id),d=e.event.volunteersRegistrations.nodes.filter(e=>{const n=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return f((0,tg.A)(o,n))});return(0,i.jsx)(de.Fragment,{children:(0,HX.A)(d,33).map((o,d)=>(0,i.jsx)(eJ,{day:r,options:e.options,palette:s,position:n,slots:l,startHour:t,startOfDay:r,volunteersRegistrations:o},`${a}-${d}`))},a)}return null})})};const tJ=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,positionId:a}}=fc(),[r,d,c]=Dg(""),{positionsOptions:u,isLoading:m}=function({eventId:e,hasSelected:n,nameDebounced:t,organizationId:s,positionsIds:o}){const{data:a,isLoading:r}=(d={organizationId:s,eventId:e,hasSelected:n,name:w(t)?t:void 0,ids:o},rs(Sa,d,[],void 0));var d;const c=(0,de.useMemo)(()=>{const e=(0,Tg.A)((0,wh.A)((a.organization?.list.nodes??[]).concat(a.organization?.selected?.nodes??[]),e=>e.id),e=>b(e.name));return(0,Tg.A)(Object.entries((0,l.A)(e,e=>e.category.name)),([e])=>b(e))},[a.organization]);return{positionsOptions:(0,de.useMemo)(()=>c.map(([e,n])=>(0,i.jsx)("optgroup",{label:e,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e)),[c]),isLoading:r}}({organizationId:s,eventId:o,hasSelected:!0,positionsIds:[a],nameDebounced:d});return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:t("aper_u_pour_la_94895")}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchLoading:m,isSearchVisible:!0,searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),state:"search",value:r,onChange:c}),values:[a],onChange:t=>{f(t)&&n.replace(e.getPath(t[0]))},children:u})}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",to:e.downloadPath,children:t("t_l_charger_03283")})})]})},iJ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{user:o}=ps(),{options:a,setOptions:r}=BX(e.data.event.document.options,{background:{name:"",content:""},headerColor:"#ffffff",logo:{name:"",content:""}},s,{id:e.data.event.document.id});return(0,i.jsxs)(Xl,{css:{flex:"1"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("fond_du_documen_51758"),maxSize:UX,placeholder:n("fond_du_documen_51758"),value:a.background,onChange:e=>{r({background:e})}}),w(a.background?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({background:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(zX,{accept:Jv.Images,format:"base64",label:n("logo_18191"),maxSize:UX,placeholder:n("logo_18191"),value:a.logo,onChange:e=>{r({logo:e})}}),w(a.logo?.name)&&(0,i.jsx)(Zr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:n("r_initialiser_77538")})]}),(0,i.jsx)(Bb,{label:n("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{r({headerColor:e})}})]}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(tJ,{downloadPath:Ex(e.data.event.position.links.positionPlanningLink,"pdf",{lang:o?.language}),getPath:e=>QD.POSITION_PLANNING({organizationId:t,eventId:s,positionId:e})}),(0,i.jsx)(bX,{css:{justifyContent:"start",overflowX:"auto","& > div":{overflowX:"auto"}},width:o_["96dpi"].height,children:(0,i.jsx)(nJ,{event:e.data.event,options:a})})]})]})},sJ=()=>{const{translate:e,params:{organizationId:n,eventId:t,positionId:s}}=fc(),{event:o}=Ly(),{data:a,loader:r}=rs("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n ...DocumentPositionPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:t,positionId:s},[Ko.DocumentPositionPlanningFragment,Ko.EventPositionsExportFragment],undefined);return fm(`${o.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(CX,{documentType:an.PositionPlanning,eventId:t,languages:a.event?.languages??[],organizationId:n,segmentsFolders:a.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(yC,{children:r||(0,i.jsx)(iJ,{data:a})})]})},oJ=e=>{const n=os(),t=w(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(Xl,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:t}),(0,i.jsx)(Zr,{color:"gray800",children:n("fiche_de_missio_00324")})]})},aJ=e=>{const n=os(),{isRenamed:t,finalName:s,rangeString:o}=gP(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,HX.A)(e.volunteers,30).map((a,r)=>(0,i.jsxs)(Xl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(oJ,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(Xl,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Zr,{font:"gray800 textSm medium",children:[n("membres_pour_le_20317",s)," (",e.volunteers.length,")"]}),t&&(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:o})]}),(0,i.jsx)(rQ,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:a})]})]},r))})};function rJ(e,n){const t=[];return"both"!==n&&"email"!==n||t.push(e.userInfo.email),w(e.userInfo.name)&&t.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==n&&"phone"!==n||t.push(`${e.userInfo.phone.internationalFormat}`),t.join("
")}const dJ=e=>{const n=os(),t=ss(Nh),s=(0,de.useMemo)(()=>(0,Tg.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:n})=>(0,sc.A)([w(e)?e:null,t.toDisplayString(n,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),o=(0,wh.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Xl,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(Xl,{gap:"9",children:[(0,i.jsx)(Zr,{color:"gray500",width:150,children:n("date_de_la_miss_70346")}),(0,i.jsx)(Xl,{css:{flex:"1"},direction:"column",children:s.map((e,n)=>(0,i.jsx)(Zr,{color:"gray800",css:{textTransform:"capitalize"},children:e},n))})]}),o.map((t,s)=>(0,i.jsxs)(Xl,{gap:"9",children:[(0,i.jsx)(Zr,{color:"gray500",width:150,children:n("reponsable_82458")}),(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:rJ(t,e.leadersData)}})]},s)),w(e.position.description)&&(0,i.jsxs)(Xl,{gap:"9",children:[(0,i.jsx)(Zr,{color:"gray500",width:150,children:n("description_58935")}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(p_,{text:e.position.description})})]}),ep(e.position)&&(0,i.jsxs)(Xl,{gap:"9",children:[(0,i.jsx)(Zr,{color:"gray500",width:150,children:n("localisation_38416")}),(0,i.jsxs)(Xl,{color:"gray800",css:{flex:"1"},direction:"column",children:[Qh(e.position)&&(0,i.jsx)(Zr,{children:e.position.address}),Jh(e.position)&&(0,i.jsx)(Zr,{children:n("point_gps_1_19889",e.position.latitude,e.position.longitude)}),Jh(e.position)&&(0,i.jsx)("a",{href:I_(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${ee.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)(Xl,{gap:"9",children:[(0,i.jsx)(Zr,{color:"gray500",width:150,children:n("nombre_de_cr_ne_40593")}),(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(Xl,{gap:"9",children:[(0,i.jsx)(Zr,{color:"gray500",width:150,children:n("nombre_de_membr_08851")}),(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},lJ=e=>{const{organization:n,event:t}=e.positionDocumentFragment,s=t.position,o=(0,de.useMemo)(()=>s.slots.filter(n=>!e.date?.isValid||n.range.start.startOf("day").equals(e.date.startOf("day"))),[s,e.date]);return(0,i.jsxs)(Zr,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(Xl,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(oJ,{acronym:s.acronym,name:s.name}),(0,i.jsx)(dJ,{displayPositionName:!1,leadersData:"both",position:s,ranges:s.range?[{name:null,range:s.range}]:[],showResourcesInfos:!0})]}),e.options.showVolunteersLists&&o.map(o=>{const a=(0,Tg.A)(t.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(o.id)),e=>e.userInfo.name);return(0,i.jsx)(aJ,{customFields:n.customFields.nodes,positionAcronym:s.acronym,positionName:s.name,slot:o,slugsToDisplay:e.options.slugsToDisplay,volunteers:a},o.id)})]})},cJ=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{user:o}=ps(),{event:a}=Ly(),{options:r,setOptions:d}=BX(e.data.event.document.options,{format:Nn.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},s,{id:e.data.event.document.id});return fm(`${a.name} ${n("fiche_de_missio_00324")}`),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(VX,{children:[(0,i.jsxs)(nf,{value:r.format,onChange:e=>{d({format:e})},children:[(0,i.jsx)("option",{value:Nn.A4Portrait,children:n("a4_portrait_92125")}),(0,i.jsx)("option",{value:Nn.A4Landscape,children:n("a4_paysage_24039")})]}),(0,i.jsx)(Zm,{state:r.showPositionData?"checked":"unchecked",onClick:e=>{d({showPositionData:"checked"===e})},children:n("afficher_les_do_85282")}),(0,i.jsx)(Zm,{state:r.showVolunteersLists?"checked":"unchecked",onClick:e=>{d({showVolunteersLists:"checked"===e})},children:n("afficher_les_li_18523")}),(0,i.jsxs)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{d({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:n("Email")}),(0,i.jsx)("option",{value:"fullName",children:n("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:n("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)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(tJ,{downloadPath:Ex(e.data.event.position.links.positionSheetLink,"pdf",{lang:o?.language}),getPath:e=>QD.POSITION_SHEET({organizationId:t,eventId:s,positionId:e})}),(0,i.jsx)(bX,{width:1,children:(0,i.jsx)(lJ,{options:r,positionDocumentFragment:e.data})})]})]})},uJ=()=>{const{translate:e,params:{organizationId:n,eventId:t,positionId:s}}=fc(),{data:o,loader:a}=rs("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:n,eventId:t,positionId:s},[Ko.DocumentPositionSheetFragment,Ko.EventPositionsExportFragment],undefined);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{documentType:an.Position,eventId:t,languages:o.event?.languages??[],organizationId:n,segmentsFolders:o.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(yC,{css:{overflow:"hidden"},children:a||(0,i.jsx)(cJ,{data:o})})]})},mJ=(e,n)=>{const t=QZ(e);if(t)return n.userInfo.fields?.[t]?.url||"";if(e===ZZ.Skidata){const e=n.utid||"";return bx(e,{height:100,width:100})}if(e===ZZ.QrCode){const e=n.ticketId;return bx(e,{height:100,width:100})}if(e===ZZ.Code39){const e=n.ticketId;return bx(e,{barcodeType:Cx.Code39,height:28,width:234})}return e},gJ=e=>{const n=w(e.element.source)&&w(mJ(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:mJ(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(Zr,{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.inGrid?1:e.element.height,width:e.element.inGrid?1:e.element.width,children:w(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:n}):n})},hJ=e=>{const n=ss(Dz),t=FP((0,pQ.A)(n.renderText(e.element.text,{accreditations:e.vr.accreditationsUsersInfos,assignments:e.vr.positionsSlotsUsersInfos,userInfo:e.vr.userInfo,event:e.event,organization:e.organization,customFields:e.customFields,volunteerRegistration:e.vr,separator:"\n"},"TEXT"),{target:"_blank"}));return(0,i.jsx)(Xl,{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:t},height:e.element.inGrid?1:e.element.height,justify:e.element.justify,width:e.element.inGrid?1:e.element.width})},pJ=e=>{const n=n=>n.elements.map(n=>(0,i.jsx)(pJ,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:n,event:e.event,organization:e.organization,positionsSlotsIds:e.positionsSlotsIds,segmentsIds:e.segmentsIds,vr:e.vr},n.id));return uK(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.segmentsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(Xl,{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.inGrid?1:e.element.height,justify:e.element.justify,width:e.element.inGrid?1:e.element.width,wrap:"wrap",children:n(e.element)}):"grid"===e.element.type?(0,i.jsx)(Zr,{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",columnGap:`${e.element.columnGap}px`,display:"grid",gridTemplateColumns:`repeat(${e.element.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${e.element.rows}, minmax(0, 1fr))`,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",rowGap:`${e.element.rowGap}px`,top:`${e.element.top}px`,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},height:e.element.inGrid?1:e.element.height,width:e.element.inGrid?1:e.element.width,children:n(e.element)}):"image"===e.element.type?(0,i.jsx)(gJ,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(hJ,{customFields:e.customFields,element:e.element,event:e.event,organization:e.organization,vr:e.vr}):null:null},IJ=e=>{const n=e.customDocument.configuration,t=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),s=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>w(e.accreditation.acronym)?[e.accreditation.acronym]:[]),o=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),a=e.volunteerRegistration.segmentsIds,r=n.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:n.pages.map(d=>uK(d,t,s,o,a,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(Xl,{css:{background:"white",padding:`${r}px`,position:"relative"},height:2*r+n.height,width:2*r+n.width,children:[n.bleed&&(0,i.jsx)(wK,{}),(0,i.jsx)(Xl,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:n.height,width:n.width,children:d.elements.map(n=>(0,i.jsx)(pJ,{accreditationsAcronyms:s,accreditationsSlotsIds:t,customFields:e.customFields,element:n,event:e.event,organization:e.organization,positionsSlotsIds:o,segmentsIds:a,vr:e.volunteerRegistration},n.id))})]},d.id):null)})},fJ=()=>{const{translate:e,params:{eventId:n,customDocumentId:t}}=fc(),[s,o]=(0,de.useState)(0),{data:a,isLoading:r}=rs("query UserCustomDocumentHistories(\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n $offset: Int\n) {\n event(id: $eventId) {\n id\n customDocument(customDocumentId: $customDocumentId) {\n id\n histories(offset: $offset, limit: 25) {\n nodes {\n ...HistoryRow\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{eventId:n,customDocumentId:t,offset:s},[Ko.HistoryRowFragment],undefined);const d=a.event?.customDocument?.histories,{numberOfPages:l,totalCount:c}=Jf(d);return(0,i.jsx)(yC,{css:{overflowY:"auto"},children:(0,i.jsx)(uk,{getActionLabel:n=>e(`history_custom_documents_${n}`),histories:d?.nodes??[],isLoading:r,numberOfPages:l,offset:s,setOffset:o,totalCount:c})})},xJ=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}}=fc(),{event:r}=Ly(),{data:d,loader:l}=rs("query UserCustomDocumentExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n id\n name\n dateFormat\n datetimeFormat\n timeFormat\n\n customFields(eventId: $eventId) {\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 fields\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:t,eventId:s,userInfoId:o,customDocumentId:a},[Ko.CustomFieldWithConditionFragment,Ko.EventVolunteersExportFragment,Ko.CustomBadgeVolunteerRegistrationFragment],undefined);const c=(0,de.useMemo)(()=>{if(d.event){const e=d.event.customDocument,n=d.event.volunteerRegistration.userInfo.links;return Ex(n?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:d.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[d.event]);return fm(`${r.name} ${d.event?.customDocument?.name??""}`),(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(gs,{path:QD.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsxs)(AC,{children:[(0,i.jsx)(CX,{customDocumentSlug:d.event?.customDocument?.slug,documentType:an.UserCustomDocument,eventId:s,extraButton:(0,i.jsx)(lC,{permissions:nC.DOCUMENT_EDIT,children:(0,i.jsx)(yc,{color:"white",onClick:()=>{e.push(QD.EDIT_CUSTOM_DOCUMENT({organizationId:t,eventId:s,customDocumentId:a}))},children:n("_diter_le_docum_83590")})}),languages:d.event?.languages??[],organizationId:t,segmentsFolders:d.event?.segmentsFolders??[],title:d.event?.customDocument?.name??""}),(0,i.jsxs)(TC,{css:{flex:"1",overflow:"hidden"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:QD.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}),children:n("aper_u_25595")}),(0,i.jsx)(EC,{path:QD.USER_CUSTOM_DOCUMENT_HISTORY({organizationId:t,eventId:s,userInfoId:o,customDocumentId:a}),children:n("historique_06296")})]}),(0,i.jsx)($C,{path:QD.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(yC,{css:{overflow:"hidden"},children:l||(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(NC,{downloadPath:c,getPath:e=>QD.USER_CUSTOM_DOCUMENT_PREVIEW({organizationId:t,eventId:s,userInfoId:e,customDocumentId:a}),populationsIds:f(d.event?.customDocument?.populationsIds)?d.event.customDocument.populationsIds:void 0}),(0,i.jsx)(bX,{children:(0,i.jsx)(IJ,{customDocument:d.event.customDocument,customFields:d.organization.customFields.nodes,event:d.event,organization:d.organization,volunteerRegistration:d.event.volunteerRegistration})})]})})}),(0,i.jsx)($C,{path:QD.USER_CUSTOM_DOCUMENT_HISTORY({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(fJ,{})})]})]})})]})},_J=[{color:"primary",title:"membres_11310",emails:[{emailType:ln.VolunteerRegistration,title:"UserInfoAdminCreate",description:"cet_e_mail_est_75023"},{emailType:ln.Code,title:"code_20843",description:"cet_e_mail_est_49663"}]},{color:"purple",title:"missions_63972",emails:[{emailType:ln.Assignments,title:"affectation_u_11128",description:"cet_e_mail_cont_98777"},{emailType:ln.Refused,title:"refus_d_affecta_71455",description:"cet_e_mail_est_69069"},{emailType:ln.NotifyLeaders,title:"un_responsable_88525",description:"cet_e_mail_est_90425"},{emailType:ln.PositionCategoryLeaderAssign,title:"nomination_en_t_02948",description:"cet_e_mail_est_70420"},{emailType:ln.PositionLeaderAssign,title:"nomination_en_t_06971",description:"cet_e_mail_est_82173"}]},{color:"success",title:"accr_ditations_39450",emails:[{emailType:ln.Accreditations,title:"affectation_u_39802",description:"cet_e_mail_cont_75798"},{emailType:ln.AccreditationsRefused,title:"refus_d_accr_di_89997",description:"cet_e_mail_est_69069"}]},{color:"warning",title:"d_l_gations_78318",emails:[{emailType:ln.DelegationCategoryLeaderAssign,title:"nomination_en_t_77654",description:"cet_e_mail_est_67392"},{emailType:ln.DelegationLeaderAssign,title:"appointment_as_team_manager",description:"email_sent_when_appointing_team_manager"},{emailType:ln.DelegationFormInvite,title:"envoi_du_formul_09434",description:"cet_e_mail_est_19547"}]}],jJ=_J.flatMap(({emails:e})=>e.map(({emailType:e})=>e)),vJ=(e,n)=>n>0?Math.round(e/n*100):0,SJ=({color:e,email:n,isCustom:t,stats:s})=>{const{history:o,params:{organizationId:a,eventId:r},translate:d}=fc(),l=s?.numberOfSent??0,c=s?.numberOfBounced??0,u=vJ(s?.numberOfOpen??0,s?.numberOfDelivered??0);return(0,i.jsxs)(Eg,{css:{cursor:"pointer",minHeight:"72px","&:hover":{background:"$gray50"}},onClick:()=>{o.push(Wo.EVENT_AUTOMATIC_EMAIL(a,r,n.emailType))},children:[(0,i.jsxs)(_g,{css:{gap:"$4",py:"$3"},children:[(0,i.jsx)(Xl,{align:"center",css:{background:`$${e}50`,borderRadius:"$2",color:`$${e}700`,flex:"0 0 auto"},height:40,justify:"center",width:40,children:(0,i.jsx)(pc,{icon:"envelope"})}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:d(n.title)}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:d(n.description)})]})]}),(0,i.jsx)(_g,{width:160,children:d(t?"personnalis_40360":"par_d_faut_15730")}),(0,i.jsxs)(_g,{align:"start",direction:"column",justify:"center",width:160,children:[(0,i.jsx)(Zr,{children:l}),c>0&&(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:d("automatic_emails_bounced_count",c)})]}),(0,i.jsx)(_g,{css:{gap:"$3"},width:200,children:l>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(VL,{percent:u/100}),(0,i.jsxs)(Zr,{css:{flex:"0 0 auto"},children:[u," %"]})]}):(0,i.jsx)(Zr,{color:"gray500",children:"-"})})]})},yJ=({event:e,group:n})=>{const{translate:t}=fc();return(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:t(n.title)}),(0,i.jsxs)(gg,{children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:t("e_mail_13869")}),(0,i.jsx)(Mg,{width:160,children:t("automatic_emails_column_content")}),(0,i.jsx)(Mg,{width:160,children:t("automatic_emails_column_sent")}),(0,i.jsx)(Mg,{width:200,children:t("automatic_emails_opened")})]}),n.emails.map(t=>{const s=e.emailsTemplates.find(({emailType:e})=>e===t.emailType);return(0,i.jsx)(SJ,{color:n.color,email:t,isCustom:!!s&&!s.useDefault,stats:e.emailsStatsByType.find(({emailType:e})=>e===t.emailType)?.stats},t.emailType)})]})]})},CJ=e=>(0,i.jsxs)(jL,{children:[(0,i.jsx)(Zr,{color:"gray500",fontWeight:"medium",children:e.label}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.value}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:e.description})]}),bJ=({stats:e})=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{gap:"6",width:1,children:[(0,i.jsx)(CJ,{description:n("automatic_emails_last_30_days"),label:n("automatic_emails_sent"),value:e.numberOfSent}),(0,i.jsx)(CJ,{description:n("automatic_emails_delivered_rate",vJ(e.numberOfDelivered,e.numberOfSent)),label:n("automatic_emails_delivered"),value:e.numberOfDelivered}),(0,i.jsx)(CJ,{description:n("automatic_emails_opened_count",e.numberOfOpen),label:n("automatic_emails_opened"),value:`${vJ(e.numberOfOpen,e.numberOfDelivered)} %`}),(0,i.jsx)(CJ,{description:n("automatic_emails_bounced_rate",vJ(e.numberOfBounced,e.numberOfSent)),label:n("automatic_emails_bounced"),value:e.numberOfBounced})]})},AJ=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s}}=Ly();fm(`${s} ${t("automatic_emails")}`);const o=(0,de.useMemo)(()=>Jo.c9.now().minus({days:30}).startOf("day"),[]),{data:a,loader:r}=rs("query AutomaticEmails($eventId: EventId!, $emailTypes: [EmailType!]!, $since: Datetime!) {\n event(id: $eventId) {\n emailsStats(emailTypes: $emailTypes, since: $since) {\n numberOfSent\n numberOfDelivered\n numberOfOpen\n numberOfBounced\n }\n\n emailsStatsByType(emailTypes: $emailTypes, since: $since) {\n emailType\n stats {\n numberOfSent\n numberOfDelivered\n numberOfOpen\n numberOfBounced\n }\n }\n\n emailsTemplates {\n emailType\n useDefault\n }\n }\n}\n",{eventId:n,emailTypes:jJ,since:o},[],undefined);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(CC,{breadcrumbs:(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{children:t("communication_05277")}),(0,i.jsx)(gO,{isCurrent:!0,to:Wo.EVENT_AUTOMATIC_EMAILS(e,n),children:t("e_mails_09850")})]}),name:t("automatic_emails"),subtext:t("automatic_emails_description")}),(0,i.jsx)(yC,{css:{gap:"$7"},children:r||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bJ,{stats:a.event.emailsStats}),_J.map(e=>(0,i.jsx)(yJ,{event:a.event,group:e},e.title))]})})]})},EJ=({emailType:e,eventId:n,organizationId:t})=>{const{translate:s}=fc(),{data:o,loader:a}=tl({organizationId:t,eventId:n,formId:null,source:null,emailType:e}),{mutate:r,isLoading:d}=il(),l=ss(uD),c=ss(ec),u=ny(Xc(e,!0)),m=(0,de.useMemo)(()=>Jc(u),[u]),g=(0,de.useMemo)(()=>l.emailTypeToDefault(e,ee.HEAVENT_APP_URL,n,null),[l,e,n]),[h,p]=(0,de.useState)(0);return a||(0,i.jsx)(Fc,{direction:"column",initialValues:{emailTemplate:l.emailTemplateDefault(e,ee.HEAVENT_APP_URL,o.organization.emailTemplate,n,null)},render:({form:e,handleSubmit:n,values:t})=>{const a=t.emailTemplate.useDefault;return(0,i.jsx)(yz,{css:{maxWidth:"800px"},title:s("contenu_de_l_e_19848"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Zr,{color:"gray500",children:s("automatic_email_content_description")}),(0,i.jsx)(Bx,{name:"emailTemplate.useDefault",subtext:s(a?"automatic_email_use_default_hint":"automatic_email_custom_hint"),children:s("utiliser_le_mod_93521")}),a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hu,{label:s("automatic_email_subject"),state:"disabled",value:g.subject,onChange:Ou.A}),(0,i.jsx)(QS,{hint:s("automatic_email_locked_hint"),initialValue:g.content,label:s("contenu_29668"),state:"disabled",onChange:Ou.A},"default")]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:s("automatic_email_subject"),name:"emailTemplate.subject",variables:m}),(0,i.jsx)(JS,{buttonColor:mD(o,t.emailTemplate.emailSenderId),buttons:!0,hint:s("automatic_email_variables_hint"),label:s("contenu_29668"),name:"emailTemplate.content",variables:u},`custom-${h}`),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{color:"invisible",onClick:()=>{e.batch(()=>{e.change("emailTemplate.subject",g.subject),e.change("emailTemplate.content",g.content)}),p(e=>e+1)},children:s("automatic_email_reset")})})]}),(0,i.jsx)(lC,{permissions:nC.EMAIL_EDIT,children:(0,i.jsx)(Xl,{justify:"end",children:(0,i.jsx)(yc,{isLoading:d,onClick:n,children:s("enregistrer_le_77369")})})})]})})},validate:c.validateForForm(l.updateEmailTemplateSchema()),width:1,onSubmit:async e=>{await r({organizationId:t,eventId:n,formId:null,source:null,emailTemplate:e.emailTemplate})}})},wJ=()=>{const{params:{organizationId:e,eventId:n,emailType:t},translate:s}=fc(),{event:{name:o}}=Ly(),a=_J.flatMap(({emails:e})=>e).find(e=>e.emailType===t);return fm(`${o} ${a?s(a.title):""}`),a?(0,i.jsxs)(AC,{children:[(0,i.jsx)(CC,{breadcrumbs:(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{children:s("communication_05277")}),(0,i.jsx)(gO,{to:Wo.EVENT_AUTOMATIC_EMAILS(e,n),children:s("automatic_emails")}),(0,i.jsx)(gO,{isCurrent:!0,to:Wo.EVENT_AUTOMATIC_EMAIL(e,n,a.emailType),children:s(a.title)})]}),name:s(a.title),subtext:s(a.description)}),(0,i.jsx)(yC,{children:(0,i.jsx)(EJ,{emailType:a.emailType,eventId:n,organizationId:e})})]}):(0,i.jsx)(Xr.rd,{to:Wo.EVENT_AUTOMATIC_EMAILS(e,n)})},$J=e=>{const{history:n,translate:t}=fc(),{data:s,loader:o}=rs("query EmailsTemplates($eventId: EventId!) {\n event(id: $eventId) {\n emailSender {\n ... on EmailsSender {\n domainStatus\n }\n }\n }\n}\n",{eventId:e.eventId},[],undefined);const[a,r]=(0,de.useState)(ln.Assignments);return o||(0,i.jsxs)(i.Fragment,{children:[(!s.event.emailSender||s.event.emailSender.domainStatus!==tn.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{gap:"4",width:1,children:[s.event.emailSender&&s.event.emailSender.domainStatus!==tn.Success&&(0,i.jsxs)(Tc,{alertStyle:"error",width:1,children:[(0,i.jsx)(zc,{children:t("vos_entr_es_dns_68834")}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Xl,{width:1,children:(0,i.jsx)(yc,{color:"invisible",css:{color:"inherit",px:"0","&:hover":{color:"inherit"}},rightIcon:"arrow-right",onClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:t("configurer_les_65453")})})})]}),!s.event.emailSender&&(0,i.jsxs)(Tc,{alertStyle:"warning",width:1,children:[(0,i.jsx)(zc,{children:t("aucun_metteur_26635",ee.EMAIL_FROM)}),(0,i.jsx)(Oc,{children:(0,i.jsx)(Xl,{width:1,children:(0,i.jsx)(yc,{color:"invisible",css:{color:"inherit",px:"0","&:hover":{color:"inherit"}},rightIcon:"arrow-right",onClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:t("configurer_les_56837")})})})]})]}),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(lD,{isSelected:a===ln.VolunteerRegistration,subtitle:t("cet_e_mail_est_75023"),title:t("UserInfoAdminCreate"),onClick:()=>r(ln.VolunteerRegistration)}),(0,i.jsx)(lD,{isSelected:a===ln.Assignments,subtitle:t("cet_e_mail_cont_98777"),title:t("affectation_u_11128"),onClick:()=>r(ln.Assignments)}),(0,i.jsx)(lD,{isSelected:a===ln.Refused,subtitle:t("cet_e_mail_est_69069"),title:t("refus_d_affecta_71455"),onClick:()=>r(ln.Refused)}),(0,i.jsx)(lD,{isSelected:a===ln.Accreditations,subtitle:t("cet_e_mail_cont_75798"),title:t("affectation_u_39802"),onClick:()=>r(ln.Accreditations)}),(0,i.jsx)(lD,{isSelected:a===ln.AccreditationsRefused,subtitle:t("cet_e_mail_est_69069"),title:t("refus_d_accr_di_89997"),onClick:()=>r(ln.AccreditationsRefused)}),(0,i.jsx)(lD,{isSelected:a===ln.DelegationCategoryLeaderAssign,subtitle:t("cet_e_mail_est_67392"),title:t("nomination_en_t_77654"),onClick:()=>r(ln.DelegationCategoryLeaderAssign)}),(0,i.jsx)(lD,{isSelected:a===ln.DelegationLeaderAssign,subtitle:t("email_sent_when_appointing_team_manager"),title:t("appointment_as_team_manager"),onClick:()=>r(ln.DelegationLeaderAssign)}),(0,i.jsx)(lD,{isSelected:a===ln.DelegationFormInvite,subtitle:t("cet_e_mail_est_19547"),title:t("envoi_du_formul_09434"),onClick:()=>r(ln.DelegationFormInvite)}),(0,i.jsx)(lD,{isSelected:a===ln.PositionLeaderAssign,subtitle:t("cet_e_mail_est_82173"),title:t("nomination_en_t_06971"),onClick:()=>r(ln.PositionLeaderAssign)}),(0,i.jsx)(lD,{isSelected:a===ln.PositionCategoryLeaderAssign,subtitle:t("cet_e_mail_est_70420"),title:t("nomination_en_t_02948"),onClick:()=>r(ln.PositionCategoryLeaderAssign)}),(0,i.jsx)(lD,{isSelected:a===ln.NotifyLeaders,subtitle:t("cet_e_mail_est_90425"),title:t("un_responsable_88525"),onClick:()=>r(ln.NotifyLeaders)}),(0,i.jsx)(lD,{isSelected:a===ln.Code,subtitle:t("cet_e_mail_est_49663"),title:t("code_20843"),onClick:()=>r(ln.Code)})]})]}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Xl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(gD,{emailType:a,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},TJ=()=>{const e=os(),{event:{name:n}}=Ly();fm(`${n} ${e("e_mails_09850")}`);const{organizationId:t,eventId:s}=ls();return(0,i.jsxs)(Xl,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)($J,{eventId:s,organizationId:t})]})};var zJ;let OJ=class extends ju{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||tt.None,accreditationFilter:e?.accreditationFilter||ot.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 Jl.Ik().shape({accreditationDisplay:Jl.Yj().required(this.t("la_strat_gie_d_70458")).oneOf($i,this.t("la_strat_gie_d_70458")),accreditationFilter:Jl.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(Oi,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:Jl.YO().of(Jl.ai()),showFullAccreditation:Jl.zM().required(),showAccreditationDescription:Jl.zM().required(),accreditationTitle:Jl.Yj(),accreditationSubtitle:Jl.Yj()})}updateFormParametersAccreditationsSchema(){return Jl.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};OJ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(zJ=void 0!==ts&&ts)?zJ:Object])],OJ);const RJ=e=>{const n=os(),{data:t,loader:s}=gr({eventId:e.eventId,loadIsBlocked:!1}),o=ss(Wg),[a,r]=(0,de.useState)(f(e.values.form.hiddenAccreditationsCategoriesIds)||f(e.values.form.hiddenAccreditationsIds)||f(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[d,l]=(0,de.useState)(f(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,de.useState)(f(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[m,g]=(0,de.useState)(f(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[h,p]=(0,de.useState)(f(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[I,x]=(0,de.useState)(f(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[_,j]=(0,de.useState)(f(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),v=(0,de.useMemo)(()=>(0,Tg.A)(t.event?.accreditationsCategories??[],e=>b(e.name)),[t.event]),S=(0,de.useMemo)(()=>v.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[v]),y=(0,de.useMemo)(()=>v.map(e=>{const n=rp(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[t.event]),C=(0,de.useMemo)(()=>Yp(o,v),[v]);return(0,i.jsx)(Xl,{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)(Zr,{font:"gray800 textSm semiBold",children:n("pr_f_rences_d_a_19371")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:"hidden"===a?"checked":"unchecked",onClick:n=>{"checked"===n&&(r("hidden"),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:n("cacher_des_cat_43848")}),(0,i.jsx)(ic,{height:"3"}),"hidden"===a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Zm,{state:d,onClick:n=>{l(n),"unchecked"===n&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:n("cacher_certaine_12220")}),"checked"===d&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:S})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:c,onClick:n=>{u(n),"unchecked"===n&&e.change("form.hiddenAccreditationsIds",[])},children:n("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:y})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:m,onClick:n=>{g(n),"unchecked"===n&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:n("cacher_certains_02997")}),"checked"===m&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:C})]})]}),(0,i.jsx)(ic,{height:"5"})]}),(0,i.jsx)(eg,{state:"displayed"===a?"checked":"unchecked",onClick:n=>{r("displayed"),"checked"===n&&(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]))},children:n("afficher_des_ca_68243")}),(0,i.jsx)(ic,{height:"3"}),"displayed"===a&&(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Zm,{state:h,onClick:n=>{p(n),"unchecked"===n&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:n("afficher_certai_88457")}),"checked"===h&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:S})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:I,onClick:n=>{x(n),"unchecked"===n&&e.change("form.displayedAccreditationsIds",[])},children:n("afficher_certai_29161")}),"checked"===I&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:y})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:_,onClick:n=>{j(n),"unchecked"===n&&e.change("form.displayedAccreditationsSlotsIds",[])},children:n("afficher_certai_38724")}),"checked"===_&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:C})]})]})]})})},DJ=e=>{const n=os(),[t,s]=(0,de.useState)(f(e.values.form.hiddenAccreditationsCategoriesIds)||f(e.values.form.hiddenAccreditationsIds)||f(e.values.form.hiddenAccreditationsSlotsIds)||f(e.values.form.displayedAccreditationsCategoriesIds)||f(e.values.form.displayedAccreditationsIds)||f(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{value:t,onChange:n=>{s(n),n||(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:n("afficher_masq_37398")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(RJ,{change:e.change,eventId:e.eventId,values:e.values})]})]})},MJ=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ny(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),{isNotSavedModalOpen:o,onClose:a,onNotSavedClose:r,onSave:d}=jD(e.initialValues,e.values,e.handleSubmit),l=e.slotDisplay!==at.Hide;return(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:d,children:n("enregistrer_06519")}),title:e.name,onClose:a,children:(0,i.jsx)(_D,{isNotSavedOpen:o,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{font:"gray800 textMd semiBold",children:n("param_tres_des_90955")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("comment_souhait_18471")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"form.accreditationDisplay",value:tt.Accreditation,children:n("afficher_les_ac_56952")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.accreditationDisplay",value:tt.None,children:n("ne_rien_affiche_81467")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("personnalisatio_86385")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Jx,{name:"form.showFullAccreditation",children:n("afficher_les_ac_56062")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(DJ,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("affichage_des_d_57491")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Bx,{name:"form.showAccreditationDescription",children:n("afficher_la_des_94587")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{font:"gray800 textMd semiBold",children:n("filtrer_les_acc_57840")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("d_cider_si_le_c_31187")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"form.accreditationFilter",value:ot.FilterWithSlots,children:n("filtrer_les_acc_66152")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.accreditationFilter",value:ot.None,children:n("ne_pas_filtrer_97321")})]}),(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{font:"gray800 textMd semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_44808")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:n("description_58935"),name:"form.accreditationSubtitle",variables:s})]})})})},PJ=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("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:t},[],undefined);fm(s.organization?.form.name??"");const a=ss(ec),r=ss(OJ),{mutate:d,isLoading:l}=function(e={}){return ds("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=(0,de.useMemo)(()=>({form:r.formParametersAccreditationsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:a})=>(0,i.jsx)(MJ,{change:e.change,eventId:n,handleSubmit:t,initialValues:c,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay||at.Hide,values:a}),validate:a.validateForForm(r.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})};var kJ;let FJ=class extends ju{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return Jl.Ik().shape({name:Jl.Yj().nullable(),startTime:Jl.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:Jl.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}};FJ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(kJ=void 0!==ts&&ts)?kJ:Object])],FJ);var NJ,LJ;let UJ=class extends ju{customSlotInputService;constructor(e,n){super(e),this.customSlotInputService=n}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}}customSlotPeriodInputSchema(){return Jl.Ik().shape({customSlotPeriod:Jl.Ik().shape({name:Jl.Yj(),customSlots:Jl.YO().of(this.customSlotInputService.customSlotInputSchema()).required("").min(1,"")})})}};UJ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(NJ=void 0!==ts&&ts)?NJ:Object,"function"==typeof(LJ=void 0!==FJ&&FJ)?LJ:Object])],UJ);var VJ;let BJ=class extends ju{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||at.Hide,minNumberOfSlots:e?.minNumberOfSlots??1,daysDisplay:e?.daysDisplay||it.AllDays,customSlotsPeriods:(e?.customSlotsPeriods??[]).map(e=>(0,Rr.A)(e,["id","conditionCustomField"])),slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return Jl.Ik().shape({slotDisplay:Jl.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(Ri,this.t("la_strat_gie_d_34961")),daysDisplay:Jl.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(Ti,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return Jl.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};BJ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(VJ=void 0!==ts&&ts)?VJ:Object])],BJ);const WJ=e=>{const n=os(),t=ss(UJ),s=ss(FJ);return(0,i.jsx)(Yf,{isOpen:!0,onClose:e.onClose,children:(0,i.jsx)(Hf,{children:(0,i.jsx)(Fc,{direction:"column",hideDefaultErrors:!0,initialValues:{customSlotPeriod:e.customSlotPeriod},render:({form:t,handleSubmit:o,submitting:a,values:r})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qf,{icon:"sliders-up",subtitle:n("param_trer_les_33935"),children:n("mise_jour_de_14984")}),(0,i.jsxs)(Gf,{css:{overflowY:"auto"},gap:"7",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mc,{hideSpacer:!0}),(0,i.jsx)(pu,{hint:n("le_nom_de_la_p_49293"),label:(0,i.jsx)($S,{children:n("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wx,{label:(0,i.jsx)($S,{children:n("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(Wx,{label:(0,i.jsx)($S,{children:n("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Jx,{name:"customSlotPeriod.hasCondition",children:n("conditionner_l_33629")}),r.customSlotPeriod.hasCondition&&(0,i.jsx)(Xl,{css:{background:"$gray50",bd:!0,padding:"$4"},direction:"column",gap:"4",children:(0,i.jsx)(JR,{conditionCustomFieldId:r.customSlotPeriod.conditionCustomFieldId,conditionCustomFields:e.conditionCustomFields,conditionValue:r.customSlotPeriod.conditionValue,setConditionCustomFieldId:n=>{const i=e.conditionCustomFields.find(e=>e.id===n);i&&(t.change("customSlotPeriod.conditionValue",i.fieldType===_n.Checkbox||[]),t.change("customSlotPeriod.conditionCustomFieldId",n))},setConditionValue:e=>{t.change("customSlotPeriod.conditionValue",e)}})})]})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("cr_neaux_person_16330")}),r.customSlotPeriod.customSlots.map((e,s)=>{const o=`customSlotPeriod.customSlots[${s}].`;return(0,i.jsxs)(Xl,{align:"end",gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(pu,{label:n("nom_du_cr_neau_54351"),name:`${o}name`})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(iy,{label:n("SlotStart"),name:`${o}startTime`})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(iy,{label:n("SlotEnd"),name:`${o}endTime`})}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",onClick:()=>{t.change("customSlotPeriod.customSlots",y(r.customSlotPeriod.customSlots,s))}})]},s)}),(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{t.change("customSlotPeriod.customSlots",[...r.customSlotPeriod.customSlots,s.customSlotInputDefault()])},children:n("ajouter_un_cr_n_63607")})]}),r.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("options_d_affic_10797")}),(0,i.jsx)(Jx,{name:"customSlotPeriod.hideNameDates",children:n("masquer_les_inf_78021")}),(0,i.jsx)(Jx,{name:"customSlotPeriod.displayAsCalendar",children:n("afficher_les_di_90328")})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{isLoading:a,onClick:o,children:n("mettre_jour_l_81276")})})]}),schema:t.customSlotPeriodInputSchema(),onSubmit:async n=>{await e.onSuccess(n.customSlotPeriod),e.onClose()}})})})},GJ=e=>{const n=os(),t=ss(Wg),[s,o]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray900 textSm semiBold",children:w(e.customSlotPeriod.name)?e.customSlotPeriod.name:n("p_riode_de_l_v_78032")}),(0,i.jsxs)(Zr,{color:"gray500",children:[e.customSlotPeriod.startDate?t.toLocaleString(e.customSlotPeriod.startDate,da.DateOnly.WeekdayLongMonthLong):n("d_but_le_l_v_n_58366")," ","-"," ",e.customSlotPeriod.endDate?t.toLocaleString(e.customSlotPeriod.endDate,da.DateOnly.WeekdayLongMonthLong):n("fin_de_l_v_nem_88380")," ","- ",n("creneau",e.customSlotPeriod.customSlots.length)]})]}),(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),s&&(0,i.jsx)(WJ,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>o(!1),onSuccess:async n=>{e.updateCustomSlotPeriod(n,e.index)}})]})},qJ=e=>{const n=os();return(0,i.jsxs)(Xl,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((n,t)=>(0,i.jsx)(GJ,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:n,event:e.event,index:t,remove:()=>{e.remove(t)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},t)),(0,i.jsxs)(Xl,{align:"center",css:{color:"$primary500",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(pc,{icon:"plus"}),(0,i.jsx)(Zr,{children:n("ajouter_une_p_r_04249")})]})]})},HJ=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ny(["user",...t?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),o=ss(UJ),{isNotSavedModalOpen:a,onClose:r,onNotSavedClose:d,onSave:l}=jD(e.initialValues,e.values,e.handleSubmit),c=(0,de.useCallback)(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,o.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),u=(0,de.useCallback)(n=>{e.form.change("form.customSlotsPeriods",y(e.values.form.customSlotsPeriods,n))},[e.values.form.customSlotsPeriods,e.form.change]),m=(0,de.useCallback)((n,t)=>{const i=[...e.values.form.customSlotsPeriods];i[t]=n,e.form.change("form.customSlotsPeriods",i)},[e.values.form.customSlotsPeriods,e.form.change]),g=e.values.form.slotDisplay===at.Custom,h=e.values.form.slotDisplay===at.DisplayDays||e.values.form.slotDisplay===at.Calendar||e.values.form.slotDisplay===at.Custom;return(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:l,children:n("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(_D,{isNotSavedOpen:a,onNotSavedClose:d,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Wv,{heading:n("affichage_des_d_20852"),role:"radiogroup",subtitle:n("personnaliser_l_64536"),children:[(0,i.jsx)(gy,{name:"form.slotDisplay",value:at.Display,children:n("demander_au_mem_07520")}),(0,i.jsx)(gy,{name:"form.slotDisplay",value:at.DisplayDays,children:n("demander_au_mem_50067")}),(0,i.jsx)(gy,{name:"form.slotDisplay",value:at.Calendar,children:n("demander_au_mem_60083")}),(0,i.jsx)(gy,{name:"form.slotDisplay",value:at.Custom,children:n("demander_au_mem_31132")}),g&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(qJ,{add:c,conditionCustomFields:e.conditionCustomFields,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:u,updateCustomSlotPeriod:m})}),(0,i.jsx)(gy,{name:"form.slotDisplay",value:at.Hide,children:n("ne_pas_demander_46686")})]}),e.values.form.slotDisplay!==at.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("nombre_de_dispo_22220")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("le_membre_soit_74069")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(pu,{name:"form.minNumberOfSlots",shouldParseAsInt:!0})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("filtrer_les_dis_80634")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("d_cider_de_filt_81078")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"form.daysDisplay",value:it.AllDays,children:n("afficher_l_ense_11531")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.daysDisplay",value:it.DaysWithSlots,children:n("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==at.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"7"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_44808")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:n("description_58935"),name:"form.slotSubtitle",variables:s})]})]})})})},YJ=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("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:n,formId:t},[Ko.FormCustomFieldsFragment,Ko.FormSlotsOptionsFragment,Ko.FormRegisterCustomSlotPeriodFragment],undefined);fm(s.organization?.form.name??"");const a=ss(ec),r=ss(BJ),{mutate:d,isLoading:l}=function(e={}){return ds("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,de.useMemo)(()=>(s.organization?.formCustomFields.nodes??[]).filter(e=>[_n.Checkbox,_n.Country,_n.Language,_n.Nationality,_n.Select].includes(e.fieldType)),[s.organization]),u=(0,de.useMemo)(()=>({form:r.formParametersAvailabilitiesInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:u,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(HJ,{conditionCustomFields:c,event:s.event,form:e,handleSubmit:n,initialValues:u,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",values:t}),validate:a.validateForForm(r.updateFormParametersAvailabilitiesSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})};var ZJ;let KJ=class extends ju{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||st.None,positionFilter:e?.positionFilter||ot.FilterWithSlots,positionRanking:e?.positionRanking||Cn.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 Jl.Ik().shape({positionDisplay:Jl.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(zi,this.t("la_strat_gie_d_44170")),positionFilter:Jl.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(Oi,this.t("la_strat_gie_de_13294")),positionRanking:Jl.Yj().required(this.t("le_type_de_clas_66819")).oneOf(gi,this.t("le_type_de_clas_66819")),positionLimit:Jl.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:Jl.YO().of(Jl.ai()),hiddenPositionsIds:Jl.YO().of(Jl.ai()),hiddenPositionsSlotsIds:Jl.YO().of(Jl.ai()),hiddenPositionsTagsIds:Jl.YO().of(Jl.ai()),displayedPositionsCategoriesIds:Jl.YO().of(Jl.ai()),displayedPositionsIds:Jl.YO().of(Jl.ai()),displayedPositionsSlotsIds:Jl.YO().of(Jl.ai()),displayedPositionsTagsIds:Jl.YO().of(Jl.ai()),showFullPosition:Jl.zM().required(),showPositionCategoryDescription:Jl.zM().required(),showPositionDescription:Jl.zM().required(),positionTitle:Jl.Yj(),positionSubtitle:Jl.Yj(),willAutoAssign:Jl.zM().required()})}updateFormParametersMissionsSchema(){return Jl.Ik().shape({form:this.formParametersMissionsInputSchema()})}};KJ=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(ZJ=void 0!==ts&&ts)?ZJ:Object])],KJ);const XJ=e=>(0,i.jsxs)(Xl,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(Xl,{align:"center",css:{background:"$primary500",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(pc,{icon:"check"})}),(0,i.jsx)(Zr,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary500":"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)(Zr,{font:"gray800 textSm semiBold",children:e.name})]}),QJ=e=>{const n=os(),{data:t,loader:s}=rs("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},[],undefined);const o=ss(Nh),[a,r]=(0,de.useState)(f(e.values.form.hiddenPositionsCategoriesIds)||f(e.values.form.hiddenPositionsIds)||f(e.values.form.hiddenPositionsSlotsIds)||f(e.values.form.hiddenPositionsTagsIds)?"hidden":"displayed"),[d,l]=(0,de.useState)(f(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,de.useState)(f(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[m,g]=(0,de.useState)(f(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[h,p]=(0,de.useState)(f(e.values.form.hiddenPositionsTagsIds)?"checked":"unchecked"),[I,x]=(0,de.useState)(f(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[_,j]=(0,de.useState)(f(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[v,S]=(0,de.useState)(f(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),[y,C]=(0,de.useState)(f(e.values.form.displayedPositionsTagsIds)?"checked":"unchecked"),A=(0,de.useMemo)(()=>(0,Tg.A)(t.event?.positionsCategories??[],e=>b(e.name)),[t.event]),E=(0,de.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]),w=(0,de.useMemo)(()=>Zp(o,A),[A,o]),$=(0,de.useMemo)(()=>(0,Tg.A)(t.organization?.tags.nodes??[],e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[t.organization]);return(0,i.jsx)(Xl,{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)(Zr,{font:"gray800 textSm semiBold",children:n("pr_f_rences_d_a_19371")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:"hidden"===a?"checked":"unchecked",onClick:n=>{"checked"===n&&(r("hidden"),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:n("cacher_des_cat_31908")}),(0,i.jsx)(ic,{height:"3"}),"hidden"===a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Zm,{state:d,onClick:n=>{l(n),"unchecked"===n&&e.change("form.hiddenPositionsCategoriesIds",[])},children:n("cacher_certaine_12220")}),"checked"===d&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{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)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:c,onClick:n=>{u(n),"unchecked"===n&&e.change("form.hiddenPositionsIds",[])},children:n("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:E})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:m,onClick:n=>{g(n),"unchecked"===n&&e.change("form.hiddenPositionsSlotsIds",[])},children:n("cacher_certains_02997")}),"checked"===m&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:w})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:h,onClick:n=>{p(n),"unchecked"===n&&e.change("form.hiddenPositionsTagsIds",[])},children:n("cacher_certains_66424")}),"checked"===h&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsTagsIds",children:$})]})]}),(0,i.jsx)(ic,{height:"5"})]}),(0,i.jsx)(eg,{state:"displayed"===a?"checked":"unchecked",onClick:n=>{r("displayed"),"checked"===n&&(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]))},children:n("afficher_des_ca_37473")}),(0,i.jsx)(ic,{height:"3"}),"displayed"===a&&(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(Zm,{state:I,onClick:n=>{x(n),"unchecked"===n&&e.change("form.displayedPositionsCategoriesIds",[])},children:n("afficher_certai_88457")}),"checked"===I&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{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)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:_,onClick:n=>{j(n),"unchecked"===n&&e.change("form.displayedPositionsIds",[])},children:n("affficher_certa_32341")}),"checked"===_&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:E})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:v,onClick:n=>{S(n),"unchecked"===n&&e.change("form.displayedPositionsSlotsIds",[])},children:n("afficher_certai_38724")}),"checked"===v&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:w})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zm,{state:y,onClick:n=>{C(n),"unchecked"===n&&e.change("form.displayedPositionsTagsIds",[])},children:n("afficher_certai_47793")}),"checked"===y&&(0,i.jsxs)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Kx,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsTagsIds",children:$})]})]})]})})},JJ=e=>{const n=os(),[t,s]=(0,de.useState)(f(e.values.form.hiddenPositionsCategoriesIds)||f(e.values.form.hiddenPositionsIds)||f(e.values.form.hiddenPositionsSlotsIds)||f(e.values.form.hiddenPositionsTagsIds)||f(e.values.form.displayedPositionsCategoriesIds)||f(e.values.form.displayedPositionsIds)||f(e.values.form.displayedPositionsSlotsIds)||f(e.values.form.displayedPositionsTagsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oI,{value:t,onChange:n=>{s(n),n||(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:n("afficher_masq_74825")}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(QJ,{change:e.change,eventId:e.eventId,organizationId:e.organizationId,values:e.values})]})]})},e0=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ny(["user",...s?["event"]:[],"organization"],{eventsCustomFields:!1,usersCustomFields:"form"}),{isNotSavedModalOpen:a,onClose:r,onNotSavedClose:d,onSave:l}=jD(e.initialValues,e.values,e.handleSubmit),c=e.slotDisplay!==at.Hide&&e.values.form.positionDisplay!==st.None;return(0,i.jsx)(CR,{button:(0,i.jsx)(yc,{isLoading:e.isMutateLoading,onClick:l,children:n("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(_D,{isNotSavedOpen:a,onNotSavedClose:d,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("param_tres_des_93365")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("d_cider_du_type_01830")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"8",children:[(0,i.jsx)(XJ,{isSelected:e.values.form.positionRanking===Cn.Unranked,name:n("choix_illimit_s_72460"),src:Yu.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",Cn.Unranked)}}),(0,i.jsx)(XJ,{isSelected:e.values.form.positionRanking===Cn.Ranked,name:n("classement_des_43897"),src:Yu.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",Cn.Ranked),e.values.form.positionDisplay===st.None&&e.change("form.positionDisplay",st.Position)}})]}),e.values.form.positionRanking===Cn.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(pu,{label:n("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)(Yj,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("affichage_des_m_65982")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_26207")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("comment_souhait_23788")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"form.positionDisplay",value:st.Category,children:n("afficher_les_ca_26287")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.positionDisplay",value:st.Position,children:n("afficher_les_mi_31841")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.positionDisplay",value:st.Slot,children:n("afficher_les_cr_32311")}),e.values.form.positionRanking===Cn.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.positionDisplay",value:st.None,children:n("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==st.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("personnalisatio_94071")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Jx,{name:"form.showFullPosition",children:n("afficher_les_mi_35510")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(JJ,{change:e.change,eventId:s,organizationId:t,values:e.values}),e.values.form.positionRanking!==Cn.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:n("affichage_des_d_57491")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Bx,{name:"form.showPositionCategoryDescription",children:n("afficher_la_des_67852")}),e.values.form.positionDisplay!==st.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Bx,{name:"form.showPositionDescription",children:n("afficher_la_des_21998")})]})]}),(0,i.jsx)(Yj,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("automatisation_49411")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("d_cider_si_l_af_60345")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Jx,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===st.Category?n("la_pr_affectat_61978"):e.values.form.positionDisplay===st.Position?n("la_pr_affectat_20431"):n("l_affectation_s_68435")})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("filtrer_les_cat_63783")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("d_cider_si_le_c_98644")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"form.positionFilter",value:ot.FilterWithSlots,children:n("filtrer_les_cat_52780")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(gy,{name:"form.positionFilter",value:ot.None,children:n("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==st.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yj,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:n("personnalisatio_15893")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:n("personnaliser_l_44808")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:n("description_58935"),name:"form.positionSubtitle",variables:o})]})]})})})},n0=()=>{const{params:{organizationId:e,eventId:n,formId:t}}=fc(),{data:s,loader:o}=rs("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:t},[],undefined);fm(s.organization?.form.name??"");const a=ss(ec),r=ss(KJ),{mutate:d,isLoading:l}=function(e={}){return ds("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=(0,de.useMemo)(()=>({form:r.formParametersMissionsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:t})=>(0,i.jsx)(e0,{change:e.change,handleSubmit:n,initialValues:c,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay??at.Hide,values:t}),validate:a.validateForForm(r.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>d({organizationId:e,eventId:n,formId:t,form:i.form})})},t0=e=>{const n=os(),t=ss(Wg),s=zg(),o=e.endpoint.params.some(e=>"endDate"===e.name),a=(0,de.useMemo)(()=>(0,Tg.A)(e.data.event.accreditationsCategories,e=>b(e.name)),[e.data.event]),r=(0,de.useMemo)(()=>(0,Tg.A)(e.data.event.positionsCategories,e=>b(e.name)),[e.data.event]),d=(0,de.useMemo)(()=>(0,wh.A)(e.data.event.formsCustomsFields.concat(e.data.organization.usersInfosCustomFields.nodes),e=>e.slug),[e.data]),l={accreditationsCategoriesIds:n("cat_gories_d_ac_73496"),accreditationsIds:n("accr_ditations_39450"),accreditationsSlotsIds:n("cr_neaux_33401"),columns:n("colonnes_73889"),date:n(o?"date_de_d_but_43380":"Date"),delimiter:n("s_parateur_36232"),endDate:n("date_de_fin_86920"),includeLeaders:n("reponsable_82458"),includeMembers:n("membres_11310"),positionCategoryId:n("Catégorie de missions"),positionId:n("Position"),slugs:n("champs_91671"),sortAttribute:n("trier_par_05826"),sortDirection:n("ordre_78726"),state:n("statut_d_affect_57444"),states:n("statut_d_accr_d_75527")},c={assigned:n("attribu_es_48167"),quota:n("quota_00069"),scanned:n("scann_es_13169"),wished:n("souhait_es_78101"),[bt.AccreditationState]:n("statut_d_accr_d_75527"),[bt.Delegation]:n("Delegation"),[bt.Email]:n("e_mail_13869"),[bt.FirstName]:n("pr_nom_66988"),[bt.Id]:n("id_51738"),[bt.InsertedAt]:n("date_d_inscript_31369"),[bt.LastName]:n("nom_08311"),[bt.LocalId]:n("id_sur_l_v_nem_01171"),[bt.Name]:n("Nom complet"),[bt.PairedAt]:n("Date d'appairage"),[bt.State]:n("statut_d_affect_57444"),[bt.TeamCode]:n("code_quipe_14296"),[bt.UpdatedAt]:n("date_de_mise_74553"),[ut.Asc]:n("croissant_68432"),[ut.Desc]:n("d_croissant_08512")},u=e=>"slugs"===e.type?"all"===e.emptyMeans?n("tous_les_champs_57939"):n("aucun_champ_23523"):"states"===e.name?n("tous_les_status_67644"):n("tous_39916"),m=o=>{const m=e.values[o.name],g=l[o.name]??o.name,h=void 0===o.requires||void 0!==e.values[o.requires]&&null!==e.values[o.requires]&&""!==e.values[o.requires]?void 0:"disabled",p={flex:"1 1 0",minWidth:"160px"},I=n=>e.onChange(o.name,n);switch(o.type){case"boolean":return(0,i.jsxs)(nf,{css:p,label:g,shouldParseAsBoolean:!0,value:!0===m,onChange:I,children:[(0,i.jsx)("option",{value:"false",children:n("ne_pas_les_incl_04166")}),(0,i.jsx)("option",{value:"true",children:n("les_inclure_90965")})]},o.name);case"date":return(0,i.jsx)(df,{css:p,label:g,state:h,value:"string"==typeof m?m:null,onChange:e=>{I(e.isValid?e.toFormat("yyyyMMdd"):null)}},o.name);case"delimiter":return(0,i.jsxs)(nf,{css:p,label:g,value:"string"==typeof m?m:"",onChange:I,children:[(0,i.jsx)("option",{value:"",children:n("virgule_par_d_64346")}),(0,i.jsx)("option",{value:";",children:n("point_virgule_15722")}),(0,i.jsx)("option",{value:"\t",children:n("tabulation_85540")})]},o.name);case"enum":case"ids":case"slugs":{const l="enum"===o.type?(e=>e.every(e=>void 0!==c[e])?e.map(e=>(0,i.jsx)("option",{value:e,children:c[e]},e)):s([...e]))(o.values):"ids"===o.type?(e=>{switch(e.resource){case"accreditationsCategories":return a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id));case"accreditations":return a.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:rp(e.accreditations).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id));case"accreditationsSlots":return Yp(t,a);case"positionsCategories":return r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id));case"positions":return r.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Tg.A)(e.positions,e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))}})(o):(t=>{const s=t.variety===Ke.Position?e.data.organization.positionsCustomFields.nodes:d;return[...(t.extraSlugs??[]).map(e=>(0,i.jsx)("option",{value:e,children:"description"===e?n("Description"):e},e)),...s.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))]})(o);if("slugs"===o.type||o.multiple)return(0,i.jsx)(lg,{css:p,isSearchVisible:!0,isSelectAllVisible:!0,label:g,multiple:!0,placeholder:u(o),renderOnPortal:!0,state:h,values:Array.isArray(m)?m:[],onChange:I,children:l},o.name);{const e="ids"===o.type||void 0===o.defaultValue;return(0,i.jsxs)(nf,{css:p,label:g,shouldParseAsInt:"ids"===o.type,state:h,value:null==m?"":m.toString(),onChange:e=>{I("number"==typeof e&&Number.isNaN(e)?null:e)},children:[e&&(0,i.jsx)("option",{value:"",children:"positionId"===o.name?n("toutes_les_miss_87817"):"positionCategoryId"===o.name?n("toutes_les_cat_63746"):"sortAttribute"===o.name?n("aucun_tri_90071"):n("tous_les_status_67644")}),l]},o.name)}}}};return(0,i.jsx)(Xl,{direction:"column",gap:"6",children:(0,HX.A)(e.endpoint.params,5).map((e,n)=>(0,i.jsx)(Xl,{align:"start",css:{columnGap:"$4",rowGap:"$6"},wrap:"wrap",children:e.map(m)},n))})},i0=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{user:o}=ps(),{isLoading:a,copy:r}=ay(),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)("api"),[m,g]=(0,de.useState)(()=>LG(e.endpoint)),h=Ax({organizationId:t,eventId:s,lang:o?.language,pathComponent:e.endpoint.path,key:e.data.event.key,searchParams:UG(e.endpoint,m)}),p="sheets"===c?`=IMPORTDATA("${h}")`:h,I=function(e,n){const t=UG(e,n);return e.params.filter(e=>void 0!==t[e.name]&&("enum"!==e.type||e.defaultValue!==t[e.name])).length}(e.endpoint,m),f="string"==typeof m.delimiter&&""!==m.delimiter&&","!==m.delimiter;return(0,i.jsxs)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs",padding:"$5 $6"},direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsxs)(Xl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsxs)(Xl,{css:{minWidth:"0"},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",wrap:"wrap",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:e.title}),I>0&&(0,i.jsx)(Lm,{color:"primary",children:n("_1_param_tre_m_53568",I)})]}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:e.description})]}),(0,i.jsx)(yc,{color:"white",css:{flexShrink:"0"},leftIcon:"sliders-up",rightIcon:d?"chevron-up":"chevron-down",onClick:()=>l(!d),children:n("personnaliser_84232")})]}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(hu,{css:{flex:"1",minWidth:"0","& .h-styled-input-container":{background:"white"}},state:"disabled",value:p,onChange:Ou.A}),(0,i.jsx)(yc,{isLoading:a,leftIcon:"copy",onClick:()=>r(p),children:n("copier_75889")})]})]}),d&&(0,i.jsxs)(Xl,{css:{borderTop:"1px solid $gray200",paddingTop:"$5"},direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{css:{maxWidth:"100%",width:"280px"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:n("Format du lien")}),(0,i.jsxs)(RS,{color:"primary",selectedItem:c,onChange:e=>u(e),children:[(0,i.jsx)(DS,{item:"api",children:"API"}),(0,i.jsx)(DS,{item:"sheets",children:"Google Sheet"})]})]}),"sheets"===c&&f&&(0,i.jsx)(Tc,{alertStyle:"warning",children:(0,i.jsx)(Oc,{children:n("google_sheets_a_66636")})}),(0,i.jsx)(t0,{data:e.data,endpoint:e.endpoint,values:m,onChange:(e,n)=>{g(t=>({...t,[e]:n}))}}),(0,i.jsxs)(Xl,{align:"center",gap:"3",justify:"between",wrap:"wrap",children:[(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:n("les_param_tres_72412")}),(0,i.jsx)(yc,{color:"invisible-gray",leftIcon:"rotate-left",onClick:()=>g(LG(e.endpoint)),children:n("r_initialiser_l_27814")})]})]})]})},s0=e=>{const{translate:n}=fc(),{hasFeature:t}=Yy(),s={assignments:n("affectations_de_70985"),accreditations:n("accr_ditations_55053"),"accreditations-matrix":n("accr_ditations_29354"),"accreditations-slots":n("cr_neaux_d_accr_44687"),positions:n("missions_63972"),"delegations-matrix":n("d_l_gations_sou_41605")},o={assignments:n("exporter_vos_me_66217"),accreditations:n("exporter_toutes_28045"),"accreditations-matrix":n("exporter_toutes_67075"),"accreditations-slots":n("liste_des_cr_ne_56641"),positions:n("liste_des_missi_29192"),"delegations-matrix":n("accr_ditations_29277")};return(0,i.jsx)(Xl,{direction:"column",gap:"3",width:1,children:NG.filter(e=>void 0===e.feature||t(e.feature)).map(n=>(0,i.jsx)(i0,{data:e.data,description:o[n.path],endpoint:n,title:s[n.path]},n.path))})},o0=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{event:{name:s}}=Ly();fm(`${s} API`);const{hasFeature:o}=Yy(),{data:a,loader:r}=rs("query EventApi($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n usersInfosCustomFields: customFields(\n variety: UserInfo\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n slug\n name\n }\n }\n\n positionsCustomFields: customFields(\n variety: Position\n privacy: All\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n slug\n name\n }\n }\n }\n\n event(id: $eventId) {\n key\n\n formsCustomsFields {\n slug\n name\n }\n\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n }\n }\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n acronym\n accreditationDisplay\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:t},[],undefined);return r||(0,i.jsxs)(AC,{children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(Tc,{alertStyle:"primary",children:(0,i.jsx)(Oc,{children:e("l_api_permet_de_66672",nm)})}),(0,i.jsx)(ic,{height:"7"}),o(In.Api)?(0,i.jsx)(s0,{data:a}):(0,i.jsx)(Xl,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(Pv,{icon:"code-branch"})})]})]})},a0=[fn.Eid,fn.FirstName,fn.LastName,fn.Picture,fn.Population],r0=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{event:s}=Ly();fm(`${s.name} Weezevent`);const{data:o}=rs("query WeezeventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 weezaccessEventId\n isWeezaccessSynchronized\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:n,eventId:t},[],undefined);const{mutate:a}=function(e={}){return ds("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n id\n }\n}\n",e)}(),r=o.event?.isWeezaccessSynchronized??!1,d=(0,de.useMemo)(()=>(0,Tg.A)(o.organization?.customFields.nodes??[],e=>b(e.name)).filter(e=>!a0.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),l=(0,de.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]),c=(0,de.useMemo)(()=>(0,Tg.A)(o.event?.accreditationsCategories??[],e=>b(e.name)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,Tg.A)(e.accreditations,e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]),u=(0,de.useMemo)(()=>(0,Tg.A)(o.organization?.weezaccessEvents??[],e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o]);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(yC,{children:(0,i.jsx)(Fc,{initialValues:{accreditationsIds:o.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:o.event?.weezevent?.customFieldsSlugs||[],segmentsIds:o.event?.weezevent?.segmentsIds||[],weezaccessEventId:o.event?.weezaccessEventId??null},render:({handleSubmit:n,submitting:t})=>(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Kx,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:d}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:l}),(0,i.jsx)(Kx,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:c}),(0,i.jsx)(Kx,{hint:r?e("la_synchronisat"):void 0,isSearchVisible:!0,label:e("id_de_l_v_neme_87336"),name:"weezaccessEventId",state:r?"disabled":void 0,children:u}),(0,i.jsx)(lC,{permissions:nC.WEEZEVENT_EDIT,children:(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:t,onClick:n,children:e("enregistrer_06519")})})})]}),onSubmit:({weezaccessEventId:e,...n})=>a({eventId:t,weezevent:r?n:{...n,weezaccessEventId:e}})})})]})};let d0=class{positionsCustomFieldInputSchema(){return Jl.Ik().shape({customFieldId:Jl.ai().required(),conditionValue:Jl.gl().required()})}};d0=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)()],d0);var l0;let c0=class extends ju{constructor(e){super(e)}positionsSlotInputDefault(e,n){return{id:n?.id,name:n?.name??"",startDate:n?.startDate??e,startTime:n?.startTime??e.toFormat("HH:mm"),endDate:n?.endDate??e,endTime:n?.endTime??e.plus({hour:1}).toFormat("HH:mm"),resources:n?.resources??1,assignedResources:n?.assignedResources}}createPositionSlotSchema(){return Jl.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return Jl.Ik().shape({name:Jl.Yj(),startDate:e_.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:Jl.Yj().required(this.t("heure_de_d_but_90785")),endDate:e_.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,n)=>Jo.c9.isDateTime(n.parent.startDate)&&n.parent.startDate.isValid&&Jo.c9.isDateTime(n.parent.endDate)&&n.parent.endDate.isValid&&n.parent.endDate>=n.parent.startDate),endTime:Jl.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,n)=>{const t=Jo.c9.isDateTime(n.parent.startDate)&&n.parent.startDate.isValid,i=Bh(n.parent.startTime),s=Jo.c9.isDateTime(n.parent.endDate)&&n.parent.endDate.isValid,o=Bh(n.parent.endTime);if(t&&i&&s&&o){const[e,t]=Wh(n.parent.startTime),[i,s]=Wh(n.parent.endTime);return n.parent.startDate.set({hours:e,minutes:t})=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(l0=void 0!==ts&&ts)?l0:Object])],c0);var u0,m0,g0;let h0=class extends ju{positionsCustomFieldInputService;positionsSlotInputService;constructor(e,n,t){super(t),this.positionsCustomFieldInputService=e,this.positionsSlotInputService=n}positionInputDefault(e,{positionCategoryId:n,layer:t,latitude:i,longitude:s,startAt:o}){let a=e?.category.id??n;return Number.isInteger(a)||(a=null),{positionCategoryId:a,name:e?.name??"",description:e?.description??"",privateNote:e?.privateNote??"",acronym:e?.acronym??"",color:e?.color??Lr.colors.primary500.value,icon:e?.icon??En.LocationDot,weezeventIsSynchronized:e?.weezeventIsSynchronized??!1,address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??s??null,zoom:e?.zoom??sd,layer:e?.layer??t,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(o)],positionDisplay:e?.positionDisplay??Ln.List,conditionsOperator:e?.conditionsOperator??Ge.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(e){const n=this.positionInputSchema();return Jl.Ik().shape({position:e?n.shape({fields:e}):n})}positionInputSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:Jl.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:Jl.Yj(),color:Jl.Yj().required(this.t("la_couleur_est_95740")),icon:Jl.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(pi,this.t("l_ic_ne_est_req_15843")),description:Jl.Yj(),privateNote:Jl.Yj(),address:Jl.Yj().nullable(),latitude:Jl.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:Jl.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:Jl.YO().of(Jl.ai()),slots:Jl.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionDisplay:Jl.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Ci,this.t("le_type_d_affic_60154")),positionsCustomFields:Jl.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:Jl.YO().of(Jl.ai())})}};h0=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(u0=void 0!==d0&&d0)?u0:Object,"function"==typeof(m0=void 0!==c0&&c0)?m0:Object,"function"==typeof(g0=void 0!==ts&&ts)?g0:Object])],h0);const p0=e=>{const{mutate:n}=function(e={}){return ds("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(UA,{initialName:"",isEdit:!1,mutate:async t=>{const{positionCategoryCreate:i}=await n({eventId:e.eventId,positionCategory:{name:t}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},I0=e=>{const{mutate:n}=function(e={}){return ds("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)(UA,{initialName:e.positionCategoryName,isEdit:!0,mutate:async t=>{const{positionCategoryUpdate:i}=await n({eventId:e.eventId,positionCategoryId:e.positionCategoryId,positionCategory:{name:t}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},f0=(0,de.memo)(function(e){const{params:{eventId:n},translate:t}=fc(),[s,o]=(0,de.useState)(iA(e.event.positionsCategories)),{hasEventRole:a}=Ly(),{canPositionEdit:r}=tC(),d=a&&r,[l,c]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(pu,{label:t("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Kx,{createText:t("cr_er_une_nouve_72722"),isCreateVisible:d,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{c(!0)},children:s.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:t("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wb,{label:t("Color"),name:"position.color"}),(0,i.jsx)(Zb,{label:t("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:t("description_58935")}),name:"position.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{align:"center",gap:"3",children:[(0,i.jsx)(Jx,{name:"position.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(pc,{icon:"circle-info"})})}),(0,i.jsx)(ux,{placement:"top",children:t("cr_er_automatiq_66502")})]})]})]}),l&&(0,i.jsx)(p0,{eventId:n,onClose:()=>{c(!1)},onSuccess:n=>{o(iA([...s,n])),e.change("position.positionCategoryId",n.id)}})]})}),x0=()=>{const e=os();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(JS,{label:(0,i.jsx)($S,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},_0=e=>{const n=os(),t=ss(c0);return(0,i.jsx)(mA,{buttonText:n("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:t.createPositionSlotSchema(),size:"md",subtitle:n("param_trer_les_00874"),title:n("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async n=>{await e.onSuccess((0,Qr.A)(n.slot,["id","name","startDate","startTime","endDate","endTime","resources"])),e.onClose()},children:({form:t,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ud,{name:"slot.startDate",onChange:e=>{e>s.slot.endDate&&t.change("slot.endDate",e)}}),(0,i.jsxs)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(pu,{hint:n("vous_pouvez_per_94218"),label:(0,i.jsx)($S,{children:n("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wx,{label:n("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(iy,{label:n("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(Wx,{label:n("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(iy,{label:n("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(pu,{label:n("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},j0=e=>{const n=os(),t=ss(Wg),s=(0,de.useMemo)(()=>w(e.slot.name)?e.slot.name:n("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,de.useMemo)(()=>{const i=t.toLocaleString(e.slot.startDate,da.DateOnly.WeekdayLongMonthLong),s=t.toLocaleString(e.slot.endDate,da.DateOnly.WeekdayLongMonthLong);return`${i} ${e.slot.startTime.substring(0,5)} - ${s} ${e.slot.endTime.substring(0,5)} - ${n("_1_membre_49737",e.slot.resources)}`},[e.slot.startDate,e.slot.startTime,e.slot.endDate,e.slot.endTime,e.slot.resources]),[a,r]=(0,de.useState)(e.initialIsEditOpen),[d,l]=(0,de.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Zr,{color:"gray500",children:o})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{l(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(ux,{placement:"top",children:n(c?"des_membres_son_92320":"supprimer_43083")})]})]}),a&&(0,i.jsx)(_0,{event:e.event,slot:e.slot,onClose:()=>{r(!1)},onSuccess:async n=>{e.updateSlots(n,e.index)}}),d&&(0,i.jsx)(fW,{showHours:!0,onClose:()=>{l(!1)},onSubmit:(n,t)=>{e.onRepeat(e.slot,n,t)}})]})},v0=e=>{const n=os(),t=ss(c0),[s,o]=(0,de.useState)(-1),a=(0,de.useCallback)((n,t)=>{const i=[...e.values.position.slots];i[t]=n,e.change("position.slots",i)},[e.values.position.slots,e.change]),r=(0,de.useCallback)((e,n,t)=>sa(e).overlaps(t),[]),d=(0,de.useCallback)(()=>{e.change("position.slots",e.values.position.slots.concat([t.positionsSlotInputDefault(e.event.startAt)])),o(e.values.position.slots.length)},[e.values.position.slots,e.change]),l=(0,de.useCallback)((n,t,i)=>{const s=function(e,n,t){const i=Wh(e.startTime);let s=e.startDate;i&&(s=s.set({hour:i[0],minute:i[1]}));const o=Wh(e.endTime);let a=e.endDate;return o&&(a=a.set({hour:o[0],minute:o[1]})),(0,Sg.A)(1,n+1).map(n=>{if("hour"===t){const t=s.plus({hour:n}),i=a.plus({hour:n});return{name:e.name,startDate:t,startTime:t.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("day"===t){const t=s.plus({day:n}),i=a.plus({day:n});return{name:e.name,startDate:t,startTime:t.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("week"===t){const t=s.plus({week:n}),i=a.plus({week:n});return{name:e.name,startDate:t,startTime:t.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}throw new Error("Wrong unit")})}(n,t,i);e.change("position.slots",e.values.position.slots.concat(s))},[e.values.position.slots,e.change]),c=(0,de.useCallback)(n=>{e.change("position.slots",y(e.values.position.slots,n))},[e.values.position.slots,e.change]);return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(IW,{event:e.event,matchDateFilter:r,renderSlot:n=>(0,i.jsx)(j0,{event:e.event,index:n.index,initialIsEditOpen:n.index===s,remove:c,slot:n,updateSlots:a,onRepeat:l},n.index),slots:e.values.position.slots,onNewSlot:d}),(0,i.jsx)(Yj,{height:"5"}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textMd medium",children:n("type_d_affichag_09962")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("comment_souhait_62602")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(gy,{name:"position.positionDisplay",value:Ln.List,children:n("afficher_sous_f_71276")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(gy,{name:"position.positionDisplay",value:Ln.Radio,children:n("afficher_sous_f_61997")})]})]})},S0=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{showNotification:a}=Sy(),r=ss(h0),d=ss(ec),l=ss(Ub),c=(0,de.useRef)(null),u=(0,de.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.position.name):t("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);fm(u);const m=(0,de.useMemo)(()=>f(e.initialValues.position.tracesIds)||w(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),g=(0,de.useMemo)(()=>!!e.isEdit&&f(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),h=(0,de.useMemo)(()=>!!e.isEdit&&f(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),I=(0,de.useMemo)(()=>!!e.isEdit&&w(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),x=(0,de.useMemo)(()=>!!e.isEdit&&f(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]),_=(0,de.useCallback)(n=>d.validateForForm(r.createUpdatePositionSchema(l.changedFieldsSchema(e.positionCustomFields,e.initialValues.position.fields,n.position.fields)))(n),[e.positionCustomFields,e.initialValues]);return(0,i.jsx)(Fc,{customErrorRef:c,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:a,submitting:r,values:d})=>(0,i.jsx)(Nx,{button:e.isEdit&&(0,i.jsx)(yc,{isLoading:r,onClick:a,children:t("mettre_jour_l_19061")}),category:u,color:"dark",fallbackClosePath:Eo.POSITIONS({organizationId:s,eventId:o}),heading:e.isEdit?e.initialValues.position.name:t("nouvelle_missio_60727"),children:(0,i.jsxs)(kx,{ref:c,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:t("informations_su_61022"),children:(0,i.jsx)(f0,{change:n.change,event:e.event})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:t("cr_neaux_horair_62996"),subtitle:t("ajouter_les_dif_22779"),children:(0,i.jsx)(v0,{change:n.change,event:e.event,values:d})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:t("localisation_38416"),initialIsOpen:m,isToggleable:!0,subtitle:t("localiser_le_li_46319"),onToggle:t=>{t||(n.change("position.layer",e.event.layer),n.change("position.zoom",sd),n.change("position.tracesIds",[]),n.change("position.address",null),n.change("position.latitude",null),n.change("position.longitude",null))},children:(0,i.jsx)(wW,{center:e.event,layer:d.position.layer,name:"position.",point:d.position,traces:e.event.traces,tracesIds:d.position.tracesIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:t("conditions_77756"),initialIsOpen:g,isToggleable:!0,subtitle:t("ajouter_des_con_75357"),onToggle:e=>{e||n.change("position.positionsCustomFields",[])},children:(0,i.jsx)(uW,{change:n.change,conditionsOperator:d.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:d.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:t("champs_de_formu_64126"),initialIsOpen:h,isToggleable:!0,subtitle:t("ajouter_des_inf_14340"),onToggle:e=>{e||n.change("position.fields",{})},children:(0,i.jsx)(dB,{change:n.change,customFields:e.positionCustomFields,formCustomFields:p,formCustomFieldsValues:p,prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:t("note_priv_e_06303"),initialIsOpen:I,isToggleable:!0,subtitle:t("ajouter_une_not_81707"),onToggle:e=>{e||n.change("position.privateNote","")},children:(0,i.jsx)(x0,{})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:t("tags_79499"),initialIsOpen:x,isToggleable:!0,subtitle:t("ajouter_des_tag_64526"),onToggle:e=>{e||n.change("position.tagsIds",[])},children:(0,i.jsx)(hA,{change:n.change,name:"position.",organizationId:s,tags:e.tags,tagsIds:d.position.tagsIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:r,textAlign:"center",onClick:a,children:e.isEdit?t("mettre_jour_l_19061"):t("cr_er_la_missio_82644")})})]})}),validate:_,width:1,onSubmit:async i=>{const r=await e.mutate({eventId:o,position:{...i.position,slots:i.position.slots.map(e=>(0,Rr.A)(e,["index"]))}});a(e.isEdit?t("la_mission_a_t_79916"):t("la_mission_a_t_14808")),e.isEdit?n.goBack(Eo.POSITION({organizationId:s,eventId:o,positionId:r})):n.replace(Eo.POSITION({organizationId:s,eventId:o,positionId:r}))}})},y0=()=>{const e=ss(h0),{organizationId:n,eventId:t,options:s}=ls(),{data:o,loader:a}=rs("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(eventId: $eventId, variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n }\n}\n",{organizationId:n,eventId:t},[Ko.ConditionsCustomFieldsFragment,Ko.CreatePositionTagsFragment,Ko.AttachCustomFieldFragment,Ko.CreatePositionEventFragment],void 0),{mutate:r}=function(e={}){return ds("mutation PositionCreate($eventId: EventId!, $position: PositionInput!) {\n positionCreate(eventId: $eventId, position: $position) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),{positionCategoryId:d,latitude:l,longitude:c}=(e=>{const[n,t]=(e??"").split(",");return w(n)&&w(t)?{latitude:parseFloat(n),longitude:parseFloat(t)}:w(e)?{positionCategoryId:parseInt(e,10)}:{}})(s);return a||(0,i.jsx)(S0,{conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,initialValues:{position:e.positionInputDefault(null,{layer:o.event.layer,startAt:o.event.startAt,positionCategoryId:d,latitude:l,longitude:c})},isEdit:!1,mutate:async e=>{const{positionCreate:{id:n}}=await r(e);return n},positionCustomFields:o.organization.positionCustomFields.nodes,tags:o.organization.tags.nodes})},C0=()=>{const{organizationId:e,eventId:n,positionId:t}=ls(),{data:s,loader:o}=rs("query PositionToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(eventId: $eventId, 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 weezeventIsSynchronized\n privateNote\n address\n latitude\n longitude\n layer\n zoom\n tracesIds\n tagsIds\n fields\n conditionsOperator\n positionDisplay\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:n,positionId:t},[Ko.ConditionsCustomFieldsFragment,Ko.CreatePositionTagsFragment,Ko.AttachCustomFieldFragment,Ko.CreatePositionEventFragment],undefined);const a=ss(h0),{mutate:r}=function(e={}){return ds("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)(S0,{conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,initialValues:{position:a.positionInputDefault(s.event.position,{layer:s.event.layer,startAt:s.event.startAt})},isEdit:!0,mutate:async e=>{const{positionUpdate:{id:n}}=await r({...e,positionId:t});return n},positionCustomFields:s.organization.positionCustomFields.nodes,tags:s.organization.tags.nodes})};var b0,A0,E0;let w0=class extends vF{static{b0=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...vF.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",ConditionsOperator:"conditionsOperator",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===wn.Update?[b0.IMPORT_COLUMNS_DEFAULT.Id]:[],b0.IMPORT_COLUMNS_DEFAULT.SlotStart,b0.IMPORT_COLUMNS_DEFAULT.SlotEnd,b0.IMPORT_COLUMNS_DEFAULT.MaxResources,b0.IMPORT_COLUMNS_DEFAULT.PositionName,b0.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,n){super(e,n),this.csvInputService=e}};w0=b0=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(A0=void 0!==hF&&hF)?A0:Object,"function"==typeof(E0=void 0!==ts&&ts)?E0:Object])],w0);const $0=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{mutate:s}=function(e={}){return ds("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}=Sy(),{data:a,loader:r}=kd({organizationId:e,variety:Ke.Position});return r||(0,i.jsx)(cF,{alertDescriptionKey:"to_add_a_task_62291",children:(0,i.jsx)(YF,{ImportInputService:w0,checkImport:o,closePath:Eo.POSITIONS({organizationId:e,eventId:n}),customFields:a.organization.customFields.nodes,heading:t("importing_tasks_31757"),importTagPrefix:"positions",localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(Ug,{to:Eo.POSITIONS({organizationId:e,eventId:n}),children:t("revenir_aux_mis_73428")})})})};var T0,z0,O0,R0;!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.CheckedOutRate="checkedOutRate",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.Layer="layer",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.MaxResources="resources",e.AssignedResources="assignedResources",e.Slot="slot",e.SlotName="slotName",e.NumberOfMinutesAssigned="numberOfMinutesAssigned",e.NumberOfMinutesRequired="numberOfMinutesRequired",e.State="state",e.Tags="tags",e.Traces="traces",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized",e.Zoom="zoom"}(R0||(R0={}));const D0=e=>e.includes(R0.NumberOfMinutesAssigned)||e.includes(R0.NumberOfMinutesRequired);function M0(e,n){return n===mp.Map?{includeCheckedInRate:!1,includeCheckedOutRate:!1,includeConditions:!1,includeCreatedBy:!1,includeDescription:!1,includeLeaders:!1,includePositionTraces:!1,includeTags:!1,includeTraces:!0,includeVolunteerMinutes:!1}:n===mp.SlotsList?{includeCheckedInRate:e.includes(R0.CheckedInRate),includeCheckedOutRate:e.includes(R0.CheckedOutRate),includeConditions:e.includes(R0.Conditions),includeCreatedBy:e.includes(R0.CreatedBy),includeDescription:e.includes(R0.Description),includeLeaders:e.includes(R0.Leaders)||e.includes(R0.CategoryLeaders),includePositionTraces:e.includes(R0.Traces),includeTags:e.includes(R0.Tags),includeVolunteerMinutes:D0(e)}:{includeCheckedInRate:e.includes(R0.CheckedInRate),includeCheckedOutRate:e.includes(R0.CheckedOutRate),includeConditions:e.includes(R0.Conditions),includeCreatedBy:e.includes(R0.CreatedBy),includeDescription:e.includes(R0.Description),includeLeaders:e.includes(R0.Leaders)||e.includes(R0.CategoryLeaders),includePositionTraces:e.includes(R0.Traces),includeTags:e.includes(R0.Tags),includeTraces:!1,includeVolunteerMinutes:D0(e)}}let P0=class extends Eh{constructor(e,n,t){super(e,n,t)}getPositionsFilters(e,n){return(0,sc.A)([{slug:R0.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:Sn.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:R0.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:Sn.Text},{slug:R0.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:Sn.Text},f(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:Sn.Select,values:(0,Tg.A)(e.positionsCategories,e=>b(e.name)),hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:Sn.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:Sn.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:Sn.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:ht.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:Sn.Select,needLoading:!0,organizationId:e.organizationId},f(e.traces)?{slug:R0.Traces,name:this.t("Traces"),category:this.t("missions_63972"),fieldType:Sn.Select,values:(0,Tg.A)(e.traces,e=>b(e.name))}:null,{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:Sn.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:Sn.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:Sn.Select,values:pi.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:Sn.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:Sn.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:Sn.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,values:wi.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:R0.CheckedInRate,name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:R0.CheckedOutRate,name:this.t("taux_de_d_point_88315"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:R0.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:R0.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:Sn.Number,hideEmpty:!0},{slug:R0.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:Sn.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:R0.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:Sn.Datetime,hideEmpty:!0},e.isWeezeventConnected?{slug:R0.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),category:this.t("missions_63972"),fieldType:Sn.Number}:null,...this.customFieldsToFilters(n)])}getPositionsPossibleColumns(e,{isWeezeventConnected:n}){const t=[{slug:R0.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Hn.Id,width:100},{slug:R0.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:Hn.Name,minWidth:120},{slug:R0.Acronym,name:this.t("acronymes_11499"),isSearchable:!0,isSortable:!0,sortAttribute:Hn.Acronym,minWidth:120},{slug:R0.Description,name:this.t("Description"),minWidth:320},{slug:R0.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:Hn.Category,minWidth:240},{slug:R0.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:R0.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:Hn.Slot,minWidth:240},{slug:R0.MaxResources,name:this.t("membres_n_cessa_55227"),minWidth:320},{slug:R0.AssignedResources,name:this.t("membres_11310"),minWidth:320},{slug:R0.NumberOfMinutesRequired,name:this.t("nombre_de_minut_1"),minWidth:200},{slug:R0.NumberOfMinutesAssigned,name:this.t("nombre_de_minut_50497"),minWidth:200},{slug:R0.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:R0.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:R0.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:R0.Layer,name:this.t("Layer"),minWidth:180},{slug:R0.Traces,name:this.t("Traces"),minWidth:240},{slug:R0.Zoom,name:this.t("Zoom"),isSearchable:!0,minWidth:180},{slug:R0.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:R0.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:R0.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:R0.Icon,name:this.t("ic_ne_55554"),width:80},{slug:R0.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:R0.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:R0.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:R0.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:R0.CheckedOutRate,name:this.t("taux_de_d_point_88315"),minWidth:240},{slug:R0.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:R0.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Hn.CreatedAt,minWidth:180},{slug:R0.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:R0.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}];return n&&t.push({slug:R0.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:R0.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),t.concat(this.customFieldsToPossibleColumns(e))}};P0=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(T0=void 0!==dh&&dh)?T0:Object,"function"==typeof(z0=void 0!==Wg&&Wg)?z0:Object,"function"==typeof(O0=void 0!==ts&&ts)?O0:Object])],P0);var k0;function F0(e){return e===Wn.StartDate||e===Wn.EndDate}function N0(e){return e===Wn.StartTime||e===Wn.EndTime}let L0=class extends ju{constructor(e){super(e)}positionsSlotsMassEditSchema(){return Jl.Ik().shape({massEdit:this.positionsSlotsMassEditInputSchema()})}positionsSlotsMassEditInputSchema(){return Jl.Ik().shape({selecteds:Jl.Ik().required(),property:Jl.Yj().required().oneOf(Ai),strategy:Jl.Yj().required().oneOf(Ei).when("property",{is:F0,then:e=>e.oneOf([Gn.Replace])}),value:Jl.gl().test("valid-value",(e,n)=>{const{property:t,strategy:i}=n.parent;return F0(t)?Jo.c9.isDateTime(e)&&e.isValid||"string"==typeof e&&Jo.c9.fromISO(e).isValid||n.createError({message:this.t("la_date_est_req_98470")}):N0(t)&&i===Gn.Replace?Bh(e)||n.createError({message:this.t("l_heure_est_req_51396")}):N0(t)?nd(e)||n.createError({message:this.t("le_nombre_de_mi_02803")}):nd(e)||n.createError({message:this.t("le_nombre_de_me_04870")})})})}};L0=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(k0=void 0!==ts&&ts)?k0:Object])],L0);const U0=e=>{const{translate:n}=fc(),t=ss(L0),s=n=>F0(n)?e.event.startAt.startOf("day"):N0(n)?"":1,o=(e,n)=>{e.batch(()=>{e.change("massEdit.property",n),e.change("massEdit.strategy",Gn.Replace),e.change("massEdit.value",s(n))})};return(0,i.jsx)(mA,{buttonText:n("mettre_jour_85141"),icon:"sliders",initialValues:{massEdit:{selecteds:e.selecteds,property:Wn.StartDate,strategy:Gn.Replace,value:s(Wn.StartDate)}},schema:t.positionsSlotsMassEditSchema(),size:"md",title:n("_diter_une_prop_26724"),onClose:e.onClose,onSubmit:async({massEdit:n})=>{const t=await e.mutate({...n,value:F0(n.property)?n.value.toISODate():n.value});e.onSuccess(t),e.onClose()},children:({form:t,values:s})=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(ud,{name:"massEdit.strategy",onChange:e=>{N0(s.massEdit.property)&&t.change("massEdit.value",e===Gn.Replace?"":null)}}),(0,i.jsx)(Zr,{font:"gray700 textSm medium",children:n("que_souhaitez_v_87607")}),(0,i.jsx)(Gw,{isChecked:s.massEdit.property===Wn.StartDate,text:n("modifier_la_dat_77807"),onClick:()=>o(t,Wn.StartDate),children:(0,i.jsx)(Wx,{max:e.event.endAt,min:e.event.startAt,name:"massEdit.value"})}),(0,i.jsx)(Gw,{isChecked:s.massEdit.property===Wn.StartTime,text:n("modifier_l_hora_50591"),onClick:()=>o(t,Wn.StartTime),children:(0,i.jsx)(V0,{values:s})}),(0,i.jsx)(Gw,{isChecked:s.massEdit.property===Wn.EndDate,text:n("modifier_la_dat_16591"),onClick:()=>o(t,Wn.EndDate),children:(0,i.jsx)(Wx,{max:e.event.endAt,min:e.event.startAt,name:"massEdit.value"})}),(0,i.jsx)(Gw,{isChecked:s.massEdit.property===Wn.EndTime,text:n("modifier_l_hora_56263"),onClick:()=>o(t,Wn.EndTime),children:(0,i.jsx)(V0,{values:s})}),(0,i.jsxs)(Gw,{isChecked:s.massEdit.property===Wn.Resources,text:n("modifier_le_nom_22180"),onClick:()=>o(t,Wn.Resources),children:[(0,i.jsx)(B0,{}),(0,i.jsx)(pu,{name:"massEdit.value",shouldParseAsInt:!0})]})]})})},V0=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(B0,{}),e.values.massEdit.strategy===Gn.Replace?(0,i.jsx)(iy,{name:"massEdit.value"}):(0,i.jsx)(pu,{name:"massEdit.value",rightText:"min",shouldParseAsInt:!0})]}),B0=()=>{const{translate:e}=fc();return(0,i.jsxs)(Qy,{name:"massEdit.strategy",children:[(0,i.jsx)("option",{value:Gn.Replace,children:e("d_finir_une_nou_83151")}),(0,i.jsx)("option",{value:Gn.Add,children:e("ajouter_97327")}),(0,i.jsx)("option",{value:Gn.Subtract,children:e("retirer_05155")})]})},W0=e=>{const{translate:n}=fc(),{massActions:t,predicates:s}=ah(),{eventId:o,onMassEditSuccess:a}=DN(),{showNotification:r}=Sy(),{mutate:d}=function(e={}){return ds("mutation PositionsSlotsMassEdit($eventId: EventId!, $massEdit: PositionsSlotsMassEditInput!) {\n numberOfPositionsSlots: positionsSlotsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}(),[l,c]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>c(!0),children:n("_diter_une_prop_26724")}),l&&(0,i.jsx)(U0,{event:e.event,mutate:async e=>(await d({eventId:o,massEdit:e})).numberOfPositionsSlots,selecteds:t.getSelectedsInput(s,null),onClose:()=>c(!1),onSuccess:e=>{r(n("_1_cr_neaux_on_11340",e)),a()}})]})},G0=e=>{const{params:{eventId:n}}=fc(),{mutate:t}=Ga(),s=(0,de.useCallback)(async i=>{const s=I(e.property);for(const o of s){const a=1===s.length?i:i[o];await t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.positionId]},slug:o,strategy:Dn.Replace,value:a}})}},[e.positionId,e.property,t]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},q0=e=>{const{translate:n}=fc();return(0,i.jsx)(G0,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:Un.Acronym,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("Acronym"),value:e,onChange:t}),renderValue:e.position.acronym||"",updatable:e.updatable})},H0=(0,de.createContext)({}),Y0=e=>{const[n,t]=(0,de.useState)(),s=WL(Il,{eventId:e.eventId},e=>e.event.positionsCategories),o=WL(sr,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(H0.Provider,{value:{newPositionLatLng:n,getPositionsCategories:s,getTags:o,setNewPositionLatLng:t},children:e.children})};function Z0(){return(0,de.useContext)(H0)}const K0=e=>{const n=os(),{getPositionsCategories:t}=Z0(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("Category")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(nf,{label:n("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))})},X0=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{isEditMode:s}=ah();return(0,i.jsx)(G0,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:Un.Category,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(K0,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:s,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(Ug,{to:Eo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},Q0=e=>{const{translate:n}=fc();return(0,i.jsx)(G0,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:Un.Color,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Bb,{label:n("Color"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Xl,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{oy(e.position.color)}})}),(0,i.jsx)(ux,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},J0=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),s=(0,de.useMemo)(()=>t.map((e,t)=>({id:t,color:"gray",icon:null,text:`${e.customField.name} : ${XW(n,e.customField,e.conditionValue)}`})),[t]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:s})})},e1=e=>{const{params:{eventId:n}}=fc(),{mutate:t}=Ga(),s=(0,de.useCallback)(i=>t({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.position.id]},slug:Un.Description,strategy:Dn.Replace,value:i}}),[n,e.position.id,t]);return(0,i.jsx)(TU,{column:e.column,mutate:s,reload:e.reload,text:e.position.description,updatable:e.updatable})},n1=e=>{const{translate:n}=fc();return(0,i.jsx)(G0,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:Un.Icon,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Yb,{label:n("Icon"),renderOnPortal:!0,value:e,onChange:t}),renderValue:()=>(0,i.jsx)(pc,{icon:hc(e.position.icon)}),updatable:e.updatable})},t1=e=>{const{translate:n}=fc(),t=(0,de.useMemo)(()=>({[Un.Color]:e.position.color,[Un.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(G0,{column:e.column,initialValue:t,positionId:e.position.id,property:[Un.Color,Un.Icon],reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Bb,{label:n("Color"),value:e[Ae.Color],onChange:n=>{t({...e,[Ae.Color]:n})}}),(0,i.jsx)(Yb,{label:n("Icon"),renderOnPortal:!0,value:e[Ae.Icon],onChange:n=>{t({...e,[Ae.Icon]:n})}})]}),renderValue:()=>(0,i.jsx)(UI,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},i1=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{isEditMode:o}=ah();return(0,i.jsx)(G0,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:Un.Name,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_de_la_missi_64605"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(lL,{isEditMode:o,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(Ug,{to:Eo.POSITION({organizationId:t,eventId:s,positionId:e.position.id}),children:(0,i.jsx)(Zr,{css:{clamp:2},title:e.position.name,children:e.position.name})})}),updatable:e.updatable})},s1=e=>{const{translate:n}=fc(),{getTags:t}=Z0(),{result:s,isLoading:o}=hU(t);return o?(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(uu,{children:n("tags_79499")}),(0,i.jsx)(Vm,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(lg,{isSearchVisible:!0,label:n("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))})},o1=e=>{const n=(0,de.useMemo)(()=>e.position.tags||[],[e.position]),t=(0,de.useMemo)(()=>n.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[n]);return(0,i.jsx)(G0,{column:e.column,initialValue:n.map(e=>e.id),positionId:e.position.id,property:Un.Tag,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(s1,{setValue:n,value:e}),renderValue:()=>(0,i.jsx)(AE,{badges:t}),updatable:e.updatable})},a1=e=>{const n=(0,de.useMemo)(()=>(e.position.traces||[]).map(e=>({id:e.id,color:e.color,icon:null,text:e.name})),[e.position]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},r1=e=>{const{translate:n,params:{eventId:t}}=fc(),{mutate:s}=bl(),o=(0,de.useMemo)(()=>w(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(pE,{column:e.column,initialValue:e.positionSlot.name,mutate:async n=>s({eventId:t,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,Qr.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:n}}),reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(hu,{label:n("nom_du_cr_neau_54351"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Zr,{css:{clamp:2},font:"gray900 textSm medium",title:o,width:1,children:o}),updatable:e.updatable})},d1=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.positionSlot.weezeventChecklistId){const n=Ox(e.weezeventOrganizationId,e.positionSlot.weezeventChecklistId);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ug,{to:n,children:e.positionSlot.weezeventChecklistId})})}return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},l1=e=>{const{translate:n}=fc(),{hasEventRole:t}=Ly(),{canPositionEdit:s}=tC(),o=t&&s,a=ss(Nh),r=ss(dE),d=ss(wb);return e.column.slug===R0.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===R0.Category?(0,i.jsx)(X0,{column:e.column,positionCategory:e.row.positionCategory,positionId:e.row.position.id,reload:e.reload,updatable:o}):e.column.slug===R0.Name?(0,i.jsx)(i1,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.Description?(0,i.jsx)(e1,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.Slot?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:a.toDisplayString(e.row.range)}):e.column.slug===R0.SlotName?(0,i.jsx)(r1,{column:e.column,positionSlot:e.row,reload:e.reload,updatable:s}):e.column.slug===R0.MaxResources||e.column.slug===R0.AssignedResources?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(uU,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===R0.NumberOfMinutesRequired?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:r.minutesToHoursMinutesString(e.row.volunteerMinutesNeeded??0)}):e.column.slug===R0.NumberOfMinutesAssigned?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:r.minutesToHoursMinutesString(e.row.volunteerMinutesAssigned??0)}):e.column.slug===R0.Tags?(0,i.jsx)(o1,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.Conditions?(0,i.jsx)(J0,{column:e.column,position:e.row.position}):e.column.slug===R0.Address?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.address}):e.column.slug===R0.Traces?(0,i.jsx)(a1,{column:e.column,position:e.row.position}):e.column.slug===R0.Latitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.latitude}):e.column.slug===R0.Longitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.longitude}):e.column.slug===R0.Acronym?(0,i.jsx)(q0,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.Color?(0,i.jsx)(Q0,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.Icon?(0,i.jsx)(n1,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.IconColor?(0,i.jsx)(t1,{column:e.column,position:e.row.position,reload:e.reload,updatable:s}):e.column.slug===R0.State?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===Yn.Full?(0,i.jsx)(Lm,{color:"success",children:n(e.row.state)}):(0,i.jsx)(Lm,{color:"warning",children:n(e.row.state)})}):e.column.slug===R0.FillingRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug==R0.CheckedInRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug==R0.CheckedOutRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedOutRate||0,"%"]}):e.column.slug===R0.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===R0.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.position.createdBy}):e.column.slug===R0.WeezeventIsSynchronized?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.position.weezeventIsSynchronized?n("oui_54361"):n("non_33516")}):e.column.slug===R0.WeezeventChecklistId?(0,i.jsx)(d1,{column:e.column,positionSlot:e.row,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.customField?d.getValueString(e.customField,e.row.position.fields,{fileReturnValue:"name"}):""})},c1=e=>{const{translate:n,params:{eventId:t}}=fc(),{reloadRow:s}=ah(),{mutate:o}=bl(),[a,r]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),a&&(0,i.jsx)(_0,{event:e.event,slot:e.positionSlot,onClose:()=>{r(!1)},onSuccess:async n=>{await o({eventId:t,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:n}),s(e.positionSlot.id)}})]})},u1=e=>{const{canPositionEdit:n}=tC(),t=aE(e.customFields);return(0,i.jsx)(px,{renderCell:(n,s,o)=>(0,i.jsx)(l1,{column:n,customField:t.get(n.slug),reload:o,row:s,weezeventOrganizationId:e.weezeventOrganizationId}),renderRowDropdown:n=>(0,i.jsx)(c1,{event:e.event,positionSlot:n}),showMassActions:n,showRowDropdown:n,showRowEdit:!1})};var m1;let g1=class extends M${translationService;inputName="massConditions";constructor(e){super(e),this.translationService=e}step1Fields(){return{strategy:this.strategyField(Si)}}step2Fields(){return{customFieldId:Jl.ai().required(this.t("le_champ_person_80074")),value:Jl.gl().required(this.t("la_valeur_est_r_70136"))}}};g1=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(m1=void 0!==ts&&ts)?m1:Object])],g1);const h1=()=>{const e=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(LR,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:Mn.Add}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(LR,{label:e("remplacer_les_c_78082"),name:"massConditions.strategy",value:Mn.Replace}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(LR,{label:e("supprimer_toute_17358"),name:"massConditions.strategy",value:Mn.Reset})]})},p1=e=>{const n=os(),{data:t,loader:s}=rs("query MassConditionsCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ko.ConditionsCustomFieldsFragment],undefined);const o=(0,de.useMemo)(()=>t.organization&&e.values.massConditions.customFieldId?t.organization.conditionsCustomFields.nodes.find(n=>n.id===e.values.massConditions.customFieldId):void 0,[t.organization,e.values.massConditions.customFieldId]);return(0,de.useEffect)(()=>{o?.fieldType===_n.Checkbox?e.change("massConditions.value",!0):o?.fieldType===_n.Select&&e.change("massConditions.value",[])},[o]),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Qy,{label:n("CustomField"),name:"massConditions.customFieldId",shouldParseAsInt:!0,children:[(0,i.jsx)("option",{value:-1,children:n("s_lectionner_un_01451")}),t.organization.conditionsCustomFields.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),o?.fieldType===_n.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:n("mission_accessi_77261"),multiple:!0,name:"massConditions.value",children:o.values.map(({id:e,value:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),o?.fieldType===_n.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsxs)(Qy,{label:n("mission_accessi_77261"),name:"massConditions.value",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:n("true")}),(0,i.jsx)("option",{value:"false",children:n("false")})]})]})]})},I1=e=>{const n=os(),t=ss(g1),s=ss(ec),{mutate:o}=function(e={}){return ds("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[a,r]=(0,de.useState)(0);return(0,i.jsx)(Jg,{size:"md",onClose:e.onClose,children:(0,i.jsx)(ld.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:Mn.Add,value:""}},initialValuesEqual:dd.A,render:({form:t,handleSubmit:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(uA,{color:"primary",icon:"lock"})}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("_diter_les_cond_95618")}),(0,i.jsx)(ic,{height:"7"}),0===a?(0,i.jsx)(h1,{}):(0,i.jsx)(p1,{change:t.change,eventId:e.eventId,organizationId:e.organizationId,values:o}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",children:[0!==a&&(0,i.jsx)(yc,{color:"white",leftIcon:"arrow-left",onClick:()=>{r(Math.max(0,a-1))},children:n("retour_92202")}),(0,i.jsx)(Zr,{css:{flex:"1"}}),0===a&&o.massConditions.strategy!==Mn.Reset?(0,i.jsx)(yc,{rightIcon:"arrow-right",onClick:s,children:n("suivant_1_2_16815")}):(0,i.jsx)(yc,{onClick:s,children:n("appliquer_05753")})]})]}),validate:e=>0===a?s.validateForForm(t.step1Schema())(e):s.validateForForm(t.step2Schema())(e),onSubmit:async t=>{if(1===a||t.massConditions.strategy===Mn.Reset){const i=(await o({eventId:e.eventId,massConditions:t.massConditions})).numberOfPositions;e.onSuccess(n("les_conditions_78548",i)),e.onClose()}else r(a+1)}})})},f1=()=>{const e=os(),{roles:n}=Yy(),{massActions:t,predicates:s}=ah(),{eventId:o,onMassEditSuccess:a,organizationId:r,segment:d}=DN(),{showNotification:l}=Sy(),{mutate:c}=Ga(),{mutate:u}=dl(),{mutate:m}=fl(),[g,h]=(0,de.useState)(!1),[p,I]=(0,de.useState)(!1),[f,x]=(0,de.useState)(!1),[_,j]=(0,de.useState)(!1),v=t.getSelectedsInput(s,null),S=t.isAllSelected?d.count:t.numberOfSelected,y=(0,de.useCallback)(e=>{w(e)&&l(e),a()},[a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{onClick:()=>{h(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"lock",onClick:()=>{I(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(Em,{icon:"user-gear",onClick:()=>x(!0),children:e("_diter_les_resp_29588")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{j(!0)},children:e("supprimer_43083")})})]})]}),g&&(0,i.jsx)(A$,{eventId:o,mutate:e=>c({eventId:o,massEdit:e}),organizationId:r,selecteds:v,onClose:()=>{h(!1)},onSuccess:n=>{y(e("_1_missions_on_96803",n))}}),p&&(0,i.jsx)(I1,{eventId:o,organizationId:r,selecteds:v,onClose:()=>{I(!1)},onSuccess:y}),f&&(0,i.jsx)(YL,{roles:n.positionRoles,showRoleSelect:!0,onClose:()=>x(!1),onSuccess:async(n,t)=>{const i=(await u({eventId:o,massLeaders:{leaders:t,strategy:n,selecteds:v}})).numberOfPositions;y(e("les_responsable_23291",i))}}),_&&(0,i.jsx)(f$,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_65487")],text:e("suppression_de_81835",S),onClose:()=>{j(!1)},onDelete:async()=>{const n=(await m({eventId:o,selecteds:v})).numberOfPositions;y(e("_1_missions_on_56713",n))}})]})};function x1(){const{history:e,params:{organizationId:n,eventId:t}}=fc(),{mutate:i}=function(e={}){return ds("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n positionDuplicate(eventId: $eventId, positionId: $positionId) {\n id\n }\n}\n",e)}();return(0,de.useCallback)(async s=>{const{positionDuplicate:o}=await i({eventId:t,positionId:s});e.push(Wo.EDIT_POSITION(n,t,o.id))},[n,t,i])}const _1=e=>{const{translate:n,params:{eventId:t}}=fc(),{showNotification:s}=Sy(),{mutate:o}=fl(),a=[];return e.position.assignedResources>0&&a.push(n("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_01544"),n("cela_supprimera_15744"),...a],text:n("suppression_de_73669",e.position.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:t,selecteds:{ids:[e.position.id]}}),s(n("la_mission_1_45985",e.position.name)),e.onSuccess()}})},j1=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc(),o=x1(),{hasEventRole:a}=Ly(),{canPositionEdit:r}=tC(),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(!1),m=a&&r;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",to:Wo.EDIT_POSITION(n,t,e.position.id),children:s("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{await o(e.position.id)},children:s("dupliquer_28256")}),(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{l(!0),vm(e.target)},children:s("supprimer_43083")})]}),(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"plus",to:Wo.CREATE_POSITION(n,t,e.position.category.id),children:s("ajouter_une_mis_99800")}),(0,i.jsx)(Em,{icon:"eye",to:Eo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.position.category.id}),children:s("voir_1_90465",e.position.category.name)}),m&&(0,i.jsx)(Em,{icon:"pen",onClick:()=>{u(!0)},children:s("renommer_1_40542",e.position.category.name)})]})]}),d&&(0,i.jsx)(_1,{position:e.position,onClose:()=>{l(!1)},onSuccess:e.reload}),c&&(0,i.jsx)(I0,{eventId:t,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{u(!1)},onSuccess:e.reload})]})},v1=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc();return(0,i.jsxs)(lC,{permissions:nC.POSITION_EDIT,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",to:Wo.EDIT_POSITION(t,s,e.position.id)})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(j1,{position:e.position,reload:e.reload})]})},S1=e=>{const n=(0,de.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)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},y1=e=>{const n=(0,de.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(AE,{badges:n})})},C1=e=>{const{translate:n}=fc();return(0,i.jsx)(G0,{column:e.column,initialValue:e.position.weezeventIsSynchronized,positionId:e.position.id,property:Un.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,t)=>(0,i.jsxs)(nf,{label:n("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:t,children:[(0,i.jsx)("option",{value:"true",children:n("oui_54361")}),(0,i.jsx)("option",{value:"false",children:n("non_33516")})]}),renderValue:e.position.weezeventIsSynchronized?n("oui_54361"):n("non_33516"),updatable:e.updatable})},b1=e=>{const{translate:n}=fc(),t=ss(Wg),s=ss(dE),{mutate:o}=Ga(),a=(0,de.useCallback)((n,t)=>o({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:t,strategy:Dn.Replace,value:n}}),[e.row,o]),r=(0,de.useMemo)(()=>{if(e.row.range){const n=e.row.range.start,i=e.row.range.end;return n.startOf("day").equals(i.startOf("day"))?t.toLocaleString(n,da.DateOnly.MonthShort):`${t.toLocaleString(n,da.DateOnly.MonthShort)} → ${t.toLocaleString(i,da.DateOnly.MonthShort)}`}return"-"},[e.row]),{hasEventRole:d}=Ly(),{canPositionEdit:l}=tC(),c=d&&l;return e.column.slug==R0.Id?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===R0.Category?(0,i.jsx)(X0,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:c}):e.column.slug===R0.Name?(0,i.jsx)(i1,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.Description?(0,i.jsx)(e1,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.Slot?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Xl,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:r}),(0,i.jsx)(Zr,{color:"gray500",children:n("creneau",e.row.numberOfSlots)})]})}):e.column.slug===R0.SlotName?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===R0.MaxResources||e.column.slug===R0.AssignedResources?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(uU,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===R0.NumberOfMinutesRequired?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:s.minutesToHoursMinutesString(e.row.volunteerMinutesNeeded??0)}):e.column.slug===R0.NumberOfMinutesAssigned?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:s.minutesToHoursMinutesString(e.row.volunteerMinutesAssigned??0)}):e.column.slug===R0.Tags?(0,i.jsx)(o1,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.Conditions?(0,i.jsx)(J0,{column:e.column,position:e.row}):e.column.slug===R0.Address?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===R0.Layer?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.layer===Rn.Google?"Plan":e.row.layer===Rn.GoogleSatellite?"Satellite":"IGN Plan"}):e.column.slug===R0.Traces?(0,i.jsx)(a1,{column:e.column,position:e.row}):e.column.slug===R0.Zoom?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.zoom}):e.column.slug===R0.Latitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===R0.Longitude?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Xl,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"square-check"})}),(0,i.jsx)(Zr,{children:n("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"square"})}),(0,i.jsx)(Zr,{children:n("non_visible_30040")})]})})}):e.column.slug===R0.Acronym?(0,i.jsx)(q0,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.Color?(0,i.jsx)(Q0,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.Icon?(0,i.jsx)(n1,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.IconColor?(0,i.jsx)(t1,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.State?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===Yn.Full?(0,i.jsx)(Lm,{color:"success",children:n(e.row.state)}):(0,i.jsx)(Lm,{color:"warning",children:n(e.row.state)})}):e.column.slug===R0.FillingRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===R0.CheckedInRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===R0.CheckedOutRate?(0,i.jsxs)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedOutRate||0,"%"]}):e.column.slug===R0.CreatedAt?(0,i.jsx)(oL,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===R0.CreatedBy?(0,i.jsx)(aL,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===R0.Leaders?(0,i.jsx)(y1,{column:e.column,position:e.row}):e.column.slug===R0.CategoryLeaders?(0,i.jsx)(S1,{column:e.column,position:e.row}):e.column.slug===R0.WeezeventIsSynchronized?(0,i.jsx)(C1,{column:e.column,position:e.row,reload:e.reloadRow,updatable:l}):e.column.slug===R0.WeezeventChecklistId?(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):(0,i.jsx)(zE,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:a,reload:e.reloadRow,updatable:l})},A1=e=>{const{params:{eventId:n}}=fc(),t=aE(e.customFields);return(0,i.jsx)(px,{renderCell:(e,s,o)=>(0,i.jsx)(b1,{column:e,customField:t.get(e.slug),eventId:n,reloadRow:o,row:s}),renderRowDropdown:(e,n)=>(0,i.jsx)(v1,{position:e,reload:n})})},E1=e=>{const n=os();return _m(e.onClose),xm(e.onClose),(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"text"})}),(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:n("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(pc,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Lr.colors.primary600.value})})]}),(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"location-dot"})}),(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:n("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(pc,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Lr.colors.primary600.value})})]})]})},w1=e=>(_m(e.onClose),xm(e.onClose),(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(Xl,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),$1=e=>(0,i.jsxs)(Xl,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(Zr,{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)(Zr,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(Xl,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(pc,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:Lr.colors.primary600.value})})]}),T1=e=>{const n=os();return _m(e.onClose),xm(e.onClose),(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)($1,{imageSrc:Yu.Maps.GooglePlan,isSelected:e.selectedLayer===Rn.Google,name:"Plan",onClick:()=>{e.onChange(Rn.Google)}}),(0,i.jsx)($1,{imageSrc:Yu.Maps.GoogleSatellite,isSelected:e.selectedLayer===Rn.GoogleSatellite,name:n("satellite_82253"),onClick:()=>{e.onChange(Rn.GoogleSatellite)}}),(0,i.jsx)($1,{imageSrc:Yu.Maps.IgnPlan,isSelected:e.selectedLayer===Rn.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(Rn.IgnPlan)}})]})},z1=e=>(0,i.jsxs)(Xl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:n=>{Uc(n),e.onClick()},children:[e.children,(0,i.jsx)(Zr,{color:"gray700",children:e.isOpen?(0,i.jsx)(pc,{icon:"chevron-up"}):(0,i.jsx)(pc,{icon:"chevron-down"})})]});var O1;let R1=class extends ju{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??Lr.colors.primary500.value,points:e?.points??[],direction:e?.direction??ft.None,startAt:e?.startAt??null,firstRunnerPace:e?.firstRunnerPace??null,lastRunnerPace:e?.lastRunnerPace??null}}traceInputSchema(e){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_du_trac_39859")),color:Jl.Yj().required(this.t("la_couleur_du_t_36646")),points:Jl.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895")),startAt:Jl.gl().nullable().test("start-at-during-event",this.t("l_heure_de_d_pa_04968"),n=>!Jo.c9.isDateTime(n)||!n.isValid||n>=e.startAt&&n<=e.endAt.endOf("day")),firstRunnerPace:this.paceSchema(),lastRunnerPace:this.paceSchema()})}paceSchema(){return Jl.ai().nullable().typeError(this.t("l_allure_doit_06495")).integer(this.t("l_allure_doit_06495")).positive(this.t("l_allure_doit_06495"))}createTraceSchema(e){return Jl.Ik().shape({trace:this.traceInputSchema(e)})}updateNameSchema(){return Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_du_trac_39859"))})}};R1=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(O1=void 0!==ts&&ts)?O1:Object])],R1);const D1=mT,M1=uT,P1=lT,k1=cT,F1=({fieldProps:e,hint:n,state:t,...s})=>{const[o,a]=(0,de.useState)(()=>{return"number"==typeof(n=e.input.value)&&Number.isFinite(n)?`${Math.floor(n/60)}:${(n%60).toString().padStart(2,"0")}`:"";var n}),r=Lc(e.meta);return(0,i.jsx)(hu,{hint:r?e.meta.error:n,placeholder:"5:30",rightText:"min/km",state:r?"error":t,value:o,onBlur:e.input.onBlur,onChange:n=>{a(n),e.input.onChange(function(e){if(w(e)){const n=Wh(e.trim());return n&&n[1]<60?60*n[0]+n[1]:NaN}return null}(n))},onFocus:e.input.onFocus,...s})},N1=({name:e,...n})=>(0,i.jsx)(ld.D0,{name:e,render:e=>(0,i.jsx)(F1,{fieldProps:e,...n})});function L1(e){const n=e.replace(/<\?xml(.*)\?>/,""),t=(new DOMParser).parseFromString(n,"text/xml");if(0!==t.querySelectorAll("parsererror").length)throw new Error("Could not parse: "+e);return t}const U1=e=>{const n=parseFloat(e.getAttribute("lat")),t=parseFloat(e.getAttribute("lon")),i=parseFloat(e.querySelector("ele")?.textContent??"");return isNaN(n)||isNaN(t)?[]:isNaN(i)?[[n,t]]:[[n,t,i]]},V1=e=>{const n=os(),t=ss(R1),s=ss(ec),[o,a]=(0,de.useState)({name:e.trace?`${E(e.trace.name)}.gpx`:"",content:""}),{mutate:r,isLoading:d}=function(e={}){return ds("mutation TraceCreate($eventId: EventId!, $trace: TraceInput!) {\n traceCreate(eventId: $eventId, trace: $trace) {\n id\n }\n}\n",e)}(),{mutate:l,isLoading:c}=function(e={}){return ds("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n id\n }\n}\n",e)}(),{descId:u,labelId:m}=Vc();return(0,i.jsx)(Fc,{hideDefaultErrors:!0,initialValues:{trace:t.traceInputDefault(e.trace)},render:({form:t,handleSubmit:s})=>(0,i.jsxs)(D1,{descId:u,isOpen:!0,labelId:m,setIsOpen:n=>{n||e.onClose()},size:"md",children:[(0,i.jsx)(M1,{heading:(0,i.jsx)($c,{id:m,children:e.traceId?n("modifier_le_tra_68754"):n("ajouter_un_trac_05425")}),leftIcon:"route",leftIconBorder:"gray200",leftIconColor:"gray800",setIsOpen:e.onClose}),(0,i.jsx)(P1,{id:u,children:(0,i.jsxs)(Xl,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(pu,{label:n("nom_du_trac_16379"),name:"trace.name",placeholder:n("nom_du_trac_16379")}),(0,i.jsx)(zX,{accept:Jv.Gpx,format:"string",label:n("fichier_gpx_55484"),placeholder:n("s_lectionnez_un_17918"),value:o,onChange:e=>{a(e),t.change("trace.points",function(e){const n=L1(e),t=Array.from(n.querySelectorAll("trk trkseg trkpt")),i=Array.from(n.querySelectorAll("wpt")),s=Array.from(n.querySelectorAll("rte rtept"));return t.length>0?t.flatMap(U1):i.length>0?i.flatMap(U1):s.flatMap(U1)}(e.content))}}),(0,i.jsx)(Wb,{label:n("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsxs)(Qy,{label:n("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:ft.None,children:n("aucun_93456")}),(0,i.jsx)("option",{value:ft.Forward,children:n("en_avant_17614")}),(0,i.jsx)("option",{value:ft.Backward,children:n("en_arri_re_24636")})]}),(0,i.jsx)(Gb,{label:(0,i.jsx)($S,{children:n("heure_de_d_part_43498")}),max:e.event.endAt.endOf("day"),min:e.event.startAt,name:"trace.startAt"}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(N1,{label:(0,i.jsx)($S,{children:n("allure_du_premi_20993")}),name:"trace.firstRunnerPace"}),(0,i.jsx)(N1,{label:(0,i.jsx)($S,{children:n("allure_du_derni_15048")}),name:"trace.lastRunnerPace"})]})]})}),(0,i.jsx)(k1,{handleSubmit:s,isLoading:d||c,setIsOpen:e.onClose,submitText:e.traceId?n("mettre_jour_85141"):n("ajouter_97327")})]}),validate:s.validateForForm(t.createTraceSchema(e.event)),onSubmit:async n=>{const t={...n.trace,startAt:n.trace.startAt?.isValid?n.trace.startAt:null};e.traceId?await l({eventId:e.eventId,traceId:e.traceId,trace:t}):await r({eventId:e.eventId,trace:t}),e.onClose(),e.reload()}})},B1=e=>{const n=os(),{mutate:t}=function(e={}){return ds("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n traceDelete(eventId: $eventId, traceId: $traceId) {\n id\n }\n}\n",e)}(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(!1);return(0,i.jsxs)(Xl,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(Zr,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(Zr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(pc,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(Zr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>r(!0),children:(0,i.jsx)(pc,{icon:"pen"})}),(0,i.jsx)(Zr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>o(!0),children:(0,i.jsx)(pc,{icon:"xmark"})}),s&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_34035"),text:n("suppression_de_73669",e.trace.name),onClose:()=>o(!1),onDelete:async()=>{await t({eventId:e.eventId,traceId:e.trace.id}),e.reload()}}),a&&(0,i.jsx)(V1,{event:e.event,eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>r(!1)})]})},W1=e=>{const n=os();return _m(e.onClose),xm(e.onClose),(0,i.jsxs)(Xl,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"240px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[e.traces.map(n=>(0,i.jsx)(B1,{event:e.event,eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(n.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:n},n.id)),(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:n("ajouter_un_trac_05425")})]})},G1=e=>{const{translate:n,params:{eventId:t}}=fc(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(!1),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(Xl,{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)(pc,{icon:"expand"})}),(0,i.jsxs)(z1,{isOpen:s,onClick:()=>{o(e=>!e),r(()=>!1),l(()=>!1),u(()=>!1)},children:[(0,i.jsx)(Zr,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.layer===Rn.Google?Yu.Maps.GooglePlan:e.layer===Rn.GoogleSatellite?Yu.Maps.GoogleSatellite:Yu.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(Zr,{color:"gray900",css:{flex:"1"},children:e.layer===Rn.Google?"Plan":e.layer===Rn.GoogleSatellite?n("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(z1,{isOpen:a,onClick:()=>{o(()=>!1),r(e=>!e),l(()=>!1),u(()=>!1)},children:(0,i.jsxs)(Xl,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(Zr,{color:"gray900",children:n("Traces")}),(0,i.jsx)(ic,{width:"1"}),e.traces.map(e=>(0,i.jsx)(Zr,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),e.showAcronymIcon&&(0,i.jsx)(z1,{isOpen:d,onClick:()=>{o(()=>!1),r(()=>!1),l(e=>!e),u(()=>!1)},children:(0,i.jsxs)(Xl,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"acronym"===e.acronymIcon?"text":"location-dot"})}),(0,i.jsx)(Zr,{color:"gray900",children:"acronym"===e.acronymIcon?n("acronymes_11499"):n("ic_nes_16022")})]})}),e.showExport&&(0,i.jsx)(z1,{isOpen:c,onClick:()=>{o(()=>!1),r(()=>!1),l(()=>!1),u(e=>!e)},children:(0,i.jsxs)(Xl,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(Zr,{fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"file-export"})}),(0,i.jsx)(Zr,{color:"gray900",children:n("exporter_59120")})]})})]}),s&&(0,i.jsx)(Zr,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(T1,{selectedLayer:e.layer,onChange:e.setLayer,onClose:()=>o(!1)})}),a&&(0,i.jsx)(Zr,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)(W1,{event:e.event,eventId:t,hiddenTracesIds:e.hiddenTracesIds,reload:e.reload,toggleVisible:n=>{e.setHiddenTracesIds(v(e.hiddenTracesIds,n))},traces:e.traces,onAddTrace:()=>{g(!0)},onClose:()=>{r(!1)}})}),m&&(0,i.jsx)(V1,{event:e.event,eventId:t,reload:e.reload,onClose:()=>{g(!1)}}),d&&(0,i.jsx)(Zr,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)(E1,{selectedAcronymIcon:e.acronymIcon,onChange:e.setAcronymIcon,onClose:()=>l(!1)})}),c&&(0,i.jsx)(Zr,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(w1,{onClose:()=>u(!1),onExport:e.onExport})})]})};function q1(e,n,t,i){t.current.forEach(e=>e.setMap(null)),t.current=e.map(e=>{const t=e.points.map(([e,n])=>({lat:e,lng:n})),s=e.direction===ft.None?[]:[{icon:{path:e.direction===ft.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:t,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,visible:!n.includes(e.id),icons:s});return o.setMap(i.current),o})}const H1=(0,de.memo)(e=>{const n=(0,de.useCallback)(n=>{n&&(t.current&&(s.current?.setMap(null),o.current?.setMap(null),t.current=null),t.current=new google.maps.Map(n,{...e.mapOptions??{},...od(e.initialCenter,e.initialZoom,e.layer)}),t.current.mapTypes.set(Rn.IgnPlan,md()),s.current=new google.maps.OverlayView,s.current.draw=Ou.A,s.current.setMap(t.current),t.current.addListener("drag",()=>{e.onMapDrag?.()}),t.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:t.current.getCenter().lat(),lng:t.current.getCenter().lng()})}),t.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(t.current.getZoom())}),t.current.addListener("click",n=>{e.showMarker&&(o.current?.setMap(null),o.current=new google.maps.Marker({position:n.latLng,map:t.current,draggable:!0}),e.onMarkerDragEnd?.(n.latLng.lat(),n.latLng.lng()),o.current.addListener("dragend",()=>{const n=o.current.getPosition();e.onMarkerDragEnd?.(n.lat(),n.lng())}))}),t.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),d(),q1(e.traces,e.hiddenTracesIds,r,t))},[]),t=(0,de.useRef)(null),s=(0,de.useRef)(null),o=(0,de.useRef)(null),a=(0,de.useRef)([]),r=(0,de.useRef)([]),d=()=>{a.current.forEach(e=>e.setMap(null)),a.current=e.positions.map(n=>{const i=td(ad(n)),o=new google.maps.Marker({position:i,map:t.current,icon:"acronym"===e.acronymIcon?`${ee.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(n.color)}&text=${n.acronym}`:`${ee.HEAVENT_API_URL}/icons/${hc(n.icon)}.svg?color=${encodeURIComponent(n.color)}`});return o.addListener("click",()=>{const t=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));t&&e.onPositionClick?.(n,t)}),o})};return(0,de.useEffect)(()=>{d()},[JSON.stringify(e.positions),e.acronymIcon]),(0,de.useEffect)(()=>{t.current?.setMapTypeId(rd(e.layer))},[e.layer]),(0,de.useEffect)(()=>{q1(e.traces,e.hiddenTracesIds,r,t)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(Zr,{ref:n,height:1,width:1})},dd.A);H1.displayName="PositionsMap";const Y1=e=>{const{organizationId:n,eventId:t}=ls(),s=ss(Nh);return(0,i.jsx)(Xl,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(gc,{to:Eo.POSITION({organizationId:n,eventId:t,positionId:e.position.id}),children:[(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",children:e.position.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:e.position.range?s.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"chevron-right"})})]})})},Z1=e=>{const{translate:n,params:{eventId:t,segmentId:s}}=fc(),{event:o,localEvent:a,updateLocalEvent:r}=Ly(),{canPositionEdit:d}=tC(),{mutate:l}=ka(),{setNewPositionLatLng:c}=Z0(),[u,m]=(0,de.useState)(e.layer),[g,h]=(0,de.useState)([]),[p,I]=(0,de.useState)(null),[f,x]=ZP("positionsMap.center",e.center),[_,j]=ZP("positionsMap.zoom",sd),[v,S]=ZP("positionsMap.acronymIcon","icon"),[y,C]=(0,de.useState)(a?.isPositionsMapAlertVisible??!0),b=(0,de.useRef)(null),A=(0,de.useCallback)(e=>{const n=f?`${f.lat},${f.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",g.join(",")),i.set("center",n),i.set("acronymIcon",v),i.set("zoom",_.toString(10)),window.open(`${ee.HEAVENT_API_URL}/image/event/${t}/positions/${s}/map.png?${i.toString()}`)},[f,_,g,v]);return(0,i.jsxs)(Xl,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[d&&y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"primary",onClose:async()=>{await r({isPositionsMapAlertVisible:!1}),C(!1)},children:(0,i.jsx)(Oc,{children:n("pour_cr_er_une_11133")})}),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(Zr,{ref:b,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(H1,{acronymIcon:v,hiddenTracesIds:g,initialCenter:f,initialZoom:_,layer:u,positions:e.positions,showMarker:d,traces:e.traces,onMapCenterChanged:x,onMapDrag:()=>I(null),onMapZoomchanged:e=>{I(null),j(e)},onMarkerDragEnd:(e,n)=>c({latitude:e,longitude:n}),onPositionClick:(e,n)=>I({position:e,left:n.x,top:n.y})})}),d&&(0,i.jsx)(G1,{acronymIcon:v,event:o,hiddenTracesIds:g,layer:u,reload:e.reload,setAcronymIcon:S,setHiddenTracesIds:h,setLayer:async e=>{m(e),await l({eventId:t,layer:e})},showAcronymIcon:!0,showExport:!0,traces:e.traces,onExport:A,onFullscreen:()=>{b.current?.requestFullscreen()}}),b.current&&p&&(0,hd.createPortal)((0,i.jsx)(Zr,{css:{left:`${p.left+32}px`,position:"absolute",top:p.top-35-16+"px",zIndex:10},children:(0,i.jsx)(Y1,{position:p.position})}),b.current)]})},K1=e=>{const{params:{eventId:n}}=fc(),{columns:t,rendering:s}=ah(),o=(0,de.useMemo)(()=>M0(t,s),[t,s]),{data:a,loader:r,reload:d}=(l={...o,eventId:n,name:w(e.name)?e.name:null,predicatesGroups:e.predicates,hasCoordinates:!0},rs(_d,l,[Ko.PositionsPositionFragment,Ko.TraceFragment],undefined));var l;return r?(0,i.jsx)(Xl,{css:{flex:"1"},children:r}):(0,i.jsx)(Z1,{center:xj(a.data),layer:a.data.layer,positions:a.data.rows.nodes,reload:d,traces:a.data.traces||[]})},X1=e=>{const n=(0,de.useMemo)(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),t=(0,de.useMemo)(()=>Jo.IX.fromDateTimes(e.startOfDay,n).overlaps(e.slot.range),[e.startOfDay,n,e.slot]),s=(0,de.useMemo)(()=>t?Jo.IX.fromDateTimes(Jo.c9.max(e.startOfDay,e.slot.range.start),Jo.c9.min(n,e.slot.range.end)):e.slot.range,[t,e.startOfDay,n,e.slot]),o=(0,de.useMemo)(()=>{const n=s.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.startOfDay,s]),a=(0,de.useMemo)(()=>{const n=s.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*n.hours+n.minutes)},[e.startOfDay,s]);return t?(0,i.jsx)(Xl,{css:{gridColumnStart:o,gridColumnEnd:a},height:32,children:e.renderSlot(e.slot,e.row)},s.toISO()):null},Q1=e=>{const[n,t]=(0,de.useState)(null),s=(0,de.useCallback)(e=>{e&&t(e.getBoundingClientRect())},[]),[o,a]=(0,de.useState)(!1),[r,d]=(0,de.useState)(1),l=(0,de.useMemo)(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=(0,de.useCallback)(e=>{const t=Math.floor(1440*(e.clientX-(n?.left??0))/(n?.width??0)),i=t-t%60+1;i!==r&&d(i)},[n,r,d]),u=(0,de.useCallback)(t=>{const i=Math.floor(1440*(t.clientX-(n?.left??0))/(n?.width??0)),s=i-i%60,o=l.plus({minute:s});e.onPlus?.(o,e.row)},[l,e.row,e.onPlus,n]);return(0,i.jsxs)(Xl,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(Xl,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(Wu,{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:()=>{a(!1)},onMouseOver:()=>{a(!0)},children:e.row.slots.map((n,t)=>(0,i.jsx)(X1,{renderSlot:e.renderSlot,row:e.row,slot:n,startOfDay:l},t))}),e.showPlus&&(0,i.jsx)(Wu,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:o&&(0,i.jsx)(Xl,{align:"center",css:{gridColumn:`${r} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(Xl,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(pc,{icon:"plus"})})})}),(0,i.jsx)(Wu,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,Sg.A)(0,23).map(e=>(0,i.jsx)(Zr,{css:{borderRightColor:"$gray200",borderInlineEndStyle:"dashed",borderInlineEndWidth:"1px","&:nth-child(2n)":{borderInlineEndStyle:"solid"},gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},J1=e=>{const n=ss(Wg),t=e.date.startOf("day").equals(e.minDate.startOf("day")),s=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(Xl,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(df,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(Xl,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(yc,{color:"white",disabled:t,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(Zr,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:n.toLocaleString(e.date,da.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(yc,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(Xl,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Xl,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(Xl,{css:{flex:"1"},children:(0,i.jsxs)(Wu,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(Zr,{css:{gridColumn:"span 60"}}),(0,Sg.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Xl,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,XQ.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(n=>(0,i.jsx)(Q1,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:n,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},n.id.toString(10)))]})},e2=e=>{const{params:{organizationId:n,eventId:t}}=fc(),s=w(e.position.acronym)?e.position.acronym:e.position.name;return(0,i.jsxs)(Xl,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Ug,{css:{overflow:"hidden",width:"100%"},to:Eo.POSITION({organizationId:n,eventId:t,positionId:e.position.id}),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:s,width:1,children:s})}),(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},n2=({shouldShowAssignButton:e=!0,...n})=>{const{translate:t,params:{organizationId:s,eventId:o}}=fc(),a=ss(Nh),r="number"==typeof n.slot.assignedResources&&"number"==typeof n.slot.fillingRate&&"number"==typeof n.slot.resources;return(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(UI,{color:n.position.color,icon:n.position.icon}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Ug,{to:Eo.POSITION({organizationId:s,eventId:o,positionId:n.position.id}),children:(0,i.jsx)(Zr,{css:{ellipsis:!0},width:1,children:n.position.name})}),(0,i.jsx)(Zr,{color:"gray500",children:n.category.name})]})]}),(0,i.jsxs)(Xl,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:w(n.slot.name)?n.slot.name:"-"})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{color:"gray500",children:t("cr_neau_horaire_28150")}),(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:a.toDisplayString(n.slot.range,{formats:{displayWeekday:!0}})})]}),r&&(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{justify:"between",children:[(0,i.jsx)(Zr,{color:"gray500",children:t("membres_11310")}),(0,i.jsxs)(Zr,{color:"gray500",children:[n.slot.assignedResources,"/",n.slot.resources]})]}),(0,i.jsx)(Zr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(VL,{percent:n.slot.fillingRate/100})})]})]}),e&&(0,i.jsx)(Xl,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(yc,{to:Wo.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,n.position.id,n.slot.id),children:t("affecter_sur_le_19590")})})]})},t2=e=>{const n=Gh(ss(Nh),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xl,{align:"center",css:{background:Fm(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"white textXs medium",title:n,width:1,children:n})})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(n2,{category:e.position.category,position:e.position,slot:e.slot})})]})},i2=e=>{const{params:{eventId:n}}=fc(),t=ss(c0),{isEditMode:s,limit:o,nameDebounced:a,offset:r,predicates:d,setLimit:l,setOffset:c}=ah(),{infos:u,setInfos:m}=DN(),{mutate:g}=function(e={}){return ds("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:h,loader:p}=rs("query PositionsPlanning(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: positions(\n name: $name\n predicatesGroups: $predicatesGroups\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...PositionPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,name:w(a)?a:void 0,predicatesGroups:d,limit:o,offset:r},[Ko.PositionPlanningFragment],undefined);const{numberOfPages:I,totalCount:f}=Jf(h.data?.rows),[x,_]=(0,de.useState)([]),j=(0,de.useMemo)(()=>Jo.c9.isDateTime(u.positionsPlanningStartAt)&&u.positionsPlanningStartAt?.isValid?u.positionsPlanningStartAt:Jo.c9.fromISO(u.positionsPlanningStartAt)?.isValid?Jo.c9.fromISO(u.positionsPlanningStartAt,{zone:"utc"}):Jo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Jo.c9.utc())?Jo.c9.utc():e.startAt,[e.startAt,e.endAt,u]),v=(0,de.useCallback)(n=>{m({...u,positionsPlanningStartAt:n?.toISO()??e.startAt.toISO()})},[e.startAt,u,m]),[S,y]=(0,de.useState)(!1),[C,b]=(0,de.useState)(e.startAt),[A,E]=(0,de.useState)(-1),$=(0,de.useMemo)(()=>{const n=Wh(e.dayStartTime);return n?.[0]??0},[e.dayStartTime]),T=(0,de.useCallback)(async e=>{const{data:{row:t}}=await function(e,n={}){return xa("query PositionsPlanningPosition($eventId: EventId!, $positionId: PositionId!) {\n data: event(id: $eventId) {\n row: position(id: $positionId) {\n ...PositionPlanning\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.PositionPlanningFragment]})}({eventId:n,positionId:e},{token:await fe()});_(n=>n.map(n=>n.id===e?t:n))},[n]);return(0,de.useEffect)(()=>{_(h.data?.rows.nodes??[])},[h.data]),p||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Xl,{css:{background:"white",flex:"1"},children:(0,i.jsx)(J1,{data:x,date:j,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(e2,{position:e}),renderSlot:(e,n)=>(0,i.jsx)(t2,{position:n,slot:e}),showPlus:s,startHour:$,onChange:v,onPlus:(e,n)=>{b(e),y(!0),E(n.id)}})}),(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{limit:o,numberOfPages:I,offset:r,setLimit:l,setOffset:c,showLimits:!0,totalCount:f})})]}),S&&(0,i.jsx)(_0,{event:{endAt:e.endAt,startAt:e.startAt},slot:t.positionsSlotInputDefault(C),onClose:()=>{y(!1)},onSuccess:async e=>(await g({eventId:n,positionId:A,positionSlot:e}),T(A))})]})};function s2(e,n,t,i){const s=L1(e),o=(e=>Object.fromEntries(Array.from(e.querySelectorAll("Style")).map(e=>{const n=e.getAttribute("id"),[,,t,i,s,o,a,r]=(e.querySelector("color")?.textContent||"").trim().split("");return[`#${n}`,`#${a}${r}${s}${o}${t}${i}`]})))(s);return Array.from(s.querySelectorAll("Placemark")).map(e=>((e,n,t,i,s)=>{const[o="",a=""]=(e.querySelector("Point coordinates")?.textContent||"").trim().split(",");return{positionCategoryId:n,name:(e.querySelector("name")?.textContent||"").trim(),description:(e.querySelector("description")?.textContent||"").trim(),privateNote:"",color:s[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||Lr.colors.primary500.value,icon:En.LocationDot,weezeventIsSynchronized:!1,layer:t,latitude:parseFloat(a),longitude:parseFloat(o),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],positionDisplay:Ln.List,conditionsOperator:Ge.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,n,t,i,o))}const o2=e=>{const n=os(),{data:t,loader:s}=rs("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},[],undefined);const{mutate:o,isLoading:a}=function(e={}){return ds("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n positionsCreate(eventId: $eventId, positions: $positions) {\n id\n }\n}\n",e)}(),[r,d]=(0,de.useState)(),[l,c]=(0,de.useState)(-1),u=w(r?.content)&&-1!==l;return(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Zr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(pc,{icon:"cloud-arrow-up"})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:n("importer_des_mi_32264")}),(0,i.jsx)(ic,{height:"7"}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zX,{accept:Jv.Kml,format:"string",label:n("fichier_kml_55657"),placeholder:n("s_lectionnez_un_75984"),value:r,onChange:e=>{d(e)}}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsxs)(nf,{label:n("cat_gorie_00291"),shouldParseAsInt:!0,value:l??-1,onChange:e=>{c(e)},children:[(0,i.jsx)("option",{disabled:!0,value:"-1",children:n("choisissez_la_c_72356")}),t.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[(0,i.jsx)(yc,{disabled:!u,isLoading:a,onClick:async()=>{r&&(await o({eventId:e.eventId,positions:s2(r.content,l,t.event.layer,t.event.startAt)}),window.location.reload())},children:n("importer_90688")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},a2=({name:e,numberOfCategories:n,segment:t})=>{const{history:s,params:{organizationId:o,eventId:a},translate:r}=fc(),{columns:d}=ah(),{user:l}=ps(),{hasFeature:c}=Yy(),{hasPermission:u}=Ly(),{newPositionLatLng:m}=Z0(),{data:g,isLoading:h}=rs("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:a,segmentId:t.id},[],undefined);const{mutate:p}=function(e={}){return ds("mutation PositionsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: positionsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[I,f]=(0,de.useState)(!1),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),{checkExport:S}=Sy(),[y,C]=(0,de.useState)(!1),[b,A]=(0,de.useState)(!1),E=u(nC.POSITION_EDIT,{eventId:"ANY"}),w=u(nC.POSITION_EDIT,{positionCategoryId:"ANY"}),$=(0,de.useMemo)(()=>{let e;return m&&(e=`${m.latitude},${m.longitude}`),Wo.CREATE_POSITION(o,a,e)},[m]);return(0,i.jsxs)(gL,{name:(0,i.jsxs)(Xl,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray900 displayXs medium",title:e,children:e}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"gray500",children:(0,i.jsx)(pc,{icon:"circle-exclamation"})})}),(0,i.jsxs)(ux,{placement:"bottom-start",renderOnPortal:!0,children:[r("nombre_de_missi_06171",g.event?.segment.count??0),(0,i.jsx)("br",{}),r("nombre_de_membr_16367",g.event?.segment.stats?.assignedResources??0),(0,i.jsx)("br",{}),r("nombre_de_membr_29724",g.event?.segment.stats?.resources??0)]})]})]}),children:[E?(0,i.jsx)(TR,{menu:(0,i.jsxs)(i.Fragment,{children:[c(In.KmlImport)&&(0,i.jsx)(Em,{color:0===n?"disabled":"default",icon:"file-import",onClick:()=>{f(!1),A(!0)},children:r("importer_des_mi_32264")}),(0,i.jsx)(Em,{icon:"file-import",to:Eo.POSITION_IMPORT_CSV({organizationId:o,eventId:a}),children:r("import_tasks_fr_52548")})]}),path:$,children:r("cr_er_une_missi_66818")}):w?(0,i.jsx)(yc,{onClick:()=>{s.push($)},children:r("cr_er_une_missi_66818")}):null,E&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ym,{isOpen:I,onStateChange:f,children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"plus",onClick:()=>{f(!1),C(!0)},children:r("cr_er_une_cat_g_20051")})}),(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"calendar",to:Ex(g.event?.segment.links.positionsPlanningLink,"html"),children:r("voir_le_plannin_85187")}),(0,i.jsx)(Em,{icon:"calendar",to:Ex(g.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:r("voir_le_plannin_47650")}),(0,i.jsxs)(lC,{permissions:nC.POSITION_EDIT,children:[(0,i.jsx)(Em,{icon:"plug-circle-bolt",onClick:e=>{vm(e.target),_(!0)},children:r("exporter_via_l_09843")}),(0,i.jsx)(Em,{icon:"file-xls",onClick:e=>{vm(e.target),v(!0)},children:r("exporter_en_exc_51862")})]}),(0,i.jsx)(Em,{download:`${t.name}-positions-planning`,icon:"arrow-down-to-bracket",to:Ex(g.event?.segment.links.positionsPlanningLink,"pdf"),children:r("t_l_charger_le_06050")}),(0,i.jsx)(Em,{download:`${t.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:Ex(g.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:r("t_l_charger_le_02952")})]})]})]}),y&&(0,i.jsx)(p0,{eventId:a,onClose:()=>{C(!1)},onSuccess:({id:e})=>{s.push(Eo.POSITION_CATEGORY({organizationId:o,eventId:a,positionCategoryId:e}))}}),b&&(0,i.jsx)(o2,{eventId:a,onClose:()=>{A(!1)}}),!h&&(0,i.jsx)(eV,{isOpen:x,link:Ax({organizationId:o,eventId:a,lang:l?.language,pathComponent:"positions",key:g.event.key}),onClose:()=>{_(!1)}}),!h&&(0,i.jsx)(nV,{isOpen:j,requestExport:async e=>{const{jobId:n}=await p({organizationId:o,eventId:a,segmentId:t.id,format:e,columns:d});S(n,o,a)},showIncludeFiles:!1,onClose:()=>{v(!1)}})]})]})},r2=e=>{const n=os(),t=us(),{hasPermission:s,updateLocalEvent:o}=Ly(),{limit:a,nameDebounced:r,predicates:d,rendering:l}=ah(),{segment:c}=DN(),u=s(nC.SEGMENT_EDIT)&&(l===mp.List||l===mp.SlotsList),m=s(nC.POSITION_EDIT,{eventId:"ANY"})&&(l===mp.Calendar||l===mp.List||l===mp.SlotsList);return(0,de.useEffect)(()=>{o({positionBackPath:t.pathname,positionCategoryBackPath:t.pathname})},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a2,{name:c.name,numberOfCategories:e.event.positionsCategories.length,segment:c}),0===e.event.numberOfPositions&&l!==mp.Map?(0,i.jsx)(yC,{css:{overflow:"hidden"},children:(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Jw,{subtitle:n("plus_besoin_de_08254"),title:n("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:l===mp.SlotsList?(0,i.jsx)(W0,{event:e.event}):(0,i.jsx)(f1,{}),searchPlaceholder:n("rechercher_une_69998"),showActions:s(nC.POSITION_EDIT),showEditColumns:u,showEditMode:m,showSearchColumns:s(nC.SEGMENT_EDIT)}),selectSegment:l===mp.SlotsList?(0,i.jsx)(cI,{allSelectedText:n("les_1_cr_neau_33428",c.count,c.name),pageSelectedText:n("les_1_cr_neau_31538",a),selectAllText:n("s_lectionner_le_71777",c.count,c.name)}):(0,i.jsx)(cI,{allSelectedText:n("les_1_mission_38484",c.count,c.name),pageSelectedText:n("les_1_mission_95719",a),selectAllText:n("s_lectionner_le_71777",c.count,c.name)})}),l===mp.List?(0,i.jsx)(A1,{customFields:e.customFields}):l===mp.Map?(0,i.jsx)(K1,{name:r,predicates:d}):l===mp.SlotsList?(0,i.jsx)(u1,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(i2,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},d2={async loadDataList(e,n){const{event:t}=await function(e,n={}){return xa("query PositionsSlots(\n $eventId: EventId!\n $name: String\n $predicatesGroups: PredicatesGroups\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: PositionsSlotsSort\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeLeaders: Boolean!\n $includePositionTraces: Boolean!\n $includeTags: Boolean!\n $includeVolunteerMinutes: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n name: $name\n predicatesGroups: $predicatesGroups\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",{...n,variables:e,fragments:[Ko.PositionsPositionSlotFragment]})}(e,n);return{data:{rows:t.positionsSlots}}},async loadRow(e,n){const{event:t}=await function(e,n={}){return xa("query PositionsPositionSlot(\n $eventId: EventId!\n $id: PositionsSlotId!\n $includeCheckedInRate: Boolean!\n $includeCheckedOutRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeDescription: Boolean!\n $includeLeaders: Boolean!\n $includePositionTraces: Boolean!\n $includeTags: Boolean!\n $includeVolunteerMinutes: Boolean!\n) {\n event(id: $eventId) {\n positionSlot(id: $id) {\n ...PositionsPositionSlot\n }\n }\n}\n",{...n,variables:e,fragments:[Ko.PositionsPositionSlotFragment]})}(e,n);return{data:{row:t.positionSlot}}}},l2=e=>e===mp.SlotsList?d2:e===mp.List?{}:null,c2=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{hasPermission:r,localEvent:d,updateLocalEvent:l}=Ly(),c=ss(P0),u=(0,de.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),m=(0,de.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields,{isWeezeventConnected:e.event.isWeezeventConnected}),[e.customFields,e.event]);return(0,i.jsx)(Y0,{eventId:o,organizationId:s,children:(0,i.jsx)(JN,{canSegmentEdit:r(nC.SEGMENT_EDIT),columnsToIncludes:M0,eventId:o,filters:u,filtersButtonText:t("filtrer_les_mis_43681"),filtersSubtitle:t("appliquer_des_f_16037"),getSegmentPath:e=>Wo.POSITIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfPositions,initialLimit:d?.positionsLimit??jg,initialSegmentsOpen:d?.arePositionsSegmentsOpen??!0,loadDataList:_l,loadRow:xl,organizationId:s,possibleColumns:m,possibleRenderings:[mp.List,mp.Calendar,mp.Map,mp.SlotsList],reload:e.reload,renderingLoaders:l2,segmentId:a,segmentType:lt.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{l({positionsLimit:e})},showMassActions:r(nC.POSITION_EDIT,{eventId:"ANY"}),showRowDropdown:r(nC.POSITION_EDIT),onSegmentClick:e=>{l({positionsSegmentId:e})},onSegmentDelete:async()=>{await l({positionsSegmentId:null}),n.push(Eo.POSITIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await l({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(r2,{customFields:e.customFields,event:e.event,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},u2=(0,de.memo)(function(){const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s},localEvent:o}=Ly();fm(`${s} ${t("missions_63972")}`);const{data:a,loader:r,reload:d}=rs("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(eventId: $eventId, 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 isWeezeventConnected\n\n positionsCategories {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n traces {\n id\n name\n }\n\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:n},[Ko.SegmentCustomFieldFragment,Ko.LeaderInfosFragment,Ko.SegmentsFoldersSegmentsFragment],undefined);const l=(0,de.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(c2,{customFields:a.organization.customFields.nodes,event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.POSITIONS_SEGMENT(e,n,o?.positionsSegmentId&&l.includes(o.positionsSegmentId)?o?.positionsSegmentId:l[0]),replace:!0})})]})}),m2=Nr("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),g2=Nr("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),h2=e=>{const{translate:n}=fc();return(0,i.jsx)(yz,{title:n("param_tres_78420"),children:(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:f(e.customFields)?(0,i.jsx)(Zz,{children:e.customFields.map(({customField:n,conditionValue:t})=>(0,i.jsx)(de.Fragment,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"1",justify:"between",children:[(0,i.jsx)(m2,{children:n.name}),(0,i.jsx)(g2,{children:e.renderValue(n,t)})]})},n.slug))}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})})};t(7411);const p2=(0,de.forwardRef)((e,n)=>{const t=(0,de.useRef)(null),s=(0,de.useMemo)(()=>e.max===1/0?1:0===e.max?1/0:e.value/e.max,[e.max,e.value]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n circle-progress::part(base) {\n width: 70px;\n height: auto;\n }\n\n circle-progress::part(value) {\n stroke-width: 8;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke: ${Fm(s)};\n }\n\n circle-progress::part(text) {\n font-family: var(--fonts-grafik);\n fill: var(--colors-gray800);\n font-size: var(--fontSizes-textXs);\n font-size: 24px; /* For some reason the above rule applies the correct size value, but the text renders smaller. */\n font-weight: var(--fontWeights-medium);\n }\n `}}),(0,i.jsx)("circle-progress",{ref:e=>{t.current=e,"function"==typeof n?n(e):n&&(n.current=e)},max:e.max,"text-format":e.textFormat,value:e.value})]})});p2.displayName="ProgressCircle";const I2=e=>{const{translate:n}=fc(),t=Cg();return(0,i.jsx)(yz,{css:{flex:"1 1 auto",inlineSize:"unset"},title:e.title,children:(0,i.jsxs)(Xl,{direction:"column",...t?{gap:"9"}:{gap:"7"},gap:"1",width:1,children:[(0,i.jsxs)(Xl,{gap:"4",height:78,children:[(0,i.jsx)(p2,{"aria-label":e.title,max:e.position.resources,textFormat:"percent",value:e.position.assignedResources}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",justify:"center",children:[(0,i.jsxs)(wc,{css:{fontSize:"$textXl",lineHeight:"122.222%","& > .numerator":{fontSize:"$displayMd",fontWeight:"$semiBold",letterSpacing:"-0.72px"}},children:[(0,i.jsx)("span",{className:"numerator",children:e.position.assignedResources}),"/",(0,i.jsx)("span",{className:"denominator",children:e.position.resources})]}),e.position.numberOfSlots&&(0,i.jsx)(wc,{css:{fontSize:"$textXs"},textStyle:"subtitle",children:n("spread_over_1_54650",e.position.numberOfSlots)})]})]}),(0,i.jsx)(Xl,{children:(0,i.jsx)(Lm,{color:"orange",leftIcon:"user-group",children:n("_1_membre_pr_32812",e.position.preassignedResources)})})]})})},f2=e=>(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",justify:"center",children:[(0,i.jsx)(wc,{css:{fontSize:"$displayMd",fontWeight:"$semiBold"},children:e.value}),(0,i.jsx)(wc,{textStyle:"subtitle",children:e.description})]}),x2=e=>{const{params:{eventId:n,positionId:t},translate:s}=fc(),{data:o,isLoading:a}=rs("query PositionKpis($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n slots {\n fillingRate\n }\n }\n }\n}\n",{eventId:n,positionId:t},[],undefined);const r=(0,de.useMemo)(()=>o.event?{below25:o.event.position.slots.filter(e=>e.fillingRate<25).length,between25and50:o.event.position.slots.filter(e=>e.fillingRate>=25&&e.fillingRate<50).length,between50and75:o.event.position.slots.filter(e=>e.fillingRate>=50&&e.fillingRate<75).length,above75:o.event.position.slots.filter(e=>e.fillingRate>=75&&e.fillingRate<100).length,complete:o.event.position.slots.filter(e=>100===e.fillingRate).length,overquota:o.event.position.slots.filter(e=>e.fillingRate>100).length}:{below25:1/0,between25and50:1/0,between50and75:1/0,above75:1/0,complete:1/0,overquota:1/0},[o.event?.position?.slots]);return(0,i.jsx)(yz,{css:{flex:"2 1 auto",inlineSize:"unset"},title:e.title,children:a?(0,i.jsx)(Pg,{}):(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(0,i.jsx)(f2,{description:s("below_25_26800"),value:r.below25}),(0,i.jsx)(f2,{description:s("between_25_and_61597"),value:r.between25and50}),(0,i.jsx)(f2,{description:s("between_50_and_79860"),value:r.between50and75}),(0,i.jsx)(f2,{description:s("over_75_74073"),value:r.above75}),(0,i.jsx)(f2,{description:s("complet_51600"),value:r.complete}),(0,i.jsx)(f2,{description:s("au_dessus_du_qu_60828"),value:r.overquota})]})})},_2=e=>{const n=os(),{hasPermission:t}=Ly(),s=t(nC.MEMBER_ASSIGN,{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:o}=nr(),{mutate:a}=vr(),[r,d]=(0,de.useState)(!1),l=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[l.state===Be.Waiting&&(0,i.jsx)(Em,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:We.CheckIn,positionsSlotsUsersInfosIds:[l.id]}}),e.reload()},children:n("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),l.state===Be.CheckedIn&&(0,i.jsx)(Em,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:We.CheckOut,positionsSlotsUsersInfosIds:[l.id]}}),e.reload()},children:n("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),(0,i.jsx)(Em,{icon:"circle-check",onClick:()=>d(!0),children:n("mettre_jour_l_00128")}),l.state!==Be.Waiting&&(0,i.jsx)(Em,{icon:"arrows-rotate",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:We.Reset,positionsSlotsUsersInfosIds:[l.id]}}),e.reload()},children:n("remettre_z_ro_11572")}),s&&(0,i.jsx)(Em,{color:"red",icon:"user-xmark",onClick:async()=>{await a({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:Dn.Delete}}),e.reload()},children:n("d_saffecter_du_47122")})]}),(0,i.jsx)(qw,{isOpen:r,positionSlotUserInfo:l,onClose:()=>{e.reload(),d(!1)}})]})},j2=e=>{const{translate:n,params:{eventId:t}}=fc(),s=ss(Wg),o=ss(dE);return(0,i.jsxs)(Eg,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(MC,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)(_g,{children:e.volunteerRegistration.positionSlotUserInfo.state===Be.CheckedOut?(0,i.jsx)(Lm,{leftIcon:"clock",children:n("temps_total_79448",o.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===Be.CheckedIn?(0,i.jsx)(Lm,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:n("point_le_1_63576",s.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),da.DateTime))}):(0,i.jsx)(Lm,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:n("non_point_42145")})}),(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsx)(_2,{eventId:t,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},v2=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,positionId:o,positionSlotId:a}}=fc(),r=ss(Nh),[d,l]=(0,de.useState)(0),[c,u]=(0,de.useState)({direction:ut.Asc,attribute:bt.Name}),{data:m,isLoading:g,reload:h}=rs("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 breakTime\n checkInAt\n checkOutAt\n eventId\n id\n state\n timeDifferenceMinutes\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:s,positionSlotId:a,offset:d,sort:c},[],undefined);const{numberOfPages:p,totalCount:I}=Jf(m.event?.volunteersRegistrations),f=(0,de.useMemo)(()=>m.event?.positionSlot?m.event.positionSlot.resources-m.event.positionSlot.assignedResources:0,[m.event?.positionSlot]),{hasPermissions:x}=Ly(),[_]=g?[!1]:x([nC.MEMBER_ASSIGN],{positionCategoryId:m.event.positionSlot.positionCategoryId,positionId:o});return(0,i.jsxs)(fI,{returnToFallback:Eo.POSITION({organizationId:t,eventId:s,positionId:o}),size:"md",children:[(0,i.jsx)(YC,{children:(0,i.jsx)(Xl,{direction:"column",gap:"1",width:1,children:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{children:m.event.positionSlot.name||"-"}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:r.toDisplayString(m.event.positionSlot.range)})]})})}),(0,i.jsxs)(xI,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{children:n("liste_des_membr_89037")}),m.event?f>0?(0,i.jsx)(Lm,{color:"warning",children:n("_1_membre_manq_31014",f)}):(0,i.jsx)(Lm,{color:"success",children:n("complet_51600")}):null]}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsxs)(gg,{children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(ax,{attribute:bt.Name,setSort:e=>{l(0),u(e)},sort:c,children:n("nom_08311")}),(0,i.jsx)(Mg,{children:n("State")}),(0,i.jsx)(Mg,{width:100})]}),g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):m.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(j2,{positionSlot:m.event.positionSlot,reload:h,volunteerRegistration:e},e.id)),(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{numberOfPages:p,offset:d,setOffset:l,totalCount:I})})]}),(0,i.jsx)(ic,{height:"5"})]}),(0,i.jsx)(_I,{children:(0,i.jsxs)(Xl,{gap:"3",justify:"end",children:[_&&(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.POSITION_SLOT_ASSIGN_VOLUNTEERS(t,s,o,a))},children:n("affecter_des_me_30349")}),(0,i.jsx)(yc,{color:"white",onClick:()=>e.goBack(Eo.POSITION_SLOT({organizationId:t,eventId:s,positionId:o,positionSlotId:a})),children:n("fermer_62479")})]})})]})},S2=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),a=ss(Nh),{hasPermissions:r}=Ly(),d=ss(c0),{mutate:l}=bl(),{mutate:c}=nr(),{mutate:u}=function(e={}){return ds("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)}(),[m,g]=(0,de.useState)(!1),[h,p]=(0,de.useState)(!1),I=(0,de.useMemo)(()=>a.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[f,x]=r([nC.POSITION_EDIT,nC.MEMBER_ASSIGN],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Eg,{css:{cursor:"pointer"},onClick:()=>{n.push(Wo.POSITION_SLOT_MEMBERS(s,o,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)(_g,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:w(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)(_g,{css:{textTransform:"capitalize"},children:I}),(0,i.jsx)(_g,{children:(0,i.jsx)(uU,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsxs)(Lg,{children:[x&&(0,i.jsx)(Em,{icon:"wand-magic-sparkles",to:Wo.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,e.slot.positionId,e.slot.id),children:t("affecter_des_me_30349")}),f&&(0,i.jsx)(Em,{icon:"pen",onClick:()=>{g(!0)},children:t("_diter_62574")}),f&&(0,i.jsx)(Em,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{p(!0)},children:t("supprimer_43083")}),(0,i.jsx)(Em,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:We.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:t("pointer_les_mem_50347")}),(0,i.jsx)(Em,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:We.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:t("d_pointer_les_m_17150")})]})})]}),m&&(0,i.jsx)(_0,{event:e.event,slot:d.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{g(!1)},onSuccess:async n=>{await l({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:n}),e.reload()}}),h&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_48876")],text:t("suppression_de_73669",I),onClose:()=>{p(!1)},onDelete:async()=>{await u({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},y2=()=>{const{translate:e,params:{eventId:n,positionId:t}}=fc(),[s,o,a]=Dg(""),[r,d]=ZP("position.slots.date",Jo.c9.invalid("Invalid"),sx),[l,c]=(0,de.useState)(0),[u,m]=ZP("position.slots.sort",null),{data:g,isLoading:h,reload:p}=rs("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:n,positionId:t,name:w(o)?o:void 0,date:r.isValid?r:void 0,offset:l,sort:u},[Ko.PositionPositionSlotFragment],undefined);const{numberOfPages:I,totalCount:f}=Jf(g.event?.positionsSlots),x=(0,de.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:a})}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(df,{max:g.event?.endAt,min:g.event?.startAt,value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:qn.Name,setSort:x,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(ax,{attribute:qn.Range,setSort:x,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(Mg,{children:e("remplissage_75916")}),(0,i.jsx)(Mg,{width:100})]}),numberOfPages:I,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.event.positionsSlots.nodes.map(e=>(0,i.jsx)(S2,{event:g.event,reload:p,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:f})},C2=()=>{const{params:{organizationId:e,eventId:n,positionId:t},translate:s}=fc(),o=ss(Nh),{roles:a}=Yy(),{hasPermission:r}=Ly(),{data:d,loader:l,reload:c}=yl({organizationId:e,eventId:n,positionId:t}),{mutate:u}=dl(),{mutate:m}=Ga(),g=r(nC.POSITION_EDIT,{positionCategoryId:d.event?.position.positionCategoryId,positionId:t}),h=(0,de.useMemo)(()=>d?.event?.position?.slots?.filter(e=>e.fillingRate>100),[d?.event?.position?.slots]),p=as();return l||(0,i.jsx)(yC,{gap:"4",children:(0,i.jsxs)(Ig.Provider,{value:{designSystem:pg},children:[f(h)&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:s("certains_cr_nea_52758")}),(0,i.jsx)(Oc,{children:[...p(s("les_cr_neaux_su_69909","{1}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:h.map(e=>(0,i.jsx)("li",{children:Gh(o,e,d.event.position.name,{slot:{includeRange:!0}})},e.id))}))]})]}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(I2,{position:d.event.position,title:s("remplissage_de_52564")}),(0,i.jsx)(x2,{position:d.event.position,title:s("taux_de_remplis_12961")})]}),f(d.organization.customFields.nodes)&&(0,i.jsx)(h2,{customFields:d.organization.customFields.nodes.map(e=>({customField:e,conditionValue:null})),renderValue:e=>(0,i.jsx)(Lw,{field:e,fields:d.event.position.fields})}),(0,i.jsx)(y2,{}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(UO,{leaders:d.event.position.leaders,reload:c,roles:a.positionRoles,onSave:e=>u({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[t]},strategy:Dn.Replace}})}),(0,i.jsx)(h2,{customFields:d.event.position.customFields,renderValue:(e,n)=>XW(s,e,n)}),(0,i.jsx)(nO,{modalSubtitle:s("ajouter_des_tag_64526"),reload:c,tags:d.event.position.tags,...g?{associateTags:e=>m({eventId:n,massEdit:{reset:!1,selecteds:{ids:[t]},slug:Un.Tag,strategy:Dn.Replace,value:e}})}:{}})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Mz,{description:d.event.position.description}),(0,i.jsx)(KG,{location:d.event.position}),(0,i.jsx)(Kz,{privateNote:d.event.position.privateNote})]})]}),(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(v2,{})})]})})},b2=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(Dp),{canCustomFieldRead:a,canMemberAccredit:r,canMemberAssign:d,canMemberEdit:l}=tC(),[c,u]=ZP("positionMembers.columns",[Op.Name,Op.Positions]),[m,g]=ZP("positionMembers.limit",jg),[h,p]=ZP("positionMembers.predicates",[]),I=(0,de.useMemo)(()=>lh(h),[h]),[f,x]=ZP("positionMembers.sort",null),{data:_}=Cr({organizationId:t,eventId:s,privacy:a&&l?He.All:He.Public,loadCustomDocuments:!1,loadForms:!1,loadSegments:!1}),j=(0,de.useMemo)(()=>_.organization?.customFields.nodes??[],[_.organization]),v=aE(j),S=(0,de.useMemo)(()=>_.event?o.getPositionMembersFilters(t,s,j,_.event):[],[s,j,_.event]),y=(0,de.useMemo)(()=>o.getPositionMembersPossibleColumns(j),[j]),C=(0,de.useMemo)(()=>({positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId}),[e.positionCategoryId,e.positionId,e.preassignedPositionCategoryId,e.preassignedPositionId]);return(0,i.jsx)(yC,{children:(0,i.jsx)(nx,{columns:c,columnsSearch:[],columnsToIncludes:Rp,eventId:s,filters:S,getMassActionId:e=>e.userInfo.id,limit:m,loadDataList:wr,loadDataListParams:{includeCanRegistrationStateUpdate:!0,includeIsEditable:!0,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:Er,loadRowParams:{includeCanRegistrationStateUpdate:!0,includeIsEditable:!0},organizationId:t,possibleColumns:y,predicates:I,renderActions:(e,n,t)=>(0,i.jsx)(Rq,{massActions:e,predicates:I,scope:C,showOnlyMassEdit:!0,sort:f,totalNumberOfMembers:n,onMassEditSuccess:t}),renderAllSelectedText:e=>n("les_1_membres_31409",e),renderPageSelectedText:e=>n("les_1_membres_00895",e),renderSelectAllText:e=>n("s_lectionner_le_34300",e),rendering:gp.List,setColumns:u,setLimit:g,setPredicates:p,setSort:x,showEditColumns:l,showEditMode:l,showFilters:!0,showMassActions:l,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,showSelectAll:!0,sort:f,children:(0,i.jsx)(px,{renderCell:(e,n,t)=>(0,i.jsx)(Ew,{canChangeDelegation:l,canMemberAccredit:r,canMemberAssign:d,column:e,customField:v.get(e.slug),eventId:s,reloadRow:t,row:n})})})})},A2=e=>(0,i.jsx)(Xl,{align:"center",css:{padding:"$2 $4"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsx)(MC,{size:32,userInfo:e.vr.userInfo})}),E2=()=>{const{translate:e}=fc();return(0,i.jsx)(Xl,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},w2=e=>{const n=ss(Nh),t=(0,de.useMemo)(()=>Mm(e.slot.position.color),[e.slot]),s=(0,de.useMemo)(()=>Gh(n,e.slot.positionSlot,e.slot.position.name,{position:{includeName:e.shouldShowPositionName??!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(Xl,{align:"center",css:{background:t[50],border:`1px solid ${t[500]}`,borderRadius:"$1",color:t[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:s,width:1,children:s})})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(n2,{category:e.slot.positionCategory,position:e.slot.position,shouldShowAssignButton:e.shouldShowAssignButton,slot:e.slot.positionSlot})})]})},$2=e=>"assignment"===e.slot.type?(0,i.jsx)(w2,{shouldShowAssignButton:e.shouldShowAssignButton,shouldShowPositionName:e.shouldShowPositionName,slot:e.slot}):(0,i.jsx)(E2,{}),T2=e=>{const{params:{organizationId:n,eventId:t,positionId:s},translate:o}=fc(),[a,r]=(0,de.useState)(null),[d,l]=(0,de.useState)(0),[c,u,m]=Dg(""),g=ss(Dp),[h,p]=ZP("positionMembers.columns",[Op.Name,Op.Positions]),[I,f]=ZP("positionMembers.limit",jg),[x,_]=ZP("positionMembers.predicates",[]),j=(0,de.useMemo)(()=>lh(x),[x]),[v,S]=ZP("positionMembers.sort",null),{data:y,loader:C}=Pl({eventId:t,positionId:s,predicatesGroups:j,name:w(u)?u:void 0,limit:I,offset:d}),[b,A]=(0,de.useState)(!0),E=(0,de.useMemo)(()=>e.customFields.nodes??[],[e.customFields]),$=(0,de.useMemo)(()=>y.data?g.getPositionMembersFilters(n,t,E,y.data):[],[t,E,y.data]),T=(0,de.useMemo)(()=>g.getPositionMembersPossibleColumns(E),[E]),z=(0,de.useMemo)(()=>Jo.c9.isDateTime(a)&&a?.isValid?a:Jo.c9.fromISO(a)?.isValid?Jo.c9.fromISO(a,{zone:"utc"}):Jo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Jo.c9.utc())?Jo.c9.utc():e.startAt,[e.startAt,e.endAt,a]),O=(0,de.useCallback)(n=>{r(n?.toISO()??e.startAt.toISO())},[e.startAt,r]),R=(0,de.useMemo)(()=>{const n=Wh(e.dayStartTime);return n?.[0]??0},[e.dayStartTime]),D=(0,de.useMemo)(()=>(y.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>b?[{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})))})),[y.data,b]);return C||(0,i.jsx)(yC,{children:(0,i.jsxs)(nx,{columns:h,columnsSearch:[],columnsToIncludes:Rp,eventId:t,filters:$,limit:I,loadDataList:kl,loadDataListParams:{level:t?kn.Event:kn.Organization},loadRow:Cl,name:c,organizationId:n,possibleColumns:T,predicates:j,rendering:up.List,setColumns:p,setLimit:f,setName:m,setPredicates:_,setSort:S,showEditColumns:!1,showEditMode:!1,showFilters:!0,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:v,children:[(0,i.jsx)(Xl,{css:{background:"white",flex:"1"},children:(0,i.jsx)(J1,{data:D,date:z,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(Zr,{width:40,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:b?"eye":"eye-slash",onClick:()=>A(!b)})}),(0,i.jsx)(ux,{placement:"top",children:o(b?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(A2,{vr:e}),renderSlot:e=>(0,i.jsx)($2,{shouldShowAssignButton:!1,shouldShowPositionName:!1,slot:e}),showPlus:!1,startHour:R,onChange:O})}),(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{itemName:o("membres_67337"),limit:I,numberOfPages:y.data.rows.numberOfPages,offset:d,setLimit:f,setOffset:l,showLimits:!0,totalCount:y.data.rows.totalCount})})]})})},z2=e=>{const{params:{organizationId:n,eventId:t}}=fc(),{data:s,loader:o}=rs("query OrganizationCustomFields($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:n,eventId:t},[Ko.OrganizationCustomFieldsFragment],undefined);return o||(0,i.jsx)(T2,{customFields:s.organization.customFields,...e})},O2=e=>{const{params:{organizationId:n,eventId:t,positionId:s},translate:o}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:Eo.POSITIONS({organizationId:n,eventId:t}),children:o("missions_63972")}),(0,i.jsx)(gO,{to:Eo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.position.positionCategoryId}),children:e.position.positionCategoryName}),(0,i.jsx)(gO,{isCurrent:!0,to:Eo.POSITION({organizationId:n,eventId:t,positionId:s}),children:e.position.name})]})},R2=()=>{const{history:e,params:{organizationId:n,eventId:t,positionId:s},translate:o}=fc(),{user:a}=ps(),{data:r,isLoading:d}=rs("query PositionHeader($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n id\n name\n acronym\n icon\n color\n positionCategoryId\n positionCategoryName\n range\n assignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n }\n}\n",{eventId:t,positionId:s},[],undefined);const{hasPermission:l}=Ly(),c=!d&&l(nC.POSITION_EDIT,{positionCategoryId:r.event.position.positionCategoryId}),u=ss(Nh),m=x1(),g=VG(),[h,p]=(0,de.useState)(!1),I=(0,de.useMemo)(()=>r.event?.position,[r.event]);return(0,i.jsx)(CC,{acronym:I?.acronym,breadcrumbs:I&&(0,i.jsx)(O2,{position:I}),buttons:I&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yc,{color:"white",download:`${I.name}-position-sheet`,to:Ex(I.links.positionSheetLink,"pdf",{lang:a?.language}),children:o("t_l_charger_la_16259")}),(0,i.jsx)(lC,{permissions:nC.POSITION_EDIT,scope:{positionCategoryId:I.positionCategoryId,positionId:I.id},children:(0,i.jsx)(yc,{to:Wo.EDIT_POSITION(n,t,I.id),children:o("_diter_la_missi_90442")})}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{download:`${I.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:Ex(I.links.positionPlanningLink,"pdf",{lang:a?.language}),children:o("t_l_charger_le_06050")}),(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",onClick:()=>g(RG,{positionId:s}),children:o("exporter_les_me_63676")}),c&&(0,i.jsx)(Em,{icon:"clone",onClick:async()=>await m(I.id),children:o("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:c&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:async()=>p(!0),children:o("supprimer_43083")})})]})]}),h&&(0,i.jsx)(_1,{position:I,onClose:()=>p(!1),onSuccess:()=>e.replace(Eo.POSITIONS({organizationId:n,eventId:t}))})]}),color:I?.color,icon:I?.icon,isLoading:d,name:I?.name,subtext:I?.range&&u.toComponents(I.range,{hideTime:!0,formats:{separator:" → ",localeFormat:da.DateOnly.MonthShort}})})},D2=e=>{const{params:{organizationId:n,eventId:t,positionId:s},translate:o}=fc();fm(e.event.position.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":t,positionId:e?":positionId":s});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(R2,{}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:Eo.POSITION_DASHBOARD(a(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:Eo.POSITION_MEMBERS(a(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(EC,{path:Eo.POSITION_PREASSIGNED_MEMBERS(a(!1)),children:o("membres_pr_aff_93093",e.event.position.preassignedResources)}),(0,i.jsx)(EC,{path:Eo.POSITION_PLANNING(a(!1)),children:o("planning_63989")})]}),(0,i.jsx)($C,{path:[Eo.POSITION_DASHBOARD(a(!0)),Wo.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(C2,{})}),(0,i.jsx)($C,{path:Eo.POSITION_MEMBERS(a(!0)),children:(0,i.jsx)(b2,{positionId:s})}),(0,i.jsx)($C,{path:Eo.POSITION_PREASSIGNED_MEMBERS(a(!0)),children:(0,i.jsx)(b2,{preassignedPositionId:s})}),(0,i.jsx)($C,{path:Eo.POSITION_PLANNING(a(!0)),children:(0,i.jsx)(z2,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})})]})]})},M2=()=>{const{params:{organizationId:e,eventId:n,positionId:t}}=fc(),{data:s,loader:o}=rs("query Position($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n dayStartTime\n startAt\n endAt\n\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:n,positionId:t},[],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Eo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(gs,{path:Eo.POSITION_DASHBOARD({organizationId:e,eventId:n,positionId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(D2,{event:s.event})})]})},P2=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(mA,{buttonText:n("mettre_jour_l_18158"),icon:"text",initialValues:{positionCategory:{description:e.positionCategory.description}},size:"md",subtitle:n("la_description_98866"),title:n("ajouter_une_des_10769"),onClose:e.onClose,onSubmit:async n=>{await t({eventId:e.eventId,positionCategoryId:e.positionCategory.id,description:n.positionCategory?.description??""}),e.reload(),e.onClose()},children:(0,i.jsx)(Zr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(JS,{label:n("description_58935"),name:"positionCategory.description"})})})},k2=e=>{const n=os(),{hasPermission:t}=Ly(),s=t(nC.POSITION_EDIT,{positionCategoryId:e.category.id}),[o,a]=(0,de.useState)(!1),r=w(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yz,{rightIcon:s?r?"pen":"plus":void 0,rightIconClick:()=>{a(!0)},title:n("description_58935"),children:r?(0,i.jsx)(p_,{text:e.category.description}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_descript_25737")})}),s&&o&&(0,i.jsx)(P2,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{a(!1)}})]})},F2=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),a=ss(Nh),r=(0,de.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(Eg,{onClick:()=>{n.push(Eo.POSITION({organizationId:s,eventId:o,positionId:e.position.id}))},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:Eo.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:e.position.name})}),(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:e.position.range?a.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:t("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)(_g,{children:r>0?(0,i.jsx)(Lm,{color:"warning",children:t("_1_membre_manq_31014",r)}):(0,i.jsx)(Lm,{color:"success",children:t("complet_51600")})}),(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"eye",to:Eo.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:t("voir_la_mission_68087")}),(0,i.jsx)(Em,{icon:"pen",onClick:()=>{n.push(Wo.EDIT_POSITION(s,o,e.position.id))},children:t("_diter_la_missi_90442")})]})})]})},N2=()=>{const{translate:e,params:{eventId:n,positionCategoryId:t}}=fc(),[s,o,a]=Dg(""),[r,d]=ZP("positionCategory.positions.date",Jo.c9.invalid("Invalid"),sx),[l,c]=(0,de.useState)(0),[u,m]=ZP("positionCategory.positions.sort",null),{data:g,isLoading:h}=rs("query PositionCategoryPositions(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $name: String\n $date: Date\n $offset: Int\n $sort: PositionsSort\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 sort: $sort\n ) {\n nodes {\n id\n assignedResources\n name\n range\n resources\n numberOfSlots\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,positionCategoryId:t,name:w(o)?o:void 0,date:r.isValid?r:void 0,offset:l,sort:u},[],undefined);const{numberOfPages:p,totalCount:I}=Jf(g.event?.positions),f=(0,de.useCallback)(e=>{m(e),c(0)},[m,c]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:a})}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(df,{max:g.event?.endAt,min:g.event?.startAt,value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ax,{attribute:Hn.Name,setSort:f,sort:u,children:e("nom_de_la_missi_64605")}),(0,i.jsx)(ax,{attribute:Hn.Slot,setSort:f,sort:u,children:e("Date")}),(0,i.jsx)(Mg,{children:e("State")}),(0,i.jsx)(Mg,{width:100})]}),numberOfPages:p,offset:l,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.event.positions.nodes.map(e=>(0,i.jsx)(F2,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:I})},L2=e=>{const{translate:n,params:{eventId:t,positionCategoryId:s}}=fc(),{roles:o}=Yy(),a=ss(Nh),{mutate:r}=function(e={}){return ds("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(yC,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{gap:"6",width:1,children:[(0,i.jsx)(MO,{iconColor:"primary",text:n("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(MO,{iconColor:"primary",text:n("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(MO,{iconColor:"primary",text:n("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(MO,{iconColor:"primary",text:n("Date"),value:e.positionCategory.range?a.toLocaleString(e.positionCategory.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"})]}),(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)(UO,{leaders:e.positionCategory.leaders,reload:e.reload,roles:o.positionRoles,onSave:e=>r({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:Dn.Replace}})}),(0,i.jsx)(k2,{category:e.positionCategory,eventId:t,reload:e.reload})]}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(N2,{})})]})]})})},U2=e=>{const n=os(),{mutate:t}=function(e={}){return ds("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954"),n("cela_supprimera_30946")],text:n("suppression_de_73669",e.positionCategory.name),onClose:e.onClose,onDelete:async()=>{await t({eventId:e.eventId,positionCategoryId:e.positionCategory.id}),e.onSuccess()}})},V2=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc();return(0,i.jsxs)(hO,{children:[(0,i.jsx)(gO,{to:Eo.POSITIONS({organizationId:n,eventId:t}),children:s("missions_63972")}),(0,i.jsx)(gO,{isCurrent:!0,to:Eo.POSITION_CATEGORY({organizationId:n,eventId:t,positionCategoryId:e.category.id}),children:e.category.name})]})},B2=({category:e,reload:n})=>{const{translate:t,history:s,params:{organizationId:o,eventId:a}}=fc(),{hasPermission:r}=Ly(),d=r(nC.POSITION_EDIT,{eventId:a}),l=VG(),{mutate:c}=function(e={}){return ds("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}(),[u,m]=(0,de.useState)(!1),[g,h]=(0,de.useState)(!1);return(0,i.jsx)(CC,{breadcrumbs:(0,i.jsx)(V2,{category:e}),buttons:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lC,{permissions:nC.POSITION_EDIT,scope:{positionCategoryId:e.id},children:[(0,i.jsx)(yc,{color:"white",onClick:()=>h(!0),children:t("_diter_62574")}),(0,i.jsx)(yc,{onClick:()=>{s.push(Wo.CREATE_POSITION(o,a,e.id))},children:t("ajouter_une_mis_99800")})]}),d&&(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",onClick:()=>l(RG,{positionCategoryId:e.id}),children:t("exporter_les_me_63676")}),(0,i.jsx)(Em,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:n}}=await c({eventId:a,positionCategoryId:e.id});s.push(Eo.POSITION_CATEGORY({organizationId:o,eventId:a,positionCategoryId:n}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{m(!0)},children:t("supprimer_43083")})})]})]}),g&&(0,i.jsx)(I0,{eventId:a,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{h(!1)},onSuccess:n}),u&&(0,i.jsx)(U2,{eventId:a,positionCategory:e,onClose:()=>{m(!1)},onSuccess:()=>{s.replace(Eo.POSITIONS({organizationId:o,eventId:a}))}})]}),name:e.name,subtext:t("_1_mission_33169",e.numberOfPositions)})},W2=({event:e,reload:n})=>{const{translate:t,params:{organizationId:s,eventId:o,positionCategoryId:a}}=fc(),r=us(),{updateLocalEvent:d}=Ly();fm(e.positionCategory.name),(0,de.useEffect)(()=>{d({positionBackPath:r.pathname})},[]);const l=e=>({organizationId:e?":organizationId":s,eventId:e?":eventId":o,positionCategoryId:e?":positionCategoryId":a});return(0,i.jsxs)(AC,{children:[(0,i.jsx)(B2,{category:e.positionCategory,reload:n}),(0,i.jsxs)(TC,{css:{flex:"1"},children:[(0,i.jsxs)(wC,{css:{px:"$7"},children:[(0,i.jsx)(EC,{path:Eo.POSITION_CATEGORY_DASHBOARD(l(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(EC,{path:Eo.POSITION_CATEGORY_MEMBERS(l(!1)),children:t("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(EC,{path:Eo.POSITION_CATEGORY_PREASSIGNED_MEMBERS(l(!1)),children:t("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)($C,{path:Eo.POSITION_CATEGORY_DASHBOARD(l(!0)),children:(0,i.jsx)(L2,{positionCategory:e.positionCategory,reload:n})}),(0,i.jsx)($C,{path:Eo.POSITION_CATEGORY_MEMBERS(l(!0)),children:(0,i.jsx)(b2,{positionCategoryId:a})}),(0,i.jsx)($C,{path:Eo.POSITION_CATEGORY_PREASSIGNED_MEMBERS(l(!0)),children:(0,i.jsx)(b2,{preassignedPositionCategoryId:a})})]})]})},G2=()=>{const{params:{organizationId:e,eventId:n,positionCategoryId:t}}=fc(),{data:s,loader:o,reload:a}=rs("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:n,positionCategoryId:t},[Ko.LeaderInfosFragment],undefined);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Eo.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(gs,{path:Eo.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:n,positionCategoryId:t}),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(W2,{event:s.event,reload:a})})]})},q2=e=>(0,i.jsx)(Nx,{category:e.popup.category,fallbackClosePath:e.closePath,heading:e.popup.title,children:(0,i.jsxs)(Xl,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Xl,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(Xl,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(Xl,{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})]})}),H2=()=>{const{params:{organizationId:e,eventId:n,positionId:t,positionSlotId:s},translate:o}=fc(),a=ss(Wg),[r,d]=ZP("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[l,c]=ZP("positionsSlotsAssignVolunteers.filterPositions",!1),[u,m]=ZP("positionsSlotsAssignVolunteers.applyConditions",!0),[g,h]=(0,de.useState)(null),{data:p,isLoading:I}=rs("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:n,positionSlotId:s,filterAvailabilities:r,filterPositions:l,applyConditions:u,sort:g},[],undefined);const{mutate:x,isLoading:_}=vr(),[j,v]=(0,de.useState)(""),S=(0,de.useMemo)(()=>{const e=p.event?.positionSlot.availableVolunteersRegistrations??[];return w(j)?e.filter(e=>e.userInfo.name.toLowerCase().includes(j.toLowerCase())||e.userInfo.email.includes(j.toLowerCase())):e},[p.event,j]),{numberOfSelected:y,selectAllState:C,states:b,setStates:A,toggleRow:E,toggleSelectAll:$}=sh({}),T=(0,de.useMemo)(()=>(u?1:0)+(r?1:0)+(l?1:0),[u,r,l]);return(0,de.useEffect)(()=>{A(Object.fromEntries((p.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[p.event]),(0,i.jsx)(q2,{button:(0,i.jsx)(yc,{isLoading:_,to:Eo.POSITION({organizationId:e,eventId:n,positionId:t}),onClick:async()=>{const e=(p.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),t=Object.values(b).filter(({state:e})=>"checked"===e).map(({id:e})=>e),i=(0,Wm.A)(t,e),o=(0,Wm.A)(e,t);f(i)&&await x({eventId:n,massAssign:{positionsSlotsIds:[s],selecteds:{ids:i},strategy:Dn.Add}}),f(o)&&await x({eventId:n,massAssign:{positionsSlotsIds:[s],selecteds:{ids:o},strategy:Dn.Delete}})},children:0===y?o("ne_pas_affecter_05756"):o("affecter_1_me_46721",y)}),closePath:Eo.POSITION({organizationId:e,eventId:n,positionId:t}),popup:{category:o("affectation_u_96975",p.event?.positionSlot.positionName??""),title:p.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)($g,{filters:(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:o("rechercher_un_m_05904"),value:j,onChange:v})}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"gray",leftIcon:"sliders",children:o("filtres_1_41774",T)})}),(0,i.jsx)(wm,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Xl,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:o("disponibilit_s_49923")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:r?"unchecked":"checked",onClick:e=>{d("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:r?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:o("filtrer_selon_l_35857")}),(0,i.jsx)(Yj,{height:"4"}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:o("missions_63972")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:l?"unchecked":"checked",onClick:e=>{c("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:l?"checked":"unchecked",onClick:e=>{c("checked"===e)},children:o("filtrer_selon_l_42798")}),(0,i.jsx)(Yj,{height:"4"}),(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:o("conditions_77756")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:u?"unchecked":"checked",onClick:e=>{m("checked"!==e)},children:o("afficher_tous_l_44338")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:u?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:o("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{css:{paddingRight:0},width:48,children:(0,i.jsx)(Ym,{state:C,onClick:$})}),(0,i.jsx)(ax,{attribute:bt.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:h,sort:g,children:o("nom_du_membre_69353")}),(0,i.jsx)(Mg,{children:o("nombre_d_affect_31455")}),(0,i.jsx)(ax,{attribute:bt.InsertedAt,setSort:h,sort:g,children:o("date_d_inscript_31369")})]}),limit:S.length,numberOfPages:1,offset:0,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):S.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{css:{paddingRight:0},width:48,children:(0,i.jsx)(Ym,{state:b[`ui${e.userInfo.id}`]?.state??"unchecked",onClick:(n,t)=>{Uc(t),E(`ui${e.userInfo.id}`,n,t.shiftKey)}})}),(0,i.jsx)(_g,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(MC,{userInfo:e.userInfo})}),(0,i.jsx)(_g,{children:e.numberOfAssignments}),(0,i.jsx)(_g,{children:a.toLocaleString(e.insertedAt.toLocal(),da.DateTime)})]},e.id)),setOffset:Ou.A,title:o("liste_des_membr_42505"),totalCount:S.length})})};var Y2;function Z2(e){switch(e){case Jn.OrganizationNotLinked:case Jn.PartnersUnreachable:case Jn.PartnerNotFound:return"weezaccessPartnerId";case Jn.EventNotLinked:case Jn.GroupsUnreachable:case Jn.GroupNotFound:return"printerGroupId";case Jn.DocumentNotFound:return"zplDocumentId";default:return Ic()}}function K2(e){return Jo.c9.isDateTime(e)&&e.isValid}let X2=class extends ju{constructor(e){super(e)}default(e){const n=e?.activationRange;return{weezaccessPartnerId:e?.weezaccessPartnerId??null,printerGroupId:e?.printerGroupId??null,zplDocumentId:e?.zplDocumentId??null,activationStart:n?.start?.toLocal()??null,activationEnd:n?.end?.toLocal()??null}}toInput({weezaccessPartnerId:e,printerGroupId:n,zplDocumentId:t,...i}){if(null===e||null===n||null===t)throw new Error("PrintTriggerInputService.toInput: the schema requires the partner, the printer group and the ZPL document.");return{...i,weezaccessPartnerId:e,printerGroupId:n,zplDocumentId:t,activationStart:K2(i.activationStart)?i.activationStart:null,activationEnd:K2(i.activationEnd)?i.activationEnd:null}}toSubmitErrors(e){return{printTrigger:Object.fromEntries(e.map(({code:e,message:n})=>[Z2(e),n]))}}schema(){return Jl.Ik().shape({printTrigger:this.printTriggerInputSchema().required()}).required()}printTriggerInputSchema(){return Jl.Ik().shape({weezaccessPartnerId:Jl.ai().typeError(this.t("l_op_rateur_wee_26038")).required(this.t("l_op_rateur_wee_26038")),printerGroupId:Jl.Yj().typeError(this.t("le_point_d_impr_71946")).required(this.t("le_point_d_impr_71946")),zplDocumentId:Jl.ai().typeError(this.t("le_document_est_86403")).required(this.t("le_document_est_86403")),activationStart:Jl.gl().nullable().test("required-with-end",this.t("la_date_de_d_bu_05030"),(e,{parent:n})=>K2(e)||!K2(n.activationEnd)),activationEnd:Jl.gl().nullable().test("required-with-start",this.t("la_date_de_fin_32246"),(e,{parent:n})=>K2(e)||!K2(n.activationStart)).test("after-start",this.t("la_date_de_fin_00429"),(e,{parent:n})=>!K2(e)||!K2(n.activationStart)||e>n.activationStart)})}};X2=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(Y2=void 0!==ts&&ts)?Y2:Object])],X2);const Q2=e=>{const{input:{value:n}}=(0,ld.Mt)(e.name,{subscription:{value:!0}}),t="nodes"in e.list?e.list.nodes:[],s=e.currentId,o=void 0!==s&&!t.some(({id:e})=>e===s),a="message"in e.list?e.list.message:o&&n===s?e.currentError:void 0;return(0,i.jsxs)(Kx,{hint:a,isSearchVisible:!0,name:e.name,placeholder:e.placeholder,state:a?"error":void 0,children:[o&&(0,i.jsx)("option",{value:s,children:s}),t.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))]})},J2=e=>{const{translate:n}=fc(),{organization:{weezeventOrganizationId:t}}=Yy(),{event:s,organization:o,printTrigger:a}=e,r=null!==a&&(null===a.zplDocumentId||void 0===a.zplDocumentId),d="WeezaccessPartnerList"===o.weezaccessPartners.__typename&&0===o.weezaccessPartners.nodes.length,l="PrinterGroupList"===s.printerGroups.__typename&&0===s.printerGroups.nodes.length;return(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mc,{}),d&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("incomplete_prin_64421")}),(0,i.jsxs)(Oc,{children:[n("aucun_op_rateur_38215"),"number"==typeof t&&(0,i.jsx)(Ug,{target:"_blank",to:zx(t),children:n("cr_er_un_op_rat_60547")})]})]}),l&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("incomplete_prin_64421")}),(0,i.jsx)(Oc,{children:n("no_printing_loc_73059")})]}),(0,i.jsxs)(Zx,{heading:n("informations_su_47120"),children:[(0,i.jsx)(FA,{heading:n("op_rateur_weeza_31732"),children:(0,i.jsx)(Q2,{currentError:"WeezaccessPartnerError"===a?.weezaccessPartner.__typename?a.weezaccessPartner.message:void 0,currentId:a?.weezaccessPartnerId,list:o.weezaccessPartners,name:"printTrigger.weezaccessPartnerId",placeholder:n("op_rateur_weeza_31732")})}),(0,i.jsx)(FA,{heading:n("printing_locati_10729"),children:(0,i.jsx)(Q2,{currentError:"PrinterGroupError"===a?.printerGroup.__typename?a.printerGroup.message:void 0,currentId:a?.printerGroupId,list:s.printerGroups,name:"printTrigger.printerGroupId",placeholder:n("printing_locati_10729")})}),(0,i.jsxs)(FA,{heading:n("document_impr_83514"),children:[(0,i.jsx)(nf,{label:n("type_d_impressi_00431"),state:"disabled",value:Qn.Wristband,onChange:()=>{},children:(0,i.jsx)("option",{value:Qn.Wristband,children:n("bracelet_50672")})}),(0,i.jsx)(Kx,{hint:r?n("ce_d_clencheur_62408"):void 0,isSearchVisible:!0,label:n("document_87149"),name:"printTrigger.zplDocumentId",placeholder:n("document_87149"),children:s.zplDocuments.nodes.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))})]}),(0,i.jsxs)(FA,{heading:n("p_riode_d_activ_48213"),children:[(0,i.jsxs)(Xl,{gap:"4",width:1,children:[(0,i.jsx)(Gb,{label:n("d_but_41840"),name:"printTrigger.activationStart",zone:ca()}),(0,i.jsx)(Gb,{label:n("fin_60104"),name:"printTrigger.activationEnd",zone:ca()})]}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:n("dans_votre_fuse_58273",ca())})]})]}),e.children]})},e4=({children:e})=>{const{translate:n}=fc();return(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Zx,{heading:n("informations_su_47120"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(Vm,{borderRadius:"$2",height:40,width:"100%"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:40,width:"100%"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:104,width:"100%"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:64,width:"100%"})]})}),e]})},n4=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{event:a}=Ly();fm(t("_1_d_clencheur_46793",a.name));const r=(0,de.useRef)(null),d=ss(X2),{showNotification:l}=Sy(),c=nW.PRINT_TRIGGERS({organizationId:s,eventId:o});return(0,i.jsx)(Fc,{customErrorRef:r,height:1,initialValues:{printTrigger:d.default(e.printTrigger)},render:({handleSubmit:n,submitting:s})=>(0,i.jsx)(Nx,{button:(0,i.jsx)(yc,{css:{flexShrink:0},isLoading:s,onClick:n,children:e.submitText}),category:t("printing_06197"),color:"dark",fallbackClosePath:c,heading:t("d_clencheurs_de_12821"),children:(0,i.jsx)(kx,{ref:r,children:(0,i.jsx)(J2,{event:e.event,organization:e.organization,printTrigger:e.printTrigger,children:(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:s,textAlign:"center",onClick:n,children:e.submitText})})})})}),schema:d.schema(),onSubmit:async t=>{const i=await e.save(d.toInput(t.printTrigger));return"PrintTriggerErrors"===i.__typename?d.toSubmitErrors(i.errors):(l({color:"success",text:e.successText}),void n.goBack(c))}})},t4=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc();return(0,i.jsx)(Nx,{category:e("printing_06197"),color:"dark",fallbackClosePath:nW.PRINT_TRIGGERS({organizationId:n,eventId:t}),heading:e("d_clencheurs_de_12821"),children:(0,i.jsx)(kx,{children:(0,i.jsx)(e4,{})})})},i4=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{data:s,isLoading:o}=rs("query PrintTriggerFormOptions($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...PrintTriggerFormOrganization\n }\n\n event(id: $eventId) {\n ...PrintTriggerFormEvent\n }\n}\n",{organizationId:n,eventId:t},[Ko.PrintTriggerFormOrganizationFragment,Ko.PrintTriggerFormEventFragment],undefined);const{mutate:a}=function(e={}){return ds("mutation PrintTriggerCreate($eventId: EventId!, $printTrigger: PrintTriggerInput!) {\n printTriggerCreate(eventId: $eventId, printTrigger: $printTrigger) {\n __typename\n ... on PrintTrigger {\n id\n }\n ... on PrintTriggerErrors {\n errors {\n code\n message\n }\n }\n }\n}\n",e)}();return o?(0,i.jsx)(t4,{}):(0,i.jsx)(n4,{event:s.event,organization:s.organization,printTrigger:null,save:async e=>(await a({eventId:t,printTrigger:e})).printTriggerCreate,submitText:e("cr_er_le_d_clen_22168"),successText:e("le_d_clencheur_67270")})},s4=()=>{const{translate:e,params:{organizationId:n,eventId:t,printTriggerId:s}}=fc(),{data:o,isLoading:a}=rs("query PrintTrigger(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $printTriggerId: PrintTriggerId!\n) {\n organization(id: $organizationId) {\n ...PrintTriggerFormOrganization\n }\n\n event(id: $eventId) {\n ...PrintTriggerFormEvent\n\n printTrigger(id: $printTriggerId) {\n id\n weezaccessPartnerId\n weezaccessPartner {\n __typename\n\n ... on WeezaccessPartnerError {\n message\n }\n }\n printerGroupId\n printerGroup {\n __typename\n\n ... on PrinterGroupError {\n message\n }\n }\n zplDocumentId\n activationRange\n }\n }\n}\n",{organizationId:n,eventId:t,printTriggerId:s},[Ko.PrintTriggerFormOrganizationFragment,Ko.PrintTriggerFormEventFragment],undefined);const{mutate:r}=function(e={}){return ds("mutation PrintTriggerUpdate(\n $eventId: EventId!\n $printTriggerId: PrintTriggerId!\n $printTrigger: PrintTriggerInput!\n) {\n printTriggerUpdate(\n eventId: $eventId\n printTriggerId: $printTriggerId\n printTrigger: $printTrigger\n ) {\n __typename\n ... on PrintTrigger {\n id\n }\n ... on PrintTriggerErrors {\n errors {\n code\n message\n }\n }\n }\n}\n",e)}();return a?(0,i.jsx)(t4,{}):(0,i.jsx)(n4,{event:o.event,organization:o.organization,printTrigger:o.event.printTrigger,save:async e=>(await r({eventId:t,printTriggerId:s,printTrigger:e})).printTriggerUpdate,submitText:e("mettre_jour_85141"),successText:e("le_d_clencheur_40617")})};var o4,a4,r4,d4;function l4(e){return{}}!function(e){e.Id="id",e.WeezaccessPartner="weezaccessPartner",e.PrinterGroup="printerGroup",e.MediaType="mediaType",e.Document="document",e.CreatedBy="createdBy",e.CreatedAt="createdAt",e.ActivationRange="activationRange",e.Status="status"}(d4||(d4={}));let c4=class extends Eh{constructor(e,n,t){super(e,n,t)}getPrintTriggersPossibleColumns(){return[{slug:d4.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:et.Id,width:100},{slug:d4.WeezaccessPartner,name:this.t("op_rateur_weeza_31732"),isSearchable:!0,isSortable:!0,sortAttribute:et.WeezaccessPartner,minWidth:280},{slug:d4.PrinterGroup,name:this.t("printing_locati_10729"),isSearchable:!0,isSortable:!0,sortAttribute:et.PrinterGroup,minWidth:200},{slug:d4.MediaType,name:this.t("type_d_impressi_00431"),isSortable:!0,sortAttribute:et.MediaType,minWidth:160},{slug:d4.Document,name:this.t("document_87149"),isSearchable:!0,isSortable:!0,sortAttribute:et.Document,minWidth:200},{slug:d4.CreatedBy,name:this.t("cr_par_41994"),minWidth:220},{slug:d4.CreatedAt,name:this.t("cr_le_85046"),isSortable:!0,minWidth:180,sortAttribute:et.CreatedAt},{slug:d4.ActivationRange,name:this.t("p_riode_d_activ_48213"),isSortable:!0,sortAttribute:et.ActivationRange,minWidth:280},{slug:d4.Status,name:this.t("State"),isSortable:!0,sortAttribute:et.Status,minWidth:140}]}};c4=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(o4=void 0!==dh&&dh)?o4:Object,"function"==typeof(a4=void 0!==Wg&&Wg)?a4:Object,"function"==typeof(r4=void 0!==ts&&ts)?r4:Object])],c4);const u4=({children:e})=>{const{translate:n,params:{eventId:t}}=fc(),{data:s,isLoading:o}=rs("query PrintTriggersCount($eventId: EventId!) {\n event(id: $eventId) {\n numberOfPrintTriggers\n }\n}\n",{eventId:t},[],undefined);return o?(0,i.jsx)(_c,{}):s.event.numberOfPrintTriggers>0?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(Jw,{css:{alignSelf:"center",maxWidth:"460px",[`& ${Yr}:first-child`]:{maxInlineSize:"180px"}},imageSrc:Zu.WeezeventBlankSwissArmyKnife,subtitle:n("cr_er_une_corre_64867"),title:n("aucun_d_clenche_58334")})},m4=e=>{const n=ss(Nh),t=ss(ts);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:e.activationRange?(0,i.jsxs)(Xl,{direction:"column",width:1,children:[(0,i.jsx)(Zr,{font:"gray800 textSm regular",children:n.toLocaleString(e.activationRange.mapEndpoints(e=>e.toLocal()),{locale:Qu(t.language)},{weekday:"short",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:ca()})]}):"-"})},g4=({column:e,document:n})=>{const{translate:t}=fc();let s;switch(n.__typename){case"CustomDocument":case"EventsDocument":s={children:t("feuille_papier_12296"),color:"white",leftIcon:"print",size:"lg"};break;case"ZplDocument":s={children:t("bracelet_50672"),color:"white",leftIcon:"hand-back-fist",size:"lg"}}return(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Lm,{...s})})},h4=({column:e,message:n})=>(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:["-",(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"error500",css:{margin:"-3px",padding:"3px"},children:(0,i.jsx)(pc,{icon:"circle-exclamation",iconStyle:"solid"})})}),(0,i.jsx)(ux,{placement:"top",children:n})]})]})});function p4(e){switch(e){case nt.Active:return"actif_70318";case nt.Past:return"r_volu_61847";case nt.Upcoming:return"Upcoming";default:return Ic()}}function I4(e){switch(e){case nt.Active:return{color:"success",leftIcon:"play"};case nt.Past:return{color:"gray",leftIcon:"hourglass-end"};case nt.Upcoming:return{color:"purple",leftIcon:"hourglass-start"};default:return Ic()}}const f4=({column:e,status:n})=>{const{translate:t}=fc();return(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Lm,{...I4(n),children:t(p4(n))})})},x4=({column:e,row:n})=>{const{translate:t}=fc();if(s=e.slug,!Object.values(d4).includes(s))return(0,i.jsx)(_g,{children:"ERR"});switch(e.slug){case d4.Id:return(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:n.id});case d4.WeezaccessPartner:return"WeezaccessPartner"===n.weezaccessPartner.__typename?(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ug,{target:"_blank",to:n.weezaccessPartner.url,children:n.weezaccessPartner.name})}):(0,i.jsx)(h4,{column:e,message:n.weezaccessPartner.message});case d4.PrinterGroup:return"PrinterGroup"===n.printerGroup.__typename?(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:n.printerGroup.name}):(0,i.jsx)(h4,{column:e,message:n.printerGroup.message});case d4.Document:return"EventsDocument"===n.document.__typename?(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:t(Hv(n.document.documentType))}):(0,i.jsx)(_g,{minWidth:e.minWidth,width:e.width,children:n.document.name});case d4.MediaType:return(0,i.jsx)(g4,{column:e,document:n.document});case d4.ActivationRange:return(0,i.jsx)(m4,{activationRange:n.activationRange,column:e});case d4.Status:return(0,i.jsx)(f4,{column:e,status:n.status});case d4.CreatedBy:return(0,i.jsx)(aL,{column:e,createdBy:n.createdBy});case d4.CreatedAt:return(0,i.jsx)(oL,{column:e,insertedAt:n.insertedAt});default:return Ic(e.slug)}var s},_4=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{canPrintConfigEdit:s}=tC();return(0,i.jsxs)(bC,{justify:"between",children:[(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:e("d_clencheurs_de_12821")}),s&&(0,i.jsx)(yc,{to:nW.CREATE({organizationId:n,eventId:t}),children:e("ajouter_un_d_cl_57675")})]})},j4=({printTrigger:{id:e,printerGroup:n,weezaccessPartner:t},onClose:s,onDelete:o})=>{const{params:{eventId:a},translate:r}=fc(),d=as(),{showNotification:l}=Sy(),{mutate:c,isLoading:u}=function(e={}){return ds("mutation PrintTriggerDelete($eventId: EventId!, $printTriggerId: PrintTriggerId!) {\n printTriggerDelete(eventId: $eventId, printTriggerId: $printTriggerId) {\n id\n }\n}\n",e)}(),{descId:m,labelId:g}=Vc(),h=e=>{e||s()};return(0,hd.createPortal)((0,i.jsxs)(D1,{descId:m,isOpen:!0,labelId:g,role:"alertdialog",setIsOpen:h,size:"md",children:[(0,i.jsx)(M1,{heading:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)($c,{id:g,children:r("supprimer_le_d_48302")}),(0,i.jsx)(wc,{textStyle:"subtitle",children:r("l_action_est_ir_70153")})]}),leftIcon:"triangle-exclamation",leftIconColor:"error600",leftIconCss:{background:"$error100",borderColor:"$error100",boxShadow:"none",color:"$error600"},setIsOpen:h}),(0,i.jsx)(P1,{css:{padding:"$2 $7 $7 $7"},id:m,children:(0,i.jsx)(wc,{children:"PrinterGroup"===n.__typename&&"WeezaccessPartner"===t.__typename?[...d(r("vous_tes_sur_l_27614"),(0,i.jsx)("b",{children:n.name}),(0,i.jsx)("b",{children:t.name}))]:r("vous_tes_sur_l_83950",e)})}),(0,i.jsx)(k1,{handleSubmit:async()=>{await c({eventId:a,printTriggerId:e}),l(r("le_d_clencheur_59821")),s(),o()},isLoading:u,setIsOpen:h,submitStyle:"error",submitText:r("supprimer_le_d_19736")})]}),document.body)},v4=({row:e,reload:n})=>{const{params:{organizationId:t,eventId:s},translate:o}=fc(),[a,r]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"pen",to:nW.UPDATE({organizationId:t,eventId:s,printTriggerId:e.id}),children:o("_diter_62574")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),r(!0)},children:o("supprimer_43083")})})]}),a&&(0,i.jsx)(j4,{printTrigger:e,onClose:()=>r(!1),onDelete:n})]})},S4=()=>{const{event:e}=Ly(),{translate:n,params:{organizationId:t,eventId:s}}=fc();fm(n("_1_d_clencheur_46793",e.name));const[o,a]=ZP("printTriggers.columns",[d4.WeezaccessPartner,d4.PrinterGroup,d4.Document,d4.MediaType,d4.ActivationRange,d4.Status]),r=ss(c4),d=(0,de.useMemo)(()=>r.getPrintTriggersPossibleColumns(),[r]),[l,c]=ZP("printTriggers.predicates",[]),u=(0,de.useMemo)(()=>lh(l),[l]),{canPrintConfigEdit:m}=tC(),[g,h]=ZP("printTriggers.sort",null);return(0,i.jsxs)(AC,{children:[(0,i.jsx)(_4,{}),(0,i.jsx)(yC,{children:(0,i.jsx)(u4,{children:(0,i.jsx)(nx,{columns:o,columnsSearch:[],columnsToIncludes:l4,eventId:s,filters:[],limit:jg,loadDataList:Al,loadRow:El,organizationId:t,possibleColumns:d,predicates:u,rendering:up.List,setColumns:a,setPredicates:c,setSort:h,showEditColumns:!0,showEditMode:!1,showFilters:!1,showMassActions:!1,showPredicatesBadges:!0,showRowDropdown:m,showRowEdit:m,showSearchColumns:!1,sort:g,children:(0,i.jsx)(px,{getEditPath:({id:e})=>nW.UPDATE({organizationId:t,eventId:s,printTriggerId:e}),renderCell:(e,n)=>(0,i.jsx)(x4,{column:e,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(v4,{reload:n,row:e})})})})})]})},y4=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc(),a=e.userInfo.volunteerRegistration?.delegation,r=(0,de.useMemo)(()=>e.forms.map(e=>({...e,showFullAccreditation:!0,slotDisplay:at.Hide,accreditationFilter:ot.None})),[e.forms]),d=(0,de.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{profileId:t?.accreditationProfileId??null,slotsIds:t?.accreditationsSlotsIds??[]}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(tF,{forms:e.forms,getTabPath:e=>Wo.EDIT_USER_ACCREDITATIONS_FORM(n,t,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Wo.VOLUNTEERS(n,t),title:o("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((o,l)=>(0,i.jsxs)($C,{path:Wo.EDIT_USER_ACCREDITATIONS_FORM(n,t,s,o.id),children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(iP,{accreditationProfileId:e.values.userInfo.accreditations[l].accreditationProfileId,accreditationsSlotsIds:e.values.userInfo.accreditations[l].accreditationsSlotsIds,alreadyAssignedProfileId:d[l].profileId,alreadyAssignedSlotsIds:d[l].slotsIds,change:e.change,delegationAccreditationsProfiles:a?.formId===o.id?a.accreditationsProfiles:p,delegationAccreditationsSlots:a?.formId===o.id?a.accreditationsSlots:p,displayFormCustomFields:!1,event:e.event,options:r[l],prefix:`userInfo.accreditations[${l}].`,scannedSlotsIds:p,showAutoAccredit:!1,slots:p,userInfosFields:e.userInfo.fields})]},o.id))})},C4=e=>{const{history:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),a=ss(LM),{mutate:r,isLoading:d}=function(e={}){return ds("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)}(),l=(0,de.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{formId:n.id,...a.volunteersRegistrationsWishedAccreditationsUpdateInputDefault(t)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:{userInfo:{accreditations:l}},render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(y4,{change:n.change,event:e.event,forms:e.forms,handleSubmit:t,isLoading:d,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await r({eventId:s,userInfoId:o,userInfoAccreditations:e.userInfo.accreditations}),n.goBack(Wo.VOLUNTEERS(t,s))}})},b4=()=>{const{organizationId:e,eventId:n,userInfoId:t}=ls(),{data:s,loader:o}=rs("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 accreditationsProfiles {\n ...DelegationAccreditationProfile\n }\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 accreditationsProfilesCategories {\n ...FormRegisterAccreditationProfileCategory\n }\n }\n}\n",{organizationId:e,eventId:n,userInfoId:t,loadDelegation:!0},[Ko.MemberRegistrationUserInfoFragment,Ko.FormsUsersInfosWishedFragment,Ko.DelegationAccreditationProfileFragment,Ko.DelegationAccreditationSlotFragment,Ko.FormMemberRegistrationFragment,Ko.FormRegisterAccreditationCategoryFragment,Ko.FormRegisterAccreditationProfileCategoryFragment],undefined);const a=(0,de.useMemo)(()=>{if(s.organization&&s.event){const e=s.organization.userInfo.volunteerRegistration;return s.event.forms.nodes.filter(n=>n.accreditationDisplay!==tt.None||e.delegation?.formId===n.id&&f(e.delegation.accreditationsSlots))}return[]},[s.organization,s.event]);return o||(f(a)?(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(C4,{event:s.event,forms:a,userInfo:s.organization.userInfo})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.EDIT_USER_ACCREDITATIONS_FORM(e,n,t,a[0].id),replace:!0})})]}):(0,i.jsx)(gs,{}))},A4=e=>{const{params:{organizationId:n,eventId:t,userInfoId:s},translate:o}=fc();return(0,i.jsx)(tF,{forms:e.forms,getTabPath:e=>Wo.EDIT_USER_MISSIONS_FORM(n,t,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Wo.VOLUNTEERS(n,t),title:o("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((o,a)=>(0,i.jsxs)($C,{path:Wo.EDIT_USER_MISSIONS_FORM(n,t,s,o.id),children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(xP,{change:e.change,event:e.event,options:{...o,showFullPosition:!0,slotDisplay:at.Hide,positionFilter:ot.None},positionsCategoriesIds:e.values.userInfo.missions[a].positionsCategoriesIds,positionsIds:e.values.userInfo.missions[a].positionsIds,positionsSlotsIds:e.values.userInfo.missions[a].positionsSlotsIds,prefix:`userInfo.missions[${a}].`,slots:p,userInfoFields:e.userInfo.fields})]},o.id))})},E4=e=>{const{history:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),a=ss(LM),{mutate:r,isLoading:d}=function(e={}){return ds("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)}(),l=(0,de.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{formId:n.id,...a.volunteersRegistrationsWishedPositionsUpdateInputDefault(t)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:{userInfo:{missions:l}},render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)(A4,{change:n.change,event:e.event,forms:e.forms,handleSubmit:t,isLoading:d,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await r({eventId:s,userInfoId:o,userInfoPositions:e.userInfo.missions}),n.goBack(Wo.VOLUNTEERS(t,s))}})},w4=()=>{const{organizationId:e,eventId:n,userInfoId:t}=ls(),{data:s,loader:o}=rs("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:n,userInfoId:t},[Ko.MemberRegistrationUserInfoFragment,Ko.FormsUsersInfosWishedFragment,Ko.FormMemberRegistrationFragment,Ko.FormRegisterCategoryFragment],undefined);const a=(0,de.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==st.None),[s.event]);return o||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(E4,{event:s.event,forms:a,userInfo:s.organization.userInfo})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.EDIT_USER_MISSIONS_FORM(e,n,t,a[0].id),replace:!0})})]})},$4=e=>{const{translate:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc();return(0,i.jsx)(tF,{forms:e.forms,getTabPath:e=>Wo.EDIT_USER_SLOTS_FORM(t,s,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:Wo.VOLUNTEERS(t,s),title:n("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((n,a)=>(0,i.jsxs)($C,{path:Wo.EDIT_USER_SLOTS_FORM(t,s,o,n.id),children:[(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)($P,{change:e.change,currentSlots:e.values.userInfo.slots[a].slots,customSlotsPeriods:n.customSlotsPeriods,daysDisplay:n.daysDisplay,elements:n.elements,event:e.event,prefix:`userInfo.slots[${a}].`,slotDisplay:n.slotDisplay,userInfoFields:e.userInfo.fields})]},n.id))})},T4=e=>{const{history:n,params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),a=ss(LM),{mutate:r,isLoading:d}=function(e={}){return ds("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)}(),l=(0,de.useMemo)(()=>e.forms.map(n=>{const t=e.userInfo.formsUsersInfos.find(e=>e.formId===n.id);return{formId:n.id,slots:a.volunteersRegistrationsSlotsUpdateInputDefault(t?.slots)}}),[e.forms,e.userInfo]);return(0,i.jsx)(Fc,{direction:"column",height:1,initialValues:{userInfo:{slots:l}},render:({form:n,handleSubmit:t,values:s})=>(0,i.jsx)($4,{change:n.change,event:e.event,forms:e.forms,handleSubmit:t,isLoading:d,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await r({eventId:s,userInfoId:o,userInfoSlots:e.userInfo.slots}),n.goBack(Wo.VOLUNTEERS(t,s))}})},z4=()=>{const{organizationId:e,eventId:n,userInfoId:t}=ls(),{data:s,loader:o}=rs("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:n,userInfoId:t},[Ko.MemberRegistrationUserInfoFragment,Ko.FormsUsersInfosWishedFragment,Ko.FormMemberRegistrationFragment],undefined);const a=(0,de.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==at.Hide),[s.organization,s.event]),{permissions:[r],isLoading:d}=pw(cw({eventId:n,userInfoId:t})),l=cs();return d||r||l.push(Wo.DASHBOARD(e,n)),o||d?o:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(T4,{event:s.event,forms:a,userInfo:s.organization.userInfo})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.EDIT_USER_SLOTS_FORM(e,n,t,a[0].id),replace:!0})})]})},O4=()=>{const{params:{eventId:e}}=fc(),{canMemberAccredit:n}=tC(),{infos:t,setInfos:s}=DN(),{data:o,idToLoading:a,isEditMode:r,isLoading:d,limit:l,numberOfPages:c,offset:u,reloadRow:m,setLimit:g,setOffset:h,totalCount:I}=ah(),{mutate:f}=Ra(),{mutate:x}=Ta(),{data:_,isLoading:j}=rs("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsProfiles {\n nodes {\n ...AccreditationProfileMatrix\n }\n }\n\n accreditationsSlots(includeHidden: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[Ko.AccreditationProfileMatrixFragment,Ko.AccreditationSlotMatrixFragment],undefined);const v=(0,de.useMemo)(()=>t.volunteersMatrixRendering||dp.Category,[t]),S=(0,de.useCallback)(e=>s(n=>({...n,volunteersMatrixRendering:e})),[t,s]),y=(0,de.useMemo)(()=>t.volunteersMatrixSelectedSlotsIds||[],[t]),C=(0,de.useCallback)(e=>s(n=>({...n,volunteersMatrixSelectedSlotsIds:e})),[t,s]),b=(0,de.useMemo)(()=>t.volunteersMatrixSelectedProfilesIds||[],[t]),A=(0,de.useCallback)(e=>s(n=>({...n,volunteersMatrixSelectedProfilesIds:e})),[t,s]),E=(0,de.useMemo)(()=>t.volunteersMatrixShowAccreditations??!0,[t]),w=(0,de.useCallback)(e=>s(n=>({...n,volunteersMatrixShowAccreditations:e})),[s]),$=(0,de.useMemo)(()=>t.volunteersMatrixShowProfiles??!0,[t]),T=(0,de.useCallback)(e=>s(n=>({...n,volunteersMatrixShowProfiles:e})),[s]),z=(0,de.useMemo)(()=>t.volunteersMatrixShowQuota??!1,[t]),O=(0,de.useCallback)(e=>{s(n=>({...n,volunteersMatrixShowQuota:e}))},[t,s]),R=(0,de.useCallback)(e=>a[e]??!1,[a]),D=(0,de.useCallback)((n,t)=>x({eventId:e,massProfileUpdate:{accreditationProfileId:t,selecteds:{ids:[n]},strategy:Dn.Add}}),[e,x]),M=(0,de.useCallback)((n,t)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[n]},strategy:Dn.Add}}),[e,f]),P=(0,de.useCallback)((n,t)=>x({eventId:e,massProfileUpdate:{accreditationProfileId:t,selecteds:{ids:[n]},strategy:Dn.Delete}}),[e,x]),k=(0,de.useCallback)((n,t)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[n]},strategy:Dn.Delete}}),[e,f]);return(0,i.jsx)(TT,{addAccreditationProfile:D,addAccreditationSlot:M,allAccreditationsProfiles:_.event?.accreditationsProfiles.nodes??p,allAccreditationsSlots:_.event?.accreditationsSlots.nodes??p,canDeleteCheckedIn:n,deleteAccreditationProfile:P,deleteAccreditationSlot:k,editMode:"assigned",isEditMode:r,isLoading:d||j,isRowLoading:R,limit:l,members:o,numberOfPages:c,offset:u,reloadRow:m,rendering:v,selectedProfilesIds:b,selectedSlotsIds:y,setLimit:g,setOffset:h,setRendering:S,setSelectedProfilesIds:A,setSelectedSlotsIds:C,setShowAccreditations:w,setShowProfiles:T,setShowQuota:O,showAccreditations:E,showProfiles:$,showQuota:z,totalCount:I})},R4=({eventId:e,organizationId:n,reload:t,reloadRow:s,volunteerRegistration:o})=>{const{history:a,translate:r}=fc(),{hasFeature:d}=Yy(),{event:l,hasEventRole:c}=Ly(),{canMemberAccredit:u,canMemberAssign:m,canMemberAssignmentStateEdit:g,canMemberCreate:h,canMemberDelete:p,canMemberEdit:I}=tC(),{showNotification:f}=Sy(),x=o.state,_=o.accreditationState,{mutate:j,isLoading:v}=yr(),{mutate:S,isLoading:y}=jr(),{mutate:C,isLoading:b}=_r(),{mutate:A}=Ja(),{mutate:E}=or(),w=g&&x!==yt.WaitingAssignment,$=g&&x!==yt.Refused,T=g&&(x===yt.WaitingAssignment||x===yt.Assigned),z=m&&x===yt.Assigned,O=m&&x===yt.PreAssigned,R=m&&x===yt.WaitingAssignment,D=u&&_!==Re.WaitingAccreditation,M=u&&_!==Re.Refused,P=u&&(_===Re.WaitingAccreditation||_===Re.Accredited||_===Re.AutoAccredited),k=u&&(_===Re.Accredited||_===Re.AutoAccredited),F=u&&_===Re.WaitingAccreditation,[N,L]=(0,de.useState)(!1),[U,V]=(0,de.useState)(!1),[B,W]=(0,de.useState)(!1),G=c&&I&&l.useDelegations&&d(In.Delegation)&&o.delegation,q=h,H=p&&o.canDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[w&&(0,i.jsx)(Em,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:yt.WaitingAssignment}}),s())},children:r("changer_le_stat_90266")}),$&&(0,i.jsx)(Em,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:yt.Refused}}),s())},children:r("changer_le_stat_68392")}),T&&(0,i.jsx)(Em,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await j({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:yt.NotApplicable}}),s())},children:r("changer_le_stat_62507")}),z&&(0,i.jsx)(Em,{icon:"pen",onClick:()=>{v||a.push(Wo.EDIT_ASSIGNMENT(n,e,o.userInfo.id))},children:r("_diter_les_affe_42283")}),O&&(0,i.jsx)(Em,{icon:"pen",onClick:()=>{v||a.push(Wo.PRE_ASSIGNMENT(n,e,o.userInfo.id))},children:r("_diter_les_pr_10213")}),R&&(0,i.jsx)(Em,{icon:"wand-magic-sparkles",onClick:()=>{v||a.push(Wo.ASSIGNMENT(n,e,o.userInfo.id))},children:r("affecter_94255")})]}),(0,i.jsxs)(v$,{children:[D&&(0,i.jsx)(Em,{icon:"arrow-right-arrow-left",onClick:async()=>{y||(await S({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Re.WaitingAccreditation}}),s())},children:r("changer_le_stat_20528")}),M&&(0,i.jsx)(Em,{icon:"arrow-right-arrow-left",onClick:async()=>{y||(await S({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Re.Refused}}),s())},children:r("changer_le_stat_68392")}),P&&(0,i.jsx)(Em,{icon:"arrow-right-arrow-left",onClick:async()=>{y||(await S({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:Re.NotApplicable}}),s())},children:r("changer_le_stat_62507")}),k&&(0,i.jsx)(Em,{icon:"pen",onClick:()=>{y||a.push(Wo.EDIT_ACCREDIT(n,e,o.userInfo.id))},children:r("_diter_les_accr_86042")}),F&&(0,i.jsx)(Em,{icon:"check",onClick:async()=>{b||(await C({eventId:e,selecteds:{ids:[o.userInfo.id]}}),s())},children:r("valider_les_acc_80801")}),F&&(0,i.jsx)(Em,{icon:"badge-check",onClick:()=>{y||a.push(Wo.ACCREDIT(n,e,o.userInfo.id))},children:r("accr_diter_70543")})]}),(0,i.jsxs)(v$,{children:[q&&(0,i.jsx)(Em,{icon:"clone",onClick:()=>L(!0),children:r("dupliquer_28256")}),G&&(0,i.jsx)(Em,{color:"red",icon:"minus",onClick:()=>V(!0),children:r("retirer_de_la_d_64963")}),H&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>W(!0),children:r("d_sinscrire_de_06416")})]})]}),q&&N&&(0,i.jsx)(S$,{name:o.userInfo.nameOrEmail,reload:t,userInfoId:o.userInfo.id,onClose:()=>L(!1)}),G&&U&&(0,i.jsx)(f$,{buttonText:r("retirer_de_la_d_64963"),subtext:[r("_tes_vous_sur_d_34901",o.delegation.name)],text:r("suppression_de_73669",o.userInfo.name),onClose:()=>{V(!1)},onDelete:async()=>{await A({organizationId:n,eventId:e,delegationId:o.delegation.id,selecteds:{ids:[o.userInfo.id]}}),f(r("_1_a_t_retir_36729",o.userInfo.name,o.delegation.name)),s()}}),p&&B&&(0,i.jsx)(f$,{buttonText:r("d_sinscrire_de_06416"),subtext:[r("_tes_vous_sur_d_79932")],text:r("suppression_de_73669",o.userInfo.name),onClose:()=>{W(!1)},onDelete:async()=>{await E({eventId:e,selecteds:{ids:[o.userInfo.id]}}),f(r("_1_a_t_d_sin_66177",o.userInfo.name)),t()}})]})},D4=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{reloadRow:o}=ah(),{userInfo:a}=e.volunteerRegistration;return(0,i.jsxs)(i.Fragment,{children:[(a.isEditable??!0)&&(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",to:Wo.EDIT_USER(t,s,a.id)})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(R4,{eventId:s,organizationId:t,reload:e.reload,reloadRow:()=>o(e.volunteerRegistration.id),volunteerRegistration:e.volunteerRegistration})]})},M4=(0,de.memo)(function(e){const{params:{organizationId:n,eventId:t,segmentId:s}}=fc(),{hasEventRole:o,hasPermission:a}=Ly(),{canMemberAccredit:r,canMemberAssign:d,canMemberEdit:l}=tC(),c=aE(e.customFields),u=o&&l,m=(0,de.useCallback)(e=>{const i=e.userInfo.id;return{accreditationsPanelPath:Wo.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(n,t,s,i),availabilitiesPanelPath:Wo.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(n,t,s,i),positionsPanelPath:Wo.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(n,t,s,i)}},[n,t,s]),g=(0,de.useCallback)((e,n)=>a(nC.POSITION_READ,{positionCategoryId:e,positionId:n}),[a]),h=(0,de.useCallback)((e,n)=>a(nC.MEMBER_ASSIGN,{positionCategoryId:e,positionId:n}),[a]);return(0,i.jsx)(px,{renderCell:(e,n,s)=>(0,i.jsx)(Ew,{...m(n),canChangeDelegation:u,canMemberAccredit:r,canMemberAssign:d,column:e,customField:c.get(e.slug),eventId:t,reloadRow:s,row:n}),renderRowDropdown:(e,n)=>(0,i.jsx)(D4,{reload:n,volunteerRegistration:e}),renderRowPanels:(e,o)=>(0,i.jsx)(I$,{...m(e),canCheckIn:g,canDeleteCheckedIn:r,canDeletePosition:h,canMemberAccredit:r,canWishedAccreditationsEdit:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:t,organizationId:n,reloadRow:o,returnPathFallback:Wo.VOLUNTEERS(n,t),teamsPanelsPath:(e.teams||[]).map(i=>Wo.VOLUNTEERS_LIST_USER_PANEL_TEAM(n,t,s,e.userInfo.id,i.teamCode)),volunteerRegistration:e})})}),P4=(0,de.memo)(e=>{const n=(0,de.useCallback)(n=>{n&&(t.current&&(s.current?.setMap(null),t.current=null),t.current=new google.maps.Map(n,{...od(e.initialCenter,e.initialZoom,e.layer)}),t.current.mapTypes.set(Rn.IgnPlan,md()),s.current=new google.maps.OverlayView,s.current.draw=Ou.A,s.current.setMap(t.current),t.current.addListener("drag",()=>{e.onMapDrag?.()}),t.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:t.current.getCenter().lat(),lng:t.current.getCenter().lng()})}),t.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(t.current.getZoom())}),t.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),r(),q1(e.traces,e.hiddenTracesIds,a,t))},[]),t=(0,de.useRef)(null),s=(0,de.useRef)(null),o=(0,de.useRef)([]),a=(0,de.useRef)([]),r=(0,de.useCallback)(()=>{o.current.forEach(e=>e.setMap(null)),o.current=e.users.map(n=>{const i=td(n),o=D_(n.name,n.email),a=new google.maps.Marker({position:i,map:t.current,icon:`${ee.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent("#0284fe")}&text=${o}`});return a.addListener("click",()=>{const t=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));t&&e.onUserClick?.(n,t)}),a})},[e.users]);return(0,de.useEffect)(()=>{r()},[JSON.stringify(e.users)]),(0,de.useEffect)(()=>{t.current?.setMapTypeId(rd(e.layer))},[e.layer]),(0,de.useEffect)(()=>{q1(e.traces,e.hiddenTracesIds,a,t)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(Zr,{ref:n,height:1,width:1})},dd.A);P4.displayName="UsersMap";const k4=e=>{const{params:{organizationId:n,eventId:t}}=fc();return(0,i.jsx)(Xl,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:50,children:(0,i.jsxs)(gc,{to:Ev.MEMBER_INFORMATION({organizationId:n,eventId:t,userInfoId:e.user.id}),children:[(0,i.jsx)(Zr,{color:"gray800",children:e.user.name}),(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"chevron-right"})})]})})},F4=e=>{const{params:{eventId:n}}=fc(),{event:t,hasPermission:s}=Ly(),o=s(nC.MEMBER_EDIT,{eventId:n}),{mutate:a}=ka(),[r,d]=(0,de.useState)(e.layer),[l,c]=(0,de.useState)(null),[u,m]=(0,de.useState)([]),[g,h]=ZP("volunteerssMap.center",e.center),[p,I]=ZP("volunteerssMap.zoom",sd),f=(0,de.useRef)(null);return(0,i.jsxs)(Xl,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[(0,i.jsx)(Zr,{ref:f,css:{flex:"1"},width:1,children:(0,i.jsx)(P4,{hiddenTracesIds:u,initialCenter:g,initialZoom:p,layer:r,traces:e.traces,users:e.users,onMapCenterChanged:h,onMapDrag:()=>c(null),onMapZoomchanged:I,onUserClick:(e,n)=>c({user:e,left:n.x,top:n.y})})}),o&&(0,i.jsx)(G1,{acronymIcon:"icon",event:t,hiddenTracesIds:u,layer:r,reload:e.reload,setAcronymIcon:Ou.A,setHiddenTracesIds:m,setLayer:async e=>{d(e),await a({eventId:n,layer:e})},showAcronymIcon:!1,showExport:!1,traces:e.traces,onExport:Ou.A,onFullscreen:()=>{f.current?.requestFullscreen()}}),f.current&&l&&(0,hd.createPortal)((0,i.jsx)(Zr,{css:{left:`${l.left+32}px`,position:"absolute",top:l.top-25-16+"px",zIndex:10},children:(0,i.jsx)(k4,{user:l.user})}),f.current)]})},N4=()=>{const{params:{eventId:e}}=fc(),{columns:n,columnsSearch:t,nameDebounced:s,predicates:o,rendering:a}=ah(),r=(0,de.useMemo)(()=>({...Rp(n,a),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[n,a]),{data:d,loader:l,reload:c}=(u={...r,eventId:e,predicatesGroups:o,hasCoordinates:!0,name:w(s)?s:null,columnsSearch:f(t)?t:void 0,limit:250},rs(Ea,u,[Ko.VolunteerRegistrationFragment,Ko.TraceFragment],undefined));var u;const m=(0,de.useMemo)(()=>(d.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}]:[]),[d.data]);return l||(0,i.jsx)(F4,{center:xj(d.data),layer:d.data.layer,reload:c,traces:d.data.traces||[],users:m})},L4=e=>{const{translate:n,params:{eventId:t}}=fc(),{limit:s,nameDebounced:o,offset:a,predicates:r,setLimit:d,setOffset:l}=ah(),{infos:c,setInfos:u}=DN(),{data:m,loader:g}=Pl({eventId:t,predicatesGroups:r,name:w(o)?o:void 0,limit:s,offset:a}),{numberOfPages:h,totalCount:p}=Jf(m.data?.rows),I=(0,de.useMemo)(()=>c?.volunteersPlanningshowAvailabilities??!0,[c]),f=(0,de.useCallback)(e=>{u({...c,volunteersPlanningshowAvailabilities:e})},[c,u]),x=(0,de.useMemo)(()=>(m.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>I?[{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})))})),[m.data,I]),_=(0,de.useMemo)(()=>Jo.c9.isDateTime(c.volunteersPlanningStartAt)&&c.volunteersPlanningStartAt?.isValid?c.volunteersPlanningStartAt:Jo.c9.fromISO(c.volunteersPlanningStartAt)?.isValid?Jo.c9.fromISO(c.volunteersPlanningStartAt,{zone:"utc"}):Jo.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Jo.c9.utc())?Jo.c9.utc():e.startAt,[e.startAt,e.endAt,c]),j=(0,de.useCallback)(n=>{u({...c,volunteersPlanningStartAt:n?.toISO()??e.startAt.toISO()})},[e.startAt,c,u]),v=(0,de.useMemo)(()=>{const n=Wh(e.dayStartTime);return n?.[0]??0},[e.dayStartTime]);return g||(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Xl,{css:{background:"white",flex:"1"},children:(0,i.jsx)(J1,{data:x,date:_,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(Zr,{width:40,children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",leftIcon:I?"eye":"eye-slash",onClick:()=>f(!I)})}),(0,i.jsx)(ux,{placement:"top",children:n(I?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(A2,{vr:e}),renderSlot:e=>(0,i.jsx)($2,{slot:e}),showPlus:!1,startHour:v,onChange:j})}),(0,i.jsx)(wg,{children:(0,i.jsx)(Ag,{limit:s,numberOfPages:h,offset:a,setLimit:d,setOffset:l,showLimits:!0,totalCount:p})})]})},U4=()=>(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(Ym,{shouldPreventDefault:!1,state:"unchecked",onClick:Ou.A}),(0,i.jsx)(ic,{width:"3"}),(0,i.jsx)(Vm,{size:40,variant:"circular"}),(0,i.jsx)(ic,{width:"4"}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(Vm,{borderRadius:"$1",height:12,width:1})]})]}),V4=e=>{const{data:n,isLoading:t}=Dl({organizationId:e.organizationId,excludedEventId:e.eventId,name:w(e.nameOrEmail)?e.nameOrEmail:null});return t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(U4,{}),(0,i.jsx)(U4,{}),(0,i.jsx)(U4,{})]}):(0,i.jsx)(i.Fragment,{children:n.organization.usersInfos.nodes.map(n=>{const t=e.usersInfosIds.includes(n.id)?"checked":"unchecked";return(0,i.jsx)(fO,{state:t,userInfo:n,onClick:()=>{e.select(n.id)}},n.id)})})},B4=e=>{const n=os(),t=ss(LM),s=ss(ec),[o,a,r]=Dg(""),{mutate:d,isLoading:l}=Ml();return(0,i.jsx)(Fc,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:t,handleSubmit:s,values:d})=>(0,i.jsxs)(Jg,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Zr,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:Yu.AvatarGroup})}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:n("ajouter_un_memb_33261")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:n("ajouter_un_ou_d_44771")}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),value:o,onChange:r}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Mc,{}),(0,i.jsx)(Xl,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(V4,{eventId:e.eventId,nameOrEmail:a,organizationId:e.organizationId,select:e=>{t.change("usersInfosIds",v(d.usersInfosIds,e))},usersInfosIds:d.usersInfosIds})}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsxs)(Xl,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Bx,{name:"sendVolunteerRegistrationEmail",children:n("envoyer_l_e_mai_35622")}),(0,i.jsx)(yc,{isLoading:l,onClick:s,children:n("ajouter_97327")}),(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]}),validate:s.validateForForm(t.adminAddSchema()),onSubmit:async n=>{await d({eventId:e.eventId,usersInfosIds:n.usersInfosIds,sendVolunteerRegistrationEmail:n.sendVolunteerRegistrationEmail}),e.reload(),e.onClose()}})},W4=({reload:e})=>{const{params:{organizationId:n,eventId:t,segmentId:s},translate:o}=fc(),{user:a}=ps(),{hasFeature:r}=Yy(),{hasEventRole:d}=Ly(),{canMemberCreate:l}=tC(),{columns:c}=ah(),{segment:u}=DN(),{mutate:m}=function(e={}){return ds("mutation VolunteersCriblageExport($eventId: EventId!, $segmentId: SegmentId!) {\n jobId: volunteersCriblageExport(eventId: $eventId, segmentId: $segmentId)\n}\n",e)}(),{mutate:g}=function(e={}){return ds("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:p}=rs("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:t,segmentId:s},[],undefined);const[I,f]=(0,de.useState)(!1),[x,_]=(0,de.useState)(!1),[j,v]=(0,de.useState)(!1),{checkExport:S}=Sy();return(0,i.jsxs)(gL,{children:[l&&(0,i.jsx)(TR,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Em,{icon:"user-group",onClick:e=>{vm(e.target),f(!0)},children:o("ajouter_des_mem_06922")}),(0,i.jsx)(Em,{icon:"file-import",to:Wo.EVENT_VOLUNTEERS_IMPORT(n,t),onClick:e=>vm(e.target),children:o("importer_via_un_61623")})]}),path:Ev.CREATE({organizationId:n,eventId:t}),children:o("ajouter_un_memb_33261")}),(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[d&&(0,i.jsx)(Em,{icon:"plug-circle-bolt",onClick:e=>{vm(e.target),_(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(Em,{icon:"file-xls",onClick:e=>{vm(e.target),v(!0)},children:o("exporter_en_exc_51862")}),r(In.Criblage)&&(0,i.jsx)(Em,{icon:"arrow-down-to-bracket",onClick:async e=>{vm(e.target);const{jobId:i}=await m({eventId:t,segmentId:u.id});S(i,n,t)},children:o("exporter_pour_l_97136")}),(0,i.jsx)(Em,{download:`${u.name}-users-listing`,icon:"arrow-down-to-bracket",to:Ex(h.event?.segment.links.usersListingLink,"pdf",{lang:a?.language}),children:o("t_l_charger_en_59616")}),(0,i.jsx)(lC,{permissions:nC.MEMBER_CREATE,children:(0,i.jsx)(Em,{icon:"file-import",to:Wo.EVENT_FILES_IMPORT(n,t),children:o("importer_des_do_55420")})})]})]}),I&&(0,i.jsx)(B4,{eventId:t,organizationId:n,reload:e,onClose:()=>f(!1)}),!p&&(0,i.jsx)(eV,{isOpen:x,link:Ax({organizationId:n,eventId:t,lang:a?.language,pathComponent:`volunteers/${s}`,key:h.event.key}),onClose:()=>_(!1)}),(0,i.jsx)(nV,{isOpen:j,requestExport:async(e,i)=>{const{jobId:s}=await g({eventId:t,segmentId:u.id,format:e,includeFiles:i,columns:c});S(s,n,t)},showIncludeFiles:!0,onClose:()=>v(!1)})]})},G4=(0,de.memo)(function(e){const n=os(),{canAccreditationRead:t,canMemberAccredit:s,canMemberAssign:o,canMemberEdit:a,canSegmentEdit:r}=tC(),{limit:d,massActions:l,predicates:c,reload:u,rendering:m,sort:g}=ah(),{onMassEditSuccess:h,segment:p}=DN(),I=a||o||s,f=r&&m===gp.List,x=a&&m===gp.List||s&&m===gp.AccreditationsMatrix;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W4,{reload:u}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(nL,{searchRow:(0,i.jsx)(eL,{actions:(0,i.jsx)(Rq,{massActions:l,predicates:c,scope:null,showOnlyMassEdit:!1,sort:g,totalNumberOfMembers:p.count,onMassEditSuccess:h}),searchPlaceholder:n("rechercher_un_m_05904"),showActions:I,showEditColumns:f,showEditMode:x,showSearchColumns:r}),selectSegment:(0,i.jsx)(cI,{allSelectedText:n("les_1_membres_56748",p.count,p.name),pageSelectedText:n("les_1_membres_00895",d),selectAllText:n("s_lectionner_le_71777",p.count,p.name)})}),t&&m===gp.AccreditationsMatrix?(0,i.jsx)(O4,{}):m===gp.Calendar?(0,i.jsx)(L4,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):m===gp.Map?(0,i.jsx)(N4,{}):(0,i.jsx)(M4,{customFields:e.customFields})]})]})}),q4=e=>e.userInfo.id,H4={columnsToIncludes:(e,n)=>({...Rp(e,n),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1})},Y4=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o,segmentId:a}}=fc(),{event:r,hasEventRole:d,hasPermission:l,localEvent:c,updateLocalEvent:u}=Ly(),{canAccreditationRead:m,canCampaignRead:g,canDocumentRead:h,canDelegationRead:p,canFormRead:I,canMemberAccredit:f,canMemberAssign:x,canMemberAssignmentStateEdit:_,canMemberCreate:j,canMemberDelete:v,canMemberEdit:S,canPositionRead:y,canSegmentEdit:C}=tC(),b=l(nC.MEMBER_ASSIGNMENT_STATE_EDIT,{eventId:o}),A=l(nC.MEMBER_EDIT,{eventId:o}),E=(0,de.useCallback)((e,n)=>({...Rp(e,n,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!b,includeIsEditable:!A}),[b,A]),w=(0,de.useCallback)(e=>e===gp.AccreditationsMatrix&&m?H4:e===gp.Map||e===gp.Calendar?null:{},[m]),$=ss(Dp),T=(0,de.useMemo)(()=>$.getVolunteersFilters(s,o,a,e.organization.customFields.nodes,e.event,{hasAccreditations:m,hasCampaigns:g,hasDelegations:p,hasForms:I,hasPositions:y,isWeezeventConnected:e.event.isWeezeventConnected}),[o,a,e.organization,e.event]),z=(0,de.useMemo)(()=>$.getVolunteersPossibleColumns(s,e.organization.customFields.nodes,e.event.forms.nodes,e.event.customDocuments,{hasAccreditations:m,hasCampaigns:g,hasCustomDocuments:h,hasDelegations:p,hasForms:I,hasPositions:y,isWeezeventConnected:e.event.isWeezeventConnected}),[s,r,e.organization,e.event]);return(0,i.jsx)(JN,{canSegmentEdit:C,columnsToIncludes:E,eventId:o,filters:T,filtersButtonText:t("filtrer_les_mem_47149"),filtersSubtitle:t("appliquer_des_f_48814"),getMassActionId:q4,getSegmentPath:e=>Wo.VOLUNTEERS_SEGMENT(s,o,e),initialLimit:c?.volunteersLimit??jg,initialSegmentsOpen:c?.areVolunteersSegmentsOpen??!0,loadDataList:wr,loadRow:Er,organizationId:s,possibleColumns:z,possibleRenderings:d?[gp.List,gp.Calendar,gp.AccreditationsMatrix,gp.Map]:[gp.List,gp.Calendar],reload:e.reload,renderingLoaders:w,segmentId:a,segmentType:lt.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{u({volunteersLimit:e})},showMassActions:S||x||f,showRowDropdown:j||v||f||x||_,onSegmentClick:e=>{u({volunteersSegmentId:e})},onSegmentDelete:async()=>{await u({volunteersSegmentId:null}),n.replace(Wo.VOLUNTEERS(s,o))},onSegmentsToggle:async e=>{await u({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(G4,{customFields:e.organization.customFields.nodes,event:e.event})})},Z4=(0,de.memo)(function(){const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:{name:s},localEvent:o}=Ly();fm(`${s} ${t("membres_11310")}`);const{data:a,loader:r,reload:d}=Cr({organizationId:e,eventId:n,privacy:He.All,loadCustomDocuments:!0,loadForms:!0,loadSegments:!0}),l=(0,de.useMemo)(()=>(a.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[a.event]);return r||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(Y4,{event:a.event,organization:a.organization,reload:d})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.VOLUNTEERS_SEGMENT(e,n,o?.volunteersSegmentId&&l.includes(o?.volunteersSegmentId)?o.volunteersSegmentId:l[0]),replace:!0})})]})}),K4=e=>{const{params:{organizationId:n,eventId:t},translate:s}=fc(),{data:o,loader:a}=Fd({organizationId:n,eventId:t,includeIntro:!1,spaceType:mt.DelegationSpace}),r=ss($D);return a||(0,i.jsx)(Fc,{direction:"column",initialValues:{design:r.designInputDefault(o.organization.spaceDesign,o.organization.event?.spaceDesign)},render:({form:e,handleSubmit:n,submitting:a})=>(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.DELEGATIONS_SPACE_PARAM_EDIT,children:(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{isLoading:a,onClick:n,children:s("enregistrer_06519")}),(0,i.jsx)(yc,{color:"white",disabled:a,onClick:()=>{e.change("design",r.designInputDefault(t?o.organization.spaceDesign:null))},children:s("r_initialiser_77538")})]})}),heading:s("design_15043"),hideHeader:!0,children:[(0,i.jsx)(OD,{heading:s("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(zD,{initialValues:t?o.organization.spaceDesign?.colors:void 0})]}),onSubmit:async i=>await e.mutate({organizationId:n,eventId:t,spaceDesign:i.design,spaceType:mt.DelegationSpace})})},X4=()=>{const{mutate:e}=function(e={}){return ds("mutation EventSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n eventSpaceDesignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(K4,{mutate:async n=>(await e(n)).eventSpaceDesignUpdate.id})},Q4=()=>{const{mutate:e}=ml();return(0,i.jsx)(K4,{mutate:async n=>(await e(n)).organizationSpaceDesignUpdate.id})},J4=e=>{const{history:n,translate:t,params:{organizationId:s,eventId:o}}=fc(),{showNotification:a}=Sy(),{canDelegationsSpaceParamEdit:r}=tC(),{mutate:d}=function(e={}){return ds("mutation DelegationsSpaceLayoutDelete(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n delegationsSpaceLayoutDelete(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n ) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return ds("mutation DelegationsSpaceLayoutDuplicate(\n $eventId: EventId!\n $delegationsSpaceLayoutId: DelegationsSpaceLayoutId!\n) {\n delegationsSpaceLayoutDuplicate(\n eventId: $eventId\n delegationsSpaceLayoutId: $delegationsSpaceLayoutId\n ) {\n id\n }\n}\n",e)}(),[c,u]=(0,de.useState)(!1),m=lO.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:s,eventId:o,delegationsSpaceLayoutId:e.layout.id});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.layout.name}),r&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",to:m})})}),(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[(0,i.jsx)(Em,{icon:"pen",to:m,children:t("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{const{delegationsSpaceLayoutDuplicate:{id:t}}=await l({eventId:o,delegationsSpaceLayoutId:e.layout.id});n.push(lO.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:s,eventId:o,delegationsSpaceLayoutId:t}))},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:t("supprimer_43083")})})]})]})})]}),c&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_86738"),text:t("suppression_de_73669",e.layout.name),onClose:()=>u(!1),onDelete:async()=>{await d({eventId:o,delegationsSpaceLayoutId:e.layout.id}),a(t("le_layout_1_51514",e.layout.name)),e.reload()}})]})},e3=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc(),{canDelegationsSpaceParamEdit:o}=tC(),[a,r,d]=Dg(""),{data:l,isLoading:c,reload:u}=rs("query DelegationsSpaceLayouts($eventId: EventId!, $name: String) {\n event(id: $eventId) {\n delegationsSpaceLayouts(name: $name) {\n id\n name\n }\n }\n}\n",{eventId:s,name:w(r)?r:void 0},[],undefined);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_l_04356"),value:a,onChange:d})}),(0,i.jsx)(lC,{permissions:nC.DELEGATIONS_SPACE_PARAM_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{e.push(lO.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:t,eventId:s}))},children:n("cr_er_un_layout_13164")})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("nom_du_layout_81794")}),o&&(0,i.jsx)(Mg,{width:100})]}),rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:l.event.delegationsSpaceLayouts.map(e=>(0,i.jsx)(J4,{layout:e,reload:u},e.id))}),title:n("liste_des_layou_11323")})},n3=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bC,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)($c,{children:t("espace_d_l_gati_59251")}),(0,i.jsxs)(wC,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(EC,{path:lO.DELEGATIONS_SPACE_DESIGN({organizationId:e,eventId:n}),children:t("design_15043")}),(0,i.jsx)(EC,{path:lO.DELEGATIONS_SPACE_LAYOUTS({organizationId:e,eventId:n}),children:t("layouts_27757")})]})]})}),(0,i.jsx)(yC,{css:{overflowY:"auto"},children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)($C,{path:lO.DELEGATIONS_SPACE_DESIGN({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(X4,{})}),(0,i.jsx)($C,{path:lO.DELEGATIONS_SPACE_LAYOUTS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(e3,{})})]})})]})},t3=({fallbackPath:e})=>{const{history:n,translate:t}=fc(),[s,o]=(0,de.useState)(!1),a=window.location.href;return(0,i.jsxs)(Xl,{align:"center",css:{flex:1,minHeight:"100%",padding:"$6 $4"},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"displayXs",children:(0,i.jsx)(pc,{icon:"computer"})}),(0,i.jsx)(Zr,{as:"h1",css:{margin:0},font:"gray800 textLg semiBold",textAlign:"center",children:t("page_disponible")}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",textAlign:"center",children:t("cette_page_nest")}),(0,i.jsx)(Zr,{css:{background:"$gray100",borderRadius:"$1",maxWidth:"100%",padding:"$2 $3",overflowWrap:"anywhere"},font:"gray700 textXs regular",children:a}),(0,i.jsxs)(Xl,{css:{width:"100%",maxWidth:"320px"},direction:"column",gap:"2",children:[(0,i.jsx)(yc,{leftIcon:s?"check":"copy",size:"lg",textAlign:"center",onClick:()=>{oy(a),o(!0)},children:t(s?"lien_copie":"copier_le_lien_54974")}),(0,i.jsx)(yc,{color:"white",leftIcon:"arrow-left",size:"lg",textAlign:"center",onClick:()=>n.goBack(e),children:t("retour_92202")})]})]})},i3=Nr(Xl,{flex:"1",minHeight:"44px",minWidth:"44px",variants:{active:{true:{color:"$blue600"}}}}),s3=({activePaths:e,children:n,eventId:t,path:s,text:o})=>{const a=us(),{params:r}=fc(),d=[s,...e??[]].some(e=>null!==(0,Xr.B6)(a.pathname,{path:e})),l=null!==(0,Xr.B6)(a.pathname,{path:s,exact:!0}),c=(0,Xr.tW)(s,{...r,eventId:r.eventId||t});return(0,i.jsx)(i3,{active:d,children:(0,i.jsxs)(gc,{"aria-current":d?"page":void 0,replace:l,style:{alignItems:"center",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center",width:"100%"},to:c,children:[n(d),(0,i.jsx)(Zr,{fontSize:"textXs",children:o})]})})},o3=Nr("i",{fontSize:"18px"}),a3=({active:e,className:n})=>(0,i.jsx)(o3,{"aria-hidden":"true",className:`${e?"fa-solid":"fa-regular"} ${n}`}),r3=Nr("nav",{display:"flex",color:"$gray500",padding:"6px 0 calc(6px + env(safe-area-inset-bottom)) 0",boxShadow:"0px -2px 8px -2px rgba(16, 24, 40, 0.04), 0px -4px 12px -2px rgba(16, 24, 40, 0.05)"}),d3={organizationId:":organizationId",eventId:":eventId"},l3=[Eo.POSITIONS(d3),Eo.POSITION({...d3,positionId:":positionId"}),mo.ACCREDITATIONS(d3),mo.ACCREDITATION({...d3,accreditationId:":accreditationId"}),vo.DELEGATIONS(d3),vo.DELEGATION({...d3,delegationId:":delegationId"})],c3=({user:e,eventId:n})=>{const{translate:t}=fc();return(0,i.jsxs)(r3,{children:[(0,i.jsx)(s3,{eventId:n,path:Wo.DASHBOARD(":organizationId",":eventId"),text:t("accueil_70474"),children:e=>(0,i.jsx)(a3,{active:e,className:"fa-house"})}),(0,i.jsx)(s3,{eventId:n,path:Wo.VOLUNTEERS(":organizationId",":eventId"),text:t("membres_11310"),children:e=>(0,i.jsx)(a3,{active:e,className:"fa-user-group"})}),(0,i.jsx)(s3,{eventId:n,path:Wo.ORGANIZATION_PARAMETERS(":organizationId"),text:t("profil_14444"),children:()=>(0,i.jsx)(F_,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})}),(0,i.jsx)(s3,{activePaths:l3,eventId:n,path:Wo.MOBILE_MORE(":organizationId",":eventId"),text:t("plus_77692"),children:e=>(0,i.jsx)(a3,{active:e,className:"fa-grid-2"})})]})},u3=({children:e,user:n,eventId:t})=>(0,i.jsxs)(Xl,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(Zr,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)(c3,{eventId:t,user:n})]}),m3=(e,n)=>{switch(n.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:n.data,xs:n.xs,offset:n.offset}}};function g3(e,n,t){const[s,o]=(0,de.useReducer)(m3,{isLoading:!0,data:void 0,xs:void 0,offset:n.offset}),{setIsError:a}=(0,de.useContext)(Xf);(0,de.useEffect)(()=>{let i=!1;return o({type:"FIRST_PAGE_INIT"}),fe().then(t=>e(n,{token:t||null})).then(e=>{!1===i&&o({type:"FIRST_PAGE_SUCCESS",data:e,xs:t(e),offset:n.offset})},e=>{!1===i&&a(!0,e)}),()=>{i=!0}},[e,JSON.stringify(n),t]);const r=()=>{o({type:"LOAD_MORE_INIT"});const i=s.offset+n.limit;fe().then(t=>e({...n,offset:i},{token:t||null})).then(e=>{const n=[...s.xs||[]];n.splice(i,0,...t(e)),o({type:"LOAD_MORE_SUCCESS",data:e,xs:n,offset:i})},e=>{a(!0,e)})};return(e=>e.isLoading&&void 0===e.data)(s)?{data:s.data,loader:(0,i.jsx)(_c,{}),loadMore:r,xs:s.xs}:{data:s.data,loader:s.isLoading?(0,i.jsx)(_c,{}):void 0,loadMore:r,xs:s.xs}}const h3=Nr(Zr,{display:"flex",flexDirection:"column",[`${yc} + .load-more-status`]:{paddingTop:"12px"}}),p3=({loadMore:e,pageInfo:n,isLoading:t,buttonText:s,statusText:o})=>!1===n.hasNextPage&&!1===n.hasPreviousPage?null:(0,i.jsxs)(h3,{children:[n.hasNextPage&&(0,i.jsx)(yc,{isLoading:t,textAlign:"center",onClick:e,children:s}),(0,i.jsx)(Zr,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:o})]}),I3=Nr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),f3=Nr("h2",{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold",lineHeight:"24px",margin:0}),x3=Nr(Xl,{bd:!0,color:"$gray800",padding:"$4 $3"}),_3=e=>e.event.accreditations.nodes,j3=({accreditation:e,eventId:n,organizationId:t})=>(0,i.jsx)(gc,{style:{display:"block"},to:mo.ACCREDITATION({organizationId:t,eventId:n,accreditationId:e.id}),children:(0,i.jsxs)(x3,{align:"center",gap:"3",children:[(0,i.jsx)(UI,{color:e.color,icon:e.icon}),(0,i.jsxs)(Xl,{css:{flex:1,overflow:"hidden"},direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},fontWeight:"semiBold",children:e.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:"number"==typeof e.maxResources?`${e.assignedResources} / ${e.maxResources}`:e.assignedResources}),"number"==typeof e.maxResources&&e.maxResources>0&&(0,i.jsx)(VL,{percent:e.assignedResources/e.maxResources})]}),(0,i.jsx)(Zr,{color:"gray700",css:{padding:"0 10px 0 $2"},children:(0,i.jsx)(pc,{icon:"chevron-right"})})]})}),v3=({name:e})=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o={eventId:s,name:w(e)?e:null,limit:jg,offset:0},{data:a,loader:r,loadMore:d,xs:l}=g3(bd,o,_3),c=(0,de.useMemo)(()=>{const e=[];for(const n of l??[]){const t=n.accreditationCategory.name,i=e.find(e=>e.name===t);i?i.accreditations.push(n):e.push({name:t,accreditations:[n]})}return e.map(e=>({...e,accreditations:(0,Tg.A)(e.accreditations,e=>[ap(e.index),e.name.toLowerCase()])}))},[l]);return r&&void 0===a?r:0===l.length?(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},title:w(e)?n("aucune_accr_dit_76809"):n("no_accreditations")}):(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[c.map(e=>(0,i.jsxs)(Xl,{as:"section",direction:"column",gap:"3",children:[(0,i.jsx)(f3,{children:e.name}),(0,i.jsx)(Xl,{as:"ul",css:{listStyle:"none",margin:0,padding:0},direction:"column",gap:"3",children:e.accreditations.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)(j3,{accreditation:e,eventId:s,organizationId:t})},e.id))})]},e.name)),(0,i.jsx)(p3,{buttonText:n("afficher_plus_d_49529"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.accreditations.pageInfo,statusText:n("1_sur_2_accredi",l.length,a.event.accreditations.totalCount)})]})},S3=()=>{const{translate:e}=fc(),[n,t,s]=Dg("");return(0,i.jsxs)(Xl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsx)(I3,{children:e("accr_ditations_39450")}),(0,i.jsx)(hu,{icon:"search",placeholder:e("rechercher_une_65646"),type:"search",value:n,onChange:s}),(0,i.jsx)(Xl,{css:{flex:1},direction:"column",children:(0,i.jsx)(v3,{name:t.trim()})})]})},y3=Nr("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),C3=Nr(Xl,{margin:"0 $3",padding:"$3 $4"}),b3=({back:e,children:n})=>(0,i.jsxs)(Xl,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(C3,{color:"gray700",onClick:e,children:(0,i.jsx)(pc,{icon:"chevron-left"})}),n]}),A3=({children:e,css:n,...t})=>(0,i.jsx)(Xl,{align:"center",css:{flex:1,marginRight:"66px",...n},direction:"column",...t,children:e}),E3=Nr("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),w3=Nr("ul",{display:"flex",flexDirection:"column",gap:"$3",listStyle:"none",margin:0,padding:0,width:"100%"}),$3=({accreditation:e})=>{const{translate:n}=fc(),t=ss(Wg),s=(0,de.useMemo)(()=>(0,Tg.A)(e.slots.filter(e=>!e.isHidden),e=>[e.date?.toMillis()??0,e.name.toLowerCase()]),[e.slots]);return f(s)?(0,i.jsx)(yz,{title:n("cr_neaux_33401"),children:(0,i.jsx)(w3,{children:s.map(s=>(0,i.jsxs)(Xl,{align:"center",as:"li",gap:"3",justify:"between",children:[(0,i.jsx)(Zr,{color:"gray800",css:{ellipsis:!0,flex:1},fontWeight:"medium",children:qp(t,s,e.name)}),(0,i.jsxs)(Xl,{align:"end",css:{flexShrink:0},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",children:"number"==typeof s.maxResources?`${s.assignedResources} / ${s.maxResources}`:s.assignedResources}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",children:n("_1_scann_e_19753",s.scannedResources)})]})]},s.id))})}):null},T3=()=>{const{history:e,params:{organizationId:n,eventId:t,accreditationId:s}}=fc(),{data:o,loader:a}=rs("query AccreditationMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 icon\n color\n address\n latitude\n longitude\n layer\n zoom\n assignedResources\n maxResources\n fields\n numberOfDaysLimit\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 slots {\n id\n isHidden\n name\n date\n assignedResources\n scannedResources\n maxResources\n }\n }\n }\n}\n",{organizationId:n,eventId:t,accreditationId:s},[Ko.CustomFieldWithConditionFragment],undefined);if(a)return a;const r=o.event.accreditation;return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{e.goBack(mo.ACCREDITATIONS({organizationId:n,eventId:t}))},children:(0,i.jsxs)(A3,{css:{minHeight:"40px"},children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",textAlign:"center",children:r.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",textAlign:"center",children:r.accreditationCategory.name})]})}),(0,i.jsx)(y3,{children:(0,i.jsxs)(Xl,{css:{margin:"$6 0 $7"},direction:"column",gap:"7",children:[(0,i.jsx)(ZG,{assignedResources:r.assignedResources,maxResources:r.maxResources}),(0,i.jsx)($3,{accreditation:r}),(0,i.jsx)(GG,{accreditationCategoryId:r.accreditationCategory.id,accreditationCategoryName:r.accreditationCategory.name,color:r.color,customFields:o.organization.customFields.nodes,fields:r.fields,icon:r.icon,numberOfDaysLimit:r.numberOfDaysLimit}),(0,i.jsx)(Mz,{description:r.description}),(0,i.jsx)(KG,{location:r}),(0,i.jsx)(YG,{customFields:r.accreditationsCustomFields}),(0,i.jsx)(nO,{tags:r.tags}),(0,i.jsx)(Kz,{privateNote:r.privateNote})]})})]})},z3=({header:e,value:n})=>(0,i.jsxs)(Xl,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:n})]}),O3=({position:e})=>{const{history:n,params:{organizationId:t,eventId:s},translate:o}=fc();return(0,i.jsx)(Eg,{css:{cursor:"pointer"},onClick:()=>{n.push(Eo.POSITION({organizationId:t,eventId:s,positionId:e.id}))},children:(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(Zr,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(Zr,{color:"gray700",children:o("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsx)(VL,{percent:e.assignedResources/e.resources})})]})})},e.id)},R3=Nr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),D3=Nr(pc,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),M3=Nr("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),P3=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s}}=fc(),o=ss(dE),{hasEventRole:a,hasPermission:r}=Ly(),{data:d,loader:l}=rs("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},[],undefined);const c=(0,de.useMemo)(()=>d.event?(0,Tg.A)(d.event.positionsCategories,e=>e.name.toLowerCase()):[],[d.event]),u=()=>{e.push(Wo.DASHBOARD_EVENT_SWITCH(t,s))};if(l)return l;{const e=a||c.some(e=>r(nC.POSITION_READ,{positionCategoryId:e.id}));return(0,i.jsxs)(Xl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(R3,{children:n("accueil_70474")}),(0,i.jsx)(D3,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(M3,{children:d.event.name}),(0,i.jsx)(z3,{header:n("nombre_de_membr_60320",d.event.resources),value:d.event.resources}),(0,i.jsx)(z3,{header:n("nombre_de_missi_67304",d.event.positions.totalCount),value:d.event.positions.totalCount}),(0,i.jsx)(z3,{header:n("nombre_de_membr_87779",d.event.assigned.totalCount),value:d.event.assigned.totalCount}),(0,i.jsx)(z3,{header:n("nombre_de_membr_63555",d.event.waitingAssignment.totalCount),value:d.event.waitingAssignment.totalCount}),(0,i.jsx)(z3,{header:n("taux_de_remplis_11913"),value:`${0===d.event.resources?"0":Math.round(d.event.assignedResources/d.event.resources*100)}%`}),(0,i.jsx)(z3,{header:n("temps_de_b_n_vo_87924"),value:o.minutesToHoursMinutesString(d.event.volunteerMinutesNeeded)}),(0,i.jsx)(z3,{header:n("temps_de_b_n_vo_60725"),value:o.minutesToHoursMinutesString(d.event.volunteerMinutesAssigned)}),(0,i.jsx)(Zr,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Mg,{children:n("cat_gories_24533")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:c.length>0?c.map(e=>(0,i.jsx)(gZ,{category:e,clickable:!1,eventId:s,organizationId:t},e.id)):(0,i.jsx)(ww,{subtitle:n("vous_n_avez_pas_59681"),title:n("aucune_cat_gori_21347")})}),setOffset:Ou.A,title:n("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Mg,{children:n("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:d.event.positions.nodes.map(e=>(0,i.jsx)(O3,{position:e},e.id))}),setOffset:Ou.A,title:n("liste_des_membr_57353"),totalCount:0})})]})]})}},k3=Nr("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),F3=({onClose:e})=>(0,i.jsx)(k3,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),N3=Nr(Xl,{overflowX:"hidden",overflowY:"auto"}),L3=Nr(Xl,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),U3=Nr(Xl,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),V3=({children:e,onClose:n})=>{const t=(0,Xr.W6)(),s=n??t.goBack;return _m(s),(0,i.jsx)(L3,{"data-testid":"overlay-backdrop",direction:"column",onClick:s,children:(0,i.jsxs)(U3,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(F3,{onClose:s}),(0,i.jsx)(N3,{direction:"column",children:e})]})})},B3=({event:e})=>{const n=ss(Wg);return(0,i.jsx)(Zr,{children:(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(Zr,{width:25,children:(0,i.jsx)(pc,{icon:"calendar"})}),(0,i.jsx)(Zr,{css:{flex:"1",ellipsis:!0},children:_j(n,e.startAt,e.endAt)})]})})},W3=({event:e})=>{const n=os();return(0,i.jsxs)(Xl,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(Lm,{color:e.state===gn.Ongoing?"success":"error",children:n(e.state)}),(0,i.jsx)(Zr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)(B3,{event:e})]})},G3=({events:e})=>{const{organizationId:n,eventId:t}=ls(),[s,o]=(0,de.useState)(t),a=cs(),r=os();return(0,i.jsxs)(Xl,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Xl,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(NR,{state:e.id===s?"checked":"unchecked",onClick:()=>o(e.id),children:(0,i.jsx)(W3,{event:e})},e.id))}),(0,i.jsx)(ic,{height:7}),(0,i.jsx)(yc,{onClick:()=>{a.push(Wo.DASHBOARD(n,s))},children:r("s_lectionner_l_77300")})]})},q3=Nr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),H3=()=>{const{organizationId:e,eventId:n}=ls(),{loader:t,data:s}=rs(xd,{organizationId:e,includeCreatedBy:!1,includeDescription:!1,includeNumberOfMembers:!1},[Ko.EventsEventFragment],undefined);const o=cs(),a=os();return(0,i.jsxs)(V3,{onClose:()=>{o.push(Wo.DASHBOARD(e,n))},children:[(0,i.jsx)(q3,{children:a("liste_de_vos_v_44993")}),t||(0,i.jsx)(G3,{events:s.data.rows.nodes})]})},Y3=Nr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),Z3=Nr("h2",{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold",lineHeight:"24px",margin:0}),K3=Nr(Xl,{bd:!0,color:"$gray800",padding:"$4 $3"}),X3=e=>e.event.delegations.nodes,Q3=({delegation:e,eventId:n,organizationId:t})=>{const{translate:s}=fc();return(0,i.jsx)(gc,{style:{display:"block"},to:vo.DELEGATION({organizationId:t,eventId:n,delegationId:e.id}),children:(0,i.jsxs)(K3,{align:"center",gap:"3",children:[(0,i.jsxs)(Xl,{css:{flex:1,overflow:"hidden"},direction:"column",gap:"2",children:[(0,i.jsx)(Xl,{children:(0,i.jsx)(Lm,{color:"success",children:s(e.state)})}),(0,i.jsx)(Zr,{css:{ellipsis:!0},fontWeight:"semiBold",children:e.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textSm",children:"number"==typeof e.maxResources?`${e.numberOfResources} / ${e.maxResources}`:e.numberOfResources}),"number"==typeof e.maxResources&&e.maxResources>0&&(0,i.jsx)(VL,{percent:e.numberOfResources/e.maxResources})]}),(0,i.jsx)(Zr,{color:"gray700",css:{padding:"0 10px 0 $2"},children:(0,i.jsx)(pc,{icon:"chevron-right"})})]})})},J3=({name:e})=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),o={eventId:s,name:w(e)?e:null,limit:jg,offset:0},{data:a,loader:r,loadMore:d,xs:l}=g3(Jd,o,X3),c=(0,de.useMemo)(()=>{const e=[];for(const n of l??[]){const t=n.delegationCategory.name,i=e.find(e=>e.name===t);i?i.delegations.push(n):e.push({name:t,delegations:[n]})}return e.map(e=>({...e,delegations:(0,Tg.A)(e.delegations,e=>e.name.toLowerCase())}))},[l]);return r&&void 0===a?r:0===l.length?(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},title:w(e)?n("aucune_delegati"):n("aucune_d_l_gati_85273")}):(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[c.map(e=>(0,i.jsxs)(Xl,{as:"section",direction:"column",gap:"3",children:[(0,i.jsx)(Z3,{children:e.name}),(0,i.jsx)(Xl,{as:"ul",css:{listStyle:"none",margin:0,padding:0},direction:"column",gap:"3",children:e.delegations.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)(Q3,{delegation:e,eventId:s,organizationId:t})},e.id))})]},e.name)),(0,i.jsx)(p3,{buttonText:n("afficher_plus_d_49529"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.delegations.pageInfo,statusText:n("1_sur_2_delegat",l.length,a.event.delegations.totalCount)})]})},e5=()=>{const{translate:e}=fc(),[n,t,s]=Dg("");return(0,i.jsxs)(Xl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsx)(Y3,{children:e("d_l_gations_78318")}),(0,i.jsx)(hu,{icon:"search",placeholder:e("rechercher_une_31213"),type:"search",value:n,onChange:s}),(0,i.jsx)(Xl,{css:{flex:1},direction:"column",children:(0,i.jsx)(J3,{name:t.trim()})})]})},n5=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,delegationId:o}}=fc(),a=ss(Dz),{data:r,loader:d}=el({organizationId:t,eventId:s,delegationId:o}),l=r?.organization.delegation,c=(0,de.useMemo)(()=>l&&w(l.description)?a.renderText(l.description,{delegation:l}):"",[l,a]),u=(0,de.useMemo)(()=>l?l.usedCustomFields.concat(r.organization.customFields.nodes):[],[r,l]);return d||!l?d:(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{e.goBack(vo.DELEGATIONS({organizationId:t,eventId:s}))},children:(0,i.jsxs)(A3,{css:{minHeight:"40px"},children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",textAlign:"center",children:l.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",textAlign:"center",children:l.category.name})]})}),(0,i.jsx)(y3,{children:(0,i.jsxs)(Xl,{css:{margin:"$6 0 $7"},direction:"column",gap:"7",children:[(0,i.jsx)(aO,{delegation:l}),(0,i.jsx)(yz,{title:n("reponsable_82458_plural"),children:f(l.leaders)?(0,i.jsx)(Xl,{direction:"column",gap:"4",children:l.leaders.map(e=>(0,i.jsx)(MC,{areContactLinksEnabled:!0,isClickDisabled:!0,showPhoneNumber:!!e.phone,userInfo:e},e.id))}):(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",width:1,children:n("aucun_reponsabl_38504")})}),(0,i.jsx)(cO,{delegation:l}),f(u)&&(0,i.jsx)(yz,{title:n("champs_de_formu_64126"),children:(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:u.map(e=>(0,i.jsx)(Lz,{customField:e,fields:l.fields},e.slug))})}),(0,i.jsx)(Mz,{description:c}),(0,i.jsx)(nO,{tags:l.tags}),(0,i.jsx)(Kz,{privateNote:l.privateNote})]})})]})},t5=Nr(Xl,{bd:!0,color:"$gray800",minHeight:"56px",padding:"$4 $3"}),i5=({icon:e,text:n,to:t})=>(0,i.jsx)(gc,{style:{display:"block"},to:t,children:(0,i.jsxs)(t5,{align:"center",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray500",css:{textAlign:"center"},width:24,children:(0,i.jsx)(pc,{icon:e})}),(0,i.jsx)(Zr,{css:{flex:1},fontWeight:"medium",children:n}),(0,i.jsx)(Zr,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(pc,{icon:"chevron-right"})})]})}),s5=Nr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),o5=()=>{const{translate:e,params:{organizationId:n,eventId:t}}=fc(),{canAccreditationRead:s,canDelegationRead:o,canPositionRead:a}=tC(),r=[{isVisible:a,icon:"sitemap",text:e("missions_63972"),to:Eo.POSITIONS({organizationId:n,eventId:t})},{isVisible:s,icon:"badge-check",text:e("accr_ditations_39450"),to:mo.ACCREDITATIONS({organizationId:n,eventId:t})},{isVisible:o,icon:"people-group",text:e("d_l_gations_78318"),to:vo.DELEGATIONS({organizationId:n,eventId:t})}].filter(e=>e.isVisible);return(0,i.jsxs)(Xl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsx)(s5,{children:e("plus_77692")}),f(r)?(0,i.jsx)(Xl,{as:"ul",css:{listStyle:"none",margin:0,padding:0},direction:"column",gap:"3",children:r.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)(i5,{icon:e.icon,text:e.text,to:e.to})},e.to))}):(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},subtitle:e("vous_navez_acce"),title:e("aucun_module_di")})]})},a5=Nr("i",{fontSize:"$textXl"}),r5=({replaySearch:e})=>{const{eventId:n}=ls(),{data:t,loader:s}=rs("query RecentPositionsSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentPositionsRegistrationsSearches\n }\n}\n",{eventId:n},[],undefined);const o=os();if(s)return s;{const n=t.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(Xl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",n.length)}),n.map((n,t)=>(0,i.jsxs)(Xl,{align:"center",gap:"2",onClick:()=>{e(n)},children:[(0,i.jsx)(a5,{className:"fa-regular fa-clock"}),(0,i.jsx)(Zr,{children:n})]},t))]})}};var d5=t(2872);const l5=Nr(Xl,{bd:!0,padding:"$4 $3"}),c5=({children:e,...n})=>(0,i.jsxs)(l5,{align:"center",...n,children:[(0,i.jsx)(Zr,{css:{flex:1},children:e}),(0,i.jsx)(Zr,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(pc,{icon:"chevron-right"})})]}),u5=({open:e,position:n})=>{const t=os(),s=ss(Nh);return(0,i.jsxs)(c5,{onClick:()=>{e(n.id)},children:[(0,i.jsxs)(Xl,{gap:"2",children:[n.assignedResources>=n.resources?(0,i.jsx)(Lm,{color:"success",children:t("complet_51600")}):(0,i.jsx)(Lm,{color:"warning",children:t("incomplet_45915")}),!n.isVisible&&(0,i.jsx)(Lm,{color:"gray",children:t("Private")})]}),(0,i.jsx)(Zr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:n.name}),(0,i.jsx)(Zr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:`${t("creneau",n.slots.length)} · ${n.range?s.toLocaleString(n.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"}`}),(0,i.jsx)(Zr,{css:{marginTop:"$3"},children:(0,i.jsx)(VL,{percent:n.assignedResources/n.resources})})]})},m5=Nr("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),g5=Nr("div",{color:"$gray400",fontSize:"$textSm"}),h5=Nr("span",{color:"$gray800"}),p5=({category:e})=>{const n=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m5,{children:e.name}),f(e.leaders)&&(0,i.jsxs)(g5,{children:[`${n("responsable_category",e.leaders.length)} `,(0,i.jsx)(h5,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},I5=({open:e,positions:n})=>{const t=(0,de.useMemo)(()=>(0,Tg.A)((0,d5.A)((0,l.A)(n,e=>e.category.id)),e=>e[0].category.name),[n]);return(0,i.jsx)(i.Fragment,{children:t.map((n,t)=>(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(p5,{category:n[0].category}),n.map((n,t)=>(0,i.jsx)(u5,{open:e,position:n},t))]},t))})},f5=()=>{const e=os();return(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},x5=e=>e.event.positions.nodes,_5=({search:e})=>{const n=os(),{organizationId:t,eventId:s}=ls(),o={eventId:s,predicatesGroups:ch(),limit:jg,offset:0,name:e},{data:a,loader:r,loadMore:d,xs:l}=g3(jl,o,x5),c=cs();return r&&void 0===a?r:0===l.length?(0,i.jsx)(f5,{}):(0,i.jsxs)(Xl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"semiBold",children:n("r_sultat_de_la_64686",l.length)}),(0,i.jsx)(I5,{open:n=>{c.push(Wo.POSITION_SETTINGS(t,s,n),{from:"SEARCH_MOBILE",search:e})},positions:l}),(0,i.jsx)(p3,{buttonText:n("afficher_plus_d_49529"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.positions.pageInfo,statusText:n("_1_sur_2_mis_94157",l.length,a.event.positions.totalCount)})]})},j5=Nr(Xl,{color:"$blue600"}),v5=()=>{const{organizationId:e,eventId:n}=ls(),t=cs(),s=os(),o=us(),[a,r]=(0,de.useState)(o.state?.search||""),[d,l]=(0,de.useState)(o.state?.search||"");return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{t.push(Eo.POSITIONS({organizationId:e,eventId:n}))},children:(0,i.jsxs)(Xl,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(hu,{icon:"search",placeholder:s("rechercher_une_69998"),value:a,onChange:e=>{r(e),e||l(e)},onKeyDown:e=>{"Enter"===e.key&&l(a)}}),d&&(0,i.jsx)(j5,{onClick:()=>{r(""),l("")},children:s("annuler_48254")})]})}),(0,i.jsx)(y3,{children:d?(0,i.jsx)(_5,{search:d}):(0,i.jsx)(r5,{replaySearch:e=>{r(e),l(e)}})})]})},S5=({folders:e,segmentId:n,...t})=>(0,i.jsx)(nf,{shouldParseAsInt:!0,value:n,...t,children:e.map((e,n)=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map((e,n)=>(0,i.jsxs)("option",{value:e.id,children:[e.name," (",e.count,")"]},n))},n))});var y5=t(4879);const C5=()=>{const e=os();return(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},b5=e=>e.event.positions.nodes,A5=({segment:e})=>{const n=os(),{organizationId:t,eventId:s}=ls(),o={eventId:s,predicatesGroups:e.predicatesGroups,limit:jg,offset:0},{data:a,loader:r,loadMore:d,xs:l}=g3(jl,o,b5),c=cs();return r&&void 0===a?r:0===l.length?(0,i.jsx)(C5,{}):(0,i.jsxs)(Xl,{direction:"column",gap:"7",children:[(0,i.jsx)(I5,{open:e=>{c.push(Wo.POSITION_SETTINGS(t,s,e))},positions:l}),(0,i.jsx)(p3,{buttonText:n("afficher_plus_d_49529"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.positions.pageInfo,statusText:n("_1_sur_2_mis_94157",l.length,a.event.positions.totalCount)})]})},E5=Nr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),w5=Nr(pc,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),$5=({event:e})=>{const{organizationId:n,eventId:t,segmentId:s}=ls(),o=cs(),a=os(),r=(0,y5.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Xl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(E5,{children:a("missions_63972")}),(0,i.jsx)(w5,{icon:"search",onClick:()=>{o.push(Wo.POSITIONS_SEARCH(n,t))}})]}),(0,i.jsx)(Zr,{children:(0,i.jsx)(S5,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(Wo.POSITIONS_SEGMENT(n,t,e))})}),(0,i.jsx)(Xl,{css:{flex:1},direction:"column",children:(0,i.jsx)(A5,{segment:r})})]})},T5=()=>{const{organizationId:e,eventId:n}=ls(),{data:t,loader:s}=rs("query PositionsSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:n},[Ko.SegmentsFoldersSegmentsFragment],undefined);return s||(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(v5,{})}),(0,i.jsx)(Xr.qh,{path:Wo.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)($5,{event:t.event})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.POSITIONS_SEGMENT(e,n,t.event.segmentsFolders[0].segments[0].id),replace:!0})})]})},z5=Nr(Xl,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),O5=({children:e,...n})=>(0,i.jsx)(z5,{...n,children:e}),R5=Nr(Xl,{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"}}}}),D5=({children:e,path:n})=>{const t=cs(),s=us().pathname===n;return(0,i.jsx)(R5,{isSelected:s,justify:"center",onClick:()=>{t.push(n)},children:e})},M5=({back:e,position:n})=>(0,i.jsx)(b3,{back:e,children:(0,i.jsxs)(A3,{css:{minHeight:"40px"},children:[(0,i.jsx)(Zr,{color:"gray900",fontWeight:"medium",textAlign:"center",children:n.name}),(0,i.jsx)(Zr,{color:"gray500",fontSize:"textXs",textAlign:"center",children:n.positionCategoryName})]})}),P5=e=>{const{translate:n}=fc(),t=Cg();return(0,i.jsx)(yz,{title:e.title,children:(0,i.jsxs)(Xl,{align:"center",direction:"column",...t?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(sO,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(Lm,{leftIcon:"user",children:n("_1_membre_pr_32812",e.category.preassignedResources)})]})})},k5=({position:e})=>(0,i.jsx)(Zr,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),F5=({customFields:e,position:n})=>{const{translate:t}=fc(),s=ss(Nh);return(0,i.jsx)(yz,{title:t("param_tres_78420"),children:(0,i.jsx)(Xl,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(Zz,{children:[(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:t("cat_gorie_00291")}),(0,i.jsx)(Gz,{children:n.positionCategoryName})]}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:t("Color")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(k5,{position:n})})]}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:t("ic_ne_55554")}),(0,i.jsx)(Gz,{children:(0,i.jsx)(pc,{icon:hc(n.icon)})})]}),(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsxs)(Hz,{children:[(0,i.jsx)(Bz,{children:t("Date")}),(0,i.jsx)(Gz,{children:n.range?s.toLocaleString(n.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"})]}),e.map(e=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Uz,{direction:"horizontal"}),(0,i.jsx)(Lz,{customField:e,fields:n.fields})]},e.slug))]})})})},N5=({customFields:e,position:n})=>{const t=os(),{roles:s}=Yy();return(0,i.jsxs)(Xl,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(P5,{category:n,title:t("remplissage_des_84383")}),(0,i.jsx)(UO,{leaders:n.leaders,roles:s.positionRoles}),(0,i.jsx)(F5,{customFields:e,position:n}),(0,i.jsx)(Mz,{description:n.description}),(0,i.jsx)(KG,{location:n}),(0,i.jsx)(YG,{customFields:n.customFields}),(0,i.jsx)(nO,{modalSubtitle:t("ajouter_des_tag_64526"),tags:n.tags}),(0,i.jsx)(Kz,{privateNote:n.privateNote})]})},L5=(e,n)=>e.name||n.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),U5=({open:e,slot:n})=>{const t=os(),s=ss(Nh);return(0,i.jsxs)(c5,{onClick:()=>{e(n.id)},children:[(0,i.jsx)(Xl,{gap:"2",children:n.assignedResources>=n.resources?(0,i.jsx)(Lm,{color:"success",children:t("complet_51600")}):(0,i.jsx)(Lm,{color:"warning",children:t("_1_membre_manq_31014",n.resources-n.assignedResources)})}),(0,i.jsx)(Zr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:n.name}),(0,i.jsx)(Zr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:L5(n,s)}),(0,i.jsx)(Zr,{css:{marginTop:"$3"},children:(0,i.jsx)(VL,{percent:n.assignedResources/n.resources})})]})},V5=({open:e,slots:n})=>{const t=os();return(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t("liste_des_cr_ne_94056")}),n.map((n,t)=>(0,i.jsx)(U5,{open:e,slot:n},t))]})},B5=e=>e.event.positionsSlots.nodes,W5=({open:e,eventId:n,positionId:t})=>{const s={eventId:n,positionId:t,limit:jg,offset:0},{data:o,loader:a,loadMore:r,xs:d}=g3(Sl,s,B5);return a&&void 0===o?a:(0,i.jsxs)(Xl,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(V5,{open:e,slots:d}),(0,i.jsx)(p3,{buttonText:"Afficher plus de créneaux",isLoading:void 0!==a,loadMore:r,pageInfo:o.event.positionsSlots.pageInfo,statusText:`${d.length} sur ${o.event.positionsSlots.totalCount} créneaux`})]})},G5=()=>{const{history:e,translate:n,params:{organizationId:t,eventId:s,positionId:o}}=fc(),{data:a,loader:r}=yl({organizationId:t,eventId:s,positionId:o}),d=us(),[l]=(0,de.useState)(d.state);if(d.pathname===Eo.POSITION({organizationId:t,eventId:s,positionId:o}))return(0,i.jsx)(gs,{path:Wo.POSITION_SETTINGS(t,s,o),replace:!0});const c={settings:Wo.POSITION_SETTINGS(t,s,o),slots:Eo.POSITION_SLOTS({organizationId:t,eventId:s,positionId:o})};return r||(0,i.jsxs)(E3,{children:[(0,i.jsx)(M5,{back:()=>{"SEARCH_MOBILE"===l?.from?e.push(Wo.POSITIONS_SEARCH(t,s),{search:l?.search}):e.push(Eo.POSITIONS({organizationId:t,eventId:s}))},position:a.event.position}),(0,i.jsx)(y3,{children:(0,i.jsxs)(TC,{children:[(0,i.jsxs)(O5,{css:{margin:"$6 0"},children:[(0,i.jsx)(D5,{path:c.settings,children:n("param_tres_78420")}),(0,i.jsx)(D5,{path:c.slots,children:n("cr_neaux_33401")})]}),(0,i.jsx)($C,{path:c.settings,children:(0,i.jsx)(N5,{customFields:a.organization.customFields.nodes,position:a.event.position})}),(0,i.jsx)($C,{path:c.slots,children:(0,i.jsx)(W5,{eventId:s,open:n=>{e.push(Wo.POSITION_SLOT_MEMBERS(t,s,o,n))},positionId:a.event.position.id})})]})})]})},q5=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=ls(),o=cs(),a=os();return(0,i.jsx)(V3,{onClose:()=>{o.push(Wo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsxs)(Xl,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(yc,{onClick:()=>{o.push(Wo.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,n,t,s))},children:a("pointer_des_mem_09244")}),(0,i.jsx)(yc,{onClick:()=>{o.push(Wo.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,n,t,s))},children:a("d_pointer_des_m_31557")}),(0,i.jsx)(yc,{onClick:()=>{o.push(Wo.POSITION_SLOT_CHECK_MEMBERS_RESET(e,n,t,s))},children:a("remettre_z_ro_65589")})]})})},H5=Nr(Xl,{fontSize:"$textSm",color:"$blue600"}),Y5=({onSubmit:e,children:n,data:t,loader:s,loadMore:o,xs:a,disabled:r})=>{const d=os(),[l,c]=(0,de.useState)(a);(0,de.useEffect)(()=>{c(a.toSpliced(0,l.length,...l))},[a]);const u=l.filter(e=>"checked"===e.state&&!r.includes(e.positionSlotUserInfo.id)).map(e=>e.positionSlotUserInfo.id);return(0,i.jsxs)(Xl,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(Xl,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(Xl,{justify:"between",children:[(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"semiBold",children:d("liste_des_membr_86405",a.length)}),(0,i.jsx)(H5,{onClick:()=>{c(l.map(e=>({...e,state:"checked"})))},children:d("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[l.map((e,n)=>(0,i.jsx)(Zm,{disabled:r.includes(e.positionSlotUserInfo.id),state:e.state,onClick:e=>((e,n)=>{c(l.toSpliced(e,1,{...l[e],state:n}))})(n,e),children:e.userInfo.name},n)),(0,i.jsx)(p3,{buttonText:d("afficher_plus_d_41906"),isLoading:void 0!==s,loadMore:o,pageInfo:t.event.volunteersRegistrations.pageInfo,statusText:d("_1_sur_2_mem_14323",a.length,t.event.volunteersRegistrations.totalCount)})]})]}),(0,i.jsx)(Xl,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,de.isValidElement)(n)?(0,de.cloneElement)(n,{onClick:()=>e(u),disabled:0===u.length}):n})]})},Z5=e=>e.event.volunteersRegistrations.nodes,K5=()=>{const{eventId:e,positionSlotId:n}=ls(),t=os(),s={eventId:e,positionSlotId:n,predicatesGroups:lh([{operator:Zn.IsNot,value:[Be.CheckedIn],value2:[n],slug:"checkInStatePositionSlot"}]),limit:50,offset:0},{data:o,loader:a,loadMore:r,xs:d}=g3(vl,s,Z5),{isLoading:l,mutate:c}=nr(),[u,m]=(0,de.useState)([]);if(a&&void 0===o)return a;{const n=async n=>{await c({eventId:e,checkIn:{strategy:We.CheckIn,positionsSlotsUsersInfosIds:n}}),m([...u,...n])};return(0,i.jsx)(Y5,{data:o,disabled:u,loadMore:r,loader:a,xs:d,onSubmit:n,children:(0,i.jsx)(yc,{isLoading:l,textAlign:"center",children:t("pointer_80927")})})}},X5=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=ls(),o=cs(),a=os();return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{o.push(Wo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsx)(A3,{children:a("pointer_des_mem_09244")})}),(0,i.jsx)(y3,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(K5,{})})]})},Q5=e=>e.event.volunteersRegistrations.nodes,J5=()=>{const{eventId:e,positionSlotId:n}=ls(),t=os(),s={eventId:e,positionSlotId:n,predicatesGroups:lh([{operator:Zn.IsNot,value:[Be.CheckedOut],value2:[n],slug:"checkInStatePositionSlot"}]),limit:50,offset:0},{data:o,loader:a,loadMore:r,xs:d}=g3(vl,s,Q5),{isLoading:l,mutate:c}=nr(),[u,m]=(0,de.useState)([]);if(a&&void 0===o)return a;{const n=async n=>{await c({eventId:e,checkIn:{strategy:We.CheckOut,positionsSlotsUsersInfosIds:n}}),m([...u,...n])};return(0,i.jsx)(Y5,{data:o,disabled:u,loadMore:r,loader:a,xs:d,onSubmit:n,children:(0,i.jsx)(yc,{isLoading:l,textAlign:"center",children:t("d_pointer_25328")})})}},e6=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=ls(),o=cs(),a=os();return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{o.push(Wo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsx)(A3,{children:a("d_pointer_des_m_31557")})}),(0,i.jsx)(y3,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(J5,{})})]})},n6=e=>e.event.volunteersRegistrations.nodes,t6=()=>{const{eventId:e,positionSlotId:n}=ls(),t=os(),s={eventId:e,positionSlotId:n,predicatesGroups:lh([{operator:Zn.IsNot,value:[Be.Waiting],value2:[n],slug:"checkInStatePositionSlot"}]),limit:50,offset:0},{data:o,loader:a,loadMore:r,xs:d}=g3(vl,s,n6),{isLoading:l,mutate:c}=nr(),[u,m]=(0,de.useState)([]);if(a&&void 0===o)return a;{const n=async n=>{await c({eventId:e,checkIn:{strategy:We.Reset,positionsSlotsUsersInfosIds:n}}),m([...u,...n])};return(0,i.jsx)(Y5,{data:o,disabled:u,loadMore:r,loader:a,xs:d,onSubmit:n,children:(0,i.jsx)(yc,{isLoading:l,textAlign:"center",children:t("remettre_z_ro_82376")})})}},i6=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=ls(),o=cs(),a=os();return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{o.push(Wo.POSITION_SLOT_MEMBERS(e,n,t,s))},children:(0,i.jsx)(A3,{children:a("remettre_z_ro_11572")})}),(0,i.jsx)(y3,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(t6,{})})]})},s6=e=>{let n,t,s;return"registrationState"in e?(({color:n,leftIcon:s}=LC(e.registrationState)),t=`${n}100`):(n=function(e){switch(e){case Be.CheckedIn:case Be.CheckedOut:return"success";case Be.Waiting:return"warning"}}(e.checkInState),t=`${n}500`),(0,i.jsx)(Xl,{align:"center",css:{background:Lr.colors[t].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:Lr.colors[`${n}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)(pc,{icon:s})})},o6=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}},a6=Nr("div",{position:"relative"}),r6=e=>{let n,t;if("registrationState"in e){n={registrationState:e.registrationState,size:o6(e.size)};const{registrationState:i,...s}=e;t=s}else{n={checkInState:e.checkInState,size:o6(e.size)};const{checkInState:i,...s}=e;t=s}return(0,i.jsxs)(a6,{children:[(0,i.jsx)(F_,{...t}),(0,i.jsx)(s6,{...n})]})},d6=Nr(Xl,{overflow:"hidden"}),l6=Nr("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"}}}}}),c6=({userInfo:e,size:n,...t})=>(0,i.jsxs)(d6,{direction:"column",...t,children:[w(e.name)&&(0,i.jsx)(l6,{size:n,children:e.name}),(0,i.jsx)(l6,{size:n,children:e.email})]}),u6=e=>{const n={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(Xl,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)(r6,{...n,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)(r6,{...n,checkInState:e.checkInState,size:40}):(0,i.jsx)(F_,{...n,size:40}),(0,i.jsx)(c6,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},m6=()=>{const e=os();return(0,i.jsxs)(Xl,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(uA,{color:"primary",icon:"user-group"}),(0,i.jsx)(Zr,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},g6=Nr("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),h6=Nr(pc,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),p6=({back:e,slot:n})=>{const{organizationId:t,eventId:s,positionId:o,positionSlotId:a}=ls(),r=ss(Nh),d=cs(),{hasPermission:l}=Ly(),c=l(nC.POSITION_READ,{positionCategoryId:n.positionCategoryId,positionId:o});return(0,i.jsxs)(b3,{back:e,children:[(0,i.jsx)(A3,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(g6,{children:L5(n,r)})}),c&&(0,i.jsx)(h6,{icon:"list-check",onClick:()=>{d.push(Wo.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(t,s,o,a))}})]})},I6=e=>e.event.volunteersRegistrations.nodes,f6=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s}=ls(),o=os(),a=cs(),r={eventId:n,positionSlotId:s,predicatesGroups:ch(),limit:jg,offset:0},{data:d,loader:l,loadMore:c,xs:u}=g3(vl,r,I6);return l&&void 0===d?l:(0,i.jsxs)(E3,{children:[(0,i.jsx)(p6,{back:()=>{a.push(Eo.POSITION_SLOTS({organizationId:e,eventId:n,positionId:t}))},slot:d.event.positionSlot}),(0,i.jsx)(y3,{children:(0,i.jsx)(Xl,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(m6,{}):(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[u.map(o=>(0,i.jsx)(u6,{checkInState:o.positionSlotUserInfo.state,openVolunteer:()=>{a.push(Wo.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,n,t,s,o.userInfo.id))},userInfo:o.userInfo},o.id)),(0,i.jsx)(p3,{buttonText:o("afficher_plus_d_41906"),isLoading:void 0!==l,loadMore:c,pageInfo:d.event.volunteersRegistrations.pageInfo,statusText:o("_1_sur_2_mem_14323",u.length,d.event.volunteersRegistrations.totalCount)})]})})})]})},x6=Nr("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),_6=e=>(0,i.jsx)(Zr,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),j6=e=>{const n=Cg(),t=os(),s=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),o=s.length,a=e.privateCustomFields.length;return(0,i.jsxs)(Xl,{direction:"column",children:[o>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(_6,{children:t("informations_pe_37892")}),(0,i.jsx)(ic,{height:"3"}),s.map(n=>Tb(n,e.userInfo.fields,s)&&(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Vw,{field:n,fields:e.userInfo.fields}),(0,i.jsx)(x6,{})]},n.id)),!1===n&&(0,i.jsx)(Zr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:n?5:6}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(_6,{children:(0,i.jsx)(pc,{icon:"lock"})}),(0,i.jsx)(_6,{children:t("informations_pr_15873")})]}),(0,i.jsx)(ic,{height:"3"}),e.privateCustomFields.map(n=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Vw,{field:n,fields:e.userInfo.fields}),(0,i.jsx)(x6,{})]},n.id)),!1===n&&(0,i.jsx)(Zr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===n&&e.editButton,!1===n&&(0,i.jsx)(ic,{height:"6"})]})},v6=e=>{const n=cs(),t=Cg(),s=w(e.path);return(0,i.jsxs)(Xl,{css:{cursor:s?"pointer":"initial"},direction:"column",onClick:()=>{s&&n.push(e.path)},children:[(0,i.jsx)(Zr,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(ic,{height:t?5:6})]})},S6=e=>{const n=os(),{hasPermission:t}=Ly(),s=ss(Wg),o=ss(dE),a=ss(Nh),r=Cg(),d=t(nC.MEMBER_ASSIGN),l=(0,Tg.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,Tg.A)(e.volunteerRegistration.preassignPositions.map(({id:e,name:n,range:t})=>({id:e,name:n,range:t,isPosition:!0})).concat(e.volunteerRegistration.preassignPositionsCategories.map(({id:e,name:n,range:t})=>({id:e,name:n,range:t,isPosition:!1}))),e=>e.range?.start.toMillis()??0);return(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(ic,{height:"6"}),f(l)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_6,{children:n("affectation_plural")}),(0,i.jsx)(ic,{height:"3"}),l.map((n,s)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(Yw,{canCheckIn:t(nC.POSITION_READ,{positionCategoryId:n.positionCategoryId,positionId:n.position.id}),canDelete:d,positionSlotUserInfo:n,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(ic,{height:r?2:3})]},s)),(0,i.jsx)(ic,{height:"3"}),!1===r&&(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:r?5:6})]}),f(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_6,{children:n("missions_et_cat_88954")}),(0,i.jsx)(ic,{height:"3"}),c.map((n,t)=>(0,i.jsx)(v6,{path:n.isPosition?Eo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:n.id}):Eo.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:n.id}),subtext:n.range?a.toDisplayString(n.range):"-",text:n.name},t)),!1===r&&(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:r?5:6})]}),(f(e.volunteerRegistration.positionsCategories)||f(e.volunteerRegistration.positions)||f(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_6,{children:n("missions_souhai_23225")}),(0,i.jsx)(ic,{height:"3"}),(0,Tg.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((n,t)=>(0,i.jsx)(v6,{path:Eo.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:n.id}),subtext:n.range?a.toDisplayString(n.range):"-",text:n.name},t)),(0,Tg.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((n,t)=>(0,i.jsx)(v6,{path:Eo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:n.id}),subtext:n.range?a.toDisplayString(n.range):"-",text:n.name},t)),(0,Tg.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((n,t)=>(0,i.jsx)(v6,{path:Eo.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:n.position.id}),subtext:n.nameOrRange,text:n.position.name},t)),!1===r&&(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:r?5:6})]}),f(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_6,{children:n("disponibilit_s_49923")}),(0,i.jsx)(ic,{height:"3"}),e.volunteerRegistration.slots.map((e,t)=>(0,i.jsx)(v6,{subtext:a.toDisplayString(e.range),text:n("disponibilit_n_50484",t+1)},t)),!1===r&&(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:r?5:6})]}),e.volunteerRegistration.state===yt.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_6,{children:n("statistiques_98073")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(v6,{subtext:o.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:n("nombre_d_heures_36999")}),!1===r&&(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:r?5:6})]}),(0,i.jsx)(_6,{children:n("inscription_48144")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(v6,{subtext:s.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),da.DateTime),text:n("date_d_inscript_31369")})]})},y6=Nr(Xl,{bd:!0,color:"$gray800",minHeight:"56px",padding:"$3"}),C6=({aui:e,organizationId:n,eventId:t})=>{const{translate:s}=fc(),o=ss(Wg),a=qp(o,e.accreditationSlot,e.accreditation.name),r=e.state===Be.CheckedIn;return(0,i.jsx)(gc,{style:{display:"block"},to:mo.ACCREDITATION({organizationId:n,eventId:t,accreditationId:e.accreditation.id}),children:(0,i.jsxs)(y6,{align:"center",gap:"3",children:[(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Xl,{css:{flex:1,overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},fontWeight:"medium",children:e.accreditation.name}),a!==e.accreditation.name&&(0,i.jsx)(Zr,{color:"gray500",css:{ellipsis:!0},children:a}),(0,i.jsxs)(Xl,{align:"center",gap:"1",children:[(0,i.jsx)(Zr,{color:r?"success500":"warning500",children:(0,i.jsx)(pc,{icon:r?"badge-check":"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(Zr,{font:"gray800 textXs medium",children:s(r?"scann_e_01567":"pas_encore_scan_88057")}),r&&e.checkInAt?.isValid&&(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:o.toLocaleString(e.checkInAt.toLocal(),da.DateTime)})]})]}),(0,i.jsx)(Zr,{color:"gray700",css:{padding:"0 10px 0 $2"},children:(0,i.jsx)(pc,{icon:"chevron-right"})})]})})},b6=({auis:e,organizationId:n,eventId:t})=>{const{translate:s}=fc(),o=(0,de.useMemo)(()=>{const n=(0,Tg.A)(e,e=>[e.accreditationCategory.name.toLowerCase(),ap(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),t=[];for(const e of n){const n=t.at(-1);n?.name===e.accreditationCategory.name?n.auis.push(e):t.push({name:e.accreditationCategory.name,auis:[e]})}return t},[e]);return f(o)?(0,i.jsx)(Xl,{css:{paddingTop:"$6"},direction:"column",gap:"6",children:o.map(e=>(0,i.jsxs)(Xl,{as:"section",direction:"column",gap:"3",children:[(0,i.jsx)(_6,{children:e.name}),(0,i.jsx)(Xl,{as:"ul",css:{listStyle:"none",margin:0,padding:0},direction:"column",gap:"2",children:e.auis.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)(C6,{aui:e,eventId:t,organizationId:n})},e.id))})]},e.name))}):(0,i.jsx)(Jw,{css:{padding:"$6 $4"},title:s("aucune_accr_dit_22369")})},A6=({organizationId:e,eventId:n,userInfoId:t})=>{const{data:s,loader:o}=Oa({organizationId:e,eventId:n,userInfoId:t});return o||(0,i.jsx)(b6,{auis:s.event.volunteerRegistration.accreditationsUsersInfos,eventId:n,organizationId:e})},E6=Nr(Zr,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),w6=Nr(Zr,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),$6=Nr(Zr,{display:"flex",justifyContent:"center",lineHeight:"20px",marginTop:"$1",maxWidth:"100%"}),T6=({registration:e})=>{const{params:{organizationId:n}}=fc(),{canDelegationRead:t}=tC(),s=e.delegation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r6,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(E6,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(w6,{color:"gray500",fontSize:"textSm",children:e.userInfo.email}),t&&s&&(0,i.jsx)($6,{fontSize:"textSm",children:(0,i.jsxs)(Ug,{css:{color:"$primary500",maxWidth:"100%"},to:vo.DELEGATION({organizationId:n,eventId:s.eventId??void 0,delegationId:s.id}),children:[(0,i.jsx)(pc,{icon:"people-group"}),(0,i.jsx)(Zr,{as:"span",css:{ellipsis:"",marginInlineStart:"$2"},children:s.name})]})})]})},z6=({basePath:e,data:n,reload:t})=>{const{translate:s,params:{organizationId:o,eventId:a,userInfoId:r}}=fc(),{canAccreditationRead:d}=tC(),l=n.event.volunteerRegistration,c={informations:`${e}/${Ss.INFORMATION}`,registration:`${e}/${Ss.REGISTRATION}`,accreditations:`${e}/${Ss.ACCREDITATIONS}`};return(0,i.jsxs)(Xl,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(T6,{registration:l}),(0,i.jsxs)(TC,{css:{marginTop:"$5"},children:[(0,i.jsxs)(O5,{children:[(0,i.jsx)(D5,{path:c.informations,children:s("informations_22954")}),(0,i.jsx)(D5,{path:c.registration,children:s("missions_63972")}),d&&(0,i.jsx)(D5,{path:c.accreditations,children:s("accr_ditations_39450")})]}),(0,i.jsx)($C,{path:c.informations,children:(0,i.jsx)(j6,{fieldsToDisplay:n.event.formsCustomsFields,privateCustomFields:n.organization.customFields.nodes,userInfo:l.userInfo})}),(0,i.jsx)($C,{path:c.registration,children:(0,i.jsx)(S6,{eventId:a,organizationId:o,reload:t,volunteerRegistration:l})}),d&&(0,i.jsx)($C,{path:c.accreditations,children:(0,i.jsx)(A6,{eventId:a,organizationId:o,userInfoId:r})})]})]})},O6=({basePath:e,onClose:n})=>{const{params:{organizationId:t,eventId:s,userInfoId:o}}=fc(),{data:a,loader:r,reload:d}=rs("query UserInfoMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(eventId: $eventId, 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 delegation {\n id\n eventId\n name\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:t,eventId:s,userInfoId:o},[Ko.CustomFieldWithConditionFragment,Ko.UserInfoOverlayFragment,Ko.UserPositionSlotUserInfoFragment],undefined);return(0,i.jsx)(V3,{onClose:n,children:r||(0,i.jsx)(z6,{basePath:e,data:a,reload:d})})},R6=()=>{const{organizationId:e,eventId:n,positionId:t,positionSlotId:s,userInfoId:o}=ls(),a=cs(),r=Wo.POSITION_SLOT_MEMBERS_USER(e,n,t,s,o);return(0,i.jsx)(O6,{basePath:r,onClose:()=>{a.push(Wo.POSITION_SLOT_MEMBERS(e,n,t,s))}})},D6=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(X5,{})}),(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(e6,{})}),(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(i6,{})}),(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(f6,{})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(G5,{})})]}),(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(q5,{})}),(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(R6,{})})]})]}),M6=Nr("i",{fontSize:"$textXl"}),P6=({replaySearch:e})=>{const{eventId:n}=ls(),{data:t,loader:s}=rs("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentVolunteersRegistrationsSearches\n }\n}\n",{eventId:n},[],undefined);const o=os();if(s)return s;{const n=t.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(Xl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",n.length)}),n.map((n,t)=>(0,i.jsxs)(Xl,{align:"center",gap:"2",onClick:()=>{e(n)},children:[(0,i.jsx)(M6,{className:"fa-regular fa-clock"}),(0,i.jsx)(Zr,{children:n})]},t))]})}},k6=()=>{const e=os();return(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},F6=e=>e.event.volunteersRegistrations.nodes,N6=({search:e})=>{const n=os(),{organizationId:t,eventId:s}=ls(),o={eventId:s,predicatesGroups:ch(),limit:jg,offset:0,name:e},{data:a,loader:r,loadMore:d,xs:l}=g3(Ll,o,F6),c=cs();return r&&void 0===a?r:0===l.length?(0,i.jsx)(k6,{}):(0,i.jsxs)(Xl,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"semiBold",children:n("r_sultat_de_la_64686",l.length)}),l.map((e,n)=>(0,i.jsx)(u6,{openVolunteer:()=>{c.push(Wo.VOLUNTEERS_SEARCH_USER_INFORMATIONS(t,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},n)),(0,i.jsx)(p3,{buttonText:n("afficher_plus_d_41906"),isLoading:void 0!==r,loadMore:d,pageInfo:a.event.volunteersRegistrations.pageInfo,statusText:n("_1_sur_2_mem_14323",l.length,a.event.volunteersRegistrations.totalCount)})]})},L6=Nr(Xl,{color:"$blue600"}),U6=()=>{const{organizationId:e,eventId:n}=ls(),t=cs(),s=os(),[o,a]=(0,de.useState)(""),[r,d]=(0,de.useState)("");return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{t.push(Wo.VOLUNTEERS(e,n))},children:(0,i.jsxs)(Xl,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(hu,{icon:"search",placeholder:s("rechercher_un_m_05904"),value:o,onChange:e=>{a(e),e||d(e)},onKeyDown:e=>{"Enter"===e.key&&d(o)}}),r&&(0,i.jsx)(L6,{onClick:()=>{a(""),d("")},children:s("annuler_48254")})]})}),(0,i.jsx)(y3,{children:r?(0,i.jsx)(N6,{search:r}):(0,i.jsx)(P6,{replaySearch:e=>{a(e),d(e)}})})]})},V6=()=>{const{organizationId:e,eventId:n,userInfoId:t}=ls(),s=cs(),o=Wo.VOLUNTEERS_SEARCH_USER(e,n,t);return(0,i.jsx)(O6,{basePath:o,onClose:()=>{s.push(Wo.VOLUNTEERS_SEARCH(e,n))}})},B6=()=>{const e=os();return(0,i.jsx)(Jw,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},W6=e=>e.event.volunteersRegistrations.nodes,G6=({segment:e})=>{const n=os(),{organizationId:t,eventId:s,segmentId:o}=ls(),a={eventId:s,predicatesGroups:e.predicatesGroups,limit:jg,offset:0},{data:r,loader:d,loadMore:l,xs:c}=g3(Ll,a,W6),u=cs();return d&&void 0===r?d:0===c.length?(0,i.jsx)(B6,{}):(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[c.map((e,n)=>(0,i.jsx)(u6,{openVolunteer:()=>{u.push(Wo.VOLUNTEERS_LIST_USER_INFORMATIONS(t,s,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},n)),(0,i.jsx)(p3,{buttonText:n("afficher_plus_d_41906"),isLoading:void 0!==d,loadMore:l,pageInfo:r.event.volunteersRegistrations.pageInfo,statusText:n("_1_sur_2_mem_14323",c.length,r.event.volunteersRegistrations.totalCount)})]})},q6=Nr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),H6=Nr(pc,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),Y6=({event:e})=>{const{organizationId:n,eventId:t,segmentId:s}=ls(),o=cs(),a=os(),r=(0,y5.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Xl,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Xl,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(q6,{children:a("membres_11310")}),(0,i.jsx)(H6,{icon:"search",onClick:()=>{o.push(Wo.VOLUNTEERS_SEARCH(n,t))}})]}),(0,i.jsx)(Zr,{children:(0,i.jsx)(S5,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push(Wo.VOLUNTEERS_SEGMENT(n,t,e))})}),(0,i.jsx)(Xl,{css:{flex:1},direction:"column",children:(0,i.jsx)(G6,{segment:r})})]})},Z6=()=>{const{organizationId:e,eventId:n,segmentId:t,userInfoId:s}=ls(),o=cs(),a=Wo.VOLUNTEERS_LIST_USER(e,n,t,s);return(0,i.jsx)(O6,{basePath:a,onClose:()=>{o.push(Wo.VOLUNTEERS_SEGMENT(e,n,t))}})},K6=()=>{const{organizationId:e,eventId:n}=ls(),{data:t,loader:s}=rs("query VolunteersSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:n},[Ko.SegmentsFoldersSegmentsFragment],undefined);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(U6,{})}),(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(Y6,{event:t.event})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.VOLUNTEERS_SEGMENT(e,n,t.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(V6,{})}),(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(Z6,{})})]})]})},X6=()=>{const{organizationId:e,eventId:n}=ls(),{user:t}=Yy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(P3,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.MOBILE_MORE(":organizationId",":eventId"),children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(o5,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(K6,{})})}),(0,i.jsx)(Xr.qh,{path:Eo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(T5,{})})}),(0,i.jsx)(Xr.qh,{path:Eo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(D6,{})}),(0,i.jsx)(Xr.qh,{path:mo.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(S3,{})})}),(0,i.jsx)(Xr.qh,{path:mo.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(T3,{})}),(0,i.jsx)(Xr.qh,{path:vo.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(e5,{})})}),(0,i.jsx)(Xr.qh,{path:vo.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(n5,{})}),(0,i.jsx)(Xr.qh,{exact:!0,path:eo.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(gs,{path:Wo.DASHBOARD(e,n),replace:!0})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(u3,{eventId:n,user:t,children:(0,i.jsx)(t3,{fallbackPath:Wo.DASHBOARD(e,n)})})})]}),(0,i.jsx)(Xr.dO,{children:(0,i.jsx)(Xr.qh,{path:Wo.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(H3,{})})})]})},Q6=e=>{const n=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[t,s]=(0,de.useState)(n),o=!!e.children&&(!e.isMenuOpen||t),a=()=>(0,i.jsxs)(Xl,{align:"center",className:n?"h-event-menu-group-active":"",css:{color:"$gray700",cursor:"pointer",padding:"$2 $3","&:hover, &.h-event-menu-group-active":{background:"$primary50",borderRadius:"6px",color:"$primary500"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&s(!t)},children:[(0,i.jsx)(pc,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(Zr,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(Zr,{fontSize:"textXs",children:(0,i.jsx)(pc,{icon:t?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(Xl,{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?a():(0,i.jsx)(gc,{to:e.to,children:a()}),o&&(0,i.jsx)(Xl,{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)(Xl,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(Zr,{css:{padding:"$2 $3"},font:"gray900 textSm semiBold",children:e.title}),e.children]})})]})},J6=e=>{const n=e.isActive(location.pathname);return(0,i.jsx)(gc,{"aria-label":e.children,"aria-selected":n,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(Xl,{className:n?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary500"}},children:e.children})})},e8=e=>{const{translate:n,params:{organizationId:t,eventId:s}}=fc(),{hasFeature:o}=Yy(),{event:a,hasEventRole:r,numberOfWaitingAccreditations:d,numberOfWaitingAssigments:l,updateLocalEvent:c}=Ly(),{canAccreditationRead:u,canCampaignRead:m,canCustomFieldRead:g,canDelegationRead:h,canDelegationsSpaceParamRead:p,canDocumentRead:I,canEmailEdit:f,canFormRead:x,canMemberAccredit:_,canMemberAssign:j,canPositionRead:v,canPrintConfigRead:S,canWeezeventRead:y,canWorkflowRead:C}=tC(),b=aI(),A=(0,de.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")),[]),E=(0,de.useCallback)(e=>(null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/))&&!e.includes("/documents/"),[]),w=(0,de.useCallback)(e=>A(e)||E(e),[A,E]),$=(0,de.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),T=(0,de.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+/),[]),z=(0,de.useCallback)(e=>$(e)||T(e),[$,T]),O=(0,de.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),R=(0,de.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/accredit\/\d+/)||null!==e.match(/\/edit-accredit\/\d+/),[]),D=(0,de.useCallback)(e=>null!==e.match(/accreditation-profiles\/\d+/)||null!==e.match(/\/accreditation-profile\/\d+/)||null!==e.match(/\/accreditation-profile-category\/\d+/),[]),M=(0,de.useCallback)(e=>O(e)||R(e)||D(e),[O,R,D]),P=(0,de.useCallback)(e=>(e.endsWith("/forms")||e.endsWith("/forms/create"))&&!e.endsWith("/history/forms"),[]),k=(0,de.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),F=(0,de.useCallback)(e=>null!==e.match(/\/delegations-space\//),[]),N=(0,de.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),L=(0,de.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),U=(0,de.useCallback)(e=>P(e)||k(e)||F(e)||N(e)||L(e),[P,k,F,N,L]),V=(0,de.useCallback)(e=>e.endsWith("/options/api"),[]),B=(0,de.useCallback)(e=>e.endsWith("options/weezevent"),[]),W=(0,de.useCallback)(e=>e.endsWith("/print-triggers")||null!==e.match(/\/print-trigger\/\d+/),[]),G=(0,de.useCallback)(e=>null!==e.match(/workflows\/\d+/)||null!==e.match(/\/workflow\/\d+/),[]),q=(0,de.useCallback)(e=>null!==e.match(/custom-fields\/\d+/),[]),H=(0,de.useCallback)(e=>V(e)||B(e)||W(e)||G(e)||q(e),[V,B,W,G,q]),Y=r,Z=o(In.Api)&&r,K=y,X=S&&!!a.weezticketEventId&&!!a.numberOfZplDocuments,Q=Z||K||X||C||g,J=x||m||f||I||p;return(0,i.jsxs)(Xl,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(Xl,{align:"center","aria-keyshortcuts":(b?"Meta":"Control")+"+K",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{Uc(e),e.target.dispatchEvent(new CustomEvent(cM,{bubbles:!0}))},children:[(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{color:"gray800",css:{flex:"1"},children:n("action_rapide_97952")}),(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[b?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:1,children:[Y&&(0,i.jsx)(Q6,{icon:"objects-column",isMenuOpen:e.isOpen,title:n("tableau_de_bord_24627"),to:Wo.DASHBOARD(t,s)}),(0,i.jsxs)(Q6,{icon:"user-group",isActive:w,isMenuOpen:e.isOpen,title:n("population_38615"),to:Wo.VOLUNTEERS(t,s),children:[(0,i.jsx)(J6,{isActive:A,to:Wo.VOLUNTEERS(t,s),onClick:()=>c({volunteersSegmentId:null}),children:n("membres_11310")}),h&&(0,i.jsx)(J6,{isActive:E,to:vo.DELEGATIONS({organizationId:t,eventId:s}),onClick:()=>c({delegationsSegmentId:null}),children:n("d_l_gations_78318")})]}),v&&(0,i.jsxs)(Q6,{icon:"sitemap",isActive:z,isMenuOpen:e.isOpen,title:n("missions_63972"),to:Eo.POSITIONS({organizationId:t,eventId:s}),children:[(0,i.jsx)(J6,{isActive:$,to:Eo.POSITIONS({organizationId:t,eventId:s}),onClick:()=>c({positionsSegmentId:null}),children:n("missions_63972")}),j&&(0,i.jsx)(J6,{isActive:T,to:Wo.ASSIGNMENTS(t,s),children:`${n("affectation_plural")} (${l})`})]}),u&&(0,i.jsxs)(Q6,{icon:"badge-check",isActive:M,isMenuOpen:e.isOpen,title:n("accr_ditations_39450"),to:mo.ACCREDITATIONS({organizationId:t,eventId:s}),children:[(0,i.jsx)(J6,{isActive:O,to:mo.ACCREDITATIONS({organizationId:t,eventId:s}),onClick:()=>c({accreditationsSegmentId:null}),children:n("accr_ditations_39450")}),(0,i.jsx)(J6,{isActive:D,to:iM.ACCREDITATIONS_PROFILES({organizationId:t,eventId:s}),children:n("profils_d_accr_27825")}),_&&(0,i.jsx)(J6,{isActive:R,to:Wo.ACCREDITATIONS_ASSIGNMENTS(t,s),children:`${n("mod_ration_09947")} (${d})`})]}),J&&(0,i.jsxs)(Q6,{icon:"message",isActive:U,isMenuOpen:e.isOpen,title:n("communication_05277"),to:Ks.FORMS({organizationId:t,eventId:s}),children:[x&&(0,i.jsx)(J6,{isActive:P,to:Ks.FORMS({organizationId:t,eventId:s}),children:n("Form_plural")}),m&&(0,i.jsx)(J6,{isActive:k,to:Nv.CAMPAIGNS({organizationId:t,eventId:s}),children:n("Campaigns")}),f&&(0,i.jsx)(J6,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:Wo.EVENT_EMAILS_PARAMETERS(t,s),children:n("e_mails_09850")}),I&&(0,i.jsx)(J6,{isActive:L,to:QD.DOCUMENTS({organizationId:t,eventId:s}),children:n("Documents")}),p&&(0,i.jsx)(J6,{isActive:F,to:lO.DELEGATIONS_SPACE({organizationId:t,eventId:s}),children:n("espace_d_l_gati_59251")})]}),Q&&(0,i.jsxs)(Q6,{icon:"sliders-up",isActive:H,isMenuOpen:e.isOpen,title:n("options_53186"),to:Wo.OPTIONS_API(t,s),children:[Z&&(0,i.jsx)(J6,{isActive:V,to:Wo.OPTIONS_API(t,s),children:"API"}),K&&(0,i.jsx)(J6,{isActive:B,to:Wo.OPTIONS_WEEZEVENT(t,s),children:"Weezevent"}),C&&(0,i.jsx)(J6,{isActive:G,to:Vv.WORKFLOWS({organizationId:t,eventId:s}),children:n("automatisations_60045")}),g&&(0,i.jsx)(J6,{isActive:q,to:av.CUSTOM_FIELDS({organizationId:t,eventId:s}),children:n("champs_de_formu_64126")}),X&&(0,i.jsx)(J6,{isActive:W,to:nW.PRINT_TRIGGERS({organizationId:t,eventId:s}),children:n("impressions_96006")})]})]})]})},n8=e=>{const{translate:n}=fc();return(0,i.jsx)(Xl,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(yc,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(ux,{placement:"top",children:e.isOpen?n("masquer_le_menu_29008"):n("afficher_le_men_91936")})]})})},t8=()=>{const{params:{organizationId:e,eventId:n},translate:t}=fc(),{event:s,hasEventRole:o,hasPermission:a}=Ly(),r=a(nC.MEMBER_ASSIGN,{eventId:n}),{canAccreditationRead:d,canCampaignRead:l,canCustomFieldRead:c,canDelegationRead:u,canDelegationsSpaceParamRead:m,canDocumentEdit:g,canDocumentRead:h,canEmailEdit:p,canFormEdit:I,canFormRead:f,canMemberAccredit:x,canMemberAssign:_,canMemberEdit:j,canPositionRead:v,canPrintConfigRead:S,canWeezeventRead:y,canWorkflowRead:C}=tC();fm(s.name);const[b,A]=sE(e,"isEventMenuOpen",!1);return(0,i.jsxs)(Xl,{height:1,width:1,children:[(0,i.jsxs)(Xl,{"aria-label":t("menu_de_l_v_ne_05526"),as:Yl.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:b?240:64,children:[(0,i.jsx)(Xl,{css:{flex:"1",overflowY:b?"hidden":void 0},width:1,children:(0,i.jsx)(e8,{isOpen:b})}),(0,i.jsx)(n8,{isOpen:b,onToggle:()=>{A(!b)}})]}),(0,i.jsx)(Zr,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(Xr.dO,{children:[o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(pZ,{})}),v&&(0,i.jsx)(Xr.qh,{path:Eo.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(u2,{})}),v&&(0,i.jsx)(Xr.qh,{path:Eo.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(G2,{})}),v&&(0,i.jsx)(Xr.qh,{path:Eo.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(M2,{})}),(0,i.jsx)(Xr.qh,{path:Wo.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(Z4,{})}),j&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(rF,{})}),x&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(b4,{})}),_&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(w4,{})}),(0,i.jsx)(Xr.qh,{path:Wo.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(z4,{})}),u&&(0,i.jsx)(Xr.qh,{path:vo.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(PZ,{})}),(0,i.jsx)(Xr.qh,{path:Ev.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(Hk,{})}),u&&(0,i.jsx)(Xr.qh,{path:vo.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(ZO,{isEvent:!0})}),u&&(0,i.jsx)(Xr.qh,{path:vo.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(DO,{})}),(o||_)&&(0,i.jsx)(Xr.qh,{path:Wo.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(sZ,{})}),_&&(0,i.jsx)(Xr.qh,{path:Wo.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(XY,{isEdit:!1})}),_&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(XY,{isEdit:!0})}),r&&(0,i.jsx)(Xr.qh,{path:Wo.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(uZ,{})}),_&&(0,i.jsx)(Xr.qh,{path:Wo.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(XY,{isEdit:!1})}),x&&(0,i.jsx)(Xr.qh,{path:Wo.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(IH,{})}),x&&(0,i.jsx)(Xr.qh,{path:Wo.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(cH,{isEdit:!1})}),x&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(cH,{isEdit:!0})}),I&&(0,i.jsx)(Xr.qh,{path:Ks.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(IR,{isCreateOpen:!0})}),f&&(0,i.jsx)(Xr.qh,{path:Ks.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(IR,{isCreateOpen:!1})}),l&&(0,i.jsx)(Xr.qh,{path:Nv.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(mZ,{})}),l&&(0,i.jsx)(Xr.qh,{path:Nv.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(tb,{})}),m&&(0,i.jsx)(Xr.rd,{exact:!0,from:lO.DELEGATIONS_SPACE({organizationId:":organizationId",eventId:":eventId"}),push:!1,to:lO.DELEGATIONS_SPACE_DESIGN({organizationId:e,eventId:n})}),m&&(0,i.jsx)(Xr.qh,{path:lO.DELEGATIONS_SPACE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(AC,{children:(0,i.jsx)(n3,{})})}),(o||p)&&(0,i.jsx)(Xr.qh,{path:Wo.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(TJ,{})}),(o||p)&&(0,i.jsx)(Xr.qh,{path:Wo.EVENT_AUTOMATIC_EMAIL(":organizationId",":eventId",":emailType"),children:(0,i.jsx)(wJ,{})}),(o||p)&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.EVENT_AUTOMATIC_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(AJ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_PLANNING({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(WQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_PLANNING_LIST({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(KQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_PLANNING_DAYS({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(kQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_ASSIGNMENTS({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(vQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USERS_LISTING({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(cQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_BADGE({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",badgeType:"generic"}),children:(0,i.jsx)(CQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_BADGE({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",badgeType:":badgeType"}),children:(0,i.jsx)($Q,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_CERTIFICATE({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(EQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.DELEGATION_CALENDAR({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(qX,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.ASO_PAX_MANIFEST({organizationId:":organizationId",eventId:":eventId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(EX,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USER_HOURS({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(RQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.POSITION_PLANNING({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(sJ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.POSITIONS_VOLUNTEERS_PLANNING({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(oQ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.POSITION_SHEET({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(uJ,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.POSITIONS_PLANNING({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(QX,{})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.USERS_PICTURES({organizationId:":organizationId",eventId:":eventId",segmentId:":segmentId"}),children:(0,i.jsx)(hQ,{})}),h&&(0,i.jsx)(Xr.qh,{path:QD.USER_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(xJ,{})}),g&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.CREATE_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(vX,{isCreateOpen:!0})}),h&&(0,i.jsx)(Xr.qh,{exact:!0,path:QD.DOCUMENTS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(vX,{isCreateOpen:!1})}),y&&(0,i.jsx)(Xr.qh,{path:Wo.OPTIONS_WEEZEVENT(":organizationId",":eventId"),children:(0,i.jsx)(r0,{})}),C&&(0,i.jsx)(Xr.qh,{path:Vv.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(xL,{})}),c&&(0,i.jsx)(Xr.qh,{path:av.CUSTOM_FIELDS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(KV,{})}),C&&(0,i.jsx)(Xr.qh,{path:Vv.WORKFLOW({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(AL,{})}),o&&(0,i.jsx)(Xr.qh,{path:Wo.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(o0,{})}),d&&(0,i.jsx)(Xr.qh,{path:iM.ACCREDITATIONS_PROFILES({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(fY,{})}),d&&(0,i.jsx)(Xr.qh,{path:iM.ACCREDITATIONS_PROFILE({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(SY,{})}),d&&(0,i.jsx)(Xr.qh,{path:iM.ACCREDITATIONS_PROFILE_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),children:(0,i.jsx)(wY,{})}),d&&(0,i.jsx)(Xr.qh,{path:mo.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(wG,{})}),d&&(0,i.jsx)(Xr.qh,{path:mo.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(RY,{})}),d&&(0,i.jsx)(Xr.qh,{path:mo.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(Pq,{})}),d&&(0,i.jsx)(Xr.qh,{path:mo.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(AH,{})}),S&&(0,i.jsx)(Xr.qh,{path:nW.PRINT_TRIGGERS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(S4,{})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.VOLUNTEERS(e,n),replace:!0})})]})}),(0,i.jsx)(uM,{level:"event"})]})},i8=()=>{const{hasFeature:e}=Yy(),{event:n,hasPermission:t}=Ly(),s=t(nC.CAMPAIGN_SEND,{eventId:n.id}),o=t(nC.DELEGATION_EDIT,{eventId:n.id}),{canAccreditationEdit:a,canCampaignSend:r,canCustomFieldEdit:d,canDelegationEdit:l,canDelegationsSpaceParamEdit:c,canDocumentEdit:u,canFormRead:m,canMemberAssign:g,canMemberCreate:h,canMemberEdit:p,canPositionEdit:I,canPrintConfigEdit:f,canWorkflowEdit:x}=tC();return(0,i.jsxs)(Xr.dO,{children:[n.usePositions&&I&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(y0,{})}),n.usePositions&&I&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(C0,{})}),n.usePositions&&g&&(0,i.jsx)(Xr.qh,{path:Wo.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(H2,{})}),s&&(0,i.jsx)(Xr.qh,{exact:!0,path:Nv.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(xC,{isTemplate:!0})}),r&&(0,i.jsx)(Xr.qh,{exact:!0,path:Nv.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(xC,{isTemplate:!1})}),r&&(0,i.jsx)(Xr.qh,{exact:!0,path:Nv.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(_C,{})}),a&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(TW,{})}),a&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(zW,{})}),a&&(0,i.jsx)(Xr.qh,{exact:!0,path:[iM.ACCREDITATIONS_PROFILE_CREATE({organizationId:":organizationId",eventId:":eventId",accreditationProfileCategoryId:":accreditationProfileCategoryId"}),iM.ACCREDITATIONS_PROFILE_CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(kH,{})}),a&&(0,i.jsx)(Xr.qh,{exact:!0,path:iM.ACCREDITATIONS_PROFILE_EDIT({organizationId:":organizationId",eventId:":eventId",accreditationProfileId:":accreditationProfileId"}),children:(0,i.jsx)(FH,{})}),a&&(0,i.jsx)(Xr.qh,{exact:!0,path:mo.ACCREDITATIONS_IMPORT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(PW,{})}),a&&(0,i.jsx)(Xr.qh,{exact:!0,path:iM.ACCREDITATIONS_PROFILES_IMPORT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(WH,{})}),u&&(0,i.jsx)(Xr.qh,{path:QD.EDIT_CUSTOM_DOCUMENT({organizationId:":organizationId",eventId:":eventId",customDocumentId:":customDocumentId"}),children:(0,i.jsx)(dX,{})}),l&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(eE,{})}),c&&(0,i.jsx)(Xr.qh,{exact:!0,path:lO.DELEGATIONS_SPACE_LAYOUTS_CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(GZ,{})}),c&&(0,i.jsx)(Xr.qh,{exact:!0,path:lO.DELEGATIONS_SPACE_LAYOUTS_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationsSpaceLayoutId:":delegationsSpaceLayoutId"}),children:(0,i.jsx)(qZ,{})}),l&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(tE,{})}),o&&(0,i.jsx)(Xr.qh,{exact:!0,path:vo.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(iB,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(dD,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(LD,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(MD,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(YJ,{})}),n.usePositions&&m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(n0,{})}),n.useAccreditations&&m&&e(In.Accreditation)&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(PJ,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(CD,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(WD,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(bR,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(hD,{})}),m&&(0,i.jsx)(Xr.qh,{path:Ks.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(AR,{})}),l&&(0,i.jsx)(Xr.qh,{path:Wo.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(jZ,{})}),p&&(0,i.jsx)(Xr.qh,{path:Wo.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(XF,{})}),I&&(0,i.jsx)(Xr.qh,{path:Eo.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)($0,{})}),h&&(0,i.jsx)(Xr.qh,{path:Wo.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(rR,{})}),h&&(0,i.jsx)(Xr.qh,{path:[Ev.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),Ev.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(MP,{})}),x&&(0,i.jsx)(Xr.qh,{path:Vv.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(zN,{})}),x&&(0,i.jsx)(Xr.qh,{path:Vv.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(ON,{})}),d&&(0,i.jsx)(Xr.qh,{path:av.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(HR,{})}),d&&(0,i.jsx)(Xr.qh,{path:av.UPDATE({organizationId:":organizationId",eventId:":eventId",customFieldId:":customFieldId"}),children:(0,i.jsx)(YR,{})}),f&&(0,i.jsx)(Xr.qh,{exact:!0,path:nW.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(i4,{})}),f&&(0,i.jsx)(Xr.qh,{exact:!0,path:nW.UPDATE({organizationId:":organizationId",eventId:":eventId",printTriggerId:":printTriggerId"}),children:(0,i.jsx)(s4,{})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)($M,{children:(0,i.jsx)(t8,{})})})]})},s8=()=>{const{organizationId:e,eventId:n}=ls(),{data:t,loader:s}=rs("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n name\n startAt\n endAt\n languages\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n isWeezticketSynchronized\n numberOfZplDocuments\n weezticketEventId\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:n},[Ko.UserPermissionsFragment],undefined);const{setSelectedEventId:o}=Yy(),a=Cg(),r=(t.user?.roles??[]).some(e=>e.accessLevel===rt.Organization||e.accessLevel===rt.Event);if((0,de.useEffect)(()=>(o(n),()=>{o()}),[n]),s)return s;{const e=t.event.assignmentsStats;return(0,i.jsx)(Oy,{userPermissions:t.user,children:(0,i.jsx)(Ny,{event:t.event,numberOfWaitingAccreditations:t.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:r?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:a?(0,i.jsx)(X6,{}):(0,i.jsx)(i8,{})})})}};var o8,a8,r8,d8;!function(e){e.Delegation="delegation",e.Event="event",e.Id="id",e.Name="name",e.TicketId="ticket_id"}(d8||(d8={}));const l8="custom_field_value_",c8={slug:"cf80691",valueId:61410},u8={slug:"cf80691",valueId:61409},m8=[c8,u8];function g8({slug:e,valueId:n}){return`${l8}${e}_${n}`}function h8(e){return{includeCustomDocuments:e.some(Ap)}}let p8=class extends Eh{constructor(e,n,t){super(e,n,t)}getPossibleColumns(e,n){return[{slug:d8.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:bt.Id,width:100},{slug:d8.Name,name:this.t("nom_08311"),isSortable:!0,sortAttribute:bt.Name,minWidth:280},{slug:d8.Event,name:this.t("_v_nement_22345"),minWidth:240},{slug:d8.TicketId,name:this.t("TicketId"),width:200},...this.getCustomDocumentsColumns(n),...this.getCustomFieldsValuesColumns(e),...this.customFieldsToPossibleColumns(e)]}getCustomFieldsValuesColumns(e){return m8.flatMap(({slug:n,valueId:t})=>{const i=e.find(e=>e.slug===n),s=i?.values.find(e=>e.id===t);return i&&s?[{slug:g8({slug:n,valueId:t}),name:s.value,label:i.name,customField:i,width:200}]:[]})}getCustomDocumentsColumns(e){return(0,Tg.A)(Object.entries((0,l.A)(e,e=>e.slug)).map(([e,n])=>({slug:bp(e),name:this.t("imprimer_1_75795",(0,Th.A)(n,e=>e.id).name),label:e,minWidth:240})),e=>b(e.name))}};p8=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(o8=void 0!==dh&&dh)?o8:Object,"function"==typeof(a8=void 0!==Wg&&Wg)?a8:Object,"function"==typeof(r8=void 0!==ts&&ts)?r8:Object])],p8);const I8=e=>{const{clearNameCursors:n,name:t}=ah();return(0,i.jsx)(KE,{column:e.column,customDocument:e.customDocument,eventId:e.row.event.id,reload:e.reload,search:{name:t,clearName:n},volunteerRegistration:e.row})},f8=e=>{const{params:{organizationId:n}}=fc(),{mutate:t}=rr(),{slug:s,valueId:o}=(0,de.useMemo)(()=>function(e){const n=e.substring(19),t=n.lastIndexOf("_");return{slug:n.substring(0,t),valueId:parseInt(n.substring(t+1),10)}}(e.column.slug),[e.column.slug]),[a,r]=(0,de.useState)(!1),d=(0,de.useCallback)(async()=>{r(!0);try{await t({organizationId:n,userInfoId:e.row.userInfo.id,slug:s,value:e.column.customField?.canSelectMultiple?[o]:o})}finally{r(!1),e.reload()}},[n,e.column.customField,e.row.userInfo.id,e.reload,s,t,o]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(yc,{color:"white",css:{overflow:"hidden","& .h-button-content":{overflow:"hidden"}},isLoading:a,size:"sm",onClick:d,children:(0,i.jsx)(Zr,{css:{ellipsis:!0},title:e.column.name,width:1,children:e.column.name})})})},x8=e=>{const n=ss(Nh),t=(0,de.useMemo)(()=>(e.row.positionsSlotsUsersInfos||[]).map(({positionSlot:e,position:t})=>Gh(n,e,t.name,{slot:{includeRange:!0},position:{includeNameAtEnd:!0}})).join(", "),[n,e.row.positionsSlotsUsersInfos]);return(0,i.jsx)(_g,{minWidth:e.column.minWidth,width:e.column.width,children:t})},_8=()=>Promise.resolve(),j8=e=>{const{params:{organizationId:n}}=fc();if(Ap(e.column.slug)){const n=e.column.slug.substring(16),o=(e.eventIdToCustomDocuments[e.row.event.id]??[]).filter(e=>e.slug===n);return(0,i.jsx)(I8,{column:e.column,customDocument:(t=o,s=e.row.userInfo.fields?.population,t.length>1?t.find(e=>Ep(e.populationsIds,s))??t[0]:t[0]),reload:e.reload,row:e.row})}var t,s;return e.column.slug.startsWith(l8)?(0,i.jsx)(f8,{column:e.column,reload:e.reload,row:e.row}):e.column.slug===d8.Id?(0,i.jsx)(_g,{width:e.column.width,children:e.row.userInfo.id}):e.column.slug===d8.Name?(0,i.jsx)(_g,{minWidth:e.column.minWidth,children:(0,i.jsx)(MC,{isClickDisabled:!0,userInfo:e.row.userInfo})}):e.column.slug===d8.Event?(0,i.jsx)(_g,{minWidth:e.column.minWidth,children:(0,i.jsx)(Lm,{ellipsis:!0,title:e.row.event.name,children:e.row.event.name})}):e.column.slug===d8.Delegation?(0,i.jsx)(_g,{width:e.column.width,children:e.row.delegation?.name??""}):e.column.slug===d8.TicketId?(0,i.jsx)(_g,{width:e.column.width,children:e.row.ticketId}):"position"===e.column.slug?(0,i.jsx)(x8,{column:e.column,row:e.row}):(0,i.jsx)(zE,{avatarUser:e.row.userInfo,clickPath:Ev.MEMBER_INFORMATION({organizationId:n,eventId:e.row.event.id,userInfoId:e.row.userInfo.id}),column:e.column,customField:e.customField,fields:e.row.userInfo.fields??{},mutate:_8,reload:e.reload,updatable:!1})},v8=()=>{const{translate:e,params:{organizationId:n}}=fc();fm(e("membres_11310"));const t=ss(p8),{data:s,loader:o}=rs("query OrganizationMembersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n customDocuments {\n ...OrganizationMemberCustomDocument\n }\n }\n}\n",{organizationId:n},[Ko.SegmentCustomFieldFragment,Ko.OrganizationMemberCustomDocumentFragment],undefined);const a=(0,de.useMemo)(()=>s.organization?.customFields.nodes??[],[s.organization]),r=aE(a),d=(0,de.useMemo)(()=>s.organization?.customDocuments??[],[s.organization]),c=(0,de.useMemo)(()=>t.getPossibleColumns(a,d),[a,d,t]),u=(0,de.useMemo)(()=>(0,l.A)(d,e=>e.eventId),[d]),m=(0,de.useMemo)(()=>Vy(n)?[d8.Name,"population",d8.Delegation,"cf80676",d8.TicketId,bp("badgecompletr"),"cf80691",g8(c8),g8(u8),d8.Event]:function(e){return 306===e}(n)?[d8.Name,d8.Event]:[],[n]),g=(0,de.useMemo)(()=>Vy(n)?[Op.Email,Op.Id,Op.LocalId,Op.Name,Op.WeezeventBarcodeVersion,Op.Delegations,"cf80676"]:[],[n]),[h,p,I]=sE(n,"organizationMembers.limit",jg),[f,x,_]=sE(n,"organizationMembers.sort",null),j=I||_;return(0,i.jsxs)(AC,{children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:e("membres_11310")})}),(0,i.jsx)(yC,{css:{overflowY:"auto"},children:o||j?(0,i.jsx)(_c,{}):(0,i.jsx)(nx,{columns:m,columnsSearch:g,columnsToIncludes:h8,eventId:null,filters:[],limit:h,loadDataList:ul,loadRow:cl,organizationId:n,possibleColumns:c,predicates:ch(),rendering:gp.List,setColumns:Ou.A,setLimit:p,setSort:x,showEditColumns:!1,showEditMode:!1,showFilters:!1,showMassActions:!1,showPredicatesBadges:!1,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:f,children:(0,i.jsx)(px,{renderCell:(e,n,t)=>(0,i.jsx)(j8,{column:e,customField:r.get(e.slug),eventIdToCustomDocuments:u,reload:t,row:n})})})})]})};var S8,y8;let C8=class extends ju{documentInputService;constructor(e,n){super(e),this.documentInputService=n}emailSenderInputDefault(e){return{header:e?.header??this.documentInputService.documentInputDefault(),picture:e?.picture??this.documentInputService.documentInputDefault(),footer:e?.footer??this.documentInputService.documentInputDefault(),buttonColor:e?.buttonColor??Lr.colors.primary500.value,signature:e?.signature??"",name:e?.name??"",fromEmail:e?.fromEmail??"",fromName:e?.fromName??"",replyTo:e?.replyTo??"",eventsIds:e?.eventsIds??[],isOrganizationDefault:e?.isOrganizationDefault??!1}}emailSenderInputSchema(){return Jl.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),buttonColor:Jl.Yj().matches(WS,{excludeEmptyString:!0,message:this.t("la_couleur_doit")}),signature:Jl.Yj(),name:Jl.Yj().required(this.t("le_label_est_re_86986")),fromEmail:Jl.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:Jl.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:Jl.Yj()})}createUpdateEmailSenderSchema(){return Jl.Ik().shape({emailSender:this.emailSenderInputSchema()})}};C8=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(S8=void 0!==ts&&ts)?S8:Object,"function"==typeof(y8=void 0!==Rb&&Rb)?y8:Object])],C8);const b8=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc(),{showNotification:o}=Sy(),a=ss(C8),r=(0,de.useRef)(null),[d,l]=(0,de.useState)(e.initialValues.emailSender.isOrganizationDefault||f(e.initialValues.emailSender.eventsIds)),[c,u]=(0,de.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(Fc,{customErrorRef:r,height:1,initialValues:e.initialValues,render:({handleSubmit:n,submitting:o,values:a})=>{return(0,i.jsx)(Nx,{button:e.isEdit&&(0,i.jsx)(yc,{isLoading:o,onClick:n,children:t("mettre_jour_l_14264")}),category:t("_metteur_d_e_ma_51878"),fallbackClosePath:Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s),heading:e.isEdit?(m=e.initialValues.emailSender,w(m.fromName)?`${m.fromName} (${m.fromEmail})`:m.fromEmail):t("nouvel_metteur_58381"),children:(0,i.jsxs)(kx,{ref:r,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:t("informations_su_10889"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(pu,{label:"Label",name:"emailSender.name"}),(0,i.jsx)(pu,{hint:t("les_e_mails_ser_70662"),label:t("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)(pu,{hint:t("les_e_mails_ser_62925"),isEmail:!0,label:t("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)(pu,{hint:t("cette_adresse_r_36038",a.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)($S,{children:t("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(qb,{accept:Jv.Images,acl:"public-read",hint:t("chaque_e_mail_c_30386"),label:t("en_t_te_11987"),organizationId:s,prefix:"emailSender.header."}),(0,i.jsx)(Jb,{label:t("photo_de_profil_08618"),organizationId:s,prefix:"emailSender.picture."}),(0,i.jsx)(JS,{label:t("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(qb,{accept:Jv.Images,acl:"public-read",hint:t("chaque_e_mail_c_65078"),label:t("bas_de_page_86491"),organizationId:s,prefix:"emailSender.footer."}),(0,i.jsx)(Wb,{hint:t("les_boutons_pri"),initialValue:Lr.colors.primary500.value,label:t("couleur_des_bou_24410"),name:"emailSender.buttonColor"}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zm,{state:d?"checked":"unchecked",onClick:e=>{l("checked"===e)},children:t("utiliser_cet_m_47949")}),d&&(0,i.jsxs)(Xl,{children:[(0,i.jsx)(ic,{width:"6"}),(0,i.jsxs)(lg,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:c,onChange:u,children:[(0,i.jsx)("option",{value:"community",children:t("communaut_20896")}),e.events.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]})]})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:o,textAlign:"center",onClick:n,children:e.isEdit?t("mettre_jour_l_14264"):t("cr_er_l_metteu_36451")})})]})});var m},schema:a.createUpdateEmailSenderSchema(),width:1,onSubmit:async i=>{const a={...i.emailSender,eventsIds:c.filter(e=>"community"!==e),isOrganizationDefault:c.includes("community")};await e.mutate(a),o(e.isEdit?t("l_metteur_a_t_48335"):t("l_metteur_a_t_67653")),n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))}})},A8=()=>{const{params:{organizationId:e}}=fc(),{data:n,loader:t}=Xa({organizationId:e}),s=ss(C8),{mutate:o}=function(e={}){return ds("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n id\n }\n}\n",e)}();return t||(0,i.jsx)(b8,{events:n.organization.events.nodes,initialValues:{emailSender:s.emailSenderInputDefault()},isEdit:!1,mutate:n=>o({organizationId:e,emailSender:n})})},E8=()=>{const{params:{organizationId:e,emailSenderId:n}}=fc(),t=ss(C8),{data:s,loader:o}=rs("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 buttonColor\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:n},[],undefined);const{mutate:a}=function(e={}){return ds("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)(b8,{events:s.organization.events.nodes,initialValues:{emailSender:t.emailSenderInputDefault(s.organization.emailSender)},isEdit:!0,mutate:t=>a({organizationId:e,emailSenderId:n,emailSender:t})})},w8=()=>{const{translate:e,params:{organizationId:n,emailSenderId:t}}=fc(),{data:s,loader:o}=rs("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:n,emailSenderId:t},[],undefined);const a=(0,de.useMemo)(()=>s.organization?s.organization.emailSender.from:"-",[s.organization]);return(0,i.jsx)(Nx,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),heading:a,children:o||(0,i.jsx)(Zr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(BC,{content:s.organization.emailSender.preview,from:s.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})};var $8;let T8=class extends ju{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",usersInfosIds:(e?.members??[]).map(({id:e})=>e),eventsAccesses:(e?.accesses??[]).filter(e=>e.scope===rt.Event&&e.eventId).map(e=>({eventId:e.eventId,roleId:e.roleId})),isWeezaccessSynchronized:e?.isWeezaccessSynchronized??!1}}eventAccessDefault(){return{eventId:null,roleId:null}}schema(){return Jl.Ik().shape({group:Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),description:Jl.Yj(),usersInfosIds:Jl.YO().of(Jl.ai()).required(),eventsAccesses:Jl.YO().of(Jl.Ik().shape({eventId:Jl.ai().nullable().required(this.t("vous_devez_s_le_61092")),roleId:Jl.ai().nullable().required(this.t("vous_devez_s_le_18837"))})).required(),isWeezaccessSynchronized:Jl.zM()}).required()}).required()}};T8=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof($8=void 0!==ts&&ts)?$8:Object])],T8);const z8=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc(),o=ss(T8),{organization:a}=Yy(),r=(0,de.useMemo)(()=>(0,Tg.A)(a.events.nodes,e=>b(e.name)),[a.events]),d=(0,de.useCallback)(n=>{const t=e.eventsAccesses.filter((e,t)=>t!==n&&e.eventId).map(({eventId:e})=>e);return r.filter(e=>!t.includes(e.id)).map(e=>(0,i.jsx)("option",{value:e.id,children:`${e.name} (${e.id})`},e.id))},[r,e.eventsAccesses]),l=(0,de.useMemo)(()=>(0,Tg.A)(a.roles.filter(e=>e.accessLevel===rt.Event),e=>b(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[a.roles]);return 0===l.length?(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:t("vous_n_avez_pas_57236")}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",children:t("pour_donner_acc_85410")}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(yc,{color:"white",onClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_ROLES(s))},children:t("cr_er_un_r_le_99947")})]}):(0,i.jsxs)(Xl,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.eventsAccesses.map((n,s)=>(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("acc_s_n_1_17158",s+1)}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("_v_nement_22345"),menuWidth:1042,name:`group.eventsAccesses[${s}].eventId`,renderOnPortal:!0,shouldParseAsInt:!0,children:d(s)})}),(0,i.jsx)(Zr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(pc,{icon:"arrow-right"})}),(0,i.jsx)(Zr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Kx,{label:t("r_le_59302"),name:`group.eventsAccesses[${s}].roleId`,renderOnPortal:!0,shouldParseAsInt:!0,children:l})}),(0,i.jsx)(Zr,{css:{paddingTop:"$6"},children:(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("group.eventsAccesses",y(e.eventsAccesses,s))}})})]})]},s)),(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change("group.eventsAccesses",e.eventsAccesses.concat([o.eventAccessDefault()]))},children:t("ajouter_un_v_n_49943")})})]})},O8=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o,a]=Dg(""),{usersInfosOptions:r,isLoading:d}=mC({organizationId:t,eventId:null,hasSelected:f(e.usersInfosIds),nameDebounced:o,userInfoIds:e.usersInfosIds});return(0,i.jsx)(Kx,{isSearchLoading:d,isSearchVisible:!0,label:n("s_lectionnez_le_38252"),multiple:!0,name:"group.usersInfosIds",placeholder:n("ajouter_des_mem_15816"),searchElement:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_m_05904"),state:"search",value:s,onChange:a}),children:r})},R8=e=>{const{history:n,params:{organizationId:t},translate:s}=fc(),{showNotification:o}=Sy(),{organization:a}=Yy(),r=ss(T8),d=(0,de.useRef)(null),l=(0,de.useMemo)(()=>e.isEdit?s("mise_jour_de_17055",e.initialValues.group.name):s("cr_ation_d_un_g_97053"),[e.isEdit,e.initialValues]);return fm(l),(0,i.jsx)(Fc,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:n,handleSubmit:o,submitting:r,values:c})=>(0,i.jsx)(Nx,{button:e.isEdit?(0,i.jsx)(yc,{isLoading:r,onClick:o,children:s("mettre_jour_l_46926")}):null,category:l,color:"dark",fallbackClosePath:Wo.ORGANIZATION_PARAMETERS_GROUPS(t),heading:e.isEdit?e.initialValues.group.name:s("nouveau_groupe_17697"),children:(0,i.jsxs)(kx,{ref:d,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{heading:s("informations_g_79325"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(pu,{label:s("nom_du_groupe_77088"),name:"group.name"}),(0,i.jsx)(Qx,{label:s("Description"),name:"group.description"}),a.weezeventOrganizationId&&(0,i.jsx)(Jx,{name:"group.isWeezaccessSynchronized",subtext:s("un_op_rateur_we_64020"),children:s("WeezeventIsSynchronized")})]})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:s("membres_11310"),subtitle:s("les_membres_du_17237"),children:(0,i.jsx)(O8,{usersInfosIds:c.group.usersInfosIds})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:s("acc_s_aux_v_ne_33282"),subtitle:s("chaque_membre_d_91767"),children:(0,i.jsx)(z8,{change:n.change,eventsAccesses:c.group.eventsAccesses})}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:r,onClick:o,children:(0,i.jsx)(Zr,{textAlign:"center",children:e.isEdit?s("mettre_jour_l_46926"):s("cr_er_le_groupe_43408")})})})]})}),schema:r.schema(),width:1,onSubmit:async i=>{await e.mutate({group:i.group}),o(e.isEdit?s("le_groupe_a_bie_88132"):s("le_groupe_a_bie_19289")),n.goBack(Wo.ORGANIZATION_PARAMETERS_GROUPS(t))}})},D8=()=>{const{params:{organizationId:e}}=fc(),n=ss(T8),{mutate:t}=function(e={}){return ds("mutation GroupCreate($organizationId: OrganizationId!, $group: GroupInput!) {\n groupCreate(organizationId: $organizationId, group: $group) {\n id\n }\n}\n",e)}();return(0,i.jsx)(R8,{initialValues:{group:n.default(null)},isEdit:!1,mutate:async({group:n})=>(await t({organizationId:e,group:n})).groupCreate.id})},M8=()=>{const{params:{organizationId:e,groupId:n}}=fc(),t=ss(T8),{data:s,loader:o}=rs("query Group($organizationId: OrganizationId!, $groupId: GroupId!) {\n organization(id: $organizationId) {\n group(id: $groupId) {\n id\n name\n description\n isWeezaccessSynchronized\n\n members {\n id\n }\n\n accesses {\n scope\n eventId\n roleId\n }\n }\n }\n}\n",{organizationId:e,groupId:n},[],undefined);const{mutate:a}=function(e={}){return ds("mutation GroupUpdate($organizationId: OrganizationId!, $groupId: GroupId!, $group: GroupInput!) {\n groupUpdate(organizationId: $organizationId, groupId: $groupId, group: $group) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(R8,{initialValues:{group:t.default(s.organization.group)},isEdit:!0,mutate:async({group:t})=>(await a({organizationId:e,groupId:n,group:t})).groupUpdate.id})},P8=Nr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),k8=Nr("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),F8=()=>{const{organizationId:e}=ls(),n=cs(),{mutate:t}=gl(),s=os(),o=()=>{n.push(Wo.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(V3,{onClose:o,children:(0,i.jsxs)(Xl,{align:"center",direction:"column",children:[(0,i.jsx)(uA,{color:"error",icon:"user-slash"}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(P8,{children:s("suppression_de_67160")}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:s("souhaitez_vous_30775")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(yc,{onClick:o,children:s("non_je_ne_souh_99960")}),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(k8,{onClick:async()=>{await t({}),_e()},children:s("oui_je_souhait_87268")})]})})},N8=({icon:e,children:n,onClick:t})=>(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:t,children:[(0,i.jsx)(pc,{icon:e}),(0,i.jsx)("span",{children:n})]}),L8=Nr(Xl,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),U8=Nr("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),V8=Nr(Xl,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),B8=Nr("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),W8=({organization:e,user:n})=>{const{history:t,translate:s}=fc();return(0,i.jsxs)(V8,{direction:"column",gap:"6",children:[(0,i.jsx)(B8,{children:s("profil_14444")}),(0,i.jsxs)(Xl,{align:"center",gap:"4",children:[(0,i.jsx)(F_,{email:n.email,image:n.userInfo.picture?.url,name:n.userInfo.name,size:64}),(0,i.jsx)(c6,{size:64,userInfo:{email:n.email,...n.userInfo}})]}),(0,i.jsx)(L8,{direction:"column",children:(0,i.jsxs)(Xl,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(Zr,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(yc,{onClick:()=>{t.push(Wo.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:s("changer_74000")})]})}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(U8,{children:s("profil_14444")}),(0,i.jsx)(L8,{direction:"column",children:(0,i.jsx)(N8,{icon:"user-gear",onClick:()=>{t.push(Wo.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:s("informations_pe_37892")})})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"2",children:[(0,i.jsx)(U8,{children:s("g_n_ral_64953")}),(0,i.jsxs)(L8,{direction:"column",children:[(0,i.jsx)(N8,{icon:"shield",onClick:()=>{window.open(im(em(n?.language,new URL(location.href).searchParams)),"_blank")},children:s("cgu_51460")}),(0,i.jsx)(N8,{icon:"circle-question",onClick:()=>{window.open(`https://support.${ee.WEEZEVENT_DOMAIN}/fr/weezcrew`,"_blank")},children:s("aide_et_support_49790")})]})]}),(0,i.jsxs)(L8,{direction:"column",children:[(0,i.jsx)(N8,{icon:"arrow-left-from-line",onClick:_e,children:s("se_d_connecter_74151")}),(0,i.jsx)(N8,{icon:"user-xmark",onClick:()=>{t.push(Wo.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:s("supprimer_mon_c_07051")})]})]})},G8=({organizations:e})=>{const{organizationId:n}=ls(),[t,s]=(0,de.useState)(n),o=os(),a=cs();return(0,i.jsxs)(Xl,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Xl,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(NR,{state:e.id===t?"checked":"unchecked",onClick:()=>s(e.id),children:e.name},e.id))}),(0,i.jsx)(ic,{height:7}),(0,i.jsx)(yc,{onClick:()=>{a.push(Wo.ORGANIZATION_PARAMETERS(t))},children:o("s_lectionner_l_18914")})]})},q8=Nr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),H8=()=>{const{loader:e,data:n}=ll({}),{organization:t}=Yy(),s=os(),o=cs();return(0,i.jsxs)(V3,{onClose:()=>{o.push(Wo.ORGANIZATION_PARAMETERS(t.id))},children:[(0,i.jsx)(q8,{children:s("liste_de_vos_or_87919")}),e||(0,i.jsx)(G8,{organizations:n.organizations})]})},Y8=({inputName:e})=>{const n=os(),t=zg();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)(pu,{autoComplete:"given-name",label:n("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)(pu,{autoComplete:"family-name",label:n("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(pu,{autoComplete:"email",isEmail:!0,label:n("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Qy,{autoComplete:"language",label:n("Language"),name:`${e}fields.language`,children:t(Xu)}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Kj,{label:n("Phone"),prefix:`${e}fields.phone.`})]})},Z8=Nr(Xl,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),K8=()=>{const{user:e}=Yy();return(0,i.jsx)(Z8,{align:"end",justify:"center",children:(0,i.jsx)(F_,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},X8=()=>{const{organizationId:e}=ls(),{data:n,loader:t}=lr({organizationId:e}),s=ss(MM),o=ss(ec),{user:a}=ps(),{mutate:r,isLoading:d}=cr(),l=os();return t||(0,i.jsx)(Fc,{initialValues:{userInfo:s.userInfoProfileInputDefault(n.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(K8,{}),(0,i.jsxs)(y3,{children:[(0,i.jsx)(Y8,{inputName:"userInfo."}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(yc,{isLoading:d,textAlign:"center",onClick:e,children:l("enregistrer_06519")})]})]}),validate:o.validateForForm(s.updateProfileSchema()),onSubmit:async e=>{const{userProfileUpdate:{email:t,language:i}}=await r({userId:a.id,userInfoId:n.user.userInfo.id,userInfo:e.userInfo});a.email!==t?_e():a.language!==i&&location.reload()}})},Q8=Nr("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),J8=()=>{const{organizationId:e}=ls(),n=cs(),t=os();return(0,i.jsxs)(E3,{children:[(0,i.jsx)(b3,{back:()=>{n.push(Wo.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(A3,{children:(0,i.jsx)(Q8,{children:t("informations_pe_37892")})})}),(0,i.jsx)(X8,{})]})},e7=()=>{const{organization:e,user:n}=Yy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(J8,{})}),f(e.events.nodes)&&(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(u3,{eventId:e.events.nodes[0].id,user:n,children:(0,i.jsx)(W8,{organization:e,user:n})})})]}),(0,i.jsx)(Xr.dO,{children:(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)(H8,{})})}),(0,i.jsx)(Xr.dO,{children:(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)(F8,{})})})]})};var n7,t7;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationProfileCategoryCreate="AccreditationProfileCategoryCreate",e.AccreditationProfileCategoryDelete="AccreditationProfileCategoryDelete",e.AccreditationProfileCategoryDuplicate="AccreditationProfileCategoryDuplicate",e.AccreditationProfileCategoryUpdate="AccreditationProfileCategoryUpdate",e.AccreditationProfileCreate="AccreditationProfileCreate",e.AccreditationProfileDuplicate="AccreditationProfileDuplicate",e.AccreditationProfileUpdate="AccreditationProfileUpdate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsExport="AccreditationsExport",e.AccreditationsImport="AccreditationsImport",e.AccreditationsImportResult="AccreditationsImportResult",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsProfilesExport="AccreditationsProfilesExport",e.AccreditationsProfilesImport="AccreditationsProfilesImport",e.AccreditationsProfilesImportResult="AccreditationsProfilesImportResult",e.AccreditationsProfilesMassAccreditationsEdit="AccreditationsProfilesMassAccreditationsEdit",e.AccreditationsProfilesMassDelete="AccreditationsProfilesMassDelete",e.AccreditationsProfilesMassEdit="AccreditationsProfilesMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeInvoiceMarkAsWrittenOff="BackofficeInvoiceMarkAsWrittenOff",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.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassDuplicate="CustomFieldsMassDuplicate",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.DelegationsMassAccreditationsProfilesEdit="DelegationsMassAccreditationsProfilesEdit",e.DelegationsMassAccreditationsSlotsEdit="DelegationsMassAccreditationsSlotsEdit",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassLeadersEmailSend="DelegationsMassLeadersEmailSend",e.DelegationsMassMove="DelegationsMassMove",e.DelegationsSpaceLayoutCreate="DelegationsSpaceLayoutCreate",e.DelegationsSpaceLayoutDelete="DelegationsSpaceLayoutDelete",e.DelegationsSpaceLayoutDuplicate="DelegationsSpaceLayoutDuplicate",e.DelegationsSpaceLayoutUpdate="DelegationsSpaceLayoutUpdate",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.EventSpaceDesignUpdate="EventSpaceDesignUpdate",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.GroupCreate="GroupCreate",e.GroupDelete="GroupDelete",e.GroupMemberDelete="GroupMemberDelete",e.GroupUpdate="GroupUpdate",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationCreate="OrganizationCreate",e.OrganizationDelegationSpaceSettingsUpdate="OrganizationDelegationSpaceSettingsUpdate",e.OrganizationEventsShowcaseSettingsUpdate="OrganizationEventsShowcaseSettingsUpdate",e.OrganizationInvite="OrganizationInvite",e.OrganizationInviteGroups="OrganizationInviteGroups",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.PositionsExport="PositionsExport",e.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsMassEdit="PositionsSlotsMassEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.PrintTriggerCreate="PrintTriggerCreate",e.PrintTriggerDelete="PrintTriggerDelete",e.PrintTriggerUpdate="PrintTriggerUpdate",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.SegmentFolderDuplicate="SegmentFolderDuplicate",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.UserAccessDelete="UserAccessDelete",e.UserAccessMassCreate="UserAccessMassCreate",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.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersCriblageExport="VolunteersCriblageExport",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationProfileUpdate="VolunteersRegistrationsMassAccreditationProfileUpdate",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassAvailabilitiesUpdate="VolunteersRegistrationsMassAvailabilitiesUpdate",e.VolunteersRegistrationsMassCustomDocumentPrint="VolunteersRegistrationsMassCustomDocumentPrint",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassDuplicate="VolunteersRegistrationsMassDuplicate",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassPrint="VolunteersRegistrationsMassPrint",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassTicketIdRegenerate="VolunteersRegistrationsMassTicketIdRegenerate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.VolunteersRegistrationsMassWishedProfileUpdate="VolunteersRegistrationsMassWishedProfileUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowsMassEdit="WorkflowsMassEdit",e.WorkflowsMassExecute="WorkflowsMassExecute",e.WorkflowssMassDelete="WorkflowssMassDelete"}(n7||(n7={})),function(e){e[e.AccreditationsEmailsEstimate=n7.AccreditationsEmailsEstimate]="AccreditationsEmailsEstimate",e[e.AccreditationsProfilesExport=n7.AccreditationsProfilesExport]="AccreditationsProfilesExport",e[e.AccreditationsProfilesImportResult=n7.AccreditationsProfilesImportResult]="AccreditationsProfilesImportResult",e[e.AssignmentsEmailsEstimate=n7.AssignmentsEmailsEstimate]="AssignmentsEmailsEstimate",e[e.BackofficeEventUnarchive=n7.BackofficeEventUnarchive]="BackofficeEventUnarchive",e[e.BackofficeInvoiceMarkAsPaid=n7.BackofficeInvoiceMarkAsPaid]="BackofficeInvoiceMarkAsPaid",e[e.BackofficeInvoiceMarkAsRefunded=n7.BackofficeInvoiceMarkAsRefunded]="BackofficeInvoiceMarkAsRefunded",e[e.BackofficeInvoiceMarkAsWrittenOff=n7.BackofficeInvoiceMarkAsWrittenOff]="BackofficeInvoiceMarkAsWrittenOff",e[e.BackofficeOrganizationUpdate=n7.BackofficeOrganizationUpdate]="BackofficeOrganizationUpdate",e[e.BackofficeOrganizationUserAdd=n7.BackofficeOrganizationUserAdd]="BackofficeOrganizationUserAdd",e[e.BackofficeOrganizationUserRemove=n7.BackofficeOrganizationUserRemove]="BackofficeOrganizationUserRemove",e[e.CampaignEstimate=n7.CampaignEstimate]="CampaignEstimate",e[e.DelegationsExport=n7.DelegationsExport]="DelegationsExport",e[e.DelegationsImportResult=n7.DelegationsImportResult]="DelegationsImportResult",e[e.DomainDkimVerificationRetry=n7.DomainDkimVerificationRetry]="DomainDkimVerificationRetry",e[e.EmailFormInviteSend=n7.EmailFormInviteSend]="EmailFormInviteSend",e[e.EmailResend=n7.EmailResend]="EmailResend",e[e.EmailSenderVerificationResend=n7.EmailSenderVerificationResend]="EmailSenderVerificationResend",e[e.EventDocumentsExport=n7.EventDocumentsExport]="EventDocumentsExport",e[e.EventDocumentsExportResult=n7.EventDocumentsExportResult]="EventDocumentsExportResult",e[e.EventLayerUpdate=n7.EventLayerUpdate]="EventLayerUpdate",e[e.EventProfilePrivateFieldsUpdate=n7.EventProfilePrivateFieldsUpdate]="EventProfilePrivateFieldsUpdate",e[e.EventWeezeventUpdate=n7.EventWeezeventUpdate]="EventWeezeventUpdate",e[e.ExportResult=n7.ExportResult]="ExportResult",e[e.FormRegister=n7.FormRegister]="FormRegister",e[e.LoginCodeEmailCreate=n7.LoginCodeEmailCreate]="LoginCodeEmailCreate",e[e.OrganizationProfilePrivateFieldsUpdate=n7.OrganizationProfilePrivateFieldsUpdate]="OrganizationProfilePrivateFieldsUpdate",e[e.PositionsImportResult=n7.PositionsImportResult]="PositionsImportResult",e[e.SegmentFolderMoveDown=n7.SegmentFolderMoveDown]="SegmentFolderMoveDown",e[e.SegmentFolderMoveUp=n7.SegmentFolderMoveUp]="SegmentFolderMoveUp",e[e.SegmentMoveDown=n7.SegmentMoveDown]="SegmentMoveDown",e[e.SegmentMoveUp=n7.SegmentMoveUp]="SegmentMoveUp",e[e.SegmentsFoldersReorder=n7.SegmentsFoldersReorder]="SegmentsFoldersReorder",e[e.SkidataConnectionInfoSeaonEventAdd=n7.SkidataConnectionInfoSeaonEventAdd]="SkidataConnectionInfoSeaonEventAdd",e[e.SkidataConnectionInfoSeaonEventDelete=n7.SkidataConnectionInfoSeaonEventDelete]="SkidataConnectionInfoSeaonEventDelete",e[e.SkidataConnectionInfoSynchronizedEventAdd=n7.SkidataConnectionInfoSynchronizedEventAdd]="SkidataConnectionInfoSynchronizedEventAdd",e[e.SkidataConnectionInfoSynchronizedEventDelete=n7.SkidataConnectionInfoSynchronizedEventDelete]="SkidataConnectionInfoSynchronizedEventDelete",e[e.SkidataSynchronize=n7.SkidataSynchronize]="SkidataSynchronize",e[e.TextMessageRepliesRead=n7.TextMessageRepliesRead]="TextMessageRepliesRead",e[e.TranslationUpdate=n7.TranslationUpdate]="TranslationUpdate",e[e.UserCreate=n7.UserCreate]="UserCreate",e[e.UserDelete=n7.UserDelete]="UserDelete",e[e.UserInfoAdminDelete=n7.UserInfoAdminDelete]="UserInfoAdminDelete",e[e.UserInfoAndTermsUpdate=n7.UserInfoAndTermsUpdate]="UserInfoAndTermsUpdate",e[e.UserProfileUpdate=n7.UserProfileUpdate]="UserProfileUpdate",e[e.UsersInfosExport=n7.UsersInfosExport]="UsersInfosExport",e[e.UsersInfosMassDelegationDelete=n7.UsersInfosMassDelegationDelete]="UsersInfosMassDelegationDelete",e[e.VolunteersCriblageExport=n7.VolunteersCriblageExport]="VolunteersCriblageExport",e[e.VolunteersExport=n7.VolunteersExport]="VolunteersExport",e[e.VolunteersImportResult=n7.VolunteersImportResult]="VolunteersImportResult"}(t7||(t7={}));const i7=e=>{const n=ss(Wg);return(0,i.jsxs)(Eg,{children:[(0,i.jsxs)(_g,{align:"center",gap:"3",children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(pc,{icon:e.activity.icon})}),(0,i.jsx)(Zr,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)(_g,{children:n.toLocaleString(e.activity.date.toLocal(),da.DateTime)})]})},s7=()=>{const{translate:e,params:{organizationId:n}}=fc(),[t,s]=(0,de.useState)([]),[o,a]=(0,de.useState)([]),[r,d]=(0,de.useState)(Jo.c9.invalid("Invalid")),[l,c]=(0,de.useState)(0),{data:u,isLoading:m}=rs("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:n,operations:t,eventsIds:o,date:r,offset:l},[],undefined);const{numberOfPages:g,totalCount:h}=Jf(u.organization?.activities),p=(0,de.useMemo)(()=>{const n=Object.keys(t7);return Object.keys(n7).filter(e=>!n.includes(e)).map(n=>(0,i.jsx)("option",{value:n,children:e(n)},n))},[]);return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(yC,{children:(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:t,onChange:s,children:p})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:e("_v_nement_22345"),values:o,onChange:a,children:(u.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Zr,{width:200,children:(0,i.jsx)(df,{value:r,onChange:d})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("Description")}),(0,i.jsx)(Mg,{children:e("Date")})]}),numberOfPages:g,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):u.organization.activities.nodes.map((e,n)=>(0,i.jsx)(i7,{activity:e},n)),setOffset:c,totalCount:h})})]})},o7=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>{s(!0)},children:n("renommer_42135")}),(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{a(!0)},children:n("supprimer_43083")})]}),t&&(0,i.jsx)(hW,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(fH,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{a(!1)},onSuccess:e.reload})]})},a7=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationParamEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(-1),[l,c]=(0,de.useState)(0),{data:u,isLoading:m,reload:g}=rs("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:n,name:w(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[],undefined);const{numberOfPages:h,totalCount:p}=Jf(u.organization?.accreditationsCategories),I=(0,de.useMemo)(()=>(0,Tg.A)(u.organization?.events.nodes??[],e=>b(e.name)),[u.organization]),x=(0,de.useMemo)(()=>Object.fromEntries(I.map(e=>[e.id,e.name])),[I]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{f(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Mg,{children:e("_v_nement_22345")}),(0,i.jsx)(Mg,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:h,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):u.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:mo.ACCREDITATION_CATEGORY({organizationId:n,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)(_g,{children:x[e.eventId]??""}),(0,i.jsx)(_g,{children:e.numberOfAccreditations}),t&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsx)(o7,{accreditationCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:p})},r7=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>s(!0),children:n("renommer_42135")}),(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>a(!0),children:n("supprimer_43083")})]}),t&&(0,i.jsx)(DH,{accreditationProfileCategory:e.accreditationProfileCategory,eventId:e.accreditationProfileCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(yY,{accreditationProfileCategory:e.accreditationProfileCategory,eventId:e.accreditationProfileCategory.eventId,onClose:()=>a(!1),onSuccess:e.reload})]})},d7=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationParamEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(-1),[l,c]=(0,de.useState)(0),{data:u,isLoading:m,reload:g}=rs("query OrganizationCategoriesAccreditationsProfiles(\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 accreditationsProfilesCategories(\n name: $name\n eventId: $eventId\n offset: $offset\n limit: 25\n ) {\n nodes {\n id\n eventId\n name\n numberOfAccreditationsProfiles\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,name:w(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[],undefined);const{numberOfPages:h,totalCount:p}=Jf(u.organization?.accreditationsProfilesCategories),I=(0,de.useMemo)(()=>(0,Tg.A)(u.organization?.events.nodes??[],e=>b(e.name)),[u.organization]),x=(0,de.useMemo)(()=>Object.fromEntries(I.map(e=>[e.id,e.name])),[I]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{f(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Mg,{children:e("_v_nement_22345")}),(0,i.jsx)(Mg,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:h,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):u.organization.accreditationsProfilesCategories.nodes.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.name}),(0,i.jsx)(_g,{children:x[e.eventId]??""}),(0,i.jsx)(_g,{children:e.numberOfAccreditationsProfiles}),t&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsx)(r7,{accreditationProfileCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:p})},l7=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(f$,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_50954")],text:n("suppression_de_73669",e.customFieldCategory.name),onClose:e.onClose,onDelete:async()=>{await t({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id}),e.onSuccess()}})},c7=e=>{const{mutate:n}=function(e={}){return ds("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)(UA,{initialName:e.customFieldCategory.name,isEdit:!0,mutate:async t=>(await n({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id,customFieldCategory:{name:t}})).customFieldCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},u7=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>{s(!0)},children:n("renommer_42135")}),(0,i.jsx)(Em,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{a(!0)},children:n("supprimer_43083")})]}),t&&(0,i.jsx)(c7,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(l7,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e.reload})]})},m7=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationParamEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(0),{data:l,isLoading:c,reload:u}=rs("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:n,name:w(o)?o:void 0,offset:r},[],undefined);const{numberOfPages:m,totalCount:g}=Jf(l.organization?.customFieldsCategories);return(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Mg,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:m,offset:r,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):l.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.name}),(0,i.jsx)(_g,{children:e.numberOfCustomFields}),t&&(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsx)(u7,{customFieldCategory:e,organizationId:n,reload:u})})]},e.id)),setOffset:d,title:e("liste_des_cat_g_39450"),totalCount:g})},g7=e=>{const{history:n,translate:t}=fc(),[s,o]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>n.push(vo.DELEGATION_CATEGORY_UPDATE({organizationId:e.delegationCategory.organizationId,eventId:e.delegationCategory.eventId?e.delegationCategory.eventId:void 0,delegationCategoryId:e.delegationCategory.id})),children:t("renommer_42135")}),(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>o(!0),children:t("supprimer_43083")})]}),s&&(0,i.jsx)(WO,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{o(!1)},onSuccess:e.reload})]})},h7=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationParamEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(-1),[l,c]=(0,de.useState)(0),{data:u,isLoading:m,reload:g}=rs("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:n,name:w(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[],undefined);const{numberOfPages:h,totalCount:p}=Jf(u.organization?.delegationsCategories),I=(0,de.useMemo)(()=>(0,Tg.A)(u.organization?.events.nodes??[],e=>b(e.name)),[u.organization]),x=(0,de.useMemo)(()=>Object.fromEntries(I.map(e=>[e.id,e.name])),[I]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{f(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Mg,{children:e("_v_nement_22345")}),(0,i.jsx)(Mg,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:h,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):u.organization.delegationsCategories.nodes.map(s=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:vo.DELEGATION_CATEGORY({organizationId:n,eventId:s.eventId,delegationCategoryId:s.id}),children:s.name})}),(0,i.jsx)(_g,{children:s.eventId?x[s.eventId]??"":e("communaut_20896")}),(0,i.jsx)(_g,{children:s.numberOfDelegations}),t&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsx)(g7,{delegationCategory:s,reload:g})})]},s.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:p})},p7=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>{s(!0)},children:n("renommer_42135")}),(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{a(!0)},children:n("supprimer_43083")})]}),t&&(0,i.jsx)(I0,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(U2,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{a(!1)},onSuccess:e.reload})]})},I7=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationParamEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(-1),[l,c]=(0,de.useState)(0),{data:u,isLoading:m,reload:g}=rs("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:n,name:w(o)?o:void 0,eventId:-1!==r?r:void 0,offset:l},[],undefined);const{numberOfPages:h,totalCount:p}=Jf(u.organization?.positionsCategories),I=(0,de.useMemo)(()=>(0,Tg.A)(u.organization?.events.nodes??[],e=>b(e.name)),[u.organization]),x=(0,de.useMemo)(()=>Object.fromEntries(I.map(e=>[e.id,e.name])),[I]);return(0,i.jsx)($g,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{width:200,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:300,values:[r],onChange:e=>{f(e)&&d(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:a})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Mg,{children:e("_v_nement_22345")}),(0,i.jsx)(Mg,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:h,offset:l,rows:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):u.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Ug,{to:Eo.POSITION_CATEGORY({organizationId:n,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)(_g,{children:x[e.eventId]??""}),(0,i.jsx)(_g,{children:e.numberOfPositions}),t&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsx)(p7,{positionCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:p})},f7=()=>{const{translate:e,params:{organizationId:n}}=fc();return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(bC,{css:{padding:"$6 $7 0 $7"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)($c,{children:e("cat_gories_24533")}),(0,i.jsxs)(wC,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(n),children:e("champs_de_formu_64126")}),(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(n),children:e("missions_63972")}),(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(n),children:e("accr_ditations_39450")}),(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES(n),children:e("profils_d_accr_27825")}),(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(n),children:e("d_l_gations_78318")})]})]})}),(0,i.jsx)(yC,{children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(m7,{})}),(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(I7,{})}),(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(a7,{})}),(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS_PROFILES(":organizationId"),children:(0,i.jsx)(d7,{})}),(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(h7,{})})]})})]})},x7=e=>{const{params:{organizationId:n},translate:t}=fc(),s=Sx(n,e.linkPath),o=VI();return(0,i.jsxs)(Xl,{direction:o?void 0:"column",align:"start",gap:"6",children:[(0,i.jsx)(Lx,{heading:t("DelegationSpaceLink"),children:(0,i.jsx)(jR,{heading:t("lien_de_l_espac_85081"),link:s,qrCodeDescription:t("facilitez_la_co_59826")})}),(0,i.jsx)(Lx,{heading:t("iframe_27513"),children:(0,i.jsx)(_R,{alert:e.alert,heading:e.iframeLabel,iframeLabel:e.iframeLabel,link:s})})]})},_7=()=>{const{params:{organizationId:e},translate:n}=fc(),[t,s]=(0,de.useState)(ln.Code);return(0,i.jsx)(Lx,{children:(0,i.jsx)(Xl,{direction:"column",children:(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)($c,{children:n("liste_des_e_mai_73508")}),(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(lD,{isSelected:t===ln.Code,subtitle:n("cet_e_mail_est_80490"),title:n("code_20843"),onClick:()=>s(ln.Code)})]})]}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Xl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(gD,{emailType:t,eventId:null,formId:null,organizationId:e,source:On.DelegationsSpace})})]})})})},j7=e=>{const n=os(),t="badge"===e.type?e.badge:e.customDocument.slug,s=ss(Wg);return(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Xl,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(pc,{icon:"file-lines"})}),(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(wc,{textStyle:"heading",children:"badge"===e.type?fj(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),"customDocument"===e.type&&(0,i.jsx)(wc,{textStyle:"subtitle",children:n("ajout_par_1_48224",e.customDocument.createdBy.name,s.toLocaleString(e.customDocument.insertedAt.toLocal(),da.DateTime))})]}),(0,i.jsx)(oI,{value:e.delegationsSpaceCustomBadges.includes(t),onChange:n=>{e.change("delegationsSpaceCustomBadges",j(e.delegationsSpaceCustomBadges,t,n))},children:n("document_t_l_ch_56704")})]})},v7=()=>{const{params:{organizationId:e},translate:n}=fc(),{data:t,loader:s}=rs("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customBadges\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n customDocuments {\n id\n slug\n name\n insertedAt\n\n event {\n id\n name\n }\n\n createdBy {\n ...CreatedBy\n }\n }\n }\n}\n",{organizationId:e},[Ko.CreatedByFragment],undefined);const{mutate:o}=function(e={}){return ds("mutation OrganizationDelegationSpaceSettingsUpdate(\n $organizationId: OrganizationId!\n $delegationSpaceSettings: DelegationSpaceSettingsInput!\n) {\n organizationDelegationSpaceSettingsUpdate(\n organizationId: $organizationId\n delegationSpaceSettings: $delegationSpaceSettings\n ) {\n id\n }\n}\n",e)}(),a=(0,de.useMemo)(()=>(0,Tg.A)(t.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[t.organization]);return s||(0,i.jsx)(Fc,{direction:"column",initialValues:{allowDelegationSpaceDownload:t.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:t.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:s,submitting:o,values:r})=>(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{isLoading:o,onClick:s,children:n("enregistrer_06519")})}),heading:n("Documents"),subtitle:n("personnaliser_l_64606"),children:[(0,i.jsx)(FA,{heading:n("allow_documents_96106"),children:(0,i.jsx)(Jx,{name:"allowDelegationSpaceDownload",children:n("allow_delegatio_08622")})}),r.allowDelegationSpaceDownload&&(0,i.jsx)(FA,{heading:n("documents_dispo_46996"),children:(0,i.jsxs)(Xl,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[t.organization.customBadges.map(n=>(0,i.jsx)(j7,{badge:n,change:e.change,delegationsSpaceCustomBadges:r.delegationsSpaceCustomBadges,type:"badge"},n)),a.map(n=>(0,i.jsx)(j7,{change:e.change,customDocument:n,delegationsSpaceCustomBadges:r.delegationsSpaceCustomBadges,type:"customDocument"},n.id))]})})]}),onSubmit:async n=>{await o({organizationId:e,delegationSpaceSettings:n})}})},S7=()=>{const{params:{organizationId:e},translate:n}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bC,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)($c,{children:n("espace_d_l_gati_59251")}),(0,i.jsxs)(wC,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:e}),children:n("design_15043")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:e}),children:n("int_gration_10662")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:e}),children:n("mod_les_e_mail_91257")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:e}),children:n("param_tres_78420")})]})]})}),(0,i.jsx)(yC,{css:{overflowY:"auto"},children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(Q4,{})}),(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(x7,{alert:(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("comment_marche_79958")}),(0,i.jsx)(Oc,{children:n("ce_code_va_vous_19546")})]}),iframeLabel:n("code_html_pour_86852"),linkPath:ys(Os.ORGANIZATION_DELEGATIONS({organizationId:e}))})}),(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(_7,{})}),(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(v7,{})})]})})]})},y7=e=>{const n=os(),{isLoading:t,copy:s}=ay(),{isLoading:o,copy:a}=ay();return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{width:20,children:t?(0,i.jsx)(pc,{icon:"loader"}):(0,i.jsx)(pc,{icon:"copy",onClick:()=>s(e.name)})})}),(0,i.jsx)(ux,{placement:"top",children:n("copier_75889")})]}),e.name]})}),(0,i.jsx)(_g,{width:100,children:e.type}),(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{width:20,children:o?(0,i.jsx)(pc,{icon:"loader"}):(0,i.jsx)(pc,{icon:"copy",onClick:()=>a(e.value)})})}),(0,i.jsx)(ux,{placement:"top",children:n("copier_75889")})]}),e.value]})})]})},C7=e=>{const n=os(),{mutate:t,isLoading:s}=function(e={}){return ds("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)($g,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===tn.Failed&&(0,i.jsx)(yc,{color:"white",isLoading:s,leftIcon:"arrows-rotate",size:"sm",onClick:async()=>{await t({organizationId:e.organizationId,domain:e.domain.name}),e.reload()},children:n("r_essayer_43543")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("nom_08311")}),(0,i.jsx)(Mg,{width:100,children:n("type_35427")}),(0,i.jsx)(Mg,{children:n("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,n)=>(0,i.jsx)(y7,{name:e.name,type:e.type,value:e.value},n)),(0,i.jsx)(y7,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:Ou.A,title:(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:n("liste_des_entr_35559",e.domain.name)}),e.domain.status===tn.Success&&(0,i.jsx)(Lm,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:n("vos_entr_es_dns_05106")}),e.domain.status===tn.Pending&&(0,i.jsx)(Lm,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:n("vos_entr_es_dns_31271")}),e.domain.status===tn.Failed&&(0,i.jsx)(Lm,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("la_v_rification_65771")})]}),totalCount:0})},b7=`https://support.${ee.WEEZEVENT_DOMAIN}/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur`,A7=e=>{const{history:n,translate:t}=fc(),{data:s,loader:o,reload:a}=rs("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},[],undefined);return o||(0,i.jsx)(i.Fragment,{children:0===s.organization.domains.length?(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{height:250,width:1,children:(0,i.jsx)(Jw,{imageSrc:Zu.DnsBlank,subtitle:t("pour_avoir_acc_02742"),title:t("les_entr_es_dns_52899")})}),(0,i.jsxs)(Xl,{gap:"3",justify:"center",children:[(0,i.jsx)(yc,{color:"white",onClick:()=>{open(b7)},children:t("lire_la_documen_25597")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:t("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Tc,{alertStyle:"gray",children:(0,i.jsx)(Oc,{children:t("les_entr_es_dns_55177")})}),s.organization.domains.map((n,t)=>(0,i.jsxs)(de.Fragment,{children:[(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(C7,{domain:n,organizationId:e.organizationId,reload:a})]},t))]})})},E7=e=>{const{history:n,translate:t}=fc(),{mutate:s}=function(e={}){return ds("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:o}=function(e={}){return ds("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return ds("mutation EmailSenderVerificationResend(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n) {\n emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[r,d]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{align:"center",gap:"2",children:[(0,i.jsx)(Zr,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Lm,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("e_mail_non_conf_40343")})]}),(0,i.jsx)(Zr,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{color:"white",onClick:()=>{n.push(Wo.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:t("_diter_62574")})}),(0,i.jsx)(yc,{color:"white",onClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:t("aper_u_25595")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(ym,{children:[(0,i.jsx)($m,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(wm,{placement:"bottom-end",children:[(0,i.jsxs)(v$,{children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Em,{icon:"paper-plane",onClick:async()=>{await a({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:t("r_envoyer_l_e_91472")}),(0,i.jsx)(Em,{icon:"clone",onClick:async()=>{await s({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:t("dupliquer_28256")})]}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:t("supprimer_43083")})})]})]})})]}),r&&(0,i.jsx)(f$,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_90786"),text:t("suppression_de_73669",e.emailSender.from),onClose:()=>{d(!1)},onDelete:async()=>{await o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()}})]})},w7=e=>{const n=os();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{font:"gray900 textLg medium",children:n("liste_des_mett_28960")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Xl,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2","& > div:not(:last-child)":{borderBottom:"1px solid $gray200"}},direction:"column",children:e.emailsSenders.map(n=>(0,i.jsx)(E7,{emailSender:n,organizationId:e.organizationId,reload:e.reload},n.id))})]})},$7=e=>{const{history:n,translate:t}=fc(),{data:s,loader:o,reload:a}=rs("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},[],undefined);const[r,d]=(0,de.useState)(null),l=(0,de.useMemo)(()=>(s.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[s.organization]);return(0,de.useEffect)(()=>{!o&&f(s.organization.emailsSenders)&&null===r&&d(s.organization.emailsSenders[0].id)},[o,r,s.organization?.emailsSenders,d]),o||(0===s.organization.emailsSenders.length?(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{height:250,width:1,children:(0,i.jsx)(Jw,{subtitle:t("cr_er_des_mett_38995"),title:t("aucun_metteur_96777")})}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Xl,{justify:"center",children:(0,i.jsx)(yc,{onClick:()=>{n.push(Wo.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:t("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[f(l)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Tc,{alertStyle:"error",children:[(0,i.jsx)(zc,{children:t("veuillez_confir_10865")}),(0,i.jsx)(Oc,{children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:l.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})})]}),(0,i.jsx)(ic,{height:"7"})]}),(0,i.jsx)(w7,{emailsSenders:s.organization.emailsSenders,organizationId:e.organizationId,reload:a})]}))},T7=()=>{const{history:e,translate:n,params:{organizationId:t}}=fc(),s=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(bC,{css:{padding:"$6 $7 0 $7"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Xl,{align:"center",gap:"6",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)($c,{children:n("e_mails_09850")}),(0,i.jsx)(Zr,{color:"gray500",children:n("param_trer_les_39470")})]}),s&&(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{e.push(Wo.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t))},children:n("cr_er_une_nouve_77052")})})]}),(0,i.jsxs)(wC,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),children:n("_metteurs_74545")}),(0,i.jsx)(EC,{path:Wo.ORGANIZATION_PARAMETERS_EMAILS_DNS(t),children:n("entr_es_dns_11256")})]})]})}),(0,i.jsx)(yC,{children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),children:(0,i.jsx)($7,{organizationId:t})}),(0,i.jsx)($C,{path:Wo.ORGANIZATION_PARAMETERS_EMAILS_DNS(t),children:(0,i.jsx)(A7,{organizationId:t})})]})})]})};var z7;let O7=class extends ju{constructor(e){super(e)}settingsDesignInputSchema(){return Jl.Ik().shape({title:Jl.Yj().required(),intro:Jl.Yj()})}settingsInputSchema(){return Jl.Ik().shape({events:Jl.YO().of(Jl.Ik().shape({buttonText:Jl.Yj().required(),descriptionText:Jl.Yj().max(70,this.t("the_maximum_len_30779",70)),eventId:Jl.ai().required(),formId:Jl.ai().nullable()}))})}};O7=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(z7=void 0!==ts&&ts)?z7:Object])],O7);const R7=()=>{const{translate:e}=fc();return(0,i.jsx)(Wv,{heading:e("contenu_persona_18596"),subtitle:e("personnaliser_l_09507"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(pu,{label:e("titre_de_l_intr_54141"),name:"settings.title"}),(0,i.jsx)(pu,{label:e("contenu_29668"),name:"settings.intro"})]})})},D7=()=>{const{params:{organizationId:e},translate:n}=fc(),{data:t,loader:s}=Fd({organizationId:e,includeIntro:!0,spaceType:mt.EventsShowcase}),{mutate:o}=ml(),a=ss(ec),r=ss($D),d=ss(O7);return s||(0,i.jsx)(Fc,{direction:"column",initialValues:{design:r.designInputDefault(t.organization.spaceDesign),settings:{title:t.organization.eventsShowcaseSettings.title??n("liste_des_v_ne_29929"),intro:t.organization.eventsShowcaseSettings.intro??n("visualiser_tous_33187")}},render:({form:e,handleSubmit:t,submitting:s})=>(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{isLoading:s,onClick:t,children:n("enregistrer_06519")}),(0,i.jsx)(yc,{color:"white",disabled:s,onClick:()=>{e.batch(()=>{e.change("design",r.designInputDefault(null)),e.change("settings",{title:n("liste_des_v_ne_29929"),intro:n("visualiser_tous_33187")})})},children:n("r_initialiser_77538")})]})}),heading:n("design_15043"),hideHeader:!0,children:[(0,i.jsx)(R7,{}),(0,i.jsx)(OD,{heading:n("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(zD,{})]}),validate:a.validateForForm(d.settingsInputSchema()),onSubmit:async n=>await o({organizationId:e,settings:n.settings,spaceDesign:n.design,spaceType:mt.EventsShowcase})})},M7=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M1,{heading:(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)($c,{id:e.labelId,children:e.heading}),e.subtitle&&(0,i.jsx)(wc,{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)(P1,{id:e.descId,children:e.children}),(0,i.jsx)(k1,{handleSubmit:()=>{e.setValue(),e.setIsOpen(!1)},isSubmitDisabled:e.isSubmitDisabled,setIsOpen:e.setIsOpen,submitStyle:e.submitStyle,submitText:e.submitText})]}),P7=({role:e,setShowModal:n,showModal:t,...s})=>{const[o,a]=(0,de.useState)(!1),r=Vc();return(0,de.useEffect)(()=>(a(!(!t||o)),()=>{a(!1)}),[t]),(0,i.jsx)(D1,{descId:r.descId,isOpen:o,labelId:r.labelId,role:e,setIsOpen:a,size:"md",onClose:()=>{n(null)},children:(0,i.jsx)(M7,{descId:r.descId,labelId:r.labelId,setIsOpen:a,...s,children:s.children})})},k7=e=>{const{params:{organizationId:n},translate:t}=fc(),{data:s,loader:o}=rs("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:n,eventId:e.eventId},[],undefined);return o||(f(s.organization.forms.nodes)?(0,i.jsxs)(nf,{label:t("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:t("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)(Jw,{imageSrc:Zu.WeezeventBlankPerson,title:t("you_have_no_for_84347")}))},F7=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(!!e.linkedFormId);return(0,de.useEffect)(()=>{!t&&e.linkedFormId&&e.setLinkedFormId(null)},[t,e.linkedFormId]),(0,i.jsxs)(Xl,{css:{bd:!0,borderRadius:"$1",backgroundColor:"$gray50",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)($c,{textStyle:"smallcapsheading",children:n("personnalisatio_98369")}),(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(hu,{hint:n("character_limit_93641",e.descriptionText.length,70),label:n("short_descripti_92906"),value:e.descriptionText,onChange:e.setDescriptionText}),(0,i.jsx)(hu,{label:n("personnalisatio_58948"),value:e.buttonText,onChange:e.setButtonText}),(0,i.jsx)(oI,{value:t,onChange:s,children:(0,i.jsx)(Zr,{children:n("l_v_nement_est_24339")})}),t&&(0,i.jsx)(k7,{eventId:e.eventId,formId:e.linkedFormId,setFormId:e.setLinkedFormId})]})]})},N7=e=>{const{params:{organizationId:n},translate:t}=fc(),[s,o]=(0,de.useState)(void 0),[a,r]=(0,de.useState)(t("s_inscrire_20304")),[d,l]=(0,de.useState)(""),[c,u]=(0,de.useState)(null),{data:m,loader:g}=rs("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:n,existingEventIds:e.eventIds},[],undefined);return(0,i.jsx)(P7,{heading:t("nouvel_v_nemen_99684"),isSubmitDisabled:!s,leftIcon:"building",leftIconBorder:"gray200",leftIconColor:"gray800",setShowModal:e.setShowModal,setValue:()=>e.setValue({buttonText:a,descriptionText:d,eventId:s,formId:c}),showModal:e.showModal,submitText:t("ajouter_97327"),subtitle:t("ajouter_et_pers_06084"),children:e.eventIds&&g||(f(m.organization.events.nodes)?(0,i.jsxs)(Xl,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsxs)(nf,{label:t("quel_v_nement_57240"),shouldParseAsInt:!0,value:s??-1,onChange:o,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:t("s_lectionner_un_57793")}),m.organization.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),s&&(0,i.jsx)(F7,{buttonText:a,descriptionText:d,eventId:s,linkedFormId:c,setButtonText:r,setDescriptionText:l,setLinkedFormId:u})]}):(0,i.jsx)(Jw,{imageSrc:Zu.WeezeventBlankPerson,title:t("you_have_no_oth_58056")}))})},L7=e=>(0,i.jsx)(P7,{...e,leftIcon:"trash-can",leftIconBorder:"gray200",leftIconColor:"gray800",role:"alertdialog",submitStyle:"error"}),U7=e=>{const{translate:n}=fc(),[t,s]=(0,de.useState)(e.event.buttonText),[o,a]=(0,de.useState)(e.event.descriptionText??""),[r,d]=(0,de.useState)(e.event.formId??null);return(0,i.jsx)(P7,{heading:n("mettre_jour_l_28846"),leftIcon:"building",leftIconBorder:"gray800",leftIconColor:"gray200",setShowModal:e.setShowModal,setValue:()=>e.setValue({buttonText:t,descriptionText:o,eventId:e.event.eventId,formId:r}),showModal:e.showModal,submitText:n("ajouter_97327"),subtitle:n("personalise_the_05652"),children:(0,i.jsx)(Xl,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:(0,i.jsx)(F7,{buttonText:t,descriptionText:o,eventId:e.event.eventId,linkedFormId:r,setButtonText:s,setDescriptionText:a,setLinkedFormId:d})})})},V7=e=>{const{translate:n}=fc(),{setNodeRef:t,style:s,handleProps:o}=pI(e.showcaseEvent.eventId),[a,r]=(0,de.useState)(null),[d,l]=(0,de.useState)(null),c=(0,de.useMemo)(()=>e.events?.find(n=>n.id===e.showcaseEvent.eventId)?.name??"",[e.showcaseEvent,e.events]),u=(0,de.useMemo)(()=>e.forms?.find(n=>n.id===e.showcaseEvent.formId)?.name??"",[e.showcaseEvent,e.forms]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{ref:t,align:"center",css:{padding:"$4 $6",borderBlockStart:"1px solid $gray200"},gap:"4",style:s,children:[(0,i.jsx)(Zr,{color:"gray300",css:{cursor:"pointer"},...o,children:(0,i.jsx)(pc,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Xl,{direction:"column",gap:"1",children:[(0,i.jsxs)(Xl,{css:{alignItems:"center"},gap:"2",children:[(0,i.jsx)(wc,{textStyle:"subheading",children:c}),e.showcaseEvent.formId&&(0,i.jsx)(Lm,{leftIcon:"pen",children:n("linked_to_form_64790",u)})]}),w(e.showcaseEvent.descriptionText)&&(0,i.jsx)(wc,{css:{color:"$gray500"},children:e.showcaseEvent.descriptionText})]}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsxs)(Xl,{gap:"2",children:[(0,i.jsx)(yc,{color:"white",leftIcon:"pen-line",onClick:()=>l(e.showcaseEvent.eventId)}),(0,i.jsx)(yc,{color:"white",leftIcon:"trash-can",onClick:()=>r(e.showcaseEvent.eventId)})]})]}),a&&a===e.showcaseEvent.eventId&&(0,i.jsx)(L7,{heading:n("vous_tes_sur_l_04795"),setShowModal:r,setValue:()=>{e.form.change("events",y(e.values.events,e.values.events.findIndex(n=>n.eventId===e.showcaseEvent.eventId)))},showModal:!!a,submitText:n("oui_supprimer_57212"),subtitle:n("la_suppression_96669"),children:(0,i.jsx)(wc,{children:n("vous_tes_sur_l_80749",c)})}),d&&d===e.showcaseEvent.eventId&&(0,i.jsx)(U7,{event:e.showcaseEvent,setShowModal:l,setValue:n=>{e.form.change("events",e.values.events.map(t=>t.eventId===e.showcaseEvent.eventId?n:t))},showModal:!!d})]})},B7=e=>{const{translate:n}=fc(),t=(0,de.useCallback)((n,t)=>{e.form.change("events",S(e.values.events,n,t))},[e.values.events,e.form]);return(0,i.jsx)(yI,{ids:(e.values.events??[]).map(e=>e.eventId),onReorder:t,children:(0,i.jsx)(Xl,{css:{bd:!0,"& > div:first-child":{borderBlockStart:"none !important"}},direction:"column",children:f(e.values.events)?e.values.events.map(n=>(0,i.jsx)(V7,{showcaseEvent:n,...e},n.eventId)):(0,i.jsx)(Zr,{css:{padding:"$4"},children:(0,i.jsx)(Jw,{title:n("no_events_selec_80121")})})})})},W7=()=>{const{params:{organizationId:e},translate:n}=fc(),[t,s]=(0,de.useState)(!1),{data:o,loader:a}=rs("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 intro\n events {\n eventId\n descriptionText\n buttonText\n formId\n }\n }\n }\n}\n",{organizationId:e},[],undefined);const{mutate:r}=function(e={}){return ds("mutation OrganizationEventsShowcaseSettingsUpdate(\n $organizationId: OrganizationId!\n $eventsShowcaseSettings: EventsShowcaseSettingsInput!\n) {\n organizationEventsShowcaseSettingsUpdate(\n organizationId: $organizationId\n eventsShowcaseSettings: $eventsShowcaseSettings\n ) {\n id\n }\n}\n",e)}(),d=ss(ec),l=ss(O7);return a||(0,i.jsx)(Fc,{direction:"column",initialValues:{events:o.organization.eventsShowcaseSettings.events??[]},mutators:{setValue:([e,n],t,{changeValue:i})=>i(t,e,()=>n)},render:({form:e,handleSubmit:a,submitting:r,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{isLoading:r,onClick:a,children:n("enregistrer_06519")})}),gap:"7",headerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{onClick:()=>s(!0),children:n("ajouter_un_v_n_49943")})}),heading:n("difusion_des_v_78418"),subtitle:n("personnaliser_l_19452"),children:(0,i.jsx)(Xl,{direction:"column",gap:"6",children:(0,i.jsx)(B7,{events:o.organization.events.nodes,form:e,forms:o.organization.forms.nodes,values:d})})}),t&&(0,i.jsx)(N7,{eventIds:d.events.map(e=>e.eventId),setShowModal:s,setValue:n=>{e.change("events",[...d.events,n])},showModal:t})]}),validate:d.validateForForm(l.settingsInputSchema()),onSubmit:async n=>{await r({organizationId:e,eventsShowcaseSettings:n})}})},G7=()=>{const{translate:e,params:{organizationId:n}}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bC,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)($c,{children:e("site_vitrine_17673")}),(0,i.jsxs)(wC,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:n}),children:e("design_15043")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:n}),children:e("int_gration_10662")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:n}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(yC,{css:{overflowY:"auto"},children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(D7,{})}),(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(x7,{alert:(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:e("comment_marche_91826")}),(0,i.jsx)(Oc,{children:e("ce_code_va_vous_11261")})]}),iframeLabel:e("code_html_pour_31742"),linkPath:eo.EVENTS({organizationId:n})})}),(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(W7,{})})]})})]})},q7=()=>{const{translate:e,params:{organizationId:n}}=fc();return(0,i.jsxs)(bC,{gap:"6",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("groupes_34813")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(yc,{to:Wo.CREATE_ORGANIZATION_PARAMETERS_GROUP(n),children:e("cr_er_un_nouvea_64802")})})]})},H7=e=>`weezcrew-group-${e}`,Y7=e=>{return(0,i.jsx)(_g,{align:"center",width:100,children:e.group.isWeezaccessSynchronized&&e.group.weezaccessPartnerId&&(0,i.jsx)(WE,{name:e.group.name,size:30,value:(n=e.group.id,`${H7(n)}|${(e=>H7(e))(n)}`)})});var n},Z7=e=>{const{translate:n,params:{organizationId:t}}=fc(),{canOrganizationUserEdit:s}=iC(),{mutate:o}=function(e={}){return ds("mutation GroupDelete($organizationId: OrganizationId!, $groupId: GroupId!) {\n groupDelete(organizationId: $organizationId, groupId: $groupId)\n}\n",e)}(),{showNotification:a}=Sy(),[r,d]=(0,de.useState)(!1),l=Wo.EDIT_ORGANIZATION_PARAMETERS_GROUP(t,e.group.id);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Eg,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{vm(e.target)},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{ellipsis:!0,title:e.group.name,children:e.group.name})}),(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{ellipsis:!0,title:e.group.description,width:1,children:e.group.description})}),(0,i.jsx)(_g,{width:200,children:e.group.numberOfMembers}),e.hasWeezaccessSynchronizedGroups&&(0,i.jsx)(Y7,{group:e.group}),s&&(0,i.jsxs)(Vg,{justify:"end",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",to:l})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(Lg,{children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"pen",to:l,children:n("_diter_62574")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),d(!0)},children:n("supprimer_43083")})})]})]})]}),r&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_51354"),text:n("suppression_de_73669",e.group.name),onClose:()=>{d(!1)},onDelete:async()=>{await o({organizationId:t,groupId:e.group.id}),a(n("le_groupe_a_bie_29146")),e.reload()}})]})},K7=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationUserEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(0),{data:l,isLoading:c,reload:u}=rs("query Groups($organizationId: OrganizationId!, $name: String, $offset: Int) {\n organization(id: $organizationId) {\n hasWeezaccessSynchronizedGroups\n\n groups(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n description\n numberOfMembers\n isWeezaccessSynchronized\n weezaccessPartnerId\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,name:w(o)?o:void 0,offset:r},[],undefined);const m=l.organization?.hasWeezaccessSynchronizedGroups??!1,{numberOfPages:g,totalCount:h}=Jf(l.organization?.groups);return(0,i.jsx)($g,{filters:(0,i.jsx)(Xl,{align:"center",gap:"3",width:1,children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("Rechercher un groupe"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_08311")}),(0,i.jsx)(Mg,{children:e("Description")}),(0,i.jsx)(Mg,{width:200,children:e("nombre_de_membr_08851")}),m&&(0,i.jsx)(Mg,{width:100,children:e("qr_code_weezacc_68083")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:g,offset:r,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):l.organization.groups.nodes.map(e=>(0,i.jsx)(Z7,{group:e,hasWeezaccessSynchronizedGroups:m,reload:u},e.id)),setOffset:d,totalCount:h})},X7=()=>{const e=os();return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(q7,{}),(0,i.jsxs)(yC,{gap:"6",children:[(0,i.jsxs)(Tc,{alertStyle:"primary",children:[(0,i.jsx)(zc,{children:e("regrouper_des_a_43481")}),(0,i.jsx)(Oc,{children:e("un_groupe_porte_92378")})]}),(0,i.jsx)(K7,{})]})]})},Q7=e=>{const{history:n,translate:t,params:{organizationId:s}}=fc(),o=ss(Nj),a=ss(dh),{mutate:r,isLoading:d}=function(e={}){return ds("mutation OrganizationUpdateInfos(\n $organizationId: OrganizationId!\n $organization: OrganizationInfosInput!\n) {\n organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n id\n }\n}\n",e)}(),l=(0,de.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,de.useMemo)(()=>Tj.map((e,n)=>(0,i.jsx)("option",{value:e,children:e},n)),[]),u=Jo.c9.now();return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:t("organisation_71863")})}),(0,i.jsx)(yC,{children:(0,i.jsx)(Fc,{direction:"column",initialValues:l,render:({form:o,handleSubmit:r,values:l})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{isLoading:d,onClick:r,children:t("enregistrer_les_30411")})}),heading:t("informations_g_79325"),children:[(0,i.jsxs)(FA,{heading:t("_propos_de_l_o_80406"),children:[(0,i.jsx)(pu,{label:t("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(IA,{addressName:"organization.street",getAddress:e=>fA(e,a).street??e.formatted_address??"",label:t("Address"),onPlaceChange:e=>{const{postalCode:n,city:t,countryCode:i}=fA(e,a);o.batch(()=>{n&&o.change("organization.postalCode",n),t&&o.change("organization.city",t),i&&o.change("organization.country",i)})}}),(0,i.jsx)(pu,{label:t("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)(pu,{label:t("ville_67740"),name:"organization.city"}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("Country"),name:"organization.country",children:a.getCountriesIdName().map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:n},e))}),(0,i.jsx)(Kx,{isSearchVisible:!0,label:t("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]}),(0,i.jsxs)(FA,{heading:t("responsable_de_20624"),children:[(0,i.jsx)(pu,{label:t("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)(pu,{isEmail:!0,label:t("e_mail_du_respo_66060"),name:"organization.adminEmail"})]}),(0,i.jsx)(FA,{heading:t("_metteur_de_e_m_77028"),children:(0,i.jsx)(Kx,{isCreateVisible:!0,isSearchVisible:!0,label:t("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{n.push(Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsxs)(FA,{heading:t("date_time_for_13370"),children:[(0,i.jsx)(pu,{hint:t("rendu_avec_la_d_41897",u.toFormat(l.organization.dateFormat)),label:t("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)(pu,{hint:t("rendu_avec_la_d_41897",u.toFormat(l.organization.datetimeFormat)),label:t("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)(pu,{hint:t("rendu_avec_la_d_41897",u.toFormat(l.organization.timeFormat)),label:t("format_d_heure_46798"),name:"organization.timeFormat"})]})]})}),schema:o.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await r({organizationId:s,organization:e.organization})}})})]})},J7=()=>{const e=ss(Nj),{organizationId:n}=ls(),{data:t,loader:s}=er({organizationId:n});return s||(0,i.jsx)(Q7,{emailsSenders:t.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(t.organization)})},e9=()=>{const e=os(),{organizationId:n}=ls(),{data:t,loader:s}=rs("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 isWrittenOff\n }\n }\n}\n",{organizationId:n},[],undefined);return s||(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:e("factures_03552")})}),(0,i.jsx)(yC,{children:(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(Mg,{children:e("Date")}),(0,i.jsx)(Mg,{children:e("montant_55595")}),(0,i.jsx)(Mg,{children:e("State")}),(0,i.jsx)(Mg,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:t.organization.invoices.map((e,n)=>(0,i.jsx)(Zg,{invoice:e,isBackoffice:!1,showColumn:()=>!0},n))}),setOffset:Ou.A,title:e("factures_03552"),totalCount:0})})]})},n9=()=>{const{params:{organizationId:e},translate:n}=fc(),{data:t,loader:s}=Fd({organizationId:e,includeIntro:!1,spaceType:mt.MembersSpace}),{mutate:o}=ml(),a=ss($D);return s||(0,i.jsx)(Fc,{direction:"column",initialValues:{design:a.designInputDefault(t.organization.spaceDesign)},render:({form:e,handleSubmit:t,submitting:s})=>(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{isLoading:s,onClick:t,children:n("enregistrer_06519")}),(0,i.jsx)(yc,{color:"white",disabled:s,onClick:()=>{e.change("design",a.designInputDefault(null))},children:n("r_initialiser_77538")})]})}),heading:n("design_15043"),hideHeader:!0,children:[(0,i.jsx)(OD,{heading:n("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(zD,{})]}),onSubmit:async n=>await o({organizationId:e,spaceDesign:n.design,spaceType:mt.MembersSpace})})},t9=()=>{const{params:{organizationId:e},translate:n}=fc(),[t,s]=(0,de.useState)(ln.Code);return(0,i.jsx)(Lx,{children:(0,i.jsx)(Xl,{direction:"column",children:(0,i.jsxs)(Xl,{gap:"7",children:[(0,i.jsxs)(Xl,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)($c,{children:n("liste_des_e_mai_73508")}),(0,i.jsxs)(gg,{children:[(0,i.jsx)(cg,{children:(0,i.jsx)(Mg,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(lD,{isSelected:t===ln.Code,subtitle:n("cet_e_mail_est_80490"),title:n("code_20843"),onClick:()=>s(ln.Code)})]})]}),(0,i.jsx)(Zr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Xl,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(gD,{emailType:t,eventId:null,formId:null,organizationId:e,source:On.MembersSpace})})]})})})},i9=()=>{const{params:{organizationId:e},translate:n}=fc(),{data:t,loader:s}=rs("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n showMembersSpaceCommunity\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},[],undefined);const{mutate:o}=function(e={}){return ds("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)(Fc,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:t.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:t.organization.hideAccreditationsUntilConfirmationEmailSent,membersSpaceExcludeAccreditations:t.organization.membersSpaceExcludeAccreditations,showMembersSpaceCommunity:t.organization.showMembersSpaceCommunity},render:({form:e,handleSubmit:s,submitting:o,values:a})=>(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{isLoading:o,onClick:s,children:n("enregistrer_06519")})}),heading:n("param_tres_de_l_83556"),subtitle:n("personnalisez_l_44387"),children:[(0,i.jsx)(FA,{heading:n("community_featu_56458"),children:(0,i.jsx)(Jx,{name:"showMembersSpaceCommunity",children:n("show_community_78811")})}),(0,i.jsx)(FA,{heading:n("diffusion_des_a_83706"),children:(0,i.jsx)(Jx,{name:"hideAssignmentsUntilConfirmationEmailSent",children:n("afficher_les_af_06759")})}),(0,i.jsx)(FA,{heading:n("diffusion_des_a_32535"),children:(0,i.jsx)(Jx,{name:"hideAccreditationsUntilConfirmationEmailSent",children:n("afficher_les_ac_55704")})}),(0,i.jsx)(FA,{heading:n("restriction_de_66151"),children:(0,i.jsxs)(Wv,{heading:n("quelle_s_accr_53793"),role:"radiogroup",children:[(0,i.jsx)(eg,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:a.membersSpaceExcludeAccreditations?"unchecked":"checked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",void 0)},children:n("afficher_toutes_12183")}),(0,i.jsx)(eg,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:a.membersSpaceExcludeAccreditations?"checked":"unchecked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",[])},children:n("seulement_certa_92801")}),a.membersSpaceExcludeAccreditations&&(0,i.jsx)(Kx,{multiple:!0,name:"membersSpaceExcludeAccreditations",placeholder:n("add_accreditati_64170"),children:t.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 n=>{await o({organizationId:e,membersSpaceSettings:n})}})},s9=()=>{const{translate:e,params:{organizationId:n}}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bC,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)($c,{children:e("espace_membres_90896")}),(0,i.jsxs)(wC,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:n}),children:e("design_15043")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:n}),children:e("int_gration_10662")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:n}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(EC,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:n}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(yC,{css:{overflowY:"auto"},children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(n9,{})}),(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(x7,{alert:(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:e("comment_marche_87686")}),(0,i.jsx)(Oc,{children:e("ce_code_va_vous_50849")})]}),iframeLabel:e("code_html_pour_26450"),linkPath:ys(Os.ORGANIZATION({organizationId:n}))})}),(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(t9,{})}),(0,i.jsx)($C,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(i9,{})})]})})]})},o9=e=>{const n=us(),t=e.isActive?e.isActive(n.pathname):n.pathname===e.path;return(0,i.jsx)(gc,{to:e.path,children:(0,i.jsxs)(Hb,{active:t,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(Zr,{width:20,children:(0,i.jsx)(pc,{icon:e.icon})}),(0,i.jsx)(Zr,{children:e.title})]})})},a9=e=>{const{localOrganization:n,updateLocalOrganization:t}=Yy(),[s,o]=(0,de.useState)(n?.areParametersMenuSectionsOpen?.[e.name]??!0),a=(0,de.useCallback)(async i=>{o(i),await t({areParametersMenuSectionsOpen:(0,oc.A)(n?.areParametersMenuSectionsOpen,{[e.name]:i})})},[n,s,o]);return(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(Xl,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await a(!s)},children:[(0,i.jsx)(Zr,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(Zr,{css:{fontSize:"10px"},children:(0,i.jsx)(pc,{icon:s?"chevron-down":"chevron-up"})})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(Xl,{css:{px:"$3"},direction:"column",children:e.children})]})]})},r9=()=>{const{translate:e,params:{organizationId:n}}=fc();fm(e("param_tres_78420"));const{hasFeature:t}=Yy(),{canOrganizationParamRead:s,canOrganizationUserRead:o}=iC();return(0,i.jsx)(Xl,{as:Yl.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(Xl,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(a9,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(o9,{icon:"user",path:Wo.ORGANIZATION_PARAMETERS_PROFILE(n),title:e("mon_profil_48224")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o9,{icon:"building",path:Wo.ORGANIZATION_PARAMETERS_INFOS(n),title:e("organisation_71863")}),(0,i.jsx)(o9,{icon:"wave-pulse",path:Wo.ORGANIZATION_PARAMETERS_ACTIVITY(n),title:e("activit_95747")})]})]}),s&&(0,i.jsxs)(a9,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(o9,{icon:"star",isActive:e=>e.includes(Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:n})),path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:n}),title:e("site_vitrine_17673")}),(0,i.jsx)(o9,{icon:"address-card",isActive:e=>e.includes(Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:n})),path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:n}),title:e("espace_membres_90896")}),t(In.Delegation)&&(0,i.jsx)(o9,{icon:"users",isActive:e=>e.includes(Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:n})),path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:n}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(o9,{icon:"at",isActive:e=>e.includes(Wo.ORGANIZATION_PARAMETERS_EMAILS(n)),path:Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),title:e("e_mails_09850")}),(0,i.jsx)(o9,{icon:"layer-group",isActive:e=>e.includes(Wo.ORGANIZATION_PARAMETERS_CATEGORIES(n)),path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(n),title:e("cat_gories_24533")}),(0,i.jsx)(o9,{icon:"tag",path:Wo.ORGANIZATION_PARAMETERS_TAGS(n),title:e("tags_79499")}),(0,i.jsx)(o9,{icon:"language",path:Wo.ORGANIZATION_PARAMETERS_TRANSLATIONS(n),title:e("traductions_88349")})]}),o&&(0,i.jsxs)(a9,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(o9,{icon:"user-group",path:Wo.ORGANIZATION_PARAMETERS_TEAM(n),title:e("utilisateurs_04975")}),(0,i.jsx)(o9,{icon:"shield",path:Wo.ORGANIZATION_PARAMETERS_ROLES(n),title:e("r_les_et_permis_27853")}),(0,i.jsx)(o9,{icon:"people-group",path:Wo.ORGANIZATION_PARAMETERS_GROUPS(n),title:e("groupes_34813")})]}),s&&o&&(0,i.jsx)(a9,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(o9,{icon:"receipt",path:Wo.ORGANIZATION_PARAMETERS_INVOICES(n),title:e("factures_03552")})}),s&&t(In.Skidata)&&(0,i.jsx)(a9,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(o9,{icon:"person-skiing",path:Wo.ORGANIZATION_PARAMETERS_SKIDATA(n),title:"Skidata"})})]})})},d9=()=>{const{translate:e,params:{organizationId:n}}=fc(),{data:t,loader:s}=lr({organizationId:n}),o=ss(MM),a=ss(ec),{mutate:r,isLoading:d}=cr(),{mutate:l}=gl(),{user:c}=ps(),{reload:u}=Yy(),[m,g]=(0,de.useState)(!1);return s||(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(bC,{children:(0,i.jsx)(Zr,{font:"gray900 displayXs medium",children:e("mon_profil_48224")})}),(0,i.jsx)(yC,{children:(0,i.jsx)(Fc,{direction:"column",initialValues:{userInfo:o.userInfoProfileInputDefault(t.user)},render:({handleSubmit:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(yc,{isLoading:d,onClick:t,children:e("enregistrer_les_30411")}),heading:e("informations_pe_37892"),children:[(0,i.jsx)(qb,{accept:Jv.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:n,prefix:"userInfo.fields.picture."}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(Y8,{inputName:"userInfo."})]}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Zx,{heading:e("compte_16579"),children:(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{g(!0)},children:e("supprimer_mon_c_07051")})}),m&&(0,i.jsx)(f$,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{g(!1)},onDelete:async()=>{await l({}),_e()}})]}),validate:a.validateForForm(o.updateProfileSchema()),width:1,onSubmit:async e=>{const{userProfileUpdate:{email:n,language:i}}=await r({userId:c.id,userInfoId:t.user.userInfo.id,userInfo:e.userInfo});c.email!==n||c.language!==i?_e():u()}})})]})},l9=()=>{const{translate:e,params:{organizationId:n}}=fc();return(0,i.jsxs)(bC,{gap:"6",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("r_les_et_permis_27853")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(yc,{to:Wo.CREATE_ORGANIZATION_PARAMETERS_ROLE(n),children:e("cr_er_un_nouvea_53551")})})]})},c9=({onClose:e,onDelete:n,role:t})=>{const{translate:s,params:{organizationId:o}}=fc(),{mutate:a}=function(e={}){return ds("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDelete(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(f$,{buttonText:s("supprimer_43083"),subtext:0===t.numberOfTimesUsed?s("ce_r_le_n_est_p_61959"):s("ce_r_le_est_uti_35113",t.numberOfTimesUsed),text:s("suppression_de_73669",t.name),onClose:e,onDelete:()=>a({organizationId:o,roleId:t.id}).then(e=>(n(),e))})},u9=({onDelete:e,role:n})=>{const{history:t,translate:s,params:{organizationId:o}}=fc(),{mutate:a}=function(e={}){return ds("mutation RoleDuplicate($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDuplicate(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}(),{canOrganizationUserEdit:r}=iC(),[d,l]=(0,de.useState)(!1),c=(0,de.useMemo)(()=>r&&n.type===dt.Custom,[r,n]),u=async()=>{const{roleDuplicate:e}=await a({organizationId:o,roleId:n.id});t.push(Wo.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,e.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsxs)(v$,{children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Em,{icon:"pen",onClick:()=>{t.push(Wo.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,n.id))},children:s("_diter_62574")}),(0,i.jsx)(Em,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]}),n.type!==dt.Custom&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Em,{icon:"eye",onClick:()=>{t.push(Wo.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,n.id))},children:s("voir_36533")}),(0,i.jsx)(Em,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]})]}),(0,i.jsx)(v$,{children:c&&(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),l(!0)},children:s("supprimer_43083")})})]}),d&&(0,i.jsx)(c9,{role:n,onClose:()=>l(!1),onDelete:e})]})},m9=()=>{const{history:e,translate:n,params:{organizationId:t}}=fc(),{canOrganizationUserEdit:s}=iC(),[o,a,r]=Dg(""),[d,l]=(0,de.useState)([]),{data:c,isLoading:u,reload:m}=rs("query Roles($organizationId: OrganizationId!, $name: String, $levels: [RoleAccessLevel!]) {\n organization(id: $organizationId) {\n roles(name: $name, levels: $levels) {\n id\n name\n description\n accessLevel\n type\n numberOfTimesUsed\n }\n }\n}\n",{organizationId:t,name:w(a)?a:void 0,levels:f(d)?d:void 0},[],undefined);const{showNotification:g}=Sy(),{reload:h}=Yy(),p=(0,de.useMemo)(()=>(0,Tg.A)(c.organization?.roles??[],e=>[e.accessLevel===rt.Organization?1:e.accessLevel===rt.Event?2:e.accessLevel===rt.Position?3:4,b(e.name)]),[c.organization]),I=()=>{g({color:"success",text:n("le_r_le_a_bien_53462")}),m(),h()};return(0,i.jsx)($g,{filters:(0,i.jsxs)(Xl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Zr,{width:300,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:n("rechercher_un_r_39544"),value:o,onChange:r})}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zr,{width:240,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:320,multiple:!0,placeholder:"Niveau d'accès",renderOnPortal:!0,values:d,onChange:l,children:[(0,i.jsx)("option",{value:rt.Organization,children:n("organisation_71863")}),(0,i.jsx)("option",{value:rt.Event,children:n("_v_nement_22345")}),(0,i.jsx)("option",{value:rt.DelegationCategory,children:n("Delegation")}),(0,i.jsx)("option",{value:rt.Position,children:n("Position")})]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("nom_du_r_le_38492")}),(0,i.jsx)(Mg,{children:n("niveau_d_acc_s_29898")}),(0,i.jsx)(Mg,{children:n("description_du_94520")}),(0,i.jsx)(Mg,{width:200,children:"nombre_d_utilis_99999"}),s&&(0,i.jsx)(Mg,{width:100})]}),rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):p.map(o=>(0,i.jsxs)(Eg,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{e.push(Wo.EDIT_ORGANIZATION_PARAMETERS_ROLE(t,o.id))},onMouseLeave:e=>{vm(e.target)},children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{ellipsis:!0,title:o.name,children:o.name})}),(0,i.jsx)(_g,{children:o.accessLevel===rt.Organization?n("administrateur_10076"):o.accessLevel===rt.Event?n("administrateur_99393"):o.accessLevel===rt.Position?n("responsable_de_82794"):n("responsable_de_75445")}),(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{title:o.description,width:1,children:o.description})}),(0,i.jsx)(_g,{width:200,children:o.numberOfTimesUsed}),s&&(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsx)(u9,{role:o,onDelete:I})})]},o.id))})},g9=()=>{const e=os();return(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(l9,{}),(0,i.jsxs)(yC,{gap:"6",children:[(0,i.jsxs)(Tc,{alertStyle:"primary",children:[(0,i.jsx)(zc,{children:e("contr_ler_les_p_50104")}),(0,i.jsx)(Oc,{children:e("les_r_les_aiden_19371")})]}),(0,i.jsx)(m9,{})]})]})};var h9;let p9=class extends ju{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??""}}};p9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(h9=void 0!==ts&&ts)?h9:Object])],p9);const I9=e=>{const n=os(),t=ss(Wg),{mutate:s}=function(e={}){return ds("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:o}=function(e={}){return ds("mutation SkidataConnectionInfoSeaonEventDelete(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSeaonEventDelete(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:a}=function(e={}){return ds("mutation SkidataConnectionInfoSynchronizedEventAdd(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSynchronizedEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:r}=function(e={}){return ds("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)(Xl,{gap:"3",width:1,children:[(0,i.jsxs)(Xl,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(Zr,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(Zr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(Zr,{width:1,children:(0,i.jsxs)(gg,{children:[(0,i.jsxs)(cg,{children:[(0,i.jsx)(Mg,{children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(Mg,{children:n("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{}),(0,i.jsx)(Mg,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(Mg,{}),"season"===e.eventType&&(0,i.jsx)(Mg,{})]}),f(e.events)?e.events.map(d=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{color:"gray800",width:1,children:d.name})}),(0,i.jsx)(_g,{children:_j(t,d.startAt,d.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_g,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("synchroniser_34754")})}),(0,i.jsx)(_g,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Zr,{color:"primary500",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)(_g,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)(_g,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:d.id}),e.reload()},children:(0,i.jsx)(Zr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:n("supprimer_43083")})})]},d.id)):(0,i.jsx)(Eg,{css:{height:"auto"},children:(0,i.jsx)(_g,{children:(0,i.jsxs)(Xl,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(uA,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(Zr,{fontSize:"textMd",fontWeight:"medium",children:n("aucun_v_nement_39620")})]})})})]})})]})},f9=()=>{const e=os(),{organizationId:n}=ls(),t=ss(p9),{data:s,loader:o,reload:a}=rs("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:n},[],undefined);const{mutate:r}=function(e={}){return ds("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n skidataConnectionInfosDelete(organizationId: $organizationId) {\n organizationId\n }\n}\n",e)}(),{mutate:d,isLoading:l}=function(e={}){return ds("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 ds("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),m=(0,de.useMemo)(()=>s.organization?.events.nodes??[],[s.organization]),g=(0,de.useMemo)(()=>m.map(({id:e})=>e),[m]),h=(0,de.useMemo)(()=>s.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[s.organization]),p=(0,de.useMemo)(()=>s.organization?.skidataConnectionInfos?.seasonEventsIds??[],[s.organization]),I=(0,de.useMemo)(()=>{const e=(0,Wm.A)(g,h.concat(p));return m.filter(n=>e.includes(n.id))},[m,h,p]),f=(0,de.useMemo)(()=>m.filter(e=>h.includes(e.id)),[m]),x=(0,de.useMemo)(()=>m.filter(e=>p.includes(e.id)),[m,p]);return o||(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsxs)(bC,{gap:"3",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:"Skidata"}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:u?(0,i.jsx)(yc,{color:"white",leftIcon:"loader"}):(0,i.jsx)(yc,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:n})}})})}),(0,i.jsx)(ux,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(yc,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await r({organizationId:n}),a()}})})}),(0,i.jsx)(ux,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsxs)(yC,{children:[(0,i.jsx)(Fc,{direction:"column",initialValues:{connectionInfos:t.connectionInfosInputDefault(s.organization.skidataConnectionInfos)},render:({handleSubmit:n})=>(0,i.jsxs)(Zx,{footerActions:(0,i.jsx)(yc,{isLoading:l,onClick:n,children:s.organization.skidataConnectionInfos?e("enregistrer_06519"):e("se_connecter_63820")}),heading:e("connexion_05887"),children:[(0,i.jsx)(FA,{heading:e("adresse_du_web_92125"),children:(0,i.jsx)(pu,{name:"connectionInfos.url"})}),(0,i.jsx)(FA,{heading:"Issuer",children:(0,i.jsx)(pu,{name:"connectionInfos.issuer"})}),(0,i.jsx)(FA,{heading:"Receiver",children:(0,i.jsx)(pu,{name:"connectionInfos.receiver"})}),(0,i.jsx)(FA,{heading:e("lieu_20541"),children:(0,i.jsx)(pu,{name:"connectionInfos.place"})})]}),width:1,onSubmit:async e=>{await d({organizationId:n,connectionInfos:e.connectionInfos}),a()}}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(Hj,{direction:"horizontal"}),(0,i.jsx)(ic,{height:"5"}),(0,i.jsx)(I9,{eventType:"all",events:I,organizationId:n,reload:a,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)(Yj,{height:"5"}),(0,i.jsx)(I9,{eventType:"synchronized",events:f,organizationId:n,reload:a,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)(Yj,{height:"5"}),(0,i.jsx)(I9,{eventType:"season",events:x,organizationId:n,reload:a,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]})]})]})},x9=e=>{const n=os(),{mutate:t}=function(e={}){return ds("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)(mA,{buttonText:n("renommer_42135"),icon:"tag",initialValues:{name:e.name},title:n("renommer_1_40542",e.name),onClose:e.onClose,onSubmit:async n=>{await t({organizationId:e.organizationId,tagId:e.tagId,name:n.name}),e.onSuccess(),e.onClose()},children:(0,i.jsx)(pu,{label:n("nom_du_tag_95054"),name:"name"})})},_9=e=>{const n=os(),{canOrganizationParamEdit:t}=iC(),{mutate:s}=function(e={}){return ds("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n tagDelete(organizationId: $organizationId, tagId: $tagId) {\n id\n }\n}\n",e)}(),[o,a]=(0,de.useState)(!1),[r,d]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Eg,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(_g,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)(_g,{children:e.tag.numberOfTimesUsed}),t&&(0,i.jsxs)(Vg,{justify:"center",children:[(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{children:(0,i.jsx)(pc,{icon:"pen",onClick:()=>{a(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsxs)(lx,{children:[(0,i.jsx)(gx,{children:(0,i.jsx)(Zr,{color:"error700",children:(0,i.jsx)(pc,{icon:"trash-can",onClick:()=>{d(!0)}})})}),(0,i.jsx)(ux,{placement:"top",children:n("supprimer_02105")})]})]})]}),o&&(0,i.jsx)(x9,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{a(!1)},onSuccess:e.reload}),r&&(0,i.jsx)(f$,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_70200"),text:n("suppression_de_73669",e.tag.name),onClose:()=>{d(!1)},onDelete:async()=>{await s({organizationId:e.organizationId,tagId:e.tag.id}),e.reload()}})]})},j9=()=>{const{translate:e,params:{organizationId:n}}=fc(),{canOrganizationParamEdit:t}=iC(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)(0),{data:l,isLoading:c,reload:u}=rs("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:n,name:w(o)?o:void 0,offset:r},[],undefined);const{numberOfPages:m,totalCount:g}=Jf(l.organization?.tags),[h,p]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsxs)(bC,{gap:"6",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e("tags_79499")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(yc,{onClick:()=>{p(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(yC,{children:(0,i.jsx)($g,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Zr,{width:320,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:s,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("nom_08311")}),(0,i.jsx)(Mg,{children:e("nombre_d_utilis_58389")}),t&&(0,i.jsx)(Mg,{width:100})]}),numberOfPages:m,offset:r,rows:c?(0,i.jsx)(i.Fragment,{}):l.organization.tags.nodes.map(e=>(0,i.jsx)(_9,{organizationId:n,reload:u,tag:e},e.id)),setOffset:d,title:e("liste_des_tags_83521"),totalCount:g})})]}),h&&(0,i.jsx)(gA,{organizationId:n,onClose:()=>{p(!1)},onSuccess:u})]})};function v9(e,n){const t=e[`${n.toLowerCase()}String`];return w(t)?t:w(e.enString)?e.enString:w(e.frString)?e.frString:w(e.esString)?e.esString:w(e.deString)?e.deString:w(e.nlString)?e.nlString:""}const S9=e=>{const{translate:n,params:{organizationId:t}}=fc(),{user:s}=ps(),{mutate:o,isLoading:a}=function(e={}){return ds("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)}(),[r,d]=(0,de.useState)(!1),[l,c]=(0,de.useState)(Object.fromEntries(e.languages.map(n=>[n,e.translation[n.toLowerCase()]||""]))),u=s.language,m=e.languages.every(n=>e.translation[`is${n}Translated`]);return(0,i.jsxs)(Xl,{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)(Xl,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{d(!r)},children:[(0,i.jsx)(yc,{color:"invisible",css:{color:"$gray700"},leftIcon:r?"chevron-down":"chevron-right"}),(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray800 textMd medium",children:v9(e.translation,u)}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(Lm,{children:n(e.translation.module)}),m?(0,i.jsx)(Lm,{color:"success",children:n("Translated")}):(0,i.jsx)(Lm,{color:"warning",children:n("NotTranslated")})]})]}),r&&(0,i.jsxs)(Xl,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(n=>{const t=`Version ${n}`;return e.translation.translationType===jt.RichText?(0,i.jsx)(QS,{initialValue:l[n],label:t,onChange:e=>{c({...l,[n]:e})}},n):(0,i.jsx)(hu,{label:t,value:l[n],onChange:e=>{c({...l,[n]:e})}},n)}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Xl,{children:(0,i.jsx)(yc,{isLoading:a,onClick:async()=>{await o({organizationId:t,translationId:e.translation.id,translation:Object.fromEntries(Object.entries(l).map(([e,n])=>[e.toLowerCase(),n]))})},children:n("mettre_jour_85141")})})})]})]})},y9=e=>{const n=os(),t=zg(),[s,o]=(0,de.useState)(!1),[a,r]=(0,de.useState)(e.eventsIds),[d,l]=(0,de.useState)(e.modules),[c,u]=(0,de.useState)(e.translationStatus),m=(0,de.useMemo)(()=>(0,Tg.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(hu,{icon:"search",placeholder:n("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(J$,{apply:()=>{e.setEventsIds(a),e.setModules(d),e.setTranslationStatus(c),o(!1)},color:"gray",isOpen:s,reinit:()=>{e.setEventsIds([]),r([]),e.setModules([]),l([]),e.setTranslationStatus(_t.TranslatedAndNotTranslated),u(_t.TranslatedAndNotTranslated),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsx)(lg,{isSearchVisible:!0,label:n("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:a,onChange:r,children:m.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(lg,{isSearchVisible:!0,label:n("module_67984"),multiple:!0,renderOnPortal:!0,values:d,onChange:l,children:t(Ni)}),(0,i.jsx)(nf,{label:n("statut_de_tradu_58384"),value:c,onChange:u,children:t(Li)})]})]})},C9=e=>(0,i.jsx)(Xl,{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)(Vm,{borderRadius:"$2",height:32,width:1})}),b9=e=>{const{translate:n}=fc(),t=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(Xl,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(Zr,{width:.3,children:(0,i.jsx)(jL,{css:{height:"100%"},children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("nombre_de_langu_75924")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(Zr,{css:{flex:"1"},children:(0,i.jsx)(jL,{children:(0,i.jsxs)(Xl,{gap:"6",justify:"between",children:[(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("nombre_de_champ_26560")}),(0,i.jsx)(Zr,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(Xl,{direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{font:"gray700 textXs semiBold",children:n("dont_10477")}),(0,i.jsxs)(Xl,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("champs_tradui_47609")}),(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:t})]}),(0,i.jsxs)(Xl,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(Zr,{font:"gray500 textSm medium",children:n("champs_traduits_03119")}),(0,i.jsx)(Zr,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},A9=e=>{const{translate:n,params:{organizationId:t}}=fc(),[s,o,a]=Dg(""),[r,d]=(0,de.useState)([]),[l,c]=(0,de.useState)(_t.TranslatedAndNotTranslated),[u,m]=(0,de.useState)([]),[g,h]=(0,de.useState)(0),{data:p,isLoading:I}=rs("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:t,content:w(o)?o:null,eventsIds:r,modules:u,status:l,offset:g},[Ko.TranslationFragment],undefined);const{numberOfPages:f,totalCount:x}=Jf(p.organization?.translations),_=p.organization?.translations.nodes??[];return(0,i.jsxs)(Xl,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textXl medium",children:n("traductions_88349")}),(0,i.jsx)(Zr,{color:"gray500",children:n("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(Xl,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(b9,{organization:e.organization}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(y9,{content:s,eventsIds:r,modules:u,organization:e.organization,setContent:a,setEventsIds:d,setModules:m,setTranslationStatus:c,translationStatus:l}),(0,i.jsx)(ic,{height:"4"}),I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C9,{isFirst:!0,isLast:!1}),(0,i.jsx)(C9,{isFirst:!1,isLast:!1}),(0,i.jsx)(C9,{isFirst:!1,isLast:!0})]}):_.map((n,t)=>(0,i.jsx)(S9,{isFirst:0===t,isLast:t===_.length-1,languages:e.organization.languages,translation:n},n.id)),(0,i.jsx)(ic,{height:"4"}),(0,i.jsx)(Ag,{numberOfPages:f,offset:g,setOffset:h,totalCount:x})]})]})},E9=()=>{const{params:{organizationId:e}}=fc(),{data:n,loader:t}=rs("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},[],undefined);return t||(0,i.jsx)(A9,{organization:n.organization})},w9=e=>{const{translate:n,params:{organizationId:t}}=fc(),{showNotification:s}=Sy(),{mutate:o}=function(e={}){return ds("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),a=function(e,n){const{mutate:t}=fr();return(0,de.useCallback)(()=>Promise.all([ln.PositionCategoryLeaderAssign,ln.PositionLeaderAssign,ln.DelegationCategoryLeaderAssign,ln.DelegationLeaderAssign,ln.EventInvite,ln.OrganizationInvite].map(i=>t({organizationId:e,userInfoId:n,emailType:i}))),[t,e,n])}(t,e.userInfo.id),[r,d]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Lg,{children:[(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{icon:"paper-plane",onClick:async e=>{vm(e.target),await a()},children:n("r_envoyer_l_e_96215")})}),(0,i.jsx)(v$,{children:(0,i.jsx)(Em,{color:"red",icon:"trash-can",onClick:e=>{vm(e.target),d(!0)},children:n("supprimer_l_acc_85342")})})]}),r&&(0,i.jsx)(f$,{buttonText:n("supprimer_les_a_96621"),subtext:n("_tes_vous_s_r_d_35776",e.userInfo.nameOrEmail),text:n("supprimer_l_acc_85342"),onClose:()=>d(!1),onDelete:async()=>{await o({organizationId:t,userId:e.userInfo.userId}),s(n("tous_les_acc_s_26440",e.userInfo.nameOrEmail)),e.reload()}})]})},$9=e=>{const{history:n}=fc(),{organization:t}=Yy();return(0,i.jsx)(Lm,{css:{minWidth:0},cursor:"pointer",leftIcon:"people-group",onClick:()=>{n.push(Wo.EDIT_ORGANIZATION_PARAMETERS_GROUP(t.id,e.group.id))},children:e.group.name})},T9=e=>{const{organization:n}=Yy(),{canOrganizationUserEdit:t}=iC(),{mutate:s}=pl(),[o,a]=(0,de.useState)(e.roleId);return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:e.group?(0,i.jsxs)(Xl,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Zr,{ellipsis:!0,children:e.roles.find(({id:e})=>e===o)?.name}),(0,i.jsx)($9,{group:e.group})]}):(0,i.jsx)(nf,{shouldParseAsInt:!0,state:t?"active":"disabled",value:o,onChange:t=>(a(t),(t=>s({organizationId:n.id,scope:e.scope,id:e.id,roleId:t}))(t)),children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(_g,{children:e.resource}),t&&(0,i.jsx)(Vg,{justify:"center",children:!e.group&&(0,i.jsx)(Zr,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(pc,{icon:"trash-can"})})})]})},z9=e=>{const{translate:n}=fc(),{organization:t,roles:s}=Yy(),{canOrganizationUserEdit:o}=iC(),{mutate:a}=hl(),[r,d]=(0,de.useState)(e.userInfo.usersEvents.filter(n=>n.event.id===e.event.id)),[l,c]=(0,de.useState)(e.userInfo.usersDelegations.filter(n=>n.eventId===e.event.id)),[u,m]=(0,de.useState)(e.userInfo.usersDelegationsCategories.filter(n=>n.eventId===e.event.id)),[g,h]=(0,de.useState)(e.userInfo.usersPositions.filter(n=>n.eventId===e.event.id)),[p,I]=(0,de.useState)(e.userInfo.usersPositionsCategories.filter(n=>n.eventId===e.event.id)),x=n=>!n.group||!e.removedGroupsIds.includes(n.group.id),_=r.filter(x),j=u.filter(x),v=g.filter(x),S=p.filter(x),y=async(e,n)=>{await a({organizationId:t.id,scope:e,id:n}),d(e=>e.filter(e=>e.id!==n)),c(e=>e.filter(e=>e.id!==n)),m(e=>e.filter(e=>e.id!==n)),h(e=>e.filter(e=>e.id!==n)),I(e=>e.filter(e=>e.id!==n))};return f(_)||f(l)||f(j)||f(v)||f(S)?(0,i.jsx)($g,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("r_le_59302")}),(0,i.jsx)(Mg,{}),o&&(0,i.jsx)(Mg,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[_.map(n=>(0,i.jsx)(T9,{group:n.group,id:n.id,resource:"-",roleId:n.role.id,roles:s.eventRoles,scope:Ce.Event,userId:e.userInfo.userId,onDelete:y},n.id)),l.map(e=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:n("responsable_de_70462")}),(0,i.jsx)(_g,{children:e.delegation.name}),o&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsx)(Zr,{color:"error700",onClick:()=>y(Ce.Delegation,e.id),children:(0,i.jsx)(pc,{icon:"trash-can"})})})]},e.id)),j.map(n=>(0,i.jsx)(T9,{group:n.group,id:n.id,resource:n.delegationCategory.name,roleId:n.role.id,roles:s.delegationCategoryRoles,scope:Ce.DelegationCategory,userId:e.userInfo.userId,onDelete:y},n.id)),v.map(n=>(0,i.jsx)(T9,{group:n.group,id:n.id,resource:n.position.name,roleId:n.role.id,roles:s.positionRoles,scope:Ce.Position,userId:e.userInfo.userId,onDelete:y},n.id)),S.map(n=>(0,i.jsx)(T9,{group:n.group,id:n.id,resource:n.positionCategory.name,roleId:n.role.id,roles:s.positionRoles,scope:Ce.PositionCategory,userId:e.userInfo.userId,onDelete:y},n.id))]}),title:e.event.name}):null},O9=e=>{const{history:n,translate:t}=fc(),{organization:s}=Yy(),{canOrganizationUserEdit:o}=iC(),{mutate:a}=function(e={}){return ds("mutation GroupMemberDelete(\n $organizationId: OrganizationId!\n $groupId: GroupId!\n $userInfoId: UsersInfoId!\n) {\n groupMemberDelete(\n organizationId: $organizationId\n groupId: $groupId\n userInfoId: $userInfoId\n )\n}\n",e)}();return f(e.groups)?(0,i.jsx)($g,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:t("nom_08311")}),o&&(0,i.jsx)(Mg,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:e.groups.map(r=>(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:(0,i.jsx)(Zr,{css:{cursor:"pointer"},ellipsis:!0,title:r.name,onClick:()=>{n.push(Wo.EDIT_ORGANIZATION_PARAMETERS_GROUP(s.id,r.id))},children:r.name})}),o&&(0,i.jsx)(Vg,{justify:"center",children:(0,i.jsx)(Zr,{color:"error700",title:t("Retirer du groupe"),onClick:()=>(async n=>{await a({organizationId:s.id,groupId:n,userInfoId:e.userInfo.id}),e.onDelete(n)})(r.id),children:(0,i.jsx)(pc,{icon:"trash-can"})})})]},r.id))}),title:t("groupes_34813")}):null},R9=e=>{const{translate:n}=fc(),{organization:t,roles:s}=Yy(),{canOrganizationUserEdit:o}=iC(),{mutate:a}=pl(),{mutate:r}=hl(),d=e.userOrganization.group,[l,c]=(0,de.useState)(e.userOrganization.role.id),[u,m]=(0,de.useState)(e.userOrganization.sendNotifications),g=(n,i)=>a({organizationId:t.id,scope:Ce.Organization,id:e.userOrganization.id,sendNotifications:n,roleId:i});return(0,i.jsxs)(Eg,{children:[(0,i.jsx)(_g,{children:d?(0,i.jsxs)(Xl,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(Zr,{ellipsis:!0,children:s.organizationRoles.find(({id:e})=>e===l)?.name}),(0,i.jsx)($9,{group:d})]}):(0,i.jsx)(nf,{shouldParseAsInt:!0,state:o?"active":"disabled",value:l,onChange:e=>(c(e),g(u,e)),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(_g,{children:(0,i.jsx)(oI,{disabled:!o||!!d,value:u,onChange:e=>(m(e),g(e,l)),children:n("activer_38612")})}),o&&(0,i.jsx)(Vg,{justify:"center",children:!d&&(0,i.jsx)(Zr,{color:"error700",onClick:async()=>{await r({organizationId:t.id,scope:Ce.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(pc,{icon:"trash-can"})})})]})},D9=e=>{const{translate:n}=fc(),{organization:t}=Yy(),{canOrganizationUserEdit:s}=iC(),[o,a]=(0,de.useState)(e.userInfo.usersOrganizations),r=e=>{a(n=>n.filter(n=>n.id!==e))};return(0,i.jsx)($g,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:n("r_le_59302")}),(0,i.jsx)(Mg,{children:n("notifications_98765")}),s&&(0,i.jsx)(Mg,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:o.filter(n=>!n.group||!e.removedGroupsIds.includes(n.group.id)).map((n,t)=>(0,i.jsx)(R9,{userId:e.userInfo.userId,userOrganization:n,onDelete:r},t))}),title:t.name})},M9=e=>{const{translate:n}=fc(),{organization:t}=Yy(),{canOrganizationUserEdit:s}=iC(),[o,a]=(0,de.useState)(e.userInfo.groups),r=e.userInfo.groups.filter(({id:e})=>!o.some(n=>n.id===e)).map(({id:e})=>e);return(0,i.jsxs)(fI,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(YC,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(xI,{css:{gap:"$4",py:"$6"},children:[f(e.userInfo.usersOrganizations)&&(0,i.jsx)(D9,{removedGroupsIds:r,userInfo:e.userInfo}),(0,i.jsx)(O9,{groups:o,userInfo:e.userInfo,onDelete:e=>{a(n=>n.filter(n=>n.id!==e))}}),t.events.nodes.map(n=>(0,i.jsx)(z9,{event:n,removedGroupsIds:r,userInfo:e.userInfo},n.id)),s&&(0,i.jsx)(mV,{usersInfosIds:[e.userInfo.id],onClose:e.onClose})]}),(0,i.jsx)(_I,{children:(0,i.jsx)(Xl,{gap:"3",justify:"end",children:(0,i.jsx)(yc,{color:"white",onClick:e.onClose,children:n("fermer_62479")})})})]})},P9=e=>{const[n,t]=(0,de.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Eg,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>t(!0),children:[(0,i.jsx)(_g,{children:(0,i.jsx)(MC,{size:32,userInfo:e.userInfo})}),(0,i.jsx)(ME,{userPermissions:e.userInfo}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Vg,{justify:"end",children:(0,i.jsx)(w9,{reload:e.reload,userInfo:e.userInfo})})})]}),n&&(0,i.jsx)(M9,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),t(!1)}})]})},k9=e=>{const{translate:n}=fc(),{organization:t}=Yy(),{showNotification:s}=Sy(),{onClose:o}=Vf(),{mutate:a,isLoading:r}=function(e={}){return ds("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:d,isLoading:l}=function(e={}){return ds("mutation EventInvite($eventId: EventId!, $email: UserEmail!, $roleId: RoleId!) {\n eventInvite(eventId: $eventId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),{mutate:c,isLoading:u}=function(e={}){return ds("mutation OrganizationInviteGroups(\n $organizationId: OrganizationId!\n $email: UserEmail!\n $groupsIds: [GroupId!]!\n) {\n organizationInviteGroups(organizationId: $organizationId, email: $email, groupsIds: $groupsIds) {\n id\n }\n}\n",e)}(),{data:m}=rs("query OrganizationUserInviteGroups($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n groups {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t.id},[],undefined);const g=(0,de.useMemo)(()=>(0,Tg.A)(m.organization?.groups.nodes??[],e=>b(e.name)),[m.organization]),h=(0,de.useMemo)(()=>g.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[g]),p=t.roles.find(e=>e.type===dt.OrganizationAdmin),I=t.roles.find(e=>e.type===dt.OrganizationReader),x=t.roles.find(e=>e.type===dt.EventAdmin),_=t.roles.find(e=>e.type===dt.EventReader),[j,v]=(0,de.useState)(""),[S,y]=(0,de.useState)(p.id),[C,A]=(0,de.useState)([]),E=t.events.nodes,[w,$]=(0,de.useState)(E[0]?.id),T=(0,de.useMemo)(()=>E.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[E]),z=function(e){return D.test(e)}(j)&&("groups"!==S||f(C));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qf,{icon:"user-plus",children:n("inviter_un_util_06611")}),(0,i.jsxs)(Gf,{gap:"6",children:[(0,i.jsx)(hu,{isEmail:!0,label:n("Email"),value:j,onChange:v}),(0,i.jsxs)(Xl,{direction:"column",children:[(0,i.jsx)(Zr,{font:"gray800 textSm medium",children:n("quel_r_le_souha_92592")}),(0,i.jsx)(ic,{height:"2"}),(0,i.jsx)(eg,{state:S===p.id?"checked":"unchecked",onClick:()=>y(p.id),children:p.name}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:S===I.id?"checked":"unchecked",onClick:()=>y(I.id),children:I.name}),f(E)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:S===x.id?"checked":"unchecked",onClick:()=>y(x.id),children:x.name}),S===x.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(nf,{shouldParseAsInt:!0,value:w,onChange:$,children:T})})]}),(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:S===_.id?"checked":"unchecked",onClick:()=>y(_.id),children:_.name}),S===_.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},children:(0,i.jsx)(nf,{shouldParseAsInt:!0,value:w,onChange:$,children:T})})]})]}),f(g)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"3"}),(0,i.jsx)(eg,{state:"groups"===S?"checked":"unchecked",onClick:()=>y("groups"),children:n("acc_s_des_gro_61187")}),"groups"===S&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Xl,{css:{paddingLeft:"$6"},direction:"column",children:(0,i.jsx)(lg,{isSearchVisible:!0,multiple:!0,placeholder:n("Sélectionner des groupes"),renderOnPortal:!0,values:C,onChange:A,children:h})})]})]})]})]}),(0,i.jsx)(Wf,{children:(0,i.jsx)(yc,{disabled:!z,isLoading:r||l||u,onClick:async()=>{if("groups"===S)await c({organizationId:t.id,email:j,groupsIds:C}),s(n("_1_a_t_invit_99808",j,g.filter(e=>C.includes(e.id)).map(e=>e.name).join(", ")));else{const e=t.roles.find(e=>e.id===S);if(S===p.id||S===I.id)await a({organizationId:t.id,email:j,roleId:S}),s(n("_1_a_t_invit_38156",j,e.name));else{const t=E.find(e=>e.id===w);await d({eventId:w,email:j,roleId:S}),s(n("_1_a_t_invit_15646",j,e.name,t.name))}}e.reload(),o()},children:n("inviter_35349")})})]})},F9=e=>{const{translate:n}=fc();return(0,i.jsxs)(bC,{gap:"6",children:[(0,i.jsx)(Zr,{css:{flex:"1"},font:"gray900 displayXs medium",children:n("utilisateurs_04975")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_USER_EDIT,children:(0,i.jsxs)(Yf,{children:[(0,i.jsx)(Zf,{children:(0,i.jsx)(yc,{children:n("inviter_un_util_06611")})}),(0,i.jsx)(Hf,{children:(0,i.jsx)(k9,{reload:e.reload})})]})})]})},N9=()=>{const{translate:e,params:{organizationId:n}}=fc(),{organization:t,roles:s}=Yy(),[o,a]=(0,de.useState)(!0),[r,d,l]=Dg(""),[c,u]=(0,de.useState)(-1),[m,g]=(0,de.useState)(-1),[h,p]=(0,de.useState)(jg),[I,x]=(0,de.useState)(0),{data:_,isLoading:j,reload:v}=rs("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:n,hasRole:o,name:w(d)?d:void 0,roleId:-1!==c?c:void 0,eventId:-1!==m?m:void 0,limit:h,offset:I},[Ko.UserInfoOrganizationFragment],undefined);const{numberOfPages:S,totalCount:y}=Jf(_.organization?.usersInfos),[C,b]=(0,de.useState)([]),[A,E]=(0,de.useState)({}),$=(0,de.useCallback)(async e=>{E(n=>({...n,[e]:!0}));const{organization:{userInfo:n}}=await function(e,n={}){return xa("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",{...n,variables:e,fragments:[Ko.UserInfoOrganizationFragment]})}({organizationId:t.id,userInfoId:e},{token:await fe()});b(t=>t.map(t=>t.id===e?n:t)),E(n=>({...n,[e]:!1}))},[t]);return(0,de.useEffect)(()=>{b(_.organization?.usersInfos.nodes??[])},[_.organization]),(0,i.jsxs)(AC,{css:{overflowY:"auto"},children:[(0,i.jsx)(F9,{reload:v}),(0,i.jsx)(yC,{children:(0,i.jsx)($g,{filters:(0,i.jsxs)(Xl,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Zr,{width:300,children:(0,i.jsx)(hu,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:r,onChange:l})}),(0,i.jsx)(Zr,{css:{flex:"1"}}),(0,i.jsx)(Zm,{state:o?"checked":"unchecked",onClick:e=>a("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(Zr,{width:240,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:492,renderOnPortal:!0,values:[c],onChange:e=>{f(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)(Zr,{width:240,children:(0,i.jsxs)(lg,{isSearchVisible:!0,menuWidth:492,renderOnPortal:!0,values:[m],onChange:e=>{f(e)&&g(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),t.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:`${e.name} (${e.id})`},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mg,{children:e("full_name")}),(0,i.jsx)(Mg,{children:e("r_les_61679")}),(0,i.jsx)(lC,{permissions:nC.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Mg,{width:100})})]}),limit:h,numberOfPages:S,offset:I,rows:j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0}),(0,i.jsx)(Pg,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:C.map(e=>A[e.id]?(0,i.jsx)(Pg,{bx:!0},e.id):(0,i.jsx)(P9,{reload:v,reloadUserInfo:$,userInfo:e},e.id))}),setLimit:p,setOffset:x,totalCount:y})})]})},L9=()=>{const{translate:e,params:{organizationId:n}}=fc();fm(e("param_tres_78420"));const{hasFeature:t}=Yy(),{canOrganizationParamRead:s,canOrganizationUserRead:o}=iC();return(0,i.jsxs)(Xl,{height:1,width:1,children:[(0,i.jsx)(r9,{}),(0,i.jsx)(Zr,{css:{flex:"1"},height:1,children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(d9,{})}),s&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(J7,{})}),o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(N9,{})}),o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(g9,{})}),o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_GROUPS(":organizationId"),children:(0,i.jsx)(X7,{})}),s&&(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(T7,{})}),s&&(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:":organizationId"}),children:(0,i.jsx)(AC,{children:(0,i.jsx)(G7,{})})}),s&&(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(AC,{children:(0,i.jsx)(s9,{})})}),s&&t(In.Delegation)&&(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(AC,{children:(0,i.jsx)(S7,{})})}),s&&(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(f7,{})}),s&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(j9,{})}),s&&(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(E9,{})}),s&&o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)(e9,{})}),s&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(s7,{})}),s&&t(In.Skidata)&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(f9,{})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.ORGANIZATION_PARAMETERS_PROFILE(n)})})]})})]})},U9=Object.keys(nC).length/2;function V9(e){return new Array(U9).fill("0").map((n,t)=>e.includes(t)?"1":"0").join("")}const B9=V9([nC.POSITION_READ,nC.POSITION_EDIT,nC.MEMBER_EDIT,nC.MEMBER_ASSIGNMENT_STATE_EDIT,nC.COMMENT_READ,nC.COMMENT_ADD,nC.MEMBER_AVAILABILITIES_EDIT,nC.MEMBER_ASSIGN,nC.CAMPAIGN_SEND,nC.ACCREDITATION_READ,nC.ACCREDITATION_EDIT,nC.MEMBER_ACCREDIT,nC.DELEGATION_READ,nC.DELEGATION_EDIT,nC.FORM_READ,nC.FORM_EDIT,nC.EMAIL_EDIT,nC.CAMPAIGN_READ,nC.DOCUMENT_READ,nC.DOCUMENT_EDIT,nC.WORKFLOW_READ,nC.WORKFLOW_EDIT,nC.CUSTOM_FIELD_READ,nC.CUSTOM_FIELD_EDIT,nC.SEGMENT_EDIT,nC.MEMBER_CREATE,nC.MEMBER_DELETE,nC.EVENT_EDIT,nC.ORGANIZATION_PARAM_READ,nC.ORGANIZATION_PARAM_EDIT,nC.ORGANIZATION_USER_READ,nC.ORGANIZATION_USER_EDIT,nC.WEEZEVENT_READ,nC.WEEZEVENT_EDIT,nC.DELEGATIONS_SPACE_PARAM_READ,nC.DELEGATIONS_SPACE_PARAM_EDIT,nC.PRINT_CONFIG_READ,nC.PRINT_CONFIG_EDIT,nC.PRINT,nC.TICKET_ID_REGENERATE]),W9=V9([nC.POSITION_READ,nC.COMMENT_READ,nC.ACCREDITATION_READ,nC.DELEGATION_READ,nC.FORM_READ,nC.CAMPAIGN_READ,nC.DOCUMENT_READ,nC.WORKFLOW_READ,nC.CUSTOM_FIELD_READ,nC.ORGANIZATION_PARAM_READ,nC.ORGANIZATION_USER_READ,nC.WEEZEVENT_READ,nC.DELEGATIONS_SPACE_PARAM_READ,nC.PRINT_CONFIG_READ]),G9=V9([nC.POSITION_READ,nC.POSITION_EDIT,nC.MEMBER_EDIT,nC.MEMBER_ASSIGNMENT_STATE_EDIT,nC.COMMENT_READ,nC.COMMENT_ADD,nC.MEMBER_AVAILABILITIES_EDIT,nC.MEMBER_ASSIGN,nC.CAMPAIGN_SEND,nC.ACCREDITATION_READ,nC.ACCREDITATION_EDIT,nC.MEMBER_ACCREDIT,nC.DELEGATION_READ,nC.DELEGATION_EDIT,nC.FORM_READ,nC.FORM_EDIT,nC.EMAIL_EDIT,nC.CAMPAIGN_READ,nC.DOCUMENT_READ,nC.DOCUMENT_EDIT,nC.WORKFLOW_READ,nC.WORKFLOW_EDIT,nC.CUSTOM_FIELD_READ,nC.CUSTOM_FIELD_EDIT,nC.SEGMENT_EDIT,nC.MEMBER_CREATE,nC.MEMBER_DELETE,nC.WEEZEVENT_READ,nC.WEEZEVENT_EDIT,nC.DELEGATIONS_SPACE_PARAM_READ,nC.DELEGATIONS_SPACE_PARAM_EDIT,nC.PRINT_CONFIG_READ,nC.PRINT_CONFIG_EDIT,nC.PRINT,nC.TICKET_ID_REGENERATE]),q9=V9([nC.POSITION_READ,nC.COMMENT_READ,nC.ACCREDITATION_READ,nC.DELEGATION_READ,nC.FORM_READ,nC.CAMPAIGN_READ,nC.DOCUMENT_READ,nC.WORKFLOW_READ,nC.WEEZEVENT_READ,nC.DELEGATIONS_SPACE_PARAM_READ,nC.PRINT_CONFIG_READ]),H9=V9([nC.POSITION_READ,nC.POSITION_EDIT,nC.COMMENT_READ,nC.MEMBER_ASSIGN,nC.CAMPAIGN_SEND,nC.CAMPAIGN_READ]),Y9=V9([nC.POSITION_READ,nC.COMMENT_READ]),Z9=V9([nC.DELEGATION_READ]);var K9;let X9=class extends ju{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",accessLevel:e?.accessLevel??rt.Position,permissions:e?.permissions??H9}}schema(){return Jl.Ik().shape({role:Jl.Ik().shape({name:Jl.Yj().required(this.t("le_nom_est_requ_61536")),description:Jl.Yj().required(this.t("la_description_46559")),accessLevel:Jl.Yj().required(this.t("le_niveau_d_acc_94726")).oneOf(Di,this.t("le_niveau_d_acc_94726")),permissions:Jl.Yj().matches(new RegExp(`^[01]{${U9}}$`),this.t("le_format_des_p_68818")).required(this.t("le_format_des_p_68818"))}).required()}).required()}};X9=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(K9=void 0!==ts&&ts)?K9:Object])],X9);const Q9=({children:e,disabled:n,permission:t,subtext:s,permissions:o,change:a})=>(0,i.jsx)(oI,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:n,subtext:s,value:"1"===o[t],onChange:e=>a("role.permissions",function(e,n,t){return[...e].toSpliced(n,1,t).join("")}(o,t,e?"1":"0")),children:e}),J9=e=>{const{translate:n}=fc(),t=e.roleInput.accessLevel;return(0,i.jsxs)(Zx,{heading:n("accr_ditations_39450"),children:[(0,i.jsxs)(FA,{heading:n("accr_ditations_39450"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.ACCREDITATION_READ,permissions:e.roleInput.permissions,children:n("voir_les_accr_d_34867")}),t!==rt.DelegationCategory&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.ACCREDITATION_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_accr_86042")})]}),(0,i.jsx)(FA,{heading:n("mod_ration_09947"),children:(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_ACCREDIT,permissions:e.roleInput.permissions,children:n("accr_diter_les_48281")})})]})},eee=e=>{const n=os(),t=e.roleInput.accessLevel===rt.Organization||e.roleInput.accessLevel===rt.Event,s=e.roleInput.accessLevel===rt.Organization||e.roleInput.accessLevel===rt.Event,o=e.roleInput.accessLevel===rt.DelegationCategory,a=!o,r=e.roleInput.accessLevel===rt.Organization||e.roleInput.accessLevel===rt.Event||o,d=!o;return(0,i.jsxs)(Zx,{heading:n("communication_05277"),children:[t&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(FA,{heading:n("Form_plural"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.FORM_READ,permissions:e.roleInput.permissions,children:n("voir_les_formul_55824")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.FORM_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_form_10612")})]})}),a&&(0,i.jsxs)(FA,{heading:n("Campaigns"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.CAMPAIGN_READ,permissions:e.roleInput.permissions,children:n("voir_les_campag_02148")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.CAMPAIGN_SEND,permissions:e.roleInput.permissions,children:n("envoyer_une_cam_35768")})]}),s&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(FA,{heading:n("e_mails_09850"),children:(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.EMAIL_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_e_ma_05609")})})}),r&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(FA,{heading:n("Documents"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.DOCUMENT_READ,permissions:e.roleInput.permissions,children:n("voir_les_docume_33988")}),d&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.DOCUMENT_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_docu_87778")})]})})]})},nee=()=>{const e=os();return(0,i.jsx)(Zx,{heading:e("communication_05277"),children:(0,i.jsx)(FA,{heading:e("Campaigns"),children:(0,i.jsx)(Vm,{borderRadius:"$1",height:20})})})},tee=e=>{const n=os();return(0,i.jsx)(Zx,{heading:n("informations_su_20567"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(pu,{disabled:e.disabled,label:n("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(Qx,{disabled:e.disabled,label:n("Description"),name:"role.description"}),(0,i.jsxs)(Qy,{label:n("niveau_d_acc_s_29898"),name:"role.accessLevel",state:e.disabled||e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:rt.Organization,children:n("administrateur_10076")}),(0,i.jsx)("option",{value:rt.Event,children:n("administrateur_99393")}),(0,i.jsx)("option",{value:rt.Position,children:n("responsable_de_82794")}),(0,i.jsx)("option",{value:rt.DelegationCategory,children:n("responsable_de_75445")})]})]})})},iee=()=>{const e=os();return(0,i.jsx)(Zx,{heading:e("informations_su_20567"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"6",children:[(0,i.jsx)(Vm,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(Vm,{borderRadius:"$2",height:126,width:"100%"})]})})},see=e=>{const n=os(),{user:t}=ps(),s=e.roleInput.accessLevel,o=s===rt.Organization||s===rt.Event,a=s===rt.Organization||s===rt.Event||s===rt.Position,r=s===rt.Organization||s===rt.Event||s===rt.Position,d=s===rt.Organization||s===rt.Event||s===rt.DelegationCategory,l=s===rt.Organization||s===rt.Event,c=s===rt.Organization||s===rt.Event,u=s===rt.Organization||s===rt.Event,m=(0,sc.A)([(0,i.jsxs)(FA,{heading:n("membres_11310"),children:[o&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_CREATE,permissions:e.roleInput.permissions,children:n("cr_er_des_membr_28893")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_memb_39894")}),o&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_DELETE,permissions:e.roleInput.permissions,children:n("supprimer_les_m_98024")}),a&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_AVAILABILITIES_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_disp_75220")}),o&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.TICKET_ID_REGENERATE,permissions:e.roleInput.permissions,children:n("r_g_n_rer_le_co_27385")})]},"members"),r?(0,i.jsxs)(FA,{heading:n("commentaires_96492"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.COMMENT_READ,permissions:e.roleInput.permissions,subtext:n("sans_cette_perm_08373",n("Private")),children:n("lire_les_commen_55215")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.COMMENT_ADD,permissions:e.roleInput.permissions,children:n("ajouter_et_supp_32493")})]}):null,d?(0,i.jsxs)(FA,{heading:n("d_l_gations_78318"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.DELEGATION_READ,permissions:e.roleInput.permissions,children:n("voir_les_d_l_ga_71959")}),s!==rt.DelegationCategory&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.DELEGATION_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_d_l_60281")}),l&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.DELEGATIONS_SPACE_PARAM_READ,permissions:e.roleInput.permissions,children:n("voir_les_param_20270")}),l&&(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.DELEGATIONS_SPACE_PARAM_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_para_51447")})]}):null,c?(0,i.jsx)(FA,{heading:n("vues_personnali_80652"),children:(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.SEGMENT_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_vues_70658")})}):null,u?(0,i.jsxs)(FA,{heading:n("champs_de_formu_64126"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.CUSTOM_FIELD_READ,permissions:e.roleInput.permissions,children:n("voir_les_champs_59185")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.CUSTOM_FIELD_EDIT,permissions:e.roleInput.permissions,children:n("_diter_les_cham_47733")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled||(g=t.email,!["aurelie.priez@weezevent.com","benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","jean-charles.wielfaert@weezevent.com","lucie.doumeng@gmail.com","marie.wielfaert@weezevent.com","matthieu.ravey@weezevent.com","victor.gasquet@weezevent.com"].includes(g)),permission:nC.CUSTOM_FIELD_DECRYPT,permissions:e.roleInput.permissions,children:n("d_chiffrer_les_23688")})]}):null]);var g;return(0,i.jsx)(Zx,{heading:n("population_38615"),children:m.map((e,n)=>(0,i.jsx)(de.Fragment,{children:e},n))})},oee=()=>{const e=os();return(0,i.jsxs)(Zx,{heading:e("membres_11310"),subtitle:e("permissions_rel_37045"),children:[(0,i.jsx)(FA,{heading:e("profil_du_membr_68116"),children:(0,i.jsx)(Vm,{borderRadius:"$1",height:20})}),(0,i.jsxs)(FA,{heading:e("commentaires_96492"),children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:40}),(0,i.jsx)(Vm,{borderRadius:"$1",height:20})]}),(0,i.jsx)(FA,{heading:e("disponibilit_s_49923"),children:(0,i.jsx)(Vm,{borderRadius:"$1",height:20})})]})},aee=e=>{const{translate:n}=fc();return(0,i.jsxs)(Zx,{heading:n("options_53186"),children:[(0,i.jsxs)(FA,{heading:n("automatisations_60045"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.WORKFLOW_READ,permissions:e.permissions,children:n("voir_les_automa_58340")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.WORKFLOW_EDIT,permissions:e.permissions,children:n("_diter_les_auto_80436")})]}),(0,i.jsxs)(FA,{heading:"Weezeent",children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.WEEZEVENT_READ,permissions:e.permissions,children:n("voir_les_param_22835")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.WEEZEVENT_EDIT,permissions:e.permissions,children:n("_diter_les_para_16626")})]}),(0,i.jsxs)(FA,{heading:n("printing_06197"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.PRINT_CONFIG_READ,permissions:e.permissions,children:n("read_the_config_50527")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.PRINT_CONFIG_EDIT,permissions:e.permissions,children:n("edit_the_config_24355")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.PRINT,permissions:e.permissions,children:n("print_22517")})]})]})},ree=e=>{const{translate:n}=fc();return(0,i.jsxs)(Zx,{heading:n("organisation_71863"),children:[(0,i.jsx)(FA,{heading:n("_v_nements_53672"),children:(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.EVENT_EDIT,permissions:e.permissions,children:n("_diter_les_v_n_84914")})}),(0,i.jsxs)(FA,{heading:n("param_tres_78420"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.ORGANIZATION_PARAM_READ,permissions:e.permissions,children:n("voir_les_param_41674")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.ORGANIZATION_PARAM_EDIT,permissions:e.permissions,children:n("_diter_les_para_86184")})]}),(0,i.jsxs)(FA,{heading:n("utilisateurs_et_83787"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.ORGANIZATION_USER_READ,permissions:e.permissions,children:n("voir_les_utilis_06462")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.ORGANIZATION_USER_EDIT,permissions:e.permissions,children:n("_diter_les_util_98017")})]})]})},dee=e=>{const n=os();return(0,i.jsxs)(Zx,{heading:n("missions_63972"),children:[(0,i.jsxs)(FA,{heading:n("missions_63972"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.POSITION_READ,permissions:e.permissions,children:n("voir_les_missio_71964")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.POSITION_EDIT,permissions:e.permissions,subtext:n("si_le_r_le_est_05344"),children:n("_diter_les_miss_75420")})]}),(0,i.jsxs)(FA,{heading:n("affectation_plural"),children:[(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_ASSIGN,permissions:e.permissions,children:n("affecter_des_me_26669")}),(0,i.jsx)(Q9,{change:e.change,disabled:e.disabled,permission:nC.MEMBER_ASSIGNMENT_STATE_EDIT,permissions:e.permissions,subtext:n("permet_notammen_90746",n("PreAssigned")),children:n("changer_le_stat_34124")})]})]})},lee=()=>{const e=os();return(0,i.jsxs)(Zx,{heading:e("missions_63972"),children:[(0,i.jsx)(FA,{heading:e("informations_su_61022"),children:(0,i.jsx)(Vm,{borderRadius:"$1",height:60})}),(0,i.jsxs)(FA,{heading:e("affectation"),children:[(0,i.jsx)(Vm,{borderRadius:"$1",height:20}),(0,i.jsx)(Vm,{borderRadius:"$1",height:40})]})]})},cee=e=>{const{translate:n}=fc(),t=e.values.role.accessLevel,s=t===rt.Organization,o=t===rt.Organization||t===rt.Event||t===rt.Position,a=t===rt.Organization||t===rt.Event||t===rt.DelegationCategory,r=t===rt.Organization||t===rt.Event||t===rt.Position||t===rt.DelegationCategory,d=t===rt.Organization||t===rt.Event;return(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(ud,{name:"role.accessLevel",onChange:n=>{n===rt.Organization?e.change("role.permissions",B9):n===rt.Event?e.change("role.permissions",G9):n===rt.DelegationCategory?e.change("role.permissions",Z9):n===rt.Position&&e.change("role.permissions",H9)}}),!e.isCustom&&(0,i.jsxs)(Tc,{alertStyle:"warning",children:[(0,i.jsx)(zc,{children:n("impossible_de_m_46897")}),(0,i.jsx)(Oc,{children:n("ce_r_le_est_pr_71742")})]}),(0,i.jsx)(tee,{disabled:e.disabled,isEdit:e.isEdit}),(0,i.jsx)(see,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),s&&(0,i.jsx)(ree,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),o&&(0,i.jsx)(dee,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),a&&(0,i.jsx)(J9,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),r&&(0,i.jsx)(eee,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),d&&(0,i.jsx)(aee,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),e.children]})},uee=({children:e})=>(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(iee,{}),(0,i.jsx)(oee,{}),(0,i.jsx)(lee,{}),(0,i.jsx)(nee,{}),e]}),mee=()=>{const{history:e,translate:n,params:{organizationId:t}}=fc(),s=(0,de.useRef)(null),o=ss(X9),{mutate:a}=function(e={}){return ds("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n roleCreate(organizationId: $organizationId, role: $role) {\n id\n }\n}\n",e)}(),{showNotification:r}=Sy(),{reload:d}=Yy();return fm(n("cr_ation_d_un_r_27933")),(0,i.jsx)(Fc,{customErrorRef:s,height:1,initialValues:{role:o.default(null)},render:({form:e,handleSubmit:o,submitting:a,values:r})=>(0,i.jsx)(Nx,{category:n("cr_ation_d_un_r_27933"),color:"dark",fallbackClosePath:Wo.ORGANIZATION_PARAMETERS_ROLES(t),heading:n("nouveau_r_le_20981"),children:(0,i.jsx)(kx,{ref:s,children:(0,i.jsx)(cee,{change:e.change,disabled:!1,isCustom:!0,isEdit:!1,values:r,children:(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:a,textAlign:"center",onClick:o,children:n("cr_er_le_r_le_55678")})})})})}),schema:o.schema(),onSubmit:async({role:i})=>{await a({organizationId:t,role:i}),d(),r({color:"success",text:n("le_r_le_a_bien_55424")}),e.goBack(Wo.ORGANIZATION_PARAMETERS_ROLES(t))}})},gee=()=>{const{history:e,translate:n,params:{organizationId:t,roleId:s}}=fc(),o=(0,de.useRef)(null),a=ss(X9),{mutate:r}=function(e={}){return ds("mutation RoleUpdate($organizationId: OrganizationId!, $roleId: RoleId!, $role: RoleInput!) {\n roleUpdate(organizationId: $organizationId, roleId: $roleId, role: $role) {\n id\n }\n}\n",e)}(),{data:d,isLoading:l}=rs("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:t,roleId:s},[],undefined);const{canOrganizationUserEdit:c}=iC(),{showNotification:u}=Sy();fm(n("mise_jour_de_17055",d.organization?.role.name));const m=(0,de.useMemo)(()=>c&&d.organization?.role.type===dt.Custom,[d.organization,c]);return l?(0,i.jsx)(hee,{}):(0,i.jsx)(Fc,{customErrorRef:o,height:1,initialValues:{role:a.default(d.organization.role)},render:({form:e,handleSubmit:s,submitting:a,values:r})=>(0,i.jsx)(Nx,{button:m?(0,i.jsx)(yc,{css:{flexShrink:0},isLoading:a,onClick:s,children:n("modifier_le_r_l_58957")}):void 0,category:n("mise_jour_de_17055",d.organization.role.name),color:"dark",fallbackClosePath:Wo.ORGANIZATION_PARAMETERS_ROLES(t),heading:d.organization.role.name,children:(0,i.jsx)(kx,{ref:o,children:(0,i.jsx)(cee,{change:e.change,disabled:!m,isCustom:d.organization.role.type===dt.Custom,isEdit:!0,values:r,children:m&&(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{isLoading:a,textAlign:"center",onClick:s,children:n("modifier_le_r_l_58957")})})})})}),schema:a.schema(),onSubmit:async({role:i})=>{m&&(await r({organizationId:t,roleId:s,role:i}),u({color:"success",text:n("le_r_le_a_bien_48312")}),e.goBack(Wo.ORGANIZATION_PARAMETERS_ROLES(t)))}})},hee=()=>{const{organizationId:e}=ls();return(0,i.jsx)(Nx,{fallbackClosePath:Wo.ORGANIZATION_PARAMETERS_ROLES(e),heading:(0,i.jsx)(Vm,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)(kx,{children:(0,i.jsx)(uee,{})})})};var pee,Iee,fee,xee,_ee,jee,vee,See,yee,Cee,bee,Aee,Eee,wee,$ee,Tee,zee,Oee,Ree,Dee,Mee,Pee,kee,Fee,Nee,Lee,Uee,Vee,Bee,Wee,Gee,qee,Hee,Yee,Zee,Kee,Xee,Qee,Jee,ene,nne,tne,ine,sne,one,ane,rne,dne,lne,cne,une,mne,gne,hne,pne,Ine,fne,xne,_ne,jne,vne,Sne,yne,Cne,bne,Ane,Ene,wne,$ne,Tne,zne,One,Rne,Dne,Mne,Pne,kne,Fne,Nne,Lne,Une,Vne,Bne,Wne,Gne,qne,Hne,Yne,Zne,Kne,Xne,Qne,Jne,ete,nte,tte,ite,ste,ote,ate,rte,dte,lte,cte,ute,mte,gte,hte,pte,Ite,fte,xte,_te,jte,vte,Ste,yte,Cte,bte,Ate,Ete,wte,$te,Tte,zte,Ote,Rte,Dte,Mte,Pte,kte,Fte,Nte,Lte,Ute,Vte,Bte,Wte,Gte,qte,Hte,Yte,Zte,Kte,Xte,Qte,Jte,eie,nie,tie,iie,sie,oie,aie,rie,die,lie,cie,uie,mie,gie,hie,pie,Iie,fie,xie;function _ie(){return _ie=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const e=os();return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Xl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(Zr,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(jie,{})}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",nm)}),(0,i.jsxs)(Zr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",tm,nm)]})]})})};var Sie;function yie(){return yie=Object.assign?Object.assign.bind():function(e){for(var n=1;n{const e=os();return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Xl,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(Zr,{width:280,children:(0,i.jsx)(Cie,{})}),(0,i.jsx)(Zr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",nm)}),(0,i.jsxs)(Zr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",tm,nm)]})]})})},Aie=()=>{const e=os(),{user:n}=ps();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",im(em(n?.language,new URL(location.href).searchParams)),nm)}})},Eie=()=>{const{history:e,translate:n,params:{organizationId:t}}=fc(),{data:s,loader:o}=rs('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:t},[],undefined);const a=ss(MM),r=ss(ec),{mutate:d}=function(e={}){return ds("mutation UserInfoAndTermsUpdate(\n $userInfoId: UsersInfoId!\n $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n id\n }\n}\n",e)}(),l=(0,de.useRef)(null),{reload:c}=Yy();return o||(0,i.jsx)(Fc,{customErrorRef:l,height:1,initialValues:{userInfoAndTerms:a.userInfoAndTermsInputDefault(s.user)},render:({handleSubmit:e})=>(0,i.jsxs)($j,{ref:l,onClose:_e,children:[(0,i.jsx)(Mc,{}),(0,i.jsx)(Zx,{centerHeader:!0,heading:n("conditions_g_n_79662"),subtitle:n("accepter_nos_co_49122"),children:(0,i.jsxs)(Xl,{direction:"column",gap:"4",children:[(0,i.jsx)(Bx,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(Aie,{})}),(0,i.jsxs)(Xl,{gap:"4",children:[(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)(pu,{label:(0,i.jsx)($S,{children:n("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(Kj,{label:(0,i.jsx)($S,{children:n("Phone")}),prefix:"userInfoAndTerms.phone."})]})}),(0,i.jsx)(Lx,{children:(0,i.jsx)(yc,{textAlign:"center",onClick:e,children:n("mettre_jour_85141")})})]}),validate:r.validateForForm(a.updateUserInfoAndTermsSchema()),width:1,onSubmit:async n=>{await d({userInfoId:s.user.userInfo.id,userInfoAndTermsInput:n.userInfoAndTerms}),c(),e.location.state?e.push(e.location.state):e.push(Os.ORGANIZATION({organizationId:t}))}})},wie=()=>{const{organization:e}=Yy(),{canCustomFieldEdit:n,canCustomFieldRead:t,canDelegationEdit:s,canEventEdit:o,canOrganizationParamEdit:a,canOrganizationParamRead:r,canOrganizationUserEdit:d,canOrganizationUserRead:l}=iC(),c=Cg();return(0,de.useEffect)(()=>{!function(e){const n=Br({colors:{...ED(e)}});document.getElementById("heavent-react-hook")?.classList.add(n.toString())}(Mv(e.id)?.theme)},[e.id]),(0,i.jsxs)(Xr.dO,{children:[o&&(0,i.jsx)(Xr.qh,{path:eo.EVENTS_IMPORT({organizationId:":organizationId"}),children:(0,i.jsx)(xB,{})}),o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(mB,{})}),o&&(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(gB,{})}),s&&(0,i.jsx)(Xr.qh,{path:vo.DELEGATION_CATEGORY_UPDATE({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(iB,{})}),(0,i.jsx)(Xr.qh,{path:eo.EVENTS({organizationId:":organizationId"}),children:c?(0,i.jsx)(QB,{}):(0,i.jsx)($M,{children:(0,i.jsx)(XB,{})})}),(0,i.jsx)(Xr.qh,{path:eo.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(s8,{})}),n&&(0,i.jsx)(Xr.qh,{path:av.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(HR,{})}),n&&(0,i.jsx)(Xr.qh,{path:av.UPDATE({organizationId:":organizationId",customFieldId:":customFieldId"}),children:(0,i.jsx)(YR,{})}),t&&(0,i.jsx)(Xr.qh,{path:av.CUSTOM_FIELDS({organizationId:":organizationId"}),children:(0,i.jsx)($M,{children:(0,i.jsx)(XV,{})})}),a&&(0,i.jsx)(Xr.qh,{path:Wo.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(A8,{})}),a&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(E8,{})}),r&&(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(w8,{})}),d&&(0,i.jsx)(Xr.qh,{path:Wo.CREATE_ORGANIZATION_PARAMETERS_GROUP(":organizationId"),children:(0,i.jsx)(D8,{})}),d&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_ORGANIZATION_PARAMETERS_GROUP(":organizationId",":groupId"),children:(0,i.jsx)(M8,{})}),d&&(0,i.jsx)(Xr.qh,{path:Wo.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(mee,{})}),l&&(0,i.jsx)(Xr.qh,{path:Wo.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(gee,{})}),(0,i.jsx)(Xr.qh,{path:Wo.ORGANIZATION_PARAMETERS(":organizationId"),children:c?(0,i.jsx)(e7,{}):(0,i.jsx)($M,{children:(0,i.jsx)(L9,{})})}),(0,i.jsx)(Xr.qh,{path:Ev.ORGANIZATION_MEMBERS({organizationId:":organizationId"}),children:(0,i.jsx)(v8,{})}),(0,i.jsx)(Xr.qh,{path:Ms.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(EV,{})}),(0,i.jsx)(Xr.qh,{path:Os.IS_EXPIRED(Os.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)($M,{children:(0,i.jsx)(bie,{})})}),(0,i.jsx)(Xr.qh,{path:Os.IS_BLOCKED(Os.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)($M,{children:(0,i.jsx)(vie,{})})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)(Eie,{})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:eo.EVENTS({organizationId:e.id}),replace:!0})})]})},$ie=()=>(0,i.jsx)(Hy,{children:(0,i.jsx)(wie,{})}),Tie=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[n,t]=(0,de.useState)(!1),{searchParams:s}=new URL(location.href),o=function(e){if(w(e)){const[n,t]=e.split(",");if(w(n)&&w(t)){const e=parseFloat(n),i=parseFloat(t);return isNaN(e)||isNaN(i)?null:{lat:e,lng:i}}return null}return null}(s.get("center")),a=s.get("acronymIcon")||"icon",r=s.get("zoom"),d=s.get("hiddenTracesIds")?.split(",").map(e=>parseInt(e,10))??[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(H1,{acronymIcon:a,hiddenTracesIds:d,initialCenter:o,initialZoom:r?parseInt(r,10):null,layer:e.layer,mapOptions:{zoomControl:!1},positions:e.positions.nodes,showMarker:!1,traces:e.traces,onMapTilesloaded:()=>{t(!0)}})}),n&&(0,i.jsx)(pd,{})]})},zie=()=>{const{eventId:e,positionId:n}=ls(),{data:t,loader:s}=rs("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:n},[Ko.TraceFragment],undefined);const[o,a]=(0,de.useState)(!1);if(s)return s;{const e=t.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Zr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(gd,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:ad(e),traces:e.traces,onTilesloaded:()=>{a(!0)}})}),o&&(0,i.jsx)(pd,{})]})}},Oie=()=>{const e=os(),n=new URL(location.href).searchParams,t=n.get("eventName")||n.get("organizationName")||"",s=`${ee.HEAVENT_API_URL}/users/${n.get("userId")||""}/`,o=n.get("eventId")?`${s}blacklist-event?${n}`:`${s}blacklist-organization?${n}`;return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",gap:"7",width:640,children:[(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",t)})]}),(0,i.jsx)(yc,{color:"error",textAlign:"center",onClick:()=>{window.open(o,"_blank")},children:e("oui_je_souhait_20141")})]})})},Rie=e=>{const n=ss(Wg),t=(0,de.useMemo)(()=>(0,sc.A)([w(e.accreditation.slotName)?e.accreditation.slotName:null,e.accreditation.date?.isValid?n.toLocaleString(e.accreditation.date,da.DateOnly.WeekdayShortMonthShort):null]).join(" • "),[n,e.accreditation]);return(0,i.jsxs)(Xl,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"14px $6","&:last-child":{borderBottom:"none"}},gap:"4",width:1,children:[(0,i.jsx)(UI,{color:e.accreditation.color,icon:e.accreditation.icon,size:"sm"}),(0,i.jsxs)(Xl,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{css:{ellipsis:!0},font:"gray900 textSm semiBold",title:e.accreditation.accreditationName,width:1,children:e.accreditation.accreditationName}),w(t)&&(0,i.jsx)(Zr,{css:{ellipsis:!0,textTransform:"capitalize"},font:"gray500 textSm regular",width:1,children:t})]})]})},Die=e=>{const{translate:n}=fc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",borderBottom:"1px solid $gray200",padding:"10px $6"},gap:"2",children:[(0,i.jsx)(Zr,{css:{letterSpacing:"0.6px",textTransform:"uppercase"},font:"gray500 textXs medium",children:e.name}),(0,i.jsx)(Zr,{font:"gray500 textXs regular",children:n("accreditation",e.accreditations.length)})]}),e.accreditations.map(e=>(0,i.jsx)(Rie,{accreditation:e},e.accreditationSlotId))]})},Mie=()=>{const{translate:e,params:{userInfoId:n,eventId:t}}=fc(),s=(0,de.useMemo)(()=>{const e=new URL(location.href).searchParams;return{[se]:e.get("x-heavent-signature")??"",[oe]:e.get("x-heavent-expires")??"",[ae]:`accreditations-unregister:${n}:${t}`}},[n,t]),{data:o,loader:a}=rs("query UserAccreditationsUnregister($userInfoId: UsersInfoId!, $eventId: EventId!) {\n userInfo(id: $userInfoId) {\n volunteerRegistration(eventId: $eventId) {\n accreditationsUsersInfos {\n id\n accreditationProfileId\n checkInAt\n\n accreditation {\n name\n color\n icon\n }\n\n accreditationCategory {\n id\n name\n }\n\n accreditationSlot {\n id\n name\n date\n isHidden\n }\n }\n }\n }\n}\n",{userInfoId:n,eventId:t},[],{headers:s}),r=(0,de.useMemo)(()=>function(e){const n=e.userInfo?.volunteerRegistration?.accreditationsUsersInfos??[];return(0,Tg.A)(n.filter(e=>!e.accreditationProfileId&&!e.checkInAt).map(e=>({accreditationSlotId:e.accreditationSlot.id,accreditationCategoryId:e.accreditationCategory.id,accreditationCategoryName:e.accreditationCategory.name,accreditationName:e.accreditation.name,color:e.accreditation.color,date:e.accreditationSlot.date??null,icon:e.accreditation.icon,slotName:e.accreditationSlot.isHidden?"":e.accreditationSlot.name})),[e=>e.accreditationCategoryName.toLowerCase(),e=>e.date?.toMillis()??-1/0,e=>e.accreditationName.toLowerCase(),e=>e.slotName.toLowerCase()])}(o),[o]),d=(0,de.useMemo)(()=>{const e=new Map;return r.forEach(n=>{const t=e.get(n.accreditationCategoryId)??[];t.push(n),e.set(n.accreditationCategoryId,t)}),Array.from(e.values())},[r]);return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",overflowY:"auto",padding:"$7 $3"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsxs)(Xl,{css:{background:"white",bd:!0,maxHeight:"100%",overflow:"hidden",width:"100%","@desktop":{width:"840px"}},direction:"column",children:[(0,i.jsxs)(Xl,{css:{borderBottom:"1px solid $gray200",padding:"$5 $6 $4"},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:e("vos_accreditati")}),(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:e("retirez_les_acc")})]}),a?(0,i.jsx)(Xl,{css:{padding:"$7"},justify:"center",children:a}):0===r.length?(0,i.jsx)(Xl,{css:{padding:"$7"},justify:"center",children:(0,i.jsx)(Zr,{font:"gray500 textSm regular",children:e("no_accreditations")})}):(0,i.jsx)(Zr,{css:{flex:"1",overflowY:"auto"},children:d.map(e=>(0,i.jsx)(Die,{accreditations:e,name:e[0].accreditationCategoryName},e[0].accreditationCategoryId))})]})})},Pie=()=>{const{translate:e,params:{ticketId:n}}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1),r=`${ee.HEAVENT_API_URL}/users/${n}/check-in`;return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Xl,{justify:"center",width:1,children:o?(0,i.jsx)(Lm,{color:"success",leftIcon:"check",children:e("votre_pointage_47695")}):(0,i.jsx)(yc,{isLoading:t,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(r),a(!0),s(!1)},children:e("point_sur_ma_m_52527")})})})})},kie=()=>{const{translate:e,params:{ticketId:n}}=fc(),[t,s]=(0,de.useState)(!1),[o,a]=(0,de.useState)(!1),r=`${ee.HEAVENT_API_URL}/users/${n}/check-out`;return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Xl,{justify:"center",width:1,children:o?(0,i.jsx)(Lm,{color:"success",leftIcon:"check",children:e("votre_d_pointag_86150")}):(0,i.jsx)(yc,{isLoading:t,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(r),a(!0),s(!1)},children:e("d_point_sur_ma_60601")})})})})},Fie=()=>{const{translate:e,params:{userInfoId:n,eventId:t}}=fc(),s=(0,de.useMemo)(()=>new URL(location.href).searchParams.toString(),[]),[o,a]=(0,de.useState)(!1),[r,d]=(0,de.useState)(!1),[l,c]=(0,de.useState)(!1),u=`${ee.HEAVENT_API_URL}/users/${n}/event/${t}/unregister?${s}`;return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",overflow:"hidden",px:"$3"},direction:"column",gap:"7",height:1,justify:"center",width:1,children:(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$7",width:"100%","@desktop":{width:"640px"}},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textXl semiBold",children:e("_tes_vous_s_r_d_36428")}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{justify:"center",width:1,children:r?(0,i.jsx)(Lm,{color:"success",leftIcon:"check",children:e("vous_avez_t_d_46799")}):l?(0,i.jsx)(Lm,{color:"error",leftIcon:"triangle-exclamation",children:e("erreur_dans_le_52844")}):(0,i.jsx)(yc,{isLoading:o,leftIcon:"check",textAlign:"center",onClick:async()=>{try{a(!0),200===(await fetch(u)).status?(d(!0),a(!1)):(c(!0),a(!1))}catch{d(!0),a(!1)}},children:e("se_d_sinscrire_87896")})})]})})},Nie=()=>{const{translate:e,params:{organizationId:n,userInfoId:t,customFieldSlug:s,value:o}}=fc(),a=(0,de.useMemo)(()=>new URL(location.href).searchParams.toString(),[]),{data:r,loader:d}=wl({organizationId:n,slug:s}),[l,c]=(0,de.useState)(!1),[u,m]=(0,de.useState)(!1),[g,h]=(0,de.useState)(!1),p=r.organization?.customField.name??"",I=r.organization?.customField.description??"",f=(0,de.useMemo)(()=>{if(r.organization){const n=r.organization.customField;return n.fieldType===_n.Select?n.values.find(({id:e})=>e===parseInt(o,10))?.value:e("je_valide_79615")}return""},[r.organization]),x=`${ee.HEAVENT_API_URL}/users/${t}/field/${s}/update/${o}?${a}`;return(0,i.jsxs)(Xl,{align:"center",css:{background:"$gray50",overflow:"hidden",px:"$3"},direction:"column",gap:"7",height:1,justify:"center",width:1,children:[3720===n&&(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"3",children:[(0,i.jsx)(Zr,{textAlign:"center",width:300,children:(0,i.jsx)("img",{src:`${ee.HEAVENT_ASSETS_URL}/logo_planetb.png`,width:"100%"})}),(0,i.jsx)(Zr,{css:{color:"#60624e",fontFamily:"$roboto",fontSize:"30px",textTransform:"uppercase"},textAlign:"center",children:"Invitation planet b - 30 ans"}),(0,i.jsx)(Zr,{css:{color:"#60624e",fontFamily:"$roboto",fontSize:"16px"},textAlign:"center",children:"Au plaisir de vous retrouver pour fêter ensemble les 30 ans de PLANET B !"})]}),d||(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$7",width:"100%","@desktop":{width:"640px"}},direction:"column",children:[(0,i.jsx)(Zr,{font:"gray900 textXl semiBold",children:p}),(0,i.jsx)(ic,{height:"1"}),(0,i.jsx)(Zr,{color:"gray500",textAlign:"center",children:I}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{justify:"center",width:1,children:u?(0,i.jsx)(Lm,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):g?(0,i.jsx)(Lm,{color:"error",leftIcon:"triangle-exclamation",children:e("erreur_dans_le_52844")}):(0,i.jsx)(yc,{isLoading:l,leftIcon:"check",textAlign:"center",onClick:async()=>{try{c(!0),200===(await fetch(x)).status?(m(!0),c(!1)):(h(!0),c(!1))}catch{m(!0),c(!1)}},children:f})})]})]})},Lie=()=>{const{translate:e,params:{organizationId:n,customFieldSlug:t}}=fc(),{data:s,loader:o}=wl({organizationId:n,slug:t}),[a,r]=(0,de.useState)(!1),[d,l]=(0,de.useState)(!1),[c,u]=(0,de.useState)(!1),[m,g]=(0,de.useState)(""),[h,p]=(0,de.useState)(""),I=s.organization?.customField.name??"",f=s.organization?.customField.description??"",x=`${ee.HEAVENT_API_URL}/users/organization/${n}/update-by-ticket-id`;return(0,i.jsx)(Xl,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:o||(0,i.jsxs)(Xl,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{width:1,children:(0,i.jsx)(Tc,{alertStyle:"success",width:1,onClose:()=>{l(!1)},children:(0,i.jsx)(Oc,{children:e("le_champ_1_36490",I)})})}),(0,i.jsx)(ic,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xl,{width:1,children:(0,i.jsx)(Tc,{alertStyle:"error",width:1,onClose:()=>{u(!1)},children:(0,i.jsx)(Oc,{children:e("le_champ_1_46567",I)})})}),(0,i.jsx)(ic,{height:"6"})]}),(0,i.jsx)(hu,{label:e("TicketId"),value:m,onChange:g}),(0,i.jsx)(ic,{height:"6"}),(0,i.jsx)(hu,{hint:f,label:I,value:h,onChange:p}),(0,i.jsx)(ic,{height:"7"}),(0,i.jsx)(Xl,{justify:"center",width:1,children:(0,i.jsx)(yc,{isLoading:a,textAlign:"center",onClick:async()=>{r(!0),l(!1),u(!1),200===(await fetch(x,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:m,slug:t,value:h})})).status?(l(!0),g(""),p("")):u(!0),r(!1)},children:e("mettre_jour_34131",I)})})]})})},Uie=()=>{const{history:e,translate:n,params:{weezeventOrganizationId:t}}=fc(),{setIsError:s}=(0,de.useContext)(Xf),[o,a]=(0,de.useState)(void 0);return(0,de.useEffect)(()=>{let e=!1;return fe().then(e=>function(e,n={}){return xa("query WeezeventOrganizatio($id: Int) {\n organization: organizationByWeezeventId(id: $id) {\n id\n }\n}\n",{...n,variables:e,fragments:[]})}({id:parseInt(t,10)},{token:e})).then(({organization:n})=>{e||a(n?.id??null)},n=>{e||(function(e){return Array.isArray(e)&&e.some(e=>"graphql-100"===e?.code)}(n)?a(null):s(!0,n))}),()=>{e=!0}},[t,s]),void 0===o?(0,i.jsx)(_c,{}):null!==o?(0,i.jsx)(Xr.rd,{to:Os.ORGANIZATION({organizationId:o})}):(0,i.jsxs)(Xl,{align:"center",css:{background:"white"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Xl,{align:"center",css:{background:Lr.colors.blueGray900.value},height:64,justify:"center",width:1,children:(0,i.jsx)(Xl,{align:"center",css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(Du,{})})}),(0,i.jsxs)(Xl,{align:"center",css:{background:"white",flex:"1"},direction:"column",gap:"6",justify:"center",width:1,children:[(0,i.jsx)(Zr,{height:240,width:240,children:(0,i.jsx)("img",{height:"100%",src:Yu.WeezConstruction,width:"100%"})}),(0,i.jsxs)(Xl,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Zr,{font:"gray800 textMd medium",children:n("aucun_compte_we_48865")}),(0,i.jsx)(Zr,{color:"gray500",dangerouslySetInnerHTML:{__html:n("si_vous_d_sirez_19702")}})]}),(0,i.jsxs)(Xl,{gap:"3",children:[(0,i.jsx)(yc,{onClick:()=>window.open("mailto:benjamin.vuitton@gmail.com","_blank"),children:n("nous_contacter_38070")}),(0,i.jsx)(yc,{color:"invisible",onClick:()=>e.push(Wo.CREATE_EVENT_WITH_ORGANIZATION(t)),children:n("essayer_mainten_36692")})]})]})]})},Vie=e=>(0,i.jsx)(Is,{getRedirectPath:()=>Wo.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),Bie=e=>(0,i.jsx)(Is,{getRedirectPath:()=>Wo.HOME,shouldHaveUser:!1,children:e.children});const Wie=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await fe();if(w(e)){const{user:n}=await function(e,n={}){return xa("query CurrentUser {\n user {\n id\n email\n insertedAt\n language\n profile\n termsAcceptedAt\n }\n}\n",{...n,variables:{},fragments:[]})}(0,{token:e});return{user:n}}throw new Error("No token")}();return Jo.wB.defaultLocale=e.user.language.toLowerCase(),e}catch{return{user:null}}})();return await(e=>{const n=new URL(location.href).searchParams.get("lang");let t=null;e&&(t=e.language.toLowerCase()),w(n)&&(t=n);const i=t?`lang=${t}`:"";return dS(`${ee.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},Gie=e=>{const[n,t]=(0,de.useState)(null);return(0,de.useEffect)(()=>{let e=!0;return Wie().then(n=>{e&&t(n)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),n?e.render(n):(0,i.jsx)(_c,{})},qie=window.matchMedia("(max-width: 1200px)"),Hie=(0,de.createContext)({isMobile:!1}),Yie=e=>{const[n,t]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{t(qie.matches),qie.addListener(e=>{t(e.matches)})},[]),(0,i.jsx)(Hie.Provider,{value:{isMobile:n},children:e.children})},Zie=(0,i.jsx)(_c,{});function Kie(e,{redirectOnSuccess:n}={}){const[t,i]=(0,de.useState)(!1),{setIsError:s}=(0,de.useContext)(Xf);let o=null;return t&&(o=Zie),{isLoading:t,loader:o,mutate:async(t,o)=>{i(!0);try{const a=await fe(),r=await((e,n,t)=>xa(e,{variables:n,token:t||void 0}))(e,t,o||a);return!0!==n&&(i(!1),s(!1)),r}catch(e){throw s(!0,e),i(!1),e}}}}const Xie=(0,i.jsx)(_c,{});function Qie(e,n,t,i={}){const[s,o]=(0,de.useState)(!0),[a,r]=(0,de.useState)({}),[d,l]=(0,de.useState)(0),c=(0,de.useRef)([]),{setIsError:u}=(0,de.useContext)(Xf),m=`${Object.keys(n).sort().map(e=>{const t=n[e];return`"${e}":${JSON.stringify(t)}`}).join(",")}|${JSON.stringify([i.token??null,Object.entries(i.headers??{}).sort()])}`,g=()=>{const e=c.current;c.current=[],e.forEach(e=>e())};(0,de.useEffect)(()=>{let s=!1;var a;return o(!0),a=m,(void 0!==i.token?Promise.resolve(i.token):fe()).then(s=>xa(e,{reloadOnNewVersion:!0,variables:n,token:s,headers:i.headers,fragments:t})).then(e=>{s||a!==m||(r(e),u(!1),o(!1),g())},e=>{s||a!==m||(u(!0,e),g())}),()=>{s=!0}},[e,m,d]);let h=null;return s&&(h=Xie),{data:a,isLoading:s,loader:h,reload:()=>new Promise(e=>{c.current.push(e),l(d+1)})}}function Jie(){return function(e,n={}){return Object.fromEntries(Object.entries(e).map(([e,t])=>e.endsWith("Id")||"id"===e?[e,parseInt(t,10)]:n[e]?[e,n[e](t)]:[e,t]))}((0,Xr.g)())}function ese(){const e=(0,Xr.W6)();return{...e,goBack:n=>{"POP"===e.action&&e.length<=2?e.push(n):e.goBack()}}}function nse(){return(0,Xr.zy)()}function tse(){return(0,de.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 n=parseInt(window.window.localStorage.getItem(e),10);return isNaN(n)?null:n}}}catch{return{clear(){},setItem(){},getItem:()=>null,removeItem(){},key:()=>null,get length(){return 0},getItemInt:()=>null}}},[])}var ise;let sse=class extends ju{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return Jl.Ik().shape({usersInfos:Jl.YO().of(Jl.Ik().shape({email:Jl.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:Jl.gl()})).min(1,"Vous devez invité au moins une personne.")})}};sse=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(ise=void 0!==ts&&ts)?ise:Object])],sse);var ose;let ase=class extends ju{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return Jl.Ik().shape({state:Jl.Yj().required(this.t("le_statut_est_r_13164")).oneOf([yt.NotApplicable,yt.PreAssigned,yt.Refused,yt.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return Jl.Ik().shape({state:Jl.Yj().required(this.t("le_statut_est_r_13164")).oneOf([Re.NotApplicable,Re.Refused,Re.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};ase=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(ose=void 0!==ts&&ts)?ose:Object])],ase);var rse;let dse=class extends ju{translationService;constructor(e){super(e),this.translationService=e}};dse=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)(),function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}("design:paramtypes",["function"==typeof(rse=void 0!==ts&&ts)?rse:Object])],dse);let lse=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,n){switch(e){case jt.String:return w(n)?n:"";case jt.StringArray:return Array.isArray(n)?n:[];case jt.RichText:return w(n)?n:"";default:return Ic()}}};lse=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)()],lse);let cse=class{get(){return{[dt.OrganizationAdmin]:{accessLevel:rt.Organization,permissions:B9,nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[dt.OrganizationReader]:{accessLevel:rt.Organization,permissions:W9,nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[dt.EventAdmin]:{accessLevel:rt.Event,permissions:G9,nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[dt.EventReader]:{accessLevel:rt.Event,permissions:q9,nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[dt.PositionEditor]:{accessLevel:rt.Position,permissions:H9,nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[dt.PositionReader]:{accessLevel:rt.Position,permissions:Y9,nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[dt.DelegationCategoryLeader]:{accessLevel:rt.DelegationCategory,permissions:Z9,nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};cse=function(e,n,t,i){var s,o=arguments.length,a=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(n,t,a):s(n,t))||a);return o>3&&a&&Object.defineProperty(n,t,a),a}([(0,Bt._G)()],cse);const use=new Bt.i0(({bind:e})=>{e(cse).toSelf().inSingletonScope(),e(dh).toSelf().inSingletonScope(),e(Wg).toSelf().inSingletonScope(),e(dE).toSelf().inSingletonScope(),e(Nh).toSelf().inSingletonScope(),e(vS).toSelf().inSingletonScope(),e(Dz).toSelf().inSingletonScope(),e(ec).toSelf().inSingletonScope()}),mse=new Bt.i0(({bind:e})=>{e(lW).toSelf().inSingletonScope(),e(wH).toSelf().inSingletonScope(),e(MW).toSelf().inSingletonScope(),e(VH).toSelf().inSingletonScope(),e(iW).toSelf().inSingletonScope(),e(oW).toSelf().inSingletonScope(),e(QO).toSelf().inSingletonScope(),e(Au).toSelf().inSingletonScope(),e(t_).toSelf().inSingletonScope(),e(Ey).toSelf().inSingletonScope(),e(kP).toSelf().inSingletonScope(),e(hF).toSelf().inSingletonScope(),e(YZ).toSelf().inSingletonScope(),e(RR).toSelf().inSingletonScope(),e(FJ).toSelf().inSingletonScope(),e(UJ).toSelf().inSingletonScope(),e(nB).toSelf().inSingletonScope(),e(JV).toSelf().inSingletonScope(),e(sse).toSelf().inSingletonScope(),e($D).toSelf().inSingletonScope(),e(_Z).toSelf().inSingletonScope(),e(UZ).toSelf().inSingletonScope(),e(FZ).toSelf().inSingletonScope(),e(ab).toSelf().inSingletonScope(),e(Rb).toSelf().inSingletonScope(),e(C8).toSelf().inSingletonScope(),e(uD).toSelf().inSingletonScope(),e($B).toSelf().inSingletonScope(),e(fB).toSelf().inSingletonScope(),e(Bj).toSelf().inSingletonScope(),e(O7).toSelf().inSingletonScope(),e(Ub).toSelf().inSingletonScope(),e(tR).toSelf().inSingletonScope(),e(Vu).toSelf().inSingletonScope(),e(uR).toSelf().inSingletonScope(),e(OJ).toSelf().inSingletonScope(),e(BJ).toSelf().inSingletonScope(),e(ID).toSelf().inSingletonScope(),e(kD).toSelf().inSingletonScope(),e(KJ).toSelf().inSingletonScope(),e(VD).toSelf().inSingletonScope(),e(qM).toSelf().inSingletonScope(),e(xF).toSelf().inSingletonScope(),e(vF).toSelf().inSingletonScope(),e(k$).toSelf().inSingletonScope(),e(fV).toSelf().inSingletonScope(),e(cq).toSelf().inSingletonScope(),e(_q).toSelf().inSingletonScope(),e(g1).toSelf().inSingletonScope(),e(KL).toSelf().inSingletonScope(),e(nU).toSelf().inSingletonScope(),e(dT).toSelf().inSingletonScope(),e(bq).toSelf().inSingletonScope(),e(ase).toSelf().inSingletonScope(),e(fT).toSelf().inSingletonScope(),e(Nj).toSelf().inSingletonScope(),e(T8).toSelf().inSingletonScope(),e(Mj).toSelf().inSingletonScope(),e(h0).toSelf().inSingletonScope(),e(w0).toSelf().inSingletonScope(),e(d0).toSelf().inSingletonScope(),e(c0).toSelf().inSingletonScope(),e(L0).toSelf().inSingletonScope(),e(X2).toSelf().inSingletonScope(),e(X9).toSelf().inSingletonScope(),e(PN).toSelf().inSingletonScope(),e(dse).toSelf().inSingletonScope(),e(wu).toSelf().inSingletonScope(),e(am).toSelf().inSingletonScope(),e(p9).toSelf().inSingletonScope(),e(Qz).toSelf().inSingletonScope(),e(R1).toSelf().inSingletonScope(),e(lse).toSelf().inSingletonScope(),e(MM).toSelf().inSingletonScope(),e(LM).toSelf().inSingletonScope(),e(kM).toSelf().inSingletonScope(),e(bF).toSelf().inSingletonScope(),e(aN).toSelf().inSingletonScope()}),gse=new Bt.i0(({bind:e})=>{e(wb).toSelf().inSingletonScope(),e(Eh).toSelf().inSingletonScope(),e(KH).toSelf().inSingletonScope(),e(VW).toSelf().inSingletonScope(),e(jx).toSelf().inSingletonScope(),e(TL).toSelf().inSingletonScope(),e(zV).toSelf().inSingletonScope(),e(vp).toSelf().inSingletonScope(),e(CB).toSelf().inSingletonScope(),e(p8).toSelf().inSingletonScope(),e(kT).toSelf().inSingletonScope(),e(P0).toSelf().inSingletonScope(),e(c4).toSelf().inSingletonScope(),e(Dp).toSelf().inSingletonScope(),e(Lp).toSelf().inSingletonScope()});function hse(){const e=new Bt.mc,n=window.HEAVENT_TRANSLATIONS||{},t=window.HEAVENT_LANGUAGE;if(0===Object.keys(n).length)throw new Error("window.HEAVENT_TRANSLATIONS does not exist");if(!Ju(t))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(ts).toConstantValue(new ts(Ju(t),n)),e.load(use,mse,gse),e}const pse=e=>(0,i.jsx)(is.Provider,{value:{container:hse(),useQuery:Qie,useMutation:Kie,useExecuteQuery:_a,useParams:Jie,useHistory:ese,useLocation:nse,useLocalStorage:tse},children:e.children});var Ise=t(9132);const fse=(0,de.createContext)({}),xse=e=>{const n=(0,de.useCallback)((e,n)=>{ee.USE_MIXPANEL&&Ise.A.track(e,n)},[]);return(0,de.useEffect)(()=>{ee.USE_MIXPANEL&&Ise.A.init(ee.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(fse.Provider,{value:{track:n},children:e.children})};(0,Vt.H)(document.getElementById("heavent-react-hook")).render((0,i.jsx)(de.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)(Gie,{render:n=>(0,i.jsx)(hs.Provider,{value:n,children:(0,i.jsx)(pse,{children:(0,i.jsx)(Yie,{children:(0,i.jsx)(Qf,{children:(0,i.jsx)(vy,{children:(0,i.jsx)(xse,{children:(0,i.jsx)(Ig.Provider,{value:{designSystem:hg},children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})})}),{children:[(0,i.jsx)(()=>((0,de.useEffect)(()=>{fe().then(e=>{"true"===ee.LOG_TOKEN&&console.log(`"${re}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const n=(0,de.useCallback)(e=>{ee.USE_INTERCOM&&window.Intercom&&w(e)&&window.Intercom("boot",{api_base:"https://api-iam.intercom.io",app_id:"tyoj39m1",hide_default_launcher:!0,intercom_user_jwt:e})},[]),t=(0,de.useCallback)(()=>{ee.USE_INTERCOM&&window.Intercom&&window.Intercom("show")},[]);return(0,i.jsx)(By.Provider,{value:{canShow:ee.USE_INTERCOM,show:t,update:n},children:e})},{children:(0,i.jsx)(()=>(0,i.jsx)(Zr,{className:Hr,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(Kr.Kd,{basename:ee.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(Xr.dO,{children:[(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.HOME,children:(0,i.jsx)(Vie,{children:(0,i.jsx)(nv,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(Lie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(Nie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.USER_EVENT_UNREGISTER(":organizationId",":userInfoId",":eventId"),children:(0,i.jsx)(Fie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.USER_ACCREDITATIONS_UNREGISTER(":organizationId",":userInfoId",":eventId"),children:(0,i.jsx)(Mie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.USER_CHECK_IN(":organizationId",":ticketId"),children:(0,i.jsx)(Pie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.USER_CHECK_OUT(":organizationId",":ticketId"),children:(0,i.jsx)(kie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.BACKOFFICE,children:(0,i.jsx)(Vie,{children:(0,i.jsx)(Aj,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(zie,{})}),(0,i.jsx)(Xr.qh,{path:Wo.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(Hl,{})}),(0,i.jsx)(Xr.qh,{path:Wo.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(Tie,{})}),(0,i.jsx)(Xr.qh,{path:Cs(Os.ORGANIZATIONS),children:(0,i.jsx)(Vie,{children:(0,i.jsx)(tv,{})})}),(0,i.jsx)(Xr.qh,{exact:!0,path:Wo.CREATE_EVENT_WITH_ORGANIZATION(":weezeventOrganizationId?"),children:(0,i.jsx)(Vie,{children:(0,i.jsx)(ev,{})})}),(0,i.jsx)(Xr.qh,{path:Os.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(Vie,{children:(0,i.jsx)($ie,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.AUTH,children:(0,i.jsx)(Bie,{children:(0,i.jsx)(cm,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.COGNITO_CALLBACK,children:(0,i.jsx)(Bie,{children:(0,i.jsx)(mm,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(Bie,{children:(0,i.jsx)(Or,{})})}),(0,i.jsx)(Xr.qh,{path:Wo.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(Oie,{})}),(0,i.jsx)(Xr.qh,{path:"/o:weezeventOrganizationId",children:(0,i.jsx)(Vie,{children:(0,i.jsx)(Uie,{})})}),(0,i.jsx)(Xr.qh,{children:(0,i.jsx)(gs,{path:Wo.HOME})})]})})}),{})})]})}))},6687:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6751:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileJPG-aed94d931a32b62e488d.svg"},6954:(e,n,t)=>{"use strict";e.exports=t.p+"img/googleSatellite-0706bcb1678d6e9f219c.png"},6959:(e,n,t)=>{"use strict";e.exports=t.p+"svg/filePNG-c7dc0a7230035611ad34.svg"},7008:(e,n,t)=>{"use strict";e.exports=t.p+"img/accreditation-7f66e46aebab965fa566.png"},7619:(e,n,t)=>{"use strict";e.exports=t.p+"svg/fileBlank-8285380bb91a4d9e73d7.svg"},7648:(e,n,t)=>{"use strict";e.exports=t.p+"svg/weezeventBlankPerson-e5c7b9cf3fcac68f3df8.svg"},8144:(e,n,t)=>{"use strict";e.exports=t.p+"img/asoHomeBackground-e46035697a28c8d248e6.jpg"},8184:(e,n,t)=>{"use strict";e.exports=t.p+"svg/dnsWrongDomain-3954cd8d9805c779a7bc.svg"},8242:e=>{"use strict";e.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+"},8264:(e,n,t)=>{"use strict";e.exports=t.p+"img/userProfile-37c0493d81fa861def54.png"},8301:(e,n,t)=>{"use strict";e.exports=t.p+"img/aso-897aab2a976d58ba485d.png"},8652:(e,n,t)=>{"use strict";e.exports=t.p+"svg/done-d3eb25606e0846af3988.svg"},8798:(e,n,t)=>{"use strict";e.exports=t.p+"svg/recrewteerMarker-a76de3956f8adec5ded2.svg"},9191:()=>{},9848:(e,n,t)=>{"use strict";e.exports=t.p+"svg/filePDF-37cadc96dae9bc3a10ef.svg"},9882:(e,n,t)=>{"use strict";e.exports=t.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=6686)),e.O()}]); //# sourceMappingURL=app-66106d43986058bcde7b.cjs.map