DmitrMakeev commited on
Commit
c46130f
·
verified ·
1 Parent(s): e675c64

Update js/senler_btn_ud_v1.js

Browse files
Files changed (1) hide show
  1. js/senler_btn_ud_v1.js +1 -1
js/senler_btn_ud_v1.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=window.w_url.replace(/\/+$/,"")+"/add_user_senler_full",o=window.w_url.replace(/\/+$/,"")+"/get_Lo_Mess_senler",a=window.w_url.replace(/\/+$/,"")+"/del_user_senler",r=Number(window.vk_grup),l=window.vk_grup,d=window.s_grup,c=window.red_on,s=window.on_url,i=window.clarity_on,p=window.clarity_id,u=window.clarity_ses,m=window.clarity_tar,y=window.funnel,w=window.clarity_ev,g=window.ups;let _,f,h,k,B,P,b,E,v,I;const S=new URL(window.location.href),T=S.searchParams.get("vk_user_id");S.searchParams.get("vk_app_id"),window.location.href;I=window.location.hash.substring(1);const L=new URLSearchParams(I);k=L.get("gcpc")||"",B=L.get("utm_source")||"",P=L.get("utm_medium")||"",b=L.get("utm_campaign")||"",E=L.get("utm_content")||"",v=L.get("utm_term")||"",_=L.get("name")||"",f=L.get("email")||"",h=L.get("phone")||"";const j=T.toString();S.searchParams.get("vk_app_id");let x;function O(){document.getElementById("loyaltyBlock").style.display="block",document.getElementById("formBlock").style.display="none",i&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function U(){const e=new URLSearchParams;e.append("vk_user_id",x),e.append("vk_group_id",l),e.append("sub_id",d),e.append("name",_),e.append("email",f),e.append("phone",h),e.append("utm_source",B),e.append("utm_medium",P),e.append("utm_campaign",b),e.append("utm_content",E),e.append("utm_term",v),fetch(n,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{if(e&&e.add_response&&e.add_response.success){if(document.getElementById("formBlock").style.display="none",document.getElementById("loyaltyBlock").style.display="none",document.getElementById("loaderBlock").style.display="none",document.getElementById("stopBlock").style.display="block",c){i&&(R(w),M());let e=new URL(s);e.searchParams.append("ups",g),e.searchParams.append("uid",x),e.searchParams.append("name",_),e.searchParams.append("email",f),e.searchParams.append("phone",h),e.searchParams.append("gcpc",k),e.searchParams.append("utm_source",B),e.searchParams.append("utm_medium",P),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",E),e.searchParams.append("utm_term",v),window.open(e.toString(),"_blank")}else i&&(R(w),M(),document.getElementById("loaderBlock").style.display="none");document.getElementById("thankBlock").style.display="block",document.getElementById("loaderBlock").style.display="none"}else O(),document.getElementById("loaderBlock").style.display="none"}).catch(e=>{console.error("Error:",e.message),O()})}function R(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function M(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var z,A,C,D,q,H,K;vkBridge.send("VKWebAppInit"),document.getElementById("formBlock").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:r,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{x=e.id,document.getElementById("loaderBlock").style.display="flex",setTimeout(U,1e3)}).catch(e=>{O()}):O()}).catch(e=>{O()})})),i&&(z=window,A=document,D="script",q=p,z[C="clarity"]=z[C]||function(){(z[C].q=z[C].q||[]).push(arguments)},(H=A.createElement(D)).async=1,H.src="https://www.clarity.ms/tag/"+q,(K=A.getElementsByTagName(D)[0]).parentNode.insertBefore(H,K),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(j,u,m),function(e,t,n,o,a,r){window.clarity?(window.clarity("set","utm_source",e),window.clarity("set","utm_medium",t),window.clarity("set","utm_campaign",n),window.clarity("set","utm_content",o),window.clarity("set","utm_term",a),window.clarity("set","funnel",r)):console.log("Clarity is not initialized")}(B,P,b,E,v,y)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),c){let e=new URL($(this).attr("href"));e.searchParams.append("ups",g),e.searchParams.append("name",_),e.searchParams.append("email",f),e.searchParams.append("phone",h),e.searchParams.append("uid",x),e.searchParams.append("gcpc",k),e.searchParams.append("utm_source",B),e.searchParams.append("utm_medium",P),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",E),e.searchParams.append("utm_term",v),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")})),function(){const e=new URLSearchParams;e.append("vk_user_id",T),e.append("vk_group_id",l),e.append("sub_id",d),document.getElementById("loaderBlock").style.display="flex",fetch(o,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{e&&"1"===e.status?(document.getElementById("formBlock").style.display="none",document.getElementById("thankBlock").style.display="block",document.getElementById("stopBlock").style.display="block",document.getElementById("loaderBlock").style.display="none",console.log("Есть подписка")):(document.getElementById("formBlock").style.display="block",document.getElementById("loaderBlock").style.display="none",console.log("Нет подписки"))}).catch(e=>{console.error("Error:",e)})}(),$("#linkStopBlock").on("click",(function(e){e.preventDefault(),function(){const e=new URLSearchParams;e.append("vk_user_id",T),e.append("vk_group_id",l),e.append("sub_id",d),document.getElementById("loaderBlock").style.display="flex",fetch(a,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{console.log("Ответ от сервера:",e),e&&"success"===e.status?(document.getElementById("formBlock").style.display="block",document.getElementById("stopBlock").style.display="none",document.getElementById("thankBlock").style.display="none",document.getElementById("loaderBlock").style.display="none",console.log("Подписка отменена")):console.log("Ошибка или подписка не отменена")}).catch(e=>{console.error("Error:",e)})}()}))})),i&&(document.addEventListener("copy",(function(e){console.log("Текст скопирован:",window.getSelection().toString()),window.clarity&&window.clarity("set","text_copy","yes")})),document.querySelectorAll("img").forEach(e=>{e.addEventListener("contextmenu",(function(e){console.log("Контекстное меню открыто на изображении:",e.target.src),e.preventDefault(),window.clarity&&window.clarity("set","img_save","yes")}))}))}]);
 
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){const n=window.w_url.replace(/\/+$/,"")+"/add_user_senler_full",o=window.w_url.replace(/\/+$/,"")+"/get_Lo_Mess_senler",a=window.w_url.replace(/\/+$/,"")+"/del_user_senler",r=Number(window.vk_grup),l=window.vk_grup,d=window.s_grup,c=window.red_on,s=window.on_url,i=window.clarity_on,p=window.clarity_id,u=window.clarity_ses,m=window.clarity_tar,y=window.funnel,w=window.clarity_ev,g=window.ups;let _,f,h,k,B,P,b,E,v,I;const S=new URL(window.location.href),T=S.searchParams.get("vk_user_id");S.searchParams.get("vk_app_id"),window.location.href;I=window.location.hash.substring(1);const L=new URLSearchParams(I);k=L.get("gcpc")||"",B=L.get("utm_source")||"",P=L.get("utm_medium")||"",b=L.get("utm_campaign")||"",E=L.get("utm_content")||"",v=L.get("utm_term")||"",_=L.get("name")||"",f=L.get("email")||"",h=L.get("phone")||"";const j=T.toString();S.searchParams.get("vk_app_id");let x;function O(){document.getElementById("loyaltyBlock").style.display="block",document.getElementById("formBlock").style.display="none",i&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function U(){const e=new URLSearchParams;e.append("vk_user_id",x),e.append("vk_group_id",l),e.append("sub_id",d),e.append("name",_),e.append("email",f),e.append("phone",h),e.append("utm_source",B),e.append("utm_medium",P),e.append("utm_campaign",b),e.append("utm_content",E),e.append("utm_term",v),fetch(n,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{if(e&&e.add_response&&e.add_response.success)if(document.getElementById("formBlock").style.display="none",document.getElementById("loyaltyBlock").style.display="none",document.getElementById("loaderBlock").style.display="none",document.getElementById("thankBlock").style.display="block",document.getElementById("stopBlock").style.display="block",c){i&&(R(w),M());let e=new URL(s);e.searchParams.append("ups",g),e.searchParams.append("uid",x),e.searchParams.append("name",_),e.searchParams.append("email",f),e.searchParams.append("phone",h),e.searchParams.append("gcpc",k),e.searchParams.append("utm_source",B),e.searchParams.append("utm_medium",P),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",E),e.searchParams.append("utm_term",v),window.open(e.toString(),"_blank")}else i&&(R(w),M(),document.getElementById("loaderBlock").style.display="none");else O(),document.getElementById("loaderBlock").style.display="none"}).catch(e=>{console.error("Error:",e.message),O()})}function R(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function M(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var z,A,C,D,q,H,K;vkBridge.send("VKWebAppInit"),document.getElementById("formBlock").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:r,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{x=e.id,document.getElementById("loaderBlock").style.display="flex",setTimeout(U,1e3)}).catch(e=>{O()}):O()}).catch(e=>{O()})})),i&&(z=window,A=document,D="script",q=p,z[C="clarity"]=z[C]||function(){(z[C].q=z[C].q||[]).push(arguments)},(H=A.createElement(D)).async=1,H.src="https://www.clarity.ms/tag/"+q,(K=A.getElementsByTagName(D)[0]).parentNode.insertBefore(H,K),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(j,u,m),function(e,t,n,o,a,r){window.clarity?(window.clarity("set","utm_source",e),window.clarity("set","utm_medium",t),window.clarity("set","utm_campaign",n),window.clarity("set","utm_content",o),window.clarity("set","utm_term",a),window.clarity("set","funnel",r)):console.log("Clarity is not initialized")}(B,P,b,E,v,y)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),c){let e=new URL($(this).attr("href"));e.searchParams.append("ups",g),e.searchParams.append("name",_),e.searchParams.append("email",f),e.searchParams.append("phone",h),e.searchParams.append("uid",x),e.searchParams.append("gcpc",k),e.searchParams.append("utm_source",B),e.searchParams.append("utm_medium",P),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",E),e.searchParams.append("utm_term",v),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")})),function(){const e=new URLSearchParams;e.append("vk_user_id",T),e.append("vk_group_id",l),e.append("sub_id",d),document.getElementById("loaderBlock").style.display="flex",fetch(o,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{e&&"1"===e.status?(document.getElementById("formBlock").style.display="none",document.getElementById("thankBlock").style.display="block",document.getElementById("stopBlock").style.display="block",document.getElementById("loaderBlock").style.display="none",console.log("Есть подписка")):(document.getElementById("formBlock").style.display="block",document.getElementById("loaderBlock").style.display="none",console.log("Нет подписки"))}).catch(e=>{console.error("Error:",e)})}(),$("#linkStopBlock").on("click",(function(e){e.preventDefault(),function(){const e=new URLSearchParams;e.append("vk_user_id",T),e.append("vk_group_id",l),e.append("sub_id",d),document.getElementById("loaderBlock").style.display="flex",fetch(a,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{console.log("Ответ от сервера:",e),e&&"success"===e.status?(document.getElementById("formBlock").style.display="block",document.getElementById("stopBlock").style.display="none",document.getElementById("thankBlock").style.display="none",document.getElementById("loaderBlock").style.display="none",console.log("Подписка отменена")):(console.log("Ошибка или подписка не отменена"),document.getElementById("loaderBlock").style.display="none")}).catch(e=>{console.error("Error:",e)})}()}))})),i&&(document.addEventListener("copy",(function(e){console.log("Текст скопирован:",window.getSelection().toString()),window.clarity&&window.clarity("set","text_copy","yes")})),document.querySelectorAll("img").forEach(e=>{e.addEventListener("contextmenu",(function(e){console.log("Контекстное меню открыто на изображении:",e.target.src),e.preventDefault(),window.clarity&&window.clarity("set","img_save","yes")}))}))}]);