(()=>{var e={730(e,t,n){"use strict";var r;!function(){function i(e,t,n){var r,i,o,a,p,w,v,P,y,g=0,m=[],A=0,b=!1,W=[],I=[],S=!1,M=!1,C=-1;if(r=(n=n||{}).encoding||"UTF8",(y=n.numRounds||1)!==parseInt(y,10)||1>y)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)p=512,w=F,v=H,a=160,P=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(w=function(t,n){return z(t,n,e)},v=function(t,n,r,i){var o,a;if("SHA-224"===e||"SHA-256"===e)o=15+(n+65>>>9<<4),a=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");o=31+(n+129>>>10<<5),a=32}for(;t.length<=o;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[o]=4294967295&n,t[o-1]=n/4294967296|0,r=t.length,n=0;nt;t+=1)n[t]=e[t].slice();return n},C=1,"SHA3-224"===e)p=1152,a=224;else if("SHA3-256"===e)p=1088,a=256;else if("SHA3-384"===e)p=832,a=384;else if("SHA3-512"===e)p=576,a=512;else if("SHAKE128"===e)p=1344,a=-1,O=31,M=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");p=1088,a=-1,O=31,M=!0}v=function(e,t,n,r,i){var o,a=O,s=[],u=(n=p)>>>5,c=0,l=t>>>5;for(o=0;o=n;o+=u)r=B(e.slice(o,o+u),r),t-=n;for(e=e.slice(o),t%=n;e.length>>3)>>2]^=a<=i));)s.push(e.a),0==64*(c+=1)%n&&B(null,r);return s}}o=h(t,r,C),i=R(e),this.setHMACKey=function(t,n,o){var s;if(!0===b)throw Error("HMAC key already set");if(!0===S)throw Error("Cannot set HMAC key after calling update");if(!0===M)throw Error("SHAKE is not supported for HMAC");if(t=(n=h(n,r=(o||{}).encoding||"UTF8",C)(t)).binLen,n=n.value,o=(s=p>>>3)/4-1,st/8){for(;n.length<=o;)n.push(0);n[o]&=4294967040}for(t=0;t<=o;t+=1)W[t]=909522486^n[t],I[t]=1549556828^n[t];i=w(W,i),g=p,b=!0},this.update=function(e){var t,n,r,a=0,s=p>>>5;for(e=(t=o(e,m,A)).binLen,n=t.value,t=e>>>5,r=0;r>>5),A=e%p,S=!0},this.getHash=function(t,n){var r,o,h,p;if(!0===b)throw Error("Cannot call getHash after setting HMAC key");if(h=f(n),!0===M){if(-1===h.shakeLen)throw Error("shakeLen must be specified in options");a=h.shakeLen}switch(t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return u(e,a,C,h)};break;case"BYTES":r=function(e){return c(e,a,C)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return d(e,a,C)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(p=v(m.slice(),A,g,P(i),a),o=1;o>>24-a%32),p=v(p,a,0,R(e),a);return r(p)},this.getHMAC=function(t,n){var r,o,h,y;if(!1===b)throw Error("Cannot call getHMAC without first setting HMAC key");switch(h=f(n),t){case"HEX":r=function(e){return s(e,a,C,h)};break;case"B64":r=function(e){return u(e,a,C,h)};break;case"BYTES":r=function(e){return c(e,a,C)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return l(e,a,C)};break;case"UINT8ARRAY":try{r=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return d(e,a,C)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return o=v(m.slice(),A,g,P(i),a),y=w(I,R(e)),r(y=v(o,a,p,y,a))}}function o(e,t){this.a=e,this.b=t}function a(e,t,n,r){var i,o,a,s,u;for(t=t||[0],o=(n=n||0)>>>3,u=-1===r?3:0,i=0;i>>2,t.length<=a&&t.push(0),t[a]|=e[i]<<8*(u+s%4*r);return{value:t,binLen:8*e.length+n}}function s(e,t,n,r){var i,o,a,s="";for(t/=8,a=-1===n?3:0,i=0;i>>2]>>>8*(a+i%4*n),s+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?s.toUpperCase():s}function u(e,t,n,r){var i,o,a,s,u="",c=t/8;for(s=-1===n?3:0,i=0;i>>2]:0,a=i+2>>2]:0,a=(e[i>>>2]>>>8*(s+i%4*n)&255)<<16|(o>>>8*(s+(i+1)%4*n)&255)<<8|a>>>8*(s+(i+2)%4*n)&255,o=0;4>o;o+=1)u+=8*i+6*o<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):r.b64Pad;return u}function c(e,t,n){var r,i,o,a="";for(t/=8,o=-1===n?3:0,r=0;r>>2]>>>8*(o+r%4*n)&255,a+=String.fromCharCode(i);return a}function l(e,t,n){t/=8;var r,i,o,a=new ArrayBuffer(t);for(o=new Uint8Array(a),i=-1===n?3:0,r=0;r>>2]>>>8*(i+r%4*n)&255;return a}function d(e,t,n){t/=8;var r,i,o=new Uint8Array(t);for(i=-1===n?3:0,r=0;r>>2]>>>8*(i+r%4*n)&255;return o}function f(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty("shakeLen")){if(0!=e.shakeLen%8)throw Error("shakeLen must be a multiple of 8");t.shakeLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function h(e,t,n){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":e=function(e,t,r){var i,o,a,s,u,c,l=e.length;if(0!=l%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],u=(r=r||0)>>>3,c=-1===n?3:0,i=0;i>>1)+u)>>>2;t.length<=a;)t.push(0);t[a]|=o<<8*(c+s%4*n)}return{value:t,binLen:4*l+r}};break;case"TEXT":e=function(e,r,i){var o,a,s,u,c,l,d,f,h=0;if(r=r||[0],c=(i=i||0)>>>3,"UTF8"===t)for(f=-1===n?3:0,s=0;s(o=e.charCodeAt(s))?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u>>2;r.length<=l;)r.push(0);r[l]|=a[u]<<8*(f+d%4*n),h+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(f=-1===n?2:0,a="UTF16LE"===t&&1!==n||"UTF16LE"!==t&&1===n,s=0;s>>8),l=(d=h+c)>>>2;r.length<=l;)r.push(0);r[l]|=o<<8*(f+d%4*n),h+=2}return{value:r,binLen:8*h+i}};break;case"B64":e=function(e,t,r){var i,o,a,s,u,c,l,d,f=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=e.indexOf("="),e=e.replace(/\=/g,""),-1!==o&&o{"Store"===t.id?window.Store=Object.assign({},window.Store,e):window.Store[t.id]=e})};for(t.s();!(e=t.n()).done;)n()}catch(e){t.e(e)}finally{t.f()}})),void 0===window.WAPI&&(window.WAPI={lastRead:{}},window.WAPI.interfaceMute=function(e){return{attributes:e.attributes,expiration:e.expiration,id:e.id,isMuted:e.isMuted,isState:e.isState,promises:e.promises,stale:e.stale}},window.WAPI.setProfilePic=function(e,t){return Be.apply(this,arguments)},window.WAPI.getSessionTokenBrowser=function(){return Ve.apply(this,arguments)},window.WAPI.scope=Re,window.WAPI.getchatId=function(e){return Fe.apply(this,arguments)},window.WAPI.sendExist=function(e){return He.apply(this,arguments)},window.WAPI.pinChat=function(e){return Ge.apply(this,arguments)},window.WAPI.setTemporaryMessages=function(e,t){return ft.apply(this,arguments)},window.WAPI.setTheme=function(e){return je.apply(this,arguments)},window.WAPI.getTheme=function(){return ke.apply(this,arguments)},window.WAPI._serializeRawObj=e=>e&&e.toJSON?e.toJSON():{},window.WAPI._serializeChatObj=e=>null==e?null:Object.assign(window.WAPI._serializeRawObj(e),{kind:e.kind,isBroadcast:e.isBroadcast,isGroup:e.isGroup,isUser:e.isUser,contact:e.contact?window.WAPI._serializeContactObj(e.contact):null,groupMetadata:e.groupMetadata?window.WAPI._serializeRawObj(e.groupMetadata):null,presence:e.presence?window.WAPI._serializeRawObj(e.presence):null,msgs:null}),window.WAPI._serializeContactObj=e=>{if(null==e)return null;var t=null;if(!e.profilePicThumb&&e.id&&WPP.whatsapp.ProfilePicThumbStore){var n=WPP.whatsapp.ProfilePicThumbStore.get(e.id);t=n?WAPI._serializeProfilePicThumb(n):{}}return Object.assign(window.WAPI._serializeRawObj(e),{formattedName:e.formattedName,isHighLevelVerified:e.isHighLevelVerified,isMe:e.isMe,isMyContact:e.isMyContact,isPSA:e.isPSA,isUser:e.isUser,isVerified:e.isVerified,isWAContact:e.isWAContact,profilePicThumbObj:t,statusMute:e.statusMute,msgs:null})},window.WAPI._serializeMessageObj=e=>{var t,n,r,i,o,a,s;return null==e?null:(e.quotedMsg&&e.quotedMsgObj&&e.quotedMsgObj(),Object.assign(window.WAPI._serializeRawObj(e),{id:e.id._serialized,from:e.from._serialized,quotedParticipant:null==e||null===(t=e.quotedParticipant)||void 0===t?void 0:t._serialized,author:null==e||null===(n=e.author)||void 0===n?void 0:n._serialized,chatId:(null==e||null===(r=e.id)||void 0===r?void 0:r.remote)||(null==e||null===(i=e.chatId)||void 0===i?void 0:i._serialized),to:null==e||null===(o=e.to)||void 0===o?void 0:o._serialized,fromMe:null==e||null===(a=e.id)||void 0===a?void 0:a.fromMe,sender:e.senderObj?WAPI._serializeContactObj(e.senderObj):null,timestamp:e.t,content:e.body,isGroupMsg:e.isGroupMsg,isLink:e.isLink,isMMS:e.isMMS,isMedia:e.isMedia,isNotification:e.isNotification,isPSA:e.isPSA,type:e.type,quotedMsgId:null==e||null===(s=e._quotedMsgObj)||void 0===s||null===(s=s.id)||void 0===s?void 0:s._serialized,mediaData:window.WAPI._serializeRawObj(e.mediaData)}))},window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI._serializeProfilePicThumb=e=>null==e?null:Object.assign({},{eurl:e.eurl,id:e.id,img:e.img,imgFull:e.imgFull,raw:e.raw,tag:e.tag}),window.WAPI._profilePicfunc=At,window.WAPI.sendChatstate=function(e,t){return re.apply(this,arguments)},window.WAPI.sendMessageWithThumb=function(e,t,n,r,i,o){var a=WAPI.getChat(i);if(void 0===a)return void 0!==o&&o(!1),!1;var s={canonicalUrl:t,description:r,matchedText:t,title:n,thumbnail:e};return a.sendMessage(t,{linkPreview:s,mentionedJidList:[],quotedMsg:null,quotedMsgAdminGroupJid:null}),void 0!==o&&o(!0),!0},window.WAPI.processMessageObj=function(e,t,n){return e.isNotification?n?WAPI._serializeMessageObj(e):void 0:!1===e.id.fromMe||t?WAPI._serializeMessageObj(e):void 0},window.WAPI.sendMessageWithTags=function(e,t){return me.apply(this,arguments)},window.WAPI.sendMessage=function(e,t){return he.apply(this,arguments)},window.WAPI.sendMessage2=function(e,t,n){var r=WAPI.getChat(e);if(void 0!==r)try{return void 0!==n?r.sendMessage(t).then(function(){n(!0)}):r.sendMessage(t),!0}catch(e){return void 0!==n&&n(!1),!1}return void 0!==n&&n(!1),!1},window.WAPI.sendImage=function(e,t,n,r,i,o){return oe(e,t,n,r,"sendImage",i,o)},window.WAPI.sendPtt=function(e,t,n,r,i){return ue.apply(this,arguments)},window.WAPI.sendFile=oe,window.WAPI.setMyName=function(e){return Ie.apply(this,arguments)},window.WAPI.sendVideoAsGif=function(e,t,n,r,i){return be.apply(this,arguments)},window.WAPI.processFiles=ee,window.WAPI.sendImageWithProduct=function(e,t,n,r,i,o){WPP.whatsapp.CatalogStore.findCarouselCatalog(r).then(r=>{if(r&&r[0]){var a=r[0].productCollection.get(i),s={productMsgOptions:{businessOwnerJid:a.catalogWid.toString({legacy:!0}),productId:a.id.toString(),url:a.url,productImageCount:a.productImageCollection.length,title:a.name,description:a.description,currencyCode:a.currency,priceAmount1000:a.priceAmount1000,type:"product"},caption:n},u=new WPP.whatsapp.WidFactory.createWid(t);return WPP.chat.find(u).then(t=>{var n=f(e,a.name);ee(t,n).then(e=>{var n=e.getModelsArray()[0];Object.entries(s.productMsgOptions).map(e=>{var t,r,i=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];return n.mediaPrep._mediaData[o]=a}),n.mediaPrep.sendToChat(t,s),void 0!==o&&o(!0)})})}})},window.WAPI.createProduct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"BRL",u=arguments.length>8?arguments[8]:void 0;WPP.catalog.createProduct({name:t,image:e,description:n,price:r,isHidden:i,url:o,retailerId:a,currency:s}).then(e=>{void 0!==u&&u(e)})},window.WAPI.forwardMessages=function(e,t,n){return Ce.apply(this,arguments)},window.WAPI.encryptAndUploadFile=function(e,t){return b.apply(this,arguments)},window.WAPI.setOnlinePresence=function(e){return lt.apply(this,arguments)},window.WAPI.sendLocation=function(e,t,n){return de.apply(this,arguments)},window.WAPI.sendLinkPreview=function(e,t,n){return Ue.apply(this,arguments)},window.WAPI.sendMessageOptions=function(e,t){return ye.apply(this,arguments)},window.WAPI.starMessages=function(e,t){return wt.apply(this,arguments)},window.WAPI.getAllContacts=C,window.WAPI.getMyContacts=function(e){var t=WPP.whatsapp.ContactStore.filter(e=>!0===e.isMyContact).map(e=>WAPI._serializeContactObj(e));return void 0!==e&&e(t),t},window.WAPI.getContact=function(e,t){var n=WPP.whatsapp.ContactStore.get(e);return void 0!==t&&t(window.WAPI._serializeContactObj(n)),window.WAPI._serializeContactObj(n)},window.WAPI.getAllChats=function(e){var t=WPP.whatsapp.ChatStore.map(e=>WAPI._serializeChatObj(e));return void 0!==e&&e(t),t},window.WAPI.haveNewMsg=_,window.WAPI.getAllChatsWithNewMsg=x,window.WAPI.getAllChatIds=function(e){var t=WPP.whatsapp.ChatStore.map(e=>e.id._serialized||e.id);return void 0!==e&&e(t),t},window.WAPI.getAllNewMessages=function(){return x().map(e=>WAPI.getChat(e.id)).flatMap(e=>e.msgs.filter(e=>e.isNewMsg)).map(WAPI._serializeMessageObj)||[]},window.WAPI.getAllUnreadMessages=k,window.WAPI.getAllChatsWithMessages=function(e){return I.apply(this,arguments)},window.WAPI.getAllGroups=function(e){var t=WPP.whatsapp.ChatStore.filter(e=>e.isGroup);return void 0!==e&&e(t),t},window.WAPI.getChat=function(e){if(!e)return!1;e="string"==typeof e?e:e._serialized;var t=WPP.whatsapp.ChatStore.get(e);return t&&(t.sendMessage=t.sendMessage?t.sendMessage:function(){return WPP.whatsapp.functions.sendTextMsgToChat(this,...arguments)}),t},window.WAPI.getChatByName=function(e,t){var n=WPP.chat.find(t=>t.name===e);return void 0!==t&&t(n),n},window.WAPI.getNewId=function(){for(var e="",t=0;t<20;t++)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return e},window.WAPI.getChatById=function(e,t){return U.apply(this,arguments)},window.WAPI.getUnreadMessagesInChat=function(e,t,n,r){for(var i=WAPI.getChat(e).msgs._models,o=[],a=i.length-1;a>=0;a--)if("remove"!==a){var s=i[a];if("boolean"==typeof s.isNewMsg&&!1!==s.isNewMsg){s.isNewMsg=!1;var u=WAPI.processMessageObj(s,t,n);u&&o.push(u)}}return void 0!==r&&r(o),o},window.WAPI.loadEarlierMessages=function(e){return Z.apply(this,arguments)},window.WAPI.loadAllEarlierMessages=q,window.WAPI.asyncLoadAllEarlierMessages=function(e,t){q(e),t()},window.WAPI.areAllMessagesLoaded=function(e,t){return WAPI.getChat(e).msgs.msgLoadState.noEarlierMsgs?(t&&t(!0),!0):(t&&t(!1),!1)},window.WAPI.loadEarlierMessagesTillDate=function(e,t,n){var r=WAPI.getChat(e),i=function(){r.msgs.getModelsArray()[0].t>t&&!r.msgs.msgLoadState.noEarlierMsgs?r.loadEarlierMsgs().then(i):n()};i()},window.WAPI.getAllGroupMetadata=function(e){var t=WPP.whatsapp.GroupMetadataStore.map(e=>e.attributes);return void 0!==e&&e(t),t},window.WAPI.getGroupMetadata=function(e,t){return F.apply(this,arguments)},window.WAPI._getGroupParticipants=function(e){return D.apply(this,arguments)},window.WAPI.getGroupParticipantIDs=function(e,t){return z.apply(this,arguments)},window.WAPI.getAllMessagesInChat=function(e,t,n,r){return E.apply(this,arguments)},window.WAPI.loadAndGetAllMessagesInChat=function(e,t,n,r){return Q.apply(this,arguments)},window.WAPI.getUnreadMessages=function(e,t,n,r){var i=WPP.whatsapp.ChatStore.getModelsArray(),o=[];for(var a in i)if(!isNaN(a)){var s=i[a],u=WAPI._serializeChatObj(s);u.messages=[];for(var c=s.msgs._models,l=c.length-1;l>=0;l--){var d=c[l];if("boolean"==typeof d.isNewMsg&&!1!==d.isNewMsg){d.isNewMsg=!1;var f=WAPI.processMessageObj(d,e,t);f&&u.messages.push(f)}}if(u.messages.length>0)o.push(u);else if(n){for(var h=s.unreadCount,p=c.length-1;p>=0;p--){var w=c[p];if(h>0){if(!w.isSentByMe){var v=WAPI.processMessageObj(w,e,t);u.messages.unshift(v),h-=1}}else{if(-1!==h)break;if(!w.isSentByMe){var P=WAPI.processMessageObj(w,e,t);u.messages.unshift(P);break}}}u.messages.length>0&&(s.unreadCount=0,o.push(u))}}return void 0!==r&&r(o),o},window.WAPI.getCommonGroups=function(e,t){return N.apply(this,arguments)},window.WAPI.downloadFile=function(e){return d.apply(this,arguments)},window.WAPI.getNumberProfile=function(e,t){return Y.apply(this,arguments)},window.WAPI.getMessageById=a,window.WAPI.getMessages=function(e){return Ee.apply(this,arguments)},window.WAPI.getFileHash=w,window.WAPI.generateMediaKey=P,window.WAPI.arrayBufferToBase64=function(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),o=i.byteLength,a=o%3,s=o-a,u=0;u>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=i[s]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=i[s]<<8|i[s+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n},window.WAPI.getListMute=function(){return Qe.apply(this,arguments)},window.WAPI.getHost=function(){return WPP.whatsapp.Conn.attributes},window.WAPI.getWid=function(){var e;return null===(e=WPP.whatsapp.UserPrefs.getMaybeMeUser())||void 0===e?void 0:e._serialized},window.WAPI.getMe=function(e){var t=WPP.whatsapp.ContactStore.get(WPP.whatsapp.UserPrefs.getMaybeMeUser());return void 0!==e&&e(t.all),t.all},window.WAPI.isConnected=function(e){var t=null==document.querySelector('[data-testid="alert-phone"]')&&null==document.querySelector('[data-testid="alert-computer"]');return void 0!==e&&e(t),t},window.WAPI.isLoggedIn=function(e){var t=WPP.whatsapp.ContactStore&&void 0!==WPP.whatsapp.ContactStore.checksum;return void 0!==e&&e(t),t},window.WAPI.getBatteryLevel=function(){return WPP.whatsapp.Conn.attributes.battery},window.WAPI.base64ImageToFile=f,window.WAPI.base64ToFile=f,window.WAPI.sendMute=function(e,t,n){return Je.apply(this,arguments)},window.WAPI.startPhoneWatchdog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;nt(),Ze=setInterval(et,e)},window.WAPI.stopPhoneWatchdog=nt,window.WAPI.subscribePresence=function(e){return st.apply(this,arguments)},window.WAPI.unsubscribePresence=function(e){return ut.apply(this,arguments)},window.WAPI.getBusinessProfilesProducts=function(e){return i.apply(this,arguments)},window.WAPI.getOrderbyMsg=function(e){return c.apply(this,arguments)},window.WAPI._newMessagesQueue=[],window.WAPI._newMessagesBuffer=null!=sessionStorage.getItem("saved_msgs")?JSON.parse(sessionStorage.getItem("saved_msgs")):[],window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesCallbacks=[],window.addEventListener("unload",window.WAPI._unloadInform,!1),window.addEventListener("beforeunload",window.WAPI._unloadInform,!1),window.addEventListener("pageunload",window.WAPI._unloadInform,!1),window.WAPI.getProfilePicSmallFromId=function(){var e=It(function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=It(function*(e){return void 0!==e.img&&(yield window.WAPI.downloadFileWithCredentials(e.img))});return function(t){return e.apply(this,arguments)}}(),function(e){return!1})});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getProfilePicFromId=function(){var e=It(function*(e){return yield WPP.whatsapp.ProfilePicThumbStore.find(e).then(function(){var e=It(function*(e){return void 0!==e.imgFull&&(yield window.WAPI.downloadFileWithCredentials(e.imgFull))});return function(t){return e.apply(this,arguments)}}(),function(e){return!1})});return function(t){return e.apply(this,arguments)}}(),window.WAPI.downloadFileWithCredentials=function(){var e=It(function*(e){if(!axios||!e)return!1;var t=(yield axios.get(e,{responseType:"arraybuffer"})).data;return btoa(new Uint8Array(t).reduce((e,t)=>e+String.fromCharCode(t),""))});return function(t){return e.apply(this,arguments)}}(),window.WAPI._serializeNumberStatusObj=e=>null==e?null:Object.assign({},{id:e.jid,status:e.status,isBusiness:!0===e.biz,canReceiveMessage:200===e.status}),window.WAPI.checkNumberStatus=function(){var e=It(function*(e){var t=yield WPP.contact.queryExists(e);return t?{id:t.wid,isBusiness:t.biz,canReceiveMessage:!0,numberExists:!0,status:200}:{id:e,isBusiness:!1,canReceiveMessage:!1,numberExists:!1,status:404}});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getChatIsOnline=function(){var e=It(function*(e){var t=WPP.whatsapp.ChatStore.get(e);return!!t&&(yield t.presence.subscribe(),t.presence.attributes.isOnline)});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getLastSeen=function(){var e=It(function*(e){var t=WPP.whatsapp.ChatStore.get(e);return!!t&&(t.presence.hasData||(yield t.presence.subscribe(),yield new Promise(e=>setTimeout(e,100))),t.presence.chatstate.t||!1)});return function(t){return e.apply(this,arguments)}}(),window.WAPI.getWAVersion=function(){return window.Debug.VERSION},window.WAPI.deleteOldChats=function(){var e=It(function*(e){try{var t=yield window.WAPI.chat.list({onlyWithUnreadMessage:!1,onlyUsers:!0});t.reverse();for(var n=Math.min(e,t.length),r=0;r!0).catch(e=>!1)}catch(e){return console.error("Erro:",e),e}});return function(t){return e.apply(this,arguments)}}(),window.WAPI.archiveChat=function(){var e=It(function*(e,t){var n=Store.Archive.setArchive(WPP.whatsapp.ChatStore.get(e),t).then(e=>!0).catch(e=>!1);return yield Promise.resolve(n)});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendTextStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendTextStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendImageStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendImageStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.sendVideoStatus=function(){var e=It(function*(e,t){try{return yield WPP.status.sendVideoStatus(e,t)}catch(e){return console.log(e),e}});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.takeOver=It(function*(){return yield WPP.whatsapp.Socket.takeover(),!0}),window.WAPI.onIncomingCall=function(e){return WPP.whatsapp.CallStore.on("add",e),!0},window.WAPI.onInterfaceChange=function(e){var t=()=>({displayInfo:WPP.whatsapp.Stream.displayInfo,mode:WPP.whatsapp.Stream.mode,info:WPP.whatsapp.Stream.info});return e(t()),WPP.whatsapp.Stream.on("change:info change:displayInfo change:mode",()=>{e(t())}),!0},window.WAPI.onStreamModeChanged=function(e){return e(WPP.conn.getStreamData().mode),WPP.on("conn.stream_mode_changed",t=>{e(t)}),!0},window.WAPI.onStreamInfoChanged=function(e){return e(WPP.conn.getStreamData().info),WPP.on("conn.stream_info_changed",t=>{e(t)}),!0},window.WAPI.setMessagesAdminsOnly=function(){var e=It(function*(e,t){return yield WPP.group.setProperty(e,"announcement",t),!0});return function(t,n){return e.apply(this,arguments)}}(),window.WAPI.logout=It(function*(){return yield WPP.conn.logout()}),window.WAPI.isRegistered=function(){return WPP.webpack.search(e=>e.isRegistered).isRegistered()},Mt.then(function(){var e=!1,t=()=>WPP.whatsapp.Socket.stream;window.WAPI.onStreamChange=function(n){return WPP.whatsapp.Socket.on("change:stream",()=>n(t())),e||(e=!0,n(t())),!0}}),Mt.then(function(){var e=!1,t=()=>WPP.whatsapp.Socket.state;window.WAPI.onStateChange=function(n){return WPP.whatsapp.Socket.on("change:state",()=>n(t())),e||(e=!0,n(t())),!0}}),Mt.then(function(){window.WAPI._newMessagesListener=WPP.whatsapp.MsgStore.on("add",e=>{e&&e.isNewMsg&&!e.isSentByMe&&!e.isStatusV3&&setTimeout(()=>{var t=window.WAPI.processMessageObj(e,!1,!1);t&&(window.WAPI._newMessagesQueue.push(t),window.WAPI._newMessagesBuffer.push(t)),!window.WAPI._newMessagesDebouncer&&window.WAPI._newMessagesQueue.length>0&&(window.WAPI._newMessagesDebouncer=setTimeout(()=>{var e=window.WAPI._newMessagesQueue;window.WAPI._newMessagesDebouncer=null,window.WAPI._newMessagesQueue=[];var t=[];window.WAPI._newMessagesCallbacks.forEach(function(n){void 0!==n.callback&&n.callback(e),!0===n.rmAfterUse&&t.push(n)}),t.forEach(function(e){var t=window.WAPI._newMessagesCallbacks.indexOf(e);window.WAPI._newMessagesCallbacks.splice(t,1)})},1e3))},e.body?0:2e3)}),window.WAPI._unloadInform=e=>{window.WAPI._newMessagesBuffer.forEach(e=>{Object.keys(e).forEach(t=>void 0===e[t]?delete e[t]:"")}),sessionStorage.setItem("saved_msgs",JSON.stringify(window.WAPI._newMessagesBuffer)),window.WAPI._newMessagesCallbacks.forEach(function(e){void 0!==e.callback&&e.callback({status:-1,message:"page will be reloaded, wait and register callback again."})})}}),Mt.then(function(){window.WAPI.waitNewMessages=vt}),Mt.then(function(){window.WAPI.allNewMessagesListener=e=>WPP.whatsapp.MsgStore.on("add",t=>{t&&t.isNewMsg&&setTimeout(()=>{var n=window.WAPI.processMessageObj(t,!0,!1);n&&e(n)},t.body?0:2e3)})}),Mt.then(function(){window.WAPI.waitNewAcknowledgements=function(e){return WPP.whatsapp.MsgStore.on("change:ack",e),!0}}),Mt.then(function(){window.WAPI.onAddedToGroup=function(e){return WPP.whatsapp.MsgStore.on("add",t=>{if(t.isNewMsg&&t.isNotification&&"gp2"===t.type&&"add"===t.subtype)try{var n=WAPI._serializeChatObj(t.chat);e(n)}catch(e){console.error(e)}}),!0}}),Mt.then(function(){var e=[];function t(t){var n=Object.assign({},t);n.jid&&(n.id=n.jid.toString());for(var r=0,i=e;r{t({type:"enable",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,shareDuration:e.shareDuration})}),WPP.on("chat.live_location_update",e=>{t({type:"update",id:e.id.toString(),lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,elapsed:e.elapsed,lastUpdated:e.lastUpdated})}),WPP.on("chat.live_location_end",e=>{t({type:"disablle",id:e.id.toString(),chat:e.chat.toString()})}),window.WAPI.onLiveLocation=function(){var t,n=(t=function*(t){e.push(t)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){Pt(o,r,i,a,s,"next",e)}function s(e){Pt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}()}),Mt.then(function(){window.WAPI.onParticipantsChanged=function(){var e,t=(e=function*(e,t){var n=["invite","add","remove","leave","promote","demote"],r=WPP.whatsapp.ChatStore.get(e),i=WPP.whatsapp.GroupMetadataStore.get(e);gt[e]||(gt[e]={},i.participants.forEach(t=>{gt[e][t.id.toString()]={subtype:"add",from:i.owner}}));var o=0;return r.on("change:groupMetadata.participants",i=>r.on("all",(i,a)=>{var s=a.isGroup,u=a.previewMessage;if(s&&"change"===i&&u&&"gp2"===u.type&&n.includes(u.subtype)){var c=u.subtype,l=u.from,d=u.recipients,f=d[0].toString();gt[e][f]&>[e][d[0]].subtype==c||(0==o?o++:(gt[e][f]={subtype:c,from:l},t({by:l.toString(),action:c,who:d}),r.off("all",this),o=0))}})),!0},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){yt(o,r,i,a,s,"next",e)}function s(e){yt(o,r,i,a,s,"throw",e)}a(void 0)})});return function(e,n){return t.apply(this,arguments)}}()}),Mt.then(function(){window.WAPI.onNotificationMessage=function(e){return WPP.whatsapp.MsgStore.on("add",t=>{if(t.isNotification&&t.isNewMsg){var n=WAPI._serializeMessageObj(t);e(n)}}),!0}}),Mt.then(function(){window.WAPI.onPresenceChanged=function(e){return setTimeout(()=>{WPP.whatsapp.ChatStore.map(e=>e.presence.subscribe())},1e3),WPP.whatsapp.PresenceStore.on("change:chatstate.type",t=>{try{var n=WPP.whatsapp.PresenceStore.getModelsArray().find(e=>e.chatstate===t);if(!n||!n.hasData||!n.chatstate.type)return;var r=WPP.whatsapp.ContactStore.get(n.id),i={id:n.id,isOnline:n.isOnline,isGroup:n.isGroup,isUser:n.isUser,shortName:r?r.formattedShortName:"",state:n.chatstate.type,t:Date.now()};n.isUser&&(i.isContact=!n.chatstate.deny),n.isGroup&&(i.participants=n.chatstates.getModelsArray().filter(e=>!!e.type).map(e=>{var t=WPP.whatsapp.ContactStore.get(e.id);return{id:e.id.toString(),state:e.type,shortName:t?t.formattedShortName:""}})),e(i)}catch(e){console.log(e)}}),!0}}))},490(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof P?t:P,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:M(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",h="suspendedYield",p="executing",w="completed",v={};function P(){}function y(){}function g(){}var m={};c(m,a,function(){return this});var A=Object.getPrototypeOf,b=A&&A(A(x([])));b&&b!==n&&r.call(b,a)&&(m=b);var W=g.prototype=P.prototype=Object.create(m);function I(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function n(i,o,a,s){var u=d(e[i],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(l).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=f;return function(o,a){if(i===p)throw new Error("Generator is already running");if(i===w){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=C(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=w,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var c=d(e,n,r);if("normal"===c.type){if(i=r.done?w:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=w,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=d(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(e){if(null!=e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n(490),n(496)})();