(()=>{function M(o){return function(){var y=3e3,_=50,C=3e4,u={consent:"",gdpr:"",us_privacy:"",gpp:"",gpp_sid:""},x={advertising:!0,measurement:!0},f={applies:void 0,known:!1,p1:!1,p3:!1,p4:!1,p7:!1},h=!1,P={advertising:void 0,measurement:void 0},m={advertising:!0,measurement:!0},c=[],n=null;function R(t){return typeof t>"u"}function T(t){return R(P[t])?x[t]:P[t]}function e(){return{advertising:m.advertising,measurement:m.measurement}}function r(){return{consent:u.consent,gdpr:u.gdpr,us_privacy:u.us_privacy,gpp:u.gpp,gpp_sid:u.gpp_sid}}function i(){var t=!0,a=!0;f.applies===!0&&(f.known?(t=!!(f.p1&&f.p3&&f.p4),a=!!f.p7):(t=!1,a=!1)),h&&(t=!1),x.advertising=t,x.measurement=a,s()}function s(){var t={advertising:T("advertising"),measurement:T("measurement")};if(!(t.advertising===m.advertising&&t.measurement===m.measurement)){m=t;for(var a=0;a<c.length;a++)try{c[a](e())}catch(p){}}}function l(t){typeof t=="function"&&c.push(t)}function v(t){!t||typeof t!="object"||(typeof t.advertising=="boolean"&&(P.advertising=t.advertising),typeof t.measurement=="boolean"&&(P.measurement=t.measurement),s())}function O(t,a){if(typeof o[t]=="function"){a();return}var p=0,S=setInterval(function(){if(typeof o[t]=="function"){clearInterval(S),a();return}p+=_,p>=C&&clearInterval(S)},_)}function w(t,a,p){return new Promise(function(S){var d=!1,b=function(){d||(d=!0,S())};setTimeout(b,y),O(t,function(){try{a(function(g,A){A&&g&&p(g),b()})}catch(g){b()}})})}function E(t){if(u.consent=t.tcString||"",t.gdprApplies===!0?u.gdpr="1":t.gdprApplies===!1&&(u.gdpr="0"),typeof t.gdprApplies=="boolean"&&(f.applies=t.gdprApplies),f.applies===!0&&t.purpose&&t.purpose.consents){var a=t.purpose.consents;f.p1=!!a[1],f.p3=!!a[3],f.p4=!!a[4],f.p7=!!a[7],f.known=!0}i()}function U(){return O("__tcfapi",function(){try{o.__tcfapi("addEventListener",2,function(t,a){if(a&&t){var p=t.eventStatus;(p==="useractioncomplete"||p==="tcloaded"||R(p))&&E(t)}})}catch(t){}}),w("__tcfapi",function(t){o.__tcfapi("getTCData",2,t)},E)}function F(t){u.us_privacy=t||"",typeof t=="string"&&t.length>=3&&t.charAt(2)==="Y"&&(h=!0),i()}function I(){return w("__uspapi",function(t){o.__uspapi("getUSPData",1,t)},function(t){F(t.uspString)})}function D(t){u.gpp=t.gppString||"",Array.isArray(t.applicableSections)&&(u.gpp_sid=t.applicableSections.join(","));var a=t.parsedSections;a&&typeof a=="object"&&Object.keys(a).forEach(function(p){var S=a[p],d=Array.isArray(S)?S[0]:S;d&&(d.SaleOptOut===1||d.SharingOptOut===1||d.TargetedAdvertisingOptOut===1)&&(h=!0)}),i()}function j(){return new Promise(function(t){var a=!1,p=function(){a||(a=!0,t())};setTimeout(p,y);var S=function(d){if(d&&d.gppString){D(d),p();return}try{o.__gpp("getGPPData",function(b,g){g&&b&&D(b),p()})}catch(b){p()}};O("__gpp",function(){try{o.__gpp("ping",function(d,b){if(b&&d&&d.signalStatus==="ready"){S(d);return}try{o.__gpp("addEventListener",function(g,A){if(!(!A||!g)&&g.eventName==="signalStatus"&&g.data==="ready"){if(g.listenerId!=null)try{o.__gpp("removeEventListener",function(){},g.listenerId)}catch(k){}S(g.pingReturn)}})}catch(g){p()}})}catch(d){p()}})})}function q(t){return t=t||{},t.initial&&v(t.initial),n||(n=Promise.allSettled([U(),I(),j()])),n}return{getState:e,getRawSignals:r,onChange:l,set:v,init:q,advertising:function(){return e().advertising},measurement:function(){return e().measurement}}}()}function L(o,y,_){var C=_.src,u=_.initConfig||{},x=_.timeoutMs||5e3,f=_.pollMs||50;return new Promise(function(h){if(!C){h(void 0);return}if(!(o.rads&&o.rads.control)&&!y.querySelector('script[src="'+C+'"]')){var P=y.createElement("script");P.src=C,P.async=!0,(y.head||y.documentElement).appendChild(P)}var m=Date.now(),c=function(){var n=o.rads&&o.rads.control;if(n){try{typeof n.init=="function"&&n.init(u)}catch(R){}typeof n.ready=="function"?n.ready().then(function(){h(n)},function(){h(n)}):typeof n.onReady=="function"?n.onReady(function(){h(n)}):h(n);return}if(Date.now()-m>x){h(void 0);return}setTimeout(c,f)};c()})}(function(o,y){let _=[],C=!1,u={items:[],push(e){this.items.unshift(e)},pop(){return this.items.pop()},processor(){this.proc(),setInterval(this.proc,50)},proc(){!n.undef(o._ratagData)&&Array.isArray(o._ratagData)&&u.run(o._ratagData.pop()),u.items.length!==0&&u.run(Array.from(u.pop()))},run(e){if(n.undef(e))return;let r=e[0];n.undef(x[r])||(n.log("command",e),n.safe(()=>{x[r](...Array.prototype.slice.call(e,1))}))}},x={debug(e){!n.undef(e)&&e===!0&&(C=!0)},errors(){n.log("errors",_)},conversion(e){if(n.undef(e)||n.undef(e.to))return;let r=e.cid;if(n.undef(r)&&(r=n.param("_raclid")),!c.valid(r)&&(r=c.getLastFromStore(),!c.valid(r)))return;let i={cid:r,caid:e.to};!n.undef(e.value)&&typeof e.value=="number"&&(i.value=e.value),!n.undef(e.sub_id)&&typeof e.sub_id=="string"&&(i.sub_id=e.sub_id);let s=()=>n.safe(()=>n.post("https://d2.ads.rmbl.ws/convert",i,e.callback));if(f.measurement()){s();return}h.hold(s)},config(e){n.undef(e)||typeof e!="object"||n.undef(e.consent)||f.init({initial:e.consent})},consent(e){f.set(e)},enrichAdRequestUrl(e,r){typeof e!="string"||typeof r!="function"||R.onReady(()=>{let i=o.rads&&o.rads.control,s=i&&typeof i.enrichAdRequestUrl=="function"?n.safe(()=>i.enrichAdRequestUrl(e)):e;r(typeof s=="string"?s:e)})}},f=M(o),h={pending:[],cap:5,flushRegistered:!1,hold(e){this.pending.length>=this.cap&&this.pending.shift(),this.pending.push(e),this.registerFlush()},registerFlush(){this.flushRegistered||(this.flushRegistered=!0,f.onChange(e=>{e.measurement&&h.flush()}))},flush(){this.pending.splice(0,this.pending.length).forEach(r=>n.safe(r))}},P=100*24*60*60,m={memory:{},resolved:!1,persist(e,r,i){n.undef(i)&&(i=P),[()=>{localStorage[e]=r},()=>{sessionStorage[e]=r},()=>{let l=new Date;l.setSeconds(l.getSeconds()+i);let v=e+"="+encodeURI(r)+"; path=/; expires="+l.toUTCString()+"; SameSite=Lax";o.location&&o.location.protocol==="https:"&&(v+="; Secure"),y.cookie=v}].forEach(function(l){n.safe(l)})},set(e,r,i){this.memory[e]=r,!(!this.resolved||!f.advertising())&&this.persist(e,r,i)},resolve(){this.resolved=!0,f.advertising()&&Object.keys(this.memory).forEach(e=>this.persist(e,this.memory[e]))},get(e){if(this.resolved&&!f.advertising())return n.undef(this.memory[e])?"":this.memory[e];if(!n.undef(this.memory[e]))return this.memory[e];let r=!1,i=[()=>localStorage[e],()=>sessionStorage[e],()=>{let l=("; "+y.cookie).split("; "+e+"=");if(l.length===2)return l.pop().split(";").shift()}];for(let s=0;s<i.length;s++)if(r=n.safe(i[s]),!n.undef(r)&&r!==null&&r!==!1)return r;return""}},c={key:"_cids",regex:/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i,valid(e){return n.undef(e)||e===null||typeof e=="string"&&e.length===0?!1:this.regex.test(e)},get(){let e=m.get(c.key);return e.length===0?e="[]":e=atob(e),JSON.parse(e)},set(e){n.log("save cid data",e),m.set(c.key,btoa(JSON.stringify(e)))},clean(){let e=n.unixTsSeconds();this.set(this.get().filter(r=>c.valid(r.c)&&!n.undef(r.x)&&r.x>e))},saveForLater(){let e=n.param("_raclid");if(!c.valid(e))return;n.log("save cid",e);let r=c.get(),i=n.unixTsSeconds();for(let s=0;s<r.length;s++)if(!n.undef(r[s].c)&&r[s].c===e)return;r.length>5&&(r=r.slice(-4)),r.push({c:e,x:i+90*24*60*60}),c.set(r.filter(s=>!n.undef(s.x)&&s.x>i))},getLastFromStore(){let e=c.get();if(e.length===0)return null;let i=e.filter(s=>s.c).sort((s,l)=>l.x-s.x).shift();return!i||!i.c?null:i.c}},n={log(){C&&console.log(...arguments)},xhr(e,r,i){return r=new URL(r),this.safe(()=>{let s=null;if(!n.undef(i.data)&&typeof i.data=="object")switch(e){case"GET":Object.keys(i.data).forEach(v=>{r.searchParams.set(v,i.data[v])});break;case"POST":s=n.toFormData(i.data)}let l=new XMLHttpRequest;l.open(e,r.toString()),["onload","onerror","onprogress"].forEach(v=>{n.undef(i[v])||(l[v]=function(){i[v](l,arguments)})}),l.onreadystatechange=()=>{l.readyState===4&&!n.undef(i.callback)&&typeof i.callback=="function"&&i.callback()},l.send(s)})},beacon(e,r){return this.undef(navigator)||this.undef(navigator.sendBeacon)?this.xhr("POST",e,{data:r}):navigator.sendBeacon(e,this.toFormData(r))},post(e,r,i){return this.xhr("POST",e,{data:r,callback:i})},toFormData(e){let r=new FormData;return Object.keys(e).forEach(i=>{r.set(i,e[i])}),r},param(e){return this.undef(this.searchParams)&&(this.searchParams=new URLSearchParams(window.location.search)),this.searchParams.get(e)},safe(e){try{return e()}catch(r){return _.push({error:r,ts:new Date().getTime()}),r}},undef(e){return typeof e>"u"},errors(){return _},unixTsSeconds(){return Math.floor(Date.now()/1e3)}},R={ready:!1,waiters:[],started:!1,load(){this.started||(this.started=!0,L(o,y,{src:"https://d2.ads.rmbl.ws/control",initConfig:{},timeoutMs:5e3}).then(()=>this.flush()))},onReady(e){if(this.ready){n.safe(e);return}this.waiters.push(e)},flush(){if(this.ready)return;this.ready=!0,this.waiters.splice(0,this.waiters.length).forEach(r=>n.safe(r))}};u.processor(),R.load();let T=f.init();c.clean(),c.saveForLater(),T.then(()=>m.resolve()),f.onChange(e=>{e.advertising&&m.resolve()}),o.ratag=function(){u.push(arguments)}})(window,document);})();
