PageSourceSearch

https://eaaci.org/wp-content/themes/eaaci/dist/atcb.js?ver=7.1.2

js eaaci.org collected 2026-10-02 02:45:31 UTC 206,680 bytes, 3,719 lines download raw bytes

1/*!
2 *  @preserve
3 *
4 * ++++++++++++++++++++++++++++++++++++++
5 * Add to Calendar TimeZones iCal Library
6 * ++++++++++++++++++++++++++++++++++++++
7 *
8 * Version: 1.4.2
9 * Creator: Jens Kuerschner (https://jenskuerschner.de)
10 * Project: https://github.com/add2cal/timezones-ical-library
11 * License: Apache-2.0
12 *
13 */
14const tzlibVersion = '1.4.2';
15const tzlibZonesDB = {"Africa":{"Abidjan":["",0],"Accra":["Africa/Abidjan",0],"Addis_Ababa":["Africa/Nairobi",1],"Algiers":["",2],"Asmara":["Africa/Nairobi",1],"Asmera":["Africa/Nairobi",1],"Bamako":["Africa/Abidjan",0],"Bangui":["Africa/Lagos",3],"Banjul":["Africa/Abidjan",0],"Bissau":["",0],"Blantyre":["Africa/Maputo",4],"Brazzaville":["Africa/Lagos",3],"Bujumbura":["Africa/Maputo",4],"Cairo":["",5],"Casablanca":["",6],"Ceuta":["",7],"Conakry":["Africa/Abidjan",0],"Dakar":["Africa/Abidjan",0],"Dar_es_Salaam":["Africa/Nairobi",1],"Djibouti":["Africa/Nairobi",1],"Douala":["Africa/Lagos",3],"El_Aaiun":["",6],"Freetown":["Africa/Abidjan",0],"Gaborone":["Africa/Maputo",4],"Harare":["Africa/Maputo",4],"Johannesburg":["",8],"Juba":["",4],"Kampala":["Africa/Nairobi",1],"Khartoum":["",4],"Kigali":["Africa/Maputo",4],"Kinshasa":["Africa/Lagos",3],"Lagos":["",3],"Libreville":["Africa/Lagos",3],"Lome":["Africa/Abidjan",0],"Luanda":["Africa/Lagos",3],"Lubumbashi":["Africa/Maputo",4],"Lusaka":["Africa/Maputo",4],"Malabo":["Africa/Lagos",3],"Maputo":["",4],"Maseru":["Africa/Johannesburg",8],"Mbabane":["Africa/Johannesburg",8],"Mogadishu":["Africa/Nairobi",1],"Monrovia":["",0],"Nairobi":["",1],"Ndjamena":["",3],"Niamey":["Africa/Lagos",3],"Nouakchott":["Africa/Abidjan",0],"Ouagadougou":["Africa/Abidjan",0],"Porto-Novo":["Africa/Lagos",3],"Sao_Tome":["",0],"Timbuktu":["Africa/Abidjan",0],"Tripoli":["",5],"Tunis":["",2],"Windhoek":["",4]},"America":{"Adak":["",9],"Anchorage":["",10],"Anguilla":["America/Puerto_Rico",11],"Antigua":["America/Puerto_Rico",11],"Araguaina":["",12],"Argentina":{"Buenos_Aires":["",12],"Catamarca":["",12],"ComodRivadavia":["America/Argentina/Catamarca",12],"Cordoba":["",12],"Jujuy":["",12],"La_Rioja":["",12],"Mendoza":["",12],"Rio_Gallegos":["",12],"Salta":["",12],"San_Juan":["",12],"San_Luis":["",12],"Tucuman":["",12],"Ushuaia":["",12]},"Aruba":["America/Puerto_Rico",11],"Asuncion":["",13],"Atikokan":["America/Panama",14],"Atka":["America/Adak",9],"Bahia_Banderas":["",15],"Bahia":["",12],"Barbados":["",11],"Belem":["",12],"Belize":["",16],"Blanc-Sablon":["America/Puerto_Rico",11],"Boa_Vista":["",17],"Bogota":["",18],"Boise":["",19],"Buenos_Aires":["America/Argentina/Buenos_Aires",12],"Cambridge_Bay":["",19],"Campo_Grande":["",17],"Cancun":["",14],"Caracas":["",17],"Catamarca":["America/Argentina/Catamarca",12],"Cayenne":["",12],"Cayman":["America/Panama",14],"Chicago":["",20],"Chihuahua":["",21],"Coral_Harbour":["America/Panama",14],"Cordoba":["America/Argentina/Cordoba",12],"Costa_Rica":["",16],"Creston":["America/Phoenix",22],"Cuiaba":["",17],"Curacao":["America/Puerto_Rico",11],"Danmarkshavn":["",0],"Dawson_Creek":["",22],"Dawson":["",22],"Denver":["",19],"Detroit":["",23],"Dominica":["America/Puerto_Rico",11],"Edmonton":["",19],"Eirunepe":["",18],"El_Salvador":["",16],"Ensenada":["America/Tijuana",24],"Fort_Nelson":["",22],"Fort_Wayne":["America/Indiana/Indianapolis",23],"Fortaleza":["",12],"Glace_Bay":["",25],"Godthab":["America/Nuuk",26],"Goose_Bay":["",27],"Grand_Turk":["",28],"Grenada":["America/Puerto_Rico",11],"Guadeloupe":["America/Puerto_Rico",11],"Guatemala":["",16],"Guayaquil":["",18],"Guyana":["",17],"Halifax":["",25],"Havana":["",29],"Hermosillo":["",22],"Indiana":{"Indianapolis":["",23],"Knox":["",20],"Marengo":["",23],"Petersburg":["",23],"Tell_City":["",20],"Vevay":["",23],"Vincennes":["",23],"Winamac":["",28]},"Indianapolis":["America/Indiana/Indianapolis",23],"Inuvik":["",19],"Iqaluit":["",23],"Jamaica":["",14],"Jujuy":["America/Argentina/Jujuy",12],"Juneau":["",10],"Kentucky":{"Louisville":["",23],"Monticello":["",23]},"Knox_IN":["America/Indiana/Knox",20],"Kralendijk":["America/Puerto_Rico",11],"La_Paz":["",17],"Lima":["",18],"Los_Angeles":["",24],"Louisville":["America/Kentucky/Louisville",23],"Lower_Princes":["America/Puerto_Rico",11],"Maceio":["",12],"Managua":["",16],"Manaus":["",17],"Marigot":["America/Puerto_Rico",11],"Martinique":["",11],"Matamoros":["",20],"Mazatlan":["",21],"Mendoza":["America/Argentina/Mendoza",12],"Menominee":["",20],"Merida":["",30],"Metlakatla":["",10],"Mexico_City":["",30],"Miquelon":["",3
151],"Moncton":["",25],"Monterrey":["",30],"Montevideo":["",12],"Montreal":["America/Toronto",23],"Montserrat":["America/Puerto_Rico",11],"Nassau":["America/Toronto",23],"New_York":["",23],"Nipigon":["",23],"Nome":["",10],"Noronha":["",32],"North_Dakota":{"Beulah":["",20],"Center":["",20],"New_Salem":["",20]},"Nuuk":["",26],"Ojinaga":["",19],"Panama":["",14],"Pangnirtung":["",23],"Paramaribo":["",12],"Phoenix":["",22],"Port_of_Spain":["America/Puerto_Rico",11],"Port-au-Prince":["",23],"Porto_Acre":["America/Rio_Branco",18],"Porto_Velho":["",17],"Puerto_Rico":["",11],"Punta_Arenas":["",12],"Rainy_River":["",20],"Rankin_Inlet":["",20],"Recife":["",12],"Regina":["",16],"Resolute":["",33],"Rio_Branco":["",18],"Rosario":["America/Argentina/Cordoba",12],"Santa_Isabel":["America/Tijuana",24],"Santarem":["",12],"Santiago":["",34],"Santo_Domingo":["",11],"Sao_Paulo":["",12],"Scoresbysund":["",35],"Shiprock":["America/Denver",19],"Sitka":["",10],"St_Barthelemy":["America/Puerto_Rico",11],"St_Johns":["",36],"St_Kitts":["America/Puerto_Rico",11],"St_Lucia":["America/Puerto_Rico",11],"St_Thomas":["America/Puerto_Rico",11],"St_Vincent":["America/Puerto_Rico",11],"Swift_Current":["",16],"Tegucigalpa":["",16],"Thule":["",25],"Thunder_Bay":["",23],"Tijuana":["",24],"Toronto":["",23],"Tortola":["America/Puerto_Rico",11],"Vancouver":["",24],"Virgin":["America/Puerto_Rico",11],"Whitehorse":["",22],"Winnipeg":["",20],"Yakutat":["",10],"Yellowknife":["",19]},"Antarctica":{"Casey":["",37],"Davis":["",38],"DumontDUrville":["Pacific/Port_Moresby",39],"Macquarie":["",40],"Mawson":["",41],"McMurdo":["Pacific/Auckland",42],"Palmer":["",12],"Rothera":["",12],"South_Pole":["Pacific/Auckland",42],"Syowa":["Asia/Riyadh",43],"Troll":["",44],"Vostok":["Asia/Urumqi",45]},"Arctic":{"Longyearbyen":["Europe/Berlin",7]},"Asia":{"Aden":["Asia/Riyadh",43],"Almaty":["",45],"Amman":["",43],"Anadyr":["",46],"Aqtau":["",41],"Aqtobe":["",41],"Ashgabat":["",41],"Ashkhabad":["Asia/Ashgabat",41],"Atyrau":["",41],"Baghdad":["",43],"Bahrain":["Asia/Qatar",43],"Baku":["",47],"Bangkok":["",38],"Barnaul":["",38],"Beirut":["",48],"Bishkek":["",45],"Brunei":["Asia/Kuching",49],"Calcutta":["Asia/Kolkata",50],"Chita":["",51],"Choibalsan":["",49],"Chongqing":["Asia/Shanghai",52],"Chungking":["Asia/Shanghai",52],"Colombo":["",53],"Dacca":["Asia/Dhaka",45],"Damascus":["",43],"Dhaka":["",45],"Dili":["",51],"Dubai":["",47],"Dushanbe":["",41],"Famagusta":["",54],"Gaza":["",55],"Harbin":["Asia/Shanghai",52],"Hebron":["",55],"Ho_Chi_Minh":["",38],"Hong_Kong":["",56],"Hovd":["",38],"Irkutsk":["",49],"Istanbul":["Europe/Istanbul",43],"Jakarta":["",57],"Jayapura":["",58],"Jerusalem":["",59],"Kabul":["",60],"Kamchatka":["",46],"Karachi":["",61],"Kashgar":["Asia/Urumqi",45],"Kathmandu":["",62],"Katmandu":["Asia/Kathmandu",62],"Khandyga":["",51],"Kolkata":["",50],"Krasnoyarsk":["",38],"Kuala_Lumpur":["Asia/Singapore",49],"Kuching":["",49],"Kuwait":["Asia/Riyadh",43],"Macao":["Asia/Macau",52],"Macau":["",52],"Magadan":["",37],"Makassar":["",63],"Manila":["",64],"Muscat":["Asia/Dubai",47],"Nicosia":["",65],"Novokuznetsk":["",38],"Novosibirsk":["",38],"Omsk":["",45],"Oral":["",41],"Phnom_Penh":["Asia/Bangkok",38],"Pontianak":["",57],"Pyongyang":["",66],"Qatar":["",43],"Qostanay":["",45],"Qyzylorda":["",41],"Rangoon":["Asia/Yangon",67],"Riyadh":["",43],"Saigon":["Asia/Ho_Chi_Minh",38],"Sakhalin":["",37],"Samarkand":["",41],"Seoul":["",66],"Shanghai":["",52],"Singapore":["",49],"Srednekolymsk":["",37],"Taipei":["",52],"Tashkent":["",41],"Tbilisi":["",47],"Tehran":["",68],"Tel_Aviv":["Asia/Jerusalem",59],"Thimbu":["Asia/Thimphu",45],"Thimphu":["",45],"Tokyo":["",69],"Tomsk":["",38],"Ujung_Pandang":["Asia/Makassar",63],"Ulaanbaatar":["",49],"Ulan_Bator":["Asia/Ulaanbaatar",49],"Urumqi":["",45],"Ust-Nera":["",39],"Vientiane":["Asia/Bangkok",38],"Vladivostok":["",39],"Yakutsk":["",51],"Yangon":["",67],"Yekaterinburg":["",41],"Yerevan":["",47]},"Atlantic":{"Azores":["",35],"Bermuda":["",25],"Canary":["",70],"Cape_Verde":["",71],"Faeroe":["Atlantic/Faroe",70],"Faroe":["",70],"Jan_Mayen":["Europe/Berlin",7],"Madeira":["",70],"Reykjavik":["Africa/Abidjan",0],"South_Georgia":["",32],"St_Helena":["Africa/Abidjan",0],"Stanley":["",12]},"Australia":{"ACT":["Australia/Sydney",40],"Adelaide":["",72],"Brisbane":["",73],"Broken_Hill":["",72],"Canberra":["Australia/Sydney",40],"Currie":["Australia/Hobart",74],"Darwin":["",75],"Eucla":["",76],"Hobart":["",74],"LHI":["Australia/Lord_Howe",77],"Lindeman":["",73],"Lord_Howe":["",77],"Melbourne":["",40],"North":["Australia/Darwin",75],"NSW":["Australia/Sydney",40],"Perth":["",78],"Queensland":["Australia/Brisbane",73],"South":["Australia/Adelaide",72],"Sydney":["",40],"Tasmania":["Australia/Hobart",74],"Victoria":["Australia/Melbourne",40],"West":["Australia/Perth",78],"Yancowinna":["Australia/Broken_Hill",72]},"Brazil":{"Acre":["America/Rio_Branco",18],"DeNoronha":["America/Noronha",32],"East":["America/Sao_Paulo",12],"West":["America/Manaus",17]}
15,"Canada":{"Atlantic":["America/Halifax",25],"Central":["America/Winnipeg",20],"Eastern":["America/Toronto",23],"Mountain":["America/Edmonton",19],"Newfoundland":["America/St_Johns",36],"Pacific":["America/Vancouver",24],"Saskatchewan":["America/Regina",16],"Yukon":["America/Whitehorse",22]},"CET":["",7],"Chile":{"Continental":["America/Santiago",34],"EasterIsland":["Pacific/Easter",79]},"CST6CDT":["",20],"Cuba":["America/Havana",29],"EET":["",54],"Egypt":["Africa/Cairo",5],"Eire":["Europe/Dublin",80],"EST":["",14],"EST5EDT":["",23],"Etc":{"GMT-0":["Etc/GMT",0],"GMT-1":["",6],"GMT-10":["",39],"GMT-11":["",37],"GMT-12":["",46],"GMT-13":["",81],"GMT-14":["",82],"GMT-2":["",83],"GMT-3":["",43],"GMT-4":["",47],"GMT-5":["",41],"GMT-6":["",45],"GMT-7":["",38],"GMT-8":["",49],"GMT-9":["",51],"GMT":["",0],"GMT+0":["Etc/GMT",0],"GMT+1":["",71],"GMT+10":["",84],"GMT+11":["",85],"GMT+12":["",86],"GMT+2":["",32],"GMT+3":["",12],"GMT+4":["",17],"GMT+5":["",18],"GMT+6":["",87],"GMT+7":["",88],"GMT+8":["",89],"GMT+9":["",90],"GMT0":["Etc/GMT",0],"Greenwich":["Etc/GMT",0],"UCT":["Etc/UTC",91],"Universal":["Etc/UTC",91],"UTC":["",91],"Zulu":["Etc/UTC",91]},"Europe":{"Amsterdam":["Europe/Brussels",7],"Andorra":["",7],"Astrakhan":["",47],"Athens":["",54],"Belfast":["Europe/London",92],"Belgrade":["",7],"Berlin":["",7],"Bratislava":["Europe/Prague",7],"Brussels":["",7],"Bucharest":["",54],"Budapest":["",7],"Busingen":["Europe/Zurich",7],"Chisinau":["",93],"Copenhagen":["Europe/Berlin",7],"Dublin":["",80],"Gibraltar":["",7],"Guernsey":["Europe/London",92],"Helsinki":["",54],"Isle_of_Man":["Europe/London",92],"Istanbul":["",43],"Jersey":["Europe/London",92],"Kaliningrad":["",5],"Kiev":["Europe/Kyiv",65],"Kirov":["",43],"Kyiv":["",65],"Lisbon":["",94],"Ljubljana":["Europe/Belgrade",7],"London":["",92],"Luxembourg":["Europe/Brussels",7],"Madrid":["",7],"Malta":["",7],"Mariehamn":["Europe/Helsinki",54],"Minsk":["",43],"Monaco":["Europe/Paris",7],"Moscow":["",95],"Nicosia":["Asia/Nicosia",65],"Oslo":["Europe/Berlin",7],"Paris":["",7],"Podgorica":["Europe/Belgrade",7],"Prague":["",7],"Riga":["",54],"Rome":["",7],"Samara":["",47],"San_Marino":["Europe/Rome",7],"Sarajevo":["Europe/Belgrade",7],"Saratov":["",47],"Simferopol":["",95],"Skopje":["Europe/Belgrade",7],"Sofia":["",54],"Stockholm":["Europe/Berlin",7],"Tallinn":["",54],"Tirane":["",7],"Tiraspol":["Europe/Chisinau",93],"Ulyanovsk":["",47],"Uzhgorod":["Europe/Kyiv",65],"Vaduz":["Europe/Zurich",7],"Vatican":["Europe/Rome",7],"Vienna":["",7],"Vilnius":["",54],"Volgograd":["",43],"Warsaw":["",7],"Zagreb":["Europe/Belgrade",7],"Zaporozhye":["Europe/Kyiv",65],"Zurich":["",7]},"GB-Eire":["Europe/London",92],"GB":["Europe/London",92],"GMT-0":["Etc/GMT",0],"GMT":["Etc/GMT",0],"GMT+0":["Etc/GMT",0],"GMT0":["Etc/GMT",0],"Greenwich":["Etc/GMT",0],"Hongkong":["Asia/Hong_Kong",56],"HST":["",96],"Iceland":["Africa/Abidjan",0],"Indian":{"Antananarivo":["Africa/Nairobi",1],"Chagos":["",45],"Christmas":["Asia/Bangkok",38],"Cocos":["Asia/Yangon",67],"Comoro":["Africa/Nairobi",1],"Kerguelen":["Indian/Maldives",41],"Mahe":["Asia/Dubai",47],"Maldives":["",41],"Mauritius":["",47],"Mayotte":["Africa/Nairobi",1],"Reunion":["Asia/Dubai",47]},"Iran":["Asia/Tehran",68],"Israel":["Asia/Jerusalem",59],"Jamaica":["America/Jamaica",14],"Japan":["Asia/Tokyo",69],"Kwajalein":["Pacific/Kwajalein",46],"Libya":["Africa/Tripoli",5],"MET":["",97],"Mexico":{"BajaNorte":["America/Tijuana",24],"BajaSur":["America/Mazatlan",21],"General":["America/Mexico_City",30]},"MST":["",22],"MST7MDT":["",19],"Navajo":["America/Denver",19],"NZ-CHAT":["Pacific/Chatham",98],"NZ":["Pacific/Auckland",42],"Pacific":{"Apia":["",81],"Auckland":["",42],"Bougainville":["",37],"Chatham":["",98],"Chuuk":["Pacific/Port_Moresby",39],"Easter":["",79],"Efate":["",37],"Enderbury":["Pacific/Kanton",81],"Fakaofo":["",81],"Fiji":["",99],"Funafuti":["Pacific/Tarawa",46],"Galapagos":["",87],"Gambier":["",90],"Guadalcanal":["",37],"Guam":["",100],"Honolulu":["",96],"Johnston":["Pacific/Honolulu",96],"Kanton":["",81],"Kiritimati":["",82],"Kosrae":["",37],"Kwajalein":["",46],"Majuro":["Pacific/Tarawa",46],"Marquesas":["",101],"Midway":["Pacific/Pago_Pago",102],"Nauru":["",46],"Niue":["",85],"Norfolk":["",103],"Noumea":["",37],"Pago_Pago":["",102],"Palau":["",51],"Pitcairn":["",89],"Pohnpei":["Pacific/Guadalcanal",37],"Ponape":["Pacific/Guadalcanal",37],"Port_Moresby":["",39],"Rarotonga":["",84],"Saipan":["Pacific/Guam",100],"Samoa":["Pacific/Pago_Pago",102],"Tahiti":["",84],"Tarawa":["",46],"Tongatapu":["",81],"Truk":["Pacific/Port_Moresby",39],"Wake":["Pacific/Tarawa",46],"Wallis":["Pacific/Tarawa",46],"Yap":["Pacific/Port_Moresby",39]},"Poland":["Europe/Warsaw",7],"Portugal":["Europe/Lisbon",94],"PRC":["Asia/Shanghai",52],"PST8PDT":["",24],"ROC":["Asia/Taipei",52],"ROK":["Asia/Seoul",66],"Singapore":["Asia/Singapore",49],"Turkey":["Europe/Istanbul",43],"UCT":["Etc/UTC",91],"Universal":["Etc/UTC",91],"US":{"Alaska":["America/Anchorage",10],"Aleutian":["America/Adak",9],"Arizona":["America/Phoenix",22],"Central"
15:["America/Chicago",20],"East-Indiana":["America/Indiana/Indianapolis",23],"Eastern":["America/New_York",23],"Hawaii":["Pacific/Honolulu",96],"Indiana-Starke":["America/Indiana/Knox",20],"Michigan":["America/Detroit",23],"Mountain":["America/Denver",19],"Pacific":["America/Los_Angeles",24],"Samoa":["Pacific/Pago_Pago",102]},"UTC":["Etc/UTC",91],"W-SU":["Europe/Moscow",95],"WET":["",70],"Zulu":["Etc/UTC",91]};
16const tzlibZonesDetailsDB = ["20221015T115821Z<n><bs><n><tz>GMT<n><of>+0000<n><ot>+0000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>EAT<n><of>+0300<n><ot>+0300<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>CET<n><of>+0100<n><ot>+0100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>WAT<n><of>+0100<n><ot>+0100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>CAT<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>EET<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+01<n><of>+0100<n><ot>+0100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>CEST<n><of>+0100<n><ot>+0200<n><s>19700329T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>CET<n><of>+0200<n><ot>+0100<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>SAST<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>HDT<n><of>-1000<n><ot>-0900<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>HST<n><of>-0900<n><ot>-1000<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>AKDT<n><of>-0900<n><ot>-0800<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>AKST<n><of>-0800<n><ot>-0900<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>AST<n><of>-0400<n><ot>-0400<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-03<n><of>-0300<n><ot>-0300<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>-03<n><of>-0400<n><ot>-0300<n><s>19701004T000000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n><bs><n><tz>-04<n><of>-0300<n><ot>-0400<n><s>19700322T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=4SU<n><es><n>","20221015T115821Z<n><bs><n><tz>EST<n><of>-0500<n><ot>-0500<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>CST<n><of>-0600<n><ot>-0600<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-04<n><of>-0400<n><ot>-0400<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-05<n><of>-0500<n><ot>-0500<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>MDT<n><of>-0700<n><ot>-0600<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>MST<n><of>-0600<n><ot>-0700<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>MDT<n><of>-0700<n><ot>-0600<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><ed><n><bs><n><tz>MST<n><of>-0600<n><ot>-0700<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>MST<n><of>-0700<n><ot>-0700<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>EDT<n><of>-0500<n><ot>-0400<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>EST<n><of>-0400<n><ot>-0500<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>PDT<n><of>-0800<n><ot>-0700<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>PST<n><of>-0700<n><ot>-0800<n><s>
1619701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>ADT<n><of>-0400<n><ot>-0300<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>AST<n><of>-0300<n><ot>-0400<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>-02<n><of>-0300<n><ot>-0200<n><s>19700328T220000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SA<n><ed><n><bs><n><tz>-03<n><of>-0200<n><ot>-0300<n><s>19701024T230000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SA<n><es><n>","20221015T115821Z<n><bs><n><tz>AST<n><of>-0300<n><ot>-0400<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>ADT<n><of>-0400<n><ot>-0300<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>EST<n><of>-0400<n><ot>-0500<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>EDT<n><of>-0500<n><ot>-0400<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>CST<n><of>-0400<n><ot>-0500<n><s>19701101T010000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>CDT<n><of>-0500<n><ot>-0400<n><s>19700308T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>","20221015T115821Z<n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><ed><n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>-02<n><of>-0300<n><ot>-0200<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>-03<n><of>-0200<n><ot>-0300<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>-02<n><of>-0200<n><ot>-0200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>-04<n><of>-0300<n><ot>-0400<n><s>19700405T000000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>-03<n><of>-0400<n><ot>-0300<n><s>19700906T000000<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=1SU<n><ed><n>","20221015T115821Z<n><bd><n><tz>+00<n><of>-0100<n><ot>+0000<n><s>19700329T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>-01<n><of>+0000<n><ot>-0100<n><s>19701025T010000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>NST<n><of>-0230<n><ot>-0330<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>NDT<n><of>-0330<n><ot>-0230<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>+11<n><of>+1100<n><ot>+1100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+07<n><of>+0700<n><ot>+0700<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+10<n><of>+1000<n><ot>+1000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>AEST<n><of>+1100<n><ot>+1000<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>AEDT<n><of>+1000<n><ot>+1100<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>+05<n><of>+0500<n><ot>+0500<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>NZDT<n><of>+1200<n><ot>+1300<n><s>19700927T020000<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU<n><ed><n><bs><n><tz>NZST<n><of>+1300<n><ot>+1200<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>+03<n><of>+0300<n><ot>+0300<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>+02<n><of>+0000<n><ot>+0200<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>+00<n><of>+0200<n><ot>+0000<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>+06<n><of>+0600<n><ot>+0600<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+12<n><of>+1200<n><ot>+1200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+04<n><of>+0400<n><ot>+0400<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>
1619700329T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T000000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>+08<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>IST<n><of>+0530<n><ot>+0530<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+09<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>CST<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+0530<n><of>+0530<n><ot>+0530<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T030000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T040000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701024T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SA<n><es><n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700328T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SA<n><ed><n>","20221015T115821Z<n><bs><n><tz>HKT<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>WIB<n><of>+0700<n><ot>+0700<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>WIT<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>IDT<n><of>+0200<n><ot>+0300<n><s>19700327T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1FR<n><ed><n><bs><n><tz>IST<n><of>+0300<n><ot>+0200<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>+0430<n><of>+0430<n><ot>+0430<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>PKT<n><of>+0500<n><ot>+0500<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+0545<n><of>+0545<n><ot>+0545<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>WITA<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>PST<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T040000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T030000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>KST<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+0630<n><of>+0630<n><ot>+0630<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+0330<n><of>+0330<n><ot>+0330<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>JST<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>WEST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>WET<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>-01<n><of>-0100<n><ot>-0100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>ACST<n><of>+1030<n><ot>+0930<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>ACDT<n><of>+0930<n><ot>+1030<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>AEST<n><of>+1000<n><ot>+1000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>AEDT<n><of>+1000<n><ot>+1100<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n><bs><n><tz>AEST<n><of>+1100<n><ot>+1000<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>ACST<n><of>+0930<n><ot>+0930<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+0845<n><of>+0845<n><ot>+0845<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+1030<n><of>+1100<n><ot>+1030<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>+11<n><of>+1030<n><ot>+1100<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>AWST<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-06<n><of>-0500<n><ot>-0600<n><s>19700404T220000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SA<n><es><n><bd><n><tz>-05<n><of>-0600<n><ot>-0500<n><s>19700905T220000<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=1SA<n><ed><n>","20221015T115821Z<n><bs><n><tz>IST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><es><n><bd><n><tz>GMT<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>+13<n><of>+1300<n><ot>+1300<n><s>
1619700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+14<n><of>+1400<n><ot>+1400<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>+02<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-10<n><of>-1000<n><ot>-1000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-11<n><of>-1100<n><ot>-1100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-12<n><of>-1200<n><ot>-1200<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-06<n><of>-0600<n><ot>-0600<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-07<n><of>-0700<n><ot>-0700<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-08<n><of>-0800<n><ot>-0800<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-09<n><of>-0900<n><ot>-0900<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>UTC<n><of>+0000<n><ot>+0000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>BST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>GMT<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bs><n><tz>WET<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n><bd><n><tz>WEST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n>","20221015T115821Z<n><bs><n><tz>MSK<n><of>+0300<n><ot>+0300<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>HST<n><of>-1000<n><ot>-1000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>MEST<n><of>+0100<n><ot>+0200<n><s>19700329T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>MET<n><of>+0200<n><ot>+0100<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>+1345<n><of>+1245<n><ot>+1345<n><s>19700927T024500<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU<n><ed><n><bs><n><tz>+1245<n><of>+1345<n><ot>+1245<n><s>19700405T034500<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>","20221015T115821Z<n><bd><n><tz>+13<n><of>+1200<n><ot>+1300<n><s>19701108T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=2SU<n><ed><n><bs><n><tz>+12<n><of>+1300<n><ot>+1200<n><s>19700118T030000<n><r>FREQ=YEARLY;BYMONTH=1;BYDAY=-2SU<n><es><n>","20221015T115821Z<n><bs><n><tz>ChST<n><of>+1000<n><ot>+1000<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>-0930<n><of>-0930<n><ot>-0930<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bs><n><tz>SST<n><of>-1100<n><ot>-1100<n><s>19700101T000000<n><es><n>","20221015T115821Z<n><bd><n><tz>+12<n><of>+1100<n><ot>+1200<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n><bs><n><tz>+11<n><of>+1200<n><ot>+1100<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>"];
17function tzlib_get_content(tzName) {
18  const nameParts = tzName.split('/');
19  if (
20    (nameParts.length === 3 &&
21      (!tzlibZonesDB[`${nameParts[0]}`] ||
22        !tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`] ||
23        !tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][`${nameParts[2]}`])) ||
24    (nameParts.length === 2 &&
25      (!tzlibZonesDB[`${nameParts[0]}`] || !tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`])) ||
26    (nameParts.length === 1 && !tzlibZonesDB[`${nameParts[0]}`])
27  ) {
28    console.error('Given timezone not valid.');
29    return '';
30  }
31  if (nameParts.length === 3) {
32    return [
33      tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][`${nameParts[2]}`][0],
34      tzlib_enrich_data(tzlibZonesDetailsDB[tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][`${nameParts[2]}`][1]]),
35    ];
36  }
37  if (nameParts.length === 2) {
38    return [
39      tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][0],
40      tzlib_enrich_data(tzlibZonesDetailsDB[tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][1]]),
41    ];
42  }
43  return [tzlibZonesDB[`${nameParts[0]}`][0], tzlib_enrich_data(tzlibZonesDetailsDB[tzlibZonesDB[`${nameParts[0]}`][1]])];
44}
45function tzlib_enrich_data(string) {
46  const shortenerMap = {
47    "<br>":"<n>",
48    "TZNAME:":"<tz>",
49    "TZOFFSETFROM:":"<of>",
50    "TZOFFSETTO:":"<ot>",
51    "DTSTART:":"<s>",
52    "RRULE:":"<r>",
53    "BEGIN:DAYLIGHT":"<bd>",
54    "END:DAYLIGHT":"<ed>",
55    "BEGIN:STANDARD":"<bs>",
56    "END:STANDARD":"<es>"
57  }
58  for (const [key, value] of Object.entries(shortenerMap)) {
59    string = string.replaceAll(value, key);
60  }
61  return string;
62}
63// eslint-disable-next-line @typescript-eslint/no-unused-vars
64function tzlib_get_ical_block(tzName, jsonType = false) {
65  const tzBlock = tzlib_get_content(tzName);
66  if (tzBlock[1] == null || tzBlock[1] == '') {
67    return '';
68  }
69  const location = (function () {
70    if (tzBlock[0] == '') {
71      return tzName;
72    } else {
73      return tzBlock[0];
74    }
75  })();
76  const tzidLine = 'TZID=' + location;
77  const output = [
78    'BEGIN:VTIMEZONE\r\nTZID:' +
79      location +
80      '\r\nX-LIC-LOCATION:' +
81      location +
82      '\r\nLAST-MODIFIED:' +
83      tzBlock[1].replace(/[^\w_\-:,;=+/<br>]/g, '').replace(/<br>/g, '\r\n') +
84      'END:VTIMEZONE',
85    tzidLine,
86  ];
87  if (jsonType) {
88    return JSON.stringify(output);
89  }
90  return output;
91}
92// eslint-disable-next-line @typescript-eslint/no-unused-vars
93function tzlib_get_offset(tzName, isoDate, isoTime) {
94  const tzBlock = tzlib_get_content(tzName);
95  if (tzBlock[1] == null || tzBlock[1] == '') {
96    return '';
97  }
98  if (!isoDate.match(/^\d{4}-\d{2}-\d{2}$/)) {
99    console.error('offset calculation failed: date misspelled [-> YYYY-MM-DD]');
100    return '';
101  }
102  if (!isoTime.match(/^\d{2}:\d{2}$/)) {
103    console.error('offset calculation failed: time misspelled [-> hh:mm]');
104    return '';
105  }
106  if (!tzBlock[1].match(/BEGIN:DAYLIGHT/i)) {
107    return tzBlock[1].match(/TZOFFSETTO:([+|-]\d{4})/i)[1];
108  }
109  const dateString = isoDate + 'T' + isoTime + ':00';
110  const date = new Date(dateString);
111  const dateYear = date.getFullYear();
112  const dateMonth = date.getMonth() + 1;
113  const dateDay = date.getDate();
114  const dateHour = date.getHours();
115  const timezoneData = tzBlock[1].replace(/[^\w_\-:,;=+/<br>]/g, '').split('<br>');
116  const tzBreakpoints = { 1: {}, 2: {} };
117  let breakpointCount = 0;
118  for (let i = 0; i < timezoneData.length; i++) {
119    if (timezoneData[`${i}`].startsWith('TZOFFSETTO')) {
120      breakpointCount++;
121      tzBreakpoints[`${breakpointCount}`].offset = timezoneData[`${i}`].split(':')[1];
122    }
123    if (timezoneData[`${i}`].startsWith('DTSTART')) {
124      tzBreakpoints[`${breakpointCount}`].hour = parseInt(timezoneData[`${i}`].substr(17, 2));
125    }
126    if (timezoneData[`${i}`].startsWith('RRULE')) {
127      let rruleParts = timezoneData[`${i}`].split(';');
128      let rruleMonth = parseInt(rruleParts[1].split('=')[1]);
129      tzBreakpoints[`${breakpointCount}`].month = parseInt(rruleMonth);
130      tzBreakpoints[`${breakpointCount}`].day = rruleParts[2].split('=')[1];
131    }
132  }
133  if (tzBreakpoints[1].month > tzBreakpoints[2].month) {
134    [tzBreakpoints[1], tzBreakpoints[2]] = [tzBreakpoints[2], tzBreakpoints[1]];
135  }
136  if (dateMonth != tzBreakpoints[1].month && dateMonth != tzBreakpoints[2].month) {
137    if (dateMonth < tzBreakpoints[1].month || dateMonth > tzBreakpoints[2].month) {
138      return tzBreakpoints[2].offset;
139    } else {
140      return tzBreakpoints[1].offset;
141    }
142  }
143  const theCase = (function () {
144    return Object.keys(tzBreakpoints).find((key) => tzBreakpoints[`${key}`].month == dateMonth);
145  })();
146  const helperArrayWeekdays = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
147  const numberDays = new Date(dateYear, dateMonth, 0).getDate();
148  let weekdayCount = new Date(dateYear, dateMonth - 1, 1).getDay();
149  const weekdays = { SU: {}, MO: {}, TU: {}, WE: {}, TH: {}, FR: {}, SA: {} };
150  for (let d = 1; d <= numberDays; d++) {
151    const occurence = Object.keys(weekdays[helperArrayWeekdays[`${weekdayCount}`]]).length + 1;
152    weekdays[helperArrayWeekdays[`${weekdayCount}`]][`${occurence}`] = d;
153    weekdayCount++;
154    if (weekdayCount == 7) {
155      weekdayCount = 0;
156    }
157  }
158  const actualDay = (function () {
159    if (tzBreakpoints[`${theCase}`].day[0] == '-') {
160      const breakpointWeekday = tzBreakpoints[`${theCase}`].day.substr(2, 2);
161      const dayIndex =
162        Object.keys(weekdays[`${breakpointWeekday}`]).length +
163        1 -
164        parseInt(tzBreakpoints[`${theCase}`].day[1]);
165      return weekdays[`${breakpointWeekday}`][`${dayIndex}`];
166    } else {
167      const breakpointWeekday = tzBreakpoints[`${theCase}`].day.substr(1, 2);
168      return weekdays[`${breakpointWeekday}`][tzBreakpoints[`${theCase}`].day[0]];
169    }
170  })();
171  if (dateDay > actualDay || (dateDay == actualDay && dateHour >= tzBreakpoints[`${theCase}`].hour)) {
172    return tzBreakpoints[`${theCase}`].offset;
173  }
174  const fallbackCase = (function () {
175    if (theCase == 1) {
176      return 2;
177    } else {
178      return 1;
179    }
180  })();
181  return tzBreakpoints[`${fallbackCase}`].offset;
182}
183let tzlibZoneNames = [];
184// eslint-disable-next-line @typescript-eslint/no-unused-vars
185function tzlib_get_timezones(jsonType = false) {
186  if (tzlibZoneNames.length == 0) {
187    tzlibZoneNames = (function () {
188      let namesArr = [];
189      for (const [key, value] of Object.entries(tzlibZonesDB)) {
190        if (typeof value === 'object' && !Array.isArray(value)) {
191          for (const [key2, value2] of Object.entries(value)) {
192            if (typeof value2 === 'object' && !Array.isArray(value2)) {
193              for (const [key3] of Object.entries(value2)) {
194                namesArr.push(key + '/' + key2 + '/' + key3);
195              }    
196            } else {
197              namesArr.push(key + '/' + key2);
198            }
199          } 
200        } else {
201          namesArr.push(key);
202        }
203      }
204      return namesArr;
205    })();
206  }
207  if (jsonType) {
208    return JSON.stringify(tzlibZoneNames);
209  }
210  return tzlibZoneNames;
211}
212
213/*!
214 *  @preserve
215 *
216 *  ++++++++++++++++++++++
217 *  Add to Calendar Button
218 *  ++++++++++++++++++++++
219 *
220 *  Version: 1.18.8
221 *  Creator: Jens Kuerschner (https://jenskuerschner.de)
222 *  Project: https://github.com/add2cal/add-to-calendar-button
223 *  License: Apache-2.0 with “Commons Clause” License Condition v1.0
224 *  Note:    DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
225 *
226 */
227const atcbVersion = '1.18.8';
228const isBrowser = () => {
229  if (typeof window === 'undefined') {
230    return false;
231  } else {
232    return true;
233  }
234};
235const isiOS = isBrowser()
236  ? () => {
237      if (
238        (/iPad|iPhone|iPod/i.test(navigator.userAgent || navigator.vendor || window.opera) &&
239          !window.MSStream) ||
240        (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
241      ) {
242        return true;
243      } else {
244        return false;
245      }
246    }
247  : () => {
248      return false;
249    };
250const isAndroid = isBrowser()
251  ? () => {
252      if (/android/i.test(navigator.userAgent || navigator.vendor || window.opera) && !window.MSStream) {
253        return true;
254      } else {
255        return false;
256      }
257    }
258  : () => {
259      return false;
260    };
261const isChrome = isBrowser()
262  ? () => {
263      if (/chrome|chromium|crios|google inc/i.test(navigator.userAgent || navigator.vendor)) {
264        return true;
265      } else {
266        return false;
267      }
268    }
269  : () => {
270      return false;
271    };
272const isMobile = () => {
273  if (isAndroid() || isiOS()) {
274    return true;
275  } else {
276    return false;
277  }
278};
279const isWebView = isBrowser()
280  ? () => {
281      if (
282        /(; ?wv|(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari))/i.test(navigator.userAgent || navigator.vendor)
283      ) {
284        return true;
285      } else {
286        return false;
287      }
288    }
289  : () => {
290      return false;
291    };
292const isProblematicWebView = isBrowser()
293  ? () => {
294      if (/(Instagram)/i.test(navigator.userAgent || navigator.vendor || window.opera)) {
295        return true;
296      } else {
297        return false;
298      }
299    }
300  : () => {
301      return false;
302    };
303const atcbDefaultTarget = isWebView() ? '_system' : '_blank';
304const atcbOptions = ['apple', 'google', 'ical', 'ms365', 'outlookcom', 'msteams', 'yahoo'];
305const atcbValidRecurrOptions = ['apple', 'google', 'ical'];
306const atcbInvalidSubscribeOptions = ['msteams'];
307const atcbiOSInvalidOptions = ['ical'];
308const atcbStates = [];
309const atcbIcon = {
310  trigger:
311    '<span class="atcb-icon-trigger"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200.016"><path d="M132.829 7.699c0-4.248 4.199-7.699 9.391-7.699s9.391 3.451 9.391 7.699v33.724c0 4.248-4.199 7.699-9.391 7.699s-9.391-3.451-9.391-7.699zm-5.941 123.747c2.979 0 5.404 2.425 5.404 5.404s-2.425 5.404-5.404 5.404l-21.077-.065-.065 21.045c0 2.979-2.425 5.404-5.404 5.404s-5.404-2.425-5.404-5.404l.065-21.061-21.045-.081c-2.979 0-5.404-2.425-5.404-5.404s2.425-5.404 5.404-5.404l21.061.065.065-21.045c0-2.979 2.425-5.404 5.404-5.404s5.404 2.425 5.404 5.404l-.065 21.077 21.061.065zM48.193 7.699C48.193 3.451 52.393 0 57.585 0s9.391 3.451 9.391 7.699v33.724c0 4.248-4.199 7.699-9.391 7.699s-9.391-3.451-9.391-7.699zM10.417 73.763h179.167V34.945c0-1.302-.537-2.49-1.4-3.369-.863-.863-2.051-1.4-3.369-1.4h-17.171c-2.881 0-5.208-2.327-5.208-5.208s2.327-5.208 5.208-5.208h17.171c4.183 0 7.975 1.709 10.726 4.46S200 30.762 200 34.945v44.043 105.843c0 4.183-1.709 7.975-4.46 10.726s-6.543 4.46-10.726 4.46H15.186c-4.183 0-7.975-1.709-10.726-4.46C1.709 192.79 0 188.997 0 184.814V78.988 34.945c0-4.183 1.709-7.975 4.46-10.726s6.543-4.46 10.726-4.46h18.343c2.881 0 5.208 2.327 5.208 5.208s-2.327 5.208-5.208 5.208H15.186c-1.302 0-2.49.537-3.369 1.4-.863.863-1.4 2.051-1.4 3.3
31169zm179.167 10.433H10.417v100.618c0 1.302.537 2.49 1.4 3.369.863.863 2.051 1.4 3.369 1.4h169.629c1.302 0 2.49-.537 3.369-1.4.863-.863 1.4-2.051 1.4-3.369zM82.08 30.176c-2.881 0-5.208-2.327-5.208-5.208s2.327-5.208 5.208-5.208h34.977c2.881 0 5.208 2.327 5.208 5.208s-2.327 5.208-5.208 5.208z"/></svg></span>',
312  apple:
313    '<span class="atcb-icon-apple"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 245.657"><path d="M167.084 130.514c-.308-31.099 25.364-46.022 26.511-46.761-14.429-21.107-36.91-24.008-44.921-24.335-19.13-1.931-37.323 11.27-47.042 11.27-9.692 0-24.67-10.98-40.532-10.689-20.849.308-40.07 12.126-50.818 30.799-21.661 37.581-5.54 93.281 15.572 123.754 10.313 14.923 22.612 31.688 38.764 31.089 15.549-.612 21.433-10.073 40.242-10.073s24.086 10.073 40.546 9.751c16.737-.308 27.34-15.214 37.585-30.187 11.855-17.318 16.714-34.064 17.009-34.925-.372-.168-32.635-12.525-32.962-49.68l.045-.013zm-30.917-91.287C144.735 28.832 150.524 14.402 148.942 0c-12.344.503-27.313 8.228-36.176 18.609-7.956 9.216-14.906 23.904-13.047 38.011 13.786 1.075 27.862-7.004 36.434-17.376z"/></svg></span>',
314  google:
315    '<span class="atcb-icon-google"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path d="M152.637 47.363H47.363v105.273h105.273z" fill="#fff"/><path d="M152.637 200L200 152.637h-47.363z" fill="#f72a25"/><path d="M200 47.363h-47.363v105.273H200z" fill="#fbbc04"/><path d="M152.637 152.637H47.363V200h105.273z" fill="#34a853"/><path d="M0 152.637v31.576A15.788 15.788 0 0 0 15.788 200h31.576v-47.363z" fill="#188038"/><path d="M200 47.363V15.788A15.79 15.79 0 0 0 184.212 0h-31.575v47.363z" fill="#1967d2"/><path d="M15.788 0A15.79 15.79 0 0 0 0 15.788v136.849h47.363V47.363h105.274V0z" fill="#4285f4"/><path d="M68.962 129.02c-3.939-2.653-6.657-6.543-8.138-11.67l9.131-3.76c.83 3.158 2.279 5.599 4.346 7.341 2.051 1.742 4.557 2.588 7.471 2.588 2.995 0 5.55-.911 7.699-2.718 2.148-1.823 3.223-4.134 3.223-6.934 0-2.865-1.139-5.208-3.402-7.031s-5.111-2.718-8.496-2.718h-5.273v-9.033h4.736c2.913 0 5.387-.781 7.389-2.376 2.002-1.579 2.995-3.743 2.995-6.494 0-2.441-.895-4.395-2.686-5.859s-4.053-2.197-6.803-2.197c-2.686 0-4.818.716-6.396 2.148s-2.767 3.255-3.451 5.273l-9.033-3.76c1.204-3.402 3.402-6.396 6.624-8.984s7.34-3.89 12.337-3.89c3.695 0 7.031.716 9.977 2.148s5.257 3.418 6.934 5.941c1.676 2.539 2.507 5.387 2.507 8.545 0 3.223-.781 5.941-2.327 8.187-1.546 2.23-3.467 3.955-5.729 5.143v.537a17.39 17.39 0 0 1 7.34 5.729c1.904 2.572 2.865 5.632 2.865 9.212s-.911 6.771-2.718 9.57c-1.823 2.799-4.329 5.013-7.52 6.624s-6.787 2.425-10.775 2.425c-4.622 0-8.887-1.318-12.826-3.988zm56.087-45.312l-10.026 7.243-5.013-7.601 17.985-12.972h6.901v61.198h-9.847z" fill="#1a73e8"/></svg></span>',
316  ical: '<span class="atcb-icon-ical"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200.016"><path d="M132.829 7.699c0-4.248 4.199-7.699 9.391-7.699s9.391 3.451 9.391 7.699v33.724c0 4.248-4.199 7.699-9.391 7.699s-9.391-3.451-9.391-7.699zm-25.228 161.263c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm-81.803-59.766c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.902 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.902 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.918 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zM25.798 139.079c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.902 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.902 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.918 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zM25.798 168.962c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zm40.902 0c-.553 0-.993-2.327-.993-5.208s.439-5.208.993-5.208h25.7c.553 0 .993 2.327.993 5.208s-.439 5.208-.993 5.208zM48.193 7.699C48.193 3.451 52.393 0 57.585 0s9.391 3.451 9.391 7.699v33.724c0 4.248-4.199 7.699-9.391 7.699s-9.391-3.451-9.391-7.699zM10.417 73.763h179.15V34.945c0-1.302-.537-2.49-1.4-3.369-.863-.863-2.051-1.4-3.369-1.4h-17.155c-2.881 0-5.208-2.327-5.208-5.208s2.327-5.208 5.208-5.208h17.171c4.183 0 7.975 1.709 10.726 4.46S200 30.762 200 34.945v44.043 105.843c0 4.183-1.709 7.975-4.46 10.726s-6.543 4.46-10.726 4.46H15.186c-4.183 0-7.975-1.709-10.726-4.46C1.709 192.79 0 188.997 0 184.814V78.971 34.945c0-4.183 1.709-7.975 4.46-10.726s6.543-4.46 10.726-4.46h18.343c2.881 0 5.208 2.327 5.208 5.208s-2.327 5.208-5.208 5.208H15.186c-1.302 0-2.49.537-3.369 1.4-.863.863-1.4 2.051-1.4 3.3
31669zm179.167 10.433H10.417v100.618c0 1.302.537 2.49 1.4 3.369.863.863 2.051 1.4 3.369 1.4h169.629c1.302 0 2.49-.537 3.369-1.4.863-.863 1.4-2.051 1.4-3.369zM82.08 30.176c-2.881 0-5.208-2.327-5.208-5.208s2.327-5.208 5.208-5.208h34.977c2.881 0 5.208 2.327 5.208 5.208s-2.327 5.208-5.208 5.208z"/></svg></span>',
317  msteams:
318    '<span class="atcb-icon-msteams"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 186.047"><path d="M195.349 39.535a20.93 20.93 0 1 1-41.86 0 20.93 20.93 0 1 1 41.86 0zm-55.847 30.233h51.66A8.84 8.84 0 0 1 200 78.605v47.056c0 17.938-14.541 32.479-32.479 32.479h0-.154c-17.938.003-32.481-14.537-32.484-32.474v-.005-51.274a4.62 4.62 0 0 1 4.619-4.619z" fill="#5059c9"/><path d="M149.614 69.767H64.34c-4.823.119-8.637 4.122-8.526 8.944v53.67c-.673 28.941 22.223 52.957 51.163 53.665 28.94-.708 51.836-24.725 51.163-53.665v-53.67c.112-4.823-3.703-8.825-8.526-8.944zm-10.079-39.535a30.233 30.233 0 0 1-60.465 0 30.233 30.233 0 0 1 60.465 0z" fill="#7b83eb"/><path opacity=".1" d="M111.628 69.767v75.209c-.023 3.449-2.113 6.547-5.302 7.86-1.015.43-2.107.651-3.209.651H59.907l-1.628-4.651c-1.628-5.337-2.459-10.885-2.465-16.465V78.698c-.112-4.815 3.697-8.811 8.512-8.93z"/><path opacity=".2" d="M106.977 69.767v79.86a8.241 8.241 0 0 1-.651 3.209c-1.313 3.189-4.412 5.279-7.86 5.302H62.093l-2.186-4.651a46.13 46.13 0 0 1-1.628-4.651 56.647 56.647 0 0 1-2.465-16.465V78.698c-.112-4.815 3.697-8.811 8.512-8.93z"/><path opacity=".2" d="M102.326 69.767v70.558a8.58 8.58 0 0 1-8.512 8.512H58.279a56.647 56.647 0 0 1-2.465-16.465V78.698c-.112-4.815 3.697-8.811 8.512-8.93z"/><path opacity=".1" d="M111.628 45.721v14.651l-2.326.093c-.791 0-1.535-.046-2.326-.093-1.57-.104-3.127-.353-4.651-.744a30.233 30.233 0 0 1-20.93-17.767 25.845 25.845 0 0 1-1.488-4.651h23.209c4.693.018 8.494 3.818 8.512 8.512z"/><use xlink:href="#B" opacity=".2" transform="scale(.08973306)"/><path d="M106.977 50.372v10c-1.57-.104-3.127-.353-4.651-.744a30.233 30.233 0 0 1-20.93-17.767h17.07c4.693.018 8.494 3.818 8.512 8.512zm0 19.395v70.558a8.58 8.58 0 0 1-8.512 8.512H58.279a56.647 56.647 0 0 1-2.465-16.465V78.698c-.112-4.815 3.697-8.811 8.512-8.93z" opacity=".2"/><path opacity=".2" d="M102.326 50.372v9.256a30.233 30.233 0 0 1-20.93-17.767h12.419c4.693.018 8.494 3.818 8.512 8.512z"/><linearGradient id="A" gradientUnits="userSpaceOnUse" x1="17.776" y1="35.199" x2="84.55" y2="150.848"><stop offset="0" stop-color="#5a62c3"/><stop offset=".5" stop-color="#4d55bd"/><stop offset="1" stop-color="#3940ab"/></linearGradient><path fill="url(#A)" d="M8.526 41.86H93.8a8.53 8.53 0 0 1 8.526 8.526v85.274a8.53 8.53 0 0 1-8.526 8.526H8.526A8.53 8.53 0 0 1 0 135.66V
31850.386a8.53 8.53 0 0 1 8.526-8.526z"/><path fill="#fff" d="M73.6 74.316H56.553v46.419h-10.86V74.316H28.726v-9.005H73.6z"/><defs><path id="B" d="M1192.167 561.355v111.442c-17.496-1.161-34.848-3.937-51.833-8.293a336.92 336.92 0 0 1-233.25-198.003h190.228c52.304.198 94.656 42.55 94.855 94.854z"/></defs></svg></span>',
319  ms365:
320    '<span class="atcb-icon-ms365"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 239.766"><path d="M200 219.785l-.021-.012V20.591L128.615 0 .322 48.172 0 48.234.016 192.257l43.78-17.134V57.943l84.819-20.279-.012 172.285L.088 192.257l128.515 47.456v.053l71.376-19.753v-.227z"/></svg></span>',
321  outlookcom:
322    '<span class="atcb-icon-outlookcom"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 175"><path d="M178.725 0H71.275A8.775 8.775 0 0 0 62.5 8.775v9.975l60.563 18.75L187.5 18.75V8.775A8.775 8.775 0 0 0 178.725 0z" fill="#0364b8"/><path d="M197.813 96.281c.915-2.878 2.187-5.855 2.187-8.781-.002-1.485-.795-2.857-1.491-3.26l-68.434-38.99a9.37 9.37 0 0 0-9.244-.519c-.312.154-.614.325-.906.512l-67.737 38.6-.025.013-.075.044a4.16 4.16 0 0 0-2.088 3.6c.541 2.971 1.272 5.904 2.188 8.781l71.825 52.532z" fill="#0a2767"/><path d="M150 18.75h-43.75L93.619 37.5l12.631 18.75L150 93.75h37.5v-37.5z" fill="#28a8ea"/><path d="M150 18.75h37.5v37.5H150z" fill="#50d9ff"/><path d="M150 93.75l-43.75-37.5H62.5v37.5l43.75 37.5 67.7 11.05z" fill="#0364b8"/><path d="M106.25 56.25v37.5H150v-37.5zM150 93.75v37.5h37.5v-37.5zm-87.5-75h43.75v37.5H62.5z" fill="#0078d4"/><path d="M62.5 93.75h43.75v37.5H62.5z" fill="#064a8c"/><path d="M126.188 145.113l-73.706-53.75 3.094-5.438 68.181 38.825a3.3 3.3 0 0 0 2.625-.075l68.331-38.937 3.1 5.431z" fill="#0a2767" opacity=".5"/><path d="M197.919 91.106l-.088.05-.019.013-67.738 38.588c-2.736 1.764-6.192 1.979-9.125.569l23.588 31.631 51.588 11.257v-.001c2.434-1.761 3.876-4.583 3.875-7.587V87.5c.001 1.488-.793 2.862-2.081 3.606z" fill="#1490df"/><path d="M200 165.625v-4.613l-62.394-35.55-7.531 4.294a9.356 9.356 0 0 1-9.125.569l23.588 31.631 51.588 11.231v.025a9.362 9.362 0 0 0 3.875-7.588z" opacity=".05"/><path d="M199.688 168.019l-68.394-38.956-1.219.688c-2.734 1.766-6.19 1.984-9.125.575l23.588 31.631 51.587 11.256v.001a9.38 9.38 0 0 0 3.562-5.187z" opacity=".1"/><path d="M51.455 90.721c-.733-.467-1.468-1.795-1.455-3.221v78.125c-.007 5.181 4.194 9.382 9.375 9.375h131.25c1.395-.015 2.614-.366 3.813-.813.638-.258 1.252-.652 1.687-.974z" fill="#28a8ea"/><path d="M112.5 141.669V39.581a8.356 8.356 0 0 0-8.331-8.331H62.687v46.6l-10.5 5.987-.031.012-.075.044A4.162 4.162 0 0 0 50 87.5v.031-.031V150h54.169a8.356 8.356 0 0 0 8.331-8.331z" opacity=".1"/><path d="M106.25 147.919V45.831a8.356 8.356 0 0 0-8.331-8.331H62.687v40.35l-10.5 5.987-.031.012-.075.044A4.162 4.162 0 0 0 50 87.5v.031-.031 68.75h47.919a8.356 8.356 0 0 0 8.331-8.331z" opacity=".2"/><path d="M106.25 135.419V45.831a8.356 8.356 0 0 0-8.331-8.331H62.687v40.35l-10.5 5.987-.031.012-.075.044A4.162 4.162 0 0 0 50 87.5v.031-.031 56.25h47.919a8.356 8.356 0 0 0 8.331-8.331z" opacity=".2"/><path d="M100 135.419V45.831a8.356 8.356 0 0 0-8.331-8.331H62.687v40.35l-10.5 5.987-.031.012-.075.044A4.162 4.162 0 0 0 50 87.5v.031-.031 56.25h41.669a8.356 8.356 0 0 0 8.331-8.331z" opacity=".2"/><path d="M8.331 37.5h83.337A8.331 8.331 0 0 1 100 45.831v83.338a8.331 8.331 0 0 1-8.331 8.331H8.331A8.331 8.331 0 0 1 0 129.169V45.831A8.331 8.331 0 0 1 8.331 37.5z" fill="#0078d4"/><path d="M24.169 71.675a26.131 26.131 0 0 1 10.263-11.337 31.031 31.031 0 0 1 16.313-4.087 28.856 28.856 0 0 1 15.081 3.875 25.875 25.875 0 0 1 9.988 10.831 34.981 34.981 0 0 1 3.5 15.938 36.881 36.881 0 0 1-3.606 16.662 26.494 26.494 0 0 1-10.281 11.213 30 30 0 0 1-15.656 3.981 29.556 29.556 0 0 1-15.425-3.919 26.275 26.275 0 0 1-10.112-10.85 34.119 34.119 0 0 1-3.544-15.744 37.844 37.844 0 0 1 3.481-16.563zm10.938 26.613a16.975 16.975 0 0 0 5.769 7.463 15.069 15.069 0 0 0 9.019 2.719 15.831 15.831 0 0 0 9.631-2.806 16.269 16.269 0 0 0 5.606-7.481 28.913 28.913 0 0 0 1.787-10.406 31.644 31.644 0 0 0-1.687-10.538 16.681 16.681 0 0 0-5.413-7.75 14.919 14.919 0 0 0-9.544-2.956 15.581 15.581 0 0 0-9.231 2.744 17.131 17.131 0 0 0-5.9 7.519 29.85 29.85 0 0 0-.044 21.5z" fill="#fff"/></svg></span>',
323  yahoo:
324    '<span class="atcb-icon-yahoo"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 177.803"><path d="M0 43.284h38.144l22.211 56.822 22.5-56.822h37.135L64.071 177.803H26.694l15.308-35.645L.001 43.284zm163.235 45.403H121.64L158.558 0 200 .002zm-30.699 8.488c12.762 0 23.108 10.346 23.108 23.106s-10.345 23.106-23.108 23.106a23.11 23.11 0 0 1-23.104-23.106 23.11 23.11 0 0 1 23.104-23.106z"/></svg></span>',
325  atcb: '<svg version="1.1" viewBox="0 0 150 8.5002" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="matrix(1.3333 0 0 -1.3333 -2427.5 1757.9)"><g transform="matrix(.22189 0 0 -.22189 1822.6 1374.6)" fill="#9a9a9a" style="paint-order:stroke markers fill;shape-inside:url(#rect2441);white-space:pre" aria-label="Add-to-Calendar-PRO.com"><path d="m-1.2773 253.99h12.148l7.9688 27.5h-9.4141l-1.0547-5.2734h-7.1094l-1.1328 5.2734h-9.0234zm8.7109 17.305-2.6172-12.031-2.6953 12.031z" style="paint-order:stroke markers fill"/><path d="m29.66 261.16q2.2656 0 3.9062 0.9375t2.6562 3.1055v-10.078l8.4375-1.25v27.617h-8.4375v-3.7109q-0.9375 2.0117-2.5586 3.0273-1.6211 0.9961-4.043 0.9961-2.0898 0-3.8672-0.83985-1.7773-0.85937-3.0859-2.2852-1.2891-1.4258-2.0312-3.2812-0.74219-1.875-0.74219-3.9062 0-2.1875 0.78125-4.082 0.80078-1.8945 2.1484-3.2812 1.3477-1.3867 3.1055-2.168 1.7773-0.80078 3.7305-0.80078zm6.5625 10.176q-0.03906-0.78125-0.37109-1.4844-0.33203-0.70312-0.87891-1.2109-0.52734-0.52735-1.2305-0.82032-0.70312-0.3125-1.4648-0.3125-0.85938 0-1.6016 0.33203-0.72266 0.3125-1.25 0.85938-0.52734 0.54687-0.83984 1.2695-0.29297 0.72266-0.29297 1.5234 0 0.85937 0.3125 1.582 0.33203 0.72266 0.87891 1.2695 0.54688 0.52734 1.2695 0.83984 0.72266 0.29297 1.5234 0.29297 0.83984 0 1.5625-0.33203 0.72266-0.33203 1.25-0.8789 0.52734-0.54688 0.82031-1.2695 0.3125-0.72265 0.3125-1.5039z" style="paint-order:stroke markers fill"/><path d="m57.551 261.16q2.2656 0 3.9062 0.9375t2.6562 3.1055v-10.078l8.4375-1.25v27.617h-8.4375v-3.7109q-0.9375 2.0117-2.5586 3.0273-1.6211 0.9961-4.043 0.9961-2.0898 0-3.8672-0.83985-1.7773-0.85937-3.0859-2.2852-1.2891-1.4258-2.0312-3.2812-0.74219-1.875-0.74219-3.9062 0-2.1875 0.78125-4.082 0.80078-1.8945 2.1484-3.2812 1.3477-1.3867 3.1055-2.168 1.7773-0.80078 3.7305-0.80078zm6.5625 10.176q-0.03906-0.78125-0.37109-1.4844-0.33203-0.70312-0.87891-1.2109-0.52734-0.52735-1.2305-0.82032-0.70312-0.3125-1.4648-0.3125-0.85938 0-1.6016 0.33203-0.72266 0.3125-1.25 0.85938-0.52734 0.54687-0.83984 1.2695-0.29297 0.72266-0.29297 1.5234 0 0.85937 0.3125 1.582 0.33203 0.72266 0.87891 1.2695 0.54688 0.52734 1.2695 0.83984 0.72266 0.29297 1.5234 0.29297 0.83984 0 1.5625-0.33203 0.72266-0.33203 1.25-0.8789 0.52734-0.54688 0.82031-1.2695 0.3125-0.72265 0.3125-1.5039z" style="paint-order:stroke markers fill"/><path d="m76.496 268.8h10.742v4.7266h-10.742z" style="paint-order:stroke markers fill"/><path d="m104.8 280.44q-2.7148 1.3672-6.0156 1.3672-1.6992 0-3.0273-0.54688-1.3281-0.5664-2.2461-1.6016-0.89844-1.0547-1.3672-2.5195-0.46875-1.4844-0.46875-3.3398l0.03906-7.3828h-2.5391v-4.9609h3.1641l3.7109-7.5781h4.0625v7.5781h4.6094v4.9609h-4.6094v6.7969q0 1.0547 0.68359 1.582t1.8555 0.52734q0.91797 0 1.8359-0.46875z" style="paint-order:stroke markers fill"/><path d="m114.62 271.45q0 1.0938 0.3125 1.9141 0.33204 0.82031 0.85938 1.3672 0.52734 0.54687 1.2109 0.82031 0.68359 0.27344 1.3867 0.27344 0.70312 0 1.3672-0.27344 0.6836-0.27344 1.2109-0.82031 0.54688-0.54688 0.85938-1.3672 0.33203-0.82031 0.33203-1.9141t-0.33203-1.9141q-0.3125-0.82031-0.85938-1.3476-0.52734-0.54688-1.2109-0.82032-0.66406-0.27343-1.3672-0.27343-0.70313 0-1.3867 0.27343-0.6836 0.27344-1.2109 0.82032-0.52734 0.52734-0.85938 1.3476-0.3125 0.82032-0.3125 1.9141zm-7.8125 0q0.0977-2.5195 1.0352-4.4336 0.95703-1.9141 2.5195-3.2226 1.5625-1.3086 3.6133-1.9727 2.0703-0.66406 4.3945-0.66406 2.5391 0 4.6484 0.76172 2.1094 0.76171 3.6328 2.1289 1.5234 1.3477 2.3633 3.2422 0.83985 1.8945 0.83985 4.1602 0 1.8359-0.48828 3.3203-0.46875 1.4844-1.2891 2.6367-0.82031 1.1328-1.9336 1.9726-1.1133 0.83985-2.4023 1.3867-1.2891 0.52735-2.6758 0.78125-1.3672 0.25391-2.7344 0.25391-2.5781 0-4.707-0.74219-2.1094-0.76172-3.6328-2.1289-1.5234-1.3672-2.3633-3.2617-0.82032-1.9141-0.82032-4.2188z" style="paint-order:stroke markers fill"/><path d="m132.73 268.8h10.742v4.7266h-10.742z" style="paint-order:stroke markers fill"/><path d="m162.41 274.89q0.6836 0 1.2695-0.0586 0.58594-0.0781 1.1524-0.21484 0.58593-0.13672 1.1914-0.35156 0.60547-0.21485 1.3477-0.50782l1.0938 6.3477q-3.4766 2.0117-7.5781 2.0117-5.8008 0-9.9414-3.9062-4.3359-4.0625-4.3945-10.488 0-3.125 1.0742-5.7617 1.0742-2.6367 2.9688-4.5312 1.8945-1.9141 4.4726-2.9688 2.5781-1.0742 5.5859-1.0742 4.2773 0 7.7734 1.9922l-1.0547 6.2109q-2.8711-1.0938-5.1953-1.0938-3.2617 0-4.9609 1.8945-1.6797 1.875-1.6797 5.293 0 1.6992 0.44922 3.0469 0.46875 1.3281 1.3477 2.2656 0.8789 0.91797 2.1484 1.4062 1.2891 0.48829 2.9297 0.48829z" style="paint-order:stroke markers fill"/><path d="m186.52 277.78q-0.9375 1.9531-2.5391 2.9883-1.6016 1.0352-4.0234 1.0352-1.9531 0-3.7305-0.78125-1.7774-0.80078-3.125-2.1875-1.3477-1.4062-2.1484-3.3203-0.80078-1.9141-0.80078-4.1602 0-2.2266 0.80078-4.1016 0.82031-1.875 2.168-3.2227 1.3672-1.3672 3.125-2.1094 1.7
325773-0.76172 3.7109-0.76172 0.9961 0 1.9531 0.27343 0.97656 0.25391 1.8359 0.83985 0.8789 0.5664 1.582 1.4453 0.72265 0.87891 1.1914 2.1094v-4.668h8.3984v20.332h-8.3984zm0-6.4453q-0.0391-0.78125-0.37109-1.4844-0.33203-0.70312-0.87891-1.2109-0.52734-0.52735-1.2305-0.82032-0.70313-0.3125-1.4648-0.3125-0.85937 0-1.6016 0.33203-0.72266 0.3125-1.2695 0.85938-0.52735 0.52734-0.83985 1.25t-0.3125 1.543q0 0.85937 0.33204 1.6016 0.33203 0.72266 0.8789 1.25 0.56641 0.52734 1.2891 0.83984 0.72266 0.29297 1.5234 0.29297 0.82031 0 1.5234-0.3125 0.70312-0.3125 1.2305-0.83984 0.52734-0.52734 0.83984-1.2109 0.3125-0.70312 0.35156-1.4648z" style="paint-order:stroke markers fill"/><path d="m212.02 280.44q-2.7148 1.3672-6.0156 1.3672-1.6992 0-3.0273-0.54688-1.3281-0.5664-2.2461-1.6016-0.89843-1.0547-1.3672-2.5195-0.46875-1.4844-0.46875-3.3398v-18.672l8.4375-1.25v19.336q0 1.0742 0.68359 1.6016 0.68359 0.50781 1.8555 0.50781 0.89844 0 1.8359-0.46875z" style="paint-order:stroke markers fill"/><path d="m225.71 276.2q2.7344 0 5.8984-1.4062l0.97656 5.3711q-3.6328 1.6406-8.1641 1.6406-2.5195 0-4.6094-0.76172-2.0703-0.78125-3.5742-2.1484-1.4844-1.3867-2.3242-3.2812-0.82031-1.8945-0.82031-4.1211 0-2.3438 0.85937-4.2383 0.87891-1.9141 2.3828-3.2617 1.5039-1.3672 3.5156-2.0898 2.0117-0.74218 4.2969-0.74218 2.3047 0 4.043 0.78125 1.7383 0.76172 2.8906 2.1094 1.1719 1.3281 1.7383 3.125 0.58594 1.7774 0.58594 3.8086 0 0.27343-0.0195 0.52734t-0.0586 0.48828l-11.992 1.5625q0.46875 1.4062 1.5625 2.0312 1.0938 0.60547 2.8125 0.60547zm1.4844-7.6758q-0.6836-2.5-3.0469-2.5-0.74218 0-1.3281 0.29297t-0.9961 0.82031q-0.39062 0.50781-0.60546 1.2305-0.21485 0.70312-0.23438 1.5234z" style="paint-order:stroke markers fill"/><path d="m236.3 261.75h8.0469v4.082q1.1719-2.3633 3.0078-3.5156 1.8555-1.1523 4.3359-1.1523 1.9922 0 3.5156 0.74218 1.5234 0.74219 2.5586 2.1094 1.0547 1.3477 1.582 3.2617 0.54687 1.8945 0.54687 4.2188v10h-8.3984v-10.82q0-0.78125-0.15625-1.4453-0.13672-0.66406-0.46875-1.1328-0.3125-0.48828-0.80078-0.74219-0.48828-0.27343-1.1914-0.27343-0.85938 0-1.582 0.42968-0.72265 0.41016-1.2695 1.0156-0.52734 0.60547-0.85937 1.2695-0.33203 0.64453-0.42969 1.1133v10.586h-8.4375z" style="paint-order:stroke markers fill"/><path d="m272.59 261.16q2.2656 0 3.9062 0.9375 1.6406 0.9375 2.6562 3.1055v-10.078l8.4375-1.25v27.617h-8.4375v-3.7109q-0.9375 2.0117-2.5586 3.0273-1.6211 0.9961-4.043 0.9961-2.0898 0-3.8672-0.83985-1.7773-0.85937-3.0859-2.2852-1.2891-1.4258-2.0312-3.2812-0.74219-1.875-0.74219-3.9062 0-2.1875 0.78125-4.082 0.80078-1.8945 2.1484-3.2812 1.3476-1.3867 3.1055-2.168 1.7774-0.80078 3.7305-0.80078zm6.5625 10.176q-0.0391-0.78125-0.37109-1.4844-0.33203-0.70312-0.87891-1.2109-0.52734-0.52735-1.2305-0.82032-0.70312-0.3125-1.4648-0.3125-0.85937 0-1.6016 0.33203-0.72266 0.3125-1.25 0.85938-0.52735 0.54687-0.83985 1.2695-0.29296 0.72266-0.29296 1.5234 0 0.85937 0.3125 1.582 0.33203 0.72266 0.8789 1.2695 0.54688 0.52734 1.2695 0.83984 0.72266 0.29297 1.5234 0.29297 0.83984 0 1.5625-0.33203t1.25-0.8789q0.52734-0.54688 0.82031-1.2695 0.3125-0.72265 0.3125-1.5039z" style="paint-order:stroke markers fill"/><path d="m307.06 277.78q-0.9375 1.9531-2.5391 2.9883-1.6016 1.0352-4.0234 1.0352-1.9531 0-3.7305-0.78125-1.7773-0.80078-3.125-2.1875-1.3477-1.4062-2.1484-3.3203-0.80078-1.9141-0.80078-4.1602 0-2.2266 0.80078-4.1016 0.82032-1.875 2.168-3.2227 1.3672-1.3672 3.125-2.1094 1.7774-0.76172 3.7109-0.76172 0.99609 0 1.9531 0.27343 0.97657 0.25391 1.8359 0.83985 0.87891 0.5664 1.582 1.4453 0.72266 0.87891 1.1914 2.1094v-4.668h8.3984v20.332h-8.3984zm0-6.4453q-0.0391-0.78125-0.37109-1.4844-0.33204-0.70312-0.87891-1.2109-0.52734-0.52735-1.2305-0.82032-0.70312-0.3125-1.4648-0.3125-0.85938 0-1.6016 0.33203-0.72265 0.3125-1.2695 0.85938-0.52734 0.52734-0.83984 1.25t-0.3125 1.543q0 0.85937 0.33203 1.6016 0.33203 0.72266 0.87891 1.25 0.5664 0.52734 1.2891 0.83984 0.72266 0.29297 1.5234 0.29297 0.82031 0 1.5234-0.3125 0.70313-0.3125 1.2305-0.83984 0.52735-0.52734 0.83985-1.2109 0.3125-0.70312 0.35156-1.4648z" style="paint-order:stroke markers fill"/><path d="m319.5 261.75h8.4375v4.082q0.95703-2.4219 2.5391-3.5352 1.6016-1.1328 3.6719-1.1328l1.1719 6.543q-3.8086 0-5.6055 0.82031-1.7773 0.800
32578-1.7773 2.5781v10.391h-8.4375z" style="paint-order:stroke markers fill"/><path d="m337.22 268.8h10.742v4.7266h-10.742z" style="paint-order:stroke markers fill"/><path d="m352.43 253.99h9.9219q3.0859 0 5.4883 0.60547t4.043 1.7773q1.6406 1.1719 2.5 2.8711 0.85937 1.6797 0.85937 3.8477 0 2.1094-0.97656 3.7695-0.97656 1.6602-2.6758 2.832-1.6992 1.1524-3.9844 1.7774-2.2656 0.60547-4.8633 0.60547h-1.6797v9.4141h-8.6328zm10.352 12.539q2.0703 0 3.2422-0.85937 1.1719-0.85938 1.1719-2.5781 0-0.83984-0.35156-1.4648-0.33204-0.625-0.9375-1.0352-0.58594-0.42969-1.3867-0.64453t-1.7383-0.21484h-1.7188v6.7188q0.27343 0.0391 0.70312 0.0586t1.0156 0.0195z" style="paint-order:stroke markers fill"/><path d="m402.92 281.41q-2.5586 0.70313-3.6914 0.70313-7.2461 0-9.1016-6.6016l-1.0938-4.4531h-1.875v10.43h-8.75v-27.5h12.227q2.3828 0 4.4726 0.54687 2.0898 0.52735 3.6328 1.5625 1.5625 1.0156 2.4414 2.5195 0.89844 1.5039 0.89844 3.457 0 1.4453-0.37109 2.5976-0.35157 1.1328-1.0352 2.0508-0.68359 0.89844-1.6797 1.6016-0.97656 0.70312-2.2266 1.25l0.17578 0.95703q0.0586 0.33203 0.11719 0.5664 0.0586 0.23438 0.0977 0.39063l0.21484 0.83984q0.23437 0.74219 0.52734 1.2695 0.3125 0.50782 0.78125 0.83985 0.46875 0.3125 1.1524 0.46875 0.70312 0.13672 1.6992 0.13672 0.15625 0 0.48828-0.0391 0.35156-0.0391 0.89843-0.11718zm-8.8476-18.945q0-0.76172-0.33203-1.25-0.3125-0.50781-0.87891-0.78125-0.56641-0.29297-1.3281-0.39062-0.76172-0.11719-1.6406-0.11719h-2.7344v5.5078h1.5234l1.2891-0.0586q0.76171-0.0586 1.4844-0.19532 0.74219-0.15625 1.3281-0.46875 0.58593-0.33203 0.9375-0.85937 0.35156-0.54688 0.35156-1.3867z" style="paint-order:stroke markers fill"/><path d="m404.76 267.78q0-5.957 3.7891-10.039 4.043-4.3555 10.938-4.3555 3.3594 0 6.0742 1.0938 2.7148 1.0742 4.6289 2.9883t2.9492 4.5703q1.0352 2.6367 1.0352 5.7422 0 1.875-0.42968 3.6719-0.42969 1.7969-1.2891 3.3984-0.83984 1.582-2.0898 2.9297-1.25 1.3281-2.8906 2.3047-1.6211 0.95703-3.6328 1.4844-1.9922 0.54688-4.3555 0.54688-2.4219 0-4.4531-0.54688-2.0117-0.54687-3.6523-1.5234-1.6406-0.97657-2.8906-2.3242-1.2305-1.3477-2.0703-2.9297-0.82031-1.6016-1.25-3.3789-0.41016-1.7773-0.41016-3.6328zm14.727 7.0703q1.543 0 2.6172-0.64453 1.0938-0.66406 1.7774-1.6797 0.70312-1.0352 1.0156-2.3047 0.33203-1.2695 0.33203-2.4805 0-1.582-0.41015-2.8906-0.39063-1.3281-1.1524-2.2852-0.74219-0.97657-1.8164-1.543-1.0547-0.56641-2.3633-0.625-1.5625 0.0391-2.6562 0.70312-1.0938 0.66407-1.7969 1.7188-0.68359 1.0352-1.0156 2.3438-0.3125 1.2891-0.3125 2.5781 0 1.5234 0.39063 2.832 0.41016 1.2891 1.1523 2.2461 0.76172 0.9375 1.8359 1.4844 1.0742 0.54687 2.4023 0.54687z" style="paint-order:stroke markers fill"/><path d="m436.18 279.2q0-0.58594 0.2474-1.0807 0.26042-0.49479 0.67708-0.84636 0.41667-0.35156 0.95053-0.54687 0.54687-0.20834 1.1198-0.20834 0.59896 0 1.1458 0.22136 0.54688 0.20833 0.95053 0.58594 0.41666 0.36458 0.65104 0.84635 0.2474 0.48177 0.2474 1.0286 0 0.61198-0.26042 1.1068-0.2474 0.49479-0.66407 0.85938-0.41666 0.35156-0.96354 0.54687-0.53385 0.19531-1.1068 0.19531-0.625 0-1.1719-0.20833-0.54687-0.20833-0.95052-0.57292-0.40365-0.36458-0.63802-0.85937-0.23438-0.49479-0.23438-1.0677z" style="paint-order:stroke markers fill"/><path d="m454.38 272.56q-1.4062-0.4427-2.6042-0.4427-0.61198 0-1.1068 0.19531-0.48177 0.19531-0.83333 0.54687-0.33855 0.35157-0.53386 0.85938-0.18229 0.49479-0.18229 1.1068t0.18229 1.1198q0.19531 0.49479 0.54688 0.85937 0.35156 0.36459 0.84635 0.5599 0.50782 0.19531 1.1328 0.19531 1.1849 0 2.5-0.44271l0.52083 3.724q-1.0026 0.52083-1.9661 0.6901-0.95053 0.16927-2.0703 0.16927-1.5755 0-2.9036-0.49479t-2.2917-1.3932-1.5104-2.1615q-0.53385-1.276-0.53385-2.8255t0.58594-2.8125q0.58593-1.276 1.5755-2.1745 1.0026-0.91146 2.3177-1.4062 1.3151-0.4948 2.7604-0.4948 0.63802 0 1.1458 0.0521 0.52084 0.0391 0.98959 0.16927 0.46875 0.11718 0.9375 0.32552 0.46875 0.20833 1.0156 0.53385z" style="paint-order:stroke markers fill"/><path d="m461.18 274.8q0 0.72917 0.20833 1.276 0.22136 0.54688 0.57292 0.91146 0.35157 0.36459 0.80729 0.54688 0.45573 0.18229 0.92449 0.18229 0.46875 0 0.91145-0.18229 0.45573-0.18229 0.8073-0.54688 0.36458-0.36458 0.57291-0.91146 0.22136-0.54687 0.22136-1.276t-0.22136-1.276q-0.20833-0.54688-0.57291-0.89844-0.35157-0.36458-0.8073-0.54688-0.4427-0.18229-0.91145-0.18229-0.46876 0-0.92449 0.18229-0.45572 0.1823-0.80729 0.54688-0.35156 0.35156-0.57292 0.89844-0.20833 0.54687-0.20833 1.276zm-5.2083 0q0.0651-1.6797 0.69011-2.9557 0.63802-1.276 1.6797-2.1484 1.0417-0.8724 2.4088-1.3151 1.3802-0.44271 2.9297-0.44271 1.6927 0 3.099 0.50782 1.4062 0.50781 2.4219 1.4193 1.0156 0.89844 1.5755 2.1615 0.55989 1.263 0.55989 2.7734 0 1.224-0.32552 2.2136-0.3125 0.98958-0.85937 1.7578-0.54688 0.75521-1.2891 1.3151-0.74219 0.55989-1.6016 0.92448-0.85938 0.35156-1.7839 0.52083-0.91146 0.16927-1.8229 0.16927-1.7188 0-3.138-0.49479-1.4062-0.50781-2.4219-1.4193t-1.5755-2.1745q-0.54688-1.276-0.54688-2.8125z" style="paint-order:stroke markers fill"/><path d="m488.16 271.26q0.54688-1.6536 1.7578-2.487 1.2109-0.83334 3.138-0.83334 1.0938 0 2.0182 0.50782 0.92448 0.50781 1.6016 1.4193 0.67708 0.91146 1.0547 2.1745 0.3776 1.263 0.3776 2.7865v6.6667h-5.625v-6.6667q0-0.55989-0.13021-1.0286-0.11718-0.48178-0.35156-0.83334-0.23437-0.35156-0.57292-0.54687-0.33854-0.19532-0.76823-0.19532-0.55989 0-0.96354 0.26042-0.40364 0.2474-0.66406 0.63802-0.26042 0.37761-0.39063 0.84636-0.11718 0.45573-0.11718 0.85937v6.6667h-5.5729v-6.6667q0-0.54687-0.13021-1.0156-0.11718-0.48178-0.36458-0.83334-0.23438-0.35156-0.58594-0.54687-0.35156-0.20834-0.79427-0.20834-0.48177 0-0.8724 0.19532-0.3776 0.19531-0.65104 0.54687-0.27344 0.33854-0.42969 0.79427-0.14323 0.45573-0.15625 0.96355v6.7708h-5.625v-13.164h5.625v2.7214q0.74219-1.6536 1.875-2.3828 1.1458-0.72917 2.6823-0.72917 0.74219 0 1.4323 0.19532 0.69011 0.18229 1.2891 0.58593 0.61198 0.40365 1.0938 1.0417 0.49479 0.625 0.82031 1.4974z" style="paint-order:stroke markers fill"/></g></g></svg>',
326  close:
327    '<span class="atcb-icon-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path d="M2.321 13.529a7.927 7.927 0 0 1 0-11.208 7.927 7.927 0 0 1 11.208 0l86.471 86.471L186.47 2.321a7.927 7.927 0 0 1 11.209 0 7.927 7.927 0 0 1 0 11.208l-86.474 86.469 86.472 86.473a7.927 7.927 0 0 1-11.209 11.208l-86.471-86.471-86.469 86.471a7.927 7.927 0 0 1-11.208-11.208l86.471-86.473z"/></svg></span>',
328  location:
329    '<span class="atcb-icon-location"><svg viewBox="0 0 200 266.42" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="m148.54 230.43c-12.12 13.291-26.234 25.193-42.083 34.82-1.9513 1.431-4.5964 1.6044-6.7645 0.21681-23.416-14.895-43.08-32.782-58.539-52.23-21.334-26.755-34.755-56.414-39.351-84.99-4.6831-28.966-0.30354-56.848 14.114-79.505 5.6805-8.9543 12.944-17.106 21.79-24.153 20.337-16.196 43.557-24.76 66.713-24.586 22.288 0.17345 44.295 8.4773 63.309 25.844 6.6778 6.0707 12.293 13.03 16.89 20.575 15.502 25.54 18.841 58.105 12.033 91.104-6.7212 32.608-23.416 65.737-48.11 92.839zm-48.544-178.91c27.492 0 49.758 22.288 49.758 49.758 0 27.492-22.288 49.758-49.758 49.758-27.492 0-49.758-22.267-49.758-49.758-0.02168-27.492 22.267-49.758 49.758-49.758z" stroke-width="2.1681"/></svg></span>',
330  warning:
331    '<span class="atcb-icon-warning"><svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="m100 0c27.613 0 52.613 11.195 70.711 29.293 18.094 18.094 29.289 43.098 29.289 70.707 0 27.613-11.195 52.613-29.289 70.711-18.098 18.094-43.098 29.289-70.711 29.289-27.609 0-52.613-11.195-70.707-29.289-18.098-18.098-29.293-43.098-29.293-70.711 0-27.609 11.195-52.613 29.293-70.707 18.094-18.098 43.098-29.293 70.707-29.293zm57.66 42.34c-14.758-14.754-35.145-23.883-57.66-23.883-22.516 0-42.902 9.1289-57.66 23.883-14.754 14.758-23.883 35.145-23.883 57.66 0 22.516 9.1289 42.902 23.883 57.66 14.758 14.754 35.145 23.883 57.66 23.883 22.516 0 42.902-9.1289 57.66-23.883 14.754-14.758 23.883-35.145 23.883-57.66 0-22.516-9.1289-42.902-23.883-57.66z" fill="#f44336" fill-rule="nonzero" stroke-width=".39062"/><g transform="matrix(3.8384 0 0 3.8384 2277.8 -576.85)" style="shape-inside:url(#rect7396);white-space:pre" aria-label="!"><path d="m-563.8 161.59-0.65341 20.185h-5.8381l-0.65341-20.185zm-3.5796 29.503q-1.5199 0-2.6136-1.0795-1.0796-1.0796-1.0796-2.6136 0-1.5057 1.0796-2.571 1.0938-1.0796 2.6136-1.0796 1.4631 0 2.571 1.0796 1.1222 1.0653 1.1222 2.571 0 1.0227-0.52557 1.8608-0.51137 0.83807-1.3494 1.3352-0.82387 0.49715-1.8182 0.49715z"/></g></svg></span>',
332  checkmark:
333    '<span class="atcb-icon-checkmark"><svg viewBox="0 0 122.88 122.87" xmlns="http://www.w3.org/2000/svg"><path fill:#39B54A; d="m33.666 50.046s6.0748-0.59297 17.413 4.2983c9.3883 4.5751 11.891 8.3955 11.891 8.3955 5.38-8.65 11.11-16.6 17.16-23.9 10.412-12.578 24.613-22.448 24.613-22.448l14.257-0.012228s-19.308 19.294-32.483 38.51c-13.175 19.216-22.877 41.21-22.877 41.21s-9.3948-18.164-14.53-24.53-10.77-11.59-17.52-16.22z" fill="#45b555"/><path fill:#3C3C3C; d="m61.44 0c9.53 0 18.55 2.17 26.61 6.04-3.3 2.61-6.36 5.11-9.21 7.53-5.43-1.97-11.28-3.05-17.39-3.05-14.06 0-26.79 5.7-36 14.92s-14.92 21.94-14.92 36 5.7 26.78 14.92 36 21.94 14.92 36 14.92 26.79-5.7 36-14.92c9.22-9.22 14.91-21.94 14.91-36 0-3.34-0.32-6.62-0.94-9.78 2.64-3.44 5.35-6.88 8.11-10.28 2.17 6.28 3.35 13.04 3.35 20.06 0 16.96-6.88 32.33-17.99 43.44-11.12 11.12-26.48 18-43.44 18s-32.32-6.88-43.44-18c-11.13-11.12-18.01-26.48-18.01-43.44 0-16.97 6.88-32.33 17.99-43.44 11.12-11.12 26.48-18 43.45-18z"/></svg></span>',
334};
335
336
337function atcb_patch_config(configData) {
338  if (configData.event != null) {
339    Object.keys(configData.event).forEach((key) => {
340      if (key.charAt(0) !== '@') {
341        configData[`${key}`] = configData.event[`${key}`];
342      }
343    });
344    delete configData.event;
345  }
346  const keyChanges = {
347    title: 'name',
348    dateStart: 'startDate',
349    dateEnd: 'endDate',
350    timeStart: 'startTime',
351    timeEnd: 'endTime',
352  };
353  Object.keys(keyChanges).forEach((key) => {
354    if (configData[keyChanges[`${key}`]] == null && configData[`${key}`] != null) {
355      configData[keyChanges[`${key}`]] = configData[`${key}`];
356    }
357  });
358  return configData;
359}
360function atcb_decorate_data(data) {
361  data = atcb_decorate_data_identifier(data);
362  data.subscribe = atcb_decorate_data_subscribe(data);
363  data = atcb_decorate_data_rrule(data);
364  data = atcb_decorate_data_options(data);
365  data.richData = atcb_decorate_data_rich_data(data);
366  data.checkmark = atcb_decorate_data_checkmark(data);
367  data.background = atcb_decorate_data_background(data);
368  data.mindScrolling = atcb_decorate_data_mind_scrolling(data);
369  data.branding = atcb_decorate_data_branding(data);
370  data = atcb_decorate_data_style(data);
371  data = atcb_decorate_data_i18n(data);
372  data = atcb_decorate_data_dates(data);
373  data = atcb_decorate_data_meta(data);
374  data = atcb_decorate_data_extend(data);
375  return data;
376}
377function atcb_decorate_data_identifier(data) {
378  if (data.identifier != null && data.identifier != '') {
379    data.identifier = 'atcb-btn-' + data.identifier;
380    if (!/^[\w-]+$/.test(data.identifier)) {
381      data.identifier = '';
382      console.warn('Add to Calendar Button generation: identifier invalid - using auto numbers instead');
383    }
384  }
385  return data;
386}
387function atcb_decorate_data_subscribe(data) {
388  if (data.subscribe != null && data.subscribe == true) {
389    return true;
390  }
391  return false;
392}
393function atcb_decorate_data_rrule(data) {
394  if (data.recurrence != null && data.recurrence != '') {
395    data.recurrence = data.recurrence.replace(/\s+/g, '').toUpperCase();
396    if (!/^(RRULE:[\w=;,:+-/\\]+|daily|weekly|monthly|yearly)$/im.test(data.recurrence)) {
397      data.recurrence = '!wrong rrule format!';
398    } else {
399      if (/^RRULE:/i.test(data.recurrence)) {
400        const rruleParts = data.recurrence.substr(6).split(';');
401        const rruleObj = new Object();
402        rruleParts.forEach(function (rule) {
403          rruleObj[rule.split('=')[0]] = rule.split('=')[1];
404        });
405        data.recurrence_until = rruleObj.UNTIL ? rruleObj.UNTIL : '';
406        data.recurrence_count = rruleObj.COUNT ? rruleObj.COUNT : '';
407        data.recurrence_byDay = rruleObj.BYDAY ? rruleObj.BYDAY : '';
408        data.recurrence_byMonth = rruleObj.BYMONTH ? rruleObj.BYMONTH : '';
409        data.recurrence_byMonthDay = rruleObj.BYMONTHDAY ? rruleObj.BYMONTHDAY : '';
410        data.recurrence_interval = rruleObj.INTERVAL ? rruleObj.INTERVAL : 1;
411        data.recurrence_frequency = rruleObj.FREQ ? rruleObj.FREQ : '';
412      } else {
413        if (data.recurrence_interval == null || data.recurrence_interval == '') {
414          data.recurrence_interval = 1;
415        }
416        if (
417          data.recurrence_weekstart == null ||
418          (data.recurrence_weekstart == '') | (data.recurrence_weekstart.length > 2)
419        ) {
420          data.recurrence_weekstart = 'MO';
421        }
422        data.recurrence_frequency = data.recurrence;
423        data.recurrence =
424          'RRULE:FREQ=' +
425          data.recurrence +
426          ';WKST=' +
427          data.recurrence_weekstart +
428          ';INTERVAL=' +
429          data.recurrence_interval;
430        if (data.recurrence_until != null && data.recurrence_until != '') {
431          if (data.endTime != null && data.endTime != '') {
432            data.recurrence =
433              data.recurrence +
434              ';UNTIL=' +
435              data.recurrence_until.replace(/-/g, '').slice(0, 8) +
436              'T' +
437              data.endTime.replace(':', '') +
438              '00';
439          } else {
440            data.recurrence =
441              data.recurrence + ';UNTIL=' + data.recurrence_until.replace(/-/g, '').slice(0, 8);
442          }
443        }
444        if (data.recurrence_count != null && data.recurrence_count != '') {
445          data.recurrence = data.recurrence + ';COUNT=' + data.recurrence_count;
446        }
447        if (data.recurrence_byDay != null && data.recurrence_byDay != '') {
448          data.recurrence = data.recurrence + ';BYDAY=' + data.recurrence_byDay;
449        }
450        if (data.recurrence_byMonth != null && data.recurrence_byMonth != '') {
451          data.recurrence = data.recurrence + ';BYMONTH=' + data.recurrence_byMonth;
452        }
453        if (data.recurrence_byMonthDay != null && data.recurrence_byMonthDay != '') {
454          data.recurrence = data.recurrence + ';BYMONTHDAY=' + data.recurrence_byMonthDay;
455        }
456      }
457    }
458  }
459  return data;
460}
461function atcb_decorate_data_options(data) {
462  if (isiOS() && data.options.includes('ical') && !data.options.includes('apple')) {
463    data.options.push('apple');
464  }
465  const newOptions = [];
466  data.optionLabels = [];
467  for (let i = 0; i < data.options.length; i++) {
468    const cleanOption = data.options[`${i}`].split('|');
469    const optionName = cleanOption[0].toLowerCase().replace('microsoft', 'ms').replace('.', '');
470    const optionLabel = (function () {
471      if (cleanOption[1] != null) {
472        return cleanOption[1];
473      }
474      return '';
475    })();
476    if (
477      (isiOS() && atcbiOSInvalidOptions.includes(optionName)) ||
478      (data.recurrence != null &&
479        data.recurrence != '' &&
480        (!atcbValidRecurrOptions.includes(optionName) ||
481          (data.recurrence_until != null &&
482            data.recurrence_until != '' &&
483            (optionName == 'apple' || optionName == 'ical')))) ||
484      (data.subscribe && atcbInvalidSubscribeOptions.includes(optionName))
485    ) {
486      continue;
487    }
488    newOptions.push(optionName);
489    data.optionLabels.push(optionLabel);
490  }
491  data.options = newOptions;
492  return data;
493}
494function atcb_decorate_data_rich_data(data) {
495  if (data.richData != null && data.richData == false) {
496    return false;
497  }
498  return true;
499}
500function atcb_decorate_data_checkmark(data) {
501  if (data.checkmark != null && data.checkmark == false) {
502    return false;
503  }
504  return true;
505}
506function atcb_decorate_data_background(data) {
507  if (data.background != null && data.background == false) {
508    return false;
509  }
510  return true;
511}
512function atcb_decorate_data_branding(data) {
513  if (data.branding != null && data.branding == false) {
514    return false;
515  }
516  return false;
517}
518function atcb_decorate_data_mind_scrolling(data) {
519  if (data.mindScrolling != null && data.mindScrolling == true) {
520    return true;
521  }
522  return false;
523}
524function atcb_decorate_data_style(data) {
525  if (data.listStyle == null || data.listStyle == '') {
526    data.listStyle = 'dropdown';
527  }
528  if (data.listStyle === 'modal') {
529    data.trigger = 'click';
530  }
531  if (data.buttonStyle != null && data.buttonStyle != '' && data.buttonStyle != 'default') {
532    if (data.buttonStyle == 'bubble' || data.buttonStyle == 'text' || data.buttonStyle == 'date') {
533      data.trigger = 'click';
534    }
535    if (data.buttonStyle == 'date' && data.listStyle == 'dropdown') {
536      data.listStyle = 'overlay';
537    }
538  } else {
539    data.buttonStyle = '';
540  }
541  data.sizes = [];
542  data.sizes['l'] = data.sizes['m'] = data.sizes['s'] = 16;
543  if (data.size != null && data.size != '') {
544    const sizeParts = data.size.split('|');
545    for (let i = 0; i < sizeParts.length; i++) {
546      sizeParts[`${i}`] = parseInt(sizeParts[`${i}`]);
547    }
548    if (sizeParts[0] >= 0 && sizeParts[0] < 11) {
549      data.sizes['l'] = 10 + sizeParts[0];
550    }
551    if (sizeParts.length > 2) {
552      if (sizeParts[1] >= 0 && sizeParts[1] < 11) {
553        data.sizes['m'] = 10 + sizeParts[1];
554      }
555      if (sizeParts[2] >= 0 && sizeParts[2] < 11) {
556        data.sizes['s'] = 10 + sizeParts[2];
557      }
558    } else if (sizeParts.length == 2) {
559      if (sizeParts[1] >= 0 && sizeParts[1] < 11) {
560        data.sizes['m'] = data.sizes['s'] = 10 + sizeParts[1];
561      }
562    }
563  }
564  if (data.lightMode == null || data.lightMode == '') {
565    data.lightMode = 'light';
566  } else if (data.lightMode != null && data.lightMode != '') {
567    const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
568    switch (data.lightMode) {
569      case 'system':
570        if (prefersDarkScheme.matches) {
571          data.lightMode = 'dark';
572        } else {
573          data.lightMode = 'light';
574        }
575        break;
576      case 'bodyScheme':
577      case 'dark':
578        break;
579      default:
580        data.lightMode = 'light';
581        break;
582    }
583  }
584  data.iconButton = true;
585  data.iconList = true;
586  data.iconModal = true;
587  if (data.icons != null) {
588    data.icons = String(data.icons);
589    if (data.icons != '') {
590      const iconsConfig = data.icons.split('|');
591      if (iconsConfig[0] == 'false') {
592        data.iconButton = false;
593      }
594      if (iconsConfig[1] != null && iconsConfig[1] == 'false') {
595        data.iconList = false;
596      }
597      if (iconsConfig[2] != null && iconsConfig[2] == 'false') {
598        data.iconModal = false;
599      }
600    }
601  }
602  data.textLabelButton = true;
603  data.textLabelList = true;
604  if (data.textLabels != null) {
605    data.textLabels = String(data.textLabels);
606    if (data.textLabels != '') {
607      const textLabelsConfig = data.textLabels.split('|');
608      if (textLabelsConfig[0] == 'false') {
609        data.textLabelButton = false;
610      }
611      if (textLabelsConfig[1] != null && textLabelsConfig[1] == 'false') {
612        data.textLabelList = false;
613      }
614    }
615  }
616  return data;
617}
618function atcb_decorate_data_i18n(data) {
619  if (data.language == null || data.language == '') {
620    data.language = 'en';
621  }
622  if (data.language == 'ar') {
623    data.rtl = true;
624  } else {
625    data.rtl = false;
626  }
627  return data;
628}
629function atcb_decorate_data_dates(data) {
630  if (data.dates != null && data.dates.length > 0) {
631    for (let i = 0; i < data.dates.length; i++) {
632      if (data.dates[`${i}`].timeZone == null && data.timeZone != null) {
633        data.dates[`${i}`].timeZone = data.timeZone;
634      }
635      const cleanedUpDates = atcb_date_cleanup(data.dates[`${i}`]);
636      data.dates[`${i}`].startTime = cleanedUpDates.startTime;
637      data.dates[`${i}`].endTime = cleanedUpDates.endTime;
638      data.dates[`${i}`].timeZone = cleanedUpDates.timeZone;
639      data.dates[`${i}`].timestamp = cleanedUpDates.startTimestamp;
640      data.dates[`${i}`].startDate = atcb_date_calculation(cleanedUpDates.startDate);
641      data.dates[`${i}`].endDate = atcb_date_calculation(cleanedUpDates.endDate);
642    }
643  } else {
644    const cleanedUpDates = atcb_date_cleanup(data);
645    data.dates = [];
646    data.dates[0] = new Object();
647    data.startTime = data.dates[0].startTime = cleanedUpDates.startTime;
648    data.endTime = data.dates[0].endTime = cleanedUpDates.endTime;
649    data.timeZone = data.dates[0].timeZone = cleanedUpDates.timeZone;
650    data.startDate = data.dates[0].startDate = atcb_date_calculation(cleanedUpDates.startDate);
651    data.endDate = data.dates[0].endDate = atcb_date_calculation(cleanedUpDates.endDate);
652  }
653  const now = new Date();
654  if (data.created == null || data.created == '') {
655    data.created = atcb_format_datetime(now, 'clean', true);
656  }
657  if (data.updated == null || data.updated == '') {
658    data.updated = atcb_format_datetime(now, 'clean', true);
659  }
660  return data;
661}
662function atcb_decorate_data_meta(data) {
663  if (data.status == null || data.status == '') {
664    data.status = 'CONFIRMED';
665  }
666  if (data.sequence == null || data.sequence == '') {
667    data.sequence = 0;
668  }
669  return data;
670}
671function atcb_decorate_data_description(data, i) {
672  if (data.dates[`${i}`].description != null && data.dates[`${i}`].description != '') {
673    data.dates[`${i}`].descriptionHtmlFree = atcb_rewrite_html_elements(data.dates[`${i}`].description, true);
674    data.dates[`${i}`].description = atcb_rewrite_html_elements(data.dates[`${i}`].description);
675  } else {
676    if (data.dates[`${i}`].description == null && data.description != null && data.description != '') {
677      data.dates[`${i}`].descriptionHtmlFree = atcb_rewrite_html_elements(data.description, true);
678      data.dates[`${i}`].description = atcb_rewrite_html_elements(data.description);
679    } else {
680      data.dates[`${i}`].descriptionHtmlFree = data.dates[`${i}`].description = '';
681    }
682  }
683  return data;
684}
685function atcb_decorate_data_extend(data) {
686  for (let i = 0; i < data.dates.length; i++) {
687    data = atcb_decorate_data_description(data, i);
688    if (data.dates[`${i}`].name == null || data.dates[`${i}`].name == '') {
689      data.dates[`${i}`].name = data.name;
690    }
691    if (data.dates[`${i}`].status == null) {
692      data.dates[`${i}`].status = data.status.toUpperCase();
693    } else {
694      data.dates[`${i}`].status = data.dates[`${i}`].status.toUpperCase();
695    }
696    if (data.dates[`${i}`].sequence == null) {
697      data.dates[`${i}`].sequence = data.sequence;
698    }
699    if (data.dates[`${i}`].location == null && data.location != null) {
700      data.dates[`${i}`].location = data.location;
701    }
702    if (data.dates[`${i}`].organizer == null && data.organizer != null) {
703      data.dates[`${i}`].organizer = data.organizer;
704    }
705    if (data.dates[`${i}`].availability == null && data.availability != null) {
706      data.dates[`${i}`].availability = data.availability.toLowerCase();
707    } else if (data.dates[`${i}`].availability != null) {
708      data.dates[`${i}`].availability = data.dates[`${i}`].availability.toLowerCase();
709    }
710    if (data.dates[`${i}`].uid == null) {
711      data.dates[`${i}`].uid = atcb_generate_uuid();
712    }
713  }
714  if (data.recurrence != null && data.recurrence != '') {
715    data.dates[0].recurrence = data.recurrence;
716  }
717  if (data.dates.length > 1) {
718    data.dates.sort((a, b) => a.timestamp - b.timestamp);
719  }
720  return data;
721}
722function atcb_date_cleanup(dateTimeData) {
723  if (dateTimeData.endDate == null || dateTimeData.endDate == '') {
724    dateTimeData.endDate = dateTimeData.startDate;
725  }
726  const endpoints = ['start', 'end'];
727  endpoints.forEach(function (point) {
728    if (dateTimeData[point + 'Date'] != null) {
729      dateTimeData[point + 'Date'] = dateTimeData[point + 'Date'].replace(/\.\d{3}/, '').replace('Z', '');
730      const tmpSplitStartDate = dateTimeData[point + 'Date'].split('T');
731      if (tmpSplitStartDate[1] != null) {
732        dateTimeData[point + 'Date'] = tmpSplitStartDate[0];
733        dateTimeData[point + 'Time'] = tmpSplitStartDate[1];
734      }
735    }
736    if (dateTimeData[point + 'Time'] != null && dateTimeData[point + 'Time'].length === 8) {
737      const timeStr = dateTimeData[point + 'Time'];
738      dateTimeData[point + 'Time'] = timeStr.substring(0, timeStr.length - 3);
739    }
740    if (dateTimeData.timeZone == 'currentBrowser') {
741      dateTimeData.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
742    }
743    let tmpDate;
744    if (dateTimeData[point + 'Time'] != null) {
745      tmpDate = new Date(dateTimeData[point + 'Date'] + ' ' + dateTimeData[point + 'Time']);
746    } else {
747      tmpDate = new Date(dateTimeData[point + 'Date']);
748    }
749    dateTimeData[point + 'Timestamp'] = tmpDate.getTime();
750  });
751  return dateTimeData;
752}
753function atcb_date_calculation(dateString) {
754  const today = new Date();
755  const todayString = today.getUTCFullYear() + '-' + (today.getUTCMonth() + 1) + '-' + today.getUTCDate();
756  dateString = dateString.replace(/today/gi, todayString);
757  const dateStringParts = dateString.split('+');
758  const dateParts = dateStringParts[0].split('-');
759  let newDate = (function () {
760    if (dateParts[0].length < 4) {
761      return new Date(Date.UTC(dateParts[2], dateParts[0] - 1, dateParts[1]));
762    }
763    return new Date(Date.UTC(dateParts[0], dateParts[1] - 1, dateParts[2]));
764  })();
765  if (dateStringParts[1] != null && dateStringParts[1] > 0) {
766    newDate.setDate(newDate.getDate() + parseInt(dateStringParts[1]));
767  }
768  return newDate.toISOString().replace(/T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g, '');
769}
770
771
772function atcb_check_required(data) {
773  if (data.options == null || data.options.length < 1) {
774    console.error('Add to Calendar Button generation failed: no valid options set');
775    return false;
776  }
777  if (data.name == null || data.name == '') {
778    console.error('Add to Calendar Button generation failed: required name information missing');
779    return false;
780  }
781  if (data.dates != null && data.dates.length > 0) {
782    const requiredMultiField = ['name', 'startDate'];
783    const requiredMultiFieldFlex = ['name'];
784    return requiredMultiField.every(function (field) {
785      for (let i = 0; i < data.dates.length; i++) {
786        if (
787          (!requiredMultiFieldFlex.includes(`${field}`) &&
788            (data.dates[`${i}`][`${field}`] == null || data.dates[`${i}`][`${field}`] == '')) ||
789          (requiredMultiFieldFlex.includes(`${field}`) &&
790            (data.dates[`${i}`][`${field}`] == null || data.dates[`${i}`][`${field}`] == '') &&
791            (data[`${field}`] == null || data[`${field}`] == ''))
792        ) {
793          console.error(
794            'Add to Calendar Button generation failed: required setting missing [dates array object #' +
795              (i + 1) +
796              '/' +
797              data.dates.length +
798              '] => [' +
799              field +
800              ']'
801          );
802          return false;
803        }
804      }
805      return true;
806    });
807  } else {
808    const requiredSingleField = ['startDate'];
809    return requiredSingleField.every(function (field) {
810      if (data[`${field}`] == null || data[`${field}`] == '') {
811        console.error('Add to Calendar Button generation failed: required setting missing [' + field + ']');
812        return false;
813      }
814      return true;
815    });
816  }
817}
818function atcb_validate(data) {
819  const msgPrefix = 'Add to Calendar Button generation (' + data.identifier + ')';
820  if (!atcb_validate_icsFile(data, msgPrefix)) return false;
821  if (!atcb_validate_subscribe(data, msgPrefix)) return false;
822  if (!atcb_validate_created(data, msgPrefix)) return false;
823  if (!atcb_validate_updated(data, msgPrefix)) return false;
824  if (!atcb_validate_options(data, msgPrefix)) return false;
825  if (!atcb_validate_date_blocks(data, msgPrefix)) return false;
826  if (!atcb_validate_rrule(data, msgPrefix)) return false;
827  return true;
828}
829function atcb_validate_icsFile(data, msgPrefix, i = '', msgSuffix = '') {
830  const icsFileStr = (function () {
831    if (i != '' && data.dates[`${i}`].icsFile != null) {
832      return data.dates[`${i}`].icsFile;
833    }
834    if (i == '' && data.icsFile != null) {
835      return data.icsFile;
836    }
837    return '';
838  })();
839  if (icsFileStr != '') {
840    if (
841      !atcb_secure_url(icsFileStr, false) ||
842      (!/^https:\/\/(.)*\.ics$/m.test(data.icsFile) && !data.subscribe) ||
843      (!data.icsFile.startsWith('https://') && data.subscribe)
844    ) {
845      console.error(msgPrefix + ' failed: explicit ics file path not valid' + msgSuffix);
846      return false;
847    }
848  }
849  return true;
850}
851function atcb_validate_subscribe(data, msgPrefix) {
852  if (data.subscribe == true && (data.icsFile == null || data.icsFile == '')) {
853    console.error(msgPrefix + ' failed: a subscription calendar requires a valid explicit ics file as well');
854    return false;
855  }
856  return true;
857}
858function atcb_validate_created(data, msgPrefix) {
859  if (!/^\d{8}T\d{6}Z$/.test(data.created)) {
860    console.error(
861      msgPrefix +
862        ' failed: created date format not valid. Needs to be a full ISO-8601 UTC date and time string, formatted YYYYMMDDTHHMMSSZ'
863    );
864    return false;
865  }
866  return true;
867}
868function atcb_validate_updated(data, msgPrefix) {
869  if (!/^\d{8}T\d{6}Z$/.test(data.updated)) {
870    console.error(
871      msgPrefix +
872        ' failed: updated date format not valid. Needs to be a full ISO-8601 UTC date and time string, formatted YYYYMMDDTHHMMSSZ'
873    );
874    return false;
875  }
876  return true;
877}
878function atcb_validate_options(data, msgPrefix) {
879  if (
880    !data.options.every(function (option) {
881      if (!atcbOptions.includes(option)) {
882        console.error(msgPrefix + ' failed: invalid option [' + option + ']');
883        return false;
884      }
885      return true;
886    })
887  ) {
888    return false;
889  }
890  return true;
891}
892function atcb_validate_date_blocks(data, msgPrefix) {
893  for (let i = 0; i < data.dates.length; i++) {
894    const msgSuffix = (function () {
895      if (data.dates.length == 1) {
896        return '';
897      } else {
898        return ' [dates array object #' + (i + 1) + '/' + data.dates.length + '] ';
899      }
900    })();
901    if (!atcb_validate_icsFile(data, msgPrefix, i, msgSuffix)) return false;
902    if (!atcb_validate_status(data, msgPrefix, i, msgSuffix)) return false;
903    if (!atcb_validate_availability(data, msgPrefix, i, msgSuffix)) return false;
904    if (!atcb_validate_organizer(data, msgPrefix, i, msgSuffix)) return false;
905    if (!atcb_validate_uid(data, msgPrefix, i, msgSuffix)) return false;
906    if (!atcb_validate_sequence(data, msgPrefix, i, msgSuffix)) return false;
907    if (!atcb_validate_timezone(data, msgPrefix, i, msgSuffix)) return false;
908    if (!atcb_validate_datetime(data, msgPrefix, i, msgSuffix)) return false;
909  }
910  return true;
911}
912function atcb_validate_status(data, msgPrefix, i, msgSuffix) {
913  if (
914    data.dates[`${i}`].status != 'TENTATIVE' &&
915    data.dates[`${i}`].status != 'CONFIRMED' &&
916    data.dates[`${i}`].status != 'CANCELLED'
917  ) {
918    console.error(
919      msgPrefix + ' failed: event status needs to be TENTATIVE, CONFIRMED, or CANCELLED' + msgSuffix
920    );
921    return false;
922  }
923  return true;
924}
925function atcb_validate_availability(data, msgPrefix, i, msgSuffix) {
926  if (
927    data.dates[`${i}`].availability != null &&
928    data.dates[`${i}`].availability != '' &&
929    data.dates[`${i}`].availability != 'free' &&
930    data.dates[`${i}`].availability != 'busy'
931  ) {
932    console.error(msgPrefix + ' failed: event availability needs to be "free" or "busy"' + msgSuffix);
933    return false;
934  }
935  return true;
936}
937function atcb_validate_organizer(data, msgPrefix, i, msgSuffix) {
938  if (data.dates[`${i}`].organizer != null && data.dates[`${i}`].organizer != '') {
939    const organizerParts = data.dates[`${i}`].organizer.split('|');
940    if (
941      organizerParts.length != 2 ||
942      organizerParts[0].length > 50 ||
943      organizerParts[1].length > 80 ||
944      !atcb_validEmail(organizerParts[1])
945    ) {
946      console.error(
947        msgPrefix +
948          ' failed: organizer needs to match the schema "NAME|EMAIL" with a valid email address' +
949          msgSuffix
950      );
951      return false;
952    }
953  }
954  return true;
955}
956function atcb_validate_uid(data, msgPrefix, i, msgSuffix) {
957  if (!/^(\w|-){1,254}$/.test(data.dates[`${i}`].uid)) {
958    console.warn(
959      msgPrefix +
960        ': UID not valid. May only contain alpha, digits, and dashes; and be less than 255 characters. Falling back to an automated value!' +
961        msgSuffix
962    );
963    data.dates[`${i}`].uid = atcb_generate_uuid();
964  }
965  if (
966    !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(
967      data.dates[`${i}`].uid
968    )
969  ) {
970    console.warn(
971      msgPrefix +
972        ': UID is highly recommended to be a hex-encoded random Universally Unique Identifier (UUID)!' +
973        msgSuffix
974    );
975  }
976  return true;
977}
978function atcb_validate_sequence(data, msgPrefix, i, msgSuffix) {
979  if (!/^\d+$/.test(data.dates[`${i}`].sequence)) {
980    console.log(msgPrefix + ': sequence needs to be a number. Used the default 0 instead' + msgSuffix);
981    data.dates[`${i}`].sequence = 0;
982  }
983  return true;
984}
985function atcb_validate_timezone(data, msgPrefix, i, msgSuffix) {
986  if (data.dates[`${i}`].timeZone != null && data.dates[`${i}`].timeZone != '') {
987    const validTimeZones = tzlib_get_timezones();
988    if (!validTimeZones.includes(data.dates[`${i}`].timeZone)) {
989      console.error(msgPrefix + ' failed: invalid time zone given' + msgSuffix);
990      return false;
991    }
992  }
993  return true;
994}
995function atcb_validate_datetime(data, msgPrefix, i, msgSuffix) {
996  const dates = ['startDate', 'endDate'];
997  const newDate = dates;
998  if (
999    !dates.every(function (date) {
1000      if (data.dates[`${i}`][`${date}`].length !== 10) {
1001        console.error(msgPrefix + ' failed: date misspelled [-> YYYY-MM-DD]' + msgSuffix);
1002        return false;
1003      }
1004      const dateParts = data.dates[`${i}`][`${date}`].split('-');
1005      if (dateParts.length < 3 || dateParts.length > 3) {
1006        console.error(
1007          msgPrefix +
1008            ' failed: date misspelled [' +
1009            date +
1010            ': ' +
1011            data.dates[`${i}`][`${date}`] +
1012            ']' +
1013            msgSuffix
1014        );
1015        return false;
1016      }
1017      newDate[`${date}`] = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
1018      return true;
1019    })
1020  ) {
1021    return false;
1022  }
1023  const times = ['startTime', 'endTime'];
1024  if (
1025    !times.every(function (time) {
1026      if (data.dates[`${i}`][`${time}`] != null) {
1027        if (data.dates[`${i}`][`${time}`].length !== 5) {
1028          console.error(msgPrefix + ' failed: time misspelled [-> HH:MM]' + msgSuffix);
1029          return false;
1030        }
1031        const timeParts = data.dates[`${i}`][`${time}`].split(':');
1032        if (timeParts.length < 2 || timeParts.length > 2) {
1033          console.error(
1034            msgPrefix +
1035              ' failed: time misspelled [' +
1036              time +
1037              ': ' +
1038              data.dates[`${i}`][`${time}`] +
1039              ']' +
1040              msgSuffix
1041          );
1042          return false;
1043        }
1044        if (timeParts[0] > 23) {
1045          console.error(
1046            msgPrefix +
1047              ' failed: time misspelled - hours number too high [' +
1048              time +
1049              ': ' +
1050              timeParts[0] +
1051              ']' +
1052              msgSuffix
1053          );
1054          return false;
1055        }
1056        if (timeParts[1] > 59) {
1057          console.error(
1058            msgPrefix +
1059              ' failed: time misspelled - minutes number too high [' +
1060              time +
1061              ': ' +
1062              timeParts[1] +
1063              ']' +
1064              msgSuffix
1065          );
1066          return false;
1067        }
1068        if (time == 'startTime') {
1069          newDate.startDate = new Date(
1070            newDate.startDate.getTime() + timeParts[0] * 3600000 + timeParts[1] * 60000
1071          );
1072        }
1073        if (time == 'endTime') {
1074          newDate.endDate = new Date(
1075            newDate.endDate.getTime() + timeParts[0] * 3600000 + timeParts[1] * 60000
1076          );
1077        }
1078      }
1079      return true;
1080    })
1081  ) {
1082    return false;
1083  }
1084  if (
1085    (data.dates[`${i}`].startTime != null && data.dates[`${i}`].endTime == null) ||
1086    (data.dates[`${i}`].startTime == null && data.dates[`${i}`].endTime != null)
1087  ) {
1088    console.error(
1089      msgPrefix + ' failed: if you set a starting time, you also need to define an end time' + msgSuffix
1090    );
1091    return false;
1092  }
1093  if (newDate.endDate < newDate.startDate) {
1094    console.error(msgPrefix + ' failed: end date before start date' + msgSuffix);
1095    return false;
1096  }
1097  return true;
1098}
1099function atcb_validate_rrule(data, msgPrefix) {
1100  if (data.recurrence != null && data.recurrence != '' && data.dates.length > 1) {
1101    console.error(msgPrefix + ' failed: RRULE and multi-date set at the same time');
1102    return false;
1103  }
1104  if (data.recurrence != null && data.recurrence != '' && !/^RRULE:[\w=;,:+-/\\]+$/i.test(data.recurrence)) {
1105    console.error(msgPrefix + ' failed: RRULE data misspelled');
1106    return false;
1107  }
1108  if (
1109    data.recurrence_interval != null &&
1110    data.recurrence_interval != '' &&
1111    !/^\d+$/.test(data.recurrence_interval)
1112  ) {
1113    console.error(msgPrefix + ' failed: recurrence data (interval) misspelled');
1114    return false;
1115  }
1116  if (
1117    data.recurrence_until != null &&
1118    data.recurrence_until != '' &&
1119    !/^(\d|-|:)+$/i.test(data.recurrence_until)
1120  ) {
1121    console.error(msgPrefix + ' failed: recurrence data (until) misspelled');
1122    return false;
1123  }
1124  if (data.recurrence_count != null && data.recurrence_count != '' && !/^\d+$/.test(data.recurrence_count)) {
1125    console.error(msgPrefix + ' failed: recurrence data (interval) misspelled');
1126    return false;
1127  }
1128  if (
1129    data.recurrence_byMonth != null &&
1130    data.recurrence_byMonth != '' &&
1131    !/^(\d|,)+$/.test(data.recurrence_byMonth)
1132  ) {
1133    console.error(msgPrefix + ' failed: recurrence data (byMonth) misspelled');
1134    return false;
1135  }
1136  if (
1137    data.recurrence_byMonthDay != null &&
1138    data.recurrence_byMonthDay != '' &&
1139    !/^(\d|,)+$/.test(data.recurrence_byMonthDay)
1140  ) {
1141    console.error(msgPrefix + ' failed: recurrence data (byMonthDay) misspelled');
1142    return false;
1143  }
1144  if (
1145    data.recurrence_byDay != null &&
1146    data.recurrence_byDay != '' &&
1147    !/^(\d|-|MO|TU|WE|TH|FR|SA|SU|,)+$/im.test(data.recurrence_byDay)
1148  ) {
1149    console.error(msgPrefix + ' failed: recurrence data (byDay) misspelled');
1150    return false;
1151  }
1152  if (
1153    data.recurrence_weekstart != null &&
1154    data.recurrence_weekstart != '' &&
1155    !/^(MO|TU|WE|TH|FR|SA|SU)$/im.test(data.recurrence_weekstart)
1156  ) {
1157    console.error(msgPrefix + ' failed: recurrence data (weekstart) misspelled');
1158    return false;
1159  }
1160  return true;
1161}
1162
1163
1164function atcb_toggle(action, data = '', button = '', keyboardTrigger = false, generatedButton = false) {
1165  if (action == 'open') {
1166    atcb_open(data, button, keyboardTrigger, generatedButton);
1167  } else if (
1168    action == 'close' ||
1169    button.classList.contains('atcb-active') ||
1170    document.querySelector('.atcb-active-modal')
1171  ) {
1172    atcb_close(keyboardTrigger);
1173  } else {
1174    atcb_open(data, button, keyboardTrigger, generatedButton);
1175  }
1176}
1177function atcb_open(data, button, keyboardTrigger = false, generatedButton = false) {
1178  if (document.querySelector('.atcb-list') || document.querySelector('.atcb-modal')) return;
1179  const list = atcb_generate_dropdown_list(data);
1180  const listWrapper = document.createElement('div');
1181  listWrapper.classList.add('atcb-list-wrapper');
1182  if (data.textLabelList == false) {
1183    listWrapper.classList.add('atcb-no-text');
1184  }
1185  if (button) {
1186    button.classList.add('atcb-active');
1187    if (data.listStyle === 'modal') {
1188      button.classList.add('atcb-modal-style');
1189      list.classList.add('atcb-modal');
1190    } else {
1191      listWrapper.appendChild(list);
1192      listWrapper.classList.add('atcb-dropdown');
1193      if (data.listStyle === 'overlay') {
1194        listWrapper.classList.add('atcb-dropoverlay');
1195      }
1196      if (data.mindScrolling) {
1197        listWrapper.classList.add('atcb-mind-scrolling');
1198      }
1199    }
1200    if (generatedButton) {
1201      list.classList.add('atcb-generated-button'); 
1202    }
1203  } else {
1204    list.classList.add('atcb-modal');
1205  }
1206  const bgOverlay = atcb_generate_bg_overlay(data.listStyle, data.trigger, data.lightMode, data.background);
1207  if (data.listStyle === 'modal') {
1208    document.body.appendChild(bgOverlay);
1209    bgOverlay.appendChild(list);
1210    if (data.branding) {
1211      atcb_create_atcbl(false);
1212    }
1213    atcb_set_sizes(list, data.sizes);
1214    atcb_manage_body_scroll();
1215  } else {
1216    const positionWrapper = document.createElement('div');
1217    positionWrapper.id = 'atcb-pos-wrapper';
1218    positionWrapper.style.position = 'absolute';
1219    positionWrapper.style.top = '0';
1220    positionWrapper.style.bottom = '0';
1221    positionWrapper.style.width = '100%';
1222    document.body.appendChild(positionWrapper);
1223    positionWrapper.appendChild(listWrapper);
1224    listWrapper.appendChild(list);
1225    if (data.buttonStyle != '') {
1226      listWrapper.classList.add('atcb-style-' + data.buttonStyle);
1227    }
1228    if (data.branding) {
1229      atcb_create_atcbl();
1230    }
1231    document.body.appendChild(bgOverlay);
1232    atcb_set_sizes(list, data.sizes);
1233    listWrapper.style.display = 'none';
1234    setTimeout(function () {
1235      listWrapper.style.display = 'block';
1236      if (data.listStyle === 'dropdown-static') {
1237        atcb_position_list(button, listWrapper, true);
1238      } else {
1239        atcb_position_list(button, listWrapper);
1240      }
1241    }, 5);
1242  }
1243  atcb_set_fullsize(bgOverlay);
1244  if (keyboardTrigger) {
1245    list.firstChild.focus();
1246  } else {
1247    list.firstChild.focus({ preventScroll: true });
1248  }
1249  list.firstChild.blur();
1250}
1251function atcb_close(keyboardTrigger = false) {
1252  const allModals = document.querySelectorAll('.atcb-modal[data-modal-nr]');
1253  if (allModals.length > 1) {
1254    document.querySelectorAll('.atcb-modal[data-modal-nr="' + allModals.length + '"]')[0].remove();
1255    const nextModal = document.querySelectorAll(
1256      '.atcb-modal[data-modal-nr="' + (allModals.length - 1) + '"]'
1257    )[0];
1258    nextModal.style.display = 'block';
1259    let focusEl = nextModal;
1260    const availableButtons = nextModal.getElementsByTagName('button');
1261    if (availableButtons.length > 0) {
1262      focusEl = availableButtons[0];
1263    }
1264    focusEl.focus();
1265    if (!keyboardTrigger) {
1266      focusEl.blur();
1267    }
1268  } else {
1269    const newFocusEl = document.querySelector('.atcb-active, .atcb-active-modal');
1270    if (newFocusEl) {
1271      newFocusEl.focus({ preventScroll: true });
1272      if (!keyboardTrigger) {
1273        newFocusEl.blur();
1274      }
1275    }
1276    Array.from(document.querySelectorAll('.atcb-active')).forEach((button) => {
1277      button.classList.remove('atcb-active');
1278    });
1279    Array.from(document.querySelectorAll('.atcb-active-modal')).forEach((button) => {
1280      button.classList.remove('atcb-active-modal');
1281    });
1282    document.body.classList.remove('atcb-modal-no-scroll');
1283    Array.from(document.querySelectorAll('.atcb-list-wrapper'))
1284      .concat(Array.from(document.querySelectorAll('.atcb-list')))
1285      .concat(Array.from(document.querySelectorAll('.atcb-modal[data-modal-nr]')))
1286      .concat(Array.from(document.querySelectorAll('#add-to-calendar-button-reference')))
1287      .concat(Array.from(document.querySelectorAll('#atcb-pos-wrapper')))
1288      .concat(Array.from(document.querySelectorAll('#atcb-bgoverlay')))
1289      .forEach((el) => el.remove());
1290  }
1291}
1292
1293
1294function atcb_generate_label(data, parent, type, icon = false, text = '', oneOption = false) {
1295  switch (type) {
1296    case 'trigger':
1297    default:
1298      parent.id = data.identifier;
1299      if (data.trigger === 'click') {
1300        parent.addEventListener('click', (event) => {
1301          event.preventDefault();
1302          atcb_toggle('auto', data, parent, false, true);
1303        });
1304      } else {
1305        parent.addEventListener('touchend', (event) => {
1306          event.preventDefault();
1307          atcb_toggle('auto', data, parent, false, true);
1308        });
1309        parent.addEventListener(
1310          'mouseenter',
1311          atcb_debounce_leading((event) => {
1312            event.preventDefault();
1313            atcb_toggle('open', data, parent, false, true);
1314          })
1315        );
1316      }
1317      parent.addEventListener('keyup', function (event) {
1318        if (event.key == 'Enter') {
1319          event.preventDefault();
1320          atcb_toggle('auto', data, parent, true, true);
1321        }
1322      });
1323      break;
1324    case 'apple':
1325    case 'google':
1326    case 'ical':
1327    case 'msteams':
1328    case 'ms365':
1329    case 'outlookcom':
1330    case 'yahoo':
1331      parent.id = data.identifier + '-' + type;
1332      parent.addEventListener(
1333        'click',
1334        atcb_debounce(() => {
1335          oneOption ? parent.blur() : atcb_toggle('close');
1336          atcb_generate_links(type, data);
1337        })
1338      );
1339      parent.addEventListener('keyup', function (event) {
1340        if (event.key == 'Enter') {
1341          event.preventDefault();
1342          oneOption ? parent.blur() : atcb_toggle('close');
1343          atcb_generate_links(type, data, 'all', true);
1344        }
1345      });
1346      break;
1347    case 'close':
1348      parent.id = data.identifier + '-close';
1349      parent.addEventListener(
1350        'click',
1351        atcb_debounce(() => {
1352          atcb_toggle('close');
1353        })
1354      );
1355      parent.addEventListener('keyup', function (event) {
1356        if (event.key == 'Enter') {
1357          event.preventDefault();
1358          atcb_toggle('close', data, 'all', true);
1359        }
1360      });
1361      break;
1362  }
1363  if (oneOption) {
1364    parent.id = data.identifier;
1365  }
1366  atcb_generate_label_content(data, parent, type, icon, text, oneOption);
1367}
1368function atcb_generate_label_content(data, parent, type, icon, text, oneOption) {
1369  const defaultTriggerText = atcb_translate_hook('Add to Calendar', data);
1370  if (oneOption && text == '') {
1371    text = defaultTriggerText;
1372  }
1373  switch (type) {
1374    case 'trigger':
1375    default:
1376      text = text || defaultTriggerText;
1377      break;
1378    case 'apple':
1379      text = text || 'Apple';
1380      break;
1381    case 'google':
1382      text = text || 'Google';
1383      break;
1384    case 'ical':
1385      text = text || atcb_translate_hook('iCal File', data);
1386      break;
1387    case 'msteams':
1388      text = text || 'Microsoft Teams';
1389      break;
1390    case 'ms365':
1391      text = text || 'Microsoft 365';
1392      break;
1393    case 'outlookcom':
1394      text = text || 'Outlook.com';
1395      break;
1396    case 'yahoo':
1397      text = text || 'Yahoo';
1398      break;
1399    case 'close':
1400      text = atcb_translate_hook('Close', data);
1401      break;
1402  }
1403  if (data.buttonStyle == 'date' && (type == 'trigger' || oneOption)) {
1404    return;
1405  }
1406  if (icon) {
1407    const iconEl = document.createElement('span');
1408    iconEl.classList.add('atcb-icon');
1409    iconEl.innerHTML = atcbIcon[`${type}`];
1410    parent.appendChild(iconEl);
1411  }
1412  if (
1413    (type == 'trigger' && data.textLabelButton == true) ||
1414    (type != 'trigger' && data.textLabelList == true)
1415  ) {
1416    const textEl = document.createElement('span');
1417    textEl.classList.add('atcb-text');
1418    textEl.textContent = text;
1419    parent.appendChild(textEl);
1420  }
1421}
1422function atcb_generate_button(button, data) {
1423  button.textContent = '';
1424  if (data.richData && data.name && data.dates[0].location && data.dates[0].startDate) {
1425    atcb_generate_rich_data(data, button);
1426  }
1427  const buttonTriggerWrapper = document.createElement('div');
1428  buttonTriggerWrapper.classList.add('atcb-button-wrapper');
1429  buttonTriggerWrapper.classList.add('atcb-' + data.lightMode);
1430  if (data.rtl) {
1431    buttonTriggerWrapper.classList.add('atcb-rtl');
1432  }
1433  button.appendChild(buttonTriggerWrapper);
1434  atcb_set_sizes(buttonTriggerWrapper, data.sizes);
1435  const buttonTrigger = document.createElement('button');
1436  buttonTrigger.classList.add('atcb-button');
1437  if (data.textLabelButton == false) {
1438    buttonTrigger.classList.add('atcb-no-text');
1439  }
1440  if (data.trigger === 'click') {
1441    buttonTrigger.classList.add('atcb-click');
1442  }
1443  if (data.listStyle === 'overlay') {
1444    buttonTrigger.classList.add('atcb-dropoverlay');
1445  }
1446  buttonTrigger.type = 'button';
1447  buttonTriggerWrapper.appendChild(buttonTrigger);
1448  if (data.buttonStyle == 'date') {
1449    atcb_generate_date_button(data, buttonTrigger);
1450  }
1451  if (data.options.length === 1) {
1452    buttonTrigger.classList.add('atcb-single');
1453    atcb_generate_label(data, buttonTrigger, data.options[0], data.iconButton, data.label, true);
1454  } else {
1455    atcb_generate_label(data, buttonTrigger, 'trigger', data.iconButton, data.label);
1456    const buttonDropdownAnchor = document.createElement('div');
1457    buttonDropdownAnchor.classList.add('atcb-dropdown-anchor');
1458    buttonTrigger.appendChild(buttonDropdownAnchor);
1459  }
1460  if (data.checkmark) {
1461    const btnCheck = document.createElement('div');
1462    btnCheck.classList.add('atcb-checkmark');
1463    btnCheck.innerHTML = atcbIcon['checkmark'];
1464    buttonTrigger.appendChild(btnCheck);
1465  }
1466  button.classList.remove('atcb');
1467  button.classList.add('atcb-initialized');
1468  if (data.inline) {
1469    button.style.display = 'inline-block';
1470  } else {
1471    button.style.display = 'block';
1472  }
1473  // console.log('Add to Calendar Button "' + data.identifier + '" created');
1474}
1475function atcb_generate_rich_data(data, button) {
1476  const schemaEl = document.createElement('script');
1477  schemaEl.type = 'application/ld+json';
1478  const schemaContentMulti = [];
1479  if (data.dates.length > 1) {
1480    const parts = [];
1481    parts.push('"@context":"https://schema.org"');
1482    parts.push('"@type":"EventSeries"');
1483    parts.push('"@id":"' + data.name.replace(/\s/g, '') + '"');
1484    parts.push('"name":"' + data.name + '",');
1485    schemaContentMulti.push('{\r\n' + parts.join(',\r\n') + '\r\n');
1486  }
1487  const schemaContentFull = [];
1488  for (let i = 0; i < data.dates.length; i++) {
1489    const schemaContent = [];
1490    schemaContent.push('"@context":"https://schema.org"');
1491    schemaContent.push('"@type":"Event"');
1492    if (data.dates.length > 1) {
1493      schemaContent.push('"@id":"' + data.name.replace(/\s/g, '') + '-' + (i + 1) + '"');
1494    }
1495    if (data.dates[`${i}`].status == 'CANCELLED') {
1496      schemaContent.push('"eventStatus":"https://schema.org/EventCancelled"');
1497    }
1498    schemaContent.push('"name":"' + data.dates[`${i}`].name + '"');
1499    if (data.dates[`${i}`].descriptionHtmlFree) {
1500      schemaContent.push('"description":"' + data.dates[`${i}`].descriptionHtmlFree + '"');
1501    }
1502    const formattedDate = atcb_generate_time(data.dates[`${i}`], 'delimiters', 'general', true);
1503    schemaContent.push('"startDate":"' + formattedDate.start + '"');
1504    if (formattedDate.duration != null) {
1505      schemaContent.push('"duration":"' + formattedDate.duration + '"');
1506    }
1507    schemaContent.push(
1508      data.dates[`${i}`].location.startsWith('http')
1509        ? '"eventAttendanceMode":"https://schema.org/OnlineEventAttendanceMode",\r\n"location": {\r\n"@type":"VirtualLocation",\r\n"url":"' +
1510            data.dates[`${i}`].location +
1511            '"\r\n}'
1512        : '"location":"' + data.dates[`${i}`].location + '"'
1513    );
1514    if (data.recurrence != null && data.recurrence != '') {
1515      schemaContent.push(...atcb_generate_rich_data_recurrence(data, formattedDate));
1516    } else {
1517      schemaContent.push('"endDate":"' + formattedDate.end + '"');
1518    }
1519    if (data.dates[`${i}`].organizer != null && data.dates[`${i}`].organizer != '') {
1520      const organizerParts = data.dates[`${i}`].organizer.split('|');
1521      schemaContent.push(
1522        '"organizer":{\r\n"@type":"Person",\r\n"name":"' +
1523          organizerParts[0] +
1524          '",\r\n"email":"' +
1525          organizerParts[1] +
1526          '"\r\n}'
1527      );
1528    }
1529    const imageData = [];
1530    if (data.images != null) {
1531      if (Array.isArray(data.images)) {
1532        for (let i = 0; i < data.images.length; i++) {
1533          if (atcb_secure_url(data.images[`${i}`]) && data.images[`${i}`].startsWith('http')) {
1534            imageData.push('"' + data.images[`${i}`] + '"');
1535          }
1536        }
1537      }
1538    } else {
1539      imageData.push('"https://add-to-calendar-button.com/demo_assets/img/1x1.png"');
1540      imageData.push('"https://add-to-calendar-button.com/demo_assets/img/4x3.png"');
1541      imageData.push('"https://add-to-calendar-button.com/demo_assets/img/16x9.png"');
1542    }
1543    if (imageData.length > 0) {
1544      schemaContent.push('"image":[\r\n' + imageData.join(',\r\n') + ']');
1545    }
1546    schemaContentFull.push('{\r\n' + schemaContent.join(',\r\n') + '\r\n}');
1547  }
1548  if (data.dates.length > 1) {
1549    schemaEl.textContent =
1550      schemaContentMulti.join(',\r\n') + '"subEvents":[\r\n' + schemaContentFull.join(',\r\n') + '\r\n]\r\n}';
1551  } else {
1552    schemaEl.textContent = schemaContentFull[0];
1553  }
1554  button.appendChild(schemaEl);
1555}
1556function atcb_generate_rich_data_recurrence(data, formattedDate) {
1557  const schemaRecurrenceContent = [];
1558  schemaRecurrenceContent.push('"eventSchedule": { "@type": "Schedule"');
1559  if (data.dates[0].timeZone != null && data.dates[0].timeZone != '') {
1560    schemaRecurrenceContent.push('"scheduleTimezone":"' + data.dates[0].timeZone + '"');
1561  }
1562  const repeatFrequency = 'P' + data.recurrence_interval + data.recurrence_frequency.substr(0, 1);
1563  schemaRecurrenceContent.push('"repeatFrequency":"' + repeatFrequency + '"');
1564  if (data.recurrence_byDay != null && data.recurrence_byDay != '') {
1565    const byDayString = (function () {
1566      if (/\d/.test(data.recurrence_byDay)) {
1567        return '"' + data.recurrence_byDay + '"';
1568      } else {
1569        const byDays = data.recurrence_byDay.split(',');
1570        const helperMap = {
1571          MO: 'https://schema.org/Monday',
1572          TU: 'https://schema.org/Tuesday',
1573          WE: 'https://schema.org/Wednesday',
1574          TH: 'https://schema.org/Thursday',
1575          FR: 'https://schema.org/Friday',
1576          SA: 'https://schema.org/Saturday',
1577          SU: 'https://schema.org/Sunday',
1578        };
1579        const output = [];
1580        for (let i = 0; i < byDays.length; i++) {
1581          output.push('"' + helperMap[byDays[`${i}`]] + '"');
1582        }
1583        return '[' + output.join(',') + ']';
1584      }
1585    })();
1586    schemaRecurrenceContent.push('"byDay":' + byDayString);
1587  }
1588  if (data.recurrence_byMonth != null && data.recurrence_byMonth != '') {
1589    const byMonthString = data.recurrence_byMonth.includes(',')
1590      ? '[' + data.recurrence_byMonth + ']'
1591      : data.recurrence_byMonth;
1592    schemaRecurrenceContent.push('"byMonth":"' + byMonthString + '"');
1593  }
1594  if (data.recurrence_byMonthDay != null && data.recurrence_byMonthDay != '') {
1595    const byMonthDayString = data.recurrence_byMonthDay.includes(',')
1596      ? '[' + data.recurrence_byMonthDay + ']'
1597      : data.recurrence_byMonthDay;
1598    schemaRecurrenceContent.push('"byMonthDay":"' + byMonthDayString + '"');
1599  }
1600  if (data.recurrence_count != null && data.recurrence_count != '') {
1601    schemaRecurrenceContent.push('"repeatCount":"' + data.recurrence_count + '"');
1602  }
1603  if (data.recurrence_until != null && data.recurrence_until != '') {
1604    schemaRecurrenceContent.push('"endDate":"' + data.recurrence_until + '"');
1605  }
1606  if (data.startTime != null && data.startTime != '' && data.endTime != null && data.endTime != '') {
1607    schemaRecurrenceContent.push('"startTime":"' + data.startTime + ':00"');
1608    schemaRecurrenceContent.push('"endTime":"' + data.endTime + ':00"');
1609    schemaRecurrenceContent.push('"duration":"' + formattedDate.duration + '"');
1610  }
1611  schemaRecurrenceContent.push('"startDate":"' + data.startDate + '" }');
1612  return schemaRecurrenceContent;
1613}
1614function atcb_generate_dropdown_list(data) {
1615  const optionsList = document.createElement('div');
1616  optionsList.classList.add('atcb-list');
1617  optionsList.classList.add('atcb-' + data.lightMode);
1618  if (data.rtl) {
1619    optionsList.classList.add('atcb-rtl');
1620  }
1621  let listCount = 0;
1622  data.options.forEach(function (option) {
1623    const optionItem = document.createElement('div');
1624    optionItem.classList.add('atcb-list-item');
1625    optionItem.tabIndex = 0;
1626    listCount++;
1627    optionItem.dataset.optionNumber = listCount;
1628    optionsList.appendChild(optionItem);
1629    atcb_generate_label(data, optionItem, option, data.iconList, data.optionLabels[listCount - 1]);
1630  });
1631  if (data.listStyle === 'modal') {
1632    const optionItem = document.createElement('div');
1633    optionItem.classList.add('atcb-list-item', 'atcb-list-item-close');
1634    optionItem.tabIndex = 0;
1635    optionsList.appendChild(optionItem);
1636    atcb_generate_label(data, optionItem, 'close', data.iconList);
1637  }
1638  return optionsList;
1639}
1640function atcb_generate_bg_overlay(listStyle = 'dropdown', trigger = '', lightMode = 'light', darken = true) {
1641  const bgOverlay = document.createElement('div');
1642  bgOverlay.id = 'atcb-bgoverlay';
1643  if (listStyle !== 'modal' && darken) {
1644    bgOverlay.classList.add('atcb-animate-bg');
1645  }
1646  if (!darken) {
1647    bgOverlay.classList.add('atcb-no-bg');
1648  }
1649  bgOverlay.classList.add('atcb-' + lightMode);
1650  bgOverlay.tabIndex = 0;
1651  bgOverlay.addEventListener(
1652    'click',
1653    atcb_debounce((e) => {
1654      if (e.target !== e.currentTarget) return;
1655      atcb_toggle('close');
1656    })
1657  );
1658  let fingerMoved = false;
1659  bgOverlay.addEventListener(
1660    'touchstart',
1661    atcb_debounce_leading(() => (fingerMoved = false)),
1662    { passive: true }
1663  );
1664  bgOverlay.addEventListener(
1665    'touchmove',
1666    atcb_debounce_leading(() => (fingerMoved = true)),
1667    { passive: true }
1668  );
1669  bgOverlay.addEventListener(
1670    'touchend',
1671    atcb_debounce((e) => {
1672      if (fingerMoved !== false || e.target !== e.currentTarget) return;
1673      atcb_toggle('close');
1674    }),
1675    { passive: true }
1676  );
1677  bgOverlay.addEventListener(
1678    'focus',
1679    atcb_debounce_leading((e) => {
1680      if (e.target !== e.currentTarget) return;
1681      atcb_toggle('close');
1682    })
1683  );
1684  if (trigger !== 'click') {
1685    bgOverlay.addEventListener(
1686      'mousemove',
1687      atcb_debounce_leading((e) => {
1688        if (e.target !== e.currentTarget) return;
1689        atcb_toggle('close');
1690      })
1691    );
1692  } else {
1693    bgOverlay.classList.add('atcb-click');
1694  }
1695  return bgOverlay;
1696}
1697function atcb_create_atcbl(atList = true) {
1698  /*const atcbL = document.createElement('div');
1699  atcbL.id = 'add-to-calendar-button-reference';
1700  atcbL.style.width = '150px';
1701  atcbL.style.padding = '10px 0';
1702  atcbL.style.height = 'auto';
1703  atcbL.style.transform = 'translate3d(0, 0, 0)';
1704  atcbL.style.zIndex = '15000000';
1705  setTimeout(() => {
1706    atcbL.innerHTML =
1707      '<a href="https://add-to-calendar-pro.com" target="_blank" rel="noopener">' +
1708      atcbIcon['atcb'] +
1709      '</a>';
1710  }, 500);  
1711  document.body.appendChild(atcbL);
1712  if (atList) {
1713    atcbL.style.position = 'absolute';
1714  } else {
1715    if (window.innerHeight > 1000 || window.innerWidth > 1000) {
1716      atcbL.style.position = 'fixed';
1717      atcbL.style.bottom = '15px';
1718      atcbL.style.right = '30px';
1719    }
1720  }*/
1721}
1722function atcb_create_modal(
1723  data,
1724  icon = '',
1725  headline,
1726  content = '',
1727  buttons = [],
1728  subEvents = [],
1729  keyboardTrigger = false
1730) {
1731  const bgOverlay = (function () {
1732    const el = document.getElementById('atcb-bgoverlay');
1733    if (!el) {
1734      return atcb_generate_bg_overlay('modal', 'click', data.lightMode, data.background);
1735    } else {
1736      return el;
1737    }
1738  })();
1739  bgOverlay.classList.add('atcb-no-animation');
1740  document.body.appendChild(bgOverlay);
1741  const modalWrapper = document.createElement('div');
1742  modalWrapper.classList.add('atcb-modal');
1743  bgOverlay.appendChild(modalWrapper);
1744  const modalCount = document.querySelectorAll('.atcb-modal').length;
1745  modalWrapper.dataset.modalNr = modalCount;
1746  modalWrapper.tabIndex = 0;
1747  modalWrapper.focus({ preventScroll: true });
1748  modalWrapper.blur();
1749  const parentButton = document.getElementById(data.identifier);
1750  if (parentButton != null) {
1751    parentButton.classList.add('atcb-active-modal');
1752  }
1753  const modal = document.createElement('div');
1754  modal.classList.add('atcb-modal-box');
1755  modal.classList.add('atcb-' + data.lightMode);
1756  if (data.rtl) {
1757    modal.classList.add('atcb-rtl');
1758  }
1759  modalWrapper.appendChild(modal);
1760  atcb_set_sizes(modal, data.sizes);
1761  atcb_set_fullsize(bgOverlay);
1762  if (icon != '' && data.iconModal == true) {
1763    const modalIcon = document.createElement('div');
1764    modalIcon.classList.add('atcb-modal-icon');
1765    modalIcon.innerHTML = atcbIcon[`${icon}`];
1766    modal.appendChild(modalIcon);
1767  }
1768  const modalHeadline = document.createElement('div');
1769  modalHeadline.classList.add('atcb-modal-headline');
1770  modalHeadline.textContent = headline;
1771  modal.appendChild(modalHeadline);
1772  if (content != '') {
1773    const modalContent = document.createElement('div');
1774    modalContent.classList.add('atcb-modal-content');
1775    modalContent.innerHTML = content;
1776    modal.appendChild(modalContent);
1777  }
1778  if (subEvents.length > 1) {
1779    if (data.branding) {
1780      atcb_create_atcbl(false);
1781    }
1782    const modalsubEventsContent = document.createElement('div');
1783    modalsubEventsContent.classList.add('atcb-modal-content');
1784    modal.appendChild(modalsubEventsContent);
1785    for (let i = 1; i < subEvents.length; i++) {
1786      const modalSubEventButton = document.createElement('button');
1787      modalSubEventButton.type = 'button';
1788      modalSubEventButton.id = data.identifier + '-' + subEvents[0] + '-' + i;
1789      if (atcbStates[`${data.identifier}`][`${subEvents[0]}`][i - 1] > 0) {
1790        modalSubEventButton.classList.add('atcb-saved');
1791      }
1792      modalSubEventButton.classList.add('atcb-subevent-btn');
1793      modalsubEventsContent.appendChild(modalSubEventButton);
1794      atcb_generate_date_button(data, modalSubEventButton, i);
1795      if (i == 1 && keyboardTrigger) {
1796        modalSubEventButton.focus();
1797      }
1798      switch (subEvents[0]) {
1799        case 'apple':
1800        case 'google':
1801        case 'ical':
1802        case 'msteams':
1803        case 'ms365':
1804        case 'outlookcom':
1805        case 'yahoo':
1806          modalSubEventButton.addEventListener(
1807            'click',
1808            atcb_debounce(() => {
1809              atcb_generate_links(subEvents[0], data, subEvents[`${i}`], keyboardTrigger, true);
1810            })
1811          );
1812          break;
1813      }
1814    }
1815  }
1816  if (buttons.length == 0) {
1817    buttons.push({ type: 'close', label: atcb_translate_hook('Close', data) });
1818  }
1819  const modalButtons = document.createElement('div');
1820  modalButtons.classList.add('atcb-modal-buttons');
1821  modal.appendChild(modalButtons);
1822  buttons.forEach((button, index) => {
1823    let modalButton;
1824    if (button.href != null && button.href != '') {
1825      modalButton = document.createElement('a');
1826      modalButton.setAttribute('target', atcbDefaultTarget);
1827      modalButton.setAttribute('href', button.href);
1828      modalButton.setAttribute('rel', 'noopener');
1829    } else {
1830      modalButton = document.createElement('button');
1831      modalButton.type = 'button';
1832    }
1833    modalButton.classList.add('atcb-modal-btn');
1834    if (button.primary) {
1835      modalButton.classList.add('atcb-modal-btn-primary');
1836    }
1837    if (button.label == null || button.label == '') {
1838      button.label = atcb_translate_hook('Click me', data);
1839    }
1840    modalButton.textContent = button.label;
1841    modalButtons.appendChild(modalButton);
1842    if (index == 0 && subEvents.length < 2 && keyboardTrigger) {
1843      modalButton.focus();
1844    }
1845    switch (button.type) {
1846      default:
1847      case 'close':
1848        modalButton.addEventListener(
1849          'click',
1850          atcb_debounce(() => atcb_close())
1851        );
1852        modalButton.addEventListener('keyup', function (event) {
1853          if (event.key == 'Enter') {
1854            atcb_toggle('close', '', '', true);
1855          }
1856        });
1857        break;
1858      case 'yahoo2nd':
1859        modalButton.addEventListener(
1860          'click',
1861          atcb_debounce(() => {
1862            atcb_close();
1863            atcb_subscribe_yahoo_modal_switch(data);
1864          })
1865        );
1866        modalButton.addEventListener('keyup', function (event) {
1867          if (event.key == 'Enter') {
1868            atcb_toggle('close', '', '', true);
1869            atcb_subscribe_yahoo_modal_switch(data, keyboardTrigger);
1870          }
1871        });
1872        break;
1873      case 'none':
1874        break;
1875    }
1876  });
1877  if (modalCount > 1) {
1878    const prevModal = document.querySelectorAll('.atcb-modal[data-modal-nr="' + (modalCount - 1) + '"]')[0];
1879    prevModal.style.display = 'none';
1880  }
1881  atcb_manage_body_scroll(modalWrapper);
1882}
1883function atcb_subscribe_yahoo_modal_switch(data, keyboardTrigger) {
1884  atcb_set_fully_successful(data.identifier);
1885  atcb_generate_links('yahoo2nd', data, 'all', keyboardTrigger);
1886}
1887function atcb_generate_date_button(data, parent, subEvent = 'all') {
1888  if (subEvent != 'all') {
1889    subEvent = parseInt(subEvent) - 1;
1890  } else if (data.dates.length == 1) {
1891    subEvent = 0;
1892  }
1893  const fullTimeInfo = (function () {
1894    let startDateInfo, endDateInfo, timeZoneInfoStart, timeZoneInfoEnd;
1895    let formattedTimeStart = {};
1896    let formattedTimeEnd = {};
1897    if (subEvent == 'all') {
1898      formattedTimeStart = atcb_generate_time(data.dates[0]);
1899      formattedTimeEnd = atcb_generate_time(data.dates[data.dates.length - 1]);
1900      timeZoneInfoStart = data.dates[0].timeZone;
1901      timeZoneInfoEnd = data.dates[data.dates.length - 1].timeZone;
1902    } else {
1903      formattedTimeStart = atcb_generate_time(data.dates[`${subEvent}`]);
1904      formattedTimeEnd = formattedTimeStart;
1905      timeZoneInfoStart = data.dates[`${subEvent}`].timeZone;
1906      timeZoneInfoEnd = timeZoneInfoStart;
1907    }
1908    startDateInfo = new Date(formattedTimeStart.start);
1909    endDateInfo = new Date(formattedTimeEnd.end);
1910    if (timeZoneInfoStart == undefined || timeZoneInfoStart == '' || formattedTimeStart.allday) {
1911      timeZoneInfoStart = 'UTC';
1912    }
1913    if (timeZoneInfoEnd == undefined || timeZoneInfoEnd == '' || formattedTimeEnd.allday) {
1914      timeZoneInfoEnd = 'UTC';
1915    }
1916    let timeString = '';
1917    let timeZoneInfoStringStart = '';
1918    let timeZoneInfoStringEnd = '';
1919    if (
1920      !formattedTimeStart.allday &&
1921      Intl.DateTimeFormat().resolvedOptions().timeZone != timeZoneInfoStart &&
1922      timeZoneInfoStart != timeZoneInfoEnd
1923    ) {
1924      timeZoneInfoStringStart = ' (' + timeZoneInfoStart + ')';
1925    }
1926    if (
1927      (!formattedTimeEnd.allday && Intl.DateTimeFormat().resolvedOptions().timeZone != timeZoneInfoEnd) ||
1928      timeZoneInfoStart != timeZoneInfoEnd
1929    ) {
1930      timeZoneInfoStringEnd = ' (' + timeZoneInfoEnd + ')';
1931    }
1932    const formatOptionsStart = get_format_options(timeZoneInfoStart);
1933    const formatOptionsEnd = get_format_options(timeZoneInfoEnd);
1934    if (startDateInfo.toLocaleDateString(data.language, formatOptionsEnd.DateLong) === endDateInfo.toLocaleDateString(data.language, formatOptionsEnd.DateLong)) {
1935      if (formattedTimeStart.allday) {
1936        timeString = startDateInfo.toLocaleDateString(data.language, formatOptionsStart.DateShort);
1937      } else {
1938        timeString =
1939          startDateInfo.toLocaleString(data.language, formatOptionsStart.DateTimeShort) +
1940          timeZoneInfoStringStart +
1941          ' - ' +
1942          endDateInfo.toLocaleTimeString(data.language, formatOptionsEnd.Time) +
1943          timeZoneInfoStringEnd;
1944      }
1945    } else {
1946      if (formattedTimeStart.allday) {
1947        timeString = startDateInfo.toLocaleDateString(data.language, formatOptionsStart.DateShort);
1948      } else {
1949        timeString = startDateInfo.toLocaleString(data.language, formatOptionsStart.DateTimeShort);
1950      }
1951      timeString += timeZoneInfoStringStart + ' - ';
1952      if (formattedTimeEnd.allday) {
1953        timeString += endDateInfo.toLocaleDateString(data.language, formatOptionsEnd.DateLong);
1954      } else {
1955        timeString += endDateInfo.toLocaleString(data.language, formatOptionsEnd.DateTimeLong);
1956      }
1957      timeString += timeZoneInfoStringEnd;
1958    }
1959    return timeString;
1960  })();
1961  const hoverText = (function () {
1962    if (subEvent != 'all' && data.dates[`${subEvent}`].status == 'CANCELLED') {
1963      return (
1964        atcb_translate_hook('Cancelled Date', data) +
1965        '<br>' +
1966        atcb_translate_hook('Delete from Calendar', data)
1967      );
1968    }
1969    return '+ ' + atcb_translate_hook('Add to Calendar', data);
1970  })();
1971  const cancelledInfo = (function () {
1972    if (subEvent != 'all' && data.dates[`${subEvent}`].status == 'CANCELLED') {
1973      return atcb_translate_hook('Cancelled Date', data);
1974    }
1975    return '';
1976  })();
1977  if (subEvent == 'all') {
1978    subEvent = 0;
1979  }
1980  const startDate = new Date(atcb_generate_time(data.dates[`${subEvent}`]).start);
1981  const timeZone = (function () {
1982    if (data.dates[`${subEvent}`].timeZone != null && data.dates[`${subEvent}`].timeZone != '') {
1983      return data.dates[`${subEvent}`].timeZone;
1984    } else {
1985      return 'UTC';
1986    }
1987  })();
1988  const btnLeft = document.createElement('div');
1989  btnLeft.classList.add('atcb-date-btn-left');
1990  parent.appendChild(btnLeft);
1991  const btnDay = document.createElement('div');
1992  btnDay.classList.add('atcb-date-btn-day');
1993  btnLeft.appendChild(btnDay);
1994  const btnMonth = document.createElement('div');
1995  btnMonth.classList.add('atcb-date-btn-month');
1996  btnDay.textContent = startDate.toLocaleString(data.language, {
1997    day: 'numeric',
1998    timeZone: timeZone,
1999  });
2000  btnMonth.textContent = startDate.toLocaleString(data.language, {
2001    month: 'short',
2002    timeZone: timeZone,
2003  });
2004  btnLeft.appendChild(btnMonth);
2005  const btnRight = document.createElement('div');
2006  btnRight.classList.add('atcb-date-btn-right');
2007  parent.appendChild(btnRight);
2008  const btnDetails = document.createElement('div');
2009  btnDetails.classList.add('atcb-date-btn-details');
2010  btnRight.appendChild(btnDetails);
2011  const btnHeadline = document.createElement('div');
2012  btnHeadline.classList.add('atcb-date-btn-headline');
2013  btnHeadline.textContent = data.dates[`${subEvent}`].name;
2014  btnDetails.appendChild(btnHeadline);
2015  if ((data.location != null && data.location != '') || cancelledInfo != '') {
2016    const btnLocation = document.createElement('div');
2017    btnLocation.classList.add('atcb-date-btn-content');
2018    btnDetails.appendChild(btnLocation);
2019    if (cancelledInfo != '') {
2020      btnLocation.textContent = cancelledInfo;
2021      btnLocation.style.fontWeight = '600';
2022      btnLocation.style.color = '#9c1a23';
2023    } else {
2024      btnLocation.classList.add('atcb-date-btn-content-location');
2025      const btnLocationIcon = document.createElement('span');
2026      btnLocationIcon.classList.add('atcb-date-btn-content-icon');
2027      btnLocationIcon.innerHTML = atcbIcon['location'];
2028      btnLocation.appendChild(btnLocationIcon);
2029      const btnLocationText = document.createElement('span');
2030      btnLocationText.textContent = data.location;
2031      btnLocation.appendChild(btnLocationText);
2032    }
2033  }
2034  const btnDateTime = document.createElement('div');
2035  btnDateTime.classList.add('atcb-date-btn-content');
2036  btnDetails.appendChild(btnDateTime);
2037  const btnDateTimeIcon = document.createElement('span');
2038  btnDateTimeIcon.classList.add('atcb-date-btn-content-icon');
2039  btnDateTimeIcon.innerHTML = atcbIcon['ical'];
2040  btnDateTime.appendChild(btnDateTimeIcon);
2041  const btnDateTimeText = document.createElement('span');
2042  btnDateTimeText.textContent = fullTimeInfo;
2043  btnDateTime.appendChild(btnDateTimeText);
2044  if (data.recurrence != null && data.recurrence != '') {
2045    const recurSign = document.createElement('span');
2046    recurSign.classList.add('atcb-date-btn-content-recurr-icon');
2047    btnDateTime.appendChild(recurSign);
2048    recurSign.innerHTML = '&#x27F3;';
2049  }
2050  const btnHover = document.createElement('div');
2051  btnHover.classList.add('atcb-date-btn-hover');
2052  btnHover.innerHTML = hoverText;
2053  btnRight.appendChild(btnHover);
2054  if (data.checkmark) {
2055    const btnCheck = document.createElement('div');
2056    btnCheck.classList.add('atcb-checkmark');
2057    btnCheck.innerHTML = atcbIcon['checkmark'];
2058    parent.appendChild(btnCheck);
2059  }
2060}
2061function get_format_options(timeZoneInfo) {
2062  return {
2063    DateShort: {
2064      timeZone: timeZoneInfo,
2065      year: 'numeric',
2066    },
2067    DateLong: {
2068      timeZone: timeZoneInfo,
2069      year: 'numeric',
2070      month: 'numeric',
2071      day: 'numeric',
2072    },
2073    DateTimeShort: {
2074      timeZone: timeZoneInfo,
2075      year: 'numeric',
2076      hour: 'numeric',
2077      minute: '2-digit',
2078      hourCycle: 'h23',
2079    },
2080    DateTimeLong: {
2081      timeZone: timeZoneInfo,
2082      year: 'numeric',
2083      month: 'numeric',
2084      day: 'numeric',
2085      hour: 'numeric',
2086      minute: '2-digit',
2087      hourCycle: 'h23',
2088    },
2089    Time: {
2090      timeZone: timeZoneInfo,
2091      hour: 'numeric',
2092      minute: '2-digit',
2093      hourCycle: 'h23',
2094    },
2095  };
2096}
2097
2098
2099function atcb_generate_links(type, data, subEvent = 'all', keyboardTrigger = false, multiDateModal = false) {
2100  if (subEvent != 'all') {
2101    subEvent = parseInt(subEvent) - 1;
2102  } else if (data.dates.length == 1) {
2103    subEvent = 0;
2104  }
2105  if (data.subscribe) {
2106    atcb_generate_subscribe_links(type, data, keyboardTrigger);
2107    return;
2108  }
2109  if (isMobile() && (type == 'msteams' || type == 'ms365' || type == 'outlookcom')) {
2110    type = 'ical';
2111  }
2112  if (subEvent != 'all') {
2113    if (data.dates[`${subEvent}`].status == 'CANCELLED' && type != 'apple' && type != 'ical') {
2114      atcb_create_modal(
2115        data,
2116        'warning',
2117        atcb_translate_hook('Cancelled Date', data),
2118        atcb_translate_hook('Delete from Calendar', data),
2119        [],
2120        [],
2121        keyboardTrigger
2122      );
2123    } else {
2124      switch (type) {
2125        case 'apple':
2126        case 'ical':
2127          atcb_generate_ical(data, subEvent, keyboardTrigger);
2128          break;
2129        case 'google':
2130          atcb_generate_google(data.dates[`${subEvent}`]);
2131          break;
2132        case 'msteams':
2133          atcb_generate_msteams(data.dates[`${subEvent}`]);
2134          break;
2135        case 'ms365':
2136          atcb_generate_microsoft(data.dates[`${subEvent}`]);
2137          break;
2138        case 'outlookcom':
2139          atcb_generate_microsoft(data.dates[`${subEvent}`], 'outlook');
2140          break;
2141        case 'yahoo':
2142          atcb_generate_yahoo(data.dates[`${subEvent}`]);
2143          break;
2144      }
2145    }
2146    const subEventButton = document.getElementById(data.identifier + '-' + type + '-' + (subEvent + 1));
2147    if (subEventButton) {
2148      subEventButton.classList.add('atcb-saved');
2149    }
2150    atcbStates[`${data.identifier}`][`${type}`][`${subEvent}`]++;
2151    const filteredStates = atcbStates[`${data.identifier}`][`${type}`].filter(function (value) {
2152      return value < 1;
2153    });
2154    if (filteredStates.length == 0) {
2155      atcb_set_fully_successful(data.identifier, multiDateModal);
2156    }
2157    return;
2158  }
2159  atcb_generate_multidate_links(type, data, keyboardTrigger, multiDateModal);
2160}
2161function atcb_generate_multidate_links(type, data, keyboardTrigger, multiDateModal) {
2162  if (
2163    (type == 'ical' || type == 'apple') &&
2164    data.dates.every(function (theSubEvent) {
2165      if (
2166        theSubEvent.status == 'CANCELLED' ||
2167        (theSubEvent.organizer != null && theSubEvent.organizer != '')
2168      ) {
2169        return false;
2170      }
2171      return true;
2172    })
2173  ) {
2174    atcb_generate_ical(data, 'all', keyboardTrigger);
2175    for (let i = 0; i < atcbStates[`${data.identifier}`][`${type}`].length; i++) {
2176      atcbStates[`${data.identifier}`][`${type}`][`${i}`]++;
2177    }
2178    atcb_set_fully_successful(data.identifier, multiDateModal);
2179    return;
2180  }
2181  if (!multiDateModal) {
2182    const individualButtons = [type];
2183    for (let i = 0; i < data.dates.length; i++) {
2184      individualButtons.push(i + 1);
2185    }
2186    atcb_create_modal(
2187      data,
2188      type,
2189      atcb_translate_hook('modal.multidate.h', data),
2190      atcb_translate_hook('modal.multidate.text', data),
2191      [],
2192      individualButtons,
2193      keyboardTrigger
2194    );
2195  }
2196}
2197function atcb_generate_subscribe_links(type, data, keyboardTrigger) {
2198  const adjustedFileUrl = data.icsFile.replace('https://', 'webcal://');
2199  switch (type) {
2200    case 'apple':
2201    case 'ical':
2202      atcb_subscribe_ical(adjustedFileUrl);
2203      break;
2204    case 'google':
2205      atcb_subscribe_google(adjustedFileUrl.replace('webcal://calendar.google.com/calendar/u/2?cid=', ''));
2206      break;
2207    case 'ms365':
2208      atcb_subscribe_microsoft(adjustedFileUrl, data.name);
2209      break;
2210    case 'outlookcom':
2211      atcb_subscribe_microsoft(adjustedFileUrl, data.name, 'outlook');
2212      break;
2213    case 'yahoo':
2214      atcb_copy_to_clipboard(data.icsFile);
2215      atcb_create_modal(
2216        data,
2217        'yahoo',
2218        atcb_translate_hook('modal.subscribe.yahoo.h', data),
2219        atcb_translate_hook('modal.clipboard.text', data) +
2220          '<br>' +
2221          atcb_translate_hook('modal.subscribe.yahoo.text', data),
2222        [
2223          {
2224            label: atcb_translate_hook('Open Yahoo Calendar', data),
2225            primary: true,
2226            type: 'yahoo2nd',
2227            href: 'https://www.yahoo.com/calendar',
2228          },
2229          { label: atcb_translate_hook('Cancel', data) },
2230        ],
2231        [],
2232        keyboardTrigger
2233      );
2234      return;
2235    case 'yahoo2nd':
2236      atcb_copy_to_clipboard(data.icsFile);
2237      atcb_create_modal(
2238        data,
2239        'yahoo',
2240        atcb_translate_hook('modal.subscribe.yahoo.h', data),
2241        atcb_translate_hook('modal.clipboard.text', data) +
2242          '<br>' +
2243          atcb_translate_hook('modal.subscribe.yahoo.text', data),
2244        [
2245          {
2246            label: atcb_translate_hook('Open Yahoo Calendar', data),
2247            type: 'none',
2248            href: 'https://www.yahoo.com/calendar',
2249          },
2250          { label: atcb_translate_hook('Cancel', data) },
2251        ],
2252        [],
2253        keyboardTrigger
2254      );
2255      return;
2256  }
2257  atcb_set_fully_successful(data.identifier);
2258}
2259function atcb_set_fully_successful(id, multiDateModal) {
2260  const trigger = document.getElementById(id);
2261  if (trigger) {
2262    trigger.classList.add('atcb-saved');
2263  }
2264  atcb_saved_hook();
2265  if (multiDateModal && document.querySelectorAll('.atcb-modal[data-modal-nr]').length < 2) {
2266    atcb_toggle('close');
2267  }
2268}
2269function atcb_subscribe_ical(fileUrl) {
2270  atcb_open_cal_url(fileUrl);
2271}
2272function atcb_subscribe_google(fileUrl) {
2273  const baseUrl = 'https://calendar.google.com/calendar/r?cid=';
2274  atcb_open_cal_url(baseUrl + fileUrl);
2275}
2276function atcb_subscribe_microsoft(fileUrl, calName, type = '365') {
2277  const urlParts = [];
2278  const baseUrl = (function () {
2279    if (type == 'outlook') {
2280      return 'https://outlook.live.com/calendar/0/addfromweb/?';
2281    } else {
2282      return 'https://outlook.office.com/calendar/0/addfromweb/?';
2283    }
2284  })();
2285  urlParts.push('url=' + encodeURIComponent(fileUrl));
2286  urlParts.push('name=' + encodeURIComponent(calName));
2287  atcb_open_cal_url(baseUrl + urlParts.join('&'));
2288}
2289function atcb_generate_google(data) {
2290  const urlParts = [];
2291  urlParts.push('https://calendar.google.com/calendar/render?action=TEMPLATE');
2292  const formattedDate = atcb_generate_time(data, 'clean', 'google');
2293  urlParts.push(
2294    'dates=' + encodeURIComponent(formattedDate.start) + '%2F' + encodeURIComponent(formattedDate.end)
2295  );
2296  if (
2297    data.timeZone != null &&
2298    data.timeZone != '' &&
2299    !/(GMT[+|-]\d{1,2}
2299|Etc\/U|Etc\/Zulu|CET|CST6CDT|EET|EST|EST5EDT|MET|MST|MST7MDT|PST8PDT|WET)/i.test(
2300      data.timeZone
2301    )
2302  ) {
2303    urlParts.push('ctz=' + data.timeZone);
2304  }
2305  if (data.name != null && data.name != '') {
2306    urlParts.push('text=' + encodeURIComponent(data.name));
2307  }
2308  const tmpDataDescription = [];
2309  if (data.description != null && data.description != '') {
2310    tmpDataDescription.push(data.description);
2311  }
2312  if (data.location != null && data.location != '') {
2313    urlParts.push('location=' + encodeURIComponent(data.location));
2314    if (isiOS()) {
2315      if (tmpDataDescription.length > 0) {
2316        tmpDataDescription.push('<br><br>');
2317      }
2318      tmpDataDescription.push('&#128205;: ' + data.location);
2319    }
2320  }
2321  if (tmpDataDescription.length > 0) {
2322    urlParts.push('details=' + encodeURIComponent(tmpDataDescription.join()));
2323  }
2324  if (data.recurrence != null && data.recurrence != '') {
2325    urlParts.push('recur=' + encodeURIComponent(data.recurrence));
2326  }
2327  if (data.availability != null && data.availability != '') {
2328    const availabilityPart = (function () {
2329      if (data.availability == 'free') {
2330        return 'crm=AVAILABLE&trp=false';
2331      }
2332      return 'crm=BUSY&trp=true';
2333    })();
2334    urlParts.push(availabilityPart);
2335  }
2336  urlParts.push('uid=' + encodeURIComponent(data.uid));
2337  atcb_open_cal_url(urlParts.join('&'));
2338}
2339function atcb_generate_yahoo(data) {
2340  const urlParts = [];
2341  urlParts.push('https://calendar.yahoo.com/?v=60');
2342  const formattedDate = atcb_generate_time(data, 'clean');
2343  urlParts.push(
2344    'st=' + encodeURIComponent(formattedDate.start) + '&et=' + encodeURIComponent(formattedDate.end)
2345  );
2346  if (formattedDate.allday) {
2347    urlParts.push('dur=allday');
2348  }
2349  if (data.name != null && data.name != '') {
2350    urlParts.push('title=' + encodeURIComponent(data.name));
2351  }
2352  if (data.location != null && data.location != '') {
2353    urlParts.push('in_loc=' + encodeURIComponent(data.location));
2354  }
2355  if (data.descriptionHtmlFree != null && data.descriptionHtmlFree != '') {
2356    urlParts.push('desc=' + encodeURIComponent(data.descriptionHtmlFree));
2357  }
2358  atcb_open_cal_url(urlParts.join('&'));
2359}
2360function atcb_generate_microsoft(data, type = '365') {
2361  const urlParts = [];
2362  const basePath = '/calendar/0/deeplink/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent';
2363  const baseUrl = (function () {
2364    if (type == 'outlook') {
2365      return 'https://outlook.live.com' + basePath;
2366    } else {
2367      return 'https://outlook.office.com' + basePath;
2368    }
2369  })();
2370  urlParts.push(baseUrl);
2371  const formattedDate = atcb_generate_time(data, 'delimiters', 'microsoft');
2372  urlParts.push('startdt=' + encodeURIComponent(formattedDate.start));
2373  urlParts.push('enddt=' + encodeURIComponent(formattedDate.end));
2374  if (formattedDate.allday) {
2375    urlParts.push('allday=true');
2376  }
2377  if (data.name != null && data.name != '') {
2378    urlParts.push('subject=' + encodeURIComponent(data.name));
2379  }
2380  if (data.location != null && data.location != '') {
2381    urlParts.push('location=' + encodeURIComponent(data.location));
2382  }
2383  if (data.description != null && data.description != '') {
2384    urlParts.push('body=' + encodeURIComponent(data.description.replace(/\n/g, '<br>')));
2385  }
2386  urlParts.push('uid=' + encodeURIComponent(data.uid));
2387  atcb_open_cal_url(urlParts.join('&'));
2388}
2389function atcb_generate_msteams(data) {
2390  const urlParts = [];
2391  const baseUrl = 'https://teams.microsoft.com/l/meeting/new?';
2392  const formattedDate = atcb_generate_time(data, 'delimiters', 'microsoft');
2393  urlParts.push('startTime=' + encodeURIComponent(formattedDate.start));
2394  urlParts.push('endTime=' + encodeURIComponent(formattedDate.end));
2395  if (data.name != null && data.name != '') {
2396    urlParts.push('subject=' + encodeURIComponent(data.name));
2397  }
2398  let locationString = '';
2399  if (data.location != null && data.location != '') {
2400    locationString = encodeURIComponent(data.location);
2401    urlParts.push('location=' + locationString);
2402    locationString += ' // '; 
2403  }
2404  if (data.descriptionHtmlFree != null && data.descriptionHtmlFree != '') {
2405    urlParts.push('content=' + locationString + encodeURIComponent(data.descriptionHtmlFree));
2406  }
2407  urlParts.push('uid=' + encodeURIComponent(data.uid));
2408  atcb_open_cal_url(baseUrl + urlParts.join('&'));
2409}
2410function atcb_open_cal_url(url, target = '') {
2411  if (target == '') {
2412    target = atcbDefaultTarget;
2413  }
2414  if (atcb_secure_url(url)) {
2415    // eslint-disable-next-line security/detect-non-literal-fs-filename
2416    window.open(url, target).focus();
2417  }
2418}
2419function atcb_generate_ical(data, subEvent = 'all', keyboardTrigger = false) {
2420  if (subEvent != 'all') {
2421    subEvent = parseInt(subEvent);
2422  }
2423  const filename = atcb_determine_ical_filename(data, subEvent);
2424  const givenIcsFile = (function () {
2425    if (
2426      subEvent != 'all' &&
2427      data.dates[`${subEvent}`].icsFile != null &&
2428      data.dates[`${subEvent}`].icsFile != ''
2429    ) {
2430      return data.dates[`${subEvent}`].icsFile;
2431    }
2432    if (data.icsFile != null && data.icsFile != '') {
2433      return data.icsFile;
2434    }
2435    return '';
2436  })();
2437  if (givenIcsFile != '' && (!isiOS() || !isWebView())) {
2438    atcb_save_file(givenIcsFile, filename);
2439    return;
2440  }
2441  const now = new Date();
2442  const ics_lines = ['BEGIN:VCALENDAR', 'VERSION:2.0'];
2443  ics_lines.push('PRODID:-// https://add-to-calendar-pro.com // button v' + atcbVersion + ' //EN');
2444  ics_lines.push('CALSCALE:GREGORIAN');
2445  if (subEvent == 'all') {
2446    ics_lines.push('METHOD:PUBLISH');
2447  } else {
2448    if (data.dates[`${subEvent}`].status != null && data.dates[`${subEvent}`].status == 'CANCELLED') {
2449      ics_lines.push('METHOD:CANCEL');
2450    } else {
2451      if (data.dates[`${subEvent}`].organizer != null && data.dates[`${subEvent}`].organizer != '') {
2452        ics_lines.push('METHOD:REQUEST');
2453      } else {
2454        ics_lines.push('METHOD:PUBLISH');
2455      }
2456    }
2457  }
2458  const usedTimeZones = [];
2459  const loopStart = (function () {
2460    if (subEvent != 'all') {
2461      return subEvent;
2462    }
2463    return 0;
2464  })();
2465  const loopEnd = (function () {
2466    if (subEvent != 'all') {
2467      return subEvent;
2468    }
2469    return data.dates.length - 1;
2470  })();
2471  for (let i = loopStart; i <= loopEnd; i++) {
2472    const formattedDate = atcb_generate_time(data.dates[`${i}`], 'clean', 'ical');
2473    const timeAddon = (function () {
2474      if (formattedDate.allday) {
2475        return ';VALUE=DATE';
2476      }
2477      if (data.dates[`${i}`].timeZone != null && data.dates[`${i}`].timeZone != '') {
2478        const timeZoneBlock = tzlib_get_ical_block(data.dates[`${i}`].timeZone);
2479        if (!usedTimeZones.includes(data.dates[`${i}`].timeZone)) {
2480          ics_lines.push(timeZoneBlock[0]);
2481        }
2482        usedTimeZones.push(data.dates[`${i}`].timeZone);
2483        return ';' + timeZoneBlock[1];
2484      }
2485    })();
2486    ics_lines.push('BEGIN:VEVENT');
2487    ics_lines.push('UID:' + data.dates[`${i}`].uid);
2488    ics_lines.push('DTSTAMP:' + atcb_format_datetime(now, 'clean', true));
2489    ics_lines.push('DTSTART' + timeAddon + ':' + formattedDate.start);
2490    ics_lines.push('DTEND' + timeAddon + ':' + formattedDate.end);
2491    ics_lines.push('SUMMARY:' + data.dates[`${i}`].name.replace(/.{65}/g, '$&' + '\r\n ')); 
2492    if (data.dates[`${i}`].descriptionHtmlFree != null && data.dates[`${i}`].descriptionHtmlFree != '') {
2493      ics_lines.push(
2494        'DESCRIPTION:' +
2495          data.dates[`${i}`].descriptionHtmlFree.replace(/\n/g, '\\n').replace(/.{60}/g, '$&' + '\r\n ') // adjusting for intended line breaks + making sure it does not exceed 75 characters per line
2496      );
2497    }
2498    if (data.dates[`${i}`].description != null && data.dates[`${i}`].description != '') {
2499      ics_lines.push(
2500        'X-ALT-DESC;FMTTYPE=text/html:\r\n <!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 3.2//EN"">\r\n <HTML><BODY>\r\n ' +
2501          data.dates[`${i}`].description.replace(/\n/g, '<br>').replace(/.{60}/g, '$&' + '\r\n ') +
2502          '\r\n </BODY></HTML>'
2503      );
2504    }
2505    if (data.dates[`${i}`].location != null && data.dates[`${i}`].location != '') {
2506      ics_lines.push('LOCATION:' + data.dates[`${i}`].location);
2507    }
2508    if (data.dates[`${i}`].organizer != null && data.dates[`${i}`].organizer != '') {
2509      const organizerParts = data.dates[`${i}`].organizer.split('|');
2510      ics_lines.push('ORGANIZER;CN=' + organizerParts[0] + ':MAILTO:' + organizerParts[1]);
2511    }
2512    if (data.recurrence != null && data.recurrence != '') {
2513      ics_lines.push(data.recurrence);
2514    }
2515    if (data.dates[`${i}`].availability != null && data.dates[`${i}`].availability != '') {
2516      const transpVal = (function () {
2517        if (data.dates[`${i}`].availability == 'free') {
2518          return 'TRANSPARENT';
2519        }
2520        return 'OPAQUE';
2521      })();
2522      ics_lines.push('TRANSP:' + transpVal);
2523    }
2524    ics_lines.push('SEQUENCE:' + data.dates[`${i}`].sequence);
2525    ics_lines.push('STATUS:' + data.dates[`${i}`].status);
2526    ics_lines.push('CREATED:' + data.created);
2527    ics_lines.push('LAST-MODIFIED:' + data.updated);
2528    ics_lines.push('END:VEVENT');
2529  }
2530  ics_lines.push('END:VCALENDAR');
2531  const dataUrl = (function () {
2532    if (givenIcsFile != '') {
2533      return givenIcsFile;
2534    }
2535    return 'data:text/calendar;charset=utf-8,' + encodeURIComponent(ics_lines.join('\r\n'));
2536  })();
2537  if ((isiOS() && isChrome()) || (isWebView() && (isiOS() || (isAndroid() && isProblematicWebView())))) {
2538    atcb_ical_copy_note(dataUrl, data, keyboardTrigger);
2539    return;
2540  }
2541  atcb_save_file(dataUrl, filename);
2542}
2543function atcb_determine_ical_filename(data, subEvent) {
2544  const filenameSuffix = (function () {
2545    if (subEvent != 'all' && subEvent != 0) {
2546      return '-' + parseInt(subEvent) + 1;
2547    }
2548    return '';
2549  })();
2550  if (data.iCalFileName != null && data.iCalFileName != '') {
2551    return data.iCalFileName + filenameSuffix;
2552  }
2553  if (data.icsFile != null && data.icsFile != '') {
2554    const filenamePart = data.icsFile.split('/').pop().split('.')[0];
2555    if (filenamePart != '') {
2556      return filenamePart + filenameSuffix;
2557    }
2558  }
2559  return 'event-to-save-in-my-calendar' + filenameSuffix;
2560}
2561function atcb_ical_copy_note(dataUrl, data, keyboardTrigger) {
2562  atcb_copy_to_clipboard(dataUrl);
2563  if (isiOS() && isChrome()) {
2564    atcb_create_modal(
2565      data,
2566      'warning',
2567      atcb_translate_hook('modal.crios.ical.h', data),
2568      atcb_translate_hook('modal.crios.ical.text', data) +
2569        '<br>' +
2570        atcb_translate_hook('modal.clipboard.text', data) +
2571        '<br>' +
2572        atcb_translate_hook('modal.crios.ical.steps', data),
2573      [],
2574      [],
2575      keyboardTrigger
2576    );
2577    return;
2578  }
2579  atcb_create_modal(
2580    data,
2581    'warning',
2582    atcb_translate_hook('modal.webview.ical.h', data),
2583    atcb_translate_hook('modal.webview.ical.text', data) +
2584      '<br>' +
2585      atcb_translate_hook('modal.clipboard.text', data) +
2586      '<br>' +
2587      atcb_translate_hook('modal.webview.ical.steps', data),
2588    [],
2589    [],
2590    keyboardTrigger
2591  );
2592}
2593
2594
2595function atcb_saved_hook() {
2596  console.log('Event saved. Looking forward to it!');
2597}
2598function atcb_save_file(file, filename) {
2599  try {
2600    const save = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
2601    save.rel = 'noopener';
2602    save.href = file;
2603    if (isMobile()) {
2604      save.target = '_self';
2605    } else {
2606      save.target = '_blank';
2607    }
2608    save.download = filename + '.ics';
2609    const evt = new MouseEvent('click', {
2610      view: window,
2611      button: 0,
2612      bubbles: true,
2613      cancelable: false,
2614    });
2615    save.dispatchEvent(evt);
2616    (window.URL || window.webkitURL).revokeObjectURL(save.href);
2617  } catch (e) {
2618    console.error(e);
2619  }
2620}
2621function atcb_generate_time(data, style = 'delimiters', targetCal = 'general', addTimeZoneOffset = false) {
2622  if (data.startTime != null && data.startTime != '' && data.endTime != null && data.endTime != '') {
2623    const newStartDate = new Date(data.startDate + 'T' + data.startTime + ':00.000+00:00');
2624    const newEndDate = new Date(data.endDate + 'T' + data.endTime + ':00.000+00:00');
2625    const durationMS = newEndDate - newStartDate;
2626    const durationHours = Math.floor(durationMS / 1000 / 60 / 60);
2627    const durationMinutes = Math.floor(((durationMS - durationHours * 60 * 60 * 1000) / 1000 / 60) % 60);
2628    const durationString = (function () {
2629      if (durationHours < 10) {
2630        return '0' + durationHours + ':' + ('0' + durationMinutes).slice(-2);
2631      }
2632      return durationHours + ':' + ('0' + durationMinutes).slice(-2);
2633    })();
2634    if ((data.timeZone == null || (data.timeZone != null && data.timeZone == '')) && addTimeZoneOffset) {
2635      return {
2636        start: newStartDate.toISOString().replace('.000Z', '+00:00'),
2637        end: newEndDate.toISOString().replace('.000Z', '+00:00'),
2638        duration: durationString,
2639        allday: false,
2640      };
2641    }
2642    if (data.timeZone != null && data.timeZone != '') {
2643      if (
2644        targetCal == 'ical' ||
2645        (targetCal == 'google' &&
2646          !/(GMT[+|-]\d{1,2}
2646|Etc\/U|Etc\/Zulu|CET|CST6CDT|EET|EST|EST5EDT|MET|MST|MST7MDT|PST8PDT|WET)/i.test(
2647            data.timeZone
2648          ))
2649      ) {
2650        return {
2651          start: atcb_format_datetime(newStartDate, 'clean', true, true),
2652          end: atcb_format_datetime(newEndDate, 'clean', true, true),
2653          duration: durationString,
2654          allday: false,
2655        };
2656      }
2657      const offsetStart = tzlib_get_offset(data.timeZone, data.startDate, data.startTime);
2658      const offsetEnd = tzlib_get_offset(data.timeZone, data.endDate, data.endTime);
2659      if (addTimeZoneOffset) {
2660        const formattedOffsetStart = offsetStart.slice(0, 3) + ':' + offsetStart.slice(3);
2661        const formattedOffsetEnd = offsetEnd.slice(0, 3) + ':' + offsetEnd.slice(3);
2662        return {
2663          start: newStartDate.toISOString().replace('.000Z', formattedOffsetStart),
2664          end: newEndDate.toISOString().replace('.000Z', formattedOffsetEnd),
2665          duration: durationString,
2666          allday: false,
2667        };
2668      }
2669      const calcOffsetStart =
2670        parseInt(offsetStart[0] + 1) *
2671        -1 *
2672        ((parseInt(offsetStart.substr(1, 2)) * 60 + parseInt(offsetStart.substr(3, 2))) * 60 * 1000);
2673      const calcOffsetEnd =
2674        parseInt(offsetEnd[0] + 1) *
2675        -1 *
2676        ((parseInt(offsetEnd.substr(1, 2)) * 60 + parseInt(offsetEnd.substr(3, 2))) * 60 * 1000);
2677      newStartDate.setTime(newStartDate.getTime() + calcOffsetStart);
2678      newEndDate.setTime(newEndDate.getTime() + calcOffsetEnd);
2679    }
2680    return {
2681      start: atcb_format_datetime(newStartDate, style),
2682      end: atcb_format_datetime(newEndDate, style),
2683      duration: durationString,
2684      allday: false,
2685    };
2686  } else {
2687    const startDate = data.startDate.split('-');
2688    const endDate = data.endDate.split('-');
2689    const newStartDate = new Date(Date.UTC(startDate[0], startDate[1] - 1, startDate[2], 12, 0, 0));
2690    const newEndDate = new Date(Date.UTC(endDate[0], endDate[1] - 1, endDate[2], 12, 0, 0));
2691    if (targetCal == 'google' || targetCal == 'microsoft' || targetCal == 'ical') {
2692      newEndDate.setDate(newEndDate.getDate() + 1);
2693    }
2694    return {
2695      start: atcb_format_datetime(newStartDate, style, false),
2696      end: atcb_format_datetime(newEndDate, style, false),
2697      allday: true,
2698    };
2699  }
2700}
2701function atcb_format_datetime(datetime, style = 'delimiters', includeTime = true, removeZ = false) {
2702  const regex = (function () {
2703    if (includeTime) {
2704      if (style == 'clean') {
2705        return /(-|:|(\.\d{3}))/g;
2706      }
2707      return /(\.\d{3})/g;
2708    }
2709    if (style == 'clean') {
2710      return /(-|T(\d{2}:\d{2}:\d{2}\.\d{3})Z)/g;
2711    }
2712    return /T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g;
2713  })();
2714  const output = removeZ
2715    ? datetime.toISOString().replace(regex, '').replace('Z', '')
2716    : datetime.toISOString().replace(regex, '');
2717  return output;
2718}
2719function atcb_secure_content(data, isJSON = true) {
2720  const toClean = isJSON ? JSON.stringify(data) : data;
2721  const cleanedUp = toClean.replace(/(<(?!br)([^>]+)>)/gi, '');
2722  if (isJSON) {
2723    return JSON.parse(cleanedUp);
2724  } else {
2725    return cleanedUp;
2726  }
2727}
2728function atcb_secure_url(url, throwError = true) {
2729  if (
2730    url.match(
2731      /((\.\.\/)|(\.\.\\)|(%2e%2e%2f)|(%252e%252e%252f)|(%2e%2e\/)|(%252e%252e\/)|(\.\.%2f)|(\.\.%252f)|(%2e%2e%5c)|(%252e%252e%255c)|(%2e%2e\\)|(%252e%252e\\)|(\.\.%5c)|(\.\.%255c)|(\.\.%c0%af)|(\.\.%25c0%25af)|(\.\.%c1%9c)|(\.\.%25c1%259c))/gi
2732    )
2733  ) {
2734    if (throwError) {
2735      console.error(
2736        'Seems like the generated URL includes at least one security issue and got blocked. Please check the calendar button parameters!'
2737      );
2738    }
2739    return false;
2740  } else {
2741    return true;
2742  }
2743}
2744function atcb_validEmail(email, mx = false) {
2745  if (!/^.{0,70}@.{1,30}\.[\w.]{2,9}$/.test(email)) {
2746    return false;
2747  }
2748  if (mx) {
2749    console.log('Testing for MX records not yet available');
2750  }
2751  return true;
2752}
2753function atcb_rewrite_html_elements(content, clear = false) {
2754  content = content.replace(/<br\s*\/?>/gi, '\n');
2755  if (clear) {
2756    content = content.replace(/\[(|\/)(url|br|hr|p|b|strong|u|i|em|li|ul|ol|h\d)\]|((\|.*)\[\/url\])/gi, '');
2757  } else {
2758    content = content.replace(/\[(\/|)(br|hr|p|b|strong|u|i|em|li|ul|ol|h\d)\]/gi, '<$1$2>');
2759    content = content.replace(/\[url\]([\w&$+.,:;=~!*'?@^%#|\s\-()/]*)\[\/url\]/gi, function (match, p1) {
2760      const urlText = p1.split('|');
2761      const text = (function () {
2762        if (urlText.length > 1 && urlText[1] != '') {
2763          return urlText[1];
2764        } else {
2765          return urlText[0];
2766        }
2767      })();
2768      return (
2769        '<a href="' + urlText[0] + '" target="' + atcbDefaultTarget + '" rel="noopener">
2769' + text + '</a>'
2770      );
2771    });
2772  }
2773  return content;
2774}
2775function atcb_position_list(trigger, list, blockUpwards = false, resize = false) {
2776  let anchorSet = false;
2777  const originalTrigger = trigger;
2778  if (trigger.querySelector('.atcb-dropdown-anchor') !== null) {
2779    trigger = trigger.querySelector('.atcb-dropdown-anchor');
2780    anchorSet = true;
2781  }
2782  let triggerDim = trigger.getBoundingClientRect();
2783  let listDim = list.getBoundingClientRect();
2784  const btnDim = originalTrigger.getBoundingClientRect();
2785  const viewportHeight = document.documentElement.clientHeight;
2786  const posWrapper = document.getElementById('atcb-pos-wrapper');
2787  if (posWrapper !== null) {
2788    posWrapper.style.height = viewportHeight + 'px';
2789  }
2790  if (anchorSet === true && !list.classList.contains('atcb-dropoverlay')) {
2791    if (
2792      (list.classList.contains('atcb-dropup') && resize) ||
2793      (!blockUpwards &&
2794        !resize &&
2795        triggerDim.top + listDim.height > viewportHeight - 20 &&
2796        2 * btnDim.top + btnDim.height - triggerDim.top - listDim.height > 20)
2797    ) {
2798      originalTrigger.classList.add('atcb-dropup');
2799      list.classList.add('atcb-dropup');
2800      list.style.bottom =
2801        2 * viewportHeight -
2802        (viewportHeight + (btnDim.top + (btnDim.top + btnDim.height - triggerDim.top))) -
2803        window.scrollY +
2804        'px';
2805    } else {
2806      list.style.top = window.scrollY + triggerDim.top + 'px';
2807      if (originalTrigger.classList.contains('atcb-dropup')) {
2808        originalTrigger.classList.remove('atcb-dropup');
2809      }
2810    }
2811    triggerDim = trigger.getBoundingClientRect();
2812    if (list.classList.contains('atcb-style-bubble') || list.classList.contains('atcb-style-text')) {
2813      list.style.minWidth = triggerDim.width + 'px';
2814    } else {
2815      list.style.width = triggerDim.width + 'px';
2816    }
2817    listDim = list.getBoundingClientRect();
2818    list.style.left = triggerDim.left - (listDim.width - triggerDim.width) / 2 + 'px';
2819  } else {
2820    list.style.minWidth = btnDim.width + 20 + 'px';
2821    listDim = list.getBoundingClientRect();
2822    list.style.top = window.scrollY + btnDim.top + btnDim.height / 2 - listDim.height / 2 + 'px';
2823    list.style.left = btnDim.left - (listDim.width - btnDim.width) / 2 + 'px';
2824  }
2825  const atcbL = document.getElementById('add-to-calendar-button-reference');
2826  if (atcbL) {
2827    if (originalTrigger.classList.contains('atcb-dropup')) {
2828      atcbL.style.top = window.scrollY + btnDim.top + btnDim.height + 'px';
2829      atcbL.style.left = btnDim.left + (btnDim.width - 150) / 2 + 'px';
2830    } else {
2831      listDim = list.getBoundingClientRect();
2832      if (originalTrigger.classList.contains('atcb-dropoverlay') || !anchorSet) {
2833        atcbL.style.top = window.scrollY + listDim.top + listDim.height + 'px';
2834      } else {
2835        atcbL.style.top = window.scrollY + triggerDim.top + listDim.height + 'px';
2836      }
2837      atcbL.style.left = listDim.left + (listDim.width - 150) / 2 + 'px';
2838    }
2839  }
2840}
2841function atcb_manage_body_scroll(modalObj = null) {
2842  const modal = (function () {
2843    if (modalObj != null) {
2844      return modalObj;
2845    } else {
2846      const allModals = document.querySelectorAll('.atcb-modal');
2847      if (allModals.length == 0) {
2848        return null;
2849      }
2850      return allModals[allModals.length - 1];
2851    }
2852  })();
2853  if (modal == null) {
2854    return;
2855  }
2856  const modalDim = modal.getBoundingClientRect();
2857  if (modalDim.height + 100 > window.innerHeight) {
2858    document.body.classList.add('atcb-modal-no-scroll');
2859  } else {
2860    document.body.classList.remove('atcb-modal-no-scroll');
2861  }
2862}
2863function atcb_set_fullsize(el) {
2864  el.style.width = window.innerWidth + 'px';
2865  el.style.height = window.innerHeight + 100 + 'px';
2866}
2867function atcb_set_sizes(el, size) {
2868  el.style.setProperty('--base-font-size-l', size.l + 'px');
2869  el.style.setProperty('--base-font-size-m', size.m + 'px');
2870  el.style.setProperty('--base-font-size-s', size.s + 'px');
2871}
2872function atcb_generate_uuid() {
2873  return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>
2874    (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
2875  );
2876}
2877function atcb_copy_to_clipboard(dataString) {
2878  const tmpInput = document.createElement('input');
2879  document.body.appendChild(tmpInput);
2880  const editable = tmpInput.contentEditable;
2881  const readOnly = tmpInput.readOnly;
2882  tmpInput.value = dataString;
2883  tmpInput.contentEditable = true;
2884  tmpInput.readOnly = false;
2885  if (isiOS()) {
2886    var range = document.createRange();
2887    range.selectNodeContents(tmpInput);
2888    var selection = window.getSelection();
2889    selection.removeAllRanges();
2890    selection.addRange(range);
2891    tmpInput.setSelectionRange(0, 999999);
2892  } else {
2893    navigator.clipboard.writeText(dataString);
2894    tmpInput.select();
2895  }
2896  tmpInput.contentEditable = editable;
2897  tmpInput.readOnly = readOnly;
2898  document.execCommand('copy');
2899  tmpInput.remove();
2900}
2901function atcb_debounce(func, timeout = 200) {
2902  let timer;
2903  return (...args) => {
2904    clearTimeout(timer);
2905    timer = setTimeout(() => {
2906      func.apply(this, args);
2907    }, timeout);
2908  };
2909}
2910function atcb_debounce_leading(func, timeout = 300) {
2911  let timer;
2912  return (...args) => {
2913    if (!timer) {
2914      func.apply(this, args);
2915    }
2916    clearTimeout(timer);
2917    timer = setTimeout(() => {
2918      timer = undefined;
2919    }, timeout);
2920  };
2921}
2922function atcb_throttle(func, delay = 10) {
2923  let result;
2924  let timeout = null;
2925  let previous = 0;
2926  let later = (...args) => {
2927    previous = Date.now();
2928    timeout = null;
2929    result = func.apply(this, args);
2930  };
2931  return (...args) => {
2932    let now = Date.now();
2933    let remaining = delay - (now - previous);
2934    if (remaining <= 0 || remaining > delay) {
2935      if (timeout) {
2936        clearTimeout(timeout);
2937        timeout = null;
2938      }
2939      previous = now;
2940      result = func.apply(this, args);
2941    } else if (!timeout) {
2942      timeout = setTimeout(later, remaining);
2943    }
2944    return result;
2945  };
2946}
2947
2948
2949const i18nStrings = {
2950  en: {
2951    'Add to Calendar': 'Add to Calendar',
2952    'iCal File': 'iCal File',
2953    Close: 'Close',
2954    'Close Selection': 'Close Selection',
2955    'Click me': 'Click me',
2956    'modal.webview.ical.h': 'Open your browser',
2957    'modal.webview.ical.text':
2958      'Unfortunately, in-app browsers have problems with the way we generate the calendar file.',
2959    'modal.clipboard.text': 'We automatically copied a magical URL into your clipboard.',
2960    'modal.webview.ical.steps':
2961      '<ol><li><strong>Open another browser</strong> on your phone, ...</li><li><strong>Paste</strong> the clipboard content and go.</li></ol>',
2962    'modal.crios.ical.h': 'Open Safari',
2963    'modal.crios.ical.text':
2964      'Unfortunately, Chrome on iOS has problems with the way we generate the calendar file.',
2965    'modal.crios.ical.steps':
2966      '<ol><li><strong>Open Safari</strong>, ...</li><li><strong>Paste</strong> the clipboard content and go.</li></ol>',
2967    'modal.multidate.h': 'This is an event series',
2968    'modal.multidate.text': 'Add the individual events one by one:',
2969    Event: 'Event',
2970    'Cancelled Date': 'This date got cancelled.',
2971    'Delete from Calendar': 'Please update your calendar!',
2972    'modal.subscribe.yahoo.h': 'Add Calendar to Yahoo',
2973    'modal.subscribe.yahoo.text':
2974      '<ol><li>Open now the Yahoo Calendar.</li><li>Click the "Actions" tab.</li><li>Hit "Follow Other Calendars".</li><li>Set a name and past the clipboard content into the url field.</li></ol>',
2975    Cancel: 'Cancel',
2976  },
2977  de: {
2978    'Add to Calendar': 'Im Kalender speichern',
2979    'iCal File': 'iCal-Datei',
2980    Close: 'Schließen',
2981    'Close Selection': 'Auswahl schließen',
2982    'Click me': 'Klick mich',
2983    'modal.webview.ical.h': 'Öffne deinen Browser',
2984    'modal.webview.ical.text':
2985      'Leider haben In-App-Browser Probleme mit der Art, wie wir Kalender-Dateien erzeugen.',
2986    'modal.clipboard.text': 'Wir haben automatisch eine magische URL in deine Zwischenablage kopiert.',
2987    'modal.webview.ical.steps':
2988      '<ol><li><strong>Öffne einen anderen Browser</strong> auf deinem Smartphone, ...</li><li>Nutze die <strong>Einfügen</strong>-Funktion, um fortzufahren.</li></ol>',
2989    'modal.crios.ical.h': 'Öffne Safari',
2990    'modal.crios.ical.text':
2991      'Leider Chrome unter iOS Probleme mit der Art, wie wir Kalender-Dateien erzeugen.',
2992    'modal.crios.ical.steps':
2993      '<ol><li><strong>Öffne Safari</strong>, ...</li><li>Nutze die <strong>Einfügen</strong>-Funktion, um fortzufahren.</li></ol>',
2994    'modal.multidate.h': 'Dies is eine Termin-Reihe',
2995    'modal.multidate.text': 'Füge die einzelnen Termine der Reihe nach deinem Kalender hinzu:',
2996    Event: 'Termin',
2997    'Cancelled Date': 'Dieser Termin wurde abgesagt.',
2998    'Delete from Calendar': 'Bitte aktualisiere deinen Kalender!',
2999    'modal.subscribe.yahoo.h': 'Kalender zu Yahoo hinzufügen',
3000    'modal.subscribe.yahoo.text':
3001      '<ol><li>Öffne den Yahoo Kalender.</li><li>Klicke auf den "Aktionen" Tab.</li><li>Wähle "Weiteren Kalendern folgen".</li><li>Wähle einen Namen und füge die URL aus deiner Zwischenablage in das URL-Feld ein.</li></ol>',
3002    Cancel: 'Abbrechen',
3003  },
3004  es: {
3005    'Add to Calendar': 'Añadir al Calendario',
3006    'iCal File': 'iCal Ficha',
3007    Close: 'Ciérralo',
3008    'Close Selection': 'Cerrar Selección',
3009    'Click me': 'Haz clic mí',
3010    'modal.webview.ical.h': 'Abra su browser',
3011    'modal.webview.ical.text':
3012      'Lamentablemente, los browsers in-app tienen problemas con la forma en que generamos el archivo del calendario.',
3013    'modal.clipboard.text': 'Hemos copiado automáticamente una URL mágica en su portapapeles.',
3014    'modal.webview.ical.steps':
3015      '<ol><li><strong>Abre otro browser</strong> en tu smartphone, ...</li><li>Utilice la función de <strong>pegar</strong> para continuar.</li></ol>',
3016    'modal.crios.ical.h': 'Abrir Safari',
3017    'modal.crios.ical.text':
3018      'Lamentablemente, Chrome en iOS tiene problemas con la forma de generar el archivo de calendario.',
3019    'modal.crios.ical.steps':
3020      '<ol><li><strong>Abrir Safari</strong>, ...</li><li>Utilice la función de <strong>pegar</strong> para continuar.</li></ol>',
3021    'modal.multidate.h': 'Esta es una serie de fechas',
3022    'modal.multidate.text': 'Añada las fechas individuales a su calendario en orden:',
3023    Event: 'Término',
3024    'Cancelled Date': 'Esta fecha fue cancelada.',
3025    'Delete from Calendar': 'Actualice su calendario!',
3026    'modal.subscribe.yahoo.h': 'Añadir calendario a Yahoo',
3027    'modal.subscribe.yahoo.text':
3028      '<ol><li>Abra el calendario de Yahoo.</li><li>Haga clic en la pestaña "Acciones".</li><li>Seleccione "Seguir otros calendarios".</li><li>Elige un nombre y pega la URL de tu portapapeles en el campo URL.</li></ol>',
3029    Cancel: 'Cancelar',
3030  },
3031  pt: {
3032    'Add to Calendar': 'Incluir no Calendário',
3033    'iCal File': 'Ficheiro iCal',
3034    Close: 'Fechar',
3035    'Close Selection': 'Fechar selecção',
3036    'Click me': 'Clicar-me',
3037    'modal.webview.ical.h': 'Abra o seu browser',
3038    'modal.webview.ical.text':
3039      'Infelizmente, os navegadores em tampas têm problemas com a forma como geramos o ficheiro de calendário.',
3040    'modal.clipboard.text': 'Copiámos automaticamente um URL mágico para a sua área de transferência.',
3041    'modal.webview.ical.steps':
3042      '<ol><li><strong>Abrir outro browser</strong> en tu smartphone, ...</li><li>Use a função <forte>colar</strong> para continuar.</li></ol>',
3043    'modal.crios.ical.h': 'Safari aberto',
3044    'modal.crios.ical.text':
3045      'Infelizmente, o cromado no iOS tem problemas com a forma como geramos o ficheiro do calendário.',
3046    'modal.crios.ical.steps':
3047      '<ol><li><strong>Safari aberto</strong>, ...</li><li>Use a função <forte>colar</strong> para continuar.</li></ol>',
3048    'modal.multidate.h': 'Esta é uma série de datas',
3049    'modal.multidate.text': 'Adicione as datas individuais ao seu calendário, por ordem:',
3050    Event: 'Termo',
3051    'Cancelled Date': 'Esta data foi cancelada.',
3052    'Delete from Calendar': 'Actualize o seu calendário!',
3053    'modal.subscribe.yahoo.h': 'Adicionar calendário ao Yahoo',
3054    'modal.subscribe.yahoo.text':
3055      '<ol><li>Abrir o calendário do Yahoo.</li><li>Clique no separador "Acções".</li><li>Seleccione "Seguir outros calendários".</li><li>Escolha um nome e cole o URL da sua área de transferência no campo URL.</li></ol>',
3056    Cancel: 'Cancelar',
3057  },
3058  fr: {
3059    'Add to Calendar': 'Ajout au Agenda',
3060    'iCal File': 'iCal Fichier',
3061    Close: 'Fermez',
3062    'Close Selection': 'Fermez la sélection',
3063    'Click me': 'Cliquez-moi',
3064    'modal.webview.ical.h': 'Ouvrez votre navigateur',
3065    'modal.webview.ical.text':
3066      'Malheureusement, les navigateurs in-app ont des problèmes avec la manière dont nous créons les fichiers de agenda.',
3067    'modal.clipboard.text': 'Nous avons automatiquement copié une URL magique dans ton presse-papiers.',
3068    'modal.webview.ical.steps':
3069      '<ol><li><strong>Ouvre un autre navigateur</strong> sur ton smartphone, ...</li><li>Utilise la fonction <strong>insérer</strong> pour continuer.</li></ol>',
3070    'modal.crios.ical.h': 'Ouvre Safari',
3071    'modal.crios.ical.text':
3072      'Malheureusement, Chrome sur iOS a des problèmes avec la façon dont nous générons le fichier du agenda.',
3073    'modal.crios.ical.steps':
3074      '<ol><li><strong>Ouvre Safari</strong>, ...</li><li>Utilise la fonction <strong>insérer</strong> pour continuer.</li></ol>',
3075    'modal.multidate.h': "Il s'agit d'une série d'événements",
3076    'modal.multidate.text': "Ajoute les différents rendez-vous dans l'ordre à ton agenda:",
3077    Event: 'Terminaison',
3078    'Cancelled Date': 'Cette date est annulée.',
3079    'Delete from Calendar': 'Actualisez votre agenda!',
3080    'modal.subscribe.yahoo.h': 'Ajouter un agenda à Yahoo',
3081    'modal.subscribe.yahoo.text':
3082      '<ol><li>Ouvre le Yahoo calendar.</li><li>Clique sur l\'onglet "Actions".</li><li>Sélectionne "Suivre d\'autres agendas".</li><li>Choisis un nom et colle l\'URL de ton presse-papiers dans le champ URL.</li></ol>',
3083    Cancel: 'Annuler',
3084  },
3085  nl: {
3086    'Add to Calendar': 'Opslaan in Agenda',
3087    'iCal File': 'iCal File',
3088    Close: 'Sluiten',
3089    'Close Selection': 'Sluit selectie',
3090    'Click me': 'Klik me',
3091    'modal.webview.ical.h': 'Open uw browser',
3092    'modal.webview.ical.text':
3093      'Helaas hebben in-app browsers problemen met de manier waarop wij kalenderbestanden maken.',
3094    'modal.clipboard.text': 'We hebben automatisch een magische URL naar je klembord gekopieerd.',
3095    'modal.webview.ical.steps':
3096      '<ol><li><strong>Open een andere browser</strong> op uw smartphone, ...</li><li>Gebruik de <strong>insert</strong> functie om verder te gaan.</li></ol>',
3097    'modal.crios.ical.h': 'Open Safari',
3098    'modal.crios.ical.text':
3099      'Helaas heeft Chrome op iOS problemen met de manier waarop we het kalenderbestand genereren.',
3100    'modal.crios.ical.steps':
3101      '<ol><li><strong>Open Safari</strong>, ...</li><li>Gebruik de <strong>insert</strong> functie om verder te gaan.</li></ol>',
3102    'modal.multidate.h': 'Dit is een reeks data',
3103    'modal.multidate.text': 'Voeg de afzonderlijke delen één voor één toe:',
3104    Event: 'Termin',
3105    'Cancelled Date': 'Deze datum is geannuleerd.',
3106    'Delete from Calendar': 'Uw agenda bijwerken!',
3107    'modal.subscribe.yahoo.h': 'Toevoegen aan Yahoo',
3108    'modal.subscribe.yahoo.text':
3109      '<ol><li>Open de Yahoo calendar.</li><li>Klik op de "Acties" tab.</li><li>Selecteer "Volg Andere Agenda\'s".</li><li>Kies een naam en plak de URL van uw klembord in het URL-veld.</li></ol>',
3110    Cancel: 'Annuleren',
3111  },
3112  tr: {
3113    'Add to Calendar': 'Takvime Ekle',
3114    'iCal File': 'iCal Dosyası',
3115    Close: 'Kapat',
3116    'Close Selection': 'Seçimi kapat',
3117    'Click me': 'Beni tıklayın',
3118    'modal.webview.ical.h': 'Tarayıcınızı açın',
3119    'modal.webview.ical.text':
3120      'Ne yazık ki, uygulama içi tarayıcılar takvim dosyalarını oluşturma şeklimizle ilgili sorunlar yaşıyor.',
3121    'modal.clipboard.text': 'Panonuza otomatik olarak sihirli bir URL kopyaladık.',
3122    'modal.webview.ical.steps':
3123      '<ol><li><strong>Akıllı telefonunuzda başka bir tarayıcı açın</strong>, ...</li><li>Devam etmek için <strong>insert</strong> fonksiyonunu kullanın.</li></ol>',
3124    'modal.crios.ical.h': 'Açık Safari',
3125    'modal.crios.ical.text':
3126      "Ne yazık ki iOS'ta Chrome'un takvim dosyası oluşturma yöntemiyle ilgili sorunları var.",
3127    'modal.crios.ical.steps':
3128      '<ol><li><strong>Açık Safari</strong>, ...</li><li>Devam etmek için <strong>insert</strong> fonksiyonunu kullanın.</li></ol>',
3129    'modal.multidate.h': 'Bu bir etkinlik serisidir',
3130    'modal.multidate.text': 'Parçaları teker teker ekleyin:',
3131    Event: 'Etkinlik',
3132    'Cancelled Date': 'Bu tarih iptal edildi.',
3133    'Delete from Calendar': 'Lütfen takviminizi güncelleyin!',
3134    'modal.subscribe.yahoo.h': "Yahoo'ya takvim ekleme",
3135    'modal.subscribe.yahoo.text':
3136      '<ol><li>Yahoo takvimini açın.</li><li>"Eylemler" sekmesine tıklayın.</li><li>"Diğer Takvimleri Takip Et" öğesini seçin.</li><li>Bir ad seçin ve URL\'yi panonuzdan URL alanına yapıştırın.</li></ol>',
3137    Cancel: 'İptal',
3138  },
3139  zh: {
3140    'Add to Calendar': '添加到日历',
3141    'iCal File': 'iCal 文件',
3142    Close: '关',
3143    'Close Selection': '关闭选择',
3144    'Click me': '点我',
3145    'modal.webview.ical.h': '打开浏览器',
3146    'modal.webview.ical.text': '不幸的是,应用内浏览器在我们生成日历文件的方式上存在问题。',
3147    'modal.clipboard.text': '我们自动将魔术 URL 复制到您的剪贴板。',
3148    'modal.webview.ical.steps':
3149      '<ol><li>打开手机上的任何其他浏览器, ...</li><li>粘贴剪贴板内容并开始。</li></ol>',
3150    'modal.crios.ical.h': '打开 Safari',
3151    'modal.crios.ical.text': '不幸的是,iOS 上的 Chrome 在我们生成日历文件的方式上存在问题。',
3152    'modal.crios.ical.steps':
3153      '<ol><li><strong>打开 Safari</strong>, ...</li><li>粘贴剪贴板内容并开始。</li></ol>',
3154    'modal.multidate.h': '这是一个活动系列',
3155    'modal.multidate.text': '逐个添加各个部分:',
3156    Event: '事件',
3157    'Cancelled Date': '此日期已取消。',
3158    'Delete from Calendar': '请更新您的日历!',
3159    'modal.subscribe.yahoo.h': '将日历添加到 Yahoo',
3160    'modal.subscribe.yahoo.text':
3161      '<ol><li>打开 Yahoo 日历。</li><li>点击“操作”标签。</li><li>选择“关注其他日历”。</li><li>选择一个名称并将剪贴板中的 URL 粘贴到 URL 字段中。</li></ol>',
3162    Cancel: '中止',
3163  },
3164  ar: {
3165    'Add to Calendar': 'إضافة إلى التقويم',
3166    'iCal File': 'ملف iCal',
3167    Close: 'قريب',
3168    'Close Selection': 'إغلاق التحديد',
3169    'Click me': 'انقر فوق لي',
3170    'modal.webview.ical.h': 'افتح المستعرض الخاص بك',
3171    'modal.webview.ical.text': 'لسوء الحظ ، تواجه المتصفحات داخل التطبيق مشاكل في طريقة إنشاء ملف التقويم.',
3172    'modal.clipboard.text': 'قمنا تلقائيًا بنسخ عنوان URL سحري إلى الحافظة الخاصة بك.',
3173    'modal.webview.ical.steps':
3174      '<ol><li>افتح أي متصفح آخر على هاتفك الذكي, ...</li><li>.الصق محتوى الحافظة واذهب</li></ol>',
3175    'modal.crios.ical.h': 'افتح Safari',
3176    'modal.crios.ical.text': 'لسوء الحظ ، يواجه Chrome على iOS مشاكل في طريقة إنشاء ملف التقويم',
3177    'modal.crios.ical.steps':
3178      '<ol><li><strong>افتح Safari</strong>, ...</li><li>الصق محتوى الحافظة واذهب.</li></ol>',
3179    'modal.multidate.h': 'هذه سلسلة أحداث',
3180    'modal.multidate.text': 'أضف الأجزاء الفردية واحدة تلو الأخرى:',
3181    Event: 'حدث',
3182    'Cancelled Date': 'تم إلغاء هذا التاريخ.',
3183    'Delete from Calendar': 'الرجاء تحديث التقويم الخاص بك!',
3184    'modal.subscribe.yahoo.h': 'أضف التقويم إلى Yahoo',
3185    'modal.subscribe.yahoo.text':
3186      '<ol><li>افتح تقويم Yahoo.</li><li>انقر فوق علامة التبويب "الإجراءات".</li><li>حدد "متابعة تقويمات أخرى".</li><li>اختر اسمًا والصق عنوان URL من الحافظة الخاصة بك في حقل URL.</li></ol>',
3187    Cancel: 'إحباط',
3188  },
3189  hi: {
3190    'Add to Calendar': 'कैलेंडर में जोड़ें',
3191    'iCal File': 'iCal फ़ाइल',
3192    Close: 'बंद करना',
3193    'Close Selection': 'चयन बंद करें',
3194    'Click me': 'मुझे क्लिक करें',
3195    'modal.webview.ical.h': 'अपना ब्राउज़र खोलें',
3196    'modal.webview.ical.text':
3197      'दुर्भाग्य से, इन-ऐप ब्राउज़र में कैलेंडर फ़ाइल बनाने के तरीके में समस्याएँ हैं।',
3198    'modal.clipboard.text': 'हमने आपके क्लिपबोर्ड पर स्वचालित रूप से एक जादुई URL कॉपी कर लिया है।',
3199    'modal.webview.ical.steps':
3200      '<ol><li>अपने फ़ोन पर <strong>दूसरा ब्राउज़र खोलें</strong>, ...</li><li>क्लिपबोर्ड सामग्री <strong>चिपकाएं</strong> और जाएं।</li></ol>',
3201    'modal.crios.ical.h': 'सफारी खोलें',
3202    'modal.crios.ical.text':
3203      'दुर्भाग्य से, iOS पर Chrome को कैलेंडर फ़ाइल जेनरेट करने के हमारे तरीके में समस्या है।',
3204    'modal.crios.ical.steps':
3205      '<ol><li><strong>सफारी खोलें</strong>, ...</li><li>क्लिपबोर्ड सामग्री <strong>चिपकाएं</strong> और जाएं।</li></ol>',
3206    'modal.multidate.h': 'यह एक इवेंट सीरीज़ है',
3207    'modal.multidate.text': 'अलग-अलग हिस्सों को एक-एक करके जोड़ें:',
3208    Event: 'आयोजन',
3209    'Cancelled Date': 'यह तिथि रद्द हो गई।',
3210    'Delete from Calendar': 'कृपया अपना कैलेंडर अपडेट करें!',
3211    'modal.subscribe.yahoo.h': 'Yahoo . में कैलेंडर जोड़ें',
3212    'modal.subscribe.yahoo.text':
3213      '<ol><li>Yahoo कैलेंडर खोलें।</li><li>"कृती" टैब पर क्लिक करें।</li><li>"इतर कॅलेंडर्सचे अनुसरण करा" चुनें।</li><li>एक नाम चुनें और अपने क्लिपबोर्ड से URL को URL फ़ील्ड में पेस्ट करें।</li></ol>',
3214    Cancel: 'रद्द करना',
3215  },
3216  pl: {
3217    'Add to Calendar': 'Dodaj do kalendarza',
3218    'iCal File': 'Plik iCal',
3219    Close: 'Zamknij',
3220    'Close Selection': 'Zamknij wybór',
3221    'Click me': 'Kliknij mnie',
3222    'modal.webview.ical.h': 'Otwórz przeglądarkę',
3223    'modal.webview.ical.text':
3224      'Niestety, przeglądarki in-app mają problemy ze sposobem, w jaki generujemy plik kalendarza.',
3225    'modal.clipboard.text': 'Automatycznie skopiowaliśmy magiczny adres URL do schowka.',
3226    'modal.webview.ical.steps':
3227      '<ol><li><strong>Otwórz inną przeglądarkę</strong> w swoim telefonie, ...</li><li><strong>Wklej</strong> zawartość schowka i ruszaj.</li></ol>',
3228    'modal.crios.ical.h': 'Otwórz Safari',
3229    'modal.crios.ical.text': 'Niestety, Chrome na iOS ma problemy ze sposobem generowania pliku kalendarza.',
3230    'modal.crios.ical.steps':
3231      '<ol><li><strong>Otwórz Safari</strong>, ...</li><li><strong>Wklej</strong> zawartość schowka i ruszaj.</li></ol>',
3232    'modal.multidate.h': 'To jest cykl imprez',
3233    'modal.multidate.text': 'Dodawać po kolei poszczególne części:',
3234    Event: 'Wydarzenie',
3235    'Cancelled Date': 'Ta data została odwołana.',
3236    'Delete from Calendar': 'Zaktualizuj swój kalendarz!',
3237    'modal.subscribe.yahoo.h': 'Dodaj kalendarz do Yahoo',
3238    'modal.subscribe.yahoo.text':
3239      '<ol><li>Otwórz kalendarz Yahoo.</li><li>Kliknij na zakładkę "Czynności".</li><li>Wybierz "Obserwuj inne kalendarze".</li><li>Wybierz nazwę i wklej adres URL ze schowka w polu URL.</li></ol>',
3240    Cancel: 'Anuluj',
3241  },
3242  id: {
3243    'Add to Calendar': 'Tambahkan ke Kalender',
3244    'iCal File': 'File iCal',
3245    Close: 'Tutup',
3246    'Close Selection': 'Seleksi Tutup',
3247    'Click me': 'Klik saya',
3248    'modal.webview.ical.h': 'Buka browser Anda',
3249    'modal.webview.ical.text':
3250      'Sayangnya, browser dalam aplikasi memiliki masalah dengan cara kami menghasilkan file kalender.',
3251    'modal.clipboard.text': 'Kami telah secara otomatis menyalin URL ajaib ke 
3251clipboard Anda.',
3252    'modal.webview.ical.steps':
3253      '<ol><li><strong>Buka peramban lain</strong> pada ponsel Anda, ...</li><li>Tempelkan konten clipboard dan pergi.</li></ol>',
3254    'modal.crios.ical.h': 'Buka Safari',
3255    'modal.crios.ical.text':
3256      'Sayangnya, Chrome di iOS memiliki masalah dengan cara kami menghasilkan file kalender.',
3257    'modal.crios.ical.steps':
3258      '<ol><li><strong>Buka Safari</strong>, ...</li><li>Tempelkan konten clipboard dan pergi.</li></ol>',
3259    'modal.multidate.h': 'Ini adalah rangkaian acara',
3260    'modal.multidate.text': 'Tambahkan masing-masing bagian satu per satu:',
3261    Event: 'Acara',
3262    'Cancelled Date': 'Tanggal ini dibatalkan.',
3263    'Delete from Calendar': 'Perbarui kalender Anda!',
3264    'modal.subscribe.yahoo.h': 'Tambahkan kalender ke Yahoo',
3265    'modal.subscribe.yahoo.text':
3266      '<ol><li>Buka kalender Yahoo.</li><li>Klik pada tab "Tindakan".</li><li>Pilih "Ikuti Kalender Lain".</li><li>Pilih nama dan tempelkan URL dari clipboard Anda ke bidang URL.</li></ol>',
3267    Cancel: 'Batal',
3268  },
3269  no: {
3270    'Add to Calendar': 'Legg til i kalenderen',
3271    'iCal File': 'iCal-fil',
3272    Close: 'Lukk',
3273    'Close Selection': 'Lukk utvalg',
3274    'Click me': 'Klikk på meg',
3275    'modal.webview.ical.h': 'Åpne nettleseren din',
3276    'modal.webview.ical.text':
3277      'Dessverre har nettlesere i appen problemer med måten vi genererer kalenderfilen på.',
3278    'modal.clipboard.text': 'Vi kopierte automatisk en magisk URL til utklippstavlen din.',
3279    'modal.webview.ical.steps':
3280      '<ol><li><strong>Åpne en annen nettleser</strong> på telefonen, ...</li><li><strong>Lim inn</strong> innholdet på utklippstavlen og gå.</li></ol>',
3281    'modal.crios.ical.h': 'Åpne Safari',
3282    'modal.crios.ical.text': 'Dessverre har Chrome på iOS problemer med måten vi genererer kalenderfilen på.',
3283    'modal.crios.ical.steps':
3284      '<ol><li><strong>Åpne Safari</strong>, ...</li><li><strong>Lim inn</strong> innholdet på utklippstavlen og gå.</li></ol>',
3285    'modal.multidate.h': 'Dette er en avtaleserie',
3286    'modal.multidate.text': 'Legg til de enkelte datoene i kalenderen din i rekkefølge:',
3287    Event: 'Møte',
3288    'Cancelled Date': 'Denne datoen ble avlyst.',
3289    'Delete from Calendar': 'Oppdater kalenderen din!',
3290    'modal.subscribe.yahoo.h': 'Legg til kalender til Yahoo',
3291    'modal.subscribe.yahoo.text':
3292      '<ol><li>Åpne Yahoo-kalenderen.</li><li>Klikk på «Handlinger»-fanen.</li><li>Velg «Følg andre kalendere».</li><li>Velg et navn og lim inn URL-en fra utklippstavlen i URL-feltet.</li></ol>',
3293    Cancel: 'Avbryt',
3294  },
3295  fi: {
3296    'Add to Calendar': 'Lisää kalenteriin',
3297    'iCal File': 'iCal-tiedosto',
3298    Close: 'Sulje',
3299    'Close Selection': 'Sulje valinta',
3300    'Click me': 'Klikkaa minua',
3301    'modal.webview.ical.h': 'Avaa selain',
3302    'modal.webview.ical.text':
3303      'Valitettavasti sovelluksen sisäisillä selaimilla on ongelmia kalenteritiedoston luomisessa.',
3304    'modal.clipboard.text': 'Olemme automaattisesti kopioineet maagisen URL-osoitteen leikepöydällesi.',
3305    'modal.webview.ical.steps':
3306      '<ol><li><strong>Avaa toinen selain</strong> puhelimessasi., ...</li><li><strong>liitä</strong> leikepöydän sisältö ja lähde.</li></ol>',
3307    'modal.crios.ical.h': 'Avaa Safari',
3308    'modal.crios.ical.text': 'Valitettavasti iOS:n Chromessa on ongelmia kalenteritiedoston luomisessa.',
3309    'modal.crios.ical.steps':
3310      '<ol><li><strong>Avaa Safari</strong>, ...</li><li><strong>liitä</strong> leikepöydän sisältö ja lähde.</li></ol>',
3311    'modal.multidate.h': 'Tämä on tapahtumasarja',
3312    'modal.multidate.text': 'Lisää yksittäiset osat yksi kerrallaan:',
3313    Event: 'Tapahtuma',
3314    'Cancelled Date': 'Tämä päivämäärä peruttiin.',
3315    'Delete from Calendar': 'Päivitä kalenterisi!',
3316    'modal.subscribe.yahoo.h': 'Lisää kalenteri Yahoo',
3317    'modal.subscribe.yahoo.text':
3318      '<ol><li>Avaa Yahoo-kalenteri.</li><li>Napsauta "Toiminnot"-välilehteä.</li><li>Valitse "Seuraa muiden kalentereita".</li><li>Valitse nimi ja liitä URL-osoite leikepöydältäsi URL-kenttään.</li></ol>',
3319    Cancel: 'Peruuta',
3320  },
3321  sv: {
3322    'Add to Calendar': 'Lägg till i kalender',
3323    'iCal File': 'iCal-fil',
3324    Close: 'Stäng',
3325    'Close Selection': 'Stäng urvalet',
3326    'Click me': 'Klicka på mig',
3327    'modal.webview.ical.h': 'Öppna din webbläsare',
3328    'modal.webview.ical.text': 'Tyvärr har webbläsare i appen problem med hur vi genererar kalenderfilen.',
3329    'modal.clipboard.text': 'Vi har automatiskt kopierat en magisk URL till ditt klippblock.',
3330    'modal.webview.ical.steps':
3331      '<ol><li><strong>Öppna en annan webbläsare</strong> på telefonen, ...</li><li><strong>Insätt</strong> innehållet i klippbordet och kör.</li></ol>',
3332    'modal.crios.ical.h': 'Öppna Safari',
3333    'modal.crios.ical.text': 'Tyvärr har Chrome på iOS problem med hur vi genererar kalenderfilen.',
3334    'modal.crios.ical.steps':
3335      '<ol><li><strong>Öppna Safari</strong>, ...</li><li><strong>Insätt</strong> innehållet i klippbordet och kör.</li></ol>',
3336    'modal.multidate.h': 'Detta är en evenemangsserie',
3337    'modal.multidate.text': 'Lägg till de enskilda delarna en efter en:',
3338    Event: 'Evenemang',
3339    'Cancelled Date': 'Detta datum har ställts in.',
3340    'Delete from Calendar': 'Uppdatera din kalender!',
3341    'modal.subscribe.yahoo.h': 'Lägg till kalender i Yahoo',
3342    'modal.subscribe.yahoo.text':
3343      '<ol><li>Öppna Yahoo-kalendern.</li><li>Klicka på fliken "Åtgärder".</li><li>Välj "Följ andra kalendrar".</li><li>Välj ett namn och klistra in URL:en från klippbordet i URL-fältet.</li></ol>',
3344    Cancel: 'Avbryt',
3345  },
3346  cs: {
3347    'Add to Calendar': 'Přidat do kalendáře',
3348    'iCal File': 'Soubor iCal',
3349    Close: 'Zavřít',
3350    'Close Selection': 'Zavřít výběr',
3351    'Click me': 'Klikněte na mě',
3352    'modal.webview.ical.h': 'Otevřete prohlížeč',
3353    'modal.webview.ical.text':
3354      'Prohlížeče v aplikacích mají bohužel problémy se způsobem generování souboru kalendáře.',
3355    'modal.clipboard.text': 'Do schránky jsme automaticky zkopírovali kouzelnou adresu URL.',
3356    'modal.webview.ical.steps':
3357      '<ol><li><strong>Otevření jiného prohlížeče</strong> v telefonu, ...</li><li><strong>Vložte</strong> obsah schránky a přejděte.</li></ol>',
3358    'modal.crios.ical.h': 'Otevřít Safari',
3359    'modal.crios.ical.text':
3360      'Chrome v systému iOS má bohužel problémy se způsobem generování souboru kalendáře.',
3361    'modal.crios.ical.steps':
3362      '<ol><li><strong>Otevřít Safari</strong>, ...</li><li><strong>Vložte</strong> obsah schránky a přejděte.</li></ol>',
3363    'modal.multidate.h': 'Jedná se o sérii událostí',
3364    'modal.multidate.text': 'Přidávejte jednotlivé díly jeden po druhém:',
3365    Event: 'Událost',
3366    'Cancelled Date': 'Toto datum bylo zrušeno.',
3367    'Delete from Calendar': 'Aktualizujte svůj kalendář!',
3368    'modal.subscribe.yahoo.h': 'Přidat kalendář do Yahoo',
3369    'modal.subscribe.yahoo.text':
3370      '<ol><li>Otevřete kalendář Yahoo.</li><li>Klikněte na kartu "Akce".</li><li>Vyberte možnost "Sledovat další kalendáře".</li><li>Vyberte název a vložte adresu URL ze schránky do pole URL.</li></ol>',
3371    Cancel: 'Storno',
3372  },
3373  ja: {
3374    'Add to Calendar': 'カレンダーに追加',
3375    'iCal File': 'iCalファイル',
3376    Close: '閉じる',
3377    'Close Selection': 'クローズ選択',
3378    'Click me': 'クリックしてください',
3379    'modal.webview.ical.h': 'ブラウザを起動する',
3380    'modal.webview.ical.text':
3381      '残念ながら、アプリ内ブラウザは、カレンダーファイルの生成方法に問題があります。',
3382    'modal.clipboard.text': '魔法のURLを自動的にクリップボードにコピーしています。',
3383    'modal.webview.ical.steps':
3384      '<ol><li>スマートフォンで別のブラウザを起動する, ...</li><li>クリップボードの内容を貼り付けて行く。</li></ol>',
3385    'modal.crios.ical.h': 'オープンSafari',
3386    'modal.crios.ical.text': '残念ながら、iOS版Chromeでは、カレンダーファイルの生成方法に問題があります。',
3387    'modal.crios.ical.steps':
3388      '<ol><li><strong>オープンSafari</strong>, ...</li><li>クリップボードの内容を貼り付けて行く。</li></ol>',
3389    'modal.multidate.h': 'イベントシリーズです',
3390    'modal.multidate.text': '個々のパーツを一つずつ追加していく:',
3391    Event: 'イベント',
3392    'Cancelled Date': 'この日はキャンセルになりました。',
3393    'Delete from Calendar': 'カレンダーを更新する!',
3394    'modal.subscribe.yahoo.h': 'Yahooにカレンダーを追加する',
3395    'modal.subscribe.yahoo.text':
3396      '<ol><li>Yahooカレンダーを開く。</li><li>[実行] タブをクリックします。</li><li>[その他のカレンダーのフォロー] を選択します。</li><li>名前を決めて、クリップボードにあるURLをURL欄に貼り付けます。</li></ol>',
3397    Cancel: 'キャンセル',
3398  },
3399  it: {
3400    'Add to Calendar': 'Aggiungi al calendario',
3401    'iCal File': 'File iCal',
3402    Close: 'Chiudere',
3403    'Close Selection': 'Chiudere la selezione',
3404    'Click me': 'Clicca su di me',
3405    'modal.webview.ical.h': 'Aprire il browser',
3406    'modal.webview.ical.text':
3407      'Purtroppo i browser in-app hanno problemi con il modo in cui generiamo il file del calendario.',
3408    'modal.clipboard.text': 'Abbiamo copiato automaticamente un URL magico negli appunti.',
3409    'modal.webview.ical.steps':
3410      '<ol><li><strong>Aprire un altro browser</strong> sul cellulare, ...</li><li><strong>Incollare</strong> il contenuto degli appunti e partire.</li></ol>',
3411    'modal.crios.ical.h': 'Aprire Safari',
3412    'modal.crios.ical.text':
3413      'Purtroppo, Chrome su iOS ha problemi con il modo in cui generiamo il file del calendario.',
3414    'modal.crios.ical.steps':
3415      '<ol><li><strong>Aprire Safari</strong>, ...</li><li><strong>Incollare</strong> il contenuto degli appunti e partire.</li></ol>',
3416    'modal.multidate.h': 'Questa è una serie di eventi',
3417    'modal.multidate.text': 'Aggiungere le singole parti una per una:',
3418    Event: 'Evento',
3419    'Cancelled Date': 'La data è stata annullata.',
3420    'Delete from Calendar': 'Aggiornare il calendario!',
3421    'modal.subscribe.yahoo.h': 'Aggiungi il calendario a Yahoo',
3422    'modal.subscribe.yahoo.text':
3423      '<ol><li>Aprire il calendario di Yahoo.</li><li>Fare clic sulla scheda "Azioni".</li><li>Selezionare "Segui altri calendari".</li><li>
3423Scegliere un nome e incollare l\'URL dagli appunti nel campo URL.</li></ol>',
3424    Cancel: 'Annulla',
3425  },
3426  ko: {
3427    'Add to Calendar': '캘린더에 추가',
3428    'iCal File': 'iCal 파일',
3429    Close: '닫다',
3430    'Close Selection': '선택 닫기',
3431    'Click me': '클릭 해주세요',
3432    'modal.webview.ical.h': '브라우저 열기',
3433    'modal.webview.ical.text': '불행히도 인앱 브라우저는 캘린더 파일을 생성하는 방식에 문제가 있습니다.',
3434    'modal.clipboard.text': '매직 URL을 클립보드에 자동으로 복사했습니다.',
3435    'modal.webview.ical.steps':
3436      '<ol><li>휴대전화에서 다른 브라우저 열기, ...</li><li>클립보드 내용을 붙여넣고 이동합니다.</li></ol>',
3437    'modal.crios.ical.h': 'Safari 열기',
3438    'modal.crios.ical.text': '불행히도 iOS의 Chrome은 캘린더 파일을 생성하는 방식에 문제가 있습니다.',
3439    'modal.crios.ical.steps':
3440      '<ol><li><strong>Safari 열기</strong>, ...</li><li>클립보드 내용을 붙여넣고 이동합니다.</li></ol>',
3441    'modal.multidate.h': '이벤트 시리즈입니다',
3442    'modal.multidate.text': '개별 부품을 하나씩 추가:',
3443    Event: '이벤트',
3444    'Cancelled Date': '이 날짜는 취소되었습니다.',
3445    'Delete from Calendar': '캘린더를 업데이트하세요!',
3446    'modal.subscribe.yahoo.h': 'Yahoo에 캘린더 추가',
3447    'modal.subscribe.yahoo.text':
3448      '<ol><li>Yahoo 캘린더를 엽니다.</li><li>"동작" 탭을 클릭합니다.</li><li>"다른 일정관리 팔로우"를 선택합니다.</li><li>이름을 선택하고 클립보드의 URL을 URL 필드에 붙여넣습니다.</li></ol>',
3449    Cancel: '취소',
3450  },
3451  vi: {
3452    'Add to Calendar': 'Thêm vào Lịch',
3453    'iCal File': 'Tệp iCal',
3454    Close: 'Đóng',
3455    'Close Selection': 'Đóng lựa chọn',
3456    'Click me': 'Nhấp vào đây',
3457    'modal.webview.ical.h': 'Mở trình duyệt của bạn',
3458    'modal.webview.ical.text':
3459      'Rất tiếc, các trình duyệt trong ứng dụng gặp sự cố với cách chúng tôi tạo tệp lịch.',
3460    'modal.clipboard.text': 'Chúng tôi đã tự động sao chép một URL ma thuật vào khay nhớ tạm của bạn.',
3461    'modal.webview.ical.steps':
3462      '<ol><li><strong> Mở trình duyệt khác </strong> trên điện thoại của bạn, ...</li><li><strong> Dán </strong> nội dung khay nhớ tạm và bắt đầu.</li></ol>',
3463    'modal.crios.ical.h': 'Mở Safari',
3464    'modal.crios.ical.text': 'Rất tiếc, Chrome trên iOS gặp sự cố với cách chúng tôi tạo tệp lịch.',
3465    'modal.crios.ical.steps':
3466      '<ol><li><strong>Mở Safari</strong>, ...</li><li><strong> Dán </strong> nội dung khay nhớ tạm và bắt đầu.</li></ol>',
3467    'modal.multidate.h': 'Đây là một chuỗi sự kiện',
3468    'modal.multidate.text': 'Thêm từng phần riêng lẻ một:',
3469    Event: 'Biến cố',
3470    'Cancelled Date': 'Ngày này đã bị hủy.',
3471    'Delete from Calendar': 'Cập nhật lịch của bạn!',
3472    'modal.subscribe.yahoo.h': 'Thêm lịch vào Yahoo',
3473    'modal.subscribe.yahoo.text':
3474      '<ol><li>Mở Lịch Yahoo.</li><li>Nhấp vào tab "Hành động".</li><li>Chọn "Theo dõi các Lịch khác".</li><li>Chọn tên và dán URL từ khay nhớ tạm của bạn vào trường URL.</li></ol>',
3475    Cancel: 'Hủy bỏ',
3476  },
3477};
3478function atcb_translate_hook(identifier, data) {
3479  const searchKey = identifier.replace(/\s+/g, '').toLowerCase();
3480  if (
3481    data.customLabels != null &&
3482    data.customLabels[`${searchKey}`] != null &&
3483    data.customLabels[`${searchKey}`] != ''
3484  ) {
3485    return atcb_rewrite_html_elements(data.customLabels[`${searchKey}`]);
3486  } else {
3487    return atcb_translate(identifier, data.language);
3488  }
3489}
3490function atcb_translate(identifier, language) {
3491  if (!language) {
3492    language = 'en';
3493  }
3494  if (i18nStrings[`${language}`][`${identifier}`]) {
3495    return i18nStrings[`${language}`][`${identifier}`];
3496  }
3497  return identifier;
3498}
3499
3500
3501let atcbInitialInit = false;
3502function atcb_init() {
3503  if (!atcbInitialInit) {
3504    atcb_set_global_event_listener();
3505  }
3506  atcb_init_log_msg();
3507  if (!isBrowser()) {
3508    console.error('no further initialization due to wrong environment (no browser)');
3509    return;
3510  }
3511  const atcButtons = document.querySelectorAll('.atcb');
3512  const btnIDs = [];
3513  if (atcButtons.length > 0) {
3514    const atcButtonsInitialized = document.querySelectorAll('.atcb-initialized');
3515    for (let i = 0; i < atcButtons.length; i++) {
3516      if (atcButtons[parseInt(i)].classList.contains('atcb-initialized')) {
3517        continue;
3518      }
3519      const atcbJsonInput = (function () {
3520        try {
3521          return JSON.parse(
3522            atcb_secure_content(atcButtons[parseInt(i)].innerHTML.replace(/(\r\n|\n|\r)/g, ''), false)
3523          );
3524        } catch (e) {
3525          console.error(
3526            'Add to Calendar Button generation failed: JSON content provided, but badly formatted (in doubt, try some tool like https://jsonformatter.org/ to validate).\r\nError message: ' +
3527              e
3528          );
3529          return '';
3530        }
3531      })();
3532      const atcbJsonInputPatched = atcb_patch_config(atcbJsonInput);
3533      const atcbInputData = atcb_get_pro_data(atcbJsonInputPatched);
3534      if (atcbInputData.length == 0) {
3535        continue;
3536      }
3537      if (atcb_check_required(atcbInputData)) {
3538        const data = atcb_decorate_data(atcbInputData);
3539        if (data.identifier == null || data.identifier == '') {
3540          data.identifier = 'atcb-btn-' + (i + atcButtonsInitialized.length + 1);
3541        }
3542        if (atcb_validate(data)) {
3543          atcb_generate_button(atcButtons[parseInt(i)], data);
3544          atcb_update_state_management(data);
3545          btnIDs.push(data.identifier);
3546        }
3547      }
3548    }
3549  }
3550  return btnIDs;
3551}
3552// eslint-disable-next-line @typescript-eslint/no-unused-vars
3553function atcb_action(data, triggerElement, keyboardTrigger = true) {
3554  if (!atcbInitialInit) {
3555    atcb_set_global_event_listener();
3556  }
3557  atcb_init_log_msg();
3558  data = atcb_secure_content(data);
3559  data = atcb_get_pro_data(data);
3560  if (!atcb_check_required(data)) {
3561    throw new Error('Add to Calendar Button generation failed: required data missing; see console logs');
3562  }
3563  data = atcb_decorate_data(data);
3564  if (triggerElement) {
3565    if (triggerElement.id != null && triggerElement.id != '') {
3566      data.identifier = triggerElement.id;
3567    } else {
3568      if (data.identifier != null && data.identifier != '') {
3569        triggerElement.id = data.identifier;
3570      } else {
3571        data.identifier = 'atcb-btn-custom';
3572      }
3573    }
3574    if (data.listStyle == 'dropdown') {
3575      data.listStyle = 'overlay';
3576    }
3577  } else {
3578    data.identifier = 'atcb-btn-custom';
3579    data.listStyle = 'modal';
3580    data.trigger = 'click';
3581  }
3582  if (!atcb_validate(data)) {
3583    throw new Error(
3584      'Add to Calendar Button generation (' + data.identifier + ') failed: invali
3584d data; see console logs'
3585    );
3586  }
3587  atcb_update_state_management(data);
3588  atcb_toggle('open', data, triggerElement, keyboardTrigger);
3589  console.log('Add to Calendar Button "' + data.identifier + '" triggered');
3590  return [data.identifier];
3591}
3592// eslint-disable-next-line @typescript-eslint/no-unused-vars
3593function atcb_destroy(id) {
3594  atcb_close();
3595  const el = document.getElementById(id);
3596  if (atcbStates[`${id}`] == null || !el) {
3597    console.error('Add to Calendar Button could not be destroyed! ID unknown.');
3598    return false;
3599  }
3600  delete atcbStates[`${id}`];
3601  if (el.parentElement.parentElement.classList.contains('atcb-initialized')) {
3602    el.parentElement.parentElement.remove();
3603  } else {
3604    el.remove();
3605  }
3606  console.log('Add to Calendar Button "' + id + '" destroyed');
3607  return true;
3608}
3609function atcb_update_state_management(data) {
3610  const singleDates = [];
3611  for (let i = 0; i < data.options.length; i++) {
3612    singleDates[data.options[`${i}`]] = [];
3613    for (let id = 1; id <= data.dates.length; id++) {
3614      singleDates[data.options[`${i}`]].push(0);
3615    }
3616  }
3617  atcbStates[data.identifier] = singleDates;
3618}
3619function atcb_init_log_msg() {
3620  if (!atcbInitialInit) {
3621    // console.log('Add to Calendar Button Script initialized (version ' + atcbVersion + ')');
3622    // console.log('See https://github.com/add2cal/add-to-calendar-button for details');
3623    atcbInitialInit = true;
3624  }
3625}
3626function atcb_get_pro_data(data) {
3627  if (data.proKey != null && data.proKey != '') {
3628    console.error('Add to Calendar Button generation failed: proKey invalid!');
3629    return [];
3630  }
3631  return data;
3632}
3633function atcb_set_global_event_listener() {
3634  if (!isBrowser()) {
3635    return;
3636  }
3637  document.addEventListener('keyup', function (event) {
3638    if (event.key === 'Escape') {
3639      atcb_toggle('close', '', '', true);
3640    }
3641  });
3642  document.addEventListener('keydown', (event) => {
3643    if (
3644      document.querySelector('.atcb-list') &&
3645      (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Tab')
3646    ) {
3647      let targetFocus = 0;
3648      let currFocusOption = document.activeElement;
3649      const optionListCount = document.querySelectorAll('.atcb-list-item').length;
3650      if (currFocusOption.classList.contains('atcb-list-item')) {
3651        if (event.key === 'ArrowDown' && currFocusOption.dataset.optionNumber < optionListCount) {
3652          event.preventDefault();
3653          targetFocus = parseInt(currFocusOption.dataset.optionNumber) + 1;
3654        } else if (event.key === 'ArrowUp' && currFocusOption.dataset.optionNumber >= 1) {
3655          event.preventDefault();
3656          targetFocus = parseInt(currFocusOption.dataset.optionNumber) - 1;
3657        }
3658        if (targetFocus > 0) {
3659          document.querySelector('.atcb-list-item[data-option-number="' + targetFocus + '"]').focus();
3660        }
3661      } else {
3662        event.preventDefault();
3663        switch (event.key) {
3664          case 'ArrowDown':
3665            document.querySelector('.atcb-list-item[data-option-number="1"]').focus();
3666            break;
3667          case 'ArrowUp':
3668            document.querySelector('.atcb-list-item[data-option-number="' + optionListCount + '"]').focus();
3669            break;
3670          default:
3671            document.querySelector('.atcb-list-item[data-option-number="1"]').focus();
3672            break;
3673        }
3674      }
3675    }
3676  });
3677  window.addEventListener(
3678    'resize',
3679    atcb_throttle(() => {
3680      const activeOverlay = document.getElementById('atcb-bgoverlay');
3681      if (activeOverlay != null) {
3682        atcb_set_fullsize(activeOverlay);
3683        atcb_manage_body_scroll();
3684      }
3685      const activeButton = document.querySelector('.atcb-active');
3686      if (activeButton != null) {
3687        const activeList = document.querySelector('.atcb-dropdown');
3688        if (activeList != null) {
3689          atcb_position_list(activeButton, activeList, false, true);
3690        }
3691      }
3692    })
3693  );
3694  window.addEventListener(
3695    'scroll',
3696    atcb_throttle(() => {
3697      const activeButton = document.querySelector('.atcb-active');
3698      if (activeButton != null) {
3699        const activeList = document.querySelector('.atcb-dropdown');
3700        if (activeList != null) {
3701          if (activeList.classList.contains('atcb-mind-scrolling')) {
3702            atcb_position_list(activeButton, activeList, false, true);
3703          }
3704        }
3705      }
3706    }, 20)
3707  );
3708}
3709
3710
3711/*! START INIT */
3712if (isBrowser()) {
3713  if (document.readyState !== 'loading') {
3714    atcb_init();
3715  } else {
3716    document.addEventListener('DOMContentLoaded', atcb_init, false);
3717  }
3718}
3719/*! END INIT */

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.