+
    S<Âj'"  ã                   óÐ   € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt R.t ^ RItRt]R	R
.,          t0 Rmt ! R R
]4      t ! R R	4      tR#   ] d    Rt L&i ; i)aU  
This module houses the GeoIP2 object, a wrapper for the MaxMind GeoIP2(R)
Python API (https://geoip2.readthedocs.io/). This is an alternative to the
Python GeoIP2 interface provided by MaxMind.

GeoIP(R) is a registered trademark of MaxMind, Inc.

For IP-based geolocation, this module requires the GeoLite2 Country and City
datasets, in binary format (CSV will not work!). The datasets may be
downloaded from MaxMind at https://dev.maxmind.com/geoip/geoip2/geolite2/.
Grab GeoLite2-Country.mmdb.gz and GeoLite2-City.mmdb.gz, and unzip them in the
directory corresponding to settings.GEOIP_PATH.
N)Úsettings)ÚValidationError)Úvalidate_ipv46_address)Úto_path)Úcached_propertyÚ
HAS_GEOIP2TÚGeoIP2ÚGeoIP2ExceptionFc                   ó   € ] tR t^/tRtR# )r	   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    ÚY/var/www/html/data_capital/venv/lib/python3.14/site-packages/django/contrib/gis/geoip2.pyr	   r	   /   s   † Ûr   c                   óÔ   a € ] tR t^3t o ^ t^t^t^t^t]	! ]]]]]34      t
RtRtRR ltR tR t]R 4       t]R 4       t]R 4       tRR	/R
 ltR tR tR tR tR tR tR tRtV tR# )r   Nc                óR  € W P                   9  d   \        RV,          4      hT;'       g    \        \        RR4      pT;'       g    \        \        RR4      pT;'       g    \        \        RR4      pV'       g   \        R4      h\	        V4      pWV,          W,          3 FF  pVP                  4       '       g   K  Wn        \        P                  P                  WR	7      V n
         M	  \        R
4      hV P                  P                  pV\        9  d   \        RV 24      hR# )aÀ  
Initialize the GeoIP object. No parameters are required to use default
settings. Keyword arguments may be passed in to customize the locations
of the GeoIP datasets.

* path: Base directory to where GeoIP data is located or the full path
    to where the city or country data files (*.mmdb) are located.
    Assumes that both the city and country data sets are located in
    this directory; overrides the GEOIP_PATH setting.

* cache: The cache settings when opening up the GeoIP datasets. May be
    an integer in (0, 1, 2, 4, 8) corresponding to the MODE_AUTO,
    MODE_MMAP_EXT, MODE_MMAP, MODE_FILE, and MODE_MEMORY,
    `GeoIPOptions` C API settings, respectively. Defaults to 0,
    meaning MODE_AUTO.

* country: The name of the GeoIP country data file. Defaults to
    'GeoLite2-Country.mmdb'; overrides the GEOIP_COUNTRY setting.

* city: The name of the GeoIP city data file. Defaults to
    'GeoLite2-City.mmdb'; overrides the GEOIP_CITY setting.
z Invalid GeoIP caching option: %sÚ
GEOIP_PATHNÚ
GEOIP_CITYzGeoLite2-City.mmdbÚGEOIP_COUNTRYzGeoLite2-Country.mmdbzDGeoIP path must be provided via parameter or the GEOIP_PATH setting.)Úmodez@Path must be a valid database or directory containing databases.z#Unable to handle database edition: )Úcache_optionsr	   Úgetattrr   r   Úis_fileÚ_pathÚgeoip2ÚdatabaseÚReaderÚ_readerÚ	_metadataÚdatabase_typeÚSUPPORTED_DATABASE_TYPES)ÚselfÚpathÚcacheÚcountryÚcityr"   s   &&&&& r   Ú__init__ÚGeoIP2.__init__F   s
  € ð. ×*Ñ*Ô*Ü!Ð"DÀuÕ"LÓMÐMà×<Ð<”wœx¨°tÓ<ˆØ×LÐL”wœx¨Ð7KÓLˆØ×XÐXœW¤X¨Ð@WÓXˆçÜ!ØVóð ô �t‹}ˆð  $�;¨­Ó7ˆDØ�|‰|�~Œ~Ø!”
Ü%Ÿ™×5Ñ5°dÐ5ÓG�”Ùñ	 8ô "ØRóð ð Ÿ™×4Ñ4ˆØÔ 8Ô8Ü!Ð$GÈÀÐ"WÓXÐXñ 9r   c                ób   € V P                   '       d   V P                   P                  4        R # R # ©N)r    Úclose©r$   s   &r   Ú__del__ÚGeoIP2.__del__z   s    € à�<�<ˆ<Ø�L‰L×ÑÖ ñ r   c                ó¦   € V P                   pR VP                   RVP                   2pRV P                  P                   RV RV P
                   R2# )ÚvÚ.Ú<z [z	] _path='z'>)r!   Úbinary_format_major_versionÚbinary_format_minor_versionÚ	__class__r   r   )r$   ÚmÚversions   &  r   Ú__repr__ÚGeoIP2.__repr__   sU   € Ø�N‰NˆØ�a×3Ñ3Ð4°A°a×6SÑ6SÐ5TÐUˆØ�4—>‘>×*Ñ*Ð+¨2¨g¨Y°iÀÇ
Á
¸|È2ÐNÐNr   c                ó6   € V P                   P                  4       # r,   )r    Úmetadatar.   s   &r   r!   ÚGeoIP2._metadata„   s   € à�|‰|×$Ñ$Ó&Ð&r   c                ó4   € R V P                   P                  9   # )ÚCity©r!   r"   r.   s   &r   Úis_cityÚGeoIP2.is_cityˆ   s   € à˜Ÿ™×5Ñ5Ñ5Ð5r   c                ó4   € R V P                   P                  9   # )ÚCountryrA   r.   s   &r   Ú
is_countryÚGeoIP2.is_countryŒ   s   € à˜DŸN™N×8Ñ8Ñ8Ð8r   Úrequire_cityFc               ó8  € \        V\        \        P                  \        P                  34      '       g&   \        R \        V4      P                  ,          4      hV'       d+   V P                  '       g   \        RV P                   24      h\        V\        4      '       d    \        V4       V P                  '       d   V P                  P                   MV P                  P"                  pV! V4      #   \         d    \        P                  ! T4      p Lii ; i)zSGeoIP query must be a string or instance of IPv4Address or IPv6Address, not type %szInvalid GeoIP city data file: )Ú
isinstanceÚstrÚ	ipaddressÚIPv4AddressÚIPv6AddressÚ	TypeErrorÚtyper   rB   r	   r   r   r   ÚsocketÚgethostbynamer    r(   r'   )r$   ÚqueryrH   Úfunctions   &&$ r   Ú_queryÚGeoIP2._query�   sÕ   € Ü˜%¤#¤y×'<Ñ'<¼i×>SÑ>SÐ!T×UÒUÜð+Ü-1°%«[×-AÑ-AõBóð ÷
  §§ Ü!Ð$BÀ4Ç:Á:À,Ð"OÓPÐPä�eœS×!Ò!ð4Ü& uÔ-ð
 )-¯¯¨�4—<‘<×$Ò$¸$¿,¹,×:NÑ:NˆÙ˜‹Ðøô #ô 4ä×,Ò,¨UÓ3’ð4ús   Â$C5 Ã5!DÄDc                ó\  € V P                  VRR7      pVP                  '       d   VP                  ^ ,          MRp/ RVP                  P                  bRVP                  P
                  bRVP                  P                  bRVP                  P
                  bRVP                  P                  bR	VP                  P
                  bR
VP                  P                  bRVP                  P                  bRVP                  P                  bRVP                  P                  bRVP                  P                  bRV'       d   VP                  MRbRV'       d   VP
                  MRbRVP                  P                  bRVP                  P                  bRV'       d   VP                  b# Rb# )z¥
Return a dictionary of city information for the given IP address or
Fully Qualified Domain Name (FQDN). Some information in the dictionary
may be undefined (None).
T©rH   NÚaccuracy_radiusr(   Úcontinent_codeÚcontinent_nameÚcountry_codeÚcountry_nameÚis_in_european_unionÚlatitudeÚ	longitudeÚ
metro_codeÚpostal_codeÚregion_codeÚregion_nameÚ	time_zoneÚdma_codeÚregion)rU   ÚsubdivisionsÚlocationrY   r(   ÚnameÚ	continentÚcoder'   Úiso_coder^   r_   r`   ra   Úpostalre   )r$   rS   Úresponserg   s   &&  r   r(   ÚGeoIP2.city¤   s¶  € ð —;‘;˜u°4�;Ó8ˆØ-5×-B×-BÐ-B�×&Ñ& qÖ)Èˆð
Ø˜x×0Ñ0×@Ñ@ð
à�H—M‘M×&Ñ&ð
ð ˜h×0Ñ0×5Ñ5ð
ð ˜h×0Ñ0×5Ñ5ð	
ð
 ˜H×,Ñ,×5Ñ5ð
ð ˜H×,Ñ,×1Ñ1ð
ð # H×$4Ñ$4×$IÑ$Ið
ð ˜×)Ñ)×2Ñ2ð
ð ˜×*Ñ*×4Ñ4ð
ð ˜(×+Ñ+×6Ñ6ð
ð ˜8Ÿ?™?×/Ñ/ð
ð ¯f˜6Ÿ?š?¸$ð
ð ¯&˜6Ÿ;š;°dð
ð ˜×*Ñ*×4Ñ4ð
ð  ˜×)Ñ)×4Ñ4ð!
ð" ¯�f—o‘oð#
ð 	
ð" 6:ð#
ð 	
r   c                ó2   € V P                  V4      R,          # )z9Return the country code for the given IP Address or FQDN.r\   ©r'   ©r$   rS   s   &&r   r\   ÚGeoIP2.country_codeÀ   ó   € à�|‰|˜EÓ" >Õ2Ð2r   c                ó2   € V P                  V4      R,          # )z9Return the country name for the given IP Address or FQDN.r]   rr   rs   s   &&r   r]   ÚGeoIP2.country_nameÄ   ru   r   c           
     ó  € V P                  VRR7      pRVP                  P                  RVP                  P                  RVP                  P
                  RVP                  P                  RVP                  P                  /# )zÄ
Return a dictionary with the country code and name when given an
IP address or a Fully Qualified Domain Name (FQDN). For example, both
'24.124.1.80' and 'djangoproject.com' are valid parameters.
FrX   rZ   r[   r\   r]   r^   )rU   rk   rl   rj   r'   rm   r^   )r$   rS   ro   s   && r   r'   ÚGeoIP2.countryÈ   su   € ð —;‘;˜u°5�;Ó9ˆà˜h×0Ñ0×5Ñ5Ø˜h×0Ñ0×5Ñ5Ø˜H×,Ñ,×5Ñ5Ø˜H×,Ñ,×1Ñ1Ø" H×$4Ñ$4×$IÑ$Ið
ð 	
r   c                óH   € V P                  V4      pVR,          VR,          3# )z@Return a tuple of the (longitude, latitude) for the given query.r`   r_   ©r(   ©r$   rS   Údatas   && r   Úlon_latÚGeoIP2.lon_lat×   s%   € à�y‰y˜ÓˆØ�KÕ  $ zÕ"2Ð2Ð2r   c                óH   € V P                  V4      pVR,          VR,          3# )z@Return a tuple of the (latitude, longitude) for the given query.r_   r`   r{   r|   s   && r   Úlat_lonÚGeoIP2.lat_lonÜ   s%   € à�y‰y˜ÓˆØ�JÕ  kÕ!2Ð2Ð2r   c                ó@   € ^ RI Hp V! V P                  V4      RR7      # )z/Return a GEOS Point object for the given query.)ÚPointiæ  )Úsrid)Údjango.contrib.gis.geosr„   r~   )r$   rS   r„   s   && r   ÚgeosÚGeoIP2.geosá   s   € õ 	2á�T—\‘\ %Ó(¨tÔ4Ð4r   )r   r    )Né    NN)r   r   r   r   Ú	MODE_AUTOÚMODE_MMAP_EXTÚ	MODE_MMAPÚ	MODE_FILEÚMODE_MEMORYÚ	frozensetr   r   r    r)   r/   r:   r   r!   rB   rF   rU   r(   r\   r]   r'   r~   r�   r‡   r   Ú__classdictcell__)Ú__classdict__s   @r   r   r   3   sÆ   ø‡ € ð €Ià€Mà€Ià€Ià€KÙØ	�M 9¨i¸ÐEó€Mð €EØ€Gô2Yòh!ò
Oð
 ñ'ó ð'ð ñ6ó ð6ð ñ9ó ð9ð¨Eô ò(
ò83ò3ò
ò3ò
3÷
5ð 5r   >   úGeoIP2-CityúGeoLite2-CityúDBIP-City-LiteúGeoIP2-CountryúGeoLite2-CountryúDBIP-Country-Lite)Ú__doc__rL   rQ   Údjango.confr   Údjango.core.exceptionsr   Údjango.core.validatorsr   Údjango.utils._osr   Údjango.utils.functionalr   Ú__all__Úgeoip2.databaser   r   ÚImportErrorr#   Ú	Exceptionr	   r   r   r   r   Ú<module>r¢      s}   ðñó Û å  Ý 2Ý 9Ý $Ý 3àˆ.€ð-Ûð €JØ�Ð+Ð,Õ,€Gò
Ð ô	�iô 	÷s5ó s5øð/ ô Ø‚Jðús   ­A Á	A%Á$A%