1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5054],{35054:function(i,e,t){t.r(e),t.d(e,{default:function(){return d}});var n=t(98886),s=t(8071),r=t(6963),o=t(71290);var u={Nu:function(i){const e=(i+"=".repeat((4-i.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;++s)n[s]=t.charCodeAt(s);return n}},a=t(50139),c=t(74208),h=t(63186),f=t(1738);class p{constructor(i,e,t,n,s,r,o,u,a,c,f){this.iu=i,this.tu=e,this.eu=t,this.su=s,this.ru=r,this.nu=o,this.h=u,this.ou=a,this.uu=c,this.B=f,this.iu=i,this.tu=e,this.eu=t,this.au=n+"/safari/"+e,this.su=s||"/service-worker.js",this.nu=o,this.h=u,this.ou=a||!1,this.uu=c||!1,this.B=f,this.hu=h.Z.cu(),this.fu=h.Z.lu()}du(){return this.uu}pu(i,e,t,n,s){i.unsubscribe().then((i=>{i?this.bu(e,t,n,s):(o.Z.error("Failed to unsubscribe device from push."),"function"==typeof s&&s(!1))})).catch((i=>{o.Z.error("Push unsubscription error: "+i),"function"==typeof s&&s(!1)}))}yu(i,e,t){var n;const s=(i=>{if("string"==typeof i)return i;if(0!==i.endpoint.indexOf("https://android.googleapis.com/gcm/send"))return i.endpoint;let e=i.endpoint;const t=i;return t.mu&&-1===i.endpoint.indexOf(t.mu)&&(e=i.endpoint+"/"+t.mu),e})(i);let r=null,u=null;const a=i;if(null!=a.getKey)try{const i=Array.from(new Uint8Array(a.getKey("p256dh"))),e=Array.from(new Uint8Array(a.getKey("auth")));r=btoa(String.fromCharCode.apply(null,i)),u=btoa(String.fromCharCode.apply(null,e))}catch(i){o.Z.error((0,f.e)(i))}const c=(i=>{let e;return i.options&&(e=i.options.applicationServerKey)&&e.byteLength&&e.byteLength>0?btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(e)))).replace(/\+/g,"-").replace(/\//g,"_"):null})(a);null===(n=this.iu)||void 0===n||n.gu(s,e,r,u,c),s&&"function"==typeof t&&t(s,r,u)}vu(){var i;null===(i=this.iu)||void 0===i||i.wu(!0)}ku(i,e){var t;null===(t=this.iu)||void 0===t||t.wu(!1),o.Z.info(i),"function"==typeof e&&e(!1)}Pu(i,e,t,n){var s;if("default"===e.permission)try{window.safari.pushNotification.requestPermission(this.au,i,{api_key:this.tu,device_id:(null===(s=this.eu)||void 0===s?void 0:s.ve().id)||""},(e=>{"granted"===e.permission&&this.iu&&this.iu.setPushNotificationSubscriptionType(c.Z.NotificationSubscriptionTypes.OPTED_IN),this.Pu(i,e,t,n)}))}catch(i){this.ku("Could not request permission for push: "+i,n)}else"denied"===e.permission?this.ku("The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",n):"granted"===e.permission&&(o.Z.info("Device successfully subscribed to push."),this.yu(e.deviceToken,new Date,t))}requestPermission(i,e,t){const n=n=>{switch(n){case"granted":return void("function"==typeof i&&i());case"default":return void("function"==typeof e&&e());case"denied":return void("function"==typeof t&&t());default:o.Z.error("Received unexpected permission result "+n)}};let s=!1;if("default"!==window.Notification.permission)n(Notification.permission);else{const i=window.Notification.requestPermission((i=>{s&&n(i)}));i?i.then((i=>{n(i)})):s=!0}}bu(i,e,t,n){const s={userVisibleOnly:!0};null!=e&&(s.applicationServerKey=e),i.pushManager.subscribe(s).then((i=>{o.Z.info("Device successfully subscribed to push."),this.yu(i,new Date,t)})).catch((i=>{h.Z.isPushBlocked()?(o.Z.info("Permission for push notifications was denied."),"function"==typeof n&&n(!1)):(o.Z.error("Push subscription failed: "+i),"function"==typeof n&&n(!0))}))}Du(){if(this.ou)return navigator.serviceWorker.getRegistration(this.su);const i=this.ru?{scope:this.ru}:void 0;return navigator.serviceWorker.register(this.su,i).then((()=>navigator.serviceWorker.ready.then((i=>(i&&"function"==typeof i.update&&i.update().catch((i=>{o.Z.info("ServiceWorker update failed: "+i)})),i)))))}Su(i){this.ou||(i.unregister(),o.Z.info("Service worker successfully unregistered."))}subscribe(i,e){if(!h.Z.isPushSupported())return o.Z.info(p.Au),void("function"==typeof e&&e(!1));if(this.hu){if(!this.ou&&null!=window.location){let i=this.su;-1===i.indexOf(window.location.host)&&(i=window.location.host+i),-1===i.indexOf(window.location.protocol)&&(i=window.location.protocol+"//"+i)}if(h.Z.isPushBlocked())return void this.ku("Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",e);if(this.h&&!this.h.ju()&&0===this.h.xt())return o.Z.info("Waiting for VAPID key from server config before subscribing to push."),void this.h.xu((()=>{this.subscribe(i,e)}));const t=()=>{o.Z.info("Permission for push notifications was denied."),"function"==typeof e&&e(!1)},n=()=>{let i="Permission for push notifications was ignored.";h.Z.isPushBlocked()&&(i+=" The browser has automatically blocked further permission requests for a period (probably 1 week)."),o.Z.info(i),"function"==typeof e&&e(!0)},f=h.Z.isPushPermissionGranted(),p=()=>{!f&&this.iu&&this.iu.setPushNotificationSubscriptionType(c.Z.NotificationSubscriptionTypes.OPTED_IN),this.Du().then((t=>{if(null==t)return o.Z.error("No service worker registration. Set the `manageServiceWorkerExternally` initialization option to fal
1se or ensure that your service worker is registered before calling registerPush."),void("function"==typeof e&&e(!0));t.pushManager.getSubscription().then((n=>{var c;let h=null;if(null!=(null===(c=this.h)||void 0===c?void 0:c.ju())&&(h=u.Nu(this.h.ju())),n){let u,c=null,f=null;if(this.B&&(u=this.B.dt(a.I.ft.Uu)),u&&!(0,s.kJ)(u)){let i;try{i=r.Z._u(u).Wu}catch(e){i=null}null==i||isNaN(i.getTime())||0===i.getTime()||(c=i,f=new Date(c),f.setMonth(c.getMonth()+6))}null!=h&&n.options&&n.options.applicationServerKey&&n.options.applicationServerKey.byteLength&&n.options.applicationServerKey.byteLength>0&&!(0,s.Xy)(h,new Uint8Array(n.options.applicationServerKey))?(n.options.applicationServerKey.byteLength>12?o.Z.info("Device was already subscribed to push using a different VAPID provider, creating new subscription."):o.Z.info("Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription."),this.pu(n,t,h,i,e)):n.expirationTime&&new Date(n.expirationTime).valueOf()<=(new Date).valueOf()?(o.Z.info("Push subscription is expired, creating new subscription."),this.pu(n,t,h,i,e)):u&&(0,s.kJ)(u)?this.pu(n,t,h,i,e):null==f?(o.Z.info("No push subscription creation date found, creating new subscription."),this.pu(n,t,h,i,e)):f.valueOf()<=(new Date).valueOf()?(o.Z.info("Push subscription older than 6 months, creating new subscription."),this.pu(n,t,h,i,e)):(o.Z.info("Device already subscribed to push, sending existing subscription to backend."),this.yu(n,c,i))}else this.bu(t,h,i,e)})).catch((i=>{o.Z.error("Error checking current push subscriptions: "+i)}))})).catch((i=>{o.Z.error("ServiceWorker registration failed: "+i)}))};this.requestPermission(p,n,t)}else if(this.fu){if(null==this.nu||""===this.nu)return o.Z.error("You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari"),void("function"==typeof e&&e(!0));const t=window.safari.pushNotification.permission(this.nu);this.Pu(this.nu,t,i,e)}}unsubscribe(i,e){if(!h.Z.isPushSupported())return o.Z.info(p.Au),void("function"==typeof e&&e());this.hu?navigator.serviceWorker.getRegistration(this.su).then((t=>{t?t.pushManager.getSubscription().then((n=>{n?(this.vu(),n.unsubscribe().then((n=>{n?(o.Z.info("Device successfully unsubscribed from push."),"function"==typeof i&&i()):(o.Z.error("Failed to unsubscribe device from push."),"function"==typeof e&&e()),this.Su(t)})).catch((i=>{o.Z.error("Push unsubscription error: "+i),"function"==typeof e&&e()}))):(o.Z.info("Device already unsubscribed from push."),"function"==typeof i&&i())})).catch((i=>{o.Z.error("Error unsubscribing from push: "+i),"function"==typeof e&&e()})):(o.Z.info("Device already unsubscribed from push."),"function"==typeof i&&i())})):this.fu&&(this.vu(),o.Z.info("Device unsubscribed from push."),"function"==typeof i&&i())}}p.Au="Push notifications are not supported in this browser.";const l={i:!1,na:null,ra:()=>(l.t(),l.na||(l.na=new p(n.ZP.br(),n.ZP._a(),n.ZP.ue(),n.ZP.V(),n.ZP.re(n.JY.Ga),n.ZP.re(n.JY.Ha),n.ZP.re(n.JY.Ia),n.ZP.l(),n.ZP.re(n.JY.Ka),n.ZP.re(n.JY.La),n.ZP.p())),l.na),t:()=>{l.i||(n.ZP.g(l),l.i=!0)},destroy:()=>{l.na=null,l.i=!1}};var d=l}}]);
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.