1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6c7e24ff-9b0a-5c7c-83f3-27c580ce5471")}catch(e){}}(); 3import{A as Sr,r as i,e as Se,f as ke,g as Pe,h as Oe,i as Le,Q as Ee,eK as _e,R as a,C as xe,bL as zt,ca as kr,W as Vt,v as rr,b5 as Pr,b6 as Or,aR as _r,bt as he,b7 as me,aN as re,bQ as Ir,bP as Dr,Y as de,b9 as Rr,ba as je,bR as jr,ao as Wt,ai as Nr,aM as Ar,d2 as Tr,aq as Ur,aY as Br,bj as zr,a6 as Mt,I as Vr,bs as Wr,cI as Fr,L as $r,cz as Zr,bf as Hr,X as Gr,gd as ht,l as qr,a$ as Kr,x as mn,$ as Yr,V as Jr,cM as Qr,a5 as Xr,dA as St,cO as vn,c_ as yn,aS as kt,cc as bn,g9 as Pt,a0 as ei,c1 as ti,ah as ni,w as si,M as ri,dQ as ii}from"./index-Cs-In7Vx.js";import{C as oi}from"./CNPJMaskCustom-BuuETOHV.js";import{j as oe,C as ai}from"./jsx-runtime-Crd2NGxj.js";import{f as li}from"./formatAddress-DI14OUhR.js";import{L as ui}from"./LocationOnRounded-iAbEw2do.js";import{U as le,g as ci,s as di,b as ir,r as jt,c as pi,M as gi}from"./utils-BV20SPqd.js";import{V as fi,B as hi,a as mi,A as vi,M as yi}from"./MovieCreationOutlined-DPxC34Zc.js";import{I as bi}from"./ImageOutlined-jBTnVIaP.js";import{R as Li}from"./ReorderRounded-Ct9eXE7H.js";import{u as Ei,a as Ci}from"./useDrop-DkAvtxPl.js";import{U as wi,S as xi,a as Mi,b as Si,c as ki,R as Pi,d as Oi,G as _i,g as Ii,u as Di,r as Ln,e as Ri,f as ji}from"./profile.actions-5K7DhYPO.js";import"./cloneDeep-CWttLxUo.js";import"./Lock-C5j5Mq5n.js";import"./CloudUploadRounded-DqYHvwyH.js";const Ni=Sr(i.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"}));var Ne={},En;function Ai(){if(En)return Ne;En=1;var t=Se(),e=ke();Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.default=void 0;var n=e(Pe()),s=t(Oe()),r=(0,s.default)(n.createElement("path",{d:"M12 2c-4.2 0-8 3.22-8 8.2 0 3.18 2.45 6.92 7.34 11.23.38.33.95.33 1.33 0C17.55 17.12 20 13.38 20 10.2 20 5.22 16.2 2 12 2m.71 13.7c-.19.2-.43.3-.71.3-.27 0-.53-.11-.71-.3-.19-.19-.3-.44-.29-.71-.01-.55.43-.99.98-1H12c.55-.01.99.43 1 .98v.02c0 .28-.1.52-.29.71m1.98-5.79c-.21.35-.48.71-.89 1.09-.32.3-.53.56-.65.77-.1.19-.16.49-.16.69v.07c-.01.27-.24.47-.51.47h-.85c-.28 0-.5-.22-.5-.5v-.16c0-.45.1-.84.29-1.16.19-.33.52-.7 1-1.12.28-.25.48-.47.61-.66s.19-.4.19-.64c0-.29-.11-.54-.32-.74-.22-.2-.5-.3-.85-.3-.37 0-.74.1-.96.3-.12.12-.21.23-.29.38-.03.07-.08.21-.09.26-.05.17-.24.34-.47.34h-.69c-.26 0-.47-.19-.5-.45-.01-.08 0-.16.02-.24.18-.72.52-1.16.9-1.52.56-.5 1.28-.79 2.03-.79.59 0 1.11.12 1.57.35s.79.55 1.05.96c.25.41.38.85.38 1.35 0 .49-.11.9-.31 1.25"}),"NotListedLocationRounded");return Ne.default=r,Ne}var Ti=Ai();const Ui=Le(Ti);async function Bi(t){return(await Ee.put("/api/v2/company/address",t)).data}var Ae={},Cn;function zi(){if(Cn)return Ae;Cn=1;var t=Se(),e=ke();Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.default=void 0;var n=e(Pe()),s=t(Oe()),r=(0,s.default)(n.createElement("path",{d:"M18.11 1.77l.96-.96a.996.996 0 011.41 0l.71.71c.39.39.39 1.02 0 1.41l-.96.96-2.12-2.12zm-1 1l2.12 2.12-5.97 5.97a.51.51 0 01-.35.15H11.5c-.28 0-.5-.22-.5-.5V9.1c0-.13.05-.26.15-.35l5.96-5.98zm-1.98-.13L9.79 7.98c-.18.19-.29.44-.29.71v2.83c0 .55.45 1 1 1h2.83c.27 0 .52-.11.71-.29l5.33-5.33c.4.98.63 2.09.63 3.31 0 3.18-2.45 6.92-7.34 11.23-.38.33-.95.33-1.33 0C6.45 17.13 4 13.39 4 10.21c0-4.98 3.8-8.2 8-8.2 1.09 0 2.16.22 3.13.63z"}),"EditLocationRounded");return Ae.default=r,Ae}var Vi=zi();const Wi=Le(Vi);function Ze(t){"@babel/helpers - typeof";return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ze(t)}function Fi(t,e){if(Ze(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e);if(Ze(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $i(t){var e=Fi(t,"string");return Ze(e)=="symbol"?e:e+""}function M(t,e,n){return(e=$i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function or(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ot,wn;function Zi(){if(wn)return Ot;wn=1;var t=function(n,s,r,o,l,u,c,g){if(!n){var d;if(s===void 0)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[r,o,l,u,c,g],f=0;d=new Error(s.replace(/%s/g,function(){return p[f++]}
3)),d.name="Invariant Violation"}throw d.framesToPop=1,d}};return Ot=t,Ot}var Hi=Zi(),se=or(Hi),V=i.createContext(null);function Gi(){se(!!i.useContext,"useGoogleMap is React hook and requires React version 16.8+");var t=i.useContext(V);return se(!!t,"useGoogleMap needs a GoogleMap available up in the tree"),t}function qi(t,e,n){return Object.keys(t).reduce(function(r,o){return e(r,t[o],o)},n)}function Ki(t,e){Object.keys(t).forEach(n=>e(t[n],n))}function Yi(t,e,n,s){var r={},o=(l,u)=>{var c=n[u];c!==e[u]&&(r[u]=c,l(s,c))};return Ki(t,o),r}function Ji(t,e,n){var s=qi(n,function(o,l,u){return typeof t[u]=="function"&&o.push(google.maps.event.addListener(e,l,t[u])),o},[]);return s}function Qi(t){google.maps.event.removeListener(t)}function H(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];t.forEach(Qi)}function Z(t){var{updaterMap:e,eventMap:n,prevProps:s,nextProps:r,instance:o}=t,l=Ji(r,o,n);return Yi(e,s,r,o),l}var xn={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},Mn={extraMapTypes(t,e){e.forEach(function(s,r){t.mapTypes.set(String(r),s)})},center(t,e){t.setCenter(e)},clickableIcons(t,e){t.setClickableIcons(e)},heading(t,e){t.setHeading(e)},mapTypeId(t,e){t.setMapTypeId(e)},options(t,e){t.setOptions(e)},streetView(t,e){t.setStreetView(e)},tilt(t,e){t.setTilt(e)},zoom(t,e){t.setZoom(e)}};function Xi(t){var{children:e,options:n,id:s,mapContainerStyle:r,mapContainerClassName:o,center:l,onClick:u,onDblClick:c,onDrag:g,onDragEnd:d,onDragStart:p,onMouseMove:f,onMouseOut:y,onMouseOver:h,onMouseDown:m,onMouseUp:v,onRightClick:C,onCenterChanged:k,onLoad:P,onUnmount:E}=t,[b,L]=i.useState(null),w=i.useRef(null),[I,S]=i.useState(null),[O,j]=i.useState(null),[D,U]=i.useState(null),[A,T]=i.useState(null),[W,J]=i.useState(null),[F,K]=i.useState(null),[$,Q]=i.useState(null),[Y,N]=i.useState(null),[X,x]=i.useState(null),[G,ne]=i.useState(null),[B,_]=i.useState(null),[R,q]=i.useState(null);return i.useEffect(()=>{n&&b!==null&&b.setOptions(n)},[b,n]),i.useEffect(()=>{b!==null&&typeof l<"u"&&b.setCenter(l)},[b,l]),i.useEffect(()=>{b&&c&&(O!==null&&google.maps.event.removeListener(O),j(google.maps.event.addListener(b,"dblclick",c)))},[c]),i.useEffect(()=>{b&&d&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(b,"dragend",d)))},[d]),i.useEffect(()=>{b&&p&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(b,"dragstart",p)))},[p]),i.useEffect(()=>{b&&m&&(W!==null&&google.maps.event.removeListener(W),J(google.maps.event.addListener(b,"mousedown",m)))},[m]),i.useEffect(()=>{b&&f&&(F!==null&&google.maps.event.removeListener(F),K(google.maps.event.addListener(b,"mousemove",f)))},[f]),i.useEffect(()=>{b&&y&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(b,"mouseout",y)))},[y]),i.useEffect(()=>{b&&h&&(Y!==null&&google.maps.event.removeListener(Y),N(google.maps.event.addListener(b,"mouseover",h)))},[h]),i.useEffect(()=>{b&&v&&(X!==null&&google.maps.event.removeListener(X),x(google.maps.event.addListener(b,"mouseup",v)))},[v]),i.useEffect(()=>{b&&C&&(G!==null&&google.maps.event.removeListener(G),ne(google.maps.event.addListener(b,"rightclick",C)))},[C]),i.useEffect(()=>{b&&u&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(b,"click",u)))},[u]),i.useEffect(()=>{b&&g&&(R!==null&&google.maps.event.removeListener(R),q(google.maps.event.addListener(b,"drag",g)))},[g]),i.useEffect(()=>{b&&k&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(b,"center_changed",k)))},[u]),i.useEffect(()=>{var ae=w.current===null?null:new google.maps.Map(w.current,n);return L(ae),ae!==null&&P&&P(ae),()=>{ae!==null&&E&&E(ae)}},[]),oe.jsx("div",{id:s,ref:w,style:r,className:o,children:oe.jsx(V.Provider,{value:b,children:b!==null?e:null})})}i.memo(Xi);class eo extends i.PureComponent{constructor(){super(...arguments),M(this,"state",{map:null}),M(this,"registeredEvents",[]),M(this,"mapRef",null),M(this,"getInstance",()=>this.mapRef===null?null:new google.maps.Map(this.mapRef,this.props.options)),M(this,"panTo",e=>{var n=this.getInstance();n&&n.panTo(e)}),M(this,"setMapCallback",()=>{this.state.map!==null&&this.props.onLoad&&this.props.onLoad(this.state.map)}),M(this,"getRef",e=>{this.mapRef=e})}componentDidMount(){var e=this.getInstance();this.registeredEvents=Z({updaterMap:Mn,eventMap:xn,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{map:e}},this.setMapCallback)}componentDidUpdate(e){this.state.map!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Mn,eventMap:xn,prevProps:e,nextProps:this.props,instance:this.state.map}))}componentWillUnmount(){this.state.map!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),H(this.registeredEvents))}render(){return oe.jsx("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName,children:oe.jsx(V.Provider,{value:this.state.map,children:this.state.map!==null?this.props.children:null})})}}function Sn(t,e,n,s,r,o,l){try{var u=t[o](l),c=u.value}catch(g){return void n(g)}u.done?e(c):Promise.resolve(c).then(s,r)}function ar(t){return function(){var e=this,n=arguments;
3return new Promise(function(s,r){var o=t.apply(e,n);function l(c){Sn(o,s,r,l,u,"next",c)}function u(c){Sn(o,s,r,l,u,"throw",c)}l(void 0)})}}function lr(t){var{googleMapsApiKey:e,googleMapsClientId:n,version:s="weekly",language:r,region:o,libraries:l,channel:u,mapIds:c,authReferrerPolicy:g,apiUrl:d="https://maps.googleapis.com"}=t,p=[];return se(e&&n||!(e&&n),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),e?p.push("key=".concat(e)):n&&p.push("client=".concat(n)),s&&p.push("v=".concat(s)),r&&p.push("language=".concat(r)),o&&p.push("region=".concat(o)),l&&l.length&&p.push("libraries=".concat(l.sort().join(","))),u&&p.push("channel=".concat(u)),c&&c.length&&p.push("map_ids=".concat(c.join(","))),g&&p.push("auth_referrer_policy=".concat(g)),p.push("loading=async"),p.push("callback=initMap"),"".concat(d,"/maps/api/js?").concat(p.join("&"))}var fe=typeof document<"u";function ur(t){var{url:e,id:n,nonce:s}=t;return fe?new Promise(function(o,l){var u=document.getElementById(n),c=window;if(u){var g=u.getAttribute("data-state");if(u.src===e&&g!=="error"){if(g==="ready")return o(n);var d=c.initMap,p=u.onerror;c.initMap=function(){d&&d(),o(n)},u.onerror=function(y){p&&p(y),l(y)};return}else u.remove()}var f=document.createElement("script");f.type="text/javascript",f.src=e,f.id=n,f.async=!0,f.nonce=s||"",f.onerror=function(h){f.setAttribute("data-state","error"),l(h)},c.initMap=function(){f.setAttribute("data-state","ready"),o(n)},document.head.appendChild(f)}).catch(r=>{throw console.error("injectScript error: ",r),r}):Promise.reject(new Error("document is undefined"))}function kn(t){var e=t.href;return e&&(e.indexOf("https://fonts.googleapis.com/css?family=Roboto")===0||e.indexOf("https://fonts.googleapis.com/css?family=Google+Sans+Text")===0)?!0:t.tagName.toLowerCase()==="style"&&t.styleSheet&&t.styleSheet.cssText&&t.styleSheet.cssText.replace(`\r 4`,"").indexOf(".gm-style")===0?(t.styleSheet.cssText="",!0):t.tagName.toLowerCase()==="style"&&t.innerHTML&&t.innerHTML.replace(`\r 5`,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function Ft(){var t=document.getElementsByTagName("head")[0];if(t){var e=t.insertBefore.bind(t);t.insertBefore=function(r,o){return kn(r)||Reflect.apply(e,t,[r,o]),r};var n=t.appendChild.bind(t);t.appendChild=function(r){return kn(r)||Reflect.apply(n,t,[r]),r}}}var Te=!1;function cr(){return oe.jsx("div",{children:"Loading..."})}var He={id:"script-loader",version:"weekly"};class to extends i.PureComponent{constructor(){super(...arguments),M(this,"check",null),M(this,"state",{loaded:!1}),M(this,"cleanupCallback",()=>{delete window.google.maps,this.injectScript()}),M(this,"isCleaningUp",ar(function*(){function e(n){if(!Te)n();else if(fe)var s=window.setInterval(function(){Te||(window.clearInterval(s),n())},1)}return new Promise(e)})),M(this,"cleanup",()=>{Te=!0;var e=document.getElementById(this.props.id);e&&e.parentNode&&e.parentNode.removeChild(e),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(s){return typeof s.src=="string"&&s.src.includes("maps.googleapis")}).forEach(function(s){s.parentNode&&s.parentNode.removeChild(s)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(s){return s.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}
5).forEach(function(s){s.parentNode&&s.parentNode.removeChild(s)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(s){return s.innerText!==void 0&&s.innerText.length>0&&s.innerText.includes(".gm-")}).forEach(function(s){s.parentNode&&s.parentNode.removeChild(s)})}),M(this,"injectScript",()=>{this.props.preventGoogleFontsLoading&&Ft(),se(!!this.props.id,'LoadScript requires "id" prop to be a string: %s',this.props.id);var e={id:this.props.id,nonce:this.props.nonce,url:lr(this.props)};ur(e).then(()=>{this.props.onLoad&&this.props.onLoad(),this.setState(function(){return{loaded:!0}})}).catch(n=>{this.props.onError&&this.props.onError(n),console.error(` 6 There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(this.props.googleMapsApiKey||"-",") or Client ID (").concat(this.props.googleMapsClientId||"-",`) to <LoadScript /> 7 Otherwise it is a Network issue. 8 `))})}),M(this,"getRef",e=>{this.check=e})}componentDidMount(){if(fe){if(window.google&&window.google.maps&&!Te){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(n){console.error("Error at injecting script after cleaning up: ",n)})}}componentDidUpdate(e){this.props.libraries!==e.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),fe&&e.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))}componentWillUnmount(){if(fe){this.cleanup();var e=()=>{this.check||(delete window.google,Te=!1)};window.setTimeout(e,1),this.props.onUnmount&&this.props.onUnmount()}}render(){return oe.jsxs(oe.Fragment,{children:[oe.jsx("div",{ref:this.getRef}),this.state.loaded?this.props.children:this.props.loadingElement||oe.jsx(cr,{})]})}}M(to,"defaultProps",He);function no(t,e){if(t==null)return{};var n={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.includes(s))continue;n[s]=t[s]}return n}function $t(t,e){if(t==null)return{};var n,s,r=no(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)n=o[s],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var Pn;function so(t){var{id:e=He.id,version:n=He.version,nonce:s,googleMapsApiKey:r,googleMapsClientId:o,language:l,region:u,libraries:c,preventGoogleFontsLoading:g,channel:d,mapIds:p,authReferrerPolicy:f,apiUrl:y="https://maps.googleapis.com"}=t,h=i.useRef(!1),[m,v]=i.useState(!1),[C,k]=i.useState(void 0);i.useEffect(function(){return h.current=!0,()=>{h.current=!1}},[]),i.useEffect(function(){fe&&g&&Ft()},[g]),i.useEffect(function(){m&&se(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[m]);var P=lr({version:n,googleMapsApiKey:r,googleMapsClientId:o,language:l,region:u,libraries:c,channel:d,mapIds:p,authReferrerPolicy:f,apiUrl:y});i.useEffect(function(){if(!fe)return;function L(){h.current&&(v(!0),Pn=P)}if(window.google&&window.google.maps&&Pn===P){L();return}ur({id:e,url:P,nonce:s}).then(L).catch(function(I){h.current&&k(I),console.warn(` 9 There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(r||"-",") or Client ID (").concat(o||"-",`) 10 Otherwise it is a Network issue. 11 `)),console.error(I)})},[e,P,s]);var E=i.useRef(void 0);return i.useEffect(function(){E.current&&c!==E.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),E.current=c},[c]),{isLoaded:m,loadError:C,url:P}}var ro=["loadingElement","onLoad","onError","onUnmount","children"],io=oe.jsx(cr,{});function oo(t){var{loadingElement:e,onLoad:n,onError:s,onUnmount:r,children:o}=t,l=$t(t,ro),{isLoaded:u,loadError:c}=so(l);return i.useEffect(function(){u&&typeof n=="function"&&n()},[u,n]),i.useEffect(function(){c&&typeof s=="function"&&s(c)},[c,s]),i.useEffect(function(){return()=>{r&&r()}},[r]),u?o:e||io}i.memo(oo);function ao(t,e,n,s){function r(o){return o instanceof n?o:new n(function(l){l(o)})}
11return new(n||(n=Promise))(function(o,l){function u(d){try{g(s.next(d))}catch(p){l(p)}}function c(d){try{g(s.throw(d))}catch(p){l(p)}}function g(d){d.done?o(d.value):r(d.value).then(u,c)}g((s=s.apply(t,[])).next())})}function lo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var uo=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var s,r,o;if(Array.isArray(e)){if(s=e.length,s!=n.length)return!1;for(r=s;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),s=o.length,s!==Object.keys(n).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=s;r--!==0;){var l=o[r];if(!t(e[l],n[l]))return!1}return!0}return e!==e&&n!==n},co=lo(uo),On="__googleMapsScriptId",we;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(we||(we={}));class ye{constructor(e){var{apiKey:n,authReferrerPolicy:s,channel:r,client:o,id:l=On,language:u,libraries:c=[],mapIds:g,nonce:d,region:p,retries:f=3,url:y="https://maps.googleapis.com/maps/api/js",version:h}=e;if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=n,this.authReferrerPolicy=s,this.channel=r,this.client=o,this.id=l||On,this.language=u,this.libraries=c,this.mapIds=g,this.nonce=d,this.region=p,this.retries=f,this.url=y,this.version=h,ye.instance){if(!co(this.options,ye.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(ye.instance.options)));return ye.instance}ye.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?we.FAILURE:this.done?we.SUCCESS:this.loading?we.LOADING:we.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){var e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+="&key=".concat(this.apiKey)),this.channel&&(e+="&channel=".concat(this.channel)),this.client&&(e+="&client=".concat(this.client)),this.libraries.length>0&&(e+="&libraries=".concat(this.libraries.join(","))),this.language&&(e+="&language=".concat(this.language)),this.region&&(e+="®ion=".concat(this.region)),this.version&&(e+="&v=".concat(this.version)),this.mapIds&&(e+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(e+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),e}deleteScript(){var e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,n)=>{this.loadCallback(s=>{s?n(s.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,n;if(document.getElementById(this.id)){this.callback();return}var s={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(s).forEach(o=>!s[o]&&delete s[o]),!((n=(e=window?.google)===null||e===void 0?void 0:e.maps)===null||n===void 0)&&n.importLibrary||(o=>{var l,u,c,g="The Google Maps JavaScript API",d="google",p="importLibrary",f="__ib__",y=document,h=window;h=h[d]||(h[d]={});var m=h.maps||(h.maps={}),v=new Set,C=new URLSearchParams,k=()=>l||(l=new Promise((P,E)=>ao(this,void 0,void 0,function*(){var b;yield u=y.createElement("script"),u.id=this.id,C.set("libraries",[...v]+"");for(c in o)C.set(c.replace(/[A-Z]/g,L=>"_"+L[0].toLowerCase()),o[c]);C.set("callback",d+".maps."+f),u.src=this.url+"?"+C,m[f]=P,u.onerror=()=>l=E(Error(g+" could not load.")),u.nonce=this.nonce||((b=y.querySelector("script[n
11once]"))===null||b===void 0?void 0:b.nonce)||"",y.head.append(u)})));m[p]?console.warn(g+" only loads once. Ignoring:",o):m[p]=function(P){for(var E=arguments.length,b=new Array(E>1?E-1:0),L=1;L<E;L++)b[L-1]=arguments[L];return v.add(P)&&k().then(()=>m[p](P,...b))}})(s);var r=this.libraries.map(o=>this.importLibrary(o));r.length||r.push(this.importLibrary("core")),Promise.all(r).then(()=>this.callback(),o=>{var l=new ErrorEvent("error",{error:o});this.loadErrorCallback(l)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){var n=this.errors.length*Math.pow(2,this.errors.length);console.error("Failed to load Google Maps script, retrying in ".concat(n," ms.")),setTimeout(()=>{this.deleteScript(),this.setScript()},n)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}var po=["maps"];function go(t){var{id:e=He.id,version:n=He.version,nonce:s,googleMapsApiKey:r,language:o,region:l,libraries:u=po,preventGoogleFontsLoading:c,mapIds:g,authReferrerPolicy:d}=t,p=i.useRef(!1),[f,y]=i.useState(!1),[h,m]=i.useState(void 0);i.useEffect(function(){return p.current=!0,()=>{p.current=!1}},[]);var v=i.useMemo(()=>new ye({id:e,apiKey:r,version:n,libraries:u,language:o||"en",region:l||"US",mapIds:g||[],nonce:s||"",authReferrerPolicy:d||"origin"}),[e,r,n,u,o,l,g,s,d]);i.useEffect(function(){f||v.load().then(()=>{p.current&&y(!0)}).catch(P=>{m(P)})},[]),i.useEffect(()=>{fe&&c&&Ft()},[c]);var C=i.useRef();return i.useEffect(()=>{C.current&&u!==C.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),C.current=u},[u]),{isLoaded:f,loadError:h}}function _n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function mt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_n(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var In={},Dn={options(t,e){t.setOptions(e)}};function fo(t){var{options:e,onLoad:n,onUnmount:s}=t,r=i.useContext(V),[o,l]=i.useState(null);return i.useEffect(()=>{o!==null&&o.setMap(r)},[r]),i.useEffect(()=>{e&&o!==null&&o.setOptions(e)},[o,e]),i.useEffect(()=>{var u=new google.maps.TrafficLayer(mt(mt({},e),{},{map:r}));return l(u),n&&n(u),()=>{o!==null&&(s&&s(o),o.setMap(null))}},[]),null}i.memo(fo);class ho extends i.PureComponent{constructor(){super(...arguments),M(this,"state",{trafficLayer:null}),M(this,"setTrafficLayerCallback",()=>{this.state.trafficLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.trafficLayer)}),M(this,"registeredEvents",[])}componentDidMount(){var e=new google.maps.TrafficLayer(mt(mt({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:Dn,eventMap:In,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{trafficLayer:e}},this.setTrafficLayerCallback)}componentDidUpdate(e){this.state.trafficLayer!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Dn,eventMap:In,prevProps:e,nextProps:this.props,instance:this.state.trafficLayer}))}componentWillUnmount(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),H(this.registeredEvents),this.state.trafficLayer.setMap(null))}render(){return null}}M(ho,"contextType",V);function mo(t){var{onLoad:e,onUnmount:n}=t,s=i.useContext(V),[r,o]=i.useState(null);return i.useEffect(()=>{r!==null&&r.setMap(s)},[s]),i.useEffect(()=>{var l=new google.maps.BicyclingLayer;return o(l),l.setMap(s),e&&e(l),()=>{l!==null&&(n&&n(l),l.setMap(null))}},[]),null}i.memo(mo);class vo extends i.PureComponent{constructor(){super(...arguments),M(this,"state",{bicyclingLayer:null}),M(this,"setBicyclingLayerCallback",()=>{this.state.bicyclingLayer!==null&&(this.state.bicyclingLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.bicyclingLayer))})}componentDidMount(){var e=new google.maps.BicyclingLayer;this.setState(()=>({bicyclingLayer:e}),this.setBicyclingLayerCallback)}componentWillUnmount(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))}render(){return null}}M(vo,"contextType",V);function yo(t){var{onLoad:e,onUnmount:n}=t,s=i.useContext(V),[r,o]=i.useState(null);return i.useEffect(()=>{r!==null&&r.setMap(s)},[s]),i.useEffect(()=>{var l=new google.maps.TransitLayer;return o(l),l.setMap(s),e&&e(l),()=>{r!==null&&(n&&n(r),r.setMap(null))}},[]),null}i.memo(yo);class bo extends i.PureComponent{constructor(){super(...arguments),M(this,"state",{transitLayer:null}),M(this,"setTransitLayerCallback",()=>{this.state.transitLayer!==null&&(this.state.transitLayer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.transitLayer))})}componentDidMount(){var e=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:e}},this.setTransitLayerCallback)}componentWillUnmount(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))}render(){return null}}M(bo,"contextType",V);function Rn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function vt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
11e%2?Rn(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var jn={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},Nn={drawingMode(t,e){t.setDrawingMode(e)},options(t,e){t.setOptions(e)}};function Lo(t){var{options:e,drawingMode:n,onCircleComplete:s,onMarkerComplete:r,onOverlayComplete:o,onPolygonComplete:l,onPolylineComplete:u,onRectangleComplete:c,onLoad:g,onUnmount:d}=t,p=i.useContext(V),[f,y]=i.useState(null),[h,m]=i.useState(null),[v,C]=i.useState(null),[k,P]=i.useState(null),[E,b]=i.useState(null),[L,w]=i.useState(null),[I,S]=i.useState(null);return i.useEffect(()=>{f!==null&&f.setMap(p)},[p]),i.useEffect(()=>{e&&f!==null&&f.setOptions(e)},[f,e]),i.useEffect(()=>{f!==null&&f.setDrawingMode(n??null)},[f,n]),i.useEffect(()=>{f&&s&&(h!==null&&google.maps.event.removeListener(h),m(google.maps.event.addListener(f,"circlecomplete",s)))},[f,s]),i.useEffect(()=>{f&&r&&(v!==null&&google.maps.event.removeListener(v),C(google.maps.event.addListener(f,"markercomplete",r)))},[f,r]),i.useEffect(()=>{f&&o&&(k!==null&&google.maps.event.removeListener(k),P(google.maps.event.addListener(f,"overlaycomplete",o)))},[f,o]),i.useEffect(()=>{f&&l&&(E!==null&&google.maps.event.removeListener(E),b(google.maps.event.addListener(f,"polygoncomplete",l)))},[f,l]),i.useEffect(()=>{f&&u&&(L!==null&&google.maps.event.removeListener(L),w(google.maps.event.addListener(f,"polylinecomplete",u)))},[f,u]),i.useEffect(()=>{f&&c&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(f,"rectanglecomplete",c)))},[f,c]),i.useEffect(()=>{se(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var O=new google.maps.drawing.DrawingManager(vt(vt({},e),{},{map:p}));return n&&O.setDrawingMode(n),s&&m(google.maps.event.addListener(O,"circlecomplete",s)),r&&C(google.maps.event.addListener(O,"markercomplete",r)),o&&P(google.maps.event.addListener(O,"overlaycomplete",o)),l&&b(google.maps.event.addListener(O,"polygoncomplete",l)),u&&w(google.maps.event.addListener(O,"polylinecomplete",u)),c&&S(google.maps.event.addListener(O,"rectanglecomplete",c)),y(O),g&&g(O),()=>{f!==null&&(h&&google.maps.event.removeListener(h),v&&google.maps.event.removeListener(v),k&&google.maps.event.removeListener(k),E&&google.maps.event.removeListener(E),L&&google.maps.event.removeListener(L),I&&google.maps.event.removeListener(I),d&&d(f),f.setMap(null))}},[]),null}i.memo(Lo);class Eo extends i.PureComponent{constructor(e){super(e),M(this,"registeredEvents",[]),M(this,"state",{drawingManager:null}),M(this,"setDrawingManagerCallback",()=>{this.state.drawingManager!==null&&this.props.onLoad&&this.props.onLoad(this.state.drawingManager)}),se(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing)}componentDidMount(){var e=new google.maps.drawing.DrawingManager(vt(vt({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:Nn,eventMap:jn,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{drawingManager:e}},this.setDrawingManagerCallback)}componentDidUpdate(e){this.state.drawingManager!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Nn,eventMap:jn,prevProps:e,nextProps:this.props,instance:this.state.drawingManager}))}componentWillUnmount(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),H(this.registeredEvents),this.state.drawingManager.setMap(null))}render(){return null}}M(Eo,"contextType",V);function An(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Me(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
11e%2?An(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var Tn={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},Un={animation(t,e){t.setAnimation(e)},clickable(t,e){t.setClickable(e)},cursor(t,e){t.setCursor(e)},draggable(t,e){t.setDraggable(e)},icon(t,e){t.setIcon(e)},label(t,e){t.setLabel(e)},map(t,e){t.setMap(e)},opacity(t,e){t.setOpacity(e)},options(t,e){t.setOptions(e)},position(t,e){t.setPosition(e)},shape(t,e){t.setShape(e)},title(t,e){t.setTitle(e)},visible(t,e){t.setVisible(e)},zIndex(t,e){t.setZIndex(e)}},yt={};function Co(t){var{position:e,options:n,clusterer:s,noClustererRedraw:r,children:o,draggable:l,visible:u,animation:c,clickable:g,cursor:d,icon:p,label:f,opacity:y,shape:h,title:m,zIndex:v,onClick:C,onDblClick:k,onDrag:P,onDragEnd:E,onDragStart:b,onMouseOut:L,onMouseOver:w,onMouseUp:I,onMouseDown:S,onRightClick:O,onClickableChanged:j,onCursorChanged:D,onAnimationChanged:U,onDraggableChanged:A,onFlatChanged:T,onIconChanged:W,onPositionChanged:J,onShapeChanged:F,onTitleChanged:K,onVisibleChanged:$,onZindexChanged:Q,onLoad:Y,onUnmount:N}=t,X=i.useContext(V),[x,G]=i.useState(null),[ne,B]=i.useState(null),[_,R]=i.useState(null),[q,ae]=i.useState(null),[ie,De]=i.useState(null),[te,Yt]=i.useState(null),[qe,Jt]=i.useState(null),[Ke,Qt]=i.useState(null),[Ye,Xt]=i.useState(null),[Je,en]=i.useState(null),[tn,nn]=i.useState(null),[Qe,sn]=i.useState(null),[Xe,rn]=i.useState(null),[et,on]=i.useState(null),[tt,an]=i.useState(null),[nt,ln]=i.useState(null),[st,un]=i.useState(null),[rt,cn]=i.useState(null),[dn,pn]=i.useState(null),[it,gn]=i.useState(null),[ot,fn]=i.useState(null),[at,hn]=i.useState(null);i.useEffect(()=>{x!==null&&x.setMap(X)},[X]),i.useEffect(()=>{typeof n<"u"&&x!==null&&x.setOptions(n)},[x,n]),i.useEffect(()=>{typeof l<"u"&&x!==null&&x.setDraggable(l)},[x,l]),i.useEffect(()=>{e&&x!==null&&x.setPosition(e)},[x,e]),i.useEffect(()=>{typeof u<"u"&&x!==null&&x.setVisible(u)},[x,u]),i.useEffect(()=>{x?.setAnimation(c)},[x,c]),i.useEffect(()=>{x&&g!==void 0&&x.setClickable(g)},[x,g]),i.useEffect(()=>{x&&d!==void 0&&x.setCursor(d)},[x,d]),i.useEffect(()=>{x&&p!==void 0&&x.setIcon(p)},[x,p]),i.useEffect(()=>{x&&f!==void 0&&x.setLabel(f)},[x,f]),i.useEffect(()=>{x&&y!==void 0&&x.setOpacity(y)},[x,y]),i.useEffect(()=>{x&&h!==void 0&&x.setShape(h)},[x,h]),i.useEffect(()=>{x&&m!==void 0&&x.setTitle(m)},[x,m]),i.useEffect(()=>{x&&v!==void 0&&x.setZIndex(v)},[x,v]),i.useEffect(()=>{x&&k&&(ne!==null&&google.maps.event.removeListener(ne),B(google.maps.event.addListener(x,"dblclick",k)))},[k]),i.useEffect(()=>{x&&E&&(_!==null&&google.maps.event.removeListener(_),R(google.maps.event.addListener(x,"dragend",E)))},[E]),i.useEffect(()=>{x&&b&&(q!==null&&google.maps.event.removeListener(q),ae(google.maps.event.addListener(x,"dragstart",b)))},[b]),i.useEffect(()=>{x&&S&&(ie!==null&&google.maps.event.removeListener(ie),De(google.maps.event.addListener(x,"mousedown",S)))},[S]),i.useEffect(()=>{x&&L&&(te!==null&&google.maps.event.removeListener(te),Yt(google.maps.event.addListener(x,"mouseout",L)))},[L]),i.useEffect(()=>{x&&w&&(qe!==null&&google.maps.event.removeListener(qe),Jt(google.maps.event.addListener(x,"mouseover",w)))},[w]),i.useEffect(()=>{x&&I&&(Ke!==null&&google.maps.event.removeListener(Ke),Qt(google.maps.event.addListener(x,"mouseup",I)))},[I]),i.useEffect(()=>{x&&O&&(Ye!==null&&google.maps.event.removeListener(Ye),Xt(google.maps.event.addListener(x,"rightclick",O)))},[O]),i.useEffect(()=>{x&&C&&(Je!==null&&google.maps.event.removeListener(Je),en(google.maps.event.addListener(x,"click",C)))},[C]),i.useEffect(()=>{x&&P&&(tn!==null&&google.maps.event.removeListener(tn),nn(google.maps.event.addListener(x,"drag",P)))},[P]),i.useEffect(()=>{x&&j&&(Qe!==null&&google.maps.event.removeListener(Qe),sn(google.maps.event.addListener(x,"clickable_changed",j)))},[j]),i.useEffect(()=>{x&&D&&(Xe!==null&&google.maps.event.removeListener(Xe),rn(google.maps.event.addListener(x,"cursor_changed",D)))},[D]),i.useEffect(()=>{x&&U&&(et!==null&&google.maps.event.removeListener(et),on(google.maps.event.addListener(x,"animation_changed",U)))},[U]),i.useEffect(()=>{x&&A&&(tt!==null&&google.maps.event.removeListener(tt),an(google.maps.event.addListener(x,"draggable_changed",A)))},[A]),i.useEffect(()=>{x&&T&&(nt!==null&&google.maps.event.removeListener(nt),ln(google.maps.event.addListener(x,"flat_changed",T)))},[T]),i.useEffect(()=>{x&&W&&(st!==null&&google.maps.event.removeListener(st),un(google.maps.event.addListener(x,"icon_changed",W)))},[W]),i.useEffect(()=>{x&&J&&(rt!==null&&google.maps.event.removeListener(rt),cn(google.maps.event.addListener(x,"position_changed",J)))},[J]),i.useEffect(()=>{x&&F&&(dn!==null&&google.maps.event.removeListener(dn),pn(google.maps.event.addListener(x,"shape_changed",F)))},[F]),i.useEffect(()=>{x&&K&&(it!==null&&google.maps.event.removeListener(it),gn(google.maps.event.addListener(x,"title_changed",K)))},[K]),i.useEffect(()=>{x&&$&&(ot!==null&&google.maps.event.removeListener(ot),fn(google.maps.event.addListener(x,"visible_changed",$)))},[$]),i.useEffect(()=>{x&&Q&&(at!==null&&google.maps.event.removeListener(at),hn(google.maps.event.addListener(x,"zindex_changed",Q)))},[Q]),i.useEffect(()=>{var Re=Me(Me(Me({},n||yt),s?yt:{map:X}),{},{position:e}),z=new google.maps.Marker(Re);return s?s.addMarker(z,!!r):z.setMap(X),e&&z.setPosition(e),typeof u<"u"&&z.setVisible(u),typeof l<"u"&&z.setDraggable(l),typeof g<"u"&&z.setClickable(g),t
11ypeof d=="string"&&z.setCursor(d),p&&z.setIcon(p),typeof f<"u"&&z.setLabel(f),typeof y<"u"&&z.setOpacity(y),h&&z.setShape(h),typeof m=="string"&&z.setTitle(m),typeof v=="number"&&z.setZIndex(v),k&&B(google.maps.event.addListener(z,"dblclick",k)),E&&R(google.maps.event.addListener(z,"dragend",E)),b&&ae(google.maps.event.addListener(z,"dragstart",b)),S&&De(google.maps.event.addListener(z,"mousedown",S)),L&&Yt(google.maps.event.addListener(z,"mouseout",L)),w&&Jt(google.maps.event.addListener(z,"mouseover",w)),I&&Qt(google.maps.event.addListener(z,"mouseup",I)),O&&Xt(google.maps.event.addListener(z,"rightclick",O)),C&&en(google.maps.event.addListener(z,"click",C)),P&&nn(google.maps.event.addListener(z,"drag",P)),j&&sn(google.maps.event.addListener(z,"clickable_changed",j)),D&&rn(google.maps.event.addListener(z,"cursor_changed",D)),U&&on(google.maps.event.addListener(z,"animation_changed",U)),A&&an(google.maps.event.addListener(z,"draggable_changed",A)),T&&ln(google.maps.event.addListener(z,"flat_changed",T)),W&&un(google.maps.event.addListener(z,"icon_changed",W)),J&&cn(google.maps.event.addListener(z,"position_changed",J)),F&&pn(google.maps.event.addListener(z,"shape_changed",F)),K&&gn(google.maps.event.addListener(z,"title_changed",K)),$&&fn(google.maps.event.addListener(z,"visible_changed",$)),Q&&hn(google.maps.event.addListener(z,"zindex_changed",Q)),G(z),Y&&Y(z),()=>{ne!==null&&google.maps.event.removeListener(ne),_!==null&&google.maps.event.removeListener(_),q!==null&&google.maps.event.removeListener(q),ie!==null&&google.maps.event.removeListener(ie),te!==null&&google.maps.event.removeListener(te),qe!==null&&google.maps.event.removeListener(qe),Ke!==null&&google.maps.event.removeListener(Ke),Ye!==null&&google.maps.event.removeListener(Ye),Je!==null&&google.maps.event.removeListener(Je),Qe!==null&&google.maps.event.removeListener(Qe),Xe!==null&&google.maps.event.removeListener(Xe),et!==null&&google.maps.event.removeListener(et),tt!==null&&google.maps.event.removeListener(tt),nt!==null&&google.maps.event.removeListener(nt),st!==null&&google.maps.event.removeListener(st),rt!==null&&google.maps.event.removeListener(rt),it!==null&&google.maps.event.removeListener(it),ot!==null&&google.maps.event.removeListener(ot),at!==null&&google.maps.event.removeListener(at),N&&N(z),s?s.removeMarker(z,!!r):z&&z.setMap(null)}},[]);var Mr=i.useMemo(()=>o?i.Children.map(o,Re=>{if(!i.isValidElement(Re))return Re;var z=Re;return i.cloneElement(z,{anchor:x})}):null,[o,x]);return oe.jsx(oe.Fragment,{children:Mr})||null}i.memo(Co);class wo extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[])}componentDidMount(){var e=this;return ar(function*(){var n=Me(Me(Me({},e.props.options||yt),e.props.clusterer?yt:{map:e.context}),{},{position:e.props.position});e.marker=new google.maps.Marker(n),e.props.clusterer?e.props.clusterer.addMarker(e.marker,!!e.props.noClustererRedraw):e.marker.setMap(e.context),e.registeredEvents=Z({updaterMap:Un,eventMap:Tn,prevProps:{},nextProps:e.props,instance:e.marker}),e.props.onLoad&&e.props.onLoad(e.marker)})()}componentDidUpdate(e){this.marker&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Un,eventMap:Tn,prevProps:e,nextProps:this.props,instance:this.marker}))}componentWillUnmount(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),H(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))}render(){var e=this.props.children?i.Children.map(this.props.children,n=>{if(!i.isValidElement(n))return n;var s=n;return i.cloneElement(s,{anchor:this.marker})}):null;return e||null}}M(wo,"contextType",V);var xo=(function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var s=n.getMaxZoom(),r=this.cluster.getBounds(),o=n.getMap();o!==null&&"fitBounds"in o&&o.fitBounds(r),this.timeOut=window.setTimeout(function(){var l=n.getMap();if(l!==null){"fitBounds"in l&&l.fitBounds(r);var u=l.getZoom()||0;s!==null&&u>s&&l.setZoom(s+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},t.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,s,r,o,l;if(this.div&&this.center){var u=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,c=this.backgroundPosition.split(" "),g=parseInt(((e=c[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),d=parseInt(((n=c[1])===null||n===void 0?void 0:n.replace(/^\s+|\s+$/g,""))||"0",10),p=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(p!==null?"".concat(p.y,"px"):"0","; left: ").concat(p!==null?"".concat(p.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var f=document.createElement("img");f.alt=u,f.src=this.url,f.width=this.width,f.height=this.height,f.setAttribute("style","position: absolute; top: ".concat(d,"px; left: ").concat(g,"px")),this.cluster.getClusterer().enableRetinaIcons||(f.style.clip="rect(-".concat(d,"px, -").concat(g+this.width,"px, -").concat(d+this.height,", -").concat(g,")"));var y=document.createElement("div");y.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((s=this.sums)===null||s===void 0)&&s.text&&(y.innerText="".concat((r=this.sums)===null||r===void 0?void 0:r.text)),!((o=this.sums)===null||o===void 0)&&o.html&&(y.innerHTML="".concat((l=this.sums)===null||l===void 0?void 0:l.html)),this.div.innerHTML="",this.div.appendChild(f),this.div.appendChild(y),this.div.title=u,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),s=n[Math.min(n.length-1,Math.max(0,e.index-1))];s&&(this.url=s.url,this.height=s.height,this.width=s.width,s.className&&(this.className="".concat(this.clusterClassName," ").concat(s.className)),this.anchorText=s.anch
11orText||[0,0],this.anchorIcon=s.anchorIcon||[this.height/2,this.width/2],this.textColor=s.textColor||"black",this.textSize=s.textSize||11,this.textDecoration=s.textDecoration||"none",this.fontWeight=s.fontWeight||"bold",this.fontStyle=s.fontStyle||"normal",this.fontFamily=s.fontFamily||"Arial,sans-serif",this.backgroundPosition=s.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t})(),Mo=(function(){function t(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new xo(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),s=0,r=n;s<r.length;s++){var o=r[s],l=o.getPosition();l&&e.extend(l)}return e},t.prototype.remove=function(){this.clusterIcon.setMap(null),this.markers=[],delete this.markers},t.prototype.addMarker=function(e){var n;if(this.isMarkerAlreadyAdded(e))return!1;if(this.center){if(this.averageCenter){var s=e.getPosition();if(s){var r=this.markers.length+1;this.center=new google.maps.LatLng((this.center.lat()*(r-1)+s.lat())/r,(this.center.lng()*(r-1)+s.lng())/r),this.calculateBounds()}}}else{var s=e.getPosition();s&&(this.center=s,this.calculateBounds())}e.isAdded=!0,this.markers.push(e);var o=this.markers.length,l=this.markerClusterer.getMaxZoom(),u=(n=this.map)===null||n===void 0?void 0:n.getZoom();if(l!==null&&typeof u<"u"&&u>l)e.getMap()!==this.map&&e.setMap(this.map);else if(o<this.minClusterSize)e.getMap()!==this.map&&e.setMap(this.map);else if(o===this.minClusterSize)for(var c=0,g=this.markers;c<g.length;c++){var d=g[c];d.setMap(null)}else e.setMap(null);return!0},t.prototype.isMarkerInClusterBounds=function(e){if(this.bounds!==null){var n=e.getPosition();if(n)return this.bounds.contains(n)}return!1},t.prototype.calculateBounds=function(){this.bounds=this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center,this.center))},t.prototype.updateIcon=function(){var e,n=this.markers.length,s=this.markerClusterer.getMaxZoom(),r=(e=this.map)===null||e===void 0?void 0:e.getZoom();if(s!==null&&typeof r<"u"&&r>s){this.clusterIcon.hide();return}if(n<this.minClusterSize){this.clusterIcon.hide();return}this.center&&this.clusterIcon.setCenter(this.center),this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers,this.markerClusterer.getStyles().length)),this.clusterIcon.show()},t.prototype.isMarkerAlreadyAdded=function(e){if(this.markers.includes)return this.markers.includes(e);for(var n=0;n<this.markers.length;n++)if(e===this.markers[n])return!0;return!1},t})();function So(t,e){var n=t.length,s=n.toString().length,r=Math.min(s,e);return{text:n.toString(),index:r,title:""}}var ko=2e3,Po=500,Oo="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m",_o="png",Io=[53,56,66,78,90],Do="cluster",dr=(function(){function t(e,n,s){n===void 0&&(n=[]),s===void 0&&(s={}),this.getMinimumClusterSize=this.getMinimumClusterSize.bind(this),this.setMinimumClusterSize=this.setMinimumClusterSize.bind(this),this.getEnableRetinaIcons=this.getEnableRetinaIcons.bind(this),this.setEnableRetinaIcons=this.setEnableRetinaIcons.bind(this),this.addToClosestCluster=this.addToClosestCluster.bind(this),this.getImageExtension=this.getImageExtension.bind(this),this.setImageExtension=this.setImageExtension.bind(this),this.getExtendedBounds=this.getExtendedBounds.bind(this),this.getAverageCenter=this.getAverageCenter.bind(this),this.setAverageCenter=this.setAverageCenter.bind(this),this.getTotalClusters=this.getTotalClusters.bind(this),this.fitMapToMarkers=this.fitMapToMarkers.bind(this),this.getIgnoreHidden=this.getIgnoreHidden.bind(this),this.setIgnoreHidden=this.setIgnoreHidden.bind(this),this.getClusterClass=this.getClusterClass.bind(this),this.setClusterClass=this.setClusterClass.bind(this),this.getTotalMarkers=this.getTotalMarkers.bind(this),this.getZoomOnClick=this.getZoomOnClick.bind(this),this.setZoomOnClick=this.setZoomOnClick.bind(this),this.getBatchSizeIE=this.getBatchSizeIE.bind(this),this.setBatchSizeIE=this.setBatchSizeIE.bind(this),this.createCluster
11s=this.createClusters.bind(this),this.onZoomChanged=this.onZoomChanged.bind(this),this.getImageSizes=this.getImageSizes.bind(this),this.setImageSizes=this.setImageSizes.bind(this),this.getCalculator=this.getCalculator.bind(this),this.setCalculator=this.setCalculator.bind(this),this.removeMarkers=this.removeMarkers.bind(this),this.resetViewport=this.resetViewport.bind(this),this.getImagePath=this.getImagePath.bind(this),this.setImagePath=this.setImagePath.bind(this),this.pushMarkerTo=this.pushMarkerTo.bind(this),this.removeMarker=this.removeMarker.bind(this),this.clearMarkers=this.clearMarkers.bind(this),this.setupStyles=this.setupStyles.bind(this),this.getGridSize=this.getGridSize.bind(this),this.setGridSize=this.setGridSize.bind(this),this.getClusters=this.getClusters.bind(this),this.getMaxZoom=this.getMaxZoom.bind(this),this.setMaxZoom=this.setMaxZoom.bind(this),this.getMarkers=this.getMarkers.bind(this),this.addMarkers=this.addMarkers.bind(this),this.getStyles=this.getStyles.bind(this),this.setStyles=this.setStyles.bind(this),this.addMarker=this.addMarker.bind(this),this.onRemove=this.onRemove.bind(this),this.getTitle=this.getTitle.bind(this),this.setTitle=this.setTitle.bind(this),this.repaint=this.repaint.bind(this),this.onIdle=this.onIdle.bind(this),this.redraw=this.redraw.bind(this),this.onAdd=this.onAdd.bind(this),this.draw=this.draw.bind(this),this.extend=this.extend.bind(this),this.extend(t,google.maps.OverlayView),this.markers=[],this.clusters=[],this.listeners=[],this.activeMap=null,this.ready=!1,this.gridSize=s.gridSize||60,this.minClusterSize=s.minimumClusterSize||2,this.maxZoom=s.maxZoom||null,this.styles=s.styles||[],this.title=s.title||"",this.zoomOnClick=!0,s.zoomOnClick!==void 0&&(this.zoomOnClick=s.zoomOnClick),this.averageCenter=!1,s.averageCenter!==void 0&&(this.averageCenter=s.averageCenter),this.ignoreHidden=!1,s.ignoreHidden!==void 0&&(this.ignoreHidden=s.ignoreHidden),this.enableRetinaIcons=!1,s.enableRetinaIcons!==void 0&&(this.enableRetinaIcons=s.enableRetinaIcons),this.imagePath=s.imagePath||Oo,this.imageExtension=s.imageExtension||_o,this.imageSizes=s.imageSizes||Io,this.calculator=s.calculator||So,this.batchSize=s.batchSize||ko,this.batchSizeIE=s.batchSizeIE||Po,this.clusterClass=s.clusterClass||Do,navigator.userAgent.toLowerCase().indexOf("msie")!==-1&&(this.batchSize=this.batchSizeIE),this.timerRefStatic=null,this.setupStyles(),this.addMarkers(n,!0),this.setMap(e)}return t.prototype.onZoomChanged=function(){var e,n;this.resetViewport(!1),(((e=this.getMap())===null||e===void 0?void 0:e.getZoom())===(this.get("minZoom")||0)||((n=this.getMap())===null||n===void 0?void 0:n.getZoom())===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")},t.prototype.onIdle=function(){this.redraw()},t.prototype.onAdd=function(){var e=this.getMap();this.activeMap=e,this.ready=!0,this.repaint(),e!==null&&(this.listeners=[google.maps.event.addListener(e,"zoom_changed",this.onZoomChanged),google.maps.event.addListener(e,"idle",this.onIdle)])},t.prototype.onRemove=function(){for(var e=0,n=this.markers;e<n.length;e++){var s=n[e];s.getMap()!==this.activeMap&&s.setMap(this.activeMap)}
11for(var r=0,o=this.clusters;r<o.length;r++){var l=o[r];l.remove()}this.clusters=[];for(var u=0,c=this.listeners;u<c.length;u++){var g=c[u];google.maps.event.removeListener(g)}this.listeners=[],this.activeMap=null,this.ready=!1},t.prototype.draw=function(){},t.prototype.getMap=function(){return null},t.prototype.getPanes=function(){return null},t.prototype.getProjection=function(){return{fromContainerPixelToLatLng:function(){return null},fromDivPixelToLatLng:function(){return null},fromLatLngToContainerPixel:function(){return null},fromLatLngToDivPixel:function(){return null},getVisibleRegion:function(){return null},getWorldWidth:function(){return 0}}},t.prototype.setMap=function(){},t.prototype.addListener=function(){return{remove:function(){}}},t.prototype.bindTo=function(){},t.prototype.get=function(){},t.prototype.notify=function(){},t.prototype.set=function(){},t.prototype.setValues=function(){},t.prototype.unbind=function(){},t.prototype.unbindAll=function(){},t.prototype.setupStyles=function(){if(!(this.styles.length>0))for(var e=0;e<this.imageSizes.length;e++)this.styles.push({url:"".concat(this.imagePath+(e+1),".").concat(this.imageExtension),height:this.imageSizes[e]||0,width:this.imageSizes[e]||0})},t.prototype.fitMapToMarkers=function(){for(var e=this.getMarkers(),n=new google.maps.LatLngBounds,s=0,r=e;s<r.length;s++){var o=r[s],l=o.getPosition();l&&n.extend(l)}var u=this.getMap();u!==null&&"fitBounds"in u&&u.fitBounds(n)},t.prototype.getGridSize=function(){return this.gridSize},t.prototype.setGridSize=function(e){this.gridSize=e},t.prototype.getMinimumClusterSize=function(){return this.minClusterSize},t.prototype.setMinimumClusterSize=function(e){this.minClusterSize=e},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.setMaxZoom=function(e){this.maxZoom=e},t.prototype.getStyles=function(){return this.styles},t.prototype.setStyles=function(e){this.styles=e},t.prototype.getTitle=function(){return this.title},t.prototype.setTitle=function(e){this.title=e},t.prototype.getZoomOnClick=function(){return this.zoomOnClick},t.prototype.setZoomOnClick=function(e){this.zoomOnClick=e},t.prototype.getAverageCenter=function(){return this.averageCenter},t.prototype.setAverageCenter=function(e){this.averageCenter=e},t.prototype.getIgnoreHidden=function(){return this.ignoreHidden},t.prototype.setIgnoreHidden=function(e){this.ignoreHidden=e},t.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons},t.prototype.setEnableRetinaIcons=function(e){this.enableRetinaIcons=e},t.prototype.getImageExtension=function(){return this.imageExtension},t.prototype.setImageExtension=function(e){this.imageExtension=e},t.prototype.getImagePath=function(){return this.imagePath},t.prototype.setImagePath=function(e){this.imagePath=e},t.prototype.getImageSizes=function(){return this.imageSizes},t.prototype.setImageSizes=function(e){this.imageSizes=e},t.prototype.getCalculator=function(){return this.calculator},t.prototype.setCalculator=function(e){this.calculator=e},t.prototype.getBatchSizeIE=function(){return this.batchSizeIE},t.prototype.setBatchSizeIE=function(e){this.batchSizeIE=e},t.prototype.getClusterClass=function(){return this.clusterClass},t.prototype.setClusterClass=function(e){this.clusterClass=e},t.prototype.getMarkers=function(){return this.markers},t.prototype.getTotalMarkers=function(){return this.markers.length},t.prototype.getClusters=function(){return this.clusters},t.prototype.getTotalClusters=function(){return this.clusters.length},t.prototype.addMarker=function(e,n){this.pushMarkerTo(e),n||this.redraw()},t.prototype.addMarkers=function(e,n){for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var r=e[s];r&&this.pushMarkerTo(r)}n||this.redraw()},t.prototype.pushMarkerTo=function(e){var n=this;e.getDraggable()&&google.maps.event.addListener(e,"dragend",function(){n.ready&&(e.isAdded=!1,n.repaint())}),e.isAdded=!1,this.markers.push(e)},t.prototype.removeMarker_=function(e){var n=-1;if(this.markers.indexOf)n=this.markers.indexOf(e);else for(var s=0;s<this.markers.length;s++)if(e===this.markers[s]){n=s;break}return n===-1?!1:(e.setMap(null),this.markers.splice(n,1),!0)},t.prototype.removeMarker=function(e,n){var s=this.removeMarker_(e);return!n&&s&&this.repaint(),s},t.prototype.removeMarkers=function(e,n){for(var s=!1,r=0,o=e;r<o.length;r++){var l=o[r];s=s||this.removeMarker_(l)}return!n&&s&&this.repaint(),s},t.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers=[]}
11,t.prototype.repaint=function(){var e=this.clusters.slice();this.clusters=[],this.resetViewport(!1),this.redraw(),setTimeout(function(){for(var s=0,r=e;s<r.length;s++){var o=r[s];o.remove()}},0)},t.prototype.getExtendedBounds=function(e){var n=this.getProjection(),s=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()));s!==null&&(s.x+=this.gridSize,s.y-=this.gridSize);var r=n.fromLatLngToDivPixel(new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()));if(r!==null&&(r.x-=this.gridSize,r.y+=this.gridSize),s!==null){var o=n.fromDivPixelToLatLng(s);o!==null&&e.extend(o)}if(r!==null){var l=n.fromDivPixelToLatLng(r);l!==null&&e.extend(l)}return e},t.prototype.redraw=function(){this.createClusters(0)},t.prototype.resetViewport=function(e){for(var n=0,s=this.clusters;n<s.length;n++){var r=s[n];r.remove()}this.clusters=[];for(var o=0,l=this.markers;o<l.length;o++){var u=l[o];u.isAdded=!1,e&&u.setMap(null)}},t.prototype.distanceBetweenPoints=function(e,n){var s=6371,r=(n.lat()-e.lat())*Math.PI/180,o=(n.lng()-e.lng())*Math.PI/180,l=Math.sin(r/2)*Math.sin(r/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(n.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return s*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))},t.prototype.isMarkerInBounds=function(e,n){var s=e.getPosition();return s?n.contains(s):!1},t.prototype.addToClosestCluster=function(e){for(var n,s=4e4,r=null,o=0,l=this.cluster
11s;o<l.length;o++){var u=l[o];n=u;var c=n.getCenter(),g=e.getPosition();if(c&&g){var d=this.distanceBetweenPoints(c,g);d<s&&(s=d,r=n)}}r&&r.isMarkerInClusterBounds(e)?r.addMarker(e):(n=new Mo(this),n.addMarker(e),this.clusters.push(n))},t.prototype.createClusters=function(e){var n=this;if(this.ready){e===0&&(google.maps.event.trigger(this,"clusteringbegin",this),this.timerRefStatic!==null&&(window.clearTimeout(this.timerRefStatic),delete this.timerRefStatic));for(var s=this.getMap(),r=s!==null&&("getBounds"in s)?s.getBounds():null,o=s?.getZoom()||0,l=o>3?new google.maps.LatLngBounds(r?.getSouthWest(),r?.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),u=this.getExtendedBounds(l),c=Math.min(e+this.batchSize,this.markers.length),g=e;g<c;g++){var d=this.markers[g];d&&!d.isAdded&&this.isMarkerInBounds(d,u)&&(!this.ignoreHidden||this.ignoreHidden&&d.getVisible())&&this.addToClosestCluster(d)}if(c<this.markers.length)this.timerRefStatic=window.setTimeout(function(){n.createClusters(c)},0);else{this.timerRefStatic=null,google.maps.event.trigger(this,"clusteringend",this);
11for(var p=0,f=this.clusters;p<f.length;p++){var y=f[p];y.updateIcon()}}}},t.prototype.extend=function(e,n){return(function(r){for(var o in r.prototype){var l=o;this.prototype[l]=r.prototype[l]}return this}).apply(e,[n])},t})();function Bn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Ro(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Bn(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var ce={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},ee={averageCenter(t,e){t.setAverageCenter(e)},batchSizeIE(t,e){t.setBatchSizeIE(e)},calculator(t,e){t.setCalculator(e)},clusterClass(t,e){t.setClusterClass(e)},enableRetinaIcons(t,e){t.setEnableRetinaIcons(e)},gridSize(t,e){t.setGridSize(e)},ignoreHidden(t,e){t.setIgnoreHidden(e)},imageExtension(t,e){t.setImageExtension(e)},imagePath(t,e){t.setImagePath(e)},imageSizes(t,e){t.setImageSizes(e)},maxZoom(t,e){t.setMaxZoom(e)},minimumClusterSize(t,e){t.setMinimumClusterSize(e)},styles(t,e){t.setStyles(e)},title(t,e){t.setTitle(e)},zoomOnClick(t,e){t.setZoomOnClick(e)}},jo={};function No(t){var{children:e,options:n,averageCenter:s,batchSizeIE:r,calculator:o,clusterClass:l,enableRetinaIcons:u,gridSize:c,ignoreHidden:g,imageExtension:d,imagePath:p,imageSizes:f,maxZoom:y,minimumClusterSize:h,styles:m,title:v,zoomOnClick:C,onClick:k,onClusteringBegin:P,onClusteringEnd:E,onMouseOver:b,onMouseOut:L,onLoad:w,onUnmount:I}=t,[S,O]=i.useState(null),j=i.useContext(V),[D,U]=i.useState(null),[A,T]=i.useState(null),[W,J]=i.useState(null),[F,K]=i.useState(null),[$,Q]=i.useState(null);return i.useEffect(()=>{S&&L&&(F!==null&&google.maps.event.removeListener(F),K(google.maps.event.addListener(S,ce.onMouseOut,L)))},[L]),i.useEffect(()=>{S&&b&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(S,ce.onMouseOver,b)))},[b]),i.useEffect(()=>{S&&k&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(S,ce.onClick,k)))},[k]),i.useEffect(()=>{S&&P&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(S,ce.onClusteringBegin,P)))},[P]),i.useEffect(()=>{S&&E&&(W!==null&&google.maps.event.removeListener(W),T(google.maps.event.addListener(S,ce.onClusteringEnd,E)))},[E]),i.useEffect(()=>{typeof s<"u"&&S!==null&&ee.averageCenter(S,s)},[S,s]),i.useEffect(()=>{typeof r<"u"&&S!==null&&ee.batchSizeIE(S,r)},[S,r]),i.useEffect(()=>{typeof o<"u"&&S!==null&&ee.calculator(S,o)},[S,o]),i.useEffect(()=>{typeof l<"u"&&S!==null&&ee.clusterClass(S,l)},[S,l]),i.useEffect(()=>{typeof u<"u"&&S!==null&&ee.enableRetinaIcons(S,u)},[S,u]),i.useEffect(()=>{typeof c<"u"&&S!==null&&ee.gridSize(S,c)},[S,c]),i.useEffect(()=>{typeof g<"u"&&S!==null&&ee.ignoreHidden(S,g)},[S,g]),i.useEffect(()=>{typeof d<"u"&&S!==null&&ee.imageExtension(S,d)},[S,d]),i.useEffect(()=>{typeof p<"u"&&S!==null&&ee.imagePath(S,p)},[S,p]),i.useEffect(()=>{typeof f<"u"&&S!==null&&ee.imageSizes(S,f)},[S,f]),i.useEffect(()=>{typeof y<"u"&&S!==null&&ee.maxZoom(S,y)},[S,y]),i.useEffect(()=>{typeof h<"u"&&S!==null&&ee.minimumClusterSize(S,h)},[S,h]),i.useEffect(()=>{typeof m<"u"&&S!==null&&ee.styles(S,m)},[S,m]),i.useEffect(()=>{typeof v<"u"&&S!==null&&ee.title(S,v)},[S,v]),i.useEffect(()=>{typeof C<"u"&&S!==null&&ee.zoomOnClick(S,C)},[S,C]),i.useEffect(()=>{if(j){var Y=Ro({},n||jo),N=new dr(j,[],Y);return s&&ee.averageCenter(N,s),r&&ee.batchSizeIE(N,r),o&&ee.calculator(N,o),l&&ee.clusterClass(N,l),u&&ee.enableRetinaIcons(N,u),c&&ee.gridSize(N,c),g&&ee.ignoreHidden(N,g),d&&ee.imageExtension(N,d),p&&ee.imagePath(N,p),f&&ee.imageSizes(N,f),y&&ee.maxZoom(N,y),h&&ee.minimumClusterSize(N,h),m&&ee.styles(N,m),v&&ee.title(N,v),C&&ee.zoomOnClick(N,C),L&&K(google.maps.event.addListener(N,ce.onMouseOut,L)),b&&Q(google.maps.event.addListener(N,ce.onMouseOver,b)),
11k&&U(google.maps.event.addListener(N,ce.onClick,k)),P&&T(google.maps.event.addListener(N,ce.onClusteringBegin,P)),E&&J(google.maps.event.addListener(N,ce.onClusteringEnd,E)),O(N),w&&w(N),()=>{F!==null&&google.maps.event.removeListener(F),$!==null&&google.maps.event.removeListener($),D!==null&&google.maps.event.removeListener(D),A!==null&&google.maps.event.removeListener(A),W!==null&&google.maps.event.removeListener(W),I&&I(N)}}},[]),S!==null&&e(S)||null}i.memo(No);class Ao extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{markerClusterer:null}),M(this,"setClustererCallback",()=>{this.state.markerClusterer!==null&&this.props.onLoad&&this.props.onLoad(this.state.markerClusterer)})}componentDidMount(){if(this.context){var e=new dr(this.context,[],this.props.options);this.registeredEvents=Z({updaterMap:ee,eventMap:ce,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({markerClusterer:e}),this.setClustererCallback)}}componentDidUpdate(e){this.state.markerClusterer&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:ee,eventMap:ce,prevProps:e,nextProps:this.props,instance:this.state.markerClusterer}))}componentWillUnmount(){this.state.markerClusterer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),H(this.registeredEvents),this.state.markerClusterer.setMap(null))}render(){return this.state.markerClusterer!==null?this.props.children(this.state.markerClusterer):null}}M(Ao,"contextType",V);function zn(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}var pr=(function(){function t(e){e===void 0&&(e={}),this.getCloseClickHandler=this.getCloseClickHandler.bind(this),this.closeClickHandler=this.closeClickHandler.bind(this),this.createInfoBoxDiv=this.createInfoBoxDiv.bind(this),this.addClickHandler=this.addClickHandler.bind(this),this.getCloseBoxImg=this.getCloseBoxImg.bind(this),this.getBoxWidths=this.getBoxWidths.bind(this),this.setBoxStyle=this.setBoxStyle.bind(this),this.setPosition=this.setPosition.bind(this),this.getPosition=this.getPosition.bind(this),this.setOptions=this.setOptions.bind(this),this.setContent=this.setContent.bind(this),this.setVisible=this.setVisible.bind(this),this.getContent=this.getContent.bind(this),this.getVisible=this.getVisible.bind(this),this.setZIndex=this.setZIndex.bind(this),this.getZIndex=this.getZIndex.bind(this),this.onRemove=this.onRemove.bind(this),this.panBox=this.panBox.bind(this),this.extend=this.extend.bind(this),this.close=this.close.bind(this),this.draw=this.draw.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.open=this.open.bind(this),this.extend(t,google.maps.OverlayView),this.content=e.content||"",this.disableAutoPan=e.disableAutoPan||!1,this.maxWidth=e.maxWidth||0,this.pixelOffset=e.pixelOffset||new google.maps.Size(0,0),this.position=e.position||new google.maps.LatLng(0,0),this.zIndex=e.zIndex||null,this.boxClass=e.boxClass||"infoBox",this.boxStyle=e.boxStyle||{},this.closeBoxMargin=e.closeBoxMargin||"2px",this.closeBoxURL=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",e.closeBoxURL===""&&(this.closeBoxURL=""),this.infoBoxClearance=e.infoBoxClearance||new google.maps.Size(1,1),typeof e.visible>"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var e=this,n=function(d){d.returnValue=!1,d.preventDefault&&d.preventDefault(),e.enableEventPropagation||zn(d)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var s=this.getPanes();if(s!==null&&s[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var r=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-r.left-r.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var o=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],l=0,u=o;l<u.length;l++){var c=u[l];this.eventListeners.push(google.maps.event.addListener(this.div,c,zn))}this.eventListeners.push(google.maps.event.addListener(this.div,"mouseover",function(){e.div&&(e.div.style.cursor="default")}))}this.contextListener=google.maps.event.addListener(this.div,"contextmenu",n),google.maps.event.trigger(this,"domready")}},t.prototype.getCloseBoxImg=function(){var e="";return this.closeBoxURL!==""&&(e='<img alt=""',e+=' aria-hidden="true"',e+=" src='"+this.closeBoxURL+"'",e+=" align=right",e+=" style='",e+=" position: relative;",e+=" cursor: pointer;",e+=" margin: "+this.closeBoxMargin+";",e+="'>"),e},t.prototype.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&this.closeBoxURL!==""?google.maps.event.addListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},t.prototype.closeClickHandler=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),google.maps.event.trigger(this,"closeclick"),this.close()},t.prototype.getCloseClickHandler=function(){return this.closeClickHandler},t.prototype.panBox=function(e){if(this.div&&!e){var n=this.getMap();if(n instanceof google.maps.Map){var s=0,r=0,o=n.getBounds();o&&!o.contains(this.position)&&n.setCenter(this.position);var l=n.getDiv(),u=l.offsetWidth,c=l.offsetHeight,g=this.pixelOffset.width,d=this.pixelOffset.height,p=this.div.offsetWidth,f=this.div.offsetHeight,y=this.infoBoxClearance.width,h=this.infoBoxClearance.height,m=this.getProjection(),v=m.fromLatLngToContainerPixel(this.position);v!==null&&(v.x<-g+y?s=v.x+g-y:v.x+p+g+y>u&&(s=v.x+p+g+y-u),this.alignBottom?v.y<-d+h+f?r=v.y+d-h-f:v.y+d+h>
11c&&(r=v.y+d+h-c):v.y<-d+h?r=v.y+d-h:v.y+f+d+h>c&&(r=v.y+f+d+h-c)),s===0&&r===0||n.panBy(s,r)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var s=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+s*100+')"',this.div.style.filter="alpha(opacity="+s*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,s=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;s&&(e.top=parseInt(s.borderTopWidth||"",10)||0,e.bottom=parseInt(s.borderBottomWidth||"",10)||0,e.left=parseInt(s.borderLeftWidth||"",10)||0,e.right=parseInt(s.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var r=this.div.currentStyle;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.borderRightWidth||"",10)||0)}return e},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var s=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var r=n.getPosition();s.setPosition(r)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){s.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e<n.length;e++){var s=n[e];google.maps.event.removeListener(s)}this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},t.prototype.extend=function(e,n){return(function(r){for(var o in r.prototype)Object.prototype.hasOwnProperty.call(this,o)||(this.prototype[o]=r.prototype[o]);return this}).apply(e,[n])},t})(),To=["position"],Uo=["position"];function Vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function bt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
11e%2?Vn(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var Wn={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Fn={options(t,e){t.setOptions(e)},position(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible(t,e){t.setVisible(e)},zIndex(t,e){t.setZIndex(e)}},Bo={};function zo(t){var{children:e,anchor:n,options:s,position:r,zIndex:o,onCloseClick:l,onDomReady:u,onContentChanged:c,onPositionChanged:g,onZindexChanged:d,onLoad:p,onUnmount:f}=t,y=i.useContext(V),[h,m]=i.useState(null),[v,C]=i.useState(null),[k,P]=i.useState(null),[E,b]=i.useState(null),[L,w]=i.useState(null),[I,S]=i.useState(null),O=i.useRef(null);return i.useEffect(()=>{y&&h!==null&&(h.close(),n?h.open(y,n):h.getPosition()&&h.open(y))},[y,h,n]),i.useEffect(()=>{s&&h!==null&&h.setOptions(s)},[h,s]),i.useEffect(()=>{if(r&&h!==null){var j=r instanceof google.maps.LatLng?r:new google.maps.LatLng(r.lat,r.lng);h.setPosition(j)}},[r]),i.useEffect(()=>{typeof o=="number"&&h!==null&&h.setZIndex(o)},[o]),i.useEffect(()=>{h&&l&&(v!==null&&google.maps.event.removeListener(v),C(google.maps.event.addListener(h,"closeclick",l)))},[l]),i.useEffect(()=>{h&&u&&(k!==null&&google.maps.event.removeListener(k),P(google.maps.event.addListener(h,"domready",u)))},[u]),i.useEffect(()=>{h&&c&&(E!==null&&google.maps.event.removeListener(E),b(google.maps.event.addListener(h,"content_changed",c)))},[c]),i.useEffect(()=>{h&&g&&(L!==null&&google.maps.event.removeListener(L),w(google.maps.event.addListener(h,"position_changed",g)))},[g]),i.useEffect(()=>{h&&d&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(h,"zindex_changed",d)))},[d]),i.useEffect(()=>{if(y){var j=s||Bo,{position:D}=j,U=$t(j,To),A;D&&!(D instanceof google.maps.LatLng)&&(A=new google.maps.LatLng(D.lat,D.lng));var T=new pr(bt(bt({},U),A?{position:A}:{}));O.current=document.createElement("div"),m(T),l&&C(google.maps.event.addListener(T,"closeclick",l)),u&&P(google.maps.event.addListener(T,"domready",u)),c&&b(google.maps.event.addListener(T,"content_changed",c)),g&&w(google.maps.event.addListener(T,"position_changed",g)),d&&S(google.maps.event.addListener(T,"zindex_changed",d)),T.setContent(O.current),n?T.open(y,n):T.getPosition()?T.open(y):se(!1,"You must provide either an anchor or a position prop for <InfoBox>."),p&&p(T)}return()=>{h!==null&&(v&&google.maps.event.removeListener(v),E&&google.maps.event.removeListener(E),k&&google.maps.event.removeListener(k),L&&google.maps.event.removeListener(L),I&&google.maps.event.removeListener(I),f&&f(h),h.close())}},[]),O.current?_e.createPortal(i.Children.only(e),O.current):null}i.memo(zo);class Vo extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"containerElement",null),M(this,"state",{infoBox:null}),M(this,"open",(e,n)=>{n?this.context!==null&&e.open(this.context,n):e.getPosition()?this.context!==null&&e.open(this.context):se(!1,"You must provide either an anchor or a position prop for <InfoBox>.")}),M(this,"setInfoBoxCallback",()=>{this.state.infoBox!==null&&this.containerElement!==null&&(this.state.infoBox.setContent(this.containerElement),this.open(this.state.infoBox,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoBox))})}componentDidMount(){var e=this.props.options||{},{position:n}=e,s=$t(e,Uo),r;n&&!(n instanceof google.maps.LatLng)&&(r=new google.maps.LatLng(n.lat,n.lng));var o=new pr(bt(bt({},s),r?{position:r}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Z({updaterMap:Fn,eventMap:Wn,prevProps:{},nextProps:this.props,instance:o}),this.setState({infoBox:o},this.setInfoBoxCallback)}componentDidUpdate(e){var{infoBox:n}=this.state;n!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Fn,eventMap:Wn,prevProps:e,nextProps:this.props,instance:n}))}componentWillUnmount(){var{onUnmount:e}=this.props,{infoBox:n}=this.state;n!==null&&(e&&e(n),H(this.registeredEvents),n.close())}render(){return this.containerElement?_e.createPortal(i.Children.only(this.props.children),this.containerElement):null}}M(Vo,"contextType",V);var _t,$n;function Wo(){return $n||($n=1,_t=function t(e,n){if(e===n)return!0;
11if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var s,r,o;if(Array.isArray(e)){if(s=e.length,s!=n.length)return!1;for(r=s;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),s=o.length,s!==Object.keys(n).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=s;r--!==0;){var l=o[r];if(!t(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}),_t}var Fo=Wo(),Zn=or(Fo),Hn=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],It=1,Ue=8;class Zt{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var[n,s]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");var r=s>>4;if(r!==It)throw new Error("Got v".concat(r," data when expected v").concat(It,"."));var o=Hn[s&15];if(!o)throw new Error("Unrecognized array type.");var[l]=new Uint16Array(e,2,1),[u]=new Uint32Array(e,4,1);return new Zt(u,l,o,e)}constructor(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:64,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;var o=Hn.indexOf(this.ArrayType),l=e*2*this.ArrayType.BYTES_PER_ELEMENT,u=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-u%8)%8;if(o<0)throw new Error("Unexpected typed array class: ".concat(s,"."));r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,Ue,e),this.coords=new this.ArrayType(this.data,Ue+u+c,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Ue+l+u+c),this.ids=new this.IndexArrayType(this.data,Ue,e),this.coords=new this.ArrayType(this.data,Ue+u+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(It<<4)+o]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){var s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=n,s}finish(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Nt(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:o,coords:l,nodeSize:u}=this,c=[0,o.length-1,0],g=[];c.length;){var d=c.pop()||0,p=c.pop()||0,f=c.pop()||0;if(p-f<=u){for(var y=f;y<=p;y++){var h=l[2*y],m=l[2*y+1];h>=e&&h<=s&&m>=n&&m<=r&&g.push(o[y])}continue}var v=f+p>>1,C=l[2*v],k=l[2*v+1];C>=e&&C<=s&&k>=n&&k<=r&&g.push(o[v]),(d===0?e<=C:n<=k)&&(c.push(f),c.push(v-1),c.push(1-d)),(d===0?s>=C:r>=k)&&(c.push(v+1),c.push(p),c.push(1-d))}return g}within(e,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var{ids:r,coords:o,nodeSize:l}=this,u=[0,r.length-1,0],c=[],g=s*s;u.length;){var d=u.pop()||0,p=u.pop()||0,f=u.pop()||0;if(p-f<=l){for(var y=f;y<=p;y++)Gn(o[2*y],o[2*y+1],e,n)<=g&&c.push(r[y]);continue}var h=f+p>>1,m=o[2*h],v=o[2*h+1];Gn(m,v,e,n)<=g&&c.push(r[h]),(d===0?e-s<=m:n-s<=v)&&(u.push(f),u.push(h-1),u.push(1-d)),(d===0?e+s>=m:n+s>=v)&&(u.push(h+1),u.push(p),u.push(1-d))}return c}}function Nt(t,e,n,s,r,o){if(!(r-s<=n)){var l=s+r>>1;gr(t,e,l,s,r,o),Nt(t,e,n,s,l-1,1-o),Nt(t,e,n,l+1,r,1-o)}}function gr(t,e,n,s,r,o){for(;r>s;){if(r-s>600){var l=r-s+1,u=n-s+1,c=Math.log(l),g=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*g*(l-g)/l)*(u-l/2<0?-1:1),p=Math.max(s,Math.floor(n-u*g/l+d)),f=Math.min(r,Math.floor(n+(l-u)*g/l+d));gr(t,e,n,p,f,o)}var y=e[2*n+o],h=s,m=r;for(Be(t,e,s,n),e[2*r+o]>y&&Be(t,e,s,r);h<m;){for(Be(t,e,h,m),h++,m--;e[2*h+o]<y;)h++;for(;e[2*m+o]>y;)m--}e[2*s+o]===y?Be(t,e,s,m):(m++,Be(t,e,m,r)),m<=n&&(s=m+1),n<=m&&(r=m-1)}}function Be(t,e,n,s){Dt(t,n,s),Dt(e,2*n,2*s),Dt(e,2*n+1,2*s+1)}function Dt(t,e,n){var s=t[e];t[e]=t[n],t[n]=s}function Gn(t,e,n,s){var r=t-n,o=e-s;return r*r+o*o}var $o={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},qn=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),ve=2,ge=3,Rt=4,pe=5,fr=6;class Zo{constructor(e){this.options=Object.assign(Object.create($o),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){var{log:n,minZoom:s,maxZoom:r}=this.options;n&&console.time("total time");var o="prepare ".concat(e.length," points");n&&console.time(o),this.points=e;for(var l=[],u=0;u<e.length;u++){var c=e[u];if(c.geometry){var[g,d]=c.geometry.coordinates,p=qn(lt(g)),f=qn(ut(d));l.push(p,f,1/0,u,-1,1),this.options.reduce&&l.push(0)}}var y=this.trees[r+1]=this._createTree(l);n&&console.timeEnd(o);for(var h=r;h>=s;h--){var m=+Date.now();y=this.trees[h]=this._createTree(this._cluster(y,h)),n&&console.log("z%d: %d clusters in %dms",h,y.numItems,+Date.now()-m)}return n&&console.timeEnd("total time"),this}getClusters(e,n){var s=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,l=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)s=-180,o=180;else if(s>o){var u=this.getClusters([s,r,180,l],n),c=this.getClusters([-180,r,o,l],n);return u.concat(c)}var g=this.trees[this._limitZoom(n)],d=g.range(lt(s),ut(l),lt(o),ut(r)),p=g.data,f=[];for(var y of d){var h=this.stride*y;f.push(p[h+pe]>1?Kn(p,h,this.clusterProps):this.points[p[h+ge]])}return f}getChildren(e){var n=this._getOriginId(e),s=this._getOriginZoom(e),r="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(r);var l=o.data;if(n*this.stride>=l.length)throw new Error(r);var u=this.options.radius/(this.options.extent*Math.pow(2,s-1)),c=l[n*this.stride],g=l[n*this.stride+1],d=o.within(c,g,u),p=[];for(var f of d){var y=f*this.stride;l[y+Rt]===e&&p.push(l[y+pe]>1?Kn(l,y,this.clusterProps):this.points[l[y+ge]])}if(p.length===0)throw new Error(r);return p}getLeaves(e,n,s){n=n||10,s=s||0;var r=[];
11return this._appendLeaves(r,e,n,s,0),r}getTile(e,n,s){var r=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:l,radius:u}=this.options,c=u/l,g=(s-c)/o,d=(s+1+c)/o,p={features:[]};return this._addTileFeatures(r.range((n-c)/o,g,(n+1+c)/o,d),r.data,n,s,o,p),n===0&&this._addTileFeatures(r.range(1-c/o,g,1,d),r.data,o,s,o,p),n===o-1&&this._addTileFeatures(r.range(0,g,c/o,d),r.data,-1,s,o,p),p.features.length?p:null}getClusterExpansionZoom(e){for(var n=this._getOriginZoom(e)-1;n<=this.options.maxZoom;){var s=this.getChildren(e);if(n++,s.length!==1)break;e=s[0].properties.cluster_id}return n}_appendLeaves(e,n,s,r,o){var l=this.getChildren(n);for(var u of l){var c=u.properties;if(c&&c.cluster?o+c.point_count<=r?o+=c.point_count:o=this._appendLeaves(e,c.cluster_id,s,r,o):o<r?o++:e.push(u),e.length===s)break}return o}_createTree(e){for(var n=new Zt(e.length/this.stride|0,this.options.nodeSize,Float32Array),s=0;s<e.length;s+=this.stride)n.add(e[s],e[s+1]);return n.finish(),n.data=e,n}_addTileFeatures(e,n,s,r,o,l){for(var u of e){var c=u*this.stride,g=n[c+pe]>1,d=void 0,p=void 0,f=void 0;if(g)d=hr(n,c,this.clusterProps),p=n[c],f=n[c+1];else{var y=this.points[n[c+ge]];d=y.properties;var[h,m]=y.geometry.coordinates;p=lt(h),f=ut(m)}var v={type:1,geometry:[[Math.round(this.options.extent*(p*o-s)),Math.round(this.options.extent*(f*o-r))]],tags:d},C=void 0;g||this.options.generateId?C=n[c+ge]:C=this.points[n[c+ge]].id,C!==void 0&&(v.id=C),l.features.push(v)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){for(var{radius:s,extent:r,reduce:o,minPoints:l}=this.options,u=s/(r*Math.pow(2,n)),c=e.data,g=[],d=this.stride,p=0;p<c.length;p+=d)if(!(c[p+ve]<=n)){c[p+ve]=n;var f=c[p],y=c[p+1],h=e.within(c[p],c[p+1],u),m=c[p+pe],v=m;for(var C of h){var k=C*d;c[k+ve]>n&&(v+=c[k+pe])}if(v>m&&v>=l){var P=f*m,E=y*m,b=void 0,L=-1,w=((p/d|0)<<5)+(n+1)+this.points.length;for(var I of h){var S=I*d;if(!(c[S+ve]<=n)){c[S+ve]=n;var O=c[S+pe];P+=c[S]*O,E+=c[S+1]*O,c[S+Rt]=w,o&&(b||(b=this._map(c,p,!0),L=this.clusterProps.length,this.clusterProps.push(b)),o(b,this._map(c,S)))}}c[p+Rt]=w,g.push(P/v,E/v,1/0,w,-1,v),o&&g.push(L)}else{for(var j=0;j<d;j++)g.push(c[p+j]);if(v>1)for(var D of h){var U=D*d;if(!(c[U+ve]<=n)){c[U+ve]=n;for(var A=0;A<d;A++)g.push(c[U+A])}}}}return g}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,s){if(e[n+pe]>1){var r=this.clusterProps[e[n+fr]];return s?Object.assign({},r):r}var o=this.points[e[n+ge]].properties,l=this.options.map(o);return s&&l===o?Object.assign({},l):l}}function Kn(t,e,n){return{type:"Feature",id:t[e+ge],properties:hr(t,e,n),geometry:{type:"Point",coordinates:[Ho(t[e]),Go(t[e+1])]}}}function hr(t,e,n){var s=t[e+pe],r=s>=1e4?"".concat(Math.round(s/1e3),"k"):s>=1e3?"".concat(Math.round(s/100)/10,"k"):s,o=t[e+fr],l=o===-1?{}:Object.assign({},n[o]);return Object.assign(l,{cluster:!0,cluster_id:t[e+ge],point_count:s,point_count_abbreviated:r})}function lt(t){return t/360+.5}function ut(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Ho(t){return(t-.5)*360}function Go(t){var e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function qo(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n}class ue{static isAdvancedMarkerAvailable(e){return google.maps.marker&&e.getMapCapabilities().isAdvancedMarkersAvailable===!0}static isAdvancedMarker(e){return google.maps.marker&&e instanceof google.maps.marker.AdvancedMarkerElement}static setMap(e,n){this.isAdvancedMarker(e)?e.map=n:e.setMap(n)}static getPosition(e){if(this.isAdvancedMarker(e)){if(e.position){if(e.position instanceof google.maps.LatLng)return e.position;if(e.position.lat&&e.position.lng)return new google.maps.LatLng(e.position.lat,e.position.lng)}return new google.maps.LatLng(null)}return e.getPosition()}static getVisible(e){return this.isAdvancedMarker(e)?!0:e.getVisible()}}class At{constructor(e){var{markers:n,position:s}=e;this.markers=n,s&&(s instanceof google.maps.LatLng?this._position=s:this._position=new google.maps.LatLng(s))}get bounds(){if(!(this.markers.length===0&&!this._position)){var e=new google.maps.LatLngBounds(this._position,this._position);for(var n of this.markers)e.extend(ue.getPosition(n));return e}}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter(e=>ue.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(ue.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class Ko{constructor(e){var{maxZoom:n=16}=e;this.maxZoom=n}noop(e){var{markers:n}=e;return Yo(n)}}var Yo=t=>{var e=t.map(n=>new At({position:ue.getPosition(n),markers:[n]}));return e};class Jo extends Ko{constructor(e){var{maxZoom:n,radius:s=60}=e,r=qo(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1}
11,this.superCluster=new Zo(Object.assign({maxZoom:this.maxZoom,radius:s},r))}calculate(e){var n=!1,s={zoom:e.map.getZoom()};if(!Zn(e.markers,this.markers)){n=!0,this.markers=[...e.markers];var r=this.markers.map(o=>{var l=ue.getPosition(o),u=[l.lng(),l.lat()];return{type:"Feature",geometry:{type:"Point",coordinates:u},properties:{marker:o}}});this.superCluster.load(r)}return n||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(n=!Zn(this.state,s)),this.state=s,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster(e){var{map:n}=e;return this.superCluster.getClusters([-180,-90,180,90],Math.round(n.getZoom())).map(s=>this.transformCluster(s))}transformCluster(e){var{geometry:{coordinates:[n,s]},properties:r}=e;if(r.cluster)return new At({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(l=>l.properties.marker),position:{lat:s,lng:n}});var o=r.marker;return new At({markers:[o],position:ue.getPosition(o)})}}class Qo{constructor(e,n){this.markers={sum:e.length};var s=n.map(o=>o.count),r=s.reduce((o,l)=>o+l,0);this.clusters={count:n.length,markers:{mean:r/n.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class Xo{render(e,n,s){var{count:r,position:o}=e,l=r>Math.max(10,n.clusters.markers.mean)?"#ff0000":"#0000ff",u='<svg fill="'.concat(l,`" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50"> 12<circle cx="120" cy="120" opacity=".6" r="70" /> 13<circle cx="120" cy="120" opacity=".3" r="90" /> 14<circle cx="120" cy="120" opacity=".2" r="110" /> 15<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">`).concat(r,`</text> 16</svg>`),c="Cluster of ".concat(r," markers"),g=Number(google.maps.Marker.MAX_ZINDEX)+r;if(ue.isAdvancedMarkerAvailable(s)){var d=new DOMParser,p=d.parseFromString(u,"image/svg+xml").documentElement;p.setAttribute("transform","translate(0 25)");var f={map:s,position:o,zIndex:g,title:c,content:p};return new google.maps.marker.AdvancedMarkerElement(f)}var y={position:o,zIndex:g,title:c,icon:{url:"data:image/svg+xml;base64,".concat(btoa(u)),anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(y)}}function ea(t,e){for(var n in e.prototype)t.prototype[n]=e.prototype[n]}class Ht{constructor(){ea(Ht,google.maps.OverlayView)}}var $e;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})($e||($e={}));var ta=(t,e,n)=>{n.fitBounds(e.bounds)};class na extends Ht{constructor(e){var{map:n,markers:s=[],algorithmOptions:r={},algorithm:o=new Jo(r),renderer:l=new Xo,onClusterClick:u=ta}=e;super(),this.markers=[...s],this.clusters=[],this.algorithm=o,this.renderer=l,this.onClusterClick=u,n&&this.setMap(n)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(s=>{this.addMarker(s,!0)}),n||this.render()}removeMarker(e,n){var s=this.markers.indexOf(e);return s===-1?!1:(ue.setMap(e,null),this.markers.splice(s,1),n||this.render(),!0)}removeMarkers(e,n){var s=!1;return e.forEach(r=>{s=this.removeMarker(r,!0)||s}),s&&!n&&this.render(),s}clearMarkers(e){this.markers.length=0,e||this.render()}render(){var e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,$e.CLUSTERING_BEGIN,this);var{clusters:n,changed:s}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(s||s==null){var r=new Set;for(var o of n)o.markers.length==1&&r.add(o.markers[0]);var l=[];for(var u of this.clusters)u.marker!=null&&(u.markers.length==1?r.has(u.marker)||ue.setMap(u.marker,null):l.push(u.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>l.forEach(c=>ue.setMap(c,null)))}google.maps.event.trigger(this,$e.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>ue.setMap(e,null)),this.clusters.forEach(e=>
16e.delete()),this.clusters=[]}renderClusters(){var e=new Qo(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(s=>{s.markers.length===1?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,e,n),s.markers.forEach(r=>ue.setMap(r,null)),this.onClusterClick&&s.marker.addListener("click",r=>{google.maps.event.trigger(this,$e.CLUSTER_CLICK,s),this.onClusterClick(r,s,n)})),ue.setMap(s.marker,n)})}}function Yn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Jn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Yn(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function sa(t){var e=Gi(),[n,s]=i.useState(null);return i.useEffect(()=>{if(e&&n===null){var r=new na(Jn(Jn({},t),{},{map:e}));s(r)}},[e]),n}function ra(t){var{children:e,options:n}=t,s=sa(n);return s!==null?e(s):null}i.memo(ra);var Qn={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Xn={options(t,e){t.setOptions(e)},position(t,e){t.setPosition(e)},zIndex(t,e){t.setZIndex(e)}};function ia(t){var{children:e,anchor:n,options:s,position:r,zIndex:o,onCloseClick:l,onDomReady:u,onContentChanged:c,onPositionChanged:g,onZindexChanged:d,onLoad:p,onUnmount:f}=t,y=i.useContext(V),[h,m]=i.useState(null),[v,C]=i.useState(null),[k,P]=i.useState(null),[E,b]=i.useState(null),[L,w]=i.useState(null),[I,S]=i.useState(null),O=i.useRef(null);return i.useEffect(()=>{h!==null&&(h.close(),n?h.open(y,n):h.getPosition()&&h.open(y))},[y,h,n]),i.useEffect(()=>{s&&h!==null&&h.setOptions(s)},[h,s]),i.useEffect(()=>{r&&h!==null&&h.setPosition(r)},[r]),i.useEffect(()=>{typeof o=="number"&&h!==null&&h.setZIndex(o)},[o]),i.useEffect(()=>{h&&l&&(v!==null&&google.maps.event.removeListener(v),C(google.maps.event.addListener(h,"closeclick",l)))},[l]),i.useEffect(()=>{h&&u&&(k!==null&&google.maps.event.removeListener(k),P(google.maps.event.addListener(h,"domready",u)))},[u]),i.useEffect(()=>{h&&c&&(E!==null&&google.maps.event.removeListener(E),b(google.maps.event.addListener(h,"content_changed",c)))},[c]),i.useEffect(()=>{h&&g&&(L!==null&&google.maps.event.removeListener(L),w(google.maps.event.addListener(h,"position_changed",g)))},[g]),i.useEffect(()=>{h&&d&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(h,"zindex_changed",d)))},[d]),i.useEffect(()=>{var j=new google.maps.InfoWindow(s);return m(j),O.current=document.createElement("div"),l&&C(google.maps.event.addListener(j,"closeclick",l)),u&&P(google.maps.event.addListener(j,"domready",u)),c&&b(google.maps.event.addListener(j,"content_changed",c)),g&&w(google.maps.event.addListener(j,"position_changed",g)),d&&S(google.maps.event.addListener(j,"zindex_changed",d)),j.setContent(O.current),r&&j.setPosition(r),o&&j.setZIndex(o),n?j.open(y,n):j.getPosition()?j.open(y):se(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>."),p&&p(j),()=>{v&&google.maps.event.removeListener(v),E&&google.maps.event.removeListener(E),k&&google.maps.event.removeListener(k),L&&google.maps.event.removeListener(L),I&&google.maps.event.removeListener(I),f&&f(j),j.close()}},[]),O.current?_e.createPortal(i.Children.only(e),O.current):null}i.memo(ia);class oa extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"containerElement",null),M(this,"state",{infoWindow:null}),M(this,"open",(e,n)=>{n?e.open(this.context,n):e.getPosition()?e.open(this.context):se(!1,"You must provide either an anchor (typically render it inside a <Marker>) or a position props for <InfoWindow>.")}),M(this,"setInfoWindowCallback",()=>{this.state.infoWindow!==null&&this.containerElement!==null&&(this.state.infoWindow.setContent(this.containerElement),this.open(this.state.infoWindow,this.props.anchor),this.props.onLoad&&this.props.onLoad(this.state.infoWindow))})}componentDidMount(){var e=new google.maps.InfoWindow(this.props.options);this.containerElement=document.createElement("div"),this.registeredEvents=Z({updaterMap:Xn,eventMap:Qn,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({infoWindow:e}),this.setInfoWindowCallback)}componentDidUpdate(e){this.state.infoWindow!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Xn,eventMap:Qn,prevProps:e,nextProps:this.props,instance:this.state.infoWindow}))}componentWillUnmount(){this.state.infoWindow!==null&&(H(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())}render(){return this.containerElement?_e.createPortal(i.Children.only(this.props.children),this.containerElement):null}}M(oa,"contextType",V);function es(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Lt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
16e%2?es(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):es(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var ts={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ns={draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},path(t,e){t.setPath(e)},visible(t,e){t.setVisible(e)}},aa={};function la(t){var{options:e,draggable:n,editable:s,visible:r,path:o,onDblClick:l,onDragEnd:u,onDragStart:c,onMouseDown:g,onMouseMove:d,onMouseOut:p,onMouseOver:f,onMouseUp:y,onRightClick:h,onClick:m,onDrag:v,onLoad:C,onUnmount:k}=t,P=i.useContext(V),[E,b]=i.useState(null),[L,w]=i.useState(null),[I,S]=i.useState(null),[O,j]=i.useState(null),[D,U]=i.useState(null),[A,T]=i.useState(null),[W,J]=i.useState(null),[F,K]=i.useState(null),[$,Q]=i.useState(null),[Y,N]=i.useState(null),[X,x]=i.useState(null),[G,ne]=i.useState(null);return i.useEffect(()=>{E!==null&&E.setMap(P)},[P]),i.useEffect(()=>{typeof e<"u"&&E!==null&&E.setOptions(e)},[E,e]),i.useEffect(()=>{typeof n<"u"&&E!==null&&E.setDraggable(n)},[E,n]),i.useEffect(()=>{typeof s<"u"&&E!==null&&E.setEditable(s)},[E,s]),i.useEffect(()=>{typeof r<"u"&&E!==null&&E.setVisible(r)},[E,r]),i.useEffect(()=>{typeof o<"u"&&E!==null&&E.setPath(o)},[E,o]),i.useEffect(()=>{E&&l&&(L!==null&&google.maps.event.removeListener(L),w(google.maps.event.addListener(E,"dblclick",l)))},[l]),i.useEffect(()=>{E&&u&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(E,"dragend",u)))},[u]),i.useEffect(()=>{E&&c&&(O!==null&&google.maps.event.removeListener(O),j(google.maps.event.addListener(E,"dragstart",c)))},[c]),i.useEffect(()=>{E&&g&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(E,"mousedown",g)))},[g]),i.useEffect(()=>{E&&d&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(E,"mousemove",d)))},[d]),i.useEffect(()=>{E&&p&&(W!==null&&google.maps.event.removeListener(W),J(google.maps.event.addListener(E,"mouseout",p)))},[p]),i.useEffect(()=>{E&&f&&(F!==null&&google.maps.event.removeListener(F),K(google.maps.event.addListener(E,"mouseover",f)))},[f]),i.useEffect(()=>{E&&y&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(E,"mouseup",y)))},[y]),i.useEffect(()=>{E&&h&&(Y!==null&&google.maps.event.removeListener(Y),N(google.maps.event.addListener(E,"rightclick",h)))},[h]),i.useEffect(()=>{E&&m&&(X!==null&&google.maps.event.removeListener(X),x(google.maps.event.addListener(E,"click",m)))},[m]),i.useEffect(()=>{E&&v&&(G!==null&&google.maps.event.removeListener(G),ne(google.maps.event.addListener(E,"drag",v)))},[v]),i.useEffect(()=>{var B=new google.maps.Polyline(Lt(Lt({},e||aa),{},{map:P}));return o&&B.setPath(o),typeof r<"u"&&B.setVisible(r),typeof s<"u"&&B.setEditable(s),typeof n<"u"&&B.setDraggable(n),l&&w(google.maps.event.addListener(B,"dblclick",l)),u&&S(google.maps.event.addListener(B,"dragend",u)),c&&j(google.maps.event.addListener(B,"dragstart",c)),g&&U(google.maps.event.addListener(B,"mousedown",g)),d&&T(google.maps.event.addListener(B,"mousemove",d)),p&&J(google.maps.event.addListener(B,"mouseout",p)),f&&K(google.maps.event.addListener(B,"mouseover",f)),y&&Q(google.maps.event.addListener(B,"mouseup",y)),h&&N(google.maps.event.addListener(B,"rightclick",h)),m&&x(google.maps.event.addListener(B,"click",m)),v&&ne(google.maps.event.addListener(B,"drag",v)),b(B),C&&C(B),()=>{L!==null&&google.maps.event.removeListener(L),I!==null&&google.maps.event.removeListener(I),O!==null&&google.maps.event.removeListener(O),D!==null&&google.maps.event.removeListener(D),A!==null&&google.maps.event.removeListener(A),W!==null&&google.maps.event.removeListener(W),F!==null&&google.maps.event.removeListener(F),$!==null&&google.maps.event.removeListener($),Y!==null&&google.maps.event.removeListener(Y),X!==null&&google.maps.event.removeListener(X),k&&k(B),B.setMap(null)}},[]),null}i.memo(la);class ua extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{polyline:null}),M(this,"setPolylineCallback",()=>{this.state.polyline!==null&&this.props.onLoad&&this.props.onLoad(this.state.polyline)})}componentDidMount(){var e=new google.maps.Polyline(Lt(Lt({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:ns,eventMap:ts,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{polyline:e}},this.setPolylineCallback)}componentDidUpdate(e){this.state.polyline!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:ns,eventMap:ts,prevProps:e,nextProps:this.props,instance:this.state.polyline}))}componentWillUnmount(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),H(this.registeredEvents),this.state.polyline.setMap(null))}render(){return null}}M(ua,"contextType",V);function ss(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function rs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
16e%2?ss(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ss(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var is={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},os={draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},path(t,e){t.setPath(e)},paths(t,e){t.setPaths(e)},visible(t,e){t.setVisible(e)}};function ca(t){var{options:e,draggable:n,editable:s,visible:r,path:o,paths:l,onDblClick:u,onDragEnd:c,onDragStart:g,onMouseDown:d,onMouseMove:p,onMouseOut:f,onMouseOver:y,onMouseUp:h,onRightClick:m,onClick:v,onDrag:C,onLoad:k,onUnmount:P,onEdit:E}=t,b=i.useContext(V),[L,w]=i.useState(null),[I,S]=i.useState(null),[O,j]=i.useState(null),[D,U]=i.useState(null),[A,T]=i.useState(null),[W,J]=i.useState(null),[F,K]=i.useState(null),[$,Q]=i.useState(null),[Y,N]=i.useState(null),[X,x]=i.useState(null),[G,ne]=i.useState(null),[B,_]=i.useState(null);return i.useEffect(()=>{L!==null&&L.setMap(b)},[b]),i.useEffect(()=>{typeof e<"u"&&L!==null&&L.setOptions(e)},[L,e]),i.useEffect(()=>{typeof n<"u"&&L!==null&&L.setDraggable(n)},[L,n]),i.useEffect(()=>{typeof s<"u"&&L!==null&&L.setEditable(s)},[L,s]),i.useEffect(()=>{typeof r<"u"&&L!==null&&L.setVisible(r)},[L,r]),i.useEffect(()=>{typeof o<"u"&&L!==null&&L.setPath(o)},[L,o]),i.useEffect(()=>{typeof l<"u"&&L!==null&&L.setPaths(l)},[L,l]),i.useEffect(()=>{L&&typeof u=="function"&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(L,"dblclick",u)))},[u]),i.useEffect(()=>{L&&(google.maps.event.addListener(L.getPath(),"insert_at",()=>{E?.(L)}),google.maps.event.addListener(L.getPath(),"set_at",()=>{E?.(L)}),google.maps.event.addListener(L.getPath(),"remove_at",()=>{E?.(L)}))},[L,E]),i.useEffect(()=>{L&&typeof c=="function"&&(O!==null&&google.maps.event.removeListener(O),j(google.maps.event.addListener(L,"dragend",c)))},[c]),i.useEffect(()=>{L&&typeof g=="function"&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(L,"dragstart",g)))},[g]),i.useEffect(()=>{L&&typeof d=="function"&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(L,"mousedown",d)))},[d]),i.useEffect(()=>{L&&typeof p=="function"&&(W!==null&&google.maps.event.removeListener(W),J(google.maps.event.addListener(L,"mousemove",p)))},[p]),i.useEffect(()=>{L&&typeof f=="function"&&(F!==null&&google.maps.event.removeListener(F),K(google.maps.event.addListener(L,"mouseout",f)))},[f]),i.useEffect(()=>{L&&typeof y=="function"&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(L,"mouseover",y)))},[y]),i.useEffect(()=>{L&&typeof h=="function"&&(Y!==null&&google.maps.event.removeListener(Y),N(google.maps.event.addListener(L,"mouseup",h)))},[h]),i.useEffect(()=>{L&&typeof m=="function"&&(X!==null&&google.maps.event.removeListener(X),x(google.maps.event.addListener(L,"rightclick",m)))},[m]),i.useEffect(()=>{L&&typeof v=="function"&&(G!==null&&google.maps.event.removeListener(G),ne(google.maps.event.addListener(L,"click",v)))},[v]),i.useEffect(()=>{L&&typeof C=="function"&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(L,"drag",C)))},[C]),i.useEffect(()=>{var R=new google.maps.Polygon(rs(rs({},e),{},{map:b}));return o&&R.setPath(o),l&&R.setPaths(l),typeof r<"u"&&R.setVisible(r),typeof s<"u"&&R.setEditable(s),typeof n<"u"&&R.setDraggable(n),u&&S(google.maps.event.addListener(R,"dblclick",u)),c&&j(google.maps.event.addListener(R,"dragend",c)),g&&U(google.maps.event.addListener(R,"dragstart",g)),d&&T(google.maps.event.addListener(R,"mousedown",d)),p&&J(google.maps.event.addListener(R,"mousemove",p)),f&&K(google.maps.event.addListener(R,"mouseout",f)),y&&Q(google.maps.event.addListener(R,"mouseover",y)),h&&N(google.maps.event.addListener(R,"mouseup",h)),m&&x(google.maps.event.addListener(R,"rightclick",m)),v&&ne(google.maps.event.addListener(R,"click",v)),C&&_(google.maps.event.addListener(R,"drag",C)),w(R),k&&k(R),()=>{I!==null&&google.maps.event.removeListener(I),O!==null&&google.maps.event.removeListener(O),D!==null&&google.maps.event.removeListener(
16D),A!==null&&google.maps.event.removeListener(A),W!==null&&google.maps.event.removeListener(W),F!==null&&google.maps.event.removeListener(F),$!==null&&google.maps.event.removeListener($),Y!==null&&google.maps.event.removeListener(Y),X!==null&&google.maps.event.removeListener(X),G!==null&&google.maps.event.removeListener(G),P&&P(R),R.setMap(null)}},[]),null}i.memo(ca);class da extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[])}componentDidMount(){var e=this.props.options||{};this.polygon=new google.maps.Polygon(e),this.polygon.setMap(this.context),this.registeredEvents=Z({updaterMap:os,eventMap:is,prevProps:{},nextProps:this.props,instance:this.polygon}),this.props.onLoad&&this.props.onLoad(this.polygon)}componentDidUpdate(e){this.polygon&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:os,eventMap:is,prevProps:e,nextProps:this.props,instance:this.polygon}))}componentWillUnmount(){this.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.polygon),H(this.registeredEvents),this.polygon&&this.polygon.setMap(null))}render(){return null}}M(da,"contextType",V);function as(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Et(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?as(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):as(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var ls={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},us={bounds(t,e){t.setBounds(e)},draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},visible(t,e){t.setVisible(e)}};function pa(t){var{options:e,bounds:n,draggable:s,editable:r,visible:o,onDblClick:l,onDragEnd:u,onDragStart:c,onMouseDown:g,onMouseMove:d,onMouseOut:p,onMouseOver:f,onMouseUp:y,onRightClick:h,onClick:m,onDrag:v,onBoundsChanged:C,onLoad:k,onUnmount:P}=t,E=i.useContext(V),[b,L]=i.useState(null),[w,I]=i.useState(null),[S,O]=i.useState(null),[j,D]=i.useState(null),[U,A]=i.useState(null),[T,W]=i.useState(null),[J,F]=i.useState(null),[K,$]=i.useState(null),[Q,Y]=i.useState(null),[N,X]=i.useState(null),[x,G]=i.useState(null),[ne,B]=i.useState(null),[_,R]=i.useState(null);return i.useEffect(()=>{b!==null&&b.setMap(E)},[E]),i.useEffect(()=>{typeof e<"u"&&b!==null&&b.setOptions(e)},[b,e]),i.useEffect(()=>{typeof s<"u"&&b!==null&&b.setDraggable(s)},[b,s]),i.useEffect(()=>{typeof r<"u"&&b!==null&&b.setEditable(r)},[b,r]),i.useEffect(()=>{typeof o<"u"&&b!==null&&b.setVisible(o)},[b,o]),i.useEffect(()=>{typeof n<"u"&&b!==null&&b.setBounds(n)},[b,n]),i.useEffect(()=>{b&&l&&(w!==null&&google.maps.event.removeListener(w),I(google.maps.event.addListener(b,"dblclick",l)))},[l]),i.useEffect(()=>{b&&u&&(S!==null&&google.maps.event.removeListener(S),O(google.maps.event.addListener(b,"dragend",u)))},[u]),i.useEffect(()=>{b&&c&&(j!==null&&google.maps.event.removeListener(j),D(google.maps.event.addListener(b,"dragstart",c)))},[c]),i.useEffect(()=>{b&&g&&(U!==null&&google.maps.event.removeListener(U),A(google.maps.event.addListener(b,"mousedown",g)))},[g]),i.useEffect(()=>{b&&d&&(T!==null&&google.maps.event.removeListener(T),W(google.maps.event.addListener(b,"mousemove",d)))},[d]),i.useEffect(()=>{b&&p&&(J!==null&&google.maps.event.removeListener(J),F(google.maps.event.addListener(b,"mouseout",p)))},[p]),i.useEffect(()=>{b&&f&&(K!==null&&google.maps.event.removeListener(K),$(google.maps.event.addListener(b,"mouseover",f)))},[f]),i.useEffect(()=>{b&&y&&(Q!==null&&google.maps.event.removeListener(Q),Y(google.maps.event.addListener(b,"mouseup",y)))},[y]),i.useEffect(()=>{b&&h&&(N!==null&&google.maps.event.removeListener(N),X(google.maps.event.addListener(b,"rightclick",h)))},[h]),i.useEffect(()=>{b&&m&&(x!==null&&google.maps.event.removeListener(x),G(google.maps.event.addListener(b,"click",m)))},[m]),i.useEffect(()=>{b&&v&&(ne!==null&&google.maps.event.removeListener(ne),B(google.maps.event.addListener(b,"drag",v)))},[v]),i.useEffect(()=>{b&&C&&(_!==null&&google.maps.event.removeListener(_),R(google.maps.event.addListener(b,"boun
16ds_changed",C)))},[C]),i.useEffect(()=>{var q=new google.maps.Rectangle(Et(Et({},e),{},{map:E}));return typeof o<"u"&&q.setVisible(o),typeof r<"u"&&q.setEditable(r),typeof s<"u"&&q.setDraggable(s),typeof n<"u"&&q.setBounds(n),l&&I(google.maps.event.addListener(q,"dblclick",l)),u&&O(google.maps.event.addListener(q,"dragend",u)),c&&D(google.maps.event.addListener(q,"dragstart",c)),g&&A(google.maps.event.addListener(q,"mousedown",g)),d&&W(google.maps.event.addListener(q,"mousemove",d)),p&&F(google.maps.event.addListener(q,"mouseout",p)),f&&$(google.maps.event.addListener(q,"mouseover",f)),y&&Y(google.maps.event.addListener(q,"mouseup",y)),h&&X(google.maps.event.addListener(q,"rightclick",h)),m&&G(google.maps.event.addListener(q,"click",m)),v&&B(google.maps.event.addListener(q,"drag",v)),C&&R(google.maps.event.addListener(q,"bounds_changed",C)),L(q),k&&k(q),()=>{w!==null&&google.maps.event.removeListener(w),S!==null&&google.maps.event.removeListener(S),j!==null&&google.maps.event.removeListener(j),U!==null&&google.maps.event.removeListener(U),T!==null&&google.maps.event.removeListener(T),J!==null&&google.maps.event.removeListener(J),K!==null&&google.maps.event.removeListener(K),Q!==null&&google.maps.event.removeListener(Q),N!==null&&google.maps.event.removeListener(N),x!==null&&google.maps.event.removeListener(x),ne!==null&&google.maps.event.removeListener(ne),_!==null&&google.maps.event.removeListener(_),P&&P(q),q.setMap(null)}},[]),null}i.memo(pa);class ga extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{rectangle:null}),M(this,"setRectangleCallback",()=>{this.state.rectangle!==null&&this.props.onLoad&&this.props.onLoad(this.state.rectangle)})}componentDidMount(){var e=new google.maps.Rectangle(Et(Et({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:us,eventMap:ls,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{rectangle:e}},this.setRectangleCallback)}componentDidUpdate(e){this.state.rectangle!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:us,eventMap:ls,prevProps:e,nextProps:this.props,instance:this.state.rectangle}))}componentWillUnmount(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),H(this.registeredEvents),this.state.rectangle.setMap(null))}render(){return null}}M(ga,"contextType",V);function cs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Ct(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cs(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cs(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var ds={onCenterChanged:"center_changed",onRadiusChanged:"radius_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ps={center(t,e){t.setCenter(e)},draggable(t,e){t.setDraggable(e)},editable(t,e){t.setEditable(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},radius(t,e){t.setRadius(e)},visible(t,e){t.setVisible(e)}},fa={};function ha(t){var{options:e,center:n,radius:s,draggable:r,editable:o,visible:l,onDblClick:u,onDragEnd:c,onDragStart:g,onMouseDown:d,onMouseMove:p,onMouseOut:f,onMouseOver:y,onMouseUp:h,onRightClick:m,onClick:v,onDrag:C,onCenterChanged:k,onRadiusChanged:P,onLoad:E,onUnmount:b}=t,L=i.useContext(V),[w,I]=i.useState(null),[S,O]=i.useState(null),[j,D]=i.useState(null),[U,A]=i.useState(null),[T,W]=i.useState(null),[J,F]=i.useState(null),[K,$]=i.useState(null),[Q,Y]=i.useState(null),[N,X]=i.useState(null),[x,G]=i.useState(null),[ne,B]=i.useState(null),[_,R]=i.useState(null),[q,ae]=i.useState(null),[ie,De]=i.useState(null);return i.useEffect(()=>{w!==null&&w.setMap(L)},[L]),i.useEffect(()=>{typeof e<"u"&&w!==null&&w.setOptions(e)},[w,e]),i.useEffect(()=>{typeof r<"u"&&w!==null&&w.setDraggable(r)},[w,r]),i.useEffect(()=>{typeof o<"u"&&w!==null&&w.setEditable(o)},[w,o]),i.useEffect(()=>{typeof l<"u"&&w!==null&&w.setVisible(l)},[w,l]),i.useEffect(()=>{typeof s=="number"&&w!==null&&w.setRadius(s)},[w,s]),i.useEffect(()=>{typeof n<"u"&&w!==null&&w.setCenter(n)},[w,n]),i.useEffect(()=>{w&&u&&(S!==null&&google.maps.event.removeListener(S),O(google.maps.event.addListener(w,"dblclick",u)))},[u]),i.useEffect(()=>
16{w&&c&&(j!==null&&google.maps.event.removeListener(j),D(google.maps.event.addListener(w,"dragend",c)))},[c]),i.useEffect(()=>{w&&g&&(U!==null&&google.maps.event.removeListener(U),A(google.maps.event.addListener(w,"dragstart",g)))},[g]),i.useEffect(()=>{w&&d&&(T!==null&&google.maps.event.removeListener(T),W(google.maps.event.addListener(w,"mousedown",d)))},[d]),i.useEffect(()=>{w&&p&&(J!==null&&google.maps.event.removeListener(J),F(google.maps.event.addListener(w,"mousemove",p)))},[p]),i.useEffect(()=>{w&&f&&(K!==null&&google.maps.event.removeListener(K),$(google.maps.event.addListener(w,"mouseout",f)))},[f]),i.useEffect(()=>{w&&y&&(Q!==null&&google.maps.event.removeListener(Q),Y(google.maps.event.addListener(w,"mouseover",y)))},[y]),i.useEffect(()=>{w&&h&&(N!==null&&google.maps.event.removeListener(N),X(google.maps.event.addListener(w,"mouseup",h)))},[h]),i.useEffect(()=>{w&&m&&(x!==null&&google.maps.event.removeListener(x),G(google.maps.event.addListener(w,"rightclick",m)))},[m]),i.useEffect(()=>{w&&v&&(ne!==null&&google.maps.event.removeListener(ne),B(google.maps.event.addListener(w,"click",v)))},[v]),i.useEffect(()=>{w&&C&&(_!==null&&google.maps.event.removeListener(_),R(google.maps.event.addListener(w,"drag",C)))},[C]),i.useEffect(()=>{w&&k&&(q!==null&&google.maps.event.removeListener(q),ae(google.maps.event.addListener(w,"center_changed",k)))},[v]),i.useEffect(()=>{w&&P&&(ie!==null&&google.maps.event.removeListener(ie),De(google.maps.event.addListener(w,"radius_changed",P)))},[P]),i.useEffect(()=>{var te=new google.maps.Circle(Ct(Ct({},e||fa),{},{map:L}));return typeof s=="number"&&te.setRadius(s),typeof n<"u"&&te.setCenter(n),typeof s=="number"&&te.setRadius(s),typeof l<"u"&&te.setVisible(l),typeof o<"u"&&te.setEditable(o),typeof r<"u"&&te.setDraggable(r),u&&O(google.maps.event.addListener(te,"dblclick",u)),c&&D(google.maps.event.addListener(te,"dragend",c)),g&&A(google.maps.event.addListener(te,"dragstart",g)),d&&W(google.maps.event.addListener(te,"mousedown",d)),p&&F(google.maps.event.addListener(te,"mousemove",p)),f&&$(google.maps.event.addListener(te,"mouseout",f)),y&&Y(google.maps.event.addListener(te,"mouseover",y)),h&&X(google.maps.event.addListener(te,"mouseup",h)),m&&G(google.maps.event.addListener(te,"rightclick",m)),v&&B(google.maps.event.addListener(te,"click",v)),C&&R(google.maps.event.addListener(te,"drag",C)),k&&ae(google.maps.event.addListener(te,"center_changed",k)),P&&De(google.maps.event.addListener(te,"radius_changed",P)),I(te),E&&E(te),()=>{S!==null&&google.maps.event.removeListener(S),j!==null&&google.maps.event.removeListener(j),U!==null&&google.maps.event.removeListener(U),T!==null&&google.maps.event.removeListener(T),J!==null&&google.maps.event.removeListener(J),K!==null&&google.maps.event.removeListener(K),Q!==null&&google.maps.event.removeListener(Q),N!==null&&google.maps.event.removeListener(N),x!==null&&google.maps.event.removeListener(x),ne!==null&&google.maps.event.removeListener(ne),q!==null&&google.maps.event.removeListener(q),ie!==null&&google.maps.event.removeListener(ie),b&&b(te),te.setMap(null)}},[]),null}i.memo(ha);class ma extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{circle:null}),M(this,"setCircleCallback",()=>{this.state.circle!==null&&this.props.onLoad&&this.props.onLoad(this.state.circle)})}componentDidMount(){var e=new google.maps.Circle(Ct(Ct({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:ps,eventMap:ds,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{circle:e}},this.setCircleCallback)}componentDidUpdate(e){this.state.circle!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:ps,eventMap:ds,prevProps:e,nextProps:this.props,instance:this.state.circle}))}componentWillUnmount(){if(this.state.circle!==null){var e;this.props.onUnmount&&this.props.onUnmount(this.state.circle),H(this.registeredEvents),(e=this.state.circle)===null||e===void 0||e.setMap(null)}}render(){return null}}M(ma,"contextType",V);function gs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function wt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
16e%2?gs(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gs(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var fs={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},hs={add(t,e){t.add(e)},addgeojson(t,e,n){t.addGeoJson(e,n)},contains(t,e){t.contains(e)},foreach(t,e){t.forEach(e)},loadgeojson(t,e,n,s){t.loadGeoJson(e,n,s)},overridestyle(t,e,n){t.overrideStyle(e,n)},remove(t,e){t.remove(e)},revertstyle(t,e){t.revertStyle(e)},controlposition(t,e){t.setControlPosition(e)},controls(t,e){t.setControls(e)},drawingmode(t,e){t.setDrawingMode(e)},map(t,e){t.setMap(e)},style(t,e){t.setStyle(e)},togeojson(t,e){t.toGeoJson(e)}};function va(t){var{options:e,onClick:n,onDblClick:s,onMouseDown:r,onMouseMove:o,onMouseOut:l,onMouseOver:u,onMouseUp:c,onRightClick:g,onAddFeature:d,onRemoveFeature:p,onRemoveProperty:f,onSetGeometry:y,onSetProperty:h,onLoad:m,onUnmount:v}=t,C=i.useContext(V),[k,P]=i.useState(null),[E,b]=i.useState(null),[L,w]=i.useState(null),[I,S]=i.useState(null),[O,j]=i.useState(null),[D,U]=i.useState(null),[A,T]=i.useState(null),[W,J]=i.useState(null),[F,K]=i.useState(null),[$,Q]=i.useState(null),[Y,N]=i.useState(null),[X,x]=i.useState(null),[G,ne]=i.useState(null),[B,_]=i.useState(null);return i.useEffect(()=>{k!==null&&k.setMap(C)},[C]),i.useEffect(()=>{k&&s&&(E!==null&&google.maps.event.removeListener(E),b(google.maps.event.addListener(k,"dblclick",s)))},[s]),i.useEffect(()=>{k&&r&&(L!==null&&google.maps.event.removeListener(L),w(google.maps.event.addListener(k,"mousedown",r)))},[r]),i.useEffect(()=>{k&&o&&(I!==null&&google.maps.event.removeListener(I),S(google.maps.event.addListener(k,"mousemove",o)))},[o]),i.useEffect(()=>{k&&l&&(O!==null&&google.maps.event.removeListener(O),j(google.maps.event.addListener(k,"mouseout",l)))},[l]),i.useEffect(()=>{k&&u&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(k,"mouseover",u)))},[u]),i.useEffect(()=>{k&&c&&(A!==null&&google.maps.event.removeListener(A),T(google.maps.event.addListener(k,"mouseup",c)))},[c]),i.useEffect(()=>{k&&g&&(W!==null&&google.maps.event.removeListener(W),J(google.maps.event.addListener(k,"rightclick",g)))},[g]),i.useEffect(()=>{k&&n&&(F!==null&&google.maps.event.removeListener(F),K(google.maps.event.addListener(k,"click",n)))},[n]),i.useEffect(()=>{k&&d&&($!==null&&google.maps.event.removeListener($),Q(google.maps.event.addListener(k,"addfeature",d)))},[d]),i.useEffect(()=>{k&&p&&(Y!==null&&google.maps.event.removeListener(Y),N(google.maps.event.addListener(k,"removefeature",p)))},[p]),i.useEffect(()=>{k&&f&&(X!==null&&google.maps.event.removeListener(X),x(google.maps.event.addListener(k,"removeproperty",f)))},[f]),i.useEffect(()=>{k&&y&&(G!==null&&google.maps.event.removeListener(G),ne(google.maps.event.addListener(k,"setgeometry",y)))},[y]),i.useEffect(()=>{k&&h&&(B!==null&&google.maps.event.removeListener(B),_(google.maps.event.addListener(k,"setproperty",h)))},[h]),i.useEffect(()=>{if(C!==null){var R=new google.maps.Data(wt(wt({},e),{},{map:C}));s&&b(google.maps.event.addListener(R,"dblclick",s)),r&&w(google.maps.event.addListener(R,"mousedown",r)),o&&S(google.maps.event.addListener(R,"mousemove",o)),l&&j(google.maps.event.addListener(R,"mouseout",l)),u&&U(google.maps.event.addListener(R,"mouseover",u)),c&&T(google.maps.event.addListener(R,"mouseup",c)),g&&J(google.maps.event.addListener(R,"rightclick",g)),n&&K(google.maps.event.addListener(R,"click",n)),d&&Q(google.maps.event.addListener(R,"addfeature",d)),p&&N(google.maps.event.addListener(R,"removefeature",p)),f&&x(google.maps.event.addListener(R,"removeproperty",f)),y&&ne(google.maps.event.addListener(R,"setgeometry",y)),h&&_(google.maps.event.addListener(R,"setproperty",h)),P(R),m&&m(R)}return()=>{k&&(E!==null&&google.maps.event.removeListener(E),L!==null&&google.maps.event.removeListener(L),I!==null&&google.maps.event.removeListener(I),O!==null&&google.maps.event.removeListener(O),D!==null&&google.maps.event.removeListener(
16D),A!==null&&google.maps.event.removeListener(A),W!==null&&google.maps.event.removeListener(W),F!==null&&google.maps.event.removeListener(F),$!==null&&google.maps.event.removeListener($),Y!==null&&google.maps.event.removeListener(Y),X!==null&&google.maps.event.removeListener(X),G!==null&&google.maps.event.removeListener(G),B!==null&&google.maps.event.removeListener(B),v&&v(k),k.setMap(null))}},[]),null}i.memo(va);class ya extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{data:null}),M(this,"setDataCallback",()=>{this.state.data!==null&&this.props.onLoad&&this.props.onLoad(this.state.data)})}componentDidMount(){if(this.context!==null){var e=new google.maps.Data(wt(wt({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:hs,eventMap:fs,prevProps:{},nextProps:this.props,instance:e}),this.setState(()=>({data:e}),this.setDataCallback)}}componentDidUpdate(e){this.state.data!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:hs,eventMap:fs,prevProps:e,nextProps:this.props,instance:this.state.data}))}componentWillUnmount(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),H(this.registeredEvents),this.state.data&&this.state.data.setMap(null))}render(){return null}}M(ya,"contextType",V);function ms(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function vs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ms(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ms(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var ys={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},bs={options(t,e){t.setOptions(e)},url(t,e){t.setUrl(e)},zIndex(t,e){t.setZIndex(e)}};class ba extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{kmlLayer:null}),M(this,"setKmlLayerCallback",()=>{this.state.kmlLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.kmlLayer)})}componentDidMount(){var e=new google.maps.KmlLayer(vs(vs({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:bs,eventMap:ys,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{kmlLayer:e}},this.setKmlLayerCallback)}componentDidUpdate(e){this.state.kmlLayer!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:bs,eventMap:ys,prevProps:e,nextProps:this.props,instance:this.state.kmlLayer}))}componentWillUnmount(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),H(this.registeredEvents),this.state.kmlLayer.setMap(null))}render(){return null}}M(ba,"contextType",V);function mr(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function La(t,e){return new e(t.lat,t.lng)}function Ea(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function Ca(t,e,n){return t instanceof e?t:n(t,e)}function wa(t,e,n){return t instanceof e?t:n(t,e)}function xa(t,e,n){var s=t&&t.fromLatLngToDivPixel(n.getNorthEast()),r=t&&t.fromLatLngToDivPixel(n.getSouthWest
16());return s&&r?{left:"".concat(r.x+e.x,"px"),top:"".concat(s.y+e.y,"px"),width:"".concat(s.x-r.x-e.x,"px"),height:"".concat(r.y-s.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function Ma(t,e,n){var s=t&&t.fromLatLngToDivPixel(n);if(s){var{x:r,y:o}=s;return{left:"".concat(r+e.x,"px"),top:"".concat(o+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function vr(t,e,n,s){return n!==void 0?xa(t,e,wa(n,google.maps.LatLngBounds,Ea)):Ma(t,e,Ca(s,google.maps.LatLng,La))}function Sa(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function Ls(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function ka(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ls(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function Pa(t,e,n,s,r){class o extends google.maps.OverlayView{constructor(u,c,g,d){super(),this.container=u,this.pane=c,this.position=g,this.bounds=d}onAdd(){var u,c=(u=this.getPanes())===null||u===void 0?void 0:u[this.pane];c?.appendChild(this.container)}draw(){var u=this.getProjection(),c=ka({},this.container?mr(this.container,r):{x:0,y:0}),g=vr(u,c,this.bounds,this.position);for(var[d,p]of Object.entries(g))this.container.style[d]=p}onRemove(){this.container.parentNode!==null&&this.container.parentNode.removeChild(this.container)}}return new o(t,e,n,s)}function Es(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Oa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Es(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Es(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}function Cs(t){if(!t)return"";var e=t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng);return e+""}function ws(t){if(!t)return"";var e=t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west));return e+""}function _a(t){var{position:e,bounds:n,mapPaneName:s,zIndex:r,onLoad:o,onUnmount:l,getPixelPositionOffset:u,children:c}=t,g=i.useContext(V),d=i.useMemo(()=>{var f=document.createElement("div");return f.style.position="absolute",f},[]),p=i.useMemo(()=>Pa(d,s,e,n,u),[d,s,e,n]);return i.useEffect(()=>(o?.(p),p?.setMap(g),()=>{l?.(p),p?.setMap(null)}),[g,p]),i.useEffect(()=>{d.style.zIndex="".concat(r)},[r,d]),_e.createPortal(c,d)}i.memo(_a);class Ie extends i.PureComponent{constructor(e){super(e),M(this,"state",{paneEl:null,containerStyle:{position:"absolute"}}),M(this,"updatePane",()=>{var s=this.props.mapPaneName,r=this.overlayView.getPanes();se(!!s,"OverlayView requires props.mapPaneName but got %s",s),r?this.setState({paneEl:r[s]}):this.setState({paneEl:null})}),M(this,"onAdd",()=>{var s,r;this.updatePane(),(s=(r=this.props).onLoad)===null||s===void 0||s.call(r,this.overlayView)}),M(this,"onPositionElement",()=>{var s=this.overlayView.getProjection(),r=Oa({x:0,y:0},this.containerRef.current?mr(this.containerRef.current,this.props.getPixelPositionOffset):{}),o=vr(s,r,this.props.bounds,this.props.position);if(!Sa(o,{left:this.state.containerStyle.left,top:this.state.containerStyle.top,width:this.state.containerStyle.width,height:this.state.containerStyle.height})){var l,u,c,g;this.setState({containerStyle:{top:(l=o.top)!==null&&l!==void 0?l:0,left:(u=o.left)!==null&&u!==void 0?u:0,width:(c=o.width)!==null&&c!==void 0?c:0,height:(g=o.height)!==null&&g!==void 0?g:0,position:"absolute"}})}}),M(this,"draw",()=>{this.onPositionElement()}),M(this,"onRemove",()=>{var s,r;this.setState(()=>({paneEl:null})),(s=(r=this.props).onUnmount)===null||s===void 0||s.call(r,this.overlayView)}
16),this.containerRef=i.createRef();var n=new google.maps.OverlayView;n.onAdd=this.onAdd,n.draw=this.draw,n.onRemove=this.onRemove,this.overlayView=n}componentDidMount(){this.overlayView.setMap(this.context)}componentDidUpdate(e){var n=Cs(e.position),s=Cs(this.props.position),r=ws(e.bounds),o=ws(this.props.bounds);(n!==s||r!==o)&&this.overlayView.draw(),e.mapPaneName!==this.props.mapPaneName&&this.updatePane()}componentWillUnmount(){this.overlayView.setMap(null)}render(){var e=this.state.paneEl;return e?_e.createPortal(oe.jsx("div",{ref:this.containerRef,style:this.state.containerStyle,children:i.Children.only(this.props.children)}),e):null}}M(Ie,"FLOAT_PANE","floatPane");M(Ie,"MAP_PANE","mapPane");M(Ie,"MARKER_LAYER","markerLayer");M(Ie,"OVERLAY_LAYER","overlayLayer");M(Ie,"OVERLAY_MOUSE_TARGET","overlayMouseTarget");M(Ie,"contextType",V);function Ia(){}function xs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function Ms(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xs(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xs(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var Ss={onDblClick:"dblclick",onClick:"click"},ks={opacity(t,e){t.setOpacity(e)}};function Da(t){var{url:e,bounds:n,options:s,visible:r}=t,o=i.useContext(V),l=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east)),u=i.useMemo(()=>new google.maps.GroundOverlay(e,l,s),[]);return i.useEffect(()=>{u!==null&&u.setMap(o)},[o]),i.useEffect(()=>{typeof e<"u"&&u!==null&&(u.set("url",e),u.setMap(o))},[u,e]),i.useEffect(()=>{typeof r<"u"&&u!==null&&u.setOpacity(r?1:0)},[u,r]),i.useEffect(()=>{var c=new google.maps.LatLngBounds(new google.maps.LatLng(n.south,n.west),new google.maps.LatLng(n.north,n.east));typeof n<"u"&&u!==null&&(u.set("bounds",c),u.setMap(o))},[u,n]),null}i.memo(Da);class yr extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{groundOverlay:null}),M(this,"setGroundOverlayCallback",()=>{this.state.groundOverlay!==null&&this.props.onLoad&&this.props.onLoad(this.state.groundOverlay)})}componentDidMount(){se(!!this.props.url||!!this.props.bounds,"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655");var e=new google.maps.GroundOverlay(this.props.url,this.props.bounds,Ms(Ms({},this.props.options),{},{map:this.context}));this.registeredEvents=Z({updaterMap:ks,eventMap:Ss,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{groundOverlay:e}},this.setGroundOverlayCallback)}componentDidUpdate(e){this.state.groundOverlay!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:ks,eventMap:Ss,prevProps:e,nextProps:this.props,instance:this.state.groundOverlay}))}componentWillUnmount(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))}render(){return null}}M(yr,"defaultProps",{onLoad:Ia});M(yr,"contextType",V);function Ps(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,s)}return n}function xt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
16e%2?Ps(Object(n),!0).forEach(function(s){M(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ps(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var Os={},_s={data(t,e){t.setData(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)}};function Ra(t){var{data:e,onLoad:n,onUnmount:s,options:r}=t,o=i.useContext(V),[l,u]=i.useState(null);return i.useEffect(()=>{google.maps.visualization||se(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} in useJsApiScript? %s',google.maps.visualization)},[]),i.useEffect(()=>{se(!!e,"data property is required in HeatmapLayer %s",e)},[e]),i.useEffect(()=>{l!==null&&l.setMap(o)},[o]),i.useEffect(()=>{r&&l!==null&&l.setOptions(r)},[l,r]),i.useEffect(()=>{var c=new google.maps.visualization.HeatmapLayer(xt(xt({},r),{},{data:e,map:o}));return u(c),n&&n(c),()=>{l!==null&&(s&&s(l),l.setMap(null))}},[]),null}i.memo(Ra);class ja extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{heatmapLayer:null}),M(this,"setHeatmapLayerCallback",()=>{this.state.heatmapLayer!==null&&this.props.onLoad&&this.props.onLoad(this.state.heatmapLayer)})}componentDidMount(){se(!!google.maps.visualization,'Did you include prop libraries={["visualization"]} to <LoadScript />? %s',google.maps.visualization),se(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var e=new google.maps.visualization.HeatmapLayer(xt(xt({},this.props.options),{},{data:this.props.data,map:this.context}));this.registeredEvents=Z({updaterMap:_s,eventMap:Os,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{heatmapLayer:e}},this.setHeatmapLayerCallback)}componentDidUpdate(e){H(this.registeredEvents),this.registeredEvents=Z({updaterMap:_s,eventMap:Os,prevProps:e,nextProps:this.props,instance:this.state.heatmapLayer})}componentWillUnmount(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),H(this.registeredEvents),this.state.heatmapLayer.setMap(null))}render(){return null}}M(ja,"contextType",V);var Is={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},Ds={register(t,e,n){t.registerPanoProvider(e,n)},links(t,e){t.setLinks(e)},motionTracking(t,e){t.setMotionTracking(e)},options(t,e){t.setOptions(e)},pano(t,e){t.setPano(e)},position(t,e){t.setPosition(e)},pov(t,e){t.setPov(e)},visible(t,e){t.setVisible(e)},zoom(t,e){t.setZoom(e)}};class Na extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{streetViewPanorama:null}),M(this,"setStreetViewPanoramaCallback",()=>{this.state.streetViewPanorama!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewPanorama)})}componentDidMount(){var e,n,s=(e=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&e!==void 0?e:null;this.registeredEvents=Z({updaterMap:Ds,eventMap:Is,prevProps:{},nextProps:this.props,instance:s}),this.setState(()=>({streetViewPanorama:s}),this.setStreetViewPanoramaCallback)}componentDidUpdate(e){this.state.streetViewPanorama!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Ds,eventMap:Is,prevProps:e,nextProps:this.props,instance:this.state.streetViewPanorama}))}componentWillUnmount(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),H(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))}render(){return null}}M(Na,"contextType",V);class Aa extends i.PureComponent{constructor(){super(...arguments),M(this,"state",{streetViewService:null}),M(this,"setStreetViewServiceCallback",()=>{this.state.streetViewService!==null&&this.props.onLoad&&this.props.onLoad(this.state.streetViewService)})}componentDidMount(){var e=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:e}},this.setStreetViewServiceCallback)}componentWillUnmount(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)}render(){return null}}M(Aa,"contextType",V);var Rs={onDirectionsChanged:"directions_changed"},js={directions(t,e){t.setDirections(e)},map(t,e){t.setMap(e)},options(t,e){t.setOptions(e)},panel(t,e){t.setPanel(e)},routeIndex(t,e){t.setRouteIndex(e)}};class Ta extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"state",{directionsRenderer:null}),M(this,"setDirectionsRendererCallback",()=>{this.state.directionsRenderer!==null&&(this.state.directionsRenderer.setMap(this.context),this.props.onLoad&&this.props.onLoad(this.state.directionsRenderer))})}componentDidMount(){var e=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Z({updaterMap:js,eventMap:Rs,prevProps:{},nextProps:this.props,instance:e}),this.setState(function(){return{directionsRenderer:e}},this.setDirectionsRendererCallback)}componentDidUpdate(e){this.state.directionsRenderer!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:js,eventMap:Rs,prevProps:e,nextProps:this.props,instance:this.state.directionsRenderer}))}componentWillUnmount(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),H(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))}render(){return null}}M(Ta,"contextType",V);var Ns={onPlacesChanged:"places_changed"},As={bounds(t,e){t.setBounds(e)}};class Ua extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"containerElement",i.createRef()),M(this,"state",{searchBox:null}),M(this,"setSearchBoxCallback",()=>{this.state.searchBox!==null&&this.props.onLoad&&this.props.onLoad(this.state.searchBox
16)})}componentDidMount(){if(se(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var e=this.containerElement.current.querySelector("input");if(e!==null){var n=new google.maps.places.SearchBox(e,this.props.options);this.registeredEvents=Z({updaterMap:As,eventMap:Ns,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{searchBox:n}},this.setSearchBoxCallback)}}}componentDidUpdate(e){this.state.searchBox!==null&&(H(this.registeredEvents),this.registeredEvents=Z({updaterMap:As,eventMap:Ns,prevProps:e,nextProps:this.props,instance:this.state.searchBox}))}componentWillUnmount(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),H(this.registeredEvents))}render(){return oe.jsx("div",{ref:this.containerElement,children:i.Children.only(this.props.children)})}}M(Ua,"contextType",V);var Ts={onPlaceChanged:"place_changed"},Us={bounds(t,e){t.setBounds(e)},restrictions(t,e){t.setComponentRestrictions(e)},fields(t,e){t.setFields(e)},options(t,e){t.setOptions(e)},types(t,e){t.setTypes(e)}};class br extends i.PureComponent{constructor(){super(...arguments),M(this,"registeredEvents",[]),M(this,"containerElement",i.createRef()),M(this,"state",{autocomplete:null}),M(this,"setAutocompleteCallback",()=>{this.state.autocomplete!==null&&this.props.onLoad&&this.props.onLoad(this.state.autocomplete)})}componentDidMount(){var e;se(!!google.maps.places,'You need to provide libraries={["places"]} prop to <LoadScript /> component %s',google.maps.places);var n=(e=this.containerElement.current)===null||e===void 0?void 0:e.querySelector("input");if(n){var s=new google.maps.places.Autocomplete(n,this.props.options);this.registeredEvents=Z({updaterMap:Us,eventMap:Ts,prevProps:{},nextProps:this.props,instance:s}),this.setState(()=>({autocomplete:s}),this.setAutocompleteCallback)}}componentDidUpdate(e){H(this.registeredEvents),this.registeredEvents=Z({updaterMap:Us,eventMap:Ts,prevProps:e,nextProps:this.props,instance:this.state.autocomplete})}componentWillUnmount(){this.state.autocomplete!==null&&H(this.registeredEvents)}render(){return oe.jsx("div",{ref:this.containerElement,className:this.props.className,children:i.Children.only(this.props.children)})}}M(br,"defaultProps",{className:""});M(br,"contextType",V);const Ba=[{featureType:"poi.business",stylers:[{visibility:"off"}]},{featureType:"poi.park",elementType:"labels.text",stylers:[{visibility:"off"}]}],za={width:"100%",height:"100%"},Bs={lat:-3.7282529,lng:-38.5359288};function Va({latitude:t,longitude:e,updateLatLong:n}){const[s,r]=a.useState(!1),[o,l]=a.useState({lat:t??Bs.lat,lng:e??Bs.lng}),u=a.useRef(null),c=a.useCallback(f=>{u.current=f},[]),g=a.useCallback(()=>{u.current=null},[]),{isLoaded:d}=go({googleMapsApiKey:"AIzaSyAlWmGRhhOSOL07T7jYWrCtF4dKc7nvKg0"});a.useEffect(()=>{t&&e&&l({lat:t,lng:e})},[t,e]);const p=a.useCallback(()=>{r(!1);const f=u.current;if(f){const y={lat:f.getCenter().lat(),lng:f.getCenter().lng()};l(y),n(y.lat,y.lng)}},[n]);return d?a.createElement(a.Fragment,null,a.createElement(eo,{mapContainerStyle:za,onLoad:c,onUnmount:g,center:o,zoom:16,onDragStart:()=>r(!0),onDragEnd:p,options:{styles:Ba,disableDefaultUI:!0,disableDoubleClickZoom:!0,gestureHandling:"greedy"}}),s?a.createElement(Wi,{style:{color:"#777",fontSize:55,position:"absolute",top:"50%",transform:"translate(-50%, -49.81px)",left:"50%"}}):a.createElement(ui,{style:{color:"#890000",fontSize:55,position:"absolute",top:"50%",transform:"translate(-50%, -49.81px)",left:"50%"}})):a.createElement("div",{className:"flex h-full w-full items-center justify-center"},a.createElement(xe,{color:"primary"}))}function Gt(){const{data:t,error:e,mutate:n}=zt("/api/v2/company/address",kr,{dedupingInterval:1e4});return{data:t,isLoading:!e&&!t,isError:e,mutate:n}}const Wa=Rr().shape({street:je().trim().required("Você deve informar o Endereço"),neighborhood:je().trim().required("Você deve informar o Bairro"),city:je().trim().required("Você deve informar o Cidade"),state:je().trim().oneOf(jr,"Informe um estado válido").uppercase().required("Você deve informar o Estado"),zip_code:je().matches(/^\d{5}-?\d{3}$/,"Informe um CEP válido").required("Você deve informar o CEP")}),zs={street:"",house_number:"",neighborhood:"",address_complement:"",city:"",state:"",zip_code:"",address_block:"",address_lot:"",latitude:-3.7282529,longitude:-38.5359288};function Fa({address:t,goBack:e,setLoading:n,onClose:s}){const r=Vt(),o=rr(),{mutate:l}=Gt(),{handleSubmit:u,reset:c,watch:g,setValue:d,formState:p,control:f}=Pr({mode:"onSubmit",defaultValues:zs,resolver:Or(Wa)}),y=g("latitude"),h=g("longitude");a.useEffect(()=>{c({...zs,...t||{}})},[t,c]);const m=a.useCallback(async C=>{n(!0);const k={street:C.street,house_number:C.house_number,neighborhood:C.neighborhood,address_complement:C.address_complement,city:C.city,state:C.state,zip_code:C.zip_code.replace(/\D/g,""),address_block:C.address_block,address_lot:C.address_lot,latitude:C.latitude||-3.7282529,longitude:C.longitude||-38.5359288};try{await Bi(k),await l(),o(_r()),s()}catch(P){r.error(P.response?.data?.message||"Não foi possÃvel atualizar a conta")}n(!1)},[r,o,l,s,n]),{errors:v}=p;return a.createElement("form",{onSubmit:u(m),className:"space-y-28"},a.createElement("div",{className:"space-y-8"},a.createElement("div",{className:"text-center text-16 font-bold text-gray-600"},"Indique no mapa onde fica o estabelecimento"),a.createElement(he,{variant:"outlined",className:"relative h-224 w-full"},a.createElement(Va,{latitude:y,longitude:h,updateLatLong:(C,k)=>{d("latitude",C),d("longitude",k)}}))),a.createElement("div",{className:"space-y-20"},a.createElement("div",{className:"flex space-x-12"},a.createElement(me,{name:"street",control:f,render:({field:C}
16)=>a.createElement(re,{...C,id:"street",label:"Endereço",error:!!v.street,helperText:v?.street?.message,variant:"outlined",fullWidth:!0,required:!0})}),a.createElement(me,{name:"house_number",control:f,render:({field:C})=>a.createElement(re,{...C,id:"house_number",label:"Número",error:!!v.house_number,helperText:v?.house_number?.message,variant:"outlined",className:"w-128"})})),a.createElement("div",{className:"flex space-x-12"},a.createElement(me,{name:"neighborhood",control:f,render:({field:C})=>a.createElement(re,{...C,id:"neighborhood",label:"Bairro",error:!!v.neighborhood,helperText:v?.neighborhood?.message,variant:"outlined",fullWidth:!0,required:!0})}),a.createElement(me,{name:"address_complement",control:f,render:({field:C})=>a.createElement(re,{...C,id:"address_complement",label:"Complemento",error:!!v.address_complement,helperText:v?.address_complement?.message,variant:"outlined",fullWidth:!0})})),a.createElement("div",{className:"flex space-x-12"},a.createElement(me,{name:"city",control:f,render:({field:C}
16)=>a.createElement(re,{...C,id:"city",label:"Cidade",error:!!v.city,helperText:v?.city?.message,variant:"outlined",fullWidth:!0,required:!0})}),a.createElement(me,{name:"state",control:f,render:({field:C})=>a.createElement(Ir,{...C,error:!!v.state,helperText:v?.state?.message})})),a.createElement(me,{name:"zip_code",control:f,render:({field:C})=>a.createElement(re,{...C,id:"zip_code",label:"CEP",error:!!v.zip_code,helperText:v?.zip_code?.message,InputProps:{inputComponent:Dr},variant:"outlined",fullWidth:!0,required:!0})})),a.createElement("div",{className:"flex justify-between space-x-16"},a.createElement(de,{onClick:e,variant:"outlined"},"Voltar"),a.createElement(de,{type:"submit",color:"primary",variant:"contained",disableElevation:!0},"Salvar")))}var ze={},Vs;function $a(){if(Vs)return ze;Vs=1;var t=Se(),e=ke();Object.defineProperty(ze,"__esModule",{value:!0}),ze.default=void 0;var n=e(Pe()),s=t(Oe()),r=(0,s.default)(n.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}),"LocationOn");return ze.default=r,ze}var Za=$a();const Ha=Le(Za);var Ve={},Ws;function Ga(){if(Ws)return Ve;Ws=1;var t=Se(),e=ke();Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.default=void 0;var n=e(Pe()),s=t(Oe()),r=(0,s.default)(n.createElement("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7zm.88 13.75h-1.75V14h1.75v1.75zm0-2.87h-1.75c0-2.84 2.62-2.62 2.62-4.38 0-.96-.79-1.75-1.75-1.75s-1.75.79-1.75 1.75H8.5C8.5 6.57 10.07 5 12 5s3.5 1.57 3.5 3.5c0 2.19-2.62 2.41-2.62 4.38z"}),"NotListedLocation");return Ve.default=r,Ve}var qa=Ga();const Ka=Le(qa),Ya="/assets/powered_by_google_on_white_hdpi-PZDd-Vr9.png";var gt={exports:{}},Ja=gt.exports,Fs;function Qa(){return Fs||(Fs=1,(function(t,e){(function(n,s){t.exports=s()})(Ja,(()=>{return n={705:r=>{r.exports=function(o,l){const u=[];return l.length===0?u.push({text:o,highlight:!1}):l[0][0]>0&&u.push({text:o.slice(0,l[0][0]),highlight:!1}),l.forEach(((c,g)=>{const d=c[0],p=c[1];u.push({text:o.slice(d,p),highlight:!0}),g===l.length-1?p<o.length&&u.push({text:o.slice(p,o.length),highlight:!1}):p<l[g+1][0]&&u.push({text:o.slice(p,l[g+1][0]),highlight:!1})})),u}}},s={},(function r(o){var l=s[o];if(l!==void 0)return l.exports;var u=s[o]={exports:{}};return n[o](u,u.exports,r),u.exports})(705);var n,s}))})(gt)),gt.exports}var Xa=Qa();const el=Le(Xa);function tl({open:t,onClose:e,onSubmit:n}){const[s,r]=a.useState("");a.useEffect(()=>{t&&r("")},[t]);const o=a.useCallback(()=>{n(s),e()},[s,e,n]);return a.createElement(Wt,{open:t,title:"Informe o número do endereço",onClose:e,onSubmit:void 0},a.createElement("div",{className:"space-y-20"},a.createElement(re,{label:"Número",value:s,onChange:l=>r(l.target.value),variant:"outlined",autoFocus:!0,fullWidth:!0}),a.createElement("div",{className:"flex space-x-16"},a.createElement(de,{onClick:o,variant:"outlined",fullWidth:!0},"Endereço sem número"),a.createElement(de,{color:"primary",variant:"contained",onClick:o,disabled:!s,disableElevation:!0,fullWidth:!0},"Buscar com número"))))}function nl(t,e,n){if(!e)return;const s=document.createElement("script");s.setAttribute("async",""),s.setAttribute("id",n),s.src=t,e.appendChild(s)}const ct={current:null},dt={current:null},pt={route:"short_name",street_number:"long_name",sublocality_level_1:"long_name",administrative_area_level_2:"long_name",administrative_area_level_1:"short_name",postal_code:"long_name"},$s={route:"street",street_number:"house_number",sublocality_level_1:"neighborhood",administrative_area_level_2:"city",administrative_area_level_1:"state",postal_code:"zip_code"},Zs=["route","street_number","sublocality_level_1","administrative_area_level_2","administrative_area_level_1","postal_code"],sl=t=>e=>a.createElement("div",null,e.children,a.createElement(Ur,{button:!0,onClick:t},a.createElement("div",{className:"flex w-full items-center space-x-20 py-8"},a.createElement(Ka,{className:"text-3xl text-red"}),a.createElement("div",{className:"text-16"},a.createElement("div",{className:"font-bold text-red"},"Não achei meu endereço"),a.createElement("div",{className:"text-15 font-light text-gray-500"},"Quero tentar de outra forma"))))),rl=t=>a.createElement("div",{className:"flex-grow overflow-auto"},t.children);function il({goToAddressForm:t,setLoading:e}
16){const[n,s]=a.useState(""),[r,o]=a.useState([]),[l,u]=a.useState(!1),c=a.useRef(!1),[g,d]=a.useState(!1);typeof window<"u"&&!c.current&&(document.querySelector("#google-maps")||nl("https://maps.googleapis.com/maps/api/js?key=AIzaSyAlWmGRhhOSOL07T7jYWrCtF4dKc7nvKg0&libraries=places",document.querySelector("head"),"google-maps"),c.current=!0);const p=a.useMemo(()=>Nr((v,C)=>{ct.current.getPlacePredictions(v,C)},850),[]),f=a.useMemo(()=>(v,C)=>{dt.current.getDetails(v,C)},[]),y=(v,C,k)=>{k==="select-option"&&(d(!0),e(!0),f({placeId:C.place_id,fields:["address_component","geometry"]},P=>{const E={latitude:P.geometry.location.lat(),longitude:P.geometry.location.lng()};for(let b=0;b<P.address_components.length;b++)for(let L=0;L<P.address_components[b].types.length;L++){const w=P.address_components[b].types[L];if(Zs.indexOf(w)!==-1&&pt[w]){const I=P.address_components[b][pt[w]];E[$s[w]]=I;break}}if(d(!1),e(!1),!E.house_number){u(!0);return}t(E)}))},h=v=>{d(!0),e(!0),p({input:n+", "+v,bounds:{east:-36.532803,north:-2.50539,south:-7.817451,west:-41.872921},types:["address"],language:"pt_BR",componentRestrictions:{country:"br"}},(C,k)=>{k==="OK"&&f({placeId:C[0].place_id,fields:["address_component","geometry"]},P=>{const E={latitude:P.geometry.location.lat(),longitude:P.geometry.location.lng()};for(let b=0;b<P.address_components.length;b++)for(let L=0;L<P.address_components[b].types.length;L++){const w=P.address_components[b].types[L];if(Zs.indexOf(w)!==-1&&pt[w]){const I=P.address_components[b][pt[w]];E[$s[w]]=I;break}}d(!1),e(!1),t(E)})})};a.useEffect(()=>{if(!ct.current&&window.google&&(window.google.maps.places.AutocompleteService(),ct.current=new window.google.maps.places.AutocompleteService),!dt.current&&window.google&&(dt.current=new window.google.maps.places.PlacesService(document.createElement("div"))),!(!ct.current||!dt.current)){if(n===""){o([]);return}d(!0),p({input:n,bounds:{east:-36.532803,north:-2.50539,south:-7.817451,west:-41.872921},types:["address"],language:"pt_BR",componentRestrictions:{country:"br"}},(C,k)=>{k==="OK"&&(C&&C.length>0?o(C):o(C||[])),d(!1)})}},[n,p,d]);const m=a.useMemo(()=>sl(t),[t]);return a.createElement("div",{className:"relative flex h-full w-full flex-col sm:h-640"},a.createElement(Ar,{fullWidth:!0,freeSolo:!0,autoComplete:!0,getOptionLabel:v=>typeof v=="string"?v:v.description.slice(0,-13),filterOptions:v=>v,options:r,open:r.length>0&&n.length>0,clearText:"Limpar",closeIcon:a.createElement(Tr,{fontSize:"small"}),onChange:y,noOptionsText:"Nenhum endereço encontrado",PaperComponent:m,PopperComponent:rl,onInputChange:(v,C)=>{s(C)},renderInput:v=>a.createElement(a.Fragment,null,a.createElement(re,{...v,label:"Buscar endereço e número",InputProps:{...v.InputProps,endAdornment:a.createElement(a.Fragment,null,g?a.createElement(xe,{className:"text-gray-500",size:20}):null,v.InputProps.endAdornment)},variant:"outlined",fullWidth:!0}),a.createElement("div",{className:"mt-8 flex w-full justify-end"},a.createElement("img",{alt:"powered by Google",src:Ya,className:"poweredByGoogle h-auto w-96"}))),renderOption:v=>{const C=v.structured_formatting.main_text_matched_substrings||[],k=el(v.structured_formatting.main_text,C.map(P=>[P.offset,P.offset+P.length]));return a.createElement("div",{className:"flex w-full items-center space-x-20 py-8"},a.createElement(Ha,{className:"text-3xl text-gray-400"}),a.createElement("div",{className:"text-16"},a.createElement("div",{className:"text-gray-600"},k.map((P,E)=>a.createElement("span",{key:E,style:{fontWeight:P.highlight?700:400}},P.text))),a.createElement("div",{className:"text-15 font-light text-gray-500"},v.structured_formatting.secondary_text?.slice(0,-8))))}}),r.length===0&&n.length>0&&!g&&a.createElement("div",{className:"flex flex-1 flex-col items-center justify-center text-center"},a.createElement("div",{className:"mb-12 text-20 font-bold text-gray-400"},"Endereço não encontrado"),a.createElement("div",{className:"mb-24 text-16 font-medium text-gray-400"},"Verifique se o endereço e o número estão corretos"),a.createElement("div",{className:"cursor-pointer text-16 font-bold text-red",onClick:()=>t()},"Tentar de outra forma")),a.createElement(tl,{open:l,onClose:()=>u(!1),onSubmit:h}))}function ol({open:t,onClose:e}
16){const[n,s]=a.useState(!1),[r,o]=a.useState("search"),[l,u]=a.useState(null),c=p=>{u(p),o("confirm")},g=()=>{o("search")},d=()=>{o("search"),u(null),s(!1),e()};return a.createElement(Wt,{open:t,title:"Atualizar endereço",loading:n,onClose:d,onSubmit:void 0},r==="search"&&a.createElement(il,{goToAddressForm:c,setLoading:s}),r==="confirm"&&a.createElement(Fa,{address:l,goBack:g,setLoading:s,onClose:d}))}function al(){return a.createElement(he,{variant:"outlined",className:"mb-24 space-y-16 rounded-6 p-16 sm:p-20",style:{borderColor:"rgba(0,0,0,0.23)"}},a.createElement("div",{className:"h-24 w-full max-w-360 animate-pulse rounded-8 bg-gray-200"}),a.createElement("div",{className:"h-216 w-full animate-pulse rounded-8 bg-gray-200"}),a.createElement("div",{className:"space-y-8"},a.createElement("div",{className:"h-24 w-full max-w-320 animate-pulse rounded-8 bg-gray-200"}),a.createElement("div",{className:"h-24 w-full max-w-360 animate-pulse rounded-8 bg-gray-200"}),a.createElement("div",{className:"h-24 w-full max-w-288 animate-pulse rounded-8 bg-gray-200"})),a.createElement("div",{className:"h-36 w-full max-w-192 animate-pulse rounded-8 bg-gray-200"}))}function ll(t){const{latitude:e,longitude:n}=t;return`https://maps.googleapis.com/maps/api/staticmap?center=${e},${n}&zoom=16&size=640x400&scale=2&maptype=roadmap&markers=color:red%7C${e},${n}&style=feature:poi|visibility:off&key=AIzaSyAlWmGRhhOSOL07T7jYWrCtF4dKc7nvKg0`}function ul(){const{data:t,isLoading:e,isError:n}=Gt(),[s,r]=a.useState(!1);if(e)return a.createElement(al,null);if(n)return a.createElement(he,{variant:"outlined",className:"mb-24 space-y-16 rounded-6 p-16 sm:p-20",style:{borderColor:"rgba(0,0,0,0.23)"}},a.createElement(Br,{title:"Não foi possÃvel pegar o endereço da empresa"}));const o=t.street&&t.neighborhood&&t.city;return a.createElement(he,{variant:"outlined",className:"mb-24 space-y-16 rounded-6 p-16 sm:p-20",style:{borderColor:"rgba(0,0,0,0.23)"}},a.createElement("div",{className:"text-18 font-bold"},"Endereço do estabelecimento"),a.createElement(he,{variant:"outlined",className:"h-216 w-full overflow-hidden rounded-8"},t.latitude&&t.longitude?a.createElement("img",{src:ll(t),alt:"Mapa",className:"h-full w-full object-cover object-center"}):a.createElement("div",{className:"flex h-full w-full flex-col items-center justify-center space-y-16 bg-gray-100"},a.createElement(Ui,{className:"h-88 w-88 text-gray-300"}),a.createElement("div",{className:"max-w-360 text-center text-18 font-semibold text-gray-400"},"Edite o endereço e mostre no mapa onde fica seu estabelecimento"))),o&&a.createElement("p",{className:"whitespace-pre-wrap text-16 leading-loose text-gray-600"},li(t)),a.createElement(de,{variant:"text",color:"primary",startIcon:a.createElement(zr,null),onClick:()=>r(!0)},o?"Editar endereço":"Informar endereço"),a.createElement(ol,{open:s,onClose:()=>r(!1)}))}const Hs={header:"PROFILE_MEDIA_HEADER_ITEM",highlights:"PROFILE_MEDIA_HIGHLIGHTS_ITEM"},Lr=["jpg","jpeg","png","webp"],Er=["mp4","webm","mov","m4v","avi","mkv"],cl=Lr.map(t=>`.${t}`).join(","),dl=Er.map(t=>`.${t}`).join(","),pl=`${cl},${dl}`,ft=5,qt=2,Kt=15,gl=[{key:"sunday",label:"DOM"},{key:"monday",label:"SEG"},{key:"tuesday",label:"TER"},{key:"wednesday",label:"QUA"},{key:"thursday",label:"QUI"},{key:"friday",label:"SEX"},{key:"saturday",label:"SÃB"}];function fl(t){return{selectedDays:(t||[]).map(e=>e.weekday),startTime:t?.[0]?.start_time||"",endTime:t?.[0]?.end_time||""}}function hl({item:t}){const[e,n]=a.useState(!1);a.useEffect(()=>{n(!1)},[t.previewUrl]);const s=t.uploadStatus===le.ERROR,r=t.type==="image"&&t.previewUrl,o=t.type==="video"&&t.previewUrl&&!e;return a.createElement("div",{className:Mt("relative h-56 w-56 flex-shrink-0 overflow-hidden rounded-6 bg-gray-100",s&&"opacity-50")},r?a.createElement("img",{src:t.previewUrl,alt:"",className:"h-full w-full object-cover"}):o?a.createElement("video",{key:t.previewUrl,src:t.previewUrl,muted:!0,playsInline:!0,preload:"metadata",className:"h-full w-full object-cover",controls:!1,onError:()=>setTimeout(()=>n(!0),0)}):a.createElement("div",{className:"flex h-full w-full items-center justify-center text-gray-400"},a.createElement(fi,null)))}const ml={[le.UPLOADED]:{Icon:Zr,text:"Upload concluÃdo",className:"text-green-dark"}
16,[le.ERROR]:{Icon:hi,text:"Erro ao fazer upload, tente novamente",className:"text-red-darker"}};function vl({item:t,show:e}){if(!e)return null;if(t.uploadStatus===le.UPLOADING)return a.createElement("div",{className:"space-y-8"},a.createElement("div",{className:"text-purple-600 flex items-center gap-4 text-12"},a.createElement(Fr,{className:"text-16"}),a.createElement("span",null,"Aguarde o upload terminar antes de fechar")),a.createElement($r,{variant:"determinate",value:t.uploadProgress,className:"h-4 rounded-2"}));const n=ml[t.uploadStatus];if(!n)return null;const{Icon:s,text:r,className:o}=n;return a.createElement("div",{className:Mt("flex items-center gap-4 text-12",o)},a.createElement(s,{className:"text-16"}),a.createElement("span",null,r))}function yl({scheduleRules:t,onSave:e,disabled:n}){const{selectedDays:s,startTime:r,endTime:o}=fl(t),l=!r&&!o,u=s.length>0,c=n,g=d=>{const p=!s.includes(d),f=p?[...s,d]:s.filter(m=>m!==d);let y=r,h=o;p&&f.length===1&&!r&&!o&&(y="00:00",h="23:59"),e({weekdays:f,start_time:y,end_time:h})};return a.createElement("div",{className:"mt-8 flex flex-col gap-4 roun
16ded-8 border border-solid border-gray-200 bg-gray-50 px-12 py-12"},a.createElement("div",{className:"flex flex-wrap items-center gap-x-16 gap-y-6"},a.createElement("div",{className:"flex items-center gap-4"},gl.map(d=>{const p=s.includes(d.key);return a.createElement("button",{key:d.key,type:"button","aria-pressed":p,disabled:c,onClick:()=>g(d.key),style:p?{backgroundColor:"#A543FA",borderColor:"#A543FA",color:"#ffffff"}:void 0,className:Mt("h-28 min-w-[40px] rounded-4 border border-solid px-6 text-11 font-semibold transition-colors",p?"border-purple-600 bg-purple-600 text-white":"hover:border-purple-300 hover:text-purple-600 border-gray-300 bg-white text-gray-600",c&&"cursor-not-allowed opacity-50")},d.label)})),u&&!l&&a.createElement("div",{className:"flex items-center gap-6"},a.createElement("span",{className:"text-12 text-gray-500"},"de"),a.createElement("input",{type:"time",value:r,disabled:c,onChange:d=>e({weekdays:s,start_time:d.target.value,end_time:o}),className:"w-90 h-28 rounded-4 border border-solid border-gray-300 bg-white px-8 text-12 text-gray-700 disabled:opacity-50"}),a.createElement("span",{className:"text-12 text-gray-500"},"até"),a.createElement("input",{type:"time",value:o,disabled:c,onChange:d=>e({weekdays:s,start_time:r,end_time:d.target.value}),className:"w-90 h-28 rounded-4 border border-solid border-gray-300 bg-white px-8 text-12 text-gray-700 disabled:opacity-50"})),u&&a.createElement("div",{className:"flex items-center"},a.createElement(Hr,{className:"m-0",style:{marginLeft:-4},control:a.createElement(Gr,{color:"primary",size:"small",checked:l,disabled:c,onChange:d=>{const p=d.target.checked?"":"00:00",f=d.target.checked?"":"23:59";e({weekdays:s,start_time:p,end_time:f})}}),label:a.createElement("span",{className:"text-12 text-gray-600"},"Dia inteiro")}))),!u&&a.createElement("p",{className:"m-0 text-11 text-gray-400"},"Selecione dias para configurar um horário de exibição."))}function bl({item:t,index:e,group:n,onRemove:s,onReorder:r,onReorderComplete:o,uploadFeedbackMediaIds:l=new Set,onScheduleChange:u,hasScheduleError:c}){const g=t.uploadStatus===le.UPLOADING,d=g,p=a.useMemo(()=>t.uploadStatus!==le.UPLOADED?!1:!t.scheduleRules||t.scheduleRules.length===0?!0:t.scheduleRules.some(P=>P.start_time&&!P.end_time||!P.start_time&&P.end_time),[t.scheduleRules,t.uploadStatus]),f=a.useRef(o);a.useEffect(()=>{f.current=o},[o]);const[{isDragging:y},h]=Ei({item:{type:Hs[n],index:e,group:n},collect:P=>({isDragging:P.isDragging()}),canDrag:!g,end:()=>{f.current?.()}}),[,m]=Ci({accept:Hs[n],hover(P){if(P.group!==n)return;const E=P.index,b=e;E!==b&&(r(E,b),P.index=b)}}),v=t.type==="video"?"VÃdeo":"Imagem",C=ci(t),k=a.useCallback(P=>{t.mediaId&&u?.(t.id,t.mediaId,P)},[t.id,t.mediaId,u]);return a.createElement("div",{ref:P=>h(m(P)),className:Mt("border-b border-solid border-gray-200 py-16 last:border-b-0",y&&"opacity-50")},a.createElement("div",{className:"flex items-start gap-12"},a.createElement(Li,{className:"mt-20 cursor-move text-gray-400"}),a.createElement(hl,{item:t}),a.createElement("div",{className:"min-w-0 flex-1 space-y-4"},a.createElement("div",{className:"truncate text-14 font-medium text-gray-700"},t.name),a.createElement("div",{className:"text-12 text-gray-500"},C?`${v} · ${C}`:v),a.createElement(vl,{item:t,show:di(t,l)})),a.createElement(Vr,{"aria-label":"Remover mÃdia",onClick:()=>s(e),size:"small",color:"primary",disabled:d,className:"mt-8"},a.createElement(Wr,null))),t.mediaId&&a.createElement("div",{className:"pl-24"},a.createElement(yl,{scheduleRules:t.scheduleRules,onSave:k,disabled:d}),c&&a.createElement("p",{className:"mt-8 text-12 font-medium text-cardapio-web"},"Ocorreu um erro ao salvar o agendamento desta mÃdia."),p&&a.createElement("p",{className:"mt-8 text-12 font-medium text-cardapio-web"},'à necessário definir um agendamento. Preencha inÃcio e fim, ou marque "Dia inteiro".')))}const be="/api/v2/company/profile_medias",Cr=be,Gs={header:`${be}/header`,highlights:`${be}/highlights`},qs={header:`${be}/header/reorder`,highlights:`${be}/highlights/reorder`};function wr(){return Ee.defaults.headers.common.CompanyId||localStorage.getItem("active_company_id")}function Ll(t={}){const e={...t};
16if(!e.CompanyId){const n=wr();n&&(e.CompanyId=String(n))}return e}function Ge(t={}){return{...t,headers:Ll(t.headers)}}function Tt(t,e){return t?.response?.data?.message||e}function El(t){return t?.code==="ERR_CANCELED"||t?.name==="CanceledError"}async function xr([t,e]){return(await Ee.get(t,Ge({headers:{CompanyId:String(e)}}))).data}async function Cl(t,e,{onUploadProgress:n,signal:s}={}){if(!Gs[t])throw new Error(`Grupo de mÃdia inválido: "${t}". Esperado: "header" ou "highlights".`);const r=new FormData;return r.append("file",e),(await Ee.post(Gs[t],r,Ge({signal:s,onUploadProgress:l=>{if(!n||!l.total)return;const u=Math.round(l.loaded*100/l.total);n(u)}}))).data}async function wl(t,e){if(!qs[t])throw new Error(`Grupo de mÃdia inválido: "${t}". Esperado: "header" ou "highlights".`);return(await Ee.put(qs[t],{media_ids:e},Ge())).data}async function Ks(t){return(await Ee.delete(`${be}/${t}`,Ge())).data}async function xl(t,{weekdays:e,start_time:n,end_time:s}){return(await Ee.patch(`${be}/${t}/schedule`,{weekdays:e,start_time:n,end_time:s},Ge())).data}function Ut(t){return t.uploadStatus===le.UPLOADING||t.uploadStatus===le.ERROR}function Ml(t=[]){return[...t].sort((e,n)=>e.position-n.position).map(e=>{const n=e.media_kind==="video"?"video":"image";let s=`mÃdia-${e.id}`;if(e.name)s=e.name;else if(e.url)try{const o=new URL(e.url).pathname.split("/").pop();o&&(s=o)}catch{}return{id:`profile-media-${e.id}`,mediaId:e.id,file:null,name:s,previewUrl:e.thumbnail_url||e.url,uploadStatus:le.UPLOADED,uploadProgress:100,type:n,position:e.position,scheduleRules:e.schedule_rules||[]}})}function Sl({group:t,itemsRef:e,setItems:n,onChange:s}){const r=a.useRef(null),o=a.useCallback((g,d)=>{n(p=>{const f=[...p],[y]=f.splice(g,1);return f.splice(d,0,y),s?.(f),f})},[n,s]),l=a.useCallback(()=>{r.current=e.current},[e]),u=a.useCallback(async()=>{if(!r.current)return;const g=e.current.map(d=>d.mediaId).filter(Boolean);g.length<=1||(await wl(t,g),r.current=null)},[t,e]),c=a.useCallback(()=>{r.current=null},[]);return{handleReorderItems:o,handleReorderComplete:l,savePendingOrder:u,clearPendingOrder:c}}class Bt extends Error{constructor(e="Não foi possÃvel salvar alguns agendamentos."){super(e),this.name="ScheduleSaveError"}}function kl({group:t,profileData:e,swrKeyRef:n,setItems:s,applyMediasFromProfile:r,alert:o,onChange:l}){const u=a.useRef({}),[c,g]=a.useState(()=>new Set),d=a.useCallback((h,m,v)=>{m&&(u.current[m]=v,s(C=>{const k=C.map(P=>P.id===h?{...P,scheduleRules:v.weekdays.map(E=>({weekday:E,start_time:v.start_time,end_time:v.end_time}))}:P);return l?.(k),k}),g(C=>{const k=String(m);if(C.has(k)){const P=new Set(C);return P.delete(k),P}return C}))},[l,s]),p=a.useCallback(async()=>{const h=u.current,m=Object.keys(h);if(m.length===0)return;g(new Set);const v=await Promise.allSettled(m.map(E=>xl(E,h[E])));let C=!1;const k=new Set,P={};if(v.forEach((E,b)=>{const L=m[b];E.status==="fulfilled"?(P[L]=h[L],delete u.current[L]):(C=!0,k.add(L))}),k.size>0&&g(k),Object.keys(P).length>0&&e&&ht(n.current,E=>{if(!E||!E.profile_medias||!E.profile_medias[t])return E;const b=E.profile_medias[t].map(L=>{if(P[L.id]){const w=P[L.id];return{...L,schedule_rules:w.weekdays.map(I=>({weekday:I,start_time:w.start_time,end_time:w.end_time}))}}return L});return{...E,profile_medias:{...E.profile_medias,[t]:b}}},!1),C)throw o.error("Não foi possÃvel salvar alguns agendamentos."),new Bt},[o,e,t,n]),f=a.useCallback(()=>{u.current={},g(new Set),e&&r(e)},[e,r]),y=a.useCallback(h=>{delete u.current[h],g(m=>{if(m.has(String(h))){const v=new Set(m);return v.delete(String(h)),v}return m})},[]);return{scheduleErrors:c,handleScheduleChange:d,savePendingSchedules:p,clearPendingSchedules:f,removePendingSchedule:y,pendingSchedulesRef:u}}function Pl(t){return pi(t,{uploadStatus:le.UPLOADING})}function Ol(t){const e=t.toLowerCase().split(".");return e.length>1?e.pop():""}function _l(t){const e=Ol(t.name);return Lr.includes(e)||Er.includes(e)}function Il(t){const n=ir(t)?Kt:qt;return t.size<=n*1024*1024}function Dl({group:t,maxFiles:e,swrKeyRef:n,itemsRef:s,setItems:r,alert:o,onChange:l,onRemoveMedia:u}
16){const c=a.useRef(new Set),[g,d]=a.useState(()=>new Set),p=a.useRef(new Map),f=a.useRef(!1),y=a.useRef(new Set),h=a.useCallback((L,w)=>{r(I=>{const S=I.map(O=>O.id===L?{...O,...w}:O);return l?.(S),S})},[r,l]),m=a.useCallback(async L=>{const w=Pl(L),I=new AbortController;p.current.set(w.id,I),r(S=>{const O=[...S,w];return l?.(O),O});try{const S=await Cl(t,L,{signal:I.signal,onUploadProgress:D=>{h(w.id,{uploadProgress:D})}});if(f.current)return;const O=new Set(s.current.map(D=>D.mediaId).filter(Boolean)),j=(S?.medias||[]).map(D=>D.id).filter(D=>D&&!O.has(D));j.forEach(D=>y.current.add(D)),d(D=>{const U=new Set(D);return j.forEach(A=>U.add(A)),U}),h(w.id,{uploadStatus:le.UPLOADED,mediaId:j[0]}),await ht(n.current),o.success("Upload realizado com sucesso!")}catch(S){if(El(S)||f.current)return;h(w.id,{uploadStatus:le.ERROR}),o.error(Tt(S,"Não foi possÃvel concluir o upload."))}finally{p.current.delete(w.id)}},[o,t,s,n,h,r,l]),v=a.useCallback(async L=>{const w=Array.from(L.target.files||[]),I=e-s.current.length;if(!w.length||I<=0)return;const S=w.slice(0,I);for(const O of S){if(!_l(O)){o.error(`Formato não suportado: ${O.name}`);continue}if(!Il(O)){const D=ir(O)?Kt:qt;o.error(`Arquivo ${O.name} muito grande. O limite é ${D} MB.`);continue}m(O)}L.target&&(L.target.value="")},[o,s,e,m]),C=a.useCallback(async L=>{const w=s.current[L];if(w){if(!w.mediaId){p.current.get(w.id)?.abort(),p.current.delete(w.id),r(S=>{jt([w]);const O=S.filter((j,D)=>D!==L);return l?.(O),O});return}c.current.add(w.mediaId),u?.(w.mediaId),r(I=>{const S=I.filter((O,j)=>j!==L);return l?.(S),S})}},[s,r,l,u]),k=a.useCallback(async L=>{f.current=!0;const w=p.current.size>0,I=s.current.filter(Ut),S=[...y.current],O=w||I.length>0||S.length>0;if(p.current.forEach(j=>j.abort()),p.current.clear(),I.length>0&&r(j=>(jt(I),j.filter(D=>!Ut(D)))),y.current.clear(),await Promise.allSettled(S.map(j=>Ks(j))),O)try{await L()}catch{}f.current=!1},[r,s]),P=a.useCallback(()=>{y.current.clear()},[]),E=a.useCallback(async()=>{const L=Array.from(c.current);L.length>0&&(await Promise.allSettled(L.map(w=>Ks(w))),L.forEach(w=>y.current.delete(w)),c.current.clear())},[]),b=a.useCallback(()=>{c.current.clear()},[]);return{uploadFeedbackMediaIds:g,handleSelectFile:v,handleRemoveItem:C,discardUnsentMedia:k,clearSessionUploads:P,savePendingDeletions:E,clearPendingDeletions:b}}function Rl(t){return Ml(t?.medias||[])}function jl({group:t,maxFiles:e,onChange:n}){const s=Vt(),r=a.useMemo(()=>wr(),[]),o=r?[Cr,String(r)]:null,l=a.useRef(o),{data:u,error:c,isLoading:g}=zt(o,xr,{dedupingInterval:3e4,revalidateOnFocus:!1,revalidateOnReconnect:!0,keepPreviousData:!0}
16),[d,p]=a.useState([]),f=a.useRef(d);f.current=d;const y=d.length>0,h=d.some(x=>x.uploadStatus===le.UPLOADING),m=a.useCallback(x=>{p(G=>(jt(G),Rl(x)))},[]),v=a.useCallback(x=>{const G=x?.profile_medias?.[t]||[];m({medias:G})},[m,t]),C=a.useCallback(async()=>{try{const x=await ht(l.current);x&&v(x)}catch(x){s.error(Tt(x,"Não foi possÃvel carregar as mÃdias."))}},[s,v]),k=a.useCallback(x=>{n?.(t,x)},[n,t]),{uploadFeedbackMediaIds:P,handleSelectFile:E,handleRemoveItem:b,discardUnsentMedia:L,clearSessionUploads:w,savePendingDeletions:I,clearPendingDeletions:S}=Dl({group:t,maxFiles:e,swrKeyRef:l,itemsRef:f,setItems:p,alert:s,onChange:k,onRemoveMedia:x=>F(x)}),{handleReorderItems:O,handleReorderComplete:j,savePendingOrder:D,clearPendingOrder:U}=Sl({group:t,itemsRef:f,setItems:p,onChange:k}),{scheduleErrors:A,handleScheduleChange:T,savePendingSchedules:W,clearPendingSchedules:J,removePendingSchedule:F,pendingSchedulesRef:K}=kl({group:t,profileData:u,swrKeyRef:l,setItems:p,applyMediasFromProfile:v,alert:s,onChange:k});a.useLayoutEffect(()=>{if(!u)return;const x=f.current.some(Ut),G=Object.keys(K.current).length>0;x||G||v(u)},[u,v,K]),a.useEffect(()=>{c&&s.error(Tt(c,"Não foi possÃvel carregar as mÃdias."))},[s,c]);const $=h,Q=a.useMemo(()=>d.some(x=>x.uploadStatus!==le.UPLOADED?!1:!x.scheduleRules||x.scheduleRules.length===0?!0:x.scheduleRules.some(G=>G.start_time&&!G.end_time||!G.start_time&&G.end_time)),[d]),Y=a.useCallback(()=>{S(),J(),U()},[S,J,U]),N=a.useCallback(async()=>{Y(),await L(C)},[Y,L,C]),X=a.useCallback(async()=>{await I(),await W(),await D(),await ht(l.current)},[I,W,D,l]);return{items:d,uploadFeedbackMediaIds:P,scheduleErrors:A,discardSessionUploads:N,clearSessionUploads:w,hasItemsWithoutSchedule:Q,hasItems:y,hasUploadingItems:h,isLoadingMedias:g,isInteractionDisabled:$,handleSelectFile:E,handleRemoveItem:b,handleReorderItems:O,handleReorderComplete:j,handleScheduleChange:T,savePendingChanges:X,clearPendingChanges:Y}}const Nl={image:bi,video:yi,orientation:vi,quantity:mi};function Al({icon:t,label:e,detail:n}){const s=Nl[t];return a.createElement("li",{className:"flex items-start gap-8 text-12 text-gray-500"},s&&a.createElement(s,{className:"text-20 text-gray-400"}),a.createElement("span",null,a.createElement("span",{className:"font-semibold text-gray-600"},e),n&&a.createElement("span",{className:"ml-4"},n)))}function Tl({requirements:t}){return!t||t.length===0?null:a.createElement("ul",{className:"flex flex-col gap-6 rounded-8 bg-gray-50 px-0 py-12"},t.map(e=>a.createElement(Al,{key:e.label,...e})))}const Ul=[{icon:"image",label:"Imagem",detail:`JPG, JPEG, PNG, WEBP · até ${qt} MB.`},{icon:"video",label:"VÃdeo",detail:`MP4, MOV, WebM, M4V, AVI, MKV · até ${Kt} MB.`},{icon:"orientation",label:"Orientação horizontal",detail:"largura maior que altura."},{icon:"quantity",label:"Quantidade",detail:`até ${ft} mÃdias por grupo.`}];function Bl({items:t,group:e,uploadFeedbackMediaIds:n,scheduleErrors:s,onRemove:r,onReorder:o,onReorderComplete:l,onScheduleChange:u}){return a.createElement("div",null,t.map((c,g)=>a.createElement(bl,{key:c.id,item:c,index:g,group:e,onRemove:r,onReorder:o,onReorderComplete:l,uploadFeedbackMediaIds:n,onScheduleChange:u,hasScheduleError:s?.has(String(c.mediaId))})))}const Ys=a.forwardRef(({group:t,description:e,onChange:n,onValidationChange:s},r)=>{const o=a.useMemo(()=>`profile-media-upload-${t}`,[t]),{items:l,uploadFeedbackMediaIds:u,scheduleErrors:c,isLoadingMedias:g,isInteractionDisabled:d,hasItemsWithoutSchedule:p,handleSelectFile:f,handleRemoveItem:y,handleReorderItems:h,handleReorderComplete:m,handleScheduleChange:v,savePendingChanges:C,clearPendingChanges:k,discardSessionUploads:P,clearSessionUploads:E}=jl({group:t,maxFiles:ft,onChange:n});a.useEffect(()=>{s?.(p)},[p,s]);const b=a.useCallback(()=>a.createElement(Bl,{items:l,group:t,uploadFeedbackMediaIds:u,scheduleErrors:c,onRemove:y,onReorder:h,onReorderComplete:m,onScheduleChange:v}),[l,t,u,c,y,h,m,v]);return a.useImperativeHandle(r,()=>({savePendingChanges:C,clearPendingChanges:k,discardSessionUploads:P,clearSessionUploads:E}),[C,k,P,E]),a.createElement("div",{className:"flex flex-col gap-16"},a.createElement("div",{className:"flex flex-col gap-8"},e&&a.createElement("p",{className:"text-14 leading-relaxed text-gray-600"},e),a.createElement(Tl,{requirements:Ul})),g?a.createElement("div",{className:"flex items-center justify-center py-48"},a.createElement(xe,{size:28})):a.createElement(gi,{inputId:o,accept:pl,multiple:!0,maxFiles:ft,disabled:d,items:l,onSelectFile:f,maxReachedLabel:`Limite de ${ft} mÃdias atingido`,renderList:b}))});function zl({open:t,onClose:e,onCancel:n,headerMediaRef:s,highlightsMediaRef:r,onMediaChange:o,canSave:l,onHeaderValidationChange:u,onHighlightsValidationChange:c}){return a.createElement(Wt,{open:t,onClose:e,title:"Configurar Banners e Destaques",maxWidth:"md",keepMounted:!0,Actions:a.createElement("div",{className:"flex w-full justify-end gap-12"},a.createElement(de,{onClick:n||e,color:"default",variant:"outlined"},"Cancelar"),a.createElement(de,{onClick:e,color:"primary",variant:"contained",disableElevation:!0,disabled:!l},"ConcluÃdo"))},a.createElement("div",{className:"flex flex-col gap-32 bg-gray-50"},a.createElement("div",{className:"rounded-12 border border-solid border-gray-200 bg-white p-24"},a.createElement("h3",{className:"mb-12 text-16 font-semibold text-gray-800"},"Destaques do banner"),a.createElement(Ys,{ref:s,group:"header",description:"Adicione até 5 imagens ou vÃdeos horizontais que aparecem no topo do cardápio além do banner padrão. Você pode configurar agendamento para cada mÃdia, definindo em quais dias e horários ela será exibida.",onCh
16ange:o,onValidationChange:u})),a.createElement("div",{className:"rounded-12 border border-solid border-gray-200 bg-white p-24"},a.createElement("h3",{className:"mb-12 text-16 font-semibold text-gray-800"},"Destaques da sua loja"),a.createElement(Ys,{ref:r,group:"highlights",description:"Adicione até 5 imagens ou vÃdeos de destaque que aparecem no cardápio digital. Você pode configurar agendamento para cada mÃdia, definindo em quais dias e horários ela será exibida.",onChange:o,onValidationChange:c}))))}var We={},Js;function Vl(){if(Js)return We;Js=1;var t=Se(),e=ke();Object.defineProperty(We,"__esModule",{value:!0}),We.default=void 0;var n=e(Pe()),s=t(Oe()),r=(0,s.default)(n.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}),"Room");return We.default=r,We}var Wl=Vl();const Fl=Le(Wl);var Fe={},Qs;function $l(){if(Qs)return Fe;Qs=1;var t=Se(),e=ke();Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.default=void 0;var n=e(Pe()),s=t(Oe()),r=(0,s.default)(n.createElement("path",{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}),"ShoppingCart");return Fe.default=r,Fe}var Zl=$l();const Hl=Le(Zl),Gl=5e3;function Xs(t){return t?t.filter(e=>e.uploadStatus==="uploaded"||e.mediaId).map(e=>({id:e.mediaId,url:e.previewUrl||e.url,media_kind:e.type,thumbnail_url:e.thumbnailUrl,schedule_rules:e.scheduleRules})):null}function ql(t){if(!t.schedule_rules||t.schedule_rules.length===0)return!0;const e=qr(),n=e.locale("en").format("dddd").toLowerCase(),s=e.format("HH:mm");return t.schedule_rules.some(r=>r.weekday!==n?!1:!r.start_time||!r.end_time?!0:r.start_time<=r.end_time?s>=r.start_time&&s<=r.end_time:s>=r.start_time||s<=r.end_time)}function er(t,e){const n=[];return t&&n.push({type:"image",url:t}),(e||[]).filter(ql).forEach(s=>{const r=s.url;if(!r)return;const o=s.media_kind==="video"?"video":"image";n.push({type:o,url:r,thumbnailUrl:s.thumbnail_url||null})}),n}function tr({slides:t,height:e}){const[n,s]=a.useState(0),r=a.useRef(null),o=a.useRef(null),l=t.length,u=l>0?Math.min(n,l-1):0,c=t[u]??null,g=a.useCallback(()=>{s(d=>(d+1)%l)},[l]);return a.useEffect(()=>{l>0&&n>=l&&s(l-1)},[l,n]),a.useEffect(()=>{if(!(!c||c.type==="video"))return r.current=setTimeout(g,Gl),()=>clearTimeout(r.current)},[g,c?.url,c?.type,c]),a.useEffect(()=>{o.current&&(o.current.load(),o.current.play().catch(()=>{}))},[u]),c?a.createElement("div",{className:"relative w-full",style:{height:e}},t.map((d,p)=>{const f=p===u;return a.createElement("div",{key:d.url,className:"absolute inset-0 transition-opacity duration-500 ease-in-out",style:{opacity:f?1:0,pointerEvents:f?"auto":"none"}},d.type==="image"?a.createElement("img",{src:d.url,alt:`Banner ${p}`,className:"h-full w-full object-cover object-center"}):a.createElement("video",{ref:f?o:null,src:d.url,poster:d.thumbnailUrl,muted:!0,playsInline:!0,autoPlay:f,onEnded:f?g:void 0,onError:f?g:void 0,className:"h-full w-full object-cover object-center"}))}),l>1&&a.createElement("div",{className:"pointer-events-none absolute left-0 right-0 top-8 z-10 flex justify-center gap-5"},t.map((d,p)=>a.createElement("div",{key:p,className:"rounded-full transition-all",style:{width:p===u?16:6,height:6,backgroundColor:"rgba(255,255,255,0.85)",opacity:p===u?.95:.45}})))):null}function Kl({data:t,mediasData:e,localHeaderMedias:n,localHighlightMedias:s}){const{data:r}=Gt();if(!t)return null;const o=t.color||"#890000",l=r?.city&&r?.state?`${r.city} - ${r.state}`:"Sem endereço",u=Xs(n)??e?.profile_medias?.header??[],c=Xs(s)??e?.profile_medias?.highlights??[],g=er(t.image,u),d=er(null,c);return a.createElement("div",{className:"sticky top-0"},a.createElement("p",{className:"mb-12 text-14 font-semibold text-gray-500"},"Preview do cardápio"),a.createElement(he,{elevation:4,className:"overflow-hidden rounded-16",style:{maxWidth:320,borderRadius:20,background:"#f5f5f5"}},a.createElement("div",{className:"relative",style:{height:110}},g.length>0?a.createElement(tr,{slides:g,height:110}):a.createElement("div",{className:"h-full w-full",style:{background:o}}),a.createElement("div",{className:"absolute left-0 right-0 flex justify-center",style:{bottom:-44}},a.createElement("div",{className:"flex items-center justify-center overflow-hidden rounded-full border-4 border-white bg-white shadow-lg",style:{width:88,height:88}},t.logo?a.createElement("img",{src:t.logo,alt:"Logo",className:"h-full w-full rounded-full object-cover object-center"}):a.createElement("div",{className:"flex h-full w-full items-center justify-center rounded-full text-center text-11 font-semibold leading-tight text-gray-400",style:{background:"#ddd",fontSize:11}},"LOGO")))),a.createElement("div",{className:"bg-white px-20 pb-16 text-center",style:{paddingTop:56}},a.createElement("h2",{className:"mb-8 text-15 font-bold leading-snug text-gray-900"},t.name||"Nome do estabelecimento"),a.createElement("div",{className:"mb-6 flex items-center justify-center gap-6 text-12 text-gray-500"},a.createElement(Fl,{style:{fontSize:13}}),a.createElement("span",null,l),a.createElement("span",null,"â¢"),a.createElement("span",{className:"cursor-pointer font-medium"},"Mais informações")),a.createElement("p",{className:"text-12 font-semibold"},"Aberto agora"),t.instagram&&a.createElement("p",{className:"mt-6 text-12 text-gray-400"},"@",t.instagram.replace(/^@/,"")),d.length>0&&a.createElement("div",{className:"mt-16 overflow-hidden rounded-8"},a.createElement(tr,{slides:d,height:100})),a.createElement("div",{className:"mt-16 rounded-8",style:{height:100,background:"#f0f0f0"}})),a.createElement("div",{className:"flex items-center justify-center gap-12 px-20 py-16",style:{backgroundColor:"#1a1a1a"}},a.createElement("div",{className:"relative"},a.createElement(Hl,{style:{color:"#fff",fontSize:22}}),a.createElement("span",{className:"absolute flex items-center justify-center rounded-full text-10 font-bold text-white",style:{to
16p:-6,right:-6,width:16,height:16,backgroundColor:o,fontSize:9}},"1")),a.createElement("span",{className:"text-15 font-bold text-white"},"Ver sacola"))))}const Yl={company:null,companyInputAddress:null,loadingAddress:!1,loading:!1},Jl=function(t=Yl,e){switch(e.type){case _i:return{...t,company:e.payload};case Oi:return{...t,companyInputAddress:{...e.address}};case Pi:return{...t,companyInputAddress:null};case ki:return{...t,loadingAddress:e.payload};case Si:return{...t,companyInputAddress:{...t.companyInputAddress,latitude:e.latitude,longitude:e.longitude}};case Mi:return{...t,searchText:e.searchText};case xi:return{...t,selectedFilter:e.selectedFilter};case wi:return{...t,loading:e.payload};default:return t}},Ql=si({paper:{border:"1px solid #d3d4d5"},list:{padding:0}})(t=>a.createElement(ri,{elevation:0,getContentAnchorEl:null,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},...t}));function nr(t){const{inputRef:e,...n}=t;return a.createElement(ii,{...n,ref:s=>{e(s?s.inputElement:null)},mask:["(",/[1-9]/,/\d/,")"," ",/\d/,/\d/,/\d/,/\d/,/\d/,/\d/,/\d/,/\d/,/\d/],placeholderChar:"â"})}const sr=[{key:"email",label:"E-mail"},{key:"birth_date",label:"Data de nascimento"},{key:"gender",label:"Gênero"}];function Ce({title:t,children:e}){return a.createElement("div",{className:"mb-32 flex flex-col border-b border-gray-200 pb-32 last:mb-0 last:border-0 last:pb-0 md:flex-row"},a.createElement("div",{className:"mb-16 pr-16 md:mb-0 md:w-1/3"},a.createElement("h3",{className:"text-12 font-bold uppercase tracking-wider text-gray-500"},t)),a.createElement("div",{className:"flex flex-col space-y-16 md:w-2/3"},e))}function Xl(){const t=rr(),e=Vt(),n=mn(({profile:_})=>_.company),s=mn(({profile:_})=>_.loading),[r,o]=a.useState(null),[l,u]=a.useState(!1),[c,g]=a.useState(!1),[d,p]=a.use
16State(!1),[f,y]=a.useState(!1),{hasModule:h}=Yr(),[m,v]=a.useState(null),[C,k]=a.useState(null),[P,E]=a.useState(null),b=a.useRef(null),L=a.useRef(null),{data:w}=zt(n?.id?[Cr,String(n.id)]:null,xr),I=a.useMemo(()=>{if(!w||!w.profile_medias)return!1;const{header:_,highlights:R}=w.profile_medias;return _&&_.length>0||R&&R.length>0},[w]);a.useEffect(()=>{t(Ii())},[t]),a.useEffect(()=>{v(n)},[n,t]);const S=a.useCallback(_=>{o(_.currentTarget)},[]),O=a.useCallback(()=>{o(null)},[]),j=a.useCallback(_=>{p(!0),_?.hex&&v(R=>({...R,color:_.hex}))},[]),D=a.useCallback(_=>{_.persist(),p(!0),v(R=>({...R,[_.target.name]:_.target.name==="order_whatsapp"?"55"+_.target.value:_.target.value}))},[]),U=a.useCallback(()=>y(!0),[]),A=a.useCallback(()=>y(!1),[]),T=a.useCallback(async()=>{await Promise.allSettled([b.current?.discardSessionUploads?.(),L.current?.discardSessionUploads?.()]),y(!1)},[]),[W,J]=a.useState(!1),[F,K]=a.useState(!1),$=!W&&!F,Q=a.useCallback((_,R)=>{p(!0),_==="header"&&k(R),_==="highlights"&&E(R)},[]),Y=a.useCallback(async()=>{const _=new FormData;if(m.name!==n.name&&_.append("name",m.name),m.color!==n.color&&_.append("color",m.color||"#890000"),m.phone_number!==n.phone_number&&_.append("phone_number",m.phone_number),(m.observation_before_complete_order===""||m.observation_before_complete_order!==n.observation_before_complete_order)&&_.append("observation_before_complete_order",m.observation_before_complete_order),(m.description===""||m.description!==n.description)&&_.append("description",m.description),(m.cnpj===""||m.cnpj&&m.cnpj.replace(/\D/g,"")!==n.cnpj)&&_.append("cnpj",m.cnpj.replace(/\D/g,"")),m.order_whatsapp===""||m.order_whatsapp!==n.order_whatsapp){const R=m.order_whatsapp?(m.order_whatsapp.match(/\d+/g)||[]).join(""):"";_.append("order_whatsapp",R)}(m.instagram===""||m.instagram!==n.instagram)&&_.append("instagram",m.instagram),(m.facebook_pixel===""||m.facebook_pixel!==n.facebook_pixel)&&_.append("facebook_pixel",m.facebook_pixel),(m.facebook_domain_verification===""||m.facebook_domain_verification!==n.facebook_domain_verification)&&_.append("facebook_domain_verification",m.facebook_domain_verification),m.minimum_order_value!==n.minimum_order_value&&_.append("minimum_order_value",m.minimum_order_value?Jr.currencyStringToFloat(m.minimum_order_value):""),m.required_fields_on_signup!==n.required_fields_on_signup&&_.append("required_fields_on_signup",m.required_fields_on_signup),m.ddi_allowed!==n.ddi_allowed&&_.append("ddi_allowed",m.ddi_allowed);try{const R=await Promise.allSettled([b.current?.savePendingChanges?.(),L.current?.savePendingChanges?.()]);if(R.some(ie=>ie.status==="rejected"&&ie.reason instanceof Bt)){y(!0);return}const ae=R.find(ie=>ie.status==="rejected"&&!(ie.reason instanceof Bt));if(ae)throw ae.reason}catch(R){console.error("Erro inesperado ao salvar perfil:",R),e.error("Ocorreu um erro inesperado ao salvar o perfil. Tente novamente.");return}t(Di(_)),p(!1),t(Ln()),b.current?.clearSessionUploads?.(),L.current?.clearSessionUploads?.()},[m,n,t,e]),N=a.useCallback(async()=>
16{p(!1),v(n),await Promise.allSettled([b.current?.discardSessionUploads?.(),L.current?.discardSessionUploads?.()]),k(null),E(null),t(Ln())},[n,t]),X=a.useCallback(_=>{_.image&&v(R=>({...R,image:_.image}))},[]),x=a.useCallback(_=>{_.logo&&v(R=>({...R,logo:_.logo}))},[]),G=a.useCallback(()=>{u(!0),t(Ri()).then(()=>{v(_=>({..._,image:null}))}).finally(()=>u(!1))},[t]),ne=a.useCallback(()=>{g(!0),t(ji()).then(()=>{v(_=>({..._,logo:null}))}).finally(()=>g(!1))},[t]),B=a.useCallback(_=>{t(Qr({anchorOrigin:{vertical:"top",horizontal:"center"},autoHideDuration:4e3,message:_,variant:"error"}))},[t]);return m?a.createElement(a.Fragment,null,a.createElement("div",{className:"flex-grow overflow-auto px-0 pt-12 md:px-12"},a.createElement(St,{container:!0,spacing:3,className:"m-0 w-full"},a.createElement(St,{item:!0,xs:12,md:8},a.createElement(Ce,{title:"MÃdias da sua loja"},a.createElement("div",{className:"relative mb-32 mt-8 w-full"},a.createElement("div",{className:"relative mb-16"},a.createElement(he,{variant:"outlined",className:"relative h-[200px] w-full overflow-hidden rounded-12 border-dashed bg-gray-50"},a.createElement(vn,{imageURL:m.image,endpoint:"/api/v1/company/profile/banner_image",onUploaded:X,onError:B,dropzoneClasses:"rounded-12",cropOptions:{aspect:2.75,maxWidth:1280}}),m.image&&a.createElement(de,{variant:"contained",color:"default",onClick:G,size:"small",disabled:l,className:"absolute bottom-8 right-8 h-28 w-28 min-w-0 rounded-full bg-gray-200 p-0 text-gray-600 hover:bg-gray-300"},l?a.createElement(xe,{size:16}):a.createElement(yn,{fontSize:"small"}))),a.createElement("div",{className:"absolute -bottom-32 left-32"},a.createElement(he,{variant:"outlined",className:"absolute bottom-0 h-128 w-128 overflow-hidden rounded-full sm:h-136 sm:w-136",style:{left:"calc(max(2rem, 5%))"}},a.createElement(vn,{imageURL:m.logo,endpoint:"/api/v1/company/profile/logo_image",onUploaded:x,onError:B,dropzoneClasses:"rounded-full",hideDropzoneText:!0,cropOptions:{maxWidth:400,maxHeight:400}}),m.logo&&a.createElement(de,{variant:"contained",color:"default",onClick:ne,size:"small",disabled:c,className:"absolute bottom-0 left-1/2 h-28 w-28 min-w-0 -translate-x-1/2 rounded-full bg-gray-200 p-0 text-gray-600 hover:bg-gray-300",style:{transform:"translateX(-50%)"}},c?a.createElement(xe,{size:16}):a.createElement(yn,{fontSize:"small"}))))),a.createElement("div",{className:"flex w-full items-center justify-end"},a.createElement("div",{className:"flex items-center gap-12"},a.createElement("span",{className:"text-12 font-medium text-gray-700"},"Cor do menu:"),a.createElement("div",null,a.createElement("div",{className:"cursor-pointer rounded-4",onClick:S},a.createElement("div",{className:"h-32 w-64 cursor-pointer rounded-4 shadow-sm",style:{backgroundColor:m.color||"#890000",border:"1px solid rgba(0, 0, 0, 0.23)"}})),a.createElement(Ql,{id:"customized-menu",anchorEl:r,open:!!r,onClose:O},a.createElement(ai,{color:m.color||"#890000",onChange:j,disableAlpha:!0}))))))),a.createElement(Ce,{title:"Dados do estabelecimento"},a.createElement("div",{className:"flex flex-col space-y-16 md:flex-row md:space-x-16 md:space-y-0"},a.createElement(re,{id:"name",name:"name",label:"Nome do estabelecimento",value:m.name,onChange:D,className:"bg-white",variant:"outlined",fullWidth:!0,required:!0}),a.createElement(re,{id:"cnpj",name:"cnpj",label:"CNPJ",value:m.cnpj,InputProps:{inputComponent:oi},onChange:D,variant:"outlined",className:"bg-white",fullWidth:!0})),a.createElement(re,{id:"description",name:"description",label:"Descrição",value:m.description||"",onChange:D,className:"bg-white",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4}),a.createElement(re,{id:"uuid",name:"uuid",label:"ID do estabelecimento",value:m.uuid,className:"bg-white",onClick:()=>{navigator.clipboard.writeText(m.uuid),e.info("ID copiado para a área de transferência")},variant:"outlined",fullWidth:!0,disabled:!0,InputProps:{startAdornment:a.createElement(kt,{position:"start",className:"cursor-pointer"},a.createElement(Ni,{className:"h-20 w-20"}))}})),a.createElement(Ce,{title:"Contato do estabelecimento"},a.createElement("div",{className:"flex flex-col space-y-16 md:flex-row md:space-x-16 md:space-y-0"}
16,a.createElement(bn,{label:"DDI aceitos",name:"ddi_allowed",value:m.ddi_allowed||[],onChange:D,optionValueKey:"ddi",optionLabelKey:"country",className:"flex-1 bg-white",size:"medium",options:Object.values(Pt).map(_=>({..._,ddi:_.ddi?.toString(),checked:m.ddi_allowed?.includes(String(_.ddi))})),renderValue:_=>_.map(R=>`${Pt[R]?.country} (+${Pt[R]?.ddi})`).join(", ")}),a.createElement(re,{id:"phone_number",name:"phone_number",label:"Telefone de contato",value:m.phone_number,onChange:D,className:"flex-1 bg-white",variant:"outlined",InputProps:{inputComponent:nr},fullWidth:!0,required:!0})),a.createElement("div",{className:"flex flex-col space-y-16 md:flex-row md:space-x-16 md:space-y-0"},a.createElement(re,{id:"instagram",name:"instagram",label:"Meu @ no Instagram",value:m.instagram||"",onChange:D,className:"flex-1 bg-white",variant:"outlined",InputProps:{startAdornment:a.createElement(kt,{position:"start"},"@")},fullWidth:!0}),a.createElement(re,{id:"order_whatsapp",name:"order_whatsapp",label:"Whatsapp",value:m.order_whatsapp?m.order_whatsapp.slice(2):"",onChange:D,className:"flex-1 bg-white",variant:"outlined",InputProps:{startAdornment:a.createElement(kt,{position:"start"},"+55"),inputComponent:nr},fullWidth:!0}))),a.createElement(Ce,{title:"Banners e Destaques"},a.createElement("p",{className:"mb-16 text-14 text-gray-600"},"Configure imagens e vÃdeos para aparecerem no topo do cardápio e como destaques da sua loja."),a.createElement(de,{variant:"outlined",color:"primary",onClick:U},I?"Visualizar banners":"Cadastrar banners")),a.createElement(Ce,{title:"Dados para entrega"},a.createElement(ul,null)),a.createElement(Ce,{title:"Parâmetros de cardápio"},h(ei.DELIVERY_MODULE)&&a.createElement(ti,{id:"minimum_order_value",name:"minimum_order_value",label:"Pedido mÃnimo para delivery",value:m.minimum_order_value,onChange:D,helperText:"Menor valor de um pedido de delivery, sem contar a taxa de entrega",className:"bg-white",variant:"outlined",size:"medium"}),a.createElement(re,{id:"observation_before_complete_order",name:"observation_before_complete_order",label:"Observação antes de finalizar o pedido",helperText:"Observação que aparecerá para o cliente antes dele finalizar o pedido no cardápio",value:m.observation_before_complete_order||"",onChange:D,className:"bg-white",variant:"outlined",fullWidth:!0}),a.createElement(bn,{label:"Campos obrigatórios no cadastro do cliente",name:"required_fields_on_signup",value:m.required_fields_on_signup||[],onChange:D,optionValueKey:"key",optionLabelKey:"label",className:"bg-white",size:"medium",options:sr.map(_=>({..._,checked:m.required_fields_on_signup?.includes(_.key)})),renderValue:_=>_.map(R=>sr.find(({key:q})=>q===R)?.label).join(", ")}))),a.createElement(St,{item:!0,xs:12,md:4},a.createElement(Kl,{data:m,mediasData:w,localHeaderMedias:C,localHighlightMedias:P})))),(s||d)&&a.createElement(a.Fragment,null,a.createElement(ni,null),a.createElement("div",{className:"flex flex-shrink-0 justify-end bg-white px-16 py-12 sm:px-28 sm:py-20"},a.createElement(de,{color:"primary",variant:"outlined",className:"mr-12 w-full max-w-160 py-8",onClick:N},"Cancelar"),a.createElement(de,{color:"primary",variant:"contained",className:"ml-12 w-full max-w-160 py-8",onClick:Y},s?a.createElement(xe,{style:{color:"#fff"},size:20}):"Salvar"))),a.createElement(zl,{open:f,onClose:A,onCancel:T,headerMediaRef:b,highlightsMediaRef:L,onMediaChange:Q,canSave:$,onHeaderValidationChange:J,onHighlightsValidationChange:K})):a.createElement(Xr,null)}const fu=Kr("profile",Jl)(Xl);export{fu as default}; 17 18//# debugId=6c7e24ff-9b0a-5c7c-83f3-27c580ce5471
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.