__smjsonp__([12],{92:function(t,e,r){"use strict";var a=function(){function t(t,e){var r=[],a=!0,n=!1,o=void 0;try{for(var s,i=t[Symbol.iterator]();!(a=(s=i.next()).done)&&(r.push(s.value),!e||r.length!==e);a=!0);}catch(t){n=!0,o=t}finally{try{!a&&i.return&&i.return()}finally{if(n)throw o}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=r(88);t.exports=function(){n.onMessage(n.getMessaging(),function(t){function e(t){var e=new URLSearchParams(t),r={},n=!0,o=!1,s=void 0;try{for(var i,u=e.entries()[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var d=a(i.value,2);r[d[0]]=d[1]}}catch(t){o=!0,s=t}finally{try{!n&&u.return&&u.return()}finally{if(o)throw s}}return r}function r(r,n,o,s,i){var u=t.data.hasOwnProperty("vi")?"https://"+t.data.vi:"https://www.salesmanago.com",d=new URL("/api/push/display.json",u),p=new URLSearchParams,c=e("userId="+n);p.set("pushId",r),p.set("type",o),p.set("webPushMessageIntId",s);var h=!0,l=!1,f=void 0;try{for(var y,v=Object.entries(c)[Symbol.iterator]();!(h=(y=v.next()).done);h=!0){var I=a(y.value,2);p.set(I[0],I[1])}}catch(t){l=!0,f=t}finally{try{!h&&v.return&&v.return()}finally{if(l)throw f}}i&&p.set("productId",i),d.search=p.toString(),fetch(d.toString(),{method:"GET",mode:"no-cors",headers:{"Content-Type":"application/json"}})}function n(t){return t.hasOwnProperty("options")&&t.options.hasOwnProperty("data")?t.options.data.productId:null}navigator.serviceWorker.ready.then(function(e){if(t.data)if("image"in Notification.prototype&&t.data.hasOwnProperty("rich")){var a=JSON.parse(t.data.rich);a.options.data||(a.options.data={}),t.data.hasOwnProperty("vi")&&(a.options.data.vendorInstance=t.data.vi),e.showNotification(a.title,a.options),r(a.user.pushId,a.user.userId,"RICH_WEB_PUSH",a.user.webPushMessageIntId,n(a))}else if(t.data.hasOwnProperty("basic")){var o=JSON.parse(t.data.basic);if(o.hasOwnProperty("options"))o.options.data||(o.options.data={}),t.data.hasOwnProperty("vi")&&(o.options.data.vendorInstance=t.data.vi),e.showNotification(o.title,o.options);else{var s={targetUrl:o.targetUrl,pushId:o.user.pushId,userId:o.user.userId,webPushMessageIntId:o.user.webPushMessageIntId,vendorInstance:t.data.vi||null};e.showNotification(o.title,{body:o.message,icon:o.icon,requireInteraction:!0,data:s})}r(o.user.pushId,o.user.userId,"WEB_PUSH",o.user.webPushMessageIntId,n(o))}})})}}});