
    ihR              	      4   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZ d dlmZmZ d dlmZmZmZmZ d dlmZm Z m!Z!m"Z" erd d	l#m$Z$  G d
 deeeee      Z% G d de%      Z& G d de%      Z' G d de      Z( G d d      Z)y)    )annotations)gettext)TYPE_CHECKING)_CustomIslamicHolidays)JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
_timedelta)BANKPUBLIC)ChristianHolidaysInternationalHolidaysIslamicHolidaysStaticHolidays)ObservedHolidayBaseSAT_TO_NEXT_TUESAT_SUN_TO_NEXT_MONSAT_SUN_TO_NEXT_MON_TUE)datec                       e Zd ZdZdZeefZdZ e	d      Z
 e	d      Z e	d      ZdZdZd	d
d fdZddZd Zd Z xZS )Tanzaniaa  Tanzania holidays.

    References:
        * [Act No. 57 of 1964](https://web.archive.org/web/20250426030228/http://www.parliament.go.tz/polis/uploads/bills/acts/1565172859-The%20Public%20Holidays%20Ordinance%20(amendment)%20Act,%201964.pdf)
        * [Act No. 28 of 1966](https://web.archive.org/web/20241130122429/http://www.parliament.go.tz/polis/uploads/bills/acts/1565692654-The%20Public%20Holidays%20Ordinance%20(Amendment)%20Act,%201966.pdf)
        * [Regular Notice No. 115 of 1973](https://web.archive.org/web/20250726035131/https://archive.gazettes.africa/archive/tz/1973/tz-government-gazette-dated-1973-02-02-no-5.pdf)
        * [Act No. 1 of 1993](https://web.archive.org/web/20250425095011/https://www.parliament.go.tz/polis/uploads/bills/acts/1566639469-The%20Written%20Laws%20(Miscellaneous%20Amendments)%20Act,%201993.pdf)
        * [Act No. 10 of 1994](https://web.archive.org/web/20240515125908/https://www.parliament.go.tz/polis/uploads/bills/acts/1566638051-The%20Written%20Laws%20(Miscellaneous%20Amendments)%20(No.%202)%20Act,%201994.pdf)
        * [Supplements No. 39 of 2002](https://web.archive.org/web/20250726035133/https://media.tanzlii.org/media/legislation/375064/source_file/276a8691d29bd8a3/tz-act-gn-2002-451-publication-document.pdf)
        * [Act No. 25 of 2002](https://web.archive.org/web/20250427172313/http://parliament.go.tz/polis/uploads/bills/acts/1454076376-ActNo-25-2002.pdf)
        * [Government Notice No. 486 of 2022](https://web.archive.org/web/20250815171402/https://media.tanzlii.org/media/legislation/325046/source_file/aaaaa31bca89a995/tz-act-gn-2022-486-publication-document.pdf)
        * [The Public Holidays Act (as of 2025)](https://web.archive.org/web/20250726035253/https://www.nps.go.tz/uploads/documents/sw-1751397436-THE%20PUBLIC%20HOLIDAYS%20ACT.pdf)
        * <https://en.wikipedia.org/wiki/Public_holidays_in_Tanzania>
        * <https://web.archive.org/web/20250427125715/https://mytanzaniatimes.blogspot.com/2014/08/holiday-nane-nane-farmers-day-in.html>

    Checked With:
        * [2025](https://web.archive.org/web/20250214094413/https://www.bot.go.tz/webdocs/Other/PUBLIC%20HOLIDAYS%202025.pdf)
        * [2024](https://web.archive.org/web/20250403094322/https://www.bot.go.tz/webdocs/Other/2023%20public%20holidays.pdf)
        * [2023](https://web.archive.org/web/20230811104654/https://www.bot.go.tz/webdocs/Other/2023%20public%20holidays.pdf)
        * [2022](https://web.archive.org/web/20230123001009/https://www.bot.go.tz/webdocs/Other/PUBLIC%20HOLIDAYS%202022.pdf)
        * [2021](https://web.archive.org/web/20210812134750/https://www.bot.go.tz/webdocs/Other/PUBLIC%20HOLIDAYS%202021.pdf)
        * [2020 (2)](https://web.archive.org/web/20201219014125/https://www.bot.go.tz/webdocs/Other/PUBLIC%20HOLIDAYS%202020.pdf)
        * [2020 (1)](https://web.archive.org/web/20250717184907/https://archive.gazettes.africa/archive/tz/2019/tz-government-gazette-dated-2019-11-08-no-46.pdf)
        * [2018](https://web.archive.org/web/20250726041516/https://www.michuzi.co.tz/2017/11/sikukuu-za-kitaifa-zenye-mapumziko-kwa.html)
        * [2014](https://web.archive.org/web/20250726041327/https://archive.gazettes.africa/archive/tz/2013/tz-government-gazette-dated-2013-07-12-no-28.pdf)
        * [2013](https://web.archive.org/web/20250717184650/https://archive.gazettes.africa/archive/tz/2012/tz-government-gazette-dated-2012-11-30-no-48.pdf)
        * [2011](https://web.archive.org/web/20250726041328/https://archive.gazettes.africa/archive/tz/2010/tz-government-gazette-dated-2010-10-08-no-41.pdf)
        * [2010](https://web.archive.org/web/20250726041331/https://archive.gazettes.africa/archive/tz/2009/tz-government-gazette-dated-2009-09-25-no-39.pdf)
        * [2009](https://web.archive.org/web/20250726042634/https://archive.gazettes.africa/archive/tz/2008/tz-government-gazette-dated-2008-09-19-no-38.pdf)
        * [2007](https://web.archive.org/web/20250726035107/https://archive.gazettes.africa/archive/tz/2006/tz-government-gazette-dated-2006-09-29-no-39.pdf)
        * [2006](https://web.archive.org/web/20250726042507/https://archive.gazettes.africa/archive/tz/2005/tz-government-gazette-dated-2005-11-11-no-45.pdf)
        * [2004](https://web.archive.org/web/20250726042505/https://archive.gazettes.africa/archive/tz/2003/tz-government-gazette-dated-2003-10-24-no-43.pdf)
        * [2003](https://web.archive.org/web/20250726042558/https://archive.gazettes.africa/archive/tz/2002/tz-government-gazette-dated-2002-12-06-no-49.pdf)
        * [2002](https://web.archive.org/web/20250726042713/https://archive.gazettes.africa/archive/tz/2001/tz-government-gazette-dated-2001-09-28-no-39.pdf)
        * [2001](https://web.archive.org/web/20250726042632/https://archive.gazettes.africa/archive/tz/2000/tz-government-gazette-dated-2000-09-22-no-38.pdf)
        * [1998](https://web.archive.org/web/20250726042845/https://archive.gazettes.africa/archive/tz/1997/tz-government-gazette-dated-1997-10-17-no-42.pdf)
        * [1994](https://web.archive.org/web/20250726043005/https://archive.gazettes.africa/archive/tz/1993/tz-government-gazette-dated-1993-10-15-no-42.pdf)
        * [1992](https://web.archive.org/web/20250726043006/https://archive.gazettes.africa/archive/tz/1991/tz-government-gazette-dated-1991-08-30-no-35.pdf)
        * [1991](https://web.archive.org/web/20250726043011/https://archive.gazettes.africa/archive/tz/1990/tz-government-gazette-dated-1990-08-24-no-36.pdf)
        * [1987](https://web.archive.org/web/20250726043022/https://archive.gazettes.africa/archive/tz/1986/tz-government-gazette-dated-1986-10-10-no-41.pdf)
        * [1984](https://web.archive.org/web/20250726043037/https://archive.gazettes.africa/archive/tz/1983/tz-government-gazette-dated-1983-11-18-no-46.pdf)
        * [1983](https://web.archive.org/web/20250726042943/https://archive.gazettes.africa/archive/tz/1982/tz-government-gazette-dated-1982-11-12-no-46.pdf)
        * [1982](https://web.archive.org/web/20250726043116/https://archive.gazettes.africa/archive/tz/1981/tz-government-gazette-dated-1981-09-25-no-39.pdf)
        * [1975](https://web.archive.org/web/20250726043340/https://archive.gazettes.africa/archive/tz/1974/tz-government-gazette-dated-1974-10-25-no-43.pdf)
        * [1970](https://web.archive.org/web/20250717155730/https://archive.gazettes.africa/archive/tz/1969/tz-government-gazette-dated-1969-09-26-no-42.pdf)
        * [1969](https://web.archive.org/web/20250726043344/https://archive.gazettes.africa/archive/tz/1968/tz-government-gazette-dated-1968-11-29-no-53.pdf)
        * [1965](https://web.archive.org/web/20250717150107/https://archive.gazettes.africa/archive/tz/1964/tz-government-gazette-dated-1964-12-18-no-75.pdf)
        * <https://web.archive.org/web/20250726043450/https://www.timeanddate.com/holidays/tanzania/>
    TZswz%s (makisio)zBadala ya %szBadala ya %s (makisio))en_USr"     T)islamic_show_estimatedc                   t        j                  |        t        j                  |        t        j                  | t        |       t        j                  | t               t        |   |i | y)z
        Args:
            islamic_show_estimated:
                Whether to add "estimated" label to Islamic holidays name
                if holiday date is estimated.
        )clsshow_estimatedN)r   __init__r   r   TanzaniaIslamicHolidaysr   TanzaniaStaticHolidayssuper)selfr%   argskwargs	__class__s       [/var/www/api/v1/venv_fitandmore/lib/python3.12/site-packages/holidays/countries/tanzania.pyr)   zTanzania.__init__v   s]     	""4(&&t,  ->T	
 	&<=$)&)    c                   | j                   dk  s| j                   dk\  ryt        | j                  d      }t        |      D ]H  }||v rt        }n||k(  rt
        }nt        }| j                  |      D ]  }| j                  |||        J y)a  
        Applies `SAT_SUN_TO_NEXT_MON_TUE` instead of `SAT_SUN_TO_NEXT_MON`
        observed_rule for Christmas Day and the first day of Eid al-Fitr
        holidays, based on section 4 of the Ordinance.

        Added via Act No. 10 of 1994 on July 29th, 1994.
        Removed via G.N. No. 486 of 2022 on July 15th, 2022.

        For 1994 and 2022 edge cases, see `special_public_holidays_observed`.
            N)	_yearr   _easter_sundaysortedr   r   r   get_list_add_observed)r-   dtsdts_specialholy_saturdaydtrulenames          r1   _populate_observedzTanzania._populate_observed   s     ::t!3 #4#6#6;+B[ .}$&*b)""2tT2 * r2   c                8    | j                  t        d             y )NzSikukuu ya Pasaka)_add_easter_sundaytr)r-   s    r1   _populate_bank_holidaysz Tanzania._populate_bank_holidays   s     	#6 78r2   c                N   t               }t               }| j                  dk  s| j                  dk\  r)|j                  | j                  t	        d                   |j                  | j                  t	        d                   d| j                  cxk  rdk  r7n n4| j                  | j                  dk\  rt	        d      n
t	        d	             | j                  d
k\  r)|j                  | j                  t	        d                   | j                  t	        d             | j                  t	        d             |j                  | j                  | j                  dk\  rt	        d      n
t	        d                   |j                  | j                  t	        d                   | j                  dk\  rt	        d      }n&| j                  dk\  rt	        d      }nt	        d      }|j                  | j                  |             | j                  dk\  r)|j                  | j                  t	        d                   | j                  dk\  r)|j                  | j                  t	        d                   |j                  | j                  t	        d                   | j!                  t	        d            }|j                  |       |j                  |       | j                  dk  s| j                  dk\  r)|j                  | j#                  t	        d                   t	        d      }| j%                  |      }|j'                  |       |j'                  |       |j'                  | j)                  |             t	        d      }|j'                  | j+                  |             | j                  dk  r |j'                  | j-                  |             |j'                  | j/                  t	        d                   | j0                  r| j3                  ||       y y ) Ni    
Mwaka MpyazMapinduzi ya Zanzibari  i  i  z Kuzaliwa kwa Chama cha MapinduzizKuzaliwa kwa ASP  z`Siku ya kumbukumbu ya Rais wa Kwanza wa Serikali ya Mapinduzi Zanzibar Sheikh Abeid Amani Karumez
Ijumaa KuuzJumatatu ya Pasaka  zMuungano wa TanzaniazSikukuu ya Muungano"Sikukuu ya Wafanyakazi Ulimwengunir4   SabasabazSikukuu ya Wakulimaz	Saba Sabai    z:Kumbukumbu ya Mwalimu Nyerere na Kilele cha mbio za MwengezUhuru na JamhuriKuzaliwa Kristor$   zSiku ya Kupeana ZawadizEid El-FitriEid El HajjMaulidi)setr7   add_add_new_years_dayrE   _add_holiday_jan_12_add_holiday_feb_5_add_holiday_apr_7_add_good_friday_add_easter_monday_add_holiday_apr_26_add_labor_day_add_holiday_jul_7_add_holiday_aug_8_add_holiday_oct_14_add_holiday_dec_9_add_christmas_day_add_christmas_day_two_add_eid_al_fitr_dayupdate_add_eid_al_fitr_day_two_add_eid_al_adha_day_add_eid_al_adha_day_two_add_mawlid_dayobservedrB   )r-   dts_observedr=   rA   r?   r<   s         r1   _populate_public_holidaysz"Tanzania._populate_public_holidays   s   ue ::t!3T44R5EFG 	11"5L2MNO
 4::%%## ::% 56 *+ ::''4 	b./ 	#7 89$$ ::% )* -.	
 	,,R0T-UVW ::j>DZZ4+,D k?D0067 ::T44R8M5NOP ::((ST 	004F1GHI $$R(9%:; ::t!3T88<T9UVW .!''-C 3D99$?@ - D55d;<:: = =d CD 	D00I?@==##L+> r2   )r%   bool)r<   	set[date]r=   rl   returnNone)__name__
__module____qualname____doc__countryr   r   supported_categoriesdefault_languagerE   estimated_labelobserved_labelobserved_estimated_labelsupported_languages
start_yearr)   rB   rF   rj   __classcell__)r0   s   @r1   r    r    4   sc    0d G &>(O'N!":;)J=A *369z?r2   r    c                      e Zd Zy)r!   Nro   rp   rq    r2   r1   r!   r!   %      r2   r!   c                      e Zd Zy)TZANr}   r~   r2   r1   r   r   )  r   r2   r   c                     e Zd ZdZi dedfdedfdedfded	fd
edfdedfdedfde	dfde	dfde
dfdedfdedfdedfdedfdedfdedfded fedfed!fedfe	d"fe	d fe
dfe
dfedfedfed#fedfedfd$ZdZi ded%fdedfded fded&fdedfded'fdedfded(fded#fded)fdedfdedfded#fded*fded+fded,fd-ed#fedfed#fed,fedfed*fedfedfed%fedfed.fd/
ZdZi dedfdedfdedfded#fdedfded0fdedfded0fded(fded1fde	dfde
d,fdedfded2fdedfded fd-edfed.fedfed%fed'ffedfed!fedfedfed1fedfe	d	fe	d"fd3Zy4)5r*   )i    r$           i  
   i     i     i     i     i     i  	   rH      rK      i     r4      i  i  i  i              )rJ                 r5       r                           rJ      )
r   r     r   r   r   r   r5   r   r            )r   r   r   r   r   r   r   r   r5   r   r   N)ro   rp   rq   !EID_AL_ADHA_DATES_CONFIRMED_YEARSr
   r	   r   r   r   r   r   r   r   r   r   EID_AL_ADHA_DATES!EID_AL_FITR_DATES_CONFIRMED_YEARSr   EID_AL_FITR_DATESMAWLID_DATES_CONFIRMED_YEARSMAWLID_DATESr~   r2   r1   r*   r*   -  sb   (4%"sBi" 	sBi	" 	sBi" 	sBi" 	sBi" 	sBi" 	sAh" 	sBi" 	sAh" 	sAh" 	sBi"  	sBi!"" 	sBi#"$ 	sAh%"& 	sAh'"( 	sBi)"* 	sAh+", AhAhAhBiAhBiBiBiBiBiBiAhC"H )5% sAh  	sBi	  	sAh  	sBi  	sAh  	sBi  	sBi  	sAh  	sBi  	sBi  	sAh   	sBi! " 	sBi# $ 	sBi% & 	sBi' ( 	sBi) * 	sBi+ , BiBiBiAhBiAhBiAhBiBi? D $0 !sBi! 	sBi	! 	sBi! 	sBi! 	sBi! 	sAh! 	sBi! 	sAh! 	sAh! 	sBi! 	sBi!  	sBi!!" 	sAh#!$ 	sAh%!& 	sBi'!( 	sAh)!* 	sBi+!, BiBiQx#r#BiAhBiBiBiAhBiBiA!Lr2   r*   c                      e Zd ZdZ ed      Z ed      Z ed      Zed ed      fe	defe
d ed	      fed
efedefedeffe	defdZed ed      fed ed      fed ed      fed ed      ffdZy)r+   a  Tanzania special holidays.

    References:
        * [G.N. No. 2440 of 1967](https://web.archive.org/web/20250726035513/https://archive.gazettes.africa/archive/tz/1967/tz-government-gazette-dated-1967-11-28-no-50a.pdf)
        * <https://web.archive.org/web/20231209061602/https://www.theeastafrican.co.ke/tea/business/tanzania-declares-public-holiday-on-census-day-3918836>
        * <https://web.archive.org/web/20250413194112/https://www.dw.com/en/samia-suluhu-hassan-who-is-tanzanias-new-president/a-56932264>
    z$Sikukuu ya Uchaguzi Mkuu wa Tanzaniaz*Siku ya Sensa ya Kitaifa ya Watu na MakazizMazishi ya John Pombe Magufulir   z3Uzinduzi wa Jumuiya ya Kiuchumi ya Afrika Masharikir   r   z,Sikukuu ya Kuapishwa kwa John Pombe Magufulir   r      )r   rN   r   i  r   r5   r   rO   r   rI   r   rL   r   rP   )r4   r5   N)ro   rp   rq   rr   rE   tz_election_dayphc_census_dayjohn_magufuli_funeralr   r   r   r   r	   special_public_holidaysr   r   r    special_public_holidays_observedr~   r2   r1   r+   r+     s     ?@O DEN ?@ ArOPQB'ArHIJB("+,"+,
 B' B,-. !R%&!R<=>"b'(
($r2   r+   N)*
__future__r   r   rE   typingr   holidays.calendarsr   holidays.calendars.gregorianr   r   r	   r
   r   r   r   r   r   r   r   r   r   holidays.constantsr   r   holidays.groupsr   r   r   r   holidays.observed_holiday_baser   r   r   r   datetimer   r    r!   r   r*   r+   r~   r2   r1   <module>r      s    # !   5    ,   n?*,A?Tbn?b	 		( 	k4 k\* *r2   