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IAAI,EAAmB,EAAW,GAAY,EAAW,EACrD,EAAI,qBAAuB,EAAI,oBAAoB,gBASnD,EAAI,oBAAoB,kBAAkB,GACnC,EAAI,cAAgB,EAAI,aAAa,mBAC5C,EAAI,aAAa,kBAAkB,EAbX,CAehC,GAmEI,EAAW,OAAO,OAClB,OAAO,KAAK,EAAI,OAExB,CA3LA,CA2LE","file":"/npm/html5-desktop-notifications@1.0.0/desktop-notify.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/html5-desktop-notifications@1.0.0/desktop-notify.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Copyright 2012 Tsvetan Tsvetkov\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Author: Tsvetan Tsvetkov (tsekach@gmail.com)\n */\n(function (win) {\n    /*\n     Safari native methods required for Notifications do NOT run in strict mode.\n     */\n    //\"use strict\";\n    var PERMISSION_DEFAULT = \"default\",\n        PERMISSION_GRANTED = \"granted\",\n        PERMISSION_DENIED = \"denied\",\n        PERMISSION = [PERMISSION_GRANTED, PERMISSION_DEFAULT, PERMISSION_DENIED],\n        defaultSetting = {\n            pageVisibility: false,\n            autoClose: 0\n        },\n        empty = {},\n        emptyString = \"\",\n        isSupported = (function () {\n            var isSupported = false;\n            /*\n             * Use try {} catch() {} because the check for IE may throws an exception\n             * if the code is run on browser that is not Safar/Chrome/IE or\n             * Firefox with html5notifications plugin.\n             *\n             * Also, we canNOT detect if msIsSiteMode method exists, as it is\n             * a method of host object. In IE check for existing method of host\n             * object returns undefined. So, we try to run it - if it runs\n             * successfully - then it is IE9+, if not - an exceptions is thrown.\n             */\n            try {\n                isSupported = !!(/* Safari, Chrome */win.Notification || /* Chrome & ff-html5notifications plugin */win.webkitNotifications || /* Firefox Mobile */navigator.mozNotification || /* IE9+ */(win.external && win.external.msIsSiteMode() !== undefined));\n            } catch (e) {}\n            return isSupported;\n        }()),\n        ieVerification = Math.floor((Math.random() * 10) + 1),\n        isFunction = function (value) { return (value && (value).constructor === Function); },\n        isString = function (value) {return (value && (value).constructor === String); },\n        isObject = function (value) {return (value && (value).constructor === Object); },\n        /**\n         * Dojo Mixin\n         */\n        mixin = function (target, source) {\n            var name, s;\n            for (name in source) {\n                s = source[name];\n                if (!(name in target) || (target[name] !== s && (!(name in empty) || empty[name] !== s))) {\n                    target[name] = s;\n                }\n            }\n            return target; // Object\n        },\n        noop = function () {},\n        settings = defaultSetting;\n    function getNotification(title, options) {\n        var notification;\n        if (win.Notification) { /* Safari 6, Chrome (23+) */\n            notification =  new win.Notification(title, {\n                /* The notification's icon - For Chrome in Windows, Linux & Chrome OS */\n                icon: isString(options.icon) ? options.icon : options.icon.x32,\n                /* The notification’s subtitle. */\n                body: options.body || emptyString,\n                /*\n                    The notification’s unique identifier.\n                    This prevents duplicate entries from appearing if the user has multiple instances of your website open at once.\n                */\n                tag: options.tag || emptyString\n            });\n        } else if (win.webkitNotifications) { /* FF with html5Notifications plugin installed */\n            notification = win.webkitNotifications.createNotification(options.icon, title, options.body);\n            notification.show();\n        } else if (navigator.mozNotification) { /* Firefox Mobile */\n            notification = navigator.mozNotification.createNotification(title, options.body, options.icon);\n            notification.show();\n        } else if (win.external && win.external.msIsSiteMode()) { /* IE9+ */\n            //Clear any previous notifications\n            win.external.msSiteModeClearIconOverlay();\n            win.external.msSiteModeSetIconOverlay((isString(options.icon) ? options.icon : options.icon.x16), title);\n            win.external.msSiteModeActivate();\n            notification = {\n                \"ieVerification\": ieVerification + 1\n            };\n        }\n        return notification;\n    }\n    function getWrapper(notification) {\n        return {\n            close: function () {\n                if (notification) {\n                    if (notification.close) {\n                        //http://code.google.com/p/ff-html5notifications/issues/detail?id=58\n                        notification.close();\n                    }\n                    else if (notification.cancel) {\n                        notification.cancel();\n                    } else if (win.external && win.external.msIsSiteMode()) {\n                        if (notification.ieVerification === ieVerification) {\n                            win.external.msSiteModeClearIconOverlay();\n                        }\n                    }\n                }\n            }\n        };\n    }\n    function requestPermission(callback) {\n        if (!isSupported) { return; }\n        var callbackFunction = isFunction(callback) ? callback : noop;\n        if (win.webkitNotifications && win.webkitNotifications.checkPermission) {\n            /*\n             * Chrome 23 supports win.Notification.requestPermission, but it\n             * breaks the browsers, so use the old-webkit-prefixed\n             * win.webkitNotifications.checkPermission instead.\n             *\n             * Firefox with html5notifications plugin supports this method\n             * for requesting permissions.\n             */\n            win.webkitNotifications.requestPermission(callbackFunction);\n        } else if (win.Notification && win.Notification.requestPermission) {\n            win.Notification.requestPermission(callbackFunction);\n        }\n    }\n    function permissionLevel() {\n        var permission;\n        if (!isSupported) { return; }\n        if (win.Notification && win.Notification.permissionLevel) {\n            //Safari 6\n            permission = win.Notification.permissionLevel();\n        } else if (win.webkitNotifications && win.webkitNotifications.checkPermission) {\n            //Chrome & Firefox with html5-notifications plugin installed\n            permission = PERMISSION[win.webkitNotifications.checkPermission()];\n        } else if (win.Notification && win.Notification.permission) {\n            // Firefox 23+\n            permission = win.Notification.permission;\n        } else if (navigator.mozNotification) {\n            //Firefox Mobile\n            permission = PERMISSION_GRANTED;\n        } else if (win.external && (win.external.msIsSiteMode() !== undefined)) { /* keep last */\n            //IE9+\n            permission = win.external.msIsSiteMode() ? PERMISSION_GRANTED : PERMISSION_DEFAULT;\n        }\n        return permission;\n    }\n    /**\n     *\n     */\n    function config(params) {\n        if (params && isObject(params)) {\n            mixin(settings, params);\n        }\n        return settings;\n    }\n    \n    function createNotification(title, options) {\n        var notification,\n            notificationWrapper;\n        /*\n            Return undefined if notifications are not supported.\n\n            Return undefined if no permissions for displaying notifications.\n\n            Title and icons are required. Return undefined if not set.\n         */\n        if (isSupported && isString(title) && (options && (isString(options.icon) || isObject(options.icon))) && (permissionLevel() === PERMISSION_GRANTED)) {\n            notification = getNotification(title, options);\n        }\n        notificationWrapper = getWrapper(notification);\n        //Auto-close notification\n        if (settings.autoClose && notification && !notification.ieVerification && notification.addEventListener) {\n            notification.addEventListener(\"show\", function () {\n                var notification = notificationWrapper;\n                win.setTimeout(function () {\n                    notification.close();\n                }, settings.autoClose);\n            });\n        }\n        return notificationWrapper;\n    }\n    win.notify = {\n        PERMISSION_DEFAULT: PERMISSION_DEFAULT,\n        PERMISSION_GRANTED: PERMISSION_GRANTED,\n        PERMISSION_DENIED: PERMISSION_DENIED,\n        isSupported: isSupported,\n        config: config,\n        createNotification: createNotification,\n        permissionLevel: permissionLevel,\n        requestPermission: requestPermission\n    };\n    if (isFunction(Object.seal)) {\n        Object.seal(win.notify);\n    }\n}(window));\n"]}