DmitrMakeev commited on
Commit
30063b7
·
verified ·
1 Parent(s): 304b0d2

Update js/senler_btn_v1.js

Browse files
Files changed (1) hide show
  1. js/senler_btn_v1.js +1 -1
js/senler_btn_v1.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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",o=window.w_url.replace(/\/+$/,"")+"/get_Lo_Mess_senler",r=window.w_url.replace(/\/+$/,"")+"/del_user_senler",a=Number(window.vk_grup),i=window.vk_grup,s=window.s_grup,c=window.red_on,d=window.on_url,l=window.clarity_on,u=window.clarity_id,p=window.clarity_ses,m=window.clarity_tar,w=window.funnel,y=window.clarity_ev,_=window.ups;let f,g,h,b,P,k,v;const S=new URL(window.location.href),E=S.searchParams.get("vk_user_id");S.searchParams.get("vk_app_id"),window.location.href;v=window.location.hash.substring(1);const B=new URLSearchParams(v);f=B.get("gcpc")||"",g=B.get("utm_source")||"",h=B.get("utm_medium")||"",b=B.get("utm_campaign")||"",P=B.get("utm_content")||"",k=B.get("utm_term")||"";const T=E.toString();S.searchParams.get("vk_app_id");let L;function j(){document.getElementById("notLoyalty").style.display="block",document.getElementById("contactForm").style.display="none",l&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function I(){document.getElementById("contactForm").style.display="none",document.getElementById("notLoyalty").style.display="none";const e=new URLSearchParams;e.append("vk_user_id",L),e.append("vk_group_id",i),e.append("sub_id",s),e.append("utm_source",g),e.append("utm_medium",h),e.append("utm_campaign",b),e.append("utm_content",P),e.append("utm_term",k),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.success){if(c){l&&(O(y),U());let e=new URL(d);e.searchParams.append("ups",_),e.searchParams.append("uid",L),e.searchParams.append("gcpc",f),e.searchParams.append("utm_source",g),e.searchParams.append("utm_medium",h),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",P),e.searchParams.append("utm_term",k),window.open(e.toString(),"_blank")}else l&&(O(y),U());document.getElementById("thankYouBlock").style.display="block"}else j()}).catch(e=>{console.error("Error:",e),j()})}function O(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function U(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var C,M,R,x,z,A,F;vkBridge.send("VKWebAppInit"),document.getElementById("contactForm").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:a,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{L=e.id,setTimeout(I,1e3)}).catch(e=>{j()}):j()}).catch(e=>{j()})})),l&&(C=window,M=document,x="script",z=u,C[R="clarity"]=C[R]||function(){(C[R].q=C[R].q||[]).push(arguments)},(A=M.createElement(x)).async=1,A.src="https://www.clarity.ms/tag/"+z,(F=M.getElementsByTagName(x)[0]).parentNode.insertBefore(A,F),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(T,p,m),function(e,t,n,o,r,a){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",r),window.clarity("set","funnel",a)):console.log("Clarity is not initialized")}(g,h,b,P,k,w)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),c){let e=new URL($(this).attr("href"));e.searchParams.append("ups",_),e.searchParams.append("uid",L),e.searchParams.append("gcpc",f),e.searchParams.append("utm_source",g),e.searchParams.append("utm_medium",h),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",P),e.searchParams.append("utm_term",k),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")})),function(){const e=new URLSearchParams;e.append("vk_user_id",E),e.append("vk_group_id",i),e.append("sub_id",s),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("messContStop").style.display="block",console.log("Есть подписка")):console.log("Нет под��иски")}).catch(e=>{console.error("Error:",e)})}(),$("#linkStopMess").on("click",(function(e){e.preventDefault(),function(){const e=new URLSearchParams;e.append("vk_user_id",E),e.append("vk_group_id",i),e.append("sub_id",s),fetch(r,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{e&&!0===e.status?(document.getElementById("messContStop").style.display="none",console.log("Подписка отменена")):console.log("Ошибка или подписка не отменена")}).catch(e=>{console.error("Error:",e)})}()}))}))}]);
 
1
+ !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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",o=window.w_url.replace(/\/+$/,"")+"/get_Lo_Mess_senler",r=window.w_url.replace(/\/+$/,"")+"/del_user_senler",a=Number(window.vk_grup),i=window.vk_grup,c=window.s_grup,s=window.red_on,d=window.on_url,l=window.clarity_on,u=window.clarity_id,p=window.clarity_ses,m=window.clarity_tar,w=window.funnel,y=window.clarity_ev,_=window.ups;let f,g,h,b,P,k,v;const S=new URL(window.location.href),E=S.searchParams.get("vk_user_id");S.searchParams.get("vk_app_id"),window.location.href;v=window.location.hash.substring(1);const B=new URLSearchParams(v);f=B.get("gcpc")||"",g=B.get("utm_source")||"",h=B.get("utm_medium")||"",b=B.get("utm_campaign")||"",P=B.get("utm_content")||"",k=B.get("utm_term")||"";const T=E.toString();S.searchParams.get("vk_app_id");let L;function j(){document.getElementById("notLoyalty").style.display="block",document.getElementById("contactForm").style.display="none",l&&(window.clarity?window.clarity("set","loyalty","not"):console.log("Clarity is not initialized"))}function I(){document.getElementById("contactForm").style.display="none",document.getElementById("notLoyalty").style.display="none";const e=new URLSearchParams;e.append("vk_user_id",L),e.append("vk_group_id",i),e.append("sub_id",c),e.append("utm_source",g),e.append("utm_medium",h),e.append("utm_campaign",b),e.append("utm_content",P),e.append("utm_term",k),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.success){if(s){l&&(O(y),U());let e=new URL(d);e.searchParams.append("ups",_),e.searchParams.append("uid",L),e.searchParams.append("gcpc",f),e.searchParams.append("utm_source",g),e.searchParams.append("utm_medium",h),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",P),e.searchParams.append("utm_term",k),window.open(e.toString(),"_blank")}else l&&(O(y),U());document.getElementById("thankYouBlock").style.display="block"}else j()}).catch(e=>{console.error("Error:",e),j()})}function O(e){window.clarity?window.clarity("event",e):console.log("Clarity is not initialized")}function U(){window.clarity?window.clarity("set","loyalty","yes"):console.log("Clarity is not initialized")}var C,M,R,x,z,A,F;vkBridge.send("VKWebAppInit"),document.getElementById("contactForm").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:a,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{L=e.id,setTimeout(I,1e3)}).catch(e=>{j()}):j()}).catch(e=>{j()})})),l&&(C=window,M=document,x="script",z=u,C[R="clarity"]=C[R]||function(){(C[R].q=C[R].q||[]).push(arguments)},(A=M.createElement(x)).async=1,A.src="https://www.clarity.ms/tag/"+z,(F=M.getElementsByTagName(x)[0]).parentNode.insertBefore(A,F),function(e,t,n){window.clarity?window.clarity("identify",e,t,n):console.log("Clarity is not initialized")}(T,p,m),function(e,t,n,o,r,a){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",r),window.clarity("set","funnel",a)):console.log("Clarity is not initialized")}(g,h,b,P,k,w)),$(document).ready((function(){$("#linkThank").on("click",(function(e){if(e.preventDefault(),s){let e=new URL($(this).attr("href"));e.searchParams.append("ups",_),e.searchParams.append("uid",L),e.searchParams.append("gcpc",f),e.searchParams.append("utm_source",g),e.searchParams.append("utm_medium",h),e.searchParams.append("utm_campaign",b),e.searchParams.append("utm_content",P),e.searchParams.append("utm_term",k),window.open(e.toString(),"_blank")}else window.open($(this).attr("href"),"_blank")})),function(){const e=new URLSearchParams;e.append("vk_user_id",E),e.append("vk_group_id",i),e.append("sub_id",c),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("messContStop").style.display="block",console.log("Есть подписка")):console.log("Нет подписки")}).catch(e=>{console.error("Error:",e)})}(),$("#linkStopMess").on("click",(function(e){e.preventDefault(),function(){const e=new URLSearchParams;e.append("vk_user_id",E),e.append("vk_group_id",i),e.append("sub_id",c),fetch(r,{method:"POST",body:e}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{e&&!0===e.success?(document.getElementById("messContStop").style.display="none",console.log("Подписка отменена")):console.log("Ошибка или подписка не отменена")}).catch(e=>{console.error("Error:",e)})}()}))}))}]);