{"ast":null,"code":"import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Tooltip as LeafletTooltip } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Tooltip = createOverlayComponent(function createTooltip(props, context) {\n const tooltip = new LeafletTooltip(props, context.overlayContainer);\n return createElementObject(tooltip, context);\n}, function useTooltipLifecycle(element, context, _ref, setOpen) {\n let {\n position\n } = _ref;\n useEffect(function addTooltip() {\n const container = context.overlayContainer;\n\n if (container == null) {\n return;\n }\n\n const {\n instance\n } = element;\n\n const onTooltipOpen = event => {\n if (event.tooltip === instance) {\n if (position != null) {\n instance.setLatLng(position);\n }\n\n instance.update();\n setOpen(true);\n }\n };\n\n const onTooltipClose = event => {\n if (event.tooltip === instance) {\n setOpen(false);\n }\n };\n\n container.on({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n container.bindTooltip(instance);\n return function removeTooltip() {\n container.off({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n }); // @ts-ignore protected property\n\n if (container._map != null) {\n container.unbindTooltip();\n }\n };\n }, [element, context, setOpen, position]);\n});","map":{"version":3,"names":["createElementObject","createOverlayComponent","Tooltip","LeafletTooltip","useEffect","createTooltip","props","context","tooltip","overlayContainer","useTooltipLifecycle","element","setOpen","position","addTooltip","container","instance","onTooltipOpen","event","setLatLng","update","onTooltipClose","on","tooltipopen","tooltipclose","bindTooltip","removeTooltip","off","_map","unbindTooltip"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/Tooltip.js"],"sourcesContent":["import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Tooltip as LeafletTooltip } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Tooltip = createOverlayComponent(function createTooltip(props, context) {\n const tooltip = new LeafletTooltip(props, context.overlayContainer);\n return createElementObject(tooltip, context);\n}, function useTooltipLifecycle(element, context, { position }, setOpen) {\n useEffect(function addTooltip() {\n const container = context.overlayContainer;\n if (container == null) {\n return;\n }\n const { instance } = element;\n const onTooltipOpen = (event)=>{\n if (event.tooltip === instance) {\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.update();\n setOpen(true);\n }\n };\n const onTooltipClose = (event)=>{\n if (event.tooltip === instance) {\n setOpen(false);\n }\n };\n container.on({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n container.bindTooltip(instance);\n return function removeTooltip() {\n container.off({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n // @ts-ignore protected property\n if (container._map != null) {\n container.unbindTooltip();\n }\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n"],"mappings":"AAAA,SAASA,mBAAT,EAA8BC,sBAA9B,QAA4D,qBAA5D;AACA,SAASC,OAAO,IAAIC,cAApB,QAA0C,SAA1C;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,OAAO,MAAMF,OAAO,GAAGD,sBAAsB,CAAC,SAASI,aAAT,CAAuBC,KAAvB,EAA8BC,OAA9B,EAAuC;EACjF,MAAMC,OAAO,GAAG,IAAIL,cAAJ,CAAmBG,KAAnB,EAA0BC,OAAO,CAACE,gBAAlC,CAAhB;EACA,OAAOT,mBAAmB,CAACQ,OAAD,EAAUD,OAAV,CAA1B;AACH,CAH4C,EAG1C,SAASG,mBAAT,CAA6BC,OAA7B,EAAsCJ,OAAtC,QAA8DK,OAA9D,EAAuE;EAAA,IAAxB;IAAEC;EAAF,CAAwB;EACtET,SAAS,CAAC,SAASU,UAAT,GAAsB;IAC5B,MAAMC,SAAS,GAAGR,OAAO,CAACE,gBAA1B;;IACA,IAAIM,SAAS,IAAI,IAAjB,EAAuB;MACnB;IACH;;IACD,MAAM;MAAEC;IAAF,IAAgBL,OAAtB;;IACA,MAAMM,aAAa,GAAIC,KAAD,IAAS;MAC3B,IAAIA,KAAK,CAACV,OAAN,KAAkBQ,QAAtB,EAAgC;QAC5B,IAAIH,QAAQ,IAAI,IAAhB,EAAsB;UAClBG,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