PageSourceSearch

https://pixel.wp.pl/push_manager/push.js

js wp.pl collected 2026-10-09 21:49:10 UTC 87,413 bytes, 2 lines download raw bytes

vendor: 1,178 bytes, lines 1-2
1/*! For license information please see push.js.LICENSE.txt */
2(()=>{var e={7503(e,t,i){var n;e=i.nmd(e),function(){"use strict";var r={function:!0,object:!0},o=r[typeof window]&&window||this,s=r[typeof t]&&t,a=r.object&&e&&!e.nodeType&&e,l=s&&a&&"object"==typeof i.g&&i.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(o=l);var u=Math.pow(2,53)-1,c=/\bOpera/,d=Object.prototype,p=d.hasOwnProperty,g=d.toString;function h(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function b(e){return e=w(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:h(e)}function v(e,t){for(var i in e)p.call(e,i)&&t(e[i],i,e)}function S(e){return null==e?h(e):g.call(e).slice(8,-1)}function f(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function m(e,t){var i=null;return function(e,t){var i=-1,n=e?e.length:0;if("number"==typeof n&&n>-1&&n<=u)for(;++i<n;)t(e[i],i);else v(e,t)}(e,function(n,r){i=t(i,n,r,e)}),i}function w(e){return String(e).replace(/^ +| +$/g,"")}var P=function e(t){var i=o,n=t&&"object"==typeof t&&"String"!=S(t);n&&(i=t,t=null);var r=i.navigator||{},s=r.userAgent||"";t||(t=s);var a,l,u,d,p,h=n?!!r.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(g.toString()),P="Object",
vendor: 4,559 bytes, line 2
2y=n?P:"ScriptBridgingProxyObject",I=n?P:"Environment",x=n&&i.java?"JavaPackage":S(i.java),W=n?P:"RuntimeObject",E=/\bJava/.test(x)&&i.java,M=E&&S(i.environment)==I,_=E?"a":"α",O=E?"b":"β",k=i.document||{},L=i.operamini||i.opera,T=c.test(T=n&&L?L["[[Class]]"]:S(L))?T:L=null,A=t,F=[],B=null,C=t==s,R=C&&L&&"function"==typeof L.version&&L.version(),N=m([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(e,i){return e||RegExp("\\b"+(i.pattern||f(i))+"\\b","i").exec(t)&&(i.label||i)}),j=m(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],function(e,i){return e||RegExp("\\b"+(i.pattern||f(i))+"\\b","i").exec(t)&&(i.label||i)}),V=U([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),D=m({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}},function(e,i,n){return e||(i[V]||i[/^[a-z]+(?: +[a-z]+\b)*/i.exec(V)]||RegExp("\\b"+f(n)+"(?:\\b|\\w*\\d)","i").exec(t))&&n}),G=m(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],function(e,i){var n=i.pattern||f(i);return!e&&(e=RegExp("\\b"+n+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,i){var n={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&i&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(n=n[/[\d.]+$/.exec(e)])&&(e="Windows "+n),e=String(e),t&&i&&(e=e.replace(RegExp(t,"i"),i)),b(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,n,i.label||i)),e});function U(e){return m(e,function(e,i){var n=i.pattern||f(i);return!e&&(e=RegExp("\\b"+n+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+n+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+n+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(i.label&&!RegExp(n,"i").test(i.label)?i.label:e).split("/"))[1]&&
vendor: 7,239 bytes, line 2
2!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),i=i.label||i,e=b(e[0].replace(RegExp(n,"i"),i).replace(RegExp("; *(?:"+i+"[_-])?","i")," ").replace(RegExp("("+i+")[-_.]?(\\w)","i"),"$1 $2"))),e})}function K(e){return m(e,function(e,i){return e||(RegExp(i+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null})}if(N&&(N=[N]),/\bAndroid\b/.test(G)&&!V&&(a=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(V=w(a[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),D&&!V?V=U([D]):D&&V&&(V=V.replace(RegExp("^("+f(D)+")[-_.\\s]","i"),D+" ").replace(RegExp("^("+f(D)+")[-_.]?(\\w)","i"),D+" $2")),(a=/\bGoogle TV\b/.exec(V))&&(V=a[0]),/\bSimulator\b/i.test(t)&&(V=(V?V+" ":"")+"Simulator"),"Opera Mini"==j&&/\bOPiOS\b/.test(t)&&F.push("running in Turbo/Uncompressed mode"),"IE"==j&&/\blike iPhone OS\b/.test(t)?(D=(a=e(t.replace(/like iPhone OS/,""))).manufacturer,V=a.product):/^iP/.test(V)?(j||(j="Safari"),G="iOS"+((a=/ OS ([\d_]+)/i.exec(t))?" "+a[1].replace(/_/g,"."):"")):"Konqueror"==j&&/^Linux\b/i.test(G)?G="Kubuntu":D&&"Google"!=D&&(/Chrome/.test(j)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(V))||/\bAndroid\b/.test(G)&&/^Chrome/.test(j)&&/\bVersion\//i.test(t)?(j="Android Browser",G=/\bAndroid\b/.test(G)?G:"Android"):"Silk"==j?(/\bMobi/i.test(t)||(G="Android",F.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&F.unshift("accelerated")):"UC Browser"==j&&/\bUCWEB\b/.test(t)?F.push("speed mode"):"PaleMoon"==j&&(a=/\bFirefox\/([\d.]+)\b/.exec(t))?F.push("identifying as Firefox "+a[1]):"Firefox"==j&&(a=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(G||(G="Firefox OS"),V||(V=a[1])):!j||(a=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(j))?(j&&!V&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(a+"/")+8))&&(j=null),(a=V||D||G)&&(V||D||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(G))&&(j=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(G)?G:a)+" Browser")):"Electron"==j&&(a=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&F.push("Chromium "+a),R||(R=K(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",f(j),"(?:Firefox|Minefield|NetFront)"])),(a=("iCab"==N&&parseFloat(R)>3?"WebKit":/\bOpera\b/.test(j)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(N)&&"WebKit"||!N&&/\bMSIE\b/i.test(t)&&("Mac OS"==G?"Tasman":"Trident")||"WebKit"==N&&/\bPlayStation\b(?! Vita\b)/i.test(j)&&"NetFront")&&(N=[a]),"IE"==j&&(a=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(j+=" Mobile",G="Windows Phone "+(/\+$/.test(a)?a:a+".x"),F.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(j="IE Mobile",G="Windows Phone 8.x",F.unshift("desktop mode"),R||(R=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=j&&"Trident"==N&&(a=/\brv:([\d.]+)/.exec(t))&&(j&&F.push("identifying as "+j+(R?" "+R:"")),j="IE",R=a[1]),C){if(d="global",p=null!=(u=i)?typeof u[d]:"number",/^(?:boolean|number|string|undefined)$/.test(p)||"object"==p&&!u[d])S(a=i.runtime)==y?(j="Adobe AIR",G=a.flash.system.Capabilities.os):S(a=i.phantom)==W?(j="PhantomJS",R=(a=a.version||null)&&a.major+"."+a.minor+"."+a.patch):"number"==typeof k.documentMode&&(a=/\bTrident\/(\d+)/i.exec(t))?(R=[R,k.documentMode],(a=+a[1]+4)!=R[1]&&(F.push("IE "+R[1]+" mode"),N&&(N[1]=""),R[1]=a),R="IE"==j?String(R[1].toFixed(1)):R[0]):"number"==typeof k.documentMode&&/^(?:Chrome|Firefox)\b/.test(j)&&(F.push("masking as "+j+" "+R),j="IE",R="11.0",N=["Trident"],G="Windows");else if(E&&(A=(a=E.lang.System).getProperty("os.arch"),G=G||a.getProperty("os.name")+" "+a.getProperty("os.version")),M){try{R=i.require("ringo/engine").version.join("."),j="RingoJS"}catch(e){(a=i.system)&&a.global.system==i.system&&(j="Narwhal",G||(G=a[0].os||null))}j||(j="Rhino")}else"object"==typeof i.process&&!i.process.browser&&(a=i.process)&&("object"==typeof a.versions&&("string"==typeof a.versions.electron?(F.push("Node "+a.versions.node),j="Electron",R=a.versions.electron):"string"==typeof a.versions.nw&&(F.push("Chromium "+R,"Node "+a.versions.node),j="NW.js",R=a.versions.nw)),j||(j="Node.js",A=a.arch,G=a.platform,R=(R=/[\d.]+/.exec(a.version))?R[0]:null));G=G&&b(G)}if(R&&(a=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(R)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(C&&r.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(B=/b/i.test(a)?"beta":"alpha",R=R.replace(RegExp(a+"\\+?$"),"")+("beta"==B?O:_)+(/\d+\+?/.exec(a)||"")),"Fennec"==j||"Firefox"==j&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))j="Firefox Mobile";else if("Maxthon"==j&&R)R=R.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(G=null),"Xbox 360"==V&&/\bIEMobile\b/.test(t)&&F.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(j)&&(!j||V||/Browser|Mobi/.test(j))||"Windows CE"!=G&&!/Mobi/i.test(t))if("IE"==j&&C)try{null===i.external&&F.unshift("platform preview")}catch(e){F.unshift("embedded")}else(/\bBlackBerry\b/.test(V)||/\bBB10\b/.test(t))&&(a=(RegExp(V.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||R)?(G=((a=[a,/BB10/.test(t)])[1]?(V=null,D="BlackBerry"):"Device Software")+" "+a[0],R=null):this!=v&&"Wii"!=V&&(C&&L||/Opera/.test(j)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==j&&/\bOS X (?:\d+\.){2,}/.test(G)||"IE"==j&&(G&&!/^Win/.test(G)&&R>5.5||/\bWindows XP\b/.test(G)&&R>8||8==R&&!/\bTrident\b/.test(t)))&&!c.test(a=e.call(v,t.replace(c,"")+";"))&&a.name&&(a="ing as "+a.name+((a=a.version)?" "+a:""),c.test(j)?(/\bIE\b/.test(a)&&"Mac OS"==G&&(G=null),a="identify"+a):(a="mask"+a,j=T?b(T.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(a)&&(G=null),C||(R=null)),N=["Presto"],F.push(a));else j+=" Mobile";(a=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(a=[parseFloat(a.replace(/\.(\d)$/,".0$1")),a],"Safari"==j&&"+"==a[1].slice(-1)?(j="WebKit Nightly",B="alpha",R=a[1].slice(0,-1)):R!=a[1]&&R!=(a[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(R=null),a[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==a[0]&&537.36==a[2]&&parseFloat(a[1])>=28&&"WebKit"==N&&(N=["Blink"]),C&&(h||a[1])?(N&&(N[1]="like Chrome"),a=a[1]||((a=a[0])<530?1:a<532?2:a<532.05?3:a<533?4:a<534.03?5:a<534.07?6:a<534.1?7:a<534.13?8:a<534.16?9:a<534.24?10:a<534.3?11:a<535.01?12:a<535.02?"13+":a<535.07?15:a<535.11?16:a<535.19?17:a<536.05?18:a<536.1?19:a<537.01?20:a<537.11?"21+":a<537.13?23:a<537.18?24:a<537.24?25:a<537.36?26:"Blink"!=N?"27":"28")):(N&&(N[1]="like Safari"),a=(a=a[0])<400?1:a<500?2:a<526?3:a<533?4:a<534?"4+":a<535?5:a<537?6:a<538?7:a<601?8:a<602?9:a<604?10:a<606?11:a<608?12:"12"),N&&(N[1]+=" "+(a+="number"==typeof a?".x":/[.+]/.test(a)?"":"+")),"Safari"==j&&(!R||parseInt(R)>45)?R=a:"Chrome"==j&&/\bHeadlessChrome/i.test(t)&&F.unshift("headless")),"Opera"==j&&(a=/\bzbov|zvav$/.exec(G))?(j+=" ",F.unshift("desktop mode"),"zvav"==a?(j+="Mini",R=null):j+="Mobile",G=G.replace(RegExp(" *"+a+"$"),"")):"Safari"==j&&/\bChrome\b/.exec(N&&N[1])?(F.unshift("desktop mode"),j="Chrome Mobile",R=null,/\bOS X\b/.test(G)?(D="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(j)&&!R&&(R=K("Chrome")),R&&0==R.indexOf(a=/[\d.]+$/.exec(G))&&t.indexOf("/"+a+"-")>-1&&(G=w(G.replace(a,""))),G&&-1!=G.indexOf(j)&&!RegExp(j+" OS").test(G)&&(G=G.replace(RegExp(" *"+f(j)+" *"),"")),N&&
2!/\b(?:Avant|Nook)\b/.test(j)&&(/Browser|Lunascape|Maxthon/.test(j)||"Safari"!=j&&/^iOS/.test(G)&&/\bSafari\b/.test(N[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(j)&&N[1])&&(a=N[N.length-1])&&F.push(a),F.length&&(F=["("+F.join("; ")+")"]),D&&V&&V.indexOf(D)<0&&F.push("on "+D),V&&F.push((/^on /.test(F[F.length-1])?"":"on ")+V),G&&(a=/ ([\d.+]+)$/.exec(G),l=a&&"/"==G.charAt(G.length-a[0].length-1),G={architecture:32,family:a&&!l?G.replace(a[0],""):G,version:a?a[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(a=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(A))&&!/\bi686\b/i.test(A)?(G&&(G.architecture=64,G.family=G.family.replace(RegExp(" *"+a),"")),j&&(/\bWOW64\b/i.test(t)||C&&/\w(?:86|32)$/.test(r.cpuClass||r.platform)&&!/\bWin64; x64\b/i.test(t))&&F.unshift("32-bit")):G&&/^OS X/.test(G.family)&&"Chrome"==j&&parseFloat(R)>=39&&(G.architecture=64),t||(t=null);var $={};return $.description=t,$.layout=N&&N[0],$.manufacturer=D,$.name=j,$.prerelease=B,$.product=V,$.ua=t,$.version=j&&R,$.os=G||{architecture:null,family:null,version:null,toString:function(){return"null"}},$.parse=e,$.toString=function(){return this.description||""},$.version&&F.unshift(R),$.name&&F.unshift(j),G&&j&&(G!=String(G).split(" ")[0]||G!=j.split(" ")[0]&&!V)&&F.push(V?"("+G+")":"on "+G),F.length&&($.description=F.join(" ")),$}();o.platform=P,void 0===(n=function(){return P}.call(t,i,t,e))||(e.exports=n)}.call(this)},4480(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserService=void 0,t.BrowserService=class{constructor(e){this.source=e}getDomain(){const e=this.source.getDomain();if(null===e||""===e)throw new Error("Domain is required but could not be determined.");return e}getBrowserName(){var e;return null!==(e=this.source.getBrowserName())&&void 0!==e?e:"Unknown"}getBrowserVersion(){var e;return null!==(e=this.source.getBrowserVersion())&&void 0!==e?e:"Unknown"}}},1222(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WindowBrowserSource=t.UrlBrowserSource=void 0;const r=n(i(7503));t.UrlBrowserSource=class{getDomain(){return new URLSearchParams(window.location.search).get("domain")}getBrowserName(){var e;return null!==(e=r.default.name)&&void 0!==e?e:null}getBrowserVersion(){var e;return null!==(e=r.default.version)&&void 0!==e?e:null}},t.WindowBrowserSource=class{getDomain(){return window.location.hostname.replace("www.","")||null}getBrowserName(){var e;return null!==(e=r.default.name)&&void 0!==e?e:null}getBrowserVersion(){var e;return null!==(e=r.default.version)&&void 0!==e?e:null}}},7243(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserVersion=t.browserName=t.domain=void 0;const n=i(3283),r=i(1222),o=i(4480),s=()=>{const e=n.SubscriptionType.isExternal()?new r.UrlBrowserSource:new r.WindowBrowserSource;return new o.BrowserService(e)};t.domain=()=>s().getDomain(),t.browserName=()=>s().getBrowserName(),t.browserVersion=()=>s().getBrowserVersion()},2612(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionChangeEventListener=void 0;const r=i(3877),o=i(3283),s=i(1898),a=i(2895),l=i(383),u=i(4760),c=i(7927),d=i(395),p=i(1705);class g{static register(){"permissions"in navigator&&navigator.permissions.query({name:"notifications"}).then(function(e){e.onchange=function(){r.PushInternalLogger.log("User decided to change push settings. New permission: "+e.state),"granted"==e.state?(o.SubscriptionType.isExternal()&&s.ExternalWindowSubscription.showSavingStateAndDisableButton(),r.PushInternalLogger.log(e),g.handleGrantedPermission()):"denied"==e.state?(o.SubscriptionType.isExternal()?a.PermissionDOMWindow.sendPermissionStats("browser-external","de
2nied"):a.PermissionDOMWindow.sendPermissionStats("browser","denied"),c.PushStats.emit(d.PushStatEvent.browserPromptDenied)):"prompt"==e.state&&l.PushStateStorage.clearExists()}})}static handleGrantedPermission(){return n(this,void 0,void 0,function*(){const e=u.SubscriptionManager.getInstance();if(e.isOperationPending()){r.PushInternalLogger.log("PermissionChangeEventListener: Operation in progress, waiting...");const t=yield p.GlobalWpPushSettings.get();if(!(yield e.waitForPendingOperation(t.pendingOperationMaxWait,t.pendingOperationIntervalMs)))return void r.PushInternalLogger.log("PermissionChangeEventListener: Timeout waiting for operation");r.PushInternalLogger.log("PermissionChangeEventListener: Operation completed, checking subscription state")}const t=o.SubscriptionType.isExternal()?"external":"browser",i=yield e.subscribe(t);i.success||i.alreadyExists?(o.SubscriptionType.isExternal()&&s.ExternalWindowSubscription.thankYouAfterSubscription(),r.PushInternalLogger.log("PermissionChangeEventListener: Subscription handled successfully",i.alreadyExists?"(already existed)":"(newly created)")):r.PushInternalLogger.log("PermissionChangeEventListener: Subscription failed",i.error)})}}t.PermissionChangeEventListener=g},4384(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushSubscriptionOptionsObject=void 0;const n=i(1911);t.PushSubscriptionOptionsObject=class{static get(){return{userVisibleOnly:!0,applicationServerKey:n.VapidPublicKey.get()}}}},3128(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.AutomaticInitializationSetting=void 0;const r=i(2163);t.AutomaticInitializationSetting=class{static get(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.automaticInitialization&&"boolean"==typeof window.WpPushSettings.automaticInitialization)return window.WpPushSettings.automaticInitialization;const e=yield r.RemoteSettingGetter.get();return void 0===e.automaticInitialization||"boolean"!=typeof e.automaticInitialization||e.automaticInitialization})}}},2341(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentWindowLocation=void 0,t.CurrentWindowLocation=class{static get(){return encodeURIComponent(window.location.href)}}},4008(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalSubscriptionWindowSettings=void 0;const r=i(3877),o=i(2163);class s{static get(){return n(this,void 0,void 0,function*(){return{enabled:yield s.getEnabledSettings(),html:yield s.getHtml(),htmlAfterSubscription:yield s.getHtmlAfterSubscription(),autoCloseTimeout:yield s.getAutoCloseTimout(),autoCloseTimeoutAfterSubscription:yield s.getAutoCloseTimoutAfterSubscription()}})}static getEnabledSettings(){return n(this,void 0,void 0,function*(){if("object"==typeof window.WpPushSettings.externalSubscription&&"boolean"==typeof window.WpPushSettings.externalSubscription.enabled)return window.WpPushSettings.externalSubscription.enabled;const e=yield o.RemoteSettingGetter.get();return void 0!==e.externalSubscription&&"boolean"==typeof e.externalSubscription.enabled&&e.externalSubscription.enabled})}static getHtml(){return n(this,void 0,void 0,function*(){const e=yield o.RemoteSettingGetter.get();return void 0!==e.externalSubscription&&"string"==typeof e.externalSubscription.html?e.externalSubscription.html:(r.PushInternalLogger.log("PermissionDOMWindow::getHtmlElement: no html found in settings. Using empty string"),"")})}static getHtmlAfterSubscription(){return n(this,void 0,void 0,function*(){const e=yield o.RemoteSettingGetter.get();return void 0!==e.externalSubscription&&"string"==typeof e.externalSubscription.htmlAfterSubscription?e.externalSubscription.htmlAfterSubscription:(r.PushInternalLogger.log("PermissionDOMWindow::getHtmlElement: no html found in settings. Using empty string"),"")})}static getAutoCloseTimout(){return n(this,void 0,void 0,function*(){const e=yield o.RemoteSettingGetter.get();return void 0!==e.externalSubscription&&"number"==typeof e.externalSubscription.autoCloseTimeout?e.externalSubscription.autoCloseTimeout:0})}static getAutoCloseTimoutAfterSubscription(){return n(this,void 0,void 0,function*(){const e=yield o.RemoteSettingGetter.get();return void 0!==e.externalSubscription&&"number"==typeof e.externalSubscription.autoCloseTimeoutAfterSubscription?e.externalSubscription.autoCloseTimeoutAfterSubscription:0})}}t.ExternalSubscriptionWindowSettings=s},1705(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Prom
2ise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWpPushSettings=void 0;const r=i(3128),o=i(8625),s=i(2341),a=i(4008),l=i(3877),u=i(9906),c=i(2934),d=i(2047),p=i(524),g=i(7895),h=i(6243);t.GlobalWpPushSettings=class{static get(){return n(this,void 0,void 0,function*(){const e={enabled:yield d.WpPushEnable.get(),currentWindowLocation:s.CurrentWindowLocation.get(),subscriptionForm:yield u.SubscriptionFormSetting.get(),automaticInitialization:yield r.AutomaticInitializationSetting.get(),serviceWorkerName:yield o.ServiceWorkerName.get(),externalSubscription:yield a.ExternalSubscriptionWindowSettings.get(),stats:yield c.StatsSetting.get(),vapidReadyMaxWait:yield p.VapidReadySetting.getMaxWait(),vapidReadyIntervalMs:yield p.VapidReadySetting.getIntervalMs(),serviceWorkerReadyMaxWait:yield g.ServiceWorkerReadySetting.getMaxWait(),serviceWorkerReadyIntervalMs:yield g.ServiceWorkerReadySetting.getIntervalMs(),pendingOperationMaxWait:yield h.PendingOperationSetting.getMaxWait(),pendingOperationIntervalMs:yield h.PendingOperationSetting.getIntervalMs()};return l.PushInternalLogger.log(e),e})}}},6243(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.PendingOperationSetting=void 0;const r=i(2163);t.PendingOperationSetting=class{static getMaxWait(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.pendingOperationMaxWait&&"number"==typeof window.WpPushSettings.pendingOperationMaxWait&&window.WpPushSettings.pendingOperationMaxWait>0)return window.WpPushSettings.pendingOperationMaxWait;const e=yield r.RemoteSettingGetter.get();return void 0!==e.pendingOperationMaxWait&&"number"==typeof e.pendingOperationMaxWait&&e.pendingOperationMaxWait>0?e.pendingOperationMaxWait:5e3})}static getIntervalMs(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.pendingOperationIntervalMs&&"number"==typeof window.WpPushSettings.pendingOperationIntervalMs&&window.WpPushSettings.pendingOperationIntervalMs>0)return window.WpPushSettings.pendingOperationIntervalMs;const e=yield r.RemoteSettingGetter.get();return void 0!==e.pendingOperationIntervalMs&&"number"==typeof e.pendingOperationIntervalMs&&e.pendingOperationIntervalMs>0?e.pendingOperationIntervalMs:50})}}},2163(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteSettingGetter=void 0;const r=i(3877),o=i(8566);class s{static get(){return n(this,void 0,void 0,function*(){return""==(0,o.pixelId)()?{}:s.settings&&"object"==typeof s.settings?(r.PushInternalLogger.log("Settings returned from const."),s.settings):yield s.callCeph()})}static callCeph(){return n(this,void 0,void 0,function*(){const e=this.getUrl();try{const t=yield fetch(e),i=yield t.text();r.PushInternalLogger.log("response: ",i);const n=JSON.parse(i);n&&"object"==typeof n?("boolean"==typeof n.automaticInintialization&&(n.automaticInitialization=n.automaticInintialization),s.settings=n):s.settings={}}catch(e){r.PushInternalLogger.log("Error while getting remote settings: ",e),s.settings={}}return s.settings})}static getUrl(){let e;return e="https://pixel.wp.pl/push_manager/"+(0,o.pixelId)()+"/settings.json",e}}t.RemoteSettingGetter=s},8625(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Prom
2ise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceWorkerName=void 0;const r=i(2163);t.ServiceWorkerName=class{static get(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.serviceWorkerName&&window.WpPushSettings.serviceWorkerName.length>0){let e=window.WpPushSettings.serviceWorkerName;return e.startsWith("/")||e.startsWith("./")||(e="/"+e),e}const e=yield r.RemoteSettingGetter.get();if(void 0!==e.serviceWorkerName&&"string"==typeof e.serviceWorkerName){let t=e.serviceWorkerName;return t.startsWith("/")||t.startsWith("./")||(t="/"+t),t}return"/sw.js"})}}},7895(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceWorkerReadySetting=void 0;const r=i(2163);t.ServiceWorkerReadySetting=class{static getMaxWait(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.serviceWorkerReadyMaxWait&&"number"==typeof window.WpPushSettings.serviceWorkerReadyMaxWait&&window.WpPushSettings.serviceWorkerReadyMaxWait>0)return window.WpPushSettings.serviceWorkerReadyMaxWait;const e=yield r.RemoteSettingGetter.get();return void 0!==e.serviceWorkerReadyMaxWait&&"number"==typeof e.serviceWorkerReadyMaxWait&&e.serviceWorkerReadyMaxWait>0?e.serviceWorkerReadyMaxWait:5e3})}static getIntervalMs(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.serviceWorkerReadyIntervalMs&&"number"==typeof window.WpPushSettings.serviceWorkerReadyIntervalMs&&window.WpPushSettings.serviceWorkerReadyIntervalMs>0)return window.WpPushSettings.serviceWorkerReadyIntervalMs;const e=yield r.RemoteSettingGetter.get();return void 0!==e.serviceWorkerReadyIntervalMs&&"number"==typeof e.serviceWorkerReadyIntervalMs&&e.serviceWorkerReadyIntervalMs>0?e.serviceWorkerReadyIntervalMs:250})}}},2934(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsSetting=t.DEFAULT_STATS_SETTINGS=void 0;const r=i(3877),o=i(497),s=i(2163);t.DEFAULT_STATS_SETTINGS={enabled:!0,bucket:"user_actions",areaIds:{popup:"push_acquisition_popup",browser:"push_acquisition_browser"},boxIds:{pushEnable:"push_enable",skip:"skip",granted:"granted",denied:"denied"},events:{}};class a{static get(){return n(this,void 0,void 0,function*(){const e=a.asObject(window.WpPushSettings.stats),i=yield s.RemoteSettingGetter.get(),n=a.asObject(i.stats);return{enabled:a.firstBoolean([e.enabled,n.enabled],t.DEFAULT_STATS_SETTINGS.enabled),bucket:a.firstString([e.bucket,n.bucket],t.DEFAULT_STATS_SETTINGS.bucket),areaIds:a.getAreaIds(e,n),boxIds:a.getBoxIds(e,n),events:a.getEvents(e,n)}})}static getAreaIds(e,i){const n=a.asObject(e.areaIds),r=a.asObject(i.areaIds),o=t.DEFAULT_STATS_SETTINGS.areaIds;return{popup:a.firstVabName([n.popup,r.popup],o.popup,"areaIds.popup"),browser:a.firstVabName([n.browser,r.browser],o.browser,"areaIds.browser")}}static getBoxIds(e,i){const n=a.asObject(e.boxIds),r=a.asObject(i.boxIds),o=t.DEFAULT_STATS_SETTINGS.boxIds;return{pushEnable:a.firstVabName([n.pushEnable,r.pushEnable],o.pushEnable,"boxIds.pushEnable"),skip:a.firstVabName([n.skip,r.skip],o.skip,"boxIds.skip"),granted:a.firstVabName([n.granted,r.granted],o.granted,"boxIds.granted"),denied:a.firstVabName([n.denied,r.denied],o.denied,"boxIds.denied")}}static getEvents(e,t){return Object.assign(Object.assign({},a.booleansOnly(t.events)),a.booleansOnly(e.events))}static booleansOnly(e){const t={},i=a.asObject(e);for(const e of Object.keys(i))"boolean"==typeof i[e]&&(t[e]=i[e]);return t}static asObject(e){return"object"!=typeof e||null===e||Array.isArray(e)?{}:e}static firstString(e,t){for(const t of e)if("string"==typeof t&&""!==t.trim())return t;return t}static firstVabName(e,t,i){for(const n of e)if("string"==typeof n&&""!==n.trim()){if((0,o.isValidVabName)(n))return n;
2r.PushInternalLogger.log(`StatsSetting: ${i} = "${n}" is not a valid VAB name, falling back to "${t}"`)}return t}static firstBoolean(e,t){for(const t of e)if("boolean"==typeof t)return t;return t}}t.StatsSetting=a},9906(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionFormSetting=void 0;const r=i(2163);class o{static get(){return n(this,void 0,void 0,function*(){return{enabled:yield o.getEnabled(),html:yield o.getHtml(),parentSelector:yield o.getParentSelector(),autoCloseTimeout:yield o.getAutoCloseTimout(),waitForElementMaxWait:yield o.getWaitForElementMaxWait(),waitForElementIntervalMs:yield o.getWaitForElementIntervalMs()}})}static getEnabled(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.subscriptionForm&&"boolean"==typeof window.WpPushSettings.subscriptionForm.enabled)return window.WpPushSettings.subscriptionForm.enabled;const e=yield r.RemoteSettingGetter.get();return void 0===e.subscriptionForm||"boolean"!=typeof e.subscriptionForm.enabled||e.subscriptionForm.enabled})}static getHtml(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.subscriptionForm&&"string"==typeof window.WpPushSettings.subscriptionForm.html)return window.WpPushSettings.subscriptionForm.html;const e=yield r.RemoteSettingGetter.get();return void 0!==e.subscriptionForm&&"string"==typeof e.subscriptionForm.html?e.subscriptionForm.html:""})}static getParentSelector(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.subscriptionForm&&"string"==typeof window.WpPushSettings.subscriptionForm.parentSelector)return window.WpPushSettings.subscriptionForm.parentSelector;const e=yield r.RemoteSettingGetter.get();return void 0!==e.subscriptionForm&&"string"==typeof e.subscriptionForm.parentSelector?e.subscriptionForm.parentSelector:"body"})}static getAutoCloseTimout(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.subscriptionForm&&"number"==typeof window.WpPushSettings.subscriptionForm.autoCloseTimeout&&window.WpPushSettings.subscriptionForm.autoCloseTimeout>0)return window.WpPushSettings.subscriptionForm.autoCloseTimeout;const e=yield r.RemoteSettingGetter.get();return void 0!==e.subscriptionForm&&"number"==typeof e.subscriptionForm.autoCloseTimeout&&e.subscriptionForm.autoCloseTimeout>0?e.subscriptionForm.autoCloseTimeout:0})}static getWaitForElementMaxWait(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.subscriptionForm&&"number"==typeof window.WpPushSettings.subscriptionForm.waitForElementMaxWait&&window.WpPushSettings.subscriptionForm.waitForElementMaxWait>0)return window.WpPushSettings.subscriptionForm.waitForElementMaxWait;const e=yield r.RemoteSettingGetter.get();return void 0!==e.subscriptionForm&&"number"==typeof e.subscriptionForm.waitForElementMaxWait&&e.subscriptionForm.waitForElementMaxWait>0?e.subscriptionForm.waitForElementMaxWait:5e3})}static getWaitForElementIntervalMs(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.subscriptionForm&&"number"==typeof window.WpPushSettings.subscriptionForm.waitForElementIntervalMs&&window.WpPushSettings.subscriptionForm.waitForElementIntervalMs>0)return window.WpPushSettings.subscriptionForm.waitForElementIntervalMs;const e=yield r.RemoteSettingGetter.get();return void 0!==e.subscriptionForm&&"number"==typeof e.subscriptionForm.waitForElementIntervalMs&&e.subscriptionForm.waitForElementIntervalMs>0?e.subscriptionForm.waitForElementIntervalMs:100})}}t.SubscriptionFormSetting=o},524(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};
2Object.defineProperty(t,"__esModule",{value:!0}),t.VapidReadySetting=void 0;const r=i(2163);t.VapidReadySetting=class{static getMaxWait(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.vapidReadyMaxWait&&"number"==typeof window.WpPushSettings.vapidReadyMaxWait&&window.WpPushSettings.vapidReadyMaxWait>0)return window.WpPushSettings.vapidReadyMaxWait;const e=yield r.RemoteSettingGetter.get();return void 0!==e.vapidReadyMaxWait&&"number"==typeof e.vapidReadyMaxWait&&e.vapidReadyMaxWait>0?e.vapidReadyMaxWait:5e3})}static getIntervalMs(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.vapidReadyIntervalMs&&"number"==typeof window.WpPushSettings.vapidReadyIntervalMs&&window.WpPushSettings.vapidReadyIntervalMs>0)return window.WpPushSettings.vapidReadyIntervalMs;const e=yield r.RemoteSettingGetter.get();return void 0!==e.vapidReadyIntervalMs&&"number"==typeof e.vapidReadyIntervalMs&&e.vapidReadyIntervalMs>0?e.vapidReadyIntervalMs:100})}}},2047(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.WpPushEnable=void 0;const r=i(2163);t.WpPushEnable=class{static get(){return n(this,void 0,void 0,function*(){if(void 0!==window.WpPushSettings.enabled&&"boolean"==typeof window.WpPushSettings.enabled)return window.WpPushSettings.enabled;const e=yield r.RemoteSettingGetter.get();return void 0!==e.enabled&&"boolean"==typeof e.enabled&&e.enabled})}}},3382(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClient=void 0;const r=i(4326);class o{static get(e){return n(this,arguments,void 0,function*(e,t={}){return o.request("GET",r.CruxWrapper.uniformUrl(e),t)})}static post(e){return n(this,arguments,void 0,function*(e,t={}){return o.request("POST",r.CruxWrapper.uniformUrl(e),t)})}static put(e){return n(this,arguments,void 0,function*(e,t={}){return o.request("PUT",r.CruxWrapper.uniformUrl(e),t)})}static delete(e){return n(this,arguments,void 0,function*(e,t={}){return o.request("DELETE",r.CruxWrapper.uniformUrl(e),t)})}static patch(e){return n(this,arguments,void 0,function*(e,t={}){return o.request("PATCH",r.CruxWrapper.uniformUrl(e),t)})}static request(e,t,i){const{headers:n={},body:r,credentials:o="include"}=i,s={method:e,credentials:o,headers:Object.assign({"content-type":"application/json;charset=UTF-8"},n)};return void 0!==r&&(s.body=JSON.stringify(r)),fetch(t,s)}}t.HttpClient=o},4326(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CruxWrapper=void 0,t.CruxWrapper=class{static uniformUrl(e){var t;return"undefined"!=typeof window&&(null===(t=window.WP)||void 0===t?void 0:t.crux)?window.WP.crux.mess(e):e}}},8285(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClient=void 0;var n=i(3382);Object.defineProperty(t,"HttpClient",{enumerable:!0,get:function(){return n.HttpClient}})},8156(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.WpPush=void 0;const r=i(2895),o=i(3877),s=i(7067),a=i(8556),l=i(3171),u=i(1705),c=i(1911),d=i(3283),p=i(1898),g=i(9479),h=i(2612),b=i(383),v=i(3244),S=i(7927);class f{constructor(){f.init().catch(e=>{o.PushInternalLogger.log("WpPush initialization failed:",e),"function"==typeof window.WpPush.onError&&window.WpPush.onError(e)})}static init(){return n(this,void 0,void 0,function*(){if(f.isInitialized)o.PushInternalLogger.log("WpPush already initialized. Skipping.");else try{o.PushInternalLogger.log("WPPUSH INIT");const e=yield u.GlobalWpPushSettings.get();if(!e.enabled)return o.PushInternalLogger.log("WpPush is disabled. Skipping initialization."),void(f.
2isInitialized=!0);S.PushStats.init(e.stats),f.windowSettingsShow=new r.PermissionDOMWindow,f.setWpPushPublicMethods(),f.registerEventListeners(),yield s.VapidKeys.getVapidPublicKey().then(e=>{if(!e.ok)throw o.PushInternalLogger.log("Initialization failed. Vapid response is not OK. Check your vapid key or endpoint."),Error("Initialization failed. Vapid response is not OK. Check your vapid key or endpoint.");return e.json()}).then(e=>{o.PushInternalLogger.log("settings.vapidPublicKey:",c.VapidPublicKey.get()),new c.VapidPublicKey(e.public_key),o.PushInternalLogger.log("settings.vapidPublicKey after setting:",c.VapidPublicKey.get())}),o.PushInternalLogger.log("Vapid initialization completed."),o.PushInternalLogger.log(e),o.PushInternalLogger.log("external state:",e.externalSubscription.enabled),o.PushInternalLogger.log("external stage:",d.SubscriptionType.isExternal()),e.automaticInitialization&&e.externalSubscription.enabled&&!d.SubscriptionType.isExternal()?yield f.show():(yield new a.ServiceWorkerLoader(e.serviceWorkerName).load(),o.PushInternalLogger.log("ServiceWorkerLoader initialization completed."),e.automaticInitialization&&(yield f.show()),"granted"==Notification.permission&&d.SubscriptionType.isExternal()&&p.ExternalWindowSubscription.thankYouAfterSubscription()),f.isInitialized=!0,o.PushInternalLogger.log("WpPush initialization completed successfully.")}catch(e){throw o.PushInternalLogger.log("WpPush initialization error:",e),e}})}static show(){return n(this,void 0,void 0,function*(){const e=yield u.GlobalWpPushSettings.get();if(e.externalSubscription.enabled&&e.subscriptionForm.enabled&&!d.SubscriptionType.isExternal()){if(o.PushInternalLogger.log("WpPush::show: External subscription mode - checking subscription status"),b.PushStateStorage.exists())return void o.PushInternalLogger.log("WpPush::show: Subscription state exists, skipping form display");try{if(o.PushInternalLogger.log("WpPush::show: Checking exist API for external subscription"),302===(yield v.SubscriptionExists.check()).status)return o.PushInternalLogger.log("WpPush::show: User already subscribed (302), saving state and skipping popup"),void b.PushStateStorage.setExists();o.PushInternalLogger.log("WpPush::show: User not subscribed, displaying external subscription form")}catch(e){o.PushInternalLogger.log("WpPush::show: exist check failed, showing popup anyway",e)}f.windowSettingsShow.display()}else if(e.subscriptionForm.enabled||d.SubscriptionType.isExternal())yield l.PermissionBrowserWindow.refreshSubscription(),f.windowSettingsShow.display();else if(yield l.PermissionBrowserWindow.refreshSubscription(),!b.PushStateStorage.exists()&&g.PermissionState.isDefault()){o.PushInternalLogger.log("WpPush::show: No forms enabled, showing direct browser prompt");try{yield l.PermissionBrowserWindow.ask(!1)}catch(e){o.PushInternalLogger.log("WpPush::show: automatic ask() failed",e)}}})}static setWpPushPublicMethods(){window.WpPush.show=()=>n(this,void 0,void 0,function*(){return yield f.show()}),window.WpPush.run=()=>n(this,void 0,void 0,function*(){return yield f.show()})}static registerEventListeners(){h.PermissionChangeEventListener.register()}}t.WpPush=f,f.isInitialized=!1,"object"!=typeof window.WpPush&&(window.WpPush={}),"object"!=typeof window.WpPushSettings&&(window.WpPushSettings={}),new f},3877(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushInternalLogger=void 0;const n=i(7672);t.PushInternalLogger=class{static log(...e){this.getSettingsFromLocalStorage()&&console.log(...e)}static getSettingsFromLocalStorage(){return"true"===n.LoggerStorage.LoggerEnabledSetting.get()}}},7672(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerStorage=void 0;const n=i(4337);class r{}t.LoggerStorage=r,r.LoggerEnabledSetting=new n.InternalLoggingEnabledSetting},4337(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InternalLoggingEnabledSetting=void 0;const n=i(8383);class r extends n.BaseLocalStorage{constructor(){super(...arguments),this.name="___pushinternallogger",this.immutable=!1}}t.InternalLoggingEnabledSetting=r},1658(e,t,i){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.AutoClose=void 0;const n=i(3283),r=i(3877);t.AutoClose=class{static start(e,t,i){r.PushInternalLogger.log("AutoClose observer start");let o=null;if(0!==t){if(r.PushInternalLogger.log("AutoClose timeout:",t),null!==o&&(r.PushInternalLogger.log("AutoClose MutationObserver clear timeout;"),clearTimeout(o)),o=window.setTimeout(()=>{r.PushInternalLogger.log("AutoClose MutationObserver timer run;"),"close"in e?(r.PushInternalLogger.log("AutoClose MutationObserver close;"),e.close()):"hide"in e&&(r.PushInternalLogger.log("AutoClose MutationObserver hide;"),e.hide())},1e3*t),i){r.PushInternalLogger.log("clearOnClick start;");let e=document.querySelector(".wp-push-main-container");n.SubscriptionType.isExternal()&&(e=document.body),e&&e.addEventListener("click",()=>{r.PushInternalLogger.log("clearOnClick event triggered;"),null!==o&&(clearTimeout(o),o=null)})}}else r.PushInternalLogger.log("AutoClose observer exit; timeout = 0")}}},5711(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalWindowEndpoints=void 0;const n=i(3518),r=i(7243),o=i(8566),s=i(3877);class a{static getBaseUrl(){let e="https://";return IS_STAGE||(e+=window.location.host.split(".").join("")),e+="pushservice.pl",e}static externalWindowSubscriptionUrl(){const e=new URL(a.getBaseUrl());return e.searchParams.set("pixel_id",(0,o.pixelId)()),e.searchParams.set("domain",(0,r.domain)()),e.searchParams.set("uid",(0,o.uid)()),e.searchParams.set("ac_id",n.PixelUser.get()),e.searchParams.set("fpuid",(0,o.fpuid)()),e.searchParams.set("em",(0,o.em)()),e.searchParams.set("wph_a",(0,o.wpha)()),s.PushInternalLogger.log("External window url:",e.toString()),e.toString()}}t.ExternalWindowEndpoints=a},8429(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalWindowEndpoints=void 0;var n=i(5711);Object.defineProperty(t,"ExternalWindowEndpoints",{enumerable:!0,get:function(){return n.ExternalWindowEndpoints}})},3171(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionBrowserWindow=void 0;const r=i(3877),o=i(2895),s=i(383),a=i(4760),l=i(3283),u=i(7927),c=i(395),d=i(9479),p=i(1705);class g{static ask(e){return n(this,void 0,void 0,function*(){var t,i,n;const s=l.SubscriptionType.isExternal(),h=s?"browser-external":"browser";if(e||(o.PermissionDOMWindow.sendPermissionStats(h,"ask"),d.PermissionState.isDefault()&&u.PushStats.emit(c.PushStatEvent.browserPromptView)),r.PushInternalLogger.log("PermissionBrowserWindow::ask - delegating to SubscriptionManager"),!("serviceWorker"in navigator))return r.PushInternalLogger.log("PermissionBrowserWindow::ask - serviceWorker not supported"),void o.PermissionDOMWindow.sendPermissionStats(h,"failed","sw_unsupported");const b=yield p.GlobalWpPushSettings.get();if(!(yield g.waitForServiceWorkerReady(b.serviceWorkerReadyMaxWait)))throw r.PushInternalLogger.log("PermissionBrowserWindow::ask - serviceWorker.ready timed out"),o.PermissionDOMWindow.sendPermissionStats(h,"failed","sw_ready_timeout"),new Error("PermissionBrowserWindow::ask: serviceWorker.ready timed out before the permission prompt could be requested");const v=a.SubscriptionManager.getInstance();v.isOperationPending()&&(r.PushInternalLogger.log("PermissionBrowserWindow::ask - waiting for pending operation before subscribing"),yield v.waitForPendingOperation(b.pendingOperationMaxWait,b.pendingOperationIntervalMs));const S=s?"external":"popup",f=yield v.subscribe(S);if(f.success||f.alreadyExists)f.alreadyExists?r.PushInternalLogger.log("PermissionBrowserWindow::ask - subscription already exists"):r.PushInternalLogger.log("PermissionBrowserWindow::ask - subscription created successfully");else if(r.PushInternalLogger.log("PermissionBrowserWindow::ask failed",f.error),"NotAllowedError"!==(null===(t=f.error)||void 0===t?void 0:t.name)){const e=null!==(i=f.reason)&&void 0!==i?i:"subscribe_other";throw o.PermissionDOMWindow.sendPermissionStats(h,"failed",e),null!==(n=f.error)&&void 0!==n?n:new Error("PermissionBrowserWindow::ask: subscribe failed")}})}static refreshSubscription(){return n(this,void 0,void 0,function*(){r.PushInternalLogger.log("[PermissionBrowserWindow::refreshSubscription]: delegating to SubscriptionManager"),yield a.SubscriptionManager.getInstance().resubscribe()})}static decline(){o.PermissionDOMWindow.hide(),s.PushStateStorage.setDeclined()}static waitForServiceWorkerReady(e=5e3){return Promise.race([navigator.serviceWorker.ready.then(()=>!0),new Promise(t=>setTimeout(()=>t(!1),e))])}}t.PermissionBrowserWindow=g},3244(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Prom
2ise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionExists=void 0;const r=i(3518),o=i(3699),s=i(7243),a=i(1705),l=i(3283),u=i(8566);t.SubscriptionExists=class{static check(e){return n(this,void 0,void 0,function*(){let t={browser:(0,s.browserName)(),domain:(0,s.domain)()};""!==r.PixelUser.get()&&(t.ac_id=r.PixelUser.get());const i=(0,u.wpha)();return""!=i&&(t.wph_a=i),(!(yield a.GlobalWpPushSettings.get()).externalSubscription.enabled&&!l.SubscriptionType.isExternal()||l.SubscriptionType.isExternal())&&e&&(t.endpoint=e.endpoint),o.SubscriptionEndpoints.doesSubscriptionExist(t)})}}},1898(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalWindowSubscription=void 0;const r=i(8429),o=i(3877),s=i(1705),a=i(1658);class l{static open(){var e;null===(e=window.open(r.ExternalWindowEndpoints.externalWindowSubscriptionUrl(),"Push subscription","_blanc, toolbar=no, width=500, height=600"))||void 0===e||e.focus()}static fillExternalSubscriptionWindowWithElements(){return n(this,void 0,void 0,function*(){o.PushInternalLogger.log("Fill external subscription window with elements::start"),l.clearHtml(),yield l.fillHtml(),o.PushInternalLogger.log("Fill external subscription window with elements::end")})}static thankYouAfterSubscription(){return n(this,void 0,void 0,function*(){o.PushInternalLogger.log("Fill external subscription window with thank you message::start"),l.clearHtml(),yield l.fillHtmlAfterSubscription();const e=yield s.GlobalWpPushSettings.get();a.AutoClose.start(l,e.externalSubscription.autoCloseTimeoutAfterSubscription,!1),o.PushInternalLogger.log("Fill external subscription window with thank you message::end")})}static fillHtml(){return n(this,void 0,void 0,function*(){let e=document.getElementById("html");const t=yield s.GlobalWpPushSettings.get();e.insertAdjacentHTML("afterbegin",t.externalSubscription.html)})}static fillHtmlAfterSubscription(){return n(this,void 0,void 0,function*(){let e=document.getElementById("html");const t=yield s.GlobalWpPushSettings.get();e.insertAdjacentHTML("afterbegin",t.externalSubscription.htmlAfterSubscription)})}static clearHtml(){document.getElementById("html").innerHTML=""}static close(){window.close()}static showSavingStateAndDisableButton(){let e=document.getElementById("wp-push-yes");e&&(e.innerHTML='<span class="dot">.</span><span class="dot">.</span><span class="dot">.</span>',e.style.pointerEvents="none",e.setAttribute("disabled","disabled"))}}t.ExternalWindowSubscription=l},3572(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentifierService=void 0;const n=i(2253);t.IdentifierService=class{constructor(e){this.source=e}isNullLike(e){return null===e||"null"===e||"undefined"===e||""===e}getEM(){const e=this.source.getEM();return this.isNullLike(e)?"":e}getUID(){const e=this.source.getUID();if(this.isNullLike(e))return"";const t=Number(e);return isNaN(t)||t<2?"":String(e)}getLTID(){const e=this.source.getLTID();return this.isNullLike(e)?"":e}getWPHa(e=!1){const t=this.source.getWPHa();return this.isNullLike(t)?e?this.getWPHaFromLocalStorage():"":t}getWPHaFromLocalStorage(){const e=n.LocalStorage.getInstance(),t=e.get("__wph_a.key"),i=e.get("__wph_a.ts");return null!==t&&null!==i?`${t}.${i}`:""}getFPUID(){const e=this.source.getFPUID();return this.isNullLike(e)?"":e}getPixelId(){const e=this.source.getPixelId();return this.isNullLike(e)?"":e}}},8566(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pixelId=t.fpuid=t.wpha=t.ltid=t.uid=t.em=void 0;const n=i(3283),r=i(607),o=i(3572),s=()=>{const e=n.SubscriptionType.isExternal()?new r.UrlIdentitySource:new r.WphIdentitySource;return new o.IdentifierService(e)};t.em=()=>s().getEM(),t.uid=()=>s().getUID(),t.ltid=()=>s().getLTID(),t.wpha=()=>{const e=!n.SubscriptionType.isExternal()&&"undefined"==typeof wph;return s().getWPHa(e)},t.fpuid=()=>s().getFPUID(),t.pixelId=()=>(()=>{const e="undefined"==typeof wph?new r.UrlIdentitySource:new r.WphIdentitySource;return new o.IdentifierService(e)})().getPixelId()},607(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.WphIdentitySource=t.UrlIdentitySource=void 0,t.UrlIdentitySource=class{getParams(){return new URLSearchParams(window.location.search)}getEM(){return this.getParams().get("em")}getUID(){return this.getParams().get("uid")}getLTID(){return this.getParams().get("ltid")}getWPHa(){return this.getParams().get("wph_a")}getFPUID(){return this.getParams().get("fpuid")}getPixelId(){return this.getParams().get("pixel_id")}},t.WphIdentitySource=class{getEM(){var e,t;return"undefined"==typeof wph?null:null!==(t=null===(e=null===wph||void 0===wph?void 0:wph.params)||void 0===e?void 0:e.em)&&void 0!==t?t:null}getUID(){var e,t;return"undefined"==typeof wph?null:null!==(t=null===(e=null===wph||void 0===wph?void 0:wph.params)||void 0===e?void 0:e.uid)&&void 0!==t?t:null}getLTID(){var e,t;return"undefined"==typeof wph?null:null!==(t=null===(e=null===wph||void 0===wph?void 0:wph.params)||void 0===e?void 0:e.ltid)&&void 0!==t?t:null}getWPHa(){var e,t;return"undefined"==typeof wph?null:null!==(t=null===(e=null===wph||void 0===wph?void 0:wph.params)||void 0===e?void 0:e.wpha)&&void 0!==t?t:null}getFPUID(){var e,t;return"undefined"==typeof wph?null:null!==(t=null===(e=null===wph||void 0===wph?void 0:wph.params)||void 0===e?void 0:e.fpuid)&&void 0!==t?t:null}getPixelId(){var e,t;return"undefined"==typeof wph?null:null!==(t=null===(e=null===wph||void 0===wph?void 0:wph.params)||void 0===e?void 0:e.pixelID)&&void 0!==t?t:null}}},2895(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionDOMWindow=t.PermissionBoxInsertType=void 0;const r=i(3518),o=i(3699),s=i(7243),a=i(3877),l=i(8566),u=i(1705),c=i(3283),d=i(3171),p=i(1898),g=i(1658),h=i(383),b=i(7927),v=i(395);var S;!function(e){e.before="beforeContent",e.after="afterContent"}(S||(t.PermissionBoxInsertType=S={}));const f=[{elementId:"wp-push-yes",boxIdKey:v.PushStatBoxIdKey.pushEnable},{elementId:"wp-push-no",boxIdKey:v.PushStatBoxIdKey.skip}];class m{constructor(){}display(){return n(this,void 0,void 0,function*(){if("denied"==Notification.permission||"granted"==Notification.permission)return a.PushInternalLogger.log("PermissionDOMWindow::display: skipping due to permission state."),void a.PushInternalLogger.log("PermissionDOMWindow::display: permission state: "+Notification.permission);if(h.PushStateStorage.isDeclined())return void a.PushInternalLogger.log("PermissionDOMWindow::display: Push state is declined. Skipping");a.PushInternalLogger.log("PermissionDOMWindow::display: start");const e=yield this.getHtmlElement();let t;const i=yield u.GlobalWpPushSettings.get();if(t=document.querySelector(i.subscriptionForm.parentSelector),null===t&&(a.PushInternalLogger.log("No elements returned for given selector! Waiting for it to appear before giving up."),t=yield this.waitForElement(i.subscriptionForm.parentSelector,i.subscriptionForm.waitForElementMaxWait,i.subscriptionForm.waitForElementIntervalMs)),null===t){const e=c.SubscriptionType.isExternal()?"external":"popup";throw m.sendPermissionStats(e,"failed","element_timeout"),new Error(`PermissionDOMWindow::display: no element found for selector "${i.subscriptionForm.parentSelector}" after waiting ${i.subscriptionForm.waitForElementMaxWait}ms`)}yield this.show(t,e);const n=c.SubscriptionType.isExternal()?p.ExternalWindowSubscription:m;yield this.addButtonsListeners(),g.AutoClose.start(n,i.subscriptionForm.autoCloseTimeout,!0),a.PushInternalLogger.log("PermissionDOMWindow::display: end")})}waitForElement(e){return n(this,arguments,void 0,function*(e,t=5e3,i=100){const n=Date.now();return new Promise(r=>{const o=setInterval(()=>{const i=document.querySelector(e);i?(clearInterval(o),a.PushInternalLogger.log(`PermissionDOMWindow::waitForElement: element found after ${Date.now()-n}ms`),r(i)):Date.now()-n>=t&&(clearInterval(o),a.PushInternalLogger.log(`PermissionDOMWindow::waitForElement: timed out after ${t}ms waiting for selector "${e}"`),r(null))},i)})})}getHtmlElement(){return n(this,void 0,void 0,function*(){const e=yield u.GlobalWpPushSettings.get();return""!=e.subscriptionForm.html?e.subscriptionForm.html:(a.PushInternalLogger.log("PermissionDOMWindow::getHtmlElement: no html found in settings. Using empty string"),"")})}show(e,t){return n(this,void 0,void 0,function*(){c.SubscriptionType.isExternal()?yield p.ExternalWindowSubscription.fillExternalSubscriptionWindowWithElements():(e.insertAdjacentHTML("beforeend",t),m.sendPermissionStats("popup","show"),b.PushStats.emit(v.PushStatEvent.formView,{length:m.getFormButtons().length}))})}static getFormButtons(){return f.map(({elementId:e,boxIdKey:t})=>({element:document.getElementById(e),boxIdKey:t})).filter(e=>null!==e.element).sort((e,t)=>
20!==(e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING)?-1:1).map((e,t)=>Object.assign(Object.assign({},e),{index:t}))}static findFormButton(e,t){return e.find(e=>e.boxIdKey===t)}static emitButtonStat(e,t){c.SubscriptionType.isExternal()||b.PushStats.emit(e,{boxIdKey:t.boxIdKey,index:t.index})}addButtonsListeners(){return n(this,void 0,void 0,function*(){a.PushInternalLogger.log("PermissionDOMWindow::addButtonsListeners: start");const e=m.getFormButtons(),t=m.findFormButton(e,v.PushStatBoxIdKey.pushEnable),i=m.findFormButton(e,v.PushStatBoxIdKey.skip);t?(m.emitButtonStat(v.PushStatEvent.formButtonView,t),t.element.addEventListener("click",e=>n(this,void 0,void 0,function*(){m.emitButtonStat(v.PushStatEvent.formButtonClick,t),(yield u.GlobalWpPushSettings.get()).externalSubscription.enabled&&!c.SubscriptionType.isExternal()?(m.hide(),m.sendPermissionStats("external","open"),p.ExternalWindowSubscription.open()):(m.hide(),c.SubscriptionType.isExternal()?m.sendPermissionStats("external-popup","agree"):m.sendPermissionStats("popup","agree"),yield d.PermissionBrowserWindow.ask(!1))})),a.PushInternalLogger.log("PermissionDOMWindow::addButtonsListeners: wp-push-yes listener attached")):a.PushInternalLogger.log("PermissionDOMWindow::addButtonsListeners: wp-push-yes button not found, skipping"),i?(m.emitButtonStat(v.PushStatEvent.formButtonView,i),i.element.addEventListener("click",e=>{m.emitButtonStat(v.PushStatEvent.formButtonClick,i),m.sendPermissionStats("popup","declined"),d.PermissionBrowserWindow.decline()}),a.PushInternalLogger.log("PermissionDOMWindow::addButtonsListeners: wp-push-no listener attached")):a.PushInternalLogger.log("PermissionDOMWindow::addButtonsListeners: wp-push-no button not found, skipping"),a.PushInternalLogger.log("PermissionDOMWindow::addButtonsListeners: Completed")})}static hide(){var e;null===(e=document.getElementsByClassName("wp-push-main-container")[0])||void 0===e||(e.style.visibility="hidden")}static sendPermissionStats(e,t,i){let n;n=r.PixelUser.get().length>0?r.PixelUser.get():(0,l.wpha)();let a={user_id:n,type:e,value:t,pixel_id:(0,l.pixelId)(),browser:(0,s.browserName)(),domain:(0,s.domain)()};void 0!==i&&(a.reason=i),o.SubscriptionEndpoints.consentStats(a)}}t.PermissionDOMWindow=m},3518(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PixelUser=void 0;const n=i(7591),r=i(3877),o=i(3283);class s{static get(){return o.SubscriptionType.isExternal()?s.getFromParams():s.getFromCookie()}static getFromCookie(){let e,t=n.IdentifiersStorage.AcIdCookie.get();return t?(t.startsWith("ac%3A")&&(t=t.replace("ac%3A","ac:")),r.PushInternalLogger.log("AcID cookie:"),r.PushInternalLogger.log(t),e=t.startsWith("ac:")?t.split(":").slice(0,2).join(":"):t.split(":").slice(0,1).join(),r.PushInternalLogger.log("AcID after split: ",e),e):(r.PushInternalLogger.log("AcID identifier not found"),"")}static getFromParams(){let e=new URLSearchParams(window.location.search).get("ac_id");return null!==e?e:""}}t.PixelUser=s},6305(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SavePushSubscription=void 0;const n=i(3518),r=i(3699),o=i(7243),s=i(8566),a=i(3877);t.SavePushSubscription=class{static sendToBackend(e,t){var i,l;if("string"!=typeof e.endpoint||""===e.endpoint)throw new Error("PushSubscriptionJSON endpoint is not string or is empty!");const u=n.PixelUser.get(),c=(0,s.wpha)(),d=(0,s.pixelId)();a.PushInternalLogger.log("SavePushSubscription::sendToBackend","pushSubscription:",e),a.PushInternalLogger.log("SavePushSubscription::sendToBackend","ac_id:",u),a.PushInternalLogger.log("SavePushSubscription::sendToBackend","wph_a:",c),a.PushInternalLogger.log("SavePushSubscription::sendToBackend","pixel_id:",d);let p={wph_a:c,pixel_id:d,ac_id:u,endpoint:e.endpoint,auth:null===(i=null==e?void 0:e.keys)||void 0===i?void 0:i.auth,p256dh:null===(l=null==e?void 0:e.keys)||void 0===l?void 0:l.p256dh,browser:(0,o.browserName)(),domain:(0,o.domain)(),em:(0,s.em)(),fpuid:(0,s.fpuid)(),ltid:(0,s.ltid)(),uid:(0,s.uid)()};return void 0!==t&&"string"==typeof t.endpoint&&(p.old_endpoint=null==t?void 0:t.endpoint),r.SubscriptionEndpoints.register(p)}}},9479(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionState=void 0,t.PermissionState=class{static isGranted(){return"granted"===Notification.permission}static isDefault(){return"default"===Notification.permission}static isDenied(){return"denied"===Notification.permission}}},7591(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentifiersStorage=void 0;const n=i(6052);class r{}t.IdentifiersStorage=r,r.AcIdCookie=new n.AcIdCookie},6052(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AcIdCookie=void 0;const n=i(1781);class r extends n.BaseCookie{constructor(){super(...arguments),this.name="STac",this.lifetimeInDays=0,this.immutable=!0}}t.AcIdCookie=r},383(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushStateStorage=void 0;const n=i(6483),r=i(3877);class o extends n.BaseWpStorage{constructor(){super(...arguments),this.name="WPpshstt"}}class s{static isDeclined(){var e;return"declined"===(null===(e=s.read())||void 0===e?void 0:e.state)}static setDeclined(){s.write("declined")}static exists(){var e;return"exist"===(null===(e=s.read())||void 0===e?void 0:e.state)}static setExists(){s.write("exist")}static clearExists(){s.exists()&&s.item.delete()}static read(){const e=s.item.get();if(!e)return null;const t=s.decode(e);return t?Date.now()>t.expires?(r.PushInternalLogger.log("PushStateStorage: stored push state expired, clearing"),s.item.delete(),null):t:(r.PushInternalLogger.log("PushStateStorage: stored push state unreadable with current decoder, leaving it in place"),null)}static write(e){const t={expires:Date.now()+2592e6,state:e};s.item.set(s.encode(t))}static encode(e){return JSON.stringify(e)}static decode(e){try{const t=JSON.parse(e);return s.isValidPayload(t)?t:null}catch(e){return r.PushInternalLogger.log("PushStateStorage: could not parse stored push state",e),null}}static isValidPayload(e){const t=e;return!!t&&"number"==typeof t.expires&&!!t.state}}t.PushStateStorage=s,s.item=new o},8556(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceWorkerLoader=void 0;const n=i(3877),r=i(9869);t.ServiceWorkerLoader=class{constructor(e){this.swPatch=e}load(){return new Promise((e,t)=>{const i=window.navigator,o=i.serviceWorker;i&&o?i.serviceWorker.register(this.swPatch,{scope:"/"}).then(t=>{var i;i=null,t.installing?i=t.installing:t.waiting?i=t.waiting:t.active&&(i=t.active),i&&(r.SwRegistration.set(t),n.PushInternalLogger.log(`Service Worker registration state: '${i.state}'`)),n.PushInternalLogger.log(`Service Worker registration complete, scope: '${t.scope}'`),r.SwRegistration.set(t),e()}).catch(e=>{n.PushInternalLogger.log(`Service Worker registration failed with error: '${e}'`),t(e)}):t(new Error("Navigator or Service Worker is not available"))})}static unregisterSW(){navigator.serviceWorker.getRegistrations().then(function(e){for(let t of e)t.unregister().then(e=>{console.log("unregister: ",e)}).catch(e=>{console.error(e)})})}}},9869(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SwRegistration=void 0,t.SwRegistration=class{static set(e){globalThis.swRegistration=e}static get(e=5e3,t=250){const i=Date.now();return new Promise(n=>{!function r(){if(void 0===globalThis.swRegistration||null===globalThis.swRegistration){if(Date.now()-i>=e)return void n(null);setTimeout(r,t)}else n(globalThis.swRegistration)}()})}}},395(e,t){"use strict";var i,n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.PushStatAreaIdKey=t.PushStatBoxIdKey=t.PushStatEvent=void 0,function(e){e.formView="formView",e.formButtonView="formButtonView",e.formButtonClick="formButtonClick",e.browserPromptView="browserPromptView",e.browserPromptGranted="browserPromptGranted",e.browserPromptDenied="browserPromptDenied"}(i||(t.PushStatEvent=i={})),function(e){e.pushEnable="pushEnable",e.skip="skip",e.granted="granted",e.denied="denied"}(n||(t.PushStatBoxIdKey=n={})),function(e){e.popup="popup",e.browser="browser"}(r||(t.PushStatAreaIdKey=r={}))},7927(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PushStats=void 0;const n=i(2934),r=i(3877),o=i(497),s=[new(i(3173).WaveStatsSink)];let a=null;const l=new Set;
2t.PushStats=class{static init(e){a=e,r.PushInternalLogger.log("PushStats: initialized",e)}static emit(e,t={}){var i;try{const u=null!=a?a:n.DEFAULT_STATS_SETTINGS;if(!u.enabled)return void r.PushInternalLogger.log(`PushStats: statistics disabled, skipping ${e}`);if(!1===u.events[e])return void r.PushInternalLogger.log(`PushStats: event ${e} disabled by settings`);const c=(0,o.resolveVabNames)(e,t,u);if(null===c)return void r.PushInternalLogger.log(`PushStats: ${e} has no valid VAB names in settings, skipping`);const d=`${e}:${null!==(i=c.boxId)&&void 0!==i?i:""}`;if(l.has(d))return void r.PushInternalLogger.log(`PushStats: ${d} already sent, skipping`);let p=!1;for(const i of s)try{p=i.send(e,t,u)||p}catch(t){r.PushInternalLogger.log(`PushStats: sink ${i.name} failed for ${e}`,t)}p?l.add(d):r.PushInternalLogger.log(`PushStats: ${d} not delivered by any sink, dedup key not set`)}catch(t){r.PushInternalLogger.log(`PushStats: emit failed for ${e}`,t)}}static reset(){a=null,l.clear();for(const e of s)e.reset()}}},3173(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaveStatsSink=t.MAX_CONSECUTIVE_FAILURES=void 0;const n=i(3877),r=i(8566),o=i(497);t.MAX_CONSECUTIVE_FAILURES=3;class s{constructor(){this.name="wave",this.consecutiveFailures=0}send(e,i,r){var a;if(this.consecutiveFailures>=t.MAX_CONSECUTIVE_FAILURES)return n.PushInternalLogger.log(`WaveStatsSink: disabled after ${t.MAX_CONSECUTIVE_FAILURES} consecutive failures, skipping ${e}`),!1;const l=null===(a=window.WP)||void 0===a?void 0:a.stat;if(void 0===l||"function"!=typeof l.wave)return n.PushInternalLogger.log(`WaveStatsSink: WP.stat.wave unavailable, skipping ${e}`),!1;const u=s.buildParams(e,i,r);if(null===u)return!1;const c=o.WAVE_EVENT_MAPPING[e].action;try{return l.wave(c,u,r.bucket),this.consecutiveFailures=0,n.PushInternalLogger.log(`WaveStatsSink: sent ${e} as ${c}`,u),!0}catch(e){return this.consecutiveFailures+=1,n.PushInternalLogger.log(`WaveStatsSink: wave call failed (${this.consecutiveFailures}/${t.MAX_CONSECUTIVE_FAILURES})`,e),!1}}reset(){this.consecutiveFailures=0}static buildParams(e,t,i){var r,a;const l=o.WAVE_EVENT_MAPPING[e],u=(0,o.resolveVabNames)(e,t,i);if(null===u)return null;const c={type:l.type,areaid:u.areaId};if(l.type===o.WaveElementType.area){const i=null!==(r=t.length)&&void 0!==r?r:l.length;if("number"!=typeof i||i<1)return n.PushInternalLogger.log(`WaveStatsSink: invalid length for ${e}, skipping`,i),null;c.length=i}else{const i=null!==(a=t.index)&&void 0!==a?a:l.index;if("number"!=typeof i||i<0)return n.PushInternalLogger.log(`WaveStatsSink: invalid index for ${e}, skipping`,i),null;c.id=u.boxId,c.index=i}return Object.assign(Object.assign({},c),s.baseParams())}static baseParams(){return{isLogged:""!==(0,r.uid)(),url:window.location.href}}}t.WaveStatsSink=s},497(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveVabNames=t.isValidVabName=t.WAVE_EVENT_MAPPING=t.VAB_NAME_PATTERN=t.WaveElementType=t.WaveAction=void 0;const n=i(395);var r,o;!function(e){e.view="view",e.click="click"}(r||(t.WaveAction=r={})),function(e){e.area="area",e.button="button"}(o||(t.WaveElementType=o={})),t.VAB_NAME_PATTERN=/^[A-Za-z0-9/_-]{3,48}$/,t.WAVE_EVENT_MAPPING={[n.PushStatEvent.formView]:{action:r.view,type:o.area,areaIdKey:n.PushStatAreaIdKey.popup},[n.PushStatEvent.formButtonView]:{action:r.view,type:o.button,areaIdKey:n.PushStatAreaIdKey.popup},[n.PushStatEvent.formButtonClick]:{action:r.click,type:o.button,areaIdKey:n.PushStatAreaIdKey.popup},[n.PushStatEvent.browserPromptView]:{action:r.view,type:o.area,areaIdKey:n.PushStatAreaIdKey.browser,length:1},[n.PushStatEvent.browserPromptGranted]:{action:r.click,type:o.button,areaIdKey:n.PushStatAreaIdKey.browser,boxIdKey:n.PushStatBoxIdKey.granted,index:0},[n.PushStatEvent.browserPromptDenied]:{action:r.click,type:o.button,areaIdKey:n.PushStatAreaIdKey.browser,boxIdKey:n.PushStatBoxIdKey.denied,index:0}},t.isValidVabName=e=>t.VAB_NAME_PATTERN.test(e),t.resolveVabNames=(e,i,n)=>{var r;const s=t.WAVE_EVENT_MAPPING[e];if(void 0===s)return null;const a=n.areaIds[s.areaIdKey];if("string"!=typeof a||!(0,t.isValidVabName)(a))return null;if(s.type!==o.button)return{areaId:a};const l=null!==(r=i.boxIdKey)&&void 0!==r?r:s.boxIdKey;if(void 0===l)return null;const u=n.boxIds[l];return"string"==typeof u&&(0,t.isValidVabName)(u)?{areaId:a,boxId:u}:null}},9435(e,t,i){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.CookieProvider=void 0;const n=i(3877),r=i(3283);class o{constructor(){if(!o.isAvailable())throw new Error("Cookies are not supported in this environment")}static isAvailable(){if("undefined"==typeof document)return n.PushInternalLogger.log("Document is not available"),!1;try{return"undefined"!=typeof navigator&&Boolean(navigator.cookieEnabled)}catch(e){return n.PushInternalLogger.log("Error testing cookie availability:",e),!1}}static getInstance(){return o.instance||(o.instance=new o),o.instance}get(e){return"undefined"==typeof document?(n.PushInternalLogger.log("Cannot read document!"),null):(n.PushInternalLogger.log("all cookies"),n.PushInternalLogger.log(document.cookie),document.cookie.split(";").map(e=>e.trim()).filter(t=>t.substring(0,e.length+1)===`${e}=`).map(t=>decodeURIComponent(t.substring(e.length+1)))[0]||null)}set(e,t,i){if("undefined"==typeof document)return void n.PushInternalLogger.log("Cannot read document!");let o="";r.SubscriptionType.isExternal()&&(o="domain=."+location.host),document.cookie=`${e}=${t}; expires=${i.toUTCString()}; path=/; ${o}SameSite=None; Secure`}delete(e){this.get(e)?document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`:n.PushInternalLogger.log("Cannot delete cookie as it's not set.")}isAvailable(){return o.isAvailable()}}t.CookieProvider=o},2253(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorage=void 0;class i{constructor(){if(!i.isAvailable())throw new Error("LocalStorage is not supported in this environment")}static getInstance(){return i.instance||(i.instance=new i),i.instance}get(e){return localStorage.getItem(e)}set(e,t,i){localStorage.setItem(e,t)}delete(e){localStorage.removeItem(e)}isAvailable(){return i.isAvailable()}static isAvailable(){try{const e=i.testKey;return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch(e){return!1}}}t.LocalStorage=i,i.testKey="wppush_availability_test"},8087(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WpNativeStorageProvider=void 0;const n=i(3877),r=i(2253),o="v";class s{static getInstance(){return s.instance||(s.instance=new s),s.instance}get(e){const t=s.getRaw(e);return null===t?null:s.decode(t)}set(e,t,i){const o=s.encode(t),a=s.wpStorage();if("function"==typeof(null==a?void 0:a.set))try{return void a.set(e,o)}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: WP.storage.set failed, falling back to localStorage",e)}try{r.LocalStorage.getInstance().set(e,o,i)}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: localStorage fallback unavailable",e)}}static getRaw(e){var t;const i=s.wpStorage();if("function"==typeof(null==i?void 0:i.get))try{return null!==(t=i.get(e))&&void 0!==t?t:null}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: WP.storage.get failed, falling back to localStorage",e)}try{return r.LocalStorage.getInstance().get(e)}catch(e){return n.PushInternalLogger.log("WpNativeStorageProvider: localStorage fallback unavailable",e),null}}static encode(e){const t=s.wpRandomizers();if("function"==typeof(null==t?void 0:t.encode))try{const i=t.encode({[o]:e});if("string"==typeof i&&i.length>0)return i;n.PushInternalLogger.log("WpNativeStorageProvider: WP.randomizers.encode returned no value, storing plain value")}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: WP.randomizers.encode failed, storing plain value",e)}return e}static decode(e){var t;const i=s.wpRandomizers();if("function"==typeof(null==i?void 0:i.decode))try{const r=null===(t=i.decode(e))||void 0===t?void 0:t.v;if("string"==typeof r)return r;n.PushInternalLogger.log("WpNativeStorageProvider: WP.randomizers.decode returned no value, using raw value")}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: WP.randomizers.decode failed, using raw value",e)}return e}delete(e){const t=s.wpStorage();if("function"==typeof(null==t?void 0:t.remove))try{return void t.remove(e)}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: WP.storage.remove failed, falling back to localStorage",e)}try{r.LocalStorage.getInstance().delete(e)}catch(e){n.PushInternalLogger.log("WpNativeStorageProvider: localStorage fallback unavailable",e)}}isAvailable(){return!!s.wpStorage()||r.LocalStorage.isAvailable()}static wpStorage(){var e;return"undefined"!=typeof window?null===(e=window.WP)||void 0===e?void 0:e.storage:void 0}static wpRandomizers(){var e;return"undefined"!=typeof window?null===(e=window.WP)||void 0===e?void 0:e.randomizers:void 0}}t.WpNativeStorageProvider=s},1781(e,t,i){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCookie=void 0;const n=i(9435);t.BaseCookie=class{constructor(){this.provider=n.CookieProvider.getInstance()}get(){return this.provider.get(this.name)}set(e){if(this.immutable)throw new Error("Cannot set value for immutable cookie");const t=new Date;t.setDate(t.getDate()+this.lifetimeInDays),this.provider.set(this.name,e,t)}delete(){if(this.immutable)throw new Error("Cannot delete immutable cookie");this.provider.delete(this.name)}refresh(){const e=this.get();e&&this.set(e)}}},8383(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseLocalStorage=void 0;const n=i(7545),r=i(2253);class o extends n.BaseProviderStorage{constructor(){super(r.LocalStorage.getInstance())}}t.BaseLocalStorage=o},7545(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseProviderStorage=void 0,t.BaseProviderStorage=class{constructor(e){this.immutable=!1,this.provider=e}get(){return this.provider.get(this.name)}set(e){this.provider.set(this.name,e)}delete(){this.provider.delete(this.name)}}},6483(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWpStorage=void 0;const n=i(7545),r=i(8087);class o extends n.BaseProviderStorage{constructor(){super(r.WpNativeStorageProvider.getInstance())}}t.BaseWpStorage=o},4760(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;const r=i(3877),o=i(4384),s=i(1911),a=i(6305),l=i(2895),u=i(9869),c=i(3244),d=i(383),p=i(3283),g=i(7927),h=i(395),b=i(1705),v=i(4274);class S{constructor(){this.isOperationInProgress=!1,this.currentSubscription=null,this.state="idle",r.PushInternalLogger.log("SubscriptionManager: Instance created")}static getInstance(){return S.instance||(S.instance=new S),S.instance}static resetInstance(){S.instance=null}subscribe(e){return n(this,void 0,void 0,function*(){if(r.PushInternalLogger.log(`SubscriptionManager::subscribe called from source: ${e}`),"refresh"===e)return r.PushInternalLogger.log("SubscriptionManager: Subscribe blocked - 'refresh' source is not allowed to create subscriptions"),{success:!1,error:new Error("Cannot auto-subscribe from refresh source")};if(this.isOperationInProgress)return r.PushInternalLogger.log("SubscriptionManager: Subscribe blocked - operation in progress"),{success:!1,alreadyExists:!0};this.isOperationInProgress=!0,this.state="subscribing";let t="subscribe_other";try{const i=yield this.getSwRegistration();if(!i)throw t="sw_registration_timeout",new Error("SubscriptionManager: service worker registration not ready (timed out)");const n=yield i.pushManager.getSubscription();if(n){r.PushInternalLogger.log("SubscriptionManager: Subscription already exists in browser, checking backend...",n),this.currentSubscription=n;const i=n.toJSON();t="backend_error";const o=yield c.SubscriptionExists.check(i);return 404===o.status?(r.PushInternalLogger.log("SubscriptionManager: Subscription not found in backend (404), updating..."),this.state="saving",yield a.SavePushSubscription.sendToBackend(i),r.PushInternalLogger.log("SubscriptionManager: Subscription updated in backend"),this.sendStats(e,"agreed"),{success:!0,subscription:n}):(302===o.status&&(r.PushInternalLogger.log("SubscriptionManager: Subscription exists in backend, saving state."),d.PushStateStorage.setExists()),{success:!0,subscription:n,alreadyExists:!0})}r.PushInternalLogger.log("SubscriptionManager: Creating new subscription");const l=yield b.GlobalWpPushSettings.get();if(yield s.VapidPublicKey.ready(l.vapidReadyMaxWait,l.vapidReadyIntervalMs),""===s.VapidPublicKey.get())throw t="vapid_timeout",new Error("SubscriptionManager: vapid public key not available (timed out)");t="push_subscribe_error";const u=yield i.pushManager.subscribe(o.PushSubscriptionOptionsObject.get());
2r.PushInternalLogger.log("SubscriptionManager: New subscription created",u),this.currentSubscription=u,this.state="saving",t="backend_error";const p=u.toJSON();return yield a.SavePushSubscription.sendToBackend(p),r.PushInternalLogger.log("SubscriptionManager: Subscription saved to backend"),this.sendStats(e,"agreed"),g.PushStats.emit(h.PushStatEvent.browserPromptGranted),{success:!0,subscription:u}}catch(e){return r.PushInternalLogger.log("SubscriptionManager: Error during subscribe",e),"push_subscribe_error"===t&&(t=(0,v.pushSubscribeFailureReason)(e)),{success:!1,error:e,reason:t}}finally{this.isOperationInProgress=!1,this.state="idle"}})}unsubscribe(){return n(this,void 0,void 0,function*(){if(r.PushInternalLogger.log("SubscriptionManager::unsubscribe called"),this.isOperationInProgress)r.PushInternalLogger.log("SubscriptionManager: Unsubscribe blocked - operation in progress");else{this.isOperationInProgress=!0,this.state="unsubscribing";try{const e=yield this.getSwRegistration();if(!e)throw new Error("SubscriptionManager: service worker registration not ready (timed out)");const t=yield e.pushManager.getSubscription();t?(yield t.unsubscribe(),r.PushInternalLogger.log("SubscriptionManager: Unsubscribed successfully"),this.currentSubscription=null):r.PushInternalLogger.log("SubscriptionManager: No subscription to unsubscribe")}catch(e){throw r.PushInternalLogger.log("SubscriptionManager: Error during unsubscribe",e),e}finally{this.isOperationInProgress=!1,this.state="idle"}}})}resubscribe(){return n(this,void 0,void 0,function*(){if(r.PushInternalLogger.log("SubscriptionManager::resubscribe called"),!d.PushStateStorage.exists()||p.SubscriptionType.isExternal())if(this.isOperationInProgress)r.PushInternalLogger.log("SubscriptionManager: Resubscribe blocked - operation in progress");else{this.isOperationInProgress=!0;try{const e=yield this.getSwRegistration();if(!e)throw new Error("SubscriptionManager: service worker registration not ready (timed out)");const t=yield e.pushManager.getSubscription();if(t){r.PushInternalLogger.log("SubscriptionManager: Subscription exists in browser, checking with backend."),this.currentSubscription=t;const e=t.toJSON(),i=yield c.SubscriptionExists.check(e);404===i.status?(r.PushInternalLogger.log("SubscriptionManager: Backend returned 404, resubscribing to backend..."),this.state="saving",yield a.SavePushSubscription.sendToBackend(e),this.sendStats("browser","resubscribe"),r.PushInternalLogger.log("SubscriptionManager: Resubscribed to backend successfully"),d.PushStateStorage.setExists()):302===i.status?(r.PushInternalLogger.log("SubscriptionManager: Subscription exists in backend, saving state."),d.PushStateStorage.setExists()):r.PushInternalLogger.log(`SubscriptionManager: Subscription is valid (status: ${i.status}).`)}else r.PushInternalLogger.log("SubscriptionManager: No subscription found in browser.")}catch(e){r.PushInternalLogger.log("SubscriptionManager: Error during resubscribe",e)}finally{this.isOperationInProgress=!1,this.state="idle"}}else r.PushInternalLogger.log("SubscriptionManager: Subscription state exists, skipping resubscribe")})}getSubscription(){return this.currentSubscription}getState(){return this.state}getSwRegistration(){return n(this,void 0,void 0,function*(){const e=yield b.GlobalWpPushSettings.get();return u.SwRegistration.get(e.serviceWorkerReadyMaxWait,e.serviceWorkerReadyIntervalMs)})}isOperationPending(){return this.isOperationInProgress}waitForPendingOperation(){return n(this,arguments,void 0,function*(e=5e3,t=50){if(!this.isOperationInProgress)return!0;r.PushInternalLogger.log("SubscriptionManager: Waiting for pending operation to complete...");const i=Date.now();return new Promise(n=>{const o=setInterval(()=>{this.isOperationInProgress?Date.now()-i>=e&&(clearInterval(o),r.PushInternalLogger.log(`SubscriptionManager: Timeout waiting for pending operation (${e}ms)`),n(!1)):(clearInterval(o),r.PushInternalLogger.log(`SubscriptionManager: Pending operation completed after ${Date.now()-i}ms`),n(!0))},t)})})}sendStats(e,t){const i="external"===e?"browser-external":"browser";l.PermissionDOMWindow.sendPermissionStats(i,t),r.PushInternalLogger.log(`SubscriptionManager: Stats sent - type: ${i}, action: ${t}`)}}t.SubscriptionManager=S},8889(e,t,i){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionEndpoints=void 0;const n=i(8285),r="https://webpush.wp.pl/subscription/",o="save",s="update",a="statistics",l="exists";t.SubscriptionEndpoints=class{static register(e){return n.HttpClient.post(r+o,{body:e})}static update(e){return n.HttpClient.post(r+s,{body:e})}static statistics(e){return n.HttpClient.post(r+a,{body:e})}static doesSubscriptionExist(e){return n.HttpClient.post(r+l,{body:e})}static consentStats(e){return n.HttpClient.post(r+"push_consents_stats",{body:e})}}},3699(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionEndpoints=void 0;var n=i(8889);Object.defineProperty(t,"SubscriptionEndpoints",{enumerable:!0,get:function(){return n.SubscriptionEndpoints}})},4274(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pushSubscribeFailureReason=void 0;const i={AbortError:"push_abort",InvalidStateError:"push_invalid_state",NotSupportedError:"push_not_supported",InvalidAccessError:"push_invalid_access"};t.pushSubscribeFailureReason=e=>{var t,n;return null!==(n=i[null!==(t=null==e?void 0:e.name)&&void 0!==t?t:""])&&void 0!==n?n:"push_subscribe_error"}},3283(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionType=void 0,t.SubscriptionType=class{static isExternal(){return window.location.href.includes("pushservice.pl")}static isInternal(){return!this.isExternal()}}},7012(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VapidEndpoints=void 0;const n=i(8285),r=i(7243),o=i(8566);t.VapidEndpoints=class{static getVapidPublicKey(){const e="https://webpush.wp.pl/vapid_service/?"+new URLSearchParams({pixel_id:(0,o.pixelId)(),domain:(0,r.domain)()}).toString();return n.HttpClient.get(e,{headers:{}})}}},2162(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VapidEndpoints=void 0;var n=i(7012);Object.defineProperty(t,"VapidEndpoints",{enumerable:!0,get:function(){return n.VapidEndpoints}})},7067(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VapidKeys=void 0;const n=i(2162);t.VapidKeys=class{static getVapidPublicKey(){return n.VapidEndpoints.getVapidPublicKey()}}},1911(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VapidPublicKey=void 0;let i="";t.VapidPublicKey=class{constructor(e){i=e}static get(){return i}static ready(e=5e3,t=100){if(""!==i)return Promise.resolve();const n=Date.now();return new Promise(r=>{const o=setInterval(()=>{(""!==i||Date.now()-n>=e)&&(clearInterval(o),r())},t)})}}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i(8156)})();

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.