@deriv-com/custom-scripts
Advanced tools
Comparing version 1.24.1 to 1.24.2
@@ -1,1 +0,1 @@ | ||
import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as t,ref as o,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,t,o,n){let i="";if(o){let e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(t||"")+i+`;domain=${n};path=/`:e+"="+(t||"")+i+";path=/"}function r(e){let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].trim();if(n.startsWith(e+"="))return n.substring(e.length+1)}return null}function c(e,t){const o={};return e.split(";").forEach((e=>{const[t,n]=e.split("=").map((e=>e.trim()));o[t]=decodeURIComponent(n)})),o[t]}function a(e){i("webflow-user-language",e,30)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,t)=>{t?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const t=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(t)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,t=new URL(e).hostname,o=["deriv.com","deriv.be","deriv.me"].find((e=>t.endsWith(e)));return o?`https://oauth.${o}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const t=c(document.cookie,"clients_country"),o=c(document.cookie,"client_information");return o&&(null==(e=JSON.parse(o))?void 0:e.residence)||t},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),t=new URLSearchParams(window.location.search||"").get("app_id");if(t)return t;const o=localStorage.getItem("config.app_id");if(o)return o;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const l=()=>{const e=localStorage.getItem("config.server_url"),t=c(document.cookie,"webflow-user-language");let o=t?t.toLowerCase():"en";"zh-cn"!==o&&"zh-tw"!==o||(o=o.replace("-","_"));const n=(e=>{let t="";return e&&Object.keys(e).forEach((o=>{t+=`&${o}=${e[o]}`})),t})((()=>{const e=c(document.cookie,"utm_data");if(e){const t=JSON.parse(e),o={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{t.hasOwnProperty(e)&&(o[e]=t[e])})),o}return null})()),i=c(document.cookie,"affiliate_tracking"),r=i?`&affiliate_token=${i}`:"",a=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${o}&brand=deriv${r}${n}&platform=${a}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${o}&brand=deriv${r}${n}&platform=${a}`};window.establishWebSocketConnection=()=>new Promise(((e,t)=>{const o=c(document.cookie,"webflow-user-language"),n=o?o.toLowerCase():"en",i=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",(t=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var o;null==(o=null==window?void 0:window.websocket)||o.close(),t(e)}))})),window.socketMessageSend=async(e,t)=>{var o;try{return(null==window?void 0:window.websocket)&&(null==(o=null==window?void 0:window.websocket)?void 0:o.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,o)=>{window.websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,o)=>{websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(n){return Promise.reject(n)}};const d=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],u=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],w=()=>{const e=window.getClientCountry();d.forEach((t=>{const o="hideDiel"===t.id?!t.countries.includes(e):t.countries.includes(e);if(e&&o)return t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===t.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!o){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),u.forEach((t=>{e&&t.countries.includes(e)?t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{if(t){const o=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(o.classList.add("disclaimer-show"),t.classList.remove("hide-element")):t.style.display="block"}}))})):t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{t&&(".banner_disclaimer"===e?t.classList.add("hide-element"):t.style.display="none")}))}))}))};document.addEventListener("DOMContentLoaded",(function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),t=await e.text(),o=Object.fromEntries(t.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();o!==c(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",o,30)),w()}catch(e){w()}}();c(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then((e=>{c(document.cookie,"clients_country")!==e.website_status.clients_country&&(s("clients_country"),i("clients_country",e.website_status.clients_country,30)),w()})).catch((e=>{}))}));const m=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function g(){let e,t=!1,o=!1;const n=()=>{o=!0,t=!!c(document.cookie,"client_information"),t&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>t,getAuthCheckedStatus:()=>o,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",(function(){(()=>{var e;const t=window.location.pathname,o=window.location.hash,n=window.location.search,i=t.split("/"),r=i[1],s=m.includes(r||""),l=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy");s&&a(r);const d=(null==(e=c(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=s?r:d;if((s||"en"!==d)&&r!==d)if(s&&r!==d)a(u);else if(!l){const e=(s?i.map((e=>e===r?u:e)).join("/"):u+i.join("/"))+n+o;window.location.href="/"+e}})()})),document.addEventListener("DOMContentLoaded",(()=>{const e=g();e.onAuthStatusChange((()=>{if(e.getAuthCheckedStatus()&&e.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(e.getAuthCheckedStatus()&&!e.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}))}));const p=["en","fr","de","it","es","pt","pl","ru"];document.addEventListener("DOMContentLoaded",(function(){let e=c(document.cookie,"webflow-user-language"),t="";t="en"===e.toLowerCase()&&window.location.pathname.includes("/eu/")?window.location.origin+"/eu/signup":"en"===e.toLowerCase()?window.location.origin+"/signup":window.location.pathname.includes("/eu/")?window.location.origin+"/"+e+"/eu/signup":window.location.origin+"/"+e+"/signup";const o=Array.from(document.querySelectorAll("a")).filter((e=>e.href.includes(t)));p.includes(e.toLowerCase()&&window.location.pathname.includes("/eu/"))?o.forEach((t=>{t.href=`${window.location.origin}/eu/signup?locale=${e}`})):p.includes(e.toLowerCase())&&o.forEach((t=>{t.href=`${window.location.origin}/signup?locale=${e}`}))}));const f=document.querySelector(".banner_disclaimer"),h=document.querySelector(".main-wrapper");if(f){new ResizeObserver((e=>{for(let t of e)if(t.target===f){let e=t.target.getBoundingClientRect();h&&(h.style.paddingTop=e.height+"px")}})).observe(f)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const v=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let b=!1,y=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=o(v,"remote_config/deriv-com/chat");n(e,(e=>{const o=e.val();b=o.live_chat,y=o.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=y?"visible":"hidden"),i&&(i.style.visibility=b?"visible":"hidden");const r=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){t.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach((e=>{e.style.visibility="hidden"}))}if(r){const e=document.querySelectorAll(".livechatbtn");b?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const t=document.querySelectorAll(".whatsapp_chat");y?t.forEach((e=>{e.style.visibility="visible"})):t.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,o;(b||y)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),b||y||null==(o=null==t?void 0:t.classList)||o.add("hide-element")}))}),(e=>{var o;null==(o=null==t?void 0:t.classList)||o.remove("hide-element")}))}catch(i){null==(e=null==t?void 0:t.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const t of e)if(t.addedNodes.length)for(const e of t.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const _=document.querySelector(".redirection_background-wrapper"),k=document.getElementById("cancel-redirect"),L=document.getElementById("proceed-redirect"),E="tracking_status",S="tracking_status_decline",q=window.dataLayer,C=c(document.cookie,"client_information"),A=!!C,x=document.getElementById("accept-cookie"),z=document.getElementById("dont-accept-cookie"),$=document.querySelector(".cookies_background-wrapper");if(document.addEventListener("DOMContentLoaded",(()=>{q&&window.dataLayer.push({loggedIn:A,language:c(document.cookie,"webflow-user-language")||"en",...A&&{visitorId:null==C?void 0:C.loginid,currency:null==C?void 0:C.currency,email:null==C?void 0:C.email}}),!window.location.pathname.includes("eu")||r(E)||r(S)||($.classList.remove("hide-element"),document.body.classList.add("show-cookie")),null==x||x.addEventListener("click",(()=>{i(E,!0),$.classList.add("hide-element"),document.body.classList.remove("show-cookie")})),null==z||z.addEventListener("click",(()=>{i(S,!0),i(E,!1),$.classList.add("hide-element"),document.body.classList.remove("show-cookie")}))})),window.isEuRegion(window.location.pathname)&&_&&k&&L){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let t="",o="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),r=new URL(window.location.href);e.includes(i.host)||i.host===r.host||n.addEventListener("click",(function(e){e.preventDefault(),t=i.href,o=n.target||"_self",_.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),k.addEventListener("click",(function(){_.classList.add("hide-element"),document.body.style.overflow="auto",t=""})),L.addEventListener("click",(function(){t&&(window.open(t,o),t="",_.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.addEventListener("DOMContentLoaded",(function(){document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible")}));const j=document.querySelectorAll(".navbar_accordion-item");function O(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}j.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.overflow="hidden",t.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",t.style.opacity="0"})),j.forEach((e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",(function(){const e=t.classList.contains("open");if(j.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.opacity="0"})),!e){t.classList.add("open");const e=t.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(O,300)}))}));const D=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const t=e.target;t.classList.contains("open")&&t.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{D.observe(e,{attributes:!0})}));const I=new URL(window.location.href),M=new URLSearchParams(I.search),R=M.get("t");if(M.has("referrer")&&null!=R){c(document.cookie,"referrer_token")!==R&&(s("referrer_token"),i("referrer_token",R,365,".deriv.com"))}const B=document.getElementById("navbar-home_login");B&&B.addEventListener("click",(function(e){e.preventDefault(),window.location.href=l()}));const N=document.getElementById("res-navbar-home_login");N&&N.addEventListener("click",(function(e){e.preventDefault(),window.location.href=l()}));const U=document.getElementById("white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=l()}));const W=document.getElementById("res-white-navbar_login");W&&W.addEventListener("click",(function(e){e.preventDefault(),window.location.href=l()})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),t=document.querySelector(".navbar_menu-button");if(document.querySelector(".new-navbar_component")){const e=document.querySelector(".new-navbar_component");e.addEventListener("mouseenter",(()=>{window.innerWidth>991&&document.body.classList.add("disable-scroll")})),e.addEventListener("mouseleave",(()=>{window.innerWidth>991&&document.body.classList.remove("disable-scroll")}))}t&&t.addEventListener("click",(function(){let e=window.innerHeight,t=document.querySelector(".new-navbar_main-wrapper");if(t){let o=e-t.offsetHeight,n=document.querySelector(".new-navbar_menu");n&&(n.style.height=`${o}px`)}})),e.forEach((t=>{t.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let t=e.querySelector(".navbar_accordion-trigger");t&&t.classList.add("current")}}})),document.addEventListener("DOMContentLoaded",(()=>{var e=window.location.pathname;["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"].some((t=>e.includes(t)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}))})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let t=e.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(t&&o.length)for(let e of o)e.innerText=t}}));let P=document.querySelectorAll(".w-locales-items");if(P.length>0){P.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),i("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))}));const e=e=>{let t=document.querySelector('a[hreflang="'+e+'"]');t&&window.location.pathname!==t.getAttribute("href")&&t.click()};window.setLanguageCookie=e=>{i("webflow-user-language",e,30)};let t=r("webflow-user-language"),o=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],n=window.location.pathname,c=!1;o.some((e=>n.includes(e))),t&&c&&e(t)}document.addEventListener("DOMContentLoaded",(function(){const e=c(document.cookie,"webflow-user-language"),t=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const o=window.getClientCountry();o&&t.includes(o)&&("en"===e?window.location.replace("/404"):window.location.replace(`/${e}/404`))}})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))})); | ||
import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as t,ref as o,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,t,o,n){let i="";if(o){let e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(t||"")+i+`;domain=${n};path=/`:e+"="+(t||"")+i+";path=/"}function r(e){let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].trim();if(n.startsWith(e+"="))return n.substring(e.length+1)}return null}function c(e,t){const o={};return e.split(";").forEach((e=>{const[t,n]=e.split("=").map((e=>e.trim()));o[t]=decodeURIComponent(n)})),o[t]}function a(e){i("webflow-user-language",e,30)}function s(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,t)=>{t?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const t=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(t)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,t=new URL(e).hostname,o=["deriv.com","deriv.be","deriv.me"].find((e=>t.endsWith(e)));return o?`https://oauth.${o}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const t=c(document.cookie,"clients_country"),o=c(document.cookie,"client_information");return o&&(null==(e=JSON.parse(o))?void 0:e.residence)||t},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),t=new URLSearchParams(window.location.search||"").get("app_id");if(t)return t;const o=localStorage.getItem("config.app_id");if(o)return o;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const d=()=>{const e=localStorage.getItem("config.server_url"),t=c(document.cookie,"webflow-user-language");let o=t?t.toLowerCase():"en";"zh-cn"!==o&&"zh-tw"!==o||(o=o.replace("-","_"));const n=(e=>{let t="";return e&&Object.keys(e).forEach((o=>{t+=`&${o}=${e[o]}`})),t})((()=>{const e=c(document.cookie,"utm_data");if(e){const t=JSON.parse(e),o={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{t.hasOwnProperty(e)&&(o[e]=t[e])})),o}return null})()),i=c(document.cookie,"affiliate_tracking"),r=i?`&affiliate_token=${i}`:"",a=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${o}&brand=deriv${r}${n}&platform=${a}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${o}&brand=deriv${r}${n}&platform=${a}`};window.establishWebSocketConnection=()=>new Promise(((e,t)=>{const o=c(document.cookie,"webflow-user-language"),n=o?o.toLowerCase():"en",i=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",(t=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var o;null==(o=null==window?void 0:window.websocket)||o.close(),t(e)}))})),window.socketMessageSend=async(e,t)=>{var o;try{return(null==window?void 0:window.websocket)&&(null==(o=null==window?void 0:window.websocket)?void 0:o.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,o)=>{window.websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,o)=>{websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);t===i.msg_type&&(i.error?o(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(n){return Promise.reject(n)}};const l=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],u=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],m=()=>{const e=window.getClientCountry();l.forEach((t=>{const o="hideDiel"===t.id?!t.countries.includes(e):t.countries.includes(e);if(e&&o)return t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===t.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!o){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),u.forEach((t=>{e&&t.countries.includes(e)?t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{if(t){const o=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(o.classList.add("disclaimer-show"),t.classList.remove("hide-element")):t.style.display="block"}}))})):t.selectors.forEach((e=>{document.querySelectorAll(e).forEach((t=>{t&&(".banner_disclaimer"===e?t.classList.add("hide-element"):t.style.display="none")}))}))}))};document.addEventListener("DOMContentLoaded",(function(){const e=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),t=await e.text(),o=Object.fromEntries(t.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();o!==c(document.cookie,"clients_country")&&(s("clients_country"),i("clients_country",o,30)),m()}catch(e){m()}}();c(document.cookie,"clients_country")||window.socketMessageSend(e,"website_status").then((e=>{c(document.cookie,"clients_country")!==e.website_status.clients_country&&(s("clients_country"),i("clients_country",e.website_status.clients_country,30)),m()})).catch((e=>{}))}));const w=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];function g(){let e,t=!1,o=!1;const n=()=>{o=!0,t=!!c(document.cookie,"client_information"),t&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>t,getAuthCheckedStatus:()=>o,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}document.addEventListener("DOMContentLoaded",(function(){(()=>{var e;const t=window.location.pathname,o=window.location.hash,n=window.location.search,i=t.split("/"),r=i[1],s=w.includes(r||""),d=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("trading-terms-glossary")||i.includes("eu-careers")||i.includes("our-locations")||i.includes("academy");s&&a(r);const l=(null==(e=c(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",u=s?r:l;if((s||"en"!==l)&&r!==l)if(s&&r!==l)a(u);else if(!d){const e=(s?i.map((e=>e===r?u:e)).join("/"):u+i.join("/"))+n+o;window.location.href="/"+e}})()})),document.addEventListener("DOMContentLoaded",(()=>{const e=g();e.onAuthStatusChange((()=>{if(e.getAuthCheckedStatus()&&e.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(e.getAuthCheckedStatus()&&!e.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}))}));const p=document.querySelector(".banner_disclaimer"),f=document.querySelector(".main-wrapper");if(p){new ResizeObserver((e=>{for(let t of e)if(t.target===p){let e=t.target.getBoundingClientRect();f&&(f.style.paddingTop=e.height+"px")}})).observe(p)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const h=t(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let v=!1,b=!1;!function(){var e;const t=document.getElementById("live_chat-wrapper");try{const e=o(h,"remote_config/deriv-com/chat");n(e,(e=>{const o=e.val();v=o.live_chat,b=o.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=b?"visible":"hidden"),i&&(i.style.visibility=v?"visible":"hidden");const r=window.location.pathname.includes("/help-centre");if(window.location.pathname.includes("/deriv-prime")){t.style.flexDirection="column-reverse";document.querySelectorAll(".whatsapp_chat").forEach((e=>{e.style.visibility="hidden"}))}if(r){const e=document.querySelectorAll(".livechatbtn");v?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const t=document.querySelectorAll(".whatsapp_chat");b?t.forEach((e=>{e.style.visibility="visible"})):t.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,o;(v||b)&&(null==(e=null==t?void 0:t.classList)||e.remove("hide-element")),v||b||null==(o=null==t?void 0:t.classList)||o.add("hide-element")}))}),(e=>{var o;null==(o=null==t?void 0:t.classList)||o.remove("hide-element")}))}catch(i){null==(e=null==t?void 0:t.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const t of e)if(t.addedNodes.length)for(const e of t.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const y=document.querySelector(".redirection_background-wrapper"),_=document.getElementById("cancel-redirect"),k=document.getElementById("proceed-redirect"),L="tracking_status",E="tracking_status_decline",S=window.dataLayer,q=c(document.cookie,"client_information"),x=!!q,z=document.getElementById("accept-cookie"),A=document.getElementById("dont-accept-cookie"),C=document.querySelector(".cookies_background-wrapper");if(document.addEventListener("DOMContentLoaded",(()=>{S&&window.dataLayer.push({loggedIn:x,language:c(document.cookie,"webflow-user-language")||"en",...x&&{visitorId:null==q?void 0:q.loginid,currency:null==q?void 0:q.currency,email:null==q?void 0:q.email}}),!window.location.pathname.includes("eu")||r(L)||r(E)||(C.classList.remove("hide-element"),document.body.classList.add("show-cookie")),null==z||z.addEventListener("click",(()=>{i(L,!0),C.classList.add("hide-element"),document.body.classList.remove("show-cookie")})),null==A||A.addEventListener("click",(()=>{i(E,!0),i(L,!1),C.classList.add("hide-element"),document.body.classList.remove("show-cookie")}))})),window.isEuRegion(window.location.pathname)&&y&&_&&k){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let t="",o="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),r=new URL(window.location.href);e.includes(i.host)||i.host===r.host||n.addEventListener("click",(function(e){e.preventDefault(),t=i.href,o=n.target||"_self",y.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),_.addEventListener("click",(function(){y.classList.add("hide-element"),document.body.style.overflow="auto",t=""})),k.addEventListener("click",(function(){t&&(window.open(t,o),t="",y.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.addEventListener("DOMContentLoaded",(function(){document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible")}));const j=document.querySelectorAll(".navbar_accordion-item");function O(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}j.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.overflow="hidden",t.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",t.style.opacity="0"})),j.forEach((e=>{const t=e.querySelector(".navbar_accordion-trigger");t.addEventListener("click",(function(){const e=t.classList.contains("open");if(j.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const t=e.querySelector(".navbar_accordion-content");t.classList.remove("open"),t.style.maxHeight="0px",t.style.opacity="0"})),!e){t.classList.add("open");const e=t.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(O,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const t=e.target;t.classList.contains("open")&&t.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const $=new URL(window.location.href),D=new URLSearchParams($.search),M=D.get("t");if(D.has("referrer")&&null!=M){c(document.cookie,"referrer_token")!==M&&(s("referrer_token"),i("referrer_token",M,365,".deriv.com"))}const R=document.getElementById("navbar-home_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()}));const B=document.getElementById("res-navbar-home_login");B&&B.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()}));const N=document.getElementById("white-navbar_login");N&&N.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()}));const U=document.getElementById("res-white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=d()})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelectorAll(".navbar_accordion-trigger"),t=document.querySelector(".navbar_menu-button");if(document.querySelector(".new-navbar_component")){const e=document.querySelector(".new-navbar_component");e.addEventListener("mouseenter",(()=>{window.innerWidth>991&&document.body.classList.add("disable-scroll")})),e.addEventListener("mouseleave",(()=>{window.innerWidth>991&&document.body.classList.remove("disable-scroll")}))}t&&t.addEventListener("click",(function(){let e=window.innerHeight,t=document.querySelector(".new-navbar_main-wrapper");if(t){let o=e-t.offsetHeight,n=document.querySelector(".new-navbar_menu");n&&(n.style.height=`${o}px`)}})),e.forEach((t=>{t.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let t=e.querySelector(".navbar_accordion-trigger");t&&t.classList.add("current")}}})),document.addEventListener("DOMContentLoaded",(()=>{var e=window.location.pathname;["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"].some((t=>e.includes(t)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}))})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let t=e.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(t&&o.length)for(let e of o)e.innerText=t}}));let W=document.querySelectorAll(".w-locales-items");if(W.length>0){W.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),i("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))}));const e=e=>{let t=document.querySelector('a[hreflang="'+e+'"]');t&&window.location.pathname!==t.getAttribute("href")&&t.click()};window.setLanguageCookie=e=>{i("webflow-user-language",e,30)};let t=r("webflow-user-language"),o=["/careers","/locations","/derivtech","/derivlife","/eu-careers","/our-locations","/product-explorer","/academy","/trading-terms-glossary"],n=window.location.pathname,c=!1;o.some((e=>n.includes(e))),t&&c&&e(t)}document.addEventListener("DOMContentLoaded",(function(){const e=c(document.cookie,"webflow-user-language"),t=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const o=window.getClientCountry();o&&t.includes(o)&&("en"===e?window.location.replace("/404"):window.location.replace(`/${e}/404`))}})),document.addEventListener("DOMContentLoaded",(function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))})); |
{ | ||
"name": "@deriv-com/custom-scripts", | ||
"version": "1.24.1", | ||
"version": "1.24.2", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
50221
187