(function(){"use strict";if(window.__ZV_PHONE_DETECT_LOADED__)return;window.__ZV_PHONE_DETECT_LOADED__=!0;const p=360,l=5e3;let u=0,o=null;function i(n){const e=String(n||"").replace(/\D/g,"");return e.length>=8&&e.length<=15?e:""}function a(n){const e=i(n?.phone);e&&(document.documentElement.setAttribute("data-zv-phone",e),document.documentElement.setAttribute("data-zv-register-phone",e),n.wppVersion&&document.documentElement.setAttribute("data-zv-wpp-version",n.wppVersion),n.displayName&&document.documentElement.setAttribute("data-zv-display-name",n.displayName))}function c(n){try{a(n),window.dispatchEvent(new CustomEvent("zv:phone-ready",{detail:n})),window.dispatchEvent(new CustomEvent("zv:register-instance",{detail:n}))}catch{}}function w(){try{const n=window.WPP;if(!n?.conn?.getMyUserId)return null;const e=n.conn.getMyUserId(),t=e?.user??(typeof e?.toString=="function"?e.toString().split("@")[0]:null);if(!t)return null;const s=i(t);return s?{phone:s,wppVersion:n?.whatsapp?.Conn?.clientVersion||window.Debug?.VERSION||"unknown",displayName:n?.whatsapp?.Conn?.pushname||n?.whatsapp?.Conn?.me?.pushname||null}:null}catch{return null}}function d(){try{const n=window.Store||window.WPP?.whatsapp?.Store;if(!n?.Conn)return null;const e=n.Conn?.wid?.user||n.Conn?.me?.user||null;if(!e)return null;const t=i(e);return t?{phone:t,wppVersion:n.Conn?.clientVersion||window.Debug?.VERSION||"unknown",displayName:n.Conn?.pushname||n.Conn?.me?.pushname||null}:null}catch{return null}}function _(n){return n?.phone?(n.phone===o||(o=n.phone,window.__ZV_PHONE__=n.phone,window.__ZV_WPP_VERSION__=n.wppVersion,window.__ZV_DISPLAY_NAME__=n.displayName,c(n)),!0):!1}function r(){u+=1;const n=w()||d();return n?_(n):!1}function m(){try{const n=window.WPP;if(!n?.ev?.addListener)return;n.ev.addListener("conn.main_ready",()=>{o=null,r()})}catch{}}if(m(),!r()){const n=setInterval(()=>{(r()||u>=p)&&clearInterval(n)},l)}setInterval(()=>{o=null,r()},300*1e3)})();
