@communecter/cocolight-api-client 1.0.149 → 1.0.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1035.cocolight-api-client.browser.js +1 -0
- package/dist/1035.cocolight-api-client.cjs +1 -0
- package/dist/1035.cocolight-api-client.mjs.js +1 -0
- package/dist/1483.cocolight-api-client.browser.js +1 -0
- package/dist/1483.cocolight-api-client.cjs +1 -0
- package/dist/1483.cocolight-api-client.mjs.js +1 -0
- package/dist/1491.cocolight-api-client.browser.js +1 -0
- package/dist/1491.cocolight-api-client.cjs +1 -0
- package/dist/1491.cocolight-api-client.mjs.js +1 -0
- package/dist/1494.cocolight-api-client.browser.js +1 -0
- package/dist/1494.cocolight-api-client.cjs +1 -0
- package/dist/1494.cocolight-api-client.mjs.js +1 -0
- package/dist/1641.cocolight-api-client.browser.js +1 -0
- package/dist/1641.cocolight-api-client.cjs +1 -0
- package/dist/1641.cocolight-api-client.mjs.js +1 -0
- package/dist/1678.cocolight-api-client.browser.js +1 -0
- package/dist/1678.cocolight-api-client.cjs +1 -0
- package/dist/1678.cocolight-api-client.mjs.js +1 -0
- package/dist/2041.cocolight-api-client.browser.js +1 -0
- package/dist/2041.cocolight-api-client.cjs +1 -0
- package/dist/2041.cocolight-api-client.mjs.js +1 -0
- package/dist/2302.cocolight-api-client.browser.js +1 -0
- package/dist/2302.cocolight-api-client.cjs +1 -0
- package/dist/2302.cocolight-api-client.mjs.js +1 -0
- package/dist/2313.cocolight-api-client.browser.js +1 -0
- package/dist/2313.cocolight-api-client.cjs +1 -0
- package/dist/2313.cocolight-api-client.mjs.js +1 -0
- package/dist/2379.cocolight-api-client.browser.js +1 -0
- package/dist/2379.cocolight-api-client.cjs +1 -0
- package/dist/2379.cocolight-api-client.mjs.js +1 -0
- package/dist/2439.cocolight-api-client.browser.js +1 -0
- package/dist/2439.cocolight-api-client.cjs +1 -0
- package/dist/2439.cocolight-api-client.mjs.js +1 -0
- package/dist/2594.cocolight-api-client.browser.js +1 -0
- package/dist/2594.cocolight-api-client.cjs +1 -0
- package/dist/2594.cocolight-api-client.mjs.js +1 -0
- package/dist/2766.cocolight-api-client.browser.js +1 -0
- package/dist/2766.cocolight-api-client.cjs +1 -0
- package/dist/2766.cocolight-api-client.mjs.js +1 -0
- package/dist/2812.cocolight-api-client.browser.js +1 -0
- package/dist/2812.cocolight-api-client.cjs +1 -0
- package/dist/2812.cocolight-api-client.mjs.js +1 -0
- package/dist/2918.cocolight-api-client.browser.js +1 -0
- package/dist/2918.cocolight-api-client.cjs +1 -0
- package/dist/2918.cocolight-api-client.mjs.js +1 -0
- package/dist/3028.cocolight-api-client.browser.js +1 -0
- package/dist/3028.cocolight-api-client.cjs +1 -0
- package/dist/3028.cocolight-api-client.mjs.js +1 -0
- package/dist/3330.cocolight-api-client.browser.js +1 -0
- package/dist/3330.cocolight-api-client.cjs +1 -0
- package/dist/3330.cocolight-api-client.mjs.js +1 -0
- package/dist/3371.cocolight-api-client.browser.js +1 -0
- package/dist/3371.cocolight-api-client.cjs +1 -0
- package/dist/3371.cocolight-api-client.mjs.js +1 -0
- package/dist/3401.cocolight-api-client.browser.js +1 -0
- package/dist/3401.cocolight-api-client.cjs +1 -0
- package/dist/3401.cocolight-api-client.mjs.js +1 -0
- package/dist/3516.cocolight-api-client.browser.js +1 -0
- package/dist/3516.cocolight-api-client.cjs +1 -0
- package/dist/3516.cocolight-api-client.mjs.js +1 -0
- package/dist/3593.cocolight-api-client.browser.js +1 -0
- package/dist/3593.cocolight-api-client.cjs +1 -0
- package/dist/3593.cocolight-api-client.mjs.js +1 -0
- package/dist/3764.cocolight-api-client.browser.js +1 -0
- package/dist/3764.cocolight-api-client.cjs +1 -0
- package/dist/3764.cocolight-api-client.mjs.js +1 -0
- package/dist/3873.cocolight-api-client.browser.js +1 -0
- package/dist/3873.cocolight-api-client.cjs +1 -0
- package/dist/3873.cocolight-api-client.mjs.js +1 -0
- package/dist/3911.cocolight-api-client.browser.js +1 -0
- package/dist/3911.cocolight-api-client.cjs +1 -0
- package/dist/3911.cocolight-api-client.mjs.js +1 -0
- package/dist/4031.cocolight-api-client.browser.js +1 -0
- package/dist/4031.cocolight-api-client.cjs +1 -0
- package/dist/4031.cocolight-api-client.mjs.js +1 -0
- package/dist/4152.cocolight-api-client.browser.js +1 -0
- package/dist/4152.cocolight-api-client.cjs +1 -0
- package/dist/4152.cocolight-api-client.mjs.js +1 -0
- package/dist/4203.cocolight-api-client.browser.js +1 -0
- package/dist/4203.cocolight-api-client.cjs +1 -0
- package/dist/4203.cocolight-api-client.mjs.js +1 -0
- package/dist/424.cocolight-api-client.browser.js +1 -0
- package/dist/424.cocolight-api-client.cjs +1 -0
- package/dist/424.cocolight-api-client.mjs.js +1 -0
- package/dist/435.cocolight-api-client.browser.js +1 -0
- package/dist/435.cocolight-api-client.cjs +1 -0
- package/dist/435.cocolight-api-client.mjs.js +1 -0
- package/dist/4402.cocolight-api-client.browser.js +1 -0
- package/dist/4402.cocolight-api-client.cjs +1 -0
- package/dist/4402.cocolight-api-client.mjs.js +1 -0
- package/dist/4425.cocolight-api-client.browser.js +1 -0
- package/dist/4425.cocolight-api-client.cjs +1 -0
- package/dist/4425.cocolight-api-client.mjs.js +1 -0
- package/dist/4472.cocolight-api-client.browser.js +1 -0
- package/dist/4472.cocolight-api-client.cjs +1 -0
- package/dist/4472.cocolight-api-client.mjs.js +1 -0
- package/dist/4914.cocolight-api-client.browser.js +1 -0
- package/dist/4914.cocolight-api-client.cjs +1 -0
- package/dist/4914.cocolight-api-client.mjs.js +1 -0
- package/dist/4959.cocolight-api-client.browser.js +1 -0
- package/dist/4959.cocolight-api-client.cjs +1 -0
- package/dist/4959.cocolight-api-client.mjs.js +1 -0
- package/dist/5100.cocolight-api-client.browser.js +1 -0
- package/dist/5100.cocolight-api-client.cjs +1 -0
- package/dist/5100.cocolight-api-client.mjs.js +1 -0
- package/dist/5111.cocolight-api-client.browser.js +1 -0
- package/dist/5111.cocolight-api-client.cjs +1 -0
- package/dist/5111.cocolight-api-client.mjs.js +1 -0
- package/dist/5286.cocolight-api-client.browser.js +1 -0
- package/dist/5286.cocolight-api-client.cjs +1 -0
- package/dist/5286.cocolight-api-client.mjs.js +1 -0
- package/dist/5380.cocolight-api-client.browser.js +1 -0
- package/dist/5380.cocolight-api-client.cjs +1 -0
- package/dist/5380.cocolight-api-client.mjs.js +1 -0
- package/dist/5383.cocolight-api-client.browser.js +1 -0
- package/dist/5383.cocolight-api-client.cjs +1 -0
- package/dist/5383.cocolight-api-client.mjs.js +1 -0
- package/dist/5480.cocolight-api-client.browser.js +1 -0
- package/dist/5480.cocolight-api-client.cjs +1 -0
- package/dist/5480.cocolight-api-client.mjs.js +1 -0
- package/dist/5541.cocolight-api-client.browser.js +1 -0
- package/dist/5541.cocolight-api-client.cjs +1 -0
- package/dist/5541.cocolight-api-client.mjs.js +1 -0
- package/dist/5839.cocolight-api-client.browser.js +1 -0
- package/dist/5839.cocolight-api-client.cjs +1 -0
- package/dist/5839.cocolight-api-client.mjs.js +1 -0
- package/dist/5862.cocolight-api-client.browser.js +1 -0
- package/dist/5862.cocolight-api-client.cjs +1 -0
- package/dist/5862.cocolight-api-client.mjs.js +1 -0
- package/dist/5869.cocolight-api-client.browser.js +1 -0
- package/dist/5869.cocolight-api-client.cjs +1 -0
- package/dist/5869.cocolight-api-client.mjs.js +1 -0
- package/dist/588.cocolight-api-client.cjs +1 -1
- package/dist/588.cocolight-api-client.mjs.js +1 -1
- package/dist/601.cocolight-api-client.browser.js +1 -0
- package/dist/601.cocolight-api-client.cjs +1 -0
- package/dist/601.cocolight-api-client.mjs.js +1 -0
- package/dist/6012.cocolight-api-client.browser.js +1 -0
- package/dist/6012.cocolight-api-client.cjs +1 -0
- package/dist/6012.cocolight-api-client.mjs.js +1 -0
- package/dist/6200.cocolight-api-client.browser.js +1 -0
- package/dist/6200.cocolight-api-client.cjs +1 -0
- package/dist/6200.cocolight-api-client.mjs.js +1 -0
- package/dist/6369.cocolight-api-client.browser.js +1 -0
- package/dist/6369.cocolight-api-client.cjs +1 -0
- package/dist/6369.cocolight-api-client.mjs.js +1 -0
- package/dist/7009.cocolight-api-client.browser.js +1 -0
- package/dist/7009.cocolight-api-client.cjs +1 -0
- package/dist/7009.cocolight-api-client.mjs.js +1 -0
- package/dist/725.cocolight-api-client.browser.js +1 -0
- package/dist/725.cocolight-api-client.cjs +1 -0
- package/dist/725.cocolight-api-client.mjs.js +1 -0
- package/dist/7320.cocolight-api-client.browser.js +1 -0
- package/dist/7339.cocolight-api-client.browser.js +1 -0
- package/dist/7339.cocolight-api-client.cjs +1 -0
- package/dist/7339.cocolight-api-client.mjs.js +1 -0
- package/dist/7398.cocolight-api-client.browser.js +1 -0
- package/dist/7398.cocolight-api-client.cjs +1 -0
- package/dist/7398.cocolight-api-client.mjs.js +1 -0
- package/dist/7888.cocolight-api-client.browser.js +1 -0
- package/dist/7888.cocolight-api-client.cjs +1 -0
- package/dist/7888.cocolight-api-client.mjs.js +1 -0
- package/dist/7975.cocolight-api-client.browser.js +1 -0
- package/dist/7975.cocolight-api-client.cjs +1 -0
- package/dist/7975.cocolight-api-client.mjs.js +1 -0
- package/dist/809.cocolight-api-client.browser.js +1 -0
- package/dist/809.cocolight-api-client.cjs +1 -0
- package/dist/809.cocolight-api-client.mjs.js +1 -0
- package/dist/8300.cocolight-api-client.browser.js +1 -0
- package/dist/8300.cocolight-api-client.cjs +1 -0
- package/dist/8300.cocolight-api-client.mjs.js +1 -0
- package/dist/8317.cocolight-api-client.browser.js +1 -0
- package/dist/8317.cocolight-api-client.cjs +1 -0
- package/dist/8317.cocolight-api-client.mjs.js +1 -0
- package/dist/8525.cocolight-api-client.browser.js +1 -0
- package/dist/8525.cocolight-api-client.cjs +1 -0
- package/dist/8525.cocolight-api-client.mjs.js +1 -0
- package/dist/8894.cocolight-api-client.browser.js +1 -0
- package/dist/8894.cocolight-api-client.cjs +1 -0
- package/dist/8894.cocolight-api-client.mjs.js +1 -0
- package/dist/9301.cocolight-api-client.browser.js +1 -0
- package/dist/9301.cocolight-api-client.cjs +1 -0
- package/dist/9301.cocolight-api-client.mjs.js +1 -0
- package/dist/9438.cocolight-api-client.browser.js +1 -0
- package/dist/9438.cocolight-api-client.cjs +1 -0
- package/dist/9438.cocolight-api-client.mjs.js +1 -0
- package/dist/9478.cocolight-api-client.browser.js +1 -0
- package/dist/9478.cocolight-api-client.cjs +1 -0
- package/dist/9478.cocolight-api-client.mjs.js +1 -0
- package/dist/9568.cocolight-api-client.browser.js +1 -0
- package/dist/9568.cocolight-api-client.cjs +1 -0
- package/dist/9568.cocolight-api-client.mjs.js +1 -0
- package/dist/cocolight-api-client.browser.js +3 -3
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +3 -2
- package/src/ApiClient.ts +53 -13
- package/src/api/BaseEntity.ts +241 -6
- package/src/api/EndpointApi.ts +17 -1
- package/src/api/EndpointApi.types.ts +218 -430
- package/src/api/Event.ts +6 -0
- package/src/api/Organization.ts +21 -85
- package/src/api/Poi.ts +10 -101
- package/src/api/Project.ts +6 -0
- package/src/api/User.ts +19 -1
- package/src/costum/normalize.ts +7 -0
- package/src/costum/registry.ts +138 -0
- package/src/costum/runtime-map.ts +221 -0
- package/src/costum/runtime.ts +221 -0
- package/src/costum/schemas/CercleTravailleursSociauxLiberauxLaPlumeSociale.ts +19 -0
- package/src/costum/schemas/FabEn.ts +19 -0
- package/src/costum/schemas/LivingLabInnovationSocialeBraspanon.ts +19 -0
- package/src/costum/schemas/alfph.ts +27 -0
- package/src/costum/schemas/campagne.ts +19 -0
- package/src/costum/schemas/chtitube.ts +19 -0
- package/src/costum/schemas/circuitCourt.ts +19 -0
- package/src/costum/schemas/cmcasHauteBretagne.ts +19 -0
- package/src/costum/schemas/coFinancementTierslieux.ts +27 -0
- package/src/costum/schemas/coeurNumerique.ts +19 -0
- package/src/costum/schemas/communLundi.ts +19 -0
- package/src/costum/schemas/cressReunion.ts +35 -0
- package/src/costum/schemas/cressReunionNetwork.ts +35 -0
- package/src/costum/schemas/ctenat.ts +43 -0
- package/src/costum/schemas/cyberReunion.ts +19 -0
- package/src/costum/schemas/ekisphere.ts +35 -0
- package/src/costum/schemas/equipementsSportifs974.ts +19 -0
- package/src/costum/schemas/federationDesCae.ts +19 -0
- package/src/costum/schemas/formationGenerique.ts +35 -0
- package/src/costum/schemas/franceTierslieux.ts +19 -0
- package/src/costum/schemas/hinaura.ts +27 -0
- package/src/costum/schemas/hubmayotte.ts +19 -0
- package/src/costum/schemas/hubnouvellecaledonie.ts +19 -0
- package/src/costum/schemas/hubpolynesiefrancaise.ts +19 -0
- package/src/costum/schemas/hubreunion.ts +19 -0
- package/src/costum/schemas/hubterritoires.ts +19 -0
- package/src/costum/schemas/hubwallisetfutuna.ts +19 -0
- package/src/costum/schemas/hva.ts +27 -0
- package/src/costum/schemas/ibv2.ts +19 -0
- package/src/costum/schemas/institutBleu.ts +19 -0
- package/src/costum/schemas/journalInsoumisChambery.ts +27 -0
- package/src/costum/schemas/kpacite.ts +19 -0
- package/src/costum/schemas/laCompagnieDesTierslieux.ts +43 -0
- package/src/costum/schemas/laMaisonDesFaiseurs.ts +19 -0
- package/src/costum/schemas/laReunionPourUnNumeriqueInclusif.ts +19 -0
- package/src/costum/schemas/laSemaineDesTierslieux.ts +19 -0
- package/src/costum/schemas/labEnCommuns.ts +19 -0
- package/src/costum/schemas/lakou.ts +27 -0
- package/src/costum/schemas/lesCommunsDesTierslieux.ts +19 -0
- package/src/costum/schemas/mayottePourUnNumeriqueInclusif.ts +19 -0
- package/src/costum/schemas/meir.ts +27 -0
- package/src/costum/schemas/navigatorDesTierslieux.ts +19 -0
- package/src/costum/schemas/notragora.ts +27 -0
- package/src/costum/schemas/nouvellecaledoniePourUnNumeriqueInclusif.ts +19 -0
- package/src/costum/schemas/openAtlas.ts +19 -0
- package/src/costum/schemas/polynesieFrancaisePourUnNumeriqueInclusif.ts +19 -0
- package/src/costum/schemas/prdr.ts +19 -0
- package/src/costum/schemas/reseauTierslieux.ts +19 -0
- package/src/costum/schemas/rfflabs.ts +19 -0
- package/src/costum/schemas/ries.ts +19 -0
- package/src/costum/schemas/siteDuPactePourLaTransition.ts +27 -0
- package/src/costum/schemas/sportSanteBienetre.ts +43 -0
- package/src/costum/schemas/suppa.ts +19 -0
- package/src/costum/schemas/terramies.ts +19 -0
- package/src/costum/schemas/testeTplFormation.ts +35 -0
- package/src/costum/schemas/tierslieuxbelgique.ts +19 -0
- package/src/costum/schemas/tierslieuxorg1.ts +35 -0
- package/src/costum/schemas/transiter.ts +35 -0
- package/src/costum/schemas/vhelioPeiTour2025.ts +19 -0
- package/src/costum/schemas/wallisetfutunaPourUnNumeriqueInclusif.ts +19 -0
- package/src/costum/symbol.ts +26 -0
- package/src/costum/types.ts +895 -0
- package/src/endpoints.module.ts +329 -219
- package/src/forms/entityForm.ts +142 -0
- package/src/index.ts +14 -0
- package/types/ApiClient.d.ts +1 -0
- package/types/api/BaseEntity.d.ts +69 -2
- package/types/api/EndpointApi.d.ts +11 -1
- package/types/api/EndpointApi.types.d.ts +36 -272
- package/types/api/Event.d.ts +2 -0
- package/types/api/Organization.d.ts +15 -71
- package/types/api/Poi.d.ts +2 -36
- package/types/api/Project.d.ts +2 -0
- package/types/api/User.d.ts +14 -0
- package/types/costum/normalize.d.ts +2 -0
- package/types/costum/registry.d.ts +11 -0
- package/types/costum/runtime-map.d.ts +3 -0
- package/types/costum/runtime.d.ts +99 -0
- package/types/costum/schemas/CercleTravailleursSociauxLiberauxLaPlumeSociale.d.ts +3 -0
- package/types/costum/schemas/FabEn.d.ts +3 -0
- package/types/costum/schemas/LivingLabInnovationSocialeBraspanon.d.ts +3 -0
- package/types/costum/schemas/alfph.d.ts +3 -0
- package/types/costum/schemas/campagne.d.ts +3 -0
- package/types/costum/schemas/chtitube.d.ts +3 -0
- package/types/costum/schemas/circuitCourt.d.ts +3 -0
- package/types/costum/schemas/cmcasHauteBretagne.d.ts +3 -0
- package/types/costum/schemas/coFinancementTierslieux.d.ts +3 -0
- package/types/costum/schemas/coeurNumerique.d.ts +3 -0
- package/types/costum/schemas/communLundi.d.ts +3 -0
- package/types/costum/schemas/cressReunion.d.ts +3 -0
- package/types/costum/schemas/cressReunionNetwork.d.ts +3 -0
- package/types/costum/schemas/ctenat.d.ts +3 -0
- package/types/costum/schemas/cyberReunion.d.ts +3 -0
- package/types/costum/schemas/ekisphere.d.ts +3 -0
- package/types/costum/schemas/equipementsSportifs974.d.ts +3 -0
- package/types/costum/schemas/federationDesCae.d.ts +3 -0
- package/types/costum/schemas/formationGenerique.d.ts +3 -0
- package/types/costum/schemas/franceTierslieux.d.ts +3 -0
- package/types/costum/schemas/hinaura.d.ts +3 -0
- package/types/costum/schemas/hubmayotte.d.ts +3 -0
- package/types/costum/schemas/hubnouvellecaledonie.d.ts +3 -0
- package/types/costum/schemas/hubpolynesiefrancaise.d.ts +3 -0
- package/types/costum/schemas/hubreunion.d.ts +3 -0
- package/types/costum/schemas/hubterritoires.d.ts +3 -0
- package/types/costum/schemas/hubwallisetfutuna.d.ts +3 -0
- package/types/costum/schemas/hva.d.ts +3 -0
- package/types/costum/schemas/ibv2.d.ts +3 -0
- package/types/costum/schemas/institutBleu.d.ts +3 -0
- package/types/costum/schemas/journalInsoumisChambery.d.ts +3 -0
- package/types/costum/schemas/kpacite.d.ts +3 -0
- package/types/costum/schemas/laCompagnieDesTierslieux.d.ts +3 -0
- package/types/costum/schemas/laMaisonDesFaiseurs.d.ts +3 -0
- package/types/costum/schemas/laReunionPourUnNumeriqueInclusif.d.ts +3 -0
- package/types/costum/schemas/laSemaineDesTierslieux.d.ts +3 -0
- package/types/costum/schemas/labEnCommuns.d.ts +3 -0
- package/types/costum/schemas/lakou.d.ts +3 -0
- package/types/costum/schemas/lesCommunsDesTierslieux.d.ts +3 -0
- package/types/costum/schemas/mayottePourUnNumeriqueInclusif.d.ts +3 -0
- package/types/costum/schemas/meir.d.ts +3 -0
- package/types/costum/schemas/navigatorDesTierslieux.d.ts +3 -0
- package/types/costum/schemas/notragora.d.ts +3 -0
- package/types/costum/schemas/nouvellecaledoniePourUnNumeriqueInclusif.d.ts +3 -0
- package/types/costum/schemas/openAtlas.d.ts +3 -0
- package/types/costum/schemas/polynesieFrancaisePourUnNumeriqueInclusif.d.ts +3 -0
- package/types/costum/schemas/prdr.d.ts +3 -0
- package/types/costum/schemas/reseauTierslieux.d.ts +3 -0
- package/types/costum/schemas/rfflabs.d.ts +3 -0
- package/types/costum/schemas/ries.d.ts +3 -0
- package/types/costum/schemas/siteDuPactePourLaTransition.d.ts +3 -0
- package/types/costum/schemas/sportSanteBienetre.d.ts +3 -0
- package/types/costum/schemas/suppa.d.ts +3 -0
- package/types/costum/schemas/terramies.d.ts +3 -0
- package/types/costum/schemas/testeTplFormation.d.ts +3 -0
- package/types/costum/schemas/tierslieuxbelgique.d.ts +3 -0
- package/types/costum/schemas/tierslieuxorg1.d.ts +3 -0
- package/types/costum/schemas/transiter.d.ts +3 -0
- package/types/costum/schemas/vhelioPeiTour2025.d.ts +3 -0
- package/types/costum/schemas/wallisetfutunaPourUnNumeriqueInclusif.d.ts +3 -0
- package/types/costum/symbol.d.ts +25 -0
- package/types/costum/types.d.ts +822 -0
- package/types/endpoints.module.d.ts +1393 -6162
- package/types/forms/entityForm.d.ts +28 -0
- package/types/index.d.ts +4 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"bson-objectid";import*as t from"file-type";import*as n from"ajv";import*as o from"ajv-formats";import*as r from"ejson";import*as i from"pino";import{EventEmitter as s}from"events";import{AggregateAjvError as a}from"@segment/ajv-human-errors";import c from"axios";import p from"axios-retry";import{jwtDecode as d}from"jwt-decode";import*as m from"fs";import*as l from"os";import*as u from"path";class ApiError extends Error{name="ApiError";status;details;constructor(e,t,n){super(e),this.status=t,this.details=n}}class ApiClientError extends ApiError{name="ApiClientError";constructor(e,t,n){super(e,t,n)}}class ApiValidationError extends Error{name="ApiValidationError";status;messages;details;constructor(e,t,n,o=null){super(e),this.status=t,this.messages=n,this.details=o}}class CircuitBreakerError extends ApiError{name="CircuitBreakerError";constructor(e){super(e,503)}}class ApiResponseError extends Error{name="ApiResponseError";status;responseData;details;constructor(e,t,n,o=null){super(e),this.status=t,this.responseData=n,this.details=o}}class ApiAuthenticationError extends ApiError{name="ApiAuthenticationError";constructor(e,t,n){super(e,t,n)}}var h=Object.freeze({__proto__:null,ApiAuthenticationError:ApiAuthenticationError,ApiClientError:ApiClientError,ApiError:ApiError,ApiResponseError:ApiResponseError,ApiValidationError:ApiValidationError,CircuitBreakerError:CircuitBreakerError});const y=new Map;function f(e,t){y.set(e,t)}function g(e){return!!e&&"object"==typeof e&&"__entityTag"in e}function w(e,t=null){if(!g(e))return e;let n=t;const o=e;if(o.parent&&"object"==typeof o.parent){const e=o.parent,r=e.serverData?.id||e.id;if(t&&"id"in t&&t.id===r)n=t;else{const e=w(o.parent,t);e&&"object"==typeof e&&"id"in e&&(n=e)}}let r=e.serverData?.collection;if(r||(r={User:"citoyens",Organization:"organizations",Project:"projects",Event:"events",Poi:"poi",News:"news",Badge:"badges",Comment:"comments",Answer:"answers",Form:"forms",Classified:"classifieds",Action:"actions"}[e.__entityTag]||null),!r)return e;const i=function(e,t){const n=y.get(t),o=t,r={EndpointApi:y.get("EndpointApi"),User:"User"===o?n:y.get("User"),Organization:"Organization"===o?n:y.get("Organization"),Project:"Project"===o?n:y.get("Project"),Event:"Event"===o?n:y.get("Event"),Poi:"Poi"===o?n:y.get("Poi"),Badge:"Badge"===o?n:y.get("Badge"),News:"News"===o?n:y.get("News"),Comment:"Comment"===o?n:y.get("Comment"),Answer:"Answer"===o?n:y.get("Answer"),Form:"Form"===o?n:y.get("Form"),Classified:"Classified"===o?n:y.get("Classified"),Action:"Action"===o?n:y.get("Action")};return{citoyens:{entityClass:r.User,deps:r},organizations:{entityClass:r.Organization,deps:r},projects:{entityClass:r.Project,deps:r},events:{entityClass:r.Event,deps:{...r,Badge:void 0}},poi:{entityClass:r.Poi,deps:{...r,Badge:void 0,News:void 0,Comment:void 0}},news:{entityClass:r.News,deps:{...r}},badges:{entityClass:r.Badge,deps:{EndpointApi:r.EndpointApi,User:r.User,Organization:r.Organization,Project:r.Project}},comments:{entityClass:r.Comment,deps:{...r}},answers:{entityClass:r.Answer,deps:{...r}},forms:{entityClass:r.Form,deps:{...r}},classifieds:{entityClass:r.Classified,deps:{...r,Badge:void 0,News:void 0}},actions:{entityClass:r.Action,deps:{...r}}}[e]||null}(r,e.__entityTag);if(!i)return e;if(!i.entityClass?.fromJSON)throw new Error(`Classe inconnue ou fromJSON manquant pour ${e.__entityTag}`);return i.entityClass.fromJSON(e,n,i.deps)}function _(e,t=null,n={}){const o={citoyens:{entityTag:"User",meta:e=>E(e,{remove:[]})},organizations:{entityTag:"Organization",meta:e=>E(e,{remove:[]})},projects:{entityTag:"Project",meta:e=>E(e,{remove:[]})},events:{entityTag:"Event",meta:e=>E(e,{remove:["Badge"]})},poi:{entityTag:"Poi",meta:e=>E(e,{remove:["Badge","News","Comments"]})},news:{entityTag:"News",meta:e=>E(e,{remove:[]})},badges:{entityTag:"Badge",meta:()=>function(e){const t=y.get(e),n={EndpointApi:y.get("EndpointApi"),User:y.get("User"),Organization:y.get("Organization"),Project:y.get("Project")};return n[e]=t,{entityClass:t,deps:n}}("Badge")},comments:{entityTag:"Comment",meta:e=>E(e,{remove:[]})},answers:{entityTag:"Answer",meta:e=>E(e,{remove:[]})},forms:{entityTag:"Form",meta:e=>E(e,{remove:[]})},classifieds:{entityTag:"Classified",meta:e=>E(e,{remove:["Badge","News"]})},actions:{entityTag:"Action",meta:e=>E(e,{remove:[]})}},r=o[e];if(!r)return console.warn(`Collection inconnue : '${e}'`),null;const{entityTag:i,meta:s}=r,{entityClass:a,deps:c}=s(i);if(!a)throw new Error(`EntityClass introuvable pour ${i}`);return new a(t,n,c)}function E(e,t){const n=y.get(e),o={EndpointApi:y.get("EndpointApi"),User:y.get("User"),Organization:y.get("Organization"),Project:y.get("Project"),Event:y.get("Event"),Poi:y.get("Poi"),Badge:y.get("Badge"),News:y.get("News"),Comment:y.get("Comment"),Answer:y.get("Answer"),Form:y.get("Form"),Classified:y.get("Classified"),Action:y.get("Action")};return o[e]=n,t.remove.forEach(e=>delete o[e]),{entityClass:n,deps:o}}const A=e=>e&&e.default?e.default:e,T=A(n),b=A(o),v=A(i),I=A(r),S=[],C=new WeakMap,O=new WeakMap;let P=0;const j=new Set;function D(e){const t=()=>{try{S.push(t),e()}finally{S.pop()}};return t(),t}function k(e){P++;try{e()}finally{if(P--,0===P){const e=Array.from(j);j.clear();for(const t of e)t()}}}function x(e){let t=e;const n=new Set;return{get value(){const e=S[S.length-1];return e&&n.add(e),t},set value(e){t!==e&&(t=e,P>0?n.forEach(e=>j.add(e)):n.forEach(e=>e()))},subscribe:e=>(n.add(e),()=>n.delete(e)),__isSignal:!0}}function L(e){return e&&!0===e.__isSignal}function N(e,t=[]){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return function(e,t){return new Proxy(e,{get(e,n,o){if("string"==typeof n&&!isNaN(+n)){const o=e[+n];return R(o)?o:N(o,[...t,n])}return Reflect.get(e,n,o)},set(e,n,o){if("string"==typeof n&&!isNaN(+n)){const r=N(o,[...t,n]);e[+n]=r}return!0}})}(e,t);if(e.__isReactive)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(e instanceof Date)return e;if(e.__entityTag)return e;const n=new Map,o=new Proxy(e,{get(e,o){if("__raw"===o)return e;if("__isReactive"===o)return!0;if(!n.has(o)){const r=x(N(e[o],[...t,String(o)]));n.set(o,r)}return n.get(o).value},set(e,o,r){const i=N(r,[...t,String(o)]);if(!n.has(o)){const e=x(i);n.set(o,e)}return n.get(o).value=i,e[o]=function(e){return L(e)?e.value:e}(i),!0},deleteProperty:(e,t)=>(n.delete(t),Reflect.deleteProperty(e,t))});return O.set(o,n),o}function M(e){return"object"!=typeof e||null===e||e.__isReactive?e:N(e)}function R(e){return null!==e&&"object"==typeof e&&!0===e.__isReactive}function q(e){if(C.has(e))return C.get(e);const t=x();return D(()=>t.value=e()),C.set(e,t),t}function U(e,t){let n;D(()=>{const o=e();o!==n&&(t(o,n),n=o)})}function F(e){return R(e)?O.get(e):null}function $(e,t,n){const o=F(e);if(!o||!o.has(t))return()=>{};const r=o.get(t);return r?.subscribe?.(()=>n(r.value))??(()=>{})}var B=Object.freeze({__proto__:null,batch:k,computed:q,effect:D,getSignals:F,isReactive:R,isSignal:L,reactive:M,subscribeTo:$,watch:U});const{fromBuffer:z}=t,V=e,G={CURRENT_TIME:"updatedTime",NOW:"now",PATH_ALL_TO_ROOT:"allToRoot"},K={default:"globalAutocompleteCostum","navigator-tl":"navigatorGettl"};class BaseEntity{__entityTag;deps;apiClient;parent;userContext;endpointApi;data;meta;_draftData={};_initialDraftData={};_serverData=M({});_calledFromSave=!1;_syncReactiveDraft=!1;_isDeleted=!1;_add;_update;_allowedFieldsCache;_allowedFieldsMetadata;static entityTag="BaseEntity";static entityType;static SCHEMA_CONSTANTS;static VIRTUAL_SCHEMAS;static CUSTOM_FIELD_HANDLERS;_checkNotDeleted(){if(this._isDeleted)throw new ApiError(`Cet objet ${this.__entityTag} a été supprimé et ne peut plus être utilisé.`,400)}constructor(e,t={},n={},o={}){this.__entityTag=o.entityTag||this.getEntityTag(this._getCtor().entityTag)||"BaseEntity",this.deps=n;if("ApiClient"===this.getEntityTag(e?.__entityTag))this.apiClient=e,this.parent=null,this.userContext=null;else{if(!e||!("apiClient"in e))throw new ApiError("Parent invalide ou ApiClient manquant.",400);{const t=e;this.apiClient=t.apiClient,this.parent=t,this.userContext="User"===this.getEntityTag(t?.__entityTag)?t:t.userContext||null}}if("function"==typeof n.EndpointApi)this.endpointApi=new n.EndpointApi(this.apiClient);else{if("object"!=typeof n.EndpointApi)throw new ApiError("deps.EndpointApi doit être une classe ou une instance valide.",500);this.endpointApi=n.EndpointApi}this._serverData=M({});const{draft:r,proxy:i,initial:s}=this._buildDraftAndProxy({data:{...t,...this.defaultFields},serverData:this._serverData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});this._initialDraftData=s,this._draftData=r,this.data=i}_getCtor(){return this.constructor}getEntityTag=e=>e?.replace(/^_/,"");get id(){return this._draftData.id||null}get slug(){return this._draftData.slug||null}_id(e){this._draftData.id=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}get draftData(){return this._draftData}get initialDraftData(){return this._initialDraftData}get serverData(){return this._serverData}get isMe(){return!!(this.isConnected&&this.userId&&this.userContext?.id&&"string"==typeof this.userId&&"string"==typeof this.userContext?.id&&this.userId===this.userContext?.id)}getEntityType(){return this._getCtor().entityType}hasChanges(){const e=this._toRawDeep(this._draftData),t=this._serialize(e),n=this._serialize(this._initialDraftData);return JSON.stringify(t)!==JSON.stringify(n)}async refresh(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);return this.get()}async _refreshIfDirect(){!this._calledFromSave&&this.id&&await this.refresh()}async save(){if(this._checkNotDeleted(),!this.isConnected)throw new ApiError("Non connecté.",401);this._calledFromSave=!0;try{const e={...this._draftData};if(!this.id&&"function"==typeof this._add)return await this._add(e),this._resetInitialDraftData(),this.userContext&&await(this.userContext?.refresh()),await this.refresh();if("function"==typeof this._update){const t=await this._update(e);if(this._resetInitialDraftData(),t)return await this.refresh()}return this._serverData}finally{this._calledFromSave=!1}}static fromServerData(e,t,n){const o=new this(t,{},n);return o._setData(e,{forceInitialDraftReset:!0}),o}_transformServerData(e){return e}_setData(e,{forceInitialDraftReset:t=!1}={}){this.userContext&&this.userContext!==this&&this.apiClient._logger?.debug?.(`[${this.__entityTag}] Mise à jour liée à userContext : ${this.userContext.id}`);const n=this._transformServerData(e)??{};if(this._serverData&&R(this._serverData)){for(const e of Object.keys(this._serverData))e in n||delete this._serverData[e];for(const e of Object.keys(n))this._serverData[e]=n[e]}else this._serverData=M({...n});const o=this._draftData?this._toRawDeep(this._draftData):{},r={...e||{},...this.defaultFields,...o},{draft:i,proxy:s,initial:a}=this._buildDraftAndProxy({data:r,serverData:this._serverData,previousDraft:this._draftData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});t?this._initialDraftData=structuredClone(this._toRawDeep(i)):this._initialDraftData||(this._initialDraftData=a),R(this._draftData)?this._updateDraftPreservingUserChanges(i):this._draftData=M(i),this.data||(this.data=s)}_updateDraftPreservingUserChanges(e){for(const t of Object.keys(this._draftData||{}))t in e||delete this._draftData[t];for(const t of Object.keys(e)){const n=this._draftData?.[t],o=this._initialDraftData?.[t];void 0!==n&&void 0!==o&&this._serialize(this._toRawDeep(n))!==this._serialize(o)||(this._draftData[t]=e[t])}}_resetInitialDraftData(){const e=this._toRawDeep(this._draftData);this._initialDraftData=structuredClone(e)}_toRawDeep(e){if(!this||"function"!=typeof this._toRawDeep)throw new Error("`this._toRawDeep` is not bound correctly. Use a lambda to preserve context.");if(L(e))return this._toRawDeep(e.value);if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return this._toRawDeep(e.__raw);if(e instanceof Date)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(Array.isArray(e))return e.map(e=>this._toRawDeep(e));if("object"==typeof e&&null!==e){const t={};for(const n of Object.keys(e))t[n]=this._toRawDeep(e[n]);return t}return e}defaultFields={};removeFields=[];transforms={};toJSON(){const e={};return this.parent?.id&&(e.id=this.parent.id),"function"==typeof this.parent?.getEntityType&&(e.type=this.parent.getEntityType()),this.parent?.__entityTag&&(e.__entityTag=this.parent.__entityTag),this.parent?.slug&&(e.slug=this.parent.slug),this.parent?.serverData&&(e.serverData={id:this.parent.serverData.id,collection:this.parent.serverData.collection,slug:this.parent.serverData.slug,...this.parent.serverData.name&&{name:this.parent.serverData.name},...this.parent.serverData.parent&&{parent:this.parent.serverData.parent},...this.parent.serverData.organizer&&{organizer:this.parent.serverData.organizer},...this.parent.serverData.links&&{links:this.parent.serverData.links}}),{__entityTag:this.__entityTag,__isSerializedEntity:!0,serverData:this._serialize(this._serverData),parent:Object.keys(e).length>0?e:null}}_serialize(e){try{return JSON.parse(I.stringify(this._removeUnserializables(e)))}catch(e){const t=e;return this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON:",{message:t?.message,stack:t?.stack,error:e}),null}}_removeUnserializables(e,t=new WeakSet){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof RegExp)return e;if(e&&"object"==typeof e&&"_bsontype"in e&&"ObjectID"===e._bsontype)return e;if(e instanceof Uint8Array||ArrayBuffer.isView(e))return e;if(e instanceof BaseEntity)return e.toJSON();if(t.has(e))return null;if(t.add(e),e.__isReactive&&"object"==typeof e.__raw)return this._removeUnserializables(e.__raw,t);if(Array.isArray(e))return e.map(e=>this._removeUnserializables(e,t));const n={};for(const o of Object.keys(e)){const r=e[o];if("function"!=typeof r&&"symbol"!=typeof r&&void 0!==r)try{n[o]=this._removeUnserializables(r,t)}catch{n[o]=null}}return n}static _revive(e,t){const n=I.fromJSONValue(e);return this._deserializeNestedEntities(n,t)}static _deserializeNestedEntities(e,t){if(null===e||"object"!=typeof e)return e;if(e instanceof Date||e instanceof RegExp)return e;if(Array.isArray(e))return e.map(e=>this._deserializeNestedEntities(e,t));if(e.__isSerializedEntity&&e.__entityTag&&e.serverData)return w(e,t);const n={};for(const[o,r]of Object.entries(e))n[o]=this._deserializeNestedEntities(r,t);return n}static fromJSON(e,t,n){if(!e||"object"!=typeof e||!("serverData"in e))throw new Error("Invalid JSON format: missing serverData");const{serverData:o}=e;return this.fromServerData(this._revive(o,t),t,n||{})}async call(e,t={}){return this.apiClient.safeCall(async()=>{const n=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(n),n.data})}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous devez ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(this._checkNotDeleted(),!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour faire cette action.",401);return"function"==typeof e?await e():this.call(e,t)}async callIsMe(e,t={}){if(this._checkNotDeleted(),!this.isMe)throw new ApiAuthenticationError("Vous devez être vous-même pour faire cette action.",403);return"function"==typeof e?await e():await this.callIsConnected(e,t)}async _validateImage(e){return await this._validateUploadInput(e,{allowedMimeTypes:["image/jpeg","image/png","image/jpg"],expectedType:"image"})}async _validateFile(e){return await this._validateUploadInput(e,{allowedMimeTypes:["application/pdf","text/plain","text/csv"],expectedType:"file"})}async _prepareUploadFile(e,t=`upload-${Date.now()}`){const n="undefined"==typeof window&&"undefined"!=typeof process;if("undefined"!=typeof File&&e instanceof File)return{qqfile:e,qqfilename:e.name,qqtotalfilesize:e.size};if("undefined"!=typeof Blob&&e instanceof Blob){const n=`${t}.${e.type.split("/")[1]||"bin"}`,o=new File([e],n,{type:e.type});return{qqfile:o,qqfilename:n,qqtotalfilesize:o.size}}if(n&&Buffer.isBuffer(e)){const n=await z(e),o=n?.mime??"application/octet-stream",r=n?.ext??"bin",i=/\.[a-z0-9]+$/i.test(t)?t:`${t}.${r}`;return{qqfile:await this._createReadStreamFromBuffer(e,i,o),qqfilename:i,qqtotalfilesize:e.length}}if(n&&e&&"function"==typeof e.pipe){const n=e;return{qqfile:n,qqfilename:"string"==typeof n.path&&n.path||t,qqtotalfilesize:"number"==typeof n.size?n.size:0}}throw new ApiError("Type de fichier non reconnu pour l'upload.",400)}async deleteFile(e){if("string"!=typeof e||24!==e.length)throw new ApiError("docId requis (24 hex) pour supprimer un document.",400);const t={pathParams:{id:e}};await this.callIsConnected(()=>this.endpointApi.deleteDocumentById(t))}_markDeletedLocally(){Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async _deleteViaElement(e,t,{checkHierarchy:n=!0}={}){if(!this.id)throw new ApiError(`Vous devez fournir un id pour supprimer ${this.constructor.name}.`,400);if(!this.isAuthorOrAdmin({checkHierarchy:n}))throw new ApiError("Suppression refusée — vous devez être l'auteur ou administrateur (ou administrateur du parent).",403);const o={reason:t,pathParams:{type:e,id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteElement(o)),this._markDeletedLocally()}async updateField(e,t,n={}){if(void 0===t)throw new ApiError("`value` ne peut pas être undefined. Utiliser `null` pour $unset.",400);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if("string"!=typeof e||0===e.length)throw new ApiError("`path` est requis et doit être une string non vide.",400);if(n.arrayForm&&n.pull&&!Array.isArray(t))throw new ApiError("`arrayForm` + `pull` requièrent value: array (mode $pullAll). Pour un $pull simple, utiliser uniquement `pull` (sans arrayForm).",400);if(n.updatePartial&&("object"!=typeof t||null===t||Array.isArray(t)))throw new ApiError("`updatePartial: true` requiert value: object (les sous-clés deviennent des sub-paths).",400);this._assertNotEntityType("updateField",["badges","news","comments","classifieds"]);const o={id:this.id,collection:this.getEntityType(),path:e,value:t};return void 0!==n.setType&&(o.setType=n.setType),n.arrayForm&&(o.arrayForm=!0),n.pull&&(o.pull=n.pull),n.updatePartial&&(o.updatePartial=!0),n.formParentId&&(o.formParentId=n.formParentId),n.edit&&(o.edit=!0),this.endpointApi.updatePathValue(this._normalizeUpdatePathPayload(o))}_normalizeUpdatePathPayload(e){let t=e;if(Array.isArray(t.setType)&&0===t.setType.length){const{setType:e,...n}=t;t=n}t.value instanceof Date&&(t={...t,value:t.value.toISOString(),setType:"isoDate"});const n=Array.isArray(t.setType)&&t.setType.length>0&&t.setType.every(e=>"isoDate"===e?.type);if("string"==typeof t.value&&n&&(t={...t,setType:"isoDate"}),!t.pull||""!==t.value&&null!==t.value&&void 0!==t.value||(t={...t,value:""}),Array.isArray(t.value)&&0===t.value.length&&!t.arrayForm&&!t.pull){const{setType:e,...n}=t;t={...n,value:""}}return t}async _validateUploadInput(e,{allowedMimeTypes:t=[],expectedType:n="any"}){if(!e)throw new ApiValidationError("Le fichier est requis.",400,["Le fichier est requis"]);const o="undefined"==typeof window&&"undefined"!=typeof process;let r=null,i="";if("undefined"!=typeof File&&e instanceof File){if(i=e.type,!t.includes(i))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);r=e}else if("undefined"!=typeof Blob&&e instanceof Blob){if(i=e.type,!t.includes(i))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);const n=i.split("/")[1]||"bin",o=`${Date.now()}.${n}`;r=new File([e],o,{type:i})}else if(o&&Buffer.isBuffer(e)){const o=await z(e);if(!o)throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(i=o.mime,!t.includes(i))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if("image"===n){const t=o.ext,n=`${Date.now()}.${t}`;r=await this._createReadStreamFromBuffer(e,n,i)}else r=e}else{if(!o||!(s=e)||"object"!=typeof s||"function"!=typeof s.pipe||"function"!=typeof s.on)throw new ApiValidationError("Type de fichier non reconnu.",400,["Type de fichier non reconnu."]);{const n=e,o=[],s=await this._passThrough(),a=await this._passThrough(),c=4100;let p=0;n.on("data",e=>{p<c&&(o.push(e),p+=e.length)}),n.pipe(s).pipe(a),await new Promise(e=>setTimeout(e,10));const d=Buffer.concat(o),m=await z(d);if(!m)throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(i=m.mime,!t.includes(i))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);a.path=`${Date.now()}.${m.ext}`,a.mimeType=i,r=a}}var s;return r}async _createReadStreamFromBuffer(e,t="file.bin",n="application/octet-stream"){const o=await this._bufferToReadable(e);return o.path=t,o.mimeType=n,o}async _bufferToReadable(e){if("undefined"==typeof window){const{bufferToReadable:t}=await Promise.resolve().then(function(){return ye});return t(e)}throw new Error("bufferToReadable ne doit pas être appelé dans le navigateur")}async _passThrough(){if("undefined"==typeof window){const{createPassThrough:e}=await Promise.resolve().then(function(){return ye});return e()}throw new Error("passThrough ne doit pas être appelé dans le navigateur")}_omitProps(e,t){if(!e||"object"!=typeof e)return{};const n={...e};for(const e of t)delete n[e];return n}_pickProps(e,t,n={}){if(!e||"object"!=typeof e)return{};const o={};for(const r of t)if(r in e){const t=e[r];"function"==typeof n[r]?o[r]=n[r](t,e):o[r]=t}return o}_hasAtLeastOne(e,t=[]){return t.some(t=>t in e&&null!=e[t])}_createFilteredProxy(e){return new Proxy(e,{get(e,t,n){const o=e.filter(e=>!e._isDeleted);if("length"===t)return o.length;if("string"==typeof t&&/^\d+$/.test(t))return o[Number(t)];const r=Reflect.get(o,t,n);return"function"==typeof r?r.bind(o):r}})}_newId(){return V().toHexString()}_getAllowedFieldsForCurrentState(){if(!this._allowedFieldsMetadata)return this._allowedFieldsCache||[];const{combinedSchema:e,removeFields:t}=this._allowedFieldsMetadata,n=this._toRawDeep(this._draftData),o={...this.defaultFields,...n};let r=this._extractWritableFields(e,o);return o.id&&!r.includes("id")&&r.push("id"),o.slug&&!r.includes("slug")&&r.push("slug"),r=r.filter(e=>!t.includes(e)),r}_createDraftProxy(e,t={},n={},o=[],r={},i={},s=this){return new Proxy({},{get:(e,o)=>{if("string"==typeof o||"symbol"==typeof o){if("string"==typeof o&&o in n){const e=n[o],t=r[o];return"function"==typeof t?t(e,n):e}if(t&&"object"==typeof t&&"string"==typeof o&&o in t){const e=t[o],n=r[o];return"function"==typeof n?n(e,t):e}}},set:(t,o,r)=>{if("string"!=typeof o)return!1;const a=s._getAllowedFieldsForCurrentState();if(!a.includes(o)){const t=`[DraftProxy] Le champ "${o}" n'est pas autorisé.`;if(i.throwOnError)throw new ApiValidationError(t,400,[t],{field:o,value:r,allowedFields:a});return e._logger?.warn?.(t),!1}const c=n[o];return c&&"object"==typeof c&&!0===c.__isSignal?c.value=r:n[o]=r,!0},deleteProperty:(e,t)=>{if("string"!=typeof t)return!1;return!!s._getAllowedFieldsForCurrentState().includes(t)&&(delete n[t],!0)},has:(e,o)=>"string"==typeof o&&(o in n||t&&"object"==typeof t&&o in t),ownKeys:()=>{const e=new Set([...Object.keys(t||{}),...Object.keys(n||{})]);return Array.from(e)},getOwnPropertyDescriptor:(e,o)=>{if("string"==typeof o)return o in n||t&&"object"==typeof t&&o in t?{enumerable:!0,configurable:!0}:void 0}})}_extractWritableFields(e={},t={},n={defs:{},visited:new Set}){if(!e||"object"!=typeof e)return[];if(e.$id&&n.visited.has(e.$id))return[];e.$id&&n.visited.add(e.$id),n.defs=e.$defs||e.definitions||n.defs;const o=[];if(e.$ref){const r=e.$ref.replace(/^#\/?(\$defs|definitions)\//,""),i=n.defs[r];i&&o.push(...this._extractWritableFields(i,t,n))}if(e.allOf&&e.allOf.forEach(e=>o.push(...this._extractWritableFields(e,t,n))),e.if&&e.then){const r=e.if.properties;let i=!0;if(r)for(const e in r){const n=r[e]?.const;if(t[e]!==n){i=!1;break}}i&&e.then?o.push(...this._extractWritableFields(e.then,t,n)):!i&&e.else&&o.push(...this._extractWritableFields(e.else,t,n))}return e.properties&&o.push(...Object.entries(e.properties).filter(([e,t])=>!0!==t.readOnly&&void 0===t.const).map(([e])=>e)),Array.from(new Set(o))}_buildDraftAndProxy({data:e={},serverData:t=null,previousDraft:n=null,constant:o,apiClient:r,transforms:i={},throwOnError:s=!0,removeFields:a=[]}){const c=Array.isArray(o)?o:[o],p={allOf:[],$defs:{}};for(const e of c){let t=r.getRequestSchema(e);const n=this._getCtor(),o=n.VIRTUAL_SCHEMAS?.[e];if(o&&(t=this._mergeSchemas(t,o)),!t)throw new ApiError(`Unable to find schema for ${e}.`,404);if(t.$defs)for(const[n,o]of Object.entries(t.$defs))p.$defs[n]?r._logger.warn(`Duplicate $defs key '${n}' from schema '${e}'`):p.$defs[n]=o;p.allOf.push(t)}let d=this._extractWritableFields(p,e);e.id&&-1===d.indexOf("id")&&d.push("id"),e.slug&&-1===d.indexOf("slug")&&d.push("slug"),d=d.filter(e=>!a.includes(e)),this._allowedFieldsCache=d,this._allowedFieldsMetadata={combinedSchema:p,transforms:i,removeFields:a};const m=Object.fromEntries(d.map(t=>{const n=e[t];return[t,"function"==typeof i[t]?i[t](n,e):n]}).filter(([e,t])=>void 0!==t)),l=structuredClone?structuredClone(m):JSON.parse(JSON.stringify(m)),u=n&&R(n)?Object.assign(n,m):M(m),h=R(t)?t:t&&"object"==typeof t?M(t):t;return{draft:u,proxy:this._createDraftProxy(r,h,u,d,i,{throwOnError:s}),initial:l}}async _invokeBlockMethod(e,t,n){const o=this[t];return await o.call(this,n)}_isUploadType(e){return!("undefined"==typeof Buffer||!Buffer.isBuffer(e))||("undefined"!=typeof File&&e instanceof File||("undefined"!=typeof Blob&&e instanceof Blob||!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on)))}_compareValues(e,t){return this._isUploadType(e)||this._isUploadType(t)?e!==t:JSON.stringify(this._toRawDeep(e))!==JSON.stringify(this._toRawDeep(t))}_mergeSchemas(e,t){return e?t?{allOf:[e,t],$defs:{...e.$defs,...t.$defs}}:e:t}_hasFieldChanged(e){const t=this._draftData[e],n=this._initialDraftData[e];return this._compareValues(t,n)}async _invokeCustomFieldHandler(e,t,n){const o=this[e];if("function"!=typeof o)throw new ApiError(`Custom handler "${e}" not found for field "${n}"`,500);return await o.call(this,t)}_extractChangedFieldsFromSchema(e,t,n={},o,r=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,n);const a={},c=o?.()||{};s=s.filter(e=>!r.includes(e));for(const e of s){if(void 0===n[e])continue;const t=n[e],o=c[e];this._compareValues(t,o)&&(a[e]=t)}return Object.keys(a).length>0?a:null}_extractAllValidFieldsFromSchema(e,t,n={},o,r=[]){const i=e.getRequestSchema(t);let s=this._extractWritableFields(i,n);const a={},c={},p=o?.()||{};s=s.filter(e=>!r.includes(e));for(const e of s){if(void 0===n[e])continue;const t=n[e],o=p[e];JSON.stringify(t)!==JSON.stringify(o)&&(a[e]=t),c[e]=t}return Object.keys(a).length>0?c:null}async _resolveId(e){if(!this.id&&this.slug)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:this.slug}});if(!t.contextId||t.contextType!==e)throw new ApiResponseError(`Le slug ${this.slug} ne correspond pas à un ${e}`,200,t);this._id(t.contextId)}catch(t){if(t instanceof ApiResponseError){throw t.responseData.contextType!==e?t:new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${this.slug}`,t.status,t.responseData)}throw t}if(!this.id)throw new ApiError(`Impossible de résoudre l'identifiant pour le type ${e}.`,404);return this.id}async _getPublicProfile(){if(await this._resolveId(this.getEntityType()),!this.id)throw new ApiError("L'identifiant de l'entité n'est pas défini.",400);const e=this.getEntityType();if("news"===e||"comments"===e)throw new ApiError(`getElementsAbout ne supporte pas le type '${e}'.`,400);return this.endpointApi.getElementsAbout({pathParams:{id:this.id,type:e},tpl:"ficheInfoElement"})}_getEntityMeta(e){const t=this.constructor,n=this.__entityTag,o={EndpointApi:this.deps.EndpointApi,User:"User"===n?t:this.deps.User,Organization:"Organization"===n?t:this.deps.Organization,Project:"Project"===n?t:this.deps.Project,Event:"Event"===n?t:this.deps.Event,Poi:"Poi"===n?t:this.deps.Poi,Badge:"Badge"===n?t:this.deps.Badge,News:"News"===n?t:this.deps.News,Comment:"Comment"===n?t:this.deps.Comment,Answer:"Answer"===n?t:this.deps.Answer,Form:"Form"===n?t:this.deps.Form,Classified:"Classified"===n?t:this.deps.Classified,Action:"Action"===n?t:this.deps.Action};return{classifieds:{entityClass:o.Classified,deps:{...o}},citoyens:{entityClass:o.User,deps:o},organizations:{entityClass:o.Organization,deps:o},projects:{entityClass:o.Project,deps:o},events:{entityClass:o.Event,deps:{...o,Badge:void 0}},poi:{entityClass:o.Poi,deps:{...o,Badge:void 0,News:void 0}},news:{entityClass:o.News,deps:{...o}},badges:{entityClass:o.Badge,deps:{EndpointApi:o.EndpointApi,User:o.User,Organization:o.Organization,Project:o.Project}},comments:{entityClass:o.Comment,deps:{...o}},answers:{entityClass:o.Answer,deps:{...o}},forms:{entityClass:o.Form,deps:{...o}},actions:{entityClass:o.Action,deps:{...o}}}[e]||null}_linkEntity(e,t){const n=this._getEntityMeta(e);return n?n.entityClass.fromServerData(t,this,n.deps):t}_linkNestedEntity(e){if(!e||"object"!=typeof e)return e;if(!e.id||!e.type)return e;try{return this._linkEntity(e.type,e)}catch(t){return this.apiClient._logger?.warn?.(`Impossible de lier l'entité imbriquée de type ${e.type}:`,t),e}}async _linkEntityById(e,t,n){const o=this._getEntityMeta(e);if(!o)return null;const r=new o.entityClass(this,{id:t},o.deps);return n?.skipGet||await r.get(),r}_linkEntities(e){return e.flatMap(e=>e?.collection?[this._linkEntity?.(e.collection,e)??e]:(this.apiClient._logger?.warn?.(`Objet ignoré car sans 'collection' : ${e?.id}`),[]))}async linkEntitiesFromServerData(e,t={},n={}){const o=n.key||e,r="function"==typeof n.mapFn?n.mapFn:null,i=e=>!0===e||"true"===e,s=e=>!1===e||"false"===e,a=this.serverData?.[o],c=[];if(a&&"object"==typeof a&&Object.keys(a).length>0)for(const n of Object.keys(a)){const o=a[n],p=Object.entries(t).every(([e,t])=>{const n=o[e];if("function"==typeof t)try{return t(n)}catch(t){return console.warn(`Erreur dans le filtre personnalisé pour ${e}`,t),!1}return t instanceof RegExp?"string"==typeof n&&t.test(n):"string"==typeof t&&"string"==typeof n?n.toLowerCase().includes(t.toLowerCase()):i(t)?i(n):s(t)?s(n):"string"!=typeof n||"string"!=typeof t||isNaN(Date.parse(n))||isNaN(Date.parse(t))?n===t:new Date(n).getTime()===new Date(t).getTime()});if(p)try{const t=await this._linkEntityById(e,n);t&&(t.meta=o,c.push(r?r(t):t))}catch(t){this.apiClient._logger?.error?.(`Erreur lors de la récupération de l'entité ${e} (${n}) :`,t)}}return c}_entityInstanceData(e,t){const n=this._getEntityMeta(e);if(!n)throw new ApiError(`Type d'entité inconnu: ${e}`,400);const o=this.__entityTag,r=this.constructor;return new n.entityClass(this,t,{[o]:r,...n.deps})}async entity(e,t={}){try{const n=this._entityInstanceData(e,t),o={citoyens:["id","slug"],organizations:["id","slug"],projects:["id","slug"],events:["id","slug"],poi:["id","slug"],news:["id"],badges:["id"],comments:[],answers:["id"],classifieds:["id"],actions:["id"],forms:["id"]}[e];return o&&this._hasAtLeastOne(t,o)&&await n.get(),n}catch(t){throw this.apiClient._logger.error(`[Api.${this.__entityTag}.${e}] Erreur lors de la création d'une instance ${e} :`,t.message),t}}async entityBySlug(e){if(!e)throw new ApiError("Le slug est requis.",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType){const e=await this.entity(t.contextType,{id:t.contextId});return await this._fixEntityUserContext(e),e}throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}async _fixEntityUserContext(e){const t=e.getEntityType();if(!["events","projects","poi"].includes(t))return;const n=this._extractRealParent(e);if(!n)return;const o=await this._findOrCreateParent(n);o&&o!==e.parent&&(e.userContext=this._extractUserContext(o),e.parent=o)}_extractRealParent(e){const t=e.serverData;if("events"===e.getEntityType()){const e=t;if(e.organizer){const t=Object.entries(e.organizer),n=t.find(([e,t])=>"projects"===t.type);if(n)return{type:"projects",id:n[0]};const o=t.find(([e,t])=>"organizations"===t.type);if(o)return{type:"organizations",id:o[0]};const r=t.find(([e,t])=>"citoyens"===t.type);if(r)return{type:"citoyens",id:r[0]};const i=t[0];if(i&&i[1])return{type:i[1].type,id:i[0]}}}const n=t;if(n.parent){const e=Object.entries(n.parent)[0];if(e&&e[1])return{type:e[1].type,id:e[0]}}return null}async _findOrCreateParent(e){try{let t=this.parent;for(;t;){if(t.id===e.id&&t.getEntityType()===e.type)return t;t=t.parent}const n={citoyens:"citoyens",organizations:"organizations",projects:"projects"}[e.type];if(n){const t=this._entityInstanceData(n,{id:e.id});return await t.get(),t}return null}catch(e){return this.apiClient._logger?.warn?.("Impossible de créer le parent réel:",e),null}}_extractUserContext(e){return"User"===this.getEntityTag(e?.__entityTag)?e:e.userContext||null}_isAdminViaHierarchy(){const e=this.getEntityType(),t=this.serverData;let n;if("events"===e)n=t?.organizer;else{if("projects"!==e&&"poi"!==e&&"classifieds"!==e&&"actions"!==e)return!1;n=t?.parent}if(!n||"object"!=typeof n)return!1;for(const[e,t]of Object.entries(n)){if(!t||"object"!=typeof t)continue;const n=t.type;if(n&&this._isAdminOfParent(e,n))return!0}return!1}_isAdminOfParent(e,t){const n=this.userContext?.serverData?.links;if(!n)return!1;let o;if("citoyens"===t)return!1;if("organizations"===t)o="memberOf";else{if("projects"!==t)return!1;o="projects"}const r=n[o];if(!r)return!1;const i=r[e];return this._validateUserLink(i)&&!0===i?.isAdmin&&!i?.isAdminPending}_buildLinkFilters(e,{linkType:t,isAdmin:n,isAdminPending:o,isInviting:r,toBeValidated:i=!1,roles:s=[]}){if("string"!=typeof e||null===e)throw new TypeError("id doit être une chaîne non-nulle.");if("string"!=typeof t)throw new TypeError("linkType doit être une chaîne.");if(void 0!==n&&"boolean"!=typeof n)throw new TypeError("isAdmin doit être un booléen.");if(void 0!==o&&"boolean"!=typeof o)throw new TypeError("isAdminPending doit être un booléen.");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError("isInviting doit être un booléen.");if(void 0!==i&&"boolean"!=typeof i)throw new TypeError("toBeValidated doit être un booléen.");if(!Array.isArray(s))throw new TypeError("roles doit être un tableau de chaînes.");const a=`links.${t}.${e}`,c={[`${a}`]:{$exists:!0}};return"boolean"==typeof i&&(c[`${a}.toBeValidated`]={$exists:i}),"boolean"==typeof r&&(c[`${a}.isInviting`]={$exists:r}),!0===n&&(c[`${a}.isAdmin`]={$exists:!0}),!0===o&&(c[`${a}.isAdminPending`]={$exists:!0}),s.length>0&&(c[`${a}.roles`]={$in:s}),c}_getLinkMeta(){const e=this.getEntityType(),t={organizations:{linkType:"memberOf",connectTypeConnect:"member",connectTypeDisconnect:"members"},projects:{linkType:"projects",connectTypeConnect:"contributor",connectTypeDisconnect:"contributors"},events:{linkType:"events",connectTypeConnect:"attendee",connectTypeDisconnect:"attendees"},citoyens:{linkType:"friends",connectTypeConnect:"friend",connectTypeDisconnect:"friends"}}[e];if(!t)throw new ApiError(`Aucune correspondance de lien définie pour le type d'entité "${e}"`,404);return t}_checkLinkableEntity(){try{this._getLinkMeta()}catch(e){if(e instanceof ApiError)throw new ApiError(`L'entité "${this.getEntityType()}" ne prend pas en charge les actions de lien.`,400);throw e}}_getLinkFromConnectedUser(){const{linkType:e}=this._getLinkMeta();if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);return this?.userContext?.serverData?.links?.[e]?.[this.id]||null}async _submitLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){this._assertNotEntityType("connect",["poi","badges","news","actions"]);const t=this.getEntityType(),n={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:e},o=await this.callIsMe(()=>this.endpointApi.connect(n));return await(this.userContext?.refresh()),o}if(t.isInviting)return this._acceptLinkRequest();if(t.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation.",400);throw new ApiError("Vous êtes déjà connecté à cette entité.",400)}async _submitLinkRequestAdmin(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(!e){this._assertNotEntityType("connect",["poi","badges","news","actions"]);const e=this.getEntityType(),t={childId:this.userId,childType:"citoyens",parentType:e,parentId:this.id,connectType:"admin"},n=await this.callIsMe(()=>this.endpointApi.connect(t));return await(this.userContext?.refresh()),n}if(e.isInviting||e.isAdminInviting)return this._acceptLinkRequest();if(e.toBeValidated&&e.isAdminPending)throw new ApiError("Vous êtes déjà en attente de validation pour devenir admin.",400);if(e.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation pour rejoindre cette entité.",400);throw new ApiError("Vous êtes déjà connecté à cette entité.",400)}async _acceptLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(e&&(e.isInviting||e.isAdminInviting)){this._assertNotEntityType("linkValidate",["poi","badges","news","actions"]);const e=this.getEntityType(),t={childId:this.userId,childType:"citoyens",parentType:e,parentId:this.id,linkOption:"isInviting"},n=await this.callIsMe(()=>this.endpointApi.linkValidate(t));return await(this.userContext?.refresh()),n}throw new ApiError("Vous n'avez pas d'invitation à valider.",400)}async _leaveLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.",404);this._assertNotEntityType("disconnect",["poi","badges","news","actions"]);const t=this.getEntityType(),n={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:e},o=await this.callIsMe(()=>this.endpointApi.disconnect(n));return await(this.userContext?.refresh()),o}async get(){return this.apiClient.safeCall(async()=>{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e})}async updateSettings(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateSettings",["poi","badges","news","actions"]);const t=this.getEntityType(),{type:n,value:o}=e;if("string"!=typeof n)throw new ApiValidationError("Le champ 'type' est requis (string).",400,["type requis"]);const r={type:n,value:o,idEntity:this.id,typeEntity:t};return this.callIsConnected(()=>this.endpointApi.updateSettings(r))}async updateDescription(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateDescription",["badges","news","actions"]);const t=this.getEntityType(),n={block:"descriptions",id:this.id,typeElement:t,...e};return this.callIsConnected(()=>this.endpointApi.updateBlockDescription(n))}async updateInfo(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateInfo",["badges","news","actions"]);const t=this.getEntityType(),n={block:"info",id:this.id,typeElement:t,...e};return this.callIsConnected(()=>this.endpointApi.updateBlockInfo(n))}async updateSocial(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateSocial",["badges","news","poi","events","actions"]);const t=this.getEntityType(),n={block:"network",id:this.id,typeElement:t,...e};return this.callIsConnected(()=>this.endpointApi.updateBlockSocial(n))}_isPostalAddress(e){return!!e&&"object"==typeof e&&"PostalAddress"===e["@type"]&&"string"==typeof e.addressCountry&&"string"==typeof e.addressLocality&&"string"==typeof e.level1&&"string"==typeof e.level1Name&&"string"==typeof e.codeInsee&&"string"==typeof e.localityId}_isGeo(e){return!(!e||"object"!=typeof e||"number"!=typeof e.latitude&&"string"!=typeof e.latitude||"number"!=typeof e.longitude&&"string"!=typeof e.longitude)}_isGeoPosition(e){return!!e&&"object"==typeof e&&"Point"===e.type&&Array.isArray(e.coordinates)&&2===e.coordinates.length&&("number"==typeof e.coordinates[0]||"string"==typeof e.coordinates[0])&&("number"==typeof e.coordinates[1]||"string"==typeof e.coordinates[1])&&!0===e.float}async updateLocality(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(this._assertNotEntityType("updateLocality",["badges","news","comments","answers","actions"]),!("address"in e))throw new ApiValidationError("Le champ 'address' est requis.",400,["address requis"]);const t=e.address;if(""!==t&&!this._isPostalAddress(t))throw new ApiValidationError("Format de 'address' invalide.",400,["address invalide"]);const n=t,o=this.getEntityType(),r={block:"localities",id:this.id,typeElement:o,address:n,..."geo"in e&&this._isGeo(e.geo)?{geo:e.geo}:{},..."geoPosition"in e&&this._isGeoPosition(e.geoPosition)?{geoPosition:e.geoPosition}:{},..."locality"in e?{locality:e.locality}:{}};return this.callIsConnected(()=>this.endpointApi.updateBlockLocality(r))}async updateSlug({slug:e}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateSlug",["badges","news","comments","actions"]);const t=this.getEntityType();try{await this.endpointApi.check({block:"info",type:t,id:this.id,slug:e})}catch(e){if(e instanceof ApiResponseError)throw new ApiResponseError("Erreur lors de la vérification du slug.",e.status,e.responseData);throw e}const n={block:"info",typeElement:t,id:this.id,slug:e};return this.callIsConnected(()=>this.endpointApi.updateBlockSlug(n))}async updateImageProfil({profil_avatar:e}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateImageProfil",["badges","news","comments","answers","actions"]);const t=this.getEntityType();e=await this._validateImage(e);const n={pathParams:{folder:t,ownerId:this.id},profil_avatar:e};return this.callIsConnected(()=>this.endpointApi.profilImage(n))}async updateImageBanner({banner:e,cropW:t,cropH:n,cropX:o,cropY:r}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateImageBanner",["badges","news","comments","answers","actions"]);const i=this.getEntityType();e=await this._validateImage(e);const s={pathParams:{folder:i,ownerId:this.id},parentType:i,parentId:this.id,formOrigin:"banner",cropW:t,cropH:n,cropX:o,cropY:r,banner:e};return this.callIsConnected(()=>this.endpointApi.profilBanner(s))}async organization(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",403);return await this.entity("organizations",e)}async project(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un projet.",401);return await this.entity("projects",e)}async poi(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un POI.",401);return await this.entity("poi",e)}async classified(e={}){if(!("id"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer une ressource.",401);return await this.entity("classifieds",e)}async event(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un événement.",401);return await this.entity("events",e)}async badge(e={}){if(!("id"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un badge.",401);return await this.entity("badges",e)}async news(e={}){if(!e?.id&&!this.isConnected)throw new ApiError("Vous devez être connecté.",401);return await this.entity("news",e)}async action(e={}){throw new ApiError(`action n'existe pas dans ${this.constructor.name}`,501)}async form(e={}){return await this.entity("forms",e)}async answer(e={}){throw new ApiError(`answer n'existe pas dans ${this.constructor.name}`,501)}async getOrganizations(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getOrganizations",restoredState:t?.restoredState,finalizer:async e=>{this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}});return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getOrganizationsAdmin(e)):()=>this.endpointApi.getOrganizationsNoAdmin(e))()}}).next()}async getProjects(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_PROJECTS_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getProjects",restoredState:t?.restoredState,finalizer:async e=>{this.isMe?(e.pathParams={type:this.getEntityType(),id:this.id},e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}}):(delete e?.pathParams,e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}});return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getProjectsAdmin(e)):()=>this.endpointApi.getProjectsNoAdmin(e))()}}).next()}async getEvents(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_EVENTS","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getEvents",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,e.filters={$or:{[`links.attendees.${this.id}`]:{$exists:!0},[`organizer.${this.id}`]:{$exists:!0}}},this.endpointApi.getEvents(e))}).next()}async getPois(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_POIS_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getPois",restoredState:t?.restoredState,finalizer:async e=>{this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`parent.${this.id}`]:{$exists:!0}});return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getPoisAdmin(e)):()=>this.endpointApi.getPoisNoAdmin(e))()}}).next()}async getSubscribers(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIBERS","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getSubscribers",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,e.filters={[`links.follows.${this.id}`]:{$exists:!0},[`links.follows.${this.id}.toBeValidated`]:{$exists:!1},[`links.follows.${this.id}.isInviting`]:{$exists:!1}},this.endpointApi.getSubscribers(e))}).next()}async getBadgesIssuer(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_BADGES","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getBadgesIssuer",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,e.filters=e.filters||{"preferences.private":!1},e.filters.$or={},e.filters.$or[`issuer.${this.id}`]={$exists:!0},this.endpointApi.getBadges(e))}).next()}async getNews(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("getNews",["badges","news","poi","events","comments","answers","actions"]);const t=this.getEntityType(),n="dateLimit"in e&&"number"==typeof e.dateLimit?{dateLimit:e.dateLimit}:{dateLimit:0},o="indexStep"in e&&"number"==typeof e.indexStep?{indexStep:e.indexStep}:{indexStep:12},r="search"in e&&"object"==typeof e.search&&null!==e.search&&"name"in e.search&&"string"==typeof e.search.name?{search:{name:e.search.name}}:{},i={pathParams:{type:t,id:this.id,isLive:!0},...n,...o,...r},s=await this.endpointApi.getNews(i);if(!Array.isArray(s))throw new ApiResponseError("Erreur lors de la récupération des actualités.",500,s);const a=this._linkEntities(s);return this._createFilteredProxy(a)}async getGallery(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("getGallery",["badges","news","poi","events","comments","answers","actions"]);const t={pathParams:{type:this.getEntityType(),id:this.id,docType:e.pathParams?.docType||"image"}};return await this.endpointApi.getGallery(t)}async searchMembers(e){const t=await this.endpointApi.searchMemberAutocomplete(e);if(!t||!Array.isArray(t))return[];this._assertNotEntityType("searchMembers",["badges","news","poi","comments","actions"]),t.forEach(e=>{for(const t of Object.keys(e))["id","name","slug","profilThumbImageUrl","profilMarkerImageUrl","type","collection"].includes(t)||delete e[t]});return this._linkEntities(t)}async requestToJoin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequest()}async requestToJoinAdmin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequestAdmin()}async requestPromoteToAdmin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(!e)throw new ApiError("vous n'êtes pas membre de cette entité.",400);if(e?.isAdmin&&(e?.isInviting||e?.isAdminInviting))throw new ApiError("Cet utilisateur est déjà en cours d'invitation en tant qu'admin.",400);if(e?.isAdmin&&!e?.isInviting&&!e?.isAdminInviting)throw new ApiError("Cet utilisateur est déjà admin.",400);const t=this.getEntityType(),n=["organizations","projects"];if(!n.includes(t))throw new ApiError(`L'entité doit être de type : ${n.join(", ")}, reçu : ${t}`,400);const o=t,r={childId:this.userId,childType:"citoyens",parentType:o,parentId:this.id,connectType:"admin"},i=await this.callIsMe(()=>this.endpointApi.connect(r));return await(this.userContext?.refresh()),i}async acceptInvitation(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._acceptLinkRequest()}async leave(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._leaveLinkRequest()}async follow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour suivre cette entité.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401);this._assertNotEntityType("follow",["badges","news","poi","comments","actions"]);const e=this.getEntityType();if(!(this.userContext?.serverData?.links?.follows?.[this.id]||null)){const t={childId:this.userId,childType:"citoyens",parentType:e,parentId:this.id},n=await this.callIsMe(()=>this.endpointApi.follow(t));return await(this.userContext?.refresh()),n}throw new ApiError("Vous êtes déjà abonné à cette entité.",409)}async unfollow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour vous désabonner.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401);const e=this.userContext?.serverData?.links?.follows?.[this.id]||null;this._assertNotEntityType("unfollow",["badges","news","poi","actions"]);const t=this.getEntityType();if(e){const e={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:"followers"},n=await this.callIsMe(()=>this.endpointApi.disconnect(e));return await(this.userContext?.refresh()),n}throw new ApiError("Vous n'êtes pas abonné à cette entité.",404)}_checkAccess(e="effectuer cette action"){if(!this.isMe)throw new ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404)}_validateUserLink(e){if(!e)return!1;const{toBeValidated:t,isInviting:n,isAdminInviting:o,isAdminPending:r}=e;return!(t||n||o||r)}_assertEntityType(...e){const t=Array.isArray(e[0])?e[0]:e;if(!t.includes(this.getEntityType()))throw new ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.getEntityType()}`,400)}_assertNotEntityType(e,...t){const n=Array.isArray(t[0])?t[0]:t,o=this.getEntityType();if(n.includes(o))throw new ApiError(`Le type d'entité "${o}" n'est pas supporté par ${e}.`,400)}_getValidatedUserLink(e,t,n){const o=n?.silent??!0;try{this._checkAccess(e),this._assertEntityType(...t)}catch(e){if(o)return null;throw e}return this._getLinkFromConnectedUser()}_isLinked(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.userContext?.serverData?.links;return!!t&&!!t[e]?.[this.id]}isAuthor(e){const t=e?.silent??!0;try{if(this._checkAccess("vérifier l'auteur"),!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401)}catch(e){if(t)return!1;throw e}const n=this.serverData;return!!n.creator&&Boolean(this.userId&&"string"==typeof n.creator&&n.creator===this.userId)}isAdmin(e){const t=this._getValidatedUserLink("vérifier l'administrateur",["organizations","projects","events","classifieds"],{silent:e?.silent});return!(!this._validateUserLink(t)||!0!==t?.isAdmin||t?.isAdminPending)||!!e?.checkHierarchy&&this._isAdminViaHierarchy()}isAuthorOrAdmin(e){return this.isAuthor()||this.isAdmin(e)}isMember(e){const t=this._getValidatedUserLink("vérifier le membre",["organizations"],{silent:e?.silent});return this._validateUserLink(t)}isContributor(e){const t=this._getValidatedUserLink("vérifier le contributeur",["projects"],{silent:e?.silent});return this._validateUserLink(t)}isAttendee(e){const t=this._getValidatedUserLink("vérifier le participant",["events"],{silent:e?.silent});return this._validateUserLink(t)}isFollower(e){const t=e?.silent??!0,n=["citoyens","organizations","projects","events","poi"];try{this._checkAccess("vérifier si il vous suit"),this._assertEntityType(...n)}catch(e){if(t)return!1;throw e}return this._isLinked("followers")}isFollowing(e){const t=e?.silent??!0,n=["citoyens","organizations","projects","events","poi"];try{this._checkAccess("vérifier si vous le suivez"),this._assertEntityType(...n)}catch(e){if(t)return!1;throw e}return this._isLinked("follows")}isToBeValidated(e){const t=this._getValidatedUserLink("vérifier si il est à valider",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.toBeValidated}isInviting(e){const t=this._getValidatedUserLink("vérifier si il est invité",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.isInviting}isInvitingAdmin(e){const t=this._getValidatedUserLink("vérifier si il est invité admin",["organizations","projects","events"],{silent:e?.silent});return!!t&&((!0===t.isAdminInviting||!0===t.isInviting)&&!0===t.isAdmin)}isAdminPending(e){const t=this._getValidatedUserLink("vérifier si il est en attente admin",["organizations","projects","events"],{silent:e?.silent});return!!t&&(!0===t.isAdmin&&!0===t.isAdminPending)}async getCostumJson(){if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);const e=this.serverData;if(!e||"string"!=typeof e.slug||""===e.slug.trim())throw new ApiError("slug de l'entité non défini",400);const t={pathParams:{slug:e.slug}};return this.endpointApi.getCostumJson(t)}_generateRanges(e,t,n={}){const o={};for(const r of e){const e=n[r]||{indexMax:0};o[r]={indexMin:e.indexMax||0,indexMax:e.indexMax+t}}return o}_normalizeCount(e={}){return delete e.spam,e.total=Object.values(e).reduce((e,t)=>e+("number"==typeof t?t:0),0),e}_getDefaultFromEndpoint(e,t){const n=this.apiClient.getRequestSchema(e);if(n?.properties?.[t])return n.properties[t].default}_createPaginatorEngine({initialData:e,finalizer:t,methodName:n,restoredState:o}){const r=this,i=o?{...o}:{cursor:null,count:0,index:0,history:[],sizes:[]},s=e=>Boolean(e?.indexStep&&e.indexStep>0),a=e=>null!=e&&(("string"==typeof e||!!Array.isArray(e))&&e.length>0);async function c(o=!1){const p={...e};i.cursor&&(o||0!==i.history.length)||(i.count=0,i.index=0,i.history=[],i.sizes=[],p.countType=p.searchType,!a(p.searchBy)&&s(p)?(p.ranges=r._generateRanges(p.searchType,p.indexStep),p.indexMin=p.indexMin??0,p.indexMax=p.indexMax??p.indexStep):a(p.searchBy)&&s(p)&&(p.indexMin=p.indexMin??0,p.indexMax=p.indexMax??p.indexStep),i.cursor={...p});const d=i.cursor;o&&d&&(i.history.push({...d}),!a(d.searchBy)&&s(d)?(d.ranges=r._generateRanges(d.searchType,d.indexStep,d.ranges),d.indexMin=d.indexMax??0,d.indexMax=(d.indexMax??0)+d.indexStep):a(d.searchBy)&&s(d)&&(d.indexMin=d.indexMax??0,d.indexMax=(d.indexMax??0)+d.indexStep),i.cursor={...d});const m={...i.cursor||{}};if(!o){const e=m.searchType;if(!Array.isArray(e)||0===e.length)throw new Error("searchType non défini")}const l=await t(m);if(!Array.isArray(l.results))throw new Error("Les résultats doivent être un tableau");i.count+=l.results.length,i.sizes.push(l.results.length),o&&i.index++;const u=r._normalizeCount(l.count),h=r._linkEntities(l.results),y=s(m)&&i.count<u.total,f=i.history.length>0;return{count:u,results:h,pageIndex:i.index,pageNumber:i.index+1,hasNext:y,hasPrev:f,next:y?()=>c(!0):void 0,prev:f?async()=>{const e=i.history.pop(),t=i.sizes.pop()??0;return i.count-=t,i.index=Math.max(0,i.index-1),i.cursor={...e},c(!1)}:void 0,_initialData:{...e},_state:i,_entity:r,_methodName:n}}return{next:()=>c(!1)}}_withCostumContext(e){return async t=>{if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);const n=this.serverData;if(!n||"string"!=typeof n.slug||""===n.slug.trim())throw new ApiError("slug de l'entité non défini",400);if(!n.id||"string"!=typeof n.id)throw new ApiError("id de l'entité non défini",400);const o=Array.isArray(t?.sourceKey)?t.sourceKey:[],r=o.length>0?o:[n.slug],i={...t||{},costumSlug:n.slug,contextId:n.id,contextType:this.getEntityType(),costumId:n.id,costumType:this.getEntityType(),sourceKey:r};return e(i)}}async searchCostum(e={},t){const n=t?.restoredState?.meta?.variant,o=t?.variant??n??"default",r=K[o],i=this._createPaginatorEngine({initialData:e,methodName:"searchCostum",restoredState:t?.restoredState,finalizer:this._withCostumContext(e=>this.endpointApi[r].call(this.endpointApi,e))}),s=await i.next();return s._state&&(s._state.meta={...s._state.meta||{},variant:o}),s}async costumEventRequestActors(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e},n=this._withCostumContext(e=>this.endpointApi.costumEventRequestActors(e));return await n(t)}async costumEventRequestSubevents(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestSubevents(e))(t)}async costumEventRequestDates(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestDates(e))(t)}async costumEventRequestElementEvent(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestElementEvent(e))(t)}async costumEventRequestCategories(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestCategories(e))(t)}async costumEventRequestEvent(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestEvent(e))(t)}async costumEventRequestLinkTlToEvent(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!e.tl&&!e.event)throw new ApiError("Les paramètres 'tl' et 'event' sont requis.",400);if("string"!=typeof e.tl||"string"!=typeof e.event)throw new ApiError("Les paramètres 'tl' et 'event' doivent être des chaînes de caractères.",400);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestLinkTlToEvent(e))(t)}async costumEventRequestLoadContextTag(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestLoadContextTag(e))(t)}async coformAnswersSearch(e={},t){e.searchType=e.searchType??["answers"];return this._createPaginatorEngine({initialData:e,methodName:"coformAnswersSearch",restoredState:t?.restoredState,finalizer:this._withCostumContext(e=>this.endpointApi.coformAnswersSearch(e))}).next()}async searchAnswersByForms(e={}){if(!e.forms||Array.isArray(e.forms)||0===Object.keys(e.forms).length)throw new ApiError("Le paramètre 'forms' est requis et doit être un objet non vide.",400);return(await this.endpointApi.coformAnswersByForms(e)).map(e=>({...e,answers:this._linkEntities(Object.values(e.answers||{}))}))}async fundingEnvelope(e={}){const t=this._withCostumContext(e=>this.endpointApi.fundingEnvelope(e)),n=await t(e);return{...n,...n.contextData&&{contextData:this._linkEntity(n.contextData.collection,n.contextData)??n.contextData},...n.context&&{context:this._linkEntity(n.context.collection,n.context)??n.context},...n.nopropProject&&{nopropProject:this._linkEntities(Object.values(n.nopropProject))??n.nopropProject},...n.projects&&{projects:n.projects.map(e=>{const t=e?.project;let n=e.project;t&&"object"==typeof t&&(n=this._linkEntity(t.collection??"projects",t)??e.project);const o=e.serverData;return o?.actions&&Array.isArray(o.actions)&&n&&"function"==typeof n._linkEntity&&(o.actions=o.actions.map(e=>n._linkEntity("actions",e)??e)),{...e,project:n}})},...n.userOrga&&{userOrga:this._linkEntities(Object.values(n.userOrga))??n.userOrga}}}async coformFiltersSearch(e={}){return this._withCostumContext(e=>this.endpointApi.costumFilterCoform(e))(e)}async coformFilterByPath(e){if(!e?.params||"string"!=typeof e.params.thematicPath||""===e.params.thematicPath.trim())throw new ApiError("coformFilterByPath : params.thematicPath est requis (string non vide).",400);const t=this._withCostumContext(e=>this.endpointApi.costumFilterCoformByPath(e)),n=await t(e),o=Array.isArray(n?.results)?n.results:[];let r=[];const i=[];for(const e of o)e&&"object"==typeof e&&("distinctElements"!==e.id?i.push({name:"string"==typeof e.name?e.name:String(e.id??""),image:"string"==typeof e.image?e.image:"",orgaNameArray:Array.isArray(e.orgaNameArray)?e.orgaNameArray.map(e=>String(e)):[]}):r=Object.entries(e).filter(([e])=>/^\d+$/.test(e)).sort(([e],[t])=>Number(e)-Number(t)).map(([,e])=>String(e)));return{distinctElements:r,values:i,count:n?.count&&"object"==typeof n.count?n.count:{answers:i.length}}}async searchZone(e){if(!e.countryCode?.length||!e.level?.length)throw new ApiError("countryCode et level sont requis.",400);return this._withCostumContext(e=>this.endpointApi.searchZones(e))(e)}async getCountries(e={}){return this.endpointApi.getCountries(e)}async generateNewAnswerId(e){if(!e||"string"!=typeof e)throw new ApiError("formId est requis et doit être une chaîne de caractères.",400);const t=await this.endpointApi.generateAnswerFromForm({pathParams:{formId:e},action:"new"});return this._linkEntity?.(t.collection,t)??t}async linkDiscourseAccount(e){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.linkDiscourseAccount({...e,costumId:e.contextId,costumType:e.contextType}))({username:e})}async unlinkDiscourseAccount(){return this._withCostumContext(e=>this.endpointApi.unlinkDiscourseAccount({...e,costumId:e.contextId,costumType:e.contextType}))({})}async getDiscourseProfile(e){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.discourseProfile({...e,costumId:e.contextId,costumType:e.contextType}))({username:e})}async checkDiscourseEmailMatch(){return this._withCostumContext(e=>this.endpointApi.discourseCheckEmail({...e,costumId:e.contextId,costumType:e.contextType}))({})}async dismissDiscourseLink(){return this._withCostumContext(e=>this.endpointApi.discourseDismissLink({...e,costumId:e.contextId,costumType:e.contextType}))({})}async linkMediaWikiAccount(e){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.linkMediawikiAccount({...e,costumId:e.contextId,costumType:e.contextType}))({username:e})}async unlinkMediaWikiAccount(){return this._withCostumContext(e=>this.endpointApi.unlinkMediawikiAccount({...e,costumId:e.contextId,costumType:e.contextType}))({})}async getMediaWikiContributions(e,t){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.getMediawikiContributions({...e,costumId:e.contextId,costumType:e.contextType}))({username:e,limit:t})}async coremuOperation(e){if(!e.form||"string"!=typeof e.form)throw new ApiError("form est requis et doit être une chaîne de caractères.",400);if(!e.project||"string"!=typeof e.project)throw new ApiError("project est requis et doit être une chaîne de caractères.",400);const t={...e,answer:"new",action:"generateproposition"},n=await this.endpointApi.coremuOperation(t);return this._linkEntity(n?.collection,n)??n}static restorePaginationFromJSON(e,t){const n=t instanceof BaseEntity?t:w(e._entity,t),o=e.results.map(e=>w(e,n)),r=e._methodName,i=e._initialData,s=e._state;return{results:o,count:e.count,hasNext:e.hasNext,hasPrev:e.hasPrev,pageIndex:e.pageIndex,pageNumber:e.pageNumber,next:e.hasNext?async()=>{const e=n[r];if("function"!=typeof e)throw new Error(`Méthode ${r} non trouvée sur l'entité`);const t=await e.call(n,i,{restoredState:s});return t.next?.()??t}:void 0,prev:e.hasPrev?async()=>{const e=n[r];if("function"!=typeof e)throw new Error(`Méthode ${r} non trouvée sur l'entité`);const t=await e.call(n,i,{restoredState:s});return t.prev?.()??t}:void 0,_initialData:i,_state:s,_entity:n,_methodName:r}}}class Action extends BaseEntity{static entityType="actions";static entityTag="Action";static SCHEMA_CONSTANTS=["COSTUM_PROJECT_ACTION_REQUEST_NEW","VIRTUAL_ACTION_EDITABLE"];static VIRTUAL_SCHEMAS={VIRTUAL_ACTION_EDITABLE:{type:"object",properties:{name:{type:"string"},credits:{type:"integer"},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},status:{type:"string",enum:["todo","done"]},tags:{type:"array",items:{type:"string"}},links:{type:"object"},startDate:{oneOf:[{type:"string"},{type:"null"}]},endDate:{oneOf:[{type:"string"},{type:"null"}]},milestone:{oneOf:[{type:"object"},{type:"null"}]},importance:{type:"string"}}}};static ADD_BLOCKS=new Map([["COSTUM_PROJECT_ACTION_REQUEST_NEW","addAction"]]);static CUSTOM_FIELD_HANDLERS=new Map([["name",{updateMethod:"updateName",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["credits",{updateMethod:"updateCredits",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["min",{updateMethod:"updateMin",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["max",{updateMethod:"updateMax",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["status",{updateMethod:"updateStatus",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["tags",{updateMethod:"updateTags",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["links",{updateMethod:"updateContributors",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["startDate",{updateMethod:"updateStartDate",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["endDate",{updateMethod:"updateEndDate",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["milestone",{updateMethod:"updateMilestone",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["importance",{updateMethod:"updateImportance",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}]]);static CREATE_ONLY_FIELDS={mentions:"Utilise joinContributor/leaveContributor/updateContributors à la place.",is_contributor:"Flag de création one-shot (auto-ajoute le créateur comme admin contributor).",assign:"Flag de création one-shot (assigne un user comme admin contributor à la création).",urls:"Non modifiable en update (à confirmer empiriquement avec le backend).",idParentRoom:"Auto-géré par le backend (Room::getOrCreateActionRoom).",timeSpent:"Modifié implicitement par le flow status=done (auto-injecte updateStatus[N].timeSpent côté backend)."};static UPDATE_BLOCKS=new Map([]);defaultFields={parentType:"projects"};removeFields=["parentType","parentId"];_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);if(!this.parent?.id)throw new ApiError("Le parent (Project) doit être défini pour créer une action.",400);if("projects"!==this.parent.getEntityType())throw new ApiError(`Une Action ne peut être créée que depuis un Project (parent reçu: ${this.parent.getEntityType()}).`,400);const t=e.milestone?.milestoneId;if(t){const e=this.parent;if("function"==typeof e.hasMilestone&&!e.hasMilestone(t))throw new ApiError(`Milestone "${t}" introuvable dans project.serverData.oceco.milestones — refresh le projet ou utilise un milestoneId valide.`,400)}e.parentId=this.parent.id;for(const[t,n]of Array.from(Action.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(Action.ADD_BLOCKS,n,o),t=e?.content;!this.id&&t?.id&&(this._draftData.id=t.id,this._setData(t,{forceInitialDraftReset:!0}))}}};async addAction(e={}){return this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestNew(e))}_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(!this.id)throw new ApiError("Action sans id, impossible de mettre à jour.",400);const t=this.parent;if(!t||"function"!=typeof t.isAdmin||!t.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cette action",403);e.id&&delete e.id;for(const[e,t]of Object.entries(Action.CREATE_ONLY_FIELDS))if(this._hasFieldChanged(e))throw new ApiError(`"${e}" est create-only, non modifiable après création. ${t}`,400);let n=!1;const o=Action.CUSTOM_FIELD_HANDLERS;if(o){const t=new Set;for(const[r,i]of o)r in e&&this._hasFieldChanged(r)&&(await this._invokeCustomFieldHandler(i.updateMethod,e[r],r),t.add(r),n=!0);t.forEach(t=>delete e[t])}for(const[t,o]of Array.from(Action.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Action.UPDATE_BLOCKS,o,r),n=!0)}return n};async updateName(e){const t=await this._updatePath("name",e);return await this._refreshIfDirect(),t}async updateCredits(e){this._assertInt("credits",e);const t=await this._updatePath("credits",e,"int");return await this._refreshIfDirect(),t}async updateMin(e){this._assertInt("min",e);const t=await this._updatePath("min",e,"int");return await this._refreshIfDirect(),t}async updateMax(e){this._assertInt("max",e);const t=await this._updatePath("max",e,"int");return await this._refreshIfDirect(),t}async updateStatus(e){const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetStatus({id:this.id,status:e}));return await this._refreshIfDirect(),t}async updateTags(e){const t=await this._updatePath("tags",e);return await this._refreshIfDirect(),t}async updateImportance(e){if("string"!=typeof e)throw new ApiError(`importance: attendu string. Reçu: ${JSON.stringify(e)}`,400);const t=await this._updatePath("importance",e);return await this._refreshIfDirect(),t}async updateContributors(e){this._assertParentAdminForContributorMutation("updateContributors");const t=Object.keys(e?.contributors??{}),n=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetContributors({action:this.id,contributors:t}));return await this._refreshIfDirect(),n}async joinContributor(e){const t=e??this.userId;if(!t)throw new ApiError("userId requis pour joinContributor (utilisateur non connecté ou paramètre absent)",400);t===this.userId||this._assertParentAdminForContributorMutation("joinContributor",t);const n=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetContributors({action:this.id,contributor:t,participate:1}));return await this._refreshIfDirect(),n}async leaveContributor(e){const t=e??this.userId;if(!t)throw new ApiError("userId requis pour leaveContributor (utilisateur non connecté ou paramètre absent)",400);t===this.userId||this._assertParentAdminForContributorMutation("leaveContributor",t);const n=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetContributors({action:this.id,contributor:t,participate:0}));return await this._refreshIfDirect(),n}_assertParentAdminForContributorMutation(e,t){const n=this.parent;if(!n||"function"!=typeof n.isAdmin||!n.isAdmin()){throw new ApiError(`${e}${t?` (cible: "${t}")`:""} : seul un admin du projet parent peut effectuer cette opération.`,403)}}async updateMilestone(e){let t;if(null===e)t=await this._updatePath("milestone","");else{const n=e?.milestoneId;if("string"!=typeof n||0===n.length)throw new ApiError("milestone: attendu objet { milestoneId: string non-vide } ou null pour effacer.",400);const o=this.parent;if("function"==typeof o.hasMilestone&&!o.hasMilestone(n))throw new ApiError(`Milestone "${n}" introuvable dans project.serverData.oceco.milestones — refresh le projet ou utilise un milestoneId valide.`,400);t=await this._updatePath("milestone",{milestoneId:n})}return await this._refreshIfDirect(),t}async updateStartDate(e){this._assertIsoDate("startDate",e);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetDate({id:this.id,startDate:null===e?"":e}));return await this._refreshIfDirect(),t}async updateEndDate(e){this._assertIsoDate("endDate",e);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetDate({id:this.id,endDate:null===e?"":e}));return await this._refreshIfDirect(),t}isContributor(e){const t=e?.silent??!0;try{if(!this.userId)throw new ApiError("Utilisateur non connecté.",401);if(!this.id)throw new ApiError("Action non enregistrée.",404);if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404)}catch(e){if(t)return!1;throw e}return!!this.serverData.links?.contributors?.[this.userId]}async cancel(){if(!this.id)throw new ApiError("Action sans id, impossible d'annuler.",400);const e=this.parent;if(!e||"function"!=typeof e.isAdmin||!e.isAdmin())throw new ApiError("Vous n'avez pas les droits pour annuler cette action",403);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestCancel({id:this.id}));return await this._refreshIfDirect(),t}async archive(){if(!this.id)throw new ApiError("Action sans id, impossible d'archiver.",400);const e=this.parent;if(!e||"function"!=typeof e.isAdmin||!e.isAdmin())throw new ApiError("Vous n'avez pas les droits pour archiver cette action",403);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestArchive({id:this.id}));return await this._refreshIfDirect(),t}async delete(e="delete action"){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une Action.",400);if(!this.isAuthorOrAdmin({checkHierarchy:!0}))throw new ApiError("Suppression refusée — vous devez être l'auteur de l'Action ou administrateur du projet parent.",403);const t={reason:e,pathParams:{type:"actions",id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteElement(t)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async _updatePath(e,t,n){return this.updateField(e,t,n?{setType:n}:{})}_assertInt(e,t){if("number"!=typeof t||!Number.isInteger(t))throw new ApiError(`${e}: attendu entier (Number.isInteger). Reçu: ${JSON.stringify(t)}`,400)}_assertIsoDate(e,t){if(null!==t&&("string"!=typeof t||!this._isIsoDateTime(t)))throw new ApiError(`${e}: attendu chaîne ISO 8601 ("2026-05-20T08:00:00.000Z") ou null. Reçu: ${JSON.stringify(t)}`,400)}_isIsoDateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/.test(e)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}class Answer extends BaseEntity{static entityType="answers";static entityTag="Answer";static SCHEMA_CONSTANTS=["SAVE_COFORM_ANSWER"];static ADD_BLOCKS=new Map([["SAVE_COFORM_ANSWER","saveCoformAnswer"]]);static UPDATE_BLOCKS=new Map([["SAVE_COFORM_ANSWER","saveCoformAnswer"]]);defaultFields={};removeFields=["_id","collection","user","created","updated","modified","draft","finished","context","voteCount","vote","project"];_isAdminViaHierarchy(){const e=this.parent;if(!e||"function"!=typeof e.getEntityType||"forms"!==e.getEntityType())return!1;const t=e.serverData?.parent;if(!t||"object"!=typeof t)return!1;for(const[e,n]of Object.entries(t)){if(!n||"object"!=typeof n)continue;const t=n;if(t.type&&this._isAdminOfParent(e,t.type))return!0}return!1}isAuthor(e){const t=e?.silent??!0;try{if(!this.isConnected)throw new ApiError("Vous devez être connecté pour vérifier l'auteur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401)}catch(e){if(t)return!1;throw e}const n=this._serverData.user;if(!n)return!1;const o="string"==typeof n?n:n.id;return Boolean(this.userId&&"string"==typeof o&&o===this.userId)}_transformServerData(e){e.user&&"object"==typeof e.user&&"id"in e.user&&(e.user=this._linkNestedEntity({type:"citoyens",collection:"citoyens",...e.user}));const t=this._resolveFormData();return t&&e.answers&&"object"==typeof e.answers&&(e.answers=this._normalizeLegacyUploaderInAnswers(e.answers,t)),e}async get(e={}){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);const t=this.id,n="formId"in e?e.formId:this._autoFormIdFromParent(),o={answerId:t};e.fields&&e.fields.length>0&&(o.fields=e.fields),"string"==typeof n&&n.length>0&&(o.formId=n),e.finderPath&&(o.finderPath=e.finderPath);const r=await this.endpointApi.coformAnswersById(o);if(r?.data?.id)return this._setData(r.data,{forceInitialDraftReset:!0}),this.serverData;throw new ApiError(`Aucune réponse trouvée pour l'ID ${this.id}`,404)}_autoFormIdFromParent(){const e=this.parent;if(e&&"function"==typeof e.getEntityType&&"forms"===e.getEntityType()&&"string"==typeof e.id)return e.id}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async delete(e="delete coform answer"){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une Answer.",400);if(!this.isAuthorOrAdmin({checkHierarchy:!0}))throw new ApiError("Suppression refusée — vous devez être l'auteur de l'Answer ou administrateur du parent (organisation/projet) du Form.",403);const t={reason:e,pathParams:{type:"answers",id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteElement(t)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async deleteFile(e){await super.deleteFile(e),this._removeDocIdFromUploaderFields(this._serverData.answers,e),this._removeDocIdFromUploaderFields(this._draftData.answers,e)}_removeDocIdFromUploaderFields(e,t){if(e&&"object"==typeof e)for(const n of Object.values(e))if(this._isObjectRecord(n))for(const e of Object.values(n)){if(!this._isObjectRecord(e))continue;const n=e.files;this._isObjectRecord(n)&&t in n&&delete n[t]}}async getFiles(e){if(!this.id)throw new ApiError("Answer sans id, impossible de lister ses fichiers.",400);if(!e.subKey||0===e.subKey.length)throw new ApiError("`subKey` requis pour lister les fichiers d'un input.",400);const t={answerId:this.id,subKey:e.subKey};e.docType&&(t.docType=e.docType),e.contentKey&&(t.contentKey=e.contentKey);return((await this.callIsConnected(()=>this.endpointApi.coformGetAnswerFiles(t))).files??[]).filter(e=>"string"==typeof e.id&&"string"==typeof e.docPath).map(e=>({docId:e.id,docPath:e.docPath,name:e.name??void 0,size:e.size??void 0,imagePath:e.imagePath??void 0,imageThumbPath:e.imageThumbPath??void 0,imageMediumPath:e.imageMediumPath??void 0}))}async getHistory(){if(!this.id)throw new ApiError("Answer sans id, impossible de récupérer son historique.",400);const e={answerId:this.id},t=await this.callIsConnected(()=>this.endpointApi.getCoformAnswerHistory(e)),n=t?.data?.history;return Array.isArray(n)?n:[]}async getMultiEvalData(e={}){if(!this.id)throw new ApiError("Answer sans id, impossible de récupérer ses évaluations multiples.",400);const t={answerId:this.id};e.stepKey&&(t.stepKey=e.stepKey);const n=await this.callIsConnected(()=>this.endpointApi.getCoformMultievalData(t)),o=n?.data?.steps;return{steps:Array.isArray(o)?o:[]}}async uploadFile(e,t={}){const n=this._resolveFormId({}),o=t.qqfilename??`upload-${Date.now()}`,{qqfile:r,qqfilename:i,qqtotalfilesize:s}=await this._prepareUploadFile(e,o),a={formId:n,docType:t.docType??"image",contentKey:t.contentKey??"slider",qquuid:t.qquuid??this._generateUuid(),qqfilename:t.qqfilename??i,qqtotalfilesize:t.qqtotalfilesize??s,qqfile:r};t.subKey&&(a.subKey=t.subKey),this.id&&(a.answerId=this.id);const c=await this.callIsConnected(()=>this.endpointApi.coformUploadAnswerFile(a));if(!0!==c?.result&&!0!==c?.success)throw new ApiError(c?.msg||"Échec de l'upload coform.",500);if(!c.answerId||!c.docPath)throw new ApiError("Réponse d'upload incomplète (answerId ou docPath manquant).",500);return this.id||(this._draftData.id=c.answerId),{docId:c.id??"",docPath:c.docPath,answerId:c.answerId}}async processUploads(e,t={}){const n=t.formData??this._resolveFormData(),o=this._collectPendingUploads(e,[],n);if(0===o.length)return this._cleanUploaderUrls(e,n);let r=e,i=0;if(!this.id){const e=o[0],t=await this._uploadAndReplace(e,r,1);r=t,i=1}if(i<o.length){const e=o.slice(i),n=t.batchSize??4,s=await this._uploadInBatches(e,(e,t)=>this._uploadPendingItem(e,i+t+1),n);e.forEach((e,t)=>{r=this._setValueAtPath(r,e.path,s[t])})}const s=new Map;for(const e of o)if(e.inputType?.endsWith(".uploader")&&e.path.length>=2){const t=JSON.stringify(e.path.slice(0,2));s.has(t)||s.set(t,e.path.slice(0,2))}for(const e of s.values()){const t=this._getValueAtPath(r,e);r=this._setValueAtPath(r,e,this._normalizeUploaderValue(t))}return this._cleanUploaderUrls(r,n)}_generateUuid(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");const t=this._resolveFormId(e),n=this._buildSavePayload(t,e,!1),o=await this.callIsConnected(()=>this.endpointApi.saveCoformAnswer(n)),r=o?.data?.id;this.id||"string"!=typeof r||24!==r.length||(this._draftData.id=r)};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");if(!this.id)throw new ApiError("Answer sans id, impossible de mettre à jour.",400);const t=this._resolveFormId(e),n=this._buildSavePayload(t,e,!0);return await this.callIsConnected(()=>this.endpointApi.saveCoformAnswer(n)),!0};_resolveFormId(e){const t="string"==typeof e.form?e.form:void 0,n="string"==typeof this._serverData.form?this._serverData.form:void 0,o=this.parent,r=o&&"function"==typeof o.getEntityType&&"forms"===o.getEntityType()&&"string"==typeof o.id?o.id:void 0,i=t??n??r;if("string"!=typeof i||0===i.length)throw new ApiError("formId introuvable pour sauvegarder l'Answer. Créez l'Answer via `form.answer()` ou définissez `answer.data.form` manuellement.",400);return i}_buildSavePayload(e,t,n){const o=t.answers??(n?this._serverData.answers:void 0);if(null==o)throw new ApiError("answer.data.answers est requis (objet `{ subFormId: { inputId: value } }`).",400);const r={formId:e,answers:JSON.stringify(o)};return n&&(r.answerId=this.id),t.addedOptions&&"object"==typeof t.addedOptions&&Object.keys(t.addedOptions).length>0&&(r.addedOptions=JSON.stringify(t.addedOptions)),t.links&&"object"==typeof t.links&&Object.keys(t.links).length>0&&(r.links=JSON.stringify(t.links)),r}_resolveFormData(){const e=this.parent;if(e&&"function"==typeof e.getEntityType&&"forms"===e.getEntityType())return e.serverData}_isObjectRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}_isDataUri(e){return/^data:[^;]+;base64,/.test(e)}_isPendingUploadValue(e){return!!this._isObjectRecord(e)&&("string"==typeof e.data&&this._isDataUri(e.data))}_parseMimeType(e){const t=e.match(/^data:([^;]+);base64,/i);return t?.[1]?.toLowerCase()??"application/octet-stream"}_inferExtensionFromMimeType(e){return{"image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","application/pdf":"pdf","text/plain":"txt","text/csv":"csv","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/zip":"zip","application/x-rar-compressed":"rar"}[e]??"bin"}_sanitizeBaseName(e){return e.replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9_. -]+/g,"-").trim()||"upload"}async _dataUriToFile(e,t){const n=this._parseMimeType(e.data),o=n.startsWith("image/")?"image":"file",r=this._inferExtensionFromMimeType(n),i=e.name&&""!==e.name.trim()?e.name:t,s=/\.[a-zA-Z0-9]+$/.test(i)?i:`${this._sanitizeBaseName(i)}.${r}`;if("undefined"!=typeof window&&"undefined"!=typeof File){const t=await(await fetch(e.data)).blob();return{file:new File([t],s,{type:n}),docType:o,filename:s}}const a=e.data.match(/^data:[^;]+;base64,(.*)$/);if(!a)throw new ApiError("data:URI invalide (base64 attendu).",400);return{file:Buffer.from(a[1],"base64"),docType:o,filename:s}}_collectPendingUploads(e,t=[],n){const o=[],r=()=>{if(!n||t.length<2)return;const[e,o]=t;if("string"!=typeof e||"string"!=typeof o)return;const r=n.inputs?.[e];if(!r)return;const i=r.inputs?.[o];return i&&"object"==typeof i&&"type"in i?i.type:void 0};return"string"==typeof e?(this._isDataUri(e)&&o.push({value:{data:e},path:t,inputType:r()}),o):this._isPendingUploadValue(e)?(o.push({value:e,path:t,inputType:r()}),o):Array.isArray(e)?(e.forEach((e,r)=>{o.push(...this._collectPendingUploads(e,[...t,r],n))}),o):(this._isObjectRecord(e)&&Object.entries(e).forEach(([e,r])=>{o.push(...this._collectPendingUploads(r,[...t,e],n))}),o)}_getUploadKeys(e,t){if(e&&("uploader"===e||e.endsWith(".uploader"))){return{contentKey:"presentation",subKey:t.slice(0,2).filter(e=>"string"==typeof e).join(".")||void 0}}return{contentKey:"slider"}}_getValueAtPath(e,t){if(0===t.length)return e;const[n,...o]=t;return Array.isArray(e)||this._isObjectRecord(e)?this._getValueAtPath(e[n],o):void 0}_setValueAtPath(e,t,n){if(0===t.length)return n;const[o,...r]=t;if(Array.isArray(e)){const t=[...e];return t[o]=this._setValueAtPath(t[o],r,n),t}return this._isObjectRecord(e)?{...e,[o]:this._setValueAtPath(e[o],r,n)}:e}_normalizeLegacyUploaderInAnswers(e,t){const n={};for(const[o,r]of Object.entries(e)){if(!this._isObjectRecord(r)){n[o]=r;continue}const e=t.inputs?.[o];if(!e){n[o]=r;continue}const i={};for(const[t,n]of Object.entries(r)){const o=e.inputs?.[t],r=o&&"object"==typeof o&&"type"in o?o.type:void 0;i[t]=r?.endsWith(".uploader")?this._normalizeUploaderValue(n):n}n[o]=i}return n}_normalizeUploaderValue(e){const t=(new Date).toLocaleDateString("fr-FR"),n=e=>{const t={};for(const n of e)this._isObjectRecord(n)&&"string"==typeof n.docId&&"string"==typeof n.docPath?t[n.docId]=n.docPath:"string"==typeof n&&(t[n]=n);return t};return this._isObjectRecord(e)&&"updateDate"in e&&Array.isArray(e.updateDate)?this._isObjectRecord(e.files)?e:Array.isArray(e.files)?{...e,files:n(e.files)}:e:Array.isArray(e)?{updateDate:[t],files:n(e)}:e}_cleanUrlToRelativePath(e){if("string"==typeof e){if(this._isDataUri(e))return e;const t=e.match(/^https?:\/\/[^/]+(\/.*)/i);return t?t[1]:e}if(Array.isArray(e))return e.map(e=>this._cleanUrlToRelativePath(e));if(this._isObjectRecord(e)){if("data"in e&&"string"==typeof e.data){const t=this._isDataUri(e.data)?e.data:this._cleanUrlToRelativePath(e.data);return{...e,data:t}}const t={};for(const[n,o]of Object.entries(e))t[n]=this._cleanUrlToRelativePath(o);return t}return e}static INPUT_TYPES_TO_CLEAN_URLS=[".uploader",".simpleTable"];_cleanUploaderUrls(e,t){if(!t)return e;const n={};for(const[o,r]of Object.entries(e)){if(!this._isObjectRecord(r)){n[o]=r;continue}const e=t.inputs?.[o];if(!e){n[o]=r;continue}const i={};for(const[t,n]of Object.entries(r)){const o=e.inputs?.[t],r=o&&"object"==typeof o&&"type"in o?o.type:void 0,s=!!r&&Answer.INPUT_TYPES_TO_CLEAN_URLS.some(e=>r.endsWith(e));i[t]=s?this._cleanUrlToRelativePath(n):n}n[o]=i}return n}async _uploadInBatches(e,t,n=4){const o=[];for(let r=0;r<e.length;r+=n){const i=e.slice(r,r+n),s=await Promise.all(i.map((e,n)=>t(e,r+n)));o.push(...s)}return o}async _uploadPendingItem(e,t){const n=`upload-${t}`,{file:o,docType:r,filename:i}=await this._dataUriToFile(e.value,n),{contentKey:s,subKey:a}=this._getUploadKeys(e.inputType,e.path),c=await this.uploadFile(o,{docType:r,contentKey:s,subKey:a,qqfilename:i});return e.inputType?.endsWith(".uploader")??!1?{docId:c.docId,docPath:c.docPath}:c.docPath}async _uploadAndReplace(e,t,n){const o=await this._uploadPendingItem(e,n);return this._setValueAtPath(t,e.path,o)}}class Badge extends BaseEntity{static entityType="badges";static entityTag="Badge";static SCHEMA_CONSTANTS=["ADD_BADGES"];static ADD_BLOCKS=new Map([["ADD_BADGES","addBadges"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Badge.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(o&&Object.keys(o).length>0){const e=await this[n](o);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[n,o]of Array.from(Badge.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this[o](r),t=!0)}return t};async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async getSubscribers(){throw new ApiError(`getSubscribers n'existe pas dans ${this.constructor.name}`,501)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}function J(e){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{type:t?.type??"",name:t?.name}])):{}}function H(e){return(t,n)=>n?.socialNetwork?.[e]}class Classified extends BaseEntity{static entityType="classifieds";static entityTag="Classified";static SCHEMA_CONSTANTS=["ADD_CLASSIFIED"];static ADD_BLOCKS=new Map([["ADD_CLASSIFIED","addClassified"]]);defaultFields={typeElement:"classified"};removeFields=["typeElement"];transforms={parent:J};_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.();for(const[t,n]of Array.from(Classified.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(o&&Object.keys(o).length>0){const e=await this[n](o);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(!this.isAuthor()&&!this.isAdmin({checkHierarchy:!0}))throw new ApiError("Vous n'êtes pas autorisé à modifier cette ressource",403);let t=!1;const n=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_CLASSIFIED",{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);return n&&Object.keys(n).length>0&&(await this.addClassified(n),t=!0),t};async addClassified(e={}){const t=e;if(this.parent&&this.parent.id&&this.parent.id!==this.userId&&!t.parent){t.parent={};t.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}}return this.callIsConnected(()=>this.endpointApi.addClassified(e))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}async classified(){throw new ApiError(`classified n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async follow(){throw new ApiError(`follow n'existe pas dans ${this.constructor.name}`,501)}async unfollow(){throw new ApiError(`unfollow n'existe pas dans ${this.constructor.name}`,501)}async getGallery(){throw new ApiError(`getGallery n'existe pas dans ${this.constructor.name}`,501)}}class Comment extends BaseEntity{static entityType="comments";static entityTag="Comment";static SCHEMA_CONSTANTS=["ADD_COMMENTS"];static ADD_BLOCKS=new Map([["ADD_COMMENTS","addComments"]]);static UPDATE_BLOCKS=new Map([["ADD_COMMENTS","updateComments"]]);defaultFields={};removeFields=["contextId","contextType","parentCommentId","argval"];_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),Array.isArray(e.replies)&&(e.replies=e.replies.map(e=>(e&&"object"==typeof e&&!e.type&&(e.type="comments",e.collection="comments"),this._linkNestedEntity(e)))),e}async get(){throw new ApiError(`get n'existe pas dans ${this.constructor.name}`,501)}async save(){const e=this.refresh;this.refresh=async()=>this._serverData;try{return await super.save()}finally{this.refresh=e}}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");if(""===e.text&&(e.text=" "),"comments"===this.parent.getEntityType()){e.parentCommentId=this.parent.id;let t=this.parent.parent;for(;t&&t.getEntityType&&"comments"===t.getEntityType();)t=t.parent;if(!t)throw new Error("Impossible de trouver l'entité racine pour le commentaire.");e.contextId=t.id,e.contextType=t.getEntityType()}else e.parentCommentId=e.parentCommentId||"",e.contextId=this.parent.id,e.contextType=this.parent.getEntityType();for(const[t,n]of Array.from(Comment.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{},[]);if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(Comment.ADD_BLOCKS,n,o),t=e?.object?.id||e?.id?.$id||e?.id;!this.id&&t&&(this._draftData.id=t,this._setData(e.newComment,{forceInitialDraftReset:!0}))}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");""===e?.text&&(e.text=" "),e.params={text:e.text},delete e.text;let t=!1;const n=await this.callIsConnected(()=>this.endpointApi.updateComments(e));return n?.comment&&this._setData(n.comment,{forceInitialDraftReset:!0}),t=!0,true};async addComments(e={}){return this.callIsConnected(()=>this.endpointApi.addComments(e))}async updateComments(e={}){return this.callIsConnected(()=>this.endpointApi.updateComments(e))}async delete(){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer un commentaire.",400);const e={pathParams:{id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteComments(e)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async addVote(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"comments",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected(()=>this.endpointApi.addVote(t))}async getVotes(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistré.`,404);const e={pathParams:{type:"comments",id:this.id}};return this.endpointApi.showVote(e)}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const n={collection:"comments",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected(()=>this.endpointApi.addReportAbuse(n))}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}class EndpointApi{apiClient;constructor(e){this.apiClient=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}async call(e,t={}){return this.apiClient.safeCall(async()=>{const n=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(n),n.data})}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour effectuer cette action.",401);return this.call(e,t)}async personRegister(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_REGISTER",e)}async authenticateUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("AUTHENTICATE_URL",e)}async refreshTokenUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("REFRESH_TOKEN_URL",e)}async meInfoUrl(){return this.callIsConnected("ME_INFO_URL")}async passwordRecovery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PASSWORD_RECOVERY",e)}async serverExchangeToken(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SERVER_EXCHANGE_TOKEN",e)}async changePassword(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHANGE_PASSWORD",e)}async deleteAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ACCOUNT",e)}async updateSettings(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_SETTINGS",e)}async updateBlockDescription(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_DESCRIPTION",e)}async updateBlockInfo(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_INFO",e)}async updateBlockSocial(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SOCIAL",e)}async updateBlockLocality(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_LOCALITY",e)}async updateBlockSlug(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SLUG",e)}async check(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHECK",e)}async profilImage(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_IMAGE",e)}async profilBanner(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_BANNER",e)}async getElementsAbout(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_ABOUT",e)}async multiconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MULTICONNECT",e)}async getNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS",e)}async getNewsById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS_BY_ID",e)}async addNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_NEWS",e)}async addImageNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_NEWS",e)}async addFileNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FILE_NEWS",e)}async deleteNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_NEWS",e)}async updateNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_NEWS",e)}async shareNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_NEWS",e)}async getComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COMMENTS",e)}async addComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_COMMENTS",e)}async deleteComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_COMMENTS",e)}async updateComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_COMMENTS",e)}async searchTags(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_TAGS",e)}async showVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SHOW_VOTE",e)}async globalAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE",e)}async cityAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE",e)}async cityAutocompleteByCountry(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE_BY_COUNTRY",e)}async suggestionInput(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SUGGESTION_INPUT",e)}async getProjectsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_PROJECTS_NO_ADMIN",e)}async getProjectsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_PROJECTS_ADMIN",e)}async getPoisNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_POIS_NO_ADMIN",e)}async getPoisAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_POIS_ADMIN",e)}async getOrganizationsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ORGANIZATIONS_NO_ADMIN",e)}async getOrganizationsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ORGANIZATIONS_ADMIN",e)}async getUserEligiblePlaces(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_USER_ELIGIBLE_PLACES",e)}async getMembersNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEMBERS_NO_ADMIN",e)}async getMembersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_MEMBERS_ADMIN",e)}async getFriendsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FRIENDS_ADMIN",e)}async getSubscriptions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIPTIONS",e)}async getSubscriptionsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIPTIONS_ADMIN",e)}async getSubscribers(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIBERS",e)}async getSubscribersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIBERS_ADMIN",e)}async getContributorsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_CONTRIBUTORS_NO_ADMIN",e)}async getContributorsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_CONTRIBUTORS_ADMIN",e)}async getBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES",e)}async getBadgesFilters(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES_FILTERS",e)}async connect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CONNECT",e)}async disconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCONNECT",e)}async getElementsKey(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_KEY",e)}async getFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FAVORIS",e)}async deleteFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_FAVORIS",e)}async addFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FAVORIS",e)}async addOrganization(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_ORGANIZATION",e)}async addProject(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_PROJECT",e)}async addPoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_POI",e)}async addEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_EVENT",e)}async deleteElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ELEMENT",e)}async addImageElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_ELEMENT",e)}async linkValidate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_VALIDATE",e)}async searchMemberAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_MEMBER_AUTOCOMPLETE",e)}async getNotifications(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS",e)}async getNotificationsCount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS_COUNT",e)}async notificationUpdate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("NOTIFICATION_UPDATE",e)}async removeAllNotifications(){return this.callIsConnected("REMOVE_ALL_NOTIFICATIONS")}async markNotificationAsRead(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MARK_NOTIFICATION_AS_READ",e)}async activitypubSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_SEARCH",e)}async activitypubLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ACTIVITYPUB_LINK",e)}async activitypubGetCommunity(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_GET_COMMUNITY",e)}async getBadge(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGE",e)}async getEmetteurBadges(){return this.call("GET_EMETTEUR_BADGES")}async addBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_BADGES",e)}async assignBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ASSIGN_BADGES",e)}async getEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_EVENTS",e)}async shareEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_EVENTS",e)}async inviteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("INVITE_EVENT",e)}async follow(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("FOLLOW",e)}async getCostumJson(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COSTUM_JSON",e)}async globalAutocompleteCostum(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE_COSTUM",e)}async navigatorGettl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("NAVIGATOR_GETTL",e)}async costumEventRequestActors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ACTORS",e)}async costumEventRequestSubevents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS",e)}async costumEventRequestElementEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT",e)}async costumEventRequestCategories(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_CATEGORIES",e)}async costumEventRequestDates(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_DATES",e)}async costumEventRequestEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_EVENT",e)}async costumEventRequestLinkTlToEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",e)}async costumEventRequestLoadContextTag(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",e)}async getGallery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_GALLERY",e)}async getAttendeesNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ATTENDEES_NO_ADMIN",e)}async getAttendeesAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ATTENDEES_ADMIN",e)}async coformAnswersSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_SEARCH",e)}async coformAnswersById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_BY_ID",e)}async getCoformById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COFORM_BY_ID",e)}async coformUploadAnswerFile(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COFORM_UPLOAD_ANSWER_FILE",e)}async coformGetAnswerFiles(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COFORM_GET_ANSWER_FILES",e)}async getCoformCatalogs(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COFORM_CATALOGS",e)}async saveCoformAnswer(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SAVE_COFORM_ANSWER",e)}async getCoformAnswerHistory(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_COFORM_ANSWER_HISTORY",e)}async getCoformMultievalData(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_COFORM_MULTIEVAL_DATA",e)}async getCoformCommontableContributors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_COFORM_COMMONTABLE_CONTRIBUTORS",e)}async addVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_VOTE",e)}async addReportAbuse(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_REPORT_ABUSE",e)}async updatePathValue(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_PATH_VALUE",e)}async deleteDocumentByContext(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_DOCUMENT_BY_CONTEXT",e)}async deleteDocumentById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_DOCUMENT_BY_ID",e)}async demoteAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DEMOTE_ADMIN",e)}async costumFilterCoform(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_FILTER_COFORM",e)}async costumFilterCoformByPath(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_FILTER_COFORM_BY_PATH",e)}async getCountries(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COUNTRIES",e)}async searchZones(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_ZONES",e)}async coformAnswersByForms(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_BY_FORMS",e)}async generateAnswerFromForm(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GENERATE_ANSWER_FROM_FORM",e)}async fundingEnvelope(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("FUNDING_ENVELOPE",e)}async coremuOperation(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COREMU_OPERATION",e)}async costumProjectActionRequestNew(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_NEW",e)}async costumProjectActionRequestSetStatus(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_STATUS",e)}async costumProjectActionRequestSetDate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_DATE",e)}async costumProjectActionRequestSetContributors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_CONTRIBUTORS",e)}async costumProjectActionRequestCancel(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_CANCEL",e)}async costumProjectActionRequestArchive(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_ARCHIVE",e)}async linkDiscourseAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_DISCOURSE_ACCOUNT",e)}async unlinkDiscourseAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UNLINK_DISCOURSE_ACCOUNT",e)}async discourseProfile(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("DISCOURSE_PROFILE",e)}async discourseCheckEmail(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCOURSE_CHECK_EMAIL",e)}async discourseDismissLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCOURSE_DISMISS_LINK",e)}async linkMediawikiAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_MEDIAWIKI_ACCOUNT",e)}async unlinkMediawikiAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UNLINK_MEDIAWIKI_ACCOUNT",e)}async getMediawikiContributions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEDIAWIKI_CONTRIBUTIONS",e)}async addClassified(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_CLASSIFIED",e)}async personActivate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_ACTIVATE",e)}}class Event extends BaseEntity{static entityType="events";static entityTag="Event";static SCHEMA_CONSTANTS=["ADD_EVENT","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_EVENT","addEvent"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:J,organizer:J};_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Event.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(Event.ADD_BLOCKS,n,o);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin({checkHierarchy:!0}))throw new ApiError("Vous n'avez pas les droits pour modifier cet événement",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);let t=!1;const n=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_EVENT",{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);n&&Object.keys(n).length>0&&(await this.addEvent(n),t=!0),e.id&&delete e.id;for(const[n,o]of Array.from(Event.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Event.UPDATE_BLOCKS,o,r),t=!0)}return t};async addEvent(e={}){return this.parent&&this.parent.id&&this.parent.id!==this.userId&&!e.organizer&&(e.organizer={},e.organizer[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected(()=>this.endpointApi.addEvent(e))}async delete(e="delete event"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents - les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getAttendees(e={},t={}){e.searchType=this._getDefaultFromEndpoint("GET_ATTENDEES_NO_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getAttendees",restoredState:t?.restoredState,finalizer:async e=>{const{toBeValidated:n,isAdmin:o,isInviting:r,isAdminPending:i,roles:s=[]}=t;this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:n,isAdmin:o,isAdminPending:i,isInviting:r,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:!1,isAdmin:o,isInviting:r,roles:s}));return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getAttendeesAdmin(e)):()=>this.endpointApi.getAttendeesNoAdmin(e))()}}).next()}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Form extends BaseEntity{static entityType="forms";static entityTag="Form";static SCHEMA_CONSTANTS=[];static ADD_BLOCKS=new Map([]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_transformServerData(e){return e}async get(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.getCoformById({parentFormId:e});if(t?.data?.id||t?.data?._id){const e={...t.data,collection:"forms",inputs:t.data.inputs??{},params:t.data.params??{},subForms:t.data.subForms??[],parent:t.data.parent??void 0,config:t.data.config??void 0};return this._setData(e,{forceInitialDraftReset:!0}),this.serverData}throw new ApiError(`Aucun formulaire trouvé pour l'ID ${this.id}`,404)}async getAnswers(e={},t){if(!this.id)throw new ApiError("Form sans id, impossible de chercher ses réponses.",400);const n=this.parent;if(!(n instanceof BaseEntity)||"string"!=typeof n.serverData?.slug||"string"!=typeof n.serverData?.id)throw new ApiError("form.getAnswers nécessite un Form créé via `org.form({id})` ou `project.form({id})` (parent avec costumContext). Pour un Form isolé, utilisez `organization.coformAnswersSearch({ filters: { form: form.id } })` directement.",400);const o={...e.filters??{},form:this.id};return n.coformAnswersSearch({...e,filters:o},t)}async answer(e={}){if(!this.id)throw new ApiError("Form sans id, impossible de créer une Answer rattachée.",400);const t="string"==typeof e.id&&e.id.length>0?e:{form:this.id,...e};return await this.entity("answers",t)}async getCommonTableContributors(e){const t=this.id;if(!t)throw new ApiError("Form sans id, impossible de récupérer les contributeurs.",400);const n=Array.isArray(e.criteriaIds)?JSON.stringify(e.criteriaIds):e.criteriaIds,o=await this.endpointApi.getCoformCommontableContributors({formId:t,inputKey:e.inputKey,criteriaIds:n});return o?.data?.contributors??[]}async getCatalogs(e){if(!this.id)throw new ApiError("Form sans id, impossible de récupérer ses catalogues.",400);if(!Array.isArray(e?.inputKeys)||0===e.inputKeys.length)throw new ApiError("`inputKeys` requis et non vide pour getCatalogs.",400);const t={formId:this.id,inputKeys:JSON.stringify(e.inputKeys)},n=await this.endpointApi.getCoformCatalogs(t),o=n?.data;if(!o||"object"!=typeof o||Array.isArray(o))return{};const r={};for(const[e,t]of Object.entries(o))r[e]=t&&"object"==typeof t&&!Array.isArray(t)?t:{};return r}}class News extends BaseEntity{static entityType="news";static entityTag="News";static SCHEMA_CONSTANTS=["ADD_NEWS"];static ADD_BLOCKS=new Map([["ADD_NEWS","addNews"]]);static UPDATE_BLOCKS=new Map([["ADD_NEWS","updateNews"]]);defaultFields={};removeFields=["parentId","parentType"];transforms={scope:e=>e?.type,mentions:e=>Array.isArray(e)?e.map(e=>({...e,count:parseInt(e.count)})):[],mediaImg:e=>{const t=e?.images?.map(e=>e.id).filter(Boolean)||[];return t.length>0?{countImages:t.length,images:t}:{countImages:0,images:[]}},mediaFile:e=>{const t=e?.files?.map(e=>e.id).filter(Boolean)||[];return t.length>0?{countFiles:t.length,files:t}:{countFiles:0,files:[]}}};_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),e.target&&(e.target=this._linkNestedEntity(e.target)),e.lastAuthorShare&&(e.lastAuthorShare=this._linkNestedEntity(e.lastAuthorShare)),Array.isArray(e.sharedBy)&&(e.sharedBy=e.sharedBy.map(e=>this._linkNestedEntity(e))),e}async get(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.getNewsById({ids:[e]});if(t&&Array.isArray(t)&&1===t.length){const e=t[0];return this._setData(e,{forceInitialDraftReset:!0}),this.serverData}throw new ApiError(`Aucune actualité trouvée pour l'ID ${this.id}`,404)}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");""===e.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType());for(const[t,n]of Array.from(News.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{},[]);if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(News.ADD_BLOCKS,n,o);!this.id&&e?.object?.id&&(this._draftData.id=e.object.id)}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id,""===e?.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType()),e.idNews=this.id;let t=!1;return await this.callIsConnected(()=>this.endpointApi.updateNews(e)),t=!0,true};async addNews(e={}){return this.callIsConnected(()=>this.endpointApi.addNews(e))}async updateNews(e={}){return this.callIsConnected(()=>this.endpointApi.updateNews(e))}async addMention({slug:e,id:t}){try{if(!e&&!t)throw new ApiError("Vous devez fournir un slug ou un id pour ajouter une mention.",400);const n=await this.entity("citoyens",{id:t,slug:e}),o=n.serverData;if(this._draftData.mentions||(this._draftData.mentions=[]),this._draftData.mentions.find(e=>e.id===o.id))return this._draftData.mentions=this._draftData.mentions.map(e=>(e.id===o.id&&(e.count+=1),e)),this._draftData.mentions;const r={id:o.id,slug:o.slug,type:n.getEntityType(),name:o.name,value:o.name,count:1};return this._draftData.mentions.push(r),this._draftData.mentions}catch(e){throw this.apiClient._logger.error("Erreur lors de l'ajout de la mention :",e),e}}async addImage(e){const t=await this._validateImage(e),n={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsImage:t},o=await this.callIsConnected(()=>this.endpointApi.addImageNews(n));return this._draftData.mediaImg?(this._draftData.mediaImg.countImages=this._draftData.mediaImg.countImages+1,this._draftData.mediaImg.images.push(o.id)):this._draftData.mediaImg={countImages:1,images:[o.id]},o}async addFile(e){const t=await this._validateFile(e),n={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsFile:t},o=await this.callIsConnected(()=>this.endpointApi.addFileNews(n));return this._draftData.mediaFile?(this._draftData.mediaFile.countFiles=this._draftData.mediaFile.countFiles+1,this._draftData.mediaFile.files.push(o.id)):this._draftData.mediaFile={countFiles:1,files:[o.id]},o}async delete(){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une news.",400);const e={pathParams:{id:this.id},isLive:!1};await this.callIsConnected(()=>this.endpointApi.deleteNews(e)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async getComments(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e={pathParams:{type:"news",id:this.id}},t=await this.endpointApi.getComments(e);if(!Array.isArray(t))throw new ApiResponseError("Erreur lors de la récupération des commentaires.",500,t);const n=this._linkEntities(t);return this._createFilteredProxy(n)}async addVote(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"news",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected(()=>this.endpointApi.addVote(t))}async getVotes(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e={pathParams:{type:"news",id:this.id}};return this.endpointApi.showVote(e)}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const n={collection:"news",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected(()=>this.endpointApi.addReportAbuse(n))}async shareNews({childId:e,childType:t,comment:n}={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);if(!this.parent?.id)throw new ApiError("Le parent doit être défini pour partager une news",400);const o=e??this.userId,r=t??"citoyens",i=["citoyens","projects","organizations"];if(!i.includes(r))throw new ApiError(`Le type de cible "${r}" n'est pas valide. Types autorisés: ${i.join(", ")}`,400);if(this.parent.id===this.userId&&o===this.userId)throw new ApiError("Vous ne pouvez pas partager votre propre news à vous-même",400);const s={parentId:this.id,parentType:"news",connectType:"share",childType:r,childId:o,comment:n};return await this.callIsConnected(()=>this.endpointApi.shareNews(s))}isAuthor(e){const t=e?.silent??!0;try{if(!this.isMe)throw new ApiError("Vous devez être connecté pour vérifier l'auteur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401)}catch(e){if(t)return!1;throw e}const n=this.serverData.author;if(!n)return!1;let o;return"serverData"in n&&n.serverData&&"object"==typeof n.serverData&&"id"in n.serverData?o=n.serverData.id:"id"in n&&(o=n.id),Boolean(o&&this.userId===o)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}class Organization extends BaseEntity{static entityType="organizations";static entityTag="Organization";static SCHEMA_CONSTANTS=["ADD_ORGANIZATION","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE","VIRTUAL_OPENING_HOURS","VIRTUAL_ORG_TIERS_LIEU_FIELDS"];static VIRTUAL_SCHEMAS={VIRTUAL_OPENING_HOURS:{type:"object",properties:{openingHours:{type:"array",description:"Horaires d'ouverture (7 jours de la semaine)",minItems:7,maxItems:7,items:{oneOf:[{type:"string",const:""},{type:"object",properties:{dayOfWeek:{type:"string",enum:["Mo","Tu","We","Th","Fr","Sa","Su"],description:"Jour de la semaine"},hours:{type:"array",description:"Liste des créneaux horaires",items:{type:"object",properties:{opens:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure d'ouverture (HH:MM)"},closes:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure de fermeture (HH:MM)"}},required:["opens","closes"],additionalProperties:!1}}},required:["dayOfWeek","hours"],additionalProperties:!1}]}}}},VIRTUAL_ORG_TIERS_LIEU_FIELDS:{type:"object",properties:{holderOrganization:{type:"string"},manageModel:{type:"string"},typePlace:{type:"string"},buildingSurfaceArea:{type:"number"},siteSurfaceArea:{type:"number"},openingDate:{type:"string"},telephone:{type:"string"},video:{type:"array",items:{type:"string"}}}}};static CUSTOM_FIELD_HANDLERS=new Map([["openingHours",{updateMethod:"updateOpeningHours",schemaConstant:"VIRTUAL_OPENING_HOURS"}],["holderOrganization",{updateMethod:"updateHolderOrganization",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["manageModel",{updateMethod:"updateManageModel",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["typePlace",{updateMethod:"updateTypePlace",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["buildingSurfaceArea",{updateMethod:"updateBuildingSurfaceArea",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["siteSurfaceArea",{updateMethod:"updateSiteSurfaceArea",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["openingDate",{updateMethod:"updateOpeningDate",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["telephone",{updateMethod:"updateTelephone",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}],["video",{updateMethod:"updateVideo",schemaConstant:"VIRTUAL_ORG_TIERS_LIEU_FIELDS"}]]);static ADD_BLOCKS=new Map([["ADD_ORGANIZATION","addOrganization"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:H("github"),gitlab:H("gitlab"),facebook:H("facebook"),twitter:H("twitter"),instagram:H("instagram"),diaspora:H("diaspora"),mastodon:H("mastodon"),telegram:H("telegram"),signal:H("signal")};_transformServerData(e){const t=e.answers;if(t&&"object"==typeof t){const n={};for(const[e,o]of Object.entries(t)){const t=Array.isArray(o)?o:o&&"object"==typeof o?Object.values(o):[];n[e]=t.map(e=>e&&"object"==typeof e?this._linkEntity("answers",{...e,collection:"answers"}):e)}e.answers=n}return e}_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Organization.ADD_BLOCKS)){const o="ADD_ORGANIZATION"===t,r={...e,...this.defaultFields};o||delete r.id;const i=this._extractChangedFieldsFromSchema(this.apiClient,t,r,()=>{},o?[]:this.removeFields);if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(Organization.ADD_BLOCKS,n,i);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cette organisation",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;const n=Organization.CUSTOM_FIELD_HANDLERS;if(n){const o=new Set;for(const[r,i]of n)r in e&&this._hasFieldChanged(r)&&(await this._invokeCustomFieldHandler(i.updateMethod,e[r],r),o.add(r),t=!0);o.forEach(t=>delete e[t])}for(const[n,o]of Array.from(Organization.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Organization.UPDATE_BLOCKS,o,r),t=!0)}return t};async addOrganization(e){return this.callIsConnected(()=>this.endpointApi.addOrganization(e))}async delete(e="delete organization"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError("getOrganizations n'existe pas dans Organization",404)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getMembers(e={},t={}){if(!this.id)throw new ApiError("L'organisation n'est pas définie, impossible de récupérer les membres",400);const n=this.id,o=this._getDefaultFromEndpoint("GET_MEMBERS_ADMIN","searchType");"citoyens"===t.searchType?e.searchType=["citoyens"]:"organizations"===t.searchType?e.searchType=o.filter(e=>"citoyens"!==e):e.searchType=o;return this._createPaginatorEngine({initialData:e,methodName:"getMembers",restoredState:t?.restoredState,finalizer:async e=>{const{toBeValidated:o,isAdmin:r,isAdminPending:i,isInviting:s,roles:a=[]}=t;this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(n,{linkType:"memberOf",toBeValidated:o,isAdmin:r,isAdminPending:i,isInviting:s,roles:a})):(delete e?.pathParams,e.filters=this._buildLinkFilters(n,{linkType:"memberOf",toBeValidated:!1,isAdmin:r,isInviting:s,roles:a}));return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getMembersAdmin(e)):()=>this.endpointApi.getMembersNoAdmin(e))()}}).next()}async getMemberOf(e={},t={}){if(!this.id)throw new ApiError("L'organisation n'est pas définie, impossible de récupérer ses adhésions",400);const n=`links.members.${this.id}`,o={[n]:{$exists:!0},[`${n}.toBeValidated`]:{$exists:!1},[`${n}.isInviting`]:{$exists:!1}},r=e?.filters&&"object"==typeof e.filters?e.filters:{},i={indexMin:0,indexStep:20,notSourceKey:!0,...e,searchType:["organizations"],countType:["organizations"],count:!0,filters:{...r,...o}};return this.searchCostum(i,t)}async getGallery(e={}){return super.getGallery(e)}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans cette organisation",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un poi dans cette organisation",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un event dans cette organisation",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans cette organisation",403);return super.badge(e)}async news(e={}){return super.news(e)}async form(e={}){return super.form(e)}async updateOpeningHours(e){const t=await this.updateField("openingHours",e);return await this._refreshIfDirect(),t}async updateHolderOrganization(e){const t=await this.updateField("holderOrganization",e);return await this._refreshIfDirect(),t}async updateManageModel(e){const t=await this.updateField("manageModel",e);return await this._refreshIfDirect(),t}async updateTypePlace(e){const t=await this.updateField("typePlace",e);return await this._refreshIfDirect(),t}async updateBuildingSurfaceArea(e){if("number"!=typeof e||!Number.isFinite(e))throw new ApiError(`buildingSurfaceArea: attendu nombre fini. Reçu: ${JSON.stringify(e)}`,400);const t=await this.updateField("buildingSurfaceArea",e,{setType:"int"});return await this._refreshIfDirect(),t}async updateSiteSurfaceArea(e){if("number"!=typeof e||!Number.isFinite(e))throw new ApiError(`siteSurfaceArea: attendu nombre fini. Reçu: ${JSON.stringify(e)}`,400);const t=await this.updateField("siteSurfaceArea",e,{setType:"int"});return await this._refreshIfDirect(),t}async updateOpeningDate(e){const t=await this.updateField("openingDate",e);return await this._refreshIfDirect(),t}async updateTelephone(e){const t=await this.updateField("telephone",e);return await this._refreshIfDirect(),t}async updateVideo(e){if(!Array.isArray(e))throw new ApiError(`video: attendu tableau d'URLs. Reçu: ${JSON.stringify(e)}`,400);const t=await this.updateField("video",e);return await this._refreshIfDirect(),t}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}requestPromoteToAdmin(){return super.requestPromoteToAdmin()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}async getCostumJson(){return super.getCostumJson()}async searchCostum(e,t){return super.searchCostum(e,t)}async coformAnswersSearch(e){return super.coformAnswersSearch(e)}}const W=[...["equip_surf","equip_larg","equip_long"].map(e=>({name:e,schema:{type:"number"},setType:"float"})),...["equip_maj_date","inst_date_creation","inst_enqu_date"].map(e=>({name:e,schema:{type:"string"},setType:"isoDate"})),...["inst_acc_handi_bool","inst_trans_bool","equip_eclair","equip_acc_libre","inst_part_bool","equip_pmr_acc","equip_pmr_chem","equip_pmr_douche","equip_pmr_sanit","equip_pmr_trib","equip_pmr_vest","equip_pshs_aire","equip_pshs_chem","equip_pshs_sanit","equip_pshs_trib","equip_pshs_vest","equip_pshs_sign","equip_douche"].map(e=>({name:e,schema:{type:"boolean"},setType:"bool"})),...["categorie","equip_type_name","inst_nom","equip_type_famille","equip_nature","equip_sol","inst_acc_handi_type","inst_trans_type","equip_prop_nom","equip_prop_type","equip_gest_type"].map(e=>({name:e,schema:{type:"string"}})),...["aps_name","inst_part_type","equip_loc_type","equip_utilisateur"].map(e=>({name:e,schema:{type:"array",items:{type:"string"}}}))];class Poi extends BaseEntity{static entityType="poi";static entityTag="Poi";static SCHEMA_CONSTANTS=["ADD_POI","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE","VIRTUAL_POI_EQUIPMENT"];static ADD_BLOCKS=new Map([["ADD_POI","addPoi"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);static VIRTUAL_SCHEMAS={VIRTUAL_POI_EQUIPMENT:{type:"object",properties:Object.fromEntries(W.map(e=>[e.name,e.schema]))}};static CUSTOM_FIELD_HANDLERS=new Map(W.map(e=>[e.name,{updateMethod:"updateEquipmentField",schemaConstant:"VIRTUAL_POI_EQUIPMENT"}]));static EQUIPMENT_SETTYPE=new Map(W.map(e=>[e.name,e.setType]));defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:J};_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Poi.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(Poi.ADD_BLOCKS,n,o);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAuthor())throw new ApiError("Vous n'avez pas les droits pour modifier ce POI",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;const n=Poi.CUSTOM_FIELD_HANDLERS;if(n){const o=new Set;for(const[r,i]of n)r in e&&this._hasFieldChanged(r)&&(await this._invokeCustomFieldHandler(i.updateMethod,e[r],r),o.add(r),t=!0);o.forEach(t=>delete e[t])}for(const[n,o]of Array.from(Poi.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Poi.UPDATE_BLOCKS,o,r),t=!0)}return t};async updateEquipmentField(e,t){const n=Poi.EQUIPMENT_SETTYPE.get(t),o=null===e||""===e;return this.updateField(t,o?"":e,o||!n?{}:{setType:n})}async _invokeCustomFieldHandler(e,t,n){const o=this[e];if("function"!=typeof o)throw new ApiError(`Custom handler "${e}" not found for field "${n}"`,500);return await o.call(this,t,n)}async addPoi(e={}){return this.parent&&this.parent.id&&this.parent.id!==this.userId&&!e.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected(()=>this.endpointApi.addPoi(e))}async delete(e="delete poi"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Project extends BaseEntity{static entityType="projects";static entityTag="Project";static SCHEMA_CONSTANTS=["ADD_PROJECT","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_PROJECT","addProject"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:H("github"),gitlab:H("gitlab"),facebook:H("facebook"),twitter:H("twitter"),instagram:H("instagram"),diaspora:H("diaspora"),mastodon:H("mastodon"),telegram:H("telegram"),signal:H("signal"),parent:J};_transformServerData(e){const t=e.answers;if(t&&"object"==typeof t){const n={};for(const[e,o]of Object.entries(t)){const t=Array.isArray(o)?o:o&&"object"==typeof o?Object.values(o):[];n[e]=t.map(e=>e&&"object"==typeof e?this._linkEntity("answers",{...e,collection:"answers"}):e)}e.answers=n}return e}_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Project.ADD_BLOCKS)){const o=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(Project.ADD_BLOCKS,n,o);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier ce projet",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[n,o]of Array.from(Project.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Project.UPDATE_BLOCKS,o,r),t=!0)}return t};async addProject(e={}){return this.parent&&this.parent.id&&this.parent.id!==this.userId&&!e.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected(()=>this.endpointApi.addProject(e))}async delete(e="delete project"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getContributors(e={},t={}){const n=this._getDefaultFromEndpoint("GET_CONTRIBUTORS_ADMIN","searchType");"citoyens"===t.searchType?e.searchType=["citoyens"]:"organizations"===t.searchType?e.searchType=n.filter(e=>"citoyens"!==e):e.searchType=n;return this._createPaginatorEngine({initialData:e,methodName:"getContributors",restoredState:t?.restoredState,finalizer:async e=>{const{toBeValidated:n,isAdmin:o,isInviting:r,isAdminPending:i,roles:s=[]}=t;this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:n,isAdmin:o,isAdminPending:i,isInviting:r,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:!1,isAdmin:o,isInviting:r,roles:s}));return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getContributorsAdmin(e)):()=>this.endpointApi.getContributorsNoAdmin(e))()}}).next()}async getGallery(e={}){return super.getGallery(e)}async searchCostum(e,t){return super.searchCostum(e,t)}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans ce projet",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un POI dans ce projet",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un événement dans ce projet",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans ce projet",403);return super.badge(e)}async form(e={}){return super.form(e)}async news(e={}){if(!e?.id&&!this.isContributor())throw new ApiError("Vous n'avez pas les droits pour créer une news dans ce projet",403);return super.news(e)}hasMilestone(e){if("string"!=typeof e||0===e.length)return!1;const t=this.serverData.oceco?.milestones;return!!Array.isArray(t)&&t.some(t=>t?.milestoneId===e)}async action(e={}){if(!e?.id&&!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer une action dans ce projet",403);return await this.entity("actions",e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}requestPromoteToAdmin(){return super.requestPromoteToAdmin()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}function Z(e,t,n){return!!t&&!0===e?.notify?.id?.[t]?.[n]}class Notification{_data;_owner;_manager;_state;constructor(e,t,n=null){this._data=e,this._owner=t,this._manager=n;const o=t.userId;this._state=M({isUnread:Z(e,o,"isUnread"),isUnseen:Z(e,o,"isUnseen")})}static fromData(e,t,n=null){return new Notification(e,t,n)}_attach(e){return this._manager=e,this}get id(){return this._data.id}get isUnread(){return this._state.isUnread}get isUnseen(){return this._state.isUnseen}get data(){return this._data}get author(){return this._data.author}get createdAt(){const e=this._data.created;return e instanceof Date?e:new Date(e)}_setReadLocal(){this._state.isUnread=!1}_setSeenLocal(){this._state.isUnseen=!1}_restoreLocal(e,t){this._state.isUnread=e,this._state.isUnseen=t}async markRead(){if(!this._state.isUnread)return;const e=this._state.isUnread,t=this._state.isUnseen;this._setReadLocal(),this._manager?._recount();try{await this._owner.markNotificationAsRead(this.id)}catch(n){throw this._restoreLocal(e,t),this._manager?._recount(),n}}markSeen(){this._setSeenLocal(),this._manager?._recount()}toJSON(){return this._data}}class Notifications{_owner;_pageSize;_items=[];_state;constructor(e,t=15){this._owner=e,this._pageSize=t,this._state=M({loadedUnreadCount:0,unseenTotal:0,cursor:0,hasMore:!0,version:0})}get items(){return this._state.version,this._items}get loadedUnreadCount(){return this._state.loadedUnreadCount}get unseenTotal(){return this._state.unseenTotal}get hasMore(){return this._state.hasMore}_recount(){this._state.loadedUnreadCount=this._items.filter(e=>e.isUnread).length}_wrap(e){return e.map(e=>Notification.fromData(e,this._owner,this))}_commit(e){this._items=e,this._state.version++,this._recount()}async list({indexMin:e=0}={}){const t=this._wrap(await this._owner.fetchNotifications({indexMin:e}));return this._commit(t),this._state.cursor=t.length,this._state.hasMore=t.length>=this._pageSize,t}async loadMore(){if(!this._state.hasMore)return[];const e=this._wrap(await this._owner.fetchNotifications({indexMin:this._state.cursor}));return this._commit([...this._items,...e]),this._state.cursor+=e.length,this._state.hasMore=e.length>=this._pageSize,e}async refresh(){return this._state.cursor=0,this._state.hasMore=!0,this.list()}async count(){return this._state.unseenTotal=await this._owner.fetchNotificationsCount(),this._state.unseenTotal}toItems(e){return this._wrap(e)}async markAllRead(){await this._bulk("read")}async markAllSeen(){await this._bulk("seen")}async _bulk(e){const t=this._items.map(e=>({n:e,u:e.isUnread,s:e.isUnseen}));k(()=>{for(const{n:n}of t)"read"===e?n._setReadLocal():n._setSeenLocal()}),"seen"===e&&(this._state.unseenTotal=0),this._recount();try{await this._owner.markAllNotifications(e)}catch(e){throw k(()=>{for(const{n:e,u:n,s:o}of t)e._restoreLocal(n,o)}),this._recount(),e}}async clear(){await this._owner.removeAllNotifications(),this._commit([]),this._state.cursor=0,this._state.hasMore=!1,this._state.unseenTotal=0}toJSON(){return this._items.map(e=>e.toJSON())}restore(e){return this._commit(this._wrap(e)),this._state.cursor=e.length,this}static restore(e,t){return new Notifications(t).restore(e)}}class User extends BaseEntity{static entityType="citoyens";static entityTag="User";static SCHEMA_CONSTANTS=["UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:H("github"),gitlab:H("gitlab"),facebook:H("facebook"),twitter:H("twitter"),instagram:H("instagram"),diaspora:H("diaspora"),mastodon:H("mastodon"),telegram:H("telegram"),signal:H("signal")};constructor(e,t,n){if(!n.EndpointApi)throw new ApiError("EndpointApi class must be injected to avoid circular dependency.",500);if(!t?.id&&!t?.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);if(!n.Organization)throw new ApiError("Organization class must be injected.",500);if(!n.Project)throw new ApiError("Project class must be injected.",500);if(!n.Event)throw new ApiError("Event class must be injected.",500);if(!n.Poi)throw new ApiError("Poi class must be injected.",500);if(!n.Badge)throw new ApiError("Badge class must be injected.",500);if(!n.News)throw new ApiError("News class must be injected.",500);if(!n.Answer)throw new ApiError("Answer class must be injected.",500);super(e,t,n)}get slug(){return this._draftData.slug||null}get isMe(){return this.isConnected&&this.userId===this.id}get parentIsMe(){return super.isMe}get isActingUser(){return this.parentIsMe&&!this.isMe}getEntityType(){return"citoyens"}async get(){return this._checkNotDeleted(),this.apiClient.safeCall(async()=>{if(this.isMe){const e=await this.endpointApi.meInfoUrl();return this._setData(e,{forceInitialDraftReset:!0}),e}{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}})}async changePassword(e){return this.callIsMe(()=>this.endpointApi.changePassword(e))}async delete(e){const t=await this.callIsMe(()=>this.endpointApi.deleteAccount(e));return Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0,t}async save(){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.",401);return await super.save()}_add=async()=>{throw new ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.",403)};_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[n,o]of Array.from(User.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(User.UPDATE_BLOCKS,o,r),t=!0)}return t};static fromServerData(e,t,n){const o=new this(t,e,n);return e&&"object"==typeof e&&Object.keys(e).length>0&&"function"==typeof o._setData&&o._setData(e,{forceInitialDraftReset:!0}),o}async updateSettings(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.",401);const t=await super.updateSettings(e);return await this.refresh(),t}async updateDescription(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.",401);return super.updateDescription(e)}async updateInfo(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.",401);return super.updateInfo(e)}async updateSocial(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.",401);return super.updateSocial(e)}async updateLocality(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.",401);return super.updateLocality(e)}async updateSlug(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.",401);return super.updateSlug(e)}async updateImageProfil(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.",401);return super.updateImageProfil(e)}async updateImageBanner(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de bannière.",401);return super.updateImageBanner(e)}async getOrganizations(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getOrganizations",restoredState:t?.restoredState,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe(()=>this.endpointApi.getOrganizationsAdmin(e)):()=>this.endpointApi.getOrganizationsNoAdmin(e);return this.isMe||e.filters||(e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),t()}}).next()}async getEligiblePlaces(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_USER_ELIGIBLE_PLACES","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getEligiblePlaces",restoredState:t?.restoredState,finalizer:async e=>{delete e?.pathParams;const t=e.filters??{},n={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}};return e.filters={...n,...t},this.callIsMe(()=>this.endpointApi.getUserEligiblePlaces(e))}}).next()}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getNews(e={}){return super.getNews(e)}async getFriends(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_FRIENDS_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getFriends",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,!this.isMe&&this.id&&(e.pathParams={id:this.id}),this.endpointApi.getFriendsAdmin(e))}).next()}async getSubscriptions(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIPTIONS","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getSubscriptions",restoredState:t?.restoredState,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe(()=>this.endpointApi.getSubscriptionsAdmin(e)):()=>this.endpointApi.getSubscriptions(e);return this.isMe||e.filters||(e.filters={[`links.followers.${this.id}`]:{$exists:!0}}),t()}}).next()}async getSubscribers(e={}){return super.getSubscribers(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getBadges(e={}){return await this.linkEntitiesFromServerData("badges",e)}async getGallery(e={}){return super.getGallery(e)}async user(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur",401);if(!e.id&&!e.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);const t=this.deps,n=new User(this,e,t);return await n.get(),n}async organization(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",401);return super.organization(e)}async project(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.",401);return super.project(e)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){if(!("id"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.",401);return super.news(e)}async poi(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.",401);return super.poi(e)}async event(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.",401);return super.event(e)}async badge(e={}){if(!("id"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.",401);return super.badge(e)}async sendFriendRequest(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour envoyer une demande d'amis.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},n=await this.endpointApi.connect(t);return await(this.userContext?.refresh()),n}if(t.isInviting&&t.invitorId===this.id)return this.acceptFriendRequest();if(t.isInviting&&t.invitorId===this.userId)throw new ApiError("Vous avez déjà envoyé une demande d'amis à cet utilisateur.",403);throw new ApiError("Vous êtes déjà connecté à cette entité.",409)}async acceptFriendRequest(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour accepter une demande d'amitié.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e=this._getLinkFromConnectedUser();if(e?.isInviting&&e.invitorId===this.id){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.endpointApi.linkValidate(e);return await(this.userContext?.refresh()),t}throw new ApiError("Vous n'avez pas d'invitation à valider.",404)}async removeFriend(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour supprimer un ami.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.",404);const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},n=await this.endpointApi.disconnect(t);return await(this.userContext?.refresh()),n}async requestToJoin(){throw new ApiError("l'utilisation de requestToJoin n'est pas autorisée sur un utilisateur.",403)}async requestToJoinAdmin(){throw new ApiError("l'utilisation de requestToJoinAdmin n'est pas autorisée sur un utilisateur.",403)}async acceptInvitation(){throw new ApiError("l'utilisation de acceptInvitation n'est pas autorisée sur un utilisateur.",403)}async leave(){throw new ApiError("l'utilisation de leave n'est pas autorisée sur un utilisateur.",403)}async follow(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour suivre un utilisateur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!(this.userContext?.serverData?.links?.follows?.[this.id]||null)){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id},t=await this.endpointApi.follow(e);return await(this.userContext?.refresh()),t}throw new ApiError("Vous êtes déjà abonné à cet utilisateur.",409)}async unfollow(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour vous désabonner d'un utilisateur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(this.userContext?.serverData?.links?.follows?.[this.id]||null){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.endpointApi.disconnect(e);return await(this.userContext?.refresh()),t}throw new ApiError("Vous n'êtes pas abonné à cet utilisateur.",404)}isFriend(e){const t=e?.silent??!0;try{if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous êtes ami.",401)}catch(e){if(t)return!1;throw e}this._assertEntityType("citoyens");const n=this._getLinkFromConnectedUser();return!!n&&this._validateUserLink(n)}isFollower(e){const t=e?.silent??!0;try{if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si il vous suit.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404)}catch(e){if(t)return!1;throw e}return this._assertEntityType("citoyens"),this._isLinked("followers")}isFollowing(e){const t=e?.silent??!0;try{if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous le suivez.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404)}catch(e){if(t)return!1;throw e}return this._assertEntityType("citoyens"),this._isLinked("follows")}async entityBySlug(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer cet entité.",401);return super.entityBySlug(e)}_validateBasePreconditions(e,t){if(!this.userId)throw new ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.parent?.id)throw new ApiError("L'entité parente n'est pas enregistrée.",404);if(!t.includes(this.parent.getEntityType()))throw new ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.parent.getEntityType()}`,400)}_validateMemberPreconditions(e,t){if(this._validateBasePreconditions(e,t),!this.parent?.id)throw new ApiError("L'entité parente n'est pas enregistrée.",404);const n=this.parent.getEntityType();if("events"===n)return;let o=!1;switch(n){case"organizations":o=this.parent.isMember();break;case"projects":o=this.parent.isContributor();break;default:o=!1}if(!o){throw new ApiError(`Vous devez être ${{organizations:"membre",projects:"contributeur"}[n]||"membre"} pour effectuer cette action.`,401)}}_validateAdminPreconditions(e,t){if(this._validateMemberPreconditions(e,t),!this.parent?.isAdmin())throw new ApiError("Vous devez être administrateur pour effectuer cette action.",401)}_getParentLinkForUser(){const{connectTypeDisconnect:e}=this.parent._getLinkMeta(),t=this.id;return t&&this.parent?.serverData?.links?.[e]?.[t]||null}_getValidatedParentLink(e,t,n){const o=n?.silent??!0;try{this._validateBasePreconditions(e,t)}catch(e){if(o)return null;throw e}return this._getParentLinkForUser()}async _refreshWithParent(){await this.refresh(),this.parent&&await this.parent.refresh()}isAdmin(e){const t=this._getValidatedParentLink("isAdmin",["organizations","projects"],{silent:e?.silent});return this._validateUserLink(t)&&!0===t?.isAdmin}isMember(e){const t=this._getValidatedParentLink("isMember",["organizations"],{silent:e?.silent});return this._validateUserLink(t)}isContributor(e){const t=this._getValidatedParentLink("isContributor",["projects"],{silent:e?.silent});return this._validateUserLink(t)}isAttendee(e){const t=this._getValidatedParentLink("isAttendee",["events"],{silent:e?.silent});return this._validateUserLink(t)}isInviting(e){const t=this._getValidatedParentLink("isInviting",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.isInviting}isInvitingFriend(e){const t=this._getValidatedUserLink("isInvitingFriend",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.isInviting}isInvitingAdmin(e){const t=this._getValidatedParentLink("isInvitingAdmin",["organizations","projects"],{silent:e?.silent});return!!t&&((!0===t.isAdminInviting||!0===t.isInviting)&&!0===t.isAdmin)}isAdminPending(e){const t=this._getValidatedParentLink("isAdminPending",["organizations","projects"],{silent:e?.silent});return!!t&&(!0===t.isAdmin&&!0===t.isAdminPending)}isToBeValidated(e){const t=this._getValidatedParentLink("isToBeValidated",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.toBeValidated}isToBeValidatedFriend(e){const t=this._getValidatedUserLink("isToBeValidatedFriend",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.toBeValidated}async sendRequestToJoinParent({admin:e}={admin:!1}){e?this._validateAdminPreconditions("sendRequestToJoinParent",["organizations","projects"]):this._validateMemberPreconditions("sendRequestToJoinParent",["organizations","projects","events"]);const{connectTypeConnect:t}=this.parent._getLinkMeta(),n=this._getParentLinkForUser();if(!n){const n=this.parent.getEntityType(),o={childId:this.id,childType:"citoyens",parentType:n,parentId:this.parent.id,connectType:e?"admin":t},r=await this.callIsConnected(()=>this.endpointApi.connect(o));return await this._refreshWithParent(),r}if(n.isInviting||n?.isAdminInviting)throw new ApiError("Une invitation est déjà en attente d'acceptation.",400);throw new ApiError("Vous êtes déjà connecté à cette entité.",400)}async validateMemberRequest(){this._validateAdminPreconditions("validateMemberRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.toBeValidated)throw new ApiError("Cet utilisateur n'a pas de demande en attente de validation.",400);const t=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"toBeValidated"},o=await this.callIsConnected(()=>this.endpointApi.linkValidate(n));return await this._refreshWithParent(),o}async validateAdminRequest(){this._validateAdminPreconditions("validateAdminRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdminPending)throw new ApiError("Cet utilisateur n'a pas de demande d'admin en attente.",400);const t=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"isAdminPending"},o=await this.callIsConnected(()=>this.endpointApi.linkValidate(n));return await this._refreshWithParent(),o}async removeFromParent(){this._validateAdminPreconditions("removeFromParent",["organizations","projects"]);if(!this._getParentLinkForUser())throw new ApiError("Cet utilisateur n'est pas connecté à cette entité.",400);const e=this.parent.getEntityType(),{connectTypeDisconnect:t}=this.parent._getLinkMeta(),n={childId:this.id,childType:"citoyens",parentType:e,parentId:this.parent.id,connectType:t},o=await this.callIsConnected(()=>this.endpointApi.disconnect(n));return await this._refreshWithParent(),o}async promoteToAdmin(){this._validateAdminPreconditions("promoteToAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e)throw new ApiError("Cet utilisateur n'est pas membre de cette entité.",400);if(e?.isAdmin&&(e?.isInviting||e?.isAdminInviting))throw new ApiError("Cet utilisateur est déjà en cours d'invitation en tant qu'admin.",400);if(e?.isAdmin&&!e?.isInviting&&!e?.isAdminInviting)throw new ApiError("Cet utilisateur est déjà admin.",400);const t=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,connectType:"admin"},o=await this.callIsConnected(()=>this.endpointApi.connect(n));return await this._refreshWithParent(),o}async demoteFromAdmin(){this._validateAdminPreconditions("demoteFromAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdmin||e.isAdminPending)throw new ApiError("Cet utilisateur n'est pas admin de cette entité.",400);const t=this.parent.getEntityType(),{connectTypeDisconnect:n}=this.parent._getLinkMeta(),o=t,r={childId:this.id,childType:"citoyens",parentType:o,parentId:this.parent.id,connect:n,isAdmin:!1},i=await this.callIsConnected(()=>this.endpointApi.demoteAdmin(r));return await this._refreshWithParent(),i}_notifications;get notifications(){return this._notifications??=new Notifications(this)}async fetchNotifications({indexMin:e}={}){const t=await this.callIsMe(()=>{const t={pathParams:{type:"citoyens",id:this.userId},...null!=e?{indexMin:e}:{}};return this.endpointApi.getNotifications(t)});return Array.isArray(t?.notif)?t.notif:[]}async fetchNotificationsCount(){const e=await this.callIsMe(()=>{const e={pathParams:{type:"citoyens",id:this.userId},refreshTimestamp:Math.floor(Date.now()/1e3)};return this.endpointApi.getNotificationsCount(e)});return"number"==typeof e?.countNotif?e.countNotif:0}async markNotificationAsRead(e){const t={id:e};return this.callIsMe(()=>this.endpointApi.markNotificationAsRead(t))}async markAllNotifications(e){const t={action:e,all:!0};return this.callIsMe(()=>this.endpointApi.notificationUpdate(t))}async removeAllNotifications(){return this.callIsMe(()=>this.endpointApi.removeAllNotifications())}}Object.assign(User.prototype,{});class ObjectID{_str;constructor(e){if(this._str=void 0,e){if(e=e.toLowerCase(),24!==(t=e).length||!/^[0-9a-f]*$/.test(t))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=e}var t}equals(e){return e instanceof ObjectID&&this.valueOf()===e.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str?.substr(0,8)??"",16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}}const Q=ObjectID,Y={common1:{type:"string"},common2:{format:"email",type:"string"},common3:{type:"boolean"},common4:{format:"uri",type:"string"},common5:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common6:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},required:["id"],type:"object"},common8:{additionalProperties:!1,properties:{reason:{default:"",type:"string"}},required:["reason"],type:"object"},common10:{default:"",type:"string"},common11:{pattern:"^[a-f0-9]{24}$",type:"string"},common12:{const:"citoyens"},common13:{properties:{value:{type:"boolean"}}},common15:{enum:["isOpenData","isOpenEdition","private","feedback"]},common16:{const:"organizations"},common17:{const:"projects"},common18:{const:"events"},common19:{default:"citoyens",enum:["citoyens","projects","organizations","events"],type:"string"},common20:{},common21:{else:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},if:{properties:{typeElement:{const:"citoyens"}}},then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}}},common24:{properties:{typeElement:{const:"citoyens"}}},common27:{not:{type:"null"}},common29:{default:"citoyens",enum:["citoyens","projects","organizations","poi","events"],type:"string"},common30:{anyOf:[{format:"email",type:"string"},{const:"",type:"string"}]},common31:{const:"",type:"string"},common32:{anyOf:[{items:{type:"string"},type:"array"},{enum:[""],type:"string"}]},common33:{items:{type:"string"},type:"array"},common34:{enum:[""],type:"string"},common35:{anyOf:[{format:"uri",type:"string"},{const:"",type:"string"}]},common36:{properties:{name:{not:{type:"null"}}},required:["name"]},common38:{properties:{url:{not:{type:"null"}}},required:["url"]},common40:{properties:{tags:{not:{type:"null"}}},required:["tags"]},common42:{properties:{email:{not:{type:"null"}}},required:["email"]},common44:{format:"date",type:"string"},common45:{const:"info",default:"info",type:"string"},common46:{anyOf:[{type:"string"},{const:"",type:"string"}]},common47:{$ref:"#/$defs/sharedFields/name"},common48:{$ref:"#/$defs/sharedFields/tags"},common49:{default:"citoyens",enum:["citoyens"],type:"string"},common50:{$ref:"#/$defs/sharedFields/url"},common51:{properties:{avancement:{not:{type:"null"}}},required:["avancement"]},common53:{properties:{parent:{not:{type:"null"}}},required:["parent"]},common55:{$ref:"#/$defs/sharedFields/emailNullable"},common56:{additionalProperties:!1,patternProperties:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},type:"object"},common58:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"},common60:{properties:{type:{not:{type:"null"}}},required:["type"]},common62:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common65:{enum:["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],type:"string"},common66:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common67:{enum:["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],type:"string"},common68:{enum:["poi"],type:"string"},common69:{$ref:"#/$defs/socialField"},common70:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},common71:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},common74:{oneOf:[{const:"",type:"string"},{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"}]},common75:{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},common77:{const:"PostalAddress",type:"string"},common78:{minLength:0,type:"string"},common79:{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"},common83:{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates","float"],type:"object"},common86:{type:"number"},common87:{const:!0,default:!0,type:"boolean"},common89:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common92:{maxLength:100,minLength:3,pattern:"^[a-zA-Z0-9]+$",type:"string"},common93:{properties:{type:{const:"citoyens"}}},common95:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common101:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},common104:{properties:{parentId:{pattern:"^[a-f0-9]{24}$"}}},common106:{properties:{parentType:{const:"citoyens"}}},common108:{properties:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common110:{default:!0,type:"boolean"},common111:{default:0,type:"integer"},common112:{items:{pattern:"^[a-f0-9]{24}$",type:"string"},type:"array"},common113:{required:["text"]},common114:{required:["mediaImg"]},common115:{required:["mediaFile"]},common116:{additionalProperties:!1,properties:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},required:["countFiles","files"],type:"object"},common118:{additionalProperties:!1,properties:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},required:["countImages","images"],type:"object"},common120:{items:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common124:{default:"public",enum:["public","private","restricted"],type:"string"},common125:{const:"news",default:"news",type:"string"},common126:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common128:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},required:["id"],type:"object"},common129:{default:!1,type:"boolean"},common130:{properties:{childId:{pattern:"^[a-f0-9]{24}$"}}},common132:{properties:{childType:{const:"citoyens"}}},common134:{const:"share",default:"share",type:"string"},common135:{properties:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common137:{default:"news",enum:["news"],type:"string"},common138:{items:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common141:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi","answers","forms"],type:"string"},common142:{const:!1,default:!1,type:"boolean"},common143:{const:"",default:"",type:"string"},common144:{default:0,type:"number"},common145:{default:30,type:"number"},common146:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},common151:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},common153:{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"},common155:{anyOf:[{type:"string"},{items:{type:"string"},minItems:1,type:"array"}]},common157:{minimum:0,type:"integer"},common158:{default:0,minimum:0,type:"integer"},common159:{const:["projects"],default:["projects"],items:{enum:["projects"],type:"string"},type:"array"},common161:{$exists:!0},common162:{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},common165:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common167:{const:["poi"],default:["poi"],items:{enum:["poi"],type:"string"},type:"array"},common168:{const:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},type:"array"},common170:{$exists:!1},common171:{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},common173:{const:!1},common174:{default:30,type:"integer"},common175:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common178:{"links.members.@{pathParams.id}":{$exists:!0},"links.members.@{pathParams.id}.isInviting":{$exists:!1},"links.members.@{pathParams.id}.toBeValidated":{$exists:!1}},common179:{default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{type:"string"},type:"array"},common180:{default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common182:{additionalProperties:!1,properties:{$exists:{default:!1,type:"boolean"}},required:["$exists"],type:"object"},common184:{additionalProperties:!1,properties:{$in:{items:{type:"string"},minItems:1,type:"array"}},required:["$in"],type:"object"},common186:{default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},minItems:1,type:"array"},common187:{const:["citoyens"],default:["citoyens"],items:{enum:["citoyens"],type:"string"},type:"array"},common188:{enum:["citoyens"],type:"string"},common189:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},type:"array"},common191:{not:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common194:{"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"}},common195:{not:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common198:{default:"citoyens",enum:["citoyens","organizations","projects"],type:"string"},common199:{const:["badges"],default:["badges"],items:{enum:["badges"],type:"string"},type:"array"},common201:{const:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common203:{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"},common205:{const:!0,type:"boolean"},common206:{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},common209:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"}},common210:{indexMax:30,indexMin:0},common211:{properties:{parentType:{const:"organizations"}}},common213:{properties:{parentType:{const:"projects"}}},common215:{properties:{parentType:{const:"events"}}},common217:{default:"@userId",pattern:"^([a-f0-9]{24}|@\\w+)$",type:"string"},common218:{const:"citoyens",default:"citoyens",enum:["citoyens"],type:"string"},common219:{enum:["citoyens","organizations","projects","events"],type:"string"},common220:{const:"citoyens",default:"citoyens",type:"string"},common221:{const:"@userId",default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common222:{minLength:3,type:"string"},common223:{enum:["Mo","Tu","We","Th","Fr","Sa","Su"],type:"string"},common224:{additionalProperties:!1,properties:{closes:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"},opens:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"}},required:["opens","closes"],type:"object"},common227:{default:{isOpenData:!0,isOpenEdition:!0},properties:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},required:["isOpenData","isOpenEdition"],type:"object"},common230:{const:"projects",default:"projects",type:"string"},common231:{additionalProperties:!1,default:{"@userId":{type:"citoyens"}},patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common234:{const:"poi",default:"poi",type:"string"},common235:{const:"events",default:"events",type:"string"},common236:{format:"date-time",type:"string"},common237:{type:"integer"},common238:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},required:["type","id"],type:"object"},common241:{const:"badges",default:"badges",type:"string"},common242:{const:"badge",default:"badge",type:"string"},common243:{patternProperties:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},type:"object"},common247:{default:"",enum:["","admin"],type:"string"},common248:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumId:{pattern:"^[a-f0-9]{24}$",type:"string"},costumSlug:{type:"string"},costumType:{enum:["projects","organizations"],type:"string"},count:{const:!0,default:!0,type:"boolean"},countType:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi","answers","forms","classifieds"],type:"string"},type:"array"},fediverse:{default:!1,type:"boolean"},fields:{items:{type:"string"},type:"array"},filters:{default:"",oneOf:[{additionalProperties:!0,type:"object"},{const:"",type:"string"}]},indexMax:{type:"number"},indexMin:{default:0,type:"number"},indexStep:{default:30,type:"number"},initType:{const:"",default:"",type:"string"},locality:{oneOf:[{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{countryCode:{type:"string"},id:{type:"string"},level:{type:["string","number"]},name:{type:"string"},postalCode:{type:"string"},type:{enum:["cities","cp","country","level1","level2","level3","level4","level5"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},{items:{additionalProperties:!1,properties:{countryCode:{type:"string"},id:{type:"string"},level:{type:["string","number"]},name:{type:"string"},postalCode:{type:"string"},type:{enum:["cities","cp","country","level1","level2","level3","level4","level5"],type:"string"}},required:["id","type"],type:"object"},type:"array"},{const:"",type:"string"}]},mapUsed:{const:!0,type:"boolean"},mode:{type:"string"},name:{type:"string"},notSourceKey:{const:!0,type:"boolean"},options:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},type:"object"},ranges:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},searchBy:{anyOf:[{type:"string"},{items:{type:"string"},minItems:1,type:"array"}]},searchTags:{items:{type:"string"},type:"array"},searchType:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi","answers","forms","classifieds"],type:"string"},type:"array"},sortBy:{additionalProperties:{enum:[1,-1],type:"integer"},type:"object"},sourceKey:{items:{type:"string"},type:"array"}},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse","costumSlug","costumEditMode"],type:"object"},common250:{enum:["projects","organizations"],type:"string"},common253:{default:"",oneOf:[{additionalProperties:!0,type:"object"},{const:"",type:"string"}]},common254:{additionalProperties:!0,type:"object"},common262:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},type:"object"},common266:{additionalProperties:{enum:[1,-1],type:"integer"},type:"object"},common268:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},required:["id","type"],type:"object"},common271:{items:{properties:{id:{type:"string"}},required:["id"],type:"object"},type:"array"},common274:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumId:{pattern:"^[a-f0-9]{24}$",type:"string"},costumSlug:{type:"string"},costumType:{enum:["projects","organizations"],type:"string"},mode:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},type:"object"},common276:{items:{enum:["answers"],type:"string"},type:"array"},common278:{enum:["comments","news"],type:"string"},common279:{minLength:1,type:"string"},common280:{default:"citoyens",enum:["citoyens","organizations","projects","events","poi"],type:"string"},common281:{type:"array"},common282:{additionalProperties:!0,properties:{costumId:{type:"string"},costumSlug:{type:"string"},costumType:{type:"string"},username:{type:"string"}},required:["username","costumSlug","costumId","costumType"],type:"object"},common284:{additionalProperties:!0,properties:{costumId:{type:"string"},costumSlug:{type:"string"},costumType:{type:"string"}},required:["costumSlug","costumId","costumType"],type:"object"}},X={endpoints:[{auth:"none",constant:"PERSON_REGISTER",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/register",request:{additionalProperties:!1,properties:{app:Y.common1,email:Y.common2,isInvitation:Y.common3,mode:Y.common1,name:Y.common1,pendingUserId:Y.common1,pwd:Y.common1,username:Y.common1},required:["name","username","email","pwd"],type:"object"}},{auth:"none",constant:"AUTHENTICATE_URL",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/api/cocolight/authenticate",postActions:[{path:"accessToken",type:"setToken"},{path:"refreshToken",type:"setRefreshToken"},{event:"userLoggedIn",path:"user",type:"emitEvent"}],request:{additionalProperties:!1,properties:{email:Y.common2,password:Y.common1},required:["email","password"],type:"object"}},{auth:"none",constant:"REFRESH_TOKEN_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/refreshtoken",request:{additionalProperties:!1,properties:{refreshToken:Y.common1},required:["refreshToken"],type:"object"}},{auth:"bearer",constant:"ME_INFO_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/me"},{auth:"none",constant:"PASSWORD_RECOVERY",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/sendemail",request:{additionalProperties:!1,properties:{email:Y.common2,type:{const:"password",default:"password",type:"string"}},required:["email","type"],type:"object"}},{auth:"bearer",constant:"SERVER_EXCHANGE_TOKEN",contentType:"application/json",method:"POST",path:"/api/cocolight/exchangetoken",request:{additionalProperties:!1,properties:{serverUrl:Y.common4},required:["serverUrl"],type:"object"}},{auth:"bearer",constant:"CHANGE_PASSWORD",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/person/changepassword",request:{additionalProperties:!1,properties:{mode:{const:"changePassword",default:"changePassword",type:"string"},newPassword:Y.common1,newPassword2:Y.common1,oldPassword:Y.common1,scope:{default:"",type:["string"]},userId:Y.common5},required:["mode","userId","oldPassword","newPassword","newPassword2"],type:"object"}},{auth:"bearer",constant:"DELETE_ACCOUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/id/{id}/type/citoyens",pathParams:Y.common6,postActions:[{type:"resetSession"},{event:"accountDeleted",path:null,type:"emitEvent"}],request:Y.common8},{auth:"bearer",constant:"UPDATE_SETTINGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatesettings",request:{additionalProperties:!1,allOf:[{else:{properties:{idEntity:Y.common11}},if:{properties:{typeEntity:Y.common12}},then:{properties:{idEntity:Y.common5}}},{if:{properties:{type:{enum:["birthDate","email","locality","phone","directory"]},typeEntity:Y.common12}},then:{properties:{value:{enum:["private","public","mask"],type:"string"}}}},{if:{properties:{type:{enum:["activitypub","isOpenData"]},typeEntity:Y.common12}},then:Y.common13},{if:{properties:{type:Y.common15,typeEntity:Y.common16}},then:Y.common13},{if:{properties:{type:Y.common15,typeEntity:Y.common17}},then:Y.common13},{if:{properties:{type:{enum:["isOpenData","isOpenEdition","public"]},typeEntity:Y.common18}},then:Y.common13}],properties:{idEntity:Y.common1,type:Y.common1,typeEntity:Y.common19,value:Y.common20},required:["type","value","typeEntity","idEntity"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_DESCRIPTION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{additionalProperties:!1,allOf:[Y.common21,{anyOf:[{properties:{description:Y.common27},required:["description"]},{properties:{shortDescription:Y.common27},required:["shortDescription"]}]}],properties:{block:{const:"descriptions",default:"descriptions",type:"string"},descMentions:Y.common10,description:Y.common1,id:Y.common1,scope:{default:"",type:["string","null"]},shortDescription:Y.common1,typeElement:Y.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_INFO",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{sharedFields:{email:Y.common2,emailNullable:Y.common30,name:Y.common1,tags:Y.common32,url:Y.common35}},allOf:[{if:Y.common24,then:{additionalProperties:!1,anyOf:[Y.common36,{properties:{birthDate:Y.common27},required:["birthDate"]},{properties:{fixe:Y.common27},required:["fixe"]},{properties:{mobile:Y.common27},required:["mobile"]},Y.common38,Y.common40,Y.common42],properties:{birthDate:{anyOf:[Y.common44,Y.common31]},block:Y.common45,email:{$ref:"#/$defs/sharedFields/email"},fixe:Y.common46,id:Y.common5,mobile:Y.common46,name:Y.common47,scope:Y.common10,tags:Y.common48,typeElement:Y.common49,url:Y.common50}}},{if:{properties:{typeElement:Y.common17}},then:{additionalProperties:!1,anyOf:[Y.common36,Y.common38,Y.common40,Y.common42,Y.common51,Y.common53],properties:{avancement:{enum:["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],type:"string"},block:Y.common45,email:Y.common55,id:Y.common1,name:Y.common47,parent:Y.common56,scope:Y.common10,tags:Y.common48,typeElement:{default:"citoyens",enum:["projects"],type:"string"},url:Y.common50}}},{if:{properties:{typeElement:Y.common18}},then:{additionalProperties:!1,anyOf:[Y.common36,Y.common38,Y.common40,Y.common42,Y.common51,Y.common60,{properties:{organizer:Y.common27},required:["organizer"]},Y.common53],properties:{block:Y.common45,email:Y.common55,id:Y.common1,name:Y.common47,organizer:Y.common62,parent:Y.common56,scope:Y.common10,tags:Y.common48,type:Y.common65,typeElement:{default:"citoyens",enum:["events"],type:"string"},url:Y.common50}}},{if:{properties:{typeElement:Y.common16}},then:{additionalProperties:!1,anyOf:[Y.common36,Y.common38,Y.common40,Y.common42,Y.common60],properties:{block:Y.common45,email:Y.common55,id:Y.common1,name:Y.common47,scope:Y.common10,tags:Y.common48,type:Y.common66,typeElement:{enum:["organizations"],type:"string"},url:Y.common50}}},{if:{properties:{typeElement:{const:"poi"}}},then:{additionalProperties:!1,anyOf:[Y.common36,Y.common40,Y.common60,{properties:{urls:Y.common27},required:["urls"]}],properties:{block:Y.common45,id:Y.common1,name:Y.common47,scope:Y.common10,tags:Y.common48,type:Y.common67,typeElement:Y.common68,urls:Y.common32}}}],properties:{block:Y.common45,id:Y.common1,scope:Y.common10,typeElement:Y.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SOCIAL",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{socialField:{anyOf:[Y.common34,Y.common4]}},allOf:[Y.common21,{anyOf:[{properties:{gitlab:Y.common27},required:["gitlab"]},{properties:{github:Y.common27},required:["github"]},{properties:{twitter:Y.common27},required:["twitter"]},{properties:{facebook:Y.common27},required:["facebook"]},{properties:{instagram:Y.common27},required:["instagram"]},{properties:{diaspora:Y.common27},required:["diaspora"]},{properties:{mastodon:Y.common27},required:["mastodon"]},{properties:{telegram:Y.common27},required:["telegram"]},{properties:{signal:Y.common27},required:["signal"]}]}],properties:{block:{const:"network",default:"network",type:"string"},diaspora:Y.common69,facebook:Y.common69,github:Y.common69,gitlab:Y.common69,id:Y.common1,instagram:Y.common69,mastodon:Y.common69,scope:Y.common10,signal:Y.common69,telegram:Y.common69,twitter:Y.common69,typeElement:Y.common70},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_LOCALITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:Y.common71,if:Y.common24,properties:{address:Y.common74,block:{const:"localities",default:"localities",type:"string"},geo:{oneOf:[Y.common31,Y.common79]},geoPosition:{oneOf:[Y.common31,Y.common83]},id:Y.common1,scope:Y.common10,typeElement:Y.common29},required:["block","typeElement","id","address"],then:Y.common89,type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SLUG",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:Y.common71,if:Y.common24,properties:{block:Y.common45,id:Y.common1,scope:Y.common10,slug:Y.common92,typeElement:Y.common29},required:["block","typeElement","id","slug"],then:Y.common89,type:"object"}},{auth:"bearer",constant:"CHECK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/check",request:{additionalProperties:!1,else:Y.common71,if:Y.common93,properties:{block:Y.common45,id:Y.common1,slug:Y.common92,type:Y.common19},required:["block","type","id","slug"],then:Y.common89,type:"object"}},{auth:"bearer",constant:"PROFIL_IMAGE",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/profil_avatar/contentKey/profil/docType/image",pathParams:Y.common95,request:{additionalProperties:!1,properties:{profil_avatar:Y.common20},required:["profil_avatar"],type:"object"}},{auth:"bearer",constant:"PROFIL_BANNER",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/banner/docType/image/contentKey/banner",pathParams:Y.common95,request:{additionalProperties:!1,properties:{banner:Y.common20,cropH:Y.common86,cropW:Y.common86,cropX:Y.common86,cropY:Y.common86,formOrigin:{const:"banner",default:"banner"},parentId:Y.common11,parentType:Y.common101},required:["banner","parentId","parentType","formOrigin","cropW","cropH","cropX","cropY"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_ABOUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/about/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,else:Y.common71,if:Y.common93,properties:{id:Y.common1,type:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi","badges","answers","classifieds","forms","actions"],type:"string"}},required:["type","id"],then:Y.common89,type:"object"},request:{additionalProperties:!1,properties:{tpl:{const:"ficheInfoElement",default:"ficheInfoElement",type:"string"}},required:["tpl"],type:"object"}},{auth:"bearer",constant:"MULTICONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:Y.common104,if:Y.common106,properties:{listInvite:{additionalProperties:!1,patternProperties:{"^(citoyens|projects|organizations)$":{additionalProperties:!1,patternProperties:{"^[0-9a-fA-F]{24}$":{additionalProperties:!1,properties:{name:Y.common1},required:["name"],type:"object"}},type:"object"}},type:"object"},parentId:Y.common1,parentType:Y.common70},required:["parentId","parentType","listInvite"],then:Y.common108,type:"object"}},{auth:"none",constant:"GET_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/get/type/{type}/id/{id}/isLive/{isLive}/json/true",pathParams:{additionalProperties:!1,else:Y.common71,if:Y.common93,properties:{id:Y.common1,isLive:Y.common110,type:Y.common70},required:["isLive","type","id"],then:Y.common89,type:"object"},request:{additionalProperties:!1,properties:{dateLimit:Y.common111,indexStep:{default:12,type:"integer"},search:{additionalProperties:!1,properties:{name:Y.common10},required:["name"],type:"object"}},required:["dateLimit","indexStep"],type:"object"}},{auth:"none",constant:"GET_NEWS_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/getbyids",request:{additionalProperties:!1,properties:{ids:Y.common112},required:["ids"],type:"object"}},{auth:"bearer",constant:"ADD_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/save",request:{additionalProperties:!1,anyOf:[Y.common113,Y.common114,Y.common115],else:Y.common104,if:Y.common106,properties:{json:Y.common87,markdownActive:Y.common110,mediaFile:Y.common116,mediaImg:Y.common118,mentions:Y.common120,parentId:Y.common1,parentType:Y.common70,scope:Y.common124,tags:Y.common32,text:Y.common1,type:Y.common125},required:["scope","markdownActive","parentId","parentType","type","json"],then:Y.common108,type:"object"}},{auth:"bearer",constant:"ADD_IMAGE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsImage/docType/image/contentKey/slider",pathParams:Y.common126,request:{additionalProperties:!1,properties:{newsImage:Y.common20},required:["newsImage"],type:"object"}},{auth:"bearer",constant:"ADD_FILE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsFile/docType/file",pathParams:Y.common126,request:{additionalProperties:!1,properties:{newsFile:Y.common20},required:["newsFile"],type:"object"}},{auth:"bearer",constant:"DELETE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/delete/id/{id}",pathParams:Y.common128,request:{additionalProperties:!1,properties:{isLive:Y.common129},required:["isLive"],type:"object"}},{auth:"bearer",constant:"UPDATE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/update",request:{additionalProperties:!1,anyOf:[Y.common113,Y.common114,Y.common115],else:Y.common104,if:Y.common106,properties:{idNews:Y.common11,markdownActive:Y.common110,mediaFile:Y.common116,mediaImg:Y.common118,mentions:Y.common120,parentId:Y.common1,parentType:Y.common70,scope:Y.common124,tags:Y.common32,text:Y.common1,type:Y.common125},required:["idNews","scope","markdownActive","parentId","parentType","type"],then:Y.common108,type:"object"}},{auth:"bearer",constant:"SHARE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:Y.common130,if:Y.common132,properties:{childId:Y.common11,childType:Y.common70,comment:Y.common1,connectType:Y.common134,parentId:Y.common11,parentType:Y.common125},required:["parentId","parentType","childId","childType","connectType"],then:Y.common135,type:"object"}},{auth:"none",constant:"GET_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/index/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,properties:{id:Y.common11,type:Y.common137},required:["type","id"],type:"object"}},{auth:"bearer",constant:"ADD_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/save",request:{additionalProperties:!1,properties:{argval:Y.common10,contextId:Y.common11,contextType:Y.common137,mentions:Y.common138,parentCommentId:{default:"",pattern:"^([a-f0-9]{24}|)$",type:"string"},path:Y.common10,text:Y.common1},required:["text","contextId","contextType"],type:"object"}},{auth:"bearer",constant:"DELETE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/delete/id/{id}",pathParams:Y.common128},{auth:"bearer",constant:"UPDATE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/update",request:{additionalProperties:!1,properties:{id:Y.common11,params:{properties:{mentions:Y.common138,text:Y.common1},required:["text"],type:"object"}},required:["id","params"],type:"object"}},{auth:"none",constant:"SEARCH_TAGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/tags/search?q={q}",pathParams:{additionalProperties:!1,properties:{q:Y.common1},required:["q"],type:"object"}},{auth:"none",constant:"SHOW_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/list/type/{type}/id/{id}/actionType/vote/json/true",pathParams:{additionalProperties:!1,properties:{id:Y.common11,type:{default:"news",enum:["news","comments"],type:"string"}},required:["type","id"],type:"object"}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:{default:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],items:Y.common141,type:"array"},fediverse:Y.common142,filters:Y.common143,indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common146,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchTags:Y.common33,searchType:{items:Y.common141,type:"array"}},required:["name","searchType","countType","indexMin","indexStep","initType","count","notSourceKey","filters","fediverse"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{minimum:5,type:"integer"},indexMin:Y.common157,locality:Y.common143,name:Y.common1,searchBy:{const:"ALL",default:"ALL",type:"string"},searchType:{const:["cities"],default:["cities"],items:{enum:["cities"],type:"string"},type:"array"}},required:["name","locality","searchType"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE_BY_COUNTRY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/city/autocompletemultiscope",request:{additionalProperties:!1,properties:{countryCode:{default:"FR",type:"string"},formInMap:Y.common129,scopeValue:Y.common1,type:{enum:["locality"],type:"string"}},required:["type","countryCode","scopeValue","formInMap"],type:"object"}},{auth:"none",constant:"SUGGESTION_INPUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{default:20,minimum:20,type:"integer"},indexMin:Y.common158,name:Y.common1,searchType:{items:{enum:["organizations","projects","poi"],type:"string"},type:"array"}},required:["name","searchType","indexMin","indexMax"],type:"object"}},{auth:"none",constant:"GET_PROJECTS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common159,fediverse:Y.common142,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@userId":Y.common161,"parent.@userId":Y.common161},"links.contributors.@userId":Y.common161},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162,"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162},type:"object"}},required:["$or"],type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common159},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_PROJECTS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:Y.common165,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common159,fediverse:Y.common142,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@{pathParams.id}":Y.common161,"parent.@{pathParams.id}":Y.common161},"links.contributors.@{pathParams.id}":Y.common161},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162},type:"object"}},required:["$or"],type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common159},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_POIS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common167,fediverse:Y.common142,filters:{additionalProperties:!1,default:{"parent.@userId":Y.common161},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common167},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_POIS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:Y.common165,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common167,fediverse:Y.common142,filters:{additionalProperties:!1,default:{"parent.@{pathParams.id}":Y.common161},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common167},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_ORGANIZATIONS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common168,fediverse:Y.common142,filters:{additionalProperties:!1,default:{"links.members.@userId":Y.common161,"links.members.@userId.isInviting":Y.common170,"links.members.@userId.toBeValidated":Y.common170},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":Y.common171,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":Y.common171},type:"object"},indexMax:Y.common86,indexMin:Y.common158,indexStep:Y.common174,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common168},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ORGANIZATIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:Y.common175,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common168,fediverse:Y.common142,filters:{additionalProperties:!0,default:Y.common178,patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":Y.common171,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":Y.common171},type:"object"},indexMax:Y.common86,indexMin:Y.common158,indexStep:Y.common174,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common168},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_USER_ELIGIBLE_PLACES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:Y.common175,request:{additionalProperties:!1,properties:{count:Y.common110,countType:Y.common179,fediverse:Y.common129,filters:{additionalProperties:!0,default:Y.common178,type:"object"},indexMax:Y.common86,indexMin:Y.common158,indexStep:Y.common174,initType:Y.common10,locality:Y.common10,name:Y.common1,notSourceKey:Y.common110,ranges:Y.common151,searchBy:{enum:["ALL"],type:"string"},searchType:Y.common179},required:["searchType","indexMin","indexStep","notSourceKey","filters"],type:"object"}},{auth:"none",constant:"GET_MEMBERS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common180,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":Y.common162,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":Y.common162,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":Y.common182,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":Y.common184,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":Y.common171},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common186},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_MEMBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/organizations/id/{id}/canSee/true",pathParams:Y.common128,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common180,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.memberOf.@{pathParams.id}":Y.common161,"links.memberOf.@{pathParams.id}.isInviting":Y.common170,"links.memberOf.@{pathParams.id}.toBeValidated":Y.common170},patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":Y.common162,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":Y.common162,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":Y.common182,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":Y.common184,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":Y.common182},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common186},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_FRIENDS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:Y.common6,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common187,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.friends.@{pathParams.id}":Y.common161,"links.friends.@{pathParams.id}.isInviting":Y.common170,"links.friends.@{pathParams.id}.toBeValidated":Y.common170},patternProperties:{"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":Y.common182,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":Y.common182},type:"object"},indexMax:Y.common86,indexMin:Y.common158,indexStep:Y.common174,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchType:Y.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIPTIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common189,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[Y.common191],default:{"links.followers.@userId":Y.common161,"links.followers.@{userId}.isInviting":Y.common170,"links.followers.@{userId}.toBeValidated":Y.common170},patternProperties:Y.common194,type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common189},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIPTIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:Y.common6,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common189,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[Y.common191],default:{"links.followers.@{pathParams.id}":Y.common161,"links.followers.@{pathParams.id}.isInviting":Y.common170,"links.followers.@{pathParams.id}.toBeValidated":Y.common170},patternProperties:Y.common194,type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common189},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIBERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common187,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[Y.common195],default:{"links.follows.@userId":Y.common161,"links.follows.@{userId}.isInviting":Y.common170,"links.follows.@{userId}.toBeValidated":Y.common170},patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":Y.common171,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":Y.common171},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,allOf:[{else:Y.common71,if:Y.common93,then:Y.common89}],properties:{id:Y.common1,type:Y.common198},required:["type","id"],type:"object"},request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common187,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[Y.common195],default:{"links.follows.@{pathParams.id}":Y.common161},maxProperties:1,minProperties:1,patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162},type:"object"},indexMin:Y.common158,indexStep:Y.common174,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,searchType:Y.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_CONTRIBUTORS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common180,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":Y.common162,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":Y.common162,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":Y.common182,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":Y.common184,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":Y.common171},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common186},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_CONTRIBUTORS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/projects/id/{id}/canSee/true",pathParams:Y.common128,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common180,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.projects.@{pathParams.id}":Y.common161,"links.projects.@{pathParams.id}.isInviting":Y.common170,"links.projects.@{pathParams.id}.toBeValidated":Y.common170},patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":Y.common162,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":Y.common162,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":Y.common182,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":Y.common184,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":Y.common182},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common186},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common199,fediverse:Y.common142,filters:{properties:{$or:{additionalProperties:!1,minProperties:1,patternProperties:{"^issuer\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162},type:"object"},isParcours:Y.common3,"preferences.private":Y.common142},required:["preferences.private"],type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common199},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES_FILTERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common201,fediverse:Y.common142,fields:Y.common199,filters:{oneOf:[{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common203}},{additionalProperties:!1,maxProperties:3,minProperties:3,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common203,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":Y.common206,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":Y.common206}},{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:Y.common209},{additionalProperties:!1,maxProperties:1,minProperties:1,properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:Y.common209,type:"object"}},required:["$or"]},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.revoke$":Y.common205}},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":Y.common203}}],type:"object"},indexMin:Y.common158,indexStep:Y.common174,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:{additionalProperties:!1,default:{Cooperative:Y.common210,GovernmentOrganization:Y.common210,Group:Y.common210,LocalBusiness:Y.common210,NGO:Y.common210,citoyens:Y.common210,projects:Y.common210},maxProperties:7,minProperties:7,patternProperties:{"^[a-zA-Z][a-zA-Z0-9]*$":Y.common153},type:"object"},searchType:Y.common201},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"CONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/connect",request:{additionalProperties:!1,allOf:[{if:Y.common106,then:{properties:{connectType:{const:"friend",default:"friend"}}}},{if:Y.common211,then:{properties:{connectType:{enum:["admin","member"]}}}},{if:Y.common213,then:{properties:{connectType:{enum:["admin","contributor"]}}}},{if:Y.common215,then:{properties:{connectType:{default:"attendee",enum:["attendee","connect"]}}}}],properties:{childId:Y.common217,childType:Y.common218,connectType:{enum:["admin","member","contributor","attendee","friend","connect"],type:"string"},parentId:Y.common11,parentType:Y.common219},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"bearer",constant:"DISCONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/disconnect",request:{additionalProperties:!1,allOf:[{if:Y.common106,then:{properties:{connectType:{default:"friends",enum:["friends","followers"]}}}},{if:Y.common211,then:{properties:{connectType:{default:"members",enum:["members","followers"]}}}},{if:Y.common213,then:{properties:{connectType:{default:"contributors",enum:["contributors","followers"]}}}},{if:Y.common215,then:{properties:{connectType:{default:"attendees",enum:["attendees","followers"]}}}}],properties:{childId:Y.common217,childType:Y.common218,connectType:{enum:["members","contributors","attendees","friends","followers"],type:"string"},parentId:Y.common11,parentType:Y.common219},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_KEY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/getinfo/key/{slug}",pathParams:{additionalProperties:!1,properties:{slug:{pattern:"^([a-zA-Z0-9-_]+)$",type:"string"}},required:["slug"],type:"object"}},{auth:"bearer",constant:"GET_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/config/type/citoyens/id/{id}/json/true",pathParams:Y.common6},{auth:"bearer",constant:"DELETE_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue?index={index}",pathParams:{properties:{index:Y.common86},type:"object"},request:{additionalProperties:!1,properties:{collection:Y.common220,id:Y.common221,path:{const:"preferences.search.@{pathParams.index}",default:"preferences.search.@{pathParams.index}",type:"string"},pull:{const:"preferences.search",type:"string"},value:Y.common143},required:["id","collection","path","pull","value"],type:"object"}},{auth:"bearer",constant:"ADD_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:Y.common205,collection:Y.common220,id:Y.common221,path:{const:"preferences.search",default:"preferences.search",type:"string"}},required:["id","collection","path","arrayForm","value"],type:"object"}},{auth:"bearer",constant:"ADD_ORGANIZATION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!0,properties:{address:Y.common75,buildingSurfaceArea:Y.common86,collection:{const:"organizations",default:"organizations",type:"string"},compagnon:Y.common1,costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,description:Y.common1,email:Y.common2,filiere:{additionalProperties:{additionalProperties:!1,properties:{icon:Y.common1,name:Y.common1,tags:Y.common33},required:["name","icon","tags"],type:"object"},type:"object"},geo:Y.common79,geoPosition:Y.common83,holderOrganization:Y.common1,id:Y.common11,key:{const:"organization",default:"organization",type:"string"},mainTag:Y.common1,manageModel:Y.common1,name:Y.common222,openingDate:Y.common1,openingHours:{items:{oneOf:[Y.common31,{additionalProperties:!1,properties:{dayOfWeek:Y.common223,hours:{items:Y.common224,type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},preferences:Y.common227,role:{enum:["admin","member"],type:"string"},scope:Y.common143,shortDescription:Y.common1,siteSurfaceArea:Y.common86,tags:Y.common33,telephone:Y.common1,thematic:Y.common33,type:Y.common66,typePlace:Y.common1,url:Y.common35,video:Y.common33},required:["id","collection","key","name","type","role","scope"],type:"object"}},{auth:"bearer",constant:"ADD_PROJECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:Y.common75,collection:Y.common230,costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,geo:Y.common79,geoPosition:Y.common83,id:Y.common11,key:{const:"project",default:"project",type:"string"},name:Y.common1,parent:Y.common231,preferences:{default:{crowdfunding:!0,isOpenData:!1,isOpenEdition:!1},properties:{crowdfunding:Y.common110,isOpenData:Y.common129,isOpenEdition:Y.common129},required:["isOpenData","isOpenEdition"],type:"object"},public:Y.common110,scope:Y.common143,shortDescription:Y.common1,tags:Y.common33,url:Y.common35},required:["id","collection","key","parent","name","public","scope"],type:"object"}},{auth:"bearer",constant:"ADD_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:Y.common75,aps_name:Y.common33,categorie:Y.common1,collection:Y.common234,costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,description:Y.common1,equip_acc_libre:Y.common3,equip_douche:Y.common3,equip_eclair:Y.common3,equip_gest_type:Y.common1,equip_larg:Y.common86,equip_loc_type:Y.common33,equip_long:Y.common86,equip_maj_date:Y.common1,equip_nature:Y.common1,equip_pmr_acc:Y.common3,equip_pmr_chem:Y.common3,equip_pmr_douche:Y.common3,equip_pmr_sanit:Y.common3,equip_pmr_trib:Y.common3,equip_pmr_vest:Y.common3,equip_prop_nom:Y.common1,equip_prop_type:Y.common1,equip_pshs_aire:Y.common3,equip_pshs_chem:Y.common3,equip_pshs_sanit:Y.common3,equip_pshs_sign:Y.common3,equip_pshs_trib:Y.common3,equip_pshs_vest:Y.common3,equip_sol:Y.common1,equip_surf:Y.common86,equip_type_famille:Y.common1,equip_type_name:Y.common1,equip_utilisateur:Y.common33,geo:Y.common79,geoPosition:Y.common83,id:Y.common11,inst_acc_handi_bool:Y.common3,inst_acc_handi_type:Y.common1,inst_date_creation:Y.common1,inst_enqu_date:Y.common1,inst_nom:Y.common1,inst_part_bool:Y.common3,inst_part_type:Y.common33,inst_trans_bool:Y.common3,inst_trans_type:Y.common1,key:Y.common234,name:Y.common1,parent:Y.common231,scope:Y.common143,source:{additionalProperties:!0,properties:{insertOrign:Y.common1,key:Y.common1,keys:Y.common33},type:"object"},tags:Y.common33,type:Y.common67,urls:Y.common33},required:["id","collection","key","parent","type","name"],type:"object"}},{auth:"bearer",constant:"ADD_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,else:{required:["openingHours"]},if:{properties:{recurrency:Y.common173}},properties:{address:Y.common74,collection:Y.common235,costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,email:Y.common30,endDate:Y.common236,geo:Y.common79,geoPosition:Y.common83,id:Y.common11,key:{const:"event",default:"event",type:"string"},name:{minLength:2,type:"string"},openingHours:{default:["","","","","","",""],items:{anyOf:[Y.common31,{additionalProperties:!1,properties:{dayOfWeek:Y.common223,hours:{default:[],items:Y.common224,type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},organizer:Y.common231,parent:{oneOf:[Y.common62,Y.common31]},preferences:{default:{isOpenData:!1,isOpenEdition:!1},properties:{isOpenData:Y.common129,isOpenEdition:Y.common129},required:["isOpenData","isOpenEdition"],type:"object"},public:Y.common110,recurrency:Y.common129,scope:Y.common143,shortDescription:{format:"textarea",type:"string"},startDate:Y.common236,tags:{anyOf:[Y.common33,Y.common31]},timeZone:Y.common1,type:Y.common65,url:Y.common35},required:["id","collection","key","organizer","type","name","scope"],startBeforeEnd:!0,then:{required:["startDate","endDate"]},type:"object"}},{auth:"bearer",constant:"DELETE_ELEMENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/{type}/id/{id}",pathParams:{additionalProperties:!1,properties:{id:Y.common11,type:Y.common1},required:["type","id"],type:"object"},request:Y.common8},{auth:"bearer",constant:"ADD_IMAGE_ELEMENT",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/qqfile/docType/image/contentKey/profil",pathParams:{additionalProperties:!1,properties:{folder:{enum:["badges","events"],type:"string"},ownerId:Y.common11},required:["folder","ownerId"],type:"object"},request:{additionalProperties:!1,properties:{qqfile:Y.common20,qqfilename:Y.common1,qqtotalfilesize:Y.common237,qquuid:Y.common11},required:["qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"LINK_VALIDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/validate",request:{additionalProperties:!1,properties:{childId:Y.common5,childType:Y.common49,linkOption:{enum:["isInviting","toBeValidated","isAdminPending"],type:"string"},parentId:Y.common11,parentType:Y.common219},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"SEARCH_MEMBER_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/searchmemberautocomplete",request:{additionalProperties:!1,properties:{search:Y.common1,searchMode:{default:"personOnly",enum:["personOnly","organizationOnly","mixte"],type:"string"}},required:["search","searchMode"],type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:Y.common238,request:{additionalProperties:!1,properties:{indexMin:Y.common111},type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS_COUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:Y.common238,request:{additionalProperties:!1,properties:{refreshTimestamp:Y.common237},type:"object"}},{auth:"bearer",constant:"NOTIFICATION_UPDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/update",request:{additionalProperties:!1,properties:{action:{enum:["seen","read"],type:"string"},all:Y.common87},required:["action","all"],type:"object"}},{auth:"bearer",constant:"REMOVE_ALL_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/removeall"},{auth:"bearer",constant:"MARK_NOTIFICATION_AS_READ",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/marknotificationasread",request:Y.common128},{auth:"none",constant:"ACTIVITYPUB_SEARCH",contentType:"application/x-www-form-urlencoded",method:"GET",params:[Y.common20],path:"/api/activitypub/search?address={address}",pathParams:{additionalProperties:!1,properties:{address:Y.common1},required:["address"],type:"object"}},{auth:"bearer",constant:"ACTIVITYPUB_LINK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/link",request:{additionalProperties:!1,properties:{action:{enum:["undo_follow","accept_invitation","reject_invitation","undo_accept","undo_request_follow","follow","remove_follow","accept_follower","reject_follower","remove_follower","remove_invitation"],type:"string"},actor:{additionalProperties:!1,properties:{id:Y.common1,name:Y.common1,type:{enum:["person"],type:"string"}},required:["id","type","name"],type:"object"},payload:Y.common4},required:["action","payload","actor"],type:"object"}},{auth:"none",constant:"ACTIVITYPUB_GET_COMMUNITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/getcommunity/userId/${userId}/type/${type}/actor/person",pathParams:{additionalProperties:!1,properties:{type:{enum:["follows","followers"],type:"string"},userId:Y.common11},required:["userId","type"],type:"object"}},{auth:"none",constant:"GET_BADGE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/page/type/badges/id/{id}/json/true",pathParams:Y.common128},{auth:"none",constant:"GET_EMETTEUR_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/badge/json/true"},{auth:"bearer",constant:"ADD_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{collection:Y.common241,costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,criteria:{additionalProperties:!1,properties:{narrative:Y.common1},required:["narrative"],type:"object"},description:Y.common1,id:Y.common11,isParcours:Y.common129,issuer:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:Y.common1,type:{enum:["citoyens","organizations","projects"],type:"string"}},required:["type"],type:"object"}},type:"object"},key:Y.common242,name:Y.common1,parent:{additionalProperties:!1,patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:{name:Y.common1,type:Y.common241},required:["type"],type:"object"}},type:"object"},preferences:Y.common227,public:Y.common110,scope:Y.common143,tags:Y.common33},required:["id","collection","key","name","public","scope","issuer","criteria"],type:"object"}},{auth:"bearer",constant:"ASSIGN_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/badges/assign",request:{additionalProperties:!1,properties:{award:{patternProperties:{"^[0-9a-f]{24}$":Y.common58},type:"object"},badgeId:Y.common11,collection:Y.common241,evidences:{items:{additionalProperties:!1,properties:{narative:Y.common1,url:Y.common4},required:["narative"],type:"object"},type:"array"},key:Y.common242,narative:Y.common1,scope:Y.common143},required:["key","collection","badgeId","award"],type:"object"}},{auth:"none",constant:"GET_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/agenda",request:{additionalProperties:!0,properties:{count:Y.common129,countType:{const:["events"],default:["events"],type:"array"},endDateUTC:Y.common236,fediverse:Y.common129,filters:{additionalProperties:!1,default:{$or:{"links.attendees.@userId":Y.common161,"organizer.@userId":Y.common161},"links.attendees.@userId":Y.common161},patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162,"^organizer\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162},type:"object"}},required:["$or"],type:"object"},indexMin:Y.common111,indexStep:{default:100,type:"integer"},locality:{patternProperties:{"^[^\\s]+$":{type:"object"}},type:"object"},name:Y.common1,recurrency:Y.common110,searchType:{const:["events"],default:["events"],items:{enum:["events"],type:"string"},type:"array"},startDateUTC:Y.common236,type:Y.common65},required:["searchType","indexMin","indexStep","fediverse"],type:"object"}},{auth:"bearer",constant:"SHARE_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:Y.common130,if:Y.common132,properties:{childId:Y.common11,childType:Y.common70,comment:Y.common1,connectType:Y.common134,parentId:Y.common11,parentType:Y.common235},required:["parentId","childId","childType","connectType","parentType"],then:Y.common135,type:"object"}},{auth:"bearer",constant:"INVITE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:Y.common104,if:Y.common106,properties:{listInvite:{additionalProperties:!1,minProperties:1,properties:{citoyens:Y.common243,invites:{patternProperties:{"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$":{additionalProperties:!1,properties:{email:Y.common2,isAdmin:Y.common247,msg:Y.common1,name:Y.common1,roles:Y.common33},required:["name","email"],type:"object"}},type:"object"},organizations:Y.common243,projects:Y.common243},type:"object"},parentId:Y.common1,parentType:Y.common70},required:["parentId","parentType","listInvite"],then:Y.common108,type:"object"}},{auth:"bearer",constant:"FOLLOW",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/follow",request:{additionalProperties:!1,properties:{childId:Y.common217,childType:Y.common218,parentId:Y.common11,parentType:Y.common219},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"GET_COSTUM_JSON",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/cms/getcostumjson?slug={slug}",pathParams:{slug:Y.common1}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE_COSTUM",contentType:"application/x-www-form-urlencoded",functionCocostum:"globalautocomplete",method:"POST",path:"/co2/search/globalautocomplete",request:Y.common248},{auth:"none",constant:"NAVIGATOR_GETTL",contentType:"application/x-www-form-urlencoded",functionCocostum:"gettl",method:"POST",path:"/costum/navigator/gettl",request:Y.common248},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ACTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestActors",method:"POST",path:"/costum/coevent/get_events/request/actors/id/{id}/type/{type}",pathParams:Y.common268,request:{additionalProperties:!1,properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,mode:Y.common1,parent_only:Y.common3,sourceKey:Y.common33,types:{items:{enum:["organizer","links.attendees","creator","links.creator","links.organizer","organizerName","animator"],type:"string"},type:"array"}},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_SUBEVENTS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestSubevents",method:"POST",path:"/costum/coevent/get_events/request/subevents/id/{id}/type/{type}",pathParams:Y.common268,request:{additionalProperties:!1,allOf:[{if:{properties:{date:Y.common1},required:["date"]},then:{required:["timezone"]}}],properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,date:{oneOf:[Y.common1,{properties:{between:{properties:{end:Y.common44,start:Y.common44},required:["start","end"],type:"object"}},required:["between"],type:"object"}]},fromToday:Y.common3,mode:Y.common1,regions:Y.common271,sourceKey:Y.common33,tags:Y.common33,timezone:Y.common1,type:Y.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ELEMENT_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestElementEvent",method:"POST",path:"/costum/coevent/get_events/request/element_event/id/{id}/type/{type}",pathParams:Y.common268,request:Y.common274},{auth:"none",constant:"COSTUM_EVENT_REQUEST_CATEGORIES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestCategories",method:"POST",path:"/costum/coevent/get_events/request/categories/id/{id}/type/{type}",pathParams:Y.common268,request:Y.common274},{auth:"none",constant:"COSTUM_EVENT_REQUEST_DATES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestDates",method:"POST",path:"/costum/coevent/get_events/request/dates/id/{id}/type/{type}",pathParams:Y.common268,request:{additionalProperties:!1,properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,mode:Y.common1,regions:Y.common271,sourceKey:Y.common33,tags:Y.common33,type:Y.common1},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestEvent",method:"POST",path:"/costum/coevent/get_events/request/event/id/{id}/type/{type}",pathParams:Y.common268,request:Y.common274},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLinkTlToEvent",method:"POST",path:"/costum/coevent/get_events/request/link_tl_to_event/id/{id}/type/{type}",pathParams:Y.common268,request:{additionalProperties:!1,properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,event:Y.common1,mode:Y.common1,sourceKey:Y.common33,tl:Y.common1},required:["tl","event"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLoadContextTag",method:"POST",path:"/costum/coevent/get_events/request/load_context_tag/id/{id}/type/{type}",pathParams:Y.common268,request:{additionalProperties:!1,properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,event:Y.common11,mode:Y.common1,search:Y.common1,sourceKey:Y.common33},type:"object"}},{auth:"none",constant:"GET_GALLERY",contentType:"application/x-www-form-urlencoded",functionCocostum:"",method:"POST",path:"/co2/gallery/index/type/{type}/id/{id}/docType/{docType}/tpl/json",pathParams:{additionalProperties:!1,else:Y.common71,if:Y.common93,properties:{docType:{default:"image",enum:["image","file","bookmarks"],type:"string"},id:Y.common1,type:Y.common198},required:["id","type","docType"],then:Y.common89,type:"object"},request:{additionalProperties:!1,properties:{contentKey:Y.common1,folderId:Y.common1},type:"object"}},{auth:"none",constant:"GET_ATTENDEES_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common187,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$":Y.common162,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":Y.common162,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":Y.common162,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":Y.common182,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":Y.common184,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":Y.common171},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ATTENDEES_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/events/id/{id}/canSee/true",pathParams:Y.common128,request:{additionalProperties:!1,properties:{count:Y.common87,countType:Y.common187,fediverse:Y.common142,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.events.@{pathParams.id}":Y.common161,"links.events.@{pathParams.id}.isInviting":Y.common170,"links.events.@{pathParams.id}.toBeValidated":Y.common170},patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":Y.common162,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":Y.common162,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":Y.common162,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":Y.common182,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":Y.common184,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":Y.common182},type:"object"},indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common143,name:Y.common1,notSourceKey:Y.common87,ranges:Y.common151,searchBy:Y.common155,searchType:Y.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_SEARCH",contentType:"application/x-www-form-urlencoded",functionCocostum:"answerlist",method:"POST",path:"/survey/coform/answerslist",request:{additionalProperties:!1,properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,count:Y.common87,countType:Y.common276,fediverse:Y.common129,fields:Y.common33,filters:Y.common253,indexMax:Y.common86,indexMin:Y.common144,indexStep:Y.common145,initType:Y.common143,locality:Y.common146,mapUsed:Y.common205,mode:Y.common1,name:Y.common1,notSourceKey:Y.common205,options:Y.common262,ranges:Y.common151,searchBy:Y.common155,searchTags:Y.common33,searchType:Y.common276,sortBy:Y.common266,sourceKey:Y.common33},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_BY_ID",contentType:"application/x-www-form-urlencoded",functionCocostum:"findanswered",method:"POST",path:"/survey/coform/findanswered",request:{additionalProperties:!1,properties:{answerId:Y.common1,fields:Y.common33,finderPath:Y.common10,formId:Y.common1},required:["answerId"],type:"object"}},{auth:"none",constant:"GET_COFORM_BY_ID",contentType:"application/x-www-form-urlencoded",functionCocostum:"getformbyid",method:"POST",path:"/survey/coform/getformbyid",request:{additionalProperties:!1,properties:{elementId:Y.common11,elementType:{enum:["organizations","projects","events","poi","citoyens"],type:"string"},parentFormId:Y.common11},required:["parentFormId"],type:"object"}},{auth:"bearer",constant:"COFORM_UPLOAD_ANSWER_FILE",contentType:"multipart/form-data",method:"POST",path:"/survey/coform/uploadanswerfile",request:{additionalProperties:!1,properties:{answerId:Y.common11,contentKey:{default:"slider",type:"string"},docType:{default:"image",enum:["image","file"],type:"string"},formId:Y.common11,qqfile:Y.common254,qqfilename:Y.common1,qqtotalfilesize:Y.common86,qquuid:Y.common1,subKey:Y.common1},required:["formId","qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"COFORM_GET_ANSWER_FILES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/survey/coform/getanswerfiles",request:{additionalProperties:!1,properties:{answerId:Y.common11,contentKey:{default:"presentation",type:"string"},docType:{default:"file",enum:["image","file"],type:"string"},subKey:Y.common1},required:["answerId","subKey"],type:"object"}},{auth:"none",constant:"GET_COFORM_CATALOGS",contentType:"application/x-www-form-urlencoded",functionCocostum:"getformcatalogs",method:"POST",path:"/survey/coform/getformcatalogs",request:{additionalProperties:!1,properties:{formId:Y.common11,inputKeys:Y.common1},required:["formId","inputKeys"],type:"object"}},{auth:"bearer",constant:"SAVE_COFORM_ANSWER",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/survey/coform/saveanswer",request:{additionalProperties:!1,properties:{addedOptions:Y.common1,answerId:Y.common11,answers:Y.common1,formId:Y.common11,links:Y.common1},required:["formId","answers"],type:"object"}},{auth:"bearer",constant:"GET_COFORM_ANSWER_HISTORY",contentType:"application/x-www-form-urlencoded",functionCocostum:"getCoformAnswerHistory",method:"POST",path:"/survey/coform/getanswerhistory",request:{additionalProperties:!1,properties:{answerId:Y.common11},required:["answerId"],type:"object"}},{auth:"bearer",constant:"GET_COFORM_MULTIEVAL_DATA",contentType:"application/x-www-form-urlencoded",functionCocostum:"getCoformMultiEvalData",method:"POST",path:"/survey/coform/getmultievaldata",request:{additionalProperties:!1,properties:{answerId:Y.common11,stepKey:Y.common1},required:["answerId"],type:"object"}},{auth:"bearer",constant:"GET_COFORM_COMMONTABLE_CONTRIBUTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"getCoformCommonTableContributors",method:"POST",path:"/survey/coform/getcommontablecontributors",request:{additionalProperties:!1,properties:{criteriaIds:Y.common1,formId:Y.common11,inputKey:Y.common1},required:["formId","inputKey","criteriaIds"],type:"object"}},{auth:"bearer",constant:"ADD_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"vote",default:"vote",type:"string"},collection:Y.common278,details:{additionalProperties:!1,properties:{status:Y.common1},required:["status"],type:"object"},id:Y.common11},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"ADD_REPORT_ABUSE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"reportAbuse",default:"reportAbuse",type:"string"},collection:Y.common278,details:{additionalProperties:!1,properties:{comment:Y.common1,reason:Y.common1},required:["reason"],type:"object"},id:Y.common11},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"UPDATE_PATH_VALUE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,allOf:[{if:{required:["pull"]},then:{properties:{value:Y.common1}}}],properties:{arrayForm:Y.common3,collection:{default:"citoyens",enum:["citoyens","organizations","projects","events","poi","answers","forms","actions"],type:"string"},edit:Y.common3,formParentId:Y.common11,id:Y.common5,path:Y.common1,pull:Y.common1,setType:{anyOf:[Y.common279,{items:{additionalProperties:!1,properties:{path:Y.common1,type:Y.common1},required:["path","type"],type:"object"},type:"array"}]},updatePartial:Y.common3,value:{type:["string","number","boolean","object","array","null"]}},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DELETE_DOCUMENT_BY_CONTEXT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/document/delete/dir/co2/contextType/{contextType}/contextId/{contextId}",pathParams:{additionalProperties:!1,properties:{contextId:Y.common5,contextType:Y.common280},required:["contextType","contextId"],type:"object"},request:{additionalProperties:!1,properties:{ids:Y.common11,parentId:Y.common5,parentType:Y.common280,path:{const:"communecter",default:"communecter",type:"string"}},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DELETE_DOCUMENT_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/document/deletedocumentbyid/id/{id}",pathParams:Y.common128},{auth:"bearer",constant:"DEMOTE_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/updateadminlink/",request:{additionalProperties:!1,properties:{childId:Y.common11,childType:Y.common188,connect:{enum:["members","contributors"],type:"string"},isAdmin:Y.common142,parentId:Y.common11,parentType:{enum:["organizations","projects"],type:"string"}},required:["parentId","parentType","childId","childType","connect","isAdmin"],type:"object"}},{constant:"COSTUM_FILTER_COFORM",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/costum/francetierslieux/autoglobalthematicntwrk",request:{properties:{costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,searchedData:Y.common254},type:"object"}},{constant:"COSTUM_FILTER_COFORM_BY_PATH",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/costum/francetierslieux/autoglobalthematicntwrk",request:{additionalProperties:!0,properties:{contextId:Y.common11,contextType:Y.common250,costumEditMode:Y.common129,costumId:Y.common11,costumSlug:Y.common1,costumType:Y.common250,count:Y.common129,fediverse:Y.common129,fields:Y.common33,filters:{oneOf:[Y.common254,Y.common31]},indexMin:Y.common144,indexStep:{default:1e4,type:"number"},initType:Y.common10,locality:{oneOf:[Y.common254,{items:Y.common254,type:"array"},Y.common31]},notSourceKey:Y.common110,params:{additionalProperties:!1,properties:{finderPath:Y.common1,thematicPath:Y.common1},required:["thematicPath"],type:"object"},searchType:{default:["answers"],items:Y.common1,type:"array"},sortBy:Y.common266,sourceKey:Y.common33},required:["params"],type:"object"}},{auth:"none",constant:"GET_COUNTRIES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/opendata/getcountries",request:{additionalProperties:!1,properties:{costumEditMode:{oneOf:[{enum:["true","false"],type:"string"},{enum:[0,1],type:"number"},Y.common3]},costumId:Y.common11,costumSlug:Y.common1,costumType:{enum:["organizations","projects","events","citoyens","poi"],type:"string"}},type:"object"}},{constant:"SEARCH_ZONES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/getzone",request:{properties:{costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,countryCode:Y.common281,level:Y.common281,sortBy:Y.common1,upperLevelId:Y.common1},required:["countryCode","level"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_BY_FORMS",contentType:"application/x-www-form-urlencoded",functionCocostum:"findanswers",method:"POST",path:"/costum/francetierslieux/getallanswersbyforms",request:{properties:{forms:{patternProperties:{"^[a-fA-F0-9]{24}$":Y.common1},type:"object"}},type:"object"}},{auth:"none",constant:"GENERATE_ANSWER_FROM_FORM",contentType:"application/x-www-form-urlencoded",functionCocostum:"generateanswerfromform",method:"POST",path:"/survey/answer/newanswer/form/{formId}",pathParams:{additionalProperties:!1,properties:{formId:Y.common11},required:["formId"],type:"object"},request:{properties:{action:Y.common1},type:"object"}},{auth:"none",constant:"FUNDING_ENVELOPE",contentType:"application/x-www-form-urlencoded",functionCocostum:"fundingenvelope",method:"POST",path:"/co2/aap/fundingenvelope",request:{additionalProperties:!0,properties:{action:Y.common1,answer:Y.common11,contextId:{pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},contextType:Y.common1,financerId:Y.common11,financerType:Y.common1,formId:Y.common11,params:Y.common254,project:Y.common11},required:["contextId","contextType"],type:"object"}},{auth:"none",constant:"COREMU_OPERATION",contentType:"application/x-www-form-urlencoded",functionCocostum:"coremuoperation",method:"POST",path:"/co2/aap/coremuoperation/",request:{additionalProperties:!0,properties:{action:{const:"generateproposition",type:"string"},answer:{const:"new",type:"string"},form:Y.common11,project:Y.common11},required:["form","answer","action","project"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_NEW",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestNew",method:"POST",path:"/costum/project/action/request/new",request:{additionalProperties:!1,properties:{assign:Y.common11,credits:{default:1,minimum:0,type:"number"},endDate:Y.common236,idParentRoom:Y.common11,importance:{default:"low",type:"string"},is_contributor:Y.common3,max:Y.common157,mentions:Y.common33,milestone:{additionalProperties:!1,properties:{endDate:Y.common236,milestoneId:Y.common11,startDate:Y.common236},required:["milestoneId"],type:"object"},min:Y.common157,name:Y.common1,parentId:Y.common11,parentType:Y.common230,startDate:Y.common236,status:{default:"todo",enum:["todo","done","tracking","discuter","next","totest","disabled","closed"],type:"string"},tags:Y.common33,timeSpent:Y.common157,urls:Y.common32},required:["name","status","parentId","parentType"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_SET_STATUS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestSetStatus",method:"POST",path:"/costum/project/action/request/set_status",request:{additionalProperties:!1,properties:{id:Y.common11,status:{enum:["todo","done","tracking","discuter","next","totest","disabled","closed"],type:"string"},user:Y.common11},required:["id","status"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_SET_DATE",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestSetDate",method:"POST",path:"/costum/project/action/request/set_date",request:{additionalProperties:!1,properties:{endDate:Y.common1,id:Y.common11,startDate:Y.common1},required:["id"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_SET_CONTRIBUTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestSetContributors",method:"POST",path:"/costum/project/action/request/set_contributors",request:{additionalProperties:!1,properties:{action:Y.common11,contributor:Y.common11,contributors:Y.common112,participate:{enum:[0,1],type:"integer"}},required:["action"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_CANCEL",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestCancel",method:"POST",path:"/costum/project/action/request/cancel",request:Y.common128},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_ARCHIVE",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestArchive",method:"POST",path:"/costum/project/action/request/archive",request:Y.common128},{auth:"bearer",constant:"LINK_DISCOURSE_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"linkDiscourseAccount",method:"POST",path:"/interop/discourse/linkAccount",request:Y.common282},{auth:"bearer",constant:"UNLINK_DISCOURSE_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"unlinkDiscourseAccount",method:"POST",path:"/interop/discourse/unlinkAccount",request:Y.common284},{auth:"none",constant:"DISCOURSE_PROFILE",contentType:"application/x-www-form-urlencoded",functionCocostum:"getDiscourseProfile",method:"POST",path:"/interop/discourse/profile",request:Y.common282},{auth:"bearer",constant:"DISCOURSE_CHECK_EMAIL",contentType:"application/x-www-form-urlencoded",functionCocostum:"checkDiscourseEmailMatch",method:"POST",path:"/interop/discourse/checkEmailMatch",request:Y.common284},{auth:"bearer",constant:"DISCOURSE_DISMISS_LINK",contentType:"application/x-www-form-urlencoded",functionCocostum:"dismissDiscourseLink",method:"POST",path:"/interop/discourse/dismissDiscourseLink",request:Y.common284},{auth:"bearer",constant:"LINK_MEDIAWIKI_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"linkMediaWikiAccount",method:"POST",path:"/interop/mediawiki/linkAccount",request:Y.common282},{auth:"bearer",constant:"UNLINK_MEDIAWIKI_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"unlinkMediaWikiAccount",method:"POST",path:"/interop/mediawiki/unlinkAccount",request:Y.common284},{auth:"none",constant:"GET_MEDIAWIKI_CONTRIBUTIONS",contentType:"application/x-www-form-urlencoded",functionCocostum:"getMediaWikiContributions",method:"POST",path:"/interop/mediawiki/contribs",request:{additionalProperties:!0,properties:{costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,limit:Y.common237,username:Y.common1},required:["username","costumSlug","costumId","costumType"],type:"object"}},{auth:"bearer",constant:"ADD_CLASSIFIED",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!0,properties:{address:{additionalProperties:!1,properties:{"@type":Y.common77,addressCountry:Y.common1,addressLocality:Y.common1,codeInsee:Y.common1,level1:Y.common1,level1Name:Y.common1,level2:Y.common1,level2Name:Y.common1,level3:Y.common78,level3Name:Y.common78,level4:Y.common78,level4Name:Y.common78,localityId:Y.common1,postalCode:Y.common1,streetAddress:Y.common1},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},category:{enum:["service","competence","material"],type:"string"},collection:{const:"classifieds",default:"classifieds",type:"string"},costumId:Y.common1,costumSlug:Y.common1,costumType:Y.common1,description:Y.common1,geo:Y.common79,geoPosition:Y.common83,id:Y.common11,key:{const:"classified",default:"classified",type:"string"},name:Y.common222,parent:Y.common231,preferences:Y.common227,scope:Y.common143,section:{enum:["need","offer"],type:"string"},subtype:Y.common279,tags:Y.common33},required:["id","collection","key","name","section","category","subtype","scope"],type:"object"}},{auth:"none",constant:"PERSON_ACTIVATE",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/activate",request:{properties:{user:Y.common1,validationKey:Y.common1},required:["user","validationKey"],type:"object"}}]};function ee(e){return e instanceof Error}function te(e){return ee(e)&&"response"in e&&"object"==typeof e.response&&"number"==typeof e.response.status}function ne(e){return ee(e)?e.message:"string"==typeof e?e:e&&"object"==typeof e&&"message"in e?String(e.message):"Unknown error"}function oe(e){return function(e){return ee(e)&&"status"in e&&"number"==typeof e.status}(e)?e.status:te(e)?e.response.status:e instanceof ApiError?e.status:void 0}class TokenStorageStrategy{}class MemoryStorageStrategy extends TokenStorageStrategy{_accessToken=null;_refreshToken=null;constructor(){super()}getAccessToken(){return this._accessToken}setAccessToken(e){this._accessToken=e}getRefreshToken(){return this._refreshToken}setRefreshToken(e){this._refreshToken=e}clear(){this._accessToken=null,this._refreshToken=null}}class LocalStorageStrategy extends TokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}getAccessToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_accessToken`):null}setAccessToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_accessToken`,e??"")}getRefreshToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_refreshToken`):null}setRefreshToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_refreshToken`,e??"")}clear(){"undefined"!=typeof localStorage&&(localStorage.removeItem(`${this.prefix}_accessToken`),localStorage.removeItem(`${this.prefix}_refreshToken`))}}class MultiServerTokenStorageStrategy extends TokenStorageStrategy{_currentBaseURL=null;constructor(){super()}use(e){if(!e)throw new Error("baseURL est requis");this._currentBaseURL=e.replace(/\/+$/,"")}_ensureContext(){if(!this._currentBaseURL)throw new Error("baseURL non défini. Appelez use(baseURL)")}_requireBaseURL(){return this._ensureContext(),this._currentBaseURL}}class MultiServerMemoryStorageStrategy extends MultiServerTokenStorageStrategy{_storage=new Map;constructor(){super()}getAccessToken(){const e=this._requireBaseURL();return this._storage.get(e)?.accessToken??null}setAccessToken(e){const t=this._requireBaseURL(),n=this._storage.get(t)||{};this._storage.set(t,{...n,accessToken:e})}getRefreshToken(){const e=this._requireBaseURL();return this._storage.get(e)?.refreshToken??null}setRefreshToken(e){const t=this._requireBaseURL(),n=this._storage.get(t)||{};this._storage.set(t,{...n,refreshToken:e})}clear(){const e=this._requireBaseURL();this._storage.delete(e)}getServers(){return Array.from(this._storage.keys())}exportAll(){return Object.fromEntries(this._storage.entries())}}class MultiServerLocalStorageStrategy extends MultiServerTokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}_key(e){return`${this.prefix}_tokens_${e}`}_getData(){if(this._ensureContext(),"undefined"==typeof localStorage)return{};const e=localStorage.getItem(this._key(this._currentBaseURL));return e?JSON.parse(e):{}}_setData(e){"undefined"!=typeof localStorage&&localStorage.setItem(this._key(this._currentBaseURL),JSON.stringify(e))}getAccessToken(){return this._getData().accessToken??null}setAccessToken(e){const t=this._getData();t.accessToken=e,this._setData(t)}getRefreshToken(){return this._getData().refreshToken??null}setRefreshToken(e){const t=this._getData();t.refreshToken=e,this._setData(t)}clear(){"undefined"!=typeof localStorage&&localStorage.removeItem(this._key(this._currentBaseURL))}getServers(){if("undefined"==typeof localStorage)return[];return Object.keys(localStorage).filter(e=>e.startsWith(`${this.prefix}_tokens_`)).map(e=>e.replace(`${this.prefix}_tokens_`,""))}exportAll(){const e={};for(const t of this.getServers()){const n=this._key(t),o="undefined"!=typeof localStorage?localStorage.getItem(n):null;o&&(e[t]=JSON.parse(o))}return e}}const re=p;I.addType("oid",e=>{if("string"==typeof e)return new Q(e);if(void 0===e)return new Q;throw new Error("Expected string value for ObjectID")});class ApiClient extends s{__entityTag="ApiClient";userId=null;_baseURL;_refreshUrl;_endpoints;_debug;_fromJSONValue;_tokenStorage;_offlineClientManager=null;_ajv;_logger;_client;_breakerThreshold;_breakerResetTime;_breakerErrorCount=0;_breakerOpen=!1;_lastBreakerOpenTime=null;_accessToken=null;_refreshToken=null;_setUserId;_mode="legacy";constructor({baseURL:e,accessToken:t,refreshToken:n,refreshUrl:o="/api/cocolight/refreshtoken",endpoints:r=X.endpoints,timeout:i=3e4,debug:s=!1,maxRetries:a=0,circuitBreakerThreshold:p=5,circuitBreakerResetTime:d=6e4,fromJSONValue:m=!0,mode:l="legacy",tokenStorageStrategy:u=null}){if(super(),!e)throw new ApiClientError('Le paramètre "baseURL" est obligatoire.',500);this._baseURL=e,this._refreshUrl=o,this._endpoints=r||X.endpoints,this._debug=s,this._fromJSONValue=m,this._mode="clean"===l?"clean":"legacy",this._breakerThreshold=p,this._breakerResetTime=d;let h=null;if(Object.defineProperty(this,"userId",{get:()=>h,set:()=>{throw new Error("Modification directe de userId non autorisée.")},enumerable:!0}),this._setUserId=e=>{h=e,this._logger?.debug(`[ApiClient] userId set: ${e}`)},this._ajv=new T({strict:!1,useDefaults:!0,allErrors:!0,verbose:!0}),b(this._ajv),this._ajv.addFormat("textarea",!0),this._ajv.addKeyword({keyword:"startBeforeEnd",type:"object",errors:!0,validate:this._startBeforeEndValidate}),this._logger=v({transport:{target:"pino-pretty",options:{colorize:!0}},level:s?"debug":"info"}),this._client=c.create({baseURL:e,timeout:i}),a>0&&(re(this._client,{retries:a,retryDelay:re.exponentialDelay,retryCondition:e=>re.isNetworkError(e)||re.isRetryableError(e),onRetry:(e,t,n)=>{this._logger.warn(`[Retry] Tentative #${e} pour ${n?.url}`),this.emit("retryAttempt",{retryCount:e,url:n?.url})}}),this._logger.info(`[ApiClient] Retry activé : ${a} max`)),u instanceof MultiServerTokenStorageStrategy&&u.use(this._baseURL),this._tokenStorage=u||new MemoryStorageStrategy,"function"!=typeof this._tokenStorage?.getAccessToken||"function"!=typeof this._tokenStorage?.setAccessToken||"function"!=typeof this._tokenStorage?.getRefreshToken||"function"!=typeof this._tokenStorage?.setRefreshToken||"function"!=typeof this._tokenStorage?.clear)throw new Error("[ApiClient] La stratégie de stockage des tokens n’est pas valide. Elle doit implémenter les méthodes requises.");n&&this.setRefreshToken(n),t&&this.setToken(t);const y=this._tokenStorage.getAccessToken();y&&this.setToken(y);const f=this._tokenStorage.getRefreshToken();f&&this.setRefreshToken(f),this._client.interceptors.response.use(e=>e,async e=>{const t=e.config;if(t._retry)throw this._logger.error("[ApiClient] Requête déjà retentée, échec définitif."),e;if(e.response&&401===e.response.status&&this._refreshToken){t._retry=!0;try{this._logger.info("[ApiClient] Tentative de refresh du token...");if(await this._refreshAccessToken())return this._logger.info("[ApiClient] Token rafraîchi avec succès."),t.headers=t.headers??{},t.headers.Authorization="Bearer "+this.getToken(),this._logger.info("[ApiClient] Retente la requête originale avec le nouveau token."),this._client.request(t);throw this.resetSession(),new ApiClientError("Impossible de rafraîchir le token.",401)}catch(e){this.resetSession();const t={code:oe(e)||401,message:ne(e)};throw new ApiClientError("Erreur lors du rafraîchissement du token.",401,t)}}throw e})}setToken(e){this._accessToken=e,this._tokenStorage.setAccessToken(e??""),e?this._client.defaults.headers.common.Authorization="Bearer "+e:delete this._client.defaults.headers.common.Authorization;const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait et défini : ${t}`)),this._logger.debug(`[ApiClient] setToken: ${e}`)}getToken(){return this._accessToken}setRefreshToken(e){if(this._refreshToken=e,this._tokenStorage.setRefreshToken(e??""),null===this.userId){const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait depuis refreshToken : ${t}`))}this._logger.debug(`[ApiClient] setRefreshToken: ${e}`)}getRefreshToken(){return this._refreshToken}get isConnected(){return!!this._accessToken}_getIdFromToken(e){if(!e)return null;try{const t=d(e);return this._logger.debug("[ApiClient] Payload décodé :",t),t.id||t.userId||null}catch(e){return this._logger.error("[ApiClient] Erreur lors du décodage du token :",e),null}}async _refreshAccessToken(){if(!this._refreshToken)return!1;const e=c.create({baseURL:this._baseURL,timeout:1e4,headers:{"Content-Type":"application/json"}});try{const t=await e.post(this._refreshUrl,{refreshToken:this._refreshToken});return!(!t.data||!t.data.token)&&(this.setToken(t.data.token),t.data.refreshToken&&this.setRefreshToken(t.data.refreshToken),this.emit("refreshSuccess",t.data),!0)}catch(e){return this.emit("refreshFailed",{error:ne(e)}),this.resetSession(),this._logger.error(`[ApiClient] Refresh Error : ${ne(e)}`),!1}}_checkCircuitBreaker(){if(!this._breakerOpen)return!0;const e=Date.now();return null!=this._lastBreakerOpenTime&&e-this._lastBreakerOpenTime>this._breakerResetTime&&(this._breakerOpen=!1,this._breakerErrorCount=0,this._logger.warn("[ApiClient] Circuit breaker réinitialisé"),this.emit("circuitBreakerReset"),!0)}_updateCircuitBreakerError(){this._breakerErrorCount+=1,this._logger.warn(`[ApiClient] Erreur #${this._breakerErrorCount} sur ${this._breakerThreshold}`),this._breakerErrorCount>=this._breakerThreshold&&(this._breakerOpen=!0,this._lastBreakerOpenTime=Date.now(),this._logger.error("[ApiClient] Circuit breaker ACTIVÉ - L'API est considérée indisponible"),this.emit("circuitBreakerOpen",{timestamp:this._lastBreakerOpenTime}))}_resetCircuitBreakerSuccess(){this._breakerErrorCount=0,this._breakerOpen&&(this._breakerOpen=!1,this._logger.warn("[ApiClient] Circuit breaker refermé suite à un succès"))}static stripNullsInPlace(e){if(e&&"object"==typeof e&&e.value&&"function"==typeof e.value.pipe)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)null===e[t]||void 0===e[t]?e.splice(t,1):"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]);else if(e&&"object"==typeof e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null===e[t]||void 0===e[t]?delete e[t]:"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]));return e}_resolveSpecialValuesInPlace(e,t={}){const n={userId:()=>this.userId,accessToken:()=>this._accessToken,refreshToken:()=>this._refreshToken,baseURL:()=>this._baseURL,pathParams:e=>{const n=this._getValueByPath(t,e);return null!=n?n:void 0}},o=/@(?:\{([^}]+)\}|([\w.]+))/g,r=e=>"string"!=typeof e?e:e.replace(o,(t,o,r)=>{if(o){if(o.startsWith("pathParams.")){const e=o.substring(11),t=n.pathParams(e);return null!=t?t:`@{${o}}`}{const e=n[o];if("function"==typeof e){const t=e();return null!=t?t:`@{${o}}`}return`@{${o}}`}}if(r){if(r.startsWith("pathParams.")){const e=r.match(/^pathParams\.([^.]+)(.*)$/);if(e){const t=e[1],o=e[2],i=n.pathParams(t);return null!=i?i+o:`@${r}`}return`@${r}`}{const e=n[r];if("function"==typeof e){const t=e();return null!=t?t:`@${r}`}return`@${r}`}}return e}),i=e=>{if((e=>e&&"object"==typeof e&&("function"==typeof e.pipe||"undefined"!=typeof Buffer&&e instanceof Buffer))(e))return e;if(Array.isArray(e))return e.map(i);if((e=>"[object Object]"===Object.prototype.toString.call(e))(e)){const t={};for(const[n,o]of Object.entries(e)){t[r(n)]=i(o)}return t}return"string"==typeof e?r(e):e};return i(e)}_cleanSchemaLeftoverAlias(e){const t=/@\w+/;if(Array.isArray(e))return e.map(e=>this._cleanSchemaLeftoverAlias(e));if(e&&"object"==typeof e){const n={};for(const o of Object.keys(e)){const r=e[o];if(!t.test(o)){if("default"===o){if("string"==typeof r&&t.test(r))continue;if(r&&"object"==typeof r){const e=this._cleanSchemaLeftoverAlias(r);Object.keys(e).length>0&&(n[o]=e);continue}}"string"==typeof r&&t.test(r)||(n[o]=this._cleanSchemaLeftoverAlias(r))}}return n}return e}async safeCall(e,...t){try{return await e(...t)}catch(e){throw this._logger.error(`[ApiClient.safeCall] Erreur: ${ne(e)}`),e}}async callEndpoint(e,t={},n=!0,o=!0){const r=this._endpoints.find(t=>t.constant===e);if(!r)throw new ApiClientError(`Endpoint introuvable : ${e}`,404);const{path:i,method:s,contentType:a,auth:c,pathParams:p,request:d,responses:m}=r,l=(s||"GET").toLowerCase(),u=a||"application/json",h={"Content-Type":u};if("clean"===this._mode&&(h["X-Coco-Mode"]="clean"),this._accessToken)"bearer"===c?h.Authorization=`Bearer ${this._accessToken}`:c&&"none"!==c||h.Authorization||(h.Authorization=`Bearer ${this._accessToken}`);else if("bearer"===c)throw new ApiClientError(`Token requis pour l'endpoint sécurisé : ${e}`,401);let y,f=i,g={};if(p){let n=p;"none"===c&&null===this.userId&&(n=this._cleanSchemaLeftoverAlias(p));const o=t.pathParams||{},r=this._ajv.compile(n);if(!r(o)){const t=this._ajvErrorHuman(r.errors??[]);throw this.emit("validationError",{stage:"pathParams",errors:r.errors}),new ApiValidationError(`callEndpoint: ${e} - Path parameter validation failed.`,400,t,r.errors)}g=this._resolveSpecialValuesInPlace(o),f=f.replace(/\{(\w+)\}/g,(e,t)=>{const n=g[t];if(void 0!==n)return encodeURIComponent(n);throw new ApiClientError(`Path param manquant ou non résolu : {${t}}`,400)})}if(d){let n=d;"none"===c&&null===this.userId&&(n=this._cleanSchemaLeftoverAlias(d));let o={...t};delete o.pathParams,"application/x-www-form-urlencoded"===u&&(o=ApiClient.normalizeDatesForValidation(o),o=ApiClient.normalizeSchemaDateFields(o,n));const r=ApiClient.stripNullsInPlace(o),i=this._ajv.compile(n);if(!i(r)){const t=i.errors?this._ajvErrorHuman(i.errors):[];throw this.emit("validationError",{stage:"request",errors:i.errors}),new ApiValidationError(`callEndpoint: ${e} - Request validation failed.`,400,t,i.errors)}t=this._resolveSpecialValuesInPlace(r,g)}if(this._offlineClientManager?.isOffline()){if("function"==typeof this._offlineClientManager._enqueueOfflineAction){this._logger.warn(`[ApiClient] Mode dégradé : mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:n,validateResponseSchema:o}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (offline mode)`),this.emit("queuedOffline",{constant:e,reason:"offlineMode",data:t});return{data:null,offline:!0}}throw this._logger.warn("[ApiClient] Mode dégradé actif mais offlineManager non initialisé correctement"),new ApiClientError("Mode hors-ligne actif, mais gestionnaire offline non disponible.",503)}if(!this._checkCircuitBreaker()){if(!1===this._offlineClientManager?.isOffline?.()&&"function"==typeof this._offlineClientManager._enqueueOfflineAction){this._logger.warn(`[ApiClient] Circuit breaker actif → mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:n,validateResponseSchema:o}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (circuit breaker)`),this.emit("queuedOffline",{constant:e,reason:"circuitBreaker",data:t});return{data:null,breaker:!0}}throw new CircuitBreakerError("Le circuit breaker est activé, impossible d'appeler l'API")}"application/json"===u||"multipart/form-data"===u?y=t:"application/x-www-form-urlencoded"===u&&(y=ApiClient.toURLSearchParams(t)),this._logger.debug(`[ApiClient] callEndpoint: ${e} -> ${f}, method=${l}`);try{const e=await this._client.request({url:f,method:l,headers:h,["get"===l?"params":"data"]:y});if("clean"===this._mode){const t=e.data;if(t&&"object"==typeof t&&!Array.isArray(t)&&"boolean"==typeof t.success){if(!1===t.success)throw new ApiResponseError(t?.error?.message??"Erreur inconnue",e.status,t);e.data=t.data}this._fromJSONValue&&(e.data=this._reviveClean(e.data))}else if(o){const t=String(e.status),n=m?.[t];if(n){const t=this._ajv.compile(n);if(!t(e.data)){const n=this._ajvErrorHuman(t.errors??[]);throw this.emit("validationError",{stage:"response",errors:t.errors}),new ApiValidationError("Response validation failed.",e.status,n,t.errors)}}}return this._resetCircuitBreakerSuccess(),"function"==typeof n?e.data=n(e.data):!0===n&&"clean"!==this._mode&&(e.data=this._transformData(e.data)),Array.isArray(r.postActions)&&r.postActions.forEach(t=>{const n=t.path?this._getValueByPath(e.data,t.path):null;switch(t.type){case"setToken":this.setToken(n);break;case"setRefreshToken":this.setRefreshToken(n);break;case"resetSession":this.resetSession();break;case"emitEvent":t.event&&(this.emit(t.event,n),this._logger.debug(`[ApiClient] Event émis : ${t.event}`,n));break;case"callMethod":"function"==typeof this[t.method]?(this[t.method](),this._logger.debug(`[ApiClient] Méthode appelée : ${t.method}`)):this._logger.warn(`[ApiClient] Méthode inconnue : ${t.method}`);break;default:this._logger.warn(`[ApiClient] Action inconnue : ${t.type}`)}}),e}catch(t){if(t instanceof ApiResponseError)throw t;if(this._updateCircuitBreakerError(),this._logger.error(`[ApiClient] Erreur lors de l'appel de ${e}: ${ne(t)}`),t instanceof ApiValidationError)throw t;{const e=te(t)?t.response.status:500,n=te(t)?t.response.data:null;throw new ApiClientError(`Erreur lors de l'appel de l'API : ${ne(t)}`,e,n)}}}_ajvErrorHuman(e){try{const t=new a(e);return t.errors.map(({message:e})=>e)}catch(t){return this._logger.error("[ApiClient] _ajvErrorHuman",t),e.map(({message:e})=>e)}}checkAndThrowApiResponseError(e){if(!("status"in e))return e;const t=e.data;if(!t||"object"!=typeof t)return e;if("boolean"==typeof t.result&&!1===t.result)throw new ApiResponseError(t.msg||"Erreur inconnue",e.status,t);if(t.resultErrors&&"object"==typeof t.resultErrors&&"boolean"==typeof t.resultErrors.result&&!1===t.resultErrors.result)throw new ApiResponseError(t.resultErrors.msg||"Erreur inconnue",e.status,t);return e}resetSession(){this.setToken(null),this.setRefreshToken(null),this._setUserId(null),this._tokenStorage.clear(),delete this._client.defaults.headers.common.Authorization,this._logger.info("[ApiClient] Session utilisateur réinitialisée."),this.emit("sessionReset")}_getValueByPath(e,t){if(!t)return;return t.split(".").reduce((e,t)=>e&&e[t],e)}static normalizeDatesForValidation(e){if(null==e)return e;if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return ApiClient.normalizeDatesForValidation(e.__raw);if(e instanceof Date)return e.toISOString().replace(/\.\d{3}Z$/,"+0000");if(Array.isArray(e))return e.map(e=>ApiClient.normalizeDatesForValidation(e));if("object"==typeof e){const t={};for(const n of Object.keys(e))t[n]=ApiClient.normalizeDatesForValidation(e[n]);return t}return e}static normalizeSchemaDateFields(e,t){if(!e||!t||"object"!=typeof e)return e;const n={...e};let o=t.properties||{};if(t.allOf&&Array.isArray(t.allOf))for(const e of t.allOf)e.properties&&(o={...o,...e.properties}),e.then&&e.then.properties&&(o={...o,...e.then.properties});t.then&&t.then.properties&&(o={...o,...t.then.properties});for(const[e,t]of Object.entries(o)){const o=t;if("date"===o?.format&&n[e]){const t=n[e];"string"==typeof t&&t.includes("T")&&(n[e]=t.split("T")[0])}}return n}static toURLSearchParams(e,t={}){return this._buildParams(e,new URLSearchParams,t)}static _buildParams(e,t,n={}){if("object"!=typeof e||null===e)throw new TypeError("La donnée doit être un objet non nul.");const{dots:o=!1,indexes:r=!1,metaTokens:i=!0}=n,s=[];function a(e){return"[object Object]"===Object.prototype.toString.call(e)||Array.isArray(e)}function c(e){return e.endsWith("[]")?e.slice(0,-2):e}function p(e,t,n=!1){return e?e.concat(t).map((e,t)=>(e=c(e),!n&&t?`[${e}]`:e)).join(n?".":""):t}function d(e){return null==e?"":e instanceof Date?e.toISOString():(e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||ArrayBuffer.isView(e),e)}return function e(n,m=[]){null==n||s.includes(n)||(s.push(n),Object.entries(n).forEach(([n,s])=>{void 0!==s&&function(e,n,s){if(e&&"object"==typeof e){if(n.endsWith("{}"))return n=i?n:n.slice(0,-2),t.append(p(s,n,o),JSON.stringify(e)),!1;if(Array.isArray(e)&&!e.some(a)||n.endsWith("[]"))return n=c(n),e.forEach((e,i)=>{if(null!=e){const a=r?p(s.concat(n),i,o):`${p(s,n,o)}[]`;t.append(a,d(e))}}),!1}return!!a(e)||(t.append(p(s,n,o),d(e)),!1)}(s,n.trim(),m)&&e(s,m.concat(c(n)))}),s.pop())}(e),t}_reviveClean(e){if(Array.isArray(e))return e.map(e=>this._reviveClean(e));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach(n=>{let o=this._reviveClean(e[n]);if(this._dateFields.includes(n)&&"string"==typeof o&&/^\d{4}-\d{2}-\d{2}T/.test(o)){const e=new Date(o);Number.isNaN(e.getTime())||(o=e)}t[n]=o}),"string"==typeof t.id&&/^[0-9a-fA-F]{24}$/.test(t.id)&&void 0===t._id&&(t._id=I.fromJSONValue({$type:"oid",$value:t.id})),t}return e}_transformData(e){if(e&&"object"==typeof e)if(e.resultGoods?.msg)e=this._normalizeJsonData({msg:e.resultGoods.msg,...e});else if(e.resultErrors?.msg)e=this._normalizeJsonData({msg:e.resultErrors.msg,...e});else if(e.results&&"object"==typeof e.results&&!Array.isArray(e.results))e.results=Object.keys(e.results).map(t=>this._normalizeJsonData({id:t,...e.results[t]}));else if(Array.isArray(e.results)&&e.results.length>0)e.results=e.results.map(e=>this._normalizeJsonData(e));else if(e.news&&Array.isArray(e.news)&&0===e.news.length)e=e.news;else if(e.news&&"object"==typeof e.news&&!Array.isArray(e.news))e=Object.keys(e.news).map(t=>this._normalizeJsonData({id:t,...e.news[t]}));else if(e.notif&&"object"==typeof e.notif&&!Array.isArray(e.notif))e.notif=Object.keys(e.notif).map(t=>this._normalizeJsonData({id:t,...e.notif[t]}));else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens)&&e.organizations&&"object"==typeof e.organizations&&!Array.isArray(e.organizations))e=[...Object.keys(e.citoyens).map(t=>this._normalizeJsonData({id:t,...e.citoyens[t]})),...Object.keys(e.organizations).map(t=>this._normalizeJsonData({id:t,...e.organizations[t]}))];else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens))e=Object.keys(e.citoyens).map(t=>this._normalizeJsonData({id:t,...e.citoyens[t]}));else if(e.cities&&"object"==typeof e.cities&&!Array.isArray(e.cities))e=Object.keys(e.cities).map(t=>this._normalizeJsonData({id:t,...e.cities[t]}));else if(e.cities&&Array.isArray(e.cities)&&0===e.cities.length)e=e.cities;else if(e.newComment&&"object"==typeof e.newComment)e.newComment=this._normalizeJsonData({...e.newComment});else if(Array.isArray(e))e=e.map(e=>this._normalizeJsonData(e));else if(e.map&&"object"==typeof e.map)e.map=this._normalizeJsonData(e.map);else if(e.object&&"object"==typeof e.object)e.object=this._normalizeJsonData(e.object);else if("object"==typeof e&&Object.keys(e).length>0){const t=Object.keys(e).every(e=>/^[0-9a-fA-F]{24}$/.test(e));e=t?Object.keys(e).map(t=>({id:t,...this._normalizeJsonData(e[t])})):this._normalizeJsonData(e)}return e}_normalizeJsonData(e){if(!e||"object"!=typeof e)return e;if(e=this._normalizeRecursively(e),e?.mediaImg?.images&&Array.isArray(e.mediaImg.images)&&e.mediaImg.images.length>0&&(e.mediaImg.countImages=e.mediaImg.images.length),e?.mediaFile?.files&&Array.isArray(e.mediaFile.files)&&e.mediaFile.files.length>0&&(e.mediaFile.countFiles=e.mediaFile.files.length),e?.src?.changes&&"object"==typeof e.src.changes&&Object.keys(e.src.changes).length>0&&Object.keys(e.src.changes).forEach(t=>{e.src.changes[t]&&(e.src.changes[t]=this._ensureFullURL(e.src.changes[t]))}),e?.openingHours&&Array.isArray(e.openingHours)&&e.openingHours.length>0&&(e.openingHours=e.openingHours.filter(e=>e.dayOfWeek&&e.hours&&e.hours[0]&&e.hours[0].opens)),e.replies&&"object"==typeof e.replies&&Object.keys(e.replies).length>0&&(e.replies=Object.keys(e.replies).map(t=>this._normalizeJsonData({id:t,...e.replies[t]}))),e?.author&&"object"==typeof e.author&&Object.keys(e.author).length>0&&!("profilThumbImageUrl"in e.author)){const t=Object.keys(e.author)[0];e.author={...e.author[t]}}return e?.timeAgo&&delete e.timeAgo,"people"===e?.author?.typeSig&&(e.author.type="citoyens"),"people"===e?.typeSig&&(e.collection="citoyens"),"organizations"===e?.typeSig&&(e.collection="organizations"),this._fromJSONValue?I.fromJSONValue(e):e}_ensureFullURL(e){if(!e)return e;if(!(e=e.trim())||/^https?:\/\//i.test(e))return e;let t="/";return t=this._baseURL.endsWith("/")&&e.startsWith("/")||this._baseURL.endsWith("/")||e.startsWith("/")?"":"/",`${this._baseURL}${t}${e}`}_normalizeString(e){return"true"===e||"false"!==e&&e}_normalizeId(e){return e._id&&e._id.$id&&/^[0-9a-fA-F]{24}$/.test(e._id.$id)&&(e.id=e._id.$id,e._id={$type:"oid",$value:e._id.$id}),e.id&&e.id.$id&&/^[0-9a-fA-F]{24}$/.test(e.id.$id)&&(e._id={$type:"oid",$value:e.id.$id},e.id=e.id.$id),e}_normalizeDate(e){if(e&&"object"==typeof e&&"number"==typeof e.sec)return{$date:1e3*e.sec};if("number"==typeof e)return{$date:1e3*e};if("string"==typeof e&&""!==e.trim()){const t=new Date(e);if(!isNaN(t.getTime()))return I.toJSONValue(t)}return e}_normalizeImage(e){return"string"==typeof e&&""!==e.trim()?this._ensureFullURL(e):e}_normalizeNumber(e){if("string"!=typeof e)return e;const t=e.trim();if(""===t)return e;const n=Number(t);return Number.isFinite(n)?n:e}_imageFields=["profilImageUrl","profilThumbImageUrl","profilMediumImageUrl","profilMarkerImageUrl","profilBannerUrl","profilRealBannerUrl","imagePath","imageThumbPath","docPath","imageThumb","imageMediumPath","logo","logoMin","image"];_dateFields=["modified","created","updated","birthDate","lastLoginDate","startDate","endDate","date","issuedOn","equip_maj_date","inst_date_creation","inst_enqu_date"];_numberFields=["buildingSurfaceArea","siteSurfaceArea","credits","min","max","timeSpent","equip_surf","equip_larg","equip_long"];_normalizeRecursively(e){if("string"==typeof e)return this._normalizeString(e);if(Array.isArray(e))return e.map(e=>this._normalizeRecursively(e));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach(n=>{let o=this._normalizeRecursively(e[n]);this._dateFields.includes(n)&&(o=this._normalizeDate(o)),this._imageFields.includes(n)&&(o=this._normalizeImage(o)),this._numberFields.includes(n)&&(o=this._normalizeNumber(o)),"content"===n&&o&&"object"==typeof o&&o.image&&(o.image=this._normalizeImage(o.image)),t[n]=o}),this._normalizeId(t)}return e}_startBeforeEndValidate=(e,t)=>{if(!t.startDate||!t.endDate)return!0;const n=new Date(t.startDate)<new Date(t.endDate);return n||(this._startBeforeEndValidate.errors=[{instancePath:"/startDate",schemaPath:"#/startBeforeEnd",keyword:"startBeforeEnd",params:{},message:"startDate must be before endDate"}]),n};getRequestSchema(e){const t=this._endpoints.find(t=>t.constant===e);return t?.request||null}getPathSchema(e){return this._endpoints.find(t=>t.constant===e)?.pathParams||null}onEvent(e={}){const t=["retryAttempt","queuedOffline","circuitBreakerOpen","circuitBreakerReset","refreshSuccess","refreshFailed","sessionReset","validationError","offlineModeChanged","userLoggedIn"];for(const n of t)"function"==typeof e[n]&&this.on(n,e[n])}getDeclaredEvents(){const e=new Set;for(const t of this._endpoints)if(Array.isArray(t.postActions))for(const n of t.postActions)"emitEvent"===n.type&&n.event&&e.add(n.event);return Array.from(e)}}function ie(e){return e&&"object"==typeof e&&"status"in e&&"data"in e}class UserApi{client;loggedUser=null;constructor(e){this.client=e instanceof ApiClient?e:new ApiClient(e)}get isConnected(){return this.client.isConnected}get userId(){return this.client.userId}async login(e,t){return this.client.safeCall(async()=>{const n=await this.client.callEndpoint("AUTHENTICATE_URL",{email:e,password:t});return this.loggedUser=new User(this.client,n.data.user,{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Classified:Classified,Action:Action}),this.loggedUser})}async meIsconnected(){if(!this.client.isConnected||!this.client.userId)throw new ApiError("User not connected",401);return this.client._logger.debug("UserApi","meIsconnected",this.client.userId),this.loggedUser=new User(this.client,{id:this.client.userId},{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Classified:Classified,Action:Action}),this.loggedUser}async register({name:e,username:t,email:n,pwd:o}){return this.client.safeCall(async()=>{const r=await this.client.callEndpoint("PERSON_REGISTER",{name:e,username:t,email:n,pwd:o});if(!ie(r))throw new ApiError("Requête mise en file (offline/circuit breaker)",503,r);if(!1===r?.data?.result)throw new ApiResponseError(r.data.msg,r.status,r.data);return r.data})}async recoverPassword(e){return this.client.safeCall(async()=>{const t=await this.client.callEndpoint("PASSWORD_RECOVERY",{email:e});if(!ie(t))throw new ApiError("Requête mise en file (offline/circuit breaker)",503,t);if(!1===t?.data?.result)throw new ApiResponseError(t.data.msg,t.status,t.data);return t.data})}async activateAccount({user:e,validationKey:t}){return this.client.safeCall(async()=>{const n=await this.client.callEndpoint("PERSON_ACTIVATE",{user:e,validationKey:t});if(!ie(n))throw new ApiError("Requête mise en file (offline/circuit breaker)",503,n);if(!1===n?.data?.result)throw new ApiResponseError(n.data.msg,n.status,n.data);return n.data})}}f("User",User),f("Organization",Organization),f("Project",Project),f("Event",Event),f("Poi",Poi),f("Badge",Badge),f("EndpointApi",EndpointApi),f("News",News),f("Comment",Comment),f("Answer",Answer),f("Form",Form),f("Classified",Classified),f("Action",Action);class Api{_loggedUser;_client;static async userLogin(e,t,n){const o=Api.userApi(n);return await Api.userApiLogin(o,e,t)}static userApi(e){try{return new UserApi(e)}catch(e){throw console.error("[Api.userApi] Erreur lors de la création d'un objet utilisateur :",e.message),e}}static async userApiLogin(e,t,n){try{if(!e)throw new ApiError("userApi is not defined",500);if(!e.client)throw new ApiError("userApi.client is not defined",500);if(e.client.isConnected){const t=await e.meIsconnected();return new Api(t,e.client)}{if(!t||!n)throw new ApiError("email and password are required",400);const o=await e.login(t,n);return new Api(o,e.client)}}catch(e){if(e instanceof ApiClientError&&e?.details?.error)throw new ApiAuthenticationError(e.details.error,e.status,e.details);throw e}}constructor(e,t){this._loggedUser=e,this._client=t}async me(){if(!this._loggedUser)throw new ApiAuthenticationError("Accès refusé : utilisateur non authentifié.",401);return await this._loggedUser.get(),this._loggedUser}async user(e){try{if(e.id||e.slug){const t=new User(this._client,e,{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});return await t.get(),t}return new User(this._client,e,{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action})}catch(e){throw console.error("[Api.user] Erreur lors de la création d'un objet utilisateur public :",e.message),e}}async organization(e){try{const t=new Organization(this._client,e,{EndpointApi:EndpointApi,User:User,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Organization.");return await t.get(),t}catch(e){throw console.error("[Api.organization] Erreur lors de la création d'un objet organisation :",e.message),e}}async project(e){try{const t=new Project(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Project.");return await t.get(),t}catch(e){throw console.error("[Api.project] Erreur lors de la création d'un objet projet :",e.message),e}}async event(e){try{const t=new Event(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");return await t.get(),t}catch(e){throw console.error("[Api.event] Erreur lors de la création d'un objet événement :",e.message),e}}async poi(e){try{const t=new Poi(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Poi.");return await t.get(),t}catch(e){throw console.error("[Api.poi] Erreur lors de la création d'un objet poi :",e.message),e}}async answer(e){try{const t=new Answer(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id)throw new Error("Vous devez fournir un id pour créer une instance Answer.");return await t.get(),t}catch(e){throw console.error("[Api.answer] Erreur lors de la création d'un objet Answer :",e.message),e}}async form(e){try{const t=new Form(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id)throw new Error("Vous devez fournir un id pour créer une instance Form.");return await t.get(),t}catch(e){throw console.error("[Api.form] Erreur lors de la création d'un objet Form :",e.message),e}}async classified(e){try{const t=new Classified(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Classified.");return await t.get(),t}catch(e){throw console.error("[Api.classified] Erreur lors de la création d'un objet Classified :",e.message),e}}async entitySlug(e){if(!e)throw new ApiError("slug requis",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType){const n=_(t.contextType,this._client,{id:t.contextId});if(!n)throw new ApiResponseError(`Le type d'entité pour le slug ${e} n'est pas reconnu`,200,t);return await n.get(),n}throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}get client(){return this._client}get endpointApi(){return new EndpointApi(this._client)}async searchTags(e){if("string"!=typeof e||0===e.length)throw new ApiError("Le mot-clé `q` est requis pour searchTags.",400);const t={pathParams:{q:e}};return this.endpointApi.searchTags(t)}logout(){this._loggedUser=null,this._client.resetSession(),this._client._logger.info("UserApi: User logged out")}}class OfflineQueueStorageStrategy{}class MemoryOfflineStorage extends OfflineQueueStorageStrategy{_queue=[];constructor(){super()}async loadQueue(){return this._queue}async saveQueue(e){this._queue=[...e]}}class LocalStorageOfflineStorage extends OfflineQueueStorageStrategy{key;constructor(e="cocolight-api-offline-queue"){super(),this.key=e}async loadQueue(){try{const e=localStorage.getItem(this.key);return(e?JSON.parse(e):null)??[]}catch{return[]}}async saveQueue(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(e){console.warn("[Offline] Échec du stockage localStorage",e)}}}class OfflineClientManager{_clients;_client;_offlineMode;_pingInterval;_offlineQueueStorage;_offlineQueue;_monitoringStarted;constructor(e){if(!(e&&e instanceof ApiClient))throw new Error("[OfflineClientManager] apiClient doit être une instance de ApiClient");this._clients=new Map,this._client=e,this._offlineMode=void 0,this._pingInterval=void 0,this._offlineQueueStorage=void 0,this._offlineQueue=[],this._monitoringStarted=void 0}static async attachTo(e,t={}){e._offlineClientManager=new OfflineClientManager(e);const n=await async function(e="auto"){if("memory"===e)return new MemoryOfflineStorage;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new LocalStorageOfflineStorage;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileOfflineStorage:e}=await Promise.resolve().then(function(){return we});return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new LocalStorageOfflineStorage;{const{FileOfflineStorage:e}=await Promise.resolve().then(function(){return we});return new e}}throw new Error(`Unsupported offline storage strategy: ${e}`)}(t?.offlineStorageStrategy||"auto");await e._offlineClientManager._initOfflineQueue(n),t?.disableOfflineMonitoring||e._offlineClientManager.startOfflineMonitoring(t)}async getClient(e){const t=`${e.baseURL}|${e.accessToken}`;if(this._clients.has(t))return this._clients.get(t);const n=new ApiClient({baseURL:e.baseURL,accessToken:e.accessToken,refreshToken:e.refreshToken,debug:this._client._debug});return this._clients.set(t,n),n}async replayAction(e){const t=await this.getClient(e.meta);try{const n=await t.callEndpoint(e.constant,e.data,e.options?.transformResponseData??!0,e.options?.validateResponseSchema??!0);return this._client._logger.info(`[OfflineReplay] Succès ${e.constant} sur ${e.meta.baseURL}`),n}catch(t){throw this._client._logger.error(`[OfflineReplay] Échec ${e.constant}`,t.message),t}}startOfflineMonitoring({interval:e=3e4,disableOfflineMonitoring:t=!1}={}){t||this._monitoringStarted||(this._monitoringStarted=!0,this._offlineMode="undefined"!=typeof window&&"undefined"!=typeof navigator&&!navigator.onLine,"undefined"!=typeof window&&(window.addEventListener("online",()=>this.setOfflineMode(!1)),window.addEventListener("offline",()=>this.setOfflineMode(!0))),this._pingInterval=setInterval(async()=>{const e=this._offlineMode;try{await this._client._client.head("/api/cocolight/infoserver",{timeout:5e3}),e&&this.setOfflineMode(!1)}catch{this._client._logger.error("[OfflineMonitor] ping() échoué → passage en offline"),this.setOfflineMode(!0)}},e))}setOfflineMode(e){this._offlineMode!==e&&(this._offlineMode=e,"function"==typeof this._client.emit&&this._client.emit("offlineModeChanged",e),this._client._logger.info(`[ApiClient] Mode offline : ${e} (set depuis monitoring)`),e||"function"!=typeof this._replayOfflineQueue||this._replayOfflineQueue())}isOffline(){return!!this._offlineMode}async _enqueueOfflineAction({constant:e,data:t,options:n={}}){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const o=this._client.getToken()||this._client.getRefreshToken(),r=this._client._endpoints.find(t=>t.constant===e);if("required"===(r?.authPolicy||("none"===r?.auth?"none":"required"))&&!o)return void this._client._logger.warn(`[Offline] Action ignorée : token requis mais absent (${e})`);const i={constant:e,data:t,options:n,meta:{baseURL:this._client._baseURL,accessToken:this._client.getToken(),refreshToken:this._client.getRefreshToken(),timestamp:Date.now()}};this._offlineQueue.push(i),await this._offlineQueueStorage.saveQueue(this._offlineQueue),this._client._logger.info(`[Offline] Action mise en file : ${e}`)}async _replayOfflineQueue(){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const e=[...this._offlineQueue];this._offlineQueue=[],await this._offlineQueueStorage.saveQueue([]);for(const t of e){const e=this._client._endpoints.find(e=>e.constant===t.constant),n=e?.authPolicy||("none"===e?.auth?"none":"required"),o=t.meta.accessToken||t.meta.refreshToken;if("required"!==n||o)try{await this.replayAction(t)}catch(e){this._client._logger.error("[Offline] Relecture échouée :",e.message),this._offlineQueue.push(t)}else this._client._logger.warn(`[Offline] Rejetée : token requis manquant (${t.constant})`)}await this._offlineQueueStorage.saveQueue(this._offlineQueue)}async _initOfflineQueue(e){if(!(e&&e instanceof OfflineQueueStorageStrategy))throw new Error("[OfflineClientManager] storageStrategy doit être une instance de OfflineQueueStorageStrategy");this._offlineQueueStorage=e,this._offlineQueue=await e.loadQueue()}}const se=["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],ae=["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],ce=["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],pe=["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],de=["need","offer"],me=["service","competence","material"],le={service:{key:"service",icon:"cogs",label:"Service",subcat:{charity:{key:"charity",label:"Charité",icon:"heart"},education:{key:"education",label:"Aide éducative",icon:"book"},househelp:{key:"househelp",label:"Aide ménagère",icon:"home"},washing:{key:"washing",label:"Lavage",icon:"droplets"},gardening:{key:"gardening",label:"Jardinage",icon:"flower"},farming:{key:"farming",label:"Agriculture",icon:"wheat"},generalmaintenance:{key:"generalmaintenance",label:"Maintenance générale",icon:"wrench"},childrencare:{key:"childrencare",label:"Garde d'enfants",icon:"baby"},ederlycare:{key:"ederlycare",label:"Aide aux personnes âgées",icon:"user"},disabledcare:{key:"disabledcare",label:"Aide aux personnes en situation de handicap",icon:"accessibility"},hostinghelp:{key:"hostinghelp",label:"Aide à l'accueil",icon:"handshake"},animalcare:{key:"animalcare",label:"Soins aux animaux",icon:"paw-print"}}},competence:{key:"competence",icon:"bookmark",label:"Compétence",subcat:{artistic:{key:"artistic",label:"Artistique",icon:"palette"},laws:{key:"laws",label:"Droit",icon:"scale"},itdevlopment:{key:"itdevlopment",label:"Développement informatique",icon:"code"},handcraft:{key:"handcraft",label:"Artisanat",icon:"scissors"},animalcare:{key:"animalcare",label:"Soins aux animaux",icon:"paw-print"},agriculture:{key:"agriculture",label:"Agriculture",icon:"wheat"},restauration:{key:"restauration",label:"Restauration",icon:"utensils"},building:{key:"building",label:"Construction",icon:"hard-hat"}}},material:{key:"material",icon:"wrench",label:"Matériel",subcat:{electronic:{key:"electronic",label:"Électronique",icon:"cpu"},furniture:{key:"furniture",label:"Mobilier",icon:"armchair"},primaryressources:{key:"primaryressources",label:"Ressources primaires",icon:"leaf"},buildingtools:{key:"buildingtools",label:"Outils de construction",icon:"hammer"},gardeningtools:{key:"gardeningtools",label:"Outils de jardinage",icon:"shovel"},medicalstuff:{key:"medicalstuff",label:"Matériel médical",icon:"stethoscope"}}}},ue=["todo","done","tracking","discuter","next","totest","disabled","closed"],he={ApiClient:ApiClient,Api:Api,error:h,reactive:B,effect:D,batch:k,isSignal:L,reactiveObject:M,isReactive:R,computed:q,watch:U,getSignals:F,subscribeTo:$,tokenStorageStrategy:{createDefaultTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new MemoryStorageStrategy;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new LocalStorageStrategy;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileStorageStrategy:e}=await Promise.resolve().then(function(){return ge});return new e}if("undefined"!=typeof window&&window.localStorage)return new LocalStorageStrategy;const{FileStorageStrategy:t}=await Promise.resolve().then(function(){return ge});return new t},TokenStorageStrategy:TokenStorageStrategy,createDefaultMultiServerTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new MultiServerMemoryStorageStrategy;if("localStorage"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)return new MultiServerLocalStorageStrategy;throw new Error("localStorage n'est pas disponible dans cet environnement.")}if("file"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)throw new Error("Le stockage fichier n'est pas disponible côté navigateur.");const{MultiServerFileStorageStrategy:e}=await Promise.resolve().then(function(){return fe});return new e}if("undefined"!=typeof window&&void 0!==window.localStorage)return new MultiServerLocalStorageStrategy;const{MultiServerFileStorageStrategy:t}=await Promise.resolve().then(function(){return fe});return new t},MultiServerTokenStorageStrategy:MultiServerTokenStorageStrategy},helper:{fromEntityJSON:w,reviveEntities:function e(t,n=null){if(null==t)return t;if("object"!=typeof t)return t;if(t instanceof Date||t instanceof RegExp)return t;if(g(t))return w(t,n);if(Array.isArray(t))return t.map(t=>e(t,n));const o={};for(const[r,i]of Object.entries(t))o[r]=e(i,n);return o},restorePaginationFromJSON:BaseEntity.restorePaginationFromJSON},OfflineClientManager:OfflineClientManager};var ye=Object.freeze({__proto__:null,bufferToReadable:async function(e){const{Readable:t}=await import("stream");return t.from(e)},createPassThrough:async function(){const{PassThrough:e}=await import("stream");return new e}});var fe=Object.freeze({__proto__:null,MultiServerFileStorageStrategy:class MultiServerFileStorageStrategy extends MultiServerTokenStorageStrategy{filePath;constructor(e="tokens.json",t=u.join(l.homedir(),".config","cocolight")){super(),this.filePath=u.join(t,e),m.existsSync(t)||m.mkdirSync(t,{recursive:!0})}_readFile(){if(!m.existsSync(this.filePath))return{};try{return JSON.parse(m.readFileSync(this.filePath,"utf8"))}catch{return{}}}_writeFile(e){m.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}getAccessToken(){const e=this._requireBaseURL();return this._readFile()[e]?.accessToken??null}setAccessToken(e){const t=this._requireBaseURL(),n=this._readFile();n[t]={...n[t]||{},accessToken:e},this._writeFile(n)}getRefreshToken(){const e=this._requireBaseURL();return this._readFile()[e]?.refreshToken??null}setRefreshToken(e){const t=this._requireBaseURL(),n=this._readFile();n[t]={...n[t]||{},refreshToken:e},this._writeFile(n)}clear(){const e=this._requireBaseURL(),t=this._readFile();delete t[e],this._writeFile(t)}getServers(){return Object.keys(this._readFile())}exportAll(){return this._readFile()}}});var ge=Object.freeze({__proto__:null,FileStorageStrategy:class FileStorageStrategy extends TokenStorageStrategy{dir;filePath;constructor(e="tokens.json",t=u.join(l.homedir(),".config","cocolight")){super(),this.dir=t,this.filePath=u.join(t,e),this._ensureDirectoryExists()}_ensureDirectoryExists(){m.existsSync(this.dir)||m.mkdirSync(this.dir,{recursive:!0})}_readFile(){if(!m.existsSync(this.filePath))return{};try{return JSON.parse(m.readFileSync(this.filePath,"utf8"))}catch(e){return console.error("Error reading token file:",e),{}}}_writeFile(e){m.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}getAccessToken(){return this._readFile().accessToken||null}setAccessToken(e){const t=this._readFile();t.accessToken=e,this._writeFile(t)}getRefreshToken(){return this._readFile().refreshToken||null}setRefreshToken(e){const t=this._readFile();t.refreshToken=e,this._writeFile(t)}clear(){this._writeFile({})}}});var we=Object.freeze({__proto__:null,FileOfflineStorage:class FileOfflineStorage extends OfflineQueueStorageStrategy{dir;filePath;constructor(e="offline-queue.json",t=u.join(l.homedir(),".config","cocolight")){super(),this.dir=t,this.filePath=u.join(t,e),this._ensureDirectoryExists()}_ensureDirectoryExists(){m.existsSync(this.dir)||m.mkdirSync(this.dir,{recursive:!0})}_readFile(){if(!m.existsSync(this.filePath))return[];try{return JSON.parse(m.readFileSync(this.filePath,"utf8"))}catch(e){return console.error("Erreur lecture offline queue :",e),[]}}_writeFile(e){try{m.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}catch(e){console.warn("[OfflineQueue] Erreur d'écriture:",e)}}async loadQueue(){return this._readFile()}async saveQueue(e){this._writeFile(e)}}});export{ue as ACTION_STATUSES,me as CLASSIFIED_CATEGORIES,de as CLASSIFIED_SECTIONS,le as CLASSIFIED_SUBCATEGORIES,ce as EVENT_TYPES,se as ORGANIZATION_TYPES,pe as POI_TYPES,ae as PROJECT_AVANCEMENTS,G as UPDATE_PATH_MAGIC,k as batch,q as computed,he as default,D as effect,F as getSignals,R as isReactive,L as isSignal,M as reactive,$ as subscribeTo,U as watch};
|
|
1
|
+
import e from"bson-objectid";import*as t from"file-type";import*as n from"ajv";import*as i from"ajv-formats";import*as r from"ejson";import*as o from"pino";import{EventEmitter as a}from"events";import{AggregateAjvError as s}from"@segment/ajv-human-errors";import p from"axios";import c from"axios-retry";import{jwtDecode as l}from"jwt-decode";import*as m from"fs";import*as d from"os";import*as u from"path";class ApiError extends Error{name="ApiError";status;details;constructor(e,t,n){super(e),this.status=t,this.details=n}}class ApiClientError extends ApiError{name="ApiClientError";constructor(e,t,n){super(e,t,n)}}class ApiValidationError extends Error{name="ApiValidationError";status;messages;details;constructor(e,t,n,i=null){super(e),this.status=t,this.messages=n,this.details=i}}class CircuitBreakerError extends ApiError{name="CircuitBreakerError";constructor(e){super(e,503)}}class ApiResponseError extends Error{name="ApiResponseError";status;responseData;details;constructor(e,t,n,i=null){super(e),this.status=t,this.responseData=n,this.details=i}}class ApiAuthenticationError extends ApiError{name="ApiAuthenticationError";constructor(e,t,n){super(e,t,n)}}var y=Object.freeze({__proto__:null,ApiAuthenticationError:ApiAuthenticationError,ApiClientError:ApiClientError,ApiError:ApiError,ApiResponseError:ApiResponseError,ApiValidationError:ApiValidationError,CircuitBreakerError:CircuitBreakerError});const h=new Map;function f(e,t){h.set(e,t)}function g(e){return!!e&&"object"==typeof e&&"__entityTag"in e}function b(e,t=null){if(!g(e))return e;let n=t;const i=e;if(i.parent&&"object"==typeof i.parent){const e=i.parent,r=e.serverData?.id||e.id;if(t&&"id"in t&&t.id===r)n=t;else{const e=b(i.parent,t);e&&"object"==typeof e&&"id"in e&&(n=e)}}let r=e.serverData?.collection;if(r||(r={User:"citoyens",Organization:"organizations",Project:"projects",Event:"events",Poi:"poi",News:"news",Badge:"badges",Comment:"comments",Answer:"answers",Form:"forms",Classified:"classifieds",Action:"actions"}[e.__entityTag]||null),!r)return e;const o=function(e,t){const n=h.get(t),i=t,r={EndpointApi:h.get("EndpointApi"),User:"User"===i?n:h.get("User"),Organization:"Organization"===i?n:h.get("Organization"),Project:"Project"===i?n:h.get("Project"),Event:"Event"===i?n:h.get("Event"),Poi:"Poi"===i?n:h.get("Poi"),Badge:"Badge"===i?n:h.get("Badge"),News:"News"===i?n:h.get("News"),Comment:"Comment"===i?n:h.get("Comment"),Answer:"Answer"===i?n:h.get("Answer"),Form:"Form"===i?n:h.get("Form"),Classified:"Classified"===i?n:h.get("Classified"),Action:"Action"===i?n:h.get("Action")};return{citoyens:{entityClass:r.User,deps:r},organizations:{entityClass:r.Organization,deps:r},projects:{entityClass:r.Project,deps:r},events:{entityClass:r.Event,deps:{...r,Badge:void 0}},poi:{entityClass:r.Poi,deps:{...r,Badge:void 0,News:void 0,Comment:void 0}},news:{entityClass:r.News,deps:{...r}},badges:{entityClass:r.Badge,deps:{EndpointApi:r.EndpointApi,User:r.User,Organization:r.Organization,Project:r.Project}},comments:{entityClass:r.Comment,deps:{...r}},answers:{entityClass:r.Answer,deps:{...r}},forms:{entityClass:r.Form,deps:{...r}},classifieds:{entityClass:r.Classified,deps:{...r,Badge:void 0,News:void 0}},actions:{entityClass:r.Action,deps:{...r}}}[e]||null}(r,e.__entityTag);if(!o)return e;if(!o.entityClass?.fromJSON)throw new Error(`Classe inconnue ou fromJSON manquant pour ${e.__entityTag}`);return o.entityClass.fromJSON(e,n,o.deps)}function _(e,t=null,n={}){const i={citoyens:{entityTag:"User",meta:e=>w(e,{remove:[]})},organizations:{entityTag:"Organization",meta:e=>w(e,{remove:[]})},projects:{entityTag:"Project",meta:e=>w(e,{remove:[]})},events:{entityTag:"Event",meta:e=>w(e,{remove:["Badge"]})},poi:{entityTag:"Poi",meta:e=>w(e,{remove:["Badge","News","Comments"]})},news:{entityTag:"News",meta:e=>w(e,{remove:[]})},badges:{entityTag:"Badge",meta:()=>function(e){const t=h.get(e),n={EndpointApi:h.get("EndpointApi"),User:h.get("User"),Organization:h.get("Organization"),Project:h.get("Project")};return n[e]=t,{entityClass:t,deps:n}}("Badge")},comments:{entityTag:"Comment",meta:e=>w(e,{remove:[]})},answers:{entityTag:"Answer",meta:e=>w(e,{remove:[]})},forms:{entityTag:"Form",meta:e=>w(e,{remove:[]})},classifieds:{entityTag:"Classified",meta:e=>w(e,{remove:["Badge","News"]})},actions:{entityTag:"Action",meta:e=>w(e,{remove:[]})}},r=i[e];if(!r)return console.warn(`Collection inconnue : '${e}'`),null;const{entityTag:o,meta:a}=r,{entityClass:s,deps:p}=a(o);if(!s)throw new Error(`EntityClass introuvable pour ${o}`);return new s(t,n,p)}function w(e,t){const n=h.get(e),i={EndpointApi:h.get("EndpointApi"),User:h.get("User"),Organization:h.get("Organization"),Project:h.get("Project"),Event:h.get("Event"),Poi:h.get("Poi"),Badge:h.get("Badge"),News:h.get("News"),Comment:h.get("Comment"),Answer:h.get("Answer"),Form:h.get("Form"),Classified:h.get("Classified"),Action:h.get("Action")};return i[e]=n,t.remove.forEach(e=>delete i[e]),{entityClass:n,deps:i}}const A={CercleTravailleursSociauxLiberauxLaPlumeSociale:{costumId:"654b57d6e5ff8d40a74236eb",costumType:"organizations",host:null,engine:"costumize"},FabEn:{costumId:"5ff81a71cf7b6a192f8b4568",costumType:"organizations",host:null,engine:"FabEn"},LivingLabInnovationSocialeBraspanon:{costumId:"61402f6234bdec718b4f08fd",costumType:"projects",host:null,engine:"filiereGenerique"},alfph:{costumId:"5e393f976908646b468b474f",costumType:"organizations",host:null,engine:"alfph"},campagne:{costumId:"5c7693db40bb4e885394dbfe",costumType:"projects",host:null,engine:"campagne"},chtitube:{costumId:"5d82012240bb4eca7b496a74",costumType:"projects",host:"www.chtitube.fr",engine:"chtitube"},circuitCourt:{costumId:"5e05b30d6908649d7f8b4569",costumType:"organizations",host:"www.circuitcourt.re",engine:"circuitCourt"},cmcasHauteBretagne:{costumId:"5eaade8f6908649b558b4988",costumType:"organizations",host:"co.cmcashb.fr",engine:"cmcasHauteBretagne"},coFinancementTierslieux:{costumId:"60ed7725f8baa73a0b113a22",costumType:"organizations",host:"adopteuncommun.communecter.org",engine:"coFinancement"},coeurNumerique:{costumId:"5dce3496690864e5758b45d9",costumType:"organizations",host:null,engine:"coeurNumerique"},communLundi:{costumId:"636bae7be225a20c3754ea48",costumType:"events",host:"communlundi.tiers-lieux.org",engine:"coevent"},cressReunion:{costumId:"5add6e1240bb4eeb16987218",costumType:"organizations",host:"www.aress-reunion.re",engine:"filiereGenerique"},cressReunionNetwork:{costumId:"6151663ad77b6e383124f413",costumType:"organizations",host:"www.aress-reunion.re",engine:"filiereGenerique"},ctenat:{costumId:"5ca1b2bb40bb4e9352ba351b",costumType:"organizations",host:"territoires-en-transition.ecologie.gouv.fr",engine:"ctenat"},cyberReunion:{costumId:"695b58ca8693fc2c121208e4",costumType:"organizations",host:null,engine:"costumize"},ekisphere:{costumId:"651e46541a70083900557c09",costumType:"organizations",host:null,engine:"costumize"},equipementsSportifs974:{costumId:"6a04155ed047177b92399685",costumType:"organizations",host:null,engine:"costumize"},federationDesCae:{costumId:"677e7e13bd08b2478f5f5314",costumType:"organizations",host:"communs.les-cae.coop",engine:"costumize"},formationGenerique:{costumId:"68184de2ad1e8a5cae19e023",costumType:"organizations",host:null,engine:"templateFormation"},franceTierslieux:{costumId:"5ec3b895690864db108b46b8",costumType:"organizations",host:"cartographie.francetierslieux.fr",engine:"franceTierslieux"},hinaura:{costumId:"5e578751690864b3338b45f9",costumType:"organizations",host:null,engine:"mednumRhoneAlpe"},hubmayotte:{costumId:"5e5788bd69086435328b4664",costumType:"organizations",host:null,engine:"hubTerritoires"},hubnouvellecaledonie:{costumId:"5e57894d6908643a328b469f",costumType:"organizations",host:null,engine:"hubTerritoires"},hubpolynesiefrancaise:{costumId:"5e5788fc6908646a478b4590",costumType:"organizations",host:null,engine:"hubTerritoires"},hubreunion:{costumId:"5e57887269086497338b46b8",costumType:"organizations",host:null,engine:"hubTerritoires"},hubterritoires:{costumId:"5e5787c56908643a328b4628",costumType:"organizations",host:null,engine:"hubTerritoires"},hubwallisetfutuna:{costumId:"5e57897169086497338b470b",costumType:"organizations",host:null,engine:"hubTerritoires"},hva:{costumId:"5b713de540bb4eb87a808363",costumType:"organizations",host:"www.portailhva.org",engine:"hva"},ibv2:{costumId:"69a66a6bff55d4489e6f2c6e",costumType:"organizations",host:null,engine:"costumize"},institutBleu:{costumId:"66f2adcfba41c614b86c0af8",costumType:"organizations",host:"annuaire.institutbleu.re",engine:"costumize"},journalInsoumisChambery:{costumId:"5c8102ac40bb4e1c6c4601c8",costumType:"organizations",host:"www.journal-insoumis-chambery.com",engine:"journalInsoumisChambery"},kpacite:{costumId:"60365ebb690864c1688b4587",costumType:"organizations",host:"observatoire.kpacite.fr",engine:"reseauTierslieux"},laCompagnieDesTierslieux:{costumId:"5d36ad9340bb4ea9625e0915",costumType:"organizations",host:"plateforme-cie.tiers-lieux.org",engine:"reseauTierslieux"},laMaisonDesFaiseurs:{costumId:"5cc30df140bb4e83202179cd",costumType:"organizations",host:null,engine:"laRaffinerie3"},laReunionPourUnNumeriqueInclusif:{costumId:"5f9991e2690864d64f8b4666",costumType:"organizations",host:"reunion.ultranumerique.fr",engine:"hubTerritoires"},laSemaineDesTierslieux:{costumId:"634fe57321f16458d240adc3",costumType:"events",host:"lasemaine.tierslieux.re",engine:"costumize"},labEnCommuns:{costumId:"607ecf90690864c2578b45bc",costumType:"organizations",host:null,engine:"labEnCommuns"},lakou:{costumId:"66605dff37cbe5791b506ebf",costumType:"organizations",host:null,engine:"costumize"},lesCommunsDesTierslieux:{costumId:"615724525a88061a684d4916",costumType:"organizations",host:"lescommuns.tiers-lieux.org",engine:"costumize"},mayottePourUnNumeriqueInclusif:{costumId:"5f9fb3f1690864041c8b4b1c",costumType:"organizations",host:"mayotte.ultranumerique.fr",engine:"hubTerritoires"},meir:{costumId:"614a134c3bf54a64bf3ed23e",costumType:"projects",host:null,engine:"meir"},navigatorDesTierslieux:{costumId:"649ed498f93ee7202e6c8b12",costumType:"projects",host:"www.tiers-lieux.org",engine:"costumize"},notragora:{costumId:"5b99efbc40bb4eaf50e2067c",costumType:"projects",host:null,engine:"notragora"},nouvellecaledoniePourUnNumeriqueInclusif:{costumId:"5f9fbd156908648a6d8b4675",costumType:"organizations",host:"nouvellecaledonie.ultranumerique.fr",engine:"hubTerritoires"},openAtlas:{costumId:"555eba56c655675cdd65bf19",costumType:"organizations",host:"www.open-atlas.org",engine:"OpenAtlas"},polynesieFrancaisePourUnNumeriqueInclusif:{costumId:"5f9fbc4c6908648a6d8b4607",costumType:"organizations",host:"polynesiefrancaise.ultranumerique.fr",engine:"hubTerritoires"},prdr:{costumId:"5e25910c690864233b8b4671",costumType:"organizations",host:null,engine:"filiereGenerique"},reseauTierslieux:{costumId:"61960c990365ed3a8402341f",costumType:"organizations",host:null,engine:"reseauTierslieux"},rfflabs:{costumId:"61f3eba10870e2287b71c2fe",costumType:"organizations",host:"carto.rfflabs.fr",engine:"reseauTierslieux"},ries:{costumId:"60b879df690864d6438b4581",costumType:"projects",host:"www.oest.it",engine:"filiereGenerique"},siteDuPactePourLaTransition:{costumId:"5ca8650240bb4e13267b23c7",costumType:"projects",host:"www.pacte-transition.org",engine:"siteDuPactePourLaTransition"},sportSanteBienetre:{costumId:"682b2ac5e05a1d45844340e7",costumType:"organizations",host:null,engine:"costumize"},suppa:{costumId:"6442b67553f10671d16d3879",costumType:"organizations",host:null,engine:"costumize"},terramies:{costumId:"5e33da2a6908644c5f8b4829",costumType:"organizations",host:"www.terramies.fr",engine:"terramies"},testeTplFormation:{costumId:"6819e960f7765e69ee49d748",costumType:"organizations",host:null,engine:"templateFormation"},tierslieuxbelgique:{costumId:"66fa6c01f8b5267b59215dc9",costumType:"organizations",host:"www.tierslieux.xyz",engine:"costumize"},tierslieuxorg1:{costumId:"682f0e563567ec1a4c3194b8",costumType:"organizations",host:null,engine:"templateFormation"},transiter:{costumId:"65df30c185682029fd7e42bf",costumType:"organizations",host:"www.transiter.re",engine:"costumize"},vhelioPeiTour2025:{costumId:"67adabf89f10500a3c1872d6",costumType:"projects",host:null,engine:"costumize"},wallisetfutunaPourUnNumeriqueInclusif:{costumId:"5f9fbaa9690864dc4c8b4933",costumType:"organizations",host:"wallisetfutuna.ultranumerique.fr",engine:"hubTerritoires"}},T={CercleTravailleursSociauxLiberauxLaPlumeSociale:()=>Promise.resolve().then(function(){return Pe}),FabEn:()=>Promise.resolve().then(function(){return ve}),LivingLabInnovationSocialeBraspanon:()=>Promise.resolve().then(function(){return Ce}),alfph:()=>Promise.resolve().then(function(){return Se}),campagne:()=>Promise.resolve().then(function(){return je}),chtitube:()=>Promise.resolve().then(function(){return Oe}),circuitCourt:()=>Promise.resolve().then(function(){return Ie}),cmcasHauteBretagne:()=>Promise.resolve().then(function(){return Le}),coFinancementTierslieux:()=>Promise.resolve().then(function(){return De}),coeurNumerique:()=>Promise.resolve().then(function(){return xe}),communLundi:()=>Promise.resolve().then(function(){return ke}),cressReunion:()=>Promise.resolve().then(function(){return Me}),cressReunionNetwork:()=>Promise.resolve().then(function(){return Ne}),ctenat:()=>Promise.resolve().then(function(){return qe}),cyberReunion:()=>Promise.resolve().then(function(){return Re}),ekisphere:()=>Promise.resolve().then(function(){return ze}),equipementsSportifs974:()=>Promise.resolve().then(function(){return Fe}),federationDesCae:()=>Promise.resolve().then(function(){return Ue}),formationGenerique:()=>Promise.resolve().then(function(){return Be}),franceTierslieux:()=>Promise.resolve().then(function(){return $e}),hinaura:()=>Promise.resolve().then(function(){return Ve}),hubmayotte:()=>Promise.resolve().then(function(){return Ge}),hubnouvellecaledonie:()=>Promise.resolve().then(function(){return Ke}),hubpolynesiefrancaise:()=>Promise.resolve().then(function(){return He}),hubreunion:()=>Promise.resolve().then(function(){return Je}),hubterritoires:()=>Promise.resolve().then(function(){return We}),hubwallisetfutuna:()=>Promise.resolve().then(function(){return Ze}),hva:()=>Promise.resolve().then(function(){return Qe}),ibv2:()=>Promise.resolve().then(function(){return Ye}),institutBleu:()=>Promise.resolve().then(function(){return Xe}),journalInsoumisChambery:()=>Promise.resolve().then(function(){return et}),kpacite:()=>Promise.resolve().then(function(){return tt}),laCompagnieDesTierslieux:()=>Promise.resolve().then(function(){return nt}),laMaisonDesFaiseurs:()=>Promise.resolve().then(function(){return it}),laReunionPourUnNumeriqueInclusif:()=>Promise.resolve().then(function(){return rt}),laSemaineDesTierslieux:()=>Promise.resolve().then(function(){return ot}),labEnCommuns:()=>Promise.resolve().then(function(){return at}),lakou:()=>Promise.resolve().then(function(){return st}),lesCommunsDesTierslieux:()=>Promise.resolve().then(function(){return pt}),mayottePourUnNumeriqueInclusif:()=>Promise.resolve().then(function(){return ct}),meir:()=>Promise.resolve().then(function(){return lt}),navigatorDesTierslieux:()=>Promise.resolve().then(function(){return mt}),notragora:()=>Promise.resolve().then(function(){return dt}),nouvellecaledoniePourUnNumeriqueInclusif:()=>Promise.resolve().then(function(){return ut}),openAtlas:()=>Promise.resolve().then(function(){return yt}),polynesieFrancaisePourUnNumeriqueInclusif:()=>Promise.resolve().then(function(){return ht}),prdr:()=>Promise.resolve().then(function(){return ft}),reseauTierslieux:()=>Promise.resolve().then(function(){return gt}),rfflabs:()=>Promise.resolve().then(function(){return bt}),ries:()=>Promise.resolve().then(function(){return _t}),siteDuPactePourLaTransition:()=>Promise.resolve().then(function(){return wt}),sportSanteBienetre:()=>Promise.resolve().then(function(){return At}),suppa:()=>Promise.resolve().then(function(){return Tt}),terramies:()=>Promise.resolve().then(function(){return Et}),testeTplFormation:()=>Promise.resolve().then(function(){return Pt}),tierslieuxbelgique:()=>Promise.resolve().then(function(){return vt}),tierslieuxorg1:()=>Promise.resolve().then(function(){return Ct}),transiter:()=>Promise.resolve().then(function(){return St}),vhelioPeiTour2025:()=>Promise.resolve().then(function(){return jt}),wallisetfutunaPourUnNumeriqueInclusif:()=>Promise.resolve().then(function(){return Ot})},E={CercleTravailleursSociauxLiberauxLaPlumeSociale:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},info:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality"},{name:"info",path:"info"}],presets:{type:"LocalBusiness",role:"admin","preferences[isOpenEdition]":!1,"preferences[isOpenData]":!1},hidden:["role","shortDescription","tags","type"]}},FabEn:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"theme",path:"theme"}],presets:{},hidden:[]}},LivingLabInnovationSocialeBraspanon:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"theme",path:"theme"}],presets:{},hidden:[]}},alfph:{projects:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"formLocality",path:"formLocality"},{name:"theme",path:"theme"}],presets:{},hidden:[]},ressources:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality"}],presets:{section:"need",category:"service"},hidden:[]}},campagne:{proposal:{schema:{type:"object",additionalProperties:!0,properties:{devis:{type:"string"},estimationTime:{type:"string"}}},fields:[{name:"devis",path:"devis"},{name:"estimationTime",path:"estimationTime"}],presets:{tags:"nouvelle idée,co,communecter",voteDateEnd:"31/12/2019 23:59",voteAnonymous:!1,voteCanChange:!0,majority:50,amendementAndVote:!1,amendementActivated:!1,multiChoicecheckboxSimple:!1},hidden:[]}},chtitube:{poi:{schema:{type:"object",additionalProperties:!0,properties:{sectionBtn:{type:"string"}}},fields:[{name:"sectionBtn",path:"sectionBtn"}],presets:{},hidden:["parent"]}},circuitCourt:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{phone:{type:"number"}}},fields:[{name:"phone",path:"phone"}],presets:{},hidden:[]}},cmcasHauteBretagne:{events:{schema:{type:"object",additionalProperties:!0,properties:{phone:{type:"string"}}},fields:[{name:"phone",path:"phone"}],presets:{},hidden:["parent"]}},coFinancementTierslieux:{crowdfunding:{schema:{type:"object",additionalProperties:!0,properties:{donationLink:{type:"string"},invoiceAddress:{type:"string"},invoiceName:{type:"string"},invoiceSiret:{type:"string"},linkToCommon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},orgaName:{type:"string"},priority:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},similarLink:{type:"string"}}},fields:[{name:"donationLink",path:"donationLink"},{name:"invoiceAddress",path:"invoiceAddress"},{name:"invoiceName",path:"invoiceName"},{name:"invoiceSiret",path:"invoiceSiret"},{name:"linkToCommon",path:"linkToCommon"},{name:"orgaName",path:"orgaName"},{name:"priority",path:"priority"},{name:"similarLink",path:"similarLink"}],presets:{type:"campaign"},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{"preferences[crowdfunding]":{type:"string"}}},fields:[{name:"preferences[crowdfunding]",path:"preferences[crowdfunding]"}],presets:{},hidden:[]}},coeurNumerique:{badges:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"object",additionalProperties:!0}}},fields:[{name:"info",path:"info"}],presets:{tags:{value:"",forced:!0}},hidden:["color","icon","tags"]}},communLundi:{events:{schema:{type:"object",additionalProperties:!0,properties:{animator:{type:"object",additionalProperties:!0},common:{type:"object",additionalProperties:!0},documentation:{type:"string"},pattern:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"animator",path:"animator"},{name:"common",path:"common"},{name:"documentation",path:"documentation"},{name:"pattern",path:"pattern"}],presets:{},hidden:["parent","public","recurrency","tags"]}},cressReunion:{events:{schema:{type:"object",additionalProperties:!0,properties:{expectedAttendees:{type:"number"},format:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},isPaying:{type:"boolean"},lowMobilityAccess:{type:"boolean"},mailReminder:{type:"array",items:{type:"string"}},monthEss:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},registrationRequired:{type:"boolean"},tergetPublic:{type:"array",items:{type:"string"}},thematicWeek:{type:"string"},theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"expectedAttendees",path:"expectedAttendees"},{name:"format",path:"format"},{name:"isPaying",path:"isPaying"},{name:"lowMobilityAccess",path:"lowMobilityAccess"},{name:"mailReminder",path:"mailReminder"},{name:"monthEss",path:"monthEss"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"},{name:"registrationRequired",path:"registrationRequired"},{name:"tergetPublic",path:"tergetPublic"},{name:"thematicWeek",path:"thematicWeek"},{name:"theme",path:"theme"}],presets:{},hidden:[]},organizations:{schema:{type:"object",additionalProperties:!0,properties:{ambassadeurFirstName:{type:"string"},ambassadeurFonction:{type:"string"},ambassadeurMail:{type:"string"},ambassadeurName:{type:"string"},ambassadeurTel:{type:"number"},apet700:{type:"string"},arrondissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},famille:{type:"string"},interco:{type:"string"},"preferences[isOpenEdition]":{type:"string"},secteurEntreprise:{type:"string"},secteurEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},typeEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},waldec:{type:"string"}}},fields:[{name:"ambassadeurFirstName",path:"ambassadeurFirstName"},{name:"ambassadeurFonction",path:"ambassadeurFonction"},{name:"ambassadeurMail",path:"ambassadeurMail"},{name:"ambassadeurName",path:"ambassadeurName"},{name:"ambassadeurTel",path:"ambassadeurTel"},{name:"apet700",path:"apet700"},{name:"arrondissement",path:"arrondissement"},{name:"famille",path:"famille"},{name:"interco",path:"interco"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"},{name:"secteurEntreprise",path:"secteurEntreprise"},{name:"secteurEtablissement",path:"secteurEtablissement"},{name:"typeEtablissement",path:"typeEtablissement"},{name:"waldec",path:"waldec"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{domain:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},ifPaye:{type:"string"},paye:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},referentName:{type:"string"},referentPhone:{type:"number"},yourAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},zoneActivity:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"domain",path:"domain"},{name:"ifPaye",path:"ifPaye"},{name:"paye",path:"paye"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"},{name:"referentName",path:"referentName"},{name:"referentPhone",path:"referentPhone"},{name:"yourAction",path:"yourAction"},{name:"zoneActivity",path:"zoneActivity"}],presets:{},hidden:[]}},cressReunionNetwork:{events:{schema:{type:"object",additionalProperties:!0,properties:{format:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},monthEss:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"format",path:"format"},{name:"monthEss",path:"monthEss"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"},{name:"theme",path:"theme"}],presets:{},hidden:[]},organizations:{schema:{type:"object",additionalProperties:!0,properties:{ambassadeurFirstName:{type:"string"},ambassadeurFonction:{type:"string"},ambassadeurMail:{type:"string"},ambassadeurName:{type:"string"},ambassadeurTel:{type:"number"},apet700:{type:"string"},arrondissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},famille:{type:"string"},interco:{type:"string"},"preferences[isOpenEdition]":{type:"string"},secteurEntreprise:{type:"string"},secteurEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},typeEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},waldec:{type:"string"}}},fields:[{name:"ambassadeurFirstName",path:"ambassadeurFirstName"},{name:"ambassadeurFonction",path:"ambassadeurFonction"},{name:"ambassadeurMail",path:"ambassadeurMail"},{name:"ambassadeurName",path:"ambassadeurName"},{name:"ambassadeurTel",path:"ambassadeurTel"},{name:"apet700",path:"apet700"},{name:"arrondissement",path:"arrondissement"},{name:"famille",path:"famille"},{name:"interco",path:"interco"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"},{name:"secteurEntreprise",path:"secteurEntreprise"},{name:"secteurEtablissement",path:"secteurEtablissement"},{name:"typeEtablissement",path:"typeEtablissement"},{name:"waldec",path:"waldec"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{domain:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},ifPaye:{type:"string"},paye:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},referentName:{type:"string"},referentPhone:{type:"number"},yourAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},zoneActivity:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"domain",path:"domain"},{name:"ifPaye",path:"ifPaye"},{name:"paye",path:"paye"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"},{name:"referentName",path:"referentName"},{name:"referentPhone",path:"referentPhone"},{name:"yourAction",path:"yourAction"},{name:"zoneActivity",path:"zoneActivity"}],presets:{},hidden:[]}},ctenat:{addPhoto:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"string"}}},fields:[{name:"info",path:"info"}],presets:{},hidden:[]},badges:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"object",additionalProperties:!0}}},fields:[{name:"info",path:"info"}],presets:{tags:{value:"",forced:!0}},hidden:["color","icon","tags"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{definition:{type:"string"},domainAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},echelleApplication:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},methodeCalcul:{type:"string"},moyenne_nationale:{type:"string"},obj_environnemental:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},obj_operationnel_national:{type:"string"},obj_strategique:{type:"string"},objectifDD:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},originIndicator:{type:"string"},pol_pub:{type:"string"},sourceData1:{type:"string"},typectenat:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},unity1:{type:"string"}}},fields:[{name:"definition",path:"definition"},{name:"domainAction",path:"domainAction"},{name:"echelleApplication",path:"echelleApplication"},{name:"methodeCalcul",path:"methodeCalcul"},{name:"moyenne_nationale",path:"moyenne_nationale"},{name:"obj_environnemental",path:"obj_environnemental"},{name:"obj_operationnel_national",path:"obj_operationnel_national"},{name:"obj_strategique",path:"obj_strategique"},{name:"objectifDD",path:"objectifDD"},{name:"originIndicator",path:"originIndicator"},{name:"pol_pub",path:"pol_pub"},{name:"sourceData1",path:"sourceData1"},{name:"typectenat",path:"typectenat"},{name:"unity1",path:"unity1"}],presets:{type:"stand"},hidden:["description","name","parent","tags","urls"]},projects:{schema:{type:"object",additionalProperties:!0,properties:{dispositif:{type:"string"},dispositifId:{type:"string"},filRouge:{type:"string"},formLocality:{type:"string"},nbHabitant:{type:"number"},session:{type:"string"},why:{type:"string"}}},fields:[{name:"dispositif",path:"dispositif"},{name:"dispositifId",path:"dispositifId"},{name:"filRouge",path:"filRouge"},{name:"formLocality",path:"formLocality"},{name:"nbHabitant",path:"nbHabitant"},{name:"session",path:"session"},{name:"why",path:"why"}],presets:{public:!1,"preferences[isOpenEdition]":!1},hidden:["parent","public","shortDescription","tags","url"]}},cyberReunion:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality"}],presets:{},hidden:["role","shortDescription","tags","type","url"]}},ekisphere:{events:{schema:{type:"object",additionalProperties:!0,properties:{place:{type:"string"}}},fields:[{name:"place",path:"place"}],presets:{},hidden:[]},organizations:{schema:{type:"object",additionalProperties:!0,properties:{extraActivity:{type:"array",items:{type:"string"}},formLocality:{type:"string"},location:{type:"string"},similarLink:{type:"string"},structure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"extraActivity",path:"extraActivity"},{name:"formLocality",path:"formLocality"},{name:"location",path:"location"},{name:"similarLink",path:"similarLink"},{name:"structure",path:"structure"}],presets:{},hidden:["email","extraActivity","role","shortDescription","tags","type"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{access:{type:"object",additionalProperties:!0},adminEmail:{type:"string"},adminFirstName:{type:"string"},classification:{type:"object",additionalProperties:!0},contentProtectionType:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},contentReusability:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},descriptionSection:{type:"object",additionalProperties:!0},ethicCharte:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},info:{type:"object",additionalProperties:!0},infoGeneral:{type:"object",additionalProperties:!0},isEthicCharte:{type:"boolean"},mainThematic:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},propIntelectuel:{type:"object",additionalProperties:!0},protectionLicenceLink:{type:"string"},toolLevel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},toolType:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"access",path:"access"},{name:"adminEmail",path:"adminEmail"},{name:"adminFirstName",path:"adminFirstName"},{name:"classification",path:"classification"},{name:"contentProtectionType",path:"contentProtectionType"},{name:"contentReusability",path:"contentReusability"},{name:"descriptionSection",path:"descriptionSection"},{name:"ethicCharte",path:"ethicCharte"},{name:"info",path:"info"},{name:"infoGeneral",path:"infoGeneral"},{name:"isEthicCharte",path:"isEthicCharte"},{name:"mainThematic",path:"mainThematic"},{name:"propIntelectuel",path:"propIntelectuel"},{name:"protectionLicenceLink",path:"protectionLicenceLink"},{name:"toolLevel",path:"toolLevel"},{name:"toolType",path:"toolType"}],presets:{type:"tool"},hidden:["parent","type"]}},equipementsSportifs974:{poi:{schema:{type:"object",additionalProperties:!0,properties:{aps_name:{type:"array",items:{type:"string"}},categorie:{type:"string"},equip_acc_libre:{type:"boolean"},equip_douche:{type:"boolean"},equip_eclair:{type:"boolean"},equip_gest_type:{type:"string"},equip_larg:{type:"number"},equip_loc_type:{type:"array",items:{type:"string"}},equip_long:{type:"number"},equip_maj_date:{type:"string","x-format":"date"},equip_nature:{type:"string"},equip_pmr_acc:{type:"boolean"},equip_pmr_chem:{type:"boolean"},equip_pmr_douche:{type:"boolean"},equip_pmr_sanit:{type:"boolean"},equip_pmr_trib:{type:"boolean"},equip_pmr_vest:{type:"boolean"},equip_prop_nom:{type:"string"},equip_prop_type:{type:"string"},equip_pshs_aire:{type:"boolean"},equip_pshs_chem:{type:"boolean"},equip_pshs_sanit:{type:"boolean"},equip_pshs_sign:{type:"boolean"},equip_pshs_trib:{type:"boolean"},equip_pshs_vest:{type:"boolean"},equip_sol:{type:"string"},equip_surf:{type:"number"},equip_type_famille:{type:"string"},equip_type_name:{type:"string"},equip_utilisateur:{type:"array",items:{type:"string"}},inst_acc_handi_bool:{type:"boolean"},inst_acc_handi_type:{type:"string"},inst_date_creation:{type:"string","x-format":"date"},inst_enqu_date:{type:"string","x-format":"date"},inst_nom:{type:"string"},inst_part_bool:{type:"boolean"},inst_part_type:{type:"array",items:{type:"string"}},inst_trans_bool:{type:"boolean"},inst_trans_type:{type:"string"}}},fields:[{name:"aps_name",path:"aps_name"},{name:"categorie",path:"categorie"},{name:"equip_acc_libre",path:"equip_acc_libre"},{name:"equip_douche",path:"equip_douche"},{name:"equip_eclair",path:"equip_eclair"},{name:"equip_gest_type",path:"equip_gest_type"},{name:"equip_larg",path:"equip_larg"},{name:"equip_loc_type",path:"equip_loc_type"},{name:"equip_long",path:"equip_long"},{name:"equip_maj_date",path:"equip_maj_date"},{name:"equip_nature",path:"equip_nature"},{name:"equip_pmr_acc",path:"equip_pmr_acc"},{name:"equip_pmr_chem",path:"equip_pmr_chem"},{name:"equip_pmr_douche",path:"equip_pmr_douche"},{name:"equip_pmr_sanit",path:"equip_pmr_sanit"},{name:"equip_pmr_trib",path:"equip_pmr_trib"},{name:"equip_pmr_vest",path:"equip_pmr_vest"},{name:"equip_prop_nom",path:"equip_prop_nom"},{name:"equip_prop_type",path:"equip_prop_type"},{name:"equip_pshs_aire",path:"equip_pshs_aire"},{name:"equip_pshs_chem",path:"equip_pshs_chem"},{name:"equip_pshs_sanit",path:"equip_pshs_sanit"},{name:"equip_pshs_sign",path:"equip_pshs_sign"},{name:"equip_pshs_trib",path:"equip_pshs_trib"},{name:"equip_pshs_vest",path:"equip_pshs_vest"},{name:"equip_sol",path:"equip_sol"},{name:"equip_surf",path:"equip_surf"},{name:"equip_type_famille",path:"equip_type_famille"},{name:"equip_type_name",path:"equip_type_name"},{name:"equip_utilisateur",path:"equip_utilisateur"},{name:"inst_acc_handi_bool",path:"inst_acc_handi_bool"},{name:"inst_acc_handi_type",path:"inst_acc_handi_type"},{name:"inst_date_creation",path:"inst_date_creation"},{name:"inst_enqu_date",path:"inst_enqu_date"},{name:"inst_nom",path:"inst_nom"},{name:"inst_part_bool",path:"inst_part_bool"},{name:"inst_part_type",path:"inst_part_type"},{name:"inst_trans_bool",path:"inst_trans_bool"},{name:"inst_trans_type",path:"inst_trans_type"}],presets:{},hidden:[]}},federationDesCae:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{extraManageModel:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},mainTag:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"}}},fields:[{name:"extraManageModel",path:"extraManageModel"},{name:"formLocality",path:"formLocality"},{name:"holderOrganization",path:"holderOrganization"},{name:"location",path:"location"},{name:"mainTag",path:"mainTag"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate"},{name:"photo",path:"photo"},{name:"similarLink",path:"similarLink"}],presets:{tags:"CAE",role:"admin"},hidden:["role","tags","type"]}},formationGenerique:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration"},{name:"gatheringDates",path:"gatheringDates"},{name:"reportLink",path:"reportLink"},{name:"visioDate",path:"visioDate"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"]},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation"},{name:"firstName",path:"firstName"},{name:"formLocality",path:"formLocality"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence"},{name:"documentation",path:"documentation"},{name:"partner",path:"partner"},{name:"rate",path:"rate"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"]}},franceTierslieux:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},compagnon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea"},{name:"compagnon",path:"compagnon"},{name:"extraManageModel",path:"extraManageModel"},{name:"extraTypePlace",path:"extraTypePlace"},{name:"formLocality",path:"formLocality"},{name:"holderOrganization",path:"holderOrganization"},{name:"location",path:"location"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate"},{name:"photo",path:"photo"},{name:"similarLink",path:"similarLink"},{name:"siteSurfaceArea",path:"siteSurfaceArea"},{name:"typePlace",path:"typePlace"}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"]}},hinaura:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{accessibilite:{type:"boolean"},beneficiaire:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},coeffone:{type:"string"},coeffthree:{type:"string"},coefftwo:{type:"string"}}},fields:[{name:"accessibilite",path:"accessibilite"},{name:"beneficiaire",path:"beneficiaire"},{name:"coeffone",path:"coeffone"},{name:"coeffthree",path:"coeffthree"},{name:"coefftwo",path:"coefftwo"}],presets:{},hidden:[]}},hubmayotte:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},hubnouvellecaledonie:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},hubpolynesiefrancaise:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},hubreunion:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},hubterritoires:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},hubwallisetfutuna:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},hva:{events:{schema:{type:"object",additionalProperties:!0,properties:{"preferences[isOpenEdition]":{type:"string"}}},fields:[{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"}],presets:{type:"others"},hidden:["parent","public","type"]},organizations:{schema:{type:"object",additionalProperties:!0,properties:{"preferences[isOpenEdition]":{type:"string"}}},fields:[{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]"}],presets:{},hidden:[]}},ibv2:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality"},{name:"infoGeneral",path:"infoGeneral"},{name:"location",path:"location"},{name:"sextionInfo",path:"sextionInfo"},{name:"similarLink",path:"similarLink"}],presets:{},hidden:["role","shortDescription","type","url"]}},institutBleu:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality"},{name:"infoGeneral",path:"infoGeneral"},{name:"location",path:"location"},{name:"sextionInfo",path:"sextionInfo"},{name:"similarLink",path:"similarLink"}],presets:{},hidden:["role","shortDescription","type","url"]}},journalInsoumisChambery:{events:{schema:{type:"object",additionalProperties:!0,properties:{location:{type:"string"}}},fields:[{name:"location",path:"location"}],presets:{},hidden:["email","parent"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0}}},fields:[{name:"documentation",path:"documentation"}],presets:{type:"article"},hidden:["type"]}},kpacite:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},historique:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},socialNetworks:{type:"array",items:{type:"string"}}}},fields:[{name:"formLocality",path:"formLocality"},{name:"historique",path:"historique"},{name:"manageModel",path:"manageModel"},{name:"socialNetworks",path:"socialNetworks"}],presets:{mainTag:"TiersLieux"},hidden:["tags"]}},laCompagnieDesTierslieux:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"}}},fields:[{name:"duration",path:"duration"}],presets:{type:"course",category:"sessionFormation"},hidden:["gatheringDates","parent","recurrency","tags","type","visioDate"]},organizations:{schema:{type:"object",additionalProperties:!0,properties:{territorialCercle:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"territorialCercle",path:"territorialCercle"}],presets:{},hidden:[]},person:{schema:{type:"object",additionalProperties:!0,properties:{actionContributor:{type:"boolean"},addressCie:{type:"object",additionalProperties:!0},adherent:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},attendedTraining:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},emailCie:{type:"string"},expertise:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},falicitationDevice:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},firstName:{type:"string"},formLocality:{type:"string"},functionOtherStructure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},functionThirdPlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},geoCie:{type:"object",additionalProperties:!0},geoPositionCie:{type:"object",additionalProperties:!0},heldAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},keyMoment:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},linkedEvent:{type:"string"},linkedThirdPlace:{type:"object",additionalProperties:!0},mentor:{type:"object",additionalProperties:!0},monitoringColdInfo:{type:"string"},monitoringLatestExchange:{type:"string"},monitoringSupportingDocumentation:{type:"array",items:{type:"string"}},monitoringWarmInfo:{type:"string"},networkContributor:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},newsletterSubscription:{type:"boolean"},otherLinkedStructure:{type:"object",additionalProperties:!0},otherThemeLinkedStructure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},otherTypeLinkedStructure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},referentTerritorialCercle:{type:"boolean"},reportingMember:{type:"object",additionalProperties:!0},shortDescriptionCie:{type:"string"},supportCercle:{type:"boolean"},supportedStructures:{type:"object",additionalProperties:!0},tagsCie:{type:"array",items:{type:"string"}},telephoneCie:{type:"number"},territorialCercle:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"actionContributor",path:"actionContributor"},{name:"addressCie",path:"addressCie"},{name:"adherent",path:"adherent"},{name:"attendedTraining",path:"attendedTraining"},{name:"emailCie",path:"emailCie"},{name:"expertise",path:"expertise"},{name:"falicitationDevice",path:"falicitationDevice"},{name:"firstName",path:"firstName"},{name:"formLocality",path:"formLocality"},{name:"functionOtherStructure",path:"functionOtherStructure"},{name:"functionThirdPlace",path:"functionThirdPlace"},{name:"geoCie",path:"geoCie"},{name:"geoPositionCie",path:"geoPositionCie"},{name:"heldAction",path:"heldAction"},{name:"keyMoment",path:"keyMoment"},{name:"linkedEvent",path:"linkedEvent"},{name:"linkedThirdPlace",path:"linkedThirdPlace"},{name:"mentor",path:"mentor"},{name:"monitoringColdInfo",path:"monitoringColdInfo"},{name:"monitoringLatestExchange",path:"monitoringLatestExchange"},{name:"monitoringSupportingDocumentation",path:"monitoringSupportingDocumentation"},{name:"monitoringWarmInfo",path:"monitoringWarmInfo"},{name:"networkContributor",path:"networkContributor"},{name:"newsletterSubscription",path:"newsletterSubscription"},{name:"otherLinkedStructure",path:"otherLinkedStructure"},{name:"otherThemeLinkedStructure",path:"otherThemeLinkedStructure"},{name:"otherTypeLinkedStructure",path:"otherTypeLinkedStructure"},{name:"referentTerritorialCercle",path:"referentTerritorialCercle"},{name:"reportingMember",path:"reportingMember"},{name:"shortDescriptionCie",path:"shortDescriptionCie"},{name:"supportCercle",path:"supportCercle"},{name:"supportedStructures",path:"supportedStructures"},{name:"tagsCie",path:"tagsCie"},{name:"telephoneCie",path:"telephoneCie"},{name:"territorialCercle",path:"territorialCercle"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},partner:{type:"object",additionalProperties:!0},rate:{type:"number"}}},fields:[{name:"competence",path:"competence"},{name:"partner",path:"partner"},{name:"rate",path:"rate"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags"]}},laMaisonDesFaiseurs:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality"},{name:"infoGeneral",path:"infoGeneral"},{name:"location",path:"location"},{name:"sextionInfo",path:"sextionInfo"},{name:"similarLink",path:"similarLink"}],presets:{},hidden:["role","shortDescription","type","url"]}},laReunionPourUnNumeriqueInclusif:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},laSemaineDesTierslieux:{events:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},maximumAttendees:{type:"number"},organizerName:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality"},{name:"maximumAttendees",path:"maximumAttendees"},{name:"organizerName",path:"organizerName"}],presets:{},hidden:[]}},labEnCommuns:{projects:{schema:{type:"object",additionalProperties:!0,properties:{commons:{type:"object",additionalProperties:!0},formLocality:{type:"string"}}},fields:[{name:"commons",path:"commons"},{name:"formLocality",path:"formLocality"}],presets:{category:"common"},hidden:["public"]}},lakou:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},extraActivity:{type:"array",items:{type:"string"}},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string","x-format":"date"},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},structure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea"},{name:"extraActivity",path:"extraActivity"},{name:"extraManageModel",path:"extraManageModel"},{name:"extraTypePlace",path:"extraTypePlace"},{name:"formLocality",path:"formLocality"},{name:"holderOrganization",path:"holderOrganization"},{name:"location",path:"location"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate"},{name:"similarLink",path:"similarLink"},{name:"siteSurfaceArea",path:"siteSurfaceArea"},{name:"structure",path:"structure"},{name:"typePlace",path:"typePlace"}],presets:{role:"admin",mainTag:"TiersLieux"},hidden:["email","extraActivity","role","shortDescription","tags","type"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{access:{type:"object",additionalProperties:!0},adminEmail:{type:"string"},adminFirstName:{type:"string"},classification:{type:"object",additionalProperties:!0},descriptionSection:{type:"object",additionalProperties:!0},info:{type:"object",additionalProperties:!0},infoGeneral:{type:"object",additionalProperties:!0},toolLevel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},toolType:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"access",path:"access"},{name:"adminEmail",path:"adminEmail"},{name:"adminFirstName",path:"adminFirstName"},{name:"classification",path:"classification"},{name:"descriptionSection",path:"descriptionSection"},{name:"info",path:"info"},{name:"infoGeneral",path:"infoGeneral"},{name:"toolLevel",path:"toolLevel"},{name:"toolType",path:"toolType"}],presets:{type:"tool"},hidden:["parent","type"]}},lesCommunsDesTierslieux:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},compagnon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea"},{name:"compagnon",path:"compagnon"},{name:"extraManageModel",path:"extraManageModel"},{name:"extraTypePlace",path:"extraTypePlace"},{name:"formLocality",path:"formLocality"},{name:"holderOrganization",path:"holderOrganization"},{name:"location",path:"location"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate"},{name:"photo",path:"photo"},{name:"similarLink",path:"similarLink"},{name:"siteSurfaceArea",path:"siteSurfaceArea"},{name:"typePlace",path:"typePlace"}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"]}},mayottePourUnNumeriqueInclusif:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},meir:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality"}],presets:{},hidden:["role","shortDescription","tags","type","url"]},projects:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality"}],presets:{},hidden:["shortDescription","url"]}},navigatorDesTierslieux:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea"},{name:"extraManageModel",path:"extraManageModel"},{name:"extraTypePlace",path:"extraTypePlace"},{name:"formLocality",path:"formLocality"},{name:"holderOrganization",path:"holderOrganization"},{name:"location",path:"location"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate"},{name:"photo",path:"photo"},{name:"similarLink",path:"similarLink"},{name:"siteSurfaceArea",path:"siteSurfaceArea"},{name:"typePlace",path:"typePlace"}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"]}},notragora:{badges:{schema:{type:"object",additionalProperties:!0,properties:{producors:{type:"object",additionalProperties:!0},supports:{type:"object",additionalProperties:!0}}},fields:[{name:"producors",path:"producors"},{name:"supports",path:"supports"}],presets:{},hidden:["parent","tags"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{carousel:{type:"boolean"},tags1:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},tags2:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},year:{type:"number"}}},fields:[{name:"carousel",path:"carousel"},{name:"tags1",path:"tags1"},{name:"tags2",path:"tags2"},{name:"year",path:"year"}],presets:{type:"video"},hidden:["parent","urls"]}},nouvellecaledoniePourUnNumeriqueInclusif:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},openAtlas:{crowdfunding:{schema:{type:"object",additionalProperties:!0,properties:{associate:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},invoiceAddress:{type:"string"},invoiceName:{type:"string"},invoiceSiret:{type:"string"},orgaName:{type:"string"},similarLink:{type:"string"}}},fields:[{name:"associate",path:"associate"},{name:"invoiceAddress",path:"invoiceAddress"},{name:"invoiceName",path:"invoiceName"},{name:"invoiceSiret",path:"invoiceSiret"},{name:"orgaName",path:"orgaName"},{name:"similarLink",path:"similarLink"}],presets:{type:"pledge"},hidden:["donationLink"]}},polynesieFrancaisePourUnNumeriqueInclusif:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}},prdr:{badges:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"object",additionalProperties:!0}}},fields:[{name:"info",path:"info"}],presets:{tags:{value:"",forced:!0},category:"domainAction"},hidden:["category","color","icon","tags"]}},reseauTierslieux:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},compagnon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},extraManageModel:{type:"string"},extraTags:{type:"array",items:{type:"string"}},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string","x-format":"date"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea"},{name:"compagnon",path:"compagnon"},{name:"extraManageModel",path:"extraManageModel"},{name:"extraTags",path:"extraTags"},{name:"extraTypePlace",path:"extraTypePlace"},{name:"formLocality",path:"formLocality"},{name:"holderOrganization",path:"holderOrganization"},{name:"location",path:"location"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate"},{name:"photo",path:"photo"},{name:"similarLink",path:"similarLink"},{name:"siteSurfaceArea",path:"siteSurfaceArea"},{name:"typePlace",path:"typePlace"}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"]}},rfflabs:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{allNetwork:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},formLocality:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"allNetwork",path:"allNetwork"},{name:"formLocality",path:"formLocality"},{name:"manageModel",path:"manageModel"}],presets:{mainTag:"TiersLieux",typePlace:["Fablab / Atelier de Fabrication Numérique"]},hidden:["fablabNetwork","tags","thirdPlaceNetwork"]}},ries:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"theme",path:"theme"}],presets:{},hidden:[]}},siteDuPactePourLaTransition:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"string"},localMembers:{type:"string"},nextEvents:{type:"string"},publicMail:{type:"string"},referentMail:{type:"string"}}},fields:[{name:"info",path:"info"},{name:"localMembers",path:"localMembers"},{name:"nextEvents",path:"nextEvents"},{name:"publicMail",path:"publicMail"},{name:"referentMail",path:"referentMail"}],presets:{type:"Group",role:"creator",public:!1,"preferences[isOpenEdition]":!1,"preferences[isOpenData]":!1},hidden:["description","email","role","shortDescription","tags","type","url"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{commentEngagement:{type:"string"},compteRendu:{type:"object",additionalProperties:!0},contractPdf:{type:"object",additionalProperties:!0},documentation:{type:"object",additionalProperties:!0},info:{type:"string"},localMeasures:{type:"array",items:{type:"string"}},signedOn:{type:"string","x-format":"date"}}},fields:[{name:"commentEngagement",path:"commentEngagement"},{name:"compteRendu",path:"compteRendu"},{name:"contractPdf",path:"contractPdf"},{name:"documentation",path:"documentation"},{name:"info",path:"info"},{name:"localMeasures",path:"localMeasures"},{name:"signedOn",path:"signedOn"}],presets:{type:"doc",public:!1,"preferences[isOpenEdition]":!1,"preferences[isOpenData]":!1},hidden:["parent","tags","type","urls"]}},sportSanteBienetre:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration"},{name:"gatheringDates",path:"gatheringDates"},{name:"visioDate",path:"visioDate"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"]},organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},sextionInfoRepresentant:{type:"object",additionalProperties:!0},sextionInfoResponsable:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality"},{name:"infoGeneral",path:"infoGeneral"},{name:"location",path:"location"},{name:"sextionInfo",path:"sextionInfo"},{name:"sextionInfoRepresentant",path:"sextionInfoRepresentant"},{name:"sextionInfoResponsable",path:"sextionInfoResponsable"},{name:"similarLink",path:"similarLink"}],presets:{type:"NGO",role:"admin"},hidden:["role","shortDescription","tags","type","url"]},poi:{schema:{type:"object",additionalProperties:!0,properties:{dateCreation:{type:"string","x-format":"date"},eclairage:{type:"boolean"},entrepriseFonciere:{type:"string"},familleEquipement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},gardiennage:{type:"boolean"},handicap:{type:"boolean"},hebergement:{type:"boolean"},installation:{type:"string"},libreAccess:{type:"boolean"},nature:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},partenariat:{type:"boolean"},restaurant:{type:"boolean"},sole:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},sportPratiquer:{type:"string"},subCategory:{type:"string"},surface:{type:"string"},transportCommun:{type:"boolean"},typeAccessiblHandicap:{type:"string"},typePartenariat:{type:"string"},typeTransportCommun:{type:"string"}}},fields:[{name:"dateCreation",path:"dateCreation"},{name:"eclairage",path:"eclairage"},{name:"entrepriseFonciere",path:"entrepriseFonciere"},{name:"familleEquipement",path:"familleEquipement"},{name:"gardiennage",path:"gardiennage"},{name:"handicap",path:"handicap"},{name:"hebergement",path:"hebergement"},{name:"installation",path:"installation"},{name:"libreAccess",path:"libreAccess"},{name:"nature",path:"nature"},{name:"partenariat",path:"partenariat"},{name:"restaurant",path:"restaurant"},{name:"sole",path:"sole"},{name:"sportPratiquer",path:"sportPratiquer"},{name:"subCategory",path:"subCategory"},{name:"surface",path:"surface"},{name:"transportCommun",path:"transportCommun"},{name:"typeAccessiblHandicap",path:"typeAccessiblHandicap"},{name:"typePartenariat",path:"typePartenariat"},{name:"typeTransportCommun",path:"typeTransportCommun"}],presets:{type:"recoveryCenter"},hidden:["parent","tags","urls"]},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence"},{name:"documentation",path:"documentation"},{name:"partner",path:"partner"},{name:"rate",path:"rate"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"]}},suppa:{classifieds:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"string"}}},fields:[{name:"info",path:"info"}],presets:{},hidden:[]}},terramies:{poi:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0}}},fields:[{name:"documentation",path:"documentation"}],presets:{type:"atelier"},hidden:["urls"]}},testeTplFormation:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration"},{name:"gatheringDates",path:"gatheringDates"},{name:"reportLink",path:"reportLink"},{name:"visioDate",path:"visioDate"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"]},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation"},{name:"firstName",path:"firstName"},{name:"formLocality",path:"formLocality"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence"},{name:"documentation",path:"documentation"},{name:"partner",path:"partner"},{name:"rate",path:"rate"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"]}},tierslieuxbelgique:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{accessibiliteSection:{type:"object",additionalProperties:!0},accessibiliteTitle:{type:"object",additionalProperties:!0},anniversaryDate:{type:"string"},buildingSurfaceArea:{type:"number"},caracteristicSection:{type:"object",additionalProperties:!0},commonTransportsAccess:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},enjeux:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},formLocality:{type:"string"},infoCostum:{type:"object",additionalProperties:!0},infoGeneral:{type:"object",additionalProperties:!0},landController:{type:"string"},location:{type:"string"},logoAndPhotosSection:{type:"object",additionalProperties:!0},mainPartners:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},manageModelHow:{type:"string"},networks:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},otherAccess:{type:"string"},personnesAccessPMR:{type:"boolean"},phone:{type:"string"},photo:{type:"object",additionalProperties:!0},plan:{type:"object",additionalProperties:!0},raisonAndTagLine:{type:"string"},referentEmail:{type:"string"},referentPersonFirstName:{type:"string"},referentPersonName:{type:"string"},referentPorterName:{type:"string"},referentSection:{type:"object",additionalProperties:!0},referentTelephone:{type:"string"},siteEnvironment:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},vehiculesAccess:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"accessibiliteSection",path:"accessibiliteSection"},{name:"accessibiliteTitle",path:"accessibiliteTitle"},{name:"anniversaryDate",path:"anniversaryDate"},{name:"buildingSurfaceArea",path:"buildingSurfaceArea"},{name:"caracteristicSection",path:"caracteristicSection"},{name:"commonTransportsAccess",path:"commonTransportsAccess"},{name:"enjeux",path:"enjeux"},{name:"formLocality",path:"formLocality"},{name:"infoCostum",path:"infoCostum"},{name:"infoGeneral",path:"infoGeneral"},{name:"landController",path:"landController"},{name:"location",path:"location"},{name:"logoAndPhotosSection",path:"logoAndPhotosSection"},{name:"mainPartners",path:"mainPartners"},{name:"manageModel",path:"manageModel"},{name:"manageModelHow",path:"manageModelHow"},{name:"networks",path:"networks"},{name:"otherAccess",path:"otherAccess"},{name:"personnesAccessPMR",path:"personnesAccessPMR"},{name:"phone",path:"phone"},{name:"photo",path:"photo"},{name:"plan",path:"plan"},{name:"raisonAndTagLine",path:"raisonAndTagLine"},{name:"referentEmail",path:"referentEmail"},{name:"referentPersonFirstName",path:"referentPersonFirstName"},{name:"referentPersonName",path:"referentPersonName"},{name:"referentPorterName",path:"referentPorterName"},{name:"referentSection",path:"referentSection"},{name:"referentTelephone",path:"referentTelephone"},{name:"siteEnvironment",path:"siteEnvironment"},{name:"siteSurfaceArea",path:"siteSurfaceArea"},{name:"typePlace",path:"typePlace"},{name:"vehiculesAccess",path:"vehiculesAccess"}],presets:{mainTag:"TiersLieux",role:"admin",type:"ONG"},hidden:["role","tags","type"]}},tierslieuxorg1:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration"},{name:"gatheringDates",path:"gatheringDates"},{name:"reportLink",path:"reportLink"},{name:"visioDate",path:"visioDate"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"]},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation"},{name:"firstName",path:"firstName"},{name:"formLocality",path:"formLocality"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence"},{name:"documentation",path:"documentation"},{name:"partner",path:"partner"},{name:"rate",path:"rate"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"]}},transiter:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration"},{name:"gatheringDates",path:"gatheringDates"},{name:"reportLink",path:"reportLink"},{name:"visioDate",path:"visioDate"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"]},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation"},{name:"firstName",path:"firstName"},{name:"formLocality",path:"formLocality"}],presets:{},hidden:[]},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"string"},documentation:{type:"object",additionalProperties:!0},formLocality:{type:"string"},location:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"},similarLink:{type:"string"}}},fields:[{name:"competence",path:"competence"},{name:"documentation",path:"documentation"},{name:"formLocality",path:"formLocality"},{name:"location",path:"location"},{name:"partner",path:"partner"},{name:"rate",path:"rate"},{name:"similarLink",path:"similarLink"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"]}},vhelioPeiTour2025:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality"},{name:"infoGeneral",path:"infoGeneral"},{name:"location",path:"location"},{name:"sextionInfo",path:"sextionInfo"},{name:"similarLink",path:"similarLink"}],presets:{},hidden:["role","shortDescription","type","url"]}},wallisetfutunaPourUnNumeriqueInclusif:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace"}],presets:{},hidden:[]}}};function P(e){if(e.multiple)return"array";if("date"===e.format)return"date";switch(e.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"object";default:return"string"}}class CostumScope{slug;user;module;costumId;costumType;constructor(e,t,n,i,r){this.user=e,this.slug=t,this.module=n,this.costumId=i,this.costumType=r}contextFor(e){const t=this.module.collections[e];if(!t)return null;const n=t.schema.properties??{};return{slug:this.slug,costumId:this.costumId,costumType:this.costumType,collection:e,schema:{type:"object",additionalProperties:!0,properties:n},fields:t.fields,presets:t.presets??{},hidden:t.hidden??[]}}async create(e,t={}){const n=this.contextFor(e),i=n?{...n.presets,...t}:{...t},r=n??{slug:this.slug,costumId:this.costumId,costumType:this.costumType,collection:e,schema:{type:"object",additionalProperties:!0,properties:{}},fields:[],presets:{},hidden:[]};return this.user.entity(e,i,{costumCtx:r})}poi(e={}){return this.create("poi",e)}organization(e={}){return this.create("organizations",e)}project(e={}){return this.create("projects",e)}event(e={}){return this.create("events",e)}describeForm(e){const t=this.module.collections[e];if(!t)return null;const n=new Set(t.hidden??[]),i=t.fields.map(e=>({name:e.name,path:e.path,type:P(e),multiple:!0===e.multiple,...e.enum&&e.enum.length?{enum:e.enum}:{},hidden:n.has(e.name)}));return{slug:this.slug,collection:e,costumId:this.costumId,costumType:this.costumType,add:t.add??!1,createLabel:t.createLabel??null,presets:t.presets??{},hidden:t.hidden??[],fields:i}}}const v=Symbol("cocolight.costumRequestEnvelope"),C=e=>e&&e.default?e.default:e,S=C(n),j=C(i),O=C(o),I=C(r),L=[],D=new WeakMap,x=new WeakMap;let k=0;const M=new Set;function N(e){const t=()=>{try{L.push(t),e()}finally{L.pop()}};return t(),t}function q(e){k++;try{e()}finally{if(k--,0===k){const e=Array.from(M);M.clear();for(const t of e)t()}}}function R(e){let t=e;const n=new Set;return{get value(){const e=L[L.length-1];return e&&n.add(e),t},set value(e){t!==e&&(t=e,k>0?n.forEach(e=>M.add(e)):n.forEach(e=>e()))},subscribe:e=>(n.add(e),()=>n.delete(e)),__isSignal:!0}}function z(e){return e&&!0===e.__isSignal}function F(e,t=[]){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return function(e,t){return new Proxy(e,{get(e,n,i){if("string"==typeof n&&!isNaN(+n)){const i=e[+n];return B(i)?i:F(i,[...t,n])}return Reflect.get(e,n,i)},set(e,n,i){if("string"==typeof n&&!isNaN(+n)){const r=F(i,[...t,n]);e[+n]=r}return!0}})}(e,t);if(e.__isReactive)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(e instanceof Date)return e;if(e.__entityTag)return e;const n=new Map,i=new Proxy(e,{get(e,i){if("__raw"===i)return e;if("__isReactive"===i)return!0;if(!n.has(i)){const r=R(F(e[i],[...t,String(i)]));n.set(i,r)}return n.get(i).value},set(e,i,r){const o=F(r,[...t,String(i)]);if(!n.has(i)){const e=R(o);n.set(i,e)}return n.get(i).value=o,e[i]=function(e){return z(e)?e.value:e}(o),!0},deleteProperty:(e,t)=>(n.delete(t),Reflect.deleteProperty(e,t))});return x.set(i,n),i}function U(e){return"object"!=typeof e||null===e||e.__isReactive?e:F(e)}function B(e){return null!==e&&"object"==typeof e&&!0===e.__isReactive}function $(e){if(D.has(e))return D.get(e);const t=R();return N(()=>t.value=e()),D.set(e,t),t}function V(e,t){let n;N(()=>{const i=e();i!==n&&(t(i,n),n=i)})}function G(e){return B(e)?x.get(e):null}function K(e,t,n){const i=G(e);if(!i||!i.has(t))return()=>{};const r=i.get(t);return r?.subscribe?.(()=>n(r.value))??(()=>{})}var H=Object.freeze({__proto__:null,batch:q,computed:$,effect:N,getSignals:G,isReactive:B,isSignal:z,reactive:U,subscribeTo:K,watch:V});const{fromBuffer:J}=t,W=e,Z={CURRENT_TIME:"updatedTime",NOW:"now",PATH_ALL_TO_ROOT:"allToRoot"},Q={default:"globalAutocompleteCostum","navigator-tl":"navigatorGettl"};function Y(e,t,n){const i=e.find(e=>e.contentKey===t);if(i)return i;const r=((n??"").split("?")[0]??"").split("/").pop()??"";return r?e.find(e=>!!e.name&&(e.name===r||(n??"").includes(e.name))):void 0}class BaseEntity{__entityTag;deps;apiClient;parent;userContext;endpointApi;data;meta;_draftData={};_initialDraftData={};_serverData=U({});_calledFromSave=!1;_syncReactiveDraft=!1;_isDeleted=!1;_costumCtx=null;_add;_update;_allowedFieldsCache;_allowedFieldsMetadata;static entityTag="BaseEntity";static entityType;static SCHEMA_CONSTANTS;static VIRTUAL_SCHEMAS;static CUSTOM_FIELD_HANDLERS;static COSTUM_ADD_CONSTANT;_checkNotDeleted(){if(this._isDeleted)throw new ApiError(`Cet objet ${this.__entityTag} a été supprimé et ne peut plus être utilisé.`,400)}constructor(e,t={},n={},i={}){this.__entityTag=i.entityTag||this.getEntityTag(this._getCtor().entityTag)||"BaseEntity",this.deps=n;if("ApiClient"===this.getEntityTag(e?.__entityTag))this.apiClient=e,this.parent=null,this.userContext=null;else{if(!e||!("apiClient"in e))throw new ApiError("Parent invalide ou ApiClient manquant.",400);{const t=e;this.apiClient=t.apiClient,this.parent=t,this.userContext="User"===this.getEntityTag(t?.__entityTag)?t:t.userContext||null}}if("function"==typeof n.EndpointApi)this.endpointApi=new n.EndpointApi(this.apiClient);else{if("object"!=typeof n.EndpointApi)throw new ApiError("deps.EndpointApi doit être une classe ou une instance valide.",500);this.endpointApi=n.EndpointApi}this._serverData=U({}),this._costumCtx=i.costumCtx??null;const{draft:r,proxy:o,initial:a}=this._buildDraftAndProxy({data:{...t,...this.defaultFields},serverData:this._serverData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});this._initialDraftData=a,this._draftData=r,this.data=o}_getCtor(){return this.constructor}getEntityTag=e=>e?.replace(/^_/,"");get id(){return this._draftData.id||null}get slug(){return this._draftData.slug||null}_id(e){this._draftData.id=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}get draftData(){return this._draftData}get initialDraftData(){return this._initialDraftData}get serverData(){return this._serverData}get isMe(){return!!(this.isConnected&&this.userId&&this.userContext?.id&&"string"==typeof this.userId&&"string"==typeof this.userContext?.id&&this.userId===this.userContext?.id)}getEntityType(){return this._getCtor().entityType}hasChanges(){const e=this._toRawDeep(this._draftData),t=this._serialize(e),n=this._serialize(this._initialDraftData);return JSON.stringify(t)!==JSON.stringify(n)}async refresh(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);return this.get()}async _refreshIfDirect(){!this._calledFromSave&&this.id&&await this.refresh()}async save(){if(this._checkNotDeleted(),!this.isConnected)throw new ApiError("Non connecté.",401);this._calledFromSave=!0;try{const e={...this._draftData};if(!this.id&&"function"==typeof this._add)return await this._add(e),this._resetInitialDraftData(),this.userContext&&await(this.userContext?.refresh()),await this.refresh();if("function"==typeof this._update){const t=await this._update(e);if(this._resetInitialDraftData(),t)return await this.refresh()}return this._serverData}finally{this._calledFromSave=!1}}async _saveCostumViaElementSave(e){const t=this._costumCtx;if(!t||!this.id)return!1;"id"in e&&delete e.id;const n={...e,...this.defaultFields},i=this.initialDraftData??{},r=this._allowedFieldsMetadata?.combinedSchema,o=t.schema?.properties??{},a=new Set([...this._allowedFieldsCache??[],...Object.keys(o),...(t.fields??[]).map(e=>e.name)]),s={},p={};for(const e of a){if("id"===e||"slug"===e||"profil_avatar"===e||this.removeFields.includes(e))continue;if(void 0===n[e])continue;if(!this._compareValues(n[e],i[e]))continue;const t=n[e],a=null===t||""===t||Array.isArray(t)&&0===t.length;s[e]=a?"":t,p[e]=a?{}:this._lookupPropSchema(r,e)??o[e]??{}}let c=!1;if(Object.keys(s).length>0){s.id=this.id,s.collection=t.collection,s[v]={properties:p,context:{costumSlug:t.slug,costumId:t.costumId,costumType:t.costumType},isUpdate:!0,defs:r?.$defs??{}};const e=await this.apiClient.callEndpoint(this._getCtor().COSTUM_ADD_CONSTANT,s);this.apiClient.checkAndThrowApiResponseError(e),c=!0}return null!=e.profil_avatar&&(await this.updateImageProfil({profil_avatar:e.profil_avatar}),c=!0),c}_lookupPropSchema(e,t){if(e?.allOf)for(const n of e.allOf){const e=n?.properties?.[t];if(e)return e}}static fromServerData(e,t,n){const i=new this(t,{},n);return i._setData(e,{forceInitialDraftReset:!0}),i}_transformServerData(e){return e}_setData(e,{forceInitialDraftReset:t=!1}={}){this.userContext&&this.userContext!==this&&this.apiClient._logger?.debug?.(`[${this.__entityTag}] Mise à jour liée à userContext : ${this.userContext.id}`);const n=this._transformServerData(e)??{};if(this._serverData&&B(this._serverData)){for(const e of Object.keys(this._serverData))e in n||delete this._serverData[e];for(const e of Object.keys(n))this._serverData[e]=n[e]}else this._serverData=U({...n});const i=this._draftData?this._toRawDeep(this._draftData):{},r={...e||{},...this.defaultFields,...i};{const e=this._serverData?.source,t=e?.key??e?.keys?.[0];this._costumCtx=function(e,t){if(!e)return null;const n=E[e]?.[t];if(!n)return null;const i=A[e],r=n.schema.properties??{};return{slug:e,costumId:i?.costumId??"",costumType:i?.costumType??t,collection:t,schema:{type:"object",additionalProperties:!0,properties:r},fields:n.fields,presets:n.presets??{},hidden:n.hidden??[]}}(t,this.getEntityType())??this._costumCtx}const{draft:o,proxy:a,initial:s}=this._buildDraftAndProxy({data:r,serverData:this._serverData,previousDraft:this._draftData,constant:this._getCtor().SCHEMA_CONSTANTS,apiClient:this.apiClient,transforms:this.transforms,removeFields:this.removeFields});t?this._initialDraftData=structuredClone(this._toRawDeep(o)):this._initialDraftData||(this._initialDraftData=s),B(this._draftData)?this._updateDraftPreservingUserChanges(o):this._draftData=U(o),this.data||(this.data=a)}_updateDraftPreservingUserChanges(e){for(const t of Object.keys(this._draftData||{}))t in e||delete this._draftData[t];for(const t of Object.keys(e)){const n=this._draftData?.[t],i=this._initialDraftData?.[t];void 0!==n&&void 0!==i&&this._serialize(this._toRawDeep(n))!==this._serialize(i)||(this._draftData[t]=e[t])}}_resetInitialDraftData(){const e=this._toRawDeep(this._draftData);this._initialDraftData=structuredClone(e)}_toRawDeep(e){if(!this||"function"!=typeof this._toRawDeep)throw new Error("`this._toRawDeep` is not bound correctly. Use a lambda to preserve context.");if(z(e))return this._toRawDeep(e.value);if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return this._toRawDeep(e.__raw);if(e instanceof Date)return e;if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e;if("undefined"!=typeof File&&e instanceof File)return e;if("undefined"!=typeof Blob&&e instanceof Blob)return e;if(e&&"function"==typeof e.pipe&&"function"==typeof e.on)return e;if(Array.isArray(e))return e.map(e=>this._toRawDeep(e));if("object"==typeof e&&null!==e){const t={};for(const n of Object.keys(e))t[n]=this._toRawDeep(e[n]);return t}return e}defaultFields={};removeFields=[];transforms={};toJSON(){const e={};return this.parent?.id&&(e.id=this.parent.id),"function"==typeof this.parent?.getEntityType&&(e.type=this.parent.getEntityType()),this.parent?.__entityTag&&(e.__entityTag=this.parent.__entityTag),this.parent?.slug&&(e.slug=this.parent.slug),this.parent?.serverData&&(e.serverData={id:this.parent.serverData.id,collection:this.parent.serverData.collection,slug:this.parent.serverData.slug,...this.parent.serverData.name&&{name:this.parent.serverData.name},...this.parent.serverData.parent&&{parent:this.parent.serverData.parent},...this.parent.serverData.organizer&&{organizer:this.parent.serverData.organizer},...this.parent.serverData.links&&{links:this.parent.serverData.links}}),{__entityTag:this.__entityTag,__isSerializedEntity:!0,serverData:this._serialize(this._serverData),parent:Object.keys(e).length>0?e:null}}_serialize(e){try{return JSON.parse(I.stringify(this._removeUnserializables(e)))}catch(e){const t=e;return this.apiClient?._logger?.error?.("Erreur de sérialisation EJSON:",{message:t?.message,stack:t?.stack,error:e}),null}}_removeUnserializables(e,t=new WeakSet){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof RegExp)return e;if(e&&"object"==typeof e&&"_bsontype"in e&&"ObjectID"===e._bsontype)return e;if(e instanceof Uint8Array||ArrayBuffer.isView(e))return e;if(e instanceof BaseEntity)return e.toJSON();if(t.has(e))return null;if(t.add(e),e.__isReactive&&"object"==typeof e.__raw)return this._removeUnserializables(e.__raw,t);if(Array.isArray(e))return e.map(e=>this._removeUnserializables(e,t));const n={};for(const i of Object.keys(e)){const r=e[i];if("function"!=typeof r&&"symbol"!=typeof r&&void 0!==r)try{n[i]=this._removeUnserializables(r,t)}catch{n[i]=null}}return n}static _revive(e,t){const n=I.fromJSONValue(e);return this._deserializeNestedEntities(n,t)}static _deserializeNestedEntities(e,t){if(null===e||"object"!=typeof e)return e;if(e instanceof Date||e instanceof RegExp)return e;if(Array.isArray(e))return e.map(e=>this._deserializeNestedEntities(e,t));if(e.__isSerializedEntity&&e.__entityTag&&e.serverData)return b(e,t);const n={};for(const[i,r]of Object.entries(e))n[i]=this._deserializeNestedEntities(r,t);return n}static fromJSON(e,t,n){if(!e||"object"!=typeof e||!("serverData"in e))throw new Error("Invalid JSON format: missing serverData");const{serverData:i}=e;return this.fromServerData(this._revive(i,t),t,n||{})}async call(e,t={}){return this.apiClient.safeCall(async()=>{const n=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(n),n.data})}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous devez ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(this._checkNotDeleted(),!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour faire cette action.",401);return"function"==typeof e?await e():this.call(e,t)}async callIsMe(e,t={}){if(this._checkNotDeleted(),!this.isMe)throw new ApiAuthenticationError("Vous devez être vous-même pour faire cette action.",403);return"function"==typeof e?await e():await this.callIsConnected(e,t)}async _validateImage(e){return await this._validateUploadInput(e,{allowedMimeTypes:["image/jpeg","image/png","image/jpg"],expectedType:"image"})}async _validateFile(e){return await this._validateUploadInput(e,{allowedMimeTypes:["application/pdf","text/plain","text/csv"],expectedType:"file"})}async _prepareUploadFile(e,t=`upload-${Date.now()}`){const n="undefined"==typeof window&&"undefined"!=typeof process;if("undefined"!=typeof File&&e instanceof File)return{qqfile:e,qqfilename:e.name,qqtotalfilesize:e.size};if("undefined"!=typeof Blob&&e instanceof Blob){const n=`${t}.${e.type.split("/")[1]||"bin"}`,i=new File([e],n,{type:e.type});return{qqfile:i,qqfilename:n,qqtotalfilesize:i.size}}if(n&&Buffer.isBuffer(e)){const n=await J(e),i=n?.mime??"application/octet-stream",r=n?.ext??"bin",o=/\.[a-z0-9]+$/i.test(t)?t:`${t}.${r}`;return{qqfile:await this._createReadStreamFromBuffer(e,o,i),qqfilename:o,qqtotalfilesize:e.length}}if(n&&e&&"function"==typeof e.pipe){const n=e;return{qqfile:n,qqfilename:"string"==typeof n.path&&n.path||t,qqtotalfilesize:"number"==typeof n.size?n.size:0}}throw new ApiError("Type de fichier non reconnu pour l'upload.",400)}async deleteFile(e){if("string"!=typeof e||24!==e.length)throw new ApiError("docId requis (24 hex) pour supprimer un document.",400);const t={pathParams:{id:e}};await this.callIsConnected(()=>this.endpointApi.deleteDocumentById(t))}async getDocuments(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e=this.getEntityType(),t=await this.callIsConnected(()=>this.endpointApi.documentList({pathParams:{id:this.id,type:e}})),n=t?.list??{};return Object.values(n).map(e=>({id:String(e.id??""),name:e.name,path:e.path,author:e.author,contentKey:e.contentKey})).filter(e=>24===e.id.length)}async removeProfilImage(){const e=await this.getDocuments(),t=this._serverData,n=Y(e,"profil",t?.profilImageUrl||t?.profilMediumImageUrl||t?.profilThumbImageUrl);return!!n&&(await this.deleteFile(n.id),!0)}async removeBannerImage(){const e=await this.getDocuments(),t=this._serverData,n=Y(e,"banner",t?.profilRealBannerUrl||t?.profilBannerUrl);return!!n&&(await this.deleteFile(n.id),!0)}_markDeletedLocally(){Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async _deleteViaElement(e,t,{checkHierarchy:n=!0}={}){if(!this.id)throw new ApiError(`Vous devez fournir un id pour supprimer ${this.constructor.name}.`,400);if(!this.isAuthorOrAdmin({checkHierarchy:n}))throw new ApiError("Suppression refusée — vous devez être l'auteur ou administrateur (ou administrateur du parent).",403);const i={reason:t,pathParams:{type:e,id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteElement(i)),this._markDeletedLocally()}async updateField(e,t,n={}){if(void 0===t)throw new ApiError("`value` ne peut pas être undefined. Utiliser `null` pour $unset.",400);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if("string"!=typeof e||0===e.length)throw new ApiError("`path` est requis et doit être une string non vide.",400);if(n.arrayForm&&n.pull&&!Array.isArray(t))throw new ApiError("`arrayForm` + `pull` requièrent value: array (mode $pullAll). Pour un $pull simple, utiliser uniquement `pull` (sans arrayForm).",400);if(n.updatePartial&&("object"!=typeof t||null===t||Array.isArray(t)))throw new ApiError("`updatePartial: true` requiert value: object (les sous-clés deviennent des sub-paths).",400);this._assertNotEntityType("updateField",["badges","news","comments","classifieds"]);const i={id:this.id,collection:this.getEntityType(),path:e,value:t};return void 0!==n.setType&&(i.setType=n.setType),n.arrayForm&&(i.arrayForm=!0),n.pull&&(i.pull=n.pull),n.updatePartial&&(i.updatePartial=!0),n.formParentId&&(i.formParentId=n.formParentId),n.edit&&(i.edit=!0),this.endpointApi.updatePathValue(this._normalizeUpdatePathPayload(i))}_normalizeUpdatePathPayload(e){let t=e;if(Array.isArray(t.setType)&&0===t.setType.length){const{setType:e,...n}=t;t=n}t.value instanceof Date&&(t={...t,value:t.value.toISOString(),setType:"isoDate"});const n=Array.isArray(t.setType)&&t.setType.length>0&&t.setType.every(e=>"isoDate"===e?.type);if("string"==typeof t.value&&n&&(t={...t,setType:"isoDate"}),!t.pull||""!==t.value&&null!==t.value&&void 0!==t.value||(t={...t,value:""}),Array.isArray(t.value)&&0===t.value.length&&!t.arrayForm&&!t.pull){const{setType:e,...n}=t;t={...n,value:""}}return t}async _validateUploadInput(e,{allowedMimeTypes:t=[],expectedType:n="any"}){if(!e)throw new ApiValidationError("Le fichier est requis.",400,["Le fichier est requis"]);const i="undefined"==typeof window&&"undefined"!=typeof process;let r=null,o="";if("undefined"!=typeof File&&e instanceof File){if(o=e.type,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);r=e}else if("undefined"!=typeof Blob&&e instanceof Blob){if(o=e.type,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);const n=o.split("/")[1]||"bin",i=`${Date.now()}.${n}`;r=new File([e],i,{type:o})}else if(i&&Buffer.isBuffer(e)){const i=await J(e);if(!i)throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(o=i.mime,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if("image"===n){const t=i.ext,n=`${Date.now()}.${t}`;r=await this._createReadStreamFromBuffer(e,n,o)}else r=e}else{if(!i||!(a=e)||"object"!=typeof a||"function"!=typeof a.pipe||"function"!=typeof a.on)throw new ApiValidationError("Type de fichier non reconnu.",400,["Type de fichier non reconnu."]);{const n=e,i=[],a=await this._passThrough(),s=await this._passThrough(),p=4100;let c=0;n.on("data",e=>{c<p&&(i.push(e),c+=e.length)}),n.pipe(a).pipe(s),await new Promise(e=>setTimeout(e,10));const l=Buffer.concat(i),m=await J(l);if(!m)throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);if(o=m.mime,!t.includes(o))throw new ApiValidationError("Le type du fichier est invalide.",400,["Le type du fichier est invalide"]);s.path=`${Date.now()}.${m.ext}`,s.mimeType=o,r=s}}var a;return r}async _createReadStreamFromBuffer(e,t="file.bin",n="application/octet-stream"){const i=await this._bufferToReadable(e);return i.path=t,i.mimeType=n,i}async _bufferToReadable(e){if("undefined"==typeof window){const{bufferToReadable:t}=await Promise.resolve().then(function(){return It});return t(e)}throw new Error("bufferToReadable ne doit pas être appelé dans le navigateur")}async _passThrough(){if("undefined"==typeof window){const{createPassThrough:e}=await Promise.resolve().then(function(){return It});return e()}throw new Error("passThrough ne doit pas être appelé dans le navigateur")}_omitProps(e,t){if(!e||"object"!=typeof e)return{};const n={...e};for(const e of t)delete n[e];return n}_pickProps(e,t,n={}){if(!e||"object"!=typeof e)return{};const i={};for(const r of t)if(r in e){const t=e[r];"function"==typeof n[r]?i[r]=n[r](t,e):i[r]=t}return i}_hasAtLeastOne(e,t=[]){return t.some(t=>t in e&&null!=e[t])}_createFilteredProxy(e){return new Proxy(e,{get(e,t,n){const i=e.filter(e=>!e._isDeleted);if("length"===t)return i.length;if("string"==typeof t&&/^\d+$/.test(t))return i[Number(t)];const r=Reflect.get(i,t,n);return"function"==typeof r?r.bind(i):r}})}_newId(){return W().toHexString()}_getAllowedFieldsForCurrentState(){if(!this._allowedFieldsMetadata)return this._allowedFieldsCache||[];const{combinedSchema:e,removeFields:t}=this._allowedFieldsMetadata,n=this._toRawDeep(this._draftData),i={...this.defaultFields,...n};let r=this._extractWritableFields(e,i);return i.id&&!r.includes("id")&&r.push("id"),i.slug&&!r.includes("slug")&&r.push("slug"),r=r.filter(e=>!t.includes(e)),r}_createDraftProxy(e,t={},n={},i=[],r={},o={},a=this){return new Proxy({},{get:(e,i)=>{if("string"==typeof i||"symbol"==typeof i){if("string"==typeof i&&i in n){const e=n[i],t=r[i];return"function"==typeof t?t(e,n):e}if(t&&"object"==typeof t&&"string"==typeof i&&i in t){const e=t[i],n=r[i];return"function"==typeof n?n(e,t):e}}},set:(t,i,r)=>{if("string"!=typeof i)return!1;const s=a._getAllowedFieldsForCurrentState();if(!s.includes(i)){const t=`[DraftProxy] Le champ "${i}" n'est pas autorisé.`;if(o.throwOnError)throw new ApiValidationError(t,400,[t],{field:i,value:r,allowedFields:s});return e._logger?.warn?.(t),!1}const p=n[i];return p&&"object"==typeof p&&!0===p.__isSignal?p.value=r:n[i]=r,!0},deleteProperty:(e,t)=>{if("string"!=typeof t)return!1;return!!a._getAllowedFieldsForCurrentState().includes(t)&&(delete n[t],!0)},has:(e,i)=>"string"==typeof i&&(i in n||t&&"object"==typeof t&&i in t),ownKeys:()=>{const e=new Set([...Object.keys(t||{}),...Object.keys(n||{})]);return Array.from(e)},getOwnPropertyDescriptor:(e,i)=>{if("string"==typeof i)return i in n||t&&"object"==typeof t&&i in t?{enumerable:!0,configurable:!0}:void 0}})}_extractWritableFields(e={},t={},n={defs:{},visited:new Set}){if(!e||"object"!=typeof e)return[];if(e.$id&&n.visited.has(e.$id))return[];e.$id&&n.visited.add(e.$id),n.defs=e.$defs||e.definitions||n.defs;const i=[];if(e.$ref){const r=e.$ref.replace(/^#\/?(\$defs|definitions)\//,""),o=n.defs[r];o&&i.push(...this._extractWritableFields(o,t,n))}if(e.allOf&&e.allOf.forEach(e=>i.push(...this._extractWritableFields(e,t,n))),e.if&&e.then){const r=e.if.properties;let o=!0;if(r)for(const e in r){const n=r[e]?.const;if(t[e]!==n){o=!1;break}}o&&e.then?i.push(...this._extractWritableFields(e.then,t,n)):!o&&e.else&&i.push(...this._extractWritableFields(e.else,t,n))}return e.properties&&i.push(...Object.entries(e.properties).filter(([e,t])=>!0!==t.readOnly&&void 0===t.const).map(([e])=>e)),Array.from(new Set(i))}_buildDraftAndProxy({data:e={},serverData:t=null,previousDraft:n=null,constant:i,apiClient:r,transforms:o={},throwOnError:a=!0,removeFields:s=[]}){const p=Array.isArray(i)?i:[i],c={allOf:[],$defs:{}};for(const e of p){let t=r.getRequestSchema(e);const n=this._getCtor(),i=n.VIRTUAL_SCHEMAS?.[e];if(i&&(t=this._mergeSchemas(t,i)),!t)throw new ApiError(`Unable to find schema for ${e}.`,404);if(t.$defs)for(const[n,i]of Object.entries(t.$defs))c.$defs[n]?r._logger.warn(`Duplicate $defs key '${n}' from schema '${e}'`):c.$defs[n]=i;c.allOf.push(t)}this._costumCtx?.schema&&c.allOf.push(this._costumCtx.schema);let l=this._extractWritableFields(c,e);e.id&&-1===l.indexOf("id")&&l.push("id"),e.slug&&-1===l.indexOf("slug")&&l.push("slug"),l=l.filter(e=>!s.includes(e)),this._allowedFieldsCache=l,this._allowedFieldsMetadata={combinedSchema:c,transforms:o,removeFields:s};const m=Object.fromEntries(l.map(t=>{const n=e[t];return[t,"function"==typeof o[t]?o[t](n,e):n]}).filter(([e,t])=>void 0!==t)),d=structuredClone?structuredClone(m):JSON.parse(JSON.stringify(m)),u=n&&B(n)?Object.assign(n,m):U(m),y=B(t)?t:t&&"object"==typeof t?U(t):t;return{draft:u,proxy:this._createDraftProxy(r,y,u,l,o,{throwOnError:a}),initial:d}}async _invokeBlockMethod(e,t,n){const i=this[t];return await i.call(this,n)}_isUploadType(e){return!("undefined"==typeof Buffer||!Buffer.isBuffer(e))||("undefined"!=typeof File&&e instanceof File||("undefined"!=typeof Blob&&e instanceof Blob||!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on)))}_compareValues(e,t){return this._isUploadType(e)||this._isUploadType(t)?e!==t:JSON.stringify(this._toRawDeep(e))!==JSON.stringify(this._toRawDeep(t))}_mergeSchemas(e,t){return e?t?{allOf:[e,t],$defs:{...e.$defs,...t.$defs}}:e:t}_hasFieldChanged(e){const t=this._draftData[e],n=this._initialDraftData[e];return this._compareValues(t,n)}async _invokeCustomFieldHandler(e,t,n){const i=this[e];if("function"!=typeof i)throw new ApiError(`Custom handler "${e}" not found for field "${n}"`,500);return await i.call(this,t)}_extractChangedFieldsFromSchema(e,t,n={},i,r=[]){let o=e.getRequestSchema(t);const a=!!this._costumCtx?.schema&&t===this._getCtor().COSTUM_ADD_CONSTANT;a&&(o=this._mergeSchemas(o,this._costumCtx.schema));let s=this._extractWritableFields(o,n);const p={},c=i?.()||{};s=s.filter(e=>!r.includes(e));for(const e of s){if(void 0===n[e])continue;const t=n[e],i=c[e];this._compareValues(t,i)&&(p[e]=t)}if(0===Object.keys(p).length)return null;if(a){const e=this._costumCtx;p[v]={properties:e.schema.properties??{},context:{costumSlug:e.slug,costumId:e.costumId,costumType:e.costumType}}}return p}_extractAllValidFieldsFromSchema(e,t,n={},i,r=[]){const o=e.getRequestSchema(t);let a=this._extractWritableFields(o,n);const s={},p={},c=i?.()||{};a=a.filter(e=>!r.includes(e));for(const e of a){if(void 0===n[e])continue;const t=n[e],i=c[e];JSON.stringify(t)!==JSON.stringify(i)&&(s[e]=t),p[e]=t}return Object.keys(s).length>0?p:null}async _resolveId(e){if(!this.id&&this.slug)try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:this.slug}});if(!t.contextId||t.contextType!==e)throw new ApiResponseError(`Le slug ${this.slug} ne correspond pas à un ${e}`,200,t);this._id(t.contextId)}catch(t){if(t instanceof ApiResponseError){throw t.responseData.contextType!==e?t:new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${this.slug}`,t.status,t.responseData)}throw t}if(!this.id)throw new ApiError(`Impossible de résoudre l'identifiant pour le type ${e}.`,404);return this.id}async _getPublicProfile(){if(await this._resolveId(this.getEntityType()),!this.id)throw new ApiError("L'identifiant de l'entité n'est pas défini.",400);const e=this.getEntityType();if("news"===e||"comments"===e)throw new ApiError(`getElementsAbout ne supporte pas le type '${e}'.`,400);return this.endpointApi.getElementsAbout({pathParams:{id:this.id,type:e},tpl:"ficheInfoElement"})}_getEntityMeta(e){const t=this.constructor,n=this.__entityTag,i={EndpointApi:this.deps.EndpointApi,User:"User"===n?t:this.deps.User,Organization:"Organization"===n?t:this.deps.Organization,Project:"Project"===n?t:this.deps.Project,Event:"Event"===n?t:this.deps.Event,Poi:"Poi"===n?t:this.deps.Poi,Badge:"Badge"===n?t:this.deps.Badge,News:"News"===n?t:this.deps.News,Comment:"Comment"===n?t:this.deps.Comment,Answer:"Answer"===n?t:this.deps.Answer,Form:"Form"===n?t:this.deps.Form,Classified:"Classified"===n?t:this.deps.Classified,Action:"Action"===n?t:this.deps.Action};return{classifieds:{entityClass:i.Classified,deps:{...i}},citoyens:{entityClass:i.User,deps:i},organizations:{entityClass:i.Organization,deps:i},projects:{entityClass:i.Project,deps:i},events:{entityClass:i.Event,deps:{...i,Badge:void 0}},poi:{entityClass:i.Poi,deps:{...i,Badge:void 0,News:void 0}},news:{entityClass:i.News,deps:{...i}},badges:{entityClass:i.Badge,deps:{EndpointApi:i.EndpointApi,User:i.User,Organization:i.Organization,Project:i.Project}},comments:{entityClass:i.Comment,deps:{...i}},answers:{entityClass:i.Answer,deps:{...i}},forms:{entityClass:i.Form,deps:{...i}},actions:{entityClass:i.Action,deps:{...i}}}[e]||null}_linkEntity(e,t){const n=this._getEntityMeta(e);return n?n.entityClass.fromServerData(t,this,n.deps):t}_linkNestedEntity(e){if(!e||"object"!=typeof e)return e;if(!e.id||!e.type)return e;try{return this._linkEntity(e.type,e)}catch(t){return this.apiClient._logger?.warn?.(`Impossible de lier l'entité imbriquée de type ${e.type}:`,t),e}}async _linkEntityById(e,t,n){const i=this._getEntityMeta(e);if(!i)return null;const r=new i.entityClass(this,{id:t},i.deps);return n?.skipGet||await r.get(),r}_linkEntities(e){return e.flatMap(e=>e?.collection?[this._linkEntity?.(e.collection,e)??e]:(this.apiClient._logger?.warn?.(`Objet ignoré car sans 'collection' : ${e?.id}`),[]))}async linkEntitiesFromServerData(e,t={},n={}){const i=n.key||e,r="function"==typeof n.mapFn?n.mapFn:null,o=e=>!0===e||"true"===e,a=e=>!1===e||"false"===e,s=this.serverData?.[i],p=[];if(s&&"object"==typeof s&&Object.keys(s).length>0)for(const n of Object.keys(s)){const i=s[n],c=Object.entries(t).every(([e,t])=>{const n=i[e];if("function"==typeof t)try{return t(n)}catch(t){return console.warn(`Erreur dans le filtre personnalisé pour ${e}`,t),!1}return t instanceof RegExp?"string"==typeof n&&t.test(n):"string"==typeof t&&"string"==typeof n?n.toLowerCase().includes(t.toLowerCase()):o(t)?o(n):a(t)?a(n):"string"!=typeof n||"string"!=typeof t||isNaN(Date.parse(n))||isNaN(Date.parse(t))?n===t:new Date(n).getTime()===new Date(t).getTime()});if(c)try{const t=await this._linkEntityById(e,n);t&&(t.meta=i,p.push(r?r(t):t))}catch(t){this.apiClient._logger?.error?.(`Erreur lors de la récupération de l'entité ${e} (${n}) :`,t)}}return p}_entityInstanceData(e,t,n={}){const i=this._getEntityMeta(e);if(!i)throw new ApiError(`Type d'entité inconnu: ${e}`,400);const r=this.__entityTag,o=this.constructor;return new i.entityClass(this,t,{[r]:o,...i.deps},n)}async entity(e,t={},n={}){try{const i=this._entityInstanceData(e,t,n),r={citoyens:["id","slug"],organizations:["id","slug"],projects:["id","slug"],events:["id","slug"],poi:["id","slug"],news:["id"],badges:["id"],comments:[],answers:["id"],classifieds:["id"],actions:["id"],forms:["id"]}[e];return r&&this._hasAtLeastOne(t,r)&&await i.get(),i}catch(t){throw this.apiClient._logger.error(`[Api.${this.__entityTag}.${e}] Erreur lors de la création d'une instance ${e} :`,t.message),t}}async entityBySlug(e){if(!e)throw new ApiError("Le slug est requis.",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType){const e=await this.entity(t.contextType,{id:t.contextId});return await this._fixEntityUserContext(e),e}throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}async _fixEntityUserContext(e){const t=e.getEntityType();if(!["events","projects","poi"].includes(t))return;const n=this._extractRealParent(e);if(!n)return;const i=await this._findOrCreateParent(n);i&&i!==e.parent&&(e.userContext=this._extractUserContext(i),e.parent=i)}_extractRealParent(e){const t=e.serverData;if("events"===e.getEntityType()){const e=t;if(e.organizer){const t=Object.entries(e.organizer),n=t.find(([e,t])=>"projects"===t.type);if(n)return{type:"projects",id:n[0]};const i=t.find(([e,t])=>"organizations"===t.type);if(i)return{type:"organizations",id:i[0]};const r=t.find(([e,t])=>"citoyens"===t.type);if(r)return{type:"citoyens",id:r[0]};const o=t[0];if(o&&o[1])return{type:o[1].type,id:o[0]}}}const n=t;if(n.parent){const e=Object.entries(n.parent)[0];if(e&&e[1])return{type:e[1].type,id:e[0]}}return null}async _findOrCreateParent(e){try{let t=this.parent;for(;t;){if(t.id===e.id&&t.getEntityType()===e.type)return t;t=t.parent}const n={citoyens:"citoyens",organizations:"organizations",projects:"projects"}[e.type];if(n){const t=this._entityInstanceData(n,{id:e.id});return await t.get(),t}return null}catch(e){return this.apiClient._logger?.warn?.("Impossible de créer le parent réel:",e),null}}_extractUserContext(e){return"User"===this.getEntityTag(e?.__entityTag)?e:e.userContext||null}_isAdminViaHierarchy(){const e=this.getEntityType(),t=this.serverData;let n;if("events"===e)n=t?.organizer;else{if("projects"!==e&&"poi"!==e&&"classifieds"!==e&&"actions"!==e)return!1;n=t?.parent}if(!n||"object"!=typeof n)return!1;for(const[e,t]of Object.entries(n)){if(!t||"object"!=typeof t)continue;const n=t.type;if(n&&this._isAdminOfParent(e,n))return!0}return!1}_isAdminOfParent(e,t){const n=this.userContext?.serverData?.links;if(!n)return!1;let i;if("citoyens"===t)return!1;if("organizations"===t)i="memberOf";else{if("projects"!==t)return!1;i="projects"}const r=n[i];if(!r)return!1;const o=r[e];return this._validateUserLink(o)&&!0===o?.isAdmin&&!o?.isAdminPending}_buildLinkFilters(e,{linkType:t,isAdmin:n,isAdminPending:i,isInviting:r,toBeValidated:o=!1,roles:a=[]}){if("string"!=typeof e||null===e)throw new TypeError("id doit être une chaîne non-nulle.");if("string"!=typeof t)throw new TypeError("linkType doit être une chaîne.");if(void 0!==n&&"boolean"!=typeof n)throw new TypeError("isAdmin doit être un booléen.");if(void 0!==i&&"boolean"!=typeof i)throw new TypeError("isAdminPending doit être un booléen.");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError("isInviting doit être un booléen.");if(void 0!==o&&"boolean"!=typeof o)throw new TypeError("toBeValidated doit être un booléen.");if(!Array.isArray(a))throw new TypeError("roles doit être un tableau de chaînes.");const s=`links.${t}.${e}`,p={[`${s}`]:{$exists:!0}};return"boolean"==typeof o&&(p[`${s}.toBeValidated`]={$exists:o}),"boolean"==typeof r&&(p[`${s}.isInviting`]={$exists:r}),!0===n&&(p[`${s}.isAdmin`]={$exists:!0}),!0===i&&(p[`${s}.isAdminPending`]={$exists:!0}),a.length>0&&(p[`${s}.roles`]={$in:a}),p}_getLinkMeta(){const e=this.getEntityType(),t={organizations:{linkType:"memberOf",connectTypeConnect:"member",connectTypeDisconnect:"members"},projects:{linkType:"projects",connectTypeConnect:"contributor",connectTypeDisconnect:"contributors"},events:{linkType:"events",connectTypeConnect:"attendee",connectTypeDisconnect:"attendees"},citoyens:{linkType:"friends",connectTypeConnect:"friend",connectTypeDisconnect:"friends"}}[e];if(!t)throw new ApiError(`Aucune correspondance de lien définie pour le type d'entité "${e}"`,404);return t}_checkLinkableEntity(){try{this._getLinkMeta()}catch(e){if(e instanceof ApiError)throw new ApiError(`L'entité "${this.getEntityType()}" ne prend pas en charge les actions de lien.`,400);throw e}}_getLinkFromConnectedUser(){const{linkType:e}=this._getLinkMeta();if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);return this?.userContext?.serverData?.links?.[e]?.[this.id]||null}async _submitLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){this._assertNotEntityType("connect",["poi","badges","news","actions"]);const t=this.getEntityType(),n={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:e},i=await this.callIsMe(()=>this.endpointApi.connect(n));return await(this.userContext?.refresh()),i}if(t.isInviting)return this._acceptLinkRequest();if(t.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation.",400);throw new ApiError("Vous êtes déjà connecté à cette entité.",400)}async _submitLinkRequestAdmin(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(!e){this._assertNotEntityType("connect",["poi","badges","news","actions"]);const e=this.getEntityType(),t={childId:this.userId,childType:"citoyens",parentType:e,parentId:this.id,connectType:"admin"},n=await this.callIsMe(()=>this.endpointApi.connect(t));return await(this.userContext?.refresh()),n}if(e.isInviting||e.isAdminInviting)return this._acceptLinkRequest();if(e.toBeValidated&&e.isAdminPending)throw new ApiError("Vous êtes déjà en attente de validation pour devenir admin.",400);if(e.toBeValidated)throw new ApiError("Vous êtes déjà en attente de validation pour rejoindre cette entité.",400);throw new ApiError("Vous êtes déjà connecté à cette entité.",400)}async _acceptLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(e&&(e.isInviting||e.isAdminInviting)){this._assertNotEntityType("linkValidate",["poi","badges","news","actions"]);const e=this.getEntityType(),t={childId:this.userId,childType:"citoyens",parentType:e,parentId:this.id,linkOption:"isInviting"},n=await this.callIsMe(()=>this.endpointApi.linkValidate(t));return await(this.userContext?.refresh()),n}throw new ApiError("Vous n'avez pas d'invitation à valider.",400)}async _leaveLinkRequest(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.",404);this._assertNotEntityType("disconnect",["poi","badges","news","actions"]);const t=this.getEntityType(),n={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:e},i=await this.callIsMe(()=>this.endpointApi.disconnect(n));return await(this.userContext?.refresh()),i}async get(){return this.apiClient.safeCall(async()=>{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e})}async updateSettings(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateSettings",["poi","badges","news","actions"]);const t=this.getEntityType(),{type:n,value:i}=e;if("string"!=typeof n)throw new ApiValidationError("Le champ 'type' est requis (string).",400,["type requis"]);const r={type:n,value:i,idEntity:this.id,typeEntity:t};return this.callIsConnected(()=>this.endpointApi.updateSettings(r))}async updateDescription(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateDescription",["badges","news","actions"]);const t=this.getEntityType(),n={block:"descriptions",id:this.id,typeElement:t,...e};return this.callIsConnected(()=>this.endpointApi.updateBlockDescription(n))}async updateInfo(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateInfo",["badges","news","actions"]);const t=this.getEntityType(),n={block:"info",id:this.id,typeElement:t,...e};return this.callIsConnected(()=>this.endpointApi.updateBlockInfo(n))}async updateSocial(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateSocial",["badges","news","poi","events","actions"]);const t=this.getEntityType(),n={block:"network",id:this.id,typeElement:t,...e};return this.callIsConnected(()=>this.endpointApi.updateBlockSocial(n))}_isPostalAddress(e){return!!e&&"object"==typeof e&&"PostalAddress"===e["@type"]&&"string"==typeof e.addressCountry&&"string"==typeof e.addressLocality&&"string"==typeof e.level1&&"string"==typeof e.level1Name&&"string"==typeof e.codeInsee&&"string"==typeof e.localityId}_isGeo(e){return!(!e||"object"!=typeof e||"number"!=typeof e.latitude&&"string"!=typeof e.latitude||"number"!=typeof e.longitude&&"string"!=typeof e.longitude)}_isGeoPosition(e){return!!e&&"object"==typeof e&&"Point"===e.type&&Array.isArray(e.coordinates)&&2===e.coordinates.length&&("number"==typeof e.coordinates[0]||"string"==typeof e.coordinates[0])&&("number"==typeof e.coordinates[1]||"string"==typeof e.coordinates[1])&&!0===e.float}async updateLocality(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(this._assertNotEntityType("updateLocality",["badges","news","comments","answers","actions"]),!("address"in e))throw new ApiValidationError("Le champ 'address' est requis.",400,["address requis"]);const t=e.address;if(""!==t&&!this._isPostalAddress(t))throw new ApiValidationError("Format de 'address' invalide.",400,["address invalide"]);const n=t,i=this.getEntityType(),r={block:"localities",id:this.id,typeElement:i,address:n,..."geo"in e&&this._isGeo(e.geo)?{geo:e.geo}:{},..."geoPosition"in e&&this._isGeoPosition(e.geoPosition)?{geoPosition:e.geoPosition}:{},..."locality"in e?{locality:e.locality}:{}};return this.callIsConnected(()=>this.endpointApi.updateBlockLocality(r))}async updateSlug({slug:e}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateSlug",["badges","news","comments","actions"]);const t=this.getEntityType();try{await this.endpointApi.check({block:"info",type:t,id:this.id,slug:e})}catch(e){if(e instanceof ApiResponseError)throw new ApiResponseError("Erreur lors de la vérification du slug.",e.status,e.responseData);throw e}const n={block:"info",typeElement:t,id:this.id,slug:e};return this.callIsConnected(()=>this.endpointApi.updateBlockSlug(n))}async updateImageProfil({profil_avatar:e}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateImageProfil",["badges","news","comments","answers","actions"]);const t=this.getEntityType();e=await this._validateImage(e);const n={pathParams:{folder:t,ownerId:this.id},profil_avatar:e};return this.callIsConnected(()=>this.endpointApi.profilImage(n))}async updateImageBanner({banner:e,cropW:t,cropH:n,cropX:i,cropY:r}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("updateImageBanner",["badges","news","comments","answers","actions"]);const o=this.getEntityType();e=await this._validateImage(e);const a={pathParams:{folder:o,ownerId:this.id},parentType:o,parentId:this.id,formOrigin:"banner",cropW:t,cropH:n,cropX:i,cropY:r,banner:e};return this.callIsConnected(()=>this.endpointApi.profilBanner(a))}async organization(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",403);return await this.entity("organizations",e)}async project(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un projet.",401);return await this.entity("projects",e)}async poi(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un POI.",401);return await this.entity("poi",e)}async classified(e={}){if(!("id"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer une ressource.",401);return await this.entity("classifieds",e)}async event(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un événement.",401);return await this.entity("events",e)}async badge(e={}){if(!("id"in e)&&!this.isConnected)throw new ApiError("Vous devez être connecté pour créer un badge.",401);return await this.entity("badges",e)}async news(e={}){if(!e?.id&&!this.isConnected)throw new ApiError("Vous devez être connecté.",401);return await this.entity("news",e)}async action(e={}){throw new ApiError(`action n'existe pas dans ${this.constructor.name}`,501)}async form(e={}){return await this.entity("forms",e)}async answer(e={}){throw new ApiError(`answer n'existe pas dans ${this.constructor.name}`,501)}async getOrganizations(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getOrganizations",restoredState:t?.restoredState,finalizer:async e=>{this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}});return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getOrganizationsAdmin(e)):()=>this.endpointApi.getOrganizationsNoAdmin(e))()}}).next()}async getProjects(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_PROJECTS_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getProjects",restoredState:t?.restoredState,finalizer:async e=>{this.isMe?(e.pathParams={type:this.getEntityType(),id:this.id},e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}}):(delete e?.pathParams,e.filters={$or:{[`links.contributors.${this.id}`]:{$exists:!0},[`parent.${this.id}`]:{$exists:!0}},[`links.contributors.${this.id}`]:{$exists:!0}});return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getProjectsAdmin(e)):()=>this.endpointApi.getProjectsNoAdmin(e))()}}).next()}async getEvents(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_EVENTS","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getEvents",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,e.filters={$or:{[`links.attendees.${this.id}`]:{$exists:!0},[`organizer.${this.id}`]:{$exists:!0}}},this.endpointApi.getEvents(e))}).next()}async getPois(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_POIS_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getPois",restoredState:t?.restoredState,finalizer:async e=>{this.isMe?e.pathParams={type:this.getEntityType(),id:this.id}:(delete e?.pathParams,e.filters={[`parent.${this.id}`]:{$exists:!0}});return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getPoisAdmin(e)):()=>this.endpointApi.getPoisNoAdmin(e))()}}).next()}async getSubscribers(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIBERS","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getSubscribers",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,e.filters={[`links.follows.${this.id}`]:{$exists:!0},[`links.follows.${this.id}.toBeValidated`]:{$exists:!1},[`links.follows.${this.id}.isInviting`]:{$exists:!1}},this.endpointApi.getSubscribers(e))}).next()}async getBadgesIssuer(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_BADGES","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getBadgesIssuer",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,e.filters=e.filters||{"preferences.private":!1},e.filters.$or={},e.filters.$or[`issuer.${this.id}`]={$exists:!0},this.endpointApi.getBadges(e))}).next()}async getNews(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("getNews",["badges","news","poi","events","comments","answers","actions"]);const t=this.getEntityType(),n="dateLimit"in e&&"number"==typeof e.dateLimit?{dateLimit:e.dateLimit}:{dateLimit:0},i="indexStep"in e&&"number"==typeof e.indexStep?{indexStep:e.indexStep}:{indexStep:12},r="search"in e&&"object"==typeof e.search&&null!==e.search&&"name"in e.search&&"string"==typeof e.search.name?{search:{name:e.search.name}}:{},o={pathParams:{type:t,id:this.id,isLive:!0},...n,...i,...r},a=await this.endpointApi.getNews(o);if(!Array.isArray(a))throw new ApiResponseError("Erreur lors de la récupération des actualités.",500,a);const s=this._linkEntities(a);return this._createFilteredProxy(s)}async getGallery(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);this._assertNotEntityType("getGallery",["badges","news","poi","events","comments","answers","actions"]);const t={pathParams:{type:this.getEntityType(),id:this.id,docType:e.pathParams?.docType||"image"}};return await this.endpointApi.getGallery(t)}async searchMembers(e){const t=await this.endpointApi.searchMemberAutocomplete(e);if(!t||!Array.isArray(t))return[];this._assertNotEntityType("searchMembers",["badges","news","poi","comments","actions"]),t.forEach(e=>{for(const t of Object.keys(e))["id","name","slug","profilThumbImageUrl","profilMarkerImageUrl","type","collection"].includes(t)||delete e[t]});return this._linkEntities(t)}async requestToJoin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequest()}async requestToJoinAdmin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._submitLinkRequestAdmin()}async requestPromoteToAdmin(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);const e=this._getLinkFromConnectedUser();if(!e)throw new ApiError("vous n'êtes pas membre de cette entité.",400);if(e?.isAdmin&&(e?.isInviting||e?.isAdminInviting))throw new ApiError("Cet utilisateur est déjà en cours d'invitation en tant qu'admin.",400);if(e?.isAdmin&&!e?.isInviting&&!e?.isAdminInviting)throw new ApiError("Cet utilisateur est déjà admin.",400);const t=this.getEntityType(),n=["organizations","projects"];if(!n.includes(t))throw new ApiError(`L'entité doit être de type : ${n.join(", ")}, reçu : ${t}`,400);const i=t,r={childId:this.userId,childType:"citoyens",parentType:i,parentId:this.id,connectType:"admin"},o=await this.callIsMe(()=>this.endpointApi.connect(r));return await(this.userContext?.refresh()),o}async acceptInvitation(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._acceptLinkRequest()}async leave(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour envoyer une demande de participation.",401);return this._checkLinkableEntity(),this._leaveLinkRequest()}async follow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour suivre cette entité.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401);this._assertNotEntityType("follow",["badges","news","poi","comments","actions"]);const e=this.getEntityType();if(!(this.userContext?.serverData?.links?.follows?.[this.id]||null)){const t={childId:this.userId,childType:"citoyens",parentType:e,parentId:this.id},n=await this.callIsMe(()=>this.endpointApi.follow(t));return await(this.userContext?.refresh()),n}throw new ApiError("Vous êtes déjà abonné à cette entité.",409)}async unfollow(){if(!this.isMe)throw new ApiError("Vous devez être connecté pour vous désabonner.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401);const e=this.userContext?.serverData?.links?.follows?.[this.id]||null;this._assertNotEntityType("unfollow",["badges","news","poi","actions"]);const t=this.getEntityType();if(e){const e={childId:this.userId,childType:"citoyens",parentType:t,parentId:this.id,connectType:"followers"},n=await this.callIsMe(()=>this.endpointApi.disconnect(e));return await(this.userContext?.refresh()),n}throw new ApiError("Vous n'êtes pas abonné à cette entité.",404)}_checkAccess(e="effectuer cette action"){if(!this.isMe)throw new ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404)}_validateUserLink(e){if(!e)return!1;const{toBeValidated:t,isInviting:n,isAdminInviting:i,isAdminPending:r}=e;return!(t||n||i||r)}_assertEntityType(...e){const t=Array.isArray(e[0])?e[0]:e;if(!t.includes(this.getEntityType()))throw new ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.getEntityType()}`,400)}_assertNotEntityType(e,...t){const n=Array.isArray(t[0])?t[0]:t,i=this.getEntityType();if(n.includes(i))throw new ApiError(`Le type d'entité "${i}" n'est pas supporté par ${e}.`,400)}_getValidatedUserLink(e,t,n){const i=n?.silent??!0;try{this._checkAccess(e),this._assertEntityType(...t)}catch(e){if(i)return null;throw e}return this._getLinkFromConnectedUser()}_isLinked(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t=this.userContext?.serverData?.links;return!!t&&!!t[e]?.[this.id]}isAuthor(e){const t=e?.silent??!0;try{if(this._checkAccess("vérifier l'auteur"),!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401)}catch(e){if(t)return!1;throw e}const n=this.serverData;return!!n.creator&&Boolean(this.userId&&"string"==typeof n.creator&&n.creator===this.userId)}isAdmin(e){const t=this._getValidatedUserLink("vérifier l'administrateur",["organizations","projects","events","classifieds"],{silent:e?.silent});return!(!this._validateUserLink(t)||!0!==t?.isAdmin||t?.isAdminPending)||!!e?.checkHierarchy&&this._isAdminViaHierarchy()}isAuthorOrAdmin(e){return this.isAuthor()||this.isAdmin(e)}isMember(e){const t=this._getValidatedUserLink("vérifier le membre",["organizations"],{silent:e?.silent});return this._validateUserLink(t)}isContributor(e){const t=this._getValidatedUserLink("vérifier le contributeur",["projects"],{silent:e?.silent});return this._validateUserLink(t)}isAttendee(e){const t=this._getValidatedUserLink("vérifier le participant",["events"],{silent:e?.silent});return this._validateUserLink(t)}isFollower(e){const t=e?.silent??!0,n=["citoyens","organizations","projects","events","poi"];try{this._checkAccess("vérifier si il vous suit"),this._assertEntityType(...n)}catch(e){if(t)return!1;throw e}return this._isLinked("followers")}isFollowing(e){const t=e?.silent??!0,n=["citoyens","organizations","projects","events","poi"];try{this._checkAccess("vérifier si vous le suivez"),this._assertEntityType(...n)}catch(e){if(t)return!1;throw e}return this._isLinked("follows")}isToBeValidated(e){const t=this._getValidatedUserLink("vérifier si il est à valider",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.toBeValidated}isInviting(e){const t=this._getValidatedUserLink("vérifier si il est invité",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.isInviting}isInvitingAdmin(e){const t=this._getValidatedUserLink("vérifier si il est invité admin",["organizations","projects","events"],{silent:e?.silent});return!!t&&((!0===t.isAdminInviting||!0===t.isInviting)&&!0===t.isAdmin)}isAdminPending(e){const t=this._getValidatedUserLink("vérifier si il est en attente admin",["organizations","projects","events"],{silent:e?.silent});return!!t&&(!0===t.isAdmin&&!0===t.isAdminPending)}async getCostumJson(){if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);const e=this.serverData;if(!e||"string"!=typeof e.slug||""===e.slug.trim())throw new ApiError("slug de l'entité non défini",400);const t={pathParams:{slug:e.slug}};return this.endpointApi.getCostumJson(t)}_generateRanges(e,t,n={}){const i={};for(const r of e){const e=n[r]||{indexMax:0};i[r]={indexMin:e.indexMax||0,indexMax:e.indexMax+t}}return i}_normalizeCount(e={}){return delete e.spam,e.total=Object.values(e).reduce((e,t)=>e+("number"==typeof t?t:0),0),e}_getDefaultFromEndpoint(e,t){const n=this.apiClient.getRequestSchema(e);if(n?.properties?.[t])return n.properties[t].default}_createPaginatorEngine({initialData:e,finalizer:t,methodName:n,restoredState:i}){const r=this,o=i?{...i}:{cursor:null,count:0,index:0,history:[],sizes:[]},a=e=>Boolean(e?.indexStep&&e.indexStep>0),s=e=>null!=e&&(("string"==typeof e||!!Array.isArray(e))&&e.length>0);async function p(i=!1){const c={...e};o.cursor&&(i||0!==o.history.length)||(o.count=0,o.index=0,o.history=[],o.sizes=[],c.countType=c.searchType,!s(c.searchBy)&&a(c)?(c.ranges=r._generateRanges(c.searchType,c.indexStep),c.indexMin=c.indexMin??0,c.indexMax=c.indexMax??c.indexStep):s(c.searchBy)&&a(c)&&(c.indexMin=c.indexMin??0,c.indexMax=c.indexMax??c.indexStep),o.cursor={...c});const l=o.cursor;i&&l&&(o.history.push({...l}),!s(l.searchBy)&&a(l)?(l.ranges=r._generateRanges(l.searchType,l.indexStep,l.ranges),l.indexMin=l.indexMax??0,l.indexMax=(l.indexMax??0)+l.indexStep):s(l.searchBy)&&a(l)&&(l.indexMin=l.indexMax??0,l.indexMax=(l.indexMax??0)+l.indexStep),o.cursor={...l});const m={...o.cursor||{}};if(!i){const e=m.searchType;if(!Array.isArray(e)||0===e.length)throw new Error("searchType non défini")}const d=await t(m);if(!Array.isArray(d.results))throw new Error("Les résultats doivent être un tableau");o.count+=d.results.length,o.sizes.push(d.results.length),i&&o.index++;const u=r._normalizeCount(d.count),y=r._linkEntities(d.results),h=a(m)&&o.count<u.total,f=o.history.length>0;return{count:u,results:y,pageIndex:o.index,pageNumber:o.index+1,hasNext:h,hasPrev:f,next:h?()=>p(!0):void 0,prev:f?async()=>{const e=o.history.pop(),t=o.sizes.pop()??0;return o.count-=t,o.index=Math.max(0,o.index-1),o.cursor={...e},p(!1)}:void 0,_initialData:{...e},_state:o,_entity:r,_methodName:n}}return{next:()=>p(!1)}}_withCostumContext(e){return async t=>{if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);const n=this.serverData;if(!n||"string"!=typeof n.slug||""===n.slug.trim())throw new ApiError("slug de l'entité non défini",400);if(!n.id||"string"!=typeof n.id)throw new ApiError("id de l'entité non défini",400);const i=Array.isArray(t?.sourceKey)?t.sourceKey:[],r=i.length>0?i:[n.slug],o={...t||{},costumSlug:n.slug,contextId:n.id,contextType:this.getEntityType(),costumId:n.id,costumType:this.getEntityType(),sourceKey:r};return e(o)}}async searchCostum(e={},t){const n=t?.restoredState?.meta?.variant,i=t?.variant??n??"default",r=Q[i],o=this._createPaginatorEngine({initialData:e,methodName:"searchCostum",restoredState:t?.restoredState,finalizer:this._withCostumContext(e=>this.endpointApi[r].call(this.endpointApi,e))}),a=await o.next();return a._state&&(a._state.meta={...a._state.meta||{},variant:i}),a}async costumEventRequestActors(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e},n=this._withCostumContext(e=>this.endpointApi.costumEventRequestActors(e));return await n(t)}async costumEventRequestSubevents(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestSubevents(e))(t)}async costumEventRequestDates(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestDates(e))(t)}async costumEventRequestElementEvent(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestElementEvent(e))(t)}async costumEventRequestCategories(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestCategories(e))(t)}async costumEventRequestEvent(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestEvent(e))(t)}async costumEventRequestLinkTlToEvent(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!e.tl&&!e.event)throw new ApiError("Les paramètres 'tl' et 'event' sont requis.",400);if("string"!=typeof e.tl||"string"!=typeof e.event)throw new ApiError("Les paramètres 'tl' et 'event' doivent être des chaînes de caractères.",400);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestLinkTlToEvent(e))(t)}async costumEventRequestLoadContextTag(e={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={pathParams:{id:this.id,type:this.getEntityType()},...e};return this._withCostumContext(e=>this.endpointApi.costumEventRequestLoadContextTag(e))(t)}async coformAnswersSearch(e={},t){e.searchType=e.searchType??["answers"];return this._createPaginatorEngine({initialData:e,methodName:"coformAnswersSearch",restoredState:t?.restoredState,finalizer:this._withCostumContext(e=>this.endpointApi.coformAnswersSearch(e))}).next()}async searchAnswersByForms(e={}){if(!e.forms||Array.isArray(e.forms)||0===Object.keys(e.forms).length)throw new ApiError("Le paramètre 'forms' est requis et doit être un objet non vide.",400);return(await this.endpointApi.coformAnswersByForms(e)).map(e=>({...e,answers:this._linkEntities(Object.values(e.answers||{}))}))}async fundingEnvelope(e={}){const t=this._withCostumContext(e=>this.endpointApi.fundingEnvelope(e)),n=await t(e);return{...n,...n.contextData&&{contextData:this._linkEntity(n.contextData.collection,n.contextData)??n.contextData},...n.context&&{context:this._linkEntity(n.context.collection,n.context)??n.context},...n.nopropProject&&{nopropProject:this._linkEntities(Object.values(n.nopropProject))??n.nopropProject},...n.projects&&{projects:n.projects.map(e=>{const t=e?.project;let n=e.project;t&&"object"==typeof t&&(n=this._linkEntity(t.collection??"projects",t)??e.project);const i=e.serverData;return i?.actions&&Array.isArray(i.actions)&&n&&"function"==typeof n._linkEntity&&(i.actions=i.actions.map(e=>n._linkEntity("actions",e)??e)),{...e,project:n}})},...n.userOrga&&{userOrga:this._linkEntities(Object.values(n.userOrga))??n.userOrga}}}async coformFiltersSearch(e={}){return this._withCostumContext(e=>this.endpointApi.costumFilterCoform(e))(e)}async coformFilterByPath(e){if(!e?.params||"string"!=typeof e.params.thematicPath||""===e.params.thematicPath.trim())throw new ApiError("coformFilterByPath : params.thematicPath est requis (string non vide).",400);const t=this._withCostumContext(e=>this.endpointApi.costumFilterCoformByPath(e)),n=await t(e),i=Array.isArray(n?.results)?n.results:[];let r=[];const o=[];for(const e of i)e&&"object"==typeof e&&("distinctElements"!==e.id?o.push({name:"string"==typeof e.name?e.name:String(e.id??""),image:"string"==typeof e.image?e.image:"",orgaNameArray:Array.isArray(e.orgaNameArray)?e.orgaNameArray.map(e=>String(e)):[]}):r=Object.entries(e).filter(([e])=>/^\d+$/.test(e)).sort(([e],[t])=>Number(e)-Number(t)).map(([,e])=>String(e)));return{distinctElements:r,values:o,count:n?.count&&"object"==typeof n.count?n.count:{answers:o.length}}}async searchZone(e){if(!e.countryCode?.length||!e.level?.length)throw new ApiError("countryCode et level sont requis.",400);return this._withCostumContext(e=>this.endpointApi.searchZones(e))(e)}async getCountries(e={}){return this.endpointApi.getCountries(e)}async generateNewAnswerId(e){if(!e||"string"!=typeof e)throw new ApiError("formId est requis et doit être une chaîne de caractères.",400);const t=await this.endpointApi.generateAnswerFromForm({pathParams:{formId:e},action:"new"});return this._linkEntity?.(t.collection,t)??t}async linkDiscourseAccount(e){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.linkDiscourseAccount({...e,costumId:e.contextId,costumType:e.contextType}))({username:e})}async unlinkDiscourseAccount(){return this._withCostumContext(e=>this.endpointApi.unlinkDiscourseAccount({...e,costumId:e.contextId,costumType:e.contextType}))({})}async getDiscourseProfile(e){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.discourseProfile({...e,costumId:e.contextId,costumType:e.contextType}))({username:e})}async checkDiscourseEmailMatch(){return this._withCostumContext(e=>this.endpointApi.discourseCheckEmail({...e,costumId:e.contextId,costumType:e.contextType}))({})}async dismissDiscourseLink(){return this._withCostumContext(e=>this.endpointApi.discourseDismissLink({...e,costumId:e.contextId,costumType:e.contextType}))({})}async linkMediaWikiAccount(e){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.linkMediawikiAccount({...e,costumId:e.contextId,costumType:e.contextType}))({username:e})}async unlinkMediaWikiAccount(){return this._withCostumContext(e=>this.endpointApi.unlinkMediawikiAccount({...e,costumId:e.contextId,costumType:e.contextType}))({})}async getMediaWikiContributions(e,t){if(!e||"string"!=typeof e)throw new ApiError("username est requis et doit être une chaîne de caractères.",400);return this._withCostumContext(e=>this.endpointApi.getMediawikiContributions({...e,costumId:e.contextId,costumType:e.contextType}))({username:e,limit:t})}async coremuOperation(e){if(!e.form||"string"!=typeof e.form)throw new ApiError("form est requis et doit être une chaîne de caractères.",400);if(!e.project||"string"!=typeof e.project)throw new ApiError("project est requis et doit être une chaîne de caractères.",400);const t={...e,answer:"new",action:"generateproposition"},n=await this.endpointApi.coremuOperation(t);return this._linkEntity(n?.collection,n)??n}static restorePaginationFromJSON(e,t){const n=t instanceof BaseEntity?t:b(e._entity,t),i=e.results.map(e=>b(e,n)),r=e._methodName,o=e._initialData,a=e._state;return{results:i,count:e.count,hasNext:e.hasNext,hasPrev:e.hasPrev,pageIndex:e.pageIndex,pageNumber:e.pageNumber,next:e.hasNext?async()=>{const e=n[r];if("function"!=typeof e)throw new Error(`Méthode ${r} non trouvée sur l'entité`);const t=await e.call(n,o,{restoredState:a});return t.next?.()??t}:void 0,prev:e.hasPrev?async()=>{const e=n[r];if("function"!=typeof e)throw new Error(`Méthode ${r} non trouvée sur l'entité`);const t=await e.call(n,o,{restoredState:a});return t.prev?.()??t}:void 0,_initialData:o,_state:a,_entity:n,_methodName:r}}}class Action extends BaseEntity{static entityType="actions";static entityTag="Action";static SCHEMA_CONSTANTS=["COSTUM_PROJECT_ACTION_REQUEST_NEW","VIRTUAL_ACTION_EDITABLE"];static VIRTUAL_SCHEMAS={VIRTUAL_ACTION_EDITABLE:{type:"object",properties:{name:{type:"string"},credits:{type:"integer"},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},status:{type:"string",enum:["todo","done"]},tags:{type:"array",items:{type:"string"}},links:{type:"object"},startDate:{oneOf:[{type:"string"},{type:"null"}]},endDate:{oneOf:[{type:"string"},{type:"null"}]},milestone:{oneOf:[{type:"object"},{type:"null"}]},importance:{type:"string"}}}};static ADD_BLOCKS=new Map([["COSTUM_PROJECT_ACTION_REQUEST_NEW","addAction"]]);static CUSTOM_FIELD_HANDLERS=new Map([["name",{updateMethod:"updateName",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["credits",{updateMethod:"updateCredits",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["min",{updateMethod:"updateMin",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["max",{updateMethod:"updateMax",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["status",{updateMethod:"updateStatus",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["tags",{updateMethod:"updateTags",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["links",{updateMethod:"updateContributors",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["startDate",{updateMethod:"updateStartDate",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["endDate",{updateMethod:"updateEndDate",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["milestone",{updateMethod:"updateMilestone",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}],["importance",{updateMethod:"updateImportance",schemaConstant:"VIRTUAL_ACTION_EDITABLE"}]]);static CREATE_ONLY_FIELDS={mentions:"Utilise joinContributor/leaveContributor/updateContributors à la place.",is_contributor:"Flag de création one-shot (auto-ajoute le créateur comme admin contributor).",assign:"Flag de création one-shot (assigne un user comme admin contributor à la création).",urls:"Non modifiable en update (à confirmer empiriquement avec le backend).",idParentRoom:"Auto-géré par le backend (Room::getOrCreateActionRoom).",timeSpent:"Modifié implicitement par le flow status=done (auto-injecte updateStatus[N].timeSpent côté backend)."};static UPDATE_BLOCKS=new Map([]);defaultFields={parentType:"projects"};removeFields=["parentType","parentId"];_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);if(!this.parent?.id)throw new ApiError("Le parent (Project) doit être défini pour créer une action.",400);if("projects"!==this.parent.getEntityType())throw new ApiError(`Une Action ne peut être créée que depuis un Project (parent reçu: ${this.parent.getEntityType()}).`,400);const t=e.milestone?.milestoneId;if(t){const e=this.parent;if("function"==typeof e.hasMilestone&&!e.hasMilestone(t))throw new ApiError(`Milestone "${t}" introuvable dans project.serverData.oceco.milestones — refresh le projet ou utilise un milestoneId valide.`,400)}e.parentId=this.parent.id;for(const[t,n]of Array.from(Action.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(Action.ADD_BLOCKS,n,i),t=e?.content;!this.id&&t?.id&&(this._draftData.id=t.id,this._setData(t,{forceInitialDraftReset:!0}))}}};async addAction(e={}){return this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestNew(e))}_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(!this.id)throw new ApiError("Action sans id, impossible de mettre à jour.",400);const t=this.parent;if(!t||"function"!=typeof t.isAdmin||!t.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cette action",403);e.id&&delete e.id;for(const[e,t]of Object.entries(Action.CREATE_ONLY_FIELDS))if(this._hasFieldChanged(e))throw new ApiError(`"${e}" est create-only, non modifiable après création. ${t}`,400);let n=!1;const i=Action.CUSTOM_FIELD_HANDLERS;if(i){const t=new Set;for(const[r,o]of i)r in e&&this._hasFieldChanged(r)&&(await this._invokeCustomFieldHandler(o.updateMethod,e[r],r),t.add(r),n=!0);t.forEach(t=>delete e[t])}for(const[t,i]of Array.from(Action.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Action.UPDATE_BLOCKS,i,r),n=!0)}return n};async updateName(e){const t=await this._updatePath("name",e);return await this._refreshIfDirect(),t}async updateCredits(e){this._assertInt("credits",e);const t=await this._updatePath("credits",e,"int");return await this._refreshIfDirect(),t}async updateMin(e){this._assertInt("min",e);const t=await this._updatePath("min",e,"int");return await this._refreshIfDirect(),t}async updateMax(e){this._assertInt("max",e);const t=await this._updatePath("max",e,"int");return await this._refreshIfDirect(),t}async updateStatus(e){const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetStatus({id:this.id,status:e}));return await this._refreshIfDirect(),t}async updateTags(e){const t=await this._updatePath("tags",e);return await this._refreshIfDirect(),t}async updateImportance(e){if("string"!=typeof e)throw new ApiError(`importance: attendu string. Reçu: ${JSON.stringify(e)}`,400);const t=await this._updatePath("importance",e);return await this._refreshIfDirect(),t}async updateContributors(e){this._assertParentAdminForContributorMutation("updateContributors");const t=Object.keys(e?.contributors??{}),n=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetContributors({action:this.id,contributors:t}));return await this._refreshIfDirect(),n}async joinContributor(e){const t=e??this.userId;if(!t)throw new ApiError("userId requis pour joinContributor (utilisateur non connecté ou paramètre absent)",400);t===this.userId||this._assertParentAdminForContributorMutation("joinContributor",t);const n=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetContributors({action:this.id,contributor:t,participate:1}));return await this._refreshIfDirect(),n}async leaveContributor(e){const t=e??this.userId;if(!t)throw new ApiError("userId requis pour leaveContributor (utilisateur non connecté ou paramètre absent)",400);t===this.userId||this._assertParentAdminForContributorMutation("leaveContributor",t);const n=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetContributors({action:this.id,contributor:t,participate:0}));return await this._refreshIfDirect(),n}_assertParentAdminForContributorMutation(e,t){const n=this.parent;if(!n||"function"!=typeof n.isAdmin||!n.isAdmin()){throw new ApiError(`${e}${t?` (cible: "${t}")`:""} : seul un admin du projet parent peut effectuer cette opération.`,403)}}async updateMilestone(e){let t;if(null===e)t=await this._updatePath("milestone","");else{const n=e?.milestoneId;if("string"!=typeof n||0===n.length)throw new ApiError("milestone: attendu objet { milestoneId: string non-vide } ou null pour effacer.",400);const i=this.parent;if("function"==typeof i.hasMilestone&&!i.hasMilestone(n))throw new ApiError(`Milestone "${n}" introuvable dans project.serverData.oceco.milestones — refresh le projet ou utilise un milestoneId valide.`,400);t=await this._updatePath("milestone",{milestoneId:n})}return await this._refreshIfDirect(),t}async updateStartDate(e){this._assertIsoDate("startDate",e);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetDate({id:this.id,startDate:null===e?"":e}));return await this._refreshIfDirect(),t}async updateEndDate(e){this._assertIsoDate("endDate",e);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestSetDate({id:this.id,endDate:null===e?"":e}));return await this._refreshIfDirect(),t}isContributor(e){const t=e?.silent??!0;try{if(!this.userId)throw new ApiError("Utilisateur non connecté.",401);if(!this.id)throw new ApiError("Action non enregistrée.",404);if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404)}catch(e){if(t)return!1;throw e}return!!this.serverData.links?.contributors?.[this.userId]}async cancel(){if(!this.id)throw new ApiError("Action sans id, impossible d'annuler.",400);const e=this.parent;if(!e||"function"!=typeof e.isAdmin||!e.isAdmin())throw new ApiError("Vous n'avez pas les droits pour annuler cette action",403);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestCancel({id:this.id}));return await this._refreshIfDirect(),t}async archive(){if(!this.id)throw new ApiError("Action sans id, impossible d'archiver.",400);const e=this.parent;if(!e||"function"!=typeof e.isAdmin||!e.isAdmin())throw new ApiError("Vous n'avez pas les droits pour archiver cette action",403);const t=await this.callIsConnected(()=>this.endpointApi.costumProjectActionRequestArchive({id:this.id}));return await this._refreshIfDirect(),t}async delete(e="delete action"){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une Action.",400);if(!this.isAuthorOrAdmin({checkHierarchy:!0}))throw new ApiError("Suppression refusée — vous devez être l'auteur de l'Action ou administrateur du projet parent.",403);const t={reason:e,pathParams:{type:"actions",id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteElement(t)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async _updatePath(e,t,n){return this.updateField(e,t,n?{setType:n}:{})}_assertInt(e,t){if("number"!=typeof t||!Number.isInteger(t))throw new ApiError(`${e}: attendu entier (Number.isInteger). Reçu: ${JSON.stringify(t)}`,400)}_assertIsoDate(e,t){if(null!==t&&("string"!=typeof t||!this._isIsoDateTime(t)))throw new ApiError(`${e}: attendu chaîne ISO 8601 ("2026-05-20T08:00:00.000Z") ou null. Reçu: ${JSON.stringify(t)}`,400)}_isIsoDateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/.test(e)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}class Answer extends BaseEntity{static entityType="answers";static entityTag="Answer";static SCHEMA_CONSTANTS=["SAVE_COFORM_ANSWER"];static ADD_BLOCKS=new Map([["SAVE_COFORM_ANSWER","saveCoformAnswer"]]);static UPDATE_BLOCKS=new Map([["SAVE_COFORM_ANSWER","saveCoformAnswer"]]);defaultFields={};removeFields=["_id","collection","user","created","updated","modified","draft","finished","context","voteCount","vote","project"];_isAdminViaHierarchy(){const e=this.parent;if(!e||"function"!=typeof e.getEntityType||"forms"!==e.getEntityType())return!1;const t=e.serverData?.parent;if(!t||"object"!=typeof t)return!1;for(const[e,n]of Object.entries(t)){if(!n||"object"!=typeof n)continue;const t=n;if(t.type&&this._isAdminOfParent(e,t.type))return!0}return!1}isAuthor(e){const t=e?.silent??!0;try{if(!this.isConnected)throw new ApiError("Vous devez être connecté pour vérifier l'auteur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401)}catch(e){if(t)return!1;throw e}const n=this._serverData.user;if(!n)return!1;const i="string"==typeof n?n:n.id;return Boolean(this.userId&&"string"==typeof i&&i===this.userId)}_transformServerData(e){e.user&&"object"==typeof e.user&&"id"in e.user&&(e.user=this._linkNestedEntity({type:"citoyens",collection:"citoyens",...e.user}));const t=this._resolveFormData();return t&&e.answers&&"object"==typeof e.answers&&(e.answers=this._normalizeLegacyUploaderInAnswers(e.answers,t)),e}async get(e={}){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);const t=this.id,n="formId"in e?e.formId:this._autoFormIdFromParent(),i={answerId:t};e.fields&&e.fields.length>0&&(i.fields=e.fields),"string"==typeof n&&n.length>0&&(i.formId=n),e.finderPath&&(i.finderPath=e.finderPath);const r=await this.endpointApi.coformAnswersById(i);if(r?.data?.id)return this._setData(r.data,{forceInitialDraftReset:!0}),this.serverData;throw new ApiError(`Aucune réponse trouvée pour l'ID ${this.id}`,404)}_autoFormIdFromParent(){const e=this.parent;if(e&&"function"==typeof e.getEntityType&&"forms"===e.getEntityType()&&"string"==typeof e.id)return e.id}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async delete(e="delete coform answer"){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une Answer.",400);if(!this.isAuthorOrAdmin({checkHierarchy:!0}))throw new ApiError("Suppression refusée — vous devez être l'auteur de l'Answer ou administrateur du parent (organisation/projet) du Form.",403);const t={reason:e,pathParams:{type:"answers",id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteElement(t)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async deleteFile(e){await super.deleteFile(e),this._removeDocIdFromUploaderFields(this._serverData.answers,e),this._removeDocIdFromUploaderFields(this._draftData.answers,e)}_removeDocIdFromUploaderFields(e,t){if(e&&"object"==typeof e)for(const n of Object.values(e))if(this._isObjectRecord(n))for(const e of Object.values(n)){if(!this._isObjectRecord(e))continue;const n=e.files;this._isObjectRecord(n)&&t in n&&delete n[t]}}async getFiles(e){if(!this.id)throw new ApiError("Answer sans id, impossible de lister ses fichiers.",400);if(!e.subKey||0===e.subKey.length)throw new ApiError("`subKey` requis pour lister les fichiers d'un input.",400);const t={answerId:this.id,subKey:e.subKey};e.docType&&(t.docType=e.docType),e.contentKey&&(t.contentKey=e.contentKey);return((await this.callIsConnected(()=>this.endpointApi.coformGetAnswerFiles(t))).files??[]).filter(e=>"string"==typeof e.id&&"string"==typeof e.docPath).map(e=>({docId:e.id,docPath:e.docPath,name:e.name??void 0,size:e.size??void 0,imagePath:e.imagePath??void 0,imageThumbPath:e.imageThumbPath??void 0,imageMediumPath:e.imageMediumPath??void 0}))}async getHistory(){if(!this.id)throw new ApiError("Answer sans id, impossible de récupérer son historique.",400);const e={answerId:this.id},t=await this.callIsConnected(()=>this.endpointApi.getCoformAnswerHistory(e)),n=t?.data?.history;return Array.isArray(n)?n:[]}async getMultiEvalData(e={}){if(!this.id)throw new ApiError("Answer sans id, impossible de récupérer ses évaluations multiples.",400);const t={answerId:this.id};e.stepKey&&(t.stepKey=e.stepKey);const n=await this.callIsConnected(()=>this.endpointApi.getCoformMultievalData(t)),i=n?.data?.steps;return{steps:Array.isArray(i)?i:[]}}async uploadFile(e,t={}){const n=this._resolveFormId({}),i=t.qqfilename??`upload-${Date.now()}`,{qqfile:r,qqfilename:o,qqtotalfilesize:a}=await this._prepareUploadFile(e,i),s={formId:n,docType:t.docType??"image",contentKey:t.contentKey??"slider",qquuid:t.qquuid??this._generateUuid(),qqfilename:t.qqfilename??o,qqtotalfilesize:t.qqtotalfilesize??a,qqfile:r};t.subKey&&(s.subKey=t.subKey),this.id&&(s.answerId=this.id);const p=await this.callIsConnected(()=>this.endpointApi.coformUploadAnswerFile(s));if(!0!==p?.result&&!0!==p?.success)throw new ApiError(p?.msg||"Échec de l'upload coform.",500);if(!p.answerId||!p.docPath)throw new ApiError("Réponse d'upload incomplète (answerId ou docPath manquant).",500);return this.id||(this._draftData.id=p.answerId),{docId:p.id??"",docPath:p.docPath,answerId:p.answerId}}async processUploads(e,t={}){const n=t.formData??this._resolveFormData(),i=this._collectPendingUploads(e,[],n);if(0===i.length)return this._cleanUploaderUrls(e,n);let r=e,o=0;if(!this.id){const e=i[0],t=await this._uploadAndReplace(e,r,1);r=t,o=1}if(o<i.length){const e=i.slice(o),n=t.batchSize??4,a=await this._uploadInBatches(e,(e,t)=>this._uploadPendingItem(e,o+t+1),n);e.forEach((e,t)=>{r=this._setValueAtPath(r,e.path,a[t])})}const a=new Map;for(const e of i)if(e.inputType?.endsWith(".uploader")&&e.path.length>=2){const t=JSON.stringify(e.path.slice(0,2));a.has(t)||a.set(t,e.path.slice(0,2))}for(const e of a.values()){const t=this._getValueAtPath(r,e);r=this._setValueAtPath(r,e,this._normalizeUploaderValue(t))}return this._cleanUploaderUrls(r,n)}_generateUuid(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");const t=this._resolveFormId(e),n=this._buildSavePayload(t,e,!1),i=await this.callIsConnected(()=>this.endpointApi.saveCoformAnswer(n)),r=i?.data?.id;this.id||"string"!=typeof r||24!==r.length||(this._draftData.id=r)};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");if(!this.id)throw new ApiError("Answer sans id, impossible de mettre à jour.",400);const t=this._resolveFormId(e),n=this._buildSavePayload(t,e,!0);return await this.callIsConnected(()=>this.endpointApi.saveCoformAnswer(n)),!0};_resolveFormId(e){const t="string"==typeof e.form?e.form:void 0,n="string"==typeof this._serverData.form?this._serverData.form:void 0,i=this.parent,r=i&&"function"==typeof i.getEntityType&&"forms"===i.getEntityType()&&"string"==typeof i.id?i.id:void 0,o=t??n??r;if("string"!=typeof o||0===o.length)throw new ApiError("formId introuvable pour sauvegarder l'Answer. Créez l'Answer via `form.answer()` ou définissez `answer.data.form` manuellement.",400);return o}_buildSavePayload(e,t,n){const i=t.answers??(n?this._serverData.answers:void 0);if(null==i)throw new ApiError("answer.data.answers est requis (objet `{ subFormId: { inputId: value } }`).",400);const r={formId:e,answers:JSON.stringify(i)};return n&&(r.answerId=this.id),t.addedOptions&&"object"==typeof t.addedOptions&&Object.keys(t.addedOptions).length>0&&(r.addedOptions=JSON.stringify(t.addedOptions)),t.links&&"object"==typeof t.links&&Object.keys(t.links).length>0&&(r.links=JSON.stringify(t.links)),r}_resolveFormData(){const e=this.parent;if(e&&"function"==typeof e.getEntityType&&"forms"===e.getEntityType())return e.serverData}_isObjectRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}_isDataUri(e){return/^data:[^;]+;base64,/.test(e)}_isPendingUploadValue(e){return!!this._isObjectRecord(e)&&("string"==typeof e.data&&this._isDataUri(e.data))}_parseMimeType(e){const t=e.match(/^data:([^;]+);base64,/i);return t?.[1]?.toLowerCase()??"application/octet-stream"}_inferExtensionFromMimeType(e){return{"image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","application/pdf":"pdf","text/plain":"txt","text/csv":"csv","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/zip":"zip","application/x-rar-compressed":"rar"}[e]??"bin"}_sanitizeBaseName(e){return e.replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9_. -]+/g,"-").trim()||"upload"}async _dataUriToFile(e,t){const n=this._parseMimeType(e.data),i=n.startsWith("image/")?"image":"file",r=this._inferExtensionFromMimeType(n),o=e.name&&""!==e.name.trim()?e.name:t,a=/\.[a-zA-Z0-9]+$/.test(o)?o:`${this._sanitizeBaseName(o)}.${r}`;if("undefined"!=typeof window&&"undefined"!=typeof File){const t=await(await fetch(e.data)).blob();return{file:new File([t],a,{type:n}),docType:i,filename:a}}const s=e.data.match(/^data:[^;]+;base64,(.*)$/);if(!s)throw new ApiError("data:URI invalide (base64 attendu).",400);return{file:Buffer.from(s[1],"base64"),docType:i,filename:a}}_collectPendingUploads(e,t=[],n){const i=[],r=()=>{if(!n||t.length<2)return;const[e,i]=t;if("string"!=typeof e||"string"!=typeof i)return;const r=n.inputs?.[e];if(!r)return;const o=r.inputs?.[i];return o&&"object"==typeof o&&"type"in o?o.type:void 0};return"string"==typeof e?(this._isDataUri(e)&&i.push({value:{data:e},path:t,inputType:r()}),i):this._isPendingUploadValue(e)?(i.push({value:e,path:t,inputType:r()}),i):Array.isArray(e)?(e.forEach((e,r)=>{i.push(...this._collectPendingUploads(e,[...t,r],n))}),i):(this._isObjectRecord(e)&&Object.entries(e).forEach(([e,r])=>{i.push(...this._collectPendingUploads(r,[...t,e],n))}),i)}_getUploadKeys(e,t){if(e&&("uploader"===e||e.endsWith(".uploader"))){return{contentKey:"presentation",subKey:t.slice(0,2).filter(e=>"string"==typeof e).join(".")||void 0}}return{contentKey:"slider"}}_getValueAtPath(e,t){if(0===t.length)return e;const[n,...i]=t;return Array.isArray(e)||this._isObjectRecord(e)?this._getValueAtPath(e[n],i):void 0}_setValueAtPath(e,t,n){if(0===t.length)return n;const[i,...r]=t;if(Array.isArray(e)){const t=[...e];return t[i]=this._setValueAtPath(t[i],r,n),t}return this._isObjectRecord(e)?{...e,[i]:this._setValueAtPath(e[i],r,n)}:e}_normalizeLegacyUploaderInAnswers(e,t){const n={};for(const[i,r]of Object.entries(e)){if(!this._isObjectRecord(r)){n[i]=r;continue}const e=t.inputs?.[i];if(!e){n[i]=r;continue}const o={};for(const[t,n]of Object.entries(r)){const i=e.inputs?.[t],r=i&&"object"==typeof i&&"type"in i?i.type:void 0;o[t]=r?.endsWith(".uploader")?this._normalizeUploaderValue(n):n}n[i]=o}return n}_normalizeUploaderValue(e){const t=(new Date).toLocaleDateString("fr-FR"),n=e=>{const t={};for(const n of e)this._isObjectRecord(n)&&"string"==typeof n.docId&&"string"==typeof n.docPath?t[n.docId]=n.docPath:"string"==typeof n&&(t[n]=n);return t};return this._isObjectRecord(e)&&"updateDate"in e&&Array.isArray(e.updateDate)?this._isObjectRecord(e.files)?e:Array.isArray(e.files)?{...e,files:n(e.files)}:e:Array.isArray(e)?{updateDate:[t],files:n(e)}:e}_cleanUrlToRelativePath(e){if("string"==typeof e){if(this._isDataUri(e))return e;const t=e.match(/^https?:\/\/[^/]+(\/.*)/i);return t?t[1]:e}if(Array.isArray(e))return e.map(e=>this._cleanUrlToRelativePath(e));if(this._isObjectRecord(e)){if("data"in e&&"string"==typeof e.data){const t=this._isDataUri(e.data)?e.data:this._cleanUrlToRelativePath(e.data);return{...e,data:t}}const t={};for(const[n,i]of Object.entries(e))t[n]=this._cleanUrlToRelativePath(i);return t}return e}static INPUT_TYPES_TO_CLEAN_URLS=[".uploader",".simpleTable"];_cleanUploaderUrls(e,t){if(!t)return e;const n={};for(const[i,r]of Object.entries(e)){if(!this._isObjectRecord(r)){n[i]=r;continue}const e=t.inputs?.[i];if(!e){n[i]=r;continue}const o={};for(const[t,n]of Object.entries(r)){const i=e.inputs?.[t],r=i&&"object"==typeof i&&"type"in i?i.type:void 0,a=!!r&&Answer.INPUT_TYPES_TO_CLEAN_URLS.some(e=>r.endsWith(e));o[t]=a?this._cleanUrlToRelativePath(n):n}n[i]=o}return n}async _uploadInBatches(e,t,n=4){const i=[];for(let r=0;r<e.length;r+=n){const o=e.slice(r,r+n),a=await Promise.all(o.map((e,n)=>t(e,r+n)));i.push(...a)}return i}async _uploadPendingItem(e,t){const n=`upload-${t}`,{file:i,docType:r,filename:o}=await this._dataUriToFile(e.value,n),{contentKey:a,subKey:s}=this._getUploadKeys(e.inputType,e.path),p=await this.uploadFile(i,{docType:r,contentKey:a,subKey:s,qqfilename:o});return e.inputType?.endsWith(".uploader")??!1?{docId:p.docId,docPath:p.docPath}:p.docPath}async _uploadAndReplace(e,t,n){const i=await this._uploadPendingItem(e,n);return this._setValueAtPath(t,e.path,i)}}class Badge extends BaseEntity{static entityType="badges";static entityTag="Badge";static SCHEMA_CONSTANTS=["ADD_BADGES"];static ADD_BLOCKS=new Map([["ADD_BADGES","addBadges"]]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Badge.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(i&&Object.keys(i).length>0){const e=await this[n](i);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[n,i]of Array.from(Badge.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this[i](r),t=!0)}return t};async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async getSubscribers(){throw new ApiError(`getSubscribers n'existe pas dans ${this.constructor.name}`,501)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}function X(e){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{type:t?.type??"",name:t?.name}])):{}}function ee(e){return(t,n)=>n?.socialNetwork?.[e]}class Classified extends BaseEntity{static entityType="classifieds";static entityTag="Classified";static SCHEMA_CONSTANTS=["ADD_CLASSIFIED"];static ADD_BLOCKS=new Map([["ADD_CLASSIFIED","addClassified"]]);defaultFields={typeElement:"classified"};removeFields=["typeElement"];transforms={parent:X};_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.();for(const[t,n]of Array.from(Classified.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(i&&Object.keys(i).length>0){const e=await this[n](i);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(!this.isAuthor()&&!this.isAdmin({checkHierarchy:!0}))throw new ApiError("Vous n'êtes pas autorisé à modifier cette ressource",403);let t=!1;const n=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_CLASSIFIED",{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);return n&&Object.keys(n).length>0&&(await this.addClassified(n),t=!0),t};async addClassified(e={}){const t=e;if(this.parent&&this.parent.id&&this.parent.id!==this.userId&&!t.parent){t.parent={};t.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}}return this.callIsConnected(()=>this.endpointApi.addClassified(e))}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}async classified(){throw new ApiError(`classified n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async follow(){throw new ApiError(`follow n'existe pas dans ${this.constructor.name}`,501)}async unfollow(){throw new ApiError(`unfollow n'existe pas dans ${this.constructor.name}`,501)}async getGallery(){throw new ApiError(`getGallery n'existe pas dans ${this.constructor.name}`,501)}}class Comment extends BaseEntity{static entityType="comments";static entityTag="Comment";static SCHEMA_CONSTANTS=["ADD_COMMENTS"];static ADD_BLOCKS=new Map([["ADD_COMMENTS","addComments"]]);static UPDATE_BLOCKS=new Map([["ADD_COMMENTS","updateComments"]]);defaultFields={};removeFields=["contextId","contextType","parentCommentId","argval"];_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),Array.isArray(e.replies)&&(e.replies=e.replies.map(e=>(e&&"object"==typeof e&&!e.type&&(e.type="comments",e.collection="comments"),this._linkNestedEntity(e)))),e}async get(){throw new ApiError(`get n'existe pas dans ${this.constructor.name}`,501)}async save(){const e=this.refresh;this.refresh=async()=>this._serverData;try{return await super.save()}finally{this.refresh=e}}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");if(""===e.text&&(e.text=" "),"comments"===this.parent.getEntityType()){e.parentCommentId=this.parent.id;let t=this.parent.parent;for(;t&&t.getEntityType&&"comments"===t.getEntityType();)t=t.parent;if(!t)throw new Error("Impossible de trouver l'entité racine pour le commentaire.");e.contextId=t.id,e.contextType=t.getEntityType()}else e.parentCommentId=e.parentCommentId||"",e.contextId=this.parent.id,e.contextType=this.parent.getEntityType();for(const[t,n]of Array.from(Comment.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{},[]);if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(Comment.ADD_BLOCKS,n,i),t=e?.object?.id||e?.id?.$id||e?.id;!this.id&&t&&(this._draftData.id=t,this._setData(e.newComment,{forceInitialDraftReset:!0}))}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");if(!this.parent?.id)throw new Error("Le parent doit être défini pour ajouter un commentaire.");""===e?.text&&(e.text=" "),e.params={text:e.text},delete e.text;let t=!1;const n=await this.callIsConnected(()=>this.endpointApi.updateComments(e));return n?.comment&&this._setData(n.comment,{forceInitialDraftReset:!0}),t=!0,true};async addComments(e={}){return this.callIsConnected(()=>this.endpointApi.addComments(e))}async updateComments(e={}){return this.callIsConnected(()=>this.endpointApi.updateComments(e))}async delete(){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer un commentaire.",400);const e={pathParams:{id:this.id}};await this.callIsConnected(()=>this.endpointApi.deleteComments(e)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async addVote(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"comments",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected(()=>this.endpointApi.addVote(t))}async getVotes(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistré.`,404);const e={pathParams:{type:"comments",id:this.id}};return this.endpointApi.showVote(e)}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const n={collection:"comments",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected(()=>this.endpointApi.addReportAbuse(n))}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}class EndpointApi{apiClient;constructor(e){this.apiClient=e}get isConnected(){return this.apiClient.isConnected}get userId(){return this.apiClient.userId}async call(e,t={}){return this.apiClient.safeCall(async()=>{const n=await this.apiClient.callEndpoint(e,t);return this.apiClient.checkAndThrowApiResponseError(n),n.data})}async callNoConnected(e,t={}){if(this.isConnected)throw new ApiAuthenticationError("Vous ne devez pas être connecté pour faire cette action.",403);return this.call(e,t)}async callIsConnected(e,t={}){if(!this.isConnected)throw new ApiAuthenticationError("Vous devez être connecté pour effectuer cette action.",401);return this.call(e,t)}async documentList(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DOCUMENT_LIST",e)}async personRegister(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_REGISTER",e)}async authenticateUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("AUTHENTICATE_URL",e)}async refreshTokenUrl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("REFRESH_TOKEN_URL",e)}async meInfoUrl(){return this.callIsConnected("ME_INFO_URL")}async passwordRecovery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PASSWORD_RECOVERY",e)}async serverExchangeToken(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SERVER_EXCHANGE_TOKEN",e)}async changePassword(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHANGE_PASSWORD",e)}async deleteAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ACCOUNT",e)}async updateSettings(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_SETTINGS",e)}async updateBlockDescription(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_DESCRIPTION",e)}async updateBlockInfo(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_INFO",e)}async updateBlockSocial(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SOCIAL",e)}async updateBlockLocality(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_LOCALITY",e)}async updateBlockSlug(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_BLOCK_SLUG",e)}async check(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CHECK",e)}async profilImage(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_IMAGE",e)}async profilBanner(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("PROFIL_BANNER",e)}async getElementsAbout(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_ABOUT",e)}async multiconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MULTICONNECT",e)}async getNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS",e)}async getNewsById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_NEWS_BY_ID",e)}async addNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_NEWS",e)}async addImageNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_NEWS",e)}async addFileNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FILE_NEWS",e)}async deleteNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_NEWS",e)}async updateNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_NEWS",e)}async shareNews(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_NEWS",e)}async getComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COMMENTS",e)}async addComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_COMMENTS",e)}async deleteComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_COMMENTS",e)}async updateComments(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_COMMENTS",e)}async searchTags(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_TAGS",e)}async showVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SHOW_VOTE",e)}async globalAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE",e)}async cityAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE",e)}async cityAutocompleteByCountry(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("CITY_AUTOCOMPLETE_BY_COUNTRY",e)}async suggestionInput(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SUGGESTION_INPUT",e)}async getProjectsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_PROJECTS_NO_ADMIN",e)}async getProjectsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_PROJECTS_ADMIN",e)}async getPoisNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_POIS_NO_ADMIN",e)}async getPoisAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_POIS_ADMIN",e)}async getOrganizationsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ORGANIZATIONS_NO_ADMIN",e)}async getOrganizationsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ORGANIZATIONS_ADMIN",e)}async getUserEligiblePlaces(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_USER_ELIGIBLE_PLACES",e)}async getMembersNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEMBERS_NO_ADMIN",e)}async getMembersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_MEMBERS_ADMIN",e)}async getFriendsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FRIENDS_ADMIN",e)}async getSubscriptions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIPTIONS",e)}async getSubscriptionsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIPTIONS_ADMIN",e)}async getSubscribers(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_SUBSCRIBERS",e)}async getSubscribersAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_SUBSCRIBERS_ADMIN",e)}async getContributorsNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_CONTRIBUTORS_NO_ADMIN",e)}async getContributorsAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_CONTRIBUTORS_ADMIN",e)}async getBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES",e)}async getBadgesFilters(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGES_FILTERS",e)}async connect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("CONNECT",e)}async disconnect(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCONNECT",e)}async getElementsKey(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ELEMENTS_KEY",e)}async getFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_FAVORIS",e)}async deleteFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_FAVORIS",e)}async addFavoris(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_FAVORIS",e)}async addOrganization(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_ORGANIZATION",e)}async addProject(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_PROJECT",e)}async addPoi(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_POI",e)}async addEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_EVENT",e)}async deleteElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_ELEMENT",e)}async addImageElement(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_IMAGE_ELEMENT",e)}async linkValidate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_VALIDATE",e)}async searchMemberAutocomplete(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_MEMBER_AUTOCOMPLETE",e)}async getNotifications(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS",e)}async getNotificationsCount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_NOTIFICATIONS_COUNT",e)}async notificationUpdate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("NOTIFICATION_UPDATE",e)}async removeAllNotifications(){return this.callIsConnected("REMOVE_ALL_NOTIFICATIONS")}async markNotificationAsRead(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("MARK_NOTIFICATION_AS_READ",e)}async activitypubSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_SEARCH",e)}async activitypubLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ACTIVITYPUB_LINK",e)}async activitypubGetCommunity(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("ACTIVITYPUB_GET_COMMUNITY",e)}async getBadge(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_BADGE",e)}async getEmetteurBadges(){return this.call("GET_EMETTEUR_BADGES")}async addBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_BADGES",e)}async assignBadges(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ASSIGN_BADGES",e)}async getEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_EVENTS",e)}async shareEvents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SHARE_EVENTS",e)}async inviteEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("INVITE_EVENT",e)}async follow(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("FOLLOW",e)}async getCostumJson(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COSTUM_JSON",e)}async globalAutocompleteCostum(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GLOBAL_AUTOCOMPLETE_COSTUM",e)}async navigatorGettl(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("NAVIGATOR_GETTL",e)}async costumEventRequestActors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ACTORS",e)}async costumEventRequestSubevents(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_SUBEVENTS",e)}async costumEventRequestElementEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_ELEMENT_EVENT",e)}async costumEventRequestCategories(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_CATEGORIES",e)}async costumEventRequestDates(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_DATES",e)}async costumEventRequestEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_EVENT",e)}async costumEventRequestLinkTlToEvent(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",e)}async costumEventRequestLoadContextTag(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",e)}async getGallery(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_GALLERY",e)}async getAttendeesNoAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_ATTENDEES_NO_ADMIN",e)}async getAttendeesAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_ATTENDEES_ADMIN",e)}async coformAnswersSearch(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_SEARCH",e)}async coformAnswersById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_BY_ID",e)}async getCoformById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COFORM_BY_ID",e)}async coformUploadAnswerFile(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COFORM_UPLOAD_ANSWER_FILE",e)}async coformGetAnswerFiles(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COFORM_GET_ANSWER_FILES",e)}async getCoformCatalogs(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COFORM_CATALOGS",e)}async saveCoformAnswer(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("SAVE_COFORM_ANSWER",e)}async getCoformAnswerHistory(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_COFORM_ANSWER_HISTORY",e)}async getCoformMultievalData(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_COFORM_MULTIEVAL_DATA",e)}async getCoformCommontableContributors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("GET_COFORM_COMMONTABLE_CONTRIBUTORS",e)}async addVote(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_VOTE",e)}async addReportAbuse(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_REPORT_ABUSE",e)}async updatePathValue(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UPDATE_PATH_VALUE",e)}async deleteDocumentByContext(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_DOCUMENT_BY_CONTEXT",e)}async deleteDocumentById(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DELETE_DOCUMENT_BY_ID",e)}async demoteAdmin(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DEMOTE_ADMIN",e)}async costumFilterCoform(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_FILTER_COFORM",e)}async costumFilterCoformByPath(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COSTUM_FILTER_COFORM_BY_PATH",e)}async getCountries(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_COUNTRIES",e)}async searchZones(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("SEARCH_ZONES",e)}async coformAnswersByForms(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COFORM_ANSWERS_BY_FORMS",e)}async generateAnswerFromForm(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GENERATE_ANSWER_FROM_FORM",e)}async fundingEnvelope(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("FUNDING_ENVELOPE",e)}async coremuOperation(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("COREMU_OPERATION",e)}async costumProjectActionRequestNew(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_NEW",e)}async costumProjectActionRequestSetStatus(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_STATUS",e)}async costumProjectActionRequestSetDate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_DATE",e)}async costumProjectActionRequestSetContributors(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_SET_CONTRIBUTORS",e)}async costumProjectActionRequestCancel(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_CANCEL",e)}async costumProjectActionRequestArchive(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("COSTUM_PROJECT_ACTION_REQUEST_ARCHIVE",e)}async linkDiscourseAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_DISCOURSE_ACCOUNT",e)}async unlinkDiscourseAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UNLINK_DISCOURSE_ACCOUNT",e)}async discourseProfile(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("DISCOURSE_PROFILE",e)}async discourseCheckEmail(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCOURSE_CHECK_EMAIL",e)}async discourseDismissLink(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("DISCOURSE_DISMISS_LINK",e)}async linkMediawikiAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("LINK_MEDIAWIKI_ACCOUNT",e)}async unlinkMediawikiAccount(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("UNLINK_MEDIAWIKI_ACCOUNT",e)}async getMediawikiContributions(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.call("GET_MEDIAWIKI_CONTRIBUTIONS",e)}async addClassified(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callIsConnected("ADD_CLASSIFIED",e)}async personActivate(e){if(!e||"object"!=typeof e)throw new TypeError("Le paramètre data doit être un objet.");return this.callNoConnected("PERSON_ACTIVATE",e)}}class Event extends BaseEntity{static entityType="events";static entityTag="Event";static COSTUM_ADD_CONSTANT="ADD_EVENT";static SCHEMA_CONSTANTS=["ADD_EVENT","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_EVENT","addEvent"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:X,organizer:X};_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Event.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(Event.ADD_BLOCKS,n,i);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin({checkHierarchy:!0}))throw new ApiError("Vous n'avez pas les droits pour modifier cet événement",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(this._costumCtx)return this._saveCostumViaElementSave(e);let t=!1;const n=this._extractAllValidFieldsFromSchema(this.apiClient,"ADD_EVENT",{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);n&&Object.keys(n).length>0&&(await this.addEvent(n),t=!0),e.id&&delete e.id;for(const[n,i]of Array.from(Event.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Event.UPDATE_BLOCKS,i,r),t=!0)}return t};async addEvent(e={}){return this.parent&&this.parent.id&&this.parent.id!==this.userId&&!e.organizer&&(e.organizer={},e.organizer[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected(()=>this.endpointApi.addEvent(e))}async delete(e="delete event"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents - les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getAttendees(e={},t={}){e.searchType=this._getDefaultFromEndpoint("GET_ATTENDEES_NO_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getAttendees",restoredState:t?.restoredState,finalizer:async e=>{const{toBeValidated:n,isAdmin:i,isInviting:r,isAdminPending:o,roles:a=[]}=t;this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:n,isAdmin:i,isAdminPending:o,isInviting:r,roles:a})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"events",toBeValidated:!1,isAdmin:i,isInviting:r,roles:a}));return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getAttendeesAdmin(e)):()=>this.endpointApi.getAttendeesNoAdmin(e))()}}).next()}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`les sous-events ne sont pas encore implémentés dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){return super.news(e)}async requestToJoin(){return super.requestToJoin()}async acceptInvitation(){return super.acceptInvitation()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Form extends BaseEntity{static entityType="forms";static entityTag="Form";static SCHEMA_CONSTANTS=[];static ADD_BLOCKS=new Map([]);static UPDATE_BLOCKS=new Map([]);defaultFields={};removeFields=[];_transformServerData(e){return e}async get(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.getCoformById({parentFormId:e});if(t?.data?.id||t?.data?._id){const e={...t.data,collection:"forms",inputs:t.data.inputs??{},params:t.data.params??{},subForms:t.data.subForms??[],parent:t.data.parent??void 0,config:t.data.config??void 0};return this._setData(e,{forceInitialDraftReset:!0}),this.serverData}throw new ApiError(`Aucun formulaire trouvé pour l'ID ${this.id}`,404)}async getAnswers(e={},t){if(!this.id)throw new ApiError("Form sans id, impossible de chercher ses réponses.",400);const n=this.parent;if(!(n instanceof BaseEntity)||"string"!=typeof n.serverData?.slug||"string"!=typeof n.serverData?.id)throw new ApiError("form.getAnswers nécessite un Form créé via `org.form({id})` ou `project.form({id})` (parent avec costumContext). Pour un Form isolé, utilisez `organization.coformAnswersSearch({ filters: { form: form.id } })` directement.",400);const i={...e.filters??{},form:this.id};return n.coformAnswersSearch({...e,filters:i},t)}async answer(e={}){if(!this.id)throw new ApiError("Form sans id, impossible de créer une Answer rattachée.",400);const t="string"==typeof e.id&&e.id.length>0?e:{form:this.id,...e};return await this.entity("answers",t)}async getCommonTableContributors(e){const t=this.id;if(!t)throw new ApiError("Form sans id, impossible de récupérer les contributeurs.",400);const n=Array.isArray(e.criteriaIds)?JSON.stringify(e.criteriaIds):e.criteriaIds,i=await this.endpointApi.getCoformCommontableContributors({formId:t,inputKey:e.inputKey,criteriaIds:n});return i?.data?.contributors??[]}async getCatalogs(e){if(!this.id)throw new ApiError("Form sans id, impossible de récupérer ses catalogues.",400);if(!Array.isArray(e?.inputKeys)||0===e.inputKeys.length)throw new ApiError("`inputKeys` requis et non vide pour getCatalogs.",400);const t={formId:this.id,inputKeys:JSON.stringify(e.inputKeys)},n=await this.endpointApi.getCoformCatalogs(t),i=n?.data;if(!i||"object"!=typeof i||Array.isArray(i))return{};const r={};for(const[e,t]of Object.entries(i))r[e]=t&&"object"==typeof t&&!Array.isArray(t)?t:{};return r}}class News extends BaseEntity{static entityType="news";static entityTag="News";static SCHEMA_CONSTANTS=["ADD_NEWS"];static ADD_BLOCKS=new Map([["ADD_NEWS","addNews"]]);static UPDATE_BLOCKS=new Map([["ADD_NEWS","updateNews"]]);defaultFields={};removeFields=["parentId","parentType"];transforms={scope:e=>e?.type,mentions:e=>Array.isArray(e)?e.map(e=>({...e,count:parseInt(e.count)})):[],mediaImg:e=>{const t=e?.images?.map(e=>e.id).filter(Boolean)||[];return t.length>0?{countImages:t.length,images:t}:{countImages:0,images:[]}},mediaFile:e=>{const t=e?.files?.map(e=>e.id).filter(Boolean)||[];return t.length>0?{countFiles:t.length,files:t}:{countFiles:0,files:[]}}};_transformServerData(e){return e.author&&(e.author=this._linkNestedEntity(e.author)),e.target&&(e.target=this._linkNestedEntity(e.target)),e.lastAuthorShare&&(e.lastAuthorShare=this._linkNestedEntity(e.lastAuthorShare)),Array.isArray(e.sharedBy)&&(e.sharedBy=e.sharedBy.map(e=>this._linkNestedEntity(e))),e}async get(){if(!this.id)throw new ApiError("Impossible de rafraîchir sans ID.",400);const e=this.id,t=await this.endpointApi.getNewsById({ids:[e]});if(t&&Array.isArray(t)&&1===t.length){const e=t[0];return this._setData(e,{forceInitialDraftReset:!0}),this.serverData}throw new ApiError(`Aucune actualité trouvée pour l'ID ${this.id}`,404)}_add=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _add, utilisez save");""===e.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType());for(const[t,n]of Array.from(News.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{},[]);if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(News.ADD_BLOCKS,n,i);!this.id&&e?.object?.id&&(this._draftData.id=e.object.id)}}};_update=async e=>{if(!this._calledFromSave)throw new Error("utilisation invalide de _update, utilisez save");e.id&&delete e.id,""===e?.text&&(e.text=" "),this.parent&&(e.parentId=this.parent.id,e.parentType=this.parent.getEntityType()),e.idNews=this.id;let t=!1;return await this.callIsConnected(()=>this.endpointApi.updateNews(e)),t=!0,true};async addNews(e={}){return this.callIsConnected(()=>this.endpointApi.addNews(e))}async updateNews(e={}){return this.callIsConnected(()=>this.endpointApi.updateNews(e))}async addMention({slug:e,id:t}){try{if(!e&&!t)throw new ApiError("Vous devez fournir un slug ou un id pour ajouter une mention.",400);const n=await this.entity("citoyens",{id:t,slug:e}),i=n.serverData;if(this._draftData.mentions||(this._draftData.mentions=[]),this._draftData.mentions.find(e=>e.id===i.id))return this._draftData.mentions=this._draftData.mentions.map(e=>(e.id===i.id&&(e.count+=1),e)),this._draftData.mentions;const r={id:i.id,slug:i.slug,type:n.getEntityType(),name:i.name,value:i.name,count:1};return this._draftData.mentions.push(r),this._draftData.mentions}catch(e){throw this.apiClient._logger.error("Erreur lors de l'ajout de la mention :",e),e}}async addImage(e){const t=await this._validateImage(e),n={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsImage:t},i=await this.callIsConnected(()=>this.endpointApi.addImageNews(n));return this._draftData.mediaImg?(this._draftData.mediaImg.countImages=this._draftData.mediaImg.countImages+1,this._draftData.mediaImg.images.push(i.id)):this._draftData.mediaImg={countImages:1,images:[i.id]},i}async addFile(e){const t=await this._validateFile(e),n={pathParams:{folder:this.parent?.getEntityType(),ownerId:this.parent?.id},newsFile:t},i=await this.callIsConnected(()=>this.endpointApi.addFileNews(n));return this._draftData.mediaFile?(this._draftData.mediaFile.countFiles=this._draftData.mediaFile.countFiles+1,this._draftData.mediaFile.files.push(i.id)):this._draftData.mediaFile={countFiles:1,files:[i.id]},i}async delete(){if(!this.id)throw new ApiError("Vous devez fournir un id pour supprimer une news.",400);const e={pathParams:{id:this.id},isLive:!1};await this.callIsConnected(()=>this.endpointApi.deleteNews(e)),Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0}async comment(e={}){if(!this.isConnected)throw new ApiError("Vous devez être connecté.",401);return await this.entity("comments",e)}async getComments(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e={pathParams:{type:"news",id:this.id}},t=await this.endpointApi.getComments(e);if(!Array.isArray(t))throw new ApiResponseError("Erreur lors de la récupération des commentaires.",500,t);const n=this._linkEntities(t);return this._createFilteredProxy(n)}async addVote(e){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const t={collection:"news",id:this.id,action:"vote",details:{status:e}};return await this.callIsConnected(()=>this.endpointApi.addVote(t))}async getVotes(){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e={pathParams:{type:"news",id:this.id}};return this.endpointApi.showVote(e)}async addReportAbuse({reason:e,comment:t}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const n={collection:"news",id:this.id,action:"reportAbuse",details:{reason:e,comment:t}};return await this.callIsConnected(()=>this.endpointApi.addReportAbuse(n))}async shareNews({childId:e,childType:t,comment:n}={}){if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.userId)throw new ApiError("L'utilisateur connecté n'est pas défini.",400);if(!this.parent?.id)throw new ApiError("Le parent doit être défini pour partager une news",400);const i=e??this.userId,r=t??"citoyens",o=["citoyens","projects","organizations"];if(!o.includes(r))throw new ApiError(`Le type de cible "${r}" n'est pas valide. Types autorisés: ${o.join(", ")}`,400);if(this.parent.id===this.userId&&i===this.userId)throw new ApiError("Vous ne pouvez pas partager votre propre news à vous-même",400);const a={parentId:this.id,parentType:"news",connectType:"share",childType:r,childId:i,comment:n};return await this.callIsConnected(()=>this.endpointApi.shareNews(a))}isAuthor(e){const t=e?.silent??!0;try{if(!this.isMe)throw new ApiError("Vous devez être connecté pour vérifier l'auteur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.serverData)throw new ApiError("Aucune donnée serveur disponible.",404);if(!this.userId)throw new ApiError("Utilisateur non connecté.",401)}catch(e){if(t)return!1;throw e}const n=this.serverData.author;if(!n)return!1;let i;return"serverData"in n&&n.serverData&&"object"==typeof n.serverData&&"id"in n.serverData?i=n.serverData.id:"id"in n&&(i=n.id),Boolean(i&&this.userId===i)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}}class Organization extends BaseEntity{static entityType="organizations";static entityTag="Organization";static COSTUM_ADD_CONSTANT="ADD_ORGANIZATION";static SCHEMA_CONSTANTS=["ADD_ORGANIZATION","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE","VIRTUAL_OPENING_HOURS","VIRTUAL_ORG_BASE_FIELDS"];static VIRTUAL_SCHEMAS={VIRTUAL_OPENING_HOURS:{type:"object",properties:{openingHours:{type:"array",description:"Horaires d'ouverture (7 jours de la semaine)",minItems:7,maxItems:7,items:{oneOf:[{type:"string",const:""},{type:"object",properties:{dayOfWeek:{type:"string",enum:["Mo","Tu","We","Th","Fr","Sa","Su"],description:"Jour de la semaine"},hours:{type:"array",description:"Liste des créneaux horaires",items:{type:"object",properties:{opens:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure d'ouverture (HH:MM)"},closes:{type:"string",pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",description:"Heure de fermeture (HH:MM)"}},required:["opens","closes"],additionalProperties:!1}}},required:["dayOfWeek","hours"],additionalProperties:!1}]}}}},VIRTUAL_ORG_BASE_FIELDS:{type:"object",properties:{telephone:{type:"string"},video:{type:"array",items:{type:"string"}}}}};static CUSTOM_FIELD_HANDLERS=new Map([["openingHours",{updateMethod:"updateOpeningHours",schemaConstant:"VIRTUAL_OPENING_HOURS"}],["telephone",{updateMethod:"updateTelephone",schemaConstant:"VIRTUAL_ORG_BASE_FIELDS"}],["video",{updateMethod:"updateVideo",schemaConstant:"VIRTUAL_ORG_BASE_FIELDS"}]]);static ADD_BLOCKS=new Map([["ADD_ORGANIZATION","addOrganization"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:ee("github"),gitlab:ee("gitlab"),facebook:ee("facebook"),twitter:ee("twitter"),instagram:ee("instagram"),diaspora:ee("diaspora"),mastodon:ee("mastodon"),telegram:ee("telegram"),signal:ee("signal")};_transformServerData(e){const t=e.answers;if(t&&"object"==typeof t){const n={};for(const[e,i]of Object.entries(t)){const t=Array.isArray(i)?i:i&&"object"==typeof i?Object.values(i):[];n[e]=t.map(e=>e&&"object"==typeof e?this._linkEntity("answers",{...e,collection:"answers"}):e)}e.answers=n}return e}_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Organization.ADD_BLOCKS)){const i="ADD_ORGANIZATION"===t,r={...e,...this.defaultFields};i||delete r.id;const o=this._extractChangedFieldsFromSchema(this.apiClient,t,r,()=>{},i?[]:this.removeFields);if(o&&Object.keys(o).length>0){const e=await this._invokeBlockMethod(Organization.ADD_BLOCKS,n,o);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier cette organisation",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(this._costumCtx)return this._saveCostumViaElementSave(e);e.id&&delete e.id;let t=!1;const n=Organization.CUSTOM_FIELD_HANDLERS;if(n){const i=new Set;for(const[r,o]of n)r in e&&this._hasFieldChanged(r)&&(await this._invokeCustomFieldHandler(o.updateMethod,e[r],r),i.add(r),t=!0);i.forEach(t=>delete e[t])}for(const[n,i]of Array.from(Organization.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Organization.UPDATE_BLOCKS,i,r),t=!0)}return t};async addOrganization(e){return this.callIsConnected(()=>this.endpointApi.addOrganization(e))}async delete(e="delete organization"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError("getOrganizations n'existe pas dans Organization",404)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getMembers(e={},t={}){if(!this.id)throw new ApiError("L'organisation n'est pas définie, impossible de récupérer les membres",400);const n=this.id,i=this._getDefaultFromEndpoint("GET_MEMBERS_ADMIN","searchType");"citoyens"===t.searchType?e.searchType=["citoyens"]:"organizations"===t.searchType?e.searchType=i.filter(e=>"citoyens"!==e):e.searchType=i;return this._createPaginatorEngine({initialData:e,methodName:"getMembers",restoredState:t?.restoredState,finalizer:async e=>{const{toBeValidated:i,isAdmin:r,isAdminPending:o,isInviting:a,roles:s=[]}=t;this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(n,{linkType:"memberOf",toBeValidated:i,isAdmin:r,isAdminPending:o,isInviting:a,roles:s})):(delete e?.pathParams,e.filters=this._buildLinkFilters(n,{linkType:"memberOf",toBeValidated:!1,isAdmin:r,isInviting:a,roles:s}));return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getMembersAdmin(e)):()=>this.endpointApi.getMembersNoAdmin(e))()}}).next()}async getMemberOf(e={},t={}){if(!this.id)throw new ApiError("L'organisation n'est pas définie, impossible de récupérer ses adhésions",400);const n=`links.members.${this.id}`,i={[n]:{$exists:!0},[`${n}.toBeValidated`]:{$exists:!1},[`${n}.isInviting`]:{$exists:!1}},r=e?.filters&&"object"==typeof e.filters?e.filters:{},o={indexMin:0,indexStep:20,notSourceKey:!0,...e,searchType:["organizations"],countType:["organizations"],count:!0,filters:{...r,...i}};return this.searchCostum(o,t)}async getGallery(e={}){return super.getGallery(e)}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans cette organisation",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un poi dans cette organisation",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un event dans cette organisation",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans cette organisation",403);return super.badge(e)}async news(e={}){return super.news(e)}async form(e={}){return super.form(e)}async updateOpeningHours(e){const t=await this.updateField("openingHours",e);return await this._refreshIfDirect(),t}async updateTelephone(e){const t=await this.updateField("telephone",e);return await this._refreshIfDirect(),t}async updateVideo(e){if(!Array.isArray(e))throw new ApiError(`video: attendu tableau d'URLs. Reçu: ${JSON.stringify(e)}`,400);const t=await this.updateField("video",e);return await this._refreshIfDirect(),t}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}requestPromoteToAdmin(){return super.requestPromoteToAdmin()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}async getCostumJson(){return super.getCostumJson()}async searchCostum(e,t){return super.searchCostum(e,t)}async coformAnswersSearch(e){return super.coformAnswersSearch(e)}}class Poi extends BaseEntity{static entityType="poi";static entityTag="Poi";static COSTUM_ADD_CONSTANT="ADD_POI";static SCHEMA_CONSTANTS=["ADD_POI","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_POI","addPoi"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={parent:X};_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Poi.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(Poi.ADD_BLOCKS,n,i);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAuthor())throw new ApiError("Vous n'avez pas les droits pour modifier ce POI",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(this._costumCtx)return this._saveCostumViaElementSave(e);e.id&&delete e.id;let t=!1;for(const[n,i]of Array.from(Poi.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Poi.UPDATE_BLOCKS,i,r),t=!0)}return t};async addPoi(e={}){return this.parent&&this.parent.id&&this.parent.id!==this.userId&&!e.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected(()=>this.endpointApi.addPoi(e))}async delete(e="delete poi"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(){throw new ApiError(`getProjects n'existe pas dans ${this.constructor.name}`,501)}async getEvents(){throw new ApiError(`getEvents n'existe pas dans ${this.constructor.name}`,501)}async getPois(){throw new ApiError(`getPois n'existe pas dans ${this.constructor.name}`,501)}async getBadgesIssuer(){throw new ApiError(`getBadgesIssuer n'existe pas dans ${this.constructor.name}`,501)}async getNews(){throw new ApiError(`getNews n'existe pas dans ${this.constructor.name}`,501)}async getSubscribers(e={}){return super.getSubscribers(e)}async project(){throw new ApiError(`project n'existe pas dans ${this.constructor.name}`,501)}async poi(){throw new ApiError(`poi n'existe pas dans ${this.constructor.name}`,501)}async event(){throw new ApiError(`event n'existe pas dans ${this.constructor.name}`,501)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async badge(){throw new ApiError(`badge n'existe pas dans ${this.constructor.name}`,501)}async news(){throw new ApiError(`news n'existe pas dans ${this.constructor.name}`,501)}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}class Project extends BaseEntity{static entityType="projects";static entityTag="Project";static COSTUM_ADD_CONSTANT="ADD_PROJECT";static SCHEMA_CONSTANTS=["ADD_PROJECT","UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static ADD_BLOCKS=new Map([["ADD_PROJECT","addProject"],["PROFIL_IMAGE","updateImageProfil"]]);static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:ee("github"),gitlab:ee("gitlab"),facebook:ee("facebook"),twitter:ee("twitter"),instagram:ee("instagram"),diaspora:ee("diaspora"),mastodon:ee("mastodon"),telegram:ee("telegram"),signal:ee("signal"),parent:X};_transformServerData(e){const t=e.answers;if(t&&"object"==typeof t){const n={};for(const[e,i]of Object.entries(t)){const t=Array.isArray(i)?i:i&&"object"==typeof i?Object.values(i):[];n[e]=t.map(e=>e&&"object"==typeof e?this._linkEntity("answers",{...e,collection:"answers"}):e)}e.answers=n}return e}_add=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _add, utilisez save",400);e.id=this._newId?.(),e.slug&&delete e.slug;for(const[t,n]of Array.from(Project.ADD_BLOCKS)){const i=this._extractChangedFieldsFromSchema(this.apiClient,t,{...e,...this.defaultFields},()=>{});if(i&&Object.keys(i).length>0){const e=await this._invokeBlockMethod(Project.ADD_BLOCKS,n,i);!this.id&&e?.map?.id&&(this._draftData.id=e.map.id,this._draftData.slug=e.map.slug)}}};_update=async e=>{if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour modifier ce projet",403);if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);if(this._costumCtx)return this._saveCostumViaElementSave(e);e.id&&delete e.id;let t=!1;for(const[n,i]of Array.from(Project.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(Project.UPDATE_BLOCKS,i,r),t=!0)}return t};async addProject(e={}){return this.parent&&this.parent.id&&this.parent.id!==this.userId&&!e.parent&&(e.parent={},e.parent[`${this.parent.id}`]={type:this.parent.getEntityType(),name:this.parent.name}),this.callIsConnected(()=>this.endpointApi.addProject(e))}async delete(e="delete project"){await this._deleteViaElement(this.getEntityType(),e)}async getOrganizations(){throw new ApiError(`getOrganizations n'existe pas dans ${this.constructor.name}`,501)}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getNews(e={}){return super.getNews(e)}async getSubscribers(e={}){return super.getSubscribers(e)}async getContributors(e={},t={}){const n=this._getDefaultFromEndpoint("GET_CONTRIBUTORS_ADMIN","searchType");"citoyens"===t.searchType?e.searchType=["citoyens"]:"organizations"===t.searchType?e.searchType=n.filter(e=>"citoyens"!==e):e.searchType=n;return this._createPaginatorEngine({initialData:e,methodName:"getContributors",restoredState:t?.restoredState,finalizer:async e=>{const{toBeValidated:n,isAdmin:i,isInviting:r,isAdminPending:o,roles:a=[]}=t;this.isMe?(e.pathParams={id:this.id},e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:n,isAdmin:i,isAdminPending:o,isInviting:r,roles:a})):(delete e?.pathParams,e.filters=this._buildLinkFilters(this.id,{linkType:"projects",toBeValidated:!1,isAdmin:i,isInviting:r,roles:a}));return(this.isMe?()=>this.callIsMe(()=>this.endpointApi.getContributorsAdmin(e)):()=>this.endpointApi.getContributorsNoAdmin(e))()}}).next()}async getGallery(e={}){return super.getGallery(e)}async searchCostum(e,t){return super.searchCostum(e,t)}async project(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un projet dans ce projet",403);return super.project(e)}async poi(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un POI dans ce projet",403);return super.poi(e)}async event(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un événement dans ce projet",403);return super.event(e)}async badge(e={}){if(!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer un badge dans ce projet",403);return super.badge(e)}async form(e={}){return super.form(e)}async news(e={}){if(!e?.id&&!this.isContributor())throw new ApiError("Vous n'avez pas les droits pour créer une news dans ce projet",403);return super.news(e)}hasMilestone(e){if("string"!=typeof e||0===e.length)return!1;const t=this.serverData.oceco?.milestones;return!!Array.isArray(t)&&t.some(t=>t?.milestoneId===e)}async action(e={}){if(!e?.id&&!this.isAdmin())throw new ApiError("Vous n'avez pas les droits pour créer une action dans ce projet",403);return await this.entity("actions",e)}async requestToJoin(){return super.requestToJoin()}async requestToJoinAdmin(){return super.requestToJoinAdmin()}async acceptInvitation(){return super.acceptInvitation()}requestPromoteToAdmin(){return super.requestPromoteToAdmin()}async leave(){return super.leave()}async follow(){return super.follow()}async unfollow(){return super.unfollow()}}function te(e,t,n){return!!t&&!0===e?.notify?.id?.[t]?.[n]}class Notification{_data;_owner;_manager;_state;constructor(e,t,n=null){this._data=e,this._owner=t,this._manager=n;const i=t.userId;this._state=U({isUnread:te(e,i,"isUnread"),isUnseen:te(e,i,"isUnseen")})}static fromData(e,t,n=null){return new Notification(e,t,n)}_attach(e){return this._manager=e,this}get id(){return this._data.id}get isUnread(){return this._state.isUnread}get isUnseen(){return this._state.isUnseen}get data(){return this._data}get author(){return this._data.author}get createdAt(){const e=this._data.created;return e instanceof Date?e:new Date(e)}_setReadLocal(){this._state.isUnread=!1}_setSeenLocal(){this._state.isUnseen=!1}_restoreLocal(e,t){this._state.isUnread=e,this._state.isUnseen=t}async markRead(){if(!this._state.isUnread)return;const e=this._state.isUnread,t=this._state.isUnseen;this._setReadLocal(),this._manager?._recount();try{await this._owner.markNotificationAsRead(this.id)}catch(n){throw this._restoreLocal(e,t),this._manager?._recount(),n}}markSeen(){this._setSeenLocal(),this._manager?._recount()}toJSON(){return this._data}}class Notifications{_owner;_pageSize;_items=[];_state;constructor(e,t=15){this._owner=e,this._pageSize=t,this._state=U({loadedUnreadCount:0,unseenTotal:0,cursor:0,hasMore:!0,version:0})}get items(){return this._state.version,this._items}get loadedUnreadCount(){return this._state.loadedUnreadCount}get unseenTotal(){return this._state.unseenTotal}get hasMore(){return this._state.hasMore}_recount(){this._state.loadedUnreadCount=this._items.filter(e=>e.isUnread).length}_wrap(e){return e.map(e=>Notification.fromData(e,this._owner,this))}_commit(e){this._items=e,this._state.version++,this._recount()}async list({indexMin:e=0}={}){const t=this._wrap(await this._owner.fetchNotifications({indexMin:e}));return this._commit(t),this._state.cursor=t.length,this._state.hasMore=t.length>=this._pageSize,t}async loadMore(){if(!this._state.hasMore)return[];const e=this._wrap(await this._owner.fetchNotifications({indexMin:this._state.cursor}));return this._commit([...this._items,...e]),this._state.cursor+=e.length,this._state.hasMore=e.length>=this._pageSize,e}async refresh(){return this._state.cursor=0,this._state.hasMore=!0,this.list()}async count(){return this._state.unseenTotal=await this._owner.fetchNotificationsCount(),this._state.unseenTotal}toItems(e){return this._wrap(e)}async markAllRead(){await this._bulk("read")}async markAllSeen(){await this._bulk("seen")}async _bulk(e){const t=this._items.map(e=>({n:e,u:e.isUnread,s:e.isUnseen}));q(()=>{for(const{n:n}of t)"read"===e?n._setReadLocal():n._setSeenLocal()}),"seen"===e&&(this._state.unseenTotal=0),this._recount();try{await this._owner.markAllNotifications(e)}catch(e){throw q(()=>{for(const{n:e,u:n,s:i}of t)e._restoreLocal(n,i)}),this._recount(),e}}async clear(){await this._owner.removeAllNotifications(),this._commit([]),this._state.cursor=0,this._state.hasMore=!1,this._state.unseenTotal=0}toJSON(){return this._items.map(e=>e.toJSON())}restore(e){return this._commit(this._wrap(e)),this._state.cursor=e.length,this}static restore(e,t){return new Notifications(t).restore(e)}}class User extends BaseEntity{static entityType="citoyens";static entityTag="User";static SCHEMA_CONSTANTS=["UPDATE_BLOCK_DESCRIPTION","UPDATE_BLOCK_INFO","UPDATE_BLOCK_SOCIAL","UPDATE_BLOCK_LOCALITY","UPDATE_BLOCK_SLUG","PROFIL_IMAGE"];static UPDATE_BLOCKS=new Map([["UPDATE_BLOCK_DESCRIPTION","updateDescription"],["UPDATE_BLOCK_SOCIAL","updateSocial"],["UPDATE_BLOCK_LOCALITY","updateLocality"],["UPDATE_BLOCK_INFO","updateInfo"],["UPDATE_BLOCK_SLUG","updateSlug"],["PROFIL_IMAGE","updateImageProfil"]]);defaultFields={typeElement:this.getEntityType()};removeFields=["typeElement"];transforms={github:ee("github"),gitlab:ee("gitlab"),facebook:ee("facebook"),twitter:ee("twitter"),instagram:ee("instagram"),diaspora:ee("diaspora"),mastodon:ee("mastodon"),telegram:ee("telegram"),signal:ee("signal")};constructor(e,t,n){if(!n.EndpointApi)throw new ApiError("EndpointApi class must be injected to avoid circular dependency.",500);if(!t?.id&&!t?.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);if(!n.Organization)throw new ApiError("Organization class must be injected.",500);if(!n.Project)throw new ApiError("Project class must be injected.",500);if(!n.Event)throw new ApiError("Event class must be injected.",500);if(!n.Poi)throw new ApiError("Poi class must be injected.",500);if(!n.Badge)throw new ApiError("Badge class must be injected.",500);if(!n.News)throw new ApiError("News class must be injected.",500);if(!n.Answer)throw new ApiError("Answer class must be injected.",500);super(e,t,n)}get slug(){return this._draftData.slug||null}get isMe(){return this.isConnected&&this.userId===this.id}get parentIsMe(){return super.isMe}get isActingUser(){return this.parentIsMe&&!this.isMe}getEntityType(){return"citoyens"}async get(){return this._checkNotDeleted(),this.apiClient.safeCall(async()=>{if(this.isMe){const e=await this.endpointApi.meInfoUrl();return this._setData(e,{forceInitialDraftReset:!0}),e}{const e=await this._getPublicProfile();return this._setData(e,{forceInitialDraftReset:!0}),e}})}async changePassword(e){return this.callIsMe(()=>this.endpointApi.changePassword(e))}async delete(e){const t=await this.callIsMe(()=>this.endpointApi.deleteAccount(e));return Object.keys(this._draftData).forEach(e=>delete this._draftData[e]),Object.keys(this._serverData).forEach(e=>delete this._serverData[e]),this._isDeleted=!0,t}async save(){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour sauvegarder.",401);return await super.save()}_add=async()=>{throw new ApiError("Vous ne pouvez pas ajouter un utilisateur par ce moyen.",403)};_update=async e=>{if(!this._calledFromSave)throw new ApiError("utilisation invalide de _update, utilisez save",400);e.id&&delete e.id;let t=!1;for(const[n,i]of Array.from(User.UPDATE_BLOCKS)){const r=this._extractChangedFieldsFromSchema(this.apiClient,n,{...e,...this.defaultFields},()=>this.initialDraftData,this.removeFields);r&&Object.keys(r).length>0&&(await this._invokeBlockMethod(User.UPDATE_BLOCKS,i,r),t=!0)}return t};static fromServerData(e,t,n){const i=new this(t,e,n);return e&&"object"==typeof e&&Object.keys(e).length>0&&"function"==typeof i._setData&&i._setData(e,{forceInitialDraftReset:!0}),i}async updateSettings(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les paramètres.",401);const t=await super.updateSettings(e);return await this.refresh(),t}async updateDescription(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la description.",401);return super.updateDescription(e)}async updateInfo(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les informations.",401);return super.updateInfo(e)}async updateSocial(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour les réseaux sociaux.",401);return super.updateSocial(e)}async updateLocality(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour la localité.",401);return super.updateLocality(e)}async updateSlug(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour le slug.",401);return super.updateSlug(e)}async updateImageProfil(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de profil.",401);return super.updateImageProfil(e)}async updateImageBanner(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour mettre à jour l'image de bannière.",401);return super.updateImageBanner(e)}async getOrganizations(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_ORGANIZATIONS_NO_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getOrganizations",restoredState:t?.restoredState,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe(()=>this.endpointApi.getOrganizationsAdmin(e)):()=>this.endpointApi.getOrganizationsNoAdmin(e);return this.isMe||e.filters||(e.filters={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}}),t()}}).next()}async getEligiblePlaces(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_USER_ELIGIBLE_PLACES","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getEligiblePlaces",restoredState:t?.restoredState,finalizer:async e=>{delete e?.pathParams;const t=e.filters??{},n={[`links.members.${this.id}`]:{$exists:!0},[`links.members.${this.id}.toBeValidated`]:{$exists:!1},[`links.members.${this.id}.isInviting`]:{$exists:!1}};return e.filters={...n,...t},this.callIsMe(()=>this.endpointApi.getUserEligiblePlaces(e))}}).next()}async getProjects(e={}){return super.getProjects(e)}async getEvents(e={}){return super.getEvents(e)}async getPois(e={}){return super.getPois(e)}async getNews(e={}){return super.getNews(e)}async getFriends(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_FRIENDS_ADMIN","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getFriends",restoredState:t?.restoredState,finalizer:async e=>(delete e?.pathParams,!this.isMe&&this.id&&(e.pathParams={id:this.id}),this.endpointApi.getFriendsAdmin(e))}).next()}async getSubscriptions(e={},t){e.searchType=this._getDefaultFromEndpoint("GET_SUBSCRIPTIONS","searchType");return this._createPaginatorEngine({initialData:e,methodName:"getSubscriptions",restoredState:t?.restoredState,finalizer:async e=>{delete e?.pathParams;const t=this.isMe?()=>this.callIsMe(()=>this.endpointApi.getSubscriptionsAdmin(e)):()=>this.endpointApi.getSubscriptions(e);return this.isMe||e.filters||(e.filters={[`links.followers.${this.id}`]:{$exists:!0}}),t()}}).next()}async getSubscribers(e={}){return super.getSubscribers(e)}async getBadgesIssuer(e={}){return super.getBadgesIssuer(e)}async getBadges(e={}){return await this.linkEntitiesFromServerData("badges",e)}async getGallery(e={}){return super.getGallery(e)}async user(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur",401);if(!e.id&&!e.slug)throw new ApiError("Vous devez fournir un id ou un slug pour créer un User.",400);const t=this.deps,n=new User(this,e,t);return await n.get(),n}async organization(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une organisation.",401);return super.organization(e)}async project(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un projet.",401);return super.project(e)}async form(){throw new ApiError(`form n'existe pas dans ${this.constructor.name}`,501)}async news(e={}){if(!("id"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer une actualité.",401);return super.news(e)}async poi(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un POI.",401);return super.poi(e)}async event(e={}){if(!("id"in e)&&!("slug"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un événement.",401);return super.event(e)}async costum(e){return async function(e,t){const n=A[t],i=T[t];if(!n||!i)throw new ApiError(`Costum inconnu : "${t}". (Le live-fetch d'un costum hors registry n'est pas encore supporté.)`,404);const{default:r}=await i();return new CostumScope(e,t,r,n.costumId,n.costumType)}(this,e)}async badge(e={}){if(!("id"in e)&&!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer un badge.",401);return super.badge(e)}async sendFriendRequest(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour envoyer une demande d'amis.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeConnect:e}=this._getLinkMeta(),t=this._getLinkFromConnectedUser();if(!t){const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},n=await this.endpointApi.connect(t);return await(this.userContext?.refresh()),n}if(t.isInviting&&t.invitorId===this.id)return this.acceptFriendRequest();if(t.isInviting&&t.invitorId===this.userId)throw new ApiError("Vous avez déjà envoyé une demande d'amis à cet utilisateur.",403);throw new ApiError("Vous êtes déjà connecté à cette entité.",409)}async acceptFriendRequest(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour accepter une demande d'amitié.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const e=this._getLinkFromConnectedUser();if(e?.isInviting&&e.invitorId===this.id){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,linkOption:"isInviting"},t=await this.endpointApi.linkValidate(e);return await(this.userContext?.refresh()),t}throw new ApiError("Vous n'avez pas d'invitation à valider.",404)}async removeFriend(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour supprimer un ami.",401);if(this._checkLinkableEntity(),!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);const{connectTypeDisconnect:e}=this._getLinkMeta();if(!this._getLinkFromConnectedUser())throw new ApiError("Vous n'êtes pas connecté à cette entité.",404);const t={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:e},n=await this.endpointApi.disconnect(t);return await(this.userContext?.refresh()),n}async requestToJoin(){throw new ApiError("l'utilisation de requestToJoin n'est pas autorisée sur un utilisateur.",403)}async requestToJoinAdmin(){throw new ApiError("l'utilisation de requestToJoinAdmin n'est pas autorisée sur un utilisateur.",403)}async acceptInvitation(){throw new ApiError("l'utilisation de acceptInvitation n'est pas autorisée sur un utilisateur.",403)}async leave(){throw new ApiError("l'utilisation de leave n'est pas autorisée sur un utilisateur.",403)}async follow(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour suivre un utilisateur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!(this.userContext?.serverData?.links?.follows?.[this.id]||null)){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id},t=await this.endpointApi.follow(e);return await(this.userContext?.refresh()),t}throw new ApiError("Vous êtes déjà abonné à cet utilisateur.",409)}async unfollow(){if(!this.isActingUser||!this.userId)throw new ApiError("Vous devez être connecté pour vous désabonner d'un utilisateur.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(this.userContext?.serverData?.links?.follows?.[this.id]||null){const e={childId:this.userId,childType:"citoyens",parentType:this.getEntityType(),parentId:this.id,connectType:"followers"},t=await this.endpointApi.disconnect(e);return await(this.userContext?.refresh()),t}throw new ApiError("Vous n'êtes pas abonné à cet utilisateur.",404)}isFriend(e){const t=e?.silent??!0;try{if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous êtes ami.",401)}catch(e){if(t)return!1;throw e}this._assertEntityType("citoyens");const n=this._getLinkFromConnectedUser();return!!n&&this._validateUserLink(n)}isFollower(e){const t=e?.silent??!0;try{if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si il vous suit.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404)}catch(e){if(t)return!1;throw e}return this._assertEntityType("citoyens"),this._isLinked("followers")}isFollowing(e){const t=e?.silent??!0;try{if(!this.isActingUser)throw new ApiError("Vous devez être connecté pour vérifier si vous le suivez.",401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404)}catch(e){if(t)return!1;throw e}return this._assertEntityType("citoyens"),this._isLinked("follows")}async entityBySlug(e){if(!this.isMe)throw new ApiError("Vous devez être connecté et être l'utilisateur pour créer cet entité.",401);return super.entityBySlug(e)}_validateBasePreconditions(e,t){if(!this.userId)throw new ApiError(`Vous devez être connecté pour ${e}.`,401);if(!this.id)throw new ApiError(`${this.constructor.name} non enregistrée.`,404);if(!this.parent?.id)throw new ApiError("L'entité parente n'est pas enregistrée.",404);if(!t.includes(this.parent.getEntityType()))throw new ApiError(`L'entité doit être de type : ${t.join(", ")}, reçu : ${this.parent.getEntityType()}`,400)}_validateMemberPreconditions(e,t){if(this._validateBasePreconditions(e,t),!this.parent?.id)throw new ApiError("L'entité parente n'est pas enregistrée.",404);const n=this.parent.getEntityType();if("events"===n)return;let i=!1;switch(n){case"organizations":i=this.parent.isMember();break;case"projects":i=this.parent.isContributor();break;default:i=!1}if(!i){throw new ApiError(`Vous devez être ${{organizations:"membre",projects:"contributeur"}[n]||"membre"} pour effectuer cette action.`,401)}}_validateAdminPreconditions(e,t){if(this._validateMemberPreconditions(e,t),!this.parent?.isAdmin())throw new ApiError("Vous devez être administrateur pour effectuer cette action.",401)}_getParentLinkForUser(){const{connectTypeDisconnect:e}=this.parent._getLinkMeta(),t=this.id;return t&&this.parent?.serverData?.links?.[e]?.[t]||null}_getValidatedParentLink(e,t,n){const i=n?.silent??!0;try{this._validateBasePreconditions(e,t)}catch(e){if(i)return null;throw e}return this._getParentLinkForUser()}async _refreshWithParent(){await this.refresh(),this.parent&&await this.parent.refresh()}isAdmin(e){const t=this._getValidatedParentLink("isAdmin",["organizations","projects"],{silent:e?.silent});return this._validateUserLink(t)&&!0===t?.isAdmin}isMember(e){const t=this._getValidatedParentLink("isMember",["organizations"],{silent:e?.silent});return this._validateUserLink(t)}isContributor(e){const t=this._getValidatedParentLink("isContributor",["projects"],{silent:e?.silent});return this._validateUserLink(t)}isAttendee(e){const t=this._getValidatedParentLink("isAttendee",["events"],{silent:e?.silent});return this._validateUserLink(t)}isInviting(e){const t=this._getValidatedParentLink("isInviting",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.isInviting}isInvitingFriend(e){const t=this._getValidatedUserLink("isInvitingFriend",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.isInviting}isInvitingAdmin(e){const t=this._getValidatedParentLink("isInvitingAdmin",["organizations","projects"],{silent:e?.silent});return!!t&&((!0===t.isAdminInviting||!0===t.isInviting)&&!0===t.isAdmin)}isAdminPending(e){const t=this._getValidatedParentLink("isAdminPending",["organizations","projects"],{silent:e?.silent});return!!t&&(!0===t.isAdmin&&!0===t.isAdminPending)}isToBeValidated(e){const t=this._getValidatedParentLink("isToBeValidated",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.toBeValidated}isToBeValidatedFriend(e){const t=this._getValidatedUserLink("isToBeValidatedFriend",["citoyens","organizations","projects","events"],{silent:e?.silent});return!!t&&!0===t.toBeValidated}async sendRequestToJoinParent({admin:e}={admin:!1}){e?this._validateAdminPreconditions("sendRequestToJoinParent",["organizations","projects"]):this._validateMemberPreconditions("sendRequestToJoinParent",["organizations","projects","events"]);const{connectTypeConnect:t}=this.parent._getLinkMeta(),n=this._getParentLinkForUser();if(!n){const n=this.parent.getEntityType(),i={childId:this.id,childType:"citoyens",parentType:n,parentId:this.parent.id,connectType:e?"admin":t},r=await this.callIsConnected(()=>this.endpointApi.connect(i));return await this._refreshWithParent(),r}if(n.isInviting||n?.isAdminInviting)throw new ApiError("Une invitation est déjà en attente d'acceptation.",400);throw new ApiError("Vous êtes déjà connecté à cette entité.",400)}async validateMemberRequest(){this._validateAdminPreconditions("validateMemberRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.toBeValidated)throw new ApiError("Cet utilisateur n'a pas de demande en attente de validation.",400);const t=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"toBeValidated"},i=await this.callIsConnected(()=>this.endpointApi.linkValidate(n));return await this._refreshWithParent(),i}async validateAdminRequest(){this._validateAdminPreconditions("validateAdminRequest",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdminPending)throw new ApiError("Cet utilisateur n'a pas de demande d'admin en attente.",400);const t=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,linkOption:"isAdminPending"},i=await this.callIsConnected(()=>this.endpointApi.linkValidate(n));return await this._refreshWithParent(),i}async removeFromParent(){this._validateAdminPreconditions("removeFromParent",["organizations","projects"]);if(!this._getParentLinkForUser())throw new ApiError("Cet utilisateur n'est pas connecté à cette entité.",400);const e=this.parent.getEntityType(),{connectTypeDisconnect:t}=this.parent._getLinkMeta(),n={childId:this.id,childType:"citoyens",parentType:e,parentId:this.parent.id,connectType:t},i=await this.callIsConnected(()=>this.endpointApi.disconnect(n));return await this._refreshWithParent(),i}async promoteToAdmin(){this._validateAdminPreconditions("promoteToAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e)throw new ApiError("Cet utilisateur n'est pas membre de cette entité.",400);if(e?.isAdmin&&(e?.isInviting||e?.isAdminInviting))throw new ApiError("Cet utilisateur est déjà en cours d'invitation en tant qu'admin.",400);if(e?.isAdmin&&!e?.isInviting&&!e?.isAdminInviting)throw new ApiError("Cet utilisateur est déjà admin.",400);const t=this.parent.getEntityType(),n={childId:this.id,childType:"citoyens",parentType:t,parentId:this.parent.id,connectType:"admin"},i=await this.callIsConnected(()=>this.endpointApi.connect(n));return await this._refreshWithParent(),i}async demoteFromAdmin(){this._validateAdminPreconditions("demoteFromAdmin",["organizations","projects"]);const e=this._getParentLinkForUser();if(!e?.isAdmin||e.isAdminPending)throw new ApiError("Cet utilisateur n'est pas admin de cette entité.",400);const t=this.parent.getEntityType(),{connectTypeDisconnect:n}=this.parent._getLinkMeta(),i=t,r={childId:this.id,childType:"citoyens",parentType:i,parentId:this.parent.id,connect:n,isAdmin:!1},o=await this.callIsConnected(()=>this.endpointApi.demoteAdmin(r));return await this._refreshWithParent(),o}_notifications;get notifications(){return this._notifications??=new Notifications(this)}async fetchNotifications({indexMin:e}={}){const t=await this.callIsMe(()=>{const t={pathParams:{type:"citoyens",id:this.userId},...null!=e?{indexMin:e}:{}};return this.endpointApi.getNotifications(t)});return Array.isArray(t?.notif)?t.notif:[]}async fetchNotificationsCount(){const e=await this.callIsMe(()=>{const e={pathParams:{type:"citoyens",id:this.userId},refreshTimestamp:Math.floor(Date.now()/1e3)};return this.endpointApi.getNotificationsCount(e)});return"number"==typeof e?.countNotif?e.countNotif:0}async markNotificationAsRead(e){const t={id:e};return this.callIsMe(()=>this.endpointApi.markNotificationAsRead(t))}async markAllNotifications(e){const t={action:e,all:!0};return this.callIsMe(()=>this.endpointApi.notificationUpdate(t))}async removeAllNotifications(){return this.callIsMe(()=>this.endpointApi.removeAllNotifications())}}Object.assign(User.prototype,{});const ne=["ambassadeurTel","buildingSurfaceArea","duration","equip_larg","equip_long","equip_surf","expectedAttendees","maximumAttendees","nbHabitant","referentPhone","siteSurfaceArea","telephoneCie","year"],ie=["dateCreation","equip_maj_date","inst_date_creation","inst_enqu_date","signedOn"];class ObjectID{_str;constructor(e){if(this._str=void 0,e){if(e=e.toLowerCase(),24!==(t=e).length||!/^[0-9a-f]*$/.test(t))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=e}var t}equals(e){return e instanceof ObjectID&&this.valueOf()===e.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str?.substr(0,8)??"",16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}}const re=ObjectID,oe={common1:{pattern:"^[a-f0-9]{24}$",type:"string"},common2:{type:"string"},common3:{format:"email",type:"string"},common4:{type:"boolean"},common5:{format:"uri",type:"string"},common6:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common7:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}},required:["id"],type:"object"},common9:{additionalProperties:!1,properties:{reason:{default:"",type:"string"}},required:["reason"],type:"object"},common11:{default:"",type:"string"},common12:{const:"citoyens"},common13:{properties:{value:{type:"boolean"}}},common15:{enum:["isOpenData","isOpenEdition","private","feedback"]},common16:{const:"organizations"},common17:{const:"projects"},common18:{const:"events"},common19:{default:"citoyens",enum:["citoyens","projects","organizations","events"],type:"string"},common20:{},common21:{else:{properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}}},if:{properties:{typeElement:{const:"citoyens"}}},then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"}}}},common24:{properties:{typeElement:{const:"citoyens"}}},common27:{not:{type:"null"}},common29:{default:"citoyens",enum:["citoyens","projects","organizations","poi","events"],type:"string"},common30:{anyOf:[{format:"email",type:"string"},{const:"",type:"string"}]},common31:{const:"",type:"string"},common32:{anyOf:[{items:{type:"string"},type:"array"},{enum:[""],type:"string"}]},common33:{items:{type:"string"},type:"array"},common34:{enum:[""],type:"string"},common35:{anyOf:[{format:"uri",type:"string"},{const:"",type:"string"}]},common36:{properties:{name:{not:{type:"null"}}},required:["name"]},common38:{properties:{url:{not:{type:"null"}}},required:["url"]},common40:{properties:{tags:{not:{type:"null"}}},required:["tags"]},common42:{properties:{email:{not:{type:"null"}}},required:["email"]},common44:{format:"date",type:"string"},common45:{const:"info",default:"info",type:"string"},common46:{anyOf:[{type:"string"},{const:"",type:"string"}]},common47:{$ref:"#/$defs/sharedFields/name"},common48:{$ref:"#/$defs/sharedFields/tags"},common49:{default:"citoyens",enum:["citoyens"],type:"string"},common50:{$ref:"#/$defs/sharedFields/url"},common51:{properties:{avancement:{not:{type:"null"}}},required:["avancement"]},common53:{properties:{parent:{not:{type:"null"}}},required:["parent"]},common55:{$ref:"#/$defs/sharedFields/emailNullable"},common56:{additionalProperties:!1,patternProperties:{"^[a-fA-F0-9]{24}$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"}},type:"object"},common58:{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type","name"],type:"object"},common60:{properties:{type:{not:{type:"null"}}},required:["type"]},common62:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common65:{enum:["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],type:"string"},common66:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},common67:{enum:["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],type:"string"},common68:{enum:["poi"],type:"string"},common69:{$ref:"#/$defs/socialField"},common70:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},common71:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},common74:{oneOf:[{const:"",type:"string"},{additionalProperties:!1,properties:{"@type":{const:"PostalAddress",type:"string"},addressCountry:{type:"string"},addressLocality:{type:"string"},codeInsee:{type:"string"},level1:{type:"string"},level1Name:{type:"string"},level3:{minLength:0,type:"string"},level3Name:{minLength:0,type:"string"},level4:{minLength:0,type:"string"},level4Name:{minLength:0,type:"string"},localityId:{type:"string"},postalCode:{type:"string"},streetAddress:{type:"string"}},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"}]},common77:{const:"PostalAddress",type:"string"},common78:{minLength:0,type:"string"},common79:{oneOf:[{const:"",type:"string"},{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"}]},common80:{additionalProperties:!1,properties:{"@type":{const:"GeoCoordinates",type:"string"},latitude:{type:["string","number"]},longitude:{type:["string","number"]}},required:["latitude","longitude"],type:"object"},common84:{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates","float"],type:"object"},common87:{type:"number"},common88:{const:!0,default:!0,type:"boolean"},common90:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common93:{maxLength:100,minLength:3,pattern:"^[a-zA-Z0-9]+$",type:"string"},common94:{properties:{type:{const:"citoyens"}}},common96:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common102:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi"],type:"string"},common105:{properties:{parentId:{pattern:"^[a-f0-9]{24}$"}}},common107:{properties:{parentType:{const:"citoyens"}}},common109:{properties:{parentId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common111:{default:!0,type:"boolean"},common112:{default:0,type:"integer"},common113:{items:{pattern:"^[a-f0-9]{24}$",type:"string"},type:"array"},common114:{required:["text"]},common115:{required:["mediaImg"]},common116:{required:["mediaFile"]},common117:{additionalProperties:!1,properties:{countFiles:{type:"number"},files:{items:{type:"string"},type:"array"}},required:["countFiles","files"],type:"object"},common119:{additionalProperties:!1,properties:{countImages:{type:"number"},images:{items:{type:"string"},type:"array"}},required:["countImages","images"],type:"object"},common121:{items:{properties:{count:{minimum:1,type:"integer"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common125:{default:"public",enum:["public","private","restricted"],type:"string"},common126:{const:"news",default:"news",type:"string"},common127:{additionalProperties:!1,else:{properties:{ownerId:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{folder:{const:"citoyens"}}},properties:{folder:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"},ownerId:{type:"string"}},required:["folder","ownerId"],then:{properties:{ownerId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common129:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"}},required:["id"],type:"object"},common130:{default:!1,type:"boolean"},common131:{properties:{childId:{pattern:"^[a-f0-9]{24}$"}}},common133:{properties:{childType:{const:"citoyens"}}},common135:{const:"share",default:"share",type:"string"},common136:{properties:{childId:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},common138:{default:"news",enum:["news"],type:"string"},common139:{items:{additionalProperties:!1,properties:{count:{type:"number"},id:{pattern:"^[a-f0-9]{24}$",type:"string"},name:{type:"string"},slug:{type:"string"},type:{type:"string"},value:{type:"string"}},required:["id","name","slug","type","value","count"],type:"object"},type:"array"},common142:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi","answers","forms"],type:"string"},common143:{const:!1,default:!1,type:"boolean"},common144:{const:"",default:"",type:"string"},common145:{default:0,type:"number"},common146:{default:30,type:"number"},common147:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{id:{type:"string"},type:{enum:["cities","level1"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},common152:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},common154:{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"},common156:{anyOf:[{type:"string"},{items:{type:"string"},minItems:1,type:"array"}]},common158:{minimum:0,type:"integer"},common159:{default:0,minimum:0,type:"integer"},common160:{const:["projects"],default:["projects"],items:{enum:["projects"],type:"string"},type:"array"},common162:{$exists:!0},common163:{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},common166:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","projects","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common168:{const:["poi"],default:["poi"],items:{enum:["poi"],type:"string"},type:"array"},common169:{const:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{enum:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],type:"string"},type:"array"},common171:{$exists:!1},common172:{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},common174:{const:!1},common175:{default:30,type:"integer"},common176:{additionalProperties:!1,else:{properties:{id:{pattern:"^[a-f0-9]{24}$"}}},if:{properties:{type:{const:"citoyens"}}},properties:{id:{type:"string"},type:{default:"citoyens",enum:["citoyens","organizations"],type:"string"}},required:["type","id"],then:{properties:{id:{default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$"}}},type:"object"},common179:{"links.members.@{pathParams.id}":{$exists:!0},"links.members.@{pathParams.id}.isInviting":{$exists:!1},"links.members.@{pathParams.id}.toBeValidated":{$exists:!1}},common180:{default:["NGO","Cooperative","LocalBusiness","Group","GovernmentOrganization"],items:{type:"string"},type:"array"},common181:{default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common183:{additionalProperties:!1,properties:{$exists:{default:!1,type:"boolean"}},required:["$exists"],type:"object"},common185:{additionalProperties:!1,properties:{$in:{items:{type:"string"},minItems:1,type:"array"}},required:["$in"],type:"object"},common187:{default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},minItems:1,type:"array"},common188:{const:["citoyens"],default:["citoyens"],items:{enum:["citoyens"],type:"string"},type:"array"},common189:{enum:["citoyens"],type:"string"},common190:{const:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],default:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],items:{enum:["citoyens","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects"],type:"string"},type:"array"},common192:{not:{propertyNames:{pattern:"^(?!links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common195:{"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":{additionalProperties:!1,properties:{$exists:{const:!0}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"},"^links\\.followers\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":{additionalProperties:!1,properties:{$exists:{const:!1}},required:["$exists"],type:"object"}},common196:{not:{propertyNames:{pattern:"^(?!links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}},common199:{default:"citoyens",enum:["citoyens","organizations","projects"],type:"string"},common200:{const:["badges"],default:["badges"],items:{enum:["badges"],type:"string"},type:"array"},common202:{const:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],default:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],items:{enum:["citoyens","projects","NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],type:"string"},type:"array"},common204:{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"},common206:{const:!0,type:"boolean"},common207:{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},common210:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":{additionalProperties:!1,properties:{$exists:{const:!1,type:"boolean"}},required:["$exists"],type:"object"},"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":{additionalProperties:!1,properties:{$exists:{const:!0,type:"boolean"}},required:["$exists"],type:"object"}},common211:{indexMax:30,indexMin:0},common212:{properties:{parentType:{const:"organizations"}}},common214:{properties:{parentType:{const:"projects"}}},common216:{properties:{parentType:{const:"events"}}},common218:{default:"@userId",pattern:"^([a-f0-9]{24}|@\\w+)$",type:"string"},common219:{const:"citoyens",default:"citoyens",enum:["citoyens"],type:"string"},common220:{enum:["citoyens","organizations","projects","events"],type:"string"},common221:{const:"citoyens",default:"citoyens",type:"string"},common222:{const:"@userId",default:"@userId",pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},common223:{oneOf:[{const:"",type:"string"},{additionalProperties:!0,properties:{coordinates:{items:{type:"number"},maxItems:2,minItems:2,type:"array"},float:{const:!0,default:!0,type:"boolean"},type:{const:"Point",type:"string"}},required:["type","coordinates"],type:"object"}]},common225:{minLength:3,type:"string"},common226:{enum:["Mo","Tu","We","Th","Fr","Sa","Su"],type:"string"},common227:{additionalProperties:!1,properties:{closes:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"},opens:{pattern:"^([01]\\d|2[0-3]):[0-5]\\d$",type:"string"}},required:["opens","closes"],type:"object"},common230:{default:{isOpenData:!0,isOpenEdition:!0},properties:{isOpenData:{default:!0,type:"boolean"},isOpenEdition:{default:!0,type:"boolean"}},required:["isOpenData","isOpenEdition"],type:"object"},common233:{oneOf:[{const:"",type:"string"},{items:{type:"string"},type:"array"}]},common234:{const:"projects",default:"projects",type:"string"},common235:{additionalProperties:!1,default:{"@userId":{type:"citoyens"}},patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"}},required:["type"],type:"object"}},type:"object"},common238:{const:"poi",default:"poi",type:"string"},common239:{const:"events",default:"events",type:"string"},common240:{format:"date-time",type:"string"},common241:{type:"integer"},common242:{additionalProperties:!1,properties:{id:{default:"@userId",pattern:"^[a-f0-9]{24}$",type:"string"},type:{const:"citoyens",default:"citoyens",type:"string"}},required:["type","id"],type:"object"},common245:{const:"badges",default:"badges",type:"string"},common246:{const:"badge",default:"badge",type:"string"},common247:{patternProperties:{"^[0-9a-f]{24}$":{additionalProperties:!1,properties:{isAdmin:{default:"",enum:["","admin"],type:"string"},name:{type:"string"},roles:{items:{type:"string"},type:"array"}},required:["name"],type:"object"}},type:"object"},common251:{default:"",enum:["","admin"],type:"string"},common252:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumId:{pattern:"^[a-f0-9]{24}$",type:"string"},costumSlug:{type:"string"},costumType:{enum:["projects","organizations"],type:"string"},count:{const:!0,default:!0,type:"boolean"},countType:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi","answers","forms","classifieds"],type:"string"},type:"array"},fediverse:{default:!1,type:"boolean"},fields:{items:{type:"string"},type:"array"},filters:{default:"",oneOf:[{additionalProperties:!0,type:"object"},{const:"",type:"string"}]},indexMax:{type:"number"},indexMin:{default:0,type:"number"},indexStep:{default:30,type:"number"},initType:{const:"",default:"",type:"string"},locality:{oneOf:[{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{countryCode:{type:"string"},id:{type:"string"},level:{type:["string","number"]},name:{type:"string"},postalCode:{type:"string"},type:{enum:["cities","cp","country","level1","level2","level3","level4","level5"],type:"string"}},required:["id","type"],type:"object"}},type:"object"},{items:{additionalProperties:!1,properties:{countryCode:{type:"string"},id:{type:"string"},level:{type:["string","number"]},name:{type:"string"},postalCode:{type:"string"},type:{enum:["cities","cp","country","level1","level2","level3","level4","level5"],type:"string"}},required:["id","type"],type:"object"},type:"array"},{const:"",type:"string"}]},mapUsed:{const:!0,type:"boolean"},mode:{type:"string"},name:{type:"string"},notSourceKey:{const:!0,type:"boolean"},options:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},type:"object"},ranges:{additionalProperties:!1,patternProperties:{"^[^\\s]+$":{additionalProperties:!1,properties:{indexMax:{type:"number"},indexMin:{type:"number"}},required:["indexMin","indexMax"],type:"object"}},type:"object"},searchBy:{anyOf:[{type:"string"},{items:{type:"string"},minItems:1,type:"array"}]},searchTags:{items:{type:"string"},type:"array"},searchType:{items:{enum:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","organizations","projects","events","citoyens","poi","answers","forms","classifieds"],type:"string"},type:"array"},sortBy:{additionalProperties:{enum:[1,-1],type:"integer"},type:"object"},sourceKey:{items:{type:"string"},type:"array"}},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse","costumSlug","costumEditMode"],type:"object"},common254:{enum:["projects","organizations"],type:"string"},common257:{default:"",oneOf:[{additionalProperties:!0,type:"object"},{const:"",type:"string"}]},common258:{additionalProperties:!0,type:"object"},common266:{additionalProperties:!0,properties:{tags:{additionalProperties:!0,properties:{verb:{type:"string"}},type:"object"}},type:"object"},common270:{additionalProperties:{enum:[1,-1],type:"integer"},type:"object"},common272:{additionalProperties:!1,properties:{id:{pattern:"^[a-f0-9]{24}$",type:"string"},type:{default:"events",type:"string"}},required:["id","type"],type:"object"},common275:{items:{properties:{id:{type:"string"}},required:["id"],type:"object"},type:"array"},common278:{additionalProperties:!1,properties:{contextId:{pattern:"^[a-f0-9]{24}$",type:"string"},contextType:{enum:["projects","organizations"],type:"string"},costumEditMode:{default:!1,type:"boolean"},costumId:{pattern:"^[a-f0-9]{24}$",type:"string"},costumSlug:{type:"string"},costumType:{enum:["projects","organizations"],type:"string"},mode:{type:"string"},sourceKey:{items:{type:"string"},type:"array"}},type:"object"},common280:{items:{enum:["answers"],type:"string"},type:"array"},common282:{enum:["comments","news"],type:"string"},common283:{minLength:1,type:"string"},common284:{default:"citoyens",enum:["citoyens","organizations","projects","events","poi"],type:"string"},common285:{type:"array"},common286:{additionalProperties:!0,properties:{costumId:{type:"string"},costumSlug:{type:"string"},costumType:{type:"string"},username:{type:"string"}},required:["username","costumSlug","costumId","costumType"],type:"object"},common288:{additionalProperties:!0,properties:{costumId:{type:"string"},costumSlug:{type:"string"},costumType:{type:"string"}},required:["costumSlug","costumId","costumType"],type:"object"}},ae={endpoints:[{auth:"bearer",constant:"DOCUMENT_LIST",contentType:"application/json",method:"GET",path:"/co2/document/list/id/{id}/type/{type}/tpl/json",pathParams:{additionalProperties:!1,properties:{id:oe.common1,type:{default:"poi",enum:["citoyens","organizations","projects","events","poi"],type:"string"}},required:["id","type"],type:"object"}},{auth:"none",constant:"PERSON_REGISTER",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/register",request:{additionalProperties:!1,properties:{app:oe.common2,email:oe.common3,isInvitation:oe.common4,mode:oe.common2,name:oe.common2,pendingUserId:oe.common2,pwd:oe.common2,username:oe.common2},required:["name","username","email","pwd"],type:"object"}},{auth:"none",constant:"AUTHENTICATE_URL",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/api/cocolight/authenticate",postActions:[{path:"accessToken",type:"setToken"},{path:"refreshToken",type:"setRefreshToken"},{event:"userLoggedIn",path:"user",type:"emitEvent"}],request:{additionalProperties:!1,properties:{email:oe.common3,password:oe.common2},required:["email","password"],type:"object"}},{auth:"none",constant:"REFRESH_TOKEN_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/refreshtoken",request:{additionalProperties:!1,properties:{refreshToken:oe.common2},required:["refreshToken"],type:"object"}},{auth:"bearer",constant:"ME_INFO_URL",contentType:"application/json",method:"POST",path:"/api/cocolight/me"},{auth:"none",constant:"PASSWORD_RECOVERY",contentType:"application/x-www-form-urlencoded",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/sendemail",request:{additionalProperties:!1,properties:{email:oe.common3,type:{const:"password",default:"password",type:"string"}},required:["email","type"],type:"object"}},{auth:"bearer",constant:"SERVER_EXCHANGE_TOKEN",contentType:"application/json",method:"POST",path:"/api/cocolight/exchangetoken",request:{additionalProperties:!1,properties:{serverUrl:oe.common5},required:["serverUrl"],type:"object"}},{auth:"bearer",constant:"CHANGE_PASSWORD",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/person/changepassword",request:{additionalProperties:!1,properties:{mode:{const:"changePassword",default:"changePassword",type:"string"},newPassword:oe.common2,newPassword2:oe.common2,oldPassword:oe.common2,scope:{default:"",type:["string"]},userId:oe.common6},required:["mode","userId","oldPassword","newPassword","newPassword2"],type:"object"}},{auth:"bearer",constant:"DELETE_ACCOUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/id/{id}/type/citoyens",pathParams:oe.common7,postActions:[{type:"resetSession"},{event:"accountDeleted",path:null,type:"emitEvent"}],request:oe.common9},{auth:"bearer",constant:"UPDATE_SETTINGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatesettings",request:{additionalProperties:!1,allOf:[{else:{properties:{idEntity:oe.common1}},if:{properties:{typeEntity:oe.common12}},then:{properties:{idEntity:oe.common6}}},{if:{properties:{type:{enum:["birthDate","email","locality","phone","directory"]},typeEntity:oe.common12}},then:{properties:{value:{enum:["private","public","mask"],type:"string"}}}},{if:{properties:{type:{enum:["activitypub","isOpenData"]},typeEntity:oe.common12}},then:oe.common13},{if:{properties:{type:oe.common15,typeEntity:oe.common16}},then:oe.common13},{if:{properties:{type:oe.common15,typeEntity:oe.common17}},then:oe.common13},{if:{properties:{type:{enum:["isOpenData","isOpenEdition","public"]},typeEntity:oe.common18}},then:oe.common13}],properties:{idEntity:oe.common2,type:oe.common2,typeEntity:oe.common19,value:oe.common20},required:["type","value","typeEntity","idEntity"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_DESCRIPTION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{additionalProperties:!1,allOf:[oe.common21,{anyOf:[{properties:{description:oe.common27},required:["description"]},{properties:{shortDescription:oe.common27},required:["shortDescription"]}]}],properties:{block:{const:"descriptions",default:"descriptions",type:"string"},descMentions:oe.common11,description:oe.common2,id:oe.common2,scope:{default:"",type:["string","null"]},shortDescription:oe.common2,typeElement:oe.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_INFO",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{sharedFields:{email:oe.common3,emailNullable:oe.common30,name:oe.common2,tags:oe.common32,url:oe.common35}},allOf:[{if:oe.common24,then:{additionalProperties:!1,anyOf:[oe.common36,{properties:{birthDate:oe.common27},required:["birthDate"]},{properties:{fixe:oe.common27},required:["fixe"]},{properties:{mobile:oe.common27},required:["mobile"]},oe.common38,oe.common40,oe.common42],properties:{birthDate:{anyOf:[oe.common44,oe.common31]},block:oe.common45,email:{$ref:"#/$defs/sharedFields/email"},fixe:oe.common46,id:oe.common6,mobile:oe.common46,name:oe.common47,scope:oe.common11,tags:oe.common48,typeElement:oe.common49,url:oe.common50}}},{if:{properties:{typeElement:oe.common17}},then:{additionalProperties:!1,anyOf:[oe.common36,oe.common38,oe.common40,oe.common42,oe.common51,oe.common53],properties:{avancement:{enum:["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],type:"string"},block:oe.common45,email:oe.common55,id:oe.common2,name:oe.common47,parent:oe.common56,scope:oe.common11,tags:oe.common48,typeElement:{default:"citoyens",enum:["projects"],type:"string"},url:oe.common50}}},{if:{properties:{typeElement:oe.common18}},then:{additionalProperties:!1,anyOf:[oe.common36,oe.common38,oe.common40,oe.common42,oe.common51,oe.common60,{properties:{organizer:oe.common27},required:["organizer"]},oe.common53],properties:{block:oe.common45,email:oe.common55,id:oe.common2,name:oe.common47,organizer:oe.common62,parent:oe.common56,scope:oe.common11,tags:oe.common48,type:oe.common65,typeElement:{default:"citoyens",enum:["events"],type:"string"},url:oe.common50}}},{if:{properties:{typeElement:oe.common16}},then:{additionalProperties:!1,anyOf:[oe.common36,oe.common38,oe.common40,oe.common42,oe.common60],properties:{block:oe.common45,email:oe.common55,id:oe.common2,name:oe.common47,scope:oe.common11,tags:oe.common48,type:oe.common66,typeElement:{enum:["organizations"],type:"string"},url:oe.common50}}},{if:{properties:{typeElement:{const:"poi"}}},then:{additionalProperties:!1,anyOf:[oe.common36,oe.common40,oe.common60,{properties:{urls:oe.common27},required:["urls"]}],properties:{block:oe.common45,id:oe.common2,name:oe.common47,scope:oe.common11,tags:oe.common48,type:oe.common67,typeElement:oe.common68,urls:oe.common32}}}],properties:{block:oe.common45,id:oe.common2,scope:oe.common11,typeElement:oe.common29},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SOCIAL",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{$defs:{socialField:{anyOf:[oe.common34,oe.common5]}},allOf:[oe.common21,{anyOf:[{properties:{gitlab:oe.common27},required:["gitlab"]},{properties:{github:oe.common27},required:["github"]},{properties:{twitter:oe.common27},required:["twitter"]},{properties:{facebook:oe.common27},required:["facebook"]},{properties:{instagram:oe.common27},required:["instagram"]},{properties:{diaspora:oe.common27},required:["diaspora"]},{properties:{mastodon:oe.common27},required:["mastodon"]},{properties:{telegram:oe.common27},required:["telegram"]},{properties:{signal:oe.common27},required:["signal"]}]}],properties:{block:{const:"network",default:"network",type:"string"},diaspora:oe.common69,facebook:oe.common69,github:oe.common69,gitlab:oe.common69,id:oe.common2,instagram:oe.common69,mastodon:oe.common69,scope:oe.common11,signal:oe.common69,telegram:oe.common69,twitter:oe.common69,typeElement:oe.common70},required:["block","typeElement","id"],type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_LOCALITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:oe.common71,if:oe.common24,properties:{address:oe.common74,block:{const:"localities",default:"localities",type:"string"},geo:oe.common79,geoPosition:{oneOf:[oe.common31,oe.common84]},id:oe.common2,scope:oe.common11,typeElement:oe.common29},required:["block","typeElement","id","address"],then:oe.common90,type:"object"}},{auth:"bearer",constant:"UPDATE_BLOCK_SLUG",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updateblock/",request:{else:oe.common71,if:oe.common24,properties:{block:oe.common45,id:oe.common2,scope:oe.common11,slug:oe.common93,typeElement:oe.common29},required:["block","typeElement","id","slug"],then:oe.common90,type:"object"}},{auth:"bearer",constant:"CHECK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/check",request:{additionalProperties:!1,else:oe.common71,if:oe.common94,properties:{block:oe.common45,id:oe.common2,slug:oe.common93,type:oe.common19},required:["block","type","id","slug"],then:oe.common90,type:"object"}},{auth:"bearer",constant:"PROFIL_IMAGE",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/profil_avatar/contentKey/profil/docType/image",pathParams:oe.common96,request:{additionalProperties:!1,properties:{profil_avatar:oe.common20},required:["profil_avatar"],type:"object"}},{auth:"bearer",constant:"PROFIL_BANNER",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/banner/docType/image/contentKey/banner",pathParams:oe.common96,request:{additionalProperties:!1,properties:{banner:oe.common20,cropH:oe.common87,cropW:oe.common87,cropX:oe.common87,cropY:oe.common87,formOrigin:{const:"banner",default:"banner"},parentId:oe.common1,parentType:oe.common102},required:["banner","parentId","parentType","formOrigin","cropW","cropH","cropX","cropY"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_ABOUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/about/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,else:oe.common71,if:oe.common94,properties:{id:oe.common2,type:{default:"citoyens",enum:["citoyens","projects","organizations","events","poi","badges","answers","classifieds","forms","actions"],type:"string"}},required:["type","id"],then:oe.common90,type:"object"},request:{additionalProperties:!1,properties:{tpl:{const:"ficheInfoElement",default:"ficheInfoElement",type:"string"}},required:["tpl"],type:"object"}},{auth:"bearer",constant:"MULTICONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:oe.common105,if:oe.common107,properties:{listInvite:{additionalProperties:!1,patternProperties:{"^(citoyens|projects|organizations)$":{additionalProperties:!1,patternProperties:{"^[0-9a-fA-F]{24}$":{additionalProperties:!1,properties:{name:oe.common2},required:["name"],type:"object"}},type:"object"}},type:"object"},parentId:oe.common2,parentType:oe.common70},required:["parentId","parentType","listInvite"],then:oe.common109,type:"object"}},{auth:"none",constant:"GET_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/get/type/{type}/id/{id}/isLive/{isLive}/json/true",pathParams:{additionalProperties:!1,else:oe.common71,if:oe.common94,properties:{id:oe.common2,isLive:oe.common111,type:oe.common70},required:["isLive","type","id"],then:oe.common90,type:"object"},request:{additionalProperties:!1,properties:{dateLimit:oe.common112,indexStep:{default:12,type:"integer"},search:{additionalProperties:!1,properties:{name:oe.common11},required:["name"],type:"object"}},required:["dateLimit","indexStep"],type:"object"}},{auth:"none",constant:"GET_NEWS_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/getbyids",request:{additionalProperties:!1,properties:{ids:oe.common113},required:["ids"],type:"object"}},{auth:"bearer",constant:"ADD_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/save",request:{additionalProperties:!1,anyOf:[oe.common114,oe.common115,oe.common116],else:oe.common105,if:oe.common107,properties:{json:oe.common88,markdownActive:oe.common111,mediaFile:oe.common117,mediaImg:oe.common119,mentions:oe.common121,parentId:oe.common2,parentType:oe.common70,scope:oe.common125,tags:oe.common32,text:oe.common2,type:oe.common126},required:["scope","markdownActive","parentId","parentType","type","json"],then:oe.common109,type:"object"}},{auth:"bearer",constant:"ADD_IMAGE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsImage/docType/image/contentKey/slider",pathParams:oe.common127,request:{additionalProperties:!1,properties:{newsImage:oe.common20},required:["newsImage"],type:"object"}},{auth:"bearer",constant:"ADD_FILE_NEWS",contentType:"multipart/form-data",method:"POST",path:"/co2/document/uploadSave/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/newsFile/docType/file",pathParams:oe.common127,request:{additionalProperties:!1,properties:{newsFile:oe.common20},required:["newsFile"],type:"object"}},{auth:"bearer",constant:"DELETE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/delete/id/{id}",pathParams:oe.common129,request:{additionalProperties:!1,properties:{isLive:oe.common130},required:["isLive"],type:"object"}},{auth:"bearer",constant:"UPDATE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/update",request:{additionalProperties:!1,anyOf:[oe.common114,oe.common115,oe.common116],else:oe.common105,if:oe.common107,properties:{idNews:oe.common1,markdownActive:oe.common111,mediaFile:oe.common117,mediaImg:oe.common119,mentions:oe.common121,parentId:oe.common2,parentType:oe.common70,scope:oe.common125,tags:oe.common32,text:oe.common2,type:oe.common126},required:["idNews","scope","markdownActive","parentId","parentType","type"],then:oe.common109,type:"object"}},{auth:"bearer",constant:"SHARE_NEWS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:oe.common131,if:oe.common133,properties:{childId:oe.common1,childType:oe.common70,comment:oe.common2,connectType:oe.common135,parentId:oe.common1,parentType:oe.common126},required:["parentId","parentType","childId","childType","connectType"],then:oe.common136,type:"object"}},{auth:"none",constant:"GET_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/index/type/{type}/id/{id}/json/true",pathParams:{additionalProperties:!1,properties:{id:oe.common1,type:oe.common138},required:["type","id"],type:"object"}},{auth:"bearer",constant:"ADD_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/save",request:{additionalProperties:!1,properties:{argval:oe.common11,contextId:oe.common1,contextType:oe.common138,mentions:oe.common139,parentCommentId:{default:"",pattern:"^([a-f0-9]{24}|)$",type:"string"},path:oe.common11,text:oe.common2},required:["text","contextId","contextType"],type:"object"}},{auth:"bearer",constant:"DELETE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/delete/id/{id}",pathParams:oe.common129},{auth:"bearer",constant:"UPDATE_COMMENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/comment/update",request:{additionalProperties:!1,properties:{id:oe.common1,params:{properties:{mentions:oe.common139,text:oe.common2},required:["text"],type:"object"}},required:["id","params"],type:"object"}},{auth:"none",constant:"SEARCH_TAGS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/tags/search?q={q}",pathParams:{additionalProperties:!1,properties:{q:oe.common2},required:["q"],type:"object"}},{auth:"none",constant:"SHOW_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/list/type/{type}/id/{id}/actionType/vote/json/true",pathParams:{additionalProperties:!1,properties:{id:oe.common1,type:{default:"news",enum:["news","comments"],type:"string"}},required:["type","id"],type:"object"}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:{default:["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative","projects","citoyens","poi"],items:oe.common142,type:"array"},fediverse:oe.common143,filters:oe.common144,indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common147,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchTags:oe.common33,searchType:{items:oe.common142,type:"array"}},required:["name","searchType","countType","indexMin","indexStep","initType","count","notSourceKey","filters","fediverse"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{minimum:5,type:"integer"},indexMin:oe.common158,locality:oe.common144,name:oe.common2,searchBy:{const:"ALL",default:"ALL",type:"string"},searchType:{const:["cities"],default:["cities"],items:{enum:["cities"],type:"string"},type:"array"}},required:["name","locality","searchType"],type:"object"}},{auth:"none",constant:"CITY_AUTOCOMPLETE_BY_COUNTRY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/city/autocompletemultiscope",request:{additionalProperties:!1,properties:{countryCode:{default:"FR",type:"string"},formInMap:oe.common130,scopeValue:oe.common2,type:{enum:["locality"],type:"string"}},required:["type","countryCode","scopeValue","formInMap"],type:"object"}},{auth:"none",constant:"SUGGESTION_INPUT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{indexMax:{default:20,minimum:20,type:"integer"},indexMin:oe.common159,name:oe.common2,searchType:{items:{enum:["organizations","projects","poi"],type:"string"},type:"array"}},required:["name","searchType","indexMin","indexMax"],type:"object"}},{auth:"none",constant:"GET_PROJECTS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common160,fediverse:oe.common143,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@userId":oe.common162,"parent.@userId":oe.common162},"links.contributors.@userId":oe.common162},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163,"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163},type:"object"}},required:["$or"],type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common160},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_PROJECTS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:oe.common166,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common160,fediverse:oe.common143,filters:{additionalProperties:!1,default:{$or:{"links.contributors.@{pathParams.id}":oe.common162,"parent.@{pathParams.id}":oe.common162},"links.contributors.@{pathParams.id}":oe.common162},patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.contributors\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163},type:"object"}},required:["$or"],type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common160},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_POIS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common168,fediverse:oe.common143,filters:{additionalProperties:!1,default:{"parent.@userId":oe.common162},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common168},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_POIS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:oe.common166,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common168,fediverse:oe.common143,filters:{additionalProperties:!1,default:{"parent.@{pathParams.id}":oe.common162},patternProperties:{"^parent\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common168},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_ORGANIZATIONS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common169,fediverse:oe.common143,filters:{additionalProperties:!1,default:{"links.members.@userId":oe.common162,"links.members.@userId.isInviting":oe.common171,"links.members.@userId.toBeValidated":oe.common171},patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":oe.common172,"^links\\.members\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":oe.common172},type:"object"},indexMax:oe.common87,indexMin:oe.common159,indexStep:oe.common175,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common169},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ORGANIZATIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:oe.common176,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common169,fediverse:oe.common143,filters:{additionalProperties:!0,default:oe.common179,patternProperties:{"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":oe.common172,"^links\\.members\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":oe.common172},type:"object"},indexMax:oe.common87,indexMin:oe.common159,indexStep:oe.common175,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common169},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_USER_ELIGIBLE_PLACES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:oe.common176,request:{additionalProperties:!1,properties:{count:oe.common111,countType:oe.common180,fediverse:oe.common130,filters:{additionalProperties:!0,default:oe.common179,type:"object"},indexMax:oe.common87,indexMin:oe.common159,indexStep:oe.common175,initType:oe.common11,locality:oe.common11,name:oe.common2,notSourceKey:oe.common111,ranges:oe.common152,searchBy:{enum:["ALL"],type:"string"},searchType:oe.common180},required:["searchType","indexMin","indexStep","notSourceKey","filters"],type:"object"}},{auth:"none",constant:"GET_MEMBERS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common181,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":oe.common163,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":oe.common163,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":oe.common183,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":oe.common185,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":oe.common172},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_MEMBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/organizations/id/{id}/canSee/true",pathParams:oe.common129,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common181,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.memberOf.@{pathParams.id}":oe.common162,"links.memberOf.@{pathParams.id}.isInviting":oe.common171,"links.memberOf.@{pathParams.id}.toBeValidated":oe.common171},patternProperties:{"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":oe.common163,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":oe.common163,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":oe.common183,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":oe.common185,"^links\\.memberOf\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":oe.common183},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_FRIENDS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:oe.common7,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common188,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.friends.@{pathParams.id}":oe.common162,"links.friends.@{pathParams.id}.isInviting":oe.common171,"links.friends.@{pathParams.id}.toBeValidated":oe.common171},patternProperties:{"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":oe.common183,"^links\\.friends\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":oe.common183},type:"object"},indexMax:oe.common87,indexMin:oe.common159,indexStep:oe.common175,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchType:oe.common188},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIPTIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common190,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[oe.common192],default:{"links.followers.@userId":oe.common162,"links.followers.@{userId}.isInviting":oe.common171,"links.followers.@{userId}.toBeValidated":oe.common171},patternProperties:oe.common195,type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common190},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIPTIONS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/citoyens/id/{id}/canSee/true",pathParams:oe.common7,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common190,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[oe.common192],default:{"links.followers.@{pathParams.id}":oe.common162,"links.followers.@{pathParams.id}.isInviting":oe.common171,"links.followers.@{pathParams.id}.toBeValidated":oe.common171},patternProperties:oe.common195,type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common190},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_SUBSCRIBERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common188,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[oe.common196],default:{"links.follows.@userId":oe.common162,"links.follows.@{userId}.isInviting":oe.common171,"links.follows.@{userId}.toBeValidated":oe.common171},patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":oe.common172,"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":oe.common172},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common188},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_SUBSCRIBERS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/{type}/id/{id}/canSee/true",pathParams:{additionalProperties:!1,allOf:[{else:oe.common71,if:oe.common94,then:oe.common90}],properties:{id:oe.common2,type:oe.common199},required:["type","id"],type:"object"},request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common188,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[oe.common196],default:{"links.follows.@{pathParams.id}":oe.common162},maxProperties:1,minProperties:1,patternProperties:{"^links\\.follows\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163},type:"object"},indexMin:oe.common159,indexStep:oe.common175,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,searchType:oe.common188},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_CONTRIBUTORS_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common181,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":oe.common163,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":oe.common163,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":oe.common183,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":oe.common185,"^links\\.projects\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":oe.common172},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_CONTRIBUTORS_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/projects/id/{id}/canSee/true",pathParams:oe.common129,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common181,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.projects.@{pathParams.id}":oe.common162,"links.projects.@{pathParams.id}.isInviting":oe.common171,"links.projects.@{pathParams.id}.toBeValidated":oe.common171},patternProperties:{"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":oe.common163,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":oe.common163,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":oe.common183,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":oe.common185,"^links\\.projects\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":oe.common183},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common187},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common200,fediverse:oe.common143,filters:{properties:{$or:{additionalProperties:!1,minProperties:1,patternProperties:{"^issuer\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163},type:"object"},isParcours:oe.common4,"preferences.private":oe.common143},required:["preferences.private"],type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common200},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"GET_BADGES_FILTERS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common202,fediverse:oe.common143,fields:oe.common200,filters:{oneOf:[{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common204}},{additionalProperties:!1,maxProperties:3,minProperties:3,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common204,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":oe.common207,"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteRecepteur$":oe.common207}},{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:oe.common210},{additionalProperties:!1,maxProperties:1,minProperties:1,properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:oe.common210,type:"object"}},required:["$or"]},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.revoke$":oe.common206}},{additionalProperties:!1,maxProperties:1,minProperties:1,patternProperties:{"badges\\.(?:[a-f0-9]{24}|@\\w+)\\.attenteEmetteur$":oe.common204}}],type:"object"},indexMin:oe.common159,indexStep:oe.common175,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:{additionalProperties:!1,default:{Cooperative:oe.common211,GovernmentOrganization:oe.common211,Group:oe.common211,LocalBusiness:oe.common211,NGO:oe.common211,citoyens:oe.common211,projects:oe.common211},maxProperties:7,minProperties:7,patternProperties:{"^[a-zA-Z][a-zA-Z0-9]*$":oe.common154},type:"object"},searchType:oe.common202},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"CONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/connect",request:{additionalProperties:!1,allOf:[{if:oe.common107,then:{properties:{connectType:{const:"friend",default:"friend"}}}},{if:oe.common212,then:{properties:{connectType:{enum:["admin","member"]}}}},{if:oe.common214,then:{properties:{connectType:{enum:["admin","contributor"]}}}},{if:oe.common216,then:{properties:{connectType:{default:"attendee",enum:["attendee","connect"]}}}}],properties:{childId:oe.common218,childType:oe.common219,connectType:{enum:["admin","member","contributor","attendee","friend","connect"],type:"string"},parentId:oe.common1,parentType:oe.common220},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"bearer",constant:"DISCONNECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/disconnect",request:{additionalProperties:!1,allOf:[{if:oe.common107,then:{properties:{connectType:{default:"friends",enum:["friends","followers"]}}}},{if:oe.common212,then:{properties:{connectType:{default:"members",enum:["members","followers"]}}}},{if:oe.common214,then:{properties:{connectType:{default:"contributors",enum:["contributors","followers"]}}}},{if:oe.common216,then:{properties:{connectType:{default:"attendees",enum:["attendees","followers"]}}}}],properties:{childId:oe.common218,childType:oe.common219,connectType:{enum:["members","contributors","attendees","friends","followers"],type:"string"},parentId:oe.common1,parentType:oe.common220},required:["childId","childType","parentType","parentId","connectType"],type:"object"}},{auth:"none",constant:"GET_ELEMENTS_KEY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/slug/getinfo/key/{slug}",pathParams:{additionalProperties:!1,properties:{slug:{pattern:"^([a-zA-Z0-9-_]+)$",type:"string"}},required:["slug"],type:"object"}},{auth:"bearer",constant:"GET_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/config/type/citoyens/id/{id}/json/true",pathParams:oe.common7},{auth:"bearer",constant:"DELETE_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue?index={index}",pathParams:{properties:{index:oe.common87},type:"object"},request:{additionalProperties:!1,properties:{collection:oe.common221,id:oe.common222,path:{const:"preferences.search.@{pathParams.index}",default:"preferences.search.@{pathParams.index}",type:"string"},pull:{const:"preferences.search",type:"string"},value:oe.common144},required:["id","collection","path","pull","value"],type:"object"}},{auth:"bearer",constant:"ADD_FAVORIS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,properties:{arrayForm:oe.common206,collection:oe.common221,id:oe.common222,path:{const:"preferences.search",default:"preferences.search",type:"string"}},required:["id","collection","path","arrayForm","value"],type:"object"}},{auth:"bearer",constant:"ADD_ORGANIZATION",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!0,properties:{address:oe.common74,collection:{const:"organizations",default:"organizations",type:"string"},description:oe.common2,email:oe.common3,filiere:{additionalProperties:{additionalProperties:!1,properties:{icon:oe.common2,name:oe.common2,tags:oe.common33},required:["name","icon","tags"],type:"object"},type:"object"},geo:oe.common79,geoPosition:oe.common223,id:oe.common1,key:{const:"organization",default:"organization",type:"string"},mainTag:oe.common2,name:oe.common225,openingHours:{items:{oneOf:[oe.common31,{additionalProperties:!1,properties:{dayOfWeek:oe.common226,hours:{items:oe.common227,type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},preferences:oe.common230,role:{enum:["admin","member"],type:"string"},scope:oe.common144,shortDescription:oe.common2,socialNetwork:{additionalProperties:oe.common2,type:"object"},tags:oe.common233,telephone:oe.common2,thematic:oe.common33,type:oe.common66,url:oe.common35,video:oe.common33},required:["id","collection","key","name","type","role","scope"],type:"object"}},{auth:"bearer",constant:"ADD_PROJECT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:oe.common74,collection:oe.common234,geo:oe.common79,geoPosition:oe.common223,id:oe.common1,key:{const:"project",default:"project",type:"string"},name:oe.common2,parent:oe.common235,preferences:{default:{crowdfunding:!0,isOpenData:!1,isOpenEdition:!1},properties:{crowdfunding:oe.common111,isOpenData:oe.common130,isOpenEdition:oe.common130},required:["isOpenData","isOpenEdition"],type:"object"},public:oe.common111,scope:oe.common144,shortDescription:oe.common2,tags:oe.common233,url:oe.common35},required:["id","collection","key","parent","name","public","scope"],type:"object"}},{auth:"bearer",constant:"ADD_POI",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{address:oe.common74,collection:oe.common238,description:oe.common2,geo:oe.common79,geoPosition:oe.common223,id:oe.common1,key:oe.common238,name:oe.common2,parent:oe.common235,scope:oe.common144,source:{additionalProperties:!0,properties:{insertOrign:oe.common2,key:oe.common2,keys:oe.common33},type:"object"},tags:oe.common233,type:oe.common67,urls:oe.common33},required:["id","collection","key","parent","type","name"],type:"object"}},{auth:"bearer",constant:"ADD_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,else:{required:["openingHours"]},if:{properties:{recurrency:oe.common174}},properties:{address:oe.common74,collection:oe.common239,email:oe.common30,endDate:oe.common240,geo:oe.common79,geoPosition:oe.common223,id:oe.common1,key:{const:"event",default:"event",type:"string"},name:{minLength:2,type:"string"},openingHours:{default:["","","","","","",""],items:{anyOf:[oe.common31,{additionalProperties:!1,properties:{dayOfWeek:oe.common226,hours:{default:[],items:oe.common227,type:"array"}},required:["dayOfWeek","hours"],type:"object"}]},maxItems:7,minItems:7,type:"array"},organizer:oe.common235,parent:{oneOf:[oe.common62,oe.common31]},preferences:{default:{isOpenData:!1,isOpenEdition:!1},properties:{isOpenData:oe.common130,isOpenEdition:oe.common130},required:["isOpenData","isOpenEdition"],type:"object"},public:oe.common111,recurrency:oe.common130,scope:oe.common144,shortDescription:{format:"textarea",type:"string"},startDate:oe.common240,tags:{anyOf:[oe.common33,oe.common31]},timeZone:oe.common2,type:oe.common65,url:oe.common35},required:["id","collection","key","organizer","type","name","scope"],startBeforeEnd:!0,then:{required:["startDate","endDate"]},type:"object"}},{auth:"bearer",constant:"DELETE_ELEMENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/delete/type/{type}/id/{id}",pathParams:{additionalProperties:!1,properties:{id:oe.common1,type:oe.common2},required:["type","id"],type:"object"},request:oe.common9},{auth:"bearer",constant:"ADD_IMAGE_ELEMENT",contentType:"multipart/form-data",method:"POST",path:"/co2/document/upload-save/dir/communecter/folder/{folder}/ownerId/{ownerId}/input/qqfile/docType/image/contentKey/profil",pathParams:{additionalProperties:!1,properties:{folder:{enum:["badges","events"],type:"string"},ownerId:oe.common1},required:["folder","ownerId"],type:"object"},request:{additionalProperties:!1,properties:{qqfile:oe.common20,qqfilename:oe.common2,qqtotalfilesize:oe.common241,qquuid:oe.common1},required:["qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"LINK_VALIDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/validate",request:{additionalProperties:!1,properties:{childId:oe.common6,childType:oe.common49,linkOption:{enum:["isInviting","toBeValidated","isAdminPending"],type:"string"},parentId:oe.common1,parentType:oe.common220},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"SEARCH_MEMBER_AUTOCOMPLETE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/searchmemberautocomplete",request:{additionalProperties:!1,properties:{search:oe.common2,searchMode:{default:"personOnly",enum:["personOnly","organizationOnly","mixte"],type:"string"}},required:["search","searchMode"],type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:oe.common242,request:{additionalProperties:!1,properties:{indexMin:oe.common112},type:"object"}},{auth:"bearer",constant:"GET_NOTIFICATIONS_COUNT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/getnotifications/type/{type}/id/{id}",pathParams:oe.common242,request:{additionalProperties:!1,properties:{refreshTimestamp:oe.common241},type:"object"}},{auth:"bearer",constant:"NOTIFICATION_UPDATE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/update",request:{additionalProperties:!1,properties:{action:{enum:["seen","read"],type:"string"},all:oe.common88},required:["action","all"],type:"object"}},{auth:"bearer",constant:"REMOVE_ALL_NOTIFICATIONS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/removeall"},{auth:"bearer",constant:"MARK_NOTIFICATION_AS_READ",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/notification/marknotificationasread",request:oe.common129},{auth:"none",constant:"ACTIVITYPUB_SEARCH",contentType:"application/x-www-form-urlencoded",method:"GET",params:[oe.common20],path:"/api/activitypub/search?address={address}",pathParams:{additionalProperties:!1,properties:{address:oe.common2},required:["address"],type:"object"}},{auth:"bearer",constant:"ACTIVITYPUB_LINK",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/link",request:{additionalProperties:!1,properties:{action:{enum:["undo_follow","accept_invitation","reject_invitation","undo_accept","undo_request_follow","follow","remove_follow","accept_follower","reject_follower","remove_follower","remove_invitation"],type:"string"},actor:{additionalProperties:!1,properties:{id:oe.common2,name:oe.common2,type:{enum:["person"],type:"string"}},required:["id","type","name"],type:"object"},payload:oe.common5},required:["action","payload","actor"],type:"object"}},{auth:"none",constant:"ACTIVITYPUB_GET_COMMUNITY",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/api/activitypub/getcommunity/userId/${userId}/type/${type}/actor/person",pathParams:{additionalProperties:!1,properties:{type:{enum:["follows","followers"],type:"string"},userId:oe.common1},required:["userId","type"],type:"object"}},{auth:"none",constant:"GET_BADGE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/page/type/badges/id/{id}/json/true",pathParams:oe.common129},{auth:"none",constant:"GET_EMETTEUR_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/app/badge/json/true"},{auth:"bearer",constant:"ADD_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!1,properties:{collection:oe.common245,costumId:oe.common2,costumSlug:oe.common2,costumType:oe.common2,criteria:{additionalProperties:!1,properties:{narrative:oe.common2},required:["narrative"],type:"object"},description:oe.common2,id:oe.common1,isParcours:oe.common130,issuer:{additionalProperties:!1,patternProperties:{"^(?:[a-f0-9]{24}|@userId)$":{additionalProperties:!1,properties:{name:oe.common2,type:{enum:["citoyens","organizations","projects"],type:"string"}},required:["type"],type:"object"}},type:"object"},key:oe.common246,name:oe.common2,parent:{additionalProperties:!1,patternProperties:{"^[a-f0-9]{24}$":{additionalProperties:!1,properties:{name:oe.common2,type:oe.common245},required:["type"],type:"object"}},type:"object"},preferences:oe.common230,public:oe.common111,scope:oe.common144,tags:oe.common33},required:["id","collection","key","name","public","scope","issuer","criteria"],type:"object"}},{auth:"bearer",constant:"ASSIGN_BADGES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/badges/assign",request:{additionalProperties:!1,properties:{award:{patternProperties:{"^[0-9a-f]{24}$":oe.common58},type:"object"},badgeId:oe.common1,collection:oe.common245,evidences:{items:{additionalProperties:!1,properties:{narative:oe.common2,url:oe.common5},required:["narative"],type:"object"},type:"array"},key:oe.common246,narative:oe.common2,scope:oe.common144},required:["key","collection","badgeId","award"],type:"object"}},{auth:"none",constant:"GET_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/agenda",request:{additionalProperties:!0,properties:{count:oe.common130,countType:{const:["events"],default:["events"],type:"array"},endDateUTC:oe.common240,fediverse:oe.common130,filters:{additionalProperties:!1,default:{$or:{"links.attendees.@userId":oe.common162,"organizer.@userId":oe.common162},"links.attendees.@userId":oe.common162},patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163},properties:{$or:{additionalProperties:!1,maxProperties:2,minProperties:2,patternProperties:{"^links\\.attendees\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163,"^organizer\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163},type:"object"}},required:["$or"],type:"object"},indexMin:oe.common112,indexStep:{default:100,type:"integer"},locality:{patternProperties:{"^[^\\s]+$":{type:"object"}},type:"object"},name:oe.common2,recurrency:oe.common111,searchType:{const:["events"],default:["events"],items:{enum:["events"],type:"string"},type:"array"},startDateUTC:oe.common240,type:oe.common65},required:["searchType","indexMin","indexStep","fediverse"],type:"object"}},{auth:"bearer",constant:"SHARE_EVENTS",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/news/co/share",request:{additionalProperties:!1,else:oe.common131,if:oe.common133,properties:{childId:oe.common1,childType:oe.common70,comment:oe.common2,connectType:oe.common135,parentId:oe.common1,parentType:oe.common239},required:["parentId","childId","childType","connectType","parentType"],then:oe.common136,type:"object"}},{auth:"bearer",constant:"INVITE_EVENT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/multiconnect",request:{additionalProperties:!1,else:oe.common105,if:oe.common107,properties:{listInvite:{additionalProperties:!1,minProperties:1,properties:{citoyens:oe.common247,invites:{patternProperties:{"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$":{additionalProperties:!1,properties:{email:oe.common3,isAdmin:oe.common251,msg:oe.common2,name:oe.common2,roles:oe.common33},required:["name","email"],type:"object"}},type:"object"},organizations:oe.common247,projects:oe.common247},type:"object"},parentId:oe.common2,parentType:oe.common70},required:["parentId","parentType","listInvite"],then:oe.common109,type:"object"}},{auth:"bearer",constant:"FOLLOW",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/follow",request:{additionalProperties:!1,properties:{childId:oe.common218,childType:oe.common219,parentId:oe.common1,parentType:oe.common220},required:["childId","childType","parentType","parentId"],type:"object"}},{auth:"none",constant:"GET_COSTUM_JSON",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/cms/getcostumjson?slug={slug}",pathParams:{slug:oe.common2}},{auth:"none",constant:"GLOBAL_AUTOCOMPLETE_COSTUM",contentType:"application/x-www-form-urlencoded",functionCocostum:"globalautocomplete",method:"POST",path:"/co2/search/globalautocomplete",request:oe.common252},{auth:"none",constant:"NAVIGATOR_GETTL",contentType:"application/x-www-form-urlencoded",functionCocostum:"gettl",method:"POST",path:"/costum/navigator/gettl",request:oe.common252},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ACTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestActors",method:"POST",path:"/costum/coevent/get_events/request/actors/id/{id}/type/{type}",pathParams:oe.common272,request:{additionalProperties:!1,properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,mode:oe.common2,parent_only:oe.common4,sourceKey:oe.common33,types:{items:{enum:["organizer","links.attendees","creator","links.creator","links.organizer","organizerName","animator"],type:"string"},type:"array"}},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_SUBEVENTS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestSubevents",method:"POST",path:"/costum/coevent/get_events/request/subevents/id/{id}/type/{type}",pathParams:oe.common272,request:{additionalProperties:!1,allOf:[{if:{properties:{date:oe.common2},required:["date"]},then:{required:["timezone"]}}],properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,date:{oneOf:[oe.common2,{properties:{between:{properties:{end:oe.common44,start:oe.common44},required:["start","end"],type:"object"}},required:["between"],type:"object"}]},fromToday:oe.common4,mode:oe.common2,regions:oe.common275,sourceKey:oe.common33,tags:oe.common33,timezone:oe.common2,type:oe.common2},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_ELEMENT_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestElementEvent",method:"POST",path:"/costum/coevent/get_events/request/element_event/id/{id}/type/{type}",pathParams:oe.common272,request:oe.common278},{auth:"none",constant:"COSTUM_EVENT_REQUEST_CATEGORIES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestCategories",method:"POST",path:"/costum/coevent/get_events/request/categories/id/{id}/type/{type}",pathParams:oe.common272,request:oe.common278},{auth:"none",constant:"COSTUM_EVENT_REQUEST_DATES",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestDates",method:"POST",path:"/costum/coevent/get_events/request/dates/id/{id}/type/{type}",pathParams:oe.common272,request:{additionalProperties:!1,properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,mode:oe.common2,regions:oe.common275,sourceKey:oe.common33,tags:oe.common33,type:oe.common2},type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestEvent",method:"POST",path:"/costum/coevent/get_events/request/event/id/{id}/type/{type}",pathParams:oe.common272,request:oe.common278},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LINK_TL_TO_EVENT",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLinkTlToEvent",method:"POST",path:"/costum/coevent/get_events/request/link_tl_to_event/id/{id}/type/{type}",pathParams:oe.common272,request:{additionalProperties:!1,properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,event:oe.common2,mode:oe.common2,sourceKey:oe.common33,tl:oe.common2},required:["tl","event"],type:"object"}},{auth:"none",constant:"COSTUM_EVENT_REQUEST_LOAD_CONTEXT_TAG",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumEventRequestLoadContextTag",method:"POST",path:"/costum/coevent/get_events/request/load_context_tag/id/{id}/type/{type}",pathParams:oe.common272,request:{additionalProperties:!1,properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,event:oe.common1,mode:oe.common2,search:oe.common2,sourceKey:oe.common33},type:"object"}},{auth:"none",constant:"GET_GALLERY",contentType:"application/x-www-form-urlencoded",functionCocostum:"",method:"POST",path:"/co2/gallery/index/type/{type}/id/{id}/docType/{docType}/tpl/json",pathParams:{additionalProperties:!1,else:oe.common71,if:oe.common94,properties:{docType:{default:"image",enum:["image","file","bookmarks"],type:"string"},id:oe.common2,type:oe.common199},required:["id","type","docType"],then:oe.common90,type:"object"},request:{additionalProperties:!1,properties:{contentKey:oe.common2,folderId:oe.common2},type:"object"}},{auth:"none",constant:"GET_ATTENDEES_NO_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocomplete",request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common188,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$)"}}},{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$)"}}}],patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)$":oe.common163,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdmin$":oe.common163,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isAdminPending$":oe.common163,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.isInviting$":oe.common183,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.roles$":oe.common185,"^links\\.events\\.(?:[a-f0-9]{24}|@\\w+)\\.toBeValidated$":oe.common172},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common188},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"bearer",constant:"GET_ATTENDEES_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/globalautocompleteadmin/type/events/id/{id}/canSee/true",pathParams:oe.common129,request:{additionalProperties:!1,properties:{count:oe.common88,countType:oe.common188,fediverse:oe.common143,filters:{additionalProperties:!1,allOf:[{not:{propertyNames:{pattern:"^(?!links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$)"}}}],default:{"links.events.@{pathParams.id}":oe.common162,"links.events.@{pathParams.id}.isInviting":oe.common171,"links.events.@{pathParams.id}.toBeValidated":oe.common171},patternProperties:{"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))$":oe.common163,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdmin$":oe.common163,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isAdminPending$":oe.common163,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.isInviting$":oe.common183,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.roles$":oe.common185,"^links\\.events\\.(?:[a-f0-9]{24}|@(?:\\{[^}]+\\}|[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)?))\\.toBeValidated$":oe.common183},type:"object"},indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common144,name:oe.common2,notSourceKey:oe.common88,ranges:oe.common152,searchBy:oe.common156,searchType:oe.common188},required:["searchType","indexMin","initType","count","countType","indexStep","notSourceKey","filters","locality","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_SEARCH",contentType:"application/x-www-form-urlencoded",functionCocostum:"answerlist",method:"POST",path:"/survey/coform/answerslist",request:{additionalProperties:!1,properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,count:oe.common88,countType:oe.common280,fediverse:oe.common130,fields:oe.common33,filters:oe.common257,indexMax:oe.common87,indexMin:oe.common145,indexStep:oe.common146,initType:oe.common144,locality:oe.common147,mapUsed:oe.common206,mode:oe.common2,name:oe.common2,notSourceKey:oe.common206,options:oe.common266,ranges:oe.common152,searchBy:oe.common156,searchTags:oe.common33,searchType:oe.common280,sortBy:oe.common270,sourceKey:oe.common33},required:["searchType","countType","indexMin","indexStep","initType","count","fediverse"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_BY_ID",contentType:"application/x-www-form-urlencoded",functionCocostum:"findanswered",method:"POST",path:"/survey/coform/findanswered",request:{additionalProperties:!1,properties:{answerId:oe.common2,fields:oe.common33,finderPath:oe.common11,formId:oe.common2},required:["answerId"],type:"object"}},{auth:"none",constant:"GET_COFORM_BY_ID",contentType:"application/x-www-form-urlencoded",functionCocostum:"getformbyid",method:"POST",path:"/survey/coform/getformbyid",request:{additionalProperties:!1,properties:{elementId:oe.common1,elementType:{enum:["organizations","projects","events","poi","citoyens"],type:"string"},parentFormId:oe.common1},required:["parentFormId"],type:"object"}},{auth:"bearer",constant:"COFORM_UPLOAD_ANSWER_FILE",contentType:"multipart/form-data",method:"POST",path:"/survey/coform/uploadanswerfile",request:{additionalProperties:!1,properties:{answerId:oe.common1,contentKey:{default:"slider",type:"string"},docType:{default:"image",enum:["image","file"],type:"string"},formId:oe.common1,qqfile:oe.common258,qqfilename:oe.common2,qqtotalfilesize:oe.common87,qquuid:oe.common2,subKey:oe.common2},required:["formId","qquuid","qqfilename","qqtotalfilesize","qqfile"],type:"object"}},{auth:"bearer",constant:"COFORM_GET_ANSWER_FILES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/survey/coform/getanswerfiles",request:{additionalProperties:!1,properties:{answerId:oe.common1,contentKey:{default:"presentation",type:"string"},docType:{default:"file",enum:["image","file"],type:"string"},subKey:oe.common2},required:["answerId","subKey"],type:"object"}},{auth:"none",constant:"GET_COFORM_CATALOGS",contentType:"application/x-www-form-urlencoded",functionCocostum:"getformcatalogs",method:"POST",path:"/survey/coform/getformcatalogs",request:{additionalProperties:!1,properties:{formId:oe.common1,inputKeys:oe.common2},required:["formId","inputKeys"],type:"object"}},{auth:"bearer",constant:"SAVE_COFORM_ANSWER",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/survey/coform/saveanswer",request:{additionalProperties:!1,properties:{addedOptions:oe.common2,answerId:oe.common1,answers:oe.common2,formId:oe.common1,links:oe.common2},required:["formId","answers"],type:"object"}},{auth:"bearer",constant:"GET_COFORM_ANSWER_HISTORY",contentType:"application/x-www-form-urlencoded",functionCocostum:"getCoformAnswerHistory",method:"POST",path:"/survey/coform/getanswerhistory",request:{additionalProperties:!1,properties:{answerId:oe.common1},required:["answerId"],type:"object"}},{auth:"bearer",constant:"GET_COFORM_MULTIEVAL_DATA",contentType:"application/x-www-form-urlencoded",functionCocostum:"getCoformMultiEvalData",method:"POST",path:"/survey/coform/getmultievaldata",request:{additionalProperties:!1,properties:{answerId:oe.common1,stepKey:oe.common2},required:["answerId"],type:"object"}},{auth:"bearer",constant:"GET_COFORM_COMMONTABLE_CONTRIBUTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"getCoformCommonTableContributors",method:"POST",path:"/survey/coform/getcommontablecontributors",request:{additionalProperties:!1,properties:{criteriaIds:oe.common2,formId:oe.common1,inputKey:oe.common2},required:["formId","inputKey","criteriaIds"],type:"object"}},{auth:"bearer",constant:"ADD_VOTE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"vote",default:"vote",type:"string"},collection:oe.common282,details:{additionalProperties:!1,properties:{status:oe.common2},required:["status"],type:"object"},id:oe.common1},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"ADD_REPORT_ABUSE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/action/addaction",request:{additionalProperties:!1,properties:{action:{const:"reportAbuse",default:"reportAbuse",type:"string"},collection:oe.common282,details:{additionalProperties:!1,properties:{comment:oe.common2,reason:oe.common2},required:["reason"],type:"object"},id:oe.common1},required:["id","collection","action","details"],type:"object"}},{auth:"bearer",constant:"UPDATE_PATH_VALUE",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/updatepathvalue",request:{additionalProperties:!1,allOf:[{if:{required:["pull"]},then:{properties:{value:oe.common2}}}],properties:{arrayForm:oe.common4,collection:{default:"citoyens",enum:["citoyens","organizations","projects","events","poi","answers","forms","actions"],type:"string"},edit:oe.common4,formParentId:oe.common1,id:oe.common6,path:oe.common2,pull:oe.common2,setType:{anyOf:[oe.common283,{items:{additionalProperties:!1,properties:{path:oe.common2,type:oe.common2},required:["path","type"],type:"object"},type:"array"}]},updatePartial:oe.common4,value:{type:["string","number","boolean","object","array","null"]}},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DELETE_DOCUMENT_BY_CONTEXT",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/document/delete/dir/co2/contextType/{contextType}/contextId/{contextId}",pathParams:{additionalProperties:!1,properties:{contextId:oe.common6,contextType:oe.common284},required:["contextType","contextId"],type:"object"},request:{additionalProperties:!1,properties:{ids:oe.common1,parentId:oe.common6,parentType:oe.common284,path:{const:"communecter",default:"communecter",type:"string"}},required:["id","collection","path","value"],type:"object"}},{auth:"bearer",constant:"DELETE_DOCUMENT_BY_ID",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/document/deletedocumentbyid/id/{id}",pathParams:oe.common129},{auth:"bearer",constant:"DEMOTE_ADMIN",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/link/updateadminlink/",request:{additionalProperties:!1,properties:{childId:oe.common1,childType:oe.common189,connect:{enum:["members","contributors"],type:"string"},isAdmin:oe.common143,parentId:oe.common1,parentType:{enum:["organizations","projects"],type:"string"}},required:["parentId","parentType","childId","childType","connect","isAdmin"],type:"object"}},{constant:"COSTUM_FILTER_COFORM",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/costum/francetierslieux/autoglobalthematicntwrk",request:{properties:{costumId:oe.common2,costumSlug:oe.common2,costumType:oe.common2,searchedData:oe.common258},type:"object"}},{constant:"COSTUM_FILTER_COFORM_BY_PATH",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/costum/francetierslieux/autoglobalthematicntwrk",request:{additionalProperties:!0,properties:{contextId:oe.common1,contextType:oe.common254,costumEditMode:oe.common130,costumId:oe.common1,costumSlug:oe.common2,costumType:oe.common254,count:oe.common130,fediverse:oe.common130,fields:oe.common33,filters:{oneOf:[oe.common258,oe.common31]},indexMin:oe.common145,indexStep:{default:1e4,type:"number"},initType:oe.common11,locality:{oneOf:[oe.common258,{items:oe.common258,type:"array"},oe.common31]},notSourceKey:oe.common111,params:{additionalProperties:!1,properties:{finderPath:oe.common2,thematicPath:oe.common2},required:["thematicPath"],type:"object"},searchType:{default:["answers"],items:oe.common2,type:"array"},sortBy:oe.common270,sourceKey:oe.common33},required:["params"],type:"object"}},{auth:"none",constant:"GET_COUNTRIES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/opendata/getcountries",request:{additionalProperties:!1,properties:{costumEditMode:{oneOf:[{enum:["true","false"],type:"string"},{enum:[0,1],type:"number"},oe.common4]},costumId:oe.common1,costumSlug:oe.common2,costumType:{enum:["organizations","projects","events","citoyens","poi"],type:"string"}},type:"object"}},{constant:"SEARCH_ZONES",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/search/getzone",request:{properties:{costumId:oe.common2,costumSlug:oe.common2,costumType:oe.common2,countryCode:oe.common285,level:oe.common285,sortBy:oe.common2,upperLevelId:oe.common2},required:["countryCode","level"],type:"object"}},{auth:"none",constant:"COFORM_ANSWERS_BY_FORMS",contentType:"application/x-www-form-urlencoded",functionCocostum:"findanswers",method:"POST",path:"/costum/francetierslieux/getallanswersbyforms",request:{properties:{forms:{patternProperties:{"^[a-fA-F0-9]{24}$":oe.common2},type:"object"}},type:"object"}},{auth:"none",constant:"GENERATE_ANSWER_FROM_FORM",contentType:"application/x-www-form-urlencoded",functionCocostum:"generateanswerfromform",method:"POST",path:"/survey/answer/newanswer/form/{formId}",pathParams:{additionalProperties:!1,properties:{formId:oe.common1},required:["formId"],type:"object"},request:{properties:{action:oe.common2},type:"object"}},{auth:"none",constant:"FUNDING_ENVELOPE",contentType:"application/x-www-form-urlencoded",functionCocostum:"fundingenvelope",method:"POST",path:"/co2/aap/fundingenvelope",request:{additionalProperties:!0,properties:{action:oe.common2,answer:oe.common1,contextId:{pattern:"^(?:[a-f0-9]{24}|@userId)$",type:"string"},contextType:oe.common2,financerId:oe.common1,financerType:oe.common2,formId:oe.common1,params:oe.common258,project:oe.common1},required:["contextId","contextType"],type:"object"}},{auth:"none",constant:"COREMU_OPERATION",contentType:"application/x-www-form-urlencoded",functionCocostum:"coremuoperation",method:"POST",path:"/co2/aap/coremuoperation/",request:{additionalProperties:!0,properties:{action:{const:"generateproposition",type:"string"},answer:{const:"new",type:"string"},form:oe.common1,project:oe.common1},required:["form","answer","action","project"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_NEW",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestNew",method:"POST",path:"/costum/project/action/request/new",request:{additionalProperties:!1,properties:{assign:oe.common1,credits:{default:1,minimum:0,type:"number"},endDate:oe.common240,idParentRoom:oe.common1,importance:{default:"low",type:"string"},is_contributor:oe.common4,max:oe.common158,mentions:oe.common33,milestone:{additionalProperties:!1,properties:{endDate:oe.common240,milestoneId:oe.common1,startDate:oe.common240},required:["milestoneId"],type:"object"},min:oe.common158,name:oe.common2,parentId:oe.common1,parentType:oe.common234,startDate:oe.common240,status:{default:"todo",enum:["todo","done","tracking","discuter","next","totest","disabled","closed"],type:"string"},tags:oe.common33,timeSpent:oe.common158,urls:oe.common32},required:["name","status","parentId","parentType"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_SET_STATUS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestSetStatus",method:"POST",path:"/costum/project/action/request/set_status",request:{additionalProperties:!1,properties:{id:oe.common1,status:{enum:["todo","done","tracking","discuter","next","totest","disabled","closed"],type:"string"},user:oe.common1},required:["id","status"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_SET_DATE",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestSetDate",method:"POST",path:"/costum/project/action/request/set_date",request:{additionalProperties:!1,properties:{endDate:oe.common2,id:oe.common1,startDate:oe.common2},required:["id"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_SET_CONTRIBUTORS",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestSetContributors",method:"POST",path:"/costum/project/action/request/set_contributors",request:{additionalProperties:!1,properties:{action:oe.common1,contributor:oe.common1,contributors:oe.common113,participate:{enum:[0,1],type:"integer"}},required:["action"],type:"object"}},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_CANCEL",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestCancel",method:"POST",path:"/costum/project/action/request/cancel",request:oe.common129},{auth:"bearer",constant:"COSTUM_PROJECT_ACTION_REQUEST_ARCHIVE",contentType:"application/x-www-form-urlencoded",functionCocostum:"costumProjectActionRequestArchive",method:"POST",path:"/costum/project/action/request/archive",request:oe.common129},{auth:"bearer",constant:"LINK_DISCOURSE_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"linkDiscourseAccount",method:"POST",path:"/interop/discourse/linkAccount",request:oe.common286},{auth:"bearer",constant:"UNLINK_DISCOURSE_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"unlinkDiscourseAccount",method:"POST",path:"/interop/discourse/unlinkAccount",request:oe.common288},{auth:"none",constant:"DISCOURSE_PROFILE",contentType:"application/x-www-form-urlencoded",functionCocostum:"getDiscourseProfile",method:"POST",path:"/interop/discourse/profile",request:oe.common286},{auth:"bearer",constant:"DISCOURSE_CHECK_EMAIL",contentType:"application/x-www-form-urlencoded",functionCocostum:"checkDiscourseEmailMatch",method:"POST",path:"/interop/discourse/checkEmailMatch",request:oe.common288},{auth:"bearer",constant:"DISCOURSE_DISMISS_LINK",contentType:"application/x-www-form-urlencoded",functionCocostum:"dismissDiscourseLink",method:"POST",path:"/interop/discourse/dismissDiscourseLink",request:oe.common288},{auth:"bearer",constant:"LINK_MEDIAWIKI_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"linkMediaWikiAccount",method:"POST",path:"/interop/mediawiki/linkAccount",request:oe.common286},{auth:"bearer",constant:"UNLINK_MEDIAWIKI_ACCOUNT",contentType:"application/x-www-form-urlencoded",functionCocostum:"unlinkMediaWikiAccount",method:"POST",path:"/interop/mediawiki/unlinkAccount",request:oe.common288},{auth:"none",constant:"GET_MEDIAWIKI_CONTRIBUTIONS",contentType:"application/x-www-form-urlencoded",functionCocostum:"getMediaWikiContributions",method:"POST",path:"/interop/mediawiki/contribs",request:{additionalProperties:!0,properties:{costumId:oe.common2,costumSlug:oe.common2,costumType:oe.common2,limit:oe.common241,username:oe.common2},required:["username","costumSlug","costumId","costumType"],type:"object"}},{auth:"bearer",constant:"ADD_CLASSIFIED",contentType:"application/x-www-form-urlencoded",method:"POST",path:"/co2/element/save",request:{additionalProperties:!0,properties:{address:{additionalProperties:!1,properties:{"@type":oe.common77,addressCountry:oe.common2,addressLocality:oe.common2,codeInsee:oe.common2,level1:oe.common2,level1Name:oe.common2,level2:oe.common2,level2Name:oe.common2,level3:oe.common78,level3Name:oe.common78,level4:oe.common78,level4Name:oe.common78,localityId:oe.common2,postalCode:oe.common2,streetAddress:oe.common2},required:["@type","addressCountry","codeInsee","addressLocality","localityId","level1","level1Name"],type:"object"},category:{enum:["service","competence","material"],type:"string"},collection:{const:"classifieds",default:"classifieds",type:"string"},costumId:oe.common2,costumSlug:oe.common2,costumType:oe.common2,description:oe.common2,geo:oe.common80,geoPosition:oe.common84,id:oe.common1,key:{const:"classified",default:"classified",type:"string"},name:oe.common225,parent:oe.common235,preferences:oe.common230,scope:oe.common144,section:{enum:["need","offer"],type:"string"},subtype:oe.common283,tags:oe.common33},required:["id","collection","key","name","section","category","subtype","scope"],type:"object"}},{auth:"none",constant:"PERSON_ACTIVATE",contentType:"application/json",generateModule:"UserNoAuth",method:"POST",onlyAuthNone:!0,path:"/co2/person/activate",request:{properties:{user:oe.common2,validationKey:oe.common2},required:["user","validationKey"],type:"object"}}]};function se(e){return e instanceof Error}function pe(e){return se(e)&&"response"in e&&"object"==typeof e.response&&"number"==typeof e.response.status}function ce(e){return se(e)?e.message:"string"==typeof e?e:e&&"object"==typeof e&&"message"in e?String(e.message):"Unknown error"}function le(e){return function(e){return se(e)&&"status"in e&&"number"==typeof e.status}(e)?e.status:pe(e)?e.response.status:e instanceof ApiError?e.status:void 0}class TokenStorageStrategy{}class MemoryStorageStrategy extends TokenStorageStrategy{_accessToken=null;_refreshToken=null;constructor(){super()}getAccessToken(){return this._accessToken}setAccessToken(e){this._accessToken=e}getRefreshToken(){return this._refreshToken}setRefreshToken(e){this._refreshToken=e}clear(){this._accessToken=null,this._refreshToken=null}}class LocalStorageStrategy extends TokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}getAccessToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_accessToken`):null}setAccessToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_accessToken`,e??"")}getRefreshToken(){return"undefined"!=typeof localStorage?localStorage.getItem(`${this.prefix}_refreshToken`):null}setRefreshToken(e){"undefined"!=typeof localStorage&&localStorage.setItem(`${this.prefix}_refreshToken`,e??"")}clear(){"undefined"!=typeof localStorage&&(localStorage.removeItem(`${this.prefix}_accessToken`),localStorage.removeItem(`${this.prefix}_refreshToken`))}}class MultiServerTokenStorageStrategy extends TokenStorageStrategy{_currentBaseURL=null;constructor(){super()}use(e){if(!e)throw new Error("baseURL est requis");this._currentBaseURL=e.replace(/\/+$/,"")}_ensureContext(){if(!this._currentBaseURL)throw new Error("baseURL non défini. Appelez use(baseURL)")}_requireBaseURL(){return this._ensureContext(),this._currentBaseURL}}class MultiServerMemoryStorageStrategy extends MultiServerTokenStorageStrategy{_storage=new Map;constructor(){super()}getAccessToken(){const e=this._requireBaseURL();return this._storage.get(e)?.accessToken??null}setAccessToken(e){const t=this._requireBaseURL(),n=this._storage.get(t)||{};this._storage.set(t,{...n,accessToken:e})}getRefreshToken(){const e=this._requireBaseURL();return this._storage.get(e)?.refreshToken??null}setRefreshToken(e){const t=this._requireBaseURL(),n=this._storage.get(t)||{};this._storage.set(t,{...n,refreshToken:e})}clear(){const e=this._requireBaseURL();this._storage.delete(e)}getServers(){return Array.from(this._storage.keys())}exportAll(){return Object.fromEntries(this._storage.entries())}}class MultiServerLocalStorageStrategy extends MultiServerTokenStorageStrategy{prefix;constructor(e="cocolight"){super(),this.prefix=e}_key(e){return`${this.prefix}_tokens_${e}`}_getData(){if(this._ensureContext(),"undefined"==typeof localStorage)return{};const e=localStorage.getItem(this._key(this._currentBaseURL));return e?JSON.parse(e):{}}_setData(e){"undefined"!=typeof localStorage&&localStorage.setItem(this._key(this._currentBaseURL),JSON.stringify(e))}getAccessToken(){return this._getData().accessToken??null}setAccessToken(e){const t=this._getData();t.accessToken=e,this._setData(t)}getRefreshToken(){return this._getData().refreshToken??null}setRefreshToken(e){const t=this._getData();t.refreshToken=e,this._setData(t)}clear(){"undefined"!=typeof localStorage&&localStorage.removeItem(this._key(this._currentBaseURL))}getServers(){if("undefined"==typeof localStorage)return[];return Object.keys(localStorage).filter(e=>e.startsWith(`${this.prefix}_tokens_`)).map(e=>e.replace(`${this.prefix}_tokens_`,""))}exportAll(){const e={};for(const t of this.getServers()){const n=this._key(t),i="undefined"!=typeof localStorage?localStorage.getItem(n):null;i&&(e[t]=JSON.parse(i))}return e}}const me=c;I.addType("oid",e=>{if("string"==typeof e)return new re(e);if(void 0===e)return new re;throw new Error("Expected string value for ObjectID")});class ApiClient extends a{__entityTag="ApiClient";userId=null;_baseURL;_refreshUrl;_endpoints;_debug;_fromJSONValue;_tokenStorage;_offlineClientManager=null;_ajv;_ajvNoDefaults;_logger;_client;_breakerThreshold;_breakerResetTime;_breakerErrorCount=0;_breakerOpen=!1;_lastBreakerOpenTime=null;_accessToken=null;_refreshToken=null;_setUserId;_mode="legacy";constructor({baseURL:e,accessToken:t,refreshToken:n,refreshUrl:i="/api/cocolight/refreshtoken",endpoints:r=ae.endpoints,timeout:o=3e4,debug:a=!1,maxRetries:s=0,circuitBreakerThreshold:c=5,circuitBreakerResetTime:l=6e4,fromJSONValue:m=!0,mode:d="legacy",tokenStorageStrategy:u=null}){if(super(),!e)throw new ApiClientError('Le paramètre "baseURL" est obligatoire.',500);this._baseURL=e,this._refreshUrl=i,this._endpoints=r||ae.endpoints,this._debug=a,this._fromJSONValue=m,this._mode="clean"===d?"clean":"legacy",this._breakerThreshold=c,this._breakerResetTime=l;let y=null;Object.defineProperty(this,"userId",{get:()=>y,set:()=>{throw new Error("Modification directe de userId non autorisée.")},enumerable:!0}),this._setUserId=e=>{y=e,this._logger?.debug(`[ApiClient] userId set: ${e}`)},this._ajv=new S({strict:!1,useDefaults:!0,allErrors:!0,verbose:!0}),this._ajvNoDefaults=new S({strict:!1,useDefaults:!1,allErrors:!0,verbose:!0});for(const e of[this._ajv,this._ajvNoDefaults])j(e),e.addFormat("textarea",!0),e.addKeyword({keyword:"startBeforeEnd",type:"object",errors:!0,validate:this._startBeforeEndValidate});if(this._logger=O({transport:{target:"pino-pretty",options:{colorize:!0}},level:a?"debug":"info"}),this._client=p.create({baseURL:e,timeout:o}),s>0&&(me(this._client,{retries:s,retryDelay:me.exponentialDelay,retryCondition:e=>me.isNetworkError(e)||me.isRetryableError(e),onRetry:(e,t,n)=>{this._logger.warn(`[Retry] Tentative #${e} pour ${n?.url}`),this.emit("retryAttempt",{retryCount:e,url:n?.url})}}),this._logger.info(`[ApiClient] Retry activé : ${s} max`)),u instanceof MultiServerTokenStorageStrategy&&u.use(this._baseURL),this._tokenStorage=u||new MemoryStorageStrategy,"function"!=typeof this._tokenStorage?.getAccessToken||"function"!=typeof this._tokenStorage?.setAccessToken||"function"!=typeof this._tokenStorage?.getRefreshToken||"function"!=typeof this._tokenStorage?.setRefreshToken||"function"!=typeof this._tokenStorage?.clear)throw new Error("[ApiClient] La stratégie de stockage des tokens n’est pas valide. Elle doit implémenter les méthodes requises.");n&&this.setRefreshToken(n),t&&this.setToken(t);const h=this._tokenStorage.getAccessToken();h&&this.setToken(h);const f=this._tokenStorage.getRefreshToken();f&&this.setRefreshToken(f),this._client.interceptors.response.use(e=>e,async e=>{const t=e.config;if(t._retry)throw this._logger.error("[ApiClient] Requête déjà retentée, échec définitif."),e;if(e.response&&401===e.response.status&&this._refreshToken){t._retry=!0;try{this._logger.info("[ApiClient] Tentative de refresh du token...");if(await this._refreshAccessToken())return this._logger.info("[ApiClient] Token rafraîchi avec succès."),t.headers=t.headers??{},t.headers.Authorization="Bearer "+this.getToken(),this._logger.info("[ApiClient] Retente la requête originale avec le nouveau token."),this._client.request(t);throw this.resetSession(),new ApiClientError("Impossible de rafraîchir le token.",401)}catch(e){this.resetSession();const t={code:le(e)||401,message:ce(e)};throw new ApiClientError("Erreur lors du rafraîchissement du token.",401,t)}}throw e})}setToken(e){this._accessToken=e,this._tokenStorage.setAccessToken(e??""),e?this._client.defaults.headers.common.Authorization="Bearer "+e:delete this._client.defaults.headers.common.Authorization;const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait et défini : ${t}`)),this._logger.debug(`[ApiClient] setToken: ${e}`)}getToken(){return this._accessToken}setRefreshToken(e){if(this._refreshToken=e,this._tokenStorage.setRefreshToken(e??""),null===this.userId){const t=this._getIdFromToken(e);t&&(this._setUserId(t),this._logger.debug(`[ApiClient] userId extrait depuis refreshToken : ${t}`))}this._logger.debug(`[ApiClient] setRefreshToken: ${e}`)}getRefreshToken(){return this._refreshToken}get isConnected(){return!!this._accessToken}_getIdFromToken(e){if(!e)return null;try{const t=l(e);return this._logger.debug("[ApiClient] Payload décodé :",t),t.id||t.userId||null}catch(e){return this._logger.error("[ApiClient] Erreur lors du décodage du token :",e),null}}async _refreshAccessToken(){if(!this._refreshToken)return!1;const e=p.create({baseURL:this._baseURL,timeout:1e4,headers:{"Content-Type":"application/json"}});try{const t=await e.post(this._refreshUrl,{refreshToken:this._refreshToken});return!(!t.data||!t.data.token)&&(this.setToken(t.data.token),t.data.refreshToken&&this.setRefreshToken(t.data.refreshToken),this.emit("refreshSuccess",t.data),!0)}catch(e){return this.emit("refreshFailed",{error:ce(e)}),this.resetSession(),this._logger.error(`[ApiClient] Refresh Error : ${ce(e)}`),!1}}_checkCircuitBreaker(){if(!this._breakerOpen)return!0;const e=Date.now();return null!=this._lastBreakerOpenTime&&e-this._lastBreakerOpenTime>this._breakerResetTime&&(this._breakerOpen=!1,this._breakerErrorCount=0,this._logger.warn("[ApiClient] Circuit breaker réinitialisé"),this.emit("circuitBreakerReset"),!0)}_updateCircuitBreakerError(){this._breakerErrorCount+=1,this._logger.warn(`[ApiClient] Erreur #${this._breakerErrorCount} sur ${this._breakerThreshold}`),this._breakerErrorCount>=this._breakerThreshold&&(this._breakerOpen=!0,this._lastBreakerOpenTime=Date.now(),this._logger.error("[ApiClient] Circuit breaker ACTIVÉ - L'API est considérée indisponible"),this.emit("circuitBreakerOpen",{timestamp:this._lastBreakerOpenTime}))}_resetCircuitBreakerSuccess(){this._breakerErrorCount=0,this._breakerOpen&&(this._breakerOpen=!1,this._logger.warn("[ApiClient] Circuit breaker refermé suite à un succès"))}static stripNullsInPlace(e){if(e&&"object"==typeof e&&e.value&&"function"==typeof e.value.pipe)return e;if(Array.isArray(e))for(let t=e.length-1;t>=0;t--)null===e[t]||void 0===e[t]?e.splice(t,1):"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]);else if(e&&"object"==typeof e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null===e[t]||void 0===e[t]?delete e[t]:"object"==typeof e[t]&&ApiClient.stripNullsInPlace(e[t]));return e}_resolveSpecialValuesInPlace(e,t={}){const n={userId:()=>this.userId,accessToken:()=>this._accessToken,refreshToken:()=>this._refreshToken,baseURL:()=>this._baseURL,pathParams:e=>{const n=this._getValueByPath(t,e);return null!=n?n:void 0}},i=/@(?:\{([^}]+)\}|([\w.]+))/g,r=e=>"string"!=typeof e?e:e.replace(i,(t,i,r)=>{if(i){if(i.startsWith("pathParams.")){const e=i.substring(11),t=n.pathParams(e);return null!=t?t:`@{${i}}`}{const e=n[i];if("function"==typeof e){const t=e();return null!=t?t:`@{${i}}`}return`@{${i}}`}}if(r){if(r.startsWith("pathParams.")){const e=r.match(/^pathParams\.([^.]+)(.*)$/);if(e){const t=e[1],i=e[2],o=n.pathParams(t);return null!=o?o+i:`@${r}`}return`@${r}`}{const e=n[r];if("function"==typeof e){const t=e();return null!=t?t:`@${r}`}return`@${r}`}}return e}),o=e=>{if((e=>e&&"object"==typeof e&&("function"==typeof e.pipe||"undefined"!=typeof Buffer&&e instanceof Buffer))(e))return e;if(Array.isArray(e))return e.map(o);if((e=>"[object Object]"===Object.prototype.toString.call(e))(e)){const t={};for(const[n,i]of Object.entries(e)){t[r(n)]=o(i)}return t}return"string"==typeof e?r(e):e};return o(e)}_cleanSchemaLeftoverAlias(e){const t=/@\w+/;if(Array.isArray(e))return e.map(e=>this._cleanSchemaLeftoverAlias(e));if(e&&"object"==typeof e){const n={};for(const i of Object.keys(e)){const r=e[i];if(!t.test(i)){if("default"===i){if("string"==typeof r&&t.test(r))continue;if(r&&"object"==typeof r){const e=this._cleanSchemaLeftoverAlias(r);Object.keys(e).length>0&&(n[i]=e);continue}}"string"==typeof r&&t.test(r)||(n[i]=this._cleanSchemaLeftoverAlias(r))}}return n}return e}async safeCall(e,...t){try{return await e(...t)}catch(e){throw this._logger.error(`[ApiClient.safeCall] Erreur: ${ce(e)}`),e}}async callEndpoint(e,t={},n=!0,i=!0){const r=this._endpoints.find(t=>t.constant===e);if(!r)throw new ApiClientError(`Endpoint introuvable : ${e}`,404);const{path:o,method:a,contentType:s,auth:p,pathParams:c,request:l,responses:m}=r,d=(a||"GET").toLowerCase(),u=s||"application/json",y={"Content-Type":u};if("clean"===this._mode&&(y["X-Coco-Mode"]="clean"),this._accessToken)"bearer"===p?y.Authorization=`Bearer ${this._accessToken}`:p&&"none"!==p||y.Authorization||(y.Authorization=`Bearer ${this._accessToken}`);else if("bearer"===p)throw new ApiClientError(`Token requis pour l'endpoint sécurisé : ${e}`,401);let h,f=o,g={};if(c){let n=c;"none"===p&&null===this.userId&&(n=this._cleanSchemaLeftoverAlias(c));const i=t.pathParams||{},r=this._ajv.compile(n);if(!r(i)){const t=this._ajvErrorHuman(r.errors??[]);throw this.emit("validationError",{stage:"pathParams",errors:r.errors}),new ApiValidationError(`callEndpoint: ${e} - Path parameter validation failed.`,400,t,r.errors)}g=this._resolveSpecialValuesInPlace(i),f=f.replace(/\{(\w+)\}/g,(e,t)=>{const n=g[t];if(void 0!==n)return encodeURIComponent(n);throw new ApiClientError(`Path param manquant ou non résolu : {${t}}`,400)})}if(l){let n=l;"none"===p&&null===this.userId&&(n=this._cleanSchemaLeftoverAlias(l));const i=t[v];if(i){const e=Object.fromEntries(Object.keys(i.context??{}).map(e=>[e,{type:"string"}]));n=i.isUpdate?{type:"object",$defs:{...n.$defs??{},...i.defs??{}},properties:{...i.properties??{},...e,id:{type:"string"},collection:{type:"string"}},additionalProperties:!1}:{...n,properties:{...n.properties??{},...i.properties??{},...e}}}let r={...t};delete r.pathParams,delete r[v],i?.context&&Object.assign(r,i.context),"application/x-www-form-urlencoded"===u&&(r=ApiClient.normalizeDatesForValidation(r),r=ApiClient.normalizeSchemaDateFields(r,n));const o=ApiClient.stripNullsInPlace(r),a=(i?.isUpdate?this._ajvNoDefaults:this._ajv).compile(n);if(!a(o)){const t=a.errors?this._ajvErrorHuman(a.errors):[];throw this.emit("validationError",{stage:"request",errors:a.errors}),new ApiValidationError(`callEndpoint: ${e} - Request validation failed.`,400,t,a.errors)}t=this._resolveSpecialValuesInPlace(o,g)}if(this._offlineClientManager?.isOffline()){if("function"==typeof this._offlineClientManager._enqueueOfflineAction){this._logger.warn(`[ApiClient] Mode dégradé : mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:n,validateResponseSchema:i}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (offline mode)`),this.emit("queuedOffline",{constant:e,reason:"offlineMode",data:t});return{data:null,offline:!0}}throw this._logger.warn("[ApiClient] Mode dégradé actif mais offlineManager non initialisé correctement"),new ApiClientError("Mode hors-ligne actif, mais gestionnaire offline non disponible.",503)}if(!this._checkCircuitBreaker()){if(!1===this._offlineClientManager?.isOffline?.()&&"function"==typeof this._offlineClientManager._enqueueOfflineAction){this._logger.warn(`[ApiClient] Circuit breaker actif → mise en file de ${e}`),await this._offlineClientManager._enqueueOfflineAction({constant:e,data:t,options:{transformResponseData:n,validateResponseSchema:i}}),this._logger.info(`[ApiClient] Requête ${e} mise en file (circuit breaker)`),this.emit("queuedOffline",{constant:e,reason:"circuitBreaker",data:t});return{data:null,breaker:!0}}throw new CircuitBreakerError("Le circuit breaker est activé, impossible d'appeler l'API")}"application/json"===u||"multipart/form-data"===u?h=t:"application/x-www-form-urlencoded"===u&&(h=ApiClient.toURLSearchParams(t)),this._logger.debug(`[ApiClient] callEndpoint: ${e} -> ${f}, method=${d}`);try{const e=await this._client.request({url:f,method:d,headers:y,["get"===d?"params":"data"]:h});if("clean"===this._mode){const t=e.data;if(t&&"object"==typeof t&&!Array.isArray(t)&&"boolean"==typeof t.success){if(!1===t.success)throw new ApiResponseError(t?.error?.message??"Erreur inconnue",e.status,t);e.data=t.data}this._fromJSONValue&&(e.data=this._reviveClean(e.data))}else if(i){const t=String(e.status),n=m?.[t];if(n){const t=this._ajv.compile(n);if(!t(e.data)){const n=this._ajvErrorHuman(t.errors??[]);throw this.emit("validationError",{stage:"response",errors:t.errors}),new ApiValidationError("Response validation failed.",e.status,n,t.errors)}}}return this._resetCircuitBreakerSuccess(),"function"==typeof n?e.data=n(e.data):!0===n&&"clean"!==this._mode&&(e.data=this._transformData(e.data)),Array.isArray(r.postActions)&&r.postActions.forEach(t=>{const n=t.path?this._getValueByPath(e.data,t.path):null;switch(t.type){case"setToken":this.setToken(n);break;case"setRefreshToken":this.setRefreshToken(n);break;case"resetSession":this.resetSession();break;case"emitEvent":t.event&&(this.emit(t.event,n),this._logger.debug(`[ApiClient] Event émis : ${t.event}`,n));break;case"callMethod":"function"==typeof this[t.method]?(this[t.method](),this._logger.debug(`[ApiClient] Méthode appelée : ${t.method}`)):this._logger.warn(`[ApiClient] Méthode inconnue : ${t.method}`);break;default:this._logger.warn(`[ApiClient] Action inconnue : ${t.type}`)}}),e}catch(t){if(t instanceof ApiResponseError)throw t;if(this._updateCircuitBreakerError(),this._logger.error(`[ApiClient] Erreur lors de l'appel de ${e}: ${ce(t)}`),t instanceof ApiValidationError)throw t;{const e=pe(t)?t.response.status:500,n=pe(t)?t.response.data:null;throw new ApiClientError(`Erreur lors de l'appel de l'API : ${ce(t)}`,e,n)}}}_ajvErrorHuman(e){try{const t=new s(e);return t.errors.map(({message:e})=>e)}catch(t){return this._logger.error("[ApiClient] _ajvErrorHuman",t),e.map(({message:e})=>e)}}checkAndThrowApiResponseError(e){if(!("status"in e))return e;const t=e.data;if(!t||"object"!=typeof t)return e;if("boolean"==typeof t.result&&!1===t.result)throw new ApiResponseError(t.msg||"Erreur inconnue",e.status,t);if(t.resultErrors&&"object"==typeof t.resultErrors&&"boolean"==typeof t.resultErrors.result&&!1===t.resultErrors.result)throw new ApiResponseError(t.resultErrors.msg||"Erreur inconnue",e.status,t);return e}resetSession(){this.setToken(null),this.setRefreshToken(null),this._setUserId(null),this._tokenStorage.clear(),delete this._client.defaults.headers.common.Authorization,this._logger.info("[ApiClient] Session utilisateur réinitialisée."),this.emit("sessionReset")}_getValueByPath(e,t){if(!t)return;return t.split(".").reduce((e,t)=>e&&e[t],e)}static normalizeDatesForValidation(e){if(null==e)return e;if(e&&"object"==typeof e&&e.__isReactive&&e.__raw)return ApiClient.normalizeDatesForValidation(e.__raw);if(e instanceof Date)return e.toISOString().replace(/\.\d{3}Z$/,"+0000");if(Array.isArray(e))return e.map(e=>ApiClient.normalizeDatesForValidation(e));if("object"==typeof e){const t={};for(const n of Object.keys(e))t[n]=ApiClient.normalizeDatesForValidation(e[n]);return t}return e}static normalizeSchemaDateFields(e,t){if(!e||!t||"object"!=typeof e)return e;const n={...e};let i=t.properties||{};if(t.allOf&&Array.isArray(t.allOf))for(const e of t.allOf)e.properties&&(i={...i,...e.properties}),e.then&&e.then.properties&&(i={...i,...e.then.properties});t.then&&t.then.properties&&(i={...i,...t.then.properties});for(const[e,t]of Object.entries(i)){const i=t;if("date"===i?.format&&n[e]){const t=n[e];"string"==typeof t&&t.includes("T")&&(n[e]=t.split("T")[0])}}return n}static toURLSearchParams(e,t={}){return this._buildParams(e,new URLSearchParams,t)}static _buildParams(e,t,n={}){if("object"!=typeof e||null===e)throw new TypeError("La donnée doit être un objet non nul.");const{dots:i=!1,indexes:r=!1,metaTokens:o=!0}=n,a=[];function s(e){return"[object Object]"===Object.prototype.toString.call(e)||Array.isArray(e)}function p(e){return e.endsWith("[]")?e.slice(0,-2):e}function c(e,t,n=!1){return e?e.concat(t).map((e,t)=>(e=p(e),!n&&t?`[${e}]`:e)).join(n?".":""):t}function l(e){return null==e?"":e instanceof Date?e.toISOString():(e instanceof Blob||e instanceof File||e instanceof ArrayBuffer||ArrayBuffer.isView(e),e)}return function e(n,m=[]){null==n||a.includes(n)||(a.push(n),Object.entries(n).forEach(([n,a])=>{void 0!==a&&function(e,n,a){if(e&&"object"==typeof e){if(n.endsWith("{}"))return n=o?n:n.slice(0,-2),t.append(c(a,n,i),JSON.stringify(e)),!1;if(Array.isArray(e)&&!e.some(s)||n.endsWith("[]"))return n=p(n),e.forEach((e,o)=>{if(null!=e){const s=r?c(a.concat(n),o,i):`${c(a,n,i)}[]`;t.append(s,l(e))}}),!1}return!!s(e)||(t.append(c(a,n,i),l(e)),!1)}(a,n.trim(),m)&&e(a,m.concat(p(n)))}),a.pop())}(e),t}_reviveClean(e){if(Array.isArray(e))return e.map(e=>this._reviveClean(e));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach(n=>{let i=this._reviveClean(e[n]);if(this._dateFields.includes(n)&&"string"==typeof i&&/^\d{4}-\d{2}-\d{2}T/.test(i)){const e=new Date(i);Number.isNaN(e.getTime())||(i=e)}t[n]=i}),"string"==typeof t.id&&/^[0-9a-fA-F]{24}$/.test(t.id)&&void 0===t._id&&(t._id=I.fromJSONValue({$type:"oid",$value:t.id})),t}return e}_transformData(e){if(e&&"object"==typeof e)if(e.resultGoods?.msg)e=this._normalizeJsonData({msg:e.resultGoods.msg,...e});else if(e.resultErrors?.msg)e=this._normalizeJsonData({msg:e.resultErrors.msg,...e});else if(e.results&&"object"==typeof e.results&&!Array.isArray(e.results))e.results=Object.keys(e.results).map(t=>this._normalizeJsonData({id:t,...e.results[t]}));else if(Array.isArray(e.results)&&e.results.length>0)e.results=e.results.map(e=>this._normalizeJsonData(e));else if(e.news&&Array.isArray(e.news)&&0===e.news.length)e=e.news;else if(e.news&&"object"==typeof e.news&&!Array.isArray(e.news))e=Object.keys(e.news).map(t=>this._normalizeJsonData({id:t,...e.news[t]}));else if(e.notif&&"object"==typeof e.notif&&!Array.isArray(e.notif))e.notif=Object.keys(e.notif).map(t=>this._normalizeJsonData({id:t,...e.notif[t]}));else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens)&&e.organizations&&"object"==typeof e.organizations&&!Array.isArray(e.organizations))e=[...Object.keys(e.citoyens).map(t=>this._normalizeJsonData({id:t,...e.citoyens[t]})),...Object.keys(e.organizations).map(t=>this._normalizeJsonData({id:t,...e.organizations[t]}))];else if(e.citoyens&&"object"==typeof e.citoyens&&!Array.isArray(e.citoyens))e=Object.keys(e.citoyens).map(t=>this._normalizeJsonData({id:t,...e.citoyens[t]}));else if(e.cities&&"object"==typeof e.cities&&!Array.isArray(e.cities))e=Object.keys(e.cities).map(t=>this._normalizeJsonData({id:t,...e.cities[t]}));else if(e.cities&&Array.isArray(e.cities)&&0===e.cities.length)e=e.cities;else if(e.newComment&&"object"==typeof e.newComment)e.newComment=this._normalizeJsonData({...e.newComment});else if(Array.isArray(e))e=e.map(e=>this._normalizeJsonData(e));else if(e.map&&"object"==typeof e.map)e.map=this._normalizeJsonData(e.map);else if(e.object&&"object"==typeof e.object)e.object=this._normalizeJsonData(e.object);else if("object"==typeof e&&Object.keys(e).length>0){const t=Object.keys(e).every(e=>/^[0-9a-fA-F]{24}$/.test(e));e=t?Object.keys(e).map(t=>({id:t,...this._normalizeJsonData(e[t])})):this._normalizeJsonData(e)}return e}_normalizeJsonData(e){if(!e||"object"!=typeof e)return e;if(e=this._normalizeRecursively(e),e?.mediaImg?.images&&Array.isArray(e.mediaImg.images)&&e.mediaImg.images.length>0&&(e.mediaImg.countImages=e.mediaImg.images.length),e?.mediaFile?.files&&Array.isArray(e.mediaFile.files)&&e.mediaFile.files.length>0&&(e.mediaFile.countFiles=e.mediaFile.files.length),e?.src?.changes&&"object"==typeof e.src.changes&&Object.keys(e.src.changes).length>0&&Object.keys(e.src.changes).forEach(t=>{e.src.changes[t]&&(e.src.changes[t]=this._ensureFullURL(e.src.changes[t]))}),e?.openingHours&&Array.isArray(e.openingHours)&&e.openingHours.length>0&&(e.openingHours=e.openingHours.filter(e=>e.dayOfWeek&&e.hours&&e.hours[0]&&e.hours[0].opens)),e.replies&&"object"==typeof e.replies&&Object.keys(e.replies).length>0&&(e.replies=Object.keys(e.replies).map(t=>this._normalizeJsonData({id:t,...e.replies[t]}))),e?.author&&"object"==typeof e.author&&Object.keys(e.author).length>0&&!("profilThumbImageUrl"in e.author)){const t=Object.keys(e.author)[0];e.author={...e.author[t]}}return e?.timeAgo&&delete e.timeAgo,"people"===e?.author?.typeSig&&(e.author.type="citoyens"),"people"===e?.typeSig&&(e.collection="citoyens"),"organizations"===e?.typeSig&&(e.collection="organizations"),this._fromJSONValue?I.fromJSONValue(e):e}_ensureFullURL(e){if(!e)return e;if(!(e=e.trim())||/^https?:\/\//i.test(e))return e;let t="/";return t=this._baseURL.endsWith("/")&&e.startsWith("/")||this._baseURL.endsWith("/")||e.startsWith("/")?"":"/",`${this._baseURL}${t}${e}`}_normalizeString(e){return"true"===e||"false"!==e&&e}_normalizeId(e){return e._id&&e._id.$id&&/^[0-9a-fA-F]{24}$/.test(e._id.$id)&&(e.id=e._id.$id,e._id={$type:"oid",$value:e._id.$id}),e.id&&e.id.$id&&/^[0-9a-fA-F]{24}$/.test(e.id.$id)&&(e._id={$type:"oid",$value:e.id.$id},e.id=e.id.$id),e}_normalizeDate(e){if(e&&"object"==typeof e&&"number"==typeof e.sec)return{$date:1e3*e.sec};if("number"==typeof e)return{$date:1e3*e};if("string"==typeof e&&""!==e.trim()){const t=new Date(e);if(!isNaN(t.getTime()))return I.toJSONValue(t)}return e}_normalizeImage(e){return"string"==typeof e&&""!==e.trim()?this._ensureFullURL(e):e}_normalizeNumber(e){if("string"!=typeof e)return e;const t=e.trim();if(""===t)return e;const n=Number(t);return Number.isFinite(n)?n:e}_imageFields=["profilImageUrl","profilThumbImageUrl","profilMediumImageUrl","profilMarkerImageUrl","profilBannerUrl","profilRealBannerUrl","imagePath","imageThumbPath","docPath","imageThumb","imageMediumPath","logo","logoMin","image"];_dateFields=["modified","created","updated","birthDate","lastLoginDate","startDate","endDate","date","issuedOn",...ie];_numberFields=["credits","min","max","timeSpent",...ne];_normalizeRecursively(e){if("string"==typeof e)return this._normalizeString(e);if(Array.isArray(e))return e.map(e=>this._normalizeRecursively(e));if(null!==e&&"object"==typeof e){const t={};return Object.keys(e).forEach(n=>{let i=this._normalizeRecursively(e[n]);this._dateFields.includes(n)&&(i=this._normalizeDate(i)),this._imageFields.includes(n)&&(i=this._normalizeImage(i)),this._numberFields.includes(n)&&(i=this._normalizeNumber(i)),"content"===n&&i&&"object"==typeof i&&i.image&&(i.image=this._normalizeImage(i.image)),t[n]=i}),this._normalizeId(t)}return e}_startBeforeEndValidate=(e,t)=>{if(!t.startDate||!t.endDate)return!0;const n=new Date(t.startDate)<new Date(t.endDate);return n||(this._startBeforeEndValidate.errors=[{instancePath:"/startDate",schemaPath:"#/startBeforeEnd",keyword:"startBeforeEnd",params:{},message:"startDate must be before endDate"}]),n};getRequestSchema(e){const t=this._endpoints.find(t=>t.constant===e);return t?.request||null}getPathSchema(e){return this._endpoints.find(t=>t.constant===e)?.pathParams||null}onEvent(e={}){const t=["retryAttempt","queuedOffline","circuitBreakerOpen","circuitBreakerReset","refreshSuccess","refreshFailed","sessionReset","validationError","offlineModeChanged","userLoggedIn"];for(const n of t)"function"==typeof e[n]&&this.on(n,e[n])}getDeclaredEvents(){const e=new Set;for(const t of this._endpoints)if(Array.isArray(t.postActions))for(const n of t.postActions)"emitEvent"===n.type&&n.event&&e.add(n.event);return Array.from(e)}}function de(e){return e&&"object"==typeof e&&"status"in e&&"data"in e}class UserApi{client;loggedUser=null;constructor(e){this.client=e instanceof ApiClient?e:new ApiClient(e)}get isConnected(){return this.client.isConnected}get userId(){return this.client.userId}async login(e,t){return this.client.safeCall(async()=>{const n=await this.client.callEndpoint("AUTHENTICATE_URL",{email:e,password:t});return this.loggedUser=new User(this.client,n.data.user,{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Classified:Classified,Action:Action}),this.loggedUser})}async meIsconnected(){if(!this.client.isConnected||!this.client.userId)throw new ApiError("User not connected",401);return this.client._logger.debug("UserApi","meIsconnected",this.client.userId),this.loggedUser=new User(this.client,{id:this.client.userId},{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Classified:Classified,Action:Action}),this.loggedUser}async register({name:e,username:t,email:n,pwd:i}){return this.client.safeCall(async()=>{const r=await this.client.callEndpoint("PERSON_REGISTER",{name:e,username:t,email:n,pwd:i});if(!de(r))throw new ApiError("Requête mise en file (offline/circuit breaker)",503,r);if(!1===r?.data?.result)throw new ApiResponseError(r.data.msg,r.status,r.data);return r.data})}async recoverPassword(e){return this.client.safeCall(async()=>{const t=await this.client.callEndpoint("PASSWORD_RECOVERY",{email:e});if(!de(t))throw new ApiError("Requête mise en file (offline/circuit breaker)",503,t);if(!1===t?.data?.result)throw new ApiResponseError(t.data.msg,t.status,t.data);return t.data})}async activateAccount({user:e,validationKey:t}){return this.client.safeCall(async()=>{const n=await this.client.callEndpoint("PERSON_ACTIVATE",{user:e,validationKey:t});if(!de(n))throw new ApiError("Requête mise en file (offline/circuit breaker)",503,n);if(!1===n?.data?.result)throw new ApiResponseError(n.data.msg,n.status,n.data);return n.data})}}f("User",User),f("Organization",Organization),f("Project",Project),f("Event",Event),f("Poi",Poi),f("Badge",Badge),f("EndpointApi",EndpointApi),f("News",News),f("Comment",Comment),f("Answer",Answer),f("Form",Form),f("Classified",Classified),f("Action",Action);class Api{_loggedUser;_client;static async userLogin(e,t,n){const i=Api.userApi(n);return await Api.userApiLogin(i,e,t)}static userApi(e){try{return new UserApi(e)}catch(e){throw console.error("[Api.userApi] Erreur lors de la création d'un objet utilisateur :",e.message),e}}static async userApiLogin(e,t,n){try{if(!e)throw new ApiError("userApi is not defined",500);if(!e.client)throw new ApiError("userApi.client is not defined",500);if(e.client.isConnected){const t=await e.meIsconnected();return new Api(t,e.client)}{if(!t||!n)throw new ApiError("email and password are required",400);const i=await e.login(t,n);return new Api(i,e.client)}}catch(e){if(e instanceof ApiClientError&&e?.details?.error)throw new ApiAuthenticationError(e.details.error,e.status,e.details);throw e}}constructor(e,t){this._loggedUser=e,this._client=t}async me(){if(!this._loggedUser)throw new ApiAuthenticationError("Accès refusé : utilisateur non authentifié.",401);return await this._loggedUser.get(),this._loggedUser}async user(e){try{if(e.id||e.slug){const t=new User(this._client,e,{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});return await t.get(),t}return new User(this._client,e,{EndpointApi:EndpointApi,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action})}catch(e){throw console.error("[Api.user] Erreur lors de la création d'un objet utilisateur public :",e.message),e}}async organization(e){try{const t=new Organization(this._client,e,{EndpointApi:EndpointApi,User:User,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Organization.");return await t.get(),t}catch(e){throw console.error("[Api.organization] Erreur lors de la création d'un objet organisation :",e.message),e}}async project(e){try{const t=new Project(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Project.");return await t.get(),t}catch(e){throw console.error("[Api.project] Erreur lors de la création d'un objet projet :",e.message),e}}async event(e){try{const t=new Event(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Event.");return await t.get(),t}catch(e){throw console.error("[Api.event] Erreur lors de la création d'un objet événement :",e.message),e}}async poi(e){try{const t=new Poi(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Poi.");return await t.get(),t}catch(e){throw console.error("[Api.poi] Erreur lors de la création d'un objet poi :",e.message),e}}async answer(e){try{const t=new Answer(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id)throw new Error("Vous devez fournir un id pour créer une instance Answer.");return await t.get(),t}catch(e){throw console.error("[Api.answer] Erreur lors de la création d'un objet Answer :",e.message),e}}async form(e){try{const t=new Form(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id)throw new Error("Vous devez fournir un id pour créer une instance Form.");return await t.get(),t}catch(e){throw console.error("[Api.form] Erreur lors de la création d'un objet Form :",e.message),e}}async classified(e){try{const t=new Classified(this._client,e,{EndpointApi:EndpointApi,User:User,Organization:Organization,Project:Project,Event:Event,Poi:Poi,Badge:Badge,News:News,Comment:Comment,Answer:Answer,Form:Form,Classified:Classified,Action:Action});if(!e.id&&!e.slug)throw new Error("Vous devez fournir un id ou un slug pour créer une instance Classified.");return await t.get(),t}catch(e){throw console.error("[Api.classified] Erreur lors de la création d'un objet Classified :",e.message),e}}async entitySlug(e){if(!e)throw new ApiError("slug requis",400);try{const t=await this.endpointApi.getElementsKey({pathParams:{slug:e}});if(t.contextId&&t.contextType){const n=_(t.contextType,this._client,{id:t.contextId});if(!n)throw new ApiResponseError(`Le type d'entité pour le slug ${e} n'est pas reconnu`,200,t);return await n.get(),n}throw new ApiResponseError(`Le slug ${e} n'est pas valide`,200,t)}catch(t){throw t instanceof ApiResponseError?new ApiResponseError(`Impossible de récupérer l'identifiant pour le slug ${e}`,t.status,t.responseData):t}}get client(){return this._client}get endpointApi(){return new EndpointApi(this._client)}async searchTags(e){if("string"!=typeof e||0===e.length)throw new ApiError("Le mot-clé `q` est requis pour searchTags.",400);const t={pathParams:{q:e}};return this.endpointApi.searchTags(t)}logout(){this._loggedUser=null,this._client.resetSession(),this._client._logger.info("UserApi: User logged out")}}class OfflineQueueStorageStrategy{}class MemoryOfflineStorage extends OfflineQueueStorageStrategy{_queue=[];constructor(){super()}async loadQueue(){return this._queue}async saveQueue(e){this._queue=[...e]}}class LocalStorageOfflineStorage extends OfflineQueueStorageStrategy{key;constructor(e="cocolight-api-offline-queue"){super(),this.key=e}async loadQueue(){try{const e=localStorage.getItem(this.key);return(e?JSON.parse(e):null)??[]}catch{return[]}}async saveQueue(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(e){console.warn("[Offline] Échec du stockage localStorage",e)}}}class OfflineClientManager{_clients;_client;_offlineMode;_pingInterval;_offlineQueueStorage;_offlineQueue;_monitoringStarted;constructor(e){if(!(e&&e instanceof ApiClient))throw new Error("[OfflineClientManager] apiClient doit être une instance de ApiClient");this._clients=new Map,this._client=e,this._offlineMode=void 0,this._pingInterval=void 0,this._offlineQueueStorage=void 0,this._offlineQueue=[],this._monitoringStarted=void 0}static async attachTo(e,t={}){e._offlineClientManager=new OfflineClientManager(e);const n=await async function(e="auto"){if("memory"===e)return new MemoryOfflineStorage;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new LocalStorageOfflineStorage;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileOfflineStorage:e}=await Promise.resolve().then(function(){return xt});return new e}if("auto"===e){if("undefined"!=typeof window&&window.localStorage)return new LocalStorageOfflineStorage;{const{FileOfflineStorage:e}=await Promise.resolve().then(function(){return xt});return new e}}throw new Error(`Unsupported offline storage strategy: ${e}`)}(t?.offlineStorageStrategy||"auto");await e._offlineClientManager._initOfflineQueue(n),t?.disableOfflineMonitoring||e._offlineClientManager.startOfflineMonitoring(t)}async getClient(e){const t=`${e.baseURL}|${e.accessToken}`;if(this._clients.has(t))return this._clients.get(t);const n=new ApiClient({baseURL:e.baseURL,accessToken:e.accessToken,refreshToken:e.refreshToken,debug:this._client._debug});return this._clients.set(t,n),n}async replayAction(e){const t=await this.getClient(e.meta);try{const n=await t.callEndpoint(e.constant,e.data,e.options?.transformResponseData??!0,e.options?.validateResponseSchema??!0);return this._client._logger.info(`[OfflineReplay] Succès ${e.constant} sur ${e.meta.baseURL}`),n}catch(t){throw this._client._logger.error(`[OfflineReplay] Échec ${e.constant}`,t.message),t}}startOfflineMonitoring({interval:e=3e4,disableOfflineMonitoring:t=!1}={}){t||this._monitoringStarted||(this._monitoringStarted=!0,this._offlineMode="undefined"!=typeof window&&"undefined"!=typeof navigator&&!navigator.onLine,"undefined"!=typeof window&&(window.addEventListener("online",()=>this.setOfflineMode(!1)),window.addEventListener("offline",()=>this.setOfflineMode(!0))),this._pingInterval=setInterval(async()=>{const e=this._offlineMode;try{await this._client._client.head("/api/cocolight/infoserver",{timeout:5e3}),e&&this.setOfflineMode(!1)}catch{this._client._logger.error("[OfflineMonitor] ping() échoué → passage en offline"),this.setOfflineMode(!0)}},e))}setOfflineMode(e){this._offlineMode!==e&&(this._offlineMode=e,"function"==typeof this._client.emit&&this._client.emit("offlineModeChanged",e),this._client._logger.info(`[ApiClient] Mode offline : ${e} (set depuis monitoring)`),e||"function"!=typeof this._replayOfflineQueue||this._replayOfflineQueue())}isOffline(){return!!this._offlineMode}async _enqueueOfflineAction({constant:e,data:t,options:n={}}){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const i=this._client.getToken()||this._client.getRefreshToken(),r=this._client._endpoints.find(t=>t.constant===e);if("required"===(r?.authPolicy||("none"===r?.auth?"none":"required"))&&!i)return void this._client._logger.warn(`[Offline] Action ignorée : token requis mais absent (${e})`);const o={constant:e,data:t,options:n,meta:{baseURL:this._client._baseURL,accessToken:this._client.getToken(),refreshToken:this._client.getRefreshToken(),timestamp:Date.now()}};this._offlineQueue.push(o),await this._offlineQueueStorage.saveQueue(this._offlineQueue),this._client._logger.info(`[Offline] Action mise en file : ${e}`)}async _replayOfflineQueue(){if(!this._offlineQueueStorage)throw new Error("[OfflineClientManager] _offlineQueueStorage non initialisé");const e=[...this._offlineQueue];this._offlineQueue=[],await this._offlineQueueStorage.saveQueue([]);for(const t of e){const e=this._client._endpoints.find(e=>e.constant===t.constant),n=e?.authPolicy||("none"===e?.auth?"none":"required"),i=t.meta.accessToken||t.meta.refreshToken;if("required"!==n||i)try{await this.replayAction(t)}catch(e){this._client._logger.error("[Offline] Relecture échouée :",e.message),this._offlineQueue.push(t)}else this._client._logger.warn(`[Offline] Rejetée : token requis manquant (${t.constant})`)}await this._offlineQueueStorage.saveQueue(this._offlineQueue)}async _initOfflineQueue(e){if(!(e&&e instanceof OfflineQueueStorageStrategy))throw new Error("[OfflineClientManager] storageStrategy doit être une instance de OfflineQueueStorageStrategy");this._offlineQueueStorage=e,this._offlineQueue=await e.loadQueue()}}const ue=["NGO","LocalBusiness","Group","GovernmentOrganization","Cooperative"],ye=["abandoned","concept","development","production","started","testing","idea","mature","qa","finished"],he=["workshop","competition","concert","contest","conference","debate","exhibition","festival","crowdfunding","fair","course","protest","market","film","getTogether","meeting","spectacle","internship","stand","others"],fe=["link","tool","machine","software","rh","Resource material","Financial Ressource","ficheBlanche","geoJson","compostPickup","video","sharedLibrary","recoveryCenter","trash","history","something2See","funPlace","place","artPiece","streetArts","openScene","stand","parking","other"],ge=["need","offer"],be=["service","competence","material"],_e={service:{key:"service",icon:"cogs",label:"Service",subcat:{charity:{key:"charity",label:"Charité",icon:"heart"},education:{key:"education",label:"Aide éducative",icon:"book"},househelp:{key:"househelp",label:"Aide ménagère",icon:"home"},washing:{key:"washing",label:"Lavage",icon:"droplets"},gardening:{key:"gardening",label:"Jardinage",icon:"flower"},farming:{key:"farming",label:"Agriculture",icon:"wheat"},generalmaintenance:{key:"generalmaintenance",label:"Maintenance générale",icon:"wrench"},childrencare:{key:"childrencare",label:"Garde d'enfants",icon:"baby"},ederlycare:{key:"ederlycare",label:"Aide aux personnes âgées",icon:"user"},disabledcare:{key:"disabledcare",label:"Aide aux personnes en situation de handicap",icon:"accessibility"},hostinghelp:{key:"hostinghelp",label:"Aide à l'accueil",icon:"handshake"},animalcare:{key:"animalcare",label:"Soins aux animaux",icon:"paw-print"}}},competence:{key:"competence",icon:"bookmark",label:"Compétence",subcat:{artistic:{key:"artistic",label:"Artistique",icon:"palette"},laws:{key:"laws",label:"Droit",icon:"scale"},itdevlopment:{key:"itdevlopment",label:"Développement informatique",icon:"code"},handcraft:{key:"handcraft",label:"Artisanat",icon:"scissors"},animalcare:{key:"animalcare",label:"Soins aux animaux",icon:"paw-print"},agriculture:{key:"agriculture",label:"Agriculture",icon:"wheat"},restauration:{key:"restauration",label:"Restauration",icon:"utensils"},building:{key:"building",label:"Construction",icon:"hard-hat"}}},material:{key:"material",icon:"wrench",label:"Matériel",subcat:{electronic:{key:"electronic",label:"Électronique",icon:"cpu"},furniture:{key:"furniture",label:"Mobilier",icon:"armchair"},primaryressources:{key:"primaryressources",label:"Ressources primaires",icon:"leaf"},buildingtools:{key:"buildingtools",label:"Outils de construction",icon:"hammer"},gardeningtools:{key:"gardeningtools",label:"Outils de jardinage",icon:"shovel"},medicalstuff:{key:"medicalstuff",label:"Matériel médical",icon:"stethoscope"}}}},we=["todo","done","tracking","discuter","next","totest","disabled","closed"],Ae={organizations:[{name:"name",type:"string",multiple:!1,label:"Nom",required:!0},{name:"type",type:"string",multiple:!1,label:"Type",enum:[...ue]},{name:"email",type:"string",multiple:!1,label:"Email",format:"email"},{name:"url",type:"string",multiple:!1,label:"Site web",format:"url"},{name:"telephone",type:"string",multiple:!1,label:"Téléphone",format:"tel"},{name:"shortDescription",type:"string",multiple:!1,label:"Description courte"},{name:"description",type:"string",multiple:!1,label:"Description",format:"markdown"},{name:"tags",type:"array",multiple:!0,label:"Tags"},{name:"address",type:"object",multiple:!1,label:"Adresse",format:"address"},{name:"socialNetwork",type:"object",multiple:!1,label:"Réseaux sociaux",format:"social"},{name:"openingHours",type:"array",multiple:!1,label:"Horaires d'ouverture",format:"openingHours"},{name:"profil_avatar",type:"object",multiple:!1,label:"Logo / image",format:"image"}],projects:[{name:"name",type:"string",multiple:!1,label:"Nom du projet",required:!0},{name:"shortDescription",type:"string",multiple:!1,label:"Description courte"},{name:"description",type:"string",multiple:!1,label:"Description",format:"markdown"},{name:"url",type:"string",multiple:!1,label:"Site web",format:"url"},{name:"public",type:"boolean",multiple:!1,label:"Projet public"},{name:"tags",type:"array",multiple:!0,label:"Tags"},{name:"address",type:"object",multiple:!1,label:"Adresse",format:"address"},{name:"socialNetwork",type:"object",multiple:!1,label:"Réseaux sociaux",format:"social"},{name:"profil_avatar",type:"object",multiple:!1,label:"Logo / image",format:"image"}],poi:[{name:"name",type:"string",multiple:!1,label:"Nom",required:!0},{name:"type",type:"string",multiple:!1,label:"Type",enum:[...fe]},{name:"description",type:"string",multiple:!1,label:"Description",format:"markdown"},{name:"tags",type:"array",multiple:!0,label:"Tags"},{name:"urls",type:"array",multiple:!0,label:"Liens / URLs"},{name:"address",type:"object",multiple:!1,label:"Adresse",format:"address"},{name:"profil_avatar",type:"object",multiple:!1,label:"Logo / image",format:"image"}],events:[{name:"name",type:"string",multiple:!1,label:"Nom de l'événement",required:!0},{name:"type",type:"string",multiple:!1,label:"Type d'événement",enum:[...he]},{name:"public",type:"boolean",multiple:!1,label:"Événement public"},{name:"shortDescription",type:"string",multiple:!1,label:"Description courte"},{name:"url",type:"string",multiple:!1,label:"Site web",format:"url"},{name:"email",type:"string",multiple:!1,label:"Email",format:"email"},{name:"tags",type:"array",multiple:!0,label:"Tags"},{name:"startDate",type:"date",multiple:!1,label:"Date de début"},{name:"endDate",type:"date",multiple:!1,label:"Date de fin"},{name:"openingHours",type:"array",multiple:!1,label:"Horaires d'ouverture",format:"openingHours"},{name:"address",type:"object",multiple:!1,label:"Adresse",format:"address"},{name:"profil_avatar",type:"object",multiple:!1,label:"Logo / image",format:"image"}]};function Te(e){const t=Ae[e];return t?{collection:e,fields:t}:null}const Ee={ApiClient:ApiClient,Api:Api,error:y,reactive:H,effect:N,batch:q,isSignal:z,reactiveObject:U,isReactive:B,computed:$,watch:V,getSignals:G,subscribeTo:K,tokenStorageStrategy:{createDefaultTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new MemoryStorageStrategy;if("localStorage"===e){if("undefined"!=typeof window&&window.localStorage)return new LocalStorageStrategy;throw new Error("localStorage is not available in this environment.")}if("file"===e){if("undefined"!=typeof window&&window.localStorage)throw new Error("file storage is not available in this environment.");const{FileStorageStrategy:e}=await Promise.resolve().then(function(){return Dt});return new e}if("undefined"!=typeof window&&window.localStorage)return new LocalStorageStrategy;const{FileStorageStrategy:t}=await Promise.resolve().then(function(){return Dt});return new t},TokenStorageStrategy:TokenStorageStrategy,createDefaultMultiServerTokenStorageStrategy:async function(e="auto"){if("memory"===e)return new MultiServerMemoryStorageStrategy;if("localStorage"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)return new MultiServerLocalStorageStrategy;throw new Error("localStorage n'est pas disponible dans cet environnement.")}if("file"===e){if("undefined"!=typeof window&&void 0!==window.localStorage)throw new Error("Le stockage fichier n'est pas disponible côté navigateur.");const{MultiServerFileStorageStrategy:e}=await Promise.resolve().then(function(){return Lt});return new e}if("undefined"!=typeof window&&void 0!==window.localStorage)return new MultiServerLocalStorageStrategy;const{MultiServerFileStorageStrategy:t}=await Promise.resolve().then(function(){return Lt});return new t},MultiServerTokenStorageStrategy:MultiServerTokenStorageStrategy},helper:{fromEntityJSON:b,reviveEntities:function e(t,n=null){if(null==t)return t;if("object"!=typeof t)return t;if(t instanceof Date||t instanceof RegExp)return t;if(g(t))return b(t,n);if(Array.isArray(t))return t.map(t=>e(t,n));const i={};for(const[r,o]of Object.entries(t))i[r]=e(o,n);return i},restorePaginationFromJSON:BaseEntity.restorePaginationFromJSON},OfflineClientManager:OfflineClientManager};var Pe=Object.freeze({__proto__:null,default:{slug:"CercleTravailleursSociauxLiberauxLaPlumeSociale",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},info:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"info",path:"info",type:"string"}],presets:{type:"LocalBusiness",role:"admin","preferences[isOpenEdition]":!1,"preferences[isOpenData]":!1},hidden:["role","shortDescription","tags","type"],add:!0,createLabel:null}}}});var ve=Object.freeze({__proto__:null,default:{slug:"FabEn",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"theme",path:"theme"}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Ce=Object.freeze({__proto__:null,default:{slug:"LivingLabInnovationSocialeBraspanon",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"theme",path:"theme"}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Se=Object.freeze({__proto__:null,default:{slug:"alfph",collections:{projects:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"theme",path:"theme",enum:["Valorisation des circuits courts","Lutte contre l'isolement (notamment des personnes fragiles)","Lutte contre l'illettrisme","Echanges de savoirs, entraide, et soutien scolaire","Valorisation et découverte du patrimoine et de l’histoire locale","Créativité artistique","Innovation sociale","Démocratie numérique","Insertion par l'économique","Transition énergétique et écologique"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null},ressources:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality",type:"string"}],presets:{section:"need",category:"service"},hidden:[],add:!0,createLabel:null}}}});var je=Object.freeze({__proto__:null,default:{slug:"campagne",collections:{proposal:{schema:{type:"object",additionalProperties:!0,properties:{devis:{type:"string"},estimationTime:{type:"string"}}},fields:[{name:"devis",path:"devis",type:"string"},{name:"estimationTime",path:"estimationTime",type:"string"}],presets:{tags:"nouvelle idée,co,communecter",voteDateEnd:"31/12/2019 23:59",voteAnonymous:!1,voteCanChange:!0,majority:50,amendementAndVote:!1,amendementActivated:!1,multiChoicecheckboxSimple:!1},hidden:[],add:!0,createLabel:"Proposer un projet, fonctionalité"}}}});var Oe=Object.freeze({__proto__:null,default:{slug:"chtitube",collections:{poi:{schema:{type:"object",additionalProperties:!0,properties:{sectionBtn:{type:"string"}}},fields:[{name:"sectionBtn",path:"sectionBtn",type:"string"}],presets:{},hidden:["parent"],add:!0,createLabel:null}}}});var Ie=Object.freeze({__proto__:null,default:{slug:"circuitCourt",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{phone:{type:"number"}}},fields:[{name:"phone",path:"phone",type:"number"}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Le=Object.freeze({__proto__:null,default:{slug:"cmcasHauteBretagne",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{phone:{type:"string"}}},fields:[{name:"phone",path:"phone",type:"string"}],presets:{},hidden:["parent"],add:!0,createLabel:null}}}});var De=Object.freeze({__proto__:null,default:{slug:"coFinancementTierslieux",collections:{crowdfunding:{schema:{type:"object",additionalProperties:!0,properties:{donationLink:{type:"string"},invoiceAddress:{type:"string"},invoiceName:{type:"string"},invoiceSiret:{type:"string"},linkToCommon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},orgaName:{type:"string"},priority:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},similarLink:{type:"string"}}},fields:[{name:"donationLink",path:"donationLink",type:"string"},{name:"invoiceAddress",path:"invoiceAddress",type:"string"},{name:"invoiceName",path:"invoiceName",type:"string"},{name:"invoiceSiret",path:"invoiceSiret",type:"string"},{name:"linkToCommon",path:"linkToCommon"},{name:"orgaName",path:"orgaName",type:"string"},{name:"priority",path:"priority"},{name:"similarLink",path:"similarLink",type:"string"}],presets:{type:"campaign"},hidden:[],add:!1,createLabel:"Campagne"},projects:{schema:{type:"object",additionalProperties:!0,properties:{"preferences[crowdfunding]":{type:"string"}}},fields:[{name:"preferences[crowdfunding]",path:"preferences[crowdfunding]",type:"string"}],presets:{},hidden:[],add:!0,createLabel:"Commun"}}}});var xe=Object.freeze({__proto__:null,default:{slug:"coeurNumerique",collections:{badges:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"object",additionalProperties:!0}}},fields:[{name:"info",path:"info",type:"object"}],presets:{tags:{value:"",forced:!0}},hidden:["color","icon","tags"],add:!1,createLabel:null}}}});var ke=Object.freeze({__proto__:null,default:{slug:"communLundi",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{animator:{type:"object",additionalProperties:!0},common:{type:"object",additionalProperties:!0},documentation:{type:"string"},pattern:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"animator",path:"animator",type:"object"},{name:"common",path:"common",type:"object"},{name:"documentation",path:"documentation",type:"string"},{name:"pattern",path:"pattern",enum:["Aucun"]}],presets:{},hidden:["parent","public","recurrency","tags"],add:!0,createLabel:null}}}});var Me=Object.freeze({__proto__:null,default:{slug:"cressReunion",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{expectedAttendees:{type:"number"},format:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},isPaying:{type:"boolean"},lowMobilityAccess:{type:"boolean"},mailReminder:{type:"array",items:{type:"string"}},monthEss:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},registrationRequired:{type:"boolean"},tergetPublic:{type:"array",items:{type:"string"}},thematicWeek:{type:"string"},theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"expectedAttendees",path:"expectedAttendees",type:"number"},{name:"format",path:"format",enum:["Physique","En ligne (Webinaire, webcast, etc)","Les deux, présentiel et distanciel"]},{name:"isPaying",path:"isPaying",type:"boolean"},{name:"lowMobilityAccess",path:"lowMobilityAccess",type:"boolean"},{name:"mailReminder",path:"mailReminder",type:"array"},{name:"monthEss",path:"monthEss",enum:["Oui","Non"]},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"},{name:"registrationRequired",path:"registrationRequired",type:"boolean"},{name:"tergetPublic",path:"tergetPublic",type:"array"},{name:"thematicWeek",path:"thematicWeek",type:"string"},{name:"theme",path:"theme",enum:["économie circulaire","silver économie","agriculture / agroalimentaire","batiment","énergies renouvelables","digital numérique","Médico social","Santé","Ecoconstruction","REP","IAE","Textile","logistqiue","textiles"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null},organizations:{schema:{type:"object",additionalProperties:!0,properties:{ambassadeurFirstName:{type:"string"},ambassadeurFonction:{type:"string"},ambassadeurMail:{type:"string"},ambassadeurName:{type:"string"},ambassadeurTel:{type:"number"},apet700:{type:"string"},arrondissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},famille:{type:"string"},interco:{type:"string"},"preferences[isOpenEdition]":{type:"string"},secteurEntreprise:{type:"string"},secteurEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},typeEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},waldec:{type:"string"}}},fields:[{name:"ambassadeurFirstName",path:"ambassadeurFirstName",type:"string"},{name:"ambassadeurFonction",path:"ambassadeurFonction",type:"string"},{name:"ambassadeurMail",path:"ambassadeurMail",type:"string"},{name:"ambassadeurName",path:"ambassadeurName",type:"string"},{name:"ambassadeurTel",path:"ambassadeurTel",type:"number"},{name:"apet700",path:"apet700",type:"string"},{name:"arrondissement",path:"arrondissement",enum:["NORD","OUEST","SUD","EST"]},{name:"famille",path:"famille",type:"string"},{name:"interco",path:"interco",type:"string"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"},{name:"secteurEntreprise",path:"secteurEntreprise",type:"string"},{name:"secteurEtablissement",path:"secteurEtablissement",enum:["Institution","Autres intermédiations monétaires","Comm. de gros céréales, tabac non manuf. et aliments pour bétail","Hébergement touristique et autre hébergement de courte durée","Activités des sièges sociaux","Action sociale sans hébergement n.c.a.","Activité des médecins généralistes","Formation continue d'adultes","Accueil ou accompagnement sans hébergement d'enfants handicapés","Accueil accompagn. sans héberg. adultes handicapés ou pers. âgées","Hébergement social pour handicapés mentaux et malades mentaux","Hébergement médicalisé pour enfants handicapés","Nettoyage courant des bâtiments","Aide par le travail","Héberg. médicalisé adultes handicapés & autre héberg. médicalisé","Hébergement social pour enfants en difficultés","Autres transports routiers de voyageurs","Enseignement supérieur","Autres assurances","Culture et élevage associés","Hébergement social pour adultes, familles en difficultés et autre","Hébergement médicalisé pour personnes âgées","Aut. accueil ou accompgnt sans hébergt d'enfants et adolescents","Aide à domicile","Commerces de détail d'optique","Soins de beauté","Enseignement primaire","Autres enseignements","Activités hospitalières","Activités comptables","Autres organisations fonctionnant par adhésion volontaire","Activités juridiques","Accueil de jeunes enfants","Hébergement social pour handicapés physiques","Transformation et conservation de fruits","Enseignement secondaire technique ou professionnel","Fabrication d'autres vêtements et accessoires","Autres activités de soutien aux entreprises n.c.a.","Services administratifs combinés de bureau","Autres services personnels n.c.a.","Activités des infirmiers et des sages-femmes","Culture de légumes, de melons, de racines et de tubercules","Restauration collective sous contrat","Autres activités liées au sport","Activités de clubs de sports"]},{name:"typeEtablissement",path:"typeEtablissement",enum:["Association non employeuse","Association employeuse","SCOP (société coopérative et participative)","SCIC (société coopérative d'intérêt collectif)","Groupement d'Employeurs","CAE (coopérative d'activités et d'emploi)","Mutuelle","Banque Coopérative","Collectivité territoriale","Fondation","Autre Coopérative","Entreprise de l'ESS"]},{name:"waldec",path:"waldec",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{domain:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},ifPaye:{type:"string"},paye:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},referentName:{type:"string"},referentPhone:{type:"number"},yourAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},zoneActivity:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"domain",path:"domain",enum:["Activité physique","Bien-être","Garde d'enfants","Communication","Divertissement","Formation","Enseignement","Alimentation","Lien social","Services","Services à la personne","Culture - Art - Spectacle","Transport et livraison","Hébergement","Assurance","Épicerie","Santé","Dépannage","Numérique","Administratif","Financier","Environnement","Recyclage"]},{name:"ifPaye",path:"ifPaye",type:"string"},{name:"paye",path:"paye",enum:["Gratuite","Payante"]},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"},{name:"referentName",path:"referentName",type:"string"},{name:"referentPhone",path:"referentPhone",type:"number"},{name:"yourAction",path:"yourAction",enum:["était existante avant COVID 19","à été créée pour répondre à un besoin pendant le COVID 19"]},{name:"zoneActivity",path:"zoneActivity",enum:["Saint-Denis","Saint-Pierre","Bras-Panon","Cilaos","Entre-Deux","La Possession","Le Port","Les Avirons","Les Trois-Bassins","Etang-salé","La Petite île","Le Tampon","La plaine des Palmistes","Salazie","Saint-Leu","Sainte-Marie","Sainte-Rose","Saint-André","Sainte-Suzanne","Saint-philippe","Saint-Louis","Saint-Paul","Saint-Benoît","Saint-Joseph","Sur toute l’île","Régional","National","International"]}],presets:{},hidden:[],add:!0,createLabel:"Ajouter une action"}}}});var Ne=Object.freeze({__proto__:null,default:{slug:"cressReunionNetwork",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{format:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},monthEss:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"format",path:"format",enum:["Physique","En ligne (Webinaire, webcast, etc)","Les deux, présentiel et distanciel"]},{name:"monthEss",path:"monthEss",enum:["Oui","Non"]},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"},{name:"theme",path:"theme",enum:["économie circulaire","silver économie","agriculture / agroalimentaire","batiment","énergies renouvelables","digital numérique","Médico social","Santé","Ecoconstruction","REP","IAE","Textile","logistqiue","textiles"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null},organizations:{schema:{type:"object",additionalProperties:!0,properties:{ambassadeurFirstName:{type:"string"},ambassadeurFonction:{type:"string"},ambassadeurMail:{type:"string"},ambassadeurName:{type:"string"},ambassadeurTel:{type:"number"},apet700:{type:"string"},arrondissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},famille:{type:"string"},interco:{type:"string"},"preferences[isOpenEdition]":{type:"string"},secteurEntreprise:{type:"string"},secteurEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},typeEtablissement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},waldec:{type:"string"}}},fields:[{name:"ambassadeurFirstName",path:"ambassadeurFirstName",type:"string"},{name:"ambassadeurFonction",path:"ambassadeurFonction",type:"string"},{name:"ambassadeurMail",path:"ambassadeurMail",type:"string"},{name:"ambassadeurName",path:"ambassadeurName",type:"string"},{name:"ambassadeurTel",path:"ambassadeurTel",type:"number"},{name:"apet700",path:"apet700",type:"string"},{name:"arrondissement",path:"arrondissement",enum:["NORD","OUEST","SUD","EST"]},{name:"famille",path:"famille",type:"string"},{name:"interco",path:"interco",type:"string"},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"},{name:"secteurEntreprise",path:"secteurEntreprise",type:"string"},{name:"secteurEtablissement",path:"secteurEtablissement",enum:["Autres intermédiations monétaires","Comm. de gros céréales, tabac non manuf. et aliments pour bétail","Hébergement touristique et autre hébergement de courte durée","Activités des sièges sociaux","Action sociale sans hébergement n.c.a.","Activité des médecins généralistes","Formation continue d'adultes","Accueil ou accompagnement sans hébergement d'enfants handicapés","Accueil accompagn. sans héberg. adultes handicapés ou pers. âgées","Hébergement social pour handicapés mentaux et malades mentaux","Hébergement médicalisé pour enfants handicapés","Nettoyage courant des bâtiments","Aide par le travail","Héberg. médicalisé adultes handicapés & autre héberg. médicalisé","Hébergement social pour enfants en difficultés","Autres transports routiers de voyageurs","Enseignement supérieur","Autres assurances","Culture et élevage associés","Hébergement social pour adultes, familles en difficultés et autre","Hébergement médicalisé pour personnes âgées","Aut. accueil ou accompgnt sans hébergt d'enfants et adolescents","Aide à domicile","Commerces de détail d'optique","Soins de beauté","Enseignement primaire","Autres enseignements","Activités hospitalières","Activités comptables","Autres organisations fonctionnant par adhésion volontaire","Activités juridiques","Accueil de jeunes enfants","Hébergement social pour handicapés physiques","Transformation et conservation de fruits","Enseignement secondaire technique ou professionnel","Fabrication d'autres vêtements et accessoires","Autres activités de soutien aux entreprises n.c.a.","Services administratifs combinés de bureau","Autres services personnels n.c.a.","Activités des infirmiers et des sages-femmes","Culture de légumes, de melons, de racines et de tubercules","Restauration collective sous contrat","Autres activités liées au sport","Activités de clubs de sports"]},{name:"typeEtablissement",path:"typeEtablissement",enum:["Association non employeuse","Association employeuse","SCOP (société coopérative et participative)","SCIC (société coopérative d'intérêt collectif)","Groupement d'Employeurs","CAE (coopérative d'activités et d'emploi)","Mutuelle","Banque Coopérative","Fondation","Autre Coopérative","Entreprise de l'ESS"]},{name:"waldec",path:"waldec",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{domain:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},ifPaye:{type:"string"},paye:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},"preferences[isOpenEdition]":{type:"string"},referentName:{type:"string"},referentPhone:{type:"number"},yourAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},zoneActivity:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"domain",path:"domain",enum:["Activité physique","Bien-être","Garde d'enfants","Communication","Divertissement","Formation","Enseignement","Alimentation","Lien social","Services","Services à la personne","Culture - Art - Spectacle","Transport et livraison","Hébergement","Assurance","Épicerie","Santé","Dépannage","Numérique","Administratif","Financier","Environnement","Recyclage"]},{name:"ifPaye",path:"ifPaye",type:"string"},{name:"paye",path:"paye",enum:["Gratuite","Payante"]},{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"},{name:"referentName",path:"referentName",type:"string"},{name:"referentPhone",path:"referentPhone",type:"number"},{name:"yourAction",path:"yourAction",enum:["était existante avant COVID 19","à été créée pour répondre à un besoin pendant le COVID 19"]},{name:"zoneActivity",path:"zoneActivity",enum:["Saint-Denis","Saint-Pierre","Bras-Panon","Cilaos","Entre-Deux","La Possession","Le Port","Les Avirons","Les Trois-Bassins","Etang-salé","La Petite île","Le Tampon","La plaine des Palmistes","Salazie","Saint-Leu","Sainte-Marie","Sainte-Rose","Saint-André","Sainte-Suzanne","Saint-philippe","Saint-Louis","Saint-Paul","Saint-Benoît","Saint-Joseph","Sur toute l’île","Régional","National","International"]}],presets:{},hidden:[],add:!0,createLabel:"Ajouter une action"}}}});var qe=Object.freeze({__proto__:null,default:{slug:"ctenat",collections:{addPhoto:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"string"}}},fields:[{name:"info",path:"info",type:"string"}],presets:{},hidden:[],add:!1,createLabel:null},badges:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"object",additionalProperties:!0}}},fields:[{name:"info",path:"info",type:"object"}],presets:{tags:{value:"",forced:!0}},hidden:["color","icon","tags"],add:!1,createLabel:null},poi:{schema:{type:"object",additionalProperties:!0,properties:{definition:{type:"string"},domainAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},echelleApplication:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},methodeCalcul:{type:"string"},moyenne_nationale:{type:"string"},obj_environnemental:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},obj_operationnel_national:{type:"string"},obj_strategique:{type:"string"},objectifDD:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},originIndicator:{type:"string"},pol_pub:{type:"string"},sourceData1:{type:"string"},typectenat:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},unity1:{type:"string"}}},fields:[{name:"definition",path:"definition",type:"string"},{name:"domainAction",path:"domainAction",enum:["type","category","sourceKey"],multiple:!0},{name:"echelleApplication",path:"echelleApplication",enum:["Echelle de l’action","Echelle du territoire"],multiple:!0},{name:"methodeCalcul",path:"methodeCalcul",type:"string"},{name:"moyenne_nationale",path:"moyenne_nationale",type:"string"},{name:"obj_environnemental",path:"obj_environnemental",enum:["Lutte contre le changement climatique","Adaptation au changement climatique","Gestion de la ressource en eau","Economie circulaire, déchets et prévention des risques technologiques","Lutte contre les pollutions","Biodiversité, protection des espaces naturels, agricoles et forestiers, protection des espèces"]},{name:"obj_operationnel_national",path:"obj_operationnel_national",type:"string"},{name:"obj_strategique",path:"obj_strategique",type:"string"},{name:"objectifDD",path:"objectifDD",enum:["type","category","sourceKey"],multiple:!0},{name:"originIndicator",path:"originIndicator",type:"string"},{name:"pol_pub",path:"pol_pub",type:"string"},{name:"sourceData1",path:"sourceData1",type:"string"},{name:"typectenat",path:"typectenat",enum:["Impact","Résultat","Réalisation"]},{name:"unity1",path:"unity1",type:"string"}],presets:{type:"stand"},hidden:["description","name","parent","tags","urls"],add:!0,createLabel:"Modifier un indicateur"},projects:{schema:{type:"object",additionalProperties:!0,properties:{dispositif:{type:"string"},dispositifId:{type:"string"},filRouge:{type:"string"},formLocality:{type:"string"},nbHabitant:{type:"number"},session:{type:"string"},why:{type:"string"}}},fields:[{name:"dispositif",path:"dispositif",type:"string"},{name:"dispositifId",path:"dispositifId",type:"string"},{name:"filRouge",path:"filRouge",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"nbHabitant",path:"nbHabitant",type:"number"},{name:"session",path:"session",type:"string"},{name:"why",path:"why",type:"string"}],presets:{public:!1,"preferences[isOpenEdition]":!1},hidden:["parent","public","shortDescription","tags","url"],add:!0,createLabel:"Candidater"}}}});var Re=Object.freeze({__proto__:null,default:{slug:"cyberReunion",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:["role","shortDescription","tags","type","url"],add:!0,createLabel:null}}}});var ze=Object.freeze({__proto__:null,default:{slug:"ekisphere",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{place:{type:"string"}}},fields:[{name:"place",path:"place",type:"string"}],presets:{},hidden:[],add:!1,createLabel:null},organizations:{schema:{type:"object",additionalProperties:!0,properties:{extraActivity:{type:"array",items:{type:"string"}},formLocality:{type:"string"},location:{type:"string"},similarLink:{type:"string"},structure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"extraActivity",path:"extraActivity",type:"array"},{name:"formLocality",path:"formLocality",type:"string"},{name:"location",path:"location",type:"string"},{name:"similarLink",path:"similarLink",type:"string"},{name:"structure",path:"structure",enum:["Entreprise","Structures Publiques","Pôles, Clusters & Associations","Recherche","Académique"]}],presets:{},hidden:["email","extraActivity","role","shortDescription","tags","type"],add:!0,createLabel:null},poi:{schema:{type:"object",additionalProperties:!0,properties:{access:{type:"object",additionalProperties:!0},adminEmail:{type:"string"},adminFirstName:{type:"string"},classification:{type:"object",additionalProperties:!0},contentProtectionType:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},contentReusability:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},descriptionSection:{type:"object",additionalProperties:!0},ethicCharte:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},info:{type:"object",additionalProperties:!0},infoGeneral:{type:"object",additionalProperties:!0},isEthicCharte:{type:"boolean"},mainThematic:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},propIntelectuel:{type:"object",additionalProperties:!0},protectionLicenceLink:{type:"string"},toolLevel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},toolType:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"access",path:"access",type:"object"},{name:"adminEmail",path:"adminEmail",type:"string"},{name:"adminFirstName",path:"adminFirstName",type:"string"},{name:"classification",path:"classification",type:"object"},{name:"contentProtectionType",path:"contentProtectionType",enum:["Le contenu est protégé par une licence libre de droit","Le contenu est entré dans le domaine public","Il s'agit du fruit de mon travail personnel","Le contenu n’est pas protégée. Je me réfère aux licences libres de droit afin de protéger et partager le contenu (par exemple les creative commons : lien, GNU : lien, …). Je précise la licence choisie dans le champ ci-après."]},{name:"contentReusability",path:"contentReusability",enum:["L’auteur de l’oeuvre initiale doit obligatoirement être cité en cas d’utilisation de l’oeuvre.","L’oeuvre ne peut pas faire l’objet d’une réutilisation commerciale sans autorisation préalable.","L’oeuvre ne peut être modifiée ou ajoutée à une autre oeuvre préexistante sans autorisation.","L’oeuvre ne peut être partagé sous une autre licence que l’initiale."],multiple:!0},{name:"descriptionSection",path:"descriptionSection",type:"object"},{name:"ethicCharte",path:"ethicCharte",enum:["Sciences des données et société","Sciences des données et individu","Qualité des données et sécurité du système d’information","Transparence","Gouvernance des données dans un cadre de confiance","Réciprocité"],multiple:!0},{name:"info",path:"info",type:"object"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"isEthicCharte",path:"isEthicCharte",type:"boolean"},{name:"mainThematic",path:"mainThematic",enum:["Technique","Ethique","Juridique","Modèles économiques","Gouvernance des données","Transverses"],multiple:!0},{name:"propIntelectuel",path:"propIntelectuel",type:"object"},{name:"protectionLicenceLink",path:"protectionLicenceLink",type:"string"},{name:"toolLevel",path:"toolLevel",enum:["Se sensibiliser","Monter en compétences","Rendre conformes mes projets","Certifier mes projets"],multiple:!0},{name:"toolType",path:"toolType",enum:["Ressources documentaires","Outils"]}],presets:{type:"tool"},hidden:["parent","type"],add:!1,createLabel:null}}}});var Fe=Object.freeze({__proto__:null,default:{slug:"equipementsSportifs974",collections:{poi:{schema:{type:"object",additionalProperties:!0,properties:{aps_name:{type:"array",items:{type:"string"}},categorie:{type:"string"},equip_acc_libre:{type:"boolean"},equip_douche:{type:"boolean"},equip_eclair:{type:"boolean"},equip_gest_type:{type:"string"},equip_larg:{type:"number"},equip_loc_type:{type:"array",items:{type:"string"}},equip_long:{type:"number"},equip_maj_date:{type:"string","x-format":"date"},equip_nature:{type:"string"},equip_pmr_acc:{type:"boolean"},equip_pmr_chem:{type:"boolean"},equip_pmr_douche:{type:"boolean"},equip_pmr_sanit:{type:"boolean"},equip_pmr_trib:{type:"boolean"},equip_pmr_vest:{type:"boolean"},equip_prop_nom:{type:"string"},equip_prop_type:{type:"string"},equip_pshs_aire:{type:"boolean"},equip_pshs_chem:{type:"boolean"},equip_pshs_sanit:{type:"boolean"},equip_pshs_sign:{type:"boolean"},equip_pshs_trib:{type:"boolean"},equip_pshs_vest:{type:"boolean"},equip_sol:{type:"string"},equip_surf:{type:"number"},equip_type_famille:{type:"string"},equip_type_name:{type:"string"},equip_utilisateur:{type:"array",items:{type:"string"}},inst_acc_handi_bool:{type:"boolean"},inst_acc_handi_type:{type:"string"},inst_date_creation:{type:"string","x-format":"date"},inst_enqu_date:{type:"string","x-format":"date"},inst_nom:{type:"string"},inst_part_bool:{type:"boolean"},inst_part_type:{type:"array",items:{type:"string"}},inst_trans_bool:{type:"boolean"},inst_trans_type:{type:"string"}}},fields:[{name:"aps_name",path:"aps_name",type:"array"},{name:"categorie",path:"categorie",type:"string"},{name:"equip_acc_libre",path:"equip_acc_libre",type:"boolean"},{name:"equip_douche",path:"equip_douche",type:"boolean"},{name:"equip_eclair",path:"equip_eclair",type:"boolean"},{name:"equip_gest_type",path:"equip_gest_type",type:"string"},{name:"equip_larg",path:"equip_larg",type:"number"},{name:"equip_loc_type",path:"equip_loc_type",type:"array"},{name:"equip_long",path:"equip_long",type:"number"},{name:"equip_maj_date",path:"equip_maj_date",type:"string",format:"date"},{name:"equip_nature",path:"equip_nature",type:"string"},{name:"equip_pmr_acc",path:"equip_pmr_acc",type:"boolean"},{name:"equip_pmr_chem",path:"equip_pmr_chem",type:"boolean"},{name:"equip_pmr_douche",path:"equip_pmr_douche",type:"boolean"},{name:"equip_pmr_sanit",path:"equip_pmr_sanit",type:"boolean"},{name:"equip_pmr_trib",path:"equip_pmr_trib",type:"boolean"},{name:"equip_pmr_vest",path:"equip_pmr_vest",type:"boolean"},{name:"equip_prop_nom",path:"equip_prop_nom",type:"string"},{name:"equip_prop_type",path:"equip_prop_type",type:"string"},{name:"equip_pshs_aire",path:"equip_pshs_aire",type:"boolean"},{name:"equip_pshs_chem",path:"equip_pshs_chem",type:"boolean"},{name:"equip_pshs_sanit",path:"equip_pshs_sanit",type:"boolean"},{name:"equip_pshs_sign",path:"equip_pshs_sign",type:"boolean"},{name:"equip_pshs_trib",path:"equip_pshs_trib",type:"boolean"},{name:"equip_pshs_vest",path:"equip_pshs_vest",type:"boolean"},{name:"equip_sol",path:"equip_sol",type:"string"},{name:"equip_surf",path:"equip_surf",type:"number"},{name:"equip_type_famille",path:"equip_type_famille",type:"string"},{name:"equip_type_name",path:"equip_type_name",type:"string"},{name:"equip_utilisateur",path:"equip_utilisateur",type:"array"},{name:"inst_acc_handi_bool",path:"inst_acc_handi_bool",type:"boolean"},{name:"inst_acc_handi_type",path:"inst_acc_handi_type",type:"string"},{name:"inst_date_creation",path:"inst_date_creation",type:"string",format:"date"},{name:"inst_enqu_date",path:"inst_enqu_date",type:"string",format:"date"},{name:"inst_nom",path:"inst_nom",type:"string"},{name:"inst_part_bool",path:"inst_part_bool",type:"boolean"},{name:"inst_part_type",path:"inst_part_type",type:"array"},{name:"inst_trans_bool",path:"inst_trans_bool",type:"boolean"},{name:"inst_trans_type",path:"inst_trans_type",type:"string"}],presets:{},hidden:[],add:!1,createLabel:null}}}});var Ue=Object.freeze({__proto__:null,default:{slug:"federationDesCae",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{extraManageModel:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},mainTag:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"}}},fields:[{name:"extraManageModel",path:"extraManageModel",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"holderOrganization",path:"holderOrganization",type:"string"},{name:"location",path:"location",type:"string"},{name:"mainTag",path:"mainTag",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association","Collectif citoyen","Universités / Écoles d’ingénieurs ou de commerce / EPST","Établissements scolaires (Lycée, Collège, Ecole)","Collectivités (Département, Intercommunalité, Région, etc)","SARL-SA-SAS","SCIC","SCOP","Autre mode de gestion"]},{name:"openingDate",path:"openingDate",type:"string"},{name:"photo",path:"photo",type:"object"},{name:"similarLink",path:"similarLink",type:"string"}],presets:{tags:"CAE",role:"admin"},hidden:["role","tags","type"],add:!1,createLabel:null}}}});var Be=Object.freeze({__proto__:null,default:{slug:"formationGenerique",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration",type:"number"},{name:"gatheringDates",path:"gatheringDates",type:"array"},{name:"reportLink",path:"reportLink",type:"string"},{name:"visioDate",path:"visioDate",type:"object"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"],add:!1,createLabel:"Créer une session"},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation",type:"object"},{name:"firstName",path:"firstName",type:"string"},{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence",type:"array"},{name:"documentation",path:"documentation",type:"object"},{name:"partner",path:"partner",type:"object"},{name:"rate",path:"rate",type:"string"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"],add:!1,createLabel:"Créer une formation"}}}});var $e=Object.freeze({__proto__:null,default:{slug:"franceTierslieux",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},compagnon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea",type:"number"},{name:"compagnon",path:"compagnon",enum:["Compagnon France Tiers-Lieux"]},{name:"extraManageModel",path:"extraManageModel",type:"string"},{name:"extraTypePlace",path:"extraTypePlace",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"holderOrganization",path:"holderOrganization",type:"string"},{name:"location",path:"location",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association","Collectif citoyen","Universités / Écoles d’ingénieurs ou de commerce / EPST","Établissements scolaires (Lycée, Collège, Ecole)","Collectivités (Département, Intercommunalité, Région, etc)","SARL-SA-SAS","SCIC","SCOP","Autre mode de gestion"]},{name:"openingDate",path:"openingDate",type:"string"},{name:"photo",path:"photo",type:"object"},{name:"similarLink",path:"similarLink",type:"string"},{name:"siteSurfaceArea",path:"siteSurfaceArea",type:"number"},{name:"typePlace",path:"typePlace",enum:["Ateliers artisanaux partagés","Bureaux partagés / Coworking","Cuisine partagée / Foodlab","Fablab / Makerspace / Hackerspace (Espaces du Faire)","LivingLab / Laboratoire d'innovation sociale","Tiers-lieu nourricier","Tiers-lieu culturel / Lieux intermédiaires et indépendants","Autre famille de tiers-lieux"],multiple:!0}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"],add:!0,createLabel:null}}}});var Ve=Object.freeze({__proto__:null,default:{slug:"hinaura",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Amicale Laïque","BIJ/PIJ","Centre Social","Cyberbase / Cybercentre","Fablab / Hackerspace","Maison de Quartier","Maison des Services","Médiathèque"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{accessibilite:{type:"boolean"},beneficiaire:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},coeffone:{type:"string"},coeffthree:{type:"string"},coefftwo:{type:"string"}}},fields:[{name:"accessibilite",path:"accessibilite",type:"boolean"},{name:"beneficiaire",path:"beneficiaire",enum:["tout public","enfants","adultes","seniors"],multiple:!0},{name:"coeffone",path:"coeffone",type:"string"},{name:"coeffthree",path:"coeffthree",type:"string"},{name:"coefftwo",path:"coefftwo",type:"string"}],presets:{},hidden:[],add:!1,createLabel:"Ajouter un dispositif"}}}});var Ge=Object.freeze({__proto__:null,default:{slug:"hubmayotte",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Ke=Object.freeze({__proto__:null,default:{slug:"hubnouvellecaledonie",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var He=Object.freeze({__proto__:null,default:{slug:"hubpolynesiefrancaise",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Je=Object.freeze({__proto__:null,default:{slug:"hubreunion",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var We=Object.freeze({__proto__:null,default:{slug:"hubterritoires",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Ze=Object.freeze({__proto__:null,default:{slug:"hubwallisetfutuna",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Qe=Object.freeze({__proto__:null,default:{slug:"hva",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{"preferences[isOpenEdition]":{type:"string"}}},fields:[{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"}],presets:{type:"others"},hidden:["parent","public","type"],add:!0,createLabel:null},organizations:{schema:{type:"object",additionalProperties:!0,properties:{"preferences[isOpenEdition]":{type:"string"}}},fields:[{name:"preferences[isOpenEdition]",path:"preferences[isOpenEdition]",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Ye=Object.freeze({__proto__:null,default:{slug:"ibv2",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"location",path:"location",type:"string"},{name:"sextionInfo",path:"sextionInfo",type:"object"},{name:"similarLink",path:"similarLink",type:"object"}],presets:{},hidden:["role","shortDescription","type","url"],add:!0,createLabel:null}}}});var Xe=Object.freeze({__proto__:null,default:{slug:"institutBleu",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"location",path:"location",type:"string"},{name:"sextionInfo",path:"sextionInfo",type:"object"},{name:"similarLink",path:"similarLink",type:"object"}],presets:{},hidden:["role","shortDescription","type","url"],add:!0,createLabel:null}}}});var et=Object.freeze({__proto__:null,default:{slug:"journalInsoumisChambery",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{location:{type:"string"}}},fields:[{name:"location",path:"location",type:"string"}],presets:{},hidden:["email","parent"],add:!1,createLabel:"Créer un évènement"},poi:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0}}},fields:[{name:"documentation",path:"documentation",type:"object"}],presets:{type:"article"},hidden:["type"],add:!1,createLabel:"Ecrire un article"}}}});var tt=Object.freeze({__proto__:null,default:{slug:"kpacite",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},historique:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},socialNetworks:{type:"array",items:{type:"string"}}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"historique",path:"historique",type:"string"},{name:"manageModel",path:"manageModel"},{name:"socialNetworks",path:"socialNetworks",type:"array"}],presets:{mainTag:"TiersLieux"},hidden:["tags"],add:!0,createLabel:null}}}});var nt=Object.freeze({__proto__:null,default:{slug:"laCompagnieDesTierslieux",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"}}},fields:[{name:"duration",path:"duration",type:"number"}],presets:{type:"course",category:"sessionFormation"},hidden:["gatheringDates","parent","recurrency","tags","type","visioDate"],add:!1,createLabel:"Créer une session"},organizations:{schema:{type:"object",additionalProperties:!0,properties:{territorialCercle:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"territorialCercle",path:"territorialCercle",enum:["Cercle Littoral","Cercle Pévèle Douaisis","Cercle Valenciennois-Hainaut-Cambresis","Cercle Avesnois - Thierache","Cercle Bassin Minier du Pas-de-Calais","Cercle MEL","Cercle Aisne","Cercle Oise","Cercle Somme","Cercle Coeur Pas de Calais","Equipe support MEL","Cercle Arrageois","Cercle Audomarois","Cercle Flandres","Cercle Sud-Aisne","Cercle Valenciennes"],multiple:!0}],presets:{},hidden:[],add:!1,createLabel:null},person:{schema:{type:"object",additionalProperties:!0,properties:{actionContributor:{type:"boolean"},addressCie:{type:"object",additionalProperties:!0},adherent:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},attendedTraining:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},emailCie:{type:"string"},expertise:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},falicitationDevice:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},firstName:{type:"string"},formLocality:{type:"string"},functionOtherStructure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},functionThirdPlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},geoCie:{type:"object",additionalProperties:!0},geoPositionCie:{type:"object",additionalProperties:!0},heldAction:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},keyMoment:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},linkedEvent:{type:"string"},linkedThirdPlace:{type:"object",additionalProperties:!0},mentor:{type:"object",additionalProperties:!0},monitoringColdInfo:{type:"string"},monitoringLatestExchange:{type:"string"},monitoringSupportingDocumentation:{type:"array",items:{type:"string"}},monitoringWarmInfo:{type:"string"},networkContributor:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},newsletterSubscription:{type:"boolean"},otherLinkedStructure:{type:"object",additionalProperties:!0},otherThemeLinkedStructure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},otherTypeLinkedStructure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},referentTerritorialCercle:{type:"boolean"},reportingMember:{type:"object",additionalProperties:!0},shortDescriptionCie:{type:"string"},supportCercle:{type:"boolean"},supportedStructures:{type:"object",additionalProperties:!0},tagsCie:{type:"array",items:{type:"string"}},telephoneCie:{type:"number"},territorialCercle:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"actionContributor",path:"actionContributor",type:"boolean"},{name:"addressCie",path:"addressCie",type:"object"},{name:"adherent",path:"adherent",enum:["Adhérent Cie 2021","Adhérent Cie 2022","Adhérent Cie 2023","Adhérent Cie 2024","Adhérent Cie 2025"],multiple:!0},{name:"attendedTraining",path:"attendedTraining",enum:["PTL s1 hdf","PTL s2 hdf","PTL s3 hdf","PTL s4 hdf","PTL s5 hdf","PTL autre région","Formation Foncier & immobilier","Formation numérique & transitions","Master tiers-lieux 2020","Master tiers-lieux 2021","Master tiers-lieux 2022","Master tiers-lieux 2023"],multiple:!0},{name:"emailCie",path:"emailCie",type:"string"},{name:"expertise",path:"expertise",enum:["Foncier & Immobilier","Modèles Economiques","Gouvernance","Modèles coopératifs","Economie circulaire","Mobilités douces","Construction écologique","Projets culturels","Architecture","Communs","Maitrise d'oeuvre","PTCE","Gestion & administration des entreprises","Ressources Humaines","Musée","Gestion des paies","Gestion RH","Comptabilité","Open data","Bases de données","Politiques publiques","Fabrication","Fablab","Economie","Photographie","Communication","Graphisme","Animation de réseau","Evaluation","Recherche","animation de réseau","formation","Transitions","Facilitatrice","Formatrice","dependance","culture","Compostage","RSE","Ecologie","environnement","nouveau domain","Projets européens","design","ecodesign","maker","fabrication","fablab","Cartographie","Urbanisme","Artisanat","Agriculture","Management","Financement"],multiple:!0},{name:"falicitationDevice",path:"falicitationDevice",enum:["FIDESS","Aide Formation Région"],multiple:!0},{name:"firstName",path:"firstName",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"functionOtherStructure",path:"functionOtherStructure",enum:["Pilote et/ou direction","Bénévole","Chargé d'accueil","Chargé d'animation","Chargé de mission","Administrateur","Élu","Agent","Autre fonction"],multiple:!0},{name:"functionThirdPlace",path:"functionThirdPlace",enum:["Pilote et/ou direction","Bénévole","Chargé d'accueil","Chargé d'animation","Chargé de mission","Administrateur","Élu","Agent","Autre fonction"],multiple:!0},{name:"geoCie",path:"geoCie",type:"object"},{name:"geoPositionCie",path:"geoPositionCie",type:"object"},{name:"heldAction",path:"heldAction",enum:["Formation","Communication","Orientation","Foncier","AAP Carsat","Le Grand Tour des Tiers-Lieux","Meet up","Meet up","Precious Plastique"],multiple:!0},{name:"keyMoment",path:"keyMoment",enum:["Meet up","Apéro","Temps réseau FEDER","ECDTL 2024","AG 2024","ECDTL 2020","ECDTL 2021","ECDTL 2022","ECDTL 2023","Sur le pont février 2025"],multiple:!0},{name:"linkedEvent",path:"linkedEvent",type:"string"},{name:"linkedThirdPlace",path:"linkedThirdPlace",type:"object"},{name:"mentor",path:"mentor",type:"object"},{name:"monitoringColdInfo",path:"monitoringColdInfo",type:"string"},{name:"monitoringLatestExchange",path:"monitoringLatestExchange",type:"string"},{name:"monitoringSupportingDocumentation",path:"monitoringSupportingDocumentation",type:"array"},{name:"monitoringWarmInfo",path:"monitoringWarmInfo",type:"string"},{name:"networkContributor",path:"networkContributor",enum:["Actif","En sommeil","Potentiel"],multiple:!0},{name:"newsletterSubscription",path:"newsletterSubscription",type:"boolean"},{name:"otherLinkedStructure",path:"otherLinkedStructure",type:"object"},{name:"otherThemeLinkedStructure",path:"otherThemeLinkedStructure",enum:["Médiation / Education Populaire / Social","Café solidaire","Culture","Développement durable","Accompagnement de projet","Fablab","Bureaux partagés / Coworking","ateliers partagés","Alimentation","Habitat","Fabrication","Textile","Tourisme","Médiation numérique","Handicap","Enfance","En projet","Médico-social","Autre thématique"],multiple:!0},{name:"otherTypeLinkedStructure",path:"otherTypeLinkedStructure",enum:["Collectif citoyen","Agence Publique","Association","Entreprise","SARL-SA-SAS","SCIC","SCOP","CAE","Réseau de TL","Autre réseau","Association","Particulier/individu","Universités / Écoles d’ingénieurs ou de commerce / EPST","Établissements scolaires (Lycée, Collège, Ecole)","Collectivités (Département, Intercommunalité, Région, etc)","Autre type"],multiple:!0},{name:"referentTerritorialCercle",path:"referentTerritorialCercle",type:"boolean"},{name:"reportingMember",path:"reportingMember",type:"object"},{name:"shortDescriptionCie",path:"shortDescriptionCie",type:"string"},{name:"supportCercle",path:"supportCercle",type:"boolean"},{name:"supportedStructures",path:"supportedStructures",type:"object"},{name:"tagsCie",path:"tagsCie",type:"array"},{name:"telephoneCie",path:"telephoneCie",type:"number"},{name:"territorialCercle",path:"territorialCercle",enum:["Cercle Littoral","Cercle Pévèle Douaisis","Cercle Valenciennois-Hainaut-Cambresis","Cercle Avesnois - Thierache","Cercle Bassin Minier du Pas-de-Calais","Cercle MEL","Cercle Aisne","Cercle Oise","Cercle Somme","Cercle Coeur Pas de Calais","Equipe support MEL","Cercle Arrageois","Cercle Audomarois","Cercle Flandres","Cercle Sud-Aisne","Cercle Valenciennes"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},partner:{type:"object",additionalProperties:!0},rate:{type:"number"}}},fields:[{name:"competence",path:"competence",enum:["Suivi et gestion FEDER","Comptabilité","Gestion des paies","Recrutement","Gestion RH","Qualiopi","Graphisme","Developpement web","Hébergement web","Permaculture","Open data","Photographie","Conception Rédaction","Architecte","Facilitation","Médiation et gestion de crise","Restauration collective"],multiple:!0},{name:"partner",path:"partner",type:"object"},{name:"rate",path:"rate",type:"number"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags"],add:!1,createLabel:"Créer une formation"}}}});var it=Object.freeze({__proto__:null,default:{slug:"laMaisonDesFaiseurs",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"location",path:"location",type:"string"},{name:"sextionInfo",path:"sextionInfo",type:"object"},{name:"similarLink",path:"similarLink",type:"object"}],presets:{},hidden:["role","shortDescription","type","url"],add:!0,createLabel:null}}}});var rt=Object.freeze({__proto__:null,default:{slug:"laReunionPourUnNumeriqueInclusif",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var ot=Object.freeze({__proto__:null,default:{slug:"laSemaineDesTierslieux",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},maximumAttendees:{type:"number"},organizerName:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"maximumAttendees",path:"maximumAttendees",type:"number"},{name:"organizerName",path:"organizerName",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null}}}});var at=Object.freeze({__proto__:null,default:{slug:"labEnCommuns",collections:{projects:{schema:{type:"object",additionalProperties:!0,properties:{commons:{type:"object",additionalProperties:!0},formLocality:{type:"string"}}},fields:[{name:"commons",path:"commons",type:"object"},{name:"formLocality",path:"formLocality",type:"string"}],presets:{category:"common"},hidden:["public"],add:!0,createLabel:"Ajouter une recherche-action"}}}});var st=Object.freeze({__proto__:null,default:{slug:"lakou",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},extraActivity:{type:"array",items:{type:"string"}},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string","x-format":"date"},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},structure:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea",type:"number"},{name:"extraActivity",path:"extraActivity",type:"array"},{name:"extraManageModel",path:"extraManageModel",type:"string"},{name:"extraTypePlace",path:"extraTypePlace",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"holderOrganization",path:"holderOrganization",type:"string"},{name:"location",path:"location",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association","Collectif citoyen","Universités / Écoles d’ingénieurs ou de commerce / EPST","Établissements scolaires (Lycée, Collège, Ecole)","Collectivités (Département, Intercommunalité, Région, etc)","SARL-SA-SAS","SCIC","SCOP","Autre mode de gestion"]},{name:"openingDate",path:"openingDate",type:"string",format:"date"},{name:"similarLink",path:"similarLink",type:"string"},{name:"siteSurfaceArea",path:"siteSurfaceArea",type:"number"},{name:"structure",path:"structure",enum:["Entreprise","Structure Publique","Pôle, Cluster & Association","Recherche","Académique"]},{name:"typePlace",path:"typePlace",enum:["Ateliers artisanaux partagés","Bureaux partagés / Coworking","Cuisine partagée / Foodlab","Fablab / Makerspace / Hackerspace (Espaces du Faire)","LivingLab / Laboratoire d'innovation sociale","Tiers-lieu nourricier","Tiers-lieu culturel / Lieux intermédiaires et indépendants","Autre famille de tiers-lieux"],multiple:!0}],presets:{role:"admin",mainTag:"TiersLieux"},hidden:["email","extraActivity","role","shortDescription","tags","type"],add:!0,createLabel:null},poi:{schema:{type:"object",additionalProperties:!0,properties:{access:{type:"object",additionalProperties:!0},adminEmail:{type:"string"},adminFirstName:{type:"string"},classification:{type:"object",additionalProperties:!0},descriptionSection:{type:"object",additionalProperties:!0},info:{type:"object",additionalProperties:!0},infoGeneral:{type:"object",additionalProperties:!0},toolLevel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},toolType:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"access",path:"access",type:"object"},{name:"adminEmail",path:"adminEmail",type:"string"},{name:"adminFirstName",path:"adminFirstName",type:"string"},{name:"classification",path:"classification",type:"object"},{name:"descriptionSection",path:"descriptionSection",type:"object"},{name:"info",path:"info",type:"object"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"toolLevel",path:"toolLevel",enum:["Se sensibiliser (+)","Monter en compétences (++)","Devenir expert (+++)"],multiple:!0},{name:"toolType",path:"toolType",enum:["Outils","Ressources documentaires"]}],presets:{type:"tool"},hidden:["parent","type"],add:!1,createLabel:null}}}});var pt=Object.freeze({__proto__:null,default:{slug:"lesCommunsDesTierslieux",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},compagnon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea",type:"number"},{name:"compagnon",path:"compagnon"},{name:"extraManageModel",path:"extraManageModel",type:"string"},{name:"extraTypePlace",path:"extraTypePlace",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"holderOrganization",path:"holderOrganization",type:"string"},{name:"location",path:"location",type:"string"},{name:"manageModel",path:"manageModel"},{name:"openingDate",path:"openingDate",type:"string"},{name:"photo",path:"photo",type:"object"},{name:"similarLink",path:"similarLink",type:"string"},{name:"siteSurfaceArea",path:"siteSurfaceArea",type:"number"},{name:"typePlace",path:"typePlace"}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"],add:!1,createLabel:null}}}});var ct=Object.freeze({__proto__:null,default:{slug:"mayottePourUnNumeriqueInclusif",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var lt=Object.freeze({__proto__:null,default:{slug:"meir",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:["role","shortDescription","tags","type","url"],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"}}},fields:[{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:["shortDescription","url"],add:!0,createLabel:null}}}});var mt=Object.freeze({__proto__:null,default:{slug:"navigatorDesTierslieux",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},extraManageModel:{type:"string"},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea",type:"number"},{name:"extraManageModel",path:"extraManageModel",type:"string"},{name:"extraTypePlace",path:"extraTypePlace",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"holderOrganization",path:"holderOrganization",type:"string"},{name:"location",path:"location",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association","Collectif citoyen","Universités / Écoles d’ingénieurs ou de commerce / EPST","Établissements scolaires (Lycée, Collège, Ecole)","Collectivités (Département, Intercommunalité, Région, etc)","SARL-SA-SAS","SCIC","SCOP","Autre mode de gestion"]},{name:"openingDate",path:"openingDate",type:"string"},{name:"photo",path:"photo",type:"object"},{name:"similarLink",path:"similarLink",type:"string"},{name:"siteSurfaceArea",path:"siteSurfaceArea",type:"number"},{name:"typePlace",path:"typePlace",enum:["Ateliers artisanaux partagés","Bureaux partagés / Coworking","Cuisine partagée / Foodlab","Fablab / Makerspace / Hackerspace (Espaces du Faire)","LivingLab / Laboratoire d’innovation sociale","Tiers-lieu nourricier","Tiers-lieu culturel / Lieux intermédiaires et indépendants","Autre famille de tiers-lieux"],multiple:!0}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"],add:!0,createLabel:"Créer votre tiers-lieux"}}}});var dt=Object.freeze({__proto__:null,default:{slug:"notragora",collections:{badges:{schema:{type:"object",additionalProperties:!0,properties:{producors:{type:"object",additionalProperties:!0},supports:{type:"object",additionalProperties:!0}}},fields:[{name:"producors",path:"producors",type:"object"},{name:"supports",path:"supports",type:"object"}],presets:{},hidden:["parent","tags"],add:!1,createLabel:"Ajouter une collection"},poi:{schema:{type:"object",additionalProperties:!0,properties:{carousel:{type:"boolean"},tags1:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},tags2:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},year:{type:"number"}}},fields:[{name:"carousel",path:"carousel",type:"boolean"},{name:"tags1",path:"tags1",enum:["type","category","sourceKey","typeList"],multiple:!0},{name:"tags2",path:"tags2",enum:["type","category","sourceKey","typeList"],multiple:!0},{name:"year",path:"year",type:"number"}],presets:{type:"video"},hidden:["parent","urls"],add:!1,createLabel:"Ajouter une production"}}}});var ut=Object.freeze({__proto__:null,default:{slug:"nouvellecaledoniePourUnNumeriqueInclusif",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var yt=Object.freeze({__proto__:null,default:{slug:"openAtlas",collections:{crowdfunding:{schema:{type:"object",additionalProperties:!0,properties:{associate:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},invoiceAddress:{type:"string"},invoiceName:{type:"string"},invoiceSiret:{type:"string"},orgaName:{type:"string"},similarLink:{type:"string"}}},fields:[{name:"associate",path:"associate",enum:["Acteurs producteurs","Bénéficiaires"]},{name:"invoiceAddress",path:"invoiceAddress",type:"string"},{name:"invoiceName",path:"invoiceName",type:"string"},{name:"invoiceSiret",path:"invoiceSiret",type:"string"},{name:"orgaName",path:"orgaName",type:"string"},{name:"similarLink",path:"similarLink",type:"string"}],presets:{type:"pledge"},hidden:["donationLink"],add:!0,createLabel:"Campagne"}}}});var ht=Object.freeze({__proto__:null,default:{slug:"polynesieFrancaisePourUnNumeriqueInclusif",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var ft=Object.freeze({__proto__:null,default:{slug:"prdr",collections:{badges:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"object",additionalProperties:!0}}},fields:[{name:"info",path:"info",type:"object"}],presets:{tags:{value:"",forced:!0},category:"domainAction"},hidden:["category","color","icon","tags"],add:!1,createLabel:null}}}});var gt=Object.freeze({__proto__:null,default:{slug:"reseauTierslieux",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{buildingSurfaceArea:{type:"number"},compagnon:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},extraManageModel:{type:"string"},extraTags:{type:"array",items:{type:"string"}},extraTypePlace:{type:"string"},formLocality:{type:"string"},holderOrganization:{type:"string"},location:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},openingDate:{type:"string","x-format":"date"},photo:{type:"object",additionalProperties:!0},similarLink:{type:"string"},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"buildingSurfaceArea",path:"buildingSurfaceArea",type:"number"},{name:"compagnon",path:"compagnon",enum:["Compagnon France Tiers-Lieux"]},{name:"extraManageModel",path:"extraManageModel",type:"string"},{name:"extraTags",path:"extraTags",type:"array"},{name:"extraTypePlace",path:"extraTypePlace",type:"string"},{name:"formLocality",path:"formLocality",type:"string"},{name:"holderOrganization",path:"holderOrganization",type:"string"},{name:"location",path:"location",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association","Collectif citoyen","Universités / Écoles d’ingénieurs ou de commerce / EPST","Établissements scolaires (Lycée, Collège, Ecole)","Collectivités (Département, Intercommunalité, Région, etc)","SARL-SA-SAS","SCIC","SCOP","Autre mode de gestion"]},{name:"openingDate",path:"openingDate",type:"string",format:"date"},{name:"photo",path:"photo",type:"object"},{name:"similarLink",path:"similarLink",type:"string"},{name:"siteSurfaceArea",path:"siteSurfaceArea",type:"number"},{name:"typePlace",path:"typePlace",enum:["Ateliers artisanaux partagés","Bureaux partagés / Coworking","Cuisine partagée / Foodlab","Fablab / Makerspace / Hackerspace (Espaces du Faire)","LivingLab / Laboratoire d'innovation sociale","Tiers-lieu nourricier","Tiers-lieu culturel / Lieux intermédiaires et indépendants","Autre famille de tiers-lieux"],multiple:!0}],presets:{mainTag:"TiersLieux",role:"admin"},hidden:["role","tags","type"],add:!0,createLabel:null}}}});var bt=Object.freeze({__proto__:null,default:{slug:"rfflabs",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{allNetwork:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},formLocality:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"allNetwork",path:"allNetwork",enum:["RFFLabs","Fab&Co","FabCity","LabFab (Rennes métropole)","RedLab (Occitanie)","A+ C'est Mieux","Actes‐IF","Artfactories/Autresparts","Bienvenue dans la Canopée","Cap Tiers‐Lieux","Cédille Pro","Collectif des Tiers‐Lieux Ile‐de‐France","Collectif Hybrides","Compagnie des Tiers‐Lieux","Coopérative des Tiers‐Lieux","Coordination Nationale des Lieux Intermédiaires et Indépendants (CNLII)","Cowork'in Tarn","Coworking Grand Lyon","CRLII Occitanie","GIP Recia","Hub France Connectée","L'ALIM (l'Assemblée des lieux intermédiaires marseillais)","La Trame 07","Label Tiers‐Lieux Occitanie","Label C3","Label Tiers‐Lieux Normandie","Labenbib","Labs en milieux éducatifs","Le DOG","Le LIEN","Lieux Intermédiaires en région Centre","Réseau des tiers‐lieux Bourgogne Franche Comté","Réseau Médoc","Réseau TELA","Tiers‐Lieux Edu"],multiple:!0},{name:"formLocality",path:"formLocality",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association","Collectif citoyen","SARL-SA-SAS","SCIC-SCOP","Société Publique Locale","Pôle d'Equilibre Territorial Rural","Département","Région","Groupement d'Intérêt Public","Intercommunalité","Université","Collège","Lycée"]}],presets:{mainTag:"TiersLieux",typePlace:["Fablab / Atelier de Fabrication Numérique"]},hidden:["fablabNetwork","tags","thirdPlaceNetwork"],add:!0,createLabel:null}}}});var _t=Object.freeze({__proto__:null,default:{slug:"ries",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{theme:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"theme",path:"theme",enum:["Agricoltura | Alimentazione","Produzione e servizi","Educazione","Abitare","Risparmio e finanza","Salute","Energie e nuove tecnologie","Cittadinanza","Viaggi e ospitalità"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var wt=Object.freeze({__proto__:null,default:{slug:"siteDuPactePourLaTransition",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"string"},localMembers:{type:"string"},nextEvents:{type:"string"},publicMail:{type:"string"},referentMail:{type:"string"}}},fields:[{name:"info",path:"info",type:"string"},{name:"localMembers",path:"localMembers",type:"string"},{name:"nextEvents",path:"nextEvents",type:"string"},{name:"publicMail",path:"publicMail",type:"string"},{name:"referentMail",path:"referentMail",type:"string"}],presets:{type:"Group",role:"creator",public:!1,"preferences[isOpenEdition]":!1,"preferences[isOpenData]":!1},hidden:["description","email","role","shortDescription","tags","type","url"],add:!1,createLabel:"Ecrire un article"},poi:{schema:{type:"object",additionalProperties:!0,properties:{commentEngagement:{type:"string"},compteRendu:{type:"object",additionalProperties:!0},contractPdf:{type:"object",additionalProperties:!0},documentation:{type:"object",additionalProperties:!0},info:{type:"string"},localMeasures:{type:"array",items:{type:"string"}},signedOn:{type:"string","x-format":"date"}}},fields:[{name:"commentEngagement",path:"commentEngagement",type:"string"},{name:"compteRendu",path:"compteRendu",type:"object"},{name:"contractPdf",path:"contractPdf",type:"object"},{name:"documentation",path:"documentation",type:"object"},{name:"info",path:"info",type:"string"},{name:"localMeasures",path:"localMeasures",type:"array"},{name:"signedOn",path:"signedOn",type:"string",format:"date"}],presets:{type:"doc",public:!1,"preferences[isOpenEdition]":!1,"preferences[isOpenData]":!1},hidden:["parent","tags","type","urls"],add:!1,createLabel:"Ecrire un article"}}}});var At=Object.freeze({__proto__:null,default:{slug:"sportSanteBienetre",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration",type:"number"},{name:"gatheringDates",path:"gatheringDates",type:"array"},{name:"visioDate",path:"visioDate",type:"object"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"],add:!1,createLabel:"Créer une session"},organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},sextionInfoRepresentant:{type:"object",additionalProperties:!0},sextionInfoResponsable:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"location",path:"location",type:"string"},{name:"sextionInfo",path:"sextionInfo",type:"object"},{name:"sextionInfoRepresentant",path:"sextionInfoRepresentant",type:"object"},{name:"sextionInfoResponsable",path:"sextionInfoResponsable",type:"object"},{name:"similarLink",path:"similarLink",type:"object"}],presets:{type:"NGO",role:"admin"},hidden:["role","shortDescription","tags","type","url"],add:!0,createLabel:"Créer un Maisons Sport Santé"},poi:{schema:{type:"object",additionalProperties:!0,properties:{dateCreation:{type:"string","x-format":"date"},eclairage:{type:"boolean"},entrepriseFonciere:{type:"string"},familleEquipement:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},gardiennage:{type:"boolean"},handicap:{type:"boolean"},hebergement:{type:"boolean"},installation:{type:"string"},libreAccess:{type:"boolean"},nature:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},partenariat:{type:"boolean"},restaurant:{type:"boolean"},sole:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},sportPratiquer:{type:"string"},subCategory:{type:"string"},surface:{type:"string"},transportCommun:{type:"boolean"},typeAccessiblHandicap:{type:"string"},typePartenariat:{type:"string"},typeTransportCommun:{type:"string"}}},fields:[{name:"dateCreation",path:"dateCreation",type:"string",format:"date"},{name:"eclairage",path:"eclairage",type:"boolean"},{name:"entrepriseFonciere",path:"entrepriseFonciere",type:"string"},{name:"familleEquipement",path:"familleEquipement",enum:["Multisports/City-stades","Terrain extérieur de petits jeux collectifs","Terrain de grands jeux","Salle non spécialisée","Equipement d'activités de forme et de santé","Salle multisports","Boulodrome","Equipement d'athlétisme","Site d'activités aquatiques et nautiques","Court de tennis","Bassin de natation","Divers équipements Sports de nature","Salle de combat","Parcours sportif/santé","Structure Artificielle d'Escalade","Equipement équestre","Salle ou terrain spécialisé","Mur et fronton","Site d'activités aériennes","Circuit/piste de sports mécaniques","Equipement de cyclisme","Pas de tir","Site de modélisme","Skatepark & vélo Freestyle","Parcours de golf","Divers équipements","Bowling"]},{name:"gardiennage",path:"gardiennage",type:"boolean"},{name:"handicap",path:"handicap",type:"boolean"},{name:"hebergement",path:"hebergement",type:"boolean"},{name:"installation",path:"installation",type:"string"},{name:"libreAccess",path:"libreAccess",type:"boolean"},{name:"nature",path:"nature",enum:["Découvert","Intérieur","Site naturel","Site naturel aménagé","Site artificiel","Découvrable","Non précisé","Extérieur couvert"]},{name:"partenariat",path:"partenariat",type:"boolean"},{name:"restaurant",path:"restaurant",type:"boolean"},{name:"sole",path:"sole",enum:["Synthétique (hors gazon)","Bitume","Gazon naturel","Carrelage","Stabilisé/cendrée","Gazon synthétique","Béton","Surface naturelle","Terre battue","Sable","Parquet","Non précisé","Autre","Bois","Synthétique"]},{name:"sportPratiquer",path:"sportPratiquer",type:"string"},{name:"subCategory",path:"subCategory",type:"string"},{name:"surface",path:"surface",type:"string"},{name:"transportCommun",path:"transportCommun",type:"boolean"},{name:"typeAccessiblHandicap",path:"typeAccessiblHandicap",type:"string"},{name:"typePartenariat",path:"typePartenariat",type:"string"},{name:"typeTransportCommun",path:"typeTransportCommun",type:"string"}],presets:{type:"recoveryCenter"},hidden:["parent","tags","urls"],add:!1,createLabel:"Créer une actualité"},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence",type:"array"},{name:"documentation",path:"documentation",type:"object"},{name:"partner",path:"partner",type:"object"},{name:"rate",path:"rate",type:"string"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"],add:!1,createLabel:"Créer une formation"}}}});var Tt=Object.freeze({__proto__:null,default:{slug:"suppa",collections:{classifieds:{schema:{type:"object",additionalProperties:!0,properties:{info:{type:"string"}}},fields:[{name:"info",path:"info",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null}}}});var Et=Object.freeze({__proto__:null,default:{slug:"terramies",collections:{poi:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0}}},fields:[{name:"documentation",path:"documentation",type:"object"}],presets:{type:"atelier"},hidden:["urls"],add:!0,createLabel:"Créer une mesure"}}}});var Pt=Object.freeze({__proto__:null,default:{slug:"testeTplFormation",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration",type:"number"},{name:"gatheringDates",path:"gatheringDates",type:"array"},{name:"reportLink",path:"reportLink",type:"string"},{name:"visioDate",path:"visioDate",type:"object"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"],add:!1,createLabel:"Créer une session"},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation",type:"object"},{name:"firstName",path:"firstName",type:"string"},{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence",type:"array"},{name:"documentation",path:"documentation",type:"object"},{name:"partner",path:"partner",type:"object"},{name:"rate",path:"rate",type:"string"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"],add:!1,createLabel:"Créer une formation"}}}});var vt=Object.freeze({__proto__:null,default:{slug:"tierslieuxbelgique",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{accessibiliteSection:{type:"object",additionalProperties:!0},accessibiliteTitle:{type:"object",additionalProperties:!0},anniversaryDate:{type:"string"},buildingSurfaceArea:{type:"number"},caracteristicSection:{type:"object",additionalProperties:!0},commonTransportsAccess:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},enjeux:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},formLocality:{type:"string"},infoCostum:{type:"object",additionalProperties:!0},infoGeneral:{type:"object",additionalProperties:!0},landController:{type:"string"},location:{type:"string"},logoAndPhotosSection:{type:"object",additionalProperties:!0},mainPartners:{type:"string"},manageModel:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},manageModelHow:{type:"string"},networks:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},otherAccess:{type:"string"},personnesAccessPMR:{type:"boolean"},phone:{type:"string"},photo:{type:"object",additionalProperties:!0},plan:{type:"object",additionalProperties:!0},raisonAndTagLine:{type:"string"},referentEmail:{type:"string"},referentPersonFirstName:{type:"string"},referentPersonName:{type:"string"},referentPorterName:{type:"string"},referentSection:{type:"object",additionalProperties:!0},referentTelephone:{type:"string"},siteEnvironment:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},siteSurfaceArea:{type:"number"},typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},vehiculesAccess:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"accessibiliteSection",path:"accessibiliteSection",type:"object"},{name:"accessibiliteTitle",path:"accessibiliteTitle",type:"object"},{name:"anniversaryDate",path:"anniversaryDate",type:"string"},{name:"buildingSurfaceArea",path:"buildingSurfaceArea",type:"number"},{name:"caracteristicSection",path:"caracteristicSection",type:"object"},{name:"commonTransportsAccess",path:"commonTransportsAccess",enum:["Bus","Train","Covoiturage","Mobilité douce"],multiple:!0},{name:"enjeux",path:"enjeux",enum:["Santé","Alimentation","Social","Politique","Agriculture","Écologique","Économique","Éducatifs","Culturels","Habitat"],multiple:!0},{name:"formLocality",path:"formLocality",type:"string"},{name:"infoCostum",path:"infoCostum",type:"object"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"landController",path:"landController",type:"string"},{name:"location",path:"location",type:"string"},{name:"logoAndPhotosSection",path:"logoAndPhotosSection",type:"object"},{name:"mainPartners",path:"mainPartners",type:"string"},{name:"manageModel",path:"manageModel",enum:["Association sans but lucratif (associatif formel)","Association de fait / Collectif citoyen (associatif)","Université / Haute-École / Écoles","Institutionnel (communes, Intercommunales, province, CPAS, ONE, autres)","Privé (entreprise)","Coopérative","Fondation","Co-propriété (individus)","Puzzle entrepreneurial"]},{name:"manageModelHow",path:"manageModelHow",type:"string"},{name:"networks",path:"networks",enum:["Trois-Tiers","23 tiers-lieux ruraux soutenus par Plan de Relance de la Wallonie","Global Ecovillage Network (BelgEco en Belgique)","Comptoir des Ressources Créatives (CRC)","Wallonie Entreprendre","Communa","Réseau Transition","Réseau des hubs créatifs","Créatifs culturels"],multiple:!0},{name:"otherAccess",path:"otherAccess",type:"string"},{name:"personnesAccessPMR",path:"personnesAccessPMR",type:"boolean"},{name:"phone",path:"phone",type:"string"},{name:"photo",path:"photo",type:"object"},{name:"plan",path:"plan",type:"object"},{name:"raisonAndTagLine",path:"raisonAndTagLine",type:"string"},{name:"referentEmail",path:"referentEmail",type:"string"},{name:"referentPersonFirstName",path:"referentPersonFirstName",type:"string"},{name:"referentPersonName",path:"referentPersonName",type:"string"},{name:"referentPorterName",path:"referentPorterName",type:"string"},{name:"referentSection",path:"referentSection",type:"object"},{name:"referentTelephone",path:"referentTelephone",type:"string"},{name:"siteEnvironment",path:"siteEnvironment",enum:["Au sein d'un village","En centre urbain","En périphérie, décentré","Autre"],multiple:!0},{name:"siteSurfaceArea",path:"siteSurfaceArea",type:"number"},{name:"typePlace",path:"typePlace",enum:["Espaces de vie sociale et communautaire","Création, artisanat et fabrication","Transmission et éducation","Culture et Arts","Santé et soins","Alimentation et circularité","Services et infrastructures partagés"],multiple:!0},{name:"vehiculesAccess",path:"vehiculesAccess",enum:["Emplacement des parking vélo","Abri pour vélos","Parking voitures"],multiple:!0}],presets:{mainTag:"TiersLieux",role:"admin",type:"ONG"},hidden:["role","tags","type"],add:!0,createLabel:null}}}});var Ct=Object.freeze({__proto__:null,default:{slug:"tierslieuxorg1",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration",type:"number"},{name:"gatheringDates",path:"gatheringDates",type:"array"},{name:"reportLink",path:"reportLink",type:"string"},{name:"visioDate",path:"visioDate",type:"object"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"],add:!1,createLabel:"Créer une session"},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation",type:"object"},{name:"firstName",path:"firstName",type:"string"},{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"array",items:{type:"string"}},documentation:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"}}},fields:[{name:"competence",path:"competence",type:"array"},{name:"documentation",path:"documentation",type:"object"},{name:"partner",path:"partner",type:"object"},{name:"rate",path:"rate",type:"string"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"],add:!1,createLabel:"Créer une formation"}}}});var St=Object.freeze({__proto__:null,default:{slug:"transiter",collections:{events:{schema:{type:"object",additionalProperties:!0,properties:{duration:{type:"number"},gatheringDates:{type:"array",items:{type:"string"}},reportLink:{type:"string"},visioDate:{type:"object",additionalProperties:!0}}},fields:[{name:"duration",path:"duration",type:"number"},{name:"gatheringDates",path:"gatheringDates",type:"array"},{name:"reportLink",path:"reportLink",type:"string"},{name:"visioDate",path:"visioDate",type:"object"}],presets:{type:"course",category:"sessionFormation"},hidden:["endDate","recurrency","startDate","tags","type"],add:!1,createLabel:"Créer une session"},person:{schema:{type:"object",additionalProperties:!0,properties:{documentation:{type:"object",additionalProperties:!0},firstName:{type:"string"},formLocality:{type:"string"}}},fields:[{name:"documentation",path:"documentation",type:"object"},{name:"firstName",path:"firstName",type:"string"},{name:"formLocality",path:"formLocality",type:"string"}],presets:{},hidden:[],add:!0,createLabel:null},projects:{schema:{type:"object",additionalProperties:!0,properties:{competence:{type:"string"},documentation:{type:"object",additionalProperties:!0},formLocality:{type:"string"},location:{type:"object",additionalProperties:!0},partner:{type:"object",additionalProperties:!0},rate:{type:"string"},similarLink:{type:"string"}}},fields:[{name:"competence",path:"competence",type:"string"},{name:"documentation",path:"documentation",type:"object"},{name:"formLocality",path:"formLocality",type:"string"},{name:"location",path:"location",type:"object"},{name:"partner",path:"partner",type:"object"},{name:"rate",path:"rate",type:"string"},{name:"similarLink",path:"similarLink",type:"string"}],presets:{tags:"Formation",category:"formation"},hidden:["public","tags","url"],add:!1,createLabel:"Créer une formation"}}}});var jt=Object.freeze({__proto__:null,default:{slug:"vhelioPeiTour2025",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{formLocality:{type:"string"},infoGeneral:{type:"object",additionalProperties:!0},location:{type:"string"},sextionInfo:{type:"object",additionalProperties:!0},similarLink:{type:"object",additionalProperties:!0}}},fields:[{name:"formLocality",path:"formLocality",type:"string"},{name:"infoGeneral",path:"infoGeneral",type:"object"},{name:"location",path:"location",type:"string"},{name:"sextionInfo",path:"sextionInfo",type:"object"},{name:"similarLink",path:"similarLink",type:"object"}],presets:{},hidden:["role","shortDescription","type","url"],add:!0,createLabel:null}}}});var Ot=Object.freeze({__proto__:null,default:{slug:"wallisetfutunaPourUnNumeriqueInclusif",collections:{organizations:{schema:{type:"object",additionalProperties:!0,properties:{typePlace:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},fields:[{name:"typePlace",path:"typePlace",enum:["Agence CAF","Agence CGSS","Agence des Impôts","Agence Pôle emploi","CCAS/CIAS","CRIJ/BIJ/PIJ","Cyberbase/Cybercase","Espace Culturel/Médiathèque","Espace de Coworking","Espace Public Numérique autre","Fablab/Hackerspace","France Services","Maison de l'Emploi","Maison de quartier/CASE","Mission Locale","Organisme de formation","Ressourcerie/Matériel moindre coût recyclé"],multiple:!0}],presets:{},hidden:[],add:!0,createLabel:null}}}});var It=Object.freeze({__proto__:null,bufferToReadable:async function(e){const{Readable:t}=await import("stream");return t.from(e)},createPassThrough:async function(){const{PassThrough:e}=await import("stream");return new e}});var Lt=Object.freeze({__proto__:null,MultiServerFileStorageStrategy:class MultiServerFileStorageStrategy extends MultiServerTokenStorageStrategy{filePath;constructor(e="tokens.json",t=u.join(d.homedir(),".config","cocolight")){super(),this.filePath=u.join(t,e),m.existsSync(t)||m.mkdirSync(t,{recursive:!0})}_readFile(){if(!m.existsSync(this.filePath))return{};try{return JSON.parse(m.readFileSync(this.filePath,"utf8"))}catch{return{}}}_writeFile(e){m.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}getAccessToken(){const e=this._requireBaseURL();return this._readFile()[e]?.accessToken??null}setAccessToken(e){const t=this._requireBaseURL(),n=this._readFile();n[t]={...n[t]||{},accessToken:e},this._writeFile(n)}getRefreshToken(){const e=this._requireBaseURL();return this._readFile()[e]?.refreshToken??null}setRefreshToken(e){const t=this._requireBaseURL(),n=this._readFile();n[t]={...n[t]||{},refreshToken:e},this._writeFile(n)}clear(){const e=this._requireBaseURL(),t=this._readFile();delete t[e],this._writeFile(t)}getServers(){return Object.keys(this._readFile())}exportAll(){return this._readFile()}}});var Dt=Object.freeze({__proto__:null,FileStorageStrategy:class FileStorageStrategy extends TokenStorageStrategy{dir;filePath;constructor(e="tokens.json",t=u.join(d.homedir(),".config","cocolight")){super(),this.dir=t,this.filePath=u.join(t,e),this._ensureDirectoryExists()}_ensureDirectoryExists(){m.existsSync(this.dir)||m.mkdirSync(this.dir,{recursive:!0})}_readFile(){if(!m.existsSync(this.filePath))return{};try{return JSON.parse(m.readFileSync(this.filePath,"utf8"))}catch(e){return console.error("Error reading token file:",e),{}}}_writeFile(e){m.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}getAccessToken(){return this._readFile().accessToken||null}setAccessToken(e){const t=this._readFile();t.accessToken=e,this._writeFile(t)}getRefreshToken(){return this._readFile().refreshToken||null}setRefreshToken(e){const t=this._readFile();t.refreshToken=e,this._writeFile(t)}clear(){this._writeFile({})}}});var xt=Object.freeze({__proto__:null,FileOfflineStorage:class FileOfflineStorage extends OfflineQueueStorageStrategy{dir;filePath;constructor(e="offline-queue.json",t=u.join(d.homedir(),".config","cocolight")){super(),this.dir=t,this.filePath=u.join(t,e),this._ensureDirectoryExists()}_ensureDirectoryExists(){m.existsSync(this.dir)||m.mkdirSync(this.dir,{recursive:!0})}_readFile(){if(!m.existsSync(this.filePath))return[];try{return JSON.parse(m.readFileSync(this.filePath,"utf8"))}catch(e){return console.error("Erreur lecture offline queue :",e),[]}}_writeFile(e){try{m.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}catch(e){console.warn("[OfflineQueue] Erreur d'écriture:",e)}}async loadQueue(){return this._readFile()}async saveQueue(e){this._writeFile(e)}}});export{we as ACTION_STATUSES,be as CLASSIFIED_CATEGORIES,ge as CLASSIFIED_SECTIONS,_e as CLASSIFIED_SUBCATEGORIES,he as EVENT_TYPES,ue as ORGANIZATION_TYPES,fe as POI_TYPES,ye as PROJECT_AVANCEMENTS,Z as UPDATE_PATH_MAGIC,q as batch,$ as computed,Ee as default,Te as describeEntityForm,N as effect,G as getSignals,B as isReactive,z as isSignal,U as reactive,K as subscribeTo,V as watch};
|
|
2
2
|
//# sourceMappingURL=cocolight-api-client.vite.mjs.js.map
|