{"version":3,"sources":["add-to-calendar.js"],"names":["$","document","on","includes","activeElement","id","hasClass","removeClass","this","attr","click"],"mappings":"AAAAA,GAAA,WAEAA,EAAAC,UAAAC,GAAA,WAAA,KACA,CAAA,sBAAA,kBAAA,iBAAA,kBAAA,mBAAA,eAAA,kBACAC,SAAAF,SAAAG,cAAAC,MACAL,EAAA,oBAAAM,SAAA,SACAN,EAAA,oBAAAO,YAAA,QACAP,EAAAQ,MAAAC,KAAA,iBAAA,IAGAT,EAAAQ,MAAAC,KAAA,iBAAA,GAEA,IAIAT,EAAAC,UAAAS,OAAA,WACAV,EAAA,oBAAAM,SAAA,SACAN,EAAA,oBAAAS,KAAA,iBAAA,EAEA,IAIAT,EAAA,oBAAAU,OAAA,WACAV,EAAA,oBAAAM,SAAA,QACAN,EAAAQ,MAAAC,KAAA,iBAAA,GAGAT,EAAAQ,MAAAC,KAAA,iBAAA,EAEA,GACA","file":"addtocalendar-bundle.js","sourcesContent":["$(function () {\r\n    // This method is used to add/remove the \"open\" class for the calendar dropdown as well as set the aria-expanded property on the parent div appropriately to the \"open\" state\r\n    $(document).on('focusin', () => {\r\n        const calendarClasses = [\"add-to-calendar-btn\", \"add-to-calendar\", \"apple-calendar\", \"google-calendar\", \"outlook-calendar\", \"365-calendar\", \"other-calendar\"];\r\n        if (!calendarClasses.includes(document.activeElement.id)) {\r\n            if ($(\".add-to-calendar\").hasClass(\"open\")) {\r\n                $(\".add-to-calendar\").removeClass(\"open\");\r\n                $(this).attr(\"aria-expanded\", false);\r\n            }\r\n            else {\r\n                $(this).attr(\"aria-expanded\", true);\r\n            }\r\n        }\r\n    });\r\n\r\n    // This method is used to update the \"aria-expanded\" attribute on the parent Div so that click off/away from the calendar button will update the aria-expanded to false\r\n    $(document).click(function () {\r\n        if (!$(\".add-to-calendar\").hasClass(\"open\")) {\r\n            $(\".add-to-calendar\").attr(\"aria-expanded\", false);\r\n        }\r\n    });\r\n\r\n    // This method is used to update the \"aria-expanded\" attribute on the parent Div so that mouse events to open, as well as child item clicks that close the menu, will \r\n    // update the aria-expanded value appropriately\r\n    $(\".add-to-calendar\").click(function () {\r\n        if ($(\".add-to-calendar\").hasClass(\"open\")) {\r\n            $(this).attr(\"aria-expanded\", false);\r\n        }\r\n        else {\r\n            $(this).attr(\"aria-expanded\", true);\r\n        }\r\n    });\r\n});"]}