PageSourceSearch

https://app.geovelo-entreprise.com/static/js/4193.d8dafee6.chunk.js

js geovelo-entreprise.com collected 2026-10-04 12:55:15 UTC 24,597 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_geovelo_frontends_companies=self.webpackChunk_geovelo_frontends_companies||[]).push([[4193],{3487:function(e,n,t){var a=t(90106),i=t(21379),o=t(27997),r=t(57584);n.A=function(){const e=(0,i.jE)();return(0,o.n)({mutationFn:({partner:e,...n})=>a.GeogroupService.addGeogroup({...n,partner:e,type:"company"}),onSuccess:(n,{partner:t})=>{e.invalidateQueries({queryKey:r.l.partnerSubgroups.all(t.id)})}})}},3855:function(e,n,t){var a=t(64864),i=t(33387);n.A=function(){const[e,n]=(0,a.useState)(null),[t,o]=(0,a.useState)(!1),[r,s]=(0,a.useState)(),[l,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(!1),p=(0,i.Zp)();return{selectedSite:e,creationDialogOpen:t,sitesFile:r,updateDialogOpen:l,removeDialogOpen:d,openCreationDialog:o,setSitesFile:s,handleCreate:async function(e){o(!1),null!==e&&void 0!==e&&e.file&&p("/admin/add-sites",{state:{context:e.context,file:r}})},handleUpdate:function({id:e}){n(e),c(!0)},handleRemove:function(e){n(e),u(!0)},updateSite:async function(){n(null),c(!1)},removeSite:async function(){n(null),u(!1)}}}},15775:function(e,n,t){t.d(n,{A:function(){return v}});var a=t(90106),i=t(27988),o=t(75922),r=t(16757),s=t(29072),l=t(62015),c=t(64864),d=t(41811),u=t(90119),p=t(95167),m=t(21379),g=t(27997),f=t(57584);var x=function(){const e=(0,m.jE)();return(0,g.n)({mutationFn:({id:e,partner:n,...t})=>a.GeogroupService.updateGeogroup(e,t,n),onSuccess:(n,{partner:t})=>{e.invalidateQueries({queryKey:f.l.partnerSubgroups.all(t.id)})}})},h=t(60060);const y="site-update-map";var v=function({type:e,geogroup:n,...t}){const[m,g]=(0,c.useState)(""),[f,v]=(0,c.useState)(null),[j,A]=(0,c.useState)(!1),{partner:{current:_}}=(0,c.useContext)(u.BR),b=(0,c.useRef)(null),{t:S}=(0,d.useTranslation)(),{enqueueSnackbar:C}=(0,l.useSnackbar)(),{map:w,init:k,destroy:E}=(0,a.useGeoveloMap)({smallDevice:!0,baseLayer:"geovelo"}),{cancellablePromise:P,cancelPromises:L}=(0,a.useCancellablePromise)(),{mutateAsync:T}=x();return(0,c.useEffect)((()=>(t.open&&(g((null===n||void 0===n?void 0:n.title)||""),"site"===e&&(v((null===n||void 0===n?void 0:n.place)||null),k({container:y,customZoomControls:!0,center:null!==n&&void 0!==n&&n.place?{lat:n.place.point.coordinates[1],lng:n.place.point.coordinates[0]}:void 0,zoom:null!==n&&void 0!==n&&n.place?15:void 0}))),()=>{b.current=null,E()})),[t.open]),(0,c.useEffect)((()=>{function e({lngLat:{lat:e,lng:n}}){v(new a.Place(void 0,{type:"Point",coordinates:[n,e]}))}var n;if(f||null===w||void 0===w||w.on("click",e),w&&f)if(b.current){var t;null===(t=b.current)||void 0===t||t.setLngLat({lat:f.point.coordinates[1],lng:f.point.coordinates[0]})}else{const{icon:e,color:n}=a.userPlaceTypes.work,t=(0,a.createNewImageMarker)({color:n,icon:e,draggable:!0}).setLngLat({lat:f.point.coordinates[1],lng:f.point.coordinates[0]}).addTo(w);t.on("dragend",(({target:e})=>{w.flyTo({center:e.getLngLat(),zoom:Math.max(15,w.getZoom())}),v(new a.Place(void 0,{type:"Point",coordinates:e.getLngLat().toArray()}))})),b.current=t}else null===(n=b.current)||void 0===n||n.remove(),b.current=null;return()=>{null===w||void 0===w||w.off("click",e)}}),[w,f]),(0,c.useEffect)((()=>(async function(){if(f&&!f.addressDetail)try{const e=await P(a.GeocoderService.reverseGeocode(void 0,f.point));v(e)}catch(e){console.error(e)}}(),()=>L())),[f]),(0,h.jsx)(p.lG,{fullWidth:!0,loading:j,maxWidth:"sm",...t,children:(0,h.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:3,children:[(0,h.jsx)(o.A,{fontSize:"1.25rem",fontWeight:600,children:S("site"===e?"companies.pages.admin.company.data.edit_subgroup_dialog.title_site":"companies.pages.admin.company.data.edit_subgroup_dialog.title_team")}),(0,h.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:3,children:[(0,h.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:1,children:[(0,h.jsx)(o.A,{fontWeight:700,variant:"body2",children:S("site"===e?"companies.pages.admin.company.data.edit_subgroup_dialog.description_site":"companies.pages.admin.company.data.edit_subgroup_dialog.description_team")}),(0,h.jsx)(r.A,{required:!0,disabled:j,error:!m,onChange:({currentTarget:e})=>g(e.value),size:"small",slotProps:{inputLabel:{shrink:!0}},value:m,variant:"outlined"})]}),"site"===e&&(0,h.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:2,children:[(0,h.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:1,children:[(0,h.jsx)(o.A,{fontWeight:700,variant:"body2",children:S("companies.pages.admin.company.data.sites_form.labels_address")}),(0,h.jsx)(a.Autocomplete,{disableFloatingLabel:!0,defaultValue:f,disabled:j,margin:"none",onSelect:v,size:"small"})]}),(0,h.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:1,children:[(0,h.jsx)(o.A,{fontWeight:700,variant:"body2",children:S("companies.pages.admin.user.address_form.labels_map")}),(0,h.jsx)(i.A,{height:200,id:y})]})]})]}),(0,h.jsxs)(i.A,{alignItems:"center",display:"flex",gap:3,justifyContent:"flex-end",children:[(0,h.jsx)(p.$n,{color:"primary",disabled:j,onClick:()=>t.onClose(),variant:"outlined",children:S("commons.actions.cancel")}),(0,h.jsx)(p.$n,{color:"primary",disabled:j||!m||"site"===e&&!f,onClick:async function(){if(_&&n&&m&&("site"!==e||f)){A(!0);try{const a=await T({id:n.id,partner:_,name:m,..."site"===e?{address:f}:{}});t.onClose(a),C(S("site"===e?"companies.pages.admin.company.data.edit_subgroup_dialog.success_site":"companies.pages.admin.company.data.edit_subgroup_dialog.success_team"))}catch(a){console.error(a),C(S("site"===e?"companies.pages.admin.company.data.edit_subgroup_dialog.server_error_site":"companies.pages.admin.company.data.edit_subgroup_dialog.server_error_team"),{variant:"error"})}A(!1)}},startIcon:j&&(0,h.jsx)(s.A,{color:"inherit",size:16,thickness:4}),variant:"contained",children:S("commons.actions.validate")})]})]})})}},35555:function(e,n,t){var a=t(90106),i=t(27988),o=t(75922),r=t(50329),s=t(91836),l=t
1(86210),c=t(63952),d=t(16757),u=t(74502),p=t(93190),m=t(34066),g=t(29072),f=t(1658),x=t(62015),h=t(64864),y=t(41811),v=t(90119),j=t(95167),A=t(85859),_=t(3487),b=t(56996),S=t(73661),C=t(85521),w=t(60060);n.A=function({context:e,disableHeadquartersCard:n,file:t,setFile:k,...E}){var P;const[L,T]=(0,h.useState)("manually"),[z,I]=(0,h.useState)(""),[D,G]=(0,h.useState)(null),[F,R]=(0,h.useState)(""),[W,q]=(0,h.useState)(null),[$,B]=(0,h.useState)(null),[X,M]=(0,h.useState)(!1),[N,Y]=(0,h.useState)(null),[O,Z]=(0,h.useState)(!1),[H,K]=(0,h.useState)(!1),Q=(0,h.useRef)(null),V=(0,h.useRef)(null),{partner:{current:U},actions:{setCurrentPartner:J}}=(0,h.useContext)(v.BR),{mutateAsync:ee}=(0,_.A)(),{mutateAsync:ne}=(0,b.A)(),{data:te}=(0,S.A)(U),ae=null===te||void 0===te?void 0:te.sites,{t:ie}=(0,y.useTranslation)(),{enqueueSnackbar:oe}=(0,x.useSnackbar)(),{downloadXLSX:re}=(0,a.useFileSaver)(),{trackEvent:se}=(0,A.A)(),{cancellablePromise:le,cancelPromises:ce}=(0,a.useCancellablePromise)();function de(e){if(R(e),B(null),ce(),Q.current&&clearTimeout(Q.current),e.length<2)return q(null),void M(!1);M(!0),Q.current=setTimeout((()=>async function(e){const n=e.replace(/\s/g,""),t=9===n.length&&/^[0-9]*$/.test(n),i=14===n.length&&/^[0-9]*$/.test(n);q(null);try{const o=await le(a.PartnerService.searchCompanies({search:t||i?n:e,isSite:i}));q(o)}catch(o){o instanceof Error&&"CancelledPromiseError"===o.name||q([])}}(e)),400)}return(0,h.useEffect)((()=>{E.open&&(I(""),G(null),k(void 0),R(""),q(null),B(null),M(!1),Y(null))}),[E.open]),(0,h.useEffect)((()=>{$&&"siren"in $?(Z(!0),a.PartnerService.getCompanyEstablishment($).then(Y).catch((()=>Y([]))).finally((()=>Z(!1)))):Y(null)}),[$]),(0,w.jsx)(j.lG,{fullWidth:!0,loading:H,maxWidth:"sm",...E,children:(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:3,children:[(0,w.jsx)(o.A,{fontSize:"1.25rem",fontWeight:600,children:"Ajouter des sites"}),ae&&0===ae.length&&!n&&(0,w.jsx)(C.A,{onAdd:()=>E.onClose()}),(0,w.jsxs)(r.A,{onChange:({target:{value:e}})=>{T(e)},sx:{alignItems:"stretch",gap:3},value:L,children:[(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",children:[(0,w.jsx)(s.A,{control:(0,w.jsx)(l.A,{color:"primary",size:"small",value:"manually"}),label:"Renseigner manuellement"}),(0,w.jsx)(c.A,{in:"manually"===L,children:(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:2,marginTop:2,children:[(0,w.jsx)(d.A,{required:!0,disabled:H,error:!z,label:ie("companies.pages.admin.company.data.sites_form.labels_title"),onChange:({currentTarget:e})=>I(e.value),size:"small",slotProps:{inputLabel:{shrink:!0}},value:z,variant:"outlined"}),(0,w.jsx)(a.Autocomplete,{required:!0,defaultValue:D,disabled:H,label:ie("companies.pages.admin.company.data.sites_form.placeholders_address"),margin:"none",onSelect:G,size:"small"})]})})]}),(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",children:[(0,w.jsx)(s.A,{control:(0,w.jsx)(l.A,{color:"primary",size:"small",value:"file"}),label:"Importer un fichier XLSX"}),(0,w.jsx)(c.A,{in:"file"===L,children:(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:2,marginTop:2,children:[(0,w.jsxs)(o.A,{color:"textSecondary",variant:"body2",children:["Le fichier doit contenir uniquement deux colonnes (sans ent\xeate). La premi\xe8re avec la liste des noms des sites, et la deuxi\xe8me avec leur adresse compl\xe8te."," ",(0,w.jsx)("span",{onClick:()=>{re("sample.xlsx",[],[["Paris","Place de l'Hotel de Ville 75004 Paris, France"],["Lyon","Place Bellecour, Lyon, France"]])},style:{cursor:"pointer",fontWeight:700,textDecoration:"underline"},children:"Voir\xa0l'exemple"})]}),(0,w.jsx)(a.FileInput,{buttonLabel:"Parcourir...",file:t,onChange:k,size:"small",type:"xlsx"})]})})]}),!(null!==U&&void 0!==U&&U.siren)&&(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",children:[(0,w.jsx)(s.A,{control:(0,w.jsx)(l.A,{color:"primary",size:"small",value:"siret"}),label:"Ajouter d'apr\xe8s l'annuaire des entreprises"}),(0,w.jsx)(c.A,{in:"siret"===L,children:(0,w.jsxs)(i.A,{display:"flex",flexDirection:"column",gap:2,marginTop:2,children:[(0,w.jsx)(u.x,{onClickAway:()=>M(!1),children:(0,w.jsxs)(i.A,{ref:V,sx:{width:"100%"},children:[(0,w.jsx)(d.A,{fullWidth:!0,label:"Nom ou N\xb0 SIRET / SIREN",margin:"none",onChange:({currentTarget:{value:e}})=>de(e),size:"small",type:"text",value:F,variant:"outlined"}),(0,w.jsx)(p.A,{anchorEl:V.current,open:X,placement:"bottom-start",sx:{width:null===(P=V.current)||void 0===P?void 0:P.offsetWidth,zIndex:1500},children:(0,w.jsx)(m.A,{elevation:4,sx:{maxHeight:220,overflowY:"auto"},children:null===W?(0,w.jsx)(i.A,{display:"flex",justifyContent:"center",padding:2,children:(0,w.jsx)(g.A,{size:20})}):0===W.length?(0,w.jsx)(i.A,{padding:2,children:(0,w.jsx)(o.A,{color:"text.secondary",fontSize:13,children:ie("companies.pages.incitation.pilot.cycling_potential.siren_step.no_results")})}):W.slice(0,5).map(((e,n)=>(0,w.jsxs)(i.A,{children:[n>0&&(0,w.jsx)(f.A,{}),(0,w.jsxs)(i.A,{onClick:()=>function(e){B(e),R(e.name),M(!1),q(null),Y(null)}(e),padding:1.5,sx:{cursor:"pointer","&:hover":{bgcolor:"#F6F8FC"}},children:[(0,w.jsx)(o.A,{fontSize:13,fontWeight:600,children:e.name}),(0,w.jsx)(o.A,{color:"text.secondary",fontSize:12,children:e.place.address})]})]},"siren"in e?e.siren:e.siret)))})})]})}),O&&(0,w.jsx)(i.A,{display:"flex",justifyContent:"center",paddingTop:1,children:(0,w.jsx)(g.A,{size:20})}),N&&N.length>0&&(0,w.jsx)(j.mZ,{description:ie("companies.pages.new-company.sites.autofill_card.description",{count:N.length}),size:"small",title:ie("companies.pages.new-company.sites.autofill_card.title",{count:N.length})})]})})]})]}),(0,w.jsxs)(i.A,{alignItems:"center",display:"flex",gap:3,justifyContent:"flex-end",children:[(0,w.jsx)(j.$n,{color:"primary",disabled:H,onClick:()=>E.onClose(),variant:"outlined",children:ie("commons.actions.cancel")}),(0,w.jsx)(j.$n,{color:"primary",disabled:H||O||"manually"===L&&(!z||!D)||"file"===L&&!t||"siret"===L&&!$,onClick:async function(){if(null!==U&&void 0!==U&&U.geoGroupId){if(K(!0),"manually"===L&&z)try{await ee({partner:U,name:z,parentId:U.geoGroupId,subGroupType:"companySite",automaticChallengeStatus:"disabled",address:D}),se("Site Manually Created",{context:e}),E.onClose(),oe(ie("companies.pages.admin.company.data.add_subgroup_dialog.success_site"))}catch(n){console.error(n),oe(ie("companies.pages.admin.company.data.add_subgroup_dialog.server_error_site"),{variant:"error"})}else if("file"===L&&t)se("Sites File Import Started",{context:e}
1),E.onClose({context:e,file:t});else if("siret"===L&&$)try{if("siren"in $&&N&&N.length>0){let n=U;U.siren||(n=await a.PartnerService.editPartner(U,{siren:$.siren}),J(n));const t=await ne({partner:n,groups:N.map((({siret:e,name:n,place:{coordinates:t,primaryText:i,secondaryText:o}})=>{var r;return{name:n,parentId:null!==(r=U.geoGroupId)&&void 0!==r?r:void 0,subGroupType:"companySite",address:new a.Place(e,{type:"Point",coordinates:t},{primaryText:i,secondaryText:o}),siret:e}}))});se("Sites Created From SIREN",{context:e,count:t.length}),E.onClose(),oe(ie("companies.pages.new-company.sites.autofill_card.success",{count:t.length}))}else{const{name:n,place:t}=$,a="siret"in $?$.siret:void 0;await ee({partner:U,name:n,parentId:U.geoGroupId,subGroupType:"companySite",automaticChallengeStatus:"disabled",address:t,siret:a}),se("Site Created From SIRET",{context:e}),E.onClose(),oe(ie("companies.pages.admin.company.data.add_subgroup_dialog.success_site"))}}catch(n){console.error(n),oe(ie("companies.pages.admin.company.data.add_subgroup_dialog.server_error_site"),{variant:"error"})}K(!1)}},startIcon:H&&(0,w.jsx)(g.A,{color:"inherit",size:16,thickness:4}),variant:"contained",children:"siret"===L&&$&&"siren"in $&&N?ie("companies.pages.new-company.sites.autofill_card.actions.add",{count:N.length}):ie("commons.actions.validate")})]})]})})}},46183:function(e,n,t){var a=t(90106),i=t(93063),o=t(27988),r=t(75922),s=t(41811),l=t(33387),c=t(95167),d=t(60060);n.A=function({context:e,openCreationDialog:n}){const{t:t}=(0,s.useTranslation)();return(0,d.jsx)(o.A,{display:"flex",flexDirection:"column",gap:8,marginY:5,children:(0,d.jsxs)(o.A,{alignItems:"center",display:"flex",flexDirection:"column",gap:3,children:[(0,d.jsx)(o.A,{alignItems:"center",bgcolor:"#ECFBF4",border:"1px solid #CDF5E3",borderRadius:8,display:"flex",height:64,justifyContent:"center",width:64,children:(0,d.jsx)(a.CompanyIcon,{sx:{color:"#0BAA70"}})}),(0,d.jsxs)(o.A,{display:"flex",flexDirection:"column",gap:1,children:[(0,d.jsx)(r.A,{align:"center",fontWeight:700,children:t("companies.pages.admin.company.data.sites_form.empty_state")}),(0,d.jsx)(r.A,{align:"center",color:"textSecondary",variant:"body2",children:t("companies.pages.admin.company.data.sites_form.description")})]}),(0,d.jsxs)(o.A,{alignItems:"center",display:"flex",flexDirection:"column",gap:1,children:[(0,d.jsx)(c.$n,{color:"primary",onClick:()=>n(!0),startIcon:(0,d.jsx)(i.A,{}),variant:"contained",children:"Renseigner manuellement un site"}),(0,d.jsx)(c.$n,{color:"primary",component:l.N_,startIcon:(0,d.jsx)(c.JM,{}),state:{context:e},to:"/admin/add-sites",variant:"outlined",children:"Importer un fichier XLSX"})]})]})})}},47266:function(e,n,t){var a=t(90106),i=t(93063),o=t(27988),r=t(16757),s=t(75922),l=t(39895),c=t(1658),d=t(88016),u=t(89106),p=t(58628),m=t(35610),g=t(67936),f=t(71380),x=t(54673),h=t(64864),y=t(60060),v=t(41811),j=t(95167);const A="sites-map";n.A=function({sites:e,onAdd:n,onEdit:t,onRemove:_,onSelect:b}){const[S,C]=(0,h.useState)(!1),[w,k]=(0,h.useState)(""),[E,P]=(0,h.useState)(e),L=(0,h.useRef)([]),{t:T}=(0,v.useTranslation)(),{initialized:z,map:I,init:D,destroy:G}=(0,a.useGeoveloMap)({smallDevice:!0,baseLayer:"geovelo"});return(0,h.useEffect)((()=>{e&&C(!0)}),[e]),(0,h.useEffect)((()=>{if(S&&e){const n={type:"Polygon",coordinates:[e.reduce(((e,{place:n})=>{if(n){const{point:{coordinates:t}}=n;e.push(t)}return e}),[])]},{north:t,east:i,south:o,west:r}=(0,a.toBounds)(n);D({container:A,customZoomControls:!0,bounds:[r,o,i,t],fitBoundsOptions:{padding:50}})}return()=>{G()}}),[S]),(0,h.useEffect)((()=>{let n=!0;return S&&e&&n&&P(w?[...e].filter((({title:e})=>e.toLowerCase().indexOf(w.toLowerCase())>-1)):[...e]),()=>{n=!1}}),[e,w]),(0,h.useEffect)((()=>{z&&I&&e&&(L.current.forEach((e=>e.remove())),L.current=[],e.forEach((({title:e,place:n})=>{if(!n)return;const{addressDetail:t,point:{coordinates:[i,o]}}=n,r=(0,a.createNewImageMarker)({color:"#dd428d"},{onClick:()=>{r.togglePopup()}}).setLngLat({lat:o,lng:i}).setPopup(new x.Popup({maxWidth:"350px",closeButton:!1,closeOnClick:!0,className:"map-tooltip",offset:[0,-25]}).setHTML(`<h3>${e}</h3><p>${null===t||void 0===t?void 0:t.secondaryText}</p>`)).addTo(I);L.current.push(r)})))}),[z,e]),(0,y.jsxs)(o.A,{display:"flex",flexDirection:{xs:"column",lg:"row"},flexGrow:1,sx:{overflowY:"hidden"},children:[(0,y.jsxs)(o.A,{flexShrink:0,sx:{overflowY:"auto"},width:{lg:400},children:[(0,y.jsxs)(o.A,{alignItems:"center",display:"flex",gap:2,height:64,justifyContent:"space-between",paddingX:3,children:[(0,y.jsx)(r.A,{fullWidth:!0,id:"search",name:"search",onChange:({target:{value:e}})=>k(e),placeholder:T("companies.pages.admin.company.data.sites_form.actions.search"),size:"small",value:w,variant:"outlined"}),n&&(0,y.jsx)(j.$n,{color:"primary",onClick:({currentTarget:e})=>n(e),startIcon:(0,y.jsx)(i.A,{}),sx:{flexShrink:0},variant:"contained",children:T("companies.pages.admin.company.data.sites_form.actions.add")})]}),E&&0===E.length?(0,y.jsx)(o.A,{paddingX:3,paddingY:2,children:(0,y.jsx)(s.A,{color:"textSecondary",variant:"body2",children:T("companies.pages.admin.company.data.sites_form.empty_state_search")})}):(0,y.jsx)(l.A,{disablePadding:!0,children:E?E.map(((e,n)=>{const{id:a,title:i,place:o}=e;if(!o)return(0,y.jsx)(y.Fragment,{},a);const{addressDetail:r,point:{coordinates:[s,l]}}=o;return(0,y.jsxs)(y.Fragment,{children:[n>0&&(0,y.jsx)(c.A,{}),(0,y.jsx)(d.Ay,{disablePadding:!0,secondaryAction:(0,y.jsxs)(y.Fragment,{children:[t&&(0,y.jsx)(u.A,{title:T("commons.actions.update"),children:(0,y.jsx)(p.A,{onClick:n=>{n.stopPropagation(),t({...e})},size:"small",children:(0,y.jsx)(j.qU,{fontSize:"small"})})}),(0,y.jsx)(u.A,{title:T("commons.actions.remove"),children:(0,y.jsx)(p.A,{onClick:e=>{e.stopPropagation(),_(a)},size:"small",children:(0,y.jsx)(j.YP,{color:"error",fontSize:"small"})})})]}),children:(0,y.jsx)(m.A,{onClick:()=>{null===I||void 0===I||I.flyTo({animate:!1,center:{lat:l,lng:s},zoom:15}),null===b||void 0===b||b(e)},sx:{paddingLeft:4,paddingRight:11},children:(0,y.jsx)(g.A,{primary:i,secondary:null===r||void 0===r?void 0:r.secondaryText})})})]},a)})):[0,1,2].map(((e,n)=>(0,y.jsxs)(y.Fragment,{children:[n>0&&(0,y.jsx)(c.A,{}),(0,y.jsx)(d.Ay,{sx:{paddingLeft:4,paddingRight:11},children:(0,y.jsx)(g.A,{primary:(0,y.jsx)(f.A,{variant:"text",width:100}),secondary:(0,y.jsx)(f.A,{variant:"text",width:200})})})]},e)))})]}),(0,y.jsx)(o.A,{borderLeft:"1px solid rgba(0, 0, 0, 0.12)",flexGrow:1,height:{xs:300,lg:"100%"},id:A})]})}},56996:function(e,n,t){var a=t(90106),i=t(21379),o=t(27997),r=t(57584);n.A=function(){const e=(0,i.jE)();return(0,o.n)({mutationFn:({partner:e,groups:n})=>a.GeogroupService.addGeogroups({partner:e,groups:n.map((e=>({...e,type:"company"})))}),onSuccess:(n,{partner:t})=>
1{e.invalidateQueries({queryKey:r.l.partnerSubgroups.all(t.id)})}})}},72122:function(e,n,t){t.d(n,{A:function(){return h}});var a=t(27988),i=t(75922),o=t(29072),r=t(62015),s=t(64864),l=t(41811),c=t(90119),d=t(95167),u=t(90106),p=t(21379),m=t(27997),g=t(57584);var f=function(){const e=(0,p.jE)();return(0,m.n)({mutationFn:({geogroups:e,partner:n})=>Promise.all(e.map((({id:e})=>u.GeogroupService.removeGeogroup(e,n)))),onSuccess:(n,{partner:t})=>{e.invalidateQueries({queryKey:g.l.partnerSubgroups.all(t.id)})}})},x=t(60060);var h=function({type:e,geogroups:n,...t}){const[u,p]=(0,s.useState)(!1),{partner:{current:m}}=(0,s.useContext)(c.BR),{t:g}=(0,l.useTranslation)(),{enqueueSnackbar:h}=(0,r.useSnackbar)(),{mutateAsync:y}=f();return(0,x.jsx)(d.lG,{fullWidth:!0,loading:u,maxWidth:"sm",...t,children:(0,x.jsxs)(a.A,{display:"flex",flexDirection:"column",gap:3,children:[(0,x.jsx)(i.A,{fontSize:"1.25rem",fontWeight:600,children:g("site"===e?"companies.pages.admin.company.data.remove_subgroup_dialog.title_site":"companies.pages.admin.company.data.remove_subgroup_dialog.title_team",{count:n.length})}),(0,x.jsx)(i.A,{variant:"body2",children:g("site"===e?"companies.pages.admin.company.data.remove_subgroup_dialog.description_site":"companies.pages.admin.company.data.remove_subgroup_dialog.description_team",{count:n.length,geogroups:n.map((({title:e})=>`"${e}"`)).join(", ")})}),(0,x.jsxs)(a.A,{alignItems:"center",display:"flex",gap:3,justifyContent:"flex-end",children:[(0,x.jsx)(d.$n,{color:"primary",disabled:u,onClick:()=>t.onClose(),variant:"outlined",children:g("companies.pages.admin.company.data.remove_subgroup_dialog.actions.cancel")}),(0,x.jsx)(d.$n,{color:"error",disabled:u,onClick:async function(){if(m&&n){p(!0);try{await y({geogroups:n,partner:m}),t.onClose(!0),h(g("site"===e?"companies.pages.admin.company.data.remove_subgroup_dialog.success_site":"companies.pages.admin.company.data.remove_subgroup_dialog.success_team",{count:n.length}))}catch(a){console.error(a),h(g("site"===e?"companies.pages.admin.company.data.remove_subgroup_dialog.server_error_site":"companies.pages.admin.company.data.remove_subgroup_dialog.server_error_team",{count:n.length}),{variant:"error"})}p(!1)}},startIcon:u?(0,x.jsx)(o.A,{color:"inherit",size:16,thickness:4}):(0,x.jsx)(d.YP,{}),variant:"contained",children:g("companies.pages.admin.company.data.remove_subgroup_dialog.actions.confirm")})]})]})})}},74502:function(e,n,t){t.d(n,{x:function(){return c}});var a=t(64864),i=t(43486),o=t(3200),r=t(71440),s=t(87176);function l(e){return e.substring(2).toLowerCase()}function c(e){const{children:n,disableReactTree:t=!1,mouseEvent:c="onClick",onClickAway:d,touchEvent:u="onTouchEnd"}=e,p=a.useRef(!1),m=a.useRef(null),g=a.useRef(!1),f=a.useRef(!1);a.useEffect((()=>(setTimeout((()=>{g.current=!0}),0),()=>{g.current=!1})),[]);const x=(0,o.A)((0,s.A)(n),m),h=(0,r.A)((e=>{const n=f.current;f.current=!1;const a=(0,i.A)(m.current);if(!g.current||!m.current||"clientX"in e&&function(e,n){return n.documentElement.clientWidth<e.clientX||n.documentElement.clientHeight<e.clientY}(e,a))return;if(p.current)return void(p.current=!1);let o;o=e.composedPath?e.composedPath().includes(m.current):!a.documentElement.contains(e.target)||m.current.contains(e.target),o||!t&&n||d(e)})),y=e=>t=>{f.current=!0;const a=n.props[e];a&&a(t)},v={ref:x};return!1!==u&&(v[u]=y(u)),a.useEffect((()=>{if(!1!==u){const e=l(u),n=(0,i.A)(m.current),t=()=>{p.current=!0};return n.addEventListener(e,h),n.addEventListener("touchmove",t),()=>{n.removeEventListener(e,h),n.removeEventListener("touchmove",t)}}}),[h,u]),!1!==c&&(v[c]=y(c)),a.useEffect((()=>{if(!1!==c){const e=l(c),n=(0,i.A)(m.current);return n.addEventListener(e,h),()=>{n.removeEventListener(e,h)}}}),[h,c]),a.cloneElement(n,v)}},85521:function(e,n,t){var a=t(90106),i=t(29072),o=t(62015),r=t(64864),s=t(41811),l=t(33387),c=t(90119),d=t(95167),u=t(3487),p=t(50885),m=t(60060);n.A=function({onAdd:e}){var n;const[t,g]=(0,r.useState)(!1),{partner:{current:f}}=(0,r.useContext)(c.BR),{data:x}=(0,p.A)(f),{mutateAsync:h}=(0,u.A)(),{state:y}=(0,l.zy)(),{t:v}=(0,s.useTranslation)(),{enqueueSnackbar:j}=(0,o.useSnackbar)();return null!==x&&void 0!==x&&x.place?(0,m.jsx)(d.mZ,{action:(0,m.jsx)(d.$n,{color:"primary",disabled:t,onClick:()=>async function(){if(f&&x&&x.place){g(!0);try{let i=null===y||void 0===y?void 0:y.geogroupCity;if(!i)try{var n;i=null===(n=(await a.GeocoderService.reverseGeocode(-1,x.place.point)).addressDetail)||void 0===n?void 0:n.city}catch(t){console.error(t)}
1await h({partner:f,name:["Si\xe8ge social",i].filter(Boolean).join(" "),parentId:x.id,subGroupType:"companySite",automaticChallengeStatus:"disabled",address:x.place}),j(v("companies.pages.new-company.sites.add_headquarters_card.success")),null===e||void 0===e||e()}catch(t){t instanceof Error&&"CancelledPromiseError"===(null===t||void 0===t?void 0:t.name)||(console.error(t),j(v("companies.pages.new-company.sites.add_headquarters_card.server_error"),{variant:"error"}))}g(!1)}}(),size:"medium",startIcon:t&&(0,m.jsx)(i.A,{color:"inherit",size:16,thickness:4}),variant:"text",children:v("companies.pages.new-company.sites.add_headquarters_card.actions.add")}),description:v("companies.pages.new-company.sites.add_headquarters_card.description",{address:null===x||void 0===x||null===(n=x.place)||void 0===n?void 0:n.address}),size:"small",title:v("companies.pages.new-company.sites.add_headquarters_card.title"),variant:"info"}):(0,m.jsx)(m.Fragment,{})}}}]);
2//# sourceMappingURL=4193.d8dafee6.chunk.js.map

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