���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��Sid Gifari Priv8 Shell PK!assets/js/pwaforwp.min.jsnu[/** * For loaders */ var showLoader = false; if(pwaforwp_is_mobile() && pwaforwp_js_obj.loader_mobile=="1" && screen.availWidth<521){ console.log(screen.availWidth); pwaforwp_play_loader(); } if(pwaforwp_js_obj.loader_desktop=="1" && screen.availWidth>520){ pwaforwp_play_loader(); } if(pwaforwp_js_obj.loader_admin=="1" && pwaforwp_js_obj.user_admin=='1'){ pwaforwp_play_loader(); } if(pwaforwp_js_obj.loader_only_pwa=="1"){ if( window.matchMedia('(display-mode: standalone)').matches || window.matchMedia('(display-mode: fullscreen)').matches || window.matchMedia('(display-mode: minimal-ui)').matches) { pwaforwp_play_loader(); } } function pwaforwp_play_loader(){ window.addEventListener("beforeunload", function(){ if(document.getElementsByClassName('pwaforwp-loading-wrapper') && typeof document.getElementsByClassName('pwaforwp-loading-wrapper')[0]!=='undefined'){ document.getElementsByClassName('pwaforwp-loading-wrapper')[0].style.display = "flex"; } if(document.getElementById('pwaforwp_loading_div')){ document.getElementById('pwaforwp_loading_div').style.display = "flex"; } if(document.getElementById('pwaforwp_loading_icon')){ document.getElementById('pwaforwp_loading_icon').style.display = "flex"; } }); setInterval(function(){ if(document.getElementsByClassName('pwaforwp-loading-wrapper') && document.getElementsByClassName('pwaforwp-loading-wrapper').length > 0){ var tot = document.getElementsByClassName('pwaforwp-loading-wrapper'); for (var i = 0; i < tot.length; i++) { tot[i].style.display = "none"; } } if(document.getElementById('pwaforwp_loading_div')){ document.getElementById('pwaforwp_loading_div').style.display = "none"; } if(document.getElementById('pwaforwp_loading_icon')){ document.getElementById('pwaforwp_loading_icon').style.display = "none"; } }, 5000, true); } (function(){ /** * For loaders */ var showLoader = false; if(pwaforwp_is_mobile() && pwaforwp_js_obj.loader_mobile=="1" && screen.availWidth<521){ pwaforwp_ios_play_loader(); }else if(pwaforwp_js_obj.loader_desktop=="1" && screen.availWidth>520){ pwaforwp_ios_play_loader(); } function pwaforwp_ios_play_loader(){ var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; if (isSafari && iOS) { document.getElementById('pwaforwp_loading_div').style.display = "flex"; document.getElementById('pwaforwp_loading_icon').style.display = "flex"; document.getElementsByClassName('pwaforwp-loading-wrapper').style.display = "flex"; setInterval(function(){ document.getElementById('pwaforwp_loading_div').style.display = "none"; document.getElementById('pwaforwp_loading_icon').style.display = "none"; document.getElementsByClassName('pwaforwp-loading-wrapper').style.display = "none"; }, 5000, true); }else{ document.getElementById('pwaforwp_loading_div').style.display = "none"; document.getElementById('pwaforwp_loading_icon').style.display = "none"; document.getElementsByClassName('pwaforwp-loading-wrapper').style.display = "none"; window.addEventListener("beforeunload", function(){ document.getElementById('pwaforwp_loading_div').style.display = "flex"; document.getElementById('pwaforwp_loading_icon').style.display = "none"; document.getElementsByClassName('pwaforwp-loading-wrapper').style.display = "none"; }); } } /* * For Add to home screen Popup * Start */ jQuery(".pwaforwp_add_home_close").on("click", function(){ document.cookie = "pwaforwp_prompt_close="+new Date(); //jQuery(this).parents('.pwaforwp-sticky-banner').hide(); jQuery(this).parent().hide(); }); if(jQuery('.pwaforwp-add-via-class').is(':hidden')){ jQuery(".pwaforwp-sticky-banner").hide(); }else{ jQuery(".pwaforwp-sticky-banner").show(); } if(pwaforwp_js_obj.reset_cookies==1 ){ document.cookie = 'pwaforwp_prompt_close=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;' } }); function pwaforwp_is_mobile(){ var isMobile = false; //initiate as false // device detection if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) { isMobile = true; } return isMobile; }PK!~assets/js/jszip.min.jsnu[!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g>2,h=(3&b)<<4|c>>4,i=n>1?(15&c)<<2|e>>6:64,j=n>2?63&e:64,k.push(f.charAt(g)+f.charAt(h)+f.charAt(i)+f.charAt(j));return k.join("")},c.decode=function(a){var b,c,d,g,h,i,j,k=0,l=0,m="data:";if(a.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");var n=3*a.length/4;if(a.charAt(a.length-1)===f.charAt(64)&&n--,a.charAt(a.length-2)===f.charAt(64)&&n--,n%1!==0)throw new Error("Invalid base64 input, bad content length.");var o;for(o=e.uint8array?new Uint8Array(0|n):new Array(0|n);k>4,c=(15&h)<<4|i>>2,d=(3&i)<<6|j,o[l++]=b,64!==i&&(o[l++]=c),64!==j&&(o[l++]=d);return o}},{"./support":30,"./utils":32}],2:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.compressedSize=a,this.uncompressedSize=b,this.crc32=c,this.compression=d,this.compressedContent=e}var e=a("./external"),f=a("./stream/DataWorker"),g=a("./stream/DataLengthProbe"),h=a("./stream/Crc32Probe"),g=a("./stream/DataLengthProbe");d.prototype={getContentWorker:function(){var a=new f(e.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new g("data_length")),b=this;return a.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),a},getCompressedWorker:function(){return new f(e.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(a,b,c){return a.pipe(new h).pipe(new g("uncompressedSize")).pipe(b.compressWorker(c)).pipe(new g("compressedSize")).withStreamInfo("compression",b)},b.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,b,c){"use strict";var d=a("./stream/GenericWorker");c.STORE={magic:"\0\0",compressWorker:function(a){return new d("STORE compression")},uncompressWorker:function(){return new d("STORE decompression")}},c.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=h,f=d+c;a^=-1;for(var g=d;g>>8^e[255&(a^b[g])];return a^-1}function f(a,b,c,d){var e=h,f=d+c;a^=-1;for(var g=d;g>>8^e[255&(a^b.charCodeAt(g))];return a^-1}var g=a("./utils"),h=d();b.exports=function(a,b){if("undefined"==typeof a||!a.length)return 0;var c="string"!==g.getTypeOf(a);return c?e(0|b,a,a.length,0):f(0|b,a,a.length,0)}},{"./utils":32}],5:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!0,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],6:[function(a,b,c){"use strict";var d=null;d="undefined"!=typeof Promise?Promise:a("lie"),b.exports={Promise:d}},{lie:58}],7:[function(a,b,c){"use strict";function d(a,b){h.call(this,"FlateWorker/"+a),this._pako=null,this._pakoAction=a,this._pakoOptions=b,this.meta={}}var e="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,f=a("pako"),g=a("./utils"),h=a("./stream/GenericWorker"),i=e?"uint8array":"array";c.magic="\b\0",g.inherits(d,h),d.prototype.processChunk=function(a){this.meta=a.meta,null===this._pako&&this._createPako(),this._pako.push(g.transformTo(i,a.data),!1)},d.prototype.flush=function(){h.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){h.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new f[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var a=this;this._pako.onData=function(b){a.push({data:b,meta:a.meta})}},c.compressWorker=function(a){return new d("Deflate",a)},c.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:59}],8:[function(a,b,c){"use strict";function d(a,b,c,d){f.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=c,this.encodeFileName=d,this.streamFiles=a,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var e=a("../utils"),f=a("../stream/GenericWorker"),g=a("../utf8"),h=a("../crc32"),i=a("../signature"),j=function(a,b){var c,d="";for(c=0;c>>=8;return d},k=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},l=function(a,b){return 63&(a||0)},m=function(a,b,c,d,f,m){var n,o,p=a.file,q=a.compression,r=m!==g.utf8encode,s=e.transformTo("string",m(p.name)),t=e.transformTo("string",g.utf8encode(p.name)),u=p.comment,v=e.transformTo("string",m(u)),w=e.transformTo("string",g.utf8encode(u)),x=t.length!==p.name.length,y=w.length!==u.length,z="",A="",B="",C=p.dir,D=p.date,E={crc32:0,compressedSize:0,uncompressedSize:0};b&&!c||(E.crc32=a.crc32,E.compressedSize=a.compressedSize,E.uncompressedSize=a.uncompressedSize);var F=0;b&&(F|=8),r||!x&&!y||(F|=2048);var G=0,H=0;C&&(G|=16),"UNIX"===f?(H=798,G|=k(p.unixPermissions,C)):(H=20,G|=l(p.dosPermissions,C)),n=D.getUTCHours(),n<<=6,n|=D.getUTCMinutes(),n<<=5,n|=D.getUTCSeconds()/2,o=D.getUTCFullYear()-1980,o<<=4,o|=D.getUTCMonth()+1,o<<=5,o|=D.getUTCDate(),x&&(A=j(1,1)+j(h(s),4)+t,z+="up"+j(A.length,2)+A),y&&(B=j(1,1)+j(h(v),4)+w,z+="uc"+j(B.length,2)+B);var I="";I+="\n\0",I+=j(F,2),I+=q.magic,I+=j(n,2),I+=j(o,2),I+=j(E.crc32,4),I+=j(E.compressedSize,4),I+=j(E.uncompressedSize,4),I+=j(s.length,2),I+=j(z.length,2);var J=i.LOCAL_FILE_HEADER+I+s+z,K=i.CENTRAL_FILE_HEADER+j(H,2)+I+j(v.length,2)+"\0\0\0\0"+j(G,4)+j(d,4)+s+z+v;return{fileRecord:J,dirRecord:K}},n=function(a,b,c,d,f){var g="",h=e.transformTo("string",f(d));return g=i.CENTRAL_DIRECTORY_END+"\0\0\0\0"+j(a,2)+j(a,2)+j(b,4)+j(c,4)+j(h.length,2)+h},o=function(a){var b="";return b=i.DATA_DESCRIPTOR+j(a.crc32,4)+j(a.compressedSize,4)+j(a.uncompressedSize,4)};e.inherits(d,f),d.prototype.push=function(a){var b=a.meta.percent||0,c=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(a):(this.bytesWritten+=a.data.length,f.prototype.push.call(this,{data:a.data,meta:{currentFile:this.currentFile,percent:c?(b+100*(c-d-1))/c:100}}))},d.prototype.openedSource=function(a){this.currentSourceOffset=this.bytesWritten,this.currentFile=a.file.name;var b=this.streamFiles&&!a.file.dir;if(b){var c=m(a,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:c.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(a){this.accumulate=!1;var b=this.streamFiles&&!a.file.dir,c=m(a,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(c.dirRecord),b)this.push({data:o(a),meta:{percent:100}});else for(this.push({data:c.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var a=this.bytesWritten,b=0;b0?a.substring(0,b):""},q=function(a){return"/"!==a.slice(-1)&&(a+="/"),a},r=function(a,b){return b="undefined"!=typeof b?b:i.createFolders,a=q(a),this.files[a]||o.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},s={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(a){var b,c,d;for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],c=b.slice(this.root.length,b.length),c&&b.slice(0,this.root.length)===this.root&&a(c,d))},filter:function(a){var b=[];return this.forEach(function(c,d){a(c,d)&&b.push(d)}),b},file:function(a,b,c){if(1===arguments.length){if(d(a)){var e=a;return this.filter(function(a,b){return!b.dir&&e.test(a)})}var f=this.files[this.root+a];return f&&!f.dir?f:null}return a=this.root+a,o.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(d(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=r.call(this,b),e=this.clone();return e.root=c.name,e},remove:function(a){a=this.root+a;var b=this.files[a];if(b||("/"!==a.slice(-1)&&(a+="/"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f-this.zero;return-1},d.prototype.readAndCheckSignature=function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.readData(4);return b===f[0]&&c===f[1]&&d===f[2]&&e===f[3]},d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return[];var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./DataReader":18}],18:[function(a,b,c){"use strict";function d(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}var e=a("../utils");d.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return e.transformTo("string",this.readData(a))},readData:function(a){},lastIndexOfSignature:function(a){},readAndCheckSignature:function(a){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},b.exports=d},{"../utils":32}],19:[function(a,b,c){"use strict";function d(a){e.call(this,a)}var e=a("./Uint8ArrayReader"),f=a("../utils");f.inherits(d,e),d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(a,b,c){"use strict";function d(a){e.call(this,a)}var e=a("./DataReader"),f=a("../utils");f.inherits(d,e),d.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},d.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},d.prototype.readAndCheckSignature=function(a){var b=this.readData(4);return a===b},d.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./DataReader":18}],21:[function(a,b,c){"use strict";function d(a){e.call(this,a)}var e=a("./ArrayReader"),f=a("../utils");f.inherits(d,e),d.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b},b.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(a,b,c){"use strict";var d=a("../utils"),e=a("../support"),f=a("./ArrayReader"),g=a("./StringReader"),h=a("./NodeBufferReader"),i=a("./Uint8ArrayReader");b.exports=function(a){var b=d.getTypeOf(a);return d.checkSupport(b),"string"!==b||e.uint8array?"nodebuffer"===b?new h(a):e.uint8array?new i(d.transformTo("uint8array",a)):new f(d.transformTo("array",a)):new g(a)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(a,b,c){"use strict";c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\b"},{}],24:[function(a,b,c){"use strict";function d(a){e.call(this,"ConvertWorker to "+a),this.destType=a}var e=a("./GenericWorker"),f=a("../utils");f.inherits(d,e),d.prototype.processChunk=function(a){this.push({data:f.transformTo(this.destType,a.data),meta:a.meta})},b.exports=d},{"../utils":32,"./GenericWorker":28}],25:[function(a,b,c){"use strict";function d(){e.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var e=a("./GenericWorker"),f=a("../crc32"),g=a("../utils");g.inherits(d,e),d.prototype.processChunk=function(a){this.streamInfo.crc32=f(a.data,this.streamInfo.crc32||0),this.push(a)},b.exports=d},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(a,b,c){"use strict";function d(a){f.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}var e=a("../utils"),f=a("./GenericWorker");e.inherits(d,f),d.prototype.processChunk=function(a){if(a){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+a.data.length}f.prototype.processChunk.call(this,a)},b.exports=d},{"../utils":32,"./GenericWorker":28}],27:[function(a,b,c){"use strict";function d(a){f.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(a){b.dataIsReady=!0,b.data=a,b.max=a&&a.length||0,b.type=e.getTypeOf(a),b.isPaused||b._tickAndRepeat()},function(a){b.error(a)})}var e=a("../utils"),f=a("./GenericWorker"),g=16384;e.inherits(d,f),d.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this.data=null},d.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,e.delay(this._tickAndRepeat,[],this)),!0)},d.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(e.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},d.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=g,b=null,c=Math.min(this.max,this.index+a);if(this.index>=this.max)return this.end();switch(this.type){case"string":b=this.data.substring(this.index,c);break;case"uint8array":b=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":b=this.data.slice(this.index,c)}return this.index=c,this.push({data:b,meta:{percent:this.max?this.index/this.max*100:0}})},b.exports=d},{"../utils":32,"./GenericWorker":28}],28:[function(a,b,c){"use strict";function d(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}d.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,b){return this._listeners[a].push(b),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,b){if(this._listeners[a])for(var c=0;c "+a:a}},b.exports=d},{}],29:[function(a,b,c){"use strict";function d(a,b,c){switch(a){case"blob":return h.newBlob(h.transformTo("arraybuffer",b),c);case"base64":return k.encode(b);default:return h.transformTo(a,b)}}function e(a,b){var c,d=0,e=null,f=0;for(c=0;c=252?6:k>=248?5:k>=240?4:k>=224?3:k>=192?2:1;j[254]=j[254]=1;var l=function(a){var b,c,d,e,f,h=a.length,i=0;for(e=0;e>>6,b[f++]=128|63&c):c<65536?(b[f++]=224|c>>>12,b[f++]=128|c>>>6&63,b[f++]=128|63&c):(b[f++]=240|c>>>18,b[f++]=128|c>>>12&63,b[f++]=128|c>>>6&63,b[f++]=128|63&c);return b},m=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return c<0?b:0===c?b:c+j[a[c]]>b?c:b},n=function(a){var b,c,d,e,g=a.length,h=new Array(2*g);for(c=0,b=0;b4)h[c++]=65533,b+=e-1;else{for(d&=2===e?31:3===e?15:7;e>1&&b1?h[c++]=65533:d<65536?h[c++]=d:(d-=65536,h[c++]=55296|d>>10&1023,h[c++]=56320|1023&d)}return h.length!==c&&(h.subarray?h=h.subarray(0,c):h.length=c),f.applyFromCharCode(h)};c.utf8encode=function(a){return g.nodebuffer?h.newBufferFrom(a,"utf-8"):l(a)},c.utf8decode=function(a){return g.nodebuffer?f.transformTo("nodebuffer",a).toString("utf-8"):(a=f.transformTo(g.uint8array?"uint8array":"array",a),n(a))},f.inherits(d,i),d.prototype.processChunk=function(a){var b=f.transformTo(g.uint8array?"uint8array":"array",a.data);if(this.leftOver&&this.leftOver.length){if(g.uint8array){var d=b;b=new Uint8Array(d.length+this.leftOver.length),b.set(this.leftOver,0),b.set(d,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var e=m(b),h=b;e!==b.length&&(g.uint8array?(h=b.subarray(0,e),this.leftOver=b.subarray(e,b.length)):(h=b.slice(0,e),this.leftOver=b.slice(e,b.length))),this.push({data:c.utf8decode(h),meta:a.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:c.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},c.Utf8DecodeWorker=d,f.inherits(e,i),e.prototype.processChunk=function(a){this.push({data:c.utf8encode(a.data),meta:a.meta})},c.Utf8EncodeWorker=e},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(a,b,c){"use strict";function d(a){var b=null;return b=i.uint8array?new Uint8Array(a.length):new Array(a.length),f(a,b)}function e(a){return a}function f(a,b){for(var c=0;c1;)try{return n.stringifyByChunk(a,d,b)}catch(f){b=Math.floor(b/2)}return n.stringifyByChar(a)}function h(a,b){for(var c=0;c1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var a,b;for(a=0;a0)this.isSignature(c,g.CENTRAL_FILE_HEADER)||(this.reader.zero=e);else if(e<0)throw new Error("Corrupted zip: missing "+Math.abs(e)+" bytes.")},prepareReader:function(a){this.reader=e(a)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(a,b,c){"use strict";function d(a,b){this.options=a,this.loadOptions=b}var e=a("./reader/readerFor"),f=a("./utils"),g=a("./compressedObject"),h=a("./crc32"),i=a("./utf8"),j=a("./compressions"),k=a("./support"),l=0,m=3,n=function(a){for(var b in j)if(j.hasOwnProperty(b)&&j[b].magic===a)return j[b];return null};d.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},readLocalPart:function(a){var b,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(c),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(b=n(this.compressionMethod),null===b)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");this.decompressed=new g(this.compressedSize,this.uncompressedSize,this.crc32,b,a.readData(this.compressedSize))},readCentralPart:function(a){this.versionMadeBy=a.readInt(2),a.skip(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4);var b=a.readInt(2);if(this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");a.skip(b),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a===l&&(this.dosPermissions=63&this.externalFileAttributes),a===m&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(a){if(this.extraFields[1]){var b=e(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});a.indexc;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function(a){delete q[a]},"process"==a("./_cof")(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),b.exports={set:m,clear:n}},{"./_cof":39,"./_ctx":41,"./_dom-create":43,"./_global":46,"./_html":48,"./_invoke":50}],55:[function(a,b,c){var d=a("./_is-object");b.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":51}],56:[function(a,b,c){var d=a("./_export"),e=a("./_task");d(d.G+d.B,{setImmediate:e.set,clearImmediate:e.clear})},{"./_export":44,"./_task":54}],57:[function(a,b,c){(function(a){"use strict";function c(){k=!0;for(var a,b,c=l.length;c;){for(b=l,l=[],a=-1;++a0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=h.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==p)throw new Error(k[c]);if(b.header&&h.deflateSetHeader(this.strm,b.header),b.dictionary){var e;if(e="string"==typeof b.dictionary?j.string2buf(b.dictionary):"[object ArrayBuffer]"===m.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=h.deflateSetDictionary(this.strm,e),c!==p)throw new Error(k[c]);this._dict_set=!0}}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg||k[c.err];return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}function g(a,b){return b=b||{},b.gzip=!0,e(a,b)}var h=a("./zlib/deflate"),i=a("./utils/common"),j=a("./utils/strings"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=Object.prototype.toString,n=0,o=4,p=0,q=1,r=2,s=-1,t=0,u=8;d.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?o:n,"string"==typeof a?e.input=j.string2buf(a):"[object ArrayBuffer]"===m.call(a)?e.input=new Uint8Array(a):e.input=a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new i.Buf8(f),e.next_out=0,e.avail_out=f),c=h.deflate(e,d),c!==q&&c!==p)return this.onEnd(c),this.ended=!0,!1;0!==e.avail_out&&(0!==e.avail_in||d!==o&&d!==r)||("string"===this.options.to?this.onData(j.buf2binstring(i.shrinkBuf(e.output,e.next_out))):this.onData(i.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||0===e.avail_out)&&c!==q);return d===o?(c=h.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===p):d!==r||(this.onEnd(p),e.avail_out=0,!0)},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=d,c.deflate=e,c.deflateRaw=f,c.gzip=g},{"./utils/common":62,"./utils/strings":63,"./zlib/deflate":67,"./zlib/messages":72,"./zlib/zstream":74}],61:[function(a,b,c){"use strict";function d(a){if(!(this instanceof d))return new d(a);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var c=g.inflateInit2(this.strm,b.windowBits);if(c!==j.Z_OK)throw new Error(k[c]);this.header=new m,g.inflateGetHeader(this.strm,this.header)}function e(a,b){var c=new d(b);if(c.push(a,!0),c.err)throw c.msg||k[c.err];return c.result}function f(a,b){return b=b||{},b.raw=!0,e(a,b)}var g=a("./zlib/inflate"),h=a("./utils/common"),i=a("./utils/strings"),j=a("./zlib/constants"),k=a("./zlib/messages"),l=a("./zlib/zstream"),m=a("./zlib/gzheader"),n=Object.prototype.toString;d.prototype.push=function(a,b){var c,d,e,f,k,l,m=this.strm,o=this.options.chunkSize,p=this.options.dictionary,q=!1;if(this.ended)return!1;d=b===~~b?b:b===!0?j.Z_FINISH:j.Z_NO_FLUSH,"string"==typeof a?m.input=i.binstring2buf(a):"[object ArrayBuffer]"===n.call(a)?m.input=new Uint8Array(a):m.input=a,m.next_in=0,m.avail_in=m.input.length;do{if(0===m.avail_out&&(m.output=new h.Buf8(o),m.next_out=0,m.avail_out=o),c=g.inflate(m,j.Z_NO_FLUSH),c===j.Z_NEED_DICT&&p&&(l="string"==typeof p?i.string2buf(p):"[object ArrayBuffer]"===n.call(p)?new Uint8Array(p):p,c=g.inflateSetDictionary(this.strm,l)),c===j.Z_BUF_ERROR&&q===!0&&(c=j.Z_OK,q=!1),c!==j.Z_STREAM_END&&c!==j.Z_OK)return this.onEnd(c),this.ended=!0,!1;m.next_out&&(0!==m.avail_out&&c!==j.Z_STREAM_END&&(0!==m.avail_in||d!==j.Z_FINISH&&d!==j.Z_SYNC_FLUSH)||("string"===this.options.to?(e=i.utf8border(m.output,m.next_out),f=m.next_out-e,k=i.buf2string(m.output,e),m.next_out=f,m.avail_out=o-f,f&&h.arraySet(m.output,m.output,e,f,0),this.onData(k)):this.onData(h.shrinkBuf(m.output,m.next_out)))),0===m.avail_in&&0===m.avail_out&&(q=!0)}while((m.avail_in>0||0===m.avail_out)&&c!==j.Z_STREAM_END);return c===j.Z_STREAM_END&&(d=j.Z_FINISH),d===j.Z_FINISH?(c=g.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===j.Z_OK):d!==j.Z_SYNC_FLUSH||(this.onEnd(j.Z_OK),m.avail_out=0,!0)},d.prototype.onData=function(a){this.chunks.push(a)},d.prototype.onEnd=function(a){a===j.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=d,c.inflate=e,c.inflateRaw=f,c.ungzip=e},{"./utils/common":62,"./utils/strings":63,"./zlib/constants":65,"./zlib/gzheader":68,"./zlib/inflate":70,"./zlib/messages":72,"./zlib/zstream":74}],62:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;f=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;f>>6,b[g++]=128|63&c):c<65536?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;c4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&c1?j[e++]=65533:f<65536?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return c<0?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":62}],64:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0; }b.exports=d},{}],65:[function(a,b,c){"use strict";b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],66:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=f,g=d+c;a^=-1;for(var h=d;h>>8^e[255&(a^b[h])];return a^-1}var f=d();b.exports=e},{}],67:[function(a,b,c){"use strict";function d(a,b){return a.msg=I[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(E.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){F._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,E.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=G(a.adler,b,e,c):2===a.state.wrap&&(a.adler=H(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-la?a.strstart-(a.w_size-la):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ka,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&fg){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-la)){E.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ja)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===J)return ua;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return ua;if(a.strstart-a.block_start>=a.w_size-la&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?ua:ua}function o(a,b){for(var c,d;;){if(a.lookahead=ja&&(a.ins_h=(a.ins_h<=ja)if(d=F._tr_tally(a,a.strstart-a.match_start,a.match_length-ja),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=ja){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<=ja&&(a.ins_h=(a.ins_h<4096)&&(a.match_length=ja-1)),a.prev_length>=ja&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ja,d=F._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ja),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<=ja&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ka;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&ea.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=ja?(c=F._tr_tally(a,1,a.match_length-ja),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===J)return ua;break}if(a.match_length=0,c=F._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return ua}return a.insert=0,b===M?(h(a,!0),0===a.strm.avail_out?wa:xa):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?ua:va}function s(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e}function t(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=D[a.level].max_lazy,a.good_match=D[a.level].good_length,a.nice_match=D[a.level].nice_length,a.max_chain_length=D[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=ja-1,a.match_available=0,a.ins_h=0}function u(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=$,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new E.Buf16(2*ha),this.dyn_dtree=new E.Buf16(2*(2*fa+1)),this.bl_tree=new E.Buf16(2*(2*ga+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E.Buf16(ia+1),this.heap=new E.Buf16(2*ea+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E.Buf16(2*ea+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=Z,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?na:sa,a.adler=2===b.wrap?0:1,b.last_flush=J,F._tr_init(b),O):d(a,Q)}function w(a){var b=v(a);return b===O&&t(a.state),b}function x(a,b){return a&&a.state?2!==a.state.wrap?Q:(a.state.gzhead=b,O):Q}function y(a,b,c,e,f,g){if(!a)return Q;var h=1;if(b===T&&(b=6),e<0?(h=0,e=-e):e>15&&(h=2,e-=16),f<1||f>_||c!==$||e<8||e>15||b<0||b>9||g<0||g>X)return d(a,Q);8===e&&(e=9);var i=new u;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<N||b<0)return a?d(a,Q):Q;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===ta&&b!==M)return d(a,0===a.avail_out?S:Q);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===na)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=V||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=H(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=oa):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=V||h.level<2?4:0),i(h,ya),h.status=sa);else{var m=$+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=V||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=ma),m+=31-m%31,h.status=sa,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===oa)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=pa)}else h.status=pa;if(h.status===pa)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=qa)}else h.status=qa;if(h.status===qa)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindexk&&(a.adler=H(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=ra)}else h.status=ra;if(h.status===ra&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=sa)):h.status=sa),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,O}else if(0===a.avail_in&&e(b)<=e(c)&&b!==M)return d(a,S);if(h.status===ta&&0!==a.avail_in)return d(a,S);if(0!==a.avail_in||0!==h.lookahead||b!==J&&h.status!==ta){var o=h.strategy===V?r(h,b):h.strategy===W?q(h,b):D[h.level].func(h,b);if(o!==wa&&o!==xa||(h.status=ta),o===ua||o===wa)return 0===a.avail_out&&(h.last_flush=-1),O;if(o===va&&(b===K?F._tr_align(h):b!==N&&(F._tr_stored_block(h,0,0,!1),b===L&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,O}return b!==M?O:h.wrap<=0?P:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?O:P)}function B(a){var b;return a&&a.state?(b=a.state.status,b!==na&&b!==oa&&b!==pa&&b!==qa&&b!==ra&&b!==sa&&b!==ta?d(a,Q):(a.state=null,b===sa?d(a,R):O)):Q}function C(a,b){var c,d,e,g,h,i,j,k,l=b.length;if(!a||!a.state)return Q;if(c=a.state,g=c.wrap,2===g||1===g&&c.status!==na||c.lookahead)return Q;for(1===g&&(a.adler=G(a.adler,b,l,0)),c.wrap=0,l>=c.w_size&&(0===g&&(f(c.head),c.strstart=0,c.block_start=0,c.insert=0),k=new E.Buf8(c.w_size),E.arraySet(k,b,l-c.w_size,c.w_size,0),b=k,l=c.w_size),h=a.avail_in,i=a.next_in,j=a.input,a.avail_in=l,a.next_in=0,a.input=b,m(c);c.lookahead>=ja;){d=c.strstart,e=c.lookahead-(ja-1);do c.ins_h=(c.ins_h<>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<>>=w,q-=w),q<15&&(p+=B[f++]<>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<k){a.msg="invalid distance too far back",c.mode=d;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&c.sane){a.msg="invalid distance too far back",c.mode=d;break a}if(z=0,A=o,0===n){if(z+=l-w,w2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(f>3,f-=x,q-=x<<3,p&=(1<>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=L,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new s.Buf32(pa),b.distcode=b.distdyn=new s.Buf32(qa),b.sane=1,b.back=-1,D):G}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):G}function h(a,b){var c,d;return a&&a.state?(d=a.state,b<0?(c=0,b=-b):(c=(b>>4)+1,b<48&&(b&=15)),b&&(b<8||b>15)?G:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):G}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==D&&(a.state=null),c):G}function j(a){return i(a,sa)}function k(a){if(ta){var b;for(q=new s.Buf32(512),r=new s.Buf32(32),b=0;b<144;)a.lens[b++]=8;for(;b<256;)a.lens[b++]=9;for(;b<280;)a.lens[b++]=7;for(;b<288;)a.lens[b++]=8;for(w(y,a.lens,0,288,q,0,a.work,{bits:9}),b=0;b<32;)a.lens[b++]=5;w(z,a.lens,0,32,r,0,a.work,{bits:5}),ta=!1}a.lencode=q,a.lenbits=9,a.distcode=r,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<=f.wsize?(s.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),s.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(s.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave>>8&255,c.check=u(c.check,Ba,2,0),m=0,n=0,c.mode=M;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=ma;break}if((15&m)!==K){a.msg="unknown compression method",c.mode=ma;break}if(m>>>=4,n-=4,wa=(15&m)+8,0===c.wbits)c.wbits=wa;else if(wa>c.wbits){a.msg="invalid window size",c.mode=ma;break}c.dmax=1<>8&1),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0,c.mode=N;case N:for(;n<32;){if(0===i)break a;i--,m+=e[g++]<>>8&255,Ba[2]=m>>>16&255,Ba[3]=m>>>24&255,c.check=u(c.check,Ba,4,0)),m=0,n=0,c.mode=O;case O:for(;n<16;){if(0===i)break a;i--,m+=e[g++]<>8),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0,c.mode=P;case P:if(1024&c.flags){for(;n<16;){if(0===i)break a;i--,m+=e[g++]<>>8&255,c.check=u(c.check,Ba,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=Q;case Q:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wa=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),s.arraySet(c.head.extra,e,g,q,wa)),512&c.flags&&(c.check=u(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=R;case R:if(2048&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.name+=String.fromCharCode(wa));while(wa&&q>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=W;break;case U:for(;n<32;){if(0===i)break a;i--,m+=e[g++]<>>=7&n,n-=7&n,c.mode=ja;break}for(;n<3;){if(0===i)break a;i--,m+=e[g++]<>>=1,n-=1,3&m){case 0:c.mode=Y;break;case 1:if(k(c),c.mode=ca,b===C){m>>>=2,n-=2;break a}break;case 2:c.mode=_;break;case 3:a.msg="invalid block type",c.mode=ma}m>>>=2,n-=2;break;case Y:for(m>>>=7&n,n-=7&n;n<32;){if(0===i)break a;i--,m+=e[g++]<>>16^65535)){a.msg="invalid stored block lengths",c.mode=ma;break}if(c.length=65535&m,m=0,n=0,c.mode=Z,b===C)break a;case Z:c.mode=$;case $:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;s.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=W;break;case _:for(;n<14;){if(0===i)break a;i--,m+=e[g++]<>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=ma;break}c.have=0,c.mode=aa;case aa:for(;c.have>>=3,n-=3}for(;c.have<19;)c.lens[Ca[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ya={bits:c.lenbits},xa=w(x,c.lens,0,19,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid code lengths set",c.mode=ma;break}c.have=0,c.mode=ba;case ba:for(;c.have>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<>>=qa,n-=qa,c.lens[c.have++]=sa;else{if(16===sa){for(za=qa+2;n>>=qa,n-=qa,0===c.have){a.msg="invalid bit length repeat",c.mode=ma;break}wa=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sa){for(za=qa+3;n>>=qa,n-=qa,wa=0,q=3+(7&m),m>>>=3,n-=3}else{for(za=qa+7;n>>=qa,n-=qa,wa=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=ma;break}for(;q--;)c.lens[c.have++]=wa}}if(c.mode===ma)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=ma;break}if(c.lenbits=9,ya={bits:c.lenbits},xa=w(y,c.lens,0,c.nlen,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid literal/lengths set",c.mode=ma;break}if(c.distbits=6,c.distcode=c.distdyn,ya={bits:c.distbits},xa=w(z,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ya),c.distbits=ya.bits,xa){a.msg="invalid distances set",c.mode=ma;break}if(c.mode=ca,b===C)break a;case ca:c.mode=da;case da:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,v(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===W&&(c.back=-1);break}for(c.back=0;Aa=c.lencode[m&(1<>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(ta+qa<=n);){if(0===i)break a;i--,m+=e[g++]<>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,c.length=sa,0===ra){c.mode=ia;break}if(32&ra){c.back=-1,c.mode=W;break}if(64&ra){a.msg="invalid literal/length code",c.mode=ma;break}c.extra=15&ra,c.mode=ea;case ea:if(c.extra){for(za=c.extra;n>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=fa;case fa:for(;Aa=c.distcode[m&(1<>>24,ra=Aa>>>16&255,sa=65535&Aa,!(qa<=n);){if(0===i)break a;i--,m+=e[g++]<>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(ta+qa<=n);){if(0===i)break a;i--,m+=e[g++]<>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,64&ra){a.msg="invalid distance code",c.mode=ma;break}c.offset=sa,c.extra=15&ra,c.mode=ga;case ga:if(c.extra){for(za=c.extra;n>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=ma;break}c.mode=ha;case ha:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=ma;break}q>c.wnext?(q-=c.wnext,r=c.wsize-q):r=c.wnext-q,q>c.length&&(q=c.length),pa=c.window}else pa=f,r=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pa[r++];while(--q);0===c.length&&(c.mode=da);break;case ia:if(0===j)break a;f[h++]=c.length,j--,c.mode=da;break;case ja:if(c.wrap){for(;n<32;){if(0===i)break a;i--,m|=e[g++]<=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;F0&&(a===h||1!==G))return-1;for(Q[1]=0,D=1;Df||a===j&&L>g)return 1;for(;;){z=D-J,r[E]y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[c+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<f||a===j&&L>g)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":62}],72:[function(a,b,c){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],73:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length}function f(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b}function g(a){return a<256?ia[a]:ia[256+(a>>>7)]}function h(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function i(a,b,c){a.bi_valid>X-c?(a.bi_buf|=b<>X-a.bi_valid,a.bi_valid+=c-X):(a.bi_buf|=b<>>=1,c<<=1;while(--b>0);return c>>>1}function l(a){16===a.bi_valid?(h(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function m(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;f<=W;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0, c=a.heap_max+1;co&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function n(a,b,c){var d,e,f=new Array(W+1),g=0;for(d=1;d<=W;d++)f[d]=g=g+c[d-1]<<1;for(e=0;e<=b;e++){var h=a[2*e+1];0!==h&&(a[2*e]=k(f[h]++,h))}}function o(){var a,b,c,d,f,g=new Array(W+1);for(c=0,d=0;d>=7;d8?h(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function r(a,b,c,d){q(a),d&&(h(a,c),h(a,~c)),G.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function s(a,b,c,d){var e=2*b,f=2*c;return a[e]>1;c>=1;c--)t(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],t(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,t(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],m(a,b),n(f,j,a.bl_count)}function w(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;d<=c;d++)e=g,g=b[2*(d+1)+1],++h=3&&0===a.bl_tree[2*ea[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function z(a,b,c,d){var e;for(i(a,b-257,5),i(a,c-1,5),i(a,d-4,4),e=0;e>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return I;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return J;for(b=32;b0?(a.strm.data_type===K&&(a.strm.data_type=A(a)),v(a,a.l_desc),v(a,a.d_desc),g=y(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,f<=e&&(e=f)):e=f=c+5,c+4<=e&&b!==-1?C(a,b,c,d):a.strategy===H||f===e?(i(a,(M<<1)+(d?1:0),3),u(a,ga,ha)):(i(a,(N<<1)+(d?1:0),3),z(a,a.l_desc.max_code+1,a.d_desc.max_code+1,g+1),u(a,a.dyn_ltree,a.dyn_dtree)),p(a),d&&q(a)}function F(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(ja[c]+R+1)]++,a.dyn_dtree[2*g(b)]++),a.last_lit===a.lit_bufsize-1}var G=a("../utils/common"),H=4,I=0,J=1,K=2,L=0,M=1,N=2,O=3,P=258,Q=29,R=256,S=R+1+Q,T=30,U=19,V=2*S+1,W=15,X=16,Y=7,Z=256,$=16,_=17,aa=18,ba=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ca=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],da=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa=512,ga=new Array(2*(S+2));d(ga);var ha=new Array(2*T);d(ha);var ia=new Array(fa);d(ia);var ja=new Array(P-O+1);d(ja);var ka=new Array(Q);d(ka);var la=new Array(T);d(la);var ma,na,oa,pa=!1;c._tr_init=B,c._tr_stored_block=C,c._tr_flush_block=E,c._tr_tally=F,c._tr_align=D},{"../utils/common":62}],74:[function(a,b,c){"use strict";function d(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=d},{}]},{},[10])(10)}); var saveAs = saveAs || (function(view) { "use strict"; // IE <10 is explicitly unsupported if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { return; } var doc = view.document // only get URL when necessary in case Blob.js hasn't overridden it yet , get_URL = function() { return view.URL || view.webkitURL || view; } , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") , can_use_save_link = "download" in save_link , click = function(node) { var event = new MouseEvent("click"); node.dispatchEvent(event); } , is_safari = /constructor/i.test(view.HTMLElement) || view.safari , is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent) , setImmediate = view.setImmediate || view.setTimeout , throw_outside = function(ex) { setImmediate(function() { throw ex; }, 0); } , force_saveable_type = "application/octet-stream" // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to , arbitrary_revoke_timeout = 1000 * 40 // in ms , revoke = function(file) { var revoker = function() { if (typeof file === "string") { // file is an object URL get_URL().revokeObjectURL(file); } else { // file is a File file.remove(); } }; setTimeout(revoker, arbitrary_revoke_timeout); } , dispatch = function(filesaver, event_types, event) { event_types = [].concat(event_types); var i = event_types.length; while (i--) { var listener = filesaver["on" + event_types[i]]; if (typeof listener === "function") { try { listener.call(filesaver, event || filesaver); } catch (ex) { throw_outside(ex); } } } } , auto_bom = function(blob) { // prepend BOM for UTF-8 XML and text/* types (including HTML) // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type}); } return blob; } , FileSaver = function(blob, name, no_auto_bom) { if (!no_auto_bom) { blob = auto_bom(blob); } // First try a.download, then web filesystem, then object URLs var filesaver = this , type = blob.type , force = type === force_saveable_type , object_url , dispatch_all = function() { dispatch(filesaver, "writestart progress write writeend".split(" ")); } // on any filesys errors revert to saving with object URLs , fs_error = function() { if ((is_chrome_ios || (force && is_safari)) && view.FileReader) { // Safari doesn't allow downloading of blob urls var reader = new FileReader(); reader.onloadend = function() { var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;'); var popup = view.open(url, '_blank'); if(!popup) view.location.href = url; url=undefined; // release reference before dispatching filesaver.readyState = filesaver.DONE; dispatch_all(); }; reader.readAsDataURL(blob); filesaver.readyState = filesaver.INIT; return; } // don't create more object URLs than needed if (!object_url) { object_url = get_URL().createObjectURL(blob); } if (force) { view.location.href = object_url; } else { var opened = view.open(object_url, "_blank"); if (!opened) { // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html view.location.href = object_url; } } filesaver.readyState = filesaver.DONE; dispatch_all(); revoke(object_url); } ; filesaver.readyState = filesaver.INIT; if (can_use_save_link) { object_url = get_URL().createObjectURL(blob); setImmediate(function() { save_link.href = object_url; save_link.download = name; click(save_link); dispatch_all(); revoke(object_url); filesaver.readyState = filesaver.DONE; }, 0); return; } fs_error(); } , FS_proto = FileSaver.prototype , saveAs = function(blob, name, no_auto_bom) { return new FileSaver(blob, name || blob.name || "download", no_auto_bom); } ; // IE 10+ (native saveAs) if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { return function(blob, name, no_auto_bom) { name = name || blob.name || "download"; if (!no_auto_bom) { blob = auto_bom(blob); } return navigator.msSaveOrOpenBlob(blob, name); }; } // todo: detect chrome extensions & packaged apps //save_link.target = "_blank"; FS_proto.abort = function(){}; FS_proto.readyState = FS_proto.INIT = 0; FS_proto.WRITING = 1; FS_proto.DONE = 2; FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null; return saveAs; }( typeof self !== "undefined" && self || typeof window !== "undefined" && window || this )); PK!8Z[??assets/js/pwaforwp-download.jsnu[(function(){ setTimeout(()=>{ document.addEventListener("click", function(event){ if(event.target.tagName === "A"){ var isdownlod = event.target.attributes["download"] ? "1" : "0"; if(isdownlod == 1){ event.preventDefault(); var url = event.target.attributes["href"].value; event.target.removeAttribute("href"); event.target.setAttribute("link",url); var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType = 'blob'; xhr.onload = function(e) { if (this.status == 200) { var myBlob = this.response; var link = document.createElement('a'); link.href = window.URL.createObjectURL(myBlob); link.download = url; link.click(); } }; xhr.send(); } } }) },1000) })()PK!(WMassets/js/pwaforwp-video.jsnu[(function(){ setTimeout(()=>{ if(window.matchMedia('(display-mode: standalone)').matches || window.matchMedia('(display-mode: fullscreen)').matches || window.matchMedia('(display-mode: minimal-ui)').matches) { if (!navigator.onLine) { var video = document.getElementsByTagName("video"); Array.from(video).forEach(function(elm){ console.log("Each Loop",elm); var src = elm.src; console.log(src); var ext = isVideo(src); if(ext==true){ elm.setAttribute("src",''); elm.parentElement.append('

MP4 video is not supported in service worker app

'); } }) } } function isVideo(filename) { var ext = getExtension(filename); switch (ext.toLowerCase()) { case 'mp4': return true; } return false; } function getExtension(filename) { var parts = filename.split('.'); return parts[parts.length - 1]; } },1000) })()PK!W޺assets/js/main-script.jsnu[function pwaforwpGetParamByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } jQuery(document).ready(function($){ jQuery(".pwaforwp-colorpicker").wpColorPicker(); // Color picker jQuery(".pwaforwp-fcm-push-icon-upload").click(function(e) { // Application Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-fcm-push-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-fcm-push-budge-icon-upload").click(function(e) { // Application Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-fcm-push-budge-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-icon-upload").click(function(e) { // Application Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-splash-icon-upload").click(function(e) { // Splash Screen Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.splash_uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-splash-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-tabs a").click(function(e){ e.preventDefault(); var href = jQuery(this).attr("href"); var currentTab = pwaforwpGetParamByName("tab",href); if(!currentTab){ currentTab = "dashboard"; } jQuery(this).siblings().removeClass("nav-tab-active"); jQuery(this).addClass("nav-tab-active"); if(currentTab=="premium_features" && jQuery(this).attr('data-extmgr')=='yes'){ window.location.href = "admin.php?page=pwawp-extension-manager"; }else{ jQuery(".form-wrap").find(".pwaforwp-"+currentTab).siblings().hide(); jQuery(".form-wrap .pwaforwp-"+currentTab).show(); window.history.pushState("", "", href); if(currentTab=='help' || currentTab=='features'){ jQuery('.pwaforwp-help').find("tr th:first").hide() jQuery('.pwaforwp-settings-form').find('p.submit').hide(); }else{ jQuery('.pwaforwp-settings-form').find('p.submit').show(); } return false; } }); var url = window.location.href; // Returns full URL var currentTab = pwaforwpGetParamByName("tab",url); if(currentTab=='help' || currentTab=='features'){ jQuery('.pwaforwp-help').find("tr th:first").hide() jQuery('.pwaforwp-settings-form').find('p.submit').hide(); } jQuery(".pwaforwp-activate-service").on("click", function(e){ jQuery(".pwaforwp-settings-form #submit").click(); jQuery(this).hide(); }); jQuery(".pwaforwp-service-activate").on("click", function(){ var filetype = jQuery(this).attr("data-id"); if(filetype){ jQuery.ajax({ url:ajaxurl, dataType: "json", data:{filetype:filetype, action:"pwaforwp_download_setup_files", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ if(response["status"]=="t"){ jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").hide(); jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").siblings(".dashicons").removeClass("dashicons-no-alt"); jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").siblings(".dashicons").addClass("dashicons-yes"); jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").siblings(".dashicons").css("color", "#46b450"); }else{ jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").parent().next().removeClass("pwaforwp-hide"); } } }); } return false; }); //Help Query jQuery(".pwa-send-query").on("click", function(e){ e.preventDefault(); var message = jQuery("#pwaforwp_query_message").val(); var customer = jQuery("#pwaforwp_query_customer").val(); if(jQuery.trim(message) !='' && customer){ jQuery.ajax({ type: "POST", url: ajaxurl, dataType: "json", data:{action:"pwaforwp_send_query_message", customer_type: customer, message:message, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ if(response['status'] =='t'){ jQuery(".pwa-query-success").show(); jQuery(".pwa-query-error").hide(); }else{ jQuery(".pwa-query-success").hide(); jQuery(".pwa-query-error").show(); } }, error: function(response){ console.log(response); } }); }else{ if(jQuery.trim(message) =='' && customer ==''){ alert('Please enter the message and select customer type'); }else{ if(customer ==''){ alert('Select Customer type'); } if(jQuery.trim(message) == ''){ alert('Please enter the message'); } } } }); jQuery(document).on("click",".pwaforwp-reset-settings", function(e){ e.preventDefault(); var reset_confirm = confirm("Are you sure?"); if(reset_confirm == true){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_reset_all_settings", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ setTimeout(function(){ location.reload(); }, 1000); }, error: function(response){ console.log(response); } }); } }); jQuery(".pwaforwp-manual-notification").on("click", function(e){ e.preventDefault(); var message = jQuery("#pwaforwp_notification_message").val(); var pn_title = jQuery("#pwaforwp_notification_message_title").val(); var pn_url = jQuery("#pwaforwp_notification_message_url").val(); var pn_image_url = jQuery("#pwaforwp_notification_message_image_url").val(); if(jQuery.trim(message) !=''){ jQuery.ajax({ type: "POST", url: ajaxurl, dataType: "json", data:{action:"pwaforwp_send_notification_manually", message:message, title:pn_title, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce,url:pn_url, image_url: pn_image_url}, success:function(response){ if(response['status'] =='t'){ var html = 'Success: '+response['success']+'
'; //html +='Failure: '+response['failure']+''; jQuery(".pwaforwp-notification-success").show(); jQuery(".pwaforwp-notification-success").html(html); jQuery(".pwaforwp-notification-error").hide(); }else{ jQuery(".pwaforwp-notification-success").hide(); jQuery(".pwaforwp-notification-error").show(); } }, error: function(response){ console.log(response); } }); }else{ alert('Please enter the message'); } }); jQuery("#pwaforwp_settings_utm_setting").click(function(){ if(jQuery(this).prop("checked")){ jQuery('.pwawp_utm_values_class').fadeIn(); }else{ jQuery('.pwawp_utm_values_class').fadeOut(200); } }); jQuery("#pwaforwp_settings_precaching_automatic").change(function(){ if(jQuery(this).prop("checked")){ jQuery("#pwaforwp_settings_precaching_post_count").parent().parent().fadeIn(); jQuery(".pwaforwp-pre-cache-table").parent().parent().fadeIn(); }else{ jQuery("#pwaforwp_settings_precaching_post_count").parent().parent().fadeOut(200); jQuery(".pwaforwp-pre-cache-table").parent().parent().fadeOut(200); } }).change(); jQuery("#pwaforwp_settings_precaching_manual").change(function(){ if(jQuery(this).prop("checked")){ jQuery("#pwaforwp_settings_precaching_urls").parent().parent().parent().fadeIn(); }else{ jQuery("#pwaforwp_settings_precaching_urls").parent().parent().parent().fadeOut(200);; } }).change(); jQuery(document).on("click", ".pwaforwp-update-pre-caching-urls", function(e){ e.preventDefault(); var current = jQuery(this); jQuery.ajax({ url:ajaxurl, dataType: "json", data:{action:"pwaforwp_update_pre_caching_urls", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ if(response["status"]=="t"){ current.parent().parent().hide(); }else{ alert('Something went wrong'); } } }); }) jQuery("#pwaforwp_precaching_method_selector").change(function(){ if(jQuery(this).val() === 'automatic'){ jQuery('.pwaforwp_precaching_table tr').eq(1).fadeIn(); jQuery('.pwaforwp_precaching_table tr').eq(2).fadeOut(200); }else{ jQuery('.pwaforwp_precaching_table tr').eq(1).fadeOut(200); jQuery('.pwaforwp_precaching_table tr').eq(2).fadeIn(); } }); jQuery(".pwaforwp-add-to-home-banner-settings").click(function(){ if(jQuery(this).prop("checked")){ jQuery('.pwaforwp-enable-on-desktop').removeClass('afw_hide'); }else{ jQuery('.pwaforwp-enable-on-desktop').addClass('afw_hide'); jQuery('#enable_add_to_home_desktop_setting').prop('checked', false); // Checks it } }); jQuery(".pwaforwp-onesignal-support").click(function(){ if(jQuery(this).prop("checked")){ jQuery('.pwaforwp-onesignal-instruction').fadeIn(); }else{ jQuery('.pwaforwp-onesignal-instruction').fadeOut(200); } }); jQuery('.pwawp_utm_values_class').find('input').focusout(function(){ if(jQuery(this).attr('data-val')!==jQuery(this).val()){ jQuery("#pwa-utm_change_track").val('1'); } }); jQuery(".pwaforwp-fcm-checkbox").click(function(){ if(jQuery(this).prop("checked")){ jQuery(this).parent().find('p').removeClass('pwaforwp-hide'); }else{ jQuery(this).parent().find('p').addClass('pwaforwp-hide'); } }); jQuery('.pwaforwp-checkbox-tracker').change(function(e){ var respectiveId = jQuery(this).attr('data-id'); var chval = 0; if(jQuery(this).is(":checked")){ chval = jQuery(this).val(); } console.log(jQuery(this).parent('label').find('#'+respectiveId), chval); jQuery(this).parent('label').find('input[name="'+respectiveId+'"]').val(chval); }) //Licensing jquery starts here jQuery(document).on("click",".pwaforwp_license_activation", function(e){ e.preventDefault(); var current = jQuery(this); current.addClass('updating-message'); var license_status = jQuery(this).attr('license-status'); var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ jQuery(".saswp-"+add_on+"-dashicons").addClass('dashicons-yes'); jQuery(".saswp-"+add_on+"-dashicons").removeClass('dashicons-no-alt'); jQuery(".saswp-"+add_on+"-dashicons").css("color", "green"); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").attr("license-status", "inactive"); jQuery("span.addon-inactive_" + add_on + "").text('Active'); jQuery("span.addon-inactive_" + add_on + "").css("color", "green"); jQuery("span.addon-inactive_" + add_on + "").removeClass("addon-inactive_" + add_on + "").addClass("addon-activated_" + add_on + ""); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").text("Deactivate"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").text('Activated'); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").css("color", "green"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").text(response['message']); } else if(response['status'] =='expired'){ jQuery(".addon-inactive_" + add_on + "").text('Expired'); jQuery(".addon-inactive_" + add_on + "").css("color","red"); }else{ var invalid_lic = response.message; if ( invalid_lic == 'Invalid license.') { jQuery(".addon-inactive_" + add_on + "").text('Invalid'); jQuery(".addon-inactive_" + add_on + "").css("color","red"); } jQuery(".saswp-"+add_on+"-dashicons").addClass('dashicons-no-alt'); jQuery(".saswp-"+add_on+"-dashicons").removeClass('dashicons-yes'); jQuery(".saswp-"+add_on+"-dashicons").css("color", "red"); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").attr("license-status", "active"); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").text("Activate"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").css("color", "red"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").text(response['message']); jQuery("span.addon-activated_" + add_on + "").text('Inactive'); jQuery("span.addon-activated_" + add_on + "").css("color", "#bebfc0"); jQuery("span.addon-activated_" + add_on + "").removeClass("addon-activated_" + add_on + "").addClass("addon-inactive_" + add_on + ""); } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }); }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } }); // Start Usermanual Check jQuery(document).on("click","#user_refresh-", function(e){ e.preventDefault(); var current = jQuery(this); document.getElementById("user_refresh").classList.add("spin") var license_status = 'active'; var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ var days_remaining = response['days_remaining']; if (days_remaining>7) { jQuery("span.addon-activated_" + add_on + "").text('Active'); jQuery("span.addon-activated_" + add_on + "").css("color", "green"); jQuery("span.lessthan_0").text('License is'); jQuery("span.lessthan_0").css("color", "black"); jQuery("span.expiredinner_span").text('Active'); jQuery("span.expiredinner_span").css("color", "green"); jQuery("span.before_msg_active").text('Your license is'); jQuery("span.pwaforwp_addon_icon").css("display", "none"); jQuery(".renewal-license").css("display", "none"); } document.getElementById("user_refresh").classList.remove("spin") }else{ console.log('Failedd'); document.getElementById("user_refresh").classList.remove("spin") } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }) }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } }); // End Usermanual Check // Start Single Addon check function PWAforwpreadCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(";"); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==" ") c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } jQuery(document).on("click",".user_refresh_single_addon", function(e){ var currentThis = jQuery(this); e.preventDefault(); var license_status = 'active'; var add_on = currentThis.attr('add-on'); var remaining_days_org = currentThis.attr('remaining_days_org'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); document.getElementById("user_refresh_" + add_on + "").classList.add("spin") var today = new Date(); var previous_check = PWAforwpreadCookie('pwaforwp_addon_refresh_check'); previous_check = new Date(previous_check); console.log('previous_check '+previous_check+ " true"); var diffDays = -1; if( typeof previous_check != undefined){ var diffTime = Math.abs(today.getTime() - previous_check.getTime()); var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); } var expireDate = new Date(remaining_days_org); var diffTime = Math.abs( expireDate.getTime()-today.getTime() ); var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); if( diffDays==-1 || diffDays>1 || expireDays<1 ){ document.cookie = "pwaforwp_addon_refresh_check="+today;jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); document.getElementById("user_refresh_"+add_on+"").classList.remove("spin") currentThis.removeClass('updating-message'); }, error: function(response){ console.log(response); } }) } else{ setTimeout( function() { jQuery(".dashicons").removeClass( 'spin' );}, 0 ); previous_check = Math.abs(previous_check.getDate()+1)+'/'+Math.abs(previous_check.getMonth()+1) +'/'+previous_check.getFullYear()+' '+previous_check.getHours()+':'+previous_check.getMinutes()+':'+previous_check.getSeconds(); alert('Please try after '+ previous_check); } }); // End Single Addon check // Start Auto Check when expired setTimeout(function() { jQuery("#refresh_expired_addon-").trigger('click'); }, 1000) jQuery(document).on("click","#refresh_expired_addon-", function(e){ e.preventDefault(); var current = jQuery(this); document.getElementById("refresh_expired_addon").classList.add("spin") var license_status = 'active'; var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ var days_remaining = response['days_remaining']; if (days_remaining>0) { jQuery("span.addon-activated_" + add_on + "").text('Active'); jQuery("span.addon-activated_" + add_on + "").css("color", "green"); jQuery("span.lessthan_0").text('License is'); jQuery("span.lessthan_0").css("color", "black"); jQuery("span.expiredinner_span").text('Active'); jQuery("span.expiredinner_span").css("color", "green"); jQuery("span.pwaforwp_addon_icon").css("display", "none"); jQuery("span.dashicons-warning").css("display", "none"); jQuery(".renewal-license").css("display", "none"); } document.getElementById("refresh_expired_addon").classList.remove("spin") }else{ console.log('Failedd'); } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }), jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_transient",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success: function(s) { JSON.parse(s) } }) }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } });// End Auto Check when expired // Start Auto-check if user had done renewal between 0-7 days setTimeout(function() { jQuery("#auto_refresh-").trigger('click'); }, 1000) jQuery(document).on("click","#auto_refresh-", function(e){ var days_remaining = document.getElementById('activated-plugins-days_remaining'); var days_remaining_value = days_remaining.getAttribute('days_remaining'); if ( days_remaining_value >= 0 && days_remaining_value <= 7 ) { e.preventDefault(); var current = jQuery(this); document.getElementById("auto_refresh").classList.add("spin") var license_status = 'active'; var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ var days_remaining = response['days_remaining']; if (days_remaining>7) { jQuery("span.zero_to_seven").text('License is'); jQuery("span.zero_to_seven").css("color", "black"); jQuery("span.pwaforwp-addon-alert").css("color", "green"); jQuery("span.pwaforwp-addon-alert").text('Active'); jQuery(".renewal-license").css("display", "none"); } document.getElementById("auto_refresh").classList.remove("spin") }else{ console.log('Failedd'); } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }), jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_transient_zto7",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success: function(s) { JSON.parse(s) } }) }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } } }); // Auto-check End //Licensing jquery ends here jQuery('.pwaforwp-sub-tab-headings span').click(function(){ var tabId = jQuery(this).attr('data-tab-id'); jQuery(this).parents('.pwaforwp-subheading-wrap').find('.pwaforwp-subheading').find('div.selected').removeClass('selected').addClass('pwaforwp-hide'); jQuery(this).parents('.pwaforwp-subheading-wrap').find('.pwaforwp-subheading').find('#'+tabId).removeClass('pwaforwp-hide').addClass('selected'); //tab head jQuery(this).parent('.pwaforwp-sub-tab-headings').find('span.selected').removeClass('selected'); jQuery(this).addClass('selected'); }); jQuery(".pwaforwp-checkbox").click(function(){ var data_id = jQuery(this).attr('data-id'); console.log(data_id); if(jQuery(this).prop("checked")){ jQuery('.pwaforwp_'+data_id).removeClass('pwaforwp-hide'); }else{ jQuery('.pwaforwp_'+data_id).addClass('pwaforwp-hide'); } }); //ios splash screen start jQuery(".switch_apple_splash_screen").click(function(){ if(jQuery(this).is(':checked')){ jQuery('.ios-splash-images').show(); }else{ jQuery('.ios-splash-images').hide(); } }); jQuery(".pwaforwp-ios-splash-icon-upload").click(function(e) { // Splash Screen Icon upload e.preventDefault(); var self = jQuery(this); var splash_uploader_title = self.parent('.ios-splash-images-field').find('label').text(); var pwaforwpMediaUploader = wp.media({ title: splash_uploader_title, button: { text: 'Select image' }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); self.parent('.ios-splash-images-field').find(".pwaforwp-splash-icon").val(attachment.url); }) .open(); }); //ios splash screen End jQuery('.pwaforwp-change-data').click(function(e){ e.preventDefault(); if(!jQuery(this).parents('.card-action').find('label').find('input[type="checkbox"]').prop('checked')){ return false; } var opt = jQuery(this).attr('data-option'); var optTitle = jQuery(this).attr('title'); pwaforwp_showpopup(optTitle, opt, '.pwaforwp-submit-feature-opt'); //tb_show(optTitle, "#TB_inline?width=740&height=450&inlineId="+opt); datafeatureSubmit(opt); }); jQuery('.card-action input[type="checkbox"]').change(function(){ var value = 0; if(jQuery(this).is(':checked')){ jQuery(this).parents('.card-action').find('.card-action-settings').css({opacity: 1}) var value = 1; //jQuery(this).parents('.card-action').find('.pwaforwp-change-data').click(); }else{ jQuery(this).parents('.card-action').find('.card-action-settings').css({opacity: 0}); } fields = []; var name = jQuery(this).attr('name'); pwaforwp_dependent_features_section(name, value); fields.push({var_name: name, var_value: value}); pwaforwp_ajaxcall_submitdata(pwaforwp_obj, fields); }) /** * Push notification options selection */ jQuery(document).on("change", ".pwaforwp-pn-service", function(){ var self = jQuery(this); var currentSelected = self.val(); pushnotificationIntegrationLogic('notification-contents'); switch(currentSelected){ case 'pushnotifications_io': jQuery('.pwaforwp-push-notificatoin-table').hide(); jQuery('.pwaforwp-notification-condition-section').hide(); jQuery('.pwaforwp-pn-recommended-options').show(); //self.parents('.pwaforwp-wrap').find('.footer').hide(); break; case 'fcm_push': jQuery('.pwaforwp-push-notificatoin-table').show(); jQuery('.pwaforwp-notification-condition-section').show(); jQuery('.pwaforwp-pn-recommended-options').hide(); //self.parents('.pwaforwp-wrap').find('.footer').show(); break; default: jQuery('.pwaforwp-push-notificatoin-table').hide(); jQuery('.pwaforwp-notification-condition-section').hide(); jQuery('.pwaforwp-pn-recommended-options').hide(); break } jQuery('.notification-wrap-tb').find('.footer button').trigger('click') }); jQuery('.pwaforwp-install-require-plugin').on("click", function(e){ e.preventDefault(); /*var result = confirm("This required a free plugin to install in your WordPress"); if (!result) { }*/ var self = jQuery(this); self.html('Installing..').addClass('updating-message'); var nonce = self.attr('data-secure'); var activate_url = self.attr('data-activate-url'); var currentId = self.attr('id'); var activate = ''; if (currentId == 'pushnotification') { activate = '&activate=pushnotification'; } console.log(wp.updates); jQuery.ajax({ url: ajaxurl, type: 'post', data: 'action=pwafowp_enable_modules_upgread' + activate + '&verify_nonce=' + nonce, dataType: 'json', success: function (response) { if (response.status == 200) { if (self.hasClass('not-exist')) { //To installation wp.updates.installPlugin( { slug: response.slug, success: function (pluginresponse) { console.log(pluginresponse.activateUrl); pwaforwp_Activate_Modules_Upgrade(pluginresponse.activateUrl, self, response, nonce) } } ); } else { var activateUrl = self.attr('data-activate-url'); pwaforwp_Activate_Modules_Upgrade(activateUrl, self, response, nonce) } } else { alert(response.message) } } }); }); jQuery("#ios-splash-color").wpColorPicker(); //Activate pro plugin jQuery(".pwa_activate_pro_plugin").click(function(){ var self = jQuery(this); if(self.prop("checked")==true){ var nonce = self.attr('data-secure'); var data_file = self.attr('data-file'); jQuery.ajax({ url: ajaxurl,type: 'post',data: 'action=pwafowp_enable_modules_active&target_file=' + data_file + '&verify_nonce=' + nonce, dataType: 'json', success: function (response) { if (response.status == 200) { pwaforwp_show_message_toast("success", response.message); location.reload(); }else{ pwaforwp_show_message_toast("error", response.message); self.prop("checked", false); } } }); } }); }); var pushnotificationIntegrationLogic = function(opt){ if(opt==='notification-contents'){ var optNotif = jQuery('.pwaforwp-pn-service').val() if(optNotif==='' || optNotif==='pushnotifications_io'){ jQuery('.notification-wrap-tb').find('.footer').hide() }else{ jQuery('.notification-wrap-tb').find('.footer').show() } } } var datafeatureSubmit = function(opt){ pushnotificationIntegrationLogic(opt) jQuery('.pwaforwp-submit-feature-opt').click(function(e){ e.preventDefault(); var self = jQuery(this); var fields = []; self.parents('.thickbox-fetures-wrap') .find('input').each( function(k,v){ var type = jQuery(this).attr('type').toLowerCase(); var name = jQuery(this).attr('name');//.replace(/pwaforwp_settings\[/,'').replace(/\]/, ''); if(type=='checkbox'){ if(jQuery(this).is(':checked')){ var value = jQuery(this).val(); }else{ var value = (jQuery(this).attr('data-uncheck-val')) ? jQuery(this).attr('data-uncheck-val') : 0; } if(name){ pwaforwp_dependent_features_section(name, value) fields.push({var_name: name, var_value: value}); } } if(type=='radio'){ if(jQuery(this).is(':checked')){ var value = jQuery(this).val(); }else{ var value = (jQuery(this).attr('data-uncheck-val')) ? jQuery(this).attr('data-uncheck-val') : 0; } if(name){ fields.push({var_name: name, var_value: value}); } } if(type!='checkbox' && type!='radio' ){ var value = jQuery(this).val(); if(name){ fields.push({var_name: name, var_value: value}); } } }); self.parents('.thickbox-fetures-wrap') .find('textarea').each( function(k,v){ var name = jQuery(this).attr('name'); var value = jQuery(this).val(); if(name){ fields.push({var_name: name, var_value: value}); } }) self.parents('.thickbox-fetures-wrap') .find('select').each( function(k,v){ var name = jQuery(this).attr('name'); var value = jQuery(this).val(); if(name){ fields.push({var_name: name, var_value: value}); /*only for push notificatio opt*/ if( name==='pwaforwp_settings[notification_options]' ){ if(value!==''){ jQuery('#notification-opt-stat').hide(); }else{ jQuery('#notification-opt-stat').show(); } } } }) pwaforwp_ajaxcall_submitdata(pwaforwp_obj, fields) }); } function pwaforwp_ajaxcall_submitdata(pwaforwp_security_nonce, fields){ if(!staticAjaxCalled){ var staticAjaxCalled = true; } if(staticAjaxCalled){ var data = {action:"pwaforwp_update_features_options", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce,fields_data: fields}; jQuery.ajax({ url:ajaxurl, method:'post', dataType: "json", data:data, success:function(response){ staticAjaxCalled = false; if(response["status"]==200){ pwaforwp_show_message_toast('success', response.message); }else{ pwaforwp_show_message_toast('error', response.message); } } }); } } function pwaforwp_show_message_toast(type, message){ var classes = "pwaforwp-toast-error" if(type=='success'){ classes="pwaforwp-toast-success" } if(jQuery('.pwaforwp-toast-wrap').length){ jQuery('.pwaforwp-toast-wrap').remove(); } var messageDiv = '
'+message+'×
'; jQuery('body').append(messageDiv); setTimeout(function(){ jQuery('.pwaforwp-toast-wrap').remove(); }, 3000); jQuery('.close-pwaforwp-toast-single').click(function(){ jQuery(this).parents('.pwaforwp-toast-wrap').remove(); }) } var pwaforwp_dependent_features_section = function(fieldname, fieldValue){ switch(fieldname){ case 'pwaforwp_settings[precaching_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[precaching_automatic]"]').trigger('click'); jQuery('input[name="pwaforwp_settings[precaching_automatic_post]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[precaching_automatic]"]').trigger('click'); jQuery('input[name="pwaforwp_settings[precaching_automatic_post]"]').trigger('click'); } break; case 'pwaforwp_settings[precaching_automatic]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[precaching_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[precaching_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[precaching_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; case 'pwaforwp_settings[addtohomebanner_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[custom_add_to_home_setting]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[custom_add_to_home_setting]"]').trigger('click'); } break; case 'pwaforwp_settings[custom_add_to_home_setting]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[addtohomebanner_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[addtohomebanner_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[addtohomebanner_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; case 'pwaforwp_settings[loader_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[loading_icon]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[loading_icon]"]').trigger('click'); } break; case 'pwaforwp_settings[loading_icon]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[loader_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[loader_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[loader_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; case 'pwaforwp_settings[utmtracking_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[utm_setting]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[utm_setting]"]').trigger('click'); } break; case 'pwaforwp_settings[utm_setting]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[utmtracking_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[utmtracking_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[utmtracking_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; } } var pwaforwp_Activate_Modules_Upgrade = function(url, self, response, nonce){ if (typeof url === 'undefined' || !url) { return; } console.log( 'Activating...' ); self.html('Activating...'); jQuery.ajax( { async: true, type: 'GET', //data: dataString, url: url, success: function () { var msgplug = ''; if(self.attr('id')=='pushnotification'){ msgplug = 'push notification'; console.log("push notification Activated"); self.removeClass('updating-message') self.removeClass("button") self.removeClass('pwaforwp-install-require-plugin') self.unbind('click'); self.html('View Settings'); } }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status === 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status === 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } console.log(msg); }, } ); } var pwaforwp_showpopup = function(caption, inlineId, submitClass){ if(caption===null){caption="";} jQuery(".pwawp-modal-mask").find(".pwawp-popup-title").html(caption); jQuery(".pwawp-modal-mask").find(".pwawp-modal-settings").append(jQuery('#' + inlineId).children()); //to show poup jQuery(".pwawp-modal-mask").attr("data-parent", inlineId); jQuery(".pwawp-modal-mask").attr("data-parent-submit", submitClass); jQuery(".pwawp-modal-mask").find(submitClass).addClass("pwaforwp-hide"); jQuery(".pwawp-modal-mask").removeClass("pwaforwp-hide"); //Click on cross button jQuery(".pwawp-modal-mask").find(".pwawp-media-modal-close, .pwawp-close-btn-modal").click(function(){ var inlineIdData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent"); var submitClassData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent-submit"); jQuery('#' + inlineIdData).append( jQuery(".pwawp-modal-mask").find(".pwawp-modal-settings").children() ); jQuery(".pwawp-modal-mask").addClass("pwaforwp-hide"); }); //click on save button jQuery(".pwawp-modal-mask").find(".pwawp-save-btn-modal").click(function(e){ e.preventDefault(); var inlineIdData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent"); var submitClassData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent-submit"); jQuery(".pwawp-modal-mask").find(submitClassData).click(); }); } //iosSplashIcon var optSelection=document.getElementById('ios-splash-gen-opt'); optSelection.addEventListener('change', onpwaiosOptSelection,false); if(typeof Event=='function'){ var event = new Event('change'); optSelection.dispatchEvent(event); }else{ onpwaiosOptSelection(optSelection); } function onpwaiosOptSelection(e){ if(e.target){ var selected = e.target.value }else{ var selected = e.value; } if(selected==""){ document.getElementById('generate-auto-1').setAttribute("class", "panel pwaforwp-hide"); document.getElementById('manually-1').setAttribute("class", "panel pwaforwp-hide"); return; } if(selected=='generate-auto'){ document.getElementById(selected+'-1').setAttribute("class", "panel"); document.getElementById('manually-1').setAttribute("class", "panel pwaforwp-hide"); }else{ document.getElementById(selected+'-1').setAttribute("class", "panel"); document.getElementById('generate-auto-1').setAttribute("class", "panel pwaforwp-hide"); } } var image=''; document.addEventListener('DOMContentLoaded',function(){ var elmFileUpload=document.getElementById('file-upload-ios'); if(elmFileUpload){ elmFileUpload.addEventListener('change',onFileUploadChange,false); } }); function onFileUploadChange(e){ var file=e.target.files[0]; var fr=new FileReader(); fr.onload=onFileReaderLoad; fr.readAsDataURL(file); } function onFileReaderLoad(e){ image=e.target.result; document.getElementById('thumbnail').src=e.target.result; //console.log(image); }; function pwa_getimageZip(e){ e.disabled = true; if(image==''){alert("Please Select Image");return;} var imageMessage = document.getElementById("pwa-ios-splashmessage") imageMessage.innerHTML = 'Generating splash screen...'; imageMessage.setAttribute("class", "updating-message"); var zip=new JSZip(); var folder=zip.folder('splashscreens'); var canvas=document.createElement('canvas'),ctx=canvas.getContext('2d'); var img=new Image(); img.src=image; Object.keys(pwaforwp_obj.iosSplashIcon).forEach(function(key, index) { var phone = pwaforwp_obj.iosSplashIcon[key]; var ws=key.split("x")[0]; var hs=key.split("x")[1]; canvas.width=ws; canvas.height=hs; var wi=img.width; var hi=img.height; var wnew=wi; var hnew=hi; ctx.fillStyle = document.getElementById('ios-splash-color').value; ctx.fillRect(0,0,canvas.width,canvas.height); ctx.drawImage(img,(ws-wnew)/2,(hs-hnew)/2,wnew,hnew); var img2=canvas.toDataURL(); folder.file(phone.file,img2.split(';base64,')[1],{base64:true}); }); zip.generateAsync({type:'blob'}).then(function(content){ //saveAs(content,'splashscreens.zip'); var request = new XMLHttpRequest(); request.open("POST", ajaxurl+"?action=pwaforwp_splashscreen_uploader&pwaforwp_security_nonce="+pwaforwp_obj.pwaforwp_security_nonce); request.send(content); request.onreadystatechange = function() { if (request.readyState === 4) { var reponse = JSON.parse(request.response); if(reponse.status==200){ imageMessage.innerHTML = 'Splash Screen generated'; imageMessage.setAttribute("class", "dashicons dashicons-yes"); imageMessage.style.color = "#46b450"; setTimeout(function(){ window.location.reload(); }, 1000); } } } }); e.disabled = false; } var accordion = document.getElementsByClassName("accordion"); var i; for (i = 0; i < accordion.length; i++) { accordion[i].addEventListener("click", function() { this.classList.toggle("active"); var panel = this.nextElementSibling; if (panel.style.maxHeight) { panel.style.maxHeight = null; } else { panel.style.maxHeight = panel.scrollHeight + "px"; } }); }PK!assets/js/pwaforwp.jsnu[/** * For loaders */ // alert("Hi"); var showLoader = false; if(pwaforwp_is_mobile() && pwaforwp_js_obj.loader_mobile=="1"){ showLoader = true; }else if(pwaforwp_js_obj.loader_desktop=="1"){ showLoader = true; } if(pwaforwp_js_obj.loader_only_pwa=="1"){ showLoader = false; if ( window.matchMedia('(display-mode: standalone)').matches || window.matchMedia('(display-mode: fullscreen)').matches || window.matchMedia('(display-mode: minimal-ui)').matches) { showLoader = true; } } if(showLoader){ window.addEventListener("beforeunload", function(){ if(document.getElementsByClassName('pwaforwp-loading-wrapper') && typeof document.getElementsByClassName('pwaforwp-loading-wrapper')[0]!=='undefined'){ document.getElementsByClassName('pwaforwp-loading-wrapper')[0].style.display = "flex"; } if(document.getElementById('pwaforwp_loading_div')){ document.getElementById('pwaforwp_loading_div').style.display = "flex"; } if(document.getElementById('pwaforwp_loading_icon')){ document.getElementById('pwaforwp_loading_icon').style.display = "flex"; } setInterval(function(){ if(document.getElementsByClassName('pwaforwp-loading-wrapper') && document.getElementsByClassName('pwaforwp-loading-wrapper').length > 0){ var tot = document.getElementsByClassName('pwaforwp-loading-wrapper'); for (var i = 0; i < tot.length; i++) { tot[i].style.display = "none"; } } if(document.getElementById('pwaforwp_loading_div')){ document.getElementById('pwaforwp_loading_div').style.display = "none"; } if(document.getElementById('pwaforwp_loading_icon')){ document.getElementById('pwaforwp_loading_icon').style.display = "none"; } }, 1000, true); }); if(document.getElementsByClassName('pwaforwp-loading-wrapper') && typeof document.getElementsByClassName('pwaforwp-loading-wrapper')[0]!=='undefined'){ document.getElementsByClassName('pwaforwp-loading-wrapper')[0].style.display = "none"; } if(document.getElementById('pwaforwp_loading_div')){ document.getElementById('pwaforwp_loading_div').style.display = "none"; } if(document.getElementById('pwaforwp_loading_icon')){ document.getElementById('pwaforwp_loading_icon').style.display = "none"; } }else{ document.getElementById('pwaforwp_loading_div').style.display = "none"; if(document.getElementsByClassName('pwaforwp-loading-wrapper') && typeof document.getElementsByClassName('pwaforwp-loading-wrapper')[0]!=='undefined'){ document.getElementsByClassName('pwaforwp-loading-wrapper')[0].style.display = "none"; } } jQuery(document).ready(function($){ /** * For loaders */ var showLoader = false; if(pwaforwp_is_mobile() && pwaforwp_js_obj.loader_mobile=="1"){ showLoader = true; }else if(pwaforwp_js_obj.loader_desktop=="1"){ showLoader = true; } if(showLoader){ var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; if (isSafari && iOS) { jQuery('#pwaforwp_loading_div').show(); jQuery('#pwaforwp_loading_icon').show(); jQuery('.pwaforwp-loading-wrapper').show(); setInterval(function(){ jQuery('#pwaforwp_loading_div').hide(); jQuery('#pwaforwp_loading_icon').hide(); jQuery('.pwaforwp-loading-wrapper').hide();}, 1000, true); }else{ jQuery('#pwaforwp_loading_div').hide(); jQuery('#pwaforwp_loading_icon').hide(); jQuery('.pwaforwp-loading-wrapper').hide(); jQuery(window).on('beforeunload', function() { jQuery('#pwaforwp_loading_div').show(); jQuery('#pwaforwp_loading_icon').show(); jQuery('.pwaforwp-loading-wrapper').show(); }); } }else{ jQuery('#pwaforwp_loading_div').hide(); jQuery('#pwaforwp_loading_icon').hide(); jQuery('.pwaforwp-loading-wrapper').hide(); } /* * For Add to home screen Popup * Start */ jQuery(".pwaforwp_add_home_close").on("click", function(){ document.cookie = "pwaforwp_prompt_close="+new Date(); jQuery(this).parent().hide(); }); if(jQuery('.pwaforwp-add-via-class').is(':hidden')){ jQuery(".pwaforwp-sticky-banner").hide(); }else{ jQuery(".pwaforwp-sticky-banner").show(); } }); function pwaforwp_is_mobile(){ var isMobile = false; //initiate as false // device detection if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) { isMobile = true; } return isMobile; }PK!I&assets/js/wp-color-picker-alpha.min.jsnu[/**! * wp-color-picker-alpha * * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker * Only run in input and is defined data alpha in true * * Version: 3.0.0 * https://github.com/kallookoo/wp-color-picker-alpha * Licensed under the GPLv2 license or later. */ !function(e,a){var l,o={version:300};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var t=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(t)&&o.version<=t)return}Color.fn.hasOwnProperty("to_s")||(Color.fn.to_s=function(o){"hex"===(o=o||"hex")&&this._alpha<1&&(o="rgba");var a="";return"hex"===o?a=this.toString():this.error||(a=this.toCSS(o).replace(/\(\s+/,"(").replace(/\s+\)/,")")),a},window.wpColorPickerAlpha=o,l="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(o){return o===a&&(o=this._color),this.alphaOptions.alphaEnabled?(o=o.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(o=o.replace(/\s+/g,"")),o):o.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(o){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(i){function o(o){var a=i.val(),t=new Color(a),a=a.replace(/^(#|(rgb|hsl)a?)/,""),r=l.alphaOptions.alphaColorType;i.removeClass("iris-error"),t.error?""!==a&&i.addClass("iris-error"):"hex"===r&&"keyup"===o.type&&a.match(/^[0-9a-fA-F]{3}$/)||t.toIEOctoHex()!==l._color.toIEOctoHex()&&l._setOption("color",l._getColor(t))}var l=this;i.on("change",o).on("keyup",l._debounce(o,100)),l.options.hide&&i.one("focus",function(){l.show()})},_initControls:function(){var t,o,a,r;this._super(),this.alphaOptions.alphaEnabled&&(a=(o=(t=this).controls.strip.clone(!1,!1)).find(".iris-slider-offset"),r={stripAlpha:o,stripAlphaSlider:a},o.addClass("iris-strip-alpha"),a.addClass("iris-slider-offset-alpha"),o.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,function(o,a){t.controls[o]=a}),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,a){t.active="strip",t._color._alpha=parseFloat(a.value/100),t._change.apply(t,arguments)}}))},_dimensions:function(o){if(this._super(o),this.alphaOptions.alphaEnabled){for(var a=this,t=a.options,r=a.controls.square,o=a.picker.find(".iris-strip"),i=Math.round(a.picker.outerWidth(!0)-(t.border?22:0)),l=Math.round(r.outerWidth()),e=Math.round((i-l)/2),s=Math.round(e/2),n=Math.round(l+2*e+2*s);i'):t.toggler.append(''),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":r.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),r.iris({change:function(o,a){t.colorAlpha.css({"background-color":a.color.to_s(t.alphaOptions.alphaColorType)}),e.isFunction(t.options.change)&&t.options.change.call(this,o,a)}}),t.wrap.on("click.wpcolorpicker",function(o){o.stopPropagation()}),t.toggler.click(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()}),r.change(function(o){var a=e(this).val();(r.hasClass("iris-error")||""===a||a.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o))}),t.button.click(function(o){e(this).hasClass("wp-picker-default")?r.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(r.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o),r.trigger("change"))})}}))}(jQuery);PK!:J'; content += ''; content += ''; content += ''; content += ''; content += '
'; content += ''; content += ''; content += '
'; content += ''; content += ''; content += ''; content += ''; content += ''; var setup; var wp_pointers_tour_opts = { content:content, position:{ edge:"top", align:"left" } }; wp_pointers_tour_opts = jQuery.extend (wp_pointers_tour_opts, { buttons: function (event, t) { button= jQuery ('' + pwaforwp_obj.button1 + ''); button_2= jQuery ('#pointer-close.button'); button.bind ('click.pointer', function () { t.element.pointer ('close'); }); button_2.on('click', function() { t.element.pointer ('close'); } ); return button; }, close: function () { jQuery.post (pwaforwp_obj.ajax_url, { pointer: 'pwaforwp_subscribe_pointer', action: 'dismiss-wp-pointer' }); }, show: function(event, t){ t.pointer.css({'left':'170px', 'top':'160px'}); } }); setup = function () { jQuery(pwaforwp_obj.displayID).pointer(wp_pointers_tour_opts).pointer('open'); if (pwaforwp_obj.button2) { jQuery ('#pointer-close').after ('' + pwaforwp_obj.button2+ ''); jQuery ('#pointer-primary').click (function () { pwaforwp_obj.function_name; }); jQuery ('#pointer-close').click (function () { jQuery.post (pwaforwp_obj.ajax_url, { pointer: 'pwaforwp_subscribe_pointer', action: 'dismiss-wp-pointer' }); }); } }; if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) { jQuery(window).bind('load.wp-pointers', setup); } else { setup (); } } /* Newletters js ends here */ /*Newsletter submission*/ jQuery("#pwaforwp-subscribe-newsletter-form").on('submit',function(e){ e.preventDefault(); var form = jQuery(this); var name = form.find('input[name="name"]').val(); var email = form.find('input[name="email"]').val(); var website = form.find('input[name="company"]').val(); jQuery.post(pwaforwp_obj.ajax_url, {action:'pwaforwp_subscribe_newsletter',name:name, email:email,website:website}, function(data) { jQuery.post (pwaforwp_obj.ajax_url, { pointer: 'pwaforwp_subscribe_pointer', action: 'dismiss-wp-pointer' }, function(){ location.reload(); }); } ); }); });PK!ֈuassets/js/main-script.min.jsnu[function pwaforwpGetParamByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } jQuery(document).ready(function($){ jQuery(".pwaforwp-colorpicker").wpColorPicker(); // Color picker jQuery(".pwaforwp-fcm-push-icon-upload").click(function(e) { // Application Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-fcm-push-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-fcm-push-budge-icon-upload").click(function(e) { // Application Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-fcm-push-budge-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-icon-upload").click(function(e) { // Application Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-screenshots-upload").click(function(e) { // Application screenshots upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-screenshots").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-splash-icon-upload").click(function(e) { // Splash Screen Icon upload e.preventDefault(); var pwaforwpMediaUploader = wp.media({ title: pwaforwp_obj.splash_uploader_title, button: { text: pwaforwp_obj.uploader_button }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); jQuery(".pwaforwp-splash-icon").val(attachment.url); }) .open(); }); jQuery(".pwaforwp-tabs a").click(function(e){ e.preventDefault(); var href = jQuery(this).attr("href"); var currentTab = pwaforwpGetParamByName("tab",href); if(!currentTab){ currentTab = "dashboard"; } jQuery(this).siblings().removeClass("nav-tab-active"); jQuery(this).addClass("nav-tab-active"); if(currentTab=="premium_features" && jQuery(this).attr('data-extmgr')=='yes'){ window.location.href = "admin.php?page=pwawp-extension-manager"; }else{ jQuery(".form-wrap").find(".pwaforwp-"+currentTab).siblings().hide(); jQuery(".form-wrap .pwaforwp-"+currentTab).show(); window.history.pushState("", "", href); if(currentTab=='help' || currentTab=='features'){ jQuery('.pwaforwp-help').find("tr th:first").hide() jQuery('.pwaforwp-settings-form').find('p.submit').hide(); }else{ jQuery('.pwaforwp-settings-form').find('p.submit').show(); } return false; } }); var url = window.location.href; // Returns full URL var currentTab = pwaforwpGetParamByName("tab",url); if(currentTab=='help' || currentTab=='features'){ jQuery('.pwaforwp-help').find("tr th:first").hide() jQuery('.pwaforwp-settings-form').find('p.submit').hide(); } jQuery(".pwaforwp-activate-service").on("click", function(e){ jQuery(".pwaforwp-settings-form #submit").click(); jQuery(this).hide(); }); jQuery(".pwaforwp-service-activate").on("click", function(){ var filetype = jQuery(this).attr("data-id"); if(filetype){ jQuery.ajax({ url:ajaxurl, dataType: "json", data:{filetype:filetype, action:"pwaforwp_download_setup_files", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ if(response["status"]=="t"){ jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").hide(); jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").siblings(".dashicons").removeClass("dashicons-no-alt"); jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").siblings(".dashicons").addClass("dashicons-yes"); jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").siblings(".dashicons").css("color", "#46b450"); }else{ jQuery(".pwaforwp-service-activate[data-id="+filetype+"]").parent().next().removeClass("pwaforwp-hide"); } } }); } return false; }); //Help Query jQuery(".pwa-send-query").on("click", function(e){ e.preventDefault(); var message = jQuery("#pwaforwp_query_message").val(); var customer = jQuery("#pwaforwp_query_customer").val(); if(jQuery.trim(message) !='' && customer){ jQuery.ajax({ type: "POST", url: ajaxurl, dataType: "json", data:{action:"pwaforwp_send_query_message", customer_type: customer, message:message, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ if(response['status'] =='t'){ jQuery(".pwa-query-success").show(); jQuery(".pwa-query-error").hide(); }else{ jQuery(".pwa-query-success").hide(); jQuery(".pwa-query-error").show(); } }, error: function(response){ console.log(response); } }); }else{ if(jQuery.trim(message) =='' && customer ==''){ alert('Please enter the message and select customer type'); }else{ if(customer ==''){ alert('Select Customer type'); } if(jQuery.trim(message) == ''){ alert('Please enter the message'); } } } }); jQuery(document).on("click",".pwaforwp-reset-settings", function(e){ e.preventDefault(); var reset_confirm = confirm("Are you sure?"); if(reset_confirm == true){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_reset_all_settings", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ setTimeout(function(){ location.reload(); }, 1000); }, error: function(response){ console.log(response); } }); } }); jQuery(".pwaforwp-manual-notification").on("click", function(e){ e.preventDefault(); var message = jQuery("#pwaforwp_notification_message").val(); var pn_title = jQuery("#pwaforwp_notification_message_title").val(); var pn_url = jQuery("#pwaforwp_notification_message_url").val(); var pn_image_url = jQuery("#pwaforwp_notification_message_image_url").val(); if(jQuery.trim(message) !=''){ jQuery.ajax({ type: "POST", url: ajaxurl, dataType: "json", data:{action:"pwaforwp_send_notification_manually", message:message, title:pn_title, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce,url:pn_url, image_url: pn_image_url}, success:function(response){ if(response['status'] =='t'){ var html = 'Success: '+response['success']+'
'; //html +='Failure: '+response['failure']+''; jQuery(".pwaforwp-notification-success").show(); jQuery(".pwaforwp-notification-success").html(html); jQuery(".pwaforwp-notification-error").hide(); }else{ jQuery(".pwaforwp-notification-success").hide(); jQuery(".pwaforwp-notification-error").show(); } }, error: function(response){ console.log(response); } }); }else{ alert('Please enter the message'); } }); jQuery("#pwaforwp_settings_utm_setting").click(function(){ if(jQuery(this).prop("checked")){ jQuery('.pwawp_utm_values_class').fadeIn(); }else{ jQuery('.pwawp_utm_values_class').fadeOut(200); } }); jQuery("#pwaforwp_settings_precaching_automatic").change(function(){ if(jQuery(this).prop("checked")){ jQuery("#pwaforwp_settings_precaching_post_count").parent().parent().fadeIn(); jQuery(".pwaforwp-pre-cache-table").parent().parent().fadeIn(); }else{ jQuery("#pwaforwp_settings_precaching_post_count").parent().parent().fadeOut(200); jQuery(".pwaforwp-pre-cache-table").parent().parent().fadeOut(200); } }).change(); jQuery("#pwaforwp_settings_precaching_manual").change(function(){ if(jQuery(this).prop("checked")){ jQuery("#pwaforwp_settings_precaching_urls").parent().parent().parent().fadeIn(); }else{ jQuery("#pwaforwp_settings_precaching_urls").parent().parent().parent().fadeOut(200);; } }).change(); jQuery(document).on("click", ".pwaforwp-update-pre-caching-urls", function(e){ e.preventDefault(); var current = jQuery(this); jQuery.ajax({ url:ajaxurl, dataType: "json", data:{action:"pwaforwp_update_pre_caching_urls", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ if(response["status"]=="t"){ current.parent().parent().hide(); }else{ alert('Something went wrong'); } } }); }) jQuery("#pwaforwp_precaching_method_selector").change(function(){ if(jQuery(this).val() === 'automatic'){ jQuery('.pwaforwp_precaching_table tr').eq(1).fadeIn(); jQuery('.pwaforwp_precaching_table tr').eq(2).fadeOut(200); }else{ jQuery('.pwaforwp_precaching_table tr').eq(1).fadeOut(200); jQuery('.pwaforwp_precaching_table tr').eq(2).fadeIn(); } }); jQuery(".pwaforwp-add-to-home-banner-settings").click(function(){ if(jQuery(this).prop("checked")){ jQuery('.pwaforwp-enable-on-desktop').removeClass('afw_hide'); }else{ jQuery('.pwaforwp-enable-on-desktop').addClass('afw_hide'); jQuery('#enable_add_to_home_desktop_setting').prop('checked', false); // Checks it } }); jQuery(".pwaforwp-onesignal-support").click(function(){ if(jQuery(this).prop("checked")){ jQuery('.pwaforwp-onesignal-instruction').fadeIn(); }else{ jQuery('.pwaforwp-onesignal-instruction').fadeOut(200); } }); jQuery('.pwawp_utm_values_class').find('input').focusout(function(){ if(jQuery(this).attr('data-val')!==jQuery(this).val()){ jQuery("#pwa-utm_change_track").val('1'); } }); jQuery(".pwaforwp-fcm-checkbox").click(function(){ if(jQuery(this).prop("checked")){ jQuery(this).parent().find('p').removeClass('pwaforwp-hide'); }else{ jQuery(this).parent().find('p').addClass('pwaforwp-hide'); } }); jQuery('.pwaforwp-checkbox-tracker').change(function(e){ var respectiveId = jQuery(this).attr('data-id'); var chval = 0; if(jQuery(this).is(":checked")){ chval = jQuery(this).val(); } console.log(jQuery(this).parent('label').find('#'+respectiveId), chval); jQuery(this).parent('label').find('input[name="'+respectiveId+'"]').val(chval); }) //Licensing jquery starts here jQuery(document).on("click",".pwaforwp_license_activation", function(e){ e.preventDefault(); var current = jQuery(this); current.addClass('updating-message'); var license_status = jQuery(this).attr('license-status'); var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ jQuery(".saswp-"+add_on+"-dashicons").addClass('dashicons-yes'); jQuery(".saswp-"+add_on+"-dashicons").removeClass('dashicons-no-alt'); jQuery(".saswp-"+add_on+"-dashicons").css("color", "green"); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").attr("license-status", "inactive"); jQuery("span.addon-inactive_" + add_on + "").text('Active'); jQuery("span.addon-inactive_" + add_on + "").css("color", "green"); jQuery("span.addon-inactive_" + add_on + "").removeClass("addon-inactive_" + add_on + "").addClass("addon-activated_" + add_on + ""); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").text("Deactivate"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").text('Activated'); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").css("color", "green"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").text(response['message']); } else if(response['status'] =='expired'){ jQuery(".addon-inactive_" + add_on + "").text('Expired'); jQuery(".addon-inactive_" + add_on + "").css("color","red"); }else{ var invalid_lic = response.message; if ( invalid_lic == 'Invalid license.') { jQuery(".addon-inactive_" + add_on + "").text('Invalid'); jQuery(".addon-inactive_" + add_on + "").css("color","red"); } jQuery(".saswp-"+add_on+"-dashicons").addClass('dashicons-no-alt'); jQuery(".saswp-"+add_on+"-dashicons").removeClass('dashicons-yes'); jQuery(".saswp-"+add_on+"-dashicons").css("color", "red"); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").attr("license-status", "active"); jQuery(".pwaforwp_license_activation[add-on='" + add_on + "']").text("Activate"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").css("color", "red"); jQuery(".pwaforwp_license_status_msg[add-on='" + add_on + "']").text(response['message']); jQuery("span.addon-activated_" + add_on + "").text('Inactive'); jQuery("span.addon-activated_" + add_on + "").css("color", "#bebfc0"); jQuery("span.addon-activated_" + add_on + "").removeClass("addon-activated_" + add_on + "").addClass("addon-inactive_" + add_on + ""); } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }); } else{ alert('Please enter value license key'); current.removeClass('updating-message'); } }); // Start Usermanual Check jQuery(document).on("click","#user_refresh-", function(e){ e.preventDefault(); var current = jQuery(this); document.getElementById("user_refresh").classList.add("spin") var license_status = 'active'; var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ var days_remaining = response['days_remaining']; if (days_remaining>7) { jQuery("span.addon-activated_" + add_on + "").text('Active'); jQuery("span.addon-activated_" + add_on + "").css("color", "green"); jQuery("span.lessthan_0").text('License is'); jQuery("span.lessthan_0").css("color", "black"); jQuery("span.expiredinner_span").text('Active'); jQuery("span.expiredinner_span").css("color", "green"); jQuery("span.before_msg_active").text('Your license is'); jQuery("span.pwaforwp_addon_icon").css("display", "none"); jQuery(".renewal-license").css("display", "none"); } document.getElementById("user_refresh").classList.remove("spin") }else{ console.log('Failed'); document.getElementById("user_refresh").classList.remove("spin") } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }) }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } }); // End Usermanual Check // Start Single Addon check function PWAforwpreadCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(";"); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==" ") c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } jQuery(document).on("click",".user_refresh_single_addon", function(e){ var currentThis = jQuery(this); e.preventDefault(); var license_status = 'active'; var add_on = currentThis.attr('add-on'); var remaining_days_org = currentThis.attr('remaining_days_org'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); document.getElementById("user_refresh_" + add_on + "").classList.add("spin") var today = new Date(); var previous_check = PWAforwpreadCookie('pwaforwp_addon_refresh_check'); previous_check = new Date(previous_check); console.log('previous_check '+previous_check+ " true"); var diffDays = -1; if( typeof previous_check != undefined){ var diffTime = Math.abs(today.getTime() - previous_check.getTime()); var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); } var expireDate = new Date(remaining_days_org); var diffTime = Math.abs( expireDate.getTime()-today.getTime() ); var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); if( diffDays==-1 || diffDays>1 || expireDays<1 ){ document.cookie = "pwaforwp_addon_refresh_check="+today;jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); document.getElementById("user_refresh_"+add_on+"").classList.remove("spin") currentThis.removeClass('updating-message'); }, error: function(response){ console.log(response); } }) } else{ setTimeout( function() { jQuery(".dashicons").removeClass( 'spin' );}, 0 ); previous_check = Math.abs(previous_check.getDate()+1)+'/'+Math.abs(previous_check.getMonth()+1) +'/'+previous_check.getFullYear()+' '+previous_check.getHours()+':'+previous_check.getMinutes()+':'+previous_check.getSeconds(); alert('Please try after '+ previous_check); } }); // End Single Addon check // Start Auto Check when expired setTimeout(function() { jQuery("#refresh_expired_addon-").trigger('click'); }, 1000) jQuery(document).on("click","#refresh_expired_addon-", function(e){ e.preventDefault(); var current = jQuery(this); document.getElementById("refresh_expired_addon").classList.add("spin") var license_status = 'active'; var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ var days_remaining = response['days_remaining']; if (days_remaining>0) { jQuery("span.addon-activated_" + add_on + "").text('Active'); jQuery("span.addon-activated_" + add_on + "").css("color", "green"); jQuery("span.lessthan_0").text('License is'); jQuery("span.lessthan_0").css("color", "black"); jQuery("span.expiredinner_span").text('Active'); jQuery("span.expiredinner_span").css("color", "green"); jQuery("span.pwaforwp_addon_icon").css("display", "none"); jQuery("span.dashicons-warning").css("display", "none"); jQuery(".renewal-license").css("display", "none"); } document.getElementById("refresh_expired_addon").classList.remove("spin") }else{ console.log('Failedd'); } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }), jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_transient",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success: function(s) { JSON.parse(s) } }) }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } });// End Auto Check when expired // Start Auto-check if user had done renewal between 0-7 days setTimeout(function() { jQuery("#auto_refresh-").trigger('click'); }, 1000) jQuery(document).on("click","#auto_refresh-", function(e){ var days_remaining = document.getElementById('activated-plugins-days_remaining'); var days_remaining_value = days_remaining.getAttribute('days_remaining'); if ( days_remaining_value >= 0 && days_remaining_value <= 7 ) { e.preventDefault(); var current = jQuery(this); document.getElementById("auto_refresh").classList.add("spin") var license_status = 'active'; var add_on = jQuery(this).attr('add-on'); var license_key = jQuery("#"+add_on+"_addon_license_key").val(); if(license_status && add_on && license_key){ jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success:function(response){ jQuery("#"+add_on+"_addon_license_key_status").val(response['status']); if(response['status'] =='active'){ var days_remaining = response['days_remaining']; if (days_remaining>7) { jQuery("span.zero_to_seven").text('License is'); jQuery("span.zero_to_seven").css("color", "black"); jQuery("span.pwaforwp-addon-alert").css("color", "green"); jQuery("span.pwaforwp-addon-alert").text('Active'); jQuery(".renewal-license").css("display", "none"); } document.getElementById("auto_refresh").classList.remove("spin") }else{ console.log('Failedd'); } current.removeClass('updating-message'); }, error: function(response){ console.log(response); } }), jQuery.ajax({ type: "POST", url:ajaxurl, dataType: "json", data:{action:"pwaforwp_license_transient_zto7",license_key:license_key,license_status:license_status, add_on:add_on, pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce}, success: function(s) { JSON.parse(s) } }) }else{ alert('Please enter value license key'); current.removeClass('updating-message'); } } }); // Auto-check End //Licensing jquery ends here jQuery('.pwaforwp-sub-tab-headings span').click(function(){ var tabId = jQuery(this).attr('data-tab-id'); jQuery(this).parents('.pwaforwp-subheading-wrap').find('.pwaforwp-subheading').find('div.selected').removeClass('selected').addClass('pwaforwp-hide'); jQuery(this).parents('.pwaforwp-subheading-wrap').find('.pwaforwp-subheading').find('#'+tabId).removeClass('pwaforwp-hide').addClass('selected'); //tab head jQuery(this).parent('.pwaforwp-sub-tab-headings').find('span.selected').removeClass('selected'); jQuery(this).addClass('selected'); }); jQuery(".pwaforwp-checkbox").click(function(){ var data_id = jQuery(this).attr('data-id'); console.log(data_id); if(jQuery(this).prop("checked")){ jQuery('.pwaforwp_'+data_id).removeClass('pwaforwp-hide'); }else{ jQuery('.pwaforwp_'+data_id).addClass('pwaforwp-hide'); } }); //ios splash screen start jQuery(".switch_apple_splash_screen").click(function(){ if(jQuery(this).is(':checked')){ jQuery('.ios-splash-images').show(); }else{ jQuery('.ios-splash-images').hide(); } }); jQuery(".pwaforwp-ios-splash-icon-upload").click(function(e) { // Splash Screen Icon upload e.preventDefault(); var self = jQuery(this); var splash_uploader_title = self.parent('.ios-splash-images-field').find('label').text(); var pwaforwpMediaUploader = wp.media({ title: splash_uploader_title, button: { text: 'Select image' }, multiple: false, // Set this to true to allow multiple files to be selected library:{type : 'image'} }) .on("select", function() { var attachment = pwaforwpMediaUploader.state().get("selection").first().toJSON(); self.parent('.ios-splash-images-field').find(".pwaforwp-splash-icon").val(attachment.url); }) .open(); }); //ios splash screen End jQuery('.pwaforwp-change-data').click(function(e){ e.preventDefault(); if(!jQuery(this).parents('.card-action').find('label').find('input[type="checkbox"]').prop('checked')){ return false; } var opt = jQuery(this).attr('data-option'); var optTitle = jQuery(this).attr('title'); pwaforwp_showpopup(optTitle, opt, '.pwaforwp-submit-feature-opt'); //tb_show(optTitle, "#TB_inline?width=740&height=450&inlineId="+opt); datafeatureSubmit(opt); }); jQuery('.card-action input[type="checkbox"]').change(function(){ var value = 0; if(jQuery(this).is(':checked')){ jQuery(this).parents('.card-action').find('.card-action-settings').css({opacity: 1}) var value = 1; //jQuery(this).parents('.card-action').find('.pwaforwp-change-data').click(); }else{ jQuery(this).parents('.card-action').find('.card-action-settings').css({opacity: 0}); } fields = []; var name = jQuery(this).attr('name'); pwaforwp_dependent_features_section(name, value); fields.push({var_name: name, var_value: value}); pwaforwp_ajaxcall_submitdata(pwaforwp_obj, fields); }) /** * Push notification options selection */ jQuery(document).on("change", ".pwaforwp-pn-service", function(){ var self = jQuery(this); var currentSelected = self.val(); pushnotificationIntegrationLogic('notification-contents'); switch(currentSelected){ case 'pushnotifications_io': jQuery('.pwaforwp-push-notificatoin-table').hide(); jQuery('.pwaforwp-notification-condition-section').hide(); jQuery('.pwaforwp-pn-recommended-options').show(); //self.parents('.pwaforwp-wrap').find('.footer').hide(); break; case 'fcm_push': jQuery('.pwaforwp-push-notificatoin-table').show(); jQuery('.pwaforwp-notification-condition-section').show(); jQuery('.pwaforwp-pn-recommended-options').hide(); //self.parents('.pwaforwp-wrap').find('.footer').show(); break; default: jQuery('.pwaforwp-push-notificatoin-table').hide(); jQuery('.pwaforwp-notification-condition-section').hide(); jQuery('.pwaforwp-pn-recommended-options').hide(); break } jQuery('.notification-wrap-tb').find('.footer button').trigger('click') }); jQuery('.pwaforwp-install-require-plugin').on("click", function(e){ e.preventDefault(); /*var result = confirm("This required a free plugin to install in your WordPress"); if (!result) { }*/ var self = jQuery(this); self.html('Installing..').addClass('updating-message'); var nonce = self.attr('data-secure'); var activate_url = self.attr('data-activate-url'); var currentId = self.attr('id'); var activate = ''; if (currentId == 'pushnotification') { activate = '&activate=pushnotification'; } console.log(wp.updates); jQuery.ajax({ url: ajaxurl, type: 'post', data: 'action=pwafowp_enable_modules_upgread' + activate + '&verify_nonce=' + nonce, dataType: 'json', success: function (response) { if (response.status == 200) { if (self.hasClass('not-exist')) { //To installation wp.updates.installPlugin( { slug: response.slug, success: function (pluginresponse) { console.log(pluginresponse.activateUrl); pwaforwp_Activate_Modules_Upgrade(pluginresponse.activateUrl, self, response, nonce) } } ); } else { var activateUrl = self.attr('data-activate-url'); pwaforwp_Activate_Modules_Upgrade(activateUrl, self, response, nonce) } } else { alert(response.message) } } }); }); jQuery("#ios-splash-color").wpColorPicker(); //Activate pro plugin jQuery(".pwa_activate_pro_plugin").click(function(){ var selfp = jQuery(this); if(selfp.prop("checked")==true){ var nonce = selfp.attr('data-secure'); var data_file = selfp.attr('data-file'); jQuery.ajax({ url: ajaxurl,type: 'post',data: 'action=pwafowp_enable_modules_active&target_file=' + data_file + '&verify_nonce=' + nonce, dataType: 'json', success: function (response) { if (response.status == 200) { pwaforwp_show_message_toast("success", response.message); location.reload(); }else{ pwaforwp_show_message_toast("error", response.message); selfp.prop("checked", false); } } }); } }); jQuery("#pwaforwp_settings_offline_page").on("change", function(e){ var selfp = jQuery(this); if(selfp.val()=='other'){ selfp.parent("label").find(".pwaforwp-sub-tab-headings").show(); }else{ selfp.parent("label").find(".pwaforwp-sub-tab-headings").hide(); } }); }); var pushnotificationIntegrationLogic = function(opt){ if(opt==='notification-contents'){ var optNotif = jQuery('.pwaforwp-pn-service').val() if(optNotif==='' || optNotif==='pushnotifications_io'){ jQuery('.notification-wrap-tb').find('.footer').hide() }else{ jQuery('.notification-wrap-tb').find('.footer').show() } } } var datafeatureSubmit = function(opt){ pushnotificationIntegrationLogic(opt) jQuery('.pwaforwp-submit-feature-opt').click(function(e){ e.preventDefault(); var self = jQuery(this); var fields = []; self.parents('.thickbox-fetures-wrap') .find('input').each( function(k,v){ var type = jQuery(this).attr('type').toLowerCase(); var name = jQuery(this).attr('name');//.replace(/pwaforwp_settings\[/,'').replace(/\]/, ''); if(type=='checkbox'){ if(jQuery(this).is(':checked')){ var value = jQuery(this).val(); }else{ var value = (jQuery(this).attr('data-uncheck-val')) ? jQuery(this).attr('data-uncheck-val') : 0; } if(name){ pwaforwp_dependent_features_section(name, value) fields.push({var_name: name, var_value: value}); } } if(type=='radio'){ if(jQuery(this).is(':checked')){ var value = jQuery(this).val(); }else{ var value = (jQuery(this).attr('data-uncheck-val')) ? jQuery(this).attr('data-uncheck-val') : 0; } if(name){ fields.push({var_name: name, var_value: value}); } } if(type!='checkbox' && type!='radio' ){ var value = jQuery(this).val(); if(name){ fields.push({var_name: name, var_value: value}); } } }); self.parents('.thickbox-fetures-wrap') .find('textarea').each( function(k,v){ var name = jQuery(this).attr('name'); var value = jQuery(this).val(); if(name){ fields.push({var_name: name, var_value: value}); } }) self.parents('.thickbox-fetures-wrap') .find('select').each( function(k,v){ var name = jQuery(this).attr('name'); var value = jQuery(this).val(); if(name){ fields.push({var_name: name, var_value: value}); /*only for push notificatio opt*/ if( name==='pwaforwp_settings[notification_options]' ){ if(value!==''){ jQuery('#notification-opt-stat').hide(); }else{ jQuery('#notification-opt-stat').show(); } } } }) pwaforwp_ajaxcall_submitdata(pwaforwp_obj, fields) }); } function pwaforwp_ajaxcall_submitdata(pwaforwp_security_nonce, fields){ if(!staticAjaxCalled){ var staticAjaxCalled = true; } if(staticAjaxCalled){ var data = {action:"pwaforwp_update_features_options", pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce,fields_data: fields}; jQuery.ajax({ url:ajaxurl, method:'post', dataType: "json", data:data, success:function(response){ staticAjaxCalled = false; if(response["status"]==200){ pwaforwp_show_message_toast('success', response.message); }else{ pwaforwp_show_message_toast('error', response.message); } } }); } } function pwaforwp_show_message_toast(type, message){ var classes = "pwaforwp-toast-error" if(type=='success'){ classes="pwaforwp-toast-success" } if(jQuery('.pwaforwp-toast-wrap').length){ jQuery('.pwaforwp-toast-wrap').remove(); } var messageDiv = '
'+message+'×
'; jQuery('body').append(messageDiv); setTimeout(function(){ jQuery('.pwaforwp-toast-wrap').remove(); }, 3000); jQuery('.close-pwaforwp-toast-single').click(function(){ jQuery(this).parents('.pwaforwp-toast-wrap').remove(); }) } var pwaforwp_dependent_features_section = function(fieldname, fieldValue){ switch(fieldname){ case 'pwaforwp_settings[precaching_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[precaching_automatic]"]').trigger('click'); jQuery('input[name="pwaforwp_settings[precaching_automatic_post]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[precaching_automatic]"]').trigger('click'); jQuery('input[name="pwaforwp_settings[precaching_automatic_post]"]').trigger('click'); } break; case 'pwaforwp_settings[precaching_automatic]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[precaching_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[precaching_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[precaching_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; case 'pwaforwp_settings[addtohomebanner_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[custom_add_to_home_setting]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[custom_add_to_home_setting]"]').trigger('click'); } break; case 'pwaforwp_settings[custom_add_to_home_setting]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[addtohomebanner_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[addtohomebanner_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[addtohomebanner_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; case 'pwaforwp_settings[loader_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[loading_icon]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[loading_icon]"]').trigger('click'); } break; case 'pwaforwp_settings[loading_icon]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[loader_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[loader_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[loader_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; case 'pwaforwp_settings[utmtracking_feature]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[utm_setting]"]').trigger('click'); }else{ jQuery('input[name="pwaforwp_settings[utm_setting]"]').trigger('click'); } break; case 'pwaforwp_settings[utm_setting]': if(fieldValue==1){ jQuery('input[name="pwaforwp_settings[utmtracking_feature]"]').prop('checked', true); }else{ jQuery('input[name="pwaforwp_settings[utmtracking_feature]"]').prop('checked', false); jQuery('input[name="pwaforwp_settings[utmtracking_feature]"]').parents('.card-action').find('.card-action-settings').css({opacity: 0}); } break; } } var pwaforwp_Activate_Modules_Upgrade = function(url, self, response, nonce){ if (typeof url === 'undefined' || !url) { return; } console.log( 'Activating...' ); self.html('Activating...'); jQuery.ajax( { async: true, type: 'GET', //data: dataString, url: url, success: function () { var msgplug = ''; if(self.attr('id')=='pushnotification'){ msgplug = 'push notification'; console.log("push notification Activated"); self.removeClass('updating-message') self.removeClass("button") self.removeClass('pwaforwp-install-require-plugin') self.unbind('click'); self.html('View Settings'); } }, error: function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status === 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status === 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } console.log(msg); }, } ); } var pwaforwp_showpopup = function(caption, inlineId, submitClass){ if(caption===null){caption="";} jQuery(".pwawp-modal-mask").find(".pwawp-popup-title").html(caption); jQuery(".pwawp-modal-mask").find(".pwawp-modal-settings").append(jQuery('#' + inlineId).children()); //to show poup jQuery(".pwawp-modal-mask").attr("data-parent", inlineId); jQuery(".pwawp-modal-mask").attr("data-parent-submit", submitClass); jQuery(".pwawp-modal-mask").find(submitClass).addClass("pwaforwp-hide"); jQuery(".pwawp-modal-mask").removeClass("pwaforwp-hide"); //Click on cross button jQuery(".pwawp-modal-mask").find(".pwawp-media-modal-close, .pwawp-close-btn-modal").click(function(){ var inlineIdData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent"); var submitClassData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent-submit"); jQuery('#' + inlineIdData).append( jQuery(".pwawp-modal-mask").find(".pwawp-modal-settings").children() ); jQuery(".pwawp-modal-mask").addClass("pwaforwp-hide"); }); //click on save button jQuery(".pwawp-modal-mask").find(".pwawp-save-btn-modal").click(function(e){ e.preventDefault(); var inlineIdData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent"); var submitClassData = jQuery(this).parents(".pwawp-modal-mask").attr("data-parent-submit"); jQuery(".pwawp-modal-mask").find(submitClassData).click(); }); } //iosSplashIcon var optSelection=document.getElementById('ios-splash-gen-opt'); optSelection.addEventListener('change', onpwaiosOptSelection,false); if(typeof Event=='function'){ var event = new Event('change'); optSelection.dispatchEvent(event); }else{ onpwaiosOptSelection(optSelection); } function onpwaiosOptSelection(e){ if(e.target){ var selected = e.target.value }else{ var selected = e.value; } if(selected==""){ document.getElementById('generate-auto-1').setAttribute("class", "panel pwaforwp-hide"); document.getElementById('manually-1').setAttribute("class", "panel pwaforwp-hide"); return; } if(selected=='generate-auto'){ document.getElementById(selected+'-1').setAttribute("class", "panel"); document.getElementById('manually-1').setAttribute("class", "panel pwaforwp-hide"); }else{ document.getElementById(selected+'-1').setAttribute("class", "panel"); document.getElementById('generate-auto-1').setAttribute("class", "panel pwaforwp-hide"); } } var image=''; document.addEventListener('DOMContentLoaded',function(){ var elmFileUpload=document.getElementById('file-upload-ios'); if(elmFileUpload){ elmFileUpload.addEventListener('change',onFileUploadChange,false); } }); function onFileUploadChange(e){ var file=e.target.files[0]; var fr=new FileReader(); fr.onload=onFileReaderLoad; fr.readAsDataURL(file); } function onFileReaderLoad(e){ image=e.target.result; document.getElementById('thumbnail').src=e.target.result; //console.log(image); }; function pwa_getimageZip(e){ e.disabled = true; if(image==''){alert("Please Select Image");return;} var imageMessage = document.getElementById("pwa-ios-splashmessage") imageMessage.innerHTML = 'Generating splash screen...'; imageMessage.setAttribute("class", "updating-message"); var zip=new JSZip(); var folder=zip.folder('splashscreens'); var canvas=document.createElement('canvas'),ctx=canvas.getContext('2d'); var img=new Image(); img.src=image; Object.keys(pwaforwp_obj.iosSplashIcon).forEach(function(key, index) { var phone = pwaforwp_obj.iosSplashIcon[key]; var ws=key.split("x")[0]; var hs=key.split("x")[1]; canvas.width=ws; canvas.height=hs; var wi=img.width; var hi=img.height; var wnew=wi; var hnew=hi; ctx.fillStyle = document.getElementById('ios-splash-color').value; ctx.fillRect(0,0,canvas.width,canvas.height); ctx.drawImage(img,(ws-wnew)/2,(hs-hnew)/2,wnew,hnew); var img2=canvas.toDataURL(); folder.file(phone.file,img2.split(';base64,')[1],{base64:true}); }); zip.generateAsync({type:'blob'}).then(function(content){ //saveAs(content,'splashscreens.zip'); var request = new XMLHttpRequest(); request.open("POST", ajaxurl+"?action=pwaforwp_splashscreen_uploader&pwaforwp_security_nonce="+pwaforwp_obj.pwaforwp_security_nonce); request.send(content); request.onreadystatechange = function() { if (request.readyState === 4) { var reponse = JSON.parse(request.response); if(reponse.status==200){ imageMessage.innerHTML = 'Splash Screen generated'; imageMessage.setAttribute("class", "dashicons dashicons-yes"); imageMessage.style.color = "#46b450"; setTimeout(function(){ window.location.reload(); }, 1000); } } } }); e.disabled = false; } var accordion = document.getElementsByClassName("accordion"); var i; for (i = 0; i < accordion.length; i++) { accordion[i].addEventListener("click", function() { this.classList.toggle("active"); var panel = this.nextElementSibling; if (panel.style.maxHeight) { panel.style.maxHeight = null; } else { panel.style.maxHeight = panel.scrollHeight + "px"; } }); } function get_include_pages(){ var include_type = jQuery(".visibility_options_select_include").val(); jQuery(".visibility-loader").css("display","flex"); var data = {action:"pwaforwp_include_visibility_setting_callback",pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce, include_type:include_type}; jQuery.ajax({ url: ajaxurl, type: 'post', data: data, success: function(response) { var jd = jQuery.parseJSON(response); if (jd.success == 1) { jQuery(".visibility_include_select_type").html(jd.option); jQuery(".visibility-loader").css("display","none"); // console.log(response); } else { //alert(response.message) } } }); } function get_exclude_pages(){ var include_type = jQuery(".visibility_options_select_exclude").val(); jQuery(".visibility-loader").css("display","flex"); var data = {action:"pwaforwp_include_visibility_setting_callback",pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce, include_type:include_type}; jQuery.ajax({ url: ajaxurl, type: 'post', data: data, success: function(response) { var jd = jQuery.parseJSON(response); if (jd.success == 1) { jQuery(".visibility_exclude_select_type").html(jd.option); jQuery(".visibility-loader").css("display","none"); // console.log(response); } else { //alert(response.message) } } }); } function add_included_condition(){ var include_targeting_type = jQuery(".visibility_options_select_include").val(); var include_targeting_data = jQuery(".visibility_include_select_type").val(); jQuery(".include_error").html(' '); jQuery(".include_type_error").html(' '); if(include_targeting_type==''){ jQuery(".include_error").html('Please select visibility type').css('color','red'); setTimeout(function(){ jQuery(".include_error").html(' '); },5000); return false; } if(include_targeting_data==''){ jQuery(".include_type_error").html('Please select type').css('color','red'); setTimeout(function(){ jQuery(".include_type_error").html(' '); },5000); return false; } var data = {action:"pwaforwp_include_visibility_condition_callback",pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce, include_targeting_type:include_targeting_type,include_targeting_data:include_targeting_data}; jQuery(".visibility-loader").css("display","flex"); jQuery.ajax({ url: ajaxurl, type: 'post', data: data, success: function(response) { var jd = jQuery.parseJSON(response); if (jd.success == 1) { jQuery(".visibility-include-target-item-list").append(jd.option); jQuery(".visibility-loader").css("display","none"); } } }); } function add_exclude_condition(){ var exclude_targeting_type = jQuery(".visibility_options_select_exclude").val(); var exclude_targeting_data = jQuery(".visibility_exclude_select_type").val(); jQuery(".exclude_error").html(' '); jQuery(".exclude_type_error").html(' '); if(exclude_targeting_type==''){ jQuery(".include_error").html('Please select visibility type').css('color','red'); setTimeout(function(){ jQuery(".exclude_error").html(' '); },5000); return false; } if(exclude_targeting_data==''){ jQuery(".include_type_error").html('Please select type').css('color','red'); setTimeout(function(){ jQuery(".exclude_type_error").html(' '); },5000); return false; } var data = {action:"pwaforwp_exclude_visibility_condition_callback",pwaforwp_security_nonce:pwaforwp_obj.pwaforwp_security_nonce, exclude_targeting_type:exclude_targeting_type,exclude_targeting_data:exclude_targeting_data}; jQuery(".visibility-loader").css("display","flex"); jQuery.ajax({ url: ajaxurl, type: 'post', data: data, success: function(response) { var jd = jQuery.parseJSON(response); if (jd.success == 1) { jQuery(".visibility-exclude-target-item-list").append(jd.option); jQuery(".visibility-loader").css("display","none"); } } }); } function removeIncluded_visibility(sr){ jQuery(".pwaforwp-visibility-target-icon-"+sr).empty(); }PK!ʵ$$*assets/vendor/js/firebase-messaging.js.mapnu[{"version":3,"file":"firebase-messaging.js","sources":["../../node_modules/tslib/tslib.es6.js","../util/src/errors.ts","../component/src/component.ts","../../node_modules/idb/lib/idb.mjs","../installations/src/util/constants.ts","../installations/src/util/errors.ts","../installations/src/api/common.ts","../installations/src/util/sleep.ts","../installations/src/helpers/generate-fid.ts","../installations/src/helpers/buffer-to-base64-url-safe.ts","../installations/src/util/get-key.ts","../installations/src/helpers/fid-changed.ts","../installations/src/helpers/idb-manager.ts","../installations/src/index.ts","../installations/src/helpers/get-installation-entry.ts","../installations/src/api/create-installation-request.ts","../installations/src/api/generate-auth-token-request.ts","../installations/src/helpers/refresh-auth-token.ts","../installations/src/functions/get-token.ts","../installations/src/api/delete-installation-request.ts","../installations/src/functions/on-id-change.ts","../installations/src/helpers/extract-app-config.ts","../installations/src/functions/get-id.ts","../installations/src/functions/delete-installation.ts","../messaging/src/util/errors.ts","../messaging/src/helpers/extract-app-config.ts","../messaging/src/helpers/array-base64-translator.ts","../messaging/src/helpers/migrate-old-database.ts","../messaging/src/helpers/idb-manager.ts","../messaging/src/util/constants.ts","../messaging/src/core/api.ts","../messaging/src/core/token-management.ts","../messaging/src/interfaces/internal-message.ts","../messaging/src/helpers/is-console-message.ts","../messaging/src/controllers/window-controller.ts","../messaging/src/controllers/sw-controller.ts","../messaging/src/helpers/sleep.ts","../messaging/src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @fileoverview Standardized Firebase Error.\n *\n * Usage:\n *\n * // Typescript string literals for type-safe codes\n * type Err =\n * 'unknown' |\n * 'object-not-found'\n * ;\n *\n * // Closure enum for type-safe error codes\n * // at-enum {string}\n * var Err = {\n * UNKNOWN: 'unknown',\n * OBJECT_NOT_FOUND: 'object-not-found',\n * }\n *\n * let errors: Map = {\n * 'generic-error': \"Unknown error\",\n * 'file-not-found': \"Could not find file: {$file}\",\n * };\n *\n * // Type-safe function - must pass a valid error code as param.\n * let error = new ErrorFactory('service', 'Service', errors);\n *\n * ...\n * throw error.create(Err.GENERIC);\n * ...\n * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\n * ...\n * // Service: Could not file file: foo.txt (service/file-not-found).\n *\n * catch (e) {\n * assert(e.message === \"Could not find file: foo.txt.\");\n * if (e.code === 'service/file-not-found') {\n * console.log(\"Could not read file: \" + e['file']);\n * }\n * }\n */\n\nexport type ErrorMap = {\n readonly [K in ErrorCode]: string;\n};\n\nconst ERROR_NAME = 'FirebaseError';\n\nexport interface StringLike {\n toString(): string;\n}\n\nexport interface ErrorData {\n [key: string]: StringLike | undefined;\n}\n\nexport interface FirebaseError extends Error, ErrorData {\n // Unique code for error - format is service/error-code-string.\n readonly code: string;\n\n // Developer-friendly error message.\n readonly message: string;\n\n // Always 'FirebaseError'.\n readonly name: typeof ERROR_NAME;\n\n // Where available - stack backtrace in a string.\n readonly stack?: string;\n}\n\n// Based on code from:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\nexport class FirebaseError extends Error {\n readonly name = ERROR_NAME;\n\n constructor(readonly code: string, message: string) {\n super(message);\n\n // Fix For ES5\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n Object.setPrototypeOf(this, FirebaseError.prototype);\n\n // Maintains proper stack trace for where our error was thrown.\n // Only available on V8.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ErrorFactory.prototype.create);\n }\n }\n}\n\nexport class ErrorFactory<\n ErrorCode extends string,\n ErrorParams extends { readonly [K in ErrorCode]?: ErrorData } = {}\n> {\n constructor(\n private readonly service: string,\n private readonly serviceName: string,\n private readonly errors: ErrorMap\n ) {}\n\n create(\n code: K,\n ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []\n ): FirebaseError {\n const customData = (data[0] as ErrorData) || {};\n const fullCode = `${this.service}/${code}`;\n const template = this.errors[code];\n\n const message = template ? replaceTemplate(template, customData) : 'Error';\n // Service Name: Error message (service/code).\n const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\n\n const error = new FirebaseError(fullCode, fullMessage);\n\n // Keys with an underscore at the end of their name are not included in\n // error.data for some reason.\n // TODO: Replace with Object.entries when lib is updated to es2017.\n for (const key of Object.keys(customData)) {\n if (key.slice(-1) !== '_') {\n if (key in error) {\n console.warn(\n `Overwriting FirebaseError base field \"${key}\" can cause unexpected behavior.`\n );\n }\n error[key] = customData[key];\n }\n }\n\n return error;\n }\n}\n\nfunction replaceTemplate(template: string, data: ErrorData): string {\n return template.replace(PATTERN, (_, key) => {\n const value = data[key];\n return value != null ? value.toString() : `<${key}?>`;\n });\n}\n\nconst PATTERN = /\\{\\$([^}]+)}/g;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n InstantiationMode,\n InstanceFactory,\n ComponentType,\n Dictionary,\n Name\n} from './types';\n\n/**\n * Component for service name T, e.g. `auth`, `auth-internal`\n */\nexport class Component {\n multipleInstances = false;\n /**\n * Properties to be added to the service namespace\n */\n serviceProps: Dictionary = {};\n\n instantiationMode = InstantiationMode.LAZY;\n\n /**\n *\n * @param name The public service name, e.g. app, auth, firestore, database\n * @param instanceFactory Service factory responsible for creating the public interface\n * @param type whether the service provided by the component is public or private\n */\n constructor(\n readonly name: T,\n readonly instanceFactory: InstanceFactory,\n readonly type: ComponentType\n ) {}\n\n setInstantiationMode(mode: InstantiationMode): this {\n this.instantiationMode = mode;\n return this;\n }\n\n setMultipleInstances(multipleInstances: boolean): this {\n this.multipleInstances = multipleInstances;\n return this;\n }\n\n setServiceProps(props: Dictionary): this {\n this.serviceProps = props;\n return this;\n }\n}\n","function toArray(arr) {\n return Array.prototype.slice.call(arr);\n}\n\nfunction promisifyRequest(request) {\n return new Promise(function(resolve, reject) {\n request.onsuccess = function() {\n resolve(request.result);\n };\n\n request.onerror = function() {\n reject(request.error);\n };\n });\n}\n\nfunction promisifyRequestCall(obj, method, args) {\n var request;\n var p = new Promise(function(resolve, reject) {\n request = obj[method].apply(obj, args);\n promisifyRequest(request).then(resolve, reject);\n });\n\n p.request = request;\n return p;\n}\n\nfunction promisifyCursorRequestCall(obj, method, args) {\n var p = promisifyRequestCall(obj, method, args);\n return p.then(function(value) {\n if (!value) return;\n return new Cursor(value, p.request);\n });\n}\n\nfunction proxyProperties(ProxyClass, targetProp, properties) {\n properties.forEach(function(prop) {\n Object.defineProperty(ProxyClass.prototype, prop, {\n get: function() {\n return this[targetProp][prop];\n },\n set: function(val) {\n this[targetProp][prop] = val;\n }\n });\n });\n}\n\nfunction proxyRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyRequestCall(this[targetProp], prop, arguments);\n };\n });\n}\n\nfunction proxyMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return this[targetProp][prop].apply(this[targetProp], arguments);\n };\n });\n}\n\nfunction proxyCursorRequestMethods(ProxyClass, targetProp, Constructor, properties) {\n properties.forEach(function(prop) {\n if (!(prop in Constructor.prototype)) return;\n ProxyClass.prototype[prop] = function() {\n return promisifyCursorRequestCall(this[targetProp], prop, arguments);\n };\n });\n}\n\nfunction Index(index) {\n this._index = index;\n}\n\nproxyProperties(Index, '_index', [\n 'name',\n 'keyPath',\n 'multiEntry',\n 'unique'\n]);\n\nproxyRequestMethods(Index, '_index', IDBIndex, [\n 'get',\n 'getKey',\n 'getAll',\n 'getAllKeys',\n 'count'\n]);\n\nproxyCursorRequestMethods(Index, '_index', IDBIndex, [\n 'openCursor',\n 'openKeyCursor'\n]);\n\nfunction Cursor(cursor, request) {\n this._cursor = cursor;\n this._request = request;\n}\n\nproxyProperties(Cursor, '_cursor', [\n 'direction',\n 'key',\n 'primaryKey',\n 'value'\n]);\n\nproxyRequestMethods(Cursor, '_cursor', IDBCursor, [\n 'update',\n 'delete'\n]);\n\n// proxy 'next' methods\n['advance', 'continue', 'continuePrimaryKey'].forEach(function(methodName) {\n if (!(methodName in IDBCursor.prototype)) return;\n Cursor.prototype[methodName] = function() {\n var cursor = this;\n var args = arguments;\n return Promise.resolve().then(function() {\n cursor._cursor[methodName].apply(cursor._cursor, args);\n return promisifyRequest(cursor._request).then(function(value) {\n if (!value) return;\n return new Cursor(value, cursor._request);\n });\n });\n };\n});\n\nfunction ObjectStore(store) {\n this._store = store;\n}\n\nObjectStore.prototype.createIndex = function() {\n return new Index(this._store.createIndex.apply(this._store, arguments));\n};\n\nObjectStore.prototype.index = function() {\n return new Index(this._store.index.apply(this._store, arguments));\n};\n\nproxyProperties(ObjectStore, '_store', [\n 'name',\n 'keyPath',\n 'indexNames',\n 'autoIncrement'\n]);\n\nproxyRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'put',\n 'add',\n 'delete',\n 'clear',\n 'get',\n 'getAll',\n 'getKey',\n 'getAllKeys',\n 'count'\n]);\n\nproxyCursorRequestMethods(ObjectStore, '_store', IDBObjectStore, [\n 'openCursor',\n 'openKeyCursor'\n]);\n\nproxyMethods(ObjectStore, '_store', IDBObjectStore, [\n 'deleteIndex'\n]);\n\nfunction Transaction(idbTransaction) {\n this._tx = idbTransaction;\n this.complete = new Promise(function(resolve, reject) {\n idbTransaction.oncomplete = function() {\n resolve();\n };\n idbTransaction.onerror = function() {\n reject(idbTransaction.error);\n };\n idbTransaction.onabort = function() {\n reject(idbTransaction.error);\n };\n });\n}\n\nTransaction.prototype.objectStore = function() {\n return new ObjectStore(this._tx.objectStore.apply(this._tx, arguments));\n};\n\nproxyProperties(Transaction, '_tx', [\n 'objectStoreNames',\n 'mode'\n]);\n\nproxyMethods(Transaction, '_tx', IDBTransaction, [\n 'abort'\n]);\n\nfunction UpgradeDB(db, oldVersion, transaction) {\n this._db = db;\n this.oldVersion = oldVersion;\n this.transaction = new Transaction(transaction);\n}\n\nUpgradeDB.prototype.createObjectStore = function() {\n return new ObjectStore(this._db.createObjectStore.apply(this._db, arguments));\n};\n\nproxyProperties(UpgradeDB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n]);\n\nproxyMethods(UpgradeDB, '_db', IDBDatabase, [\n 'deleteObjectStore',\n 'close'\n]);\n\nfunction DB(db) {\n this._db = db;\n}\n\nDB.prototype.transaction = function() {\n return new Transaction(this._db.transaction.apply(this._db, arguments));\n};\n\nproxyProperties(DB, '_db', [\n 'name',\n 'version',\n 'objectStoreNames'\n]);\n\nproxyMethods(DB, '_db', IDBDatabase, [\n 'close'\n]);\n\n// Add cursor iterators\n// TODO: remove this once browsers do the right thing with promises\n['openCursor', 'openKeyCursor'].forEach(function(funcName) {\n [ObjectStore, Index].forEach(function(Constructor) {\n // Don't create iterateKeyCursor if openKeyCursor doesn't exist.\n if (!(funcName in Constructor.prototype)) return;\n\n Constructor.prototype[funcName.replace('open', 'iterate')] = function() {\n var args = toArray(arguments);\n var callback = args[args.length - 1];\n var nativeObject = this._store || this._index;\n var request = nativeObject[funcName].apply(nativeObject, args.slice(0, -1));\n request.onsuccess = function() {\n callback(request.result);\n };\n };\n });\n});\n\n// polyfill getAll\n[Index, ObjectStore].forEach(function(Constructor) {\n if (Constructor.prototype.getAll) return;\n Constructor.prototype.getAll = function(query, count) {\n var instance = this;\n var items = [];\n\n return new Promise(function(resolve) {\n instance.iterateCursor(query, function(cursor) {\n if (!cursor) {\n resolve(items);\n return;\n }\n items.push(cursor.value);\n\n if (count !== undefined && items.length == count) {\n resolve(items);\n return;\n }\n cursor.continue();\n });\n });\n };\n});\n\nexport function openDb(name, version, upgradeCallback) {\n var p = promisifyRequestCall(indexedDB, 'open', [name, version]);\n var request = p.request;\n\n if (request) {\n request.onupgradeneeded = function(event) {\n if (upgradeCallback) {\n upgradeCallback(new UpgradeDB(request.result, event.oldVersion, request.transaction));\n }\n };\n }\n\n return p.then(function(db) {\n return new DB(db);\n });\n}\n\nexport function deleteDb(name) {\n return promisifyRequestCall(indexedDB, 'deleteDatabase', [name]);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { version } from '../../package.json';\n\nexport const PENDING_TIMEOUT_MS = 10000;\n\nexport const PACKAGE_VERSION = `w:${version}`;\nexport const INTERNAL_AUTH_VERSION = 'FIS_v2';\n\nexport const INSTALLATIONS_API_URL =\n 'https://firebaseinstallations.googleapis.com/v1';\n\nexport const TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\n\nexport const SERVICE = 'installations';\nexport const SERVICE_NAME = 'Installations';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { SERVICE, SERVICE_NAME } from './constants';\n\nexport const enum ErrorCode {\n MISSING_APP_CONFIG_VALUES = 'missing-app-config-values',\n NOT_REGISTERED = 'not-registered',\n INSTALLATION_NOT_FOUND = 'installation-not-found',\n REQUEST_FAILED = 'request-failed',\n APP_OFFLINE = 'app-offline',\n DELETE_PENDING_REGISTRATION = 'delete-pending-registration'\n}\n\nconst ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]:\n 'Missing App configuration value: \"{$valueName}\"',\n [ErrorCode.NOT_REGISTERED]: 'Firebase Installation is not registered.',\n [ErrorCode.INSTALLATION_NOT_FOUND]: 'Firebase Installation not found.',\n [ErrorCode.REQUEST_FAILED]:\n '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\n [ErrorCode.APP_OFFLINE]: 'Could not process request. Application offline.',\n [ErrorCode.DELETE_PENDING_REGISTRATION]:\n \"Can't delete installation while there is a pending registration request.\"\n};\n\ninterface ErrorParams {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]: {\n valueName: string;\n };\n [ErrorCode.REQUEST_FAILED]: {\n requestName: string;\n [index: string]: string | number; // to make Typescript 3.8 happy\n } & ServerErrorData;\n}\n\nexport const ERROR_FACTORY = new ErrorFactory(\n SERVICE,\n SERVICE_NAME,\n ERROR_DESCRIPTION_MAP\n);\n\nexport interface ServerErrorData {\n serverCode: number;\n serverMessage: string;\n serverStatus: string;\n}\n\nexport type ServerError = FirebaseError & ServerErrorData;\n\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\nexport function isServerError(error: unknown): error is ServerError {\n return (\n error instanceof FirebaseError &&\n error.code.includes(ErrorCode.REQUEST_FAILED)\n );\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseError } from '@firebase/util';\nimport { GenerateAuthTokenResponse } from '../interfaces/api-response';\nimport { AppConfig } from '../interfaces/app-config';\nimport {\n CompletedAuthToken,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport {\n INSTALLATIONS_API_URL,\n INTERNAL_AUTH_VERSION\n} from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\nexport function getInstallationsEndpoint({ projectId }: AppConfig): string {\n return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`;\n}\n\nexport function extractAuthTokenInfoFromResponse(\n response: GenerateAuthTokenResponse\n): CompletedAuthToken {\n return {\n token: response.token,\n requestStatus: RequestStatus.COMPLETED,\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\n creationTime: Date.now()\n };\n}\n\nexport async function getErrorFromResponse(\n requestName: string,\n response: Response\n): Promise {\n const responseJson: ErrorResponse = await response.json();\n const errorData = responseJson.error;\n return ERROR_FACTORY.create(ErrorCode.REQUEST_FAILED, {\n requestName,\n serverCode: errorData.code,\n serverMessage: errorData.message,\n serverStatus: errorData.status\n });\n}\n\nexport function getHeaders({ apiKey }: AppConfig): Headers {\n return new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'x-goog-api-key': apiKey\n });\n}\n\nexport function getHeadersWithAuth(\n appConfig: AppConfig,\n { refreshToken }: RegisteredInstallationEntry\n): Headers {\n const headers = getHeaders(appConfig);\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\n return headers;\n}\n\nexport interface ErrorResponse {\n error: {\n code: number;\n message: string;\n status: string;\n };\n}\n\n/**\n * Calls the passed in fetch wrapper and returns the response.\n * If the returned response has a status of 5xx, re-runs the function once and\n * returns the response.\n */\nexport async function retryIfServerError(\n fn: () => Promise\n): Promise {\n const result = await fn();\n\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return fn();\n }\n\n return result;\n}\n\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn: string): number {\n // This works because the server will never respond with fractions of a second.\n return Number(responseExpiresIn.replace('s', '000'));\n}\n\nfunction getAuthorizationHeader(refreshToken: string): string {\n return `${INTERNAL_AUTH_VERSION} ${refreshToken}`;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Returns a promise that resolves after given time passes. */\nexport function sleep(ms: number): Promise {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bufferToBase64UrlSafe } from './buffer-to-base64-url-safe';\n\nexport const VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\nexport const INVALID_FID = '';\n\n/**\n * Generates a new FID using random values from Web Crypto API.\n * Returns an empty string if FID generation fails for any reason.\n */\nexport function generateFid(): string {\n try {\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\n // bytes. our implementation generates a 17 byte array instead.\n const fidByteArray = new Uint8Array(17);\n const crypto =\n self.crypto || ((self as unknown) as { msCrypto: Crypto }).msCrypto;\n crypto.getRandomValues(fidByteArray);\n\n // Replace the first 4 random bits with the constant FID header of 0b0111.\n fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000);\n\n const fid = encode(fidByteArray);\n\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\n } catch {\n // FID generation errored\n return INVALID_FID;\n }\n}\n\n/** Converts a FID Uint8Array to a base64 string representation. */\nfunction encode(fidByteArray: Uint8Array): string {\n const b64String = bufferToBase64UrlSafe(fidByteArray);\n\n // Remove the 23rd character that was added because of the extra 4 bits at the\n // end of our 17 byte array, and the '=' padding.\n return b64String.substr(0, 22);\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function bufferToBase64UrlSafe(array: Uint8Array): string {\n const b64 = btoa(String.fromCharCode(...array));\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppConfig } from '../interfaces/app-config';\n\n/** Returns a string key that can be used to identify the app. */\nexport function getKey(appConfig: AppConfig): string {\n return `${appConfig.appName}!${appConfig.appId}`;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getKey } from '../util/get-key';\nimport { AppConfig } from '../interfaces/app-config';\nimport { IdChangeCallbackFn } from '../functions';\n\nconst fidChangeCallbacks: Map> = new Map();\n\n/**\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\n * change to other tabs.\n */\nexport function fidChanged(appConfig: AppConfig, fid: string): void {\n const key = getKey(appConfig);\n\n callFidChangeCallbacks(key, fid);\n broadcastFidChange(key, fid);\n}\n\nexport function addCallback(\n appConfig: AppConfig,\n callback: IdChangeCallbackFn\n): void {\n // Open the broadcast channel if it's not already open,\n // to be able to listen to change events from other tabs.\n getBroadcastChannel();\n\n const key = getKey(appConfig);\n\n let callbackSet = fidChangeCallbacks.get(key);\n if (!callbackSet) {\n callbackSet = new Set();\n fidChangeCallbacks.set(key, callbackSet);\n }\n callbackSet.add(callback);\n}\n\nexport function removeCallback(\n appConfig: AppConfig,\n callback: IdChangeCallbackFn\n): void {\n const key = getKey(appConfig);\n\n const callbackSet = fidChangeCallbacks.get(key);\n\n if (!callbackSet) {\n return;\n }\n\n callbackSet.delete(callback);\n if (callbackSet.size === 0) {\n fidChangeCallbacks.delete(key);\n }\n\n // Close broadcast channel if there are no more callbacks.\n closeBroadcastChannel();\n}\n\nfunction callFidChangeCallbacks(key: string, fid: string): void {\n const callbacks = fidChangeCallbacks.get(key);\n if (!callbacks) {\n return;\n }\n\n for (const callback of callbacks) {\n callback(fid);\n }\n}\n\nfunction broadcastFidChange(key: string, fid: string): void {\n const channel = getBroadcastChannel();\n if (channel) {\n channel.postMessage({ key, fid });\n }\n closeBroadcastChannel();\n}\n\nlet broadcastChannel: BroadcastChannel | null = null;\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\nfunction getBroadcastChannel(): BroadcastChannel | null {\n if (!broadcastChannel && 'BroadcastChannel' in self) {\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\n broadcastChannel.onmessage = e => {\n callFidChangeCallbacks(e.data.key, e.data.fid);\n };\n }\n return broadcastChannel;\n}\n\nfunction closeBroadcastChannel(): void {\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\n broadcastChannel.close();\n broadcastChannel = null;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DB, openDb } from 'idb';\nimport { AppConfig } from '../interfaces/app-config';\nimport { InstallationEntry } from '../interfaces/installation-entry';\nimport { getKey } from '../util/get-key';\nimport { fidChanged } from './fid-changed';\n\nconst DATABASE_NAME = 'firebase-installations-database';\nconst DATABASE_VERSION = 1;\nconst OBJECT_STORE_NAME = 'firebase-installations-store';\n\nlet dbPromise: Promise | null = null;\nfunction getDbPromise(): Promise {\n if (!dbPromise) {\n dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, upgradeDB => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (upgradeDB.oldVersion) {\n case 0:\n upgradeDB.createObjectStore(OBJECT_STORE_NAME);\n }\n });\n }\n return dbPromise;\n}\n\n/** Gets record(s) from the objectStore that match the given key. */\nexport async function get(\n appConfig: AppConfig\n): Promise {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n return db\n .transaction(OBJECT_STORE_NAME)\n .objectStore(OBJECT_STORE_NAME)\n .get(key);\n}\n\n/** Assigns or overwrites the record for the given key with the given value. */\nexport async function set(\n appConfig: AppConfig,\n value: ValueType\n): Promise {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue = await objectStore.get(key);\n await objectStore.put(value, key);\n await tx.complete;\n\n if (!oldValue || oldValue.fid !== value.fid) {\n fidChanged(appConfig, value.fid);\n }\n\n return value;\n}\n\n/** Removes record(s) from the objectStore that match the given key. */\nexport async function remove(appConfig: AppConfig): Promise {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\n await tx.complete;\n}\n\n/**\n * Atomically updates a record with the result of updateFn, which gets\n * called with the current value. If newValue is undefined, the record is\n * deleted instead.\n * @return Updated value\n */\nexport async function update(\n appConfig: AppConfig,\n updateFn: (previousValue: InstallationEntry | undefined) => ValueType\n): Promise {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const store = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue: InstallationEntry | undefined = await store.get(key);\n const newValue = updateFn(oldValue);\n\n if (newValue === undefined) {\n await store.delete(key);\n } else {\n await store.put(newValue, key);\n }\n await tx.complete;\n\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\n fidChanged(appConfig, newValue.fid);\n }\n\n return newValue;\n}\n\nexport async function clear(): Promise {\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).clear();\n await tx.complete;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase from '@firebase/app';\nimport {\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { Component, ComponentType } from '@firebase/component';\nimport { FirebaseInstallations } from '@firebase/installations-types';\nimport {\n deleteInstallation,\n getId,\n getToken,\n IdChangeCallbackFn,\n IdChangeUnsubscribeFn,\n onIdChange\n} from './functions';\nimport { extractAppConfig } from './helpers/extract-app-config';\nimport { FirebaseDependencies } from './interfaces/firebase-dependencies';\n\nimport { name, version } from '../package.json';\n\nexport function registerInstallations(instance: _FirebaseNamespace): void {\n const installationsName = 'installations';\n\n instance.INTERNAL.registerComponent(\n new Component(\n installationsName,\n container => {\n const app = container.getProvider('app').getImmediate();\n\n // Throws if app isn't configured properly.\n const appConfig = extractAppConfig(app);\n const platformLoggerProvider = container.getProvider('platform-logger');\n const dependencies: FirebaseDependencies = {\n appConfig,\n platformLoggerProvider\n };\n\n const installations: FirebaseInstallations & FirebaseService = {\n app,\n getId: () => getId(dependencies),\n getToken: (forceRefresh?: boolean) =>\n getToken(dependencies, forceRefresh),\n delete: () => deleteInstallation(dependencies),\n onIdChange: (callback: IdChangeCallbackFn): IdChangeUnsubscribeFn =>\n onIdChange(dependencies, callback)\n };\n return installations;\n },\n ComponentType.PUBLIC\n )\n );\n\n instance.registerVersion(name, version);\n}\n\nregisterInstallations(firebase as _FirebaseNamespace);\n\n/**\n * Define extension behavior of `registerInstallations`\n */\ndeclare module '@firebase/app-types' {\n interface FirebaseNamespace {\n installations(app?: FirebaseApp): FirebaseInstallations;\n }\n interface FirebaseApp {\n installations(): FirebaseInstallations;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInstallationRequest } from '../api/create-installation-request';\nimport { AppConfig } from '../interfaces/app-config';\nimport {\n InProgressInstallationEntry,\n InstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { PENDING_TIMEOUT_MS } from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode, isServerError } from '../util/errors';\nimport { sleep } from '../util/sleep';\nimport { generateFid, INVALID_FID } from './generate-fid';\nimport { remove, set, update } from './idb-manager';\n\nexport interface InstallationEntryWithRegistrationPromise {\n installationEntry: InstallationEntry;\n /** Exist iff the installationEntry is not registered. */\n registrationPromise?: Promise;\n}\n\n/**\n * Updates and returns the InstallationEntry from the database.\n * Also triggers a registration request if it is necessary and possible.\n */\nexport async function getInstallationEntry(\n appConfig: AppConfig\n): Promise {\n let registrationPromise: Promise | undefined;\n\n const installationEntry = await update(appConfig, oldEntry => {\n const installationEntry = updateOrCreateInstallationEntry(oldEntry);\n const entryWithPromise = triggerRegistrationIfNecessary(\n appConfig,\n installationEntry\n );\n registrationPromise = entryWithPromise.registrationPromise;\n return entryWithPromise.installationEntry;\n });\n\n if (installationEntry.fid === INVALID_FID) {\n // FID generation failed. Waiting for the FID from the server.\n return { installationEntry: await registrationPromise! };\n }\n\n return {\n installationEntry,\n registrationPromise\n };\n}\n\n/**\n * Creates a new Installation Entry if one does not exist.\n * Also clears timed out pending requests.\n */\nfunction updateOrCreateInstallationEntry(\n oldEntry: InstallationEntry | undefined\n): InstallationEntry {\n const entry: InstallationEntry = oldEntry || {\n fid: generateFid(),\n registrationStatus: RequestStatus.NOT_STARTED\n };\n\n return clearTimedOutRequest(entry);\n}\n\n/**\n * If the Firebase Installation is not registered yet, this will trigger the\n * registration and return an InProgressInstallationEntry.\n *\n * If registrationPromise does not exist, the installationEntry is guaranteed\n * to be registered.\n */\nfunction triggerRegistrationIfNecessary(\n appConfig: AppConfig,\n installationEntry: InstallationEntry\n): InstallationEntryWithRegistrationPromise {\n if (installationEntry.registrationStatus === RequestStatus.NOT_STARTED) {\n if (!navigator.onLine) {\n // Registration required but app is offline.\n const registrationPromiseWithError = Promise.reject(\n ERROR_FACTORY.create(ErrorCode.APP_OFFLINE)\n );\n return {\n installationEntry,\n registrationPromise: registrationPromiseWithError\n };\n }\n\n // Try registering. Change status to IN_PROGRESS.\n const inProgressEntry: InProgressInstallationEntry = {\n fid: installationEntry.fid,\n registrationStatus: RequestStatus.IN_PROGRESS,\n registrationTime: Date.now()\n };\n const registrationPromise = registerInstallation(\n appConfig,\n inProgressEntry\n );\n return { installationEntry: inProgressEntry, registrationPromise };\n } else if (\n installationEntry.registrationStatus === RequestStatus.IN_PROGRESS\n ) {\n return {\n installationEntry,\n registrationPromise: waitUntilFidRegistration(appConfig)\n };\n } else {\n return { installationEntry };\n }\n}\n\n/** This will be executed only once for each new Firebase Installation. */\nasync function registerInstallation(\n appConfig: AppConfig,\n installationEntry: InProgressInstallationEntry\n): Promise {\n try {\n const registeredInstallationEntry = await createInstallationRequest(\n appConfig,\n installationEntry\n );\n return set(appConfig, registeredInstallationEntry);\n } catch (e) {\n if (isServerError(e) && e.serverCode === 409) {\n // Server returned a \"FID can not be used\" error.\n // Generate a new ID next time.\n await remove(appConfig);\n } else {\n // Registration failed. Set FID as not registered.\n await set(appConfig, {\n fid: installationEntry.fid,\n registrationStatus: RequestStatus.NOT_STARTED\n });\n }\n throw e;\n }\n}\n\n/** Call if FID registration is pending in another request. */\nasync function waitUntilFidRegistration(\n appConfig: AppConfig\n): Promise {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n\n let entry: InstallationEntry = await updateInstallationRequest(appConfig);\n while (entry.registrationStatus === RequestStatus.IN_PROGRESS) {\n // createInstallation request still in progress.\n await sleep(100);\n\n entry = await updateInstallationRequest(appConfig);\n }\n\n if (entry.registrationStatus === RequestStatus.NOT_STARTED) {\n // The request timed out or failed in a different call. Try again.\n const {\n installationEntry,\n registrationPromise\n } = await getInstallationEntry(appConfig);\n\n if (registrationPromise) {\n return registrationPromise;\n } else {\n // if there is no registrationPromise, entry is registered.\n return installationEntry as RegisteredInstallationEntry;\n }\n }\n\n return entry;\n}\n\n/**\n * Called only if there is a CreateInstallation request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * CreateInstallation request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateInstallationRequest(\n appConfig: AppConfig\n): Promise {\n return update(appConfig, oldEntry => {\n if (!oldEntry) {\n throw ERROR_FACTORY.create(ErrorCode.INSTALLATION_NOT_FOUND);\n }\n return clearTimedOutRequest(oldEntry);\n });\n}\n\nfunction clearTimedOutRequest(entry: InstallationEntry): InstallationEntry {\n if (hasInstallationRequestTimedOut(entry)) {\n return {\n fid: entry.fid,\n registrationStatus: RequestStatus.NOT_STARTED\n };\n }\n\n return entry;\n}\n\nfunction hasInstallationRequestTimedOut(\n installationEntry: InstallationEntry\n): boolean {\n return (\n installationEntry.registrationStatus === RequestStatus.IN_PROGRESS &&\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now()\n );\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CreateInstallationResponse } from '../interfaces/api-response';\nimport { AppConfig } from '../interfaces/app-config';\nimport {\n InProgressInstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { INTERNAL_AUTH_VERSION, PACKAGE_VERSION } from '../util/constants';\nimport {\n extractAuthTokenInfoFromResponse,\n getErrorFromResponse,\n getHeaders,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\n\nexport async function createInstallationRequest(\n appConfig: AppConfig,\n { fid }: InProgressInstallationEntry\n): Promise {\n const endpoint = getInstallationsEndpoint(appConfig);\n\n const headers = getHeaders(appConfig);\n const body = {\n fid,\n authVersion: INTERNAL_AUTH_VERSION,\n appId: appConfig.appId,\n sdkVersion: PACKAGE_VERSION\n };\n\n const request: RequestInit = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue: CreateInstallationResponse = await response.json();\n const registeredInstallationEntry: RegisteredInstallationEntry = {\n fid: responseValue.fid || fid,\n registrationStatus: RequestStatus.COMPLETED,\n refreshToken: responseValue.refreshToken,\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\n };\n return registeredInstallationEntry;\n } else {\n throw await getErrorFromResponse('Create Installation', response);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GenerateAuthTokenResponse } from '../interfaces/api-response';\nimport { AppConfig } from '../interfaces/app-config';\nimport { FirebaseDependencies } from '../interfaces/firebase-dependencies';\nimport {\n CompletedAuthToken,\n RegisteredInstallationEntry\n} from '../interfaces/installation-entry';\nimport { PACKAGE_VERSION } from '../util/constants';\nimport {\n extractAuthTokenInfoFromResponse,\n getErrorFromResponse,\n getHeadersWithAuth,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\n\nexport async function generateAuthTokenRequest(\n { appConfig, platformLoggerProvider }: FirebaseDependencies,\n installationEntry: RegisteredInstallationEntry\n): Promise {\n const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\n\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n\n // If platform logger exists, add the platform info string to the header.\n const platformLogger = platformLoggerProvider.getImmediate({\n optional: true\n });\n if (platformLogger) {\n headers.append('x-firebase-client', platformLogger.getPlatformInfoString());\n }\n\n const body = {\n installation: {\n sdkVersion: PACKAGE_VERSION\n }\n };\n\n const request: RequestInit = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue: GenerateAuthTokenResponse = await response.json();\n const completedAuthToken: CompletedAuthToken = extractAuthTokenInfoFromResponse(\n responseValue\n );\n return completedAuthToken;\n } else {\n throw await getErrorFromResponse('Generate Auth Token', response);\n }\n}\n\nfunction getGenerateAuthTokenEndpoint(\n appConfig: AppConfig,\n { fid }: RegisteredInstallationEntry\n): string {\n return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateAuthTokenRequest } from '../api/generate-auth-token-request';\nimport { AppConfig } from '../interfaces/app-config';\nimport { FirebaseDependencies } from '../interfaces/firebase-dependencies';\nimport {\n AuthToken,\n CompletedAuthToken,\n InProgressAuthToken,\n InstallationEntry,\n RegisteredInstallationEntry,\n RequestStatus\n} from '../interfaces/installation-entry';\nimport { PENDING_TIMEOUT_MS, TOKEN_EXPIRATION_BUFFER } from '../util/constants';\nimport { ERROR_FACTORY, ErrorCode, isServerError } from '../util/errors';\nimport { sleep } from '../util/sleep';\nimport { remove, set, update } from './idb-manager';\n\n/**\n * Returns a valid authentication token for the installation. Generates a new\n * token if one doesn't exist, is expired or about to expire.\n *\n * Should only be called if the Firebase Installation is registered.\n */\nexport async function refreshAuthToken(\n dependencies: FirebaseDependencies,\n forceRefresh = false\n): Promise {\n let tokenPromise: Promise | undefined;\n const entry = await update(dependencies.appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(ErrorCode.NOT_REGISTERED);\n }\n\n const oldAuthToken = oldEntry.authToken;\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\n // There is a valid token in the DB.\n return oldEntry;\n } else if (oldAuthToken.requestStatus === RequestStatus.IN_PROGRESS) {\n // There already is a token request in progress.\n tokenPromise = waitUntilAuthTokenRequest(dependencies, forceRefresh);\n return oldEntry;\n } else {\n // No token or token expired.\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(ErrorCode.APP_OFFLINE);\n }\n\n const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\n tokenPromise = fetchAuthTokenFromServer(dependencies, inProgressEntry);\n return inProgressEntry;\n }\n });\n\n const authToken = tokenPromise\n ? await tokenPromise\n : (entry.authToken as CompletedAuthToken);\n return authToken;\n}\n\n/**\n * Call only if FID is registered and Auth Token request is in progress.\n *\n * Waits until the current pending request finishes. If the request times out,\n * tries once in this thread as well.\n */\nasync function waitUntilAuthTokenRequest(\n dependencies: FirebaseDependencies,\n forceRefresh: boolean\n): Promise {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n\n let entry = await updateAuthTokenRequest(dependencies.appConfig);\n while (entry.authToken.requestStatus === RequestStatus.IN_PROGRESS) {\n // generateAuthToken still in progress.\n await sleep(100);\n\n entry = await updateAuthTokenRequest(dependencies.appConfig);\n }\n\n const authToken = entry.authToken;\n if (authToken.requestStatus === RequestStatus.NOT_STARTED) {\n // The request timed out or failed in a different call. Try again.\n return refreshAuthToken(dependencies, forceRefresh);\n } else {\n return authToken;\n }\n}\n\n/**\n * Called only if there is a GenerateAuthToken request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * GenerateAuthToken request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateAuthTokenRequest(\n appConfig: AppConfig\n): Promise {\n return update(appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(ErrorCode.NOT_REGISTERED);\n }\n\n const oldAuthToken = oldEntry.authToken;\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\n return {\n ...oldEntry,\n authToken: { requestStatus: RequestStatus.NOT_STARTED }\n };\n }\n\n return oldEntry;\n });\n}\n\nasync function fetchAuthTokenFromServer(\n dependencies: FirebaseDependencies,\n installationEntry: RegisteredInstallationEntry\n): Promise {\n try {\n const authToken = await generateAuthTokenRequest(\n dependencies,\n installationEntry\n );\n const updatedInstallationEntry: RegisteredInstallationEntry = {\n ...installationEntry,\n authToken\n };\n await set(dependencies.appConfig, updatedInstallationEntry);\n return authToken;\n } catch (e) {\n if (isServerError(e) && (e.serverCode === 401 || e.serverCode === 404)) {\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\n // Generate a new ID next time.\n await remove(dependencies.appConfig);\n } else {\n const updatedInstallationEntry: RegisteredInstallationEntry = {\n ...installationEntry,\n authToken: { requestStatus: RequestStatus.NOT_STARTED }\n };\n await set(dependencies.appConfig, updatedInstallationEntry);\n }\n throw e;\n }\n}\n\nfunction isEntryRegistered(\n installationEntry: InstallationEntry | undefined\n): installationEntry is RegisteredInstallationEntry {\n return (\n installationEntry !== undefined &&\n installationEntry.registrationStatus === RequestStatus.COMPLETED\n );\n}\n\nfunction isAuthTokenValid(authToken: AuthToken): boolean {\n return (\n authToken.requestStatus === RequestStatus.COMPLETED &&\n !isAuthTokenExpired(authToken)\n );\n}\n\nfunction isAuthTokenExpired(authToken: CompletedAuthToken): boolean {\n const now = Date.now();\n return (\n now < authToken.creationTime ||\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER\n );\n}\n\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\nfunction makeAuthTokenRequestInProgressEntry(\n oldEntry: RegisteredInstallationEntry\n): RegisteredInstallationEntry {\n const inProgressAuthToken: InProgressAuthToken = {\n requestStatus: RequestStatus.IN_PROGRESS,\n requestTime: Date.now()\n };\n return {\n ...oldEntry,\n authToken: inProgressAuthToken\n };\n}\n\nfunction hasAuthTokenRequestTimedOut(authToken: AuthToken): boolean {\n return (\n authToken.requestStatus === RequestStatus.IN_PROGRESS &&\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now()\n );\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInstallationEntry } from '../helpers/get-installation-entry';\nimport { refreshAuthToken } from '../helpers/refresh-auth-token';\nimport { AppConfig } from '../interfaces/app-config';\nimport { FirebaseDependencies } from '../interfaces/firebase-dependencies';\n\nexport async function getToken(\n dependencies: FirebaseDependencies,\n forceRefresh = false\n): Promise {\n await completeInstallationRegistration(dependencies.appConfig);\n\n // At this point we either have a Registered Installation in the DB, or we've\n // already thrown an error.\n const authToken = await refreshAuthToken(dependencies, forceRefresh);\n return authToken.token;\n}\n\nasync function completeInstallationRegistration(\n appConfig: AppConfig\n): Promise {\n const { registrationPromise } = await getInstallationEntry(appConfig);\n\n if (registrationPromise) {\n // A createInstallation request is in progress. Wait until it finishes.\n await registrationPromise;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppConfig } from '../interfaces/app-config';\nimport { RegisteredInstallationEntry } from '../interfaces/installation-entry';\nimport {\n getErrorFromResponse,\n getHeadersWithAuth,\n getInstallationsEndpoint,\n retryIfServerError\n} from './common';\n\nexport async function deleteInstallationRequest(\n appConfig: AppConfig,\n installationEntry: RegisteredInstallationEntry\n): Promise {\n const endpoint = getDeleteEndpoint(appConfig, installationEntry);\n\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n const request: RequestInit = {\n method: 'DELETE',\n headers\n };\n\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (!response.ok) {\n throw await getErrorFromResponse('Delete Installation', response);\n }\n}\n\nfunction getDeleteEndpoint(\n appConfig: AppConfig,\n { fid }: RegisteredInstallationEntry\n): string {\n return `${getInstallationsEndpoint(appConfig)}/${fid}`;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { addCallback, removeCallback } from '../helpers/fid-changed';\nimport { FirebaseDependencies } from '../interfaces/firebase-dependencies';\n\nexport type IdChangeCallbackFn = (installationId: string) => void;\nexport type IdChangeUnsubscribeFn = () => void;\n\n/**\n * Sets a new callback that will get called when Installation ID changes.\n * Returns an unsubscribe function that will remove the callback when called.\n */\nexport function onIdChange(\n { appConfig }: FirebaseDependencies,\n callback: IdChangeCallbackFn\n): IdChangeUnsubscribeFn {\n addCallback(appConfig, callback);\n\n return () => {\n removeCallback(appConfig, callback);\n };\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from '@firebase/app-types';\nimport { FirebaseError } from '@firebase/util';\nimport { AppConfig } from '../interfaces/app-config';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\nexport function extractAppConfig(app: FirebaseApp): AppConfig {\n if (!app || !app.options) {\n throw getMissingValueError('App Configuration');\n }\n\n if (!app.name) {\n throw getMissingValueError('App Name');\n }\n\n // Required app config keys\n const configKeys: Array = [\n 'projectId',\n 'apiKey',\n 'appId'\n ];\n\n for (const keyName of configKeys) {\n if (!app.options[keyName]) {\n throw getMissingValueError(keyName);\n }\n }\n\n return {\n appName: app.name,\n projectId: app.options.projectId!,\n apiKey: app.options.apiKey!,\n appId: app.options.appId!\n };\n}\n\nfunction getMissingValueError(valueName: string): FirebaseError {\n return ERROR_FACTORY.create(ErrorCode.MISSING_APP_CONFIG_VALUES, {\n valueName\n });\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getInstallationEntry } from '../helpers/get-installation-entry';\nimport { refreshAuthToken } from '../helpers/refresh-auth-token';\nimport { FirebaseDependencies } from '../interfaces/firebase-dependencies';\n\nexport async function getId(\n dependencies: FirebaseDependencies\n): Promise {\n const { installationEntry, registrationPromise } = await getInstallationEntry(\n dependencies.appConfig\n );\n\n if (registrationPromise) {\n registrationPromise.catch(console.error);\n } else {\n // If the installation is already registered, update the authentication\n // token if needed.\n refreshAuthToken(dependencies).catch(console.error);\n }\n\n return installationEntry.fid;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { deleteInstallationRequest } from '../api/delete-installation-request';\nimport { remove, update } from '../helpers/idb-manager';\nimport { FirebaseDependencies } from '../interfaces/firebase-dependencies';\nimport { RequestStatus } from '../interfaces/installation-entry';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\nexport async function deleteInstallation(\n dependencies: FirebaseDependencies\n): Promise {\n const { appConfig } = dependencies;\n\n const entry = await update(appConfig, oldEntry => {\n if (oldEntry && oldEntry.registrationStatus === RequestStatus.NOT_STARTED) {\n // Delete the unregistered entry without sending a deleteInstallation request.\n return undefined;\n }\n return oldEntry;\n });\n\n if (entry) {\n if (entry.registrationStatus === RequestStatus.IN_PROGRESS) {\n // Can't delete while trying to register.\n throw ERROR_FACTORY.create(ErrorCode.DELETE_PENDING_REGISTRATION);\n } else if (entry.registrationStatus === RequestStatus.COMPLETED) {\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(ErrorCode.APP_OFFLINE);\n } else {\n await deleteInstallationRequest(appConfig, entry);\n await remove(appConfig);\n }\n }\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum ErrorCode {\n MISSING_APP_CONFIG_VALUES = 'missing-app-config-values',\n AVAILABLE_IN_WINDOW = 'only-available-in-window',\n AVAILABLE_IN_SW = 'only-available-in-sw',\n PERMISSION_DEFAULT = 'permission-default',\n PERMISSION_BLOCKED = 'permission-blocked',\n UNSUPPORTED_BROWSER = 'unsupported-browser',\n FAILED_DEFAULT_REGISTRATION = 'failed-service-worker-registration',\n TOKEN_SUBSCRIBE_FAILED = 'token-subscribe-failed',\n TOKEN_SUBSCRIBE_NO_TOKEN = 'token-subscribe-no-token',\n TOKEN_UNSUBSCRIBE_FAILED = 'token-unsubscribe-failed',\n TOKEN_UPDATE_FAILED = 'token-update-failed',\n TOKEN_UPDATE_NO_TOKEN = 'token-update-no-token',\n INVALID_BG_HANDLER = 'invalid-bg-handler',\n USE_SW_AFTER_GET_TOKEN = 'use-sw-after-get-token',\n INVALID_SW_REGISTRATION = 'invalid-sw-registration',\n USE_VAPID_KEY_AFTER_GET_TOKEN = 'use-vapid-key-after-get-token',\n INVALID_VAPID_KEY = 'invalid-vapid-key'\n}\n\nexport const ERROR_MAP: ErrorMap = {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]:\n 'Missing App configuration value: \"{$valueName}\"',\n [ErrorCode.AVAILABLE_IN_WINDOW]:\n 'This method is available in a Window context.',\n [ErrorCode.AVAILABLE_IN_SW]:\n 'This method is available in a service worker context.',\n [ErrorCode.PERMISSION_DEFAULT]:\n 'The notification permission was not granted and dismissed instead.',\n [ErrorCode.PERMISSION_BLOCKED]:\n 'The notification permission was not granted and blocked instead.',\n [ErrorCode.UNSUPPORTED_BROWSER]:\n \"This browser doesn't support the API's required to use the firebase SDK.\",\n [ErrorCode.FAILED_DEFAULT_REGISTRATION]:\n 'We are unable to register the default service worker. {$browserErrorMessage}',\n [ErrorCode.TOKEN_SUBSCRIBE_FAILED]:\n 'A problem occured while subscribing the user to FCM: {$errorInfo}',\n [ErrorCode.TOKEN_SUBSCRIBE_NO_TOKEN]:\n 'FCM returned no token when subscribing the user to push.',\n [ErrorCode.TOKEN_UNSUBSCRIBE_FAILED]:\n 'A problem occured while unsubscribing the ' +\n 'user from FCM: {$errorInfo}',\n [ErrorCode.TOKEN_UPDATE_FAILED]:\n 'A problem occured while updating the user from FCM: {$errorInfo}',\n [ErrorCode.TOKEN_UPDATE_NO_TOKEN]:\n 'FCM returned no token when updating the user to push.',\n [ErrorCode.USE_SW_AFTER_GET_TOKEN]:\n 'The useServiceWorker() method may only be called once and must be ' +\n 'called before calling getToken() to ensure your service worker is used.',\n [ErrorCode.INVALID_SW_REGISTRATION]:\n 'The input to useServiceWorker() must be a ServiceWorkerRegistration.',\n [ErrorCode.INVALID_BG_HANDLER]:\n 'The input to setBackgroundMessageHandler() must be a function.',\n [ErrorCode.INVALID_VAPID_KEY]: 'The public VAPID key must be a string.',\n [ErrorCode.USE_VAPID_KEY_AFTER_GET_TOKEN]:\n 'The usePublicVapidKey() method may only be called once and must be ' +\n 'called before calling getToken() to ensure your VAPID key is used.'\n};\n\ninterface ErrorParams {\n [ErrorCode.MISSING_APP_CONFIG_VALUES]: {\n valueName: string;\n };\n [ErrorCode.FAILED_DEFAULT_REGISTRATION]: { browserErrorMessage: string };\n [ErrorCode.TOKEN_SUBSCRIBE_FAILED]: { errorInfo: string };\n [ErrorCode.TOKEN_UNSUBSCRIBE_FAILED]: { errorInfo: string };\n [ErrorCode.TOKEN_UPDATE_FAILED]: { errorInfo: string };\n}\n\nexport const ERROR_FACTORY = new ErrorFactory(\n 'messaging',\n 'Messaging',\n ERROR_MAP\n);\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, FirebaseOptions } from '@firebase/app-types';\nimport { FirebaseError } from '@firebase/util';\nimport { AppConfig } from '../interfaces/app-config';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\nexport function extractAppConfig(app: FirebaseApp): AppConfig {\n if (!app || !app.options) {\n throw getMissingValueError('App Configuration Object');\n }\n\n if (!app.name) {\n throw getMissingValueError('App Name');\n }\n\n // Required app config keys\n const configKeys: ReadonlyArray = [\n 'projectId',\n 'apiKey',\n 'appId',\n 'messagingSenderId'\n ];\n\n const { options } = app;\n for (const keyName of configKeys) {\n if (!options[keyName]) {\n throw getMissingValueError(keyName);\n }\n }\n\n return {\n appName: app.name,\n projectId: options.projectId!,\n apiKey: options.apiKey!,\n appId: options.appId!,\n senderId: options.messagingSenderId!\n };\n}\n\nfunction getMissingValueError(valueName: string): FirebaseError {\n return ERROR_FACTORY.create(ErrorCode.MISSING_APP_CONFIG_VALUES, {\n valueName\n });\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function arrayToBase64(array: Uint8Array | ArrayBuffer): string {\n const uint8Array = new Uint8Array(array);\n const base64String = btoa(String.fromCharCode(...uint8Array));\n return base64String\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}\n\nexport function base64ToArray(base64String: string): Uint8Array {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { openDb, deleteDb } from 'idb';\nimport { TokenDetails } from '../interfaces/token-details';\nimport { arrayToBase64 } from './array-base64-translator';\n\n// https://github.com/firebase/firebase-js-sdk/blob/7857c212f944a2a9eb421fd4cb7370181bc034b5/packages/messaging/src/interfaces/token-details.ts\nexport interface V2TokenDetails {\n fcmToken: string;\n swScope: string;\n vapidKey: string | Uint8Array;\n subscription: PushSubscription;\n fcmSenderId: string;\n fcmPushSet: string;\n createTime?: number;\n endpoint?: string;\n auth?: string;\n p256dh?: string;\n}\n\n// https://github.com/firebase/firebase-js-sdk/blob/6b5b15ce4ea3df5df5df8a8b33a4e41e249c7715/packages/messaging/src/interfaces/token-details.ts\nexport interface V3TokenDetails {\n fcmToken: string;\n swScope: string;\n vapidKey: Uint8Array;\n fcmSenderId: string;\n fcmPushSet: string;\n endpoint: string;\n auth: ArrayBuffer;\n p256dh: ArrayBuffer;\n createTime: number;\n}\n\n// https://github.com/firebase/firebase-js-sdk/blob/9567dba664732f681fa7fe60f5b7032bb1daf4c9/packages/messaging/src/interfaces/token-details.ts\nexport interface V4TokenDetails {\n fcmToken: string;\n swScope: string;\n vapidKey: Uint8Array;\n fcmSenderId: string;\n endpoint: string;\n auth: ArrayBufferLike;\n p256dh: ArrayBufferLike;\n createTime: number;\n}\n\nconst OLD_DB_NAME = 'fcm_token_details_db';\n/**\n * The last DB version of 'fcm_token_details_db' was 4. This is one higher,\n * so that the upgrade callback is called for all versions of the old DB.\n */\nconst OLD_DB_VERSION = 5;\nconst OLD_OBJECT_STORE_NAME = 'fcm_token_object_Store';\n\nexport async function migrateOldDatabase(\n senderId: string\n): Promise {\n if ('databases' in indexedDB) {\n // indexedDb.databases() is an IndexedDB v3 API\n // and does not exist in all browsers.\n // TODO: Remove typecast when it lands in TS types.\n const databases = await (indexedDB as {\n databases(): Promise>;\n }).databases();\n const dbNames = databases.map(db => db.name);\n\n if (!dbNames.includes(OLD_DB_NAME)) {\n // old DB didn't exist, no need to open.\n return null;\n }\n }\n\n let tokenDetails: TokenDetails | null = null;\n\n const db = await openDb(OLD_DB_NAME, OLD_DB_VERSION, async db => {\n if (db.oldVersion < 2) {\n // Database too old, skip migration.\n return;\n }\n\n if (!db.objectStoreNames.contains(OLD_OBJECT_STORE_NAME)) {\n // Database did not exist. Nothing to do.\n return;\n }\n\n const objectStore = db.transaction.objectStore(OLD_OBJECT_STORE_NAME);\n const value = await objectStore.index('fcmSenderId').get(senderId);\n await objectStore.clear();\n\n if (!value) {\n // No entry in the database, nothing to migrate.\n return;\n }\n\n if (db.oldVersion === 2) {\n const oldDetails = value as V2TokenDetails;\n\n if (!oldDetails.auth || !oldDetails.p256dh || !oldDetails.endpoint) {\n return;\n }\n\n tokenDetails = {\n token: oldDetails.fcmToken,\n createTime: oldDetails.createTime ?? Date.now(),\n subscriptionOptions: {\n auth: oldDetails.auth,\n p256dh: oldDetails.p256dh,\n endpoint: oldDetails.endpoint,\n swScope: oldDetails.swScope,\n vapidKey:\n typeof oldDetails.vapidKey === 'string'\n ? oldDetails.vapidKey\n : arrayToBase64(oldDetails.vapidKey)\n }\n };\n } else if (db.oldVersion === 3) {\n const oldDetails = value as V3TokenDetails;\n\n tokenDetails = {\n token: oldDetails.fcmToken,\n createTime: oldDetails.createTime,\n subscriptionOptions: {\n auth: arrayToBase64(oldDetails.auth),\n p256dh: arrayToBase64(oldDetails.p256dh),\n endpoint: oldDetails.endpoint,\n swScope: oldDetails.swScope,\n vapidKey: arrayToBase64(oldDetails.vapidKey)\n }\n };\n } else if (db.oldVersion === 4) {\n const oldDetails = value as V4TokenDetails;\n\n tokenDetails = {\n token: oldDetails.fcmToken,\n createTime: oldDetails.createTime,\n subscriptionOptions: {\n auth: arrayToBase64(oldDetails.auth),\n p256dh: arrayToBase64(oldDetails.p256dh),\n endpoint: oldDetails.endpoint,\n swScope: oldDetails.swScope,\n vapidKey: arrayToBase64(oldDetails.vapidKey)\n }\n };\n }\n });\n db.close();\n\n // Delete all old databases.\n await deleteDb(OLD_DB_NAME);\n await deleteDb('fcm_vapid_details_db');\n await deleteDb('undefined');\n\n return checkTokenDetails(tokenDetails) ? tokenDetails : null;\n}\n\nfunction checkTokenDetails(\n tokenDetails: TokenDetails | null\n): tokenDetails is TokenDetails {\n if (!tokenDetails || !tokenDetails.subscriptionOptions) {\n return false;\n }\n const { subscriptionOptions } = tokenDetails;\n return (\n typeof tokenDetails.createTime === 'number' &&\n tokenDetails.createTime > 0 &&\n typeof tokenDetails.token === 'string' &&\n tokenDetails.token.length > 0 &&\n typeof subscriptionOptions.auth === 'string' &&\n subscriptionOptions.auth.length > 0 &&\n typeof subscriptionOptions.p256dh === 'string' &&\n subscriptionOptions.p256dh.length > 0 &&\n typeof subscriptionOptions.endpoint === 'string' &&\n subscriptionOptions.endpoint.length > 0 &&\n typeof subscriptionOptions.swScope === 'string' &&\n subscriptionOptions.swScope.length > 0 &&\n typeof subscriptionOptions.vapidKey === 'string' &&\n subscriptionOptions.vapidKey.length > 0\n );\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DB, openDb, deleteDb } from 'idb';\nimport { TokenDetails } from '../interfaces/token-details';\nimport { migrateOldDatabase } from './migrate-old-database';\nimport { FirebaseInternalDependencies } from '../interfaces/internal-dependencies';\n\n// Exported for tests.\nexport const DATABASE_NAME = 'firebase-messaging-database';\nconst DATABASE_VERSION = 1;\nconst OBJECT_STORE_NAME = 'firebase-messaging-store';\n\nlet dbPromise: Promise | null = null;\nfunction getDbPromise(): Promise {\n if (!dbPromise) {\n dbPromise = openDb(DATABASE_NAME, DATABASE_VERSION, upgradeDb => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (upgradeDb.oldVersion) {\n case 0:\n upgradeDb.createObjectStore(OBJECT_STORE_NAME);\n }\n });\n }\n return dbPromise;\n}\n\n/** Gets record(s) from the objectStore that match the given key. */\nexport async function dbGet(\n firebaseDependencies: FirebaseInternalDependencies\n): Promise {\n const key = getKey(firebaseDependencies);\n const db = await getDbPromise();\n const tokenDetails = await db\n .transaction(OBJECT_STORE_NAME)\n .objectStore(OBJECT_STORE_NAME)\n .get(key);\n\n if (tokenDetails) {\n return tokenDetails;\n } else {\n // Check if there is a tokenDetails object in the old DB.\n const oldTokenDetails = await migrateOldDatabase(\n firebaseDependencies.appConfig.senderId\n );\n if (oldTokenDetails) {\n await dbSet(firebaseDependencies, oldTokenDetails);\n return oldTokenDetails;\n }\n }\n}\n\n/** Assigns or overwrites the record for the given key with the given value. */\nexport async function dbSet(\n firebaseDependencies: FirebaseInternalDependencies,\n tokenDetails: TokenDetails\n): Promise {\n const key = getKey(firebaseDependencies);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).put(tokenDetails, key);\n await tx.complete;\n return tokenDetails;\n}\n\n/** Removes record(s) from the objectStore that match the given key. */\nexport async function dbRemove(\n firebaseDependencies: FirebaseInternalDependencies\n): Promise {\n const key = getKey(firebaseDependencies);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\n await tx.complete;\n}\n\n/** Deletes the DB. Useful for tests. */\nexport async function dbDelete(): Promise {\n if (dbPromise) {\n (await dbPromise).close();\n await deleteDb(DATABASE_NAME);\n dbPromise = null;\n }\n}\n\nfunction getKey({ appConfig }: FirebaseInternalDependencies): string {\n return appConfig.appId;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_SW_PATH = '/firebase-messaging-sw.js';\nexport const DEFAULT_SW_SCOPE = '/firebase-cloud-messaging-push-scope';\n\nexport const DEFAULT_VAPID_KEY =\n 'BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4';\n\nexport const ENDPOINT = 'https://fcmregistrations.googleapis.com/v1';\n\n/** Key of FCM Payload in Notification's data field. */\nexport const FCM_MSG = 'FCM_MSG';\n\nexport const CONSOLE_CAMPAIGN_ID = 'google.c.a.c_id';\nexport const CONSOLE_CAMPAIGN_NAME = 'google.c.a.c_l';\nexport const CONSOLE_CAMPAIGN_TIME = 'google.c.a.ts';\n/** Set to '1' if Analytics is enabled for the campaign */\nexport const CONSOLE_CAMPAIGN_ANALYTICS_ENABLED = 'google.c.a.e';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorCode, ERROR_FACTORY } from '../util/errors';\nimport { DEFAULT_VAPID_KEY, ENDPOINT } from '../util/constants';\nimport { TokenDetails, SubscriptionOptions } from '../interfaces/token-details';\nimport { FirebaseInternalDependencies } from '../interfaces/internal-dependencies';\nimport { AppConfig } from '../interfaces/app-config';\n\nexport interface ApiResponse {\n token?: string;\n error?: { message: string };\n}\n\nexport interface ApiRequestBody {\n web: {\n endpoint: string;\n p256dh: string;\n auth: string;\n applicationPubKey?: string;\n };\n}\n\nexport async function requestGetToken(\n firebaseDependencies: FirebaseInternalDependencies,\n subscriptionOptions: SubscriptionOptions\n): Promise {\n const headers = await getHeaders(firebaseDependencies);\n const body = getBody(subscriptionOptions);\n\n const subscribeOptions = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n\n let responseData: ApiResponse;\n try {\n const response = await fetch(\n getEndpoint(firebaseDependencies.appConfig),\n subscribeOptions\n );\n responseData = await response.json();\n } catch (err) {\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_SUBSCRIBE_FAILED, {\n errorInfo: err\n });\n }\n\n if (responseData.error) {\n const message = responseData.error.message;\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_SUBSCRIBE_FAILED, {\n errorInfo: message\n });\n }\n\n if (!responseData.token) {\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_SUBSCRIBE_NO_TOKEN);\n }\n\n return responseData.token;\n}\n\nexport async function requestUpdateToken(\n firebaseDependencies: FirebaseInternalDependencies,\n tokenDetails: TokenDetails\n): Promise {\n const headers = await getHeaders(firebaseDependencies);\n const body = getBody(tokenDetails.subscriptionOptions!);\n\n const updateOptions = {\n method: 'PATCH',\n headers,\n body: JSON.stringify(body)\n };\n\n let responseData: ApiResponse;\n try {\n const response = await fetch(\n `${getEndpoint(firebaseDependencies.appConfig)}/${tokenDetails.token}`,\n updateOptions\n );\n responseData = await response.json();\n } catch (err) {\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_UPDATE_FAILED, {\n errorInfo: err\n });\n }\n\n if (responseData.error) {\n const message = responseData.error.message;\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_UPDATE_FAILED, {\n errorInfo: message\n });\n }\n\n if (!responseData.token) {\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_UPDATE_NO_TOKEN);\n }\n\n return responseData.token;\n}\n\nexport async function requestDeleteToken(\n firebaseDependencies: FirebaseInternalDependencies,\n token: string\n): Promise {\n const headers = await getHeaders(firebaseDependencies);\n\n const unsubscribeOptions = {\n method: 'DELETE',\n headers\n };\n\n try {\n const response = await fetch(\n `${getEndpoint(firebaseDependencies.appConfig)}/${token}`,\n unsubscribeOptions\n );\n const responseData: ApiResponse = await response.json();\n if (responseData.error) {\n const message = responseData.error.message;\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_UNSUBSCRIBE_FAILED, {\n errorInfo: message\n });\n }\n } catch (err) {\n throw ERROR_FACTORY.create(ErrorCode.TOKEN_UNSUBSCRIBE_FAILED, {\n errorInfo: err\n });\n }\n}\n\nfunction getEndpoint({ projectId }: AppConfig): string {\n return `${ENDPOINT}/projects/${projectId!}/registrations`;\n}\n\nasync function getHeaders({\n appConfig,\n installations\n}: FirebaseInternalDependencies): Promise {\n const authToken = await installations.getToken();\n\n return new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'x-goog-api-key': appConfig.apiKey!,\n 'x-goog-firebase-installations-auth': `FIS ${authToken}`\n });\n}\n\nfunction getBody({\n p256dh,\n auth,\n endpoint,\n vapidKey\n}: SubscriptionOptions): ApiRequestBody {\n const body: ApiRequestBody = {\n web: {\n endpoint,\n auth,\n p256dh\n }\n };\n\n if (vapidKey !== DEFAULT_VAPID_KEY) {\n body.web.applicationPubKey = vapidKey;\n }\n\n return body;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { dbGet, dbSet, dbRemove } from '../helpers/idb-manager';\nimport { FirebaseInternalDependencies } from '../interfaces/internal-dependencies';\nimport { TokenDetails, SubscriptionOptions } from '../interfaces/token-details';\nimport { requestUpdateToken, requestGetToken, requestDeleteToken } from './api';\nimport { arrayToBase64, base64ToArray} from '../helpers/array-base64-translator';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\n\n/** UpdateRegistration will be called once every week. */\nconst TOKEN_EXPIRATION_MS = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport async function getToken(\n firebaseDependencies: FirebaseInternalDependencies,\n swRegistration: ServiceWorkerRegistration,\n vapidKey: string\n): Promise {\n if (Notification.permission !== 'granted') {\n throw ERROR_FACTORY.create(ErrorCode.PERMISSION_BLOCKED);\n }\n\n // If a PushSubscription exists it's returned, otherwise a new subscription\n // is generated and returned.\n const pushSubscription = await getPushSubscription(swRegistration, vapidKey);\n const tokenDetails = await dbGet(firebaseDependencies);\n\n const subscriptionOptions: SubscriptionOptions = {\n vapidKey,\n swScope: swRegistration.scope,\n endpoint: pushSubscription.endpoint,\n auth: arrayToBase64(pushSubscription.getKey('auth')!),\n p256dh: arrayToBase64(pushSubscription.getKey('p256dh')!)\n };\n\n if (!tokenDetails) {\n // No token, get a new one.\n return getNewToken(firebaseDependencies, subscriptionOptions);\n } else if (\n !isTokenValid(tokenDetails.subscriptionOptions!, subscriptionOptions)\n ) {\n // Invalid token, get a new one.\n try {\n await requestDeleteToken(firebaseDependencies, tokenDetails.token);\n } catch (e) {\n // Suppress errors because of #2364\n console.warn(e);\n }\n\n return getNewToken(firebaseDependencies, subscriptionOptions);\n } else if (Date.now() >= tokenDetails.createTime + TOKEN_EXPIRATION_MS) {\n // Weekly token refresh\n return updateToken(\n {\n token: tokenDetails.token,\n createTime: Date.now(),\n subscriptionOptions\n },\n firebaseDependencies,\n swRegistration\n );\n } else {\n // Valid token, nothing to do.\n return tokenDetails.token;\n }\n}\n\n/**\n * This method deletes the token from the database, unsubscribes the token from\n * FCM, and unregisters the push subscription if it exists.\n */\nexport async function deleteToken(\n firebaseDependencies: FirebaseInternalDependencies,\n swRegistration: ServiceWorkerRegistration\n): Promise {\n const tokenDetails = await dbGet(firebaseDependencies);\n if (tokenDetails) {\n await requestDeleteToken(firebaseDependencies, tokenDetails.token);\n await dbRemove(firebaseDependencies);\n }\n\n // Unsubscribe from the push subscription.\n const pushSubscription = await swRegistration.pushManager.getSubscription();\n if (pushSubscription) {\n return pushSubscription.unsubscribe();\n }\n\n // If there's no SW, consider it a success.\n return true;\n}\n\nasync function updateToken(\n tokenDetails: TokenDetails,\n firebaseDependencies: FirebaseInternalDependencies,\n swRegistration: ServiceWorkerRegistration\n): Promise {\n try {\n const updatedToken = await requestUpdateToken(\n firebaseDependencies,\n tokenDetails\n );\n\n const updatedTokenDetails: TokenDetails = {\n token: updatedToken,\n createTime: Date.now(),\n ...tokenDetails\n };\n\n await dbSet(firebaseDependencies, updatedTokenDetails);\n return updatedToken;\n } catch (e) {\n await deleteToken(firebaseDependencies, swRegistration);\n throw e;\n }\n}\n\nasync function getNewToken(\n firebaseDependencies: FirebaseInternalDependencies,\n subscriptionOptions: SubscriptionOptions\n): Promise {\n const token = await requestGetToken(\n firebaseDependencies,\n subscriptionOptions\n );\n const tokenDetails: TokenDetails = {\n token,\n createTime: Date.now(),\n subscriptionOptions\n };\n await dbSet(firebaseDependencies, tokenDetails);\n return tokenDetails.token;\n}\n\n/**\n * Gets a PushSubscription for the current user.\n */\nasync function getPushSubscription(\n swRegistration: ServiceWorkerRegistration,\n vapidKey: string\n): Promise {\n const subscription = await swRegistration.pushManager.getSubscription();\n if (subscription) {\n return subscription;\n }\n return swRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n // Chrome <= 75 doesn't support base64-encoded VAPID key. For backward compatibility, VAPID key\n // submitted to pushManager#subscribe must be of type Uint8Array.\n applicationServerKey: base64ToArray(vapidKey)\n });\n}\n\n/**\n * Checks if the saved tokenDetails object matches the configuration provided.\n */\nfunction isTokenValid(\n dbOptions: SubscriptionOptions,\n currentOptions: SubscriptionOptions\n): boolean {\n const isVapidKeyEqual = currentOptions.vapidKey === dbOptions.vapidKey;\n const isEndpointEqual = currentOptions.endpoint === dbOptions.endpoint;\n const isAuthEqual = currentOptions.auth === dbOptions.auth;\n const isP256dhEqual = currentOptions.p256dh === dbOptions.p256dh;\n\n return isVapidKeyEqual && isEndpointEqual && isAuthEqual && isP256dhEqual;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MessagePayload } from './message-payload';\n\nexport enum MessageType {\n PUSH_RECEIVED = 'push-received',\n NOTIFICATION_CLICKED = 'notification-clicked'\n}\n\nexport interface InternalMessage {\n firebaseMessaging: {\n type: MessageType;\n payload: MessagePayload;\n };\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConsoleMessageData } from '../interfaces/message-payload';\nimport { CONSOLE_CAMPAIGN_ID } from '../util/constants';\n\nexport function isConsoleMessage(data: unknown): data is ConsoleMessageData {\n // This message has a campaign ID, meaning it was sent using the\n // Firebase Console.\n return typeof data === 'object' && !!data && CONSOLE_CAMPAIGN_ID in data;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getToken, deleteToken } from '../core/token-management';\nimport { FirebaseInternalDependencies } from '../interfaces/internal-dependencies';\nimport { FirebaseMessaging } from '@firebase/messaging-types';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\nimport { NextFn, Observer, Unsubscribe } from '@firebase/util';\nimport { InternalMessage, MessageType } from '../interfaces/internal-message';\nimport {\n CONSOLE_CAMPAIGN_ID,\n CONSOLE_CAMPAIGN_ANALYTICS_ENABLED,\n CONSOLE_CAMPAIGN_NAME,\n CONSOLE_CAMPAIGN_TIME,\n DEFAULT_SW_PATH,\n DEFAULT_SW_SCOPE,\n DEFAULT_VAPID_KEY\n} from '../util/constants';\nimport { FirebaseApp } from '@firebase/app-types';\nimport { ConsoleMessageData } from '../interfaces/message-payload';\nimport { isConsoleMessage } from '../helpers/is-console-message';\nimport { FirebaseService } from '@firebase/app-types/private';\n\nexport class WindowController implements FirebaseMessaging, FirebaseService {\n private vapidKey: string | null = null;\n private swRegistration?: ServiceWorkerRegistration;\n private onMessageCallback: NextFn | null = null;\n\n constructor(\n private readonly firebaseDependencies: FirebaseInternalDependencies\n ) {\n navigator.serviceWorker.addEventListener('message', e =>\n this.messageEventListener(e)\n );\n }\n\n get app(): FirebaseApp {\n return this.firebaseDependencies.app;\n }\n\n async getToken(): Promise {\n if (!this.vapidKey) {\n this.vapidKey = DEFAULT_VAPID_KEY;\n }\n\n const swRegistration = await this.getServiceWorkerRegistration();\n\n // Check notification permission.\n if (Notification.permission === 'default') {\n // The user hasn't allowed or denied notifications yet. Ask them.\n await Notification.requestPermission();\n }\n\n if (Notification.permission !== 'granted') {\n throw ERROR_FACTORY.create(ErrorCode.PERMISSION_BLOCKED);\n }\n\n return getToken(this.firebaseDependencies, swRegistration, this.vapidKey);\n }\n\n async deleteToken(): Promise {\n const swRegistration = await this.getServiceWorkerRegistration();\n\n return deleteToken(this.firebaseDependencies, swRegistration);\n }\n\n /**\n * Request permission if it is not currently granted.\n *\n * @return Resolves if the permission was granted, rejects otherwise.\n *\n * @deprecated Use Notification.requestPermission() instead.\n * https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission\n */\n async requestPermission(): Promise {\n if (Notification.permission === 'granted') {\n return;\n }\n\n const permissionResult = await Notification.requestPermission();\n if (permissionResult === 'granted') {\n return;\n } else if (permissionResult === 'denied') {\n throw ERROR_FACTORY.create(ErrorCode.PERMISSION_BLOCKED);\n } else {\n throw ERROR_FACTORY.create(ErrorCode.PERMISSION_DEFAULT);\n }\n }\n\n // TODO: Deprecate this and make VAPID key a parameter in getToken.\n usePublicVapidKey(vapidKey: string): void {\n if (this.vapidKey !== null) {\n throw ERROR_FACTORY.create(ErrorCode.USE_VAPID_KEY_AFTER_GET_TOKEN);\n }\n\n if (typeof vapidKey !== 'string' || vapidKey.length === 0) {\n throw ERROR_FACTORY.create(ErrorCode.INVALID_VAPID_KEY);\n }\n\n this.vapidKey = vapidKey;\n }\n\n useServiceWorker(swRegistration: ServiceWorkerRegistration): void {\n if (!(swRegistration instanceof ServiceWorkerRegistration)) {\n throw ERROR_FACTORY.create(ErrorCode.INVALID_SW_REGISTRATION);\n }\n\n if (this.swRegistration) {\n throw ERROR_FACTORY.create(ErrorCode.USE_SW_AFTER_GET_TOKEN);\n }\n\n this.swRegistration = swRegistration;\n }\n\n /**\n * @param nextOrObserver An observer object or a function triggered on\n * message.\n * @return The unsubscribe function for the observer.\n */\n // TODO: Simplify this to only accept a function and not an Observer.\n onMessage(nextOrObserver: NextFn | Observer): Unsubscribe {\n this.onMessageCallback =\n typeof nextOrObserver === 'function'\n ? nextOrObserver\n : nextOrObserver.next;\n\n return () => {\n this.onMessageCallback = null;\n };\n }\n\n setBackgroundMessageHandler(): void {\n throw ERROR_FACTORY.create(ErrorCode.AVAILABLE_IN_SW);\n }\n\n // Unimplemented\n onTokenRefresh(): Unsubscribe {\n return () => {};\n }\n\n /**\n * Creates or updates the default service worker registration.\n * @return The service worker registration to be used for the push service.\n */\n private async getServiceWorkerRegistration(): Promise<\n ServiceWorkerRegistration\n > {\n if (!this.swRegistration) {\n try {\n this.swRegistration = await navigator.serviceWorker.register(\n DEFAULT_SW_PATH,\n {\n scope: DEFAULT_SW_SCOPE\n }\n );\n\n // The timing when browser updates sw when sw has an update is unreliable by my experiment.\n // It leads to version conflict when the SDK upgrades to a newer version in the main page, but\n // sw is stuck with the old version. For example, https://github.com/firebase/firebase-js-sdk/issues/2590\n // The following line reliably updates sw if there was an update.\n this.swRegistration.update().catch(() => {\n /* it is non blocking and we don't care if it failed */\n });\n } catch (e) {\n throw ERROR_FACTORY.create(ErrorCode.FAILED_DEFAULT_REGISTRATION, {\n browserErrorMessage: e.message\n });\n }\n }\n\n return this.swRegistration;\n }\n\n private async messageEventListener(event: MessageEvent): Promise {\n if (!event.data?.firebaseMessaging) {\n // Not a message from FCM\n return;\n }\n\n const { type, payload } = (event.data as InternalMessage).firebaseMessaging;\n\n if (this.onMessageCallback && type === MessageType.PUSH_RECEIVED) {\n this.onMessageCallback(payload);\n }\n\n const { data } = payload;\n if (\n isConsoleMessage(data) &&\n data[CONSOLE_CAMPAIGN_ANALYTICS_ENABLED] === '1'\n ) {\n // Analytics is enabled on this message, so we should log it.\n await this.logEvent(type, data);\n }\n }\n\n private async logEvent(\n messageType: MessageType,\n data: ConsoleMessageData\n ): Promise {\n const eventType = getEventType(messageType);\n const analytics = await this.firebaseDependencies.analyticsProvider.get();\n analytics.logEvent(eventType, {\n /* eslint-disable camelcase */\n message_id: data[CONSOLE_CAMPAIGN_ID],\n message_name: data[CONSOLE_CAMPAIGN_NAME],\n message_time: data[CONSOLE_CAMPAIGN_TIME],\n message_device_time: Math.floor(Date.now() / 1000)\n /* eslint-enable camelcase */\n });\n }\n}\n\nfunction getEventType(messageType: MessageType): string {\n switch (messageType) {\n case MessageType.NOTIFICATION_CLICKED:\n return 'notification_open';\n case MessageType.PUSH_RECEIVED:\n return 'notification_foreground';\n default:\n throw new Error();\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { deleteToken, getToken } from '../core/token-management';\nimport { FirebaseInternalDependencies } from '../interfaces/internal-dependencies';\nimport { FirebaseMessaging } from '@firebase/messaging-types';\nimport { ERROR_FACTORY, ErrorCode } from '../util/errors';\nimport {\n MessagePayload,\n NotificationDetails\n} from '../interfaces/message-payload';\nimport { FCM_MSG, DEFAULT_VAPID_KEY } from '../util/constants';\nimport { MessageType, InternalMessage } from '../interfaces/internal-message';\nimport { dbGet } from '../helpers/idb-manager';\nimport { Unsubscribe } from '@firebase/util';\nimport { sleep } from '../helpers/sleep';\nimport { FirebaseApp } from '@firebase/app-types';\nimport { isConsoleMessage } from '../helpers/is-console-message';\nimport { FirebaseService } from '@firebase/app-types/private';\n\n// Let TS know that this is a service worker\ndeclare const self: ServiceWorkerGlobalScope;\n\nexport type BgMessageHandler = (payload: MessagePayload) => unknown;\n\nexport class SwController implements FirebaseMessaging, FirebaseService {\n private vapidKey: string | null = null;\n private bgMessageHandler: BgMessageHandler | null = null;\n\n constructor(\n private readonly firebaseDependencies: FirebaseInternalDependencies\n ) {\n self.addEventListener('push', e => {\n e.waitUntil(this.onPush(e));\n });\n self.addEventListener('pushsubscriptionchange', e => {\n e.waitUntil(this.onSubChange(e));\n });\n self.addEventListener('notificationclick', e => {\n e.waitUntil(this.onNotificationClick(e));\n });\n }\n\n get app(): FirebaseApp {\n return this.firebaseDependencies.app;\n }\n\n /**\n * Calling setBackgroundMessageHandler will opt in to some specific\n * behaviours.\n * 1.) If a notification doesn't need to be shown due to a window already\n * being visible, then push messages will be sent to the page.\n * 2.) If a notification needs to be shown, and the message contains no\n * notification data this method will be called\n * and the promise it returns will be passed to event.waitUntil.\n * If you do not set this callback then all push messages will let and the\n * developer can handle them in a their own 'push' event callback\n *\n * @param callback The callback to be called when a push message is received\n * and a notification must be shown. The callback will be given the data from\n * the push message.\n */\n setBackgroundMessageHandler(callback: BgMessageHandler): void {\n if (!callback || typeof callback !== 'function') {\n throw ERROR_FACTORY.create(ErrorCode.INVALID_BG_HANDLER);\n }\n\n this.bgMessageHandler = callback;\n }\n\n // TODO: Remove getToken from SW Controller.\n // Calling this from an old SW can cause all kinds of trouble.\n async getToken(): Promise {\n if (!this.vapidKey) {\n // Call getToken using the current VAPID key if there already is a token.\n // This is needed because usePublicVapidKey was not available in SW.\n // It will be removed when vapidKey becomes a parameter of getToken, or\n // when getToken is removed from SW.\n const tokenDetails = await dbGet(this.firebaseDependencies);\n this.vapidKey =\n tokenDetails?.subscriptionOptions?.vapidKey ?? DEFAULT_VAPID_KEY;\n }\n\n return getToken(\n this.firebaseDependencies,\n self.registration,\n this.vapidKey\n );\n }\n\n // TODO: Remove deleteToken from SW Controller.\n // Calling this from an old SW can cause all kinds of trouble.\n deleteToken(): Promise {\n return deleteToken(this.firebaseDependencies, self.registration);\n }\n\n requestPermission(): Promise {\n throw ERROR_FACTORY.create(ErrorCode.AVAILABLE_IN_WINDOW);\n }\n\n // TODO: Deprecate this and make VAPID key a parameter in getToken.\n // TODO: Remove this together with getToken from SW Controller.\n usePublicVapidKey(vapidKey: string): void {\n if (this.vapidKey !== null) {\n throw ERROR_FACTORY.create(ErrorCode.USE_VAPID_KEY_AFTER_GET_TOKEN);\n }\n\n if (typeof vapidKey !== 'string' || vapidKey.length === 0) {\n throw ERROR_FACTORY.create(ErrorCode.INVALID_VAPID_KEY);\n }\n\n this.vapidKey = vapidKey;\n }\n\n useServiceWorker(): void {\n throw ERROR_FACTORY.create(ErrorCode.AVAILABLE_IN_WINDOW);\n }\n\n onMessage(): Unsubscribe {\n throw ERROR_FACTORY.create(ErrorCode.AVAILABLE_IN_WINDOW);\n }\n\n onTokenRefresh(): Unsubscribe {\n throw ERROR_FACTORY.create(ErrorCode.AVAILABLE_IN_WINDOW);\n }\n\n /**\n * A handler for push events that shows notifications based on the content of\n * the payload.\n *\n * The payload must be a JSON-encoded Object with a `notification` key. The\n * value of the `notification` property will be used as the NotificationOptions\n * object passed to showNotification. Additionally, the `title` property of the\n * notification object will be used as the title.\n *\n * If there is no notification data in the payload then no notification will be\n * shown.\n */\n async onPush(event: PushEvent): Promise {\n const payload = getMessagePayload(event);\n if (!payload) {\n return;\n }\n\n const clientList = await getClientList();\n if (hasVisibleClients(clientList)) {\n // App in foreground. Send to page.\n return sendMessageToWindowClients(clientList, payload);\n }\n\n const notificationDetails = getNotificationData(payload);\n if (notificationDetails) {\n await showNotification(notificationDetails);\n } else if (this.bgMessageHandler) {\n await this.bgMessageHandler(payload);\n }\n }\n\n async onSubChange(event: PushSubscriptionChangeEvent): Promise {\n const { newSubscription } = event;\n if (!newSubscription) {\n // Subscription revoked, delete token\n await deleteToken(this.firebaseDependencies, self.registration);\n return;\n }\n\n const tokenDetails = await dbGet(this.firebaseDependencies);\n await deleteToken(this.firebaseDependencies, self.registration);\n await getToken(\n this.firebaseDependencies,\n self.registration,\n tokenDetails?.subscriptionOptions?.vapidKey ?? DEFAULT_VAPID_KEY\n );\n }\n\n async onNotificationClick(event: NotificationEvent): Promise {\n const payload: MessagePayload = event.notification?.data?.[FCM_MSG];\n if (!payload) {\n // Not an FCM notification, do nothing.\n return;\n } else if (event.action) {\n // User clicked on an action button.\n // This will allow devs to act on action button clicks by using a custom\n // onNotificationClick listener that they define.\n return;\n }\n\n // Prevent other listeners from receiving the event\n event.stopImmediatePropagation();\n event.notification.close();\n\n const link = getLink(payload);\n if (!link) {\n return;\n }\n\n let client = await getWindowClient(link);\n if (!client) {\n // Unable to find window client so need to open one.\n // This also focuses the opened client.\n client = await self.clients.openWindow(link);\n // Wait three seconds for the client to initialize and set up the message\n // handler so that it can receive the message.\n await sleep(3000);\n } else {\n client = await client.focus();\n }\n\n if (!client) {\n // Window Client will not be returned if it's for a third party origin.\n return;\n }\n\n const message = createNewMessage(MessageType.NOTIFICATION_CLICKED, payload);\n return client.postMessage(message);\n }\n}\n\nfunction getMessagePayload({ data }: PushEvent): MessagePayload | null {\n if (!data) {\n return null;\n }\n\n try {\n return data.json();\n } catch (err) {\n // Not JSON so not an FCM message.\n return null;\n }\n}\n\nfunction getNotificationData(\n payload: MessagePayload\n): NotificationDetails | undefined {\n if (!payload || typeof payload.notification !== 'object') {\n return;\n }\n\n const notificationInformation: NotificationDetails = {\n ...payload.notification\n };\n\n // Put the message payload under FCM_MSG name so we can identify the\n // notification as being an FCM notification vs a notification from\n // somewhere else (i.e. normal web push or developer generated\n // notification).\n notificationInformation.data = {\n ...payload.notification.data,\n [FCM_MSG]: payload\n };\n\n return notificationInformation;\n}\n\n/**\n * @param url The URL to look for when focusing a client.\n * @return Returns an existing window client or a newly opened WindowClient.\n */\nasync function getWindowClient(url: string): Promise {\n // Use URL to normalize the URL when comparing to windowClients.\n // This at least handles whether to include trailing slashes or not\n const parsedURL = new URL(url, self.location.href);\n\n const clientList = await getClientList();\n\n for (const client of clientList) {\n const parsedClientUrl = new URL(client.url, self.location.href);\n if (parsedClientUrl.host === parsedURL.host) {\n return client;\n }\n }\n\n return null;\n}\n\n/**\n * @returns If there is currently a visible WindowClient, this method will\n * resolve to true, otherwise false.\n */\nfunction hasVisibleClients(clientList: WindowClient[]): boolean {\n return clientList.some(\n client =>\n client.visibilityState === 'visible' &&\n // Ignore chrome-extension clients as that matches the background pages\n // of extensions, which are always considered visible for some reason.\n !client.url.startsWith('chrome-extension://')\n );\n}\n\n/**\n * @param payload The data from the push event that should be sent to all\n * available pages.\n * @returns Returns a promise that resolves once the message has been sent to\n * all WindowClients.\n */\nfunction sendMessageToWindowClients(\n clientList: WindowClient[],\n payload: MessagePayload\n): void {\n const message = createNewMessage(MessageType.PUSH_RECEIVED, payload);\n\n for (const client of clientList) {\n client.postMessage(message);\n }\n}\n\nfunction getClientList(): Promise {\n return self.clients.matchAll({\n type: 'window',\n includeUncontrolled: true\n // TS doesn't know that \"type: 'window'\" means it'll return WindowClient[]\n }) as Promise;\n}\n\nfunction createNewMessage(\n type: MessageType,\n payload: MessagePayload\n): InternalMessage {\n return {\n firebaseMessaging: { type, payload }\n };\n}\n\nfunction showNotification(details: NotificationDetails): Promise {\n const title = details.title ?? '';\n\n const { actions } = details;\n // Note: Firefox does not support the maxActions property.\n // https://developer.mozilla.org/en-US/docs/Web/API/notification/maxActions\n const { maxActions } = Notification;\n if (actions && maxActions && actions.length > maxActions) {\n console.warn(\n `This browser only supports ${maxActions} actions. The remaining actions will not be displayed.`\n );\n }\n\n return self.registration.showNotification(title, details);\n}\n\nfunction getLink(payload: MessagePayload): string | null {\n // eslint-disable-next-line camelcase\n const link = payload.fcmOptions?.link ?? payload.notification?.click_action;\n if (link) {\n return link;\n }\n\n if (isConsoleMessage(payload.data)) {\n // Notification created in the Firebase Console. Redirect to origin.\n return self.location.origin;\n } else {\n return null;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Returns a promise that resolves after given time passes. */\nexport function sleep(ms: number): Promise {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase from '@firebase/app';\nimport '@firebase/installations';\nimport {\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { FirebaseMessaging } from '@firebase/messaging-types';\nimport {\n Component,\n ComponentType,\n ComponentContainer\n} from '@firebase/component';\nimport { extractAppConfig } from './helpers/extract-app-config';\nimport { FirebaseInternalDependencies } from './interfaces/internal-dependencies';\nimport { ERROR_FACTORY, ErrorCode } from './util/errors';\nimport { WindowController } from './controllers/window-controller';\nimport { SwController } from './controllers/sw-controller';\n\nconst MESSAGING_NAME = 'messaging';\nfunction factoryMethod(\n container: ComponentContainer\n): FirebaseService & FirebaseMessaging {\n // Dependencies.\n const app = container.getProvider('app').getImmediate();\n const appConfig = extractAppConfig(app);\n const installations = container.getProvider('installations').getImmediate();\n const analyticsProvider = container.getProvider('analytics-internal');\n\n const firebaseDependencies: FirebaseInternalDependencies = {\n app,\n appConfig,\n installations,\n analyticsProvider\n };\n\n if (!isSupported()) {\n throw ERROR_FACTORY.create(ErrorCode.UNSUPPORTED_BROWSER);\n }\n\n if (self && 'ServiceWorkerGlobalScope' in self) {\n // Running in ServiceWorker context\n return new SwController(firebaseDependencies);\n } else {\n // Assume we are in the window context.\n return new WindowController(firebaseDependencies);\n }\n}\n\nconst NAMESPACE_EXPORTS = {\n isSupported\n};\n\n(firebase as _FirebaseNamespace).INTERNAL.registerComponent(\n new Component(\n MESSAGING_NAME,\n factoryMethod,\n ComponentType.PUBLIC\n ).setServiceProps(NAMESPACE_EXPORTS)\n);\n\n/**\n * Define extension behavior of `registerMessaging`\n */\ndeclare module '@firebase/app-types' {\n interface FirebaseNamespace {\n messaging: {\n (app?: FirebaseApp): FirebaseMessaging;\n isSupported(): boolean;\n };\n }\n interface FirebaseApp {\n messaging(): FirebaseMessaging;\n }\n}\n\nfunction isSupported(): boolean {\n if (self && 'ServiceWorkerGlobalScope' in self) {\n // Running in ServiceWorker context\n return isSWControllerSupported();\n } else {\n // Assume we are in the window context.\n return isWindowControllerSupported();\n }\n}\n\n/**\n * Checks to see if the required APIs exist.\n */\nfunction isWindowControllerSupported(): boolean {\n return (\n 'indexedDB' in window &&\n indexedDB !== null &&\n navigator.cookieEnabled &&\n 'serviceWorker' in navigator &&\n 'PushManager' in window &&\n 'Notification' in window &&\n 'fetch' in window &&\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\n PushSubscription.prototype.hasOwnProperty('getKey')\n );\n}\n\n/**\n * Checks to see if the required APIs exist within SW Context.\n */\nfunction isSWControllerSupported(): boolean {\n return (\n 'indexedDB' in self &&\n indexedDB !== null &&\n 'PushManager' in self &&\n 'Notification' in self &&\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\n PushSubscription.prototype.hasOwnProperty('getKey')\n );\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__assign","assign","t","s","i","n","arguments","length","prototype","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__values","o","m","__read","r","ar","error","__spread","concat","Error","create","__","constructor","code","message","_super","_this","FirebaseError","captureStackTrace","ErrorFactory","_i","data","customData","fullCode","service","template","errors","replace","PATTERN","key","toString","fullMessage","serviceName","_b","keys","_a","slice","console","warn","Component","mode","instantiationMode","multipleInstances","props","serviceProps","name","instanceFactory","type","promisifyRequest","request","onsuccess","onerror","promisifyRequestCall","obj","method","args","proxyProperties","ProxyClass","targetProp","properties","forEach","prop","defineProperty","get","set","val","proxyRequestMethods","Constructor","proxyMethods","proxyCursorRequestMethods","Cursor","Index","index","_index","cursor","_cursor","_request","ObjectStore","store","_store","Transaction","idbTransaction","_tx","complete","oncomplete","onabort","UpgradeDB","db","oldVersion","transaction","_db","DB","openDb","version","upgradeCallback","indexedDB","onupgradeneeded","event","deleteDb","IDBIndex","IDBCursor","methodName","createIndex","IDBObjectStore","objectStore","IDBTransaction","createObjectStore","IDBDatabase","funcName","arr","callback","nativeObject","getAll","query","count","instance","items","iterateCursor","undefined","continue","PENDING_TIMEOUT_MS","PACKAGE_VERSION","INTERNAL_AUTH_VERSION","INSTALLATIONS_API_URL","TOKEN_EXPIRATION_BUFFER","ERROR_DESCRIPTION_MAP","ERROR_FACTORY","isServerError","includes","getInstallationsEndpoint","projectId","extractAuthTokenInfoFromResponse","response","token","requestStatus","expiresIn","responseExpiresIn","Number","creationTime","Date","now","getErrorFromResponse","requestName","json","responseJson","errorData","serverCode","serverMessage","serverStatus","status","getHeaders","apiKey","Headers","Content-Type","Accept","x-goog-api-key","getHeadersWithAuth","appConfig","refreshToken","headers","append","retryIfServerError","fn","sleep","ms","setTimeout","VALID_FID_PATTERN","INVALID_FID","generateFid","fidByteArray","Uint8Array","self","crypto","msCrypto","getRandomValues","fid","array","btoa","String","fromCharCode","bufferToBase64UrlSafe","substr","test","getKey","appName","appId","fidChangeCallbacks","Map","fidChanged","callFidChangeCallbacks","channel","getBroadcastChannel","postMessage","closeBroadcastChannel","broadcastFidChange","callbacks","callbacks_1","broadcastChannel","BroadcastChannel","onmessage","size","close","DATABASE_NAME","DATABASE_VERSION","OBJECT_STORE_NAME","dbPromise","getDbPromise","upgradeDB","tx","oldValue","put","remove","delete","update","updateFn","newValue","getInstallationEntry","oldEntry","installationEntry","clearTimedOutRequest","registrationStatus","entryWithPromise","registrationPromise","updateInstallationRequest","entry","waitUntilFidRegistration","navigator","onLine","registrationPromiseWithError","inProgressEntry","registrationTime","endpoint","authVersion","sdkVersion","JSON","stringify","fetch","ok","responseValue","authToken","createInstallationRequest","registeredInstallationEntry","e_1","registerInstallation","triggerRegistrationIfNecessary","generateAuthTokenRequest","platformLoggerProvider","platformLogger","getImmediate","optional","getPlatformInfoString","installation","refreshAuthToken","dependencies","forceRefresh","isEntryRegistered","inProgressAuthToken","oldAuthToken","isAuthTokenExpired","tokenPromise","updateAuthTokenRequest","waitUntilAuthTokenRequest","requestTime","updatedInstallationEntry","fetchAuthTokenFromServer","getToken","completeInstallationRegistration","deleteInstallationRequest","onIdChange","callbackSet","Set","add","addCallback","getMissingValueError","valueName","firebase","INTERNAL","registerComponent","container","app","getProvider","options","configKeys_1","keyName","extractAppConfig","getId","catch","deleteInstallation","registerVersion","ERROR_MAP","arrayToBase64","uint8Array","OLD_DB_NAME","OLD_DB_VERSION","OLD_OBJECT_STORE_NAME","migrateOldDatabase","senderId","databases","map","tokenDetails","objectStoreNames","contains","clear","oldDetails","auth","p256dh","fcmToken","createTime","subscriptionOptions","swScope","vapidKey","checkTokenDetails","upgradeDb","dbGet","firebaseDependencies","oldTokenDetails","dbSet","DEFAULT_VAPID_KEY","ENDPOINT","FCM_MSG","CONSOLE_CAMPAIGN_ID","requestDeleteToken","unsubscribeOptions","getEndpoint","responseData","errorInfo","err_3","installations","x-goog-firebase-installations-auth","getBody","web","applicationPubKey","MessageType","swRegistration","Notification","permission","pushManager","getSubscription","subscription","subscribe","userVisibleOnly","applicationServerKey","base64String","base64","repeat","rawData","atob","outputArray","charCodeAt","base64ToArray","getPushSubscription","pushSubscription","scope","getNewToken","dbOptions","isVapidKeyEqual","currentOptions","isEndpointEqual","isAuthEqual","isP256dhEqual","updateOptions","err_2","requestUpdateToken","updatedToken","updatedTokenDetails","deleteToken","e_2","updateToken","dbRemove","unsubscribe","subscribeOptions","err_1","requestGetToken","isConsoleMessage","WindowController","getServiceWorkerRegistration","requestPermission","permissionResult","ServiceWorkerRegistration","nextOrObserver","onMessageCallback","serviceWorker","register","browserErrorMessage","firebaseMessaging","payload","PUSH_RECEIVED","logEvent","_c","messageType","eventType","NOTIFICATION_CLICKED","getEventType","analyticsProvider","message_id","message_name","message_time","message_device_time","Math","floor","addEventListener","messageEventListener","SwController","bgMessageHandler","registration","err","getMessagePayload","getClientList","clientList","some","client","visibilityState","url","startsWith","createNewMessage","clientList_2","sendMessageToWindowClients","notificationDetails","notification","notificationInformation","getNotificationData","details","title","actions","maxActions","showNotification","action","stopImmediatePropagation","link","fcmOptions","click_action","location","origin","getLink","parsedURL","URL","href","clientList_1","host","getWindowClient","clients","openWindow","focus","waitUntil","onPush","onSubChange","onNotificationClick","matchAll","includeUncontrolled","NAMESPACE_EXPORTS","isSupported","PushSubscription","window","cookieEnabled","messagingSenderId","setServiceProps"],"mappings":"kTAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IASrB,IAAIO,EAAW,WAQlB,OAPAA,EAAWN,OAAOO,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIN,KADTK,EAAIG,UAAUF,GACOV,OAAOc,UAAUT,eAAeU,KAAKN,EAAGL,KAAII,EAAEJ,GAAKK,EAAEL,IAE9E,OAAOI,IAEKQ,MAAMC,KAAML,YA8BzB,SAASM,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAWD,EAANA,GAAUE,SAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,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e,UAtB1C,cAAesf,QACD,OAAdrW,WACAmI,UAAUmO,eACV,kBAAmBnO,WACnB,gBAAiBkO,QACjB,iBAAkBA,QAClB,UAAWA,QACX1E,0BAA0Bna,UAAUT,eAAe,qBACnDqf,iBAAiB5e,UAAUT,eAAe,UA9C7CqU,GAAgCC,SAASC,kBACxC,IAAI9O,EAnCiB,YACvB,SACE+O,GAGA,IAAMC,EAAMD,EAAUE,YAAY,OAAOhC,eAKnCkE,EAAqD,CACzDnC,MACA1H,mBZzB6B0H,WAC/B,IAAKA,IAAQA,EAAIE,QACf,MAAMR,GAAqB,4BAG7B,IAAKM,EAAI1O,KACP,MAAMoO,GAAqB,YAI7B,IAOQQ,gBACR,IAAsB,IAAAC,EAAA1R,EARmC,CACvD,YACA,SACA,QACA,oDAIgC,CAA7B,IAAM2R,UACT,IAAKF,EAAQE,GACX,MAAMV,GAAqBU,qGAI/B,MAAO,CACLnG,QAAS+F,EAAI1O,KACbqF,UAAWuJ,EAAQvJ,UACnBqB,OAAQkI,EAAQlI,OAChBkC,MAAOgG,EAAQhG,MACf+G,SAAUf,EAAQ6K,mBYVF1K,CAAiBL,GAOjCgD,cANoBjD,EAAUE,YAAY,iBAAiBhC,eAO3DiJ,kBANwBnH,EAAUE,YAAY,uBAShD,IAAK0K,KACH,MAAMpU,GAAcpH,8BAGtB,OAES,IAFLiK,MAAQ,6BAA8BA,KAE7BuO,GAGA5B,IAHa5D,cAgBxB6I,gBAAgBN"}PK!_ > >$assets/vendor/js/firebase-app.min.jsnu[!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).firebase=e.firebase||{},e.firebase.app={}))}(this,function(e){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;na[0]&&t[1]=e.length?void 0:e)&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new f(o,e,i)},v);function v(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var y=/\{\$([^}]+)}/g,g=(b.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},b.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},b.prototype.setServiceProps=function(e){return this.serviceProps=e,this},b);function b(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}var w="[DEFAULT]",E=(_.prototype.get=function(e){void 0===e&&(e=w);var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new i;this.instancesDeferred.set(t,n);try{var r=this.getOrInitializeService(t);r&&n.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise},_.prototype.getImmediate=function(e){var t=c({identifier:w,optional:!1},e),e=t.identifier,n=t.optional,r=this.normalizeInstanceIdentifier(e);try{var i=this.getOrInitializeService(r);if(i)return i;if(n)return null;throw Error("Service "+this.name+" is not available")}catch(e){if(n)return null;throw e}},_.prototype.getComponent=function(){return this.component},_.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if("EAGER"===(this.component=e).instantiationMode)try{this.getOrInitializeService(w)}catch(e){}try{for(var r=p(this.instancesDeferred.entries()),i=r.next();!i.done;i=r.next()){var o=u(i.value,2),a=o[0],s=o[1],l=this.normalizeInstanceIdentifier(a);try{var c=this.getOrInitializeService(l);s.resolve(c)}catch(e){}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_.prototype.clearInstance=function(e){void 0===e&&(e=w),this.instancesDeferred.delete(e),this.instances.delete(e)},_.prototype.delete=function(){return t(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(function(){for(var e=[],t=0;t=(null!=o?o:e.logLevel)&&a({level:S[t].toLowerCase(),message:i,args:n,type:e.name})}}(n[e])}(e,t)},e.registerVersion=J,e.setLogLevel=function(e){var t=e;N.forEach(function(e){e.setLogLevel(t)})},Object.defineProperty(e,"__esModule",{value:!0})});PK!^^$assets/vendor/js/firebase-app.js.mapnu[{"version":3,"file":"firebase-app.js","sources":["../../node_modules/tslib/tslib.es6.js","../util/src/deepCopy.ts","../util/src/deferred.ts","../util/src/errors.ts","../util/src/obj.ts","../util/src/subscribe.ts","../component/src/component.ts","../component/src/constants.ts","../component/src/provider.ts","../component/src/component_container.ts","../logger/src/logger.ts","../app/src/errors.ts","../app/src/constants.ts","../app/src/logger.ts","../app/src/firebaseApp.ts","../app/src/firebaseNamespaceCore.ts","../app/src/firebaseNamespace.ts","../app/src/platformLoggerService.ts","../app/index.ts","../util/src/environment.ts","../app/src/registerCoreComponents.ts","app/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Do a deep-copy of basic JavaScript Objects or Arrays.\n */\nexport function deepCopy(value: T): T {\n return deepExtend(undefined, value) as T;\n}\n\n/**\n * Copy properties from source to target (recursively allows extension\n * of Objects and Arrays). Scalar values in the target are over-written.\n * If target is undefined, an object of the appropriate type will be created\n * (and returned).\n *\n * We recursively copy all child properties of plain Objects in the source- so\n * that namespace- like dictionaries are merged.\n *\n * Note that the target can be a function, in which case the properties in\n * the source Object are copied onto it as static properties of the Function.\n */\nexport function deepExtend(target: unknown, source: unknown): unknown {\n if (!(source instanceof Object)) {\n return source;\n }\n\n switch (source.constructor) {\n case Date:\n // Treat Dates like scalars; if the target date object had any child\n // properties - they will be lost!\n const dateValue = source as Date;\n return new Date(dateValue.getTime());\n\n case Object:\n if (target === undefined) {\n target = {};\n }\n break;\n case Array:\n // Always copy the array source and overwrite the target.\n target = [];\n break;\n\n default:\n // Not a plain Object - treat it as a scalar.\n return source;\n }\n\n for (const prop in source) {\n if (!source.hasOwnProperty(prop)) {\n continue;\n }\n (target as { [key: string]: unknown })[prop] = deepExtend(\n (target as { [key: string]: unknown })[prop],\n (source as { [key: string]: unknown })[prop]\n );\n }\n\n return target;\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class Deferred {\n promise: Promise;\n reject: (value?: unknown) => void = () => {};\n resolve: (value?: unknown) => void = () => {};\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve as (value?: unknown) => void;\n this.reject = reject as (value?: unknown) => void;\n });\n }\n\n /**\n * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around\n * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\n * and returns a node-style callback which will resolve or reject the Deferred's promise.\n */\n wrapCallback(\n callback?: (error?: unknown, value?: unknown) => void\n ): (error: unknown, value?: unknown) => void {\n return (error, value?) => {\n if (error) {\n this.reject(error);\n } else {\n this.resolve(value);\n }\n if (typeof callback === 'function') {\n // Attaching noop handler just in case developer wasn't expecting\n // promises\n this.promise.catch(() => {});\n\n // Some of our callbacks don't expect a value and our own tests\n // assert that the parameter length is 1\n if (callback.length === 1) {\n callback(error);\n } else {\n callback(error, value);\n }\n }\n };\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @fileoverview Standardized Firebase Error.\n *\n * Usage:\n *\n * // Typescript string literals for type-safe codes\n * type Err =\n * 'unknown' |\n * 'object-not-found'\n * ;\n *\n * // Closure enum for type-safe error codes\n * // at-enum {string}\n * var Err = {\n * UNKNOWN: 'unknown',\n * OBJECT_NOT_FOUND: 'object-not-found',\n * }\n *\n * let errors: Map = {\n * 'generic-error': \"Unknown error\",\n * 'file-not-found': \"Could not find file: {$file}\",\n * };\n *\n * // Type-safe function - must pass a valid error code as param.\n * let error = new ErrorFactory('service', 'Service', errors);\n *\n * ...\n * throw error.create(Err.GENERIC);\n * ...\n * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\n * ...\n * // Service: Could not file file: foo.txt (service/file-not-found).\n *\n * catch (e) {\n * assert(e.message === \"Could not find file: foo.txt.\");\n * if (e.code === 'service/file-not-found') {\n * console.log(\"Could not read file: \" + e['file']);\n * }\n * }\n */\n\nexport type ErrorMap = {\n readonly [K in ErrorCode]: string;\n};\n\nconst ERROR_NAME = 'FirebaseError';\n\nexport interface StringLike {\n toString(): string;\n}\n\nexport interface ErrorData {\n [key: string]: StringLike | undefined;\n}\n\nexport interface FirebaseError extends Error, ErrorData {\n // Unique code for error - format is service/error-code-string.\n readonly code: string;\n\n // Developer-friendly error message.\n readonly message: string;\n\n // Always 'FirebaseError'.\n readonly name: typeof ERROR_NAME;\n\n // Where available - stack backtrace in a string.\n readonly stack?: string;\n}\n\n// Based on code from:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\nexport class FirebaseError extends Error {\n readonly name = ERROR_NAME;\n\n constructor(readonly code: string, message: string) {\n super(message);\n\n // Fix For ES5\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n Object.setPrototypeOf(this, FirebaseError.prototype);\n\n // Maintains proper stack trace for where our error was thrown.\n // Only available on V8.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ErrorFactory.prototype.create);\n }\n }\n}\n\nexport class ErrorFactory<\n ErrorCode extends string,\n ErrorParams extends { readonly [K in ErrorCode]?: ErrorData } = {}\n> {\n constructor(\n private readonly service: string,\n private readonly serviceName: string,\n private readonly errors: ErrorMap\n ) {}\n\n create(\n code: K,\n ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []\n ): FirebaseError {\n const customData = (data[0] as ErrorData) || {};\n const fullCode = `${this.service}/${code}`;\n const template = this.errors[code];\n\n const message = template ? replaceTemplate(template, customData) : 'Error';\n // Service Name: Error message (service/code).\n const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\n\n const error = new FirebaseError(fullCode, fullMessage);\n\n // Keys with an underscore at the end of their name are not included in\n // error.data for some reason.\n // TODO: Replace with Object.entries when lib is updated to es2017.\n for (const key of Object.keys(customData)) {\n if (key.slice(-1) !== '_') {\n if (key in error) {\n console.warn(\n `Overwriting FirebaseError base field \"${key}\" can cause unexpected behavior.`\n );\n }\n error[key] = customData[key];\n }\n }\n\n return error;\n }\n}\n\nfunction replaceTemplate(template: string, data: ErrorData): string {\n return template.replace(PATTERN, (_, key) => {\n const value = data[key];\n return value != null ? value.toString() : `<${key}?>`;\n });\n}\n\nconst PATTERN = /\\{\\$([^}]+)}/g;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function contains(obj: T, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport function safeGet(\n obj: T,\n key: K\n): T[K] | undefined {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n return obj[key];\n } else {\n return undefined;\n }\n}\n\nexport function isEmpty(obj: object): obj is {} {\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport function map(\n obj: { [key in K]: V },\n fn: (value: V, key: K, obj: { [key in K]: V }) => U,\n contextObj?: unknown\n): { [key in K]: U } {\n const res: Partial<{ [key in K]: U }> = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n res[key] = fn.call(contextObj, obj[key], key, obj);\n }\n }\n return res as { [key in K]: U };\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport type NextFn = (value: T) => void;\nexport type ErrorFn = (error: Error) => void;\nexport type CompleteFn = () => void;\n\nexport interface Observer {\n // Called once for each value in a stream of values.\n next: NextFn;\n\n // A stream terminates by a single call to EITHER error() or complete().\n error: ErrorFn;\n\n // No events will be sent to next() once complete() is called.\n complete: CompleteFn;\n}\n\nexport type PartialObserver = Partial>;\n\n// TODO: Support also Unsubscribe.unsubscribe?\nexport type Unsubscribe = () => void;\n\n/**\n * The Subscribe interface has two forms - passing the inline function\n * callbacks, or a object interface with callback properties.\n */\nexport interface Subscribe {\n (next?: NextFn, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;\n (observer: PartialObserver): Unsubscribe;\n}\n\nexport interface Observable {\n // Subscribe method\n subscribe: Subscribe;\n}\n\nexport type Executor = (observer: Observer) => void;\n\n/**\n * Helper to make a Subscribe function (just like Promise helps make a\n * Thenable).\n *\n * @param executor Function which can make calls to a single Observer\n * as a proxy.\n * @param onNoObservers Callback when count of Observers goes to zero.\n */\nexport function createSubscribe(\n executor: Executor,\n onNoObservers?: Executor\n): Subscribe {\n const proxy = new ObserverProxy(executor, onNoObservers);\n return proxy.subscribe.bind(proxy);\n}\n\n/**\n * Implement fan-out for any number of Observers attached via a subscribe\n * function.\n */\nclass ObserverProxy implements Observer {\n private observers: Array> | undefined = [];\n private unsubscribes: Unsubscribe[] = [];\n private onNoObservers: Executor | undefined;\n private observerCount = 0;\n // Micro-task scheduling by calling task.then().\n private task = Promise.resolve();\n private finalized = false;\n private finalError?: Error;\n\n /**\n * @param executor Function which can make calls to a single Observer\n * as a proxy.\n * @param onNoObservers Callback when count of Observers goes to zero.\n */\n constructor(executor: Executor, onNoObservers?: Executor) {\n this.onNoObservers = onNoObservers;\n // Call the executor asynchronously so subscribers that are called\n // synchronously after the creation of the subscribe function\n // can still receive the very first value generated in the executor.\n this.task\n .then(() => {\n executor(this);\n })\n .catch(e => {\n this.error(e);\n });\n }\n\n next(value: T): void {\n this.forEachObserver((observer: Observer) => {\n observer.next(value);\n });\n }\n\n error(error: Error): void {\n this.forEachObserver((observer: Observer) => {\n observer.error(error);\n });\n this.close(error);\n }\n\n complete(): void {\n this.forEachObserver((observer: Observer) => {\n observer.complete();\n });\n this.close();\n }\n\n /**\n * Subscribe function that can be used to add an Observer to the fan-out list.\n *\n * - We require that no event is sent to a subscriber sychronously to their\n * call to subscribe().\n */\n subscribe(\n nextOrObserver?: PartialObserver | Function,\n error?: ErrorFn,\n complete?: CompleteFn\n ): Unsubscribe {\n let observer: Observer;\n\n if (\n nextOrObserver === undefined &&\n error === undefined &&\n complete === undefined\n ) {\n throw new Error('Missing Observer.');\n }\n\n // Assemble an Observer object when passed as callback functions.\n if (\n implementsAnyMethods(nextOrObserver as { [key: string]: unknown }, [\n 'next',\n 'error',\n 'complete'\n ])\n ) {\n observer = nextOrObserver as Observer;\n } else {\n observer = {\n next: nextOrObserver as NextFn,\n error,\n complete\n } as Observer;\n }\n\n if (observer.next === undefined) {\n observer.next = noop as NextFn;\n }\n if (observer.error === undefined) {\n observer.error = noop as ErrorFn;\n }\n if (observer.complete === undefined) {\n observer.complete = noop as CompleteFn;\n }\n\n const unsub = this.unsubscribeOne.bind(this, this.observers!.length);\n\n // Attempt to subscribe to a terminated Observable - we\n // just respond to the Observer with the final error or complete\n // event.\n if (this.finalized) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n try {\n if (this.finalError) {\n observer.error(this.finalError);\n } else {\n observer.complete();\n }\n } catch (e) {\n // nothing\n }\n return;\n });\n }\n\n this.observers!.push(observer as Observer);\n\n return unsub;\n }\n\n // Unsubscribe is synchronous - we guarantee that no events are sent to\n // any unsubscribed Observer.\n private unsubscribeOne(i: number): void {\n if (this.observers === undefined || this.observers[i] === undefined) {\n return;\n }\n\n delete this.observers[i];\n\n this.observerCount -= 1;\n if (this.observerCount === 0 && this.onNoObservers !== undefined) {\n this.onNoObservers(this);\n }\n }\n\n private forEachObserver(fn: (observer: Observer) => void): void {\n if (this.finalized) {\n // Already closed by previous event....just eat the additional values.\n return;\n }\n\n // Since sendOne calls asynchronously - there is no chance that\n // this.observers will become undefined.\n for (let i = 0; i < this.observers!.length; i++) {\n this.sendOne(i, fn);\n }\n }\n\n // Call the Observer via one of it's callback function. We are careful to\n // confirm that the observe has not been unsubscribed since this asynchronous\n // function had been queued.\n private sendOne(i: number, fn: (observer: Observer) => void): void {\n // Execute the callback asynchronously\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n if (this.observers !== undefined && this.observers[i] !== undefined) {\n try {\n fn(this.observers[i]);\n } catch (e) {\n // Ignore exceptions raised in Observers or missing methods of an\n // Observer.\n // Log error to console. b/31404806\n if (typeof console !== 'undefined' && console.error) {\n console.error(e);\n }\n }\n }\n });\n }\n\n private close(err?: Error): void {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n if (err !== undefined) {\n this.finalError = err;\n }\n // Proxy is no longer needed - garbage collect references\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n this.observers = undefined;\n this.onNoObservers = undefined;\n });\n }\n}\n\n/** Turn synchronous function into one called asynchronously. */\nexport function async(fn: Function, onError?: ErrorFn): Function {\n return (...args: unknown[]) => {\n Promise.resolve(true)\n .then(() => {\n fn(...args);\n })\n .catch((error: Error) => {\n if (onError) {\n onError(error);\n }\n });\n };\n}\n\n/**\n * Return true if the object passed in implements any of the named methods.\n */\nfunction implementsAnyMethods(\n obj: { [key: string]: unknown },\n methods: string[]\n): boolean {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n\n for (const method of methods) {\n if (method in obj && typeof obj[method] === 'function') {\n return true;\n }\n }\n\n return false;\n}\n\nfunction noop(): void {\n // do nothing\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n InstantiationMode,\n InstanceFactory,\n ComponentType,\n Dictionary,\n Name\n} from './types';\n\n/**\n * Component for service name T, e.g. `auth`, `auth-internal`\n */\nexport class Component {\n multipleInstances = false;\n /**\n * Properties to be added to the service namespace\n */\n serviceProps: Dictionary = {};\n\n instantiationMode = InstantiationMode.LAZY;\n\n /**\n *\n * @param name The public service name, e.g. app, auth, firestore, database\n * @param instanceFactory Service factory responsible for creating the public interface\n * @param type whether the service provided by the component is public or private\n */\n constructor(\n readonly name: T,\n readonly instanceFactory: InstanceFactory,\n readonly type: ComponentType\n ) {}\n\n setInstantiationMode(mode: InstantiationMode): this {\n this.instantiationMode = mode;\n return this;\n }\n\n setMultipleInstances(multipleInstances: boolean): this {\n this.multipleInstances = multipleInstances;\n return this;\n }\n\n setServiceProps(props: Dictionary): this {\n this.serviceProps = props;\n return this;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Deferred } from '@firebase/util';\nimport { ComponentContainer } from './component_container';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport { InstantiationMode, Name, NameServiceMapping } from './types';\nimport { Component } from './component';\n\n/**\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\n * NameServiceMapping[T] is an alias for the type of the instance\n */\nexport class Provider {\n private component: Component | null = null;\n private readonly instances: Map = new Map();\n private readonly instancesDeferred: Map<\n string,\n Deferred\n > = new Map();\n\n constructor(\n private readonly name: T,\n private readonly container: ComponentContainer\n ) {}\n\n /**\n * @param identifier A provider can provide mulitple instances of a service\n * if this.component.multipleInstances is true.\n */\n get(identifier: string = DEFAULT_ENTRY_NAME): Promise {\n // if multipleInstances is not supported, use the default name\n const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n\n if (!this.instancesDeferred.has(normalizedIdentifier)) {\n const deferred = new Deferred();\n this.instancesDeferred.set(normalizedIdentifier, deferred);\n // If the service instance is available, resolve the promise with it immediately\n try {\n const instance = this.getOrInitializeService(normalizedIdentifier);\n if (instance) {\n deferred.resolve(instance);\n }\n } catch (e) {\n // when the instance factory throws an exception during get(), it should not cause\n // a fatal error. We just return the unresolved promise in this case.\n }\n }\n\n return this.instancesDeferred.get(normalizedIdentifier)!.promise;\n }\n\n /**\n *\n * @param options.identifier A provider can provide mulitple instances of a service\n * if this.component.multipleInstances is true.\n * @param options.optional If optional is false or not provided, the method throws an error when\n * the service is not immediately available.\n * If optional is true, the method returns null if the service is not immediately available.\n */\n getImmediate(options: {\n identifier?: string;\n optional: true;\n }): NameServiceMapping[T] | null;\n getImmediate(options?: {\n identifier?: string;\n optional?: false;\n }): NameServiceMapping[T];\n getImmediate(options?: {\n identifier?: string;\n optional?: boolean;\n }): NameServiceMapping[T] | null {\n const { identifier, optional } = {\n identifier: DEFAULT_ENTRY_NAME,\n optional: false,\n ...options\n };\n // if multipleInstances is not supported, use the default name\n const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n try {\n const instance = this.getOrInitializeService(normalizedIdentifier);\n\n if (!instance) {\n if (optional) {\n return null;\n }\n throw Error(`Service ${this.name} is not available`);\n }\n return instance;\n } catch (e) {\n if (optional) {\n return null;\n } else {\n throw e;\n }\n }\n }\n\n getComponent(): Component | null {\n return this.component;\n }\n\n setComponent(component: Component): void {\n if (component.name !== this.name) {\n throw Error(\n `Mismatching Component ${component.name} for Provider ${this.name}.`\n );\n }\n\n if (this.component) {\n throw Error(`Component for ${this.name} has already been provided`);\n }\n\n this.component = component;\n // if the service is eager, initialize the default instance\n if (isComponentEager(component)) {\n try {\n this.getOrInitializeService(DEFAULT_ENTRY_NAME);\n } catch (e) {\n // when the instance factory for an eager Component throws an exception during the eager\n // initialization, it should not cause a fatal error.\n // TODO: Investigate if we need to make it configurable, because some component may want to cause\n // a fatal error in this case?\n }\n }\n\n // Create service instances for the pending promises and resolve them\n // NOTE: if this.multipleInstances is false, only the default instance will be created\n // and all promises with resolve with it regardless of the identifier.\n for (const [\n instanceIdentifier,\n instanceDeferred\n ] of this.instancesDeferred.entries()) {\n const normalizedIdentifier = this.normalizeInstanceIdentifier(\n instanceIdentifier\n );\n\n try {\n // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\n const instance = this.getOrInitializeService(normalizedIdentifier)!;\n instanceDeferred.resolve(instance);\n } catch (e) {\n // when the instance factory throws an exception, it should not cause\n // a fatal error. We just leave the promise unresolved.\n }\n }\n }\n\n clearInstance(identifier: string = DEFAULT_ENTRY_NAME): void {\n this.instancesDeferred.delete(identifier);\n this.instances.delete(identifier);\n }\n\n // app.delete() will call this method on every provider to delete the services\n // TODO: should we mark the provider as deleted?\n async delete(): Promise {\n const services = Array.from(this.instances.values());\n\n await Promise.all(\n services\n .filter(service => 'INTERNAL' in service)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map(service => (service as any).INTERNAL!.delete())\n );\n }\n\n isComponentSet(): boolean {\n return this.component != null;\n }\n\n private getOrInitializeService(\n identifier: string\n ): NameServiceMapping[T] | null {\n let instance = this.instances.get(identifier);\n if (!instance && this.component) {\n instance = this.component.instanceFactory(\n this.container,\n normalizeIdentifierForFactory(identifier)\n ) as NameServiceMapping[T];\n this.instances.set(identifier, instance);\n }\n\n return instance || null;\n }\n\n private normalizeInstanceIdentifier(identifier: string): string {\n if (this.component) {\n return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\n } else {\n return identifier; // assume multiple instances are supported before the component is provided.\n }\n }\n}\n\n// undefined should be passed to the service factory for the default instance\nfunction normalizeIdentifierForFactory(identifier: string): string | undefined {\n return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\n}\n\nfunction isComponentEager(component: Component): boolean {\n return component.instantiationMode === InstantiationMode.EAGER;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Provider } from './provider';\nimport { Component } from './component';\nimport { Name } from './types';\n\n/**\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\n */\nexport class ComponentContainer {\n private readonly providers = new Map>();\n\n constructor(private readonly name: string) {}\n\n /**\n *\n * @param component Component being added\n * @param overwrite When a component with the same name has already been registered,\n * if overwrite is true: overwrite the existing component with the new component and create a new\n * provider with the new component. It can be useful in tests where you want to use different mocks\n * for different tests.\n * if overwrite is false: throw an exception\n */\n addComponent(component: Component): void {\n const provider = this.getProvider(component.name);\n if (provider.isComponentSet()) {\n throw new Error(\n `Component ${component.name} has already been registered with ${this.name}`\n );\n }\n\n provider.setComponent(component);\n }\n\n addOrOverwriteComponent(component: Component): void {\n const provider = this.getProvider(component.name);\n if (provider.isComponentSet()) {\n // delete the existing provider from the container, so we can register the new component\n this.providers.delete(component.name);\n }\n\n this.addComponent(component);\n }\n\n /**\n * getProvider provides a type safe interface where it can only be called with a field name\n * present in NameServiceMapping interface.\n *\n * Firebase SDKs providing services should extend NameServiceMapping interface to register\n * themselves.\n */\n getProvider(name: T): Provider {\n if (this.providers.has(name)) {\n return this.providers.get(name) as Provider;\n }\n\n // create a Provider for a service that hasn't registered with Firebase\n const provider = new Provider(name, this);\n this.providers.set(name, provider);\n\n return provider as Provider;\n }\n\n getProviders(): Array> {\n return Array.from(this.providers.values());\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type LogLevelString =\n | 'debug'\n | 'verbose'\n | 'info'\n | 'warn'\n | 'error'\n | 'silent';\n\nexport interface LogOptions {\n level: LogLevelString;\n}\n\nexport type LogCallback = (callbackParams: LogCallbackParams) => void;\n\nexport interface LogCallbackParams {\n level: LogLevelString;\n message: string;\n args: unknown[];\n type: string;\n}\n\n/**\n * A container for all of the Logger instances\n */\nexport const instances: Logger[] = [];\n\n/**\n * The JS SDK supports 5 log levels and also allows a user the ability to\n * silence the logs altogether.\n *\n * The order is a follows:\n * DEBUG < VERBOSE < INFO < WARN < ERROR\n *\n * All of the log types above the current log level will be captured (i.e. if\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\n * `VERBOSE` logs will not)\n */\nexport enum LogLevel {\n DEBUG,\n VERBOSE,\n INFO,\n WARN,\n ERROR,\n SILENT\n}\n\nconst levelStringToEnum: { [key in LogLevelString]: LogLevel } = {\n 'debug': LogLevel.DEBUG,\n 'verbose': LogLevel.VERBOSE,\n 'info': LogLevel.INFO,\n 'warn': LogLevel.WARN,\n 'error': LogLevel.ERROR,\n 'silent': LogLevel.SILENT\n};\n\n/**\n * The default log level\n */\nconst defaultLogLevel: LogLevel = LogLevel.INFO;\n\n/**\n * We allow users the ability to pass their own log handler. We will pass the\n * type of log, the current log level, and any other arguments passed (i.e. the\n * messages that the user wants to log) to this function.\n */\nexport type LogHandler = (\n loggerInstance: Logger,\n logType: LogLevel,\n ...args: unknown[]\n) => void;\n\n/**\n * By default, `console.debug` is not displayed in the developer console (in\n * chrome). To avoid forcing users to have to opt-in to these logs twice\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\n * logs to the `console.log` function.\n */\nconst ConsoleMethod = {\n [LogLevel.DEBUG]: 'log',\n [LogLevel.VERBOSE]: 'log',\n [LogLevel.INFO]: 'info',\n [LogLevel.WARN]: 'warn',\n [LogLevel.ERROR]: 'error'\n};\n\n/**\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\n * messages on to their corresponding console counterparts (if the log method\n * is supported by the current log level)\n */\nconst defaultLogHandler: LogHandler = (instance, logType, ...args): void => {\n if (logType < instance.logLevel) {\n return;\n }\n const now = new Date().toISOString();\n const method = ConsoleMethod[logType as keyof typeof ConsoleMethod];\n if (method) {\n console[method as 'log' | 'info' | 'warn' | 'error'](\n `[${now}] ${instance.name}:`,\n ...args\n );\n } else {\n throw new Error(\n `Attempted to log a message with an invalid logType (value: ${logType})`\n );\n }\n};\n\nexport class Logger {\n /**\n * Gives you an instance of a Logger to capture messages according to\n * Firebase's logging scheme.\n *\n * @param name The name that the logs will be associated with\n */\n constructor(public name: string) {\n /**\n * Capture the current instance for later use\n */\n instances.push(this);\n }\n\n /**\n * The log level of the given Logger instance.\n */\n private _logLevel = defaultLogLevel;\n get logLevel(): LogLevel {\n return this._logLevel;\n }\n set logLevel(val: LogLevel) {\n if (!(val in LogLevel)) {\n throw new TypeError('Invalid value assigned to `logLevel`');\n }\n this._logLevel = val;\n }\n\n /**\n * The main (internal) log handler for the Logger instance.\n * Can be set to a new function in internal package code but not by user.\n */\n private _logHandler: LogHandler = defaultLogHandler;\n get logHandler(): LogHandler {\n return this._logHandler;\n }\n set logHandler(val: LogHandler) {\n if (typeof val !== 'function') {\n throw new TypeError('Value assigned to `logHandler` must be a function');\n }\n this._logHandler = val;\n }\n\n /**\n * The optional, additional, user-defined log handler for the Logger instance.\n */\n private _userLogHandler: LogHandler | null = null;\n get userLogHandler(): LogHandler | null {\n return this._userLogHandler;\n }\n set userLogHandler(val: LogHandler | null) {\n this._userLogHandler = val;\n }\n\n /**\n * The functions below are all based on the `console` interface\n */\n\n debug(...args: unknown[]): void {\n this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\n this._logHandler(this, LogLevel.DEBUG, ...args);\n }\n log(...args: unknown[]): void {\n this._userLogHandler &&\n this._userLogHandler(this, LogLevel.VERBOSE, ...args);\n this._logHandler(this, LogLevel.VERBOSE, ...args);\n }\n info(...args: unknown[]): void {\n this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\n this._logHandler(this, LogLevel.INFO, ...args);\n }\n warn(...args: unknown[]): void {\n this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\n this._logHandler(this, LogLevel.WARN, ...args);\n }\n error(...args: unknown[]): void {\n this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\n this._logHandler(this, LogLevel.ERROR, ...args);\n }\n}\n\nexport function setLogLevel(level: LogLevelString | LogLevel): void {\n const newLevel = typeof level === 'string' ? levelStringToEnum[level] : level;\n instances.forEach(inst => {\n inst.logLevel = newLevel;\n });\n}\n\nexport function setUserLogHandler(\n logCallback: LogCallback | null,\n options?: LogOptions\n): void {\n for (const instance of instances) {\n let customLogLevel: LogLevel | null = null;\n if (options && options.level) {\n customLogLevel = levelStringToEnum[options.level];\n }\n if (logCallback === null) {\n instance.userLogHandler = null;\n } else {\n instance.userLogHandler = (\n instance: Logger,\n level: LogLevel,\n ...args: unknown[]\n ) => {\n const message = args\n .map(arg => {\n if (arg == null) {\n return null;\n } else if (typeof arg === 'string') {\n return arg;\n } else if (typeof arg === 'number' || typeof arg === 'boolean') {\n return arg.toString();\n } else if (arg instanceof Error) {\n return arg.message;\n } else {\n try {\n return JSON.stringify(arg);\n } catch (ignored) {\n return null;\n }\n }\n })\n .filter(arg => arg)\n .join(' ');\n if (level >= (customLogLevel ?? instance.logLevel)) {\n logCallback({\n level: LogLevel[level].toLowerCase() as LogLevelString,\n message,\n args,\n type: instance.name\n });\n }\n };\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorFactory, ErrorMap } from '@firebase/util';\n\nexport const enum AppError {\n NO_APP = 'no-app',\n BAD_APP_NAME = 'bad-app-name',\n DUPLICATE_APP = 'duplicate-app',\n APP_DELETED = 'app-deleted',\n INVALID_APP_ARGUMENT = 'invalid-app-argument',\n INVALID_LOG_ARGUMENT = 'invalid-log-argument'\n}\n\nconst ERRORS: ErrorMap = {\n [AppError.NO_APP]:\n \"No Firebase App '{$appName}' has been created - \" +\n 'call Firebase App.initializeApp()',\n [AppError.BAD_APP_NAME]: \"Illegal App name: '{$appName}\",\n [AppError.DUPLICATE_APP]: \"Firebase App named '{$appName}' already exists\",\n [AppError.APP_DELETED]: \"Firebase App named '{$appName}' already deleted\",\n [AppError.INVALID_APP_ARGUMENT]:\n 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.',\n [AppError.INVALID_LOG_ARGUMENT]:\n 'First argument to `onLog` must be null or a function.'\n};\n\ntype ErrorParams = { [key in AppError]: { appName: string } };\n\nexport const ERROR_FACTORY = new ErrorFactory(\n 'app',\n 'Firebase',\n ERRORS\n);\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DEFAULT_ENTRY_NAME = '[DEFAULT]';\nimport { name as appName } from '../package.json';\nimport { name as analyticsName } from '../../analytics/package.json';\nimport { name as authName } from '../../auth/package.json';\nimport { name as databaseName } from '../../database/package.json';\nimport { name as functionsName } from '../../functions/package.json';\nimport { name as installationsName } from '../../installations/package.json';\nimport { name as messagingName } from '../../messaging/package.json';\nimport { name as performanceName } from '../../performance/package.json';\nimport { name as remoteConfigName } from '../../remote-config/package.json';\nimport { name as storageName } from '../../storage/package.json';\nimport { name as firestoreName } from '../../firestore/package.json';\nimport { name as packageName } from '../../../package.json';\n\nexport const PLATFORM_LOG_STRING = {\n [appName]: 'fire-core',\n [analyticsName]: 'fire-analytics',\n [authName]: 'fire-auth',\n [databaseName]: 'fire-rtdb',\n [functionsName]: 'fire-fn',\n [installationsName]: 'fire-iid',\n [messagingName]: 'fire-fcm',\n [performanceName]: 'fire-perf',\n [remoteConfigName]: 'fire-rc',\n [storageName]: 'fire-gcs',\n [firestoreName]: 'fire-fst',\n 'fire-js': 'fire-js', // Platform identifier for JS SDK.\n [packageName]: 'fire-js-all'\n} as const;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Logger } from '@firebase/logger';\n\nexport const logger = new Logger('@firebase/app');\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService\n} from '@firebase/app-types/private';\nimport { deepCopy } from '@firebase/util';\nimport {\n ComponentContainer,\n Component,\n ComponentType,\n Name\n} from '@firebase/component';\nimport { AppError, ERROR_FACTORY } from './errors';\nimport { DEFAULT_ENTRY_NAME } from './constants';\nimport { logger } from './logger';\n\n/**\n * Global context object for a collection of services using\n * a shared authentication state.\n */\nexport class FirebaseAppImpl implements FirebaseApp {\n private readonly options_: FirebaseOptions;\n private readonly name_: string;\n private isDeleted_ = false;\n private automaticDataCollectionEnabled_: boolean;\n private container: ComponentContainer;\n\n constructor(\n options: FirebaseOptions,\n config: FirebaseAppConfig,\n private readonly firebase_: _FirebaseNamespace\n ) {\n this.name_ = config.name!;\n this.automaticDataCollectionEnabled_ =\n config.automaticDataCollectionEnabled || false;\n this.options_ = deepCopy(options);\n this.container = new ComponentContainer(config.name!);\n\n // add itself to container\n this._addComponent(new Component('app', () => this, ComponentType.PUBLIC));\n // populate ComponentContainer with existing components\n for (const component of this.firebase_.INTERNAL.components.values()) {\n this._addComponent(component);\n }\n }\n\n get automaticDataCollectionEnabled(): boolean {\n this.checkDestroyed_();\n return this.automaticDataCollectionEnabled_;\n }\n\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed_();\n this.automaticDataCollectionEnabled_ = val;\n }\n\n get name(): string {\n this.checkDestroyed_();\n return this.name_;\n }\n\n get options(): FirebaseOptions {\n this.checkDestroyed_();\n return this.options_;\n }\n\n delete(): Promise {\n return new Promise(resolve => {\n this.checkDestroyed_();\n resolve();\n })\n .then(() => {\n this.firebase_.INTERNAL.removeApp(this.name_);\n\n return Promise.all(\n this.container.getProviders().map(provider => provider.delete())\n );\n })\n .then((): void => {\n this.isDeleted_ = true;\n });\n }\n\n /**\n * Return a service instance associated with this app (creating it\n * on demand), identified by the passed instanceIdentifier.\n *\n * NOTE: Currently storage and functions are the only ones that are leveraging this\n * functionality. They invoke it by calling:\n *\n * ```javascript\n * firebase.app().storage('STORAGE BUCKET ID')\n * ```\n *\n * The service name is passed to this already\n * @internal\n */\n _getService(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): FirebaseService {\n this.checkDestroyed_();\n\n // getImmediate will always succeed because _getService is only called for registered components.\n return (this.container.getProvider(name as Name).getImmediate({\n identifier: instanceIdentifier\n }) as unknown) as FirebaseService;\n }\n /**\n * Remove a service instance from the cache, so we will create a new instance for this service\n * when people try to get this service again.\n *\n * NOTE: currently only firestore is using this functionality to support firestore shutdown.\n *\n * @param name The service name\n * @param instanceIdentifier instance identifier in case multiple instances are allowed\n * @internal\n */\n _removeServiceInstance(\n name: string,\n instanceIdentifier: string = DEFAULT_ENTRY_NAME\n ): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.container.getProvider(name as any).clearInstance(instanceIdentifier);\n }\n\n /**\n * @param component the component being added to this app's container\n */\n _addComponent(component: Component): void {\n try {\n this.container.addComponent(component);\n } catch (e) {\n logger.debug(\n `Component ${component.name} failed to register with FirebaseApp ${this.name}`,\n e\n );\n }\n }\n\n _addOrOverwriteComponent(component: Component): void {\n this.container.addOrOverwriteComponent(component);\n }\n\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n private checkDestroyed_(): void {\n if (this.isDeleted_) {\n throw ERROR_FACTORY.create(AppError.APP_DELETED, { appName: this.name_ });\n }\n }\n}\n\n// Prevent dead-code elimination of these methods w/o invalid property\n// copying.\n(FirebaseAppImpl.prototype.name && FirebaseAppImpl.prototype.options) ||\n FirebaseAppImpl.prototype.delete ||\n console.log('dc');\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FirebaseApp,\n FirebaseOptions,\n FirebaseNamespace,\n FirebaseAppConfig\n} from '@firebase/app-types';\nimport {\n _FirebaseApp,\n _FirebaseNamespace,\n FirebaseService,\n FirebaseServiceNamespace\n} from '@firebase/app-types/private';\nimport { deepExtend, contains } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { ERROR_FACTORY, AppError } from './errors';\nimport { FirebaseAppLiteImpl } from './lite/firebaseAppLite';\nimport { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';\nimport { version } from '../../firebase/package.json';\nimport { logger } from './logger';\nimport {\n setUserLogHandler,\n setLogLevel,\n LogCallback,\n LogOptions\n} from '@firebase/logger';\nimport { Component, ComponentType, Name } from '@firebase/component';\n\n/**\n * Because auth can't share code with other components, we attach the utility functions\n * in an internal namespace to share code.\n * This function return a firebase namespace object without\n * any utility functions, so it can be shared between the regular firebaseNamespace and\n * the lite version.\n */\nexport function createFirebaseNamespaceCore(\n firebaseAppImpl: typeof FirebaseAppImpl | typeof FirebaseAppLiteImpl\n): FirebaseNamespace {\n const apps: { [name: string]: FirebaseApp } = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const components = new Map>();\n\n // A namespace is a plain JavaScript Object.\n const namespace: FirebaseNamespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n // @ts-ignore\n __esModule: true,\n initializeApp,\n // @ts-ignore\n app,\n registerVersion,\n setLogLevel,\n onLog,\n // @ts-ignore\n apps: null,\n SDK_VERSION: version,\n INTERNAL: {\n registerComponent,\n removeApp,\n components,\n useAsService\n }\n };\n\n // Inject a circular default export to allow Babel users who were previously\n // using:\n //\n // import firebase from 'firebase';\n // which becomes: var firebase = require('firebase').default;\n //\n // instead of\n //\n // import * as firebase from 'firebase';\n // which becomes: var firebase = require('firebase');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)['default'] = namespace;\n\n // firebase.apps is a read-only getter.\n Object.defineProperty(namespace, 'apps', {\n get: getApps\n });\n\n /**\n * Called by App.delete() - but before any services associated with the App\n * are deleted.\n */\n function removeApp(name: string): void {\n delete apps[name];\n }\n\n /**\n * Get the App object for a given name (or DEFAULT).\n */\n function app(name?: string): FirebaseApp {\n name = name || DEFAULT_ENTRY_NAME;\n if (!contains(apps, name)) {\n throw ERROR_FACTORY.create(AppError.NO_APP, { appName: name });\n }\n return apps[name];\n }\n\n // @ts-ignore\n app['App'] = firebaseAppImpl;\n /**\n * Create a new App instance (name must be unique).\n */\n function initializeApp(\n options: FirebaseOptions,\n config?: FirebaseAppConfig\n ): FirebaseApp;\n function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;\n function initializeApp(\n options: FirebaseOptions,\n rawConfig = {}\n ): FirebaseApp {\n if (typeof rawConfig !== 'object' || rawConfig === null) {\n const name = rawConfig;\n rawConfig = { name };\n }\n\n const config = rawConfig as FirebaseAppConfig;\n\n if (config.name === undefined) {\n config.name = DEFAULT_ENTRY_NAME;\n }\n\n const { name } = config;\n\n if (typeof name !== 'string' || !name) {\n throw ERROR_FACTORY.create(AppError.BAD_APP_NAME, {\n appName: String(name)\n });\n }\n\n if (contains(apps, name)) {\n throw ERROR_FACTORY.create(AppError.DUPLICATE_APP, { appName: name });\n }\n\n const app = new firebaseAppImpl(\n options,\n config,\n namespace as _FirebaseNamespace\n );\n\n apps[name] = app;\n\n return app;\n }\n\n /*\n * Return an array of all the non-deleted FirebaseApps.\n */\n function getApps(): FirebaseApp[] {\n // Make a copy so caller cannot mutate the apps list.\n return Object.keys(apps).map(name => apps[name]);\n }\n\n function registerComponent(\n component: Component\n ): FirebaseServiceNamespace | null {\n const componentName = component.name;\n if (components.has(componentName)) {\n logger.debug(\n `There were multiple attempts to register component ${componentName}.`\n );\n\n return component.type === ComponentType.PUBLIC\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentName]\n : null;\n }\n\n components.set(componentName, component);\n\n // create service namespace for public components\n if (component.type === ComponentType.PUBLIC) {\n // The Service namespace is an accessor function ...\n const serviceNamespace = (\n appArg: FirebaseApp = app()\n ): FirebaseService => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (typeof (appArg as any)[componentName] !== 'function') {\n // Invalid argument.\n // This happens in the following case: firebase.storage('gs:/')\n throw ERROR_FACTORY.create(AppError.INVALID_APP_ARGUMENT, {\n appName: componentName\n });\n }\n\n // Forward service instance lookup to the FirebaseApp.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (appArg as any)[componentName]();\n };\n\n // ... and a container for service-level properties.\n if (component.serviceProps !== undefined) {\n deepExtend(serviceNamespace, component.serviceProps);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentName] = serviceNamespace;\n\n // Patch the FirebaseAppImpl prototype\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (firebaseAppImpl.prototype as any)[componentName] =\n // TODO: The eslint disable can be removed and the 'ignoreRestArgs'\n // option added to the no-explicit-any rule when ESlint releases it.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function(...args: any) {\n const serviceFxn = this._getService.bind(this, componentName);\n return serviceFxn.apply(\n this,\n component.multipleInstances ? args : []\n );\n };\n }\n\n // add the component to existing app instances\n for (const appName of Object.keys(apps)) {\n (apps[appName] as _FirebaseApp)._addComponent(component);\n }\n\n return component.type === ComponentType.PUBLIC\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (namespace as any)[componentName]\n : null;\n }\n\n function registerVersion(\n libraryKeyOrName: string,\n version: string,\n variant?: string\n ): void {\n // TODO: We can use this check to whitelist strings when/if we set up\n // a good whitelist system.\n let library = PLATFORM_LOG_STRING[libraryKeyOrName] ?? libraryKeyOrName;\n if (variant) {\n library += `-${variant}`;\n }\n const libraryMismatch = library.match(/\\s|\\//);\n const versionMismatch = version.match(/\\s|\\//);\n if (libraryMismatch || versionMismatch) {\n const warning = [\n `Unable to register library \"${library}\" with version \"${version}\":`\n ];\n if (libraryMismatch) {\n warning.push(\n `library name \"${library}\" contains illegal characters (whitespace or \"/\")`\n );\n }\n if (libraryMismatch && versionMismatch) {\n warning.push('and');\n }\n if (versionMismatch) {\n warning.push(\n `version name \"${version}\" contains illegal characters (whitespace or \"/\")`\n );\n }\n logger.warn(warning.join(' '));\n return;\n }\n registerComponent(\n new Component(\n `${library}-version` as Name,\n () => ({ library, version }),\n ComponentType.VERSION\n )\n );\n }\n\n function onLog(logCallback: LogCallback | null, options?: LogOptions): void {\n if (logCallback !== null && typeof logCallback !== 'function') {\n throw ERROR_FACTORY.create(AppError.INVALID_LOG_ARGUMENT, {\n appName: name\n });\n }\n setUserLogHandler(logCallback, options);\n }\n\n // Map the requested service to a registered service name\n // (used to map auth to serverAuth service when needed).\n function useAsService(app: FirebaseApp, name: string): string | null {\n if (name === 'serverAuth') {\n return null;\n }\n\n const useService = name;\n\n return useService;\n }\n\n return namespace;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseApp, _FirebaseNamespace } from '@firebase/app-types/private';\nimport { createSubscribe, deepExtend, ErrorFactory } from '@firebase/util';\nimport { FirebaseAppImpl } from './firebaseApp';\nimport { createFirebaseNamespaceCore } from './firebaseNamespaceCore';\n\n/**\n * Return a firebase namespace object.\n *\n * In production, this will be called exactly once and the result\n * assigned to the 'firebase' global. It may be called multiple times\n * in unit tests.\n */\nexport function createFirebaseNamespace(): FirebaseNamespace {\n const namespace = createFirebaseNamespaceCore(FirebaseAppImpl);\n (namespace as _FirebaseNamespace).INTERNAL = {\n ...(namespace as _FirebaseNamespace).INTERNAL,\n createFirebaseNamespace,\n extendNamespace,\n createSubscribe,\n ErrorFactory,\n deepExtend\n };\n\n /**\n * Patch the top-level firebase namespace with additional properties.\n *\n * firebase.INTERNAL.extendNamespace()\n */\n function extendNamespace(props: { [prop: string]: unknown }): void {\n deepExtend(namespace, props);\n }\n\n return namespace;\n}\n\nexport const firebase = createFirebaseNamespace();\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentContainer,\n ComponentType,\n Provider,\n Name\n} from '@firebase/component';\n\nexport class PlatformLoggerService {\n constructor(private readonly container: ComponentContainer) {}\n // In initial implementation, this will be called by installations on\n // auth token refresh, and installations will send this string.\n getPlatformInfoString(): string {\n const providers = this.container.getProviders();\n // Loop through providers and get library/version pairs from any that are\n // version components.\n return providers\n .map(provider => {\n if (isVersionServiceProvider(provider)) {\n const service = provider.getImmediate();\n return `${service.library}/${service.version}`;\n } else {\n return null;\n }\n })\n .filter(logString => logString)\n .join(' ');\n }\n}\n/**\n *\n * @param provider check if this provider provides a VersionService\n *\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\n * provides VersionService. The provider is not necessarily a 'app-version'\n * provider.\n */\nfunction isVersionServiceProvider(\n provider: Provider\n): provider is Provider<'app-version'> {\n const component = provider.getComponent();\n return component?.type === ComponentType.VERSION;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { firebase as firebaseNamespace } from './src/firebaseNamespace';\nimport { isNode, isBrowser } from '@firebase/util';\nimport { logger } from './src/logger';\nimport { registerCoreComponents } from './src/registerCoreComponents';\n\n// Firebase Lite detection test\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nif (isBrowser() && (self as any).firebase !== undefined) {\n logger.warn(`\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n `);\n\n // eslint-disable-next-line\n const sdkVersion = ((self as any).firebase as FirebaseNamespace).SDK_VERSION;\n if (sdkVersion && sdkVersion.indexOf('LITE') >= 0) {\n logger.warn(`\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n `);\n }\n}\n\nconst initializeApp = firebaseNamespace.initializeApp;\n\n// TODO: This disable can be removed and the 'ignoreRestArgs' option added to\n// the no-explicit-any rule when ESlint releases it.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfirebaseNamespace.initializeApp = function(...args: any) {\n // Environment check before initializing app\n // Do the check in initializeApp, so people have a chance to disable it by setting logLevel\n // in @firebase/logger\n if (isNode()) {\n logger.warn(`\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the \"main\" field in package.json.\n \n If you are using Webpack, you can specify \"main\" as the first item in\n \"resolve.mainFields\":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the rollup-plugin-node-resolve plugin and specify \"main\"\n as the first item in \"mainFields\", e.g. ['main', 'module'].\n https://github.com/rollup/rollup-plugin-node-resolve\n `);\n }\n return initializeApp.apply(undefined, args);\n};\n\nexport const firebase = firebaseNamespace;\n\nregisterCoreComponents(firebase);\n\n// eslint-disable-next-line import/no-default-export\nexport default firebase;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CONSTANTS } from './constants';\n\n/**\n * Returns navigator.userAgent string or '' if it's not defined.\n * @return user agent string\n */\nexport function getUA(): string {\n if (\n typeof navigator !== 'undefined' &&\n typeof navigator['userAgent'] === 'string'\n ) {\n return navigator['userAgent'];\n } else {\n return '';\n }\n}\n\n/**\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\n *\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\n * wait for a callback.\n */\nexport function isMobileCordova(): boolean {\n return (\n typeof window !== 'undefined' &&\n // @ts-ignore Setting up an broadly applicable index signature for Window\n // just to deal with this case would probably be a bad idea.\n !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\n /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())\n );\n}\n\n/**\n * Detect Node.js.\n *\n * @return true if Node.js environment is detected.\n */\n// Node detection logic from: https://github.com/iliakan/detect-node/\nexport function isNode(): boolean {\n try {\n return (\n Object.prototype.toString.call(global.process) === '[object process]'\n );\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Detect Browser Environment\n */\nexport function isBrowser(): boolean {\n return typeof self === 'object' && self.self === self;\n}\n\n/**\n * Detect browser extensions (Chrome and Firefox at least).\n */\ninterface BrowserRuntime {\n id?: unknown;\n}\ndeclare const chrome: { runtime?: BrowserRuntime };\ndeclare const browser: { runtime?: BrowserRuntime };\nexport function isBrowserExtension(): boolean {\n const runtime =\n typeof chrome === 'object'\n ? chrome.runtime\n : typeof browser === 'object'\n ? browser.runtime\n : undefined;\n return typeof runtime === 'object' && runtime.id !== undefined;\n}\n\n/**\n * Detect React Native.\n *\n * @return true if ReactNative environment is detected.\n */\nexport function isReactNative(): boolean {\n return (\n typeof navigator === 'object' && navigator['product'] === 'ReactNative'\n );\n}\n\n/** Detects Electron apps. */\nexport function isElectron(): boolean {\n return getUA().indexOf('Electron/') >= 0;\n}\n\n/** Detects Internet Explorer. */\nexport function isIE(): boolean {\n const ua = getUA();\n return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\n}\n\n/** Detects Universal Windows Platform apps. */\nexport function isUWP(): boolean {\n return getUA().indexOf('MSAppHost/') >= 0;\n}\n\n/**\n * Detect whether the current SDK build is the Node version.\n *\n * @return true if it's the Node SDK build.\n */\nexport function isNodeSdk(): boolean {\n return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseNamespace } from '@firebase/app-types';\nimport { _FirebaseNamespace } from '@firebase/app-types/private';\nimport { Component, ComponentType } from '@firebase/component';\nimport { PlatformLoggerService } from './platformLoggerService';\nimport { name, version } from '../package.json';\n\nexport function registerCoreComponents(\n firebase: FirebaseNamespace,\n variant?: string\n): void {\n (firebase as _FirebaseNamespace).INTERNAL.registerComponent(\n new Component(\n 'platform-logger',\n container => new PlatformLoggerService(container),\n ComponentType.PRIVATE\n )\n );\n // Register `app` package.\n firebase.registerVersion(name, version, variant);\n // Register platform SDK identifier (no version).\n firebase.registerVersion('fire-js', '');\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase from '@firebase/app';\nimport { name, version } from '../package.json';\n\nfirebase.registerVersion(name, version, 'app');\n\nexport default firebase;\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__assign","assign","t","s","i","n","arguments","length","prototype","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__values","o","m","__read","r","ar","error","deepExtend","target","source","constructor","Date","getTime","undefined","prop","Deferred","callback","_this","promise","catch","Error","create","__","code","message","_super","FirebaseError","captureStackTrace","ErrorFactory","_i","data","customData","fullCode","service","template","errors","replace","PATTERN","key","toString","fullMessage","serviceName","_b","keys","_a","slice","console","warn","contains","obj","createSubscribe","executor","onNoObservers","proxy","ObserverProxy","subscribe","bind","forEachObserver","observer","close","complete","nextOrObserver","methods","methods_1","method","implementsAnyMethods","noop","unsub","unsubscribeOne","observers","finalized","task","finalError","observerCount","fn","sendOne","err","Component","mode","instantiationMode","multipleInstances","props","serviceProps","name","instanceFactory","type","DEFAULT_ENTRY_NAME","Provider","identifier","normalizedIdentifier","normalizeInstanceIdentifier","instancesDeferred","has","deferred","set","instance","getOrInitializeService","get","options","optional","component","entries","_d","instanceIdentifier","instanceDeferred","delete","instances","services","from","values","all","filter","map","INTERNAL","container","Map","ComponentContainer","provider","getProvider","isComponentSet","setComponent","providers","addComponent","LogLevel","defaultLogHandler","logType","args","logLevel","now","toISOString","ConsoleMethod","levelStringToEnum","debug","DEBUG","verbose","VERBOSE","info","INFO","WARN","ERROR","silent","SILENT","defaultLogLevel","Logger","_logLevel","val","_logHandler","_userLogHandler","setLogLevel","level","newLevel","forEach","inst","ERRORS","ERROR_FACTORY","PLATFORM_LOG_STRING","appName","logger","FirebaseAppImpl","checkDestroyed_","automaticDataCollectionEnabled_","name_","options_","firebase_","removeApp","getProviders","isDeleted_","getImmediate","clearInstance","addOrOverwriteComponent","config","automaticDataCollectionEnabled","_addComponent","components","log","createFirebaseNamespaceCore","firebaseAppImpl","apps","namespace","__esModule","initializeApp","rawConfig","String","app","registerVersion","libraryKeyOrName","version","variant","library","libraryMismatch","match","versionMismatch","warning","join","registerComponent","onLog","logCallback","customLogLevel","userLogHandler","arg","JSON","stringify","ignored","toLowerCase","instances_1","setUserLogHandler","SDK_VERSION","useAsService","componentName","serviceNamespace","appArg","_getService","defineProperty","firebase","createFirebaseNamespace","extendNamespace","PlatformLoggerService","getComponent","logString","self","sdkVersion","indexOf","firebaseNamespace","global","process","isNode"],"mappings":"8LAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAG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IAA4C,GAA9BA,GAAWC,QAAQ,SACnChE,EAAO9G,KAAK,sNAOhB,IAAMqI,GAAgB0C,GAAkB1C,cAKxC0C,GAAkB1C,cAAgB,eAAS,aAAAvJ,mBAAAA,IAAAiG,kBAmBzC,kBCPA,IACE,MACqD,qBAAnDrL,OAAOc,UAAUgF,SAAS/E,KAAKuQ,OAAOC,SAExC,MAAOzP,GACP,QDbE0P,IACFpE,EAAO9G,KAAK,ypBAcPqI,GAAc3N,WAAMoD,EAAWiH,QEzCtCuF,GACA1B,GF2CW0B,GAAWS,IE5CtBT,GF8CqBA,IE3CYpG,SAASiF,kBACxC,IAAIrH,EACF,kBACA,SAAAqC,GAAa,OAAA,IAAIsG,GAAsBtG,gBAK3CmG,GAAS7B,gBAAgBrG,UAAewG,IAExC0B,GAAS7B,gBAAgB,UAAW,cCjB7BA,oCAA+B"}PK!Rii*assets/vendor/js/firebase-messaging.min.jsnu[!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@firebase/app")):"function"==typeof define&&define.amd?define(["exports","@firebase/app"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).firebase=e.firebase||{},e.firebase.messaging=e.firebase.messaging||{}),e.firebase.app)}(this,function(ct,ft){"use strict";try{(function(){var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;ns[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function t(){for(var e=[],t=0;t"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new s(o,e,i)},h);function h(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var v=/\{\$([^}]+)}/g,g=(b.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},b.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},b.prototype.setServiceProps=function(e){return this.serviceProps=e,this},b);function b(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}function y(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function w(n,r,i){var o,e=new Promise(function(e,t){y(o=n[r].apply(n,i)).then(e,t)});return e.request=o,e}function m(e,n,t){t.forEach(function(t){Object.defineProperty(e.prototype,t,{get:function(){return this[n][t]},set:function(e){this[n][t]=e}})})}function k(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return w(this[n],e,arguments)})})}function S(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return this[n][e].apply(this[n],arguments)})})}function I(e,r,t,n){n.forEach(function(n){n in t.prototype&&(e.prototype[n]=function(){return e=this[r],(t=w(e,n,arguments)).then(function(e){if(e)return new T(e,t.request)});var e,t})})}function _(e){this._index=e}function T(e,t){this._cursor=e,this._request=t}function C(e){this._store=e}function P(n){this._tx=n,this.complete=new Promise(function(e,t){n.oncomplete=function(){e()},n.onerror=function(){t(n.error)},n.onabort=function(){t(n.error)}})}function x(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new P(n)}function j(e){this._db=e}function D(e,t,n){var t=w(indexedDB,"open",[e,t]),r=t.request;return r&&(r.onupgradeneeded=function(e){n&&n(new x(r.result,e.oldVersion,r.transaction))}),t.then(function(e){return new j(e)})}function O(e){return w(indexedDB,"deleteDatabase",[e])}m(_,"_index",["name","keyPath","multiEntry","unique"]),k(_,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),I(_,"_index",IDBIndex,["openCursor","openKeyCursor"]),m(T,"_cursor",["direction","key","primaryKey","value"]),k(T,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(T.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),y(t._request).then(function(e){if(e)return new T(e,t._request)})})})}),C.prototype.createIndex=function(){return new _(this._store.createIndex.apply(this._store,arguments))},C.prototype.index=function(){return new _(this._store.index.apply(this._store,arguments))},m(C,"_store",["name","keyPath","indexNames","autoIncrement"]),k(C,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),I(C,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),S(C,"_store",IDBObjectStore,["deleteIndex"]),P.prototype.objectStore=function(){return new C(this._tx.objectStore.apply(this._tx,arguments))},m(P,"_tx",["objectStoreNames","mode"]),S(P,"_tx",IDBTransaction,["abort"]),x.prototype.createObjectStore=function(){return new C(this._db.createObjectStore.apply(this._db,arguments))},m(x,"_db",["name","version","objectStoreNames"]),S(x,"_db",IDBDatabase,["deleteObjectStore","close"]),j.prototype.transaction=function(){return new P(this._db.transaction.apply(this._db,arguments))},m(j,"_db",["name","version","objectStoreNames"]),S(j,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(i){[C,_].forEach(function(e){i in e.prototype&&(e.prototype[i.replace("open","iterate")]=function(){var e=(n=arguments,Array.prototype.slice.call(n)),t=e[e.length-1],n=this._store||this._index,r=n[i].apply(n,e.slice(0,-1));r.onsuccess=function(){t(r.result)}})})}),[_,C].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,i=[];return new Promise(function(t){r.iterateCursor(e,function(e){e?(i.push(e.value),void 0===n||i.length!=n?e.continue():t(i)):t(i)})})})});var E="0.0.900",K=1e4,M="w:"+E,N="FIS_v2",A="https://firebaseinstallations.googleapis.com/v1",q=36e5,B=((B={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',B["not-registered"]="Firebase Installation is not registered.",B["installation-not-found"]="Firebase Installation not found.",B["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',B["app-offline"]="Could not process request. Application offline.",B["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",B),V=new d("installations","Installations",B);function R(e){return e instanceof s&&e.code.includes("request-failed")}function F(e){e=e.projectId;return A+"/projects/"+e+"/installations"}function H(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}function W(n,r){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,r.json()];case 1:return t=e.sent(),t=t.error,[2,V.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function L(e){e=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function $(e,t){t=t.refreshToken,e=L(e);return e.append("Authorization",N+" "+t),e}function U(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,n()];case 1:return 500<=(t=e.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function G(t){return new Promise(function(e){setTimeout(e,t)})}var J=/^[cdef][\w-]{21}$/,z="";function Y(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;e=function(e){return btoa(String.fromCharCode.apply(String,t(e))).replace(/\+/g,"-").replace(/\//g,"_")}(e).substr(0,22);return J.test(e)?e:z}catch(e){return z}}function Z(e){return e.appName+"!"+e.appId}var Q=new Map;function X(e,t){e=Z(e);ee(e,t),function(e,t){var n=function(){!te&&"BroadcastChannel"in self&&((te=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){ee(e.data.key,e.data.fid)});return te}();n&&n.postMessage({key:e,fid:t});0===Q.size&&te&&(te.close(),te=null)}(e,t)}function ee(e,t){var n,r,i=Q.get(e);if(i)try{for(var o=a(i),s=o.next();!s.done;s=o.next())(0,s.value)(t)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}var te=null;var ne="firebase-installations-database",re=1,ie="firebase-installations-store",oe=null;function se(){return oe=oe||D(ne,re,function(e){0===e.oldVersion&&e.createObjectStore(ie)})}function ae(o,s){return l(this,void 0,void 0,function(){var t,n,r,i;return p(this,function(e){switch(e.label){case 0:return t=Z(o),[4,se()];case 1:return r=e.sent(),n=r.transaction(ie,"readwrite"),[4,(r=n.objectStore(ie)).get(t)];case 2:return i=e.sent(),[4,r.put(s,t)];case 3:return e.sent(),[4,n.complete];case 4:return e.sent(),i&&i.fid===s.fid||X(o,s.fid),[2,s]}})})}function ue(r){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return t=Z(r),[4,se()];case 1:return n=e.sent(),[4,(n=n.transaction(ie,"readwrite")).objectStore(ie).delete(t)];case 2:return e.sent(),[4,n.complete];case 3:return e.sent(),[2]}})})}function ce(s,a){return l(this,void 0,void 0,function(){var t,n,r,i,o;return p(this,function(e){switch(e.label){case 0:return t=Z(s),[4,se()];case 1:return r=e.sent(),n=r.transaction(ie,"readwrite"),[4,(r=n.objectStore(ie)).get(t)];case 2:return i=e.sent(),void 0!==(o=a(i))?[3,4]:[4,r.delete(t)];case 3:return e.sent(),[3,6];case 4:return[4,r.put(o,t)];case 5:e.sent(),e.label=6;case 6:return[4,n.complete];case 7:return e.sent(),!o||i&&i.fid===o.fid||X(s,o.fid),[2,o]}})})}function fe(i){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return[4,ce(i,function(e){e=pe(e||{fid:Y(),registrationStatus:0}),e=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(i){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return[4,le(i)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,G(100)];case 3:return e.sent(),[4,le(i)];case 4:return t=e.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,fe(i)];case 6:return r=e.sent(),n=r.installationEntry,(r=r.registrationPromise)?[2,r]:[2,n];case 7:return[2,t]}})})}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(V.create("app-offline"));return{installationEntry:t,registrationPromise:n}}t={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},e=function(r,i){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(s,e){var a=e.fid;return l(this,void 0,void 0,function(){var t,n,r,i,o;return p(this,function(e){switch(e.label){case 0:return t=F(s),n=L(s),o={fid:a,authVersion:N,appId:s.appId,sdkVersion:M},r={method:"POST",headers:n,body:JSON.stringify(o)},[4,U(function(){return fetch(t,r)})];case 1:return(i=e.sent()).ok?[4,i.json()]:[3,3];case 2:return o=e.sent(),[2,{fid:o.fid||a,registrationStatus:2,refreshToken:o.refreshToken,authToken:H(o.authToken)}];case 3:return[4,W("Create Installation",i)];case 4:throw e.sent()}})})}(r,i)];case 1:return t=e.sent(),[2,ae(r,t)];case 2:return R(n=e.sent())&&409===n.customData.serverCode?[4,ue(r)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,ae(r,{fid:i.fid,registrationStatus:0})];case 5:e.sent(),e.label=6;case 6:throw n;case 7:return[2]}})})}(e,t);return{installationEntry:t,registrationPromise:e}}}(i,e);return t=e.registrationPromise,e.installationEntry})];case 1:return(n=e.sent()).fid!==z?[3,3]:(r={},[4,t]);case 2:return[2,(r.installationEntry=e.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:t}]}})})}function le(e){return ce(e,function(e){if(!e)throw V.create("installation-not-found");return pe(e)})}function pe(e){return 1===(t=e).registrationStatus&&t.registrationTime+K=a.createTime+et?[2,function(i,o){return l(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,5]),[4,function(o,s){return l(this,void 0,void 0,function(){var t,n,r,i;return p(this,function(e){switch(e.label){case 0:return[4,Ze(o)];case 1:t=e.sent(),n=Qe(s.subscriptionOptions),n={method:"PATCH",headers:t,body:JSON.stringify(n)},e.label=2;case 2:return e.trys.push([2,5,,6]),[4,fetch(Ye(o.appConfig)+"/"+s.token,n)];case 3:return[4,e.sent().json()];case 4:return r=e.sent(),[3,6];case 5:throw i=e.sent(),Se.create("token-update-failed",{errorInfo:i});case 6:if(r.error)throw i=r.error.message,Se.create("token-update-failed",{errorInfo:i});if(!r.token)throw Se.create("token-update-no-token");return[2,r.token]}})})}(i.firebaseDependencies,o)];case 1:return t=e.sent(),n=f(f({},o),{token:t,createTime:Date.now()}),[4,Ve(i.firebaseDependencies,n)];case 2:return e.sent(),[2,t];case 3:return r=e.sent(),[4,nt(i)];case 4:throw e.sent(),r;case 5:return[2]}})})}(c,{token:a.token,createTime:Date.now(),subscriptionOptions:s})]:[2,a.token];case 9:return[2]}var t,n,r,i,o})})}function nt(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,Be(n.firebaseDependencies)];case 1:return(t=e.sent())?[4,ze(n.firebaseDependencies,t.token)]:[3,4];case 2:return e.sent(),[4,function(r){return l(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return t=Re(r),[4,qe()];case 1:return n=e.sent(),[4,(n=n.transaction(Ne,"readwrite")).objectStore(Ne).delete(t)];case 2:return e.sent(),[4,n.complete];case 3:return e.sent(),[2]}})})}(n.firebaseDependencies)];case 3:e.sent(),e.label=4;case 4:return[4,n.swRegistration.pushManager.getSubscription()];case 5:return(t=e.sent())?[2,t.unsubscribe()]:[2,!0]}})})}function rt(n,r){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,function(o,s){return l(this,void 0,void 0,function(){var t,n,r,i;return p(this,function(e){switch(e.label){case 0:return[4,Ze(o)];case 1:t=e.sent(),n=Qe(s),n={method:"POST",headers:t,body:JSON.stringify(n)},e.label=2;case 2:return e.trys.push([2,5,,6]),[4,fetch(Ye(o.appConfig),n)];case 3:return[4,e.sent().json()];case 4:return r=e.sent(),[3,6];case 5:throw i=e.sent(),Se.create("token-subscribe-failed",{errorInfo:i});case 6:if(r.error)throw i=r.error.message,Se.create("token-subscribe-failed",{errorInfo:i});if(!r.token)throw Se.create("token-subscribe-no-token");return[2,r.token]}})})}(n,r)];case 1:return t=e.sent(),t={token:t,createTime:Date.now(),subscriptionOptions:r},[4,Ve(n,t)];case 2:return e.sent(),[2,t.token]}})})}function it(n){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),t=n,[4,navigator.serviceWorker.register(Fe,{scope:He})];case 1:return t.swRegistration=e.sent(),n.swRegistration.update().catch(function(){}),[3,3];case 2:throw t=e.sent(),Se.create("failed-service-worker-registration",{browserErrorMessage:t.message});case 3:return[2]}})})}function ot(e){var t={from:e.from,collapseKey:e.collapse_key};return function(e,t){if(!t.notification)return;e.notification={};var n=t.notification.title;n&&(e.notification.title=n);n=t.notification.body;n&&(e.notification.body=n);t=t.notification.image;t&&(e.notification.image=t)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){if(!t.fcmOptions)return;e.fcmOptions={};var n=t.fcmOptions.link;n&&(e.fcmOptions.link=n);t=t.fcmOptions.analytics_label;t&&(e.fcmOptions.analyticsLabel=t)}(t,e),t}function st(n,r,i){return l(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return t=function(e){switch(e){case Xe.NOTIFICATION_CLICKED:return"notification_open";case Xe.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(r),[4,n.firebaseDependencies.analyticsProvider.get()];case 1:return e.sent().logEvent(t,{message_id:i[$e],message_name:i[Ue],message_time:i[Ge],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})}function at(i,o){return l(this,void 0,void 0,function(){var n,r;return p(this,function(e){switch(e.label){case 0:return(n=o.data).isFirebaseMessaging?(i.onMessageHandler&&n.messageType===Xe.PUSH_RECEIVED&&("function"==typeof i.onMessageHandler?i.onMessageHandler(ot(n)):i.onMessageHandler.next(ot(n))),r=n.data,"object"==typeof(t=r)&&t&&$e in t&&"1"===r[Je]?[4,st(i,n.messageType,r)]:[3,2]):[2];case 1:e.sent(),e.label=2;case 2:return[2]}var t})})}function ut(t,n){return l(this,void 0,void 0,function(){return p(this,function(e){switch(e.label){case 0:if(!navigator)throw Se.create("only-available-in-window");return navigator.serviceWorker.addEventListener("message",function(e){return at(t,e)}),"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:e.sent(),e.label=2;case 2:if("granted"!==Notification.permission)throw Se.create("permission-blocked");return[4,function(t,n){return l(this,void 0,void 0,function(){return p(this,function(e){return n?t.vapidKey=n:t.vapidKey||(t.vapidKey=We),[2]})})}(t,null==n?void 0:n.vapidKey)];case 3:return e.sent(),[4,function(t,n){return l(this,void 0,void 0,function(){return p(this,function(e){switch(e.label){case 0:return n||t.swRegistration?[3,2]:[4,it(t)];case 1:e.sent(),e.label=2;case 2:if(!n&&t.swRegistration)return[2];if(!(n instanceof ServiceWorkerRegistration))throw Se.create("invalid-sw-registration");return t.swRegistration=n,[2]}})})}(t,null==n?void 0:n.serviceWorkerRegistration)];case 4:return e.sent(),[2,tt(t)]}})})}(E=Xe=Xe||{}).PUSH_RECEIVED="push-received",E.NOTIFICATION_CLICKED="notification-clicked",ft._registerComponent(new g("messaging-exp",Pe,"PUBLIC")),ct.deleteToken=function(e){return function(t){return l(this,void 0,void 0,function(){return p(this,function(e){switch(e.label){case 0:if(!navigator)throw Se.create("only-available-in-window");return t.swRegistration?[3,2]:[4,it(t)];case 1:e.sent(),e.label=2;case 2:return[2,nt(t)]}})})}(e)},ct.getMessaging=function(e){return ft._getProvider(e,"messaging-exp").getImmediate()},ct.getToken=function(t,n){return l(this,void 0,void 0,function(){return p(this,function(e){return[2,ut(t,n)]})})},ct.onMessage=function(e,t){return function(t,e){if(!navigator)throw Se.create("only-available-in-window");return navigator.serviceWorker.addEventListener("message",function(e){return at(t,e)}),t.onMessageHandler=e,function(){t.onMessageHandler=null}}(e,t)},Object.defineProperty(ct,"__esModule",{value:!0})}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.")}});PK!J??assets/css/main-css.min-rtl.cssnu[/* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. */ /* Created on : Aug 4, 2018, 7:47:47 PM Author : Magazine3 */.pwaforwp-hide { display: none!important } .pwaforwp-dashboard h2 { margin-bottom: 5px } .pwaforwp-dashboard table th { width: 0; padding: 0 } .pwaforwp-files-table { width: 100% } .pwaforwp-files-table th td { width: 300px } .pwaforwp-files-table th { vertical-align: inherit } .pwa-query-success { color: #028a00 } .pwa-query-error { color: #f73434 } .pwa_hide { display: none } .pwaforwp-push_notification th { padding: 0; width: 0 } .pwaforwp-push_notification td { padding: 0 } .pwaforwp-push-notificatoin-table { width: 100% } .pwaforwp-push-notificatoin-table th { width: 20%; padding: 10px } .pwaforwp-push-notificatoin-table input[type=text] { width: 30% } .pwaforwp-notification-success { color: #028a00 } .pwaforwp-notification-error { color: #f73434 } .pwaforwp_precaching_table input, select { width: 200px } .pwaforwp_precaching_table td { vertical-align: top } .pwaforwp-pre-cache-table td { padding-right: 0; padding-top: 0; padding-bottom: 0 } .pwaforwp-design table th { width: auto; padding: 0 } .pwaforwp-p-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px } .pwafowp-feature-ext { background: #fff; padding: 25px; border: 1px solid #d8d8d8 } .pwaforwp-features-blocks li a { text-decoration: none } .pwaforwp-ele-ic { border-radius: 256px; display: inline-block; padding: 8px 10px 8px 10px; width: 70px; height: 70px; margin-left: 20px; float: right } .pwaforwp-ele-ic img { width: 85%; top: 5px; position: relative; right: 6px } .pwaforwp-ele-tlt h3 { margin: 0; font-size: 18px; line-height: 1.4 } .pwaforwp-ele-tlt p { margin-top: 10px } .form-wrap .pwaforwp-sts-txt { font-size: 16px; color: #000 } .pwaforwp-sts-txt span { color: #bebfc0; padding-right: 5px } .pwaforwp-d-btn { background: #46b450; padding: 6px 18px; border-radius: 30px; font-size: 14px; color: #fff } .pwaforwp-sts-btn a { text-decoration: none } .pwaforwp-sts-btn { box-sizing: border-box; margin-top: 15px; padding: 11px 11px; border: 1px solid #e5e5e5; border-radius: 3px; display: inline-flex; align-items: center; justify-content: space-between; position: relative; width: 100% } .pwaforwp-ext-active span { vertical-align: sub } .pwaforwp-ext-active input { width: 70% } .pwaforwp-ext-active p { margin: 0!important } .pwaforwp-premium_features .form-table th { width: auto; padding: 0 } .pwaforwp-ext-selected { color: #000; font-weight: 500 } #pwaforwp-ext-tab a { cursor: pointer } .pwaforwp-p-feature-table lable { font-weight: 500 } .pwaforwp-sub-tab-headings { margin-top: 10px } .pwaforwp-sub-tab-headings span { color: #0073aa; cursor: pointer } .pwaforwp-sub-tab-headings span.selected { color: #000 } #subtab-pushnots th:empty { display: none } .pwaforwp-main-wrapper { width: 75%; float: right } .pwaforwp-settings-second-div { width: 22%; float: left } .pwaforwp-feedback-panel { height: 200px; width: 280px; background: #fff; position: relative } .pwaforwp-feedback-panel h2 { text-align: center; padding-top: 18px } .pwaforwp-feedback-panel ul { list-style-type: circle; list-style: decimal; padding-right: 30px; font-size: 15px } .pwaforwp-social-sharing-buttons { text-align: center; padding-top: 20px } .pwaforwp-social-sharing-buttons a { text-align: center; text-decoration: none; padding: 8px } .pwaforwp-social-sharing-buttons .pwaforwp-twitter-share-button { background: #1b95e0!important; box-shadow: 0 0 0 #1b95e0!important; color: #fff!important; line-height: 20px!important; height: 21px!important; border-radius: 3px; margin-right: 5px } .pwaforwp-social-sharing-buttons .pwaforwp-facebook-share { background: #3b5998; box-shadow: 0 0 0 #1b95e0!important; color: #fff!important; line-height: 20px!important; height: 21px!important; border-radius: 3px; margin-left: 5px } .pwaforwp-upgrade-pro { background: #fff; top: 32px; padding: 30px; border: 1px solid #cecece; display: inline-block; color: #111; margin-top: 10px; border-radius: 8px; position: relative; box-sizing: border-box; width: 100% } .pwaforwp-upgrade-pro h2 { margin: 0; color: #222; font-size: 20px; text-align: center; margin-bottom: 27px } .pwaforwp-upgrade-pro ul { margin: 0 0 30px 0 } .pwaforwp-upgrade-pro ul li { position: relative; padding-right: 30px; font-size: 15px; line-height: 1.4; margin-bottom: 10px } .pwaforwp-upgrade-pro ul li:before { content: "\f147"; background-repeat: no-repeat; font-family: dashicons; position: absolute; color: #46b450; font-size: 25px; right: 0; line-height: 1; top: 0 } .pwaforwp-upgrade-pro a { background: #43a047; padding: 10px 0; display: block; text-align: center; color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: 1px; border-radius: 5px } .pwaforwp-upgrade-pro.promo-cpn { box-sizing: border-box; border: 1px solid #ca4a1f } .pwaforwp-upgrade-pro.promo-cpn h2 { color: #ca4a1f; font-weight: bold; font-size: 24px; text-align: center; margin: 0 0 20px 0 } .pwaforwp-upgrade-pro.promo-cpn span { text-align: center; font-size: 14px; display: inline-block; color: #444; padding: 0 20px; box-sizing: border-box; line-height: 1.4; font-weight: 400 } .pwa-promo { font-size: 20px; margin-top: 15px; width: 100%; text-align: center } .pwaforwp-upgrade-pro.promo-cpn .pwa-promo .prm-cpn { border: 1px dashed #ca4a1f; border-radius: 100px; margin-top: 5px; color: #ca4a1f; font-size: 20px; padding: 2px 15px 2px 15px } .pwaforwp-upgrade-pro.promo-cpn .prm-txt { font-size: 11px; font-weight: 600; text-transform: uppercase; display: block; margin-top: 10px; line-height: 1 } .pwaforwp-wrap .pwafw-tooltip { position: relative; display: inline!important; margin-right: 0; color: #d8d8d8!important; cursor: pointer; } .pwaforwp-wrap .pwafw-tooltip:hover { color: #333!important } .pwaforwp-wrap .pwafw-tooltip i { font-size: 18px; position: relative; top: 3px } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle { visibility: hidden; width: max-content; background-color: #111; box-shadow: 0 0 10px 0 #999; color: #fff; line-height: 1.5; max-width: 410px; text-align: center; border-radius: 5px; padding: 10px 8px; position: absolute; z-index: 100; bottom: 100%; right: -26px; margin-bottom: 6px!important; opacity: 0; transition: opacity .3s; font-size: 11px } .pwaforwp-wrap .pwafw-help-subtitle a { color: #fff; background: #eee; padding: 0 5px; margin-right: 4px; color: #333; text-decoration: none; border-radius: 53px; margin-top: 9px } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle::after { content: ""; position: absolute; top: 100%; right: 35px; max-width: 1px; margin-right: -5px; border-width: 9px; border-style: solid; border-color: #111 transparent transparent transparent } .pwaforwp-wrap .pwafw-tooltip:hover .pwafw-help-subtitle { visibility: visible; opacity: 1 } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom { position: absolute; bottom: 3px; border-top: 1px solid #fff; right: 0; left: 0; top: auto; padding: 3px 0 0 } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom .help-wrap { width: 49%; float: right; border-left: 1px solid #fff; color: #fff } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom .help-wrap:last-child { border: none } .pwaforwp-wrap .afw-tootip-bottom i:before { font-size: 15px } .ios-splash-images { padding: 10px 15px 10px 0; border: 1px solid #cdcdcd; display: block } .ios-splash-images-field { padding: 5px 0; font-size: 13px } .pwaforwp-feature-cards { list-style: none; text-align: justify; margin-right: -2%; margin-top: 20px } .pwaforwp-feature-cards li.pwaforwp-card-wrap { max-width: 48%; font-size: 16px; display: inline-block; width: 100%; text-align: right; margin-bottom: 2%; margin-right: 2%; vertical-align: top } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content { position: relative; background: #fff; box-shadow: -1px 1px 0 rgba(0, 0, 0, .1); padding: 14px 17px 14px 7px; border-radius: 5px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content .card-action { display: inline-flex } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content h2 { font-size: 16px; color: #000; margin: 0; line-height: 1; padding: 0; top: -1px; position: relative; cursor: pointer; } .pwaforwp-tlt-sw .card-action-settings span { font-size: 16px; color: #555; position: relative; top: 2px; cursor: pointer } #TB_ajaxContent .pwaforwp-wrap table th:empty { display: none } .pwaforwp-card-wrap .switch { position: relative; display: inline-block; width: 60px; height: 34px } .pwaforwp-card-wrap .switch input { opacity: 0; width: 0; height: 0 } .pwaforwp-card-wrap .slider { position: absolute; cursor: pointer; top: 0; right: 0; left: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s } .pwaforwp-card-wrap .slider:before { position: absolute; content: ""; height: 12px; width: 12px; right: 3px; bottom: 3px; background-color: #fff; transition: .4s } input:checked+.slider { background-color: #46b450 } input:checked+.slider:before { right: -8px } input:focus+.slider { box-shadow: 0 0 1px #2196f3 } input:checked+.slider:before { -webkit-transform: translateX(-26px); -ms-transform: translateX(-26px); transform: translateX(-26px) } .pwaforwp-tlt-sw { display: inline-flex; width: 100%; align-items: center; justify-content: space-between; flex-wrap: wrap } .pwaforwp-card-content label.switch { display: block; padding: 2px 0; width: 33px; height: 14px; left: 31px; position: absolute; top: 15px } .slider.round { border-radius: 60px } .slider.round:before { border-radius: 50% } .pwaforwp-toast-wrap { display: block; position: fixed; width: 200px; pointer-events: none!important; letter-spacing: normal; z-index: 9999999; bottom: 20px; left: 20px } .pwaforwp-toast-single { display: block; width: 100%; padding: 10px; margin: 0 0 5px; border-radius: 4px; font-size: 16px; font-family: arial, sans-serif; line-height: 17px; position: relative; pointer-events: all!important } .pwaforwp-toast-success { background-color: #4ab866; color: #fff } .pwaforwp-toast-error { background-color: #d94f4f; color: #fff } .close-pwaforwp-toast-single { position: absolute; top: 10px; left: 7px; font-size: 20px; cursor: pointer } .pwa_contact_us_div { border-top: 1px solid #ddd; padding-top: 7px; margin-top: 25px } .pwaforwp-ext-list-table { display: inline-block; width: 100% } .pwaforwp-ext-wrap { width: 70%; margin: 0; padding: 0; margin-left: 20px; float: right; margin-bottom: 20px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pro { background: #4caf50; padding: 1px 7px; border-radius: 4px; font-size: 14px; margin-right: 1px; color: #fff; cursor: pointer; position: relative; left: 9px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .deactivated { background: #989696 } .pwaforwp-center { text-align: center } #TB_ajaxContent::-webkit-scrollbar { -webkit-appearance: none } #TB_ajaxContent::-webkit-scrollbar:vertical { width: 12px } #TB_ajaxContent::-webkit-scrollbar:horizontal { height: 12px } #TB_ajaxContent::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .5); border-radius: 10px; border: 2px solid #fff } #TB_ajaxContent::-webkit-scrollbar-track { border-radius: 10px; background-color: #fff } #TB_ajaxContent .addtohomebanner-wrap-tb p { padding-top: 0; margin-top: 0; margin-bottom: 5px } .pwawp-modal-mask { position: fixed; z-index: 99999; top: 0; right: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, .7); display: table; transition: opacity .3s ease } .pwawp-modal-wrapper { display: table-cell; vertical-align: middle } .pwawp-modal-header { background: #fff; width: 100%; z-index: 100; border-bottom: 1px solid #d8d8d8; position: relative; padding-right: 20px } .pwawp-modal-container { position: fixed; overflow: hidden; top: 30px; right: 30px; left: 30px; bottom: 30px; z-index: 160000; overflow: hidden; min-height: 300px; box-shadow: 0 5px 15px rgba(0, 0, 0, .7); background: #fcfcfc; -webkit-font-smoothing: subpixel-antialiased } .pwawp-modal-header h3 { font-weight: 400; padding: 0 0 0 16px; font-size: 20px; line-height: 50px; margin: 0; margin-bottom: 0; font-weight: 600; position: relative; right: 15px } .pwawp-modal-mask .pwawp-modal-body { overflow-y: auto; height: 92%; position: absolute; right: 0; top: 0; right: 35px; left: 0 } .pwawp-modal-settings { padding: 0 0; margin-top: 50px; border-top: 1px solid #d8d8d8; z-index: 1; position: relative } .pwawp-modal-content { height: 100vh; overflow-y: hidden; padding: 0 0 0 20px; overflow-x: hidden } .pwawp-modal-default-button { float: left; position: relative; left: 10px } .pwawp-modal-footer { padding: 10px 0; position: absolute; bottom: 0; width: 100%; bottom: 0; background: #f1f1f1; z-index: 100; display: inline-block } .pwawp-modal-footer .pwawp-del-btn-modal { right: 215px; position: relative; background: 100% 0; border: 0; box-shadow: none; color: #bc0b0b } .pwawp-modal-footer .pwawp-del-btn-modal:hover { background: #455a64; color: #fff } .pwawp-save-btn-modal { position: relative; left: 15px } .pwawp-modal-footer .pwawp-close-btn-modal { margin-left: 20px } .pwawp-modal-body .pwawp-modal-header { padding-right: 20px; height: 50px; background-color: #fafafa; border-bottom: 1px solid #d8d8d8; width: 82%; position: fixed } .pwawp-modal-wrapper .pwawp-media-modal-close { background: #fafafa; box-shadow: 1px 0 0 #d8d8d8 } .pwawp-media-modal-close:focus { outline: 0; border: 0 } .pwawp-media-modal-close:hover { background: #e9e9e9 } .pwawp-media-modal-close { position: absolute; top: 0; left: 0; width: 50px; height: 50px; margin: 0; padding: 0; border: 1px solid transparent; background: 100% 0; color: #666; z-index: 1000; cursor: pointer; outline: 0; transition: color .1s ease-in-out, background .1s ease-in-out } .pwawp-media-modal-close .pwawp-media-modal-icon:before { content: "\f158"; font: normal 20px/1 dashicons; speak: none; vertical-align: middle; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale } .pwawp-modal-settings th:empty { display: none } .ios-splash-screen-creator .field { margin-bottom: 10px; } .ios-splash-screen-creator #pwa-ios-splashmessage { display: inline; } .ios-splash-screen-creator .field label { display: inline-block; width: 50%; } .ios-splash-images .accordion { background-color: #eee; color: #444; cursor: pointer; padding: 18px; width: 100%; text-align: right; border: none; outline: none; transition: 0.4s; } .ios-splash-images .accordion.active, .ios-splash-images .accordion:hover { background-color: #ccc; } .ios-splash-images .panel { padding: 3px 18px; background-color: white; overflow: hidden; max-height: 0; transition: max-height 0.2s ease-out; } .ios-splash-images .accordion:after { content: '\02795'; font-size: 13px; color: #777; float: left; margin-right: 5px; } .ios-splash-images .active:after { content: "\2796"; } .pwaforwp-feedback-notice p { display: inline-block; } .pwaforwp-feedback-notice .dashicons-thumbs-up { padding-left: 5px; }PK!y assets/css/pwaforwp-main.cssnu[/* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. */ /* Created on : Nov 20, 2018, 3:55:15 PM Author : Magazine3 */ @media only screen and (min-width: 992px) { .pwaforwp-footer-prompt { padding: 1% 3%; flex-direction: row; justify-content: center; } } .pwaforwp-footer-prompt{ display: none; width: 100%; line-height: 2em; color: #333; text-align: center; text-decoration: none; min-height: 10%; padding:15px 0px 15px 0px; position: fixed; bottom: 0; justify-content: flex-end; flex-direction: column; flex-grow: 1; animation-duration: 1s; animation-fill-mode: both; z-index: 9999; } .pwaforwp-footer-prompt .pwaforwp-prompt-close:after{ content: "✖"; color: #d5e0eb; position: absolute; right: 10px; top: 10px; font-size: 12px; background: rgba(0, 0, 0, 0.40); border-radius: 30px; text-align: center; width: 20px; height: 20px; line-height: 22px; cursor: pointer; } .pwaforwp-bounceInUp{ animation-name: bounceInUp; } .pwaforwp-animated { animation-duration: 1s; animation-fill-mode: both; } .pwaforwp-btn{ border: none; cursor: pointer; display: inline-block; border-radius: 4px; height: auto; line-height: 1; min-width: auto; padding: 8px 16px; font-size: 16px; margin: 10px 0px 0px 0px; font-family: sans-serif; text-transform: none; transition: all .2s ease-in-out; } /* Center the loader */ #pwaforwp_loading_div { position: fixed; width: 100%; height: 200%; top: 0px; left: 0px; background-color: white; z-index: 9999; } .pwaforwp-loading-wrapper{z-index: 9999999;display:none;} #pwaforwp_loading_icon { position: fixed; left: 50%; top: 50%; z-index: 9999999; margin: -60px 0 0 -60px; border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid #3498db; width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Add animation to "page content" */ .animate-bottom { position: relative; -webkit-animation-name: animatebottom; -webkit-animation-duration: 1s; animation-name: animatebottom; animation-duration: 1s } @-webkit-keyframes animatebottom { from { bottom:-100px; opacity:0 } to { bottom:0px; opacity:1 } } @keyframes animatebottom { from{ bottom:-100px; opacity:0 } to{ bottom:0; opacity:1 } } /** Add to home screen CSS **/ #pwaforwp-add-to-home-click h3{ font-size: 20px; font-weight: 600; margin: 0px; line-height: 1.4; font-family: sans-serif; } @media(max-width:425px){ #pwaforwp-add-to-home-click h3 { font-size: 16px; } .pwaforwp-btn{ font-size: 14px; } .pwaforwp-footer-prompt{ padding:15px 0px 10px 0px; } .pwaforwp-footer-prompt .pwaforwp-prompt-close:after { right: 5px; top: 5px; } } .pwaforwp-app-contents{display: none;} PK!QiESESassets/css/main-css.cssnu[/* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. */ /* Created on : Aug 4, 2018, 7:47:47 PM Author : Magazine3 */ .pwaforwp-hide { display: none!important } .pwaforwp-dashboard h2 { margin-bottom: 5px } .pwaforwp-dashboard table th { width: 0; padding: 0 } .pwaforwp-files-table { width: 100% } .pwaforwp-files-table th td { width: 300px } .pwaforwp-files-table th { vertical-align: inherit } .pwa-query-success { color: #028a00 } .pwa-query-error { color: #f73434 } .pwa_hide { display: none } .pwaforwp-push_notification th { padding: 0; width: 0 } .pwaforwp-push_notification td { padding: 0 } .pwaforwp-push-notificatoin-table { width: 100% } .pwaforwp-push-notificatoin-table th { width: 20%; padding: 10px } .pwaforwp-push-notificatoin-table input[type=text] { width: 30% } .pwaforwp-notification-success { color: #028a00 } .pwaforwp-notification-error { color: #f73434 } .pwaforwp_precaching_table input, select { width: 200px } .pwaforwp_precaching_table td { vertical-align: top } .pwaforwp-pre-cache-table td { padding-left: 0; padding-top: 0; padding-bottom: 0 } .pwaforwp-design table th { width: auto; padding: 0 } .pwaforwp-p-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px } .pwafowp-feature-ext { background: #fff; padding: 25px; border: 1px solid #d8d8d8 } .pwaforwp-features-blocks li a { text-decoration: none } .pwaforwp-ele-ic { border-radius: 256px; display: inline-block; padding: 8px 10px 8px 10px; width: 70px; height: 70px; margin-right: 20px; float: left } .pwaforwp-ele-ic img { width: 85%; top: 5px; position: relative; left: 6px } .pwaforwp-ele-tlt h3 { margin: 0; font-size: 18px; line-height: 1.4 } .pwaforwp-ele-tlt p { margin-top: 10px } .form-wrap .pwaforwp-sts-txt { font-size: 16px; color: #000 } .pwaforwp-sts-txt span { color: #bebfc0; padding-left: 5px } .pwaforwp-d-btn { background: #46b450; padding: 6px 18px; border-radius: 30px; font-size: 14px; color: #fff } .pwaforwp-sts-btn a { text-decoration: none } .pwaforwp-sts-btn { box-sizing: border-box; margin-top: 15px; padding: 11px 11px; border: 1px solid #e5e5e5; border-radius: 3px; display: inline-flex; align-items: center; justify-content: space-between; position: relative; width: 100% } .pwaforwp-ext-active p { margin: 0!important } .pwaforwp-premium_features .form-table th { width: auto; padding: 0 } .pwaforwp-ext-selected { color: #000; font-weight: 500 } #pwaforwp-ext-tab a { cursor: pointer } .pwaforwp-p-feature-table lable { font-weight: 500 } .pwaforwp-sub-tab-headings { margin-top: 10px } .pwaforwp-sub-tab-headings span { color: #0073aa; cursor: pointer } .pwaforwp-sub-tab-headings span.selected { color: #000 } #subtab-pushnots th:empty { display: none } .pwaforwp-main-wrapper { width: 75%; float: left } .pwaforwp-settings-second-div { width: 22%; float: right } .pwaforwp-feedback-panel { height: 200px; width: 280px; background: #fff; position: relative } .pwaforwp-feedback-panel h2 { text-align: center; padding-top: 18px } .pwaforwp-feedback-panel ul { list-style-type: circle; list-style: decimal; padding-left: 30px; font-size: 15px } .pwaforwp-social-sharing-buttons { text-align: center; padding-top: 20px } .pwaforwp-social-sharing-buttons a { text-align: center; text-decoration: none; padding: 8px } .pwaforwp-social-sharing-buttons .pwaforwp-twitter-share-button { background: #1b95e0!important; box-shadow: 0 0 0 #1b95e0!important; color: #fff!important; line-height: 20px!important; height: 21px!important; border-radius: 3px; margin-left: 5px } .pwaforwp-social-sharing-buttons .pwaforwp-facebook-share { background: #3b5998; box-shadow: 0 0 0 #1b95e0!important; color: #fff!important; line-height: 20px!important; height: 21px!important; border-radius: 3px; margin-right: 5px } .pwaforwp-upgrade-pro { background: #fff; top: 32px; padding: 30px; border: 1px solid #cecece; display: inline-block; color: #111; margin-top: 10px; border-radius: 8px; position: relative; box-sizing: border-box; width: 100% } .pwaforwp-upgrade-pro h2 { margin: 0; color: #222; font-size: 20px; text-align: center; margin-bottom: 27px } .pwaforwp-upgrade-pro ul { margin: 0 0 30px 0 } .pwaforwp-upgrade-pro ul li { position: relative; padding-left: 30px; font-size: 15px; line-height: 1.4; margin-bottom: 10px } .pwaforwp-upgrade-pro ul li:before { content: "\f147"; background-repeat: no-repeat; font-family: dashicons; position: absolute; color: #46b450; font-size: 25px; left: 0; line-height: 1; top: 0 } .pwaforwp-upgrade-pro a { background: #43a047; padding: 10px 0; display: block; text-align: center; color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: 1px; border-radius: 5px } .pwaforwp-upgrade-pro.promo-cpn { box-sizing: border-box; border: 1px solid #ca4a1f } .pwaforwp-upgrade-pro.promo-cpn h2 { color: #ca4a1f; font-weight: bold; font-size: 24px; text-align: center; margin: 0 0 20px 0 } .pwaforwp-upgrade-pro.promo-cpn span { text-align: center; font-size: 14px; display: inline-block; color: #444; padding: 0 20px; box-sizing: border-box; line-height: 1.4; font-weight: 400 } .pwa-promo { font-size: 20px; margin-top: 15px; width: 100%; text-align: center } .pwaforwp-upgrade-pro.promo-cpn .pwa-promo .prm-cpn { border: 1px dashed #ca4a1f; border-radius: 100px; margin-top: 5px; color: #ca4a1f; font-size: 20px; padding: 2px 15px 2px 15px } .pwaforwp-upgrade-pro.promo-cpn .prm-txt { font-size: 11px; font-weight: 600; text-transform: uppercase; display: block; margin-top: 10px; line-height: 1 } .pwaforwp-wrap .pwafw-tooltip { position: relative; display: inline!important; margin-left: 0; color: #d8d8d8!important; cursor: pointer; } .pwaforwp-wrap .pwafw-tooltip:hover { color: #333!important } .pwaforwp-wrap .pwafw-tooltip i { font-size: 18px; position: relative; top: 3px } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle { visibility: hidden; width: max-content; background-color: #111; box-shadow: 0 0 10px 0 #999; color: #fff; line-height: 1.5; max-width: 410px; text-align: center; border-radius: 5px; padding: 10px 8px; position: absolute; z-index: 100; bottom: 100%; left: -26px; margin-bottom: 6px!important; opacity: 0; transition: opacity .3s; font-size: 11px } .pwaforwp-wrap .pwafw-help-subtitle a { color: #fff; background: #eee; padding: 0 5px; margin-left: 4px; color: #333; text-decoration: none; border-radius: 53px; margin-top: 9px } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle::after { content: ""; position: absolute; top: 100%; left: 35px; max-width: 1px; margin-left: -5px; border-width: 9px; border-style: solid; border-color: #111 transparent transparent transparent } .pwaforwp-wrap .pwafw-tooltip:hover .pwafw-help-subtitle { visibility: visible; opacity: 1 } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom { position: absolute; bottom: 3px; border-top: 1px solid #fff; left: 0; right: 0; top: auto; padding: 3px 0 0 } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom .help-wrap { width: 49%; float: left; border-right: 1px solid #fff; color: #fff } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom .help-wrap:last-child { border: none } .pwaforwp-wrap .afw-tootip-bottom i:before { font-size: 15px } .ios-splash-images { padding: 10px 0 10px 15px; border: 1px solid #cdcdcd; display: block } .ios-splash-images-field { padding: 5px 0; font-size: 13px } .pwaforwp-feature-cards { list-style: none; text-align: justify; margin-left: -2%; margin-top: 20px } .pwaforwp-feature-cards li.pwaforwp-card-wrap { max-width: 48%; font-size: 16px; display: inline-block; width: 100%; text-align: left; margin-bottom: 2%; margin-left: 2%; vertical-align: top } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content { position: relative; background: #fff; box-shadow: 1px 1px 0 rgba(0, 0, 0, .1); padding: 14px 7px 14px 17px; border-radius: 5px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content .card-action { display: inline-flex } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content h2 { font-size: 16px; color: #000; margin: 0; line-height: 1; padding: 0; top: -1px; position: relative; cursor: pointer; } .pwaforwp-tlt-sw .card-action-settings span { font-size: 16px; color: #555; position: relative; top: 2px; cursor: pointer } #TB_ajaxContent .pwaforwp-wrap table th:empty { display: none } .pwaforwp-card-wrap .switch { position: relative; display: inline-block; width: 60px; height: 34px } .pwaforwp-card-wrap .switch input { opacity: 0; width: 0; height: 0 } .pwaforwp-card-wrap .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s } .pwaforwp-card-wrap .slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: #fff; transition: .4s } input:checked+.slider { background-color: #46b450 } input:checked+.slider:before { left: -8px } input:focus+.slider { box-shadow: 0 0 1px #2196f3 } input:checked+.slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px) } .pwaforwp-tlt-sw { display: inline-flex; width: 100%; align-items: center; justify-content: space-between; flex-wrap: wrap } .pwaforwp-card-content label.switch { display: block; padding: 2px 0; width: 33px; height: 14px; right: 31px; position: absolute; top: 15px } .slider.round { border-radius: 60px } .slider.round:before { border-radius: 50% } .pwaforwp-toast-wrap { display: block; position: fixed; width: 200px; pointer-events: none!important; letter-spacing: normal; z-index: 9999999; bottom: 20px; right: 20px } .pwaforwp-toast-single { display: block; width: 100%; padding: 10px; margin: 0 0 5px; border-radius: 4px; font-size: 16px; font-family: arial, sans-serif; line-height: 17px; position: relative; pointer-events: all!important } .pwaforwp-toast-success { background-color: #4ab866; color: #fff } .pwaforwp-toast-error { background-color: #d94f4f; color: #fff } .close-pwaforwp-toast-single { position: absolute; top: 10px; right: 7px; font-size: 20px; cursor: pointer } .pwa_contact_us_div { border-top: 1px solid #ddd; padding-top: 7px; margin-top: 25px } .pwaforwp-ext-list-table { display: inline-block; width: 100% } .pwaforwp-ext-wrap { width: 70%; margin: 0; padding: 0; margin-right: 20px; float: left; margin-bottom: 20px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pro { background: #4caf50; padding: 1px 7px; border-radius: 4px; font-size: 14px; margin-left: 1px; color: #fff; cursor: pointer; position: relative; right: 9px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .deactivated { background: #989696 } .pwaforwp-center { text-align: center } #TB_ajaxContent::-webkit-scrollbar { -webkit-appearance: none } #TB_ajaxContent::-webkit-scrollbar:vertical { width: 12px } #TB_ajaxContent::-webkit-scrollbar:horizontal { height: 12px } #TB_ajaxContent::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .5); border-radius: 10px; border: 2px solid #fff } #TB_ajaxContent::-webkit-scrollbar-track { border-radius: 10px; background-color: #fff } #TB_ajaxContent .addtohomebanner-wrap-tb p { padding-top: 0; margin-top: 0; margin-bottom: 5px } .pwawp-modal-mask { position: fixed; z-index: 99999; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, .7); display: table; transition: opacity .3s ease } .pwawp-modal-wrapper { display: table-cell; vertical-align: middle } .pwawp-modal-header { background: #fff; width: 100%; z-index: 100; border-bottom: 1px solid #d8d8d8; position: relative; padding-left: 20px } .pwawp-modal-container { position: fixed; overflow: hidden; top: 30px; left: 30px; right: 30px; bottom: 30px; z-index: 160000; overflow: hidden; min-height: 300px; box-shadow: 0 5px 15px rgba(0, 0, 0, .7); background: #fcfcfc; -webkit-font-smoothing: subpixel-antialiased } .pwawp-modal-header h3 { font-weight: 400; padding: 0 16px 0 0; font-size: 20px; line-height: 50px; margin: 0; margin-bottom: 0; font-weight: 600; position: relative; left: 15px } .pwawp-modal-mask .pwawp-modal-body { overflow-y: auto; height: 92%; position: absolute; left: 0; top: 0; left: 35px; right: 0 } .pwawp-modal-settings { padding: 0 0; margin-top: 50px; border-top: 1px solid #d8d8d8; z-index: 1; position: relative } .pwawp-modal-content { height: 100vh; overflow-y: hidden; padding: 0 20px 0 0; overflow-x: hidden } .pwawp-modal-default-button { float: right; position: relative; right: 10px } .pwawp-modal-footer { padding: 10px 0; position: absolute; bottom: 0; width: 100%; bottom: 0; background: #f1f1f1; z-index: 100; display: inline-block } .pwawp-modal-footer .pwawp-del-btn-modal { left: 215px; position: relative; background: 0 0; border: 0; box-shadow: none; color: #bc0b0b } .pwawp-modal-footer .pwawp-del-btn-modal:hover { background: #455a64; color: #fff } .pwawp-save-btn-modal { position: relative; right: 15px } .pwawp-modal-footer .pwawp-close-btn-modal { margin-right: 20px } .pwawp-modal-body .pwawp-modal-header { padding-left: 20px; height: 50px; background-color: #fafafa; border-bottom: 1px solid #d8d8d8; width: 82%; position: fixed } .pwawp-modal-wrapper .pwawp-media-modal-close { background: #fafafa; box-shadow: -1px 0 0 #d8d8d8 } .pwawp-media-modal-close:focus { outline: 0; border: 0 } .pwawp-media-modal-close:hover { background: #e9e9e9 } .pwawp-media-modal-close { position: absolute; top: 0; right: 0; width: 50px; height: 50px; margin: 0; padding: 0; border: 1px solid transparent; background: 0 0; color: #666; z-index: 1000; cursor: pointer; outline: 0; transition: color .1s ease-in-out, background .1s ease-in-out } .pwawp-media-modal-close .pwawp-media-modal-icon:before { content: "\f158"; font: normal 20px/1 dashicons; speak: none; vertical-align: middle; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale } .pwawp-modal-settings th:empty { display: none } .ios-splash-screen-creator .field { margin-bottom: 10px; } .ios-splash-screen-creator #pwa-ios-splashmessage { display: inline; } .ios-splash-screen-creator .field label { display: inline-block; width: 50%; } .ios-splash-images .accordion { background-color: #eee; color: #444; cursor: pointer; padding: 18px; width: 100%; text-align: left; border: none; outline: none; transition: 0.4s; } .ios-splash-images .accordion.active, .ios-splash-images .accordion:hover { background-color: #ccc; } .ios-splash-images .panel { padding: 3px 18px; background-color: white; overflow: hidden; max-height: 0; transition: max-height 0.2s ease-out; } .ios-splash-images .accordion:after { content: '\02795'; font-size: 13px; color: #777; float: right; margin-left: 5px; } .ios-splash-images .active:after { content: "\2796"; } .pwaforwp-feedback-notice p { display: inline-block; } .pwaforwp-feedback-notice .dashicons-thumbs-up { padding-right: 5px; }span#lic_active { color: green; }#lic_inactive { color: #bebfc0; margin-left: 7px; }.license_key_input_Active { margin-left: 10px; }.form-wrap label { display: block; padding: 0px 0; }.license_key_input_Inactive { margin-left: 6px; }.pwaforwp-features-blocks{ display:inline-grid;grid-template-columns:1fr 1fr;grid-gap:20px; }.activated-plugins { position: relative; display: inline-block; color: #222; font-size: 14px; letter-spacing: 0; right: 5px; margin-left: 4px; } .dashicons-yes:before { content: "\f147"; background: #388e3c; border-radius: 40px; color: #fff; position: relative; left: 1px; border-radius: 40px; padding: 1px 1px 0 0; top: 1px; margin: 0; font-size: 14px; } .pro_icon { margin: 0; font-size: 16px; margin-left: 3px; margin-top: 1px; right: 5px; } .expiredinner_span { color: green; } i.dashicons-before.dashicons-admin-generic { color: #666; } #exp { color: red; } .dashicons-no { background: red; color: #fff; border-radius: 10px; position: relative; font-size: 15px; } .dashicons-no:before { content: "\f158"; top: 3px; position: relative; left: 0; } .pwaforwp-addon-alert { color: red; font-size: 14px; letter-spacing: 0; } .dashicons-alert::before { content: "\f534"; background: #ffb900; border-radius: 40px; color: #fff; border-radius: 40px; padding: 4px 3px 4px 4px; top: 0; right: 9px; margin: 0; position: relative; } a.renewal-license { margin-left: 5px; font-size: 12px!important; padding: 4px 10px 5px; letter-spacing: .1px; border-radius: 60px; margin-right: 0; background: #fda708; color: #000; box-shadow: 0 .15em .65em 0 rgb(0 0 0 / 25%); text-decoration: none; } .renew-lic:hover { color: #eee; } span.renew-lic { font-size: 14px; } .pwaforwp_key_user_name { font-weight: 700; } .before_msg { margin-left: 4px; } .before_msg_active { margin-left: 3px; } .pwaforwp_addon_inactive { margin-left: 3px; } .ext_settings_url { margin-left: 8px; text-decoration: unset; } .pwaforwp-main { float: right; background-color: #fff; border: 8px solid #fff; border-radius: 21px; padding: 1px 0 0 7px; margin-top: -37px; } .pwaforwp-main .activated-plugins { color: #222; } a.ext_url { text-decoration: unset; } span#pwaforwp-addon-dashicons-yes { top: 20px; left: 60px; position: relative; margin: 0; font-size: 16px; } p.pwaforwp_license_status_msg { display: inline-block; margin: 0 0 0 7px; position: relative; bottom: 10px; } span#pwaforwp-addon-dashicons-no { display: none; position: relative; top: 22px; left: 59px; } .pwaforwp-d-btn-1, .pwaforwp-d-btn-2, .pwaforwp-d-btn-3 { background: #d2150a; padding: 6px 18px; border-radius: 30px; font-size: 14px; color: #fff; display: inline-block; } .pwaforwp-reviews-dashicons { float: right; left: -163px; } .license_key_input_inactive { display: inline-block; bottom: 8px; position: relative; } .pwaforwp-woocommerce-dashicons { float: right; margin-right: 45px; } .pwaforwp-addon-no { position: relative; display: block; } span.pwaforwp_addon_icon.dashicons.dashicons-yes.pro_icon { top: 0; position: relative; } p#enter_key_reviews { position: relative; top: 20px; } p.enter_key_Reviews { position: relative; top: 8px; } label.pwaforwp-sts-txt { font-size: 14px; color: #000; } p#enter_key_woocommerce { position: relative; top: 20px; } input.license_key_input_active::placeholder { color: #000; } .pwaforwp-active-input { float: left; } span.addon-activated { color: green; padding-left: 5px; } .pwaforwp-sts-deactive-main { margin-top: -21px; padding: 6px 15px; } span.limit_span { float: left; display: block; position: relative; margin: -21px 0 0 100px; } input.license_key_input_inactive.reviews_addon_inactive { display: none; } a.button.button-default.pwaforwp_license_activation.reviews { display: none; } a#pwaforwp_license_deactivationbtn { display: none; } a#pwaforwp_license_activation_ { display: none; } .license_key_input_inactive { top: 0; } .form-wrap label { display: block; padding: 0 0; } .pwaforwp-tools-field-title { margin: 0 0 7px 0; position: relative; bottom: 7px; } .form-wrap label { display: block; padding: 8px 0; } .pwaforwp-sts-active-main.reviews_addon { margin: -7px 0 0 0; } input.license_key_input_active { margin-left: 10px; } input.license_key_input_inactive { margin-left: 10px; } .pwaforwp-sts-active-main.woocommerce_addon { margin-top: -4px; } label.pwaforwp-sts-txt.inactive { padding: 10px 0 6px 16px; } a#pwaforwp_license_deactivation_internal { display: none; } .inner_span_expiring { color: red; margin-right: 2px; } i#refresh_license_icon_top { cursor: pointer; display: none; } .dashicons.spin { animation: dashicons-spin 2s infinite; animation-timing-function: linear; } @keyframes dashicons-spin { 0% { transform: rotate(0); } 100% { transform: rotate(-360deg); } }span#lic_exp { color: red; } i#refresh_expired_addon { cursor: pointer; display: none; } i#user_refresh_expired_addon { cursor: pointer; } span.one_of_expired { color: red; } .pro_warning { color: #ffb229; right: 3px; position: relative; bottom: 1px; }.zero_to_seven{ color: red; }.zero_to_30{ color: red; }PK!ZEw assets/css/pwaforwp-main.min.cssnu[/* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. */ /* Created on : Nov 20, 2018, 3:55:15 PM Author : Magazine3 */ @media only screen and (min-width: 992px) { .pwaforwp-footer-prompt { padding: 1% 3%; flex-direction: row; justify-content: center; } } .pwaforwp-footer-prompt{ display: none; width: 100%; line-height: 2em; color: #333; text-align: center; text-decoration: none; min-height: 10%; padding:15px 0px 15px 0px; position: fixed; bottom: 0; justify-content: flex-end; flex-direction: column; flex-grow: 1; animation-duration: 1s; animation-fill-mode: both; z-index: 9999; } .pwaforwp-footer-prompt .pwaforwp-prompt-close:after{ content: "✖"; color: #d5e0eb; position: absolute; right: 10px; top: 10px; font-size: 12px; background: rgba(0, 0, 0, 0.40); border-radius: 30px; text-align: center; width: 20px; height: 20px; line-height: 22px; cursor: pointer; } .pwaforwp-bounceInUp{ animation-name: bounceInUp; } .pwaforwp-animated { animation-duration: 1s; animation-fill-mode: both; } .pwaforwp-btn{ border: none; cursor: pointer; display: inline-block; border-radius: 4px; height: auto; line-height: 1; min-width: auto; padding: 8px 16px; font-size: 16px; margin: 10px 0px 0px 0px; font-family: sans-serif; text-transform: none; transition: all .2s ease-in-out; } /* Center the loader */ #pwaforwp_loading_div { display: none; position: fixed; width: 100%; height: 200%; top: 0px; left: 0px; background-color: white; z-index: 9999; } .pwaforwp-loading-wrapper{z-index: 9999999;display:none;} #pwaforwp_loading_icon { position: fixed; left: 50%; top: 50%; z-index: 9999999; margin: -60px 0 0 -60px; border: 16px solid #f3f3f3; border-radius: 50%; border-top: 16px solid #3498db; width: 120px; height: 120px; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Add animation to "page content" */ .animate-bottom { position: relative; -webkit-animation-name: animatebottom; -webkit-animation-duration: 1s; animation-name: animatebottom; animation-duration: 1s } @-webkit-keyframes animatebottom { from { bottom:-100px; opacity:0 } to { bottom:0px; opacity:1 } } @keyframes animatebottom { from{ bottom:-100px; opacity:0 } to{ bottom:0; opacity:1 } } /** Add to home screen CSS **/ #pwaforwp-add-to-home-click h3{ font-size: 20px; font-weight: 600; margin: 0px; line-height: 1.4; font-family: sans-serif; } @media(max-width:425px){ #pwaforwp-add-to-home-click h3 { font-size: 16px; } .pwaforwp-btn{ font-size: 14px; } .pwaforwp-footer-prompt{ padding:15px 0px 10px 0px; } .pwaforwp-footer-prompt .pwaforwp-prompt-close:after { right: 5px; top: 5px; } } .pwaforwp-app-contents{display: none;} PK!J64Z[Z[assets/css/main-css.min.cssnu[/* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. */ /* Created on : Aug 4, 2018, 7:47:47 PM Author : Magazine3 */ .pwaforwp-hide { display: none!important } .pwaforwp-dashboard h2 { margin-bottom: 5px } .pwaforwp-dashboard table th { width: 0; padding: 0 } .pwaforwp-files-table { width: 100% } .pwaforwp-files-table th td { width: 300px } .pwaforwp-files-table th { vertical-align: inherit } .pwa-query-success { color: #028a00 } .pwa-query-error { color: #f73434 } .pwa_hide { display: none } .pwaforwp-push_notification th { padding: 0; width: 0 } .pwaforwp-push_notification td { padding: 0 } .pwaforwp-push-notificatoin-table { width: 100% } .pwaforwp-push-notificatoin-table th { width: 20%; padding: 10px } .pwaforwp-push-notificatoin-table input[type=text] { width: 30% } .pwaforwp-notification-success { color: #028a00 } .pwaforwp-notification-error { color: #f73434 } .pwaforwp_precaching_table input, select { width: 200px } .pwaforwp_precaching_table td { vertical-align: top } .pwaforwp-pre-cache-table td { padding-left: 0; padding-top: 0; padding-bottom: 0 } .pwaforwp-design table th { width: auto; padding: 0 } .pwaforwp-p-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px } .pwafowp-feature-ext { background: #fff; padding: 25px; border: 1px solid #d8d8d8 } .pwaforwp-features-blocks li a { text-decoration: none } .pwaforwp-ele-ic { border-radius: 256px; display: inline-block; padding: 8px 10px 8px 10px; width: 70px; height: 70px; margin-right: 20px; float: left } .pwaforwp-ele-ic img { width: 85%; top: 5px; position: relative; left: 6px } .pwaforwp-ele-tlt h3 { margin: 0; font-size: 18px; line-height: 1.4 } .pwaforwp-ele-tlt p { margin-top: 10px } .form-wrap .pwaforwp-sts-txt { color: #000; padding: 0px 0px 8px 18px; position: relative; top: 2px; } .pwaforwp-sts-txt span { /*color: #bebfc0;*/ /*padding-left: 8px*/ } label.pwaforwp-sts-txt-inactive { color: #000; padding: 0px 0px 8px 18px; position: relative; top: 2px; } .pwaforwp_addon_uninstalled{ padding-left: 8px; color: #bebfc0; } .pwaforwp-d-btn { background: #46b450; padding: 5px 18px; border-radius: 30px; font-size: 14px; color: #fff } .pwaforwp-sts-btn a { text-decoration: none } .pwaforwp-sts-btn { box-sizing: border-box; margin-top: 15px; padding: 11px 11px; border: 1px solid #e5e5e5; border-radius: 3px; display: inline-flex; align-items: center; justify-content: space-between; position: relative; width: 100% } .pwaforwp-ext-active p { margin: 0!important } .pwaforwp-premium_features .form-table th { width: auto; padding: 0 } .pwaforwp-ext-selected { color: #000; font-weight: 500 } #pwaforwp-ext-tab a { cursor: pointer } .pwaforwp-p-feature-table lable { font-weight: 500 } .pwaforwp-sub-tab-headings { margin-top: 10px } .pwaforwp-sub-tab-headings span { color: #0073aa; cursor: pointer } .pwaforwp-sub-tab-headings span.selected { color: #000 } #subtab-pushnots th:empty { display: none } .pwaforwp-main-wrapper { width: 75%; float: left } .pwaforwp-settings-second-div { width: 22%; float: right } .pwaforwp-feedback-panel { height: 200px; width: 280px; background: #fff; position: relative } .pwaforwp-feedback-panel h2 { text-align: center; padding-top: 18px } .pwaforwp-feedback-panel ul { list-style-type: circle; list-style: decimal; padding-left: 30px; font-size: 15px } .pwaforwp-social-sharing-buttons { text-align: center; padding-top: 20px } .pwaforwp-social-sharing-buttons a { text-align: center; text-decoration: none; padding: 8px } .pwaforwp-social-sharing-buttons .pwaforwp-twitter-share-button { background: #1b95e0!important; box-shadow: 0 0 0 #1b95e0!important; color: #fff!important; line-height: 20px!important; height: 21px!important; border-radius: 3px; margin-left: 5px } .pwaforwp-social-sharing-buttons .pwaforwp-facebook-share { background: #3b5998; box-shadow: 0 0 0 #1b95e0!important; color: #fff!important; line-height: 20px!important; height: 21px!important; border-radius: 3px; margin-right: 5px } .pwaforwp-upgrade-pro { background: #fff; top: 32px; padding: 30px; border: 1px solid #cecece; display: inline-block; color: #111; margin-top: 10px; border-radius: 8px; position: relative; box-sizing: border-box; width: 100% } .pwaforwp-upgrade-pro h2 { margin: 0; color: #222; font-size: 20px; text-align: center; margin-bottom: 27px } .pwaforwp-upgrade-pro ul { margin: 0 0 30px 0 } .pwaforwp-upgrade-pro ul li { position: relative; padding-left: 30px; font-size: 15px; line-height: 1.4; margin-bottom: 10px } .pwaforwp-upgrade-pro ul li:before { content: "\f147"; background-repeat: no-repeat; font-family: dashicons; position: absolute; color: #46b450; font-size: 25px; left: 0; line-height: 1; top: 0 } .pwaforwp-upgrade-pro a { background: #43a047; padding: 10px 0; display: block; text-align: center; color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: 1px; border-radius: 5px } .pwaforwp-upgrade-pro.promo-cpn { box-sizing: border-box; border: 1px solid #ca4a1f } .pwaforwp-upgrade-pro.promo-cpn h2 { color: #ca4a1f; font-weight: bold; font-size: 24px; text-align: center; margin: 0 0 20px 0 } .pwaforwp-upgrade-pro.promo-cpn span { text-align: center; font-size: 14px; display: inline-block; color: #444; padding: 0 20px; box-sizing: border-box; line-height: 1.4; font-weight: 400 } .pwa-promo { font-size: 20px; margin-top: 15px; width: 100%; text-align: center } .pwaforwp-upgrade-pro.promo-cpn .pwa-promo .prm-cpn { border: 1px dashed #ca4a1f; border-radius: 100px; margin-top: 5px; color: #ca4a1f; font-size: 20px; padding: 2px 15px 2px 15px } .pwaforwp-upgrade-pro.promo-cpn .prm-txt { font-size: 11px; font-weight: 600; text-transform: uppercase; display: block; margin-top: 10px; line-height: 1 } .pwaforwp-wrap .pwafw-tooltip { position: relative; display: inline!important; margin-left: 0; color: #d8d8d8!important; cursor: pointer; } .pwaforwp-wrap .pwafw-tooltip:hover { color: #333!important } .pwaforwp-wrap .pwafw-tooltip i { font-size: 18px; position: relative; top: 3px } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle { visibility: hidden; width: max-content; background-color: #111; box-shadow: 0 0 10px 0 #999; color: #fff; line-height: 1.5; max-width: 410px; text-align: center; border-radius: 5px; padding: 10px 8px; position: absolute; z-index: 100; bottom: 100%; left: -26px; margin-bottom: 6px!important; opacity: 0; transition: opacity .3s; font-size: 11px } .pwaforwp-wrap .pwafw-help-subtitle a { color: #fff; background: #eee; padding: 0 5px; margin-left: 4px; color: #333; text-decoration: none; border-radius: 53px; margin-top: 9px } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle::after { content: ""; position: absolute; top: 100%; left: 35px; max-width: 1px; margin-left: -5px; border-width: 9px; border-style: solid; border-color: #111 transparent transparent transparent } .pwaforwp-wrap .pwafw-tooltip:hover .pwafw-help-subtitle { visibility: visible; opacity: 1 } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom { position: absolute; bottom: 3px; border-top: 1px solid #fff; left: 0; right: 0; top: auto; padding: 3px 0 0 } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom .help-wrap { width: 49%; float: left; border-right: 1px solid #fff; color: #fff } .pwaforwp-wrap .pwafw-tooltip .pwafw-help-subtitle .afw-tootip-bottom .help-wrap:last-child { border: none } .pwaforwp-wrap .afw-tootip-bottom i:before { font-size: 15px } .ios-splash-images { padding: 10px 0 10px 15px; border: 1px solid #cdcdcd; display: block } .ios-splash-images-field { padding: 5px 0; font-size: 13px } .pwaforwp-feature-cards { list-style: none; text-align: justify; margin-left: -2%; margin-top: 20px } .pwaforwp-feature-cards li.pwaforwp-card-wrap { max-width: 48%; font-size: 16px; display: inline-block; width: 100%; text-align: left; margin-bottom: 2%; margin-left: 2%; vertical-align: top } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content { position: relative; background: #fff; box-shadow: 1px 1px 0 rgba(0, 0, 0, .1); padding: 14px 7px 14px 17px; border-radius: 5px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content .card-action { display: inline-flex } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pwaforwp-card-content h2 { font-size: 16px; color: #000; margin: 0; line-height: 1; padding: 0; top: -1px; position: relative; cursor: pointer; } .pwaforwp-tlt-sw .card-action-settings span { font-size: 16px; color: #555; position: relative; top: 2px; cursor: pointer } #TB_ajaxContent .pwaforwp-wrap table th:empty { display: none } .pwaforwp-card-wrap .switch { position: relative; display: inline-block; width: 60px; height: 34px } .pwaforwp-card-wrap .switch input { opacity: 0; width: 0; height: 0 } .pwaforwp-card-wrap .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; -webkit-transition: .4s; transition: .4s } .pwaforwp-card-wrap .slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: #fff; transition: .4s } input:checked+.slider { background-color: #46b450 } input:checked+.slider:before { left: -8px } input:focus+.slider { box-shadow: 0 0 1px #2196f3 } input:checked+.slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px) } .pwaforwp-tlt-sw { display: inline-flex; width: 100%; align-items: center; justify-content: space-between; flex-wrap: wrap } .pwaforwp-card-content label.switch { display: block; padding: 2px 0; width: 33px; height: 14px; right: 31px; position: absolute; top: 15px } .slider.round { border-radius: 60px } .slider.round:before { border-radius: 50% } .pwaforwp-toast-wrap { display: block; position: fixed; width: 200px; pointer-events: none!important; letter-spacing: normal; z-index: 9999999; bottom: 20px; right: 20px } .pwaforwp-toast-single { display: block; width: 100%; padding: 10px; margin: 0 0 5px; border-radius: 4px; font-size: 16px; font-family: arial, sans-serif; line-height: 17px; position: relative; pointer-events: all!important } .pwaforwp-toast-success { background-color: #4ab866; color: #fff } .pwaforwp-toast-error { background-color: #d94f4f; color: #fff } .close-pwaforwp-toast-single { position: absolute; top: 10px; right: 7px; font-size: 20px; cursor: pointer } .pwa_contact_us_div { border-top: 1px solid #ddd; padding-top: 7px; margin-top: 25px } .pwaforwp-ext-list-table { display: inline-block; width: 100% } .pwaforwp-ext-wrap { width: 120%; margin: 0; padding: 0; } .pwaforwp-feature-cards li.pwaforwp-card-wrap .pro { background: #4caf50; padding: 1px 7px; border-radius: 4px; font-size: 14px; margin-left: 1px; color: #fff; cursor: pointer; position: relative; right: 9px } .pwaforwp-feature-cards li.pwaforwp-card-wrap .deactivated { background: #989696 } .pwaforwp-center { text-align: center } #TB_ajaxContent::-webkit-scrollbar { -webkit-appearance: none } #TB_ajaxContent::-webkit-scrollbar:vertical { width: 12px } #TB_ajaxContent::-webkit-scrollbar:horizontal { height: 12px } #TB_ajaxContent::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .5); border-radius: 10px; border: 2px solid #fff } #TB_ajaxContent::-webkit-scrollbar-track { border-radius: 10px; background-color: #fff } #TB_ajaxContent .addtohomebanner-wrap-tb p { padding-top: 0; margin-top: 0; margin-bottom: 5px } .pwawp-modal-mask { position: fixed; z-index: 99999; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, .7); display: table; transition: opacity .3s ease } .pwawp-modal-wrapper { display: table-cell; vertical-align: middle } .pwawp-modal-header { background: #fff; width: 100%; z-index: 100; border-bottom: 1px solid #d8d8d8; position: relative; padding-left: 20px } .pwawp-modal-container { position: fixed; overflow: hidden; top: 30px; left: 30px; right: 30px; bottom: 30px; z-index: 160000; overflow: hidden; min-height: 300px; box-shadow: 0 5px 15px rgba(0, 0, 0, .7); background: #fcfcfc; -webkit-font-smoothing: subpixel-antialiased } .pwawp-modal-header h3 { font-weight: 400; padding: 0 16px 0 0; font-size: 20px; line-height: 50px; margin: 0; margin-bottom: 0; font-weight: 600; position: relative; left: 15px } .pwawp-modal-mask .pwawp-modal-body { overflow-y: auto; height: 92%; position: absolute; left: 0; top: 0; left: 35px; right: 0 } .pwawp-modal-settings { padding: 0 0; margin-top: 50px; border-top: 1px solid #d8d8d8; z-index: 1; position: relative } .pwawp-modal-content { height: 100vh; overflow-y: hidden; padding: 0 20px 0 0; overflow-x: hidden } .pwawp-modal-default-button { float: right; position: relative; right: 10px } .pwawp-modal-footer { padding: 10px 0; position: absolute; bottom: 0; width: 100%; bottom: 0; background: #f1f1f1; z-index: 100; display: inline-block } .pwawp-modal-footer .pwawp-del-btn-modal { left: 215px; position: relative; background: 0 0; border: 0; box-shadow: none; color: #bc0b0b } .pwawp-modal-footer .pwawp-del-btn-modal:hover { background: #455a64; color: #fff } .pwawp-save-btn-modal { position: relative; right: 15px } .pwawp-modal-footer .pwawp-close-btn-modal { margin-right: 20px } .pwawp-modal-body .pwawp-modal-header { padding-left: 20px; height: 50px; background-color: #fafafa; border-bottom: 1px solid #d8d8d8; width: 82%; position: fixed } .pwawp-modal-wrapper .pwawp-media-modal-close { background: #fafafa; box-shadow: -1px 0 0 #d8d8d8 } .pwawp-media-modal-close:focus { outline: 0; border: 0 } .pwawp-media-modal-close:hover { background: #e9e9e9 } .pwawp-media-modal-close { position: absolute; top: 0; right: 0; width: 50px; height: 50px; margin: 0; padding: 0; border: 1px solid transparent; background: 0 0; color: #666; z-index: 1000; cursor: pointer; outline: 0; transition: color .1s ease-in-out, background .1s ease-in-out } .pwawp-media-modal-close .pwawp-media-modal-icon:before { content: "\f158"; font: normal 20px/1 dashicons; speak: none; vertical-align: middle; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale } .pwawp-modal-settings th:empty { display: none } .ios-splash-screen-creator .field { margin-bottom: 10px; } .ios-splash-screen-creator #pwa-ios-splashmessage { display: inline; } .ios-splash-screen-creator .field label { display: inline-block; width: 50%; } .ios-splash-images .accordion { background-color: #eee; color: #444; cursor: pointer; padding: 18px; width: 100%; text-align: left; border: none; outline: none; transition: 0.4s; } .ios-splash-images .accordion.active, .ios-splash-images .accordion:hover { background-color: #ccc; } .ios-splash-images .panel { padding: 3px 18px; background-color: white; overflow: hidden; max-height: 0; transition: max-height 0.2s ease-out; } .ios-splash-images .accordion:after { content: '\02795'; font-size: 13px; color: #777; float: right; margin-left: 5px; } .ios-splash-images .active:after { content: "\2796"; } .pwaforwp-feedback-notice p { display: inline-block; } .pwaforwp-feedback-notice .dashicons-thumbs-up { padding-right: 5px; }span#lic_active { color: green; margin-left: 7px; }#lic_inactive { color: #bebfc0; margin-left: 7px; }.license_key_input_Active { margin-left: 10px; }.license_key_input_Inactive { margin-left: 6px; }.pwaforwp-features-blocks{ display:inline-grid;grid-template-columns:1fr 1fr;grid-gap:20px; }.activated-plugins { position: relative; display: inline-block; color: #222; font-size: 14px; letter-spacing: 0; right: 5px; margin-left: 4px; } .pro_icon:before { content: "\f147"; background: #388e3c; border-radius: 40px; color: #fff; position: relative; left: 1px; border-radius: 40px; padding: 1px 1px 0 0; top: 1px; margin: 0; font-size: 14px; } .pro_icon { margin: 0; font-size: 16px; margin-left: 3px; margin-top: 1px; right: 5px; } .expiredinner_span { color: green; } i.dashicons-before.dashicons-admin-generic { color: #666; } #exp { color: red; } .dashicons-no { background: red; color: #fff; border-radius: 10px; position: relative; font-size: 15px; } .dashicons-no:before { content: "\f158"; top: 2px; position: relative; left: 0; } .pwaforwp-addon-alert { color: red; font-size: 14px; letter-spacing: 0; } .dashicons-alert::before { content: "\f534"; background: #ffb900; border-radius: 40px; color: #fff; border-radius: 40px; padding: 4px 3px 4px 4px; top: 0; right: 9px; margin: 0; position: relative; } a.renewal-license { margin-left: 5px; font-size: 12px!important; padding: 4px 10px 5px; letter-spacing: .1px; border-radius: 60px; margin-right: 0; background: #388e3c; color: #fff; box-shadow: 0 0.15em 0.65em 0 rgb(0 0 0 / 25%); text-decoration: none; } .renew-lic:hover { color: #eee; } span.renew-lic { font-size: 14px; } .pwaforwp_key_user_name { font-weight: 700; } .before_msg_active { margin-left: 3px; } .pwaforwp_addon_inactive { margin-left: 3px; } .ext_settings_url { margin-left: 8px; text-decoration: unset; } .pwaforwp-main { float: right; background-color: #fff; border: 8px solid #fff; border-radius: 21px; padding: 1px 0 0 7px; margin-top: 5px; } .pwaforwp-main .activated-plugins { color: #222; } a.ext_url { text-decoration: unset; } span#pwaforwp-addon-dashicons-yes { top: 20px; left: 60px; position: relative; margin: 0; font-size: 16px; } p.pwaforwp_license_status_msg { display: inline-block; margin: 0 0 0 7px; position: relative; bottom: 10px; } span#pwaforwp-addon-dashicons-no { display: none; position: relative; top: 22px; left: 59px; } .pwaforwp-d-btn-1, .pwaforwp-d-btn-2, .pwaforwp-d-btn-3 { background: #d2150a; padding: 6px 18px; border-radius: 30px; font-size: 14px; color: #fff; display: inline-block; } .pwaforwp-reviews-dashicons { float: right; left: -163px; } .license_key_input_inactive { display: inline-block; bottom: 8px; position: relative; } .pwaforwp-woocommerce-dashicons { float: right; margin-right: 45px; } .pwaforwp-addon-no { position: relative; display: block; } span.pwaforwp_addon_icon.dashicons.dashicons-yes.pro_icon { top: 0; position: relative; } p#enter_key_reviews { position: relative; top: 20px; } p.enter_key_Reviews { position: relative; top: 8px; } label.pwaforwp-sts-txt { font-size: 14px; color: #000; } p#enter_key_woocommerce { position: relative; top: 20px; } input.license_key_input_active::placeholder { color: #000; } .pwaforwp-active-input { float: left; } span.addon-activated { color: green; padding-left: 5px; } .pwaforwp-sts-deactive-main { margin-top: -21px; padding: 6px 15px; } span.limit_span { float: left; display: block; position: relative; margin: -21px 0 0 100px; } a.button.button-default.pwaforwp_license_activation.reviews { display: none; } a#pwaforwp_license_deactivationbtn { display: none; } a#pwaforwp_license_activation_ { display: none; } .license_key_input_inactive { top: 0; } .pwaforwp-tools-field-title { margin: 0 0 7px 0; position: relative; bottom: 7px; } .pwaforwp-sts-active-main.reviews_addon { margin: -7px 0 0 0; } input.license_key_input_active { margin-left: 10px; } input.license_key_input_inactive { margin-left: 10px; } .pwaforwp-sts-active-main.woocommerce_addon { margin-top: -4px; } a#pwaforwp_license_deactivation_internal { display: none; } .inner_span_expiring { color: red; margin-right: 2px; } .dashicons.spin { animation: dashicons-spin 2s infinite; animation-timing-function: linear; } @keyframes dashicons-spin { 0% { transform: rotate(0); } 100% { transform: rotate(-360deg); } }span#lic_exp { color: red; margin-left: 7px; } i#refresh_expired_addon { cursor: pointer; /*display: none;*/ } i#user_refresh_expired_addon { cursor: pointer; } span.one_of_expired { color: red; } .pro_warning { color: #ffb229; right: 3px; position: relative; bottom: 1px; }.zero_to_seven{ color: red; }.zero_to_30{ color: red; }#auto_refresh- { cursor: pointer; display: none; } #refresh_expired_addon-{ cursor: pointer; display: none; }#user_refresh- { cursor: pointer; }span.pwaforwp-license-tenure{ display: inline-block; margin-top: 8px; padding: 0px 0px 0px 17px; } .single-renewal-license{ margin-left: 5px; padding: 4px 10px 5px; letter-spacing: .1px; border-radius: 60px; margin-right: 0; background: #388e3c; color: #fff; box-shadow: 0 0.15em 0.65em 0 rgb(0 0 0 / 25%); } span.pwaforwp-addon-active { color: #000; }.single_addon_warning{ color: #ffb229; }label { cursor: default; }.less_than_zero { color: red; cursor: default; }.expire_msg { color: red; } .expired-pwaforwp-license-tenure{ display: inline-block; margin: 0px 0px 0px 17px; }.lifetime_ { color: green; }#lic_lifetime { color: green; margin-left: 8px; }.user_refresh_single_addon { cursor: pointer; }.pro_alert { color: #ffb229; top: 2px; position: relative; } .menu_page_pro_alert{ top: 0; } .visibility-wrap-tb .form-table { width: auto; } .include-btn.button-primary, .exclude-btn.button-primary { background: #005aef; border-color: #005aef; font-size: 15px; padding: 2px 20px; margin-top: -20px; } .include-btn-box { padding: 0 !important; line-height: 0 !important; } .wp-core-ui .visibility_options_select { border-color: #cccccc; padding: 5px 10px; } .pwaforwp-visibility-target-icon { cursor: pointer; } .visibility-target-item { background-color: #027bf714; border-radius: 20px; border: 1px solid #007eff3d; padding: 5px 12px 7px 12px; font-size: 14px; color: #002638; margin-right: 10px; } .visibility-loader { display: none; min-width: 200px; width: 100%; height: 100%; padding: 10px; position: fixed; align-items: center; justify-content: center; color: #ccc; cursor: pointer; transition: 0.3s linear; z-index: 9999; background: rgba(0, 0, 0, 0.5); } .visibility-loader-box { width: 48px; height: 48px; border-radius: 50%; display: inline-block; border-top: 3px solid #fff; border-right: 3px solid transparent; -webkit-animation: rotation 1s linear infinite; animation: rotation 1s linear infinite; }PK!assets/css/index.phpnu[AMP Support: Full PWA compatibility for AMP. It works well with AMPforWP & AMP for WordPress by Automattic. * NEW: Multi site support * NEW: UTM Tracking * NEW: OneSignal support with multisite * NEW: Easily change start URL * NEW: Caching Strategy for PWA enabled assets * NEW: Added Support with PWA By PWA Plugin Contributors * Cache Expire option added * Service Worker : We have developed a service worker which automatically gets installed in the background and performs the necessary actions such as caching the external objects to reduce the requests and more. * APP Banners in Home-screen: Automatically notifies your visitor to get the APP version of the website which directly gets added with the list of Apps and Home-screen. You can customize the icons for this as well. * Web App Manifest: The Manifest file is necessary to get this functionality rolled out and we have made this automatic and connected with the PWA options. * Offline Support: The PWA version of your site will load blazing fast even when the user is offline. Once the user is online, it will update the content again. It will also count the analytics as well and updates it when the user goes online again. * Full Screen & Splash Screen: When you open the PWA version from the mobile, it will load in full screen without any browser toolbar, which gives it a native app like feel in PWA version. There’s also a welcome splash screen which is totally customizable. * Continuous Development: We will be working hard to continuously develop this PWA solution and release updates constantly so that your forms can continue to work flawlessly. * Dashboard System Status which helps you understand the setup status of the PWA. * Application Icon Uploading * Background color options for Splash screen * Add your own Application and short name. * Easily set the start page from options. * Set Device Orientation easily. * Tested with Google Lighthouse * More PWA Features Coming soon. * **[Premium]** the ability to expand PWA for WP with [Call to Action](https://pwa-for-wp.com/extensions/call-to-action-for-pwa/), [Loading Icon Library](https://pwa-for-wp.com/extensions/loading-icon-library-for-pwa/), [Data Analytics](https://pwa-for-wp.com/extensions/data-analytics-for-pwa/), [Pull to Refresh](https://pwa-for-wp.com/extensions/pull-to-refresh-for-pwa/), [Scroll Progress Bar](https://pwa-for-wp.com/extensions/scroll-progress-bar-for-pwa/), [PWA to APK Plugin](https://pwa-for-wp.com/extensions/pwa-to-apk-plugin/), [Offline Forms for PWA for WP](https://pwa-for-wp.com/extensions/offline-forms-for-pwa-for-wp/), [Navigation Bar for PWA](https://pwa-for-wp.com/extensions/navigation-bar-for-pwa/), [Quick Action for PWA](https://pwa-for-wp.com/extensions/quick-action-for-pwa/) and [Multilingual Compatibility for PWA](https://pwa-for-wp.com/extensions/multilingual-compatibility-for-pwa/) extensions **We Act Fast on Feedback!** We are actively developing this plugin and our aim is to make this plugin into the #1 solution for PWA in the world. You can [Request a Feature](https://github.com/ahmedkaludi/pwa-for-wp/issues) or [Report a Bug](https://pwa-for-wp.com/contact-us/). **Technical Support** Support is provided in [Forum](https://wordpress.org/support/plugin/pwa-for-wp). You can also [Contact us](https://pwa-for-wp.com/contact-us/), our turn around time on email is around 12 hours. **Would you like to contribute?** You may now contribute to this PWA plugin on Github: [View repository](https://github.com/ahmedkaludi/pwa-for-wp) on Github ## Frequently Asked Questions # How to install and use this PWA plugin? After you Active this plugin, and go the PWA Options Dashboard to see the status and setup options accordingly. # How do I report bugs and suggest new features? You can report the bugs for this PWA plugin [here](https://github.com/ahmedkaludi/pwa-for-wp/issues) # Will you include features to my request? Yes, Absolutely! We would suggest you send your feature request by creating an issue in [Github](https://github.com/ahmedkaludi/pwa-for-wp/issues/new/) . It helps us organize the feedback easily. # How do I get in touch? You can contact us from [here](https://pwa-for-wp.com/contact-us/) ## Changelog == Changelog == = 1.7.51 (01 November 2022) = * Improvement: Checkbox inside Default caching strategy should have some padding #761 * Improvement: styling is not right #726 * Bug Fixed: When we add the video to our website when the PWA plugin is enabled, there is an error in the console. #760 = 1.7.50 (11 October 2022) = * Bug Fixed: When loader is enable then website and app take longer to load. #739 * Bug Fixed: CTA banner's install button is not working on desktop and android devices. (Sticky bar) #753 = 1.7.49 (10 August 2022) = * Bug Fixed: Remove jQuery dependency in PWA plugin #743 * Bug Fixed: Force Update Service Worker is not working #742 = 1.7.48 (13 July 2022) = * Bug Fixed: Buddypress downloading feature is not working with IOS PWA but it is works with safari. #713 * Bug Fixed: Need to add a option for the proper uninstallation of the plugin. #723 = 1.7.47 (02 June 2022) = * Bug Fixed: Getting blank page when trying to access the BuddyBoss plugin using "Buddypress for PWAforWP" extension #704 * Bug Fixed: Video not playing with PWA #707 * Bug Fixed: IOS Splash Screen Method is not working. #717 * Improvement: Need to improve the visibility section tool tip #705 * Improvement: Need to change the To:- email in the Help tab. #718 * Improvement: Resolved jquery file issue = 1.7.46 (23 April 2022) = * Bug Fixed : Fixed loader issue in IOS, desktop, mobile, admin, and only PWA #703, #700 * Bug Fixed : Improvement when license is expired #696 * Bug Fixed : Added option to add screenshots in manifest #694 = 1.7.45 (15 April 2022) = * Added : Added Visibility Feature * Added : Added Include and exclude condition in visibility feature = 1.7.42 (21 February 2022) = * BugFixed : Removed new line issue, while exclude urls from cache * BugFixed : Loader icon will work properly * BugFixed : Added Compatibility for wp verion 5.9 = 1.7.41 (4 January 2022) = * BugFixed : removed duplicate meta tag #676 * BugFixed : Loader show only in PWA with desktop|mobile #677 * BugFixed : Update Firebase library #681 = 1.7.40 (31 October 2021) = * Added : Information rendered in admin option #662 * BugFixed : Onesignal Compatibility resolve with updated version 2.2.1 #659 * BugFixed : Issue resolve related to minify Service Worker while register #663 = 1.7.39 (15 October 2021) = * Added : Other option for offline page, user can set custom page url. #526 * BugFixed : Hide PWA admin menu for other than admin users #655 * BugFixed : Fixed Video not playing in PWA APP = 1.7.38 (20 September 2021) = * BugFixed : multisite not register with offline mode * BugFixed : Label show for apple splash screen checkbox #652 * BugFixed : Compatibility issue with Official AMP Transitional mode #651 = 1.7.36 (9 September 2021) = * BugFixed : Service worker register issue with onesignal #643 * BugFixed : Service worker register issue in multisite with dynamic URLs #643 * Added : New Addon Rewards on PWA APP Install #475,#466,#182 * BugFixed : Pre-Caching option is automatic get disabled #649 = 1.7.36 (3 August 2021) = * Added : Option to delete cookies from the cache #337 * Fixed : Getting "untitled" instead of the app title name in iOS #638 = 1.7.35 (20 July 2021) = * Added : PWA url handler for same origin urls #621 * Improvement : apple icons html added hook #633 * Improvement : Added hook for enable pushnotification feature = 1.7.34 (10 July 2021) = * Improvement : Loader will shows in preview mode with elementor #629 * Added : Multilingual Compatibility for PWA addon #408 #625 #388 * Improvement : Added the feature to show the loader functionality only for PWA #625 = 1.7.33 (24 June 2021) = * Improvement : To remove all data related with plugin, added uninstaller handle #623 * Improvement : Modified the message for review #618 * Improvement : Notices or messages related to PWA for WP should load only on settings pages #615 * Enhancement : Added quick action feature for PWA #566 * Enhancement : Added navigation tab bar feature for PWA web APPs #541 * BugFixed : On the fly service worker file serve issue with onesignal #622 * Improvement : Compressed the auto-generated Js/serviceworker file #556 * Improvement : Applied more check before store any outside operation #626 * Improvement : PWA admin notices will display only one notice at a time. #616 = 1.7.32 (22 May 2021) = * BugFixed : Removed Warnings and notice for latest version of PHP #608 * BugFixed : Removed javascript warning = 1.7.31 (29 April 2021) = * Improvement : CTA issue with OneSignal compatibility #603 * Improvement : File not update when OneSignal enabled #591 * BugFixed : Colors related fields values are not show alpha RGB colors #592 * BugFixed : splash icon is not generating for the IOS device #596 = 1.7.30 (15 March 2021) = * Improvement : OneSignal compatibility issue (resolve popup not appear with single/multi sites) #581 * Enhancement : Added Alpha options in color picker of PWA settings #575 * BugFixed : Loader not showing because of less z-index as compare to wrapper #578 * Enhancement : Add an option to select “apple-mobile-web-app-status-bar-style” property based on user requirement #580 * BugFixed : Resolve PWA APP not changes orientation as per device rotation. = 1.7.29 (26 February 2021) = * Enhancement : Integrated BuddyPress Notification with Push Notification in PWA #183 * Improvement : Sets the style of the status bar for Full screen on iOS device #577 * Improvement : Add the different markups for the regular icons and the maskable icons #573 * BugFixed : Compatible with Oxygen Gutenberg Integration Plugin #578 * BugFixed : Loading icons are not loading at users end #568 = 1.7.28 (13 January 2021) = * Improvement : Added a few Offline notice/message features to the app or website #489 * Improvement : Added prefetch option for manifest in HTML pages #564 * Fix : Loader after refresh the content #552 = 1.7.27 (24 NOVEMBER 2020) = * Improvement : Minor update = 1.7.26 (18 NOVEMBER 2020) = * Improvement : Improvement for Webpushr Plugin compatibility #513 = 1.7.24 (10 NOVEMBER 2020) = * Added : compatibility with Webpushr Plugin (Settings->Tools->Compatibility->Webpushr) #513 = 1.7.24 (04 NOVEMBER 2020) = * Added : Added option to disable PWA for logged in users #543 * Added : Compatibility with the pushnami pushnotification #409 = 1.7.23 (26 OCTOBER 2020) = * Bug Fixed : An option added that would add a custom icon 96x96 for the notifications that are sent for budge(Replace chrome icon). #517 * Improvement : FCM push notification Sending 2 times with Gutenberg editor & need a hook before sent message #547 * Improvement : Added an class to identify if its PWA "pwaforwp-app-contents", its will show only in PWA APP. #522 * Improvement : Added an option loader icon should also work in the backend #411 = 1.7.22 (12 OCTOBER 2020) = * Bug Fixed : Local video is not caching #444 * Improvement : Debug error fixed #520 * Improvement : Compatibility issues with AMP by Automattic. #522 * Improvement : If the Off line Google analytics option in the PWA option panel then showing workbox console error showing #524 = 1.7.21 (3 OCTOBER 2020) = * Bug Fixed : AMP Pages/post (Automattic) is getting blank page, when Loader feature is enabled #528 * Improvement : Added a option for loader background color change. #533 * Improvement : Issue with the Loading Icon alignment. #535 * Improvement : Hide license key of addons #530 = 1.7.20 (17 SEPTEMBER 2020) = * Improvement : Improved the UI of features section #462 * Improvement : Added learn more link after the https status message of PWA #464 * Improvement : Provide option to switch default cache strategy for the user if they have login in the front end #461 * Improvement : Change the UI of the after adding the splash screen automatically for the IOS #452 * Improvement : Pull request for update readme.md #521 = 1.7.19 (05 SEPTEMBER 2020) = * Bug Fixed : service worker version after update option panel #478 * Bug Fixed : Wrapped all the texts of the pwa-for-wp plugin in the text domain #493 * Bug Fixed : Site Icon 180x180 is grabbing while installing the PWA in the iOS mobile devices #483 * Bug Fixed : Message in the opt-in modal #492 * Bug Fixed : FCM Push Notification is sending the notification even when the new post/page is unchecked in the options. #458 = 1.7.18.1 (29 JULY 2020) = * Bug Fixed : moved apple-touch-icon-precomposed icon with manifest #467 = 1.7.18 (21 JULY 2020) = * Feature added : Added feature for Offline Forms for PWA for WP = 1.7.17.2 (14 JULY 2020) = * Bug Fixed : iOS splash screen resolution issue #453 = 1.7.17.1 (08 JULY 2020) = * Bug Fixed : Issue with 'X' button of custom add to home screen banner. #450 * Bug Fixed : Site Icon from Customizer is duplicating the icon meta tag resulting in different icon on homescreen #442 * Bug Fixed : when the app is opened Every time it is changeling for login. #446 = 1.7.17 (04 JULY 2020) = * Bug Fixed : Custom add to home screen banner is appearing on desktop. #438 * Bug Fixed : App splash screen not loading on iOS devices. #249 * Bug Fixed : iOS splash screen issue #410 = 1.7.16.1 (20 JUNE 2020) = * Bug Fixed : Warning Error: PHP Warning: count(): Parameter must be an array #437 * Bug Fixed : User interface notation updated. #441 * Bug Fixed : Maskable icon support in PWA #280 * Bug Fixed : Removed tool tip #432 * Bug Fixed : Add a “cursor: pointer” to Add to Home screen Button #440 = 1.7.16 (12 JUNE 2020) = * Bug Fixed : Extra spacing in Design tab under Setup #417 * Bug Fixed : Apostrophe 'S is adding slash in the front end #418 * Bug Fixed : Popup height issue in Sub settings under features section #416 = 1.7.15 (04 JUNE 2020) = * Bug Fixed : Status showing incorrect data in PWA main settings #414 * Bug Fixed : Add to Home Screen popup should not appear in Offline PWA App #400 * Bug Fixed : "Add To Home screen" popup is not showing on AMP #397 = 1.7.14.1 (28 MAY 2020) = * Bug Fixed : convert & to & character in PWA site title in manifest #406 = 1.7.14 (23 MAY 2020) = * Improvement : Addons are showing require pro even after the extension manager is activated with a key. #381 * Improvement : redirect to the "Extension Manager" section after clicking on the "Premium Features" when user have pwa addon manager #395 * Improvement : flywheel directory path compatibility #399 * Bug Fixed : Added an option to disable the automatic add to home screen pop #398 * Bug Fixed : FCM push notification key generation issue fixed #372 * Bug Fixed : Add to Home Screen popup should not show after adding PWA app #395 = 1.7.13 (15 MAY 2020) = * Improvement : pwa-amp-sw.html is able to view in the Google analytics #389 * Improvement : Update the user experience of premium features tab contents on pro extension exists #378 * Improvement : Improved performance #354 * Improvement : App Icon should be load in last. #362 = 1.7.12 (11 MAY 2020) = * Bug Fixed : pwa menu is enabled the menu gets aligned to full width #377 * Bug Fixed : pwa Pushnotification.io after installation go to settings link #377 * Improvement : pwa Endpoint changes #368 * Bug Fixed : Custom add to home screen banner should not appear if it in IOs #382 = 1.7.11.1 (02 MAY 2020) = * minor update = 1.7.11 (02 MAY 2020) = * Bug Fixed : Resolve multiple time occurrence issue with review message #360 * Bug Fixed : APP Icons and other data should be load in last. #362 * Bug Fixed : window is not UX friendly added scroll css to show scroll bar #361 * Bug Fixed : Added more sanitization to block sql injection in alternative method of Service worker serve #376 #364 * Bug Fixed : preview not loading in elementor in edit mode #373 = 1.7.10 (25 APRIL 2020) = * Bug Fixed : Removed debug notice = 1.7.9.3.2 (15 APRIL 2020) = * Bug Fixed : Custom banners close not working on static scroll banner #357 = 1.7.9.3.1 (31 March 2020) = * Bug Fixed : Security patch: Service worker file read permission updated = 1.7.9.3 (19 March 2020) = * Added : Add to Home screen banner for No scroll view website #346 * Bug Fixed : Fixed Upload Theme button in Appearance. #350 * Bug Fixed : Push notification is sending to user even after disabling this feature. #272 = 1.7.9.2 (6 March 2020) = * Bug Fixed : Removed javascript issue for call to action banner #343 = 1.7.9.1 (2 March 2020) = * Improvement : Minor bug fixes = 1.7.9 (25 February 2020) = * Added : Added Image field in send push notification #342 * Added : In Notification while create or update post featured image will send as big image #342 * Added : Add image option in Send manual notification with FCM integration #325 * Improvement : Minor code improvement = 1.7.8.1 (19 February 2020) = * Bug Fixed : Html cannot fetch properly #342 * Bug Fixed : manifest not working with multisite after performance resolve #341 = 1.7.8 (17 February 2020) = * Resolved : Remove JQuery dependency from Front-end #330 * Bug Fixed : while install with Pushnotification.io integration does not activate the plugin if already exists #338 * Added : Added an option asking were to show the loader only in mobile or in desktop #307 * Improvement : Performance Resolve, call of PWA manifest JSON will load via static file if permission exists #336 * Bug Fixed : 404 Page not showing Network only and network first caching strategies #334 = 1.7.7 (04 February 2020) = * Improvement : Moved Call to action options in Features tabs #313 * Bug Fixed : In background service worker when Push notifications are Selected and FCM keys are filled then also only one of either setting should be loaded in PWA, not both. #326 * Resolved : Features tab modal design issue like contents goes out, submit button not shows #328 * Added : Option to change color of the 'loader icons' #312 * Added : Added apple-touch-icon-precomposed rel link in the head tag for apple app icon #321 = 1.7.6 (18 January 2020) = * Resolved : Fatal error of Cannot redeclare checkStatus() function #297 * Bug Fixed : After Selection of pushnotification.io also shows options of FCM if user previously using FCM integration #304 * Improvement : AMP proper support with pushnotification.io version 1.6 support #303 * Resolved : Wordpress Multi site always show Service worker status "Click here to setup" #298 * Fixed : Refresh the content when default strategy is Network first from Inside APP first opening #306 * Added : Option to user can stop or allow to share data #297 * Resolved : Add to Home screen custom banner is not showing in Samsung default browsers(PWA Support Dependent) #296 = 1.7.5 (11 January 2020) = * Bug Fixed : PWA CTA bar shows behind default browser banner due in AMP #275 * Improved : Manifest loading issue if REST API not disabled #292 = 1.7.4.4 (7 January 2020) = * Minor changes * Bug Fixed : PWA not shows on home/front page with amp by Automattic #288 = 1.7.4.3 (6 January 2020) = * Feature : Compatibility with AMP-WP by Pixelative #273 * Bug Fixed : Minor bug fixed #15 #274 * Bug Fixed : Resolve issue of 301 redirection pages on Network Only and Network First caching strategy #277 * Bug Fixed : Issue fixed with buddy press message not sending #286 = 1.7.4.2 (26 December 2019) = * Feature : pushnotification.io Compatibility added #281 #283 * Bug Fixed : "Uncaught ReferenceError: pwa_cta_assets is not defined" in console #279 * Bug Fixed : PWA service worker time taking to load the page (Cache strategy) #276 = 1.7.4.1 (7 December 2019) = * Improved : Display PWA CTA in Mobile version only #252 * Bug Fixed : UTM tracking referral not set for PWA APP #262 = 1.7.4 (4 December 2019) = * Improved : Caching Strategy for network first and network only #263 * Bug Fixed : Form submit or any post Request check Added #271 * Added : Auto icon cropping feature automatically. if 192x192 icon added #224 = 1.7.3.3 (28 November 2019) = * Fixed : Fixed SW file serve dynamically with ngnix servers #239 = 1.7.3.2 (25 November 2019) = * Feature : Added support with `pwa By PWA Plugin Contributors` #107 = 1.7.3.1 (21 November 2019) = * Improved : Disable Default Add to Home bar #241 * BugFixed : After deactivating switch of push notification remove all code of push notification #231 * BugFixed : loader Icon not shows in IOS (JS event not working) #244 * BugFixed : CTA Bar will disable for 5 min when click on cross the button #248 * BugFixed : Cache strategies & service worker loading as per the wordpress standard #260 = 1.7.3 (16 November 2019) = * Fixed : PWA options are not Save in wordpress version 5.3 #253 * Improved : Improve the Caching Strategies #246 = 1.7.2.1 (13 November 2019) = * BugFixed : Meta title name not appears #243 * Added : Compatibity With amp by automatic plugin in all mode #237 * BugFixed : Resolved fatal Error of Call to undefined function get_filesystem_method() Realted to #217 = 1.7.2 (9 November 2019) = * Improved : Loader disable is not working #228 * Improved : Service worker template file not readable #238 * Improved : Service worker cache file not update on users end #240 * Bug Fixed: FCM Config values not saving properly #217 = 1.7.1.2 (22 October 2019) = * Improved : Custom Add to Homescreen Responsive = 1.7.1.1 (17 October 2019) = * Improved : Added note for Add To Home On Element Click #208 * Improved : Added "apple-touch-startup-image" icon and cache the image previously to load fast For IOS devices #212 * Bug Fixed: Improved upgrade to premium link #214 * Improved : Pre-caching list automated now. On publish post precache list will be updated #215 * Bug Fixed: Enable/Disable checkbox of the PWA on AMP or Non-AMP #216 * Bug Fixed: Fixed the license key error while activating Loading Icon Plugins #218 = 1.7.1 (12 October 2019) = * Improved: UX design of option panel #203 * Improved & Added: Loading icons library added #100 #123 #205 = 1.7 (3 October 2019) = * Added: Options to add IOS splash screen for different different screen sizes #179 * Bug Fixed: PWA addons panel improvement #196 * Improved: Added support for cdn support with autooptimize #195 = 1.6 (26 September 2019) = * Bug Fixed: PWA service worker register with onesignal, Call to action for pwa feature #191 * Bug Fixed: Service worker with Onesignal on single site #193 * Improved: Added aletrnative method for service worker blocked by cache #178 * Bug Fixed: Custom add to HomeScreen Banner,add to HomeScreen on element with oneSignal in multisite #189 #188 * Added: RTL Support #185 = 1.5.1 (20 September 2019) = * Bug Fixed: Added option to enable disabled PWA in normal non-amp #190 * Bug Fixed: AMP multisite service worker URL serving * Improved: UTM parameter properly added = 1.5 (19 September 2019) = * Improved: Video play with PWA caching support for streaming contents #136 * Added: Added auto & fullscreen options in orientation, display respectively #94 #96 * Improved: Serviceworker and other files will display properly even it does not have write permission. #176 * Improved: PWA working along with onesignal when used with multisite network #169 * Added: Added text for translate in add to home screen banner #174 * Added: The closing button option for Add to Homescreen Banner #156 * Added: Tooltip for PWA option with there tutorials links #170 * Added: Manual push notification default title will be website name. Push notification popup icon should be changable #89 = 1.4 (12 September 2019) = * Improved: Serve required files from dynamically #149 * Improved: Add to homescreen icon showing blank in iphone(apple-touch-icon) #113 * Bug Fixed: Landscape orientation is not working in PWA correctly #151 * Bug Fixed: Showing "//" when adding to home screen in Firefox browser(start url) #147 * Added: Upgrade to premium as a menu item in the PWA #174 = 1.3.2 (9 September 2019) = * Bug Fixed: Fatal error in multisite #167 = 1.3.1 (7 September 2019) = * Added: Caching strategists documentation #152 * Improved: Option panel improvements #166 = 1.3 (6 September 2019) = * Added: Option to change start page URL #153 * Feature: Onesignal fully compatible with multisites #164 * Bug Fixed: Service worker installation issue when home url & site url not same #160 * Improved: Multisite service worker installation #163 = 1.2.1 (10 July 2019) = * Bug Fixed: If CDN compatiblity is enabled, Layout of the website is broken in AMP #140 = 1.2 (04 July 2019) = * Bug Fixed: Delete the pwaforwp required files on uninstallation #141 * Bug Fixed: Click here to setup for particular file should have setup Instruction link and message. #142 * Bug Fixed: If CDN compatiblity is enabled, Layout of the website is broken #140 * Bug Fixed: AMP pages are broken on normal refresh. #139 * Bug Fixed: If https status is valid and app icon URL is HTTP then redirect it as HTTPS #133 * Bug Fixed: UTM tracking issue in PWA (Campaign parameter has been added) #114 * Bug Fixed: Home url issue #126 = 1.1 (19 June 2019) = * Added: Manual notification title & app icon in push notification #125 * Added: Option to download required files when file creation permission is not there #108 * Improvements: Increase pre-caching post limit from 50 to unlimited #124 * Bug Fixed: PHP Notice: Undefined index: #119 * Bug Fixed: messaging/permission-blocked and push notification issues in the PWA for a user #104 * Bug Fixed: Enter Urls To Be Cached is showing backend links instead of actual links #102 * Bug Fixed: One Signal issues with Progressive Web Apps (Currently, PWA For WP & AMP is compatible with single site using oneSignal and multisite without oneSignal ( https://wordpress.org/plugins/onesignal-free-web-push-notifications/ )) #81 = 1.0.9 (25 March 2019) = * Bug Fixed: Security improvement. = 1.0.8 (01 March 2019) = * Added : Option to customize push notification title. * Bug Fixed : PWA plugin using Firebase’s Development SDK? #78 * Bug Fixed : Un-visited images are not getting pre-cached when pre-cache option is enabled #80 = 1.0.7.1 (04 February 2019) = * Bug Fixed : On post update – Push notification shows post link but takes to blog home page #77 = 1.0.7 (01 February 2019) = * Bug Fixed : CDN Compatibility is not working on multisite #71 * Bug Fixed : Cache only for visitors but not logged in users? #68 * Bug Fixed : After updating post/page, the service worker still loads the stale post/page from old cache. #75 * Bug Fixed : Url issue with multisite ( service worker is getting main domain path for all subdomain path ) #72 = 1.0.6 (23 January 2019) = * Added: Loading icon option has been added inside tools tab. * Added: Reset option has been added inside tools tab. * Added: Option added inside Advanced tab to cache the request url from an external domain. * Improvements: Notice box to ask for review in day interval will not be shown again, if users click no thanks button * Bug Fixed : Js console error ( Uncaught ReferenceError: btnAdd is not defined ) #65 * Bug Fixed : PWA jumps to the browser in amp ( Now PWA in amp will redirect its link to native PWA app nor browser) #57 * Bug Fixed : If site and wordpress url is different, PWA can not be installed #63 = 1.0.5 (20 December 2018) = * New Feature: Compatible with AMP for WordPress ( https://wordpress.org/plugins/amp ) * New Feature: Pre Caching - Now the latest number of posts can be pre cached on users end on their first visit. * Option to hide and show custom add to home banner on desktop * Properly prepared for localization to make plugin translatable * Bug Fixed : This page does not respond with offline #58 = 1.0.4 (27 November 2018) = * New Feature: Custom responsive add to home banner. * New Feature: Force update service worker option (This option updates service worker for all users who have installed at once) * Offline Google Analytics options * Improvements in CDN compatibility = 1.0.3.1 (12 November 2018) = * Custom Trigger for "Add to Homescreen" bug fixed * Exclude the urls from Cache list bug fixed * And Minor bugs fixed = 1.0.3 (26 October 2018) = * New Feature: Push Notification using firebase * Added notifcations to review on day interval * Custom Trigger for "Add to Homescreen" * Exclude the urls from Cache list * And Minor bugs fixed = 1.0.2 (28 September 2018) = * Apple touch Icons Support #25 * UTM Tracking feature * Contact form added so we can help people faster * Cache Expire time option added * Caching Strategy option added * Improved Add to homescreen option with proper Mini info bar support. * and Minor bugs fixed = 1.0.1 (27 August 2018) = * You can choose to enable PWA compatibility either on AMP or Non-AMP or both. * CDN Compatibility Added - Service Worker Works perfectly, even with the CDN. https://github.com/ahmedkaludi/pwa-for-wp/issues/9 * Optin added - Service Worker Works perfectly, https://github.com/ahmedkaludi/pwa-for-wp/issues/7 * Manifest of PWA was getting override when there is onesignal Manifest in the bottom of the Code: https://github.com/ahmedkaludi/pwa-for-wp/issues/4 * Minor bugs fixed = 1.0 (16 August 2018) = * Version 1.0 ReleasedPK!Hg*5**pwa-for-wp.phpnu['.esc_html__( 'Settings', 'pwa-for-wp' ).''); return array_merge( $links, $mylinks ); } function pwaforwp_revert_src($content){ $url = pwaforwp_site_url(); if ((function_exists( 'ampforwp_is_amp_endpoint' )) || function_exists( 'is_amp_endpoint' )) { preg_match("//i", $content, $manifest_match); if(isset($manifest_match[0])){ $replacewith = ''; $content = str_replace($manifest_match[0],$replacewith,$content); } preg_match("//i", $content, $sw_match); if(isset($sw_match[0])){ $replacewith = '"; } /** * Show the loaders on admin section * @return css/text [print required styles to show loader] */ function pwaforwp_loading_icon_styles(){ echo ''; } /** * pwaforwp_merge_recursive_ex merge any multidimensional Array * @param Array1(array) Array2(array) */ function pwaforwp_merge_recursive_ex(array $array1, array $array2) { $merged = $array1; foreach ($array2 as $key => & $value) { if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { $merged[$key] = pwaforwp_merge_recursive_ex($merged[$key], $value); } else if (is_numeric($key)) { if (!in_array($value, $merged)) { $merged[] = $value; } } else { $merged[$key] = $value; } } return $merged; }PK!Btwwadmin/common-function.phpnu['; echo apply_filters('pwaforwp_loading_contents', '
'); } } if(!is_admin()){ add_action('wp_footer', 'pwaforwp_loading_icon'); } function pwaforwp_reset_all_settings(){ if ( ! isset( $_POST['pwaforwp_security_nonce'] ) ){ return; } if ( !wp_verify_nonce( $_POST['pwaforwp_security_nonce'], 'pwaforwp_ajax_check_nonce' ) ){ return; } if ( ! current_user_can( 'manage_options' ) ) { return; } $default = pwaforwp_get_default_settings_array(); $result = update_option('pwaforwp_settings', $default); delete_transient('pwaforwp_restapi_check'); if($result){ echo json_encode(array('status'=>'t')); }else{ echo json_encode(array('status'=>'f')); } wp_die(); } add_action('wp_ajax_pwaforwp_reset_all_settings', 'pwaforwp_reset_all_settings'); function pwaforwp_load_plugin_textdomain() { load_plugin_textdomain( 'pwa-for-wp', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); } add_action( 'plugins_loaded', 'pwaforwp_load_plugin_textdomain' ); function pwaforwp_review_notice_close(){ if ( ! isset( $_POST['pwaforwp_security_nonce'] ) ){ return; } if ( !wp_verify_nonce( $_POST['pwaforwp_security_nonce'], 'pwaforwp_ajax_check_nonce' ) ){ return; } $result = update_option( "pwaforwp_review_never", 'never'); if($result){ echo json_encode(array('status'=>'t')); }else{ echo json_encode(array('status'=>'f')); } wp_die(); } add_action('wp_ajax_pwaforwp_review_notice_close', 'pwaforwp_review_notice_close'); function pwaforwp_review_notice_remindme(){ if ( ! isset( $_POST['pwaforwp_security_nonce'] ) ){ return; } if ( !wp_verify_nonce( $_POST['pwaforwp_security_nonce'], 'pwaforwp_ajax_check_nonce' ) ){ return; } $result = update_option( "pwaforwp_review_notice_bar_close_date", date("Y-m-d")); if($result){ echo json_encode(array('status'=>'t')); }else{ echo json_encode(array('status'=>'f')); } wp_die(); } add_action('wp_ajax_pwaforwp_review_notice_remindme', 'pwaforwp_review_notice_remindme'); /* * REGISTER ALL NON-ADMIN SCRIPTS */ function pwaforwp_frontend_enqueue(){ if ( class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->preview->is_preview_mode() ) { return ; } $server_key = $config = ''; $settings = pwaforwp_defaultSettings(); if(isset($settings['force_update_sw_setting'])){ if(!version_compare($settings['force_update_sw_setting'],PWAFORWP_PLUGIN_VERSION, '>=') ){ $settings['force_update_sw_setting'] = PWAFORWP_PLUGIN_VERSION; } // echo esc_attr($settings['force_update_sw_setting']); $force_update_sw_setting_value = $settings['force_update_sw_setting']; }else{ $force_update_sw_setting_value = PWAFORWP_PLUGIN_VERSION; } if(isset($settings['normal_enable']) && $settings['normal_enable']==1){ if(isset($settings['fcm_server_key'])){ $server_key = $settings['fcm_server_key']; } if(isset($settings['fcm_config'])){ $config = $settings['fcm_config']; } if(isset($settings['notification_feature']) && $settings['notification_feature']==1 && isset($settings['notification_options']) && $settings['notification_options']=='fcm_push' && ($server_key !='' && $config !='')){ wp_register_script('pwaforwp-push-js', PWAFORWP_PLUGIN_URL . 'assets/js/pwa-push-notification'.pwaforwp_multisite_postfix().'.js', array('pwa-main-script'), $force_update_sw_setting_value, true); $object_name = array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'pwa_ms_prefix' => pwaforwp_multisite_postfix(), 'pwa_home_url' => pwaforwp_home_url(), 'pwaforwp_security_nonce' => wp_create_nonce('pwaforwp_ajax_check_nonce') ); wp_localize_script('pwaforwp-push-js', 'pwaforwp_obj', $object_name); wp_enqueue_script('pwaforwp-push-js'); } if( (isset($settings['loading_icon']) && $settings['loading_icon']==1) || isset($settings['add_to_home_sticky']) || isset($settings['add_to_home_menu'])){ wp_register_script('pwaforwp-js', PWAFORWP_PLUGIN_URL . 'assets/js/pwaforwp.min.js',array(), $force_update_sw_setting_value, true); $loader_desktop = $loader_mobile = $loader_admin = $loader_only_pwa = 0; //For desktop if( isset($settings['loading_icon_display_pwa']) && !empty($settings['loading_icon_display_pwa']) ){ $loader_only_pwa = $settings['loading_icon_display_pwa']; } //For desktop if(isset($settings['loading_icon_display_desktop'])): $loader_desktop = $settings['loading_icon_display_desktop']; elseif(isset($settings['loading_icon']) && $settings['loading_icon']==1) ://Falback for old users $loader_desktop = 1; endif; //For mobile if(isset($settings['loading_icon_display_mobile'])): $loader_mobile = $settings['loading_icon_display_mobile']; elseif(isset($settings['loading_icon']) && $settings['loading_icon']==1) ://Falback for old users $loader_mobile = 1; endif; //For Admin if(isset($settings['loading_icon_display_admin'])): $loader_admin = $settings['loading_icon_display_admin']; elseif(isset($settings['loading_icon']) && $settings['loading_icon']==1) ://Falback for old users $loader_admin = 1; endif; $reset_cookies=0; if(isset($settings['reset_cookies']) && $settings['reset_cookies']==1){ $reset_cookies=1; } $object_js_name = array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'pwa_ms_prefix' => pwaforwp_multisite_postfix(), 'pwa_home_url' => pwaforwp_home_url(), 'loader_desktop' => $loader_desktop, 'loader_mobile' => $loader_mobile, 'loader_admin' => $loader_admin, 'user_admin' => is_user_logged_in(), 'loader_only_pwa' => $loader_only_pwa, 'reset_cookies' => $reset_cookies, ); wp_localize_script('pwaforwp-js', 'pwaforwp_js_obj', $object_js_name); wp_enqueue_script('pwaforwp-js'); } wp_enqueue_style( 'pwaforwp-style', PWAFORWP_PLUGIN_URL . 'assets/css/pwaforwp-main.min.css', false , $force_update_sw_setting_value ); wp_style_add_data( 'pwaforwp-style', 'rtl', 'replace' ); } wp_register_script('pwaforwp-video-js', PWAFORWP_PLUGIN_URL . 'assets/js/pwaforwp-video.js',array(), $force_update_sw_setting_value, true); wp_enqueue_script('pwaforwp-video-js'); wp_register_script('pwaforwp-download-js', PWAFORWP_PLUGIN_URL . 'assets/js/pwaforwp-download.js',array(), $force_update_sw_setting_value, true); wp_enqueue_script('pwaforwp-download-js'); } add_action( 'wp_enqueue_scripts', 'pwaforwp_frontend_enqueue', 35 ); if(!function_exists('pwaforwp_is_admin')){ function pwaforwp_is_admin(){ if ( is_admin() ) { return true; } if ( isset( $_GET['page'] ) && false !== strpos( sanitize_text_field($_GET['page']), 'pwaforwp' ) ) { return true; } return false; } } function pwaforwp_admin_link($tab = '', $args = array()){ $page = 'pwaforwp'; if ( ! is_multisite() ) { $link = admin_url( 'admin.php?page=' . $page ); } else { $link = admin_url( 'admin.php?page=' . $page ); } if ( $tab ) { $link .= '&tab=' . $tab; } if ( $args ) { foreach ( $args as $arg => $value ) { $link .= '&' . $arg . '=' . urlencode( $value ); } } return esc_url($link); } function pwaforwp_get_tab( $default = '', $available = array() ) { $tab = isset( $_GET['tab'] ) ? sanitize_text_field($_GET['tab']) : $default; if ( ! in_array( $tab, $available ) ) { $tab = $default; } return $tab; } function pwaforwp_get_default_settings_array(){ $defaults = array( 'app_blog_name' => get_bloginfo( 'name' ), 'app_blog_short_name' => get_bloginfo( 'name' ), 'description' => get_bloginfo( 'description' ), 'icon' => PWAFORWP_PLUGIN_URL . 'images/logo.png', 'splash_icon' => PWAFORWP_PLUGIN_URL . 'images/logo-512x512.png', //Splash icon 'switch_apple_splash_screen'=>0, 'ios_splash_icon'=> array( '640x1136'=>'', '750x1334'=>'', '1242x2208'=>'', '1125x2436'=>'', '828x1792'=>'', '1242x2688'=>'', '1536x2048'=>'', '1668x2224'=>'', '1668x2388'=>'', '2048x2732'=>'', ), 'screenshots' => PWAFORWP_PLUGIN_URL . 'images/logo-512x512.png', 'custom_banner_background_color'=>'#D5E0EB', 'custom_banner_title_color'=>'#000', 'custom_banner_btn_color'=>'#006dda', 'custom_banner_btn_text_color'=>'#fff', 'fcm_push_icon' => PWAFORWP_PLUGIN_URL . 'images/logo.png', 'background_color' => '#D5E0EB', 'theme_color' => '#D5E0EB', 'start_url' => 0, 'start_url_amp' => 0, 'offline_page' => 0, 'offline_page_other'=> '', '404_page' => 0, 'start_page' => 0, 'orientation' => 'portrait', 'display' => 'standalone', 'ios_status_bar' => 'default', 'manualfileSetup' => 0, 'cdn_setting' => 0, 'normal_enable' => 1, 'amp_enable' => 1, 'cached_timer' => array('html'=>3600,'css'=>86400), 'serve_js_cache_menthod'=> "false", 'default_caching' => 'cacheFirst', 'default_caching_js_css'=> 'cacheFirst', 'default_caching_images'=> 'cacheFirst', 'default_caching_fonts' => 'cacheFirst', 'on_add_post_notification_title' => '', /*Push notification services*/ 'notification_options' => '', /*Features settings*/ 'notification_feature' => 0, 'precaching_feature' => 0, 'addtohomebanner_feature'=> 0, 'utmtracking_feature' => 0, 'loader_feature' => 0, /*UTM*/ 'utm_setting' => 0, 'utm_details' => array( 'utm_source'=> 'pwa-app', 'utm_medium'=> 'pwa-app', 'utm_campaign'=> 'pwa-campaign', 'utm_term' => 'pwa-term', 'utm_content' => 'pwa-content', ), /*Pre caching*/ 'precaching_automatic'=> 0, 'precaching_automatic_post'=> 0, 'precaching_automatic_page'=> 0, 'precaching_post_count'=> 5, 'precaching_automatic_custom_post'=> 0, 'precaching_manual' => 0, 'precaching_urls' => '', /*loader icon*/ 'loading_icon' => 0, 'loading_icon_color'=> '#3498db', 'loading_icon_bg_color'=> '#ffffff', 'loading_icon_display_admin'=>0, ); $defaults = apply_filters("pwaforwp_default_settings_vals",$defaults); return $defaults; } $pwaforwp_settings = array(); function pwaforwp_defaultSettings(){ global $pwaforwp_settings; if( empty($pwaforwp_settings) || (is_array($pwaforwp_settings) && count($pwaforwp_settings)==0) ){ $defaults = pwaforwp_get_default_settings_array(); $pwaforwp_settings = get_option( 'pwaforwp_settings', $defaults ); $pwaforwp_settings = wp_parse_args($pwaforwp_settings, $defaults); } //Fallback for features tab $pwaforwp_settings = pwaforwp_migration_setup_fetures($pwaforwp_settings); //autoptimize cdn compatibility $cdnUrl = false; if(function_exists('autoptimize_autoload')){ $cdnUrl = get_option( 'autoptimize_cdn_url', '' ); } if($cdnUrl){ $pwaforwp_settings['external_links_setting'] = 1; } $pwaforwp_settings = apply_filters("pwaforwp_final_settings_vals",$pwaforwp_settings); return $pwaforwp_settings; } function pwaforwp_migration_setup_fetures($pwaforwp_settings){ if(isset($pwaforwp_settings['precaching_feature']) && $pwaforwp_settings['precaching_feature']==0 && isset($pwaforwp_settings['precaching_automatic']) && $pwaforwp_settings['precaching_automatic'] == 1 ){ $pwaforwp_settings['precaching_feature'] = 1; } if(isset($pwaforwp_settings['addtohomebanner_feature']) && $pwaforwp_settings['addtohomebanner_feature']==0 && isset($pwaforwp_settings['custom_add_to_home_setting']) && $pwaforwp_settings['custom_add_to_home_setting'] == 1 ){ $pwaforwp_settings['addtohomebanner_feature'] = 1; } if(isset($pwaforwp_settings['utmtracking_feature']) && $pwaforwp_settings['utmtracking_feature']==0 && isset($pwaforwp_settings['utm_setting']) && $pwaforwp_settings['utm_setting'] == 1 ){ $pwaforwp_settings['utmtracking_feature'] = 1; } if(isset($pwaforwp_settings['loader_feature']) && $pwaforwp_settings['loader_feature']==0 && isset($pwaforwp_settings['loading_icon']) && $pwaforwp_settings['loading_icon'] == 1 ){ $pwaforwp_settings['loader_feature'] = 1; } return $pwaforwp_settings; } function pwaforwp_expanded_allowed_tags() { $my_allowed = wp_kses_allowed_html( 'post' ); // form fields - input $my_allowed['input'] = array( 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'type' => array(), 'style' => array(), 'placeholder' => array(), 'maxlength' => array(), 'checked' => array(), 'readonly' => array(), 'disabled' => array(), 'width' => array(), ); //number $my_allowed['number'] = array( 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'type' => array(), 'style' => array(), 'width' => array(), ); //textarea $my_allowed['textarea'] = array( 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'type' => array(), 'style' => array(), 'rows' => array(), ); // select $my_allowed['select'] = array( 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'type' => array(), 'required' => array(), ); // options $my_allowed['option'] = array( 'selected' => array(), 'value' => array(), ); // style $my_allowed['style'] = array( 'types' => array(), ); return $my_allowed; } function pwaforwp_home_url(){ if ( is_multisite() ) { $link = get_site_url(); } else { $link = home_url(); } $link = pwaforwp_https($link); return trailingslashit($link); } function pwaforwp_site_url(){ if (is_multisite() ) { $link = get_site_url(); } else { $link = site_url(); } $link = pwaforwp_https($link); return trailingslashit($link); } function pwaforwp_amp_takeover_status(){ $amp_take_over = false; if ( function_exists( 'ampforwp_is_amp_endpoint' ) || function_exists( 'is_amp_endpoint' ) && !defined('AMP_WP_DIR_PATH')) { global $redux_builder_amp; if(isset($redux_builder_amp['ampforwp-amp-takeover'])){ if($redux_builder_amp['ampforwp-amp-takeover'] == 1){ $amp_take_over = true; } }else{ if(function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && (is_front_page()||is_home()) ){ $amp_take_over = true; } } } return $amp_take_over; } function pwaforwp_https( $url ) { if(strpos($url, 'localhost') === false){ return str_replace( 'http://', 'https://', $url ); }else{ return $url; } } function pwaforwp_multisite_postfix(){ $multisite_postfix = ''; if ( is_multisite() ) { $multisite_postfix = '-' . get_current_blog_id(); } return $multisite_postfix; } function pwaforwp_write_a_file($path, $content, $action = null){ $writestatus = ''; if(file_exists($path)){ $writestatus = unlink($path); } if(!$action){ if(!file_exists($path) && $content){ $handle = @fopen($path, 'w'); $writestatus = @fwrite($handle, $content); @fclose($handle); } } if($writestatus){ return true; }else{ return false; } } function pwaforwp_delete_pwa_files(){ pwaforwp_required_file_creation(true); } function pwaforwp_required_file_creation($action = null){ $settings = pwaforwp_defaultSettings(); $server_key = $config = ''; $fileCreationInit = new PWAFORWP_File_Creation_Init(); pwaforwp_onesignal_compatiblity($action); pwaforwp_pushnami()->pushnami_compatiblity($action); $status = ''; $status = $fileCreationInit->pwaforwp_swjs_init($action); $status = $fileCreationInit->pwaforwp_manifest_init($action); $status = $fileCreationInit->pwaforwp_swr_init($action); $status = $fileCreationInit->pwaforwp_push_notification_js($action); if(function_exists( 'ampforwp_is_amp_endpoint' ) || function_exists( 'is_amp_endpoint' )){ $status = $fileCreationInit->pwaforwp_swjs_init_amp($action); $status = $fileCreationInit->pwaforwp_manifest_init_amp($action); $status = $fileCreationInit->pwaforwp_swhtml_init_amp($action); } if(!$status){ set_transient( 'pwaforwp_file_change_transient', true ); } if(isset($settings['fcm_server_key'])){ $server_key = $settings['fcm_server_key']; } if(isset($settings['fcm_config'])){ $config = $settings['fcm_config']; } if($server_key !='' && $config !=''){ $fileCreationInit->pwaforwp_swhtml_init_firebase_js($action); } } function pwaforwp_query_var($key=''){ $default = array( 'sw_query_var'=>'pwa_for_wp_script', 'sw_file_var'=> 'sw', ); //if(is_multisite()){ $default['site_id_var'] = 'site'; //} if(!empty($key) && isset($default[$key])){ return $default[$key]; }else{ return $default; } } function pwaforwp_manifest_json_url($is_amp=false){ $link = ''; $fileCheck = false; $multisite_postfix = pwaforwp_multisite_postfix(); $wppath = ABSPATH; $wppath = apply_filters("pwaforwp_file_creation_path", $wppath); if(!is_admin() && !is_multisite()){ $fileCheck = file_exists($wppath .apply_filters('pwaforwp_manifest_file_name', "pwa-manifest".pwaforwp_multisite_postfix().".json")); if($is_amp){ $fileCheck = file_exists($wppath .apply_filters('pwaforwp_amp_manifest_file_name', "pwa-amp-manifest".pwaforwp_multisite_postfix().".json")); } } if($fileCheck && !$multisite_postfix){ $restApiEnabled = 400; }else{ $restApiEnabled = get_transient( 'pwaforwp_restapi_check' ); if ( $restApiEnabled===false || empty($restApiEnabled) ) { $response = wp_remote_get( rest_url( 'pwa-for-wp/v2/pwa-manifest-json' ) ); $restApiEnabled = wp_remote_retrieve_response_code($response); set_transient( "pwaforwp_restapi_check", $restApiEnabled ); } } if($restApiEnabled==200){ $link = rest_url( 'pwa-for-wp/v2/pwa-manifest-json' ); if($is_amp){ $link = rest_url( 'pwa-for-wp/v2/pwa-manifest-json/amp' ); } }else{ $url = pwaforwp_site_url(); $link = $url.apply_filters('pwaforwp_manifest_file_name', "pwa-manifest".pwaforwp_multisite_postfix().".json"); if($is_amp){ $link = $url.apply_filters('pwaforwp_amp_manifest_file_name', "pwa-amp-manifest".pwaforwp_multisite_postfix().".json"); } } return $link; } add_filter("pwaforwp_file_creation_path", "pwaforwp_check_root_writable", 10, 1); function pwaforwp_check_root_writable($wppath){ $uploadArray = wp_upload_dir(); $uploadBasePath = trailingslashit($uploadArray['basedir']); if(!is_writable($wppath) && is_writable(realpath(WP_CONTENT_DIR."/../"))){ return trailingslashit(realpath(WP_CONTENT_DIR."/../")); } if(!is_writable($wppath) && is_writable($uploadBasePath)){ $uploadPwaFolder = "pwaforwp"; $newpath = $uploadBasePath.$uploadPwaFolder; wp_mkdir_p($newpath); return trailingslashit($newpath); } return trailingslashit($wppath); } function service_workerUrls($url, $filename){ $uploadArray = wp_upload_dir(); $uploadBasePath = trailingslashit($uploadArray['basedir']); $settings = pwaforwp_defaultSettings(); $site_url = pwaforwp_site_url(); $home_url = pwaforwp_home_url(); if( ( !pwaforwp_is_file_inroot() || $site_url!= $home_url) && !class_exists( 'WPPushnami' ) ){ $filename = str_replace(".", "-", $filename); $home_url = rtrim($home_url, "/"); $home_url = add_query_arg(pwaforwp_query_var('sw_query_var'), 1, $home_url); $home_url = add_query_arg(pwaforwp_query_var('sw_file_var'), $filename, $home_url); $url = $home_url; } if(isset($settings['serve_js_cache_menthod']) && $settings['serve_js_cache_menthod']=='true'){ $url = esc_url_raw(admin_url( 'admin-ajax.php?action=pwaforwp_sw_files&'.pwaforwp_query_var('sw_query_var').'=1&'.pwaforwp_query_var('sw_file_var').'='.$filename )); } return $url; } function pwaforwp_is_file_inroot(){ $wppath = ABSPATH; $wppath = apply_filters("pwaforwp_file_creation_path", $wppath); if(is_writable($wppath)){ return true; }else{ return false; } } /** * only for Automattic amp Support * When user enabled Standard & Transitional mode * it will check and give respective values */ function pwaforwp_is_automattic_amp($case=null){ //Check if current theme support amp switch ($case) { case 'amp_support': if(class_exists('AMP_Theme_Support')){ return current_theme_supports( AMP_Theme_Support::SLUG ); } break; default: if ( current_theme_supports( 'amp' ) && function_exists('is_amp_endpoint') && is_amp_endpoint() ) { return true; } break; } return false; } /** * PWA WP Enabled */ function pwaforwp_is_enabled_pwa_wp(){ if ( class_exists( 'WP_Service_Workers' ) ) { return true; } return false; } function ios_splashscreen_files_data(){ $iosSplashData = array( '1136x640'=> array("device-width"=> '320px', "device-height"=> "568px","ratio"=> 2,"orientation"=> "landscape","file"=> "icon_1136x640.png",'name'=> 'iPhone 5/iPhone SE'), '640x1136'=> array("device-width"=> '320px', "device-height"=> "568px","ratio"=> 2,"orientation"=> "portrait", "file"=> "icon_640x1136.png",'name'=> 'iPhone 5/iPhone SE'), '2688x1242'=>array("device-width"=> '414px', "device-height"=> "896px","ratio"=> 3,"orientation"=> "landscape", "file"=> "icon_2688x1242.png", 'name'=>'iPhone XS Max'), '1792x828'=> array("device-width"=> '414px', "device-height"=> "896px","ratio"=> 2, "orientation"=> "landscape", "file"=> "icon_1792x828.png", 'name'=>'iPhone XR'), '1125x2436'=>array("device-width"=> '375px', "device-height"=> "812px","ratio"=> 3,"orientation"=> 'portrait', "file"=>"icon_1125x2436.png", 'name'=> 'iPhone X/Xs'), '828x1792'=> array("device-width"=> "414px", "device-height"=> "896px","ratio"=> 2,"orientation"=> "portrait","file"=>"icon_828x1792.png",'name' => 'iPhone Xr'), '2436x1125'=> array("device-width"=> "375px","device-height"=> "812px","ratio"=> 3,"orientation"=> "landscape", "file"=>"icon_2436x1125.png", 'name'=> 'iPhone X/Xs'), '1242x2208'=> array("device-width"=> "414px","device-height"=> "736px","ratio"=> 3,"orientation"=> "portrait", "file"=>"icon_1242x2208.png", 'name'=> 'iPhone 6/7/8 Plus'), '2208x1242'=>array("device-width"=> "414px","device-height"=> "736px","ratio"=> 3,"orientation"=> "landscape", "file"=>"icon_2208x1242.png", 'name'=> 'iPhone 6/7/8 Plus'), '1334x750'=>array("device-width"=> "375px","device-height"=> "667px","ratio"=> 2,"orientation"=> "landscape", "file"=>"icon_1334x750.png", 'name'=> 'iPhone 6/7/8'), '750x1334'=>array("device-width"=> "375px","device-height"=> "667px","ratio"=> 2,"orientation"=> "portrait","file"=>"icon_750x1334.png", 'name'=> 'iPhone 6/7/8'), '2732x2048'=>array("device-width"=> "1024px","device-height"=>"1366px","ratio"=> 2,"orientation"=> "landscape","file"=>"icon_2732x2048.png", 'name'=> 'iPad Pro 12.9"'), '2048x2732'=>array("device-width"=> "1024px","device-height"=> "1366px","ratio"=> 2,"orientation"=> "portrait","file"=>"icon_2048x2732.png", 'name'=> 'iPad Pro 12.9"'), '2388x1668'=>array("device-width"=> "834px","device-height"=> "1194px","ratio"=> 2,"orientation"=> "landscape", "file"=>"icon_2388x1668.png",'name'=> 'iPad Pro 11"'), '1668x2388'=>array("device-width"=> "834px","device-height"=> "1194px","ratio"=> 2,"orientation"=> "portrait","file"=>"icon_1668x2388.png",'name'=> 'iPad Pro 11"'), '2224x1668'=>array("device-width"=> "834px", "device-height"=> "1112px","ratio"=> 2,"orientation"=>"landscape","file"=>"icon_2224x1668.png", 'name'=> 'iPad Pro 10.5"'), '1242x2688'=>array("device-width"=> "414px","device-height"=> "896px","ratio"=> 3, "orientation"=> "portrait","file"=>"icon_1242x2688.png", 'name' => 'iPhone Xs Max'), '1668x2224'=>array("device-width"=> "834px","device-height"=> "1112px","ratio"=> 2, "orientation"=> "portrait","file"=>"icon_1668x2224.png", 'name'=> 'iPad Pro 10.5"'), '1536x2048'=>array("device-width"=> "768px","device-height"=> "1024px","ratio"=> 2, "orientation"=> "portrait","file"=>"icon_1536x2048.png", 'name'=> 'iPad Mini/iPad Air'), '2048x1536'=>array("device-width"=> "768px","device-height"=> "1024px","ratio"=> 2,"orientation"=> "landscape","file"=>"icon_2048x1536.png", 'name'=> 'iPad Mini/iPad Air'), ); return $iosSplashData; }PK!O2g admin/pwa-utility.phpnu[300,"message"=>'Request not valid')); exit(); } // Exit if the user does not have proper permissions if(! current_user_can( 'install_plugins' ) ) { echo json_encode(array("status"=>300,"message"=>'User Request not valid')); exit(); } $plugins = array(); $redirectSettingsUrl = ''; $currentActivateModule = sanitize_text_field( wp_unslash($_REQUEST['activate'])); switch($currentActivateModule){ case 'pushnotification': $nonceUrl = add_query_arg( array( 'action' => 'activate', 'plugin' => 'push-notification', 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce( 'activate-plugin_push-notification' ), ), esc_url(network_admin_url( 'plugins.php' )) ); $plugins[] = array( 'name' => 'push-notification', 'path_' => 'https://downloads.wordpress.org/plugin/push-notification.zip', 'path' => $nonceUrl, 'install' => 'push-notification/push-notification.php', ); $redirectSettingsUrl = admin_url('admin.php?page=push-notification&reference=pwaforwp'); break; } if(count($plugins)>0){ echo json_encode( array( "status"=>200, "message"=>"Module successfully Added",'redirect_url'=>esc_url($redirectSettingsUrl) , "slug"=>$plugins[0]['name'], 'path'=> $plugins[0]['path'] ) ); }else{ echo json_encode(array("status"=>300, "message"=>"Modules not Found")); } wp_die(); } public function enable_modules_active_dashboard(){ if(!wp_verify_nonce( $_REQUEST['verify_nonce'], 'wp_pro_activate' ) ) { echo json_encode(array("status"=>300,"message"=>'Request not valid')); die; exit(); } if(!current_user_can('activate_plugins')){ echo json_encode(array("status"=>400,"message"=>esc_html__('User not authorized to access', 'pwa-for-wp') )); die; } $addonLists = pwaforwp_list_addons(); $target_file = $_POST['target_file']; $slug = isset($addonLists[$target_file]['p-slug'])? $addonLists[$target_file]['p-slug'] : ''; if( $slug ){ $response = activate_plugin($slug); }else{ $response = new WP_Error( 'broke', esc_html__( "invalid slug provided", "my_textdomain" ) ); } if($response instanceof WP_Error){ echo json_encode(array("status"=>500, 'message'=>$response->get_error_message()));die; }else{ echo json_encode(array("status"=>200, 'message'=>esc_html__('Plugin Activating. please wait..', 'pwa-for-wp') ));die; } } } $PWA_UtilityObj = new PWA_Utility(); $PWA_UtilityObj->init();PK!admin/index.phpnu[plugin_file = $_plugin_file; $this->home_url = trailingslashit( $_home_url ); // If the filename is 'functions' then we're tracking a theme if( basename( $this->plugin_file, '.php' ) != 'functions' ) { $this->plugin_name = basename( $this->plugin_file, '.php' ); } else { $this->what_am_i = 'theme'; $theme = wp_get_theme(); if( $theme->Name ) { $this->plugin_name = sanitize_text_field( $theme->Name ); } } $this->options = $_options; $this->require_optin = $_require_optin; $this->include_goodbye_form = $_include_goodbye_form; $this->marketing = $_marketing; // Only use this on switching theme $this->theme_allows_tracking = get_theme_mod( 'wisdom-allow-tracking', 0 ); // Schedule / deschedule tracking when activated / deactivated if( $this->what_am_i == 'theme' ) { // Need to think about scheduling for sites that have already activated the theme add_action( 'after_switch_theme', array( $this, 'schedule_tracking' ) ); add_action( 'switch_theme', array( $this, 'deactivate_this_plugin' ) ); } else { register_activation_hook( $this->plugin_file, array( $this, 'schedule_tracking' ) ); register_deactivation_hook( $this->plugin_file, array( $this, 'deactivate_this_plugin' ),11 ); } // Get it going $this->init(); } public function init() { // Check marketing if( $this->marketing == 3 ) { $this->set_can_collect_email( true, $this->plugin_name ); } // Check whether opt-in is required // If not, then tracking is allowed if( ! $this->require_optin ) { $this->set_can_collect_email( true, $this->plugin_name ); $this->set_is_tracking_allowed( true ); $this->update_block_notice(); $this->do_tracking(); } // Hook our do_tracking function to the daily action add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); // Use this action for local testing // add_action( 'admin_init', array( $this, 'do_tracking' ) ); // Display the admin notice on activation add_action( 'admin_notices', array( $this, 'optin_notice' ) ); add_action( 'admin_notices', array( $this, 'marketing_notice' ) ); // Deactivation add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ),10 ); add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) ); add_action( 'wp_ajax_goodbye_form', array( $this, 'goodbye_form_callback' ) ); /*$body = $this->get_data(); // Send the data $this->send_data( $body );*/ } /** * When the plugin is activated * Create scheduled event * And check if tracking is enabled - perhaps the plugin has been reactivated * * @since 1.0.0 */ public function schedule_tracking() { // For historical reasons, this is called 'weekly' but is in fact daily if ( ! wp_next_scheduled( 'put_do_weekly_action' ) ) { wp_schedule_event( time(), 'daily', 'put_do_weekly_action' ); } } /** * This is our function to get everything going * Check that user has opted in * Collect data * Then send it back * * @since 1.0.0 * @param $force Force tracking if it's not time */ public function do_tracking( $force=false ) { // If the home site hasn't been defined, we just drop out. Nothing much we can do. if ( ! $this->home_url ) { return; } // Check to see if the user has opted in to tracking /*$allow_tracking = $this->get_is_tracking_allowed(); if( ! $allow_tracking ) { return; } */ // Check to see if it's time to track $track_time = $this->get_is_time_to_track(); if( ! $track_time && ! $force ) { return; } $this->set_admin_email(); // Get our data $body = $this->get_data(); // Send the data $this->send_data( $body ); } /** * Send the data to the home site * * @since 1.0.0 */ public function send_data( $body ) { $request = wp_remote_post( esc_url( 'https://data.ampforwp.com/pwaforwp?usage_tracker=hello' ), array( 'method' => 'POST', 'timeout' => 20, 'redirection' => 5, 'httpversion' => '1.1', 'blocking' => true, 'body' => $body, 'user-agent' => 'PUT/1.0.0; ' . home_url() ) ); //print_r($request['body']); die; $this->set_track_time(); if( is_wp_error( $request ) ) { return $request; } } /** * Here we collect most of the data * * @since 1.0.0 */ public function get_data() { // Use this to pass error messages back if necessary $body['message'] = ''; // Use this array to send data back $body = array( 'plugin_slug' => sanitize_text_field( $this->plugin_name ), 'url' => home_url(), 'site_name' => get_bloginfo( 'name' ), 'site_version' => get_bloginfo( 'version' ), 'site_language' => get_bloginfo( 'language' ), 'charset' => get_bloginfo( 'charset' ), 'wisdom_version' => $this->wisdom_version, 'php_version' => phpversion(), 'multisite' => is_multisite(), 'file_location' => __FILE__, 'product_type' => esc_html( $this->what_am_i ) ); // Collect the email if the correct option has been set if( $this->get_can_collect_email() ) { $body['email'] = $this->get_admin_email(); } $body['marketing_method'] = $this->marketing; $body['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : ''; // Retrieve current plugin information if( ! function_exists( 'get_plugins' ) ) { include ABSPATH . '/wp-admin/includes/plugin.php'; } $plugins = array_keys( get_plugins() ); $active_plugins = get_option( 'active_plugins', array() ); foreach ( $plugins as $key => $plugin ) { if ( in_array( $plugin, $active_plugins ) ) { // Remove active plugins from list so we can show active and inactive separately unset( $plugins[$key] ); } } $body['active_plugins'] = $active_plugins; $body['inactive_plugins'] = $plugins; // Check text direction $body['text_direction'] = 'LTR'; if( function_exists( 'is_rtl' ) ) { if( is_rtl() ) { $body['text_direction'] = 'RTL'; } } else { $body['text_direction'] = 'not set'; } /** * Get our plugin data * Currently we grab plugin name and version * Or, return a message if the plugin data is not available * @since 1.0.0 */ $plugin = $this->plugin_data(); if( empty( $plugin ) ) { // We can't find the plugin data // Send a message back to our home site $body['message'] .= __( 'We can\'t detect any product information. This is most probably because you have not included the code snippet.', 'singularity' ); $body['status'] = 'Data not found'; // Never translated } else { if( isset( $plugin['Name'] ) ) { $body['plugin'] = sanitize_text_field( $plugin['Name'] ); } if( isset( $plugin['Version'] ) ) { $body['version'] = sanitize_text_field( $plugin['Version'] ); } $body['status'] = 'Active'; // Never translated } /** * Get our plugin options * @since 1.0.0 */ $options = $this->options; $plugin_options = array(); if( ! empty( $options ) && is_array( $options ) ) { foreach( $options as $option ) { $fields = get_option( $option ); // Check for permission to send this option if( isset( $fields['wisdom_registered_setting'] ) ) { foreach( $fields as $key=>$value ) { $plugin_options[$key] = $value; } } } } $body['plugin_options'] = $this->options; // Returns array $body['plugin_options_fields'] = $plugin_options; // Returns object /** * Get our theme data * Currently we grab theme name and version * @since 1.0.0 */ $theme = wp_get_theme(); if( $theme->Name ) { $body['theme'] = sanitize_text_field( $theme->Name ); } if( $theme->Version ) { $body['theme_version'] = sanitize_text_field( $theme->Version ); } if( $theme->Template ) { $body['theme_parent'] = sanitize_text_field( $theme->Template ); } if( false !== get_option( 'wisdom_deactivation_reason_' . $this->plugin_name ) ) { $body['deactivation_reason'] = get_option( 'wisdom_deactivation_reason_' . $this->plugin_name ); } // print_r($body); die; // Return the data return $body; } /** * Return plugin data * @since 1.0.0 */ public function plugin_data() { // Being cautious here if( ! function_exists( 'get_plugin_data' ) ) { include ABSPATH . '/wp-admin/includes/plugin.php'; } // Retrieve current plugin information $plugin = get_plugin_data( $this->plugin_file ); return $plugin; } /** * Deactivating plugin * @since 1.0.0 */ public function deactivate_this_plugin() { // Check to see if the user has opted in to tracking /*if( $this->what_am_i == 'theme' ) { $allow_tracking = $this->theme_allows_tracking; } else { $allow_tracking = $this->get_is_tracking_allowed(); } if( ! $allow_tracking ) { return; }*/ $body = $this->get_data(); $body['status'] = 'Deactivated'; // Never translated $body['deactivated_date'] = time(); // Add deactivation form data if( false !== get_option( 'wisdom_deactivation_reason_' . $this->plugin_name ) ) { $body['deactivation_reason'] = get_option( 'wisdom_deactivation_reason_' . $this->plugin_name ); } if( false !== get_option( 'wisdom_deactivation_details_' . $this->plugin_name ) ) { $body['deactivation_details'] = get_option( 'wisdom_deactivation_details_' . $this->plugin_name ); } if( !empty($body) ){ $this->send_data( $body ); // Clear scheduled update wp_clear_scheduled_hook( 'put_do_weekly_action' ); } } /** * Is tracking allowed? * @since 1.0.0 */ public function get_is_tracking_allowed() { // First, check if the user has changed their mind and opted out of tracking /*if( $this->has_user_opted_out() ) { $this->set_is_tracking_allowed( false, $this->plugin_name ); return false; }*/ if( $this->what_am_i == 'theme' ) { $mod = get_theme_mod( 'wisdom-allow-tracking', 0 ); if( $mod ) { return true; } } else { // The wisdom_allow_tracking option is an array of plugins that are being tracked $allow_tracking = get_option( 'wisdom_allow_tracking' ); // If this plugin is in the array, then tracking is allowed if( isset( $allow_tracking[$this->plugin_name] ) ) { return true; } } return false; } /** * Set if tracking is allowed * Option is an array of all plugins with tracking permitted * More than one plugin may be using the tracker * @since 1.0.0 * @param $is_allowed Boolean true if tracking is allowed, false if not */ public function set_is_tracking_allowed( $is_allowed, $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } // The wisdom_allow_tracking option is an array of plugins that are being tracked $allow_tracking = get_option( 'wisdom_allow_tracking' ); // If the user has decided to opt out if( $this->has_user_opted_out() ) { if( $this->what_am_i == 'theme' ) { set_theme_mod( 'wisdom-allow-tracking', 0 ); } else { if( isset( $allow_tracking[$plugin] ) ) { unset( $allow_tracking[$plugin] ); } } } else if( $is_allowed || ! $this->require_optin ) { // If the user has agreed to allow tracking or if opt-in is not required if( $this->what_am_i == 'theme' ) { set_theme_mod( 'wisdom-allow-tracking', 1 ); } else { if( empty( $allow_tracking ) || ! is_array( $allow_tracking ) ) { // If nothing exists in the option yet, start a new array with the plugin name $allow_tracking = array( $plugin => $plugin ); } else { // Else add the plugin name to the array $allow_tracking[$plugin] = $plugin; } } } else { if( $this->what_am_i == 'theme' ) { set_theme_mod( 'wisdom-allow-tracking', 0 ); } else { if( isset( $allow_tracking[$plugin] ) ) { unset( $allow_tracking[$plugin] ); } } } update_option( 'wisdom_allow_tracking', $allow_tracking ); } /** * Has the user opted out of allowing tracking? * Note that themes are opt in / plugins are opt out * @since 1.1.0 * @return Boolean */ public function has_user_opted_out() { // Different opt-out methods for plugins and themes if( $this->what_am_i == 'theme' ) { // Look for the theme mod $mod = get_theme_mod( 'wisdom-allow-tracking', 0 ); if( false === $mod ) { // If the theme mod is not set, then return true - the user has opted out return true; } } else { // Iterate through the options that are being tracked looking for wisdom_opt_out setting if( ! empty( $this->options ) ) { foreach( $this->options as $option_name ) { // Check each option $options = get_option( $option_name ); // If we find the setting, return true if( ! empty( $options['wisdom_opt_out'] ) ) { return true; } } } } return false; } /** * Check if it's time to track * @since 1.1.1 */ public function get_is_time_to_track() { // Let's see if we're due to track this plugin yet $track_times = get_option( 'wisdom_last_track_time', array() ); if( ! isset( $track_times[$this->plugin_name] ) ) { // If we haven't set a time for this plugin yet, then we must track it return true; } else { // If the time is set, let's see if it's more than a day ago if( $track_times[$this->plugin_name] < strtotime( '-1 day' ) ) { return true; } } return false; } /** * Record the time we send tracking data * @since 1.1.1 */ public function set_track_time() { // We've tracked, so record the time $track_times = get_option( 'wisdom_last_track_time', array() ); // Set different times according to plugin, in case we are tracking multiple plugins $track_times[$this->plugin_name] = time(); update_option( 'wisdom_last_track_time', $track_times ); } /** * Set if we should block the opt-in notice for this plugin * Option is an array of all plugins that have received a response from the user * @since 1.0.0 */ public function update_block_notice( $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } $block_notice = get_option( 'pwaforwp_wisdom_block_notice' ); if( empty( $block_notice ) || ! is_array( $block_notice ) ) { // If nothing exists in the option yet, start a new array with the plugin name $block_notice = array( $plugin => $plugin ); } else { // Else add the plugin name to the array $block_notice[$plugin] = $plugin; } update_option( 'pwaforwp_wisdom_block_notice', $block_notice ); } /** * Can we collect the email address? * @since 1.0.0 */ public function get_can_collect_email() { // The wisdom_collect_email option is an array of plugins that are being tracked $collect_email = get_option( 'wisdom_collect_email' ); // If this plugin is in the array, then we can collect the email address if( isset( $collect_email[$this->plugin_name] ) ) { return true; } return false; } /** * Set if user has allowed us to collect their email address * Option is an array of all plugins with email collection permitted * More than one plugin may be using the tracker * @since 1.0.0 * @param $can_collect Boolean true if collection is allowed, false if not */ public function set_can_collect_email( $can_collect, $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } // The wisdom_collect_email option is an array of plugins that are being tracked $collect_email = get_option( 'wisdom_collect_email' ); // If the user has agreed to allow tracking or if opt-in is not required if( $can_collect ) { if( empty( $collect_email ) || ! is_array( $collect_email ) ) { // If nothing exists in the option yet, start a new array with the plugin name $collect_email = array( $plugin => $plugin ); } else { // Else add the plugin name to the array $collect_email[$plugin] = $plugin; } } else { if( isset( $collect_email[$plugin] ) ) { unset( $collect_email[$plugin] ); } } update_option( 'wisdom_collect_email', $collect_email ); } /** * Get the correct email address to use * @since 1.1.2 * @return Email address */ public function get_admin_email() { // The wisdom_collect_email option is an array of plugins that are being tracked $email = get_option( 'wisdom_admin_emails' ); // If this plugin is in the array, then we can collect the email address if( isset( $email[$this->plugin_name] ) ) { return $email[$this->plugin_name]; } return false; } /** * Set the correct email address to use * There might be more than one admin on the site * So we only use the first admin's email address * @param $email Email address to set * @param $plugin Plugin name to set email address for * @since 1.1.2 */ public function set_admin_email( $email=null, $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } // If no email address passed, try to get the current user's email if( empty( $email ) ) { // Have to check that current user object is available if( function_exists( 'wp_get_current_user' ) ) { $current_user = wp_get_current_user(); $email = $current_user->user_email; } } // The wisdom_admin_emails option is an array of admin email addresses $admin_emails = get_option( 'wisdom_admin_emails' ); if( empty( $admin_emails ) || ! is_array( $admin_emails ) ) { // If nothing exists in the option yet, start a new array with the plugin name $admin_emails = array( $plugin => sanitize_email( $email ) ); } else if( empty( $admin_emails[$plugin] ) ) { // Else add the email address to the array, if not already set $admin_emails[$plugin] = sanitize_email( $email ); } update_option( 'wisdom_admin_emails', $admin_emails ); } /** * Display the admin notice to users to allow them to opt in * * @since 1.0.0 */ public function optin_notice() { global $pagenow, $pwaforwp_globe_admin_notice; if($pwaforwp_globe_admin_notice!=false){ return; } if($pagenow!='admin.php' || !isset($_GET['page']) || (isset($_GET['page']) && $_GET['page']!='pwaforwp') ) { return false; } // Check for plugin args if( isset( $_GET['plugin'] ) && isset( $_GET['plugin_action'] ) ) { $plugin = sanitize_text_field( $_GET['plugin'] ); $action = sanitize_text_field( $_GET['plugin_action'] ); if( $action == 'yes' ) { $this->set_is_tracking_allowed( true, $plugin ); $this->do_tracking( true ); // Run this straightaway } else { $this->set_is_tracking_allowed( false, $plugin ); } $this->update_block_notice( $plugin ); } // Check whether to block the notice, e.g. because we're in a local environment // wisdom_block_notice works the same as wisdom_allow_tracking, an array of plugin names $block_notice = get_option( 'pwaforwp_wisdom_block_notice' ); if( isset( $block_notice[$this->plugin_name] ) ) { return; } if ( ! current_user_can( 'manage_options' ) ) { return; } // @credit EDD // Don't bother asking user to opt in if they're in local dev if ( stristr( network_site_url( '/' ), 'dev' ) !== false /*|| stristr( network_site_url( '/' ), 'localhost' ) !== false || stristr( network_site_url( '/' ), ':8888' ) !== false*/ ) { $this->update_block_notice(); } else { // Display the notice requesting permission to track // Retrieve current plugin information $plugin = $this->plugin_data(); $plugin_name = $plugin['Name']; // Args to add to query if user opts in to tracking $yes_args = array( 'plugin' => $this->plugin_name, 'plugin_action' => 'yes' ); // Decide how to request permission to collect email addresses if( $this->marketing == 1 ) { // Option 1 combines permissions to track and collect email $yes_args['marketing_optin'] = 'yes'; } else if( $this->marketing == 2 ) { // Option 2 enables a second notice that fires after the user opts in to tracking $yes_args['marketing'] = 'yes'; } $url_yes = add_query_arg( $yes_args ); $url_no = add_query_arg( array( 'plugin' => $this->plugin_name, 'plugin_action' => 'no' ) ); $pwaforwp_globe_admin_notice = true; // Decide on notice text if( $this->marketing != 1 ) { // Standard notice text $notice_text = sprintf( __( 'Become a super contributor by opting in to our anonymous %1$s data collection and to our updates. We guarantee no sensitive data is collected.'), $this->what_am_i ); } else { // If we have option 1 for marketing, we include reference to sending product information here $notice_text = sprintf( __( 'Thank you for installing our %1$s. We\'d like your permission to track its usage on your site and subscribe you to our newsletter. We won\'t record any sensitive data, only information regarding the WordPress environment and %1$s settings, which we will use to help us make improvements to the %1$s. Tracking is completely optional.', 'singularity' ), $this->what_am_i ); } // And we allow you to filter the text anyway $notice_text = apply_filters( 'wisdom_notice_text_' . esc_attr( $this->plugin_name ), $notice_text ); ?>

Love using PWA for WP & AMP?'; ?>

  

set_can_collect_email( sanitize_text_field( $_GET['marketing_optin'] ), $this->plugin_name ); // Do tracking $this->do_tracking( true ); } else if( isset( $_GET['marketing'] ) && $_GET['marketing']=='yes' ) { // Display the notice requesting permission to collect email address // Retrieve current plugin information $plugin = $this->plugin_data(); $plugin_name = $plugin['Name']; $url_yes = add_query_arg( array( 'plugin' => $this->plugin_name, 'marketing_optin' => 'yes' ) ); $url_no = add_query_arg( array( 'plugin' => $this->plugin_name, 'marketing_optin' => 'no' ) ); $pwaforwp_globe_admin_notice = true; $marketing_text = sprintf( __( 'Thank you for opting in to tracking. Would you like to receive occasional news about this %s, including details of new features and special offers?', 'singularity' ), $this->what_am_i ); $marketing_text = apply_filters( 'wisdom_marketing_text_' . esc_attr( $this->plugin_name ), $marketing_text ); ?>

' . esc_html( $plugin_name ) . ''; ?>

get_is_tracking_allowed() ) { return $links; }*/ if( isset( $links['deactivate'] ) && $this->include_goodbye_form ) { $deactivation_link = $links['deactivate']; // Insert an onClick action to allow form before deactivating $deactivation_link = str_replace( 'form_default_text(); return apply_filters( 'wisdom_form_text_' . esc_attr( $this->plugin_name ), $form ); } /** * Form text strings * These can be filtered * @since 1.0.0 */ public function goodbye_ajax() { // Get our strings for the form $form = $this->form_filterable_text(); if( ! isset( $form['heading'] ) || ! isset( $form['body'] ) || ! isset( $form['options'] ) || ! is_array( $form['options'] ) || ! isset( $form['details'] ) ) { // If the form hasn't been filtered correctly, we revert to the default form $form = $this->form_default_text(); } // Build the HTML to go in the form $html = '
' . esc_html( $form['heading'] ) . '
'; $html .= '

' . esc_html( $form['body'] ) . '

'; if( is_array( $form['options'] ) ) { $html .= '

'; foreach( $form['options'] as $option ) { $html .= '
'; } $html .= '

'; $html .= '
'; } $html .= '
'; $html .= '

' . __( 'Submitting form', 'singularity' ) . '

'; ?>
plugin_name, $values ); } if( isset( $_POST['details'] ) ) { $details = sanitize_text_field( $_POST['details'] ); update_option( 'wisdom_deactivation_details_' . $this->plugin_name, $details ); } $this->do_tracking(); // Run this straightaway echo 'success'; wp_die(); } } } PK!̌&QQlanguages/pwa-for-wp-en.ponu[msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: 2020-09-14 11:37+0530\n" "PO-Revision-Date: 2020-09-14 15:40+0530\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.4.1\n" "X-Poedit-Basepath: ..\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-KeywordsList: esc_attr__;esc_html__;e__;__\n" "Last-Translator: \n" "Language: en\n" "X-Poedit-SearchPath-0: .\n" #: 3rd-party/wp-pwa.php:77 msgid "No service workers registered for the requested scope." msgstr "" #: 3rd-party/wp-pwa.php:78 msgid "Service Worker Installation" msgstr "" #: 3rd-party/wp-pwa.php:121 #, php-format msgid "Please update to PWA v0.2. Expected argument to be %s." msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:259 msgid "" "We can't detect any product information. This is most probably because you " "have not included the code snippet." msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:688 #, php-format msgid "" "Become a super contributor by opting in to our anonymous %1$s data " "collection and to our updates. We guarantee no sensitive data is collected." msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:695 #, php-format msgid "" "Thank you for installing our %1$s. We'd like your permission to track its " "usage on your site and subscribe you to our newsletter. We won't record any " "sensitive data, only information regarding the WordPress environment and " "%1$s settings, which we will use to help us make improvements to the %1$s. " "Tracking is completely optional." msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:704 msgid "Learn more." msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:743 #, php-format msgid "" "Thank you for opting in to tracking. Would you like to receive occasional " "news about this %s, including details of new features and special offers?" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:784 msgid "Sorry to see you go" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:785 msgid "" "Before you deactivate the plugin, would you quickly give us your reason for " "doing so?" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:787 msgid "Set up is too difficult" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:788 msgid "Lack of documentation" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:789 msgid "Not the features I wanted" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:790 msgid "Found a better plugin" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:791 msgid "Installed by mistake" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:792 msgid "Only required temporarily" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:793 msgid "Didn't work" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:795 msgid "Details (optional)" msgstr "" #: admin/class-pwaforwp-plugin-usage-tracker.php:835 msgid "Submitting form" msgstr "" #: admin/newsletter.php:35 pwa-for-wp.php:193 msgid "No Thanks" msgstr "" #: admin/settings.php:7 admin/settings.php:16 admin/settings.php:51 msgid "Progressive Web Apps For WP" msgstr "" #: admin/settings.php:8 msgid "PWA" msgstr "" #: admin/settings.php:17 pwa-for-wp.php:67 msgid "Settings" msgstr "" #: admin/settings.php:25 msgid "Upgrade To Premium" msgstr "" #: admin/settings.php:55 msgid "Dashboard" msgstr "" #: admin/settings.php:57 msgid "Setup" msgstr "" #: admin/settings.php:59 msgid "Features" msgstr "" #: admin/settings.php:61 admin/settings.php:115 msgid "Tools" msgstr "" #: admin/settings.php:63 msgid "Advance" msgstr "" #: admin/settings.php:65 msgid "Premium Features" msgstr "" #: admin/settings.php:67 msgid "Help" msgstr "" #: admin/settings.php:85 msgid "General" msgstr "" #: admin/settings.php:86 msgid "Design" msgstr "" #: admin/settings.php:116 msgid "Compatibility" msgstr "" #: admin/settings.php:146 msgid "Documentation" msgstr "" #: admin/settings.php:146 msgid "View Setup Documentation" msgstr "" #: admin/settings.php:149 msgid "Ask for Technical Support" msgstr "" #: admin/settings.php:150 msgid "We are always available to help you with anything" msgstr "" #: admin/settings.php:152 msgid "Are you existing Premium Customer?" msgstr "" #: admin/settings.php:155 msgid "Yes" msgstr "" #: admin/settings.php:156 msgid "No" msgstr "" #: admin/settings.php:159 admin/settings.php:1294 msgid "Message" msgstr "" #: admin/settings.php:162 msgid "Message sent successfully, Please wait we will get back to you shortly" msgstr "" #: admin/settings.php:163 msgid "Message not sent. please check your network connection" msgstr "" #: admin/settings.php:165 msgid "Send Message" msgstr "" #: admin/settings.php:180 msgid "Save Settings" msgstr "" #: admin/settings.php:188 msgid "Upgrade to Pro!" msgstr "" #: admin/settings.php:190 msgid "Premium features" msgstr "" #: admin/settings.php:191 msgid "Dedicated PWA Support" msgstr "" #: admin/settings.php:192 msgid "Active Development" msgstr "" #: admin/settings.php:194 msgid "UPGRADE NOW" msgstr "" #: admin/settings.php:215 msgid "Installation Status" msgstr "" #: admin/settings.php:216 msgid "PWA status verification" msgstr "" #: admin/settings.php:216 admin/settings.php:477 admin/settings.php:827 #: admin/settings.php:1673 admin/settings.php:1823 admin/settings.php:2381 msgid "Learn more" msgstr "" #: admin/settings.php:234 msgid "App Name" msgstr "" #: admin/settings.php:243 msgid "App Short Name" msgstr "" #: admin/settings.php:252 msgid "App Description" msgstr "" #: admin/settings.php:261 msgid "App Icon" msgstr "" #: admin/settings.php:270 msgid "App Splash Screen Icon" msgstr "" #: admin/settings.php:279 msgid "Offline Page" msgstr "" #: admin/settings.php:288 msgid "404 Page" msgstr "" #: admin/settings.php:297 msgid "Start Page" msgstr "" #: admin/settings.php:306 msgid "Orientation" msgstr "" #: admin/settings.php:315 msgid "Display" msgstr "" #: admin/settings.php:325 msgid "Background Color" msgstr "" #: admin/settings.php:333 msgid "Theme Color" msgstr "" #: admin/settings.php:340 admin/settings.php:351 admin/settings.php:381 #: admin/settings.php:405 admin/settings.php:448 admin/settings.php:485 #: admin/settings.php:494 admin/settings.php:504 admin/settings.php:514 msgid " " msgstr "" #: admin/settings.php:344 admin/settings.php:1029 msgid "Reset" msgstr "" #: admin/settings.php:354 msgid "CDN Compatibility" msgstr "" #: admin/settings.php:361 msgid "Offline Google Analytics" msgstr "" #: admin/settings.php:368 msgid "Force Update Service Worker" msgstr "" #: admin/settings.php:375 msgid "Add To Home On Element Click" msgstr "" #: admin/settings.php:384 msgid "Custom Add To Home Banner" msgstr "" #: admin/settings.php:400 msgid "Cache External Links" msgstr "" #: admin/settings.php:408 msgid "UTM Tracking" msgstr "" #: admin/settings.php:415 msgid "Urls Exclude From Cache List" msgstr "" #: admin/settings.php:422 msgid "Cached time" msgstr "" #: admin/settings.php:429 msgid "Remove default banner" msgstr "" #: admin/settings.php:436 msgid "PWA alternative method" msgstr "" #: admin/settings.php:443 msgid "Share Anonymous data for improving the UX" msgstr "" #: admin/settings.php:451 msgid "Loader" msgstr "" #: admin/settings.php:458 msgid "Loader color" msgstr "" #: admin/settings.php:465 msgid "Loader enable on" msgstr "" #: admin/settings.php:475 msgid "Caching Strategies" msgstr "" #: admin/settings.php:488 msgid "OneSignal" msgstr "" #: admin/settings.php:538 admin/settings.php:1729 msgid "Status" msgstr "" #: admin/settings.php:538 msgid "Inactive" msgstr "" #: admin/settings.php:540 msgid "Download" msgstr "" #: admin/settings.php:599 msgid "Data Analytics for PWA installation growth and traffic analysis" msgstr "" #: admin/settings.php:679 msgid "Add Ons" msgstr "" #: admin/settings.php:715 msgid "Default caching strategy" msgstr "" #: admin/settings.php:735 msgid "Caching strategy for CSS and JS Files" msgstr "" #: admin/settings.php:748 msgid "Caching strategy for images" msgstr "" #: admin/settings.php:761 msgid "Caching strategy for fonts" msgstr "" #: admin/settings.php:780 msgid "Set max cache time for Html Default:" msgstr "" #: admin/settings.php:780 admin/settings.php:782 msgid "in seconds;" msgstr "" #: admin/settings.php:780 admin/settings.php:782 msgid "You need to enter time in seconds" msgstr "" #: admin/settings.php:782 msgid "Set max cache time for JS, CSS, JSON Default:" msgstr "" #: admin/settings.php:792 msgid "Enable(check) it when you don't want to load default PWA Banner" msgstr "" #: admin/settings.php:801 msgid "" "Enable(check) it when PWA with OneSignal or root permission functionality " "not working because of Cache" msgstr "" #: admin/settings.php:827 msgid "We guarantee no sensitive data is collected" msgstr "" #: admin/settings.php:836 msgid "Note: Put in comma separated, do not add enter in urls" msgstr "" #: admin/settings.php:837 msgid "Put the list of urls which you do not want to cache by service worker" msgstr "" #: admin/settings.php:855 msgid "Automatic" msgstr "" #: admin/settings.php:857 admin/settings.php:901 msgid "For details click here" msgstr "" #: admin/settings.php:870 msgid "Post" msgstr "" #: admin/settings.php:876 msgid "Page" msgstr "" #: admin/settings.php:882 msgid "Custom Post" msgstr "" #: admin/settings.php:893 msgid "Enter Post Count" msgstr "" #: admin/settings.php:899 msgid "Manual" msgstr "" #: admin/settings.php:909 msgid "Enter Urls To Be Cached" msgstr "" #: admin/settings.php:912 msgid "Note: Put in comma separated" msgstr "" #: admin/settings.php:913 msgid "Put the list of urls which you want to pre cache by service worker" msgstr "" #: admin/settings.php:957 msgid "Enable UTM Tracking" msgstr "" #: admin/settings.php:958 msgid "To identify users are coming from your App" msgstr "" #: admin/settings.php:961 msgid "UTM Source" msgstr "" #: admin/settings.php:965 msgid "UTM Medium" msgstr "" #: admin/settings.php:969 msgid "UTM Campaign" msgstr "" #: admin/settings.php:973 msgid "UTM Term" msgstr "" #: admin/settings.php:977 msgid "UTM Content" msgstr "" #: admin/settings.php:981 msgid "UTM Non-amp Url" msgstr "" #: admin/settings.php:985 msgid "UTM amp Url" msgstr "" #: admin/settings.php:999 msgid "" "Offline analytics is a module that will use background sync to ensure that " "requests to Google Analytics are made regardless of the current network " "condition" msgstr "" #: admin/settings.php:1013 msgid "" "Change the version. It will automatically update the service worker for all " "the users" msgstr "" #: admin/settings.php:1022 msgid "This helps you remove conflict with the CDN" msgstr "" #: admin/settings.php:1041 msgid "This helps show loading icon on page or post load" msgstr "" #: admin/settings.php:1048 msgid "Change the icon color of loader" msgstr "" #: admin/settings.php:1059 msgid "Desktop" msgstr "" #: admin/settings.php:1060 msgid "Mobile" msgstr "" #: admin/settings.php:1069 msgid "Caches external link's resource which are in html" msgstr "" #: admin/settings.php:1121 msgid "Push notification integration" msgstr "" #: admin/settings.php:1134 msgid "FCM Server API Key" msgstr "" #: admin/settings.php:1138 msgid "Config" msgstr "" #: admin/settings.php:1141 msgid "Note: Create a new firebase project on " msgstr "" #: admin/settings.php:1141 msgid "firebase" msgstr "" #: admin/settings.php:1141 msgid "" "console, its completly free by google with some limitations. After creating " "the project you will find FCM Key and json in project details section." msgstr "" #: admin/settings.php:1142 msgid "" "Note: Firebase push notification does not support on AMP. It will support in " "future" msgstr "" #: admin/settings.php:1146 msgid "FCM Push Notification Icon" msgstr "" #: admin/settings.php:1150 admin/settings.php:1366 admin/settings.php:1387 #: admin/settings.php:1439 msgid "Choose Icon" msgstr "" #: admin/settings.php:1152 msgid "Change Firebase push notification icon. Default: PWA icon" msgstr "" #: admin/settings.php:1162 msgid "Go to setup" msgstr "" #: admin/settings.php:1164 msgid "Push notifications has it's separate options view" msgstr "" #: admin/settings.php:1164 msgid " View Settings" msgstr "" #: admin/settings.php:1189 msgid "" "This feature requires a Free plugin which integrates with a Free Push " "Notification service" msgstr "" #: admin/settings.php:1194 msgid "Install Plugin" msgstr "" #: admin/settings.php:1205 msgid "Send Notification On" msgstr "" #: admin/settings.php:1209 msgid "Add New Post" msgstr "" #: admin/settings.php:1214 admin/settings.php:1216 admin/settings.php:1227 #: admin/settings.php:1229 admin/settings.php:1240 admin/settings.php:1242 #: admin/settings.php:1253 admin/settings.php:1255 msgid "Notification Title" msgstr "" #: admin/settings.php:1223 msgid "Update Post" msgstr "" #: admin/settings.php:1235 msgid "Add New Page" msgstr "" #: admin/settings.php:1249 msgid "Update Page" msgstr "" #: admin/settings.php:1264 msgid "Send Manual Notification" msgstr "" #: admin/settings.php:1269 admin/settings.php:1316 msgid "Title" msgstr "" #: admin/settings.php:1277 msgid "Redirection Url Onclick of notification" msgstr "" #: admin/settings.php:1286 msgid "Image Url" msgstr "" #: admin/settings.php:1295 msgid "Send" msgstr "" #: admin/settings.php:1314 msgid "Custom Add To Homescreen Customization" msgstr "" #: admin/settings.php:1317 msgid "Button Text" msgstr "" #: admin/settings.php:1318 msgid "Banner Background Color" msgstr "" #: admin/settings.php:1319 msgid "Banner Title Color" msgstr "" #: admin/settings.php:1320 msgid "Button Text Color" msgstr "" #: admin/settings.php:1321 msgid "Button Background Color" msgstr "" #: admin/settings.php:1371 msgid "" "Icon of your application when installed on the phone. Must be a PNG image " "exactly" msgstr "" #: admin/settings.php:1372 msgid "192x192 in size." msgstr "" #: admin/settings.php:1373 msgid "- For Apple mobile exact sizes is necessary" msgstr "" #: admin/settings.php:1392 msgid "" "Icon displayed on the splash screen of your APPLICATION on supported " "devices. Must be a PNG image size exactly" msgstr "" #: admin/settings.php:1393 msgid "512x512 in size." msgstr "" #: admin/settings.php:1398 msgid "Setup Splash Screen for iOS" msgstr "" #: admin/settings.php:1401 msgid "iOS Splash Screen Method" msgstr "" #: admin/settings.php:1418 msgid "Select image (Only PNG)" msgstr "" #: admin/settings.php:1419 msgid "Background color" msgstr "" #: admin/settings.php:1467 #, php-format msgid "" "Offline page is displayed, when the device is offline and the requested page " "is not already cached. Current offline page is %s" msgstr "" #: admin/settings.php:1490 #, php-format msgid "" "404 page is displayed and the requested page is not found. Current 404 page " "is %s" msgstr "" #: admin/settings.php:1514 #, php-format msgid "From where you want to launch PWA APP. Current start page is %s" msgstr "" #: admin/settings.php:1529 msgid "Follow Device Orientation" msgstr "" #: admin/settings.php:1532 msgid "Portrait" msgstr "" #: admin/settings.php:1535 msgid "Landscape" msgstr "" #: admin/settings.php:1538 msgid "Auto" msgstr "" #: admin/settings.php:1541 msgid "Landscape-primary" msgstr "" #: admin/settings.php:1544 msgid "Landscape-secondary" msgstr "" #: admin/settings.php:1547 msgid "Portrait-primary" msgstr "" #: admin/settings.php:1550 msgid "Portrait-secondary" msgstr "" #: admin/settings.php:1556 admin/settings.php:1586 msgid "" "Orientation of application on devices. When set to Follow Device Orientation " "your application will rotate as the device is rotated." msgstr "" #: admin/settings.php:1571 msgid "Device display" msgstr "" #: admin/settings.php:1574 msgid "Fullscreen" msgstr "" #: admin/settings.php:1577 msgid "Standalone" msgstr "" #: admin/settings.php:1580 msgid "Minimal-ui" msgstr "" #: admin/settings.php:1604 msgid "Show custom responsive add to home banner popup" msgstr "" #: admin/settings.php:1608 admin/settings.php:1612 msgid "Enable On Desktop" msgstr "" #: admin/settings.php:1609 admin/settings.php:1613 msgid "" "Note: By default pop up will appear on mobile device, to appear on desktop " "check enable on desktop" msgstr "" #: admin/settings.php:1621 msgid "By default pop up will appear on scroll" msgstr "" #: admin/settings.php:1633 msgid "jQuery selector (.element) or (#element)" msgstr "" #: admin/settings.php:1634 msgid "Note: It is currently available in non AMP" msgstr "" #: admin/settings.php:1635 msgid "Note: In IOS devices this functionality will not work." msgstr "" #: admin/settings.php:1724 msgid "WordPress (Non-AMP)" msgstr "" #: admin/settings.php:1725 msgid "AMP" msgstr "" #: admin/settings.php:1737 msgid "Enable / Disable" msgstr "" #: admin/settings.php:1754 msgid "Manifest" msgstr "" #: admin/settings.php:1760 admin/settings.php:1771 admin/settings.php:1790 #: admin/settings.php:1803 msgid "Click here to setup" msgstr "" #: admin/settings.php:1761 admin/settings.php:1772 admin/settings.php:1791 #: admin/settings.php:1804 msgid "Change the permission or downlad the file" msgstr "" #: admin/settings.php:1761 admin/settings.php:1772 admin/settings.php:1791 #: admin/settings.php:1804 msgid "Instruction" msgstr "" #: admin/settings.php:1784 msgid "Service Worker" msgstr "" #: admin/settings.php:1816 msgid "HTTPS" msgstr "" #: admin/settings.php:1823 msgid "This site is not configure with https" msgstr "" #: admin/settings.php:1948 msgid "Application Icon" msgstr "" #: admin/settings.php:1949 msgid "Splash Screen Icon" msgstr "" #: admin/settings.php:1950 msgid "Select Icon" msgstr "" #: admin/settings.php:1951 service-work/class-init.php:149 msgid "Check permission or download from manual" msgstr "" #: admin/settings.php:2071 msgid "Deactivate" msgstr "" #: admin/settings.php:2075 msgid "Activate" msgstr "" #: admin/settings.php:2084 msgid "Enter addon license key to activate updates & support." msgstr "" #: admin/settings.php:2148 admin/settings.php:2180 msgid "An error occurred, please try again." msgstr "" #: admin/settings.php:2159 #, php-format msgid "Your license key expired on %s." msgstr "" #: admin/settings.php:2164 msgid "Your license key has been disabled." msgstr "" #: admin/settings.php:2167 msgid "Invalid license." msgstr "" #: admin/settings.php:2171 msgid "Your license is not active for this URL." msgstr "" #: admin/settings.php:2174 msgid "This appears to be an invalid license key." msgstr "" #: admin/settings.php:2177 msgid "Your license key has reached its activation limit." msgstr "" #: admin/settings.php:2227 msgid "Loader icon selector" msgstr "" #: admin/settings.php:2235 msgid "This feature requires" msgstr "" #: admin/settings.php:2237 msgid "Loading Icon Library for PWA extension" msgstr "" #: admin/settings.php:2453 msgid "Save Changes" msgstr "" #: admin/settings.php:2456 msgid "Close" msgstr "" #: pwa-for-wp.php:154 msgid "Update your pwa pre caching url list by clicking on button. " msgstr "" #: pwa-for-wp.php:154 msgid "Click Here To Update" msgstr "" #: pwa-for-wp.php:163 msgid "Thank you for using" msgstr "" #: pwa-for-wp.php:163 msgid " PWA for WP plugin! " msgstr "" #: pwa-for-wp.php:188 msgid "" "You have been using the PWA For WP plugin for some time now, do you like " "it?, If so," msgstr "" #: pwa-for-wp.php:190 msgid "please write us a review" msgstr "" #: pwa-for-wp.php:192 msgid "Remind Me Later" msgstr "" #: pwa-for-wp.php:207 msgid "Support Forum" msgstr "" #: pwa-for-wp.php:208 msgid "Hire Us" msgstr "" #: pwa-for-wp.php:209 msgid "Rate" msgstr "" #: service-work/class-init.php:147 msgid "File has been created" msgstr "" #: service-work/class-push-notification.php:38 msgid "Notification not sent. Something went wrong" msgstr "" #: service-work/class-push-notification.php:59 msgid "New Post" msgstr "" #: service-work/class-push-notification.php:70 #: service-work/class-push-notification.php:91 #: service-work/class-push-notification.php:103 msgid "Post Updated" msgstr "" #: service-work/class-push-notification.php:191 msgid "Token Saved Successfully" msgstr "" #: service-work/class-push-notification.php:193 msgid "Token Not Saved" msgstr "" #: service-work/class-service-worker.php:340 #: service-work/class-service-worker.php:341 msgid "Add" msgstr "" #: service-work/class-service-worker.php:341 msgid "to your Homescreen!" msgstr "" #: service-work/class-service-worker.php:540 msgid "Sorry, you are not allowed to edit the manifest." msgstr "" PK!h11languages/pwa-for-wp.potnu[#, fuzzy msgid "" msgstr "" "Project-Id-Version: PWA for WP\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-12-03 07:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: \n" "Language: \n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Loco https://localise.biz/\n" "X-Loco-Version: 2.2.0; wp-4.9.8" #: pwa-for-wp.php:143 msgid " PWA for WP plugin! " msgstr "" #: admin/newsletter.php:36 msgid "" "\">\n" " \n" " \n" " \n" "
\n" "
\n" "
\n" "
\n" "