OneSignalSDK.js

!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=91)}([function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0)for(var s=0;s0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=0;i--){n[i]===t&&n.splice(i,1)}},e}();t.WorkerMessengerReplyBuffer=p;var h=function(){function e(e,t){void 0===t&&(t=new p),this.context=e,this.replies=t,this.debug=!0}return e.prototype.broadcast=function(e,t){return i(this,void 0,void 0,function(){var n,i,o,s;return r(this,function(r){switch(r.label){case 0:return u.default.getWindowEnv()===l.WindowEnvironmentKind.ServiceWorker?[3,1]:[2];case 1:return[4,self.clients.matchAll({type:"window",includeUncontrolled:!0})];case 2:for(n=r.sent(),i=0,o=n;i Page] Broadcasting '"+e.toString()+"' to window client "+s.url+"."),s.postMessage({command:e,payload:t});r.label=3;case 3:return[2]}})})},e.prototype.unicast=function(e,t,n){return i(this,void 0,void 0,function(){return r(this,function(i){switch(i.label){case 0:if(u.default.getWindowEnv()!==l.WindowEnvironmentKind.ServiceWorker)return[3,1];if(!n)throw new a.InvalidArgumentError("windowClient",a.InvalidArgumentReason.Empty);return f.default.debug("[Worker Messenger] [SW -> Page] Unicasting '"+e.toString()+"' to window client "+n.url+"."),n.postMessage({command:e,payload:t}),[3,4];case 1:return[4,this.isWorkerControllingPage()];case 2:return i.sent()||f.default.debug("[Worker Messenger] The page is not controlled by the service worker yet. Waiting...",self.registration),[4,this.waitUntilWorkerControlsPage()];case 3:i.sent(),f.default.debug("[Worker Messenger] [Page -> SW] Unicasting '"+e.toString()+"' to service worker."),navigator.serviceWorker.controller.postMessage({command:e,payload:t}),i.label=4;case 4:return[2]}})})},e.prototype.listen=function(e){return i(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return d.default.supportsServiceWorkers()?u.default.getWindowEnv()!==l.WindowEnvironmentKind.ServiceWorker?[3,1]:(self.addEventListener("message",this.onWorkerMessageReceivedFromPage.bind(this)),f.default.debug("[Worker Messenger] Service worker is now listening for messages."),[3,3]):[2];case 1:return[4,this.listenForPage(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e.prototype.listenForPage=function(e){return i(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return e?[3,3]:[4,this.isWorkerControllingPage()];case 1:return t.sent()||f.default.debug("("+location.origin+") [Worker Messenger] The page is not controlled by the service worker yet. Waiting...",self.registration),[4,this.waitUntilWorkerControlsPage()];case 2:t.sent(),f.default.debug("("+location.origin+") [Worker Messenger] The page is now controlled by the service worker."),t.label=3;case 3:return navigator.serviceWorker.addEventListener("message",this.onPageMessageReceivedFromServiceWorker.bind(this)),f.default.debug("("+location.origin+") [Worker Messenger] Page is now listening for messages."),[2]}})})},e.prototype.onWorkerMessageReceivedFromPage=function(e){var t=e.data;if(t&&t.command){var n=this.replies.findListenersForMessage(t.command),i=[],r=[];f.default.debug("[Worker Messenger] Service worker received message:",e.data);for(var o=0,s=n;o=0;a--){var u=i[a];this.replies.deleteListenerRecord(t.command,u)}for(var c=0,l=r;c=0;a--){var u=i[a];this.replies.deleteListenerRecord(t.command,u)}for(var c=0,l=r;c0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1] to the first element in ."))}},e.getNotificationTypeFromOptIn=function(e){return 1==e||null==e?1:-2},e.wasHttpsNativePromptDismissed=function(){return"dismissed"===d.default.getItem("onesignal-notification-prompt")},e.markHttpPopoverShown=function(){sessionStorage.setItem("ONESIGNAL_HTTP_PROMPT_SHOWN","true")},e.isHttpPromptAlreadyShown=function(){return"true"==sessionStorage.getItem("ONESIGNAL_HTTP_PROMPT_SHOWN")},e.checkAndTriggerNotificationPermissionChanged=function(){return i(this,void 0,void 0,function(){var e,t;return r(this,function(n){switch(n.label){case 0:return[4,c.default.get("Options","notificationPermission")];case 1:return e=n.sent(),[4,OneSignal.getNotificationPermission()];case 2:return t=n.sent(),e===t?[3,5]:[4,l.triggerNotificationPermissionChanged()];case 3:return n.sent(),[4,c.default.put("Options",{key:"notificationPermission",value:t})];case 4:n.sent(),n.label=5;case 5:return[2]}})})},e.getNotificationIcons=function(){return i(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){switch(r.label){case 0:return[4,e.getAppId()];case 1:if(!(t=r.sent()))throw new s.InvalidStateError(s.InvalidStateReason.MissingAppId);return n=u.default.getOneSignalApiUrl().toString()+"/apps/"+t+"/icon",[4,fetch(n)];case 2:return[4,r.sent().json()];case 3:if((i=r.sent()).errors)throw f.default.error("API call %c"+n,l.getConsoleStyle("code"),"failed with:",i.errors),new Error("Failed to get notification icons.");return[2,i]}})})},e.getSlidedownPermissionMessageOptions=function(){var e=OneSignal.config.userConfig.promptOptions;return e?e&&!e.slidedown?e:{actionMessage:e.slidedown.actionMessage,acceptButtonText:e.slidedown.acceptButtonText,cancelButtonText:e.slidedown.cancelButtonText}:null},e.getFullscreenPermissionMessageOptions=function(){var e=OneSignal.config.userConfig.promptOptions;return e?e&&!e.fullscreen?e:{autoAcceptTitle:e.fullscreen.autoAcceptTitle,actionMessage:e.fullscreen.actionMessage,exampleNotificationTitleDesktop:e.fullscreen.title,exampleNotificationTitleMobile:e.fullscreen.title,exampleNotificationMessageDesktop:e.fullscreen.message,exampleNotificationMessageMobile:e.fullscreen.message,exampleNotificationCaption:e.fullscreen.caption,acceptButtonText:e.fullscreen.acceptButton,cancelButtonText:e.fullscreen.cancelButton}:null},e.getPromptOptionsQueryString=function(){var t="";if(e.getFullscreenPermissionMessageOptions())for(var n=e.getPromptOptionsPostHash(),i=0,r=Object.keys(n);i0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]{{prompt.native.grant}}{{prompt.native.grant}} to receive notifications"),this.text["message.action.unsubscribed"]||(this.text["message.action.unsubscribed"]="You won't receive notifications again"),this.text["dialog.main.title"]||(this.text["dialog.main.title"]="Manage Site Notifications"),this.text["dialog.main.button.subscribe"]||(this.text["dialog.main.button.subscribe"]="SUBSCRIBE"),this.text["dialog.main.button.unsubscribe"]||(this.text["dialog.main.button.unsubscribe"]="UNSUBSCRIBE"),this.text["dialog.blocked.title"]||(this.text["dialog.blocked.title"]="Unblock Notifications"),this.text["dialog.blocked.message"]||(this.text["dialog.blocked.message"]="Follow these instructions to allow notifications:"),this._launcher=N,this.state=e.STATES.UNINITIALIZED,this._ignoreSubscriptionState=!1,b.default.emitter.on(e.EVENTS.SUBSCRIBE_CLICK,function(){x.dialog.subscribeButton.disabled=!0,x._ignoreSubscriptionState=!0,b.default.setSubscription(!0).then(function(){return x.dialog.subscribeButton.disabled=!1,x.dialog.hide()}).then(function(){return x.message.display(h.default.TYPES.MESSAGE,x.text["message.action.resubscribed"],h.default.TIMEOUT)}).then(function(){return x._ignoreSubscriptionState=!1,x.launcher.clearIfWasInactive(),x.launcher.inactivate()}).then(function(){return x.updateState()})}),b.default.emitter.on(e.EVENTS.UNSUBSCRIBE_CLICK,function(){x.dialog.unsubscribeButton.disabled=!0,b.default.setSubscription(!1).then(function(){return x.dialog.unsubscribeButton.disabled=!1,x.dialog.hide()}).then(function(){return x.launcher.clearIfWasInactive(),x.launcher.activate()}).then(function(){return x.message.display(h.default.TYPES.MESSAGE,x.text["message.action.unsubscribed"],h.default.TIMEOUT)}).then(function(){return x.updateState()})}),b.default.emitter.on(e.EVENTS.HOVERING,function(){x.hovering=!0,x.launcher.activateIfInactive(),x.message.shown||x.dialog.shown?x.hovering=!1:x.message.contentType!==h.default.TYPES.MESSAGE?new Promise(function(e){if(x.message.queued.length>0)return x.message.dequeue().then(function(t){x.message.content=t,x.message.contentType=h.default.TYPES.QUEUED,e()});x.message.content=c.decodeHtmlEntities(x.message.getTipForState()),x.message.contentType=h.default.TYPES.TIP,e()}).then(function(){return x.message.show()}).then(function(){x.hovering=!1}):x.hovering=!1}),b.default.emitter.on(e.EVENTS.HOVERED,function(){x.message.contentType!==h.default.TYPES.MESSAGE&&x.dialog.hidden&&(x.hovering&&(x.hovering=!1,x.message.waitUntilShown().then(function(){return c.delay(h.default.TIMEOUT)}).then(function(){return x.message.hide()}).then(function(){x.launcher.wasInactive&&x.dialog.hidden&&(x.launcher.inactivate(),x.launcher.wasInactive=null)})),x.message.shown&&x.message.hide().then(function(){x.launcher.wasInactive&&x.dialog.hidden&&(x.launcher.inactivate(),x.launcher.wasInactive=null)}))}),b.default.emitter.on(b.default.EVENTS.SUBSCRIPTION_CHANGED,function(t){return i(x,void 0,void 0,function(){var n,i=this;return r(this,function(r){switch(r.label){case 0:return 1!=t?[3,2]:(this.badge.shown&&this.options.prenotify&&this.badge.hide(),null!==this.dialog.notificationIcons?[3,2]:[4,u.default.getNotificationIcons()]);case 1:n=r.sent(),this.dialog.notificationIcons=n,r.label=2;case 2:return b.default.getNotificationPermission(function(n){i.setState(t?e.STATES.SUBSCRIBED:"denied"===n?e.STATES.BLOCKED:e.STATES.UNSUBSCRIBED,i._ignoreSubscriptionState)}),[2]}})})}),b.default.emitter.on(e.EVENTS.STATE_CHANGED,function(t){x.launcher.element&&(t.to===e.STATES.SUBSCRIBED?x.launcher.inactivate():(t.to===e.STATES.UNSUBSCRIBED||e.STATES.BLOCKED)&&x.launcher.activate())}),b.default.emitter.on(b.default.EVENTS.NATIVE_PROMPT_PERMISSIONCHANGED,function(){x.updateState()}),this.updateState()}}return Object.defineProperty(e,"EVENTS",{get:function(){return{STATE_CHANGED:"notifyButtonStateChange",LAUNCHER_CLICK:"notifyButtonLauncherClick",BELL_CLICK:"notifyButtonButtonClick",SUBSCRIBE_CLICK:"notifyButtonSubscribeClick",UNSUBSCRIBE_CLICK:"notifyButtonUnsubscribeClick",HOVERING:"notifyButtonHovering",HOVERED:"notifyButtonHover"}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"STATES",{get:function(){return{UNINITIALIZED:"uninitialized",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",BLOCKED:"blocked"}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"TEXT_SUBS",{get:function(){return{"prompt.native.grant":{default:"Allow",chrome:"Allow",firefox:"Always Receive Notifications",safari:"Allow"}}},enumerable:!0,configurable:!0}),e.prototype.showDialogProcedure=function(){var e=this;this.dialog.shown||this.dialog.show().then(function(){c.once(document,"click",function(t,n){e.dialog.element.contains(t.target)||(n(),e.dialog.shown&&e.dialog.hide().then(function(){e.launcher.inactivateIfWasInactive()}))},!0)})},e.prototype.create=function(){return i(this,void 0,void 0,function(){var e,t,n,i,o=this;return r(this,function(r){switch(r.label){case 0:return this.options.enable?[4,b.default.context.dynamicResourceLoader.loadSdkStylesheet()]:[2];case 1:return 0!==r.sent()?(g.default.debug("Not showing notify button because styles failed to load."),[2]):(this.container&&c.removeDomElement("#onesignal-bell-container"),c.addDomElement("body","beforeend",'
'),c.addDomElement(this.container,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.message.selector,"beforeend",'
'),c.addDomElement(this.launcher.selector,"beforeend",'
'),c.addDomElement(this.dialog.selector,"beforeend",'
'),c.addDomElement(this.button.selector,"beforeEnd",''),[4,b.default.isPushNotificationsEnabled()]);case 2:return e=r.sent(),[4,b.default.getSubscription()];case 3:return t=r.sent(),[4,u.default.wasHttpsNativePromptDismissed()];case 4:return n=r.sent(),i=e?"small":this.options.size,[4,this.launcher.resize(i)];case 5:if(r.sent(),"bottom-left"===this.options.position)c.addCssClass(this.container,"onesignal-bell-container-bottom-left"),c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-bottom-left");else{if("bottom-right"!==this.options.position)throw new Error("Invalid OneSignal notify button position "+this.options.position);c.addCssClass(this.container,"onesignal-bell-container-bottom-right"),c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-bottom-right")}if("default"===this.options.theme)c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-theme-default");else{if("inverse"!==this.options.theme)throw new Error("Invalid OneSignal notify button theme "+this.options.theme);c.addCssClass(this.launcher.selector,"onesignal-bell-launcher-theme-inverse")}return this.applyOffsetIfSpecified(),this.setCustomColorsIfSpecified(),this.patchSafariSvgFilterBug(),g.default.info("Showing the notify button."),[4,(e?this.launcher.inactivate():c.nothing()).then(function(){return b.default.getSubscription()}).then(function(t){return!e&&t||null!==o.dialog.notificationIcons?c.nothing():u.default.getNotificationIcons().then(function(e){o.dialog.notificationIcons=e})}).then(function(){return c.delay(o.options.showLauncherAfter)}).then(function(){return c.isUsingSubscriptionWorkaround()&&t&&!0!==n&&!e&&!0===b.default.config.userConfig.autoRegister&&!u.default.isHttpPromptAlreadyShown()?(g.default.debug("Not showing notify button because popover will be shown."),c.nothing()):o.launcher.show()}).then(function(){return c.delay(o.options.showBadgeAfter)}).then(function(){return o.options.prenotify&&!e&&b.default._isNewVisitor?o.message.enqueue(o.text["message.prenotify"]).then(function(){return o.badge.show()}):c.nothing()}).then(function(){return o.initialized=!0})];case 6:return r.sent(),[2]}})})},e.prototype.patchSafariSvgFilterBug=function(){if(!(s.default.safari&&Number(s.default.version)>=9.1)){var e="drop-shadow(0 2px 4px rgba(34,36,38,0.35));",t="drop-shadow(0 2px 4px rgba(34,36,38,0));",n="drop-shadow(0px 2px 2px rgba(34,36,38,.15));";this.graphic.setAttribute("style","filter: "+e+"; -webkit-filter: "+e+";"),this.badge.element.setAttribute("style","filter: "+t+"; -webkit-filter: "+t+";"),this.dialog.element.setAttribute("style","filter: "+n+"; -webkit-filter: "+n+";")}s.default.safari&&this.badge.element.setAttribute("style","display: none;")},e.prototype.applyOffsetIfSpecified=function(){var e=this.options.offset;e&&(this.launcher.element.style.cssText="",e.bottom&&(this.launcher.element.style.cssText+="bottom: "+e.bottom+";"),"bottom-right"===this.options.position?e.right&&(this.launcher.element.style.cssText+="right: "+e.right+";"):"bottom-left"===this.options.position&&e.left&&(this.launcher.element.style.cssText+="left: "+e.left+";"))},e.prototype.setCustomColorsIfSpecified=function(){var e=this.dialog.element.querySelector("button.action"),t=this.button.element.querySelector(".pulse-ring");this.graphic.querySelector(".background").style.cssText="";for(var n=this.graphic.querySelectorAll(".foreground"),i=0;i0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0))for(var n=0,i=t.buttons;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]OneSignal: This page cannot be directly opened, and must be opened as a result of a subscription call."),[2,Promise.resolve()]):((e=i({},this.options)).appId=e.appId,e.subdomainName=e.subdomain,e.origin=e.origin,OneSignal.config=e||{},[4,(new c.default).getAppConfig(e)]);case 1:return t=r.sent(),OneSignal.context=new u.default(t),OneSignal.context.workerMessenger.listen(!0),OneSignal.initialized=!0,this.loadPromise={},this.loadPromise.promise=new Promise(function(e,t){n.loadPromise.resolver=e,n.loadPromise.rejector=t}),this.establishCrossOriginMessaging(),[2,this.loadPromise.promise]}})})},e.prototype.establishCrossOriginMessaging=function(){},e.prototype.dispose=function(){this.messenger.destroy()},e.prototype.finishInitialization=function(){this.loadPromise.resolver()},e.prototype.subscribe=function(){return r(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return e=n.sent(),t=opener||parent,e?t&&window.close():a.default.registerForPush(),[2]}})})},e}();t.default=l},function(e,t,n){"use strict";var i,r,o;Object.defineProperty(t,"__esModule",{value:!0}),(i=t.ConfigIntegrationKind||(t.ConfigIntegrationKind={})).TypicalSite="typical",i.WordPress="wordpress",i.Shopify="shopify",i.Blogger="blogger",i.Magento="magento",i.Drupal="drupal",i.SquareSpace="squarespace",i.Joomla="joomla",i.Weebly="weebly",i.Wix="wix",i.Custom="custom",(r=t.NotificationClickMatchBehavior||(t.NotificationClickMatchBehavior={})).Exact="exact",r.Origin="origin",(o=t.NotificationClickActionBehavior||(t.NotificationClickActionBehavior={})).Navigate="navigate",o.Focus="focus"},function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=i(n(6)),s=i(n(2)),a=i(n(35)),u=function(){function e(e,t,n,i,r,o,s){void 0===i&&(i="shown"),void 0===r&&(r=["opacity","transform"]),void 0===s&&(s=500),this.selector=e,this.showClass=t,this.hideClass=n,this.state=i,this.targetTransitionEvents=r,this.nestedContentSelector=o,this.transitionCheckTimeout=s}return e.prototype.show=function(){var t=this;return this.hidden?new Promise(function(n){if(t.state="showing",o.default.trigger(e.EVENTS.SHOWING,t),t.hideClass&&r.removeCssClass(t.element,t.hideClass),t.showClass&&r.addCssClass(t.element,t.showClass),0==t.targetTransitionEvents.length)return n(t);var i=setTimeout(function(){s.default.debug("Element did not completely show (state: "+t.state+").")},t.transitionCheckTimeout);r.once(t.element,"transitionend",function(s,a){if(s.target===t.element&&r.contains(t.targetTransitionEvents,s.propertyName))return clearTimeout(i),a(),t.state="shown",o.default.trigger(e.EVENTS.SHOWN,t),n(t)},!0)}):Promise.resolve(this)},e.prototype.hide=function(){var t=this;return this.shown?new Promise(function(n){if(t.state="hiding",o.default.trigger(e.EVENTS.HIDING,t),t.showClass&&r.removeCssClass(t.element,t.showClass),t.hideClass&&r.addCssClass(t.element,t.hideClass),0==t.targetTransitionEvents.length)return n(t);r.once(t.element,"transitionend",function(i,a){var u=setTimeout(function(){s.default.debug("Element did not completely hide (state: "+t.state+").")},t.transitionCheckTimeout);if(i.target===t.element&&r.contains(t.targetTransitionEvents,i.propertyName))return clearTimeout(u),a(),t.state="hidden",o.default.trigger(e.EVENTS.HIDDEN,t),n(t)},!0)}):Promise.resolve(this)},e.prototype.waitUntilShown=function(){var t=this;return"shown"===this.state?Promise.resolve(this):new Promise(function(n){a.default.emitter.once(e.EVENTS.SHOWN,function(e){if(e===t)return n(t)})})},e.prototype.waitUntilHidden=function(){var t=this;return"hidden"===this.state?Promise.resolve(this):new Promise(function(n){a.default.emitter.once(e.EVENTS.HIDDEN,function(e){if(e===t)return n(t)})})},Object.defineProperty(e,"EVENTS",{get:function(){return{SHOWING:"animatedElementShowing",SHOWN:"animatedElementShown",HIDING:"animatedElementHiding",HIDDEN:"animatedElementHidden"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this.nestedContentSelector?this.element.querySelector(this.nestedContentSelector).innerHTML:this.element.innerHTML},set:function(e){this.nestedContentSelector?this.element.querySelector(this.nestedContentSelector).innerHTML=e:this.element.innerHTML=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return document.querySelector(this.selector)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showing",{get:function(){return"showing"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shown",{get:function(){return"shown"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hiding",{get:function(){return"hiding"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return"hidden"===this.state},enumerable:!0,configurable:!0}),e}();t.default=u},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=i]:[2,!1];case 12:return[2]}})})},e.prototype.isSubscriptionExpiringForSecureIntegration=function(){return i(this,void 0,void 0,function(){var e,t,n,i,o;return r(this,function(r){switch(r.label){case 0:return[4,this.context.serviceWorkerManager.getActiveState()];case 1:return(e=r.sent())!==E.ServiceWorkerActiveState.WorkerA&&e!==E.ServiceWorkerActiveState.WorkerB?[2,!1]:[4,navigator.serviceWorker.getRegistration()];case 2:return[4,r.sent().pushManager.getSubscription()];case 3:return(t=r.sent())&&t.expirationTime?[4,S.default.getSubscription()]:[2,!1];case 4:return(n=r.sent().createdAt)||(i=31536e6,n=(new Date).getTime()+i),o=n+(t.expirationTime-n)/2,[2,t.expirationTime&&((new Date).getTime()>=t.expirationTime||(new Date).getTime()>=o)]}})})},e.prototype.getSubscriptionState=function(){return i(this,void 0,void 0,function(){var t,n,i,o;return r(this,function(r){switch(r.label){case 0:if(e.isSafari())return[2,this.getSubscriptionStateForSecure()];switch(t=y.default.getWindowEnv(),t){case v.WindowEnvironmentKind.ServiceWorker:return[3,1]}return[3,4];case 1:return[4,self.registration.pushManager.getSubscription()];case 2:return n=r.sent(),[4,S.default.getSubscription()];case 3:return i=r.sent().optedOut,[2,{subscribed:!!n,optedOut:i}];case 4:return[4,y.default.getIntegration()];case 5:switch(o=r.sent(),o){case P.IntegrationKind.Secure:return[3,6];case P.IntegrationKind.SecureProxy:return[3,7];case P.IntegrationKind.InsecureProxy:return[3,11]}return[3,13];case 6:return[2,this.getSubscriptionStateForSecure()];case 7:switch(t){case v.WindowEnvironmentKind.OneSignalProxyFrame:case v.WindowEnvironmentKind.OneSignalSubscriptionPopup:case v.WindowEnvironmentKind.OneSignalSubscriptionModal:return[3,8]}return[3,9];case 8:return[2,this.getSubscriptionStateForSecure()];case 9:return[4,OneSignal.proxyFrameHost.runCommand(OneSignal.POSTMAM_COMMANDS.GET_SUBSCRIPTION_STATE)];case 10:return[2,r.sent()];case 11:return[4,this.getSubscriptionStateForInsecure()];case 12:return[2,r.sent()];case 13:throw new a.InvalidStateError(a.InvalidStateReason.UnsupportedEnvironment)}})})},e.prototype.getSubscriptionStateForSecure=function(){return i(this,void 0,void 0,function(){var t,n,i,o,s,a,u,c,l;return r(this,function(r){switch(r.label){case 0:return[4,S.default.getSubscription()];case 1:return t=r.sent(),n=t.deviceId,t.subscriptionToken,i=t.optedOut,e.isSafari()?(o=window.safari.pushNotification.permission(this.config.safariWebId),[2,{subscribed:!("granted"!==o.permission||!o.deviceToken||!n),optedOut:i}]):[4,this.context.serviceWorkerManager.getActiveState()];case 2:return s=r.sent(),[4,navigator.serviceWorker.getRegistration()];case 3:return a=r.sent(),[4,this.context.permissionManager.getNotificationPermission(this.context.appConfig.safariWebId)];case 4:return u=r.sent(),c=s===E.ServiceWorkerActiveState.WorkerA||s===E.ServiceWorkerActiveState.WorkerB,a?[4,a.pushManager.getSubscription()]:[2,{subscribed:!1,optedOut:i}];case 5:return l=r.sent(),[2,{subscribed:!!(l&&n&&u===h.NotificationPermission.Granted&&c),optedOut:i}]}})})},e.prototype.getSubscriptionStateForInsecure=function(){return i(this,void 0,void 0,function(){var e,t,n,i,o;return r(this,function(r){switch(r.label){case 0:return[4,S.default.getSubscription()];case 1:return e=r.sent(),t=e.deviceId,n=e.subscriptionToken,i=e.optedOut,[4,this.context.permissionManager.getNotificationPermission(this.context.appConfig.safariWebId)];case 2:return o=r.sent(),[2,{subscribed:!(!t||!n||o!==h.NotificationPermission.Granted),optedOut:i}]}})})},e.prototype.registerFailedSubscription=function(e,t){return i(this,void 0,void 0,function(){return r(this,function(n){return t.sessionManager.isFirstPageView()&&(t.subscriptionManager.registerSubscription(new g.RawPushSubscription,e),t.sessionManager.incrementPageViewCount()),[2]})})},e}();t.SubscriptionManager=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.getBaseUrl=function(){return location.origin},e}();t.Utils=i,t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isLocalStorageSupported=function(){if("undefined"==typeof localStorage)return!1;try{return localStorage.getItem("test"),!0}catch(e){return!1}},e.setItem=function(t,n,i){if(e.isLocalStorageSupported()){var r=void 0!==i?60*i*1e3:0,o={value:JSON.stringify(n),timestamp:void 0!==i?(new Date).getTime()+r:void 0};localStorage.setItem(t,JSON.stringify(o))}},e.getItem=function(t){if(!e.isLocalStorageSupported())return null;var n,i=localStorage.getItem(t);try{n=JSON.parse(i)}catch(e){return null}if(null===n)return null;if(n.timestamp&&(new Date).getTime()>=n.timestamp)return localStorage.removeItem(t),null;var r=n.value;try{r=JSON.parse(n.value)}catch(e){return r}return r},e.removeItem=function(t){if(!e.isLocalStorageSupported())return null;localStorage.removeItem(t)},e}();t.default=i},function(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),(i=t.DevicePlatformKind||(t.DevicePlatformKind={})).Mobile="mobile",i.Tablet="tablet",i.Desktop="desktop"},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s,a=o(n(4));(s=t.OneSignalApiErrorKind||(t.OneSignalApiErrorKind={}))[s.MissingAppId=0]="MissingAppId";var u=function(e){function n(i){var r=this;switch(i){case t.OneSignalApiErrorKind.MissingAppId:r=e.call(this,"The API call is missing an app ID.")||this}return Object.setPrototypeOf(r,n.prototype),r}return r(n,e),n}(a.default);t.OneSignalApiError=u},function(e,t){e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={});t||(t={});var o,s,a=t.prefix||"__jp",u=t.name||a+n++,c=t.param||"callback",l=null!=t.timeout?t.timeout:6e4,d=encodeURIComponent,f=document.getElementsByTagName("script")[0]||document.head;l&&(s=setTimeout(function(){p(),r&&r(new Error("Timeout"))},l));function p(){o.parentNode&&o.parentNode.removeChild(o),window[u]=i,s&&clearTimeout(s)}return window[u]=function(e){p(),r&&r(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+c+"="+d(u)).replace("?&","?"),(o=document.createElement("script")).src=e,f.parentNode.insertBefore(o,f),function(){window[u]&&p()}};var n=0;function i(){}},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0?i.message:"Thanks for subscribing!",p=new URL(location.href).origin+"?_osp=do_not_open",h=i&&i.url&&i.url.length>0?i.url:p,a=l.decodeHtmlEntities(a),f=l.decodeHtmlEntities(f),o||(d.default.debug("Sending welcome notification."),u.default.sendNotification(n,[t],{en:a},{en:f},h,null,{__isOneSignalWelcomeNotification:!0},void 0),s.default.trigger(OneSignal.EVENTS.WELCOME_NOTIFICATION_SENT,{title:a,message:f,url:h})),r.label=3;case 3:return[2]}})})},e.onSubscriptionChanged_evaluateNotifyButtonDisplayPredicate=function(e){return i(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return(e=OneSignal.config.userConfig.notifyButton.displayPredicate)&&"function"==typeof e&&OneSignal.notifyButton?[4,e()]:[3,2];case 1:!1!==t.sent()?(d.default.debug("Showing notify button because display predicate returned true."),OneSignal.notifyButton.launcher.show()):(d.default.debug("Hiding notify button because display predicate returned false."),OneSignal.notifyButton.launcher.hide()),t.label=2;case 2:return[2]}})})},e.triggerSubscriptionChanged=function(e){s.default.trigger(OneSignal.EVENTS.SUBSCRIPTION_CHANGED,e)},e.fireStoredNotificationClicks=function(e){return void 0===e&&(e=document.URL),i(this,void 0,void 0,function(){function t(e){return i(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){switch(r.label){case 0:return[4,c.default.getAppState()];case 1:return(t=r.sent()).clickedNotifications[e.url]=null,[4,c.default.setAppState(t)];case 2:return r.sent(),n=e.data,(i=e.timestamp)&&(Date.now()-i)/1e3/60>5?[2]:(s.default.trigger(OneSignal.EVENTS.NOTIFICATION_CLICKED,n),[2])}})})}var n,o,a,u,l,d;return r(this,function(i){switch(i.label){case 0:return[4,c.default.getAppState()];case 1:return n=i.sent(),[4,c.default.get("Options","notificationClickHandlerMatch")];case 2:if("origin"!==i.sent())return[3,7];o=0,a=Object.keys(n.clickedNotifications),i.label=3;case 3:return o0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]2&&(t=30),c.default.debug("("+s.default.getWindowEnv().toString()+") OneSignal: User dismissed the native notification prompt; reprompt after "+t+" days."),[4,a.default.put("Options",{key:"promptDismissCount",value:e})];case 4:return i.sent(),n=24*t*60,[2,u.default.setItem("onesignal-notification-prompt","dismissed",n)]}})})},e}();t.default=d},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),a=o(n(50)),u=o(n(38)),c=o(n(2)),l=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-message","onesignal-bell-launcher-message-opened",null,"hidden",["opacity","transform"],".onesignal-bell-launcher-message-body")||this;return n.bell=t,n.contentType="",n.queued=[],n}return r(t,e),Object.defineProperty(t,"TIMEOUT",{get:function(){return 2500},enumerable:!0,configurable:!0}),Object.defineProperty(t,"TYPES",{get:function(){return{TIP:"tip",MESSAGE:"message",QUEUED:"queued"}},enumerable:!0,configurable:!0}),t.prototype.display=function(e,t,n){var i=this;return void 0===n&&(n=0),c.default.debug("Calling %cdisplay("+e+", "+t+", "+n+").",s.getConsoleStyle("code")),(this.shown?this.hide():s.nothing()).then(function(){i.content=s.decodeHtmlEntities(t),i.contentType=e}).then(function(){return i.show()}).then(function(){return s.delay(n)}).then(function(){return i.hide()}).then(function(){i.content=i.getTipForState(),i.contentType="tip"})},t.prototype.getTipForState=function(){return this.bell.state===u.default.STATES.UNSUBSCRIBED?this.bell.text["tip.state.unsubscribed"]:this.bell.state===u.default.STATES.SUBSCRIBED?this.bell.text["tip.state.subscribed"]:this.bell.state===u.default.STATES.BLOCKED?this.bell.text["tip.state.blocked"]:void 0},t.prototype.enqueue=function(e){var t=this;return this.queued.push(s.decodeHtmlEntities(e)),new Promise(function(e){t.bell.badge.shown?t.bell.badge.hide().then(function(){return t.bell.badge.increment()}).then(function(){return t.bell.badge.show()}).then(e):(t.bell.badge.increment(),t.bell.initialized?t.bell.badge.show().then(e):e())})},t.prototype.dequeue=function(e){var t=this,n=this.queued.pop(e);return new Promise(function(e){t.bell.badge.shown?t.bell.badge.hide().then(function(){return t.bell.badge.decrement()}).then(function(e){return e>0?t.bell.badge.show():Promise.resolve(t)}).then(e(n)):(t.bell.badge.decrement(),e(n))})},t}(a.default);t.default=l},function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=63&&(a.default.tablet||a.default.mobile)?[4,OneSignal.privateShowHttpPrompt()]:[3,8];case 7:return n.sent(),[3,10];case 8:return[4,y.default.registerForPush()];case 9:n.sent(),n.label=10;case 10:return[3,12];case 11:OneSignal._sessionInitAlreadyRunning=!1,n.label=12;case 12:return[3,16];case 13:return!0!==OneSignal.config.userConfig.autoRegister&&A.default.debug("OneSignal: Not automatically showing popover because autoRegister is not specifically true."),S.default.isHttpPromptAlreadyShown()&&A.default.debug("OneSignal: Not automatically showing popover because it was previously shown in the same session."),!0!==OneSignal.config.userConfig.autoRegister||S.default.isHttpPromptAlreadyShown()?[3,15]:[4,OneSignal.privateShowHttpPrompt().catch(function(e){e instanceof c.InvalidStateError&&e.reason===c.InvalidStateReason[c.InvalidStateReason.RedundantPermissionMessage]||e instanceof l.default||e instanceof u.default||e instanceof I.default?A.default.debug("[Prompt Not Showing]",e):A.default.info(e)})];case 14:n.sent(),n.label=15;case 15:OneSignal._sessionInitAlreadyRunning=!1,n.label=16;case 16:return[4,d.default.trigger(OneSignal.EVENTS.SDK_INITIALIZED)];case 17:return n.sent(),[2]}})})},e.ponyfillSafariFetch=function(){return r(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:if(!a.default.safari||void 0!==window.fetch)return[3,4];A.default.debug("Loading fetch polyfill for Safari.."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,(new P.DynamicResourceLoader).loadFetchPolyfill()];case 2:return t.sent(),A.default.debug("Done loading fetch polyfill."),[3,4];case 3:return e=t.sent(),A.default.debug("Error loading fetch polyfill:",e),[3,4];case 4:return[2]}})})},e.errorIfInitAlreadyCalled=function(){if(OneSignal._initCalled)throw new w.SdkInitError(w.SdkInitErrorKind.MultipleInitialization);OneSignal._initCalled=!0},e.initializeConfig=function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return[4,(new R.default).getAppConfig(e)];case 1:return t=n.sent(),A.default.debug("OneSignal: Final web app config: %c"+JSON.stringify(t,null,4),m.getConsoleStyle("code")),OneSignal.context=new _.default(t),OneSignal.config=OneSignal.context.appConfig,[2]}})})},e}();t.default=D},function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=i(n(0)),s=function(){function e(){}return e.promiseStub=function(){return{then:e.promiseStub,catch:e.promiseStub}},e.ensureBackwardsCompatibility=function(t){e.environmentPolyfill(t),e.postmams(t),t.syncHashedEmail=e.promiseStub},e.environmentPolyfill=function(e){e.environment={},e.environment.getEnv=function(){return""},e.environment.isPopup=function(){return o.default.getWindowEnv()===r.WindowEnvironmentKind.OneSignalSubscriptionPopup},e.environment.isIframe=function(){return o.default.getWindowEnv()===r.WindowEnvironmentKind.OneSignalProxyFrame}},e.postmams=function(e){var t=function(){this.messenger.message.apply(this.messenger,arguments)},n=function(){this.messenger.postMessage.apply(this.messenger,arguments)};function i(e){e.message=t,e.postMessage=n}e.proxyFrame&&(e.iframePostmam=e.proxyFrame,i(e.iframePostmam)),e.subscriptionPopup&&(e.popupPostmam=e.subscriptionPopup,i(e.popupPostmam)),e.subscriptionModal&&(e.modalPostmam=e.subscriptionModal,i(e.modalPostmam))},e}();t.default=s},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var PermissionMessageDismissedError=function(e){function PermissionMessageDismissedError(){var t=e.call(this,"The permission message was previously dismissed.")||this;return Object.setPrototypeOf(t,PermissionMessageDismissedError.prototype),t}return r(PermissionMessageDismissedError,e),PermissionMessageDismissedError}(o(n(4)).default);t.default=PermissionMessageDismissedError},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var AlreadySubscribedError=function(e){function AlreadySubscribedError(){var t=e.call(this,"This operation can only be performed when the user is not subscribed.")||this;return Object.setPrototypeOf(t,AlreadySubscribedError.prototype),t}return r(AlreadySubscribedError,e),AlreadySubscribedError}(o(n(4)).default);t.default=AlreadySubscribedError},,function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s,a=o(n(4)),u=n(39);(s=t.DeprecatedApiReason||(t.DeprecatedApiReason={}))[s.HttpPermissionRequest=0]="HttpPermissionRequest",s[s.SyncHashedEmail=1]="SyncHashedEmail";var c=function(e){function n(i){var r=this;switch(i){case t.DeprecatedApiReason.HttpPermissionRequest:(r=e.call(this,"The HTTP permission request has been deprecated. Please remove any custom popups from your code.")||this).reportUsage(u.ApiUsageMetricKind.HttpPermissionRequest);break;case t.DeprecatedApiReason.SyncHashedEmail:(r=e.call(this,"API syncHashedEmail() has been deprecated and will be removed in a future SDK release. Please remove any usages from your code.")||this).reportUsage(u.ApiUsageMetricKind.SyncHashedEmail)}return Object.setPrototypeOf(r,n.prototype),r}return r(n,e),n.prototype.reportUsage=function(e){"undefined"!=typeof OneSignal&&OneSignal.context&&OneSignal.context.metricsManager&&OneSignal.context.metricsManager.reportEvent(new u.ApiUsageMetricEvent(e))},n}(a.default);t.DeprecatedApiError=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.isValidUrl=function(e,t){if(t&&t.allowNull&&null===e)return!0;if(t&&t.allowEmpty&&(null===e||void 0===e))return!0;try{var n=new URL(e);return!t||!t.requireHttps||"https:"===n.protocol}catch(e){return!1}},e.isValidBoolean=function(e,t){return!(!t||!t.allowNull||null!==e)||(!0===e||!1===e)},e.isValidArray=function(e,t){return!(!t||!t.allowNull||null!==e)||(!(!t||!t.allowEmpty||null!==e&&void 0!==e)||e instanceof Array)},e}();t.ValidatorUtils=i},function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]
'+this.options.actionMessage+'
',l.addDomElement("body","beforeend",'
'),l.addDomElement(this.container,"beforeend",'
'+i+"
"),l.addCssClass(this.container,a.default.mobile?"slide-up":"slide-down"),this.allowButton.addEventListener("click",this.onPopoverAllowed.bind(this)),this.cancelButton.addEventListener("click",this.onPopoverCanceled.bind(this)),u.default.trigger(e.EVENTS.SHOWN),r.label=2;case 2:return[2]}})})},e.prototype.onPopoverAllowed=function(t){u.default.trigger(e.EVENTS.ALLOW_CLICK)},e.prototype.onPopoverCanceled=function(t){u.default.trigger(e.EVENTS.CANCEL_CLICK),this.close()},e.prototype.close=function(){var t=this;l.addCssClass(this.container,"close-popover"),l.once(this.dialog,"animationend",function(n,i){n.target!==t.dialog||"slideDownExit"!==n.animationName&&"slideUpExit"!==n.animationName||(l.removeDomElement("#onesignal-popover-container"),i(),u.default.trigger(e.EVENTS.CLOSED))},!0)},e.prototype.getPlatformNotificationIcon=function(){return this.notificationIcons?l.isChromeLikeBrowser()||a.default.firefox||a.default.msedge?this.notificationIcons.chrome?this.notificationIcons.chrome:this.notificationIcons.firefox?this.notificationIcons.firefox:"default-icon":a.default.safari?this.notificationIcons.safari?this.notificationIcons.safari:this.notificationIcons.chrome?this.notificationIcons.chrome:"default-icon":void 0:"default-icon"},Object.defineProperty(e.prototype,"container",{get:function(){return document.querySelector("#onesignal-popover-container")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return document.querySelector("#onesignal-popover-dialog")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowButton",{get:function(){return document.querySelector("#onesignal-popover-allow-button")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cancelButton",{get:function(){return document.querySelector("#onesignal-popover-cancel-button")},enumerable:!0,configurable:!0}),e}();t.default=d},function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1] Host) Getting event listener count for ",t),e.reply(OneSignal.emitter.numberOfListeners(t)),!1},e.prototype.isSubscribed=function(){var e=this;return new Promise(function(t){e.messenger.message(OneSignal.POSTMAM_COMMANDS.IS_SUBSCRIBED,null,function(e){t(e.data)})})},e.prototype.unsubscribeFromPush=function(){var e=this;return new Promise(function(t){e.messenger.message(OneSignal.POSTMAM_COMMANDS.UNSUBSCRIBE_PROXY_FRAME,null,function(e){t()})})},e.prototype.getProxyServiceWorkerActiveState=function(){var e=this;return new Promise(function(t,n){e.message(OneSignal.POSTMAM_COMMANDS.SERVICE_WORKER_STATE,null,function(e){t(e.data)})})},e.prototype.runCommand=function(e){return i(this,void 0,void 0,function(){var t=this;return r(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n,i){t.message(e,null,function(e){n(e.data)})})];case 1:return[2,n.sent()]}})})},e.prototype.message=function(){for(var e=[],t=0;t0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0?t.bell.badge.hide().then(function(){return Promise.all([e.prototype.inactivate.call(t),t.resize("small")])}).then(function(){return t.bell.badge.show()}):Promise.all([e.prototype.inactivate.call(t),t.resize("small")])})},t.prototype.activate=function(){var t=this;return this.bell.badge.content.length>0?this.bell.badge.hide().then(function(){return Promise.all([e.prototype.activate.call(t),t.resize(t.bell.options.size)])}):Promise.all([e.prototype.activate.call(this),this.resize(this.bell.options.size)])},t}(l.default);t.default=f},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(7)),a=o(n(6)),u=o(n(0)),c=n(1),l=o(n(50)),d=o(n(38)),f=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-dialog","onesignal-bell-launcher-dialog-opened",null,"hidden",["opacity","transform"],".onesignal-bell-launcher-dialog-body")||this;return n.bell=t,n.subscribeButtonId="#onesignal-bell-container .onesignal-bell-launcher #subscribe-button",n.unsubscribeButtonId="#onesignal-bell-container .onesignal-bell-launcher #unsubscribe-button",n.notificationIcons=null,n}return r(t,e),t.prototype.getPlatformNotificationIcon=function(){return this.notificationIcons?c.isChromeLikeBrowser()||s.default.firefox||s.default.msedge?this.notificationIcons.chrome||this.notificationIcons.safari:s.default.safari?this.notificationIcons.safari||this.notificationIcons.chrome:void 0:null},t.prototype.show=function(){var t=this;return this.updateBellLauncherDialogBody().then(function(){return e.prototype.show.call(t)})},Object.defineProperty(t.prototype,"subscribeButtonSelectorId",{get:function(){return"subscribe-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unsubscribeButtonSelectorId",{get:function(){return"unsubscribe-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subscribeButton",{get:function(){return this.element.querySelector("#"+this.subscribeButtonSelectorId)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unsubscribeButton",{get:function(){return this.element.querySelector("#"+this.unsubscribeButtonSelectorId)},enumerable:!0,configurable:!0}),t.prototype.updateBellLauncherDialogBody=function(){var e=this;return OneSignal.getSubscription().then(function(t){c.clearDomElementChildren(document.querySelector(e.nestedContentSelector));var n="Nothing to show.",i="";if(e.bell.options.showCredit&&(i='
Powered by OneSignal
'),e.bell.state===d.default.STATES.SUBSCRIBED&&!0===t||e.bell.state===d.default.STATES.UNSUBSCRIBED&&!1===t){var r="";r=(l=e.getPlatformNotificationIcon())?'
':'
';var o="";o=e.bell.state!==d.default.STATES.SUBSCRIBED?'":'",n="

"+e.bell.text["dialog.main.title"]+'

'+r+'
'+o+"
"+i}else if(e.bell.state===d.default.STATES.BLOCKED){var l=null;s.default.chrome?s.default.mobile||s.default.tablet||(l=u.default.getOneSignalApiUrl().origin+"/bell/chrome-unblock.jpg"):s.default.firefox?l=u.default.getOneSignalApiUrl().origin+"/bell/firefox-unblock.jpg":s.default.safari&&(l=u.default.getOneSignalApiUrl().origin+"/bell/safari-unblock.jpg");var f="";l&&(f=''),(s.default.mobile||s.default.tablet)&&s.default.chrome&&(f="
  1. Access Settings by tapping the three menu dots â‹®
  2. Click Site settings under Advanced.
  3. Click Notifications.
  4. Find and click this entry for this website.
  5. Click Notifications and set it to Allow.
"),n="

"+e.bell.text["dialog.blocked.title"]+'

'+e.bell.text["dialog.blocked.message"]+"

"+f+"
"+i}c.addDomElement(document.querySelector(e.nestedContentSelector),"beforeend",n),e.subscribeButton&&e.subscribeButton.addEventListener("click",function(){OneSignal.__doNotShowWelcomeNotification=!1,a.default.trigger(d.default.EVENTS.SUBSCRIBE_CLICK)}),e.unsubscribeButton&&e.unsubscribeButton.addEventListener("click",function(){return a.default.trigger(d.default.EVENTS.UNSUBSCRIBE_CLICK)}),e.bell.setCustomColorsIfSpecified()})},t}(l.default);t.default=f},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),a=o(n(6)),u=o(n(51)),c=o(n(38)),l=o(n(42)),d=o(n(67)),f=o(n(35)),p=function(e){function t(t){var n=e.call(this,".onesignal-bell-launcher-button",null,null,"onesignal-bell-launcher-button-active",null,"shown","")||this;return n.bell=t,n.events={mouse:"bell.launcher.button.mouse"},n.element.addEventListener("touchstart",function(){n.onHovering(),n.onTap()},{passive:!0}),n.element.addEventListener("mouseenter",function(){n.onHovering()}),n.element.addEventListener("mouseleave",function(){n.onHovered()}),n.element.addEventListener("touchmove",function(){n.onHovered()},{passive:!0}),n.element.addEventListener("mousedown",function(){n.onTap()}),n.element.addEventListener("mouseup",function(){n.onEndTap()}),n.element.addEventListener("click",function(){n.onHovered(),n.onClick()}),n}return r(t,e),t.prototype.onHovering=function(){(l.default.isEmpty(this.events.mouse)||"out"===l.default.getLast(this.events.mouse))&&a.default.trigger(c.default.EVENTS.HOVERING),l.default.put(this.events.mouse,"over")},t.prototype.onHovered=function(){l.default.put(this.events.mouse,"out"),a.default.trigger(c.default.EVENTS.HOVERED)},t.prototype.onTap=function(){this.pulse(),this.activate(),this.bell.badge.activate()},t.prototype.onEndTap=function(){this.inactivate(),this.bell.badge.inactivate()},t.prototype.onClick=function(){var e=this;if(a.default.trigger(c.default.EVENTS.BELL_CLICK),a.default.trigger(c.default.EVENTS.LAUNCHER_CLICK),!this.bell.message.shown||this.bell.message.contentType!=d.default.TYPES.MESSAGE){var t=l.default.getLast("subscription.optedOut");return this.bell.unsubscribed?t?this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()}):(f.default.registerForPushNotifications(),this.bell._ignoreSubscriptionState=!0,f.default.emitter.once(f.default.EVENTS.SUBSCRIPTION_CHANGED,function(){e.bell.message.display(d.default.TYPES.MESSAGE,e.bell.text["message.action.subscribed"],d.default.TIMEOUT).then(function(){e.bell._ignoreSubscriptionState=!1,e.bell.launcher.inactivate()})})):this.bell.subscribed?this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()}):this.bell.blocked&&(s.isUsingSubscriptionWorkaround()?f.default.registerForPushNotifications():this.bell.launcher.activateIfInactive().then(function(){e.bell.showDialogProcedure()})),this.bell.message.hide()}},t.prototype.pulse=function(){s.removeDomElement(".pulse-ring"),s.addDomElement(this.element,"beforeend",'
'),this.bell.setCustomColorsIfSpecified()},t}(u.default);t.default=p},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){return e.call(this,".onesignal-bell-launcher-badge","onesignal-bell-launcher-badge-opened",null,"onesignal-bell-launcher-badge-active",null,"hidden")||this}return r(t,e),t.prototype.increment=function(){if(!isNaN(this.content)){var e=+this.content;e+=1,this.content=e.toString()}},t.prototype.show=function(){var t=e.prototype.show.call(this);return OneSignal.notifyButton.setCustomColorsIfSpecified(),t},t.prototype.decrement=function(){if(!isNaN(this.content)){var e=+this.content;e-=1,this.content=e>0?e.toString():""}},t}(o(n(51)).default);t.default=s},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1] Host) User unsubscribed but permission granted. Re-prompting the user for push."),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,g.unsubscribeFromPush()];case 2:return n.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[3,4];case 3:return t=n.sent(),v.default.debug("Failed to unsubscribe from push remotely:",t),[3,4];case 4:return[2]}})})},t.prototype.onMarkPromptDismissed=function(e){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return v.default.debug("(Reposted from iFrame -> Host) Marking prompt as dismissed."),[4,d.default.markHttpsNativePromptDismissed()];case 1:return t.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onIsSubscribed=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onUnsubscribeProxyFrame=function(e){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,OneSignal.isPushNotificationsEnabled()];case 1:return t.sent()?[4,OneSignal.setSubscription(!1)]:[3,4];case 2:return t.sent(),[4,OneSignal.database.rebuild()];case 3:t.sent(),t.label=4;case 4:return e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onServiceWorkerState=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.serviceWorkerManager.getActiveState()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onWorkerVersion=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.serviceWorkerManager.getWorkerVersion()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onSubscriptionExpirationState=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.subscriptionManager.isSubscriptionExpiring()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t.prototype.onProcessExpiringSubscriptions=function(e){return s(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return OneSignal.context,[4,l.default.processExpiringSubscriptions()];case 1:return t.sent(),e.reply(OneSignal.POSTMAM_COMMANDS.REMOTE_OPERATION_COMPLETE),[2,!1]}})})},t.prototype.onGetSubscriptionState=function(e){return s(this,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:return[4,OneSignal.context.subscriptionManager.getSubscriptionState()];case 1:return t=n.sent(),e.reply(t),[2,!1]}})})},t}(b.default);t.default=m},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]1)return o.default.warn("OneSignal: The web push SDK is included more than once. For optimal performance, please include our SDK only once on your page."),void o.default.debug("OneSignal: Exiting from SDK initialization to prevent double-initialization errors. Occurred "+s.getSdkLoadCount()+" times.");var e;if("undefined"!=typeof OneSignal&&(e=OneSignal),s.isPushNotificationsSupported()?window.OneSignal=n(35).default:(o.default.debug("OneSignal: Push notifications are not supported. A stubbed version of the SDK will be initialized."),window.OneSignal=r.default),e){if(!Array.isArray(e))return void o.default.error("'OneSignal' was not defined as an Array. Skipping pushes");for(var t=0,i=e;t
loading...

Zagadka migreny wyjaśniona?

Migrena to naturalny sposób autonaprawy ludzkiego mózgu - głosi najnowsza teoria dotycząca pochodzenia tej choroby. Otwiera ona zupełnie nowe perspektywy w leczeniu migreny.

zdjęcie ilustracyjne: pixabay/ Zagadka migreny wyjaśniona?/ ból głowy
zdjęcie ilustracyjne: pixabay/ Zagadka migreny wyjaśniona?/ ból głowy


Tego bólu nie da się porównać z żadnym innym. Świdrujący, przeszywający, nasilający się z każdym gwałtowniejszym poruszeniem. Nad prawym lub lewym oczodołem, czasami z obydwu stron głowy. Część chorych na migrenę obserwuje u siebie tzw. aurę, czyli zaburzenia widzenia, w postaci świetlistych zygzaków, plamek, czasami ubytków w polu widzenia. Często aura wyprzedza atak bólu.

Migrena. Dlaczego boli głowa?

Pochodzenie migreny nie jest do końca wyjaśnione. Jak pisze na łamach „Aktualności Neurologicznych” prof. Adam Stępień z Kliniki Neurologii Wojskowego Instytutu Medycznego „w świetle dotychczasowych ustaleń można uznać, że migrena jest uwarunkowaną genetycznie (poligenetycznie) kanałopatią, w której istnieje szczególna predyspozycja do wzmożonej reaktywności naczynioruchowej, u podłoża której leżą napadowo ujawniające się zmiany w ośrodkowym układzie nerwowym”.

Ujmując prościej, to schorzenie wynikające z zaburzenia funkcjonowania kanałów jonowych w komórkach mózgu. Kanały jonowe zaś są wyspecjalizowanymi białkami błony komórkowej, które biorą udział w transporcie jonów w poprzek błony komórkowej.
Co to jest migrena?
Jest to choroba neurologiczna. Charakteryzuje się nawrotowymi epizodami bólów głowy, którym towarzyszą nudności, wymioty i światłowstręt. Częstość jej występowania szacuje się na ok. 6 proc. w przypadku mężczyzn i 15 -18 proc. kobiet. Najwięcej nowych zachorowań pojawia się w okolicach 40. roku życia, co oznacza, że cierpią przede wszystkim ludzie aktywni zawodowo. Najbardziej dotkliwa jest migrena przewlekła, w jej przypadku napady migrenowego bólu głowy trwają powyżej 15 dni w miesiącu przez okres przynajmniej 3 miesięcy.
Nową koncepcję pochodzenia migreny przedstawił właśnie na łamach czasopisma „Headache” amerykański badacz dr Jonathan Borkum z University of Maine. Według niego jest to mechanizm obronny mózgu w walce ze stresem oksydacyjnym. Innymi słowy, jest to sposób autonaprawy. Wcześniejsze badania wykazały bowiem, że u migreników, czyli osób cierpiących na migreny, poziom stresu oksydacyjnego jest większy.
Co to jest stres oksydacyjny?
W warunkach prawidłowych w organizmie istnieje równowaga pomiędzy utleniaczami a przeciwutleniaczami. Wzrost produkcji wolnych rodników lub spadek aktywności antyoksydacyjnej powoduje zachwianie tej równowagi w kierunku reakcji utlenienia, co nazywane jest stresem oksydacyjnym. Wolne rodniki to reaktywne formy tlenu, które powstają na skutek naturalnych procesów w ludzkim organizmie. Reaktywne formy tlenu w nadmiarze mogą powodować uszkodzenia m.in. występujących w organizmie białek i tłuszczów, a także DNA komórek. Można z nimi walczyć za pomocą przeciwutleniaczy.

Jak zapobiegać migrenie?

- Wydaje się prawdopodobne, że ataki migreny nie są po prostu wywoływane przez stres oksydacyjny, lecz aktywnie chronią przed nim mózg i aktywnie go naprawiają – mówi dr Borkum.
W świetle jego teorii, zapobiegając stresowi oksydacyjnemu w organizmie, możemy zmniejszyć liczbę ataków migreny. Organizm bowiem nie będzie się przed nim bólem głowy.
Co wywołuje stres oksydacyjny?
Dr Borkum odnotował, że każdy z czynników, wyzwalających atak migreny:
  • stres,
  • zaburzenia snu,
  • hałas,
  • zanieczyszczenie powietrza
  • niewłaściwa dieta,
  • alkohol,
  • stres oksydacyjny.
Tym samym, unikając powyższych czynników, chronimy się przed atakiem bólu migrenowego.

Masz migreny? Utrzymuj prawidłowe BMI

Innym czynnikiem ryzyka, w przypadku tego schorzenia, na który mamy wpływ, jest masa ciała. Metaanaliza obejmująca 12 prac badawczych i blisko 300 tysięcy osób przeprowadzona przez amerykańską uczoną dr B. Lee Peterlin z Johns Hopkins University School of Medicine ujawniła, że zarówno otyłość, jak i niedowaga, zwiększają ryzyko tego schorzenia. W przypadku otyłości (BMI większe niż 30) ryzyko było większe o 27 proc., a niedowagi (BMI poniżej 18,5) - 13 proc.
Co ciekawe, zależność między nadwagą a nawrotowymi bólami głowy była najsilniejsza w przypadku kobiet i generalnie młodych ludzi. I choć dr Peterlin przyznaje, że na podstawie jej badań nie wiadomo, czy utrata lub zwiększenie wagi może zmniejszyć ryzyko migreny, wiadomo jednak, że u osób otyłych notuje się również zwiększony poziom stresu oksydacyjnego, co współgra z teorią dr Borkuma.

Rodzinne uwarunkowania migren

Wiele jednak wskazuje, że sięgając dalej, migreny mają podłoże genetyczne, to znaczy istnieją określone warianty genów, lub zespołów genów, dające się powiązać z tą chorobą. W 2016 roku międzynarodowe konsorcjum badawcze opublikowało w „Nature Genetics” wyniki analizy materiału genetycznego pochodzącego od 375 tysięcy Europejczyków, Amerykanów i Australijczyków. Blisko 60 tysięcy z nich cierpiało z powodu migren. Rezultaty tych badań okazały się być wielce zaskakujące, okazało się bowiem, że w ludzkim genomie istnieje aż 38 różnych obszarów, które da się powiązać z występowaniem napadowych bólów głowy. Wcześniej znano jedynie 10. Większość genów przedstawionych w pracy konsorcjum została już opisana w kontekście innych chorób. Okazało się na przykład, że dziewięć wiązano wcześniej z ryzykiem chorób naczyń, a cztery - z regulacją ich pracy. Według badaczy, wzmacnia to teorię, według której kwestie działania układu naczyniowego pozostają kluczowe do epidemiologii migreny.
Potwierdzają to zresztą badania opisane przez Michaela Stara i Jose Billera w książce „Headache and Migraine Biology and Management”. Wynika z nich, że osoby cierpiące na migrenę z aurą są blisko dwukrotnie częściej zagrożone udarem niedokrwiennym mózgu. Polega on na zatrzymaniu dopływu krwi do mózgu, na skutek m.in. stanów zapalnych naczyń albo zmian miażdżycowych. Jeśli taki człowiek pali, ryzyko jest już wyższe trzykrotnie. Natomiast jeśli migrenę z aurą ma kobieta, która pali i bierze hormonalne leki antykoncepcyjne, ma już siedem razy większe szanse na udar niedokrwienny mózgu. Wszystkie migreny zwiększają również ryzyko zawału serca.
Mamy jednak pocieszająca wiadomość dla kobiet, które cierpią z powodu migren z aurą. Badania dr Tobiasa Kurtha z Brigham and Women’s Hospital, Harvard Medical School, przeprowadzone na grupie blisko 28 tysięcy kobiet, których losy śledzono ponad 13,5 roku dowodzą, że choć są one obarczone dwukrotnie większym ryzykiem udaru, przechodzą go znacznie łagodniej niż ludzie niecierpiący z powodu migren. W rezultacie wychodzą z udaru bez większych zmian neurologicznych w mózgu lub są one wręcz minimalne.

Jak leczyć migrenę bez powikłań?

„W leczeniu napadów migreny najczęściej stosuje się zwykłe leki przeciwbólowe i niesteroidowe leki przeciwzapalne. Są one często łączone z lekami przeciwwymiotnymi” – czytamy na łamach „Aktualności Neurologicznych” w artykule prof. Adama Stępnia. Z kolei Europejska Federacja Towarzystw Neurologicznych zaleca również przyjmowanie złożonych preparatów zawierających kwas acetylosalicylowy (250 mg), paracetamol (200–250 mg) i kofeinę (50 mg) – które okazały się skuteczniejsze niż każda z tych substancji stosowana osobno lub w postaci preparatu złożonego bez kofeiny.
Jednak, by nie rozwinął się ból głowy z nadużywania leków, zaleca się ograniczenie przyjmowania prostych leków przeciwbólowych do 15 dni w miesiącu, a preparatów złożonych – do 10 dni w miesiącu.
Neurolodzy stosują też silniej działające leki.
Warto jednak pamiętać o unikaniu, o ile jest to możliwe, czynników wyzwalających ataki migreny. Dla każdego z chorych ten zestaw może być inny, najczęściej są to:
  • głód/pominięcie posiłku
  • odwodnienie
  • zakłócenia snu: zbyt krótki lub zbyt długi sen
  • zmiany hormonalne u kobiet
  • określone stadia cyklu miesiączkowego, niektóre doustne środki antykoncepcyjne, ciąża i menopauza
  • stres
  • okresy odprężenia po stresie
  • nadmierny wysiłek fizyczny i psychiczny
  • jasne światło, gorący lub wilgotny klimat, głośne dźwięki
  • alkohol, zwłaszcza czerwone wino
  • spożywanie nadmiernych ilości napojów zawierających kofeinę
  • ser, owoce cytrusowe, czekolada
Na szczęście współczesna medycyna coraz lepiej radzi sobie ze zwalczaniem migren, więc zachowując odpowiednią ostrożność i stosując odpowiednie środki, można ich niemal całkowicie uniknąć.
Anna Piotrowska (zdrowie.pap.pl)
loading...
« PREV
NEXT »
loading...