@dtect/security-sdk-js 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Le=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var An=Object.prototype.hasOwnProperty;var Sn=(e,t)=>{for(var n in t)Le(e,n,{get:t[n],enumerable:!0})},On=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!An.call(e,o)&&o!==n&&Le(e,o,{get:()=>t[o],enumerable:!(r=bn(t,o))||r.enumerable});return e};var Dn=e=>On(Le({},"__esModule",{value:!0}),e);var vo={};Sn(vo,{LanguageCodes:()=>Q,QualityQuestionsRespondentTypes:()=>W,SecurityAPIError:()=>En,checkQualityQuestions:()=>De,default:()=>wo,getQualityQuestions:()=>Oe,getSecurityResult:()=>Ae,getSecurityToken:()=>Se,init:()=>Rn,isAIUsageDetected:()=>_e});module.exports=Dn(vo);function _n(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function Pn(e,t,n,r){let o=document,i="securitypolicyviolation",s,a=d=>{let u=new URL(e,location.href),{blockedURI:l}=d;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(s=d,c())};o.addEventListener(i,a);let c=()=>o.removeEventListener(i,a);return r?.then(c,c),Promise.resolve().then(t).then(d=>(c(),d),d=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),s)return n(s);throw d}))}function F(e){let t="";for(let n=0;n<e.length;++n)if(n>0){let r=e[n].toLowerCase();r!==e[n]?t+=` ${r}`:t+=e[n]}else t+=e[n].toUpperCase();return t}var kn={default:"endpoint"},xn={default:"tlsEndpoint"},Nn="Client timeout",Mn="Network connection error",Cn="Network request aborted",Ln="Response cannot be parsed",Fe="Blocked by CSP",Ue="The endpoint parameter is not a valid URL",Fn="Handle on demand agent data error",Un=F("WrongRegion"),Bn=F("SubscriptionNotActive"),qn=F("UnsupportedVersion"),Kn=F("InstallationMethodRestricted"),Gn=F("HostnameRestricted"),Vn=F("IntegrationFailed"),jn=F("NetworkRestricted"),Qn=F("InvalidProxyIntegrationSecret"),Wn=F("InvalidProxyIntegrationHeaders"),$n=F("ProxyIntegrationSecretEnvironmentMismatch"),Be="API key required",Et="API key not found",wt="API key expired",zn="Request cannot be parsed",Yn="Request failed",Jn="Request failed to process",Xn="Too many requests, rate limit exceeded",Zn="Not available for this origin",Hn="Not available with restricted header",er=Be,tr=Et,nr=wt,rr="3.12.0",ae="Failed to load the JS script of the agent",qe="9319";function or(e,t){let n=[],[r,o]=function(a){let c=function(l){let f=[...l];return{current:()=>f[0],postpone(){let E=f.shift();E!==void 0&&f.push(E)},exclude(){f.shift()}}}(a),d=function(l,f){let E=0;return()=>Math.random()*Math.min(f,l*Math.pow(2,E++))}(100,3e3),u=new Set;return[c.current(),(l,f)=>{let E,y=f instanceof Error?f.message:"";if(y===Fe||y===Ue)c.exclude(),E=0;else if(y===qe)c.exclude();else if(y===ae){let w=Date.now()-l.getTime()<50,g=c.current();g&&w&&!u.has(g)&&(u.add(g),E=0),c.postpone()}else c.postpone();let h=c.current();return h===void 0?void 0:[h,E??l.getTime()+d()-Date.now()]}]}(e),i;if(r===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));let s=a=>{let c=new Date,d=l=>n.push({url:a,startedAt:c,finishedAt:new Date,error:l}),u=t(a);return u.then(()=>d(),d),u.catch(l=>{if(i!=null||(i=l),n.length>=5)throw i;let f=o(c,l);if(!f)throw i;let[E,y]=f;return(h=y,new Promise(w=>setTimeout(w,h))).then(()=>s(E));var h})};return s(r).then(a=>[a,n])}var vt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",ir=vt;function sr(e){var t,n;let{picked:r,rest:o}=function(u,l){let f={},E={};for(let[y,h]of Object.entries(u))l.includes(y)?f[y]=h:E[y]=h;return{picked:f,rest:E}}(e,["scriptUrlPattern","token","apiKey"]),i=r.token,s=(t=r.apiKey)!==null&&t!==void 0?t:i,a=(n=_n(e,"scriptUrlPattern"))!==null&&n!==void 0?n:vt,[c,d]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},f=function(E,y,h,w){return E.addEventListener(y,h,w),()=>E.removeEventListener(y,h,w)}(document,"visibilitychange",l);return l(),[u,f]}();return Promise.resolve().then(()=>{if(!s||typeof s!="string")throw new Error(Be);let u=function(l,f){return(Array.isArray(l)?l:[l]).map(E=>function(y,h){let w=encodeURIComponent;return y.replace(/<[^<>]+>/g,g=>g==="<version>"?"3":g==="<apiKey>"?w(h):g==="<loaderVersion>"?w(rr):g)}(String(E),f))}(a,s);return or(u,ar)}).catch(u=>{throw d(),function(l){return l instanceof Error&&l.message===qe?new Error(ae):l}(u)}).then(([u,l])=>(d(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function ar(e){return Pn(e,()=>function(t){return new Promise((n,r)=>{if(function(a){if(URL.prototype)try{return new URL(a,location.href),!1}catch(c){if(c instanceof Error&&c.name==="TypeError")return!0;throw c}}(t))throw new Error(Ue);let o=document.createElement("script"),i=()=>{var a;return(a=o.parentNode)===null||a===void 0?void 0:a.removeChild(o)},s=document.head||document.getElementsByTagName("head")[0];o.onload=()=>{i(),n()},o.onerror=()=>{i(),r(new Error(ae))},o.async=!0,o.src=t,s.appendChild(o)})}(e),()=>{throw new Error(Fe)}).then(cr)}function cr(){let e=window,t="__fpjs_p_l_b",n=e[t];if(function(r,o){var i;let s=(i=Object.getOwnPropertyDescriptor)===null||i===void 0?void 0:i.call(Object,r,o);s?.configurable?delete r[o]:s&&!s.writable||(r[o]=void 0)}(e,t),typeof n?.load!="function")throw new Error(qe);return n}var j={load:sr,defaultScriptUrlPattern:ir,ERROR_SCRIPT_LOAD_FAIL:ae,ERROR_API_KEY_EXPIRED:wt,ERROR_API_KEY_INVALID:Et,ERROR_API_KEY_MISSING:Be,ERROR_BAD_REQUEST_FORMAT:zn,ERROR_BAD_RESPONSE_FORMAT:Ln,ERROR_CLIENT_TIMEOUT:Nn,ERROR_CSP_BLOCK:Fe,ERROR_FORBIDDEN_ENDPOINT:Gn,ERROR_FORBIDDEN_HEADER:Hn,ERROR_FORBIDDEN_ORIGIN:Zn,ERROR_GENERAL_SERVER_FAILURE:Yn,ERROR_HANDLE_AGENT_DATA:Fn,ERROR_INSTALLATION_METHOD_RESTRICTED:Kn,ERROR_INTEGRATION_FAILURE:Vn,ERROR_INVALID_ENDPOINT:Ue,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Wn,ERROR_INVALID_PROXY_INTEGRATION_SECRET:Qn,ERROR_NETWORK_ABORT:Cn,ERROR_NETWORK_CONNECTION:Mn,ERROR_NETWORK_RESTRICTED:jn,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:$n,ERROR_RATE_LIMIT:Xn,ERROR_SERVER_TIMEOUT:Jn,ERROR_SUBSCRIPTION_NOT_ACTIVE:Bn,ERROR_TOKEN_EXPIRED:nr,ERROR_TOKEN_INVALID:tr,ERROR_TOKEN_MISSING:er,ERROR_UNSUPPORTED_VERSION:qn,ERROR_WRONG_REGION:Un,defaultEndpoint:kn,defaultTlsEndpoint:xn};var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function It(e,t=0){return(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase()}var Ke,ur=new Uint8Array(16);function Ge(){if(!Ke){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ke=crypto.getRandomValues.bind(crypto)}return Ke(ur)}var lr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ve={randomUUID:lr};function dr(e,t,n){if(Ve.randomUUID&&!t&&!e)return Ve.randomUUID();e=e||{};let r=e.random??e.rng?.()??Ge();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=r[o];return t}return It(r)}var H=dr;var mr={UNAUTHORIZED:"Unauthorized"},fr={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},Rt={INTERNAL_SERVER_ERROR:"Internal Server Error during API Request",MISSING_CREDENTIALS:"Missing Public Client ID or Public API Key",MAINTENANCE_MODE:"API Under Maintenance",RATE_LIMIT_REACHED:"Too many requests. Rate limit exceeded"},bt={SDK_INIT_ERROR:"Internal Server Error during SDK Initialization",DUPLICATE_INITIALIZATION:"Multiple SDK Initializations Detected",NOT_INITIALIZED:"SDK Not Initialized"},Tt={INVALID_CREDENTIALS:"Invalid Public Client ID or Public API Key"},At={FAILED_TO_GET_SECURITY_RESULT:"Failed to Retrieve Security Result"},St={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},I={...mr,...fr,...Rt,...bt,...Tt,...At,...St},Ot={...Rt,...bt,...Tt,...At,...St};var Q=(g=>(g.AR="ar",g.BN="bn",g.DE="de",g.EN="en",g.ES="es",g.FR="fr",g.HI="hi",g.ID="id",g.IT="it",g.JA="ja",g.KO="ko",g.MS="ms",g.NL="nl",g.PT="pt",g.RU="ru",g.YU="yu",g.ZH="zh",g))(Q||{}),W=(v=>(v.GeneralConsumer="general-consumer",v.HRManagerDirector="hr-manager-director",v.WebDeveloper="web-developer",v.SoftwareEngineer="software-engineer",v.ITDirector="it-director",v.BusinessAdministrator="business-administrator",v.AccountsPayableManager="accounts-payable-manager",v.Accountant="accountant",v.FinanceDirector="finance-director",v.SmallBusinessOwner="small-business-owner",v.GeneralContractor="general-contractor",v.MarketingManagerDirector="marketing-manager-director",v.ConsumerShopper="consumer-shopper",v.Travel="travel",v.Entertainment="entertainment",v.FinanceAndBanking="finance-and-banking",v.General="general",v.B2BWhiteCollar="b2b-white-collar",v.B2BBlueCollar="b2b-blue-collar",v.Lawyer="lawyer",v))(W||{});var $={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},Vo={...$},je={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}]};async function Qe(){return hr()}async function hr(){return new Promise((t,n)=>{try{let i=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),s=i?.createBufferSource(),a=i.createOscillator();a.frequency.value=1e3;let c=i.createDynamicsCompressor();c.threshold.value=-50,c.knee.value=40,c.ratio.value=12,c.attack.value=0,c.release.value=.2,a.connect(c),c.connect(i.destination),a.start();let d;i.oncomplete=u=>{d=u.renderedBuffer.getChannelData(0),t({sampleHash:pr(d),maxChannels:i.destination.maxChannelCount,channelCountMode:s.channelCountMode})},i.startRendering()}catch(r){console.error("Error creating audio fingerprint:",r),n(r)}})}function pr(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function ce(e,t,n){let r=[];for(let s=0;s<e[0].data.length;s++){let a=[];for(let c=0;c<e.length;c++)a.push(e[c].data[s]);r.push(gr(a))}let o=r,i=new Uint8ClampedArray(o);return new ImageData(i,t,n)}function gr(e){if(e.length===0)return 0;let t={};for(let r of e)t[r]=(t[r]||0)+1;let n=e[0];for(let r in t)t[r]>t[n]&&(n=parseInt(r,10));return n}function yr(e){return new TextEncoder().encode(e).buffer}function ue(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^=e>>>16,e>>>0}var _=new Uint32Array([597399067,2869860233,951274213,2716044179]);function C(e,t){return e<<t|e>>>32-t}function Er(e,t){let n=e.byteLength/16|0,r=new Uint32Array(e,0,n*4);for(let o=0;o<n;o++){let i=r.subarray(o*4,(o+1)*4);i[0]=Math.imul(i[0],_[0]),i[0]=C(i[0],15),i[0]=Math.imul(i[0],_[1]),t[0]=t[0]^i[0],t[0]=C(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],_[1]),i[1]=C(i[1],16),i[1]=Math.imul(i[1],_[2]),t[1]=t[1]^i[1],t[1]=C(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],_[2]),i[2]=C(i[2],17),i[2]=Math.imul(i[2],_[3]),t[2]=t[2]^i[2],t[2]=C(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],_[3]),i[3]=C(i[3],18),i[3]=Math.imul(i[3],_[0]),t[3]=t[3]^i[3],t[3]=C(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function wr(e,t){let n=e.byteLength/16|0,r=e.byteLength%16,o=new Uint32Array(4),i=new Uint8Array(e,n*16,r);switch(r){case 15:o[3]=o[3]^i[14]<<16;case 14:o[3]=o[3]^i[13]<<8;case 13:o[3]=o[3]^i[12]<<0,o[3]=Math.imul(o[3],_[3]),o[3]=C(o[3],18),o[3]=Math.imul(o[3],_[0]),t[3]=t[3]^o[3];case 12:o[2]=o[2]^i[11]<<24;case 11:o[2]=o[2]^i[10]<<16;case 10:o[2]=o[2]^i[9]<<8;case 9:o[2]=o[2]^i[8]<<0,o[2]=Math.imul(o[2],_[2]),o[2]=C(o[2],17),o[2]=Math.imul(o[2],_[3]),t[2]=t[2]^o[2];case 8:o[1]=o[1]^i[7]<<24;case 7:o[1]=o[1]^i[6]<<16;case 6:o[1]=o[1]^i[5]<<8;case 5:o[1]=o[1]^i[4]<<0,o[1]=Math.imul(o[1],_[1]),o[1]=C(o[1],16),o[1]=Math.imul(o[1],_[2]),t[1]=t[1]^o[1];case 4:o[0]=o[0]^i[3]<<24;case 3:o[0]=o[0]^i[2]<<16;case 2:o[0]=o[0]^i[1]<<8;case 1:o[0]=o[0]^i[0]<<0,o[0]=Math.imul(o[0],_[0]),o[0]=C(o[0],15),o[0]=Math.imul(o[0],_[1]),t[0]=t[0]^o[0]}}function vr(e,t){t[0]=t[0]^e.byteLength,t[1]=t[1]^e.byteLength,t[2]=t[2]^e.byteLength,t[3]=t[3]^e.byteLength,t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0,t[0]=ue(t[0]),t[1]=ue(t[1]),t[2]=ue(t[2]),t[3]=ue(t[3]),t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0}function O(e,t=0){if(t=t?t|0:0,typeof e=="string"&&(e=yr(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([t,t,t,t]);Er(e,n),wr(e,n),vr(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}var Ir=3,Dt=280,_t=20;async function We(){return Rr()}function Rr(){return new Promise(e=>{let t=Array.from({length:Ir},()=>br()),n=ce(t,Dt,_t);e({commonPixelsHash:O(n.data.toString()).toString()})})}function br(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Dt,e.height=_t;let n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,"red"),n.addColorStop(1/6,"orange"),n.addColorStop(2/6,"yellow"),n.addColorStop(3/6,"green"),n.addColorStop(4/6,"blue"),n.addColorStop(5/6,"indigo"),n.addColorStop(1,"violet"),t.fillStyle=n,t.fillRect(0,0,e.width,e.height);let r="Random Text WMwmil10Oo";return t.font="23.123px Arial",t.fillStyle="black",t.fillText(r,-5,15),t.fillStyle="rgba(0, 0, 255, 0.5)",t.fillText(r,-3.3,17.7),t.beginPath(),t.moveTo(0,0),t.lineTo(e.width*2/7,e.height),t.strokeStyle="white",t.lineWidth=2,t.stroke(),t.getImageData(0,0,e.width,e.height)}async function le(e){for(;!document.body;)await Tr(50);let t=document.createElement("iframe");t.setAttribute("frameBorder","0");let n=t.style;n.setProperty("position","fixed"),n.setProperty("display","block","important"),n.setProperty("visibility","visible"),n.setProperty("border","0"),n.setProperty("opacity","0"),t.src="about:blank",document.body.appendChild(t);let r=t.contentDocument||t.contentWindow?.document;if(!r)throw new Error("Iframe document is not accessible");e({iframe:r}),setTimeout(()=>{document.body.removeChild(t)},0)}function Tr(e,t){return new Promise(n=>setTimeout(n,e,t))}var Ar=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],Sr=["monospace","sans-serif","serif"];async function $e(e){return Or()}function Or(){return new Promise((e,t)=>{try{le(async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d"),i=Sr.map(a=>Pt(o,a)),s={};Ar.forEach(a=>{let c=Pt(o,a);i.includes(c)||(s[a]=c)}),e(s)})}catch{t({error:"unsupported"})}})}function Pt(e,t){if(!e)return null;let n="WwMmLli0Oo";return e.font=`72px ${t}`,e.measureText(n).width}function ze(){return new Promise((e,t)=>{let n=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,r=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:Dr(),architecture:_r(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:r.jsHeapSizeLimit||0})})}function Dr(){let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(t&&"getParameter"in t)try{let n=(t.getParameter(t.VENDOR)||"").toString(),r=(t.getParameter(t.RENDERER)||"").toString(),o={vendor:n,renderer:r,version:(t.getParameter(t.VERSION)||"").toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||"").toString()};if(!r.length||!n.length){let i=t.getExtension("WEBGL_debug_renderer_info");if(i){let s=(t.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),a=(t.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString();s&&(o.vendorUnmasked=s),a&&(o.rendererUnmasked=a)}}return o}catch{}return"undefined"}function _r(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Ye(){return new Promise(e=>{e({languages:Pr(),timezone:kr()})})}function Pr(){let e=[];return navigator.language}function kr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var de=(e,t,n,r)=>{let o=(n-t)/r,i=0;for(let s=0;s<r;s++){let a=t+(s+.5)*o;i+=e(a)}return i*o};function Je(){return new Promise(e=>{e({acos:Math.acos(.5),asin:de(Math.asin,-1,1,97),cos:de(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:de(Math.sin,-Math.PI,Math.PI,97),tan:de(Math.tan,0,2*Math.PI,97)})})}function xr(e){if(e.length===0)return null;let t={};e.forEach(o=>{let i=String(o);t[i]=(t[i]||0)+1});let n=e[0],r=1;return Object.keys(t).forEach(o=>{t[o]>r&&(n=o,r=t[o])}),n}function kt(e,t){let n={};return t.forEach(r=>{let o=e.map(s=>r in s?s[r]:void 0).filter(s=>s!==void 0),i=xr(o);i&&(n[r]=i)}),n}var Nr=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"];async function Xe(e){let t=e?.permissions_to_check||Nr,r=await Promise.all(Array.from({length:3},()=>Mr(t)));return kt(r,t)}async function Mr(e){let t={};for(let n of e)try{let r=await navigator.permissions.query({name:n});t[n]=r.state.toString()}catch{}return t}async function Ze(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join("|"))}return new Promise(t=>{t({plugins:e})})}function z(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};let e=navigator.userAgent,t=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Brave)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],n={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(let r of t){let o=e.match(r);if(o){let i=o.groups?.name,s=o.groups?.version||o.groups?.version1||o.groups?.version2;if(!i&&(o.groups?.version1||o.groups?.version2)&&(i="Safari"),!i&&r.source.includes("Opera Mini")&&(i="Opera Mini"),!i&&r.source.includes("Opera Mobi")&&(i="Opera Mobi"),!i&&r.source.includes("Opera")&&(i="Opera"),!i&&o[1]&&(i=o[1]),!s&&o[2]&&(s=o[2]),i)return{name:n[i.toLowerCase()]||i,version:s||"unknown"}}}return{name:"unknown",version:"unknown"}}function me(){if(typeof navigator>"u"||!navigator.userAgent)return!1;let e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function He(){return new Promise(e=>{let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:Lr()};me()&&navigator.maxTouchPoints>0&&(t.resolution=Cr()),e(t)})}function Cr(){let e=window.screen.width,t=window.screen.height,n=Math.max(e,t).toString(),r=Math.min(e,t).toString();return`${n}x${r}`}function Lr(){let e=[],t={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(t).forEach(n=>{t[n].forEach(r=>{matchMedia(`(${n}: ${r})`).matches&&e.push(`${n}: ${r}`)})}),e}function et(){return new Promise(e=>{let t=z(),n=navigator.userAgent,r={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:me(),applePayVersion:Fr(),cookieEnabled:window.navigator.cookieEnabled};e(r)})}function Fr(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{let e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}var Ur=z().name!=="SamsungBrowser"?1:3,P,p=null;function Br(){typeof document<"u"&&(P=document.createElement("canvas"),P.width=200,P.height=100,p=P.getContext("webgl"))}async function tt(){Br();try{if(!p)throw new Error("WebGL not supported");let e=Array.from({length:Ur},()=>qr()),t=ce(e,P.width,P.height);return{commonPixelsHash:O(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function qr(){try{if(!p)throw new Error("WebGL not supported");let e=`
1
+ "use strict";var Le=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var An=Object.prototype.hasOwnProperty;var Sn=(e,t)=>{for(var n in t)Le(e,n,{get:t[n],enumerable:!0})},On=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!An.call(e,o)&&o!==n&&Le(e,o,{get:()=>t[o],enumerable:!(r=bn(t,o))||r.enumerable});return e};var Dn=e=>On(Le({},"__esModule",{value:!0}),e);var vo={};Sn(vo,{LanguageCodes:()=>W,QualityQuestionsRespondentTypes:()=>$,SecurityAPIError:()=>En,checkQualityQuestions:()=>De,default:()=>wo,getQualityQuestions:()=>Oe,getSecurityResult:()=>Ae,getSecurityToken:()=>Se,init:()=>Rn,isAIUsageDetected:()=>_e});module.exports=Dn(vo);function _n(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function Pn(e,t,n,r){let o=document,i="securitypolicyviolation",s,a=d=>{let u=new URL(e,location.href),{blockedURI:l}=d;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(s=d,c())};o.addEventListener(i,a);let c=()=>o.removeEventListener(i,a);return r?.then(c,c),Promise.resolve().then(t).then(d=>(c(),d),d=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),s)return n(s);throw d}))}function F(e){let t="";for(let n=0;n<e.length;++n)if(n>0){let r=e[n].toLowerCase();r!==e[n]?t+=` ${r}`:t+=e[n]}else t+=e[n].toUpperCase();return t}var kn={default:"endpoint"},xn={default:"tlsEndpoint"},Nn="Client timeout",Mn="Network connection error",Cn="Network request aborted",Ln="Response cannot be parsed",Fe="Blocked by CSP",Ue="The endpoint parameter is not a valid URL",Fn="Handle on demand agent data error",Un=F("WrongRegion"),Bn=F("SubscriptionNotActive"),qn=F("UnsupportedVersion"),Kn=F("InstallationMethodRestricted"),Gn=F("HostnameRestricted"),Vn=F("IntegrationFailed"),jn=F("NetworkRestricted"),Qn=F("InvalidProxyIntegrationSecret"),Wn=F("InvalidProxyIntegrationHeaders"),$n=F("ProxyIntegrationSecretEnvironmentMismatch"),Be="API key required",Et="API key not found",wt="API key expired",zn="Request cannot be parsed",Yn="Request failed",Jn="Request failed to process",Xn="Too many requests, rate limit exceeded",Zn="Not available for this origin",Hn="Not available with restricted header",er=Be,tr=Et,nr=wt,rr="3.12.0",ae="Failed to load the JS script of the agent",qe="9319";function or(e,t){let n=[],[r,o]=function(a){let c=function(l){let f=[...l];return{current:()=>f[0],postpone(){let E=f.shift();E!==void 0&&f.push(E)},exclude(){f.shift()}}}(a),d=function(l,f){let E=0;return()=>Math.random()*Math.min(f,l*Math.pow(2,E++))}(100,3e3),u=new Set;return[c.current(),(l,f)=>{let E,y=f instanceof Error?f.message:"";if(y===Fe||y===Ue)c.exclude(),E=0;else if(y===qe)c.exclude();else if(y===ae){let w=Date.now()-l.getTime()<50,g=c.current();g&&w&&!u.has(g)&&(u.add(g),E=0),c.postpone()}else c.postpone();let h=c.current();return h===void 0?void 0:[h,E??l.getTime()+d()-Date.now()]}]}(e),i;if(r===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));let s=a=>{let c=new Date,d=l=>n.push({url:a,startedAt:c,finishedAt:new Date,error:l}),u=t(a);return u.then(()=>d(),d),u.catch(l=>{if(i!=null||(i=l),n.length>=5)throw i;let f=o(c,l);if(!f)throw i;let[E,y]=f;return(h=y,new Promise(w=>setTimeout(w,h))).then(()=>s(E));var h})};return s(r).then(a=>[a,n])}var vt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",ir=vt;function sr(e){var t,n;let{picked:r,rest:o}=function(u,l){let f={},E={};for(let[y,h]of Object.entries(u))l.includes(y)?f[y]=h:E[y]=h;return{picked:f,rest:E}}(e,["scriptUrlPattern","token","apiKey"]),i=r.token,s=(t=r.apiKey)!==null&&t!==void 0?t:i,a=(n=_n(e,"scriptUrlPattern"))!==null&&n!==void 0?n:vt,[c,d]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},f=function(E,y,h,w){return E.addEventListener(y,h,w),()=>E.removeEventListener(y,h,w)}(document,"visibilitychange",l);return l(),[u,f]}();return Promise.resolve().then(()=>{if(!s||typeof s!="string")throw new Error(Be);let u=function(l,f){return(Array.isArray(l)?l:[l]).map(E=>function(y,h){let w=encodeURIComponent;return y.replace(/<[^<>]+>/g,g=>g==="<version>"?"3":g==="<apiKey>"?w(h):g==="<loaderVersion>"?w(rr):g)}(String(E),f))}(a,s);return or(u,ar)}).catch(u=>{throw d(),function(l){return l instanceof Error&&l.message===qe?new Error(ae):l}(u)}).then(([u,l])=>(d(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function ar(e){return Pn(e,()=>function(t){return new Promise((n,r)=>{if(function(a){if(URL.prototype)try{return new URL(a,location.href),!1}catch(c){if(c instanceof Error&&c.name==="TypeError")return!0;throw c}}(t))throw new Error(Ue);let o=document.createElement("script"),i=()=>{var a;return(a=o.parentNode)===null||a===void 0?void 0:a.removeChild(o)},s=document.head||document.getElementsByTagName("head")[0];o.onload=()=>{i(),n()},o.onerror=()=>{i(),r(new Error(ae))},o.async=!0,o.src=t,s.appendChild(o)})}(e),()=>{throw new Error(Fe)}).then(cr)}function cr(){let e=window,t="__fpjs_p_l_b",n=e[t];if(function(r,o){var i;let s=(i=Object.getOwnPropertyDescriptor)===null||i===void 0?void 0:i.call(Object,r,o);s?.configurable?delete r[o]:s&&!s.writable||(r[o]=void 0)}(e,t),typeof n?.load!="function")throw new Error(qe);return n}var j={load:sr,defaultScriptUrlPattern:ir,ERROR_SCRIPT_LOAD_FAIL:ae,ERROR_API_KEY_EXPIRED:wt,ERROR_API_KEY_INVALID:Et,ERROR_API_KEY_MISSING:Be,ERROR_BAD_REQUEST_FORMAT:zn,ERROR_BAD_RESPONSE_FORMAT:Ln,ERROR_CLIENT_TIMEOUT:Nn,ERROR_CSP_BLOCK:Fe,ERROR_FORBIDDEN_ENDPOINT:Gn,ERROR_FORBIDDEN_HEADER:Hn,ERROR_FORBIDDEN_ORIGIN:Zn,ERROR_GENERAL_SERVER_FAILURE:Yn,ERROR_HANDLE_AGENT_DATA:Fn,ERROR_INSTALLATION_METHOD_RESTRICTED:Kn,ERROR_INTEGRATION_FAILURE:Vn,ERROR_INVALID_ENDPOINT:Ue,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Wn,ERROR_INVALID_PROXY_INTEGRATION_SECRET:Qn,ERROR_NETWORK_ABORT:Cn,ERROR_NETWORK_CONNECTION:Mn,ERROR_NETWORK_RESTRICTED:jn,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:$n,ERROR_RATE_LIMIT:Xn,ERROR_SERVER_TIMEOUT:Jn,ERROR_SUBSCRIPTION_NOT_ACTIVE:Bn,ERROR_TOKEN_EXPIRED:nr,ERROR_TOKEN_INVALID:tr,ERROR_TOKEN_MISSING:er,ERROR_UNSUPPORTED_VERSION:qn,ERROR_WRONG_REGION:Un,defaultEndpoint:kn,defaultTlsEndpoint:xn};var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function It(e,t=0){return(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase()}var Ke,ur=new Uint8Array(16);function Ge(){if(!Ke){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ke=crypto.getRandomValues.bind(crypto)}return Ke(ur)}var lr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ve={randomUUID:lr};function dr(e,t,n){if(Ve.randomUUID&&!t&&!e)return Ve.randomUUID();e=e||{};let r=e.random??e.rng?.()??Ge();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=r[o];return t}return It(r)}var Q=dr;var mr={UNAUTHORIZED:"Unauthorized"},fr={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},Rt={INTERNAL_SERVER_ERROR:"Internal Server Error during API Request",MISSING_CREDENTIALS:"Missing Public Client ID or Public API Key",MAINTENANCE_MODE:"API Under Maintenance",RATE_LIMIT_REACHED:"Too many requests. Rate limit exceeded"},bt={SDK_INIT_ERROR:"Internal Server Error during SDK Initialization",DUPLICATE_INITIALIZATION:"Multiple SDK Initializations Detected",NOT_INITIALIZED:"SDK Not Initialized"},Tt={INVALID_CREDENTIALS:"Invalid Public Client ID or Public API Key"},At={FAILED_TO_GET_SECURITY_RESULT:"Failed to Retrieve Security Result"},St={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},I={...mr,...fr,...Rt,...bt,...Tt,...At,...St},Ot={...Rt,...bt,...Tt,...At,...St};var W=(g=>(g.AR="ar",g.BN="bn",g.DE="de",g.EN="en",g.ES="es",g.FR="fr",g.HI="hi",g.ID="id",g.IT="it",g.JA="ja",g.KO="ko",g.MS="ms",g.NL="nl",g.PT="pt",g.RU="ru",g.YU="yu",g.ZH="zh",g))(W||{}),$=(v=>(v.GeneralConsumer="general-consumer",v.HRManagerDirector="hr-manager-director",v.WebDeveloper="web-developer",v.SoftwareEngineer="software-engineer",v.ITDirector="it-director",v.BusinessAdministrator="business-administrator",v.AccountsPayableManager="accounts-payable-manager",v.Accountant="accountant",v.FinanceDirector="finance-director",v.SmallBusinessOwner="small-business-owner",v.GeneralContractor="general-contractor",v.MarketingManagerDirector="marketing-manager-director",v.ConsumerShopper="consumer-shopper",v.Travel="travel",v.Entertainment="entertainment",v.FinanceAndBanking="finance-and-banking",v.General="general",v.B2BWhiteCollar="b2b-white-collar",v.B2BBlueCollar="b2b-blue-collar",v.Lawyer="lawyer",v))($||{});var z={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},Vo={...z},je={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}]};async function Qe(){return hr()}async function hr(){return new Promise((t,n)=>{try{let i=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),s=i?.createBufferSource(),a=i.createOscillator();a.frequency.value=1e3;let c=i.createDynamicsCompressor();c.threshold.value=-50,c.knee.value=40,c.ratio.value=12,c.attack.value=0,c.release.value=.2,a.connect(c),c.connect(i.destination),a.start();let d;i.oncomplete=u=>{d=u.renderedBuffer.getChannelData(0),t({sampleHash:pr(d),maxChannels:i.destination.maxChannelCount,channelCountMode:s.channelCountMode})},i.startRendering()}catch(r){console.error("Error creating audio fingerprint:",r),n(r)}})}function pr(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function ce(e,t,n){let r=[];for(let s=0;s<e[0].data.length;s++){let a=[];for(let c=0;c<e.length;c++)a.push(e[c].data[s]);r.push(gr(a))}let o=r,i=new Uint8ClampedArray(o);return new ImageData(i,t,n)}function gr(e){if(e.length===0)return 0;let t={};for(let r of e)t[r]=(t[r]||0)+1;let n=e[0];for(let r in t)t[r]>t[n]&&(n=parseInt(r,10));return n}function yr(e){return new TextEncoder().encode(e).buffer}function ue(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^=e>>>16,e>>>0}var _=new Uint32Array([597399067,2869860233,951274213,2716044179]);function C(e,t){return e<<t|e>>>32-t}function Er(e,t){let n=e.byteLength/16|0,r=new Uint32Array(e,0,n*4);for(let o=0;o<n;o++){let i=r.subarray(o*4,(o+1)*4);i[0]=Math.imul(i[0],_[0]),i[0]=C(i[0],15),i[0]=Math.imul(i[0],_[1]),t[0]=t[0]^i[0],t[0]=C(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],_[1]),i[1]=C(i[1],16),i[1]=Math.imul(i[1],_[2]),t[1]=t[1]^i[1],t[1]=C(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],_[2]),i[2]=C(i[2],17),i[2]=Math.imul(i[2],_[3]),t[2]=t[2]^i[2],t[2]=C(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],_[3]),i[3]=C(i[3],18),i[3]=Math.imul(i[3],_[0]),t[3]=t[3]^i[3],t[3]=C(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function wr(e,t){let n=e.byteLength/16|0,r=e.byteLength%16,o=new Uint32Array(4),i=new Uint8Array(e,n*16,r);switch(r){case 15:o[3]=o[3]^i[14]<<16;case 14:o[3]=o[3]^i[13]<<8;case 13:o[3]=o[3]^i[12]<<0,o[3]=Math.imul(o[3],_[3]),o[3]=C(o[3],18),o[3]=Math.imul(o[3],_[0]),t[3]=t[3]^o[3];case 12:o[2]=o[2]^i[11]<<24;case 11:o[2]=o[2]^i[10]<<16;case 10:o[2]=o[2]^i[9]<<8;case 9:o[2]=o[2]^i[8]<<0,o[2]=Math.imul(o[2],_[2]),o[2]=C(o[2],17),o[2]=Math.imul(o[2],_[3]),t[2]=t[2]^o[2];case 8:o[1]=o[1]^i[7]<<24;case 7:o[1]=o[1]^i[6]<<16;case 6:o[1]=o[1]^i[5]<<8;case 5:o[1]=o[1]^i[4]<<0,o[1]=Math.imul(o[1],_[1]),o[1]=C(o[1],16),o[1]=Math.imul(o[1],_[2]),t[1]=t[1]^o[1];case 4:o[0]=o[0]^i[3]<<24;case 3:o[0]=o[0]^i[2]<<16;case 2:o[0]=o[0]^i[1]<<8;case 1:o[0]=o[0]^i[0]<<0,o[0]=Math.imul(o[0],_[0]),o[0]=C(o[0],15),o[0]=Math.imul(o[0],_[1]),t[0]=t[0]^o[0]}}function vr(e,t){t[0]=t[0]^e.byteLength,t[1]=t[1]^e.byteLength,t[2]=t[2]^e.byteLength,t[3]=t[3]^e.byteLength,t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0,t[0]=ue(t[0]),t[1]=ue(t[1]),t[2]=ue(t[2]),t[3]=ue(t[3]),t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0}function O(e,t=0){if(t=t?t|0:0,typeof e=="string"&&(e=yr(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([t,t,t,t]);Er(e,n),wr(e,n),vr(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}var Ir=3,Dt=280,_t=20;async function We(){return Rr()}function Rr(){return new Promise(e=>{let t=Array.from({length:Ir},()=>br()),n=ce(t,Dt,_t);e({commonPixelsHash:O(n.data.toString()).toString()})})}function br(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Dt,e.height=_t;let n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,"red"),n.addColorStop(1/6,"orange"),n.addColorStop(2/6,"yellow"),n.addColorStop(3/6,"green"),n.addColorStop(4/6,"blue"),n.addColorStop(5/6,"indigo"),n.addColorStop(1,"violet"),t.fillStyle=n,t.fillRect(0,0,e.width,e.height);let r="Random Text WMwmil10Oo";return t.font="23.123px Arial",t.fillStyle="black",t.fillText(r,-5,15),t.fillStyle="rgba(0, 0, 255, 0.5)",t.fillText(r,-3.3,17.7),t.beginPath(),t.moveTo(0,0),t.lineTo(e.width*2/7,e.height),t.strokeStyle="white",t.lineWidth=2,t.stroke(),t.getImageData(0,0,e.width,e.height)}async function le(e){for(;!document.body;)await Tr(50);let t=document.createElement("iframe");t.setAttribute("frameBorder","0");let n=t.style;n.setProperty("position","fixed"),n.setProperty("display","block","important"),n.setProperty("visibility","visible"),n.setProperty("border","0"),n.setProperty("opacity","0"),t.src="about:blank",document.body.appendChild(t);let r=t.contentDocument||t.contentWindow?.document;if(!r)throw new Error("Iframe document is not accessible");e({iframe:r}),setTimeout(()=>{document.body.removeChild(t)},0)}function Tr(e,t){return new Promise(n=>setTimeout(n,e,t))}var Ar=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],Sr=["monospace","sans-serif","serif"];async function $e(e){return Or()}function Or(){return new Promise((e,t)=>{try{le(async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d"),i=Sr.map(a=>Pt(o,a)),s={};Ar.forEach(a=>{let c=Pt(o,a);i.includes(c)||(s[a]=c)}),e(s)})}catch{t({error:"unsupported"})}})}function Pt(e,t){if(!e)return null;let n="WwMmLli0Oo";return e.font=`72px ${t}`,e.measureText(n).width}function ze(){return new Promise((e,t)=>{let n=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,r=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:Dr(),architecture:_r(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:r.jsHeapSizeLimit||0})})}function Dr(){let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(t&&"getParameter"in t)try{let n=(t.getParameter(t.VENDOR)||"").toString(),r=(t.getParameter(t.RENDERER)||"").toString(),o={vendor:n,renderer:r,version:(t.getParameter(t.VERSION)||"").toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||"").toString()};if(!r.length||!n.length){let i=t.getExtension("WEBGL_debug_renderer_info");if(i){let s=(t.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),a=(t.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString();s&&(o.vendorUnmasked=s),a&&(o.rendererUnmasked=a)}}return o}catch{}return"undefined"}function _r(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Ye(){return new Promise(e=>{e({languages:Pr(),timezone:kr()})})}function Pr(){let e=[];return navigator.language}function kr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var de=(e,t,n,r)=>{let o=(n-t)/r,i=0;for(let s=0;s<r;s++){let a=t+(s+.5)*o;i+=e(a)}return i*o};function Je(){return new Promise(e=>{e({acos:Math.acos(.5),asin:de(Math.asin,-1,1,97),cos:de(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:de(Math.sin,-Math.PI,Math.PI,97),tan:de(Math.tan,0,2*Math.PI,97)})})}function xr(e){if(e.length===0)return null;let t={};e.forEach(o=>{let i=String(o);t[i]=(t[i]||0)+1});let n=e[0],r=1;return Object.keys(t).forEach(o=>{t[o]>r&&(n=o,r=t[o])}),n}function kt(e,t){let n={};return t.forEach(r=>{let o=e.map(s=>r in s?s[r]:void 0).filter(s=>s!==void 0),i=xr(o);i&&(n[r]=i)}),n}var Nr=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"];async function Xe(e){let t=e?.permissions_to_check||Nr,r=await Promise.all(Array.from({length:3},()=>Mr(t)));return kt(r,t)}async function Mr(e){let t={};for(let n of e)try{let r=await navigator.permissions.query({name:n});t[n]=r.state.toString()}catch{}return t}async function Ze(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join("|"))}return new Promise(t=>{t({plugins:e})})}function Y(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};let e=navigator.userAgent,t=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Brave)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],n={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(let r of t){let o=e.match(r);if(o){let i=o.groups?.name,s=o.groups?.version||o.groups?.version1||o.groups?.version2;if(!i&&(o.groups?.version1||o.groups?.version2)&&(i="Safari"),!i&&r.source.includes("Opera Mini")&&(i="Opera Mini"),!i&&r.source.includes("Opera Mobi")&&(i="Opera Mobi"),!i&&r.source.includes("Opera")&&(i="Opera"),!i&&o[1]&&(i=o[1]),!s&&o[2]&&(s=o[2]),i)return{name:n[i.toLowerCase()]||i,version:s||"unknown"}}}return{name:"unknown",version:"unknown"}}function me(){if(typeof navigator>"u"||!navigator.userAgent)return!1;let e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function He(){return new Promise(e=>{let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:Lr()};me()&&navigator.maxTouchPoints>0&&(t.resolution=Cr()),e(t)})}function Cr(){let e=window.screen.width,t=window.screen.height,n=Math.max(e,t).toString(),r=Math.min(e,t).toString();return`${n}x${r}`}function Lr(){let e=[],t={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(t).forEach(n=>{t[n].forEach(r=>{matchMedia(`(${n}: ${r})`).matches&&e.push(`${n}: ${r}`)})}),e}function et(){return new Promise(e=>{let t=Y(),n=navigator.userAgent,r={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:me(),applePayVersion:Fr(),cookieEnabled:window.navigator.cookieEnabled};e(r)})}function Fr(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{let e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}var Ur=Y().name!=="SamsungBrowser"?1:3,P,p=null;function Br(){typeof document<"u"&&(P=document.createElement("canvas"),P.width=200,P.height=100,p=P.getContext("webgl"))}async function tt(){Br();try{if(!p)throw new Error("WebGL not supported");let e=Array.from({length:Ur},()=>qr()),t=ce(e,P.width,P.height);return{commonPixelsHash:O(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function qr(){try{if(!p)throw new Error("WebGL not supported");let e=`
2
2
  attribute vec2 position;
3
3
  void main() {
4
4
  gl_Position = vec4(position, 0.0, 1.0);
@@ -8,4 +8,4 @@
8
8
  void main() {
9
9
  gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
10
10
  }
11
- `,n=p.createShader(p.VERTEX_SHADER),r=p.createShader(p.FRAGMENT_SHADER);if(!n||!r)throw new Error("Failed to create shaders");if(p.shaderSource(n,e),p.shaderSource(r,t),p.compileShader(n),!p.getShaderParameter(n,p.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+p.getShaderInfoLog(n));if(p.compileShader(r),!p.getShaderParameter(r,p.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+p.getShaderInfoLog(r));let o=p.createProgram();if(!o)throw new Error("Failed to create shader program");if(p.attachShader(o,n),p.attachShader(o,r),p.linkProgram(o),!p.getProgramParameter(o,p.LINK_STATUS))throw new Error("Shader program linking failed: "+p.getProgramInfoLog(o));p.useProgram(o);let i=137,s=new Float32Array(i*4),a=2*Math.PI/i;for(let f=0;f<i;f++){let E=f*a;s[f*4]=0,s[f*4+1]=0,s[f*4+2]=Math.cos(E)*(P.width/2),s[f*4+3]=Math.sin(E)*(P.height/2)}let c=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,c),p.bufferData(p.ARRAY_BUFFER,s,p.STATIC_DRAW);let d=p.getAttribLocation(o,"position");p.enableVertexAttribArray(d),p.vertexAttribPointer(d,2,p.FLOAT,!1,0,0),p.viewport(0,0,P.width,P.height),p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.LINES,0,i*2);let u=new Uint8ClampedArray(P.width*P.height*4);return p.readPixels(0,0,P.width,P.height,p.RGBA,p.UNSIGNED_BYTE,u),new ImageData(u,P.width,P.height)}catch{return new ImageData(1,1)}finally{p&&(p.bindBuffer(p.ARRAY_BUFFER,null),p.useProgram(null),p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight),p.clearColor(0,0,0,0))}}function N(e){let t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let o,i;if(Array.isArray(r)){for(i="[",o=0;o<r.length;o++)o&&(i+=","),i+=n(r[o])||"null";return i+"]"}if(r===null)return"null";if(t.indexOf(r)!==-1)throw new TypeError("Converting circular structure to JSON");let s=t.push(r)-1,a=Object.keys(r).sort();for(i="",o=0;o<a.length;o++){let c=a[o],d=n(r[c]);d&&(i&&(i+=","),i+=JSON.stringify(c)+":"+d)}return t.splice(s,1),"{"+i+"}"}(e)||""}async function nt(){return new Promise(e=>{try{let t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t){e({supported:!1,error:"WebRTC not supported"});return}let n={iceCandidatePoolSize:1,iceServers:[]},r=new t(n);r.createDataChannel(""),(async()=>{try{let i={offerToReceiveAudio:!0,offerToReceiveVideo:!0},s=await r.createOffer(i);await r.setLocalDescription(s);let a=s.sdp||"",c=[...new Set((a.match(/extmap:\d+ [^\n\r]+/g)||[]).map(h=>h.replace(/extmap:\d+ /,"")))].sort(),d=h=>{let w=a.match(new RegExp(`m=${h} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},u=(h,w)=>w.map(g=>{let A=new RegExp(`(rtpmap|fmtp|rtcp-fb):${g} (.+)`,"g"),x=[...a.matchAll(A)];if(!x.length)return null;let v={};return x.forEach(xe=>{let[Io,Ne,Me]=xe,Ce=Me.split("/");Ne==="rtpmap"?(v.mimeType=`${h}/${Ce[0]}`,v.clockRate=+Ce[1],h==="audio"&&(v.channels=+Ce[2]||1)):Ne==="rtcp-fb"?(v.feedbackSupport=v.feedbackSupport||[],v.feedbackSupport.push(Me)):Ne==="fmtp"&&(v.sdpFmtpLine=Me)}),v}).filter(Boolean),l=u("audio",d("audio")),f=u("video",d("video")),E={audio:{count:l.length,hash:O(N(l))},video:{count:f.length,hash:O(N(f))},extensionsHash:O(N(c))},y=await new Promise(h=>{let w=setTimeout(()=>{r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,timeout:!0})},3e3),g=A=>{let x=A.candidate;!x||!x.candidate||(clearTimeout(w),r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,candidateType:x.type||""}))};r.addEventListener("icecandidate",g)});e({details:y,hash:O(N(y))})}catch(i){r.close(),e({supported:!0,error:`WebRTC offer failed: ${i.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}})}var xt=["\u{1D504}","\u{1D505}","\u212D","\u{1D507}","\u{1D508}","\u{1D509}","\u{1D538}","\u{1D539}","\u2102","\u{1D53B}","\u{1D53C}","\u{1D53D}"],Nt=["\u03B2","\u03C8","\u03BB","\u03B5","\u03B6","\u03B1","\u03BE","\u03BC","\u03C1","\u03C6","\u03BA","\u03C4","\u03B7","\u03C3","\u03B9","\u03C9","\u03B3","\u03BD","\u03C7","\u03B4","\u03B8","\u03C0","\u03C5","\u03BF"];async function rt(){return new Promise(e=>{try{le(async({iframe:t})=>{try{if(!Kr(t)){e({supported:!1,error:"MathML not supported"});return}let n=[ee("integral","<msubsup><mo>\u222B</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>"),ee("fraction","<mfrac><mrow><mi>\u03C0</mi><mo>\xD7</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>\u03C3</mi></mrow></mfrac>"),ee("matrix","<mo>[</mo><mtable><mtr><mtd><mi>\u03B1</mi></mtd><mtd><mi>\u03B2</mi></mtd></mtr><mtr><mtd><mi>\u03B3</mi></mtd><mtd><mi>\u03B4</mi></mtd></mtr></mtable><mo>]</mo>"),Gr(),...Vr()],r=[],o="";n.forEach((s,a)=>{let c=jr(s,t);r.push({width:c.dimensions.width,height:c.dimensions.height}),a===0&&c.fontInfo&&(o=O(N(c.fontInfo)))});let i={fontStyleHash:o,dimensions:r};e({details:i,hash:O(N(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function Kr(e){try{let t=e.createElement("math");t.innerHTML="<mrow><mi>x</mi></mrow>",t.style.position="absolute",t.style.visibility="hidden",e.body.appendChild(t);let n=t.getBoundingClientRect();return e.body.removeChild(t),n.width>0&&n.height>0}catch{return!1}}function ee(e,t){return`<math><mrow>${t}</mrow></math>`}function Gr(){let e="<mo>\u220F</mo>";return xt.forEach((t,n)=>{let r=n*2,o=Nt.slice(r,r+2);o.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`)}),ee("complex_nested",`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function Vr(){let e=[];return xt.forEach((t,n)=>{let r=n*2,o=Nt.slice(r,r+2);o.length===2&&e.push(ee("combined",`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`))}),e}function jr(e,t){try{let n=t.createElement("math");n.innerHTML=e.replace(/<\/?math>/g,""),n.style.whiteSpace="nowrap",n.style.position="absolute",n.style.visibility="hidden",n.style.top="-9999px",t.body.appendChild(n);let r=n.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(n),s={dimensions:{width:r.width,height:r.height},fontInfo:{fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle,lineHeight:i.lineHeight,fontVariant:i.fontVariant||"normal",fontStretch:i.fontStretch||"normal",fontSizeAdjust:i.fontSizeAdjust||"none",textRendering:i.textRendering||"auto",fontFeatureSettings:i.fontFeatureSettings||"normal",fontVariantNumeric:i.fontVariantNumeric||"normal",fontKerning:i.fontKerning||"auto"}};return t.body.removeChild(n),s}catch(n){return{error:n.message}}}var Qr=800;async function ot(){return new Promise(e=>{try{if(typeof window>"u"||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!="function"){e({supported:!1,error:"Speech Synthesis API not supported"});return}let t=!1,n=null,r=s=>{if(!t){t=!0,n&&clearTimeout(n);try{let a=s.map(d=>{let u=f=>f.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(d.voiceURI||""),u(d.name||""),u(d.lang||""),d.localService?"1":"0",d.default?"1":"0"].join(",")});a.sort();let c={voiceCount:s.length,voicesHash:O(N(a))};e({details:c,hash:O(N(c))})}catch(a){e({supported:!0,error:`Voice processing failed: ${a.message}`})}}},o=window.speechSynthesis.getVoices();if(o.length>0){r(o);return}n=setTimeout(()=>{let s=window.speechSynthesis.getVoices();r(s)},Qr);let i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);let s=window.speechSynthesis.getVoices();r(s)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}})}var Mt={audio:Qe,canvas:We,fonts:$e,hardware:ze,locales:Ye,math:Je,permissions:Xe,plugins:Ze,screen:He,system:et,webgl:tt},Ct={webrtc:nt,mathml:rt,speech:ot},it={},Lt={timeout:"true"},st=(e,t,n)=>{it[e]=t};function Wr(e,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function Ft(e,t,n){return Promise.all(e.map(r=>{let o=performance.now();return Promise.race([r.then(i=>({value:i,elapsed:performance.now()-o})),Wr(t,n).then(i=>({value:i,elapsed:performance.now()-o}))])}))}function fe(e,t){let n=z();if(n.name==="unknown"&&e.system&&typeof e.system=="object"&&!Array.isArray(e.system)){let l=e.system.browser;if(l&&typeof l=="object"&&!Array.isArray(l)){let f=l;n={name:f.name||"unknown",version:f.version||"unknown"}}}let r=n.name.toLowerCase(),o=n.version.split(".")[0]||"0",i=parseInt(o,10),s=[...t?.exclude||[]],a=t?.stabilize||[],c=t?.include||[];for(let u of a){let l=je[u];if(l)for(let f of l){let E=!("browsers"in f),y=!E&&f.browsers?.some(h=>{let w=h.match(/(.+?)(>=)(\d+)/);if(w){let[,g,,A]=w,x=parseInt(A,10);return r===g&&i>=x}return r===h});(E||y)&&s.push(...f.exclude)}}function d(u,l=""){let f={};for(let[E,y]of Object.entries(u)){let h=l?`${l}.${E}`:E;if(typeof y=="object"&&!Array.isArray(y)&&y!==null){let w=d(y,h);Object.keys(w).length>0&&(f[E]=w)}else{let w=s.some(A=>h.startsWith(A)),g=c.some(A=>h.startsWith(A));(!w||g)&&(f[E]=y)}}return f}return d(e)}async function at(e){let t={...$,...e},n=t.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,r={...Mt,...it},{elapsed:o,resolvedComponents:i}=await Ut(r,t),s={},a={};if(n||t.experimental){let{elapsed:w,resolvedComponents:g}=await Ut(Ct,t);s=g,a=w}let c={...o,...a},d=t.performance?{elapsed:c}:{},u=fe({},t),l={...i,...u},f={};return{thumbmark:O(N(l)),components:l,info:f,version:"",...d,...Object.keys(s).length>0&&t.experimental&&{experimental:s}}}async function Ut(e,t){let n={...$,...t},r=Object.entries(e).filter(([u])=>!n?.exclude?.includes(u)).filter(([u])=>n?.include?.some(l=>l.includes("."))?n?.include?.some(l=>l.startsWith(u)):n?.include?.length===0||n?.include?.includes(u)),o=r.map(([u])=>u),i=r.map(([u,l])=>l(t)),s=await Ft(i,n?.timeout||5e3,Lt),a={},c={};s.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,a[o[l]]=u.elapsed??0)});let d=fe(c,n);return{elapsed:a,resolvedComponents:d}}var te=class{options;constructor(t){this.options={...$,...t}}async get(t){let n={...this.options,...t};return at(n)}getVersion(){return""}includeComponent(t,n){st(t,n)}};var $r=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),zr=async(e,t)=>{if(!e.ok){let n=await e.text();throw new Error(n)}return t==="file"?e.blob():t==="json"?e.json():t==="text"?e.text():null},Bt=async({url:e,auth:t,body:n,method:r="GET",headers:o={},responseType:i="json"})=>{let s={method:r,headers:$r(t,o),...n?{body:n instanceof FormData?n:JSON.stringify(n)}:{}},a=await fetch(e,s);return zr(a,i)},ct=e=>Bt({...e,method:"GET"}),he=e=>Bt({...e,method:"POST"});function qt(e){let t=e?.qbc||!1,n=e?.mas||!1,r=e?.apd||!1,o=e?.scb||null,i=0,s=()=>{t=!1,n=!1,r=!1,o=void 0,i=0},a=()=>{let l=window?.getSelection()?.toString();l&&l.length>0&&(i=Date.now(),t=!0)},c=u=>{let l=u.clipboardData?.getData("text"),f=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&f&&(r=!0)},d=()=>{n=!0;let u=Date.now();if(i){let l=(u-i)/1e3;(o===void 0||l<o)&&(o=l)}};return document?.addEventListener("copy",a),document?.addEventListener("paste",c),window?.addEventListener("blur",d),{get qbc(){return t},get mas(){return n},get apd(){return r},get scb(){return o},reset:s,destroy(){document?.removeEventListener("copy",a),document?.removeEventListener("paste",c),window?.removeEventListener("blur",d)}}}var q=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var K=typeof window>"u"||"Deno"in globalThis;function M(){}function Vt(e,t){return typeof e=="function"?e(t):e}function jt(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lt(e,t){return typeof e=="function"?e(t):e}function Wt(e,t){return typeof e=="function"?e(t):e}function dt(e,t){let{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==ne(s,t.options))return!1}else if(!J(t.queryKey,s))return!1}if(n!=="all"){let c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function mt(e,t){let{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Y(t.options.mutationKey)!==Y(i))return!1}else if(!J(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ne(e,t){return(t?.queryKeyHashFn||Y)(e)}function Y(e){return JSON.stringify(e,(t,n)=>ut(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function J(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!J(e[n],t[n])):!1}function $t(e,t){if(e===t)return e;let n=Kt(e)&&Kt(t);if(n||ut(e)&&ut(t)){let r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},c=0;for(let d=0;d<s;d++){let u=n?d:i[d];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,c++):(a[u]=$t(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&c++)}return o===s&&c===o?e:a}return t}function Kt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ut(e){if(!Gt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Gt(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gt(e){return Object.prototype.toString.call(e)==="[object Object]"}function zt(e){return new Promise(t=>{setTimeout(t,e)})}function Yt(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$t(e,t):t}function Jt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Xt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var re=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===re?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Yr=class extends q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ge=new Yr;var Jr=class extends q{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},X=new Jr;function Zt(){let e,t,n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Xr(e){return Math.min(1e3*2**e,3e4)}function ft(e){return(e??"online")==="online"?X.isOnline():!0}var Ht=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){return e instanceof Ht}function Ee(e){let t=!1,n=0,r=!1,o,i=Zt(),s=h=>{r||(f(new Ht(h)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},d=()=>ge.isFocused()&&(e.networkMode==="always"||X.isOnline())&&e.canRun(),u=()=>ft(e.networkMode)&&e.canRun(),l=h=>{r||(r=!0,e.onSuccess?.(h),o?.(),i.resolve(h))},f=h=>{r||(r=!0,e.onError?.(h),o?.(),i.reject(h))},E=()=>new Promise(h=>{o=w=>{(r||d())&&h(w)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let h,w=n===0?e.initialPromise:void 0;try{h=w??e.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{if(r)return;let A=e.retry??(K?0:3),x=e.retryDelay??Xr,v=typeof x=="function"?x(n,g):x,xe=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,g);if(t||!xe){f(g);return}n++,e.onFail?.(n,g),zt(v).then(()=>d()?void 0:E()).then(()=>{t?f(g):y()})})};return{promise:i,cancel:s,continue:()=>(o?.(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?y():E().then(y),i)}}function Zr(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0),i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{let a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||s()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var b=Zr();var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(K?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var en=class extends we{#e;#t;#n;#r;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=eo(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){let n=Yt(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Wt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===re||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Qt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){let a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}let n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{let a=pe(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return r(c),this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});let s=a=>{ye(a)&&a.silent||this.#o({type:"error",error:a}),ye(a)||(this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this)),this.scheduleGc()};return this.#r=Ee({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(a)}catch(c){s(c);return}this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),this.scheduleGc()},onError:s,onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){let t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Hr(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;return ye(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),b.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Hr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ft(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function eo(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oe=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,o=t.queryHash??ne(r,t),i=this.get(o);return i||(i=new en({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){b.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(n=>dt(t,n))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(n=>dt(e,n)):t}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){b.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};var tn=class extends we{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||to(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=Ee({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);let o=await this.options.onMutate?.(e);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:n})}let r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#t.runNext(this)}}#r(e){let t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),b.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function to(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ie=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new tn({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);if(n)if(n.length>1){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=ve(e);if(typeof t=="string"){let r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){let t=ve(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){b.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(n=>mt(t,n))}findAll(e={}){return this.getAll().filter(t=>mt(e,t))}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(t=>t.state.isPaused);return b.batch(()=>Promise.all(e.map(t=>t.continue().catch(M))))}};function ve(e){return e.options.scope?.id}function ht(e){return{onFetch:(t,n)=>{let r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},c=0,d=async()=>{let u=!1,l=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=pe(t.options,t.fetchOptions),E=async(y,h,w)=>{if(u)return Promise.reject();if(h==null&&y.pages.length)return Promise.resolve(y);let g={queryKey:t.queryKey,pageParam:h,direction:w?"backward":"forward",meta:t.options.meta};l(g);let A=await f(g),{maxPages:x}=t.options,v=w?Xt:Jt;return{pages:v(y.pages,A,x),pageParams:v(y.pageParams,h,x)}};if(o&&i.length){let y=o==="backward",h=y?no:nn,w={pages:i,pageParams:s},g=h(r,w);a=await E(w,g,y)}else{let y=e??i.length;do{let h=c===0?s[0]??r.initialPageParam:nn(r,a);if(c>0&&h==null)break;a=await E(a,h),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function nn(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function no(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var pt=class{#e;#t;#n;#r;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new oe,this.#t=e.mutationCache||new ie,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=X.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(lt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{let r=n.data;return[t,r]})}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,s=Vt(t,i);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return b.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;b.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){let n=this.#e,r={type:"active",...e};return b.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=b.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(M).catch(M)}invalidateQueries(e,t={}){return b.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=b.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(M)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(M)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(lt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(M).catch(M)}fetchInfiniteQuery(e){return e.behavior=ht(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(M).catch(M)}ensureInfiniteQueryData(e){return e.behavior=ht(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return X.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(r=>{J(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(Y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#s.values()],n={};return t.forEach(r=>{J(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ne(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===re&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var ro=new pt({defaultOptions:{queries:{staleTime:3e4}},queryCache:new oe({onError:(e,t)=>{}}),mutationCache:new ie}),rn=ro;var oo=[{name:"lowCpuCores",weight:1,async check(){let e=navigator.hardwareConcurrency||0,t=e>0&&e<=2;return{value:e,triggered:t}}},{name:"lowDeviceMemory",weight:1,async check(){let e=navigator.deviceMemory||0,t=e>0&&e<=4;return{value:e,triggered:t}}},{name:"platformMismatch",weight:1,async check(){let e=navigator.userAgent||"",t=navigator.platform||"",n=e.includes("Mac")&&t.includes("Linux")||e.includes("Win")&&t.includes("Mac")||t===""||t==="Unknown";return{value:t,triggered:n}}},{name:"webglSoftwareRenderer",weight:2,async check(){let e=null,t=null,n=!1;try{let r=document.createElement("canvas"),o=r.getContext("webgl")||r.getContext("experimental-webgl");if(o){let i=o.getExtension("WEBGL_debug_renderer_info");if(i){e=o.getParameter(i.UNMASKED_VENDOR_WEBGL)||"",t=o.getParameter(i.UNMASKED_RENDERER_WEBGL)||"";let s=t.toLowerCase(),a=e.toLowerCase();n=s.includes("swiftshader")||s.includes("llvmpipe")||s.includes("softwar")||s.includes("basic render")||s.includes("vmware")||s.includes("virtualbox")||a.includes("vmware")||a.includes("parallels")}}}catch{}return{value:{vendor:e,renderer:t},triggered:n}}},{name:"missingWebGPUAdapter",weight:2,async check(){if(!("gpu"in navigator))return{value:"no WebGPU",triggered:!0};try{let e=await navigator.gpu.requestAdapter();return{value:e?"adapter-present":"adapter-null",triggered:!e}}catch{return{value:"adapter-error",triggered:!0}}}},{name:"reducedTimerPrecision",weight:1,async check(){let e=performance.now();await new Promise(r=>setTimeout(r,50));let t=performance.now()-e,n=t<30||t>80;return{value:t.toFixed(2),triggered:n}}},{name:"timerJitter",weight:1,async check(){let e=[];for(let r=0;r<10;r++){let o=performance.now();await new Promise(s=>setTimeout(s,10));let i=performance.now();e.push(i-o)}let t=Math.sqrt(e.map(r=>(r-10)**2).reduce((r,o)=>r+o)/e.length),n=t>5;return{value:t.toFixed(3),triggered:n}}},{name:"audioFingerprint",weight:1,async check(){try{let e=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,44100,44100),t=e.createOscillator();t.frequency.value=440,t.connect(e.destination),t.start(0);let r=(await e.startRendering()).getChannelData(0).reduce((i,s)=>i+Math.abs(s),0),o=r<100;return{value:r,triggered:o}}catch{return{value:"audio-error",triggered:!0}}}},{name:"canvasEntropy",weight:1,async check(){try{let e=document.createElement("canvas"),t=e.getContext("2d");t.textBaseline="top",t.font="14px 'Arial'",t.fillText("VM CHECK",2,2);let r=[...e.toDataURL()].reduce((i,s)=>(i+s.charCodeAt(0))%9999999,0);return{value:r,triggered:r===0||r===999999}}catch{return{value:"canvas-error",triggered:!0}}}},{name:"windowSizeWeird",weight:1,async check(){let e=window.innerWidth/window.innerHeight,t=e===1.333||e===1.6;return{value:e.toFixed(2),triggered:t}}},{name:"touchMismatch",weight:1,async check(){let e="ontouchstart"in window,t=navigator.maxTouchPoints||0;return{value:{hasTouch:e,maxTouch:t},triggered:e&&t===0}}},{name:"batteryVirtualized",weight:1,async check(){if(!navigator.getBattery)return{value:"no API",triggered:!0};try{let e=await navigator.getBattery(),t=e.chargingTime===0&&e.dischargingTime===1/0;return{value:{chargingTime:e.chargingTime,dischargingTime:e.dischargingTime},triggered:t}}catch{return{value:"battery-error",triggered:!0}}}},{name:"permissionsWeird",weight:1,async check(){try{let e=await navigator.permissions.query({name:"camera"}),t=e.state==="prompt";return{value:e.state,triggered:t}}catch{return{value:"perm-error",triggered:!0}}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.length===0;return{value:e.length,triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"virtualizedMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.some(n=>n.label.toLowerCase().includes("virtual"));return{value:e.map(n=>n.label),triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"webrtcIpPattern",weight:2,async check(){return new Promise(e=>{let t=new RTCPeerConnection({iceServers:[]});t.createDataChannel("x"),t.onicecandidate=n=>{if(!n||!n.candidate){e({value:"no candidate",triggered:!0});return}let r=n.candidate.candidate.toLowerCase(),o=r.includes("10.0.2.")||r.includes("172.16.")||r.includes("192.168.56.");e({value:r,triggered:o})},t.createOffer().then(n=>t.setLocalDescription(n))})}},{name:"gpuAccelerationDisabled",weight:2,async check(){let t=document.createElement("canvas").getContext("webgl");return{value:!!t,triggered:!t}}},{name:"noWebGL2",weight:1,async check(){let e=document.createElement("canvas").getContext("webgl2");return{value:!!e,triggered:!e}}},{name:"lowStorageQuota",weight:1,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<500*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"storage-error",triggered:!0}}}},{name:"lowEntropy",weight:1,async check(){let e=Object.keys(navigator).length+Object.keys(screen).length+Object.keys(window).length,t=e<200;return{value:e,triggered:t}}},{name:"noLanguages",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"uaEntropyLow",weight:1,async check(){let e=navigator.userAgent,t=e.length<30;return{value:e,triggered:t}}},{name:"weirdDPI",weight:1,async check(){let e=window.devicePixelRatio;return{value:e,triggered:e===1}}}];async function on({threshold:e=7}={}){let t={},n=0;for(let r of oo){let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isLikelyVM:n>=e,score:n,threshold:e,signals:t}}var io=[{name:"hookedFunctionToString",weight:2,async check(){let e=Function.prototype.toString.toString(),t=Function.prototype.toString+"";return{value:{native:e,current:t},triggered:e!==t}}},{name:"navigatorProxyTrap",weight:2,async check(){let e=!1;try{let t=Object.getOwnPropertyDescriptor(window,"navigator");t&&t.get&&t.get.toString()?.includes("[native code]")===!1&&(e=!0)}catch{}return{value:"navigator getter",triggered:e}}},{name:"uaMismatch",weight:2,async check(){let e=navigator.userAgent||"",t="";try{let r=await navigator.userAgentData?.getHighEntropyValues?.(["platform","brands"]);t=JSON.stringify(r)}catch{}let n=e?.includes("Mac")&&t?.includes("Windows")||e?.includes("Win")&&t?.includes("Mac")||t&&t.length>0&&!e;return{value:{ua:e,brandInfo:t},triggered:n}}},{name:"timezoneLocaleMismatch",weight:1,async check(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=navigator.language||"",n=t.startsWith("en")&&e==="Asia/Shanghai"||t.startsWith("zh")&&e==="America/New_York"||e===void 0;return{value:{tz:e,lang:t},triggered:n}}},{name:"canvasNoise",weight:2,async check(){let e=()=>{let o=document.createElement("canvas"),i=o.getContext("2d");return i.textBaseline="top",i.font="14px Arial",i.fillText("anti-detect-check",2,2),o.toDataURL()},t=e(),n=e();return{value:{a:t,b:n},triggered:t!==n}}},{name:"webglNoise",weight:2,async check(){try{let t=document.createElement("canvas").getContext("webgl");if(!t)return{value:"no-webgl",triggered:!0};let n=t.getExtension("WEBGL_debug_renderer_info");if(!n)return{value:"no-debug-extension",triggered:!1};let r=t.getParameter(n.UNMASKED_VENDOR_WEBGL),o=t.getParameter(n.UNMASKED_RENDERER_WEBGL),i=r===""||o===""||r?.includes(" ")===!1||o?.includes(" ")===!1;return{value:{v:r,r:o},triggered:i}}catch{return{value:"gl-error",triggered:!0}}}},{name:"webdriverFlag",weight:3,async check(){let e=navigator.webdriver===!0;return{value:navigator.webdriver,triggered:e}}},{name:"perfectEventTiming",weight:1,async check(){let e=performance.now();return{value:e,triggered:e%1===0}}},{name:"serviceWorkerBlocked",weight:1,async check(){let e=!("serviceWorker"in navigator);return{value:e,triggered:e}}},{name:"smallQuota",weight:2,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<50*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"quota-error",triggered:!0}}}},{name:"indexedDbBlocked",weight:2,async check(){try{let e=indexedDB.open("tamper-check");return await new Promise(t=>{e.onerror=()=>t({value:"error",triggered:!0}),e.onsuccess=()=>t({value:"ok",triggered:!1})})}catch{return{value:"throw",triggered:!0}}}},{name:"screenDprMismatch",weight:1,async check(){let e=window.screen.width,t=window.screen.height,n=window.devicePixelRatio,r=e===1920&&n===1&&t===1080||n%1!==0&&n%1!==.5;return{value:{w:e,h:t,dpr:n},triggered:r}}},{name:"missingCommonFonts",weight:1,async check(){return{value:"skipped",triggered:!1}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices();return{value:e.length,triggered:e.length===0}}catch{return{value:"error",triggered:!0}}}},{name:"languagesEmpty",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"pluginMismatch",weight:1,async check(){try{let e=navigator.plugins.length;return{value:e,triggered:e===0}}catch{return{value:"error",triggered:!0}}}},{name:"devtoolsDetected",weight:2,async check(){return new Promise(async e=>{let t={viewportBreakpoint:!1,consoleSpeed:!1},n=160,r=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(r>n||o>n)&&(t.viewportBreakpoint=!0);async function i(a=50){return new Promise(c=>{let d=performance.now();console.log("%c ","font-size:3000px");let u=performance.now();c(u-d>a)})}t.consoleSpeed=await i();let s=Object.values(t).some(Boolean);setTimeout(()=>{e({value:s,triggered:s})},50)})}},{name:"knownAntiDetectBrowser",weight:5,async check(){let e=navigator.userAgent.toLowerCase(),n=["incogniton","multilogin","morelogin","adspect","kameleo","goLogin"].some(r=>e?.includes(r));return{value:e,triggered:n}}}];async function sn({threshold:e=5}={}){let t={},n=0;for(let o of io){let i=await o.check();t[o.name]=i,i.triggered&&(n+=o.weight)}let r=Math.min(1,n/15);return{result:r>=.5||t.knownAntiDetectBrowser?.triggered,anomalyScore:r,antiDetectBrowser:t.knownAntiDetectBrowser?.triggered||!1,signals:t}}function so(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function ao(){let e=navigator.userAgent,t=so();return t===44||t===43?"Safari":t===51?"Chrome":t===25?"Firefox":navigator.msSaveBlob!==void 0?"MSIE":e.match(/Chrome/)?navigator.brave!==void 0?"Brave":e.includes("Edg")?"Edge":e.includes("OPR")?"Opera":"Chrome":"Unknown"}var co=[{name:"safari_currentStorageTest",weight:2,browser:"Safari",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("unknown transient reason"),value:t}}}},{name:"safari13to18_indexedDbBlobTest",weight:2,browser:"Safari",async check(){return await new Promise(e=>{let t=String(Math.random()),n=indexedDB.open(t,1);n.onupgradeneeded=r=>{let o=r.target.result;try{o.createObjectStore("t",{autoIncrement:!0}).put(new Blob),e({triggered:!1,value:"ok"})}catch(i){let s=i?.message??String(i);e({triggered:s.includes("are not yet supported"),value:s})}finally{o.close(),indexedDB.deleteDatabase(t)}},n.onerror=()=>e({triggered:!1,value:"idb-error"})})}},{name:"safari_oldWebkitTest",weight:1,browser:"Safari",async check(){let e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{return{triggered:!0,value:"openDatabase denied"}}try{t.setItem("test","1"),t.removeItem("test")}catch{return{triggered:!0,value:"localStorage denied"}}return{triggered:!1,value:"ok"}}},{name:"chrome_storageQuotaPrivateTest",weight:2,browser:"Chrome",async check(){return await new Promise((e,t)=>{let r=window?.performance?.memory?.jsHeapSizeLimit??1073741824;navigator.webkitTemporaryStorage.queryUsageAndQuota((o,i)=>{let s=Math.round(i/1048576),a=Math.round(r/(1024*1024))*2;e({triggered:s<a,value:{quotaMB:s,limitMB:a}})},o=>t(o))})}},{name:"chrome_oldFileSystemTest",weight:1,browser:"Chrome",async check(){let e=window.webkitRequestFileSystem;return e?await new Promise(t=>e(0,1,()=>t({triggered:!1,value:"ok"}),()=>t({triggered:!0,value:"denied"}))):{triggered:!1,value:"unsupported"}}},{name:"firefox_storageDirectoryTest",weight:2,browser:"Firefox",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("Security error"),value:t}}}},{name:"firefox_indexedDbInvalidStateTest",weight:1,browser:"Firefox",async check(){return await new Promise(e=>{let t=indexedDB.open("inPrivate");t.onerror=()=>{e({triggered:t.error?.name==="InvalidStateError",value:t.error?.name})},t.onsuccess=()=>{indexedDB.deleteDatabase("inPrivate"),e({triggered:!1,value:"ok"})}})}},{name:"msie_indexedDbMissing",weight:2,browser:"MSIE",async check(){return{triggered:window.indexedDB===void 0,value:"msie-idb-check"}}}];async function an(){let e=ao(),t={},n=0;for(let r of co){if(r.browser!==e)continue;let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isPrivate:n>0,browserName:e,score:n,signals:t}}typeof window<"u"&&(window.detectIncognito=an);var cn=an;var un=[{name:"globalPrivacyControl",weight:3,async check(){let e=navigator.globalPrivacyControl;return{triggered:e===!0,value:e}}},{name:"doNotTrack",weight:1,async check(){let e=navigator.doNotTrack;return{triggered:e==="1",value:e}}},{name:"cookiesDisabled",weight:3,async check(){let e=navigator.cookieEnabled;return{triggered:e===!1,value:e}}},{name:"thirdPartyCookiesBlocked",weight:3,async check(){try{if("hasStorageAccess"in document&&!await document.hasStorageAccess())try{return await document.requestStorageAccess(),{triggered:!1,value:"access_granted"}}catch{return{triggered:!0,value:"access_denied"}}let e=`__dtect_3p_test_${Date.now()}`;document.cookie=`${e}=1; SameSite=None; Secure`;let t=document.cookie.includes(e);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT`,{triggered:!1,value:t?"cookies_work":"may_be_blocked"}}catch(e){return{triggered:!1,value:`error: ${e?.message}`}}}},{name:"firefoxResistFingerprinting",weight:2,async check(){let e=[],t=new Date().getTimezoneOffset();t===0&&Intl.DateTimeFormat().resolvedOptions().timeZone==="UTC"&&e.push("timezone_utc");let n=navigator.hardwareConcurrency;n===2&&e.push("cores_capped");let r=window.screen.width,o=window.screen.height,i=window.innerWidth,s=window.innerHeight;r===i&&o===s&&e.push("screen_matches_inner");let a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return{triggered:e.length>=2,value:{signals:e,timezoneOffset:t,cores:n,prefersReducedMotion:a}}}},{name:"braveShields",weight:3,async check(){if(!(navigator.brave!==void 0))return{triggered:!1,value:"not_brave"};try{if(!await navigator.brave.isBrave())return{triggered:!1,value:"brave_check_false"};let r=document.createElement("canvas").getContext("2d");if(r){r.fillStyle="rgb(255, 0, 0)",r.fillRect(0,0,1,1);let o=r.getImageData(0,0,1,1).data;r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data;if(o[0]!==i[0]||o[1]!==i[1]||o[2]!==i[2])return{triggered:!0,value:"shields_active_canvas"}}try{let o=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});if(o.createDataChannel(""),await new Promise(s=>{let a=setTimeout(()=>{o.close(),s(!1)},1e3);o.onicecandidate=c=>{c.candidate?.candidate&&(/([0-9]{1,3}\.){3}[0-9]{1,3}/.test(c.candidate.candidate)||(clearTimeout(a),o.close(),s(!0)))},o.createOffer().then(c=>o.setLocalDescription(c))}))return{triggered:!0,value:"shields_active_webrtc"}}catch{return{triggered:!0,value:"shields_active_webrtc_blocked"}}return{triggered:!0,value:"brave_detected_shields_default"}}catch(t){return{triggered:!1,value:`error: ${t?.message}`}}}}];async function ln(){let e={},t=0,n=await Promise.allSettled(un.map(async r=>{let o=await r.check();return{name:r.name,weight:r.weight,result:o}}));for(let r of n)if(r.status==="fulfilled"){let{name:o,weight:i,result:s}=r.value;e[o]=s,s.triggered&&(t+=i)}else{let o=n.indexOf(r),i=un[o];i&&(e[i.name]={triggered:!1,value:`check_failed: ${r.reason}`})}return{isPrivacyEnabled:t>3,score:t,signals:e}}typeof window<"u"&&(window.detectPrivacy=ln);var dn=ln;var mn="dtect_security_sdk_state",fn=typeof window<"u",hn={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Ie={state:{...hn},securityKeys:{behaviorKey:"bwDZ0V3Zrb4SB6g4lZwW",automationKey:"7166bf18-b91e-407a-84fc-d57ac104de98",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}};function pn(){if(!fn)return Ie;try{let e=sessionStorage.getItem(mn);if(!e)return Ie;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Ie:{state:{...hn,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}}}catch{return Ie}}function G(e){if(fn)try{let t=Date.now()+864e5,n={...e,expiresAt:t};sessionStorage.setItem(mn,JSON.stringify(n))}catch{}}function gn(e){return e.token||H()}async function D(e,t="info",n={}){let r=`${n.endpoint??"https://api.dtect.io/security"}/log`,o={message:e,type:t,payload:n};navigator.sendBeacon(r,JSON.stringify(o))}var Re,R="https://api.dtect.io/security",be=`${R}/client/check`,T="",V="",uo=["2d6803fb-8373-4771-897a-dfa18acf7da4","f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","58da2d43-45c0-49be-96f6-bd4651148a42"],lo=["f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","13b1fab5-c93c-48db-a50d-03c7df6c30b8","4c5dea4c-d1b7-4dc7-88fc-cf03e7a54a66","32014166-ed5f-4e30-a58b-587e2a2881d8","67107037-d5b5-483a-a046-bf39c38ce738","23b778f9-d07f-477d-9863-168c90a320d2","57392ff8-1733-41e7-b336-a9c7a01ef559","59073b5c-2b9a-4933-9d7e-655b0559196f"],yn="0.0.29",mo="20000000-aaaa-bbbb-cccc-000000000002",Te;var{state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}=pn(),En=Ot,se;async function fo({clientId:e,apiKey:t,endpoint:n}){if(Pe({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k};let r=await rn.fetchQuery({queryKey:["getClientConfig",e,t],queryFn:()=>ct({url:`${n}/client/config`,headers:{"client-id":T,"x-api-key":V}})});if(!Pe(r))throw new Error("Missing keys from get client config");return L=r.automationKey,U=r.behaviorKey,B=r.dtectSignalEnabled,k=r.dtectAutomationSignalEnabled,G({state:m,securityKeys:r}),r}function gt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(I.RATE_LIMIT_REACHED);switch(e?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_TOKEN)}function Z(){if(In(m)&&Pe({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return!0;let e=ke(),t=document.querySelector("#dtect-h-captcha");return!!Re&&!!(!k&&t||e||k)}function wn(){return!!(T&&V)}function ho(){return new Promise(e=>{let t=()=>{window?.hcaptcha?e():requestAnimationFrame(t)};t()})}var ke=()=>window?.location?.href?.includes("localhost")||window?.location?.href?.includes("file:///");async function po({behaviorKey:e,dtectAutomationSignalEnabled:t=!1}){let n=performance.now();Re=await j.load({apiKey:e,endpoint:["https://fp.dtect.io",j.defaultEndpoint],scriptUrlPattern:["https://fp.dtect.io/web/v<version>/<apiKey>/loader_v<loaderVersion>.js",j.defaultScriptUrlPattern]});let o=(performance.now()-n).toFixed();if(D(`FingerprintJS loaded in ${o}ms`,"info",{function:"fpjs load",endpoint:R,diff:o,token:m.token,clientId:T}),!ke()&&!t&&(await ho(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:L,size:"invisible"})),!Re)throw new Error(I.SDK_INIT_ERROR)}async function go(){let e=performance.now();if(m.tokens){let c=(performance.now()-e).toFixed();return D(`getTokens finishes in ${c}ms`,"info",{function:"getTokens",endpoint:R,diff:c,token:m.token,clientId:T}),m.tokens}let t=new Promise(a=>{let c=Re?.get();a(c)}),n=new Promise(async a=>{ke()&&a({response:mo});let d=await window?.hcaptcha?.execute({async:!0});a(d)}),[r,o]=await Promise.all([k?{response:""}:n,t]);m.tokens={behaviorRequestId:o?.requestId,behaviorToken:o?.sealedResult,automationToken:r?.response};let s=(performance.now()-e).toFixed();return D(`getTokens finishes in ${s}ms`,"info",{function:"getTokens",endpoint:R,diff:s,token:m.token,clientId:T}),m.tokens}function yo(e){let t=e?.projectId,n=e?.visitorId||H();return(typeof e?.projectId=="number"||typeof e?.visitorId=="number")&&(t=`${e?.projectId}`,n=`${e?.visitorId}`),{visitorId:n,projectId:t}}function yt(e){if(m.projectId&&m.visitorId)return{visitorId:m.visitorId,projectId:m.projectId};let{projectId:t,visitorId:n}=yo(e);return{projectId:t,visitorId:n}}async function vn(e,t){let n=performance.now();if(!Z())throw new Error(I.NOT_INITIALIZED);if(!wn())throw new Error(I.MISSING_CREDENTIALS);let{projectId:r,visitorId:o}=yt(e);if(m.projectId=r,m.visitorId=o,!e||!r?.trim())throw new Error(I.FAILED_TO_GET_SECURITY_RESULT);let i;try{let s=await go();if(B){let a=new te,[c,d,u,l,f]=await Promise.allSettled([a.get(),on(),sn(),cn(),dn()]);i={deviceRes:c,vmDtectResults:d,tamperingDtectResults:u,incognitoDtectResults:l,privacySettingsDtectResults:f}}if(s?.behaviorToken&&s?.behaviorRequestId&&(k||!k&&s?.automationToken)){let a={behaviorToken:s.behaviorToken,automationToken:s.automationToken,behaviorRequestId:s.behaviorRequestId,entryLink:window?.location?.href,securitySettings:e.securitySettings,metaData:e.metaData,...B?{vmDtectResults:i?.vmDtectResults?.value,tamperingDtectResults:i?.tamperingDtectResults?.value,incognitoDtectResults:i?.incognitoDtectResults?.value,deviceIdResults:i?.deviceRes?.value,privacySettingsDtectResults:i?.privacySettingsDtectResults?.value}:{}};m.clientData=a;let c={...e,projectId:r,visitorId:o,clientData:a,version:"0.0.29",token:m.token,questionData:m.questionData,aiCheckData:m.aiCheckData},d=await he({url:`${t}`,body:{...c},headers:{"client-id":T,"x-api-key":V}});if("token"in d||"results"in d){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let l=(performance.now()-n).toFixed();return D(`getResultBase finishes in ${l}ms`,"info",{function:"getResultBase",endpoint:R,diff:l,token:m.token,clientId:T}),d}}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(s){let c=(performance.now()-n).toFixed();if(D("getResultBase error","error",{function:"getResultBase",endpoint:R,error:s,diff:c,token:m.token,clientId:T}),s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(s?.message?.includes("rate-limited")||s?.message?.includes("429"))throw new Error(I.RATE_LIMIT_REACHED);switch(s?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_RESULT)}}async function Ae(e){return await vn(e,`${R}/client/check/result`)}async function Se(e){return await vn(e,`${R}/client/check`)}async function Oe(e){let t=performance.now();if(!Z())throw new Error(I.NOT_INITIALIZED);let{respondentType:n,language:r}=e;try{let o=await ct({url:`${R}/client/quality-questions/${n}/${r}`,headers:{"client-id":T,"x-api-key":V}});if(o){let s=(performance.now()-t).toFixed();return D(`getQualityQuestions finishes in ${s}ms`,"info",{function:"getQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("getQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),gt(o)}}async function De(e){let t=performance.now();if(!Z())throw new Error(I.NOT_INITIALIZED);m.questionData||(m.questionData={questions:e.questions});let{visitorId:n,projectId:r}=yt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:yn,questionData:m.questionData,aiCheckData:m.aiCheckData,clientData:m.clientData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`checkQualityQuestions finishes in ${s}ms`,"info",{function:"checkQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("checkQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),gt(o)}}async function _e(e){let t=performance.now();if(!Z())throw new Error(I.NOT_INITIALIZED);m.aiCheckData={timeTakenSeconds:e.timeTakenSeconds,qbc:e.qbc||se.qbc,mas:e.mas||se.mas,scb:e.scb||se.scb,apd:e.apd||se.apd};let{visitorId:n,projectId:r}=yt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:yn,clientData:m.clientData,questionData:m.questionData,aiCheckData:m.aiCheckData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`isAIUsageDetected finishes in ${s}ms`,"info",{function:"isAIUsageDetected",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("isAIUsageDetected error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),gt(o)}}function Eo(){let e=performance.now(),t=document.querySelector("head"),n=document.querySelector("body");if(!ke()){n?.insertAdjacentHTML("beforeend",'<div id="dtect-h-captcha" ></div>');let o=document.createElement("script");o.setAttribute("src","https://js.hcaptcha.com/1/api.js"),o.setAttribute("async","true"),o.setAttribute("defer","true"),t?.append(o);let s=(performance.now()-e).toFixed()}}function Pe(e){return(e.dtectAutomationSignalEnabled||e?.automationKey)&&e?.behaviorKey}function In(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function Rn(e){let t=performance.now();if(!e?.clientId||!e?.apiKey)throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);let{clientId:n,apiKey:r,endpoint:o="https://api.dtect.io/security",includeResults:i}=e;R=o,be=`${R}/client/check`;let s=gn(m);if(m.isLoading){if(Z())return Te;throw D(I.DUPLICATE_INITIALIZATION,"error",{endpoint:R,clientId:n,apiKey:r,token:m.token}),new Error(I.DUPLICATE_INITIALIZATION)}if(se=qt(m.aiCheckData),T=n,V=r,k=uo.includes(n),B=lo.includes(n),i&&(be=`${R}/client/check/result`),m={...m,isLoading:!0,token:s||""},In(m)&&Pe({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}),{getSecurityResult:Ae,getSecurityToken:Se,isAIUsageDetected:_e,checkQualityQuestions:De,getQualityQuestions:Oe,LanguageCodes:Q,QualityQuestionsRespondentTypes:W};if(!wn())throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);if(Z())return Te;try{let c=await fo({clientId:n,apiKey:r,endpoint:o});return c.dtectAutomationSignalEnabled||Eo(),po({behaviorKey:c.behaviorKey,dtectAutomationSignalEnabled:c.dtectAutomationSignalEnabled}).then(()=>{let u=(performance.now()-t).toFixed();return D(`init() finishes ${u}ms`,"info",{endpoint:R,function:"init",diff:u,token:m.token,clientId:T}),{getSecurityResult:Ae,getSecurityToken:Se,SecurityAPIError:En,isAIUsageDetected:_e,checkQualityQuestions:De,getQualityQuestions:Oe,LanguageCodes:Q,QualityQuestionsRespondentTypes:W}}).catch(d=>{throw new Error(d.message)})}catch(c){if(c instanceof Error){if(D(c.message,"error",{function:"init",endpoint:R,error:c,token:m.token,clientId:T}),c?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if([I.INVALID_API_KEY,I.UNAUTHORIZED].includes(c?.message))throw new Error(I.INVALID_CREDENTIALS)}throw new Error(I.SDK_INIT_ERROR)}finally{m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}})}}Te={init:Rn,getSecurityResult:Ae,getSecurityToken:Se,isAIUsageDetected:_e,checkQualityQuestions:De,getQualityQuestions:Oe,QualityQuestionsRespondentTypes:W,LanguageCodes:Q};var wo=Te;
11
+ `,n=p.createShader(p.VERTEX_SHADER),r=p.createShader(p.FRAGMENT_SHADER);if(!n||!r)throw new Error("Failed to create shaders");if(p.shaderSource(n,e),p.shaderSource(r,t),p.compileShader(n),!p.getShaderParameter(n,p.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+p.getShaderInfoLog(n));if(p.compileShader(r),!p.getShaderParameter(r,p.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+p.getShaderInfoLog(r));let o=p.createProgram();if(!o)throw new Error("Failed to create shader program");if(p.attachShader(o,n),p.attachShader(o,r),p.linkProgram(o),!p.getProgramParameter(o,p.LINK_STATUS))throw new Error("Shader program linking failed: "+p.getProgramInfoLog(o));p.useProgram(o);let i=137,s=new Float32Array(i*4),a=2*Math.PI/i;for(let f=0;f<i;f++){let E=f*a;s[f*4]=0,s[f*4+1]=0,s[f*4+2]=Math.cos(E)*(P.width/2),s[f*4+3]=Math.sin(E)*(P.height/2)}let c=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,c),p.bufferData(p.ARRAY_BUFFER,s,p.STATIC_DRAW);let d=p.getAttribLocation(o,"position");p.enableVertexAttribArray(d),p.vertexAttribPointer(d,2,p.FLOAT,!1,0,0),p.viewport(0,0,P.width,P.height),p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.LINES,0,i*2);let u=new Uint8ClampedArray(P.width*P.height*4);return p.readPixels(0,0,P.width,P.height,p.RGBA,p.UNSIGNED_BYTE,u),new ImageData(u,P.width,P.height)}catch{return new ImageData(1,1)}finally{p&&(p.bindBuffer(p.ARRAY_BUFFER,null),p.useProgram(null),p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight),p.clearColor(0,0,0,0))}}function N(e){let t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let o,i;if(Array.isArray(r)){for(i="[",o=0;o<r.length;o++)o&&(i+=","),i+=n(r[o])||"null";return i+"]"}if(r===null)return"null";if(t.indexOf(r)!==-1)throw new TypeError("Converting circular structure to JSON");let s=t.push(r)-1,a=Object.keys(r).sort();for(i="",o=0;o<a.length;o++){let c=a[o],d=n(r[c]);d&&(i&&(i+=","),i+=JSON.stringify(c)+":"+d)}return t.splice(s,1),"{"+i+"}"}(e)||""}async function nt(){return new Promise(e=>{try{let t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t){e({supported:!1,error:"WebRTC not supported"});return}let n={iceCandidatePoolSize:1,iceServers:[]},r=new t(n);r.createDataChannel(""),(async()=>{try{let i={offerToReceiveAudio:!0,offerToReceiveVideo:!0},s=await r.createOffer(i);await r.setLocalDescription(s);let a=s.sdp||"",c=[...new Set((a.match(/extmap:\d+ [^\n\r]+/g)||[]).map(h=>h.replace(/extmap:\d+ /,"")))].sort(),d=h=>{let w=a.match(new RegExp(`m=${h} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},u=(h,w)=>w.map(g=>{let A=new RegExp(`(rtpmap|fmtp|rtcp-fb):${g} (.+)`,"g"),x=[...a.matchAll(A)];if(!x.length)return null;let v={};return x.forEach(xe=>{let[Io,Ne,Me]=xe,Ce=Me.split("/");Ne==="rtpmap"?(v.mimeType=`${h}/${Ce[0]}`,v.clockRate=+Ce[1],h==="audio"&&(v.channels=+Ce[2]||1)):Ne==="rtcp-fb"?(v.feedbackSupport=v.feedbackSupport||[],v.feedbackSupport.push(Me)):Ne==="fmtp"&&(v.sdpFmtpLine=Me)}),v}).filter(Boolean),l=u("audio",d("audio")),f=u("video",d("video")),E={audio:{count:l.length,hash:O(N(l))},video:{count:f.length,hash:O(N(f))},extensionsHash:O(N(c))},y=await new Promise(h=>{let w=setTimeout(()=>{r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,timeout:!0})},3e3),g=A=>{let x=A.candidate;!x||!x.candidate||(clearTimeout(w),r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,candidateType:x.type||""}))};r.addEventListener("icecandidate",g)});e({details:y,hash:O(N(y))})}catch(i){r.close(),e({supported:!0,error:`WebRTC offer failed: ${i.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}})}var xt=["\u{1D504}","\u{1D505}","\u212D","\u{1D507}","\u{1D508}","\u{1D509}","\u{1D538}","\u{1D539}","\u2102","\u{1D53B}","\u{1D53C}","\u{1D53D}"],Nt=["\u03B2","\u03C8","\u03BB","\u03B5","\u03B6","\u03B1","\u03BE","\u03BC","\u03C1","\u03C6","\u03BA","\u03C4","\u03B7","\u03C3","\u03B9","\u03C9","\u03B3","\u03BD","\u03C7","\u03B4","\u03B8","\u03C0","\u03C5","\u03BF"];async function rt(){return new Promise(e=>{try{le(async({iframe:t})=>{try{if(!Kr(t)){e({supported:!1,error:"MathML not supported"});return}let n=[ee("integral","<msubsup><mo>\u222B</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>"),ee("fraction","<mfrac><mrow><mi>\u03C0</mi><mo>\xD7</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>\u03C3</mi></mrow></mfrac>"),ee("matrix","<mo>[</mo><mtable><mtr><mtd><mi>\u03B1</mi></mtd><mtd><mi>\u03B2</mi></mtd></mtr><mtr><mtd><mi>\u03B3</mi></mtd><mtd><mi>\u03B4</mi></mtd></mtr></mtable><mo>]</mo>"),Gr(),...Vr()],r=[],o="";n.forEach((s,a)=>{let c=jr(s,t);r.push({width:c.dimensions.width,height:c.dimensions.height}),a===0&&c.fontInfo&&(o=O(N(c.fontInfo)))});let i={fontStyleHash:o,dimensions:r};e({details:i,hash:O(N(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function Kr(e){try{let t=e.createElement("math");t.innerHTML="<mrow><mi>x</mi></mrow>",t.style.position="absolute",t.style.visibility="hidden",e.body.appendChild(t);let n=t.getBoundingClientRect();return e.body.removeChild(t),n.width>0&&n.height>0}catch{return!1}}function ee(e,t){return`<math><mrow>${t}</mrow></math>`}function Gr(){let e="<mo>\u220F</mo>";return xt.forEach((t,n)=>{let r=n*2,o=Nt.slice(r,r+2);o.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`)}),ee("complex_nested",`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function Vr(){let e=[];return xt.forEach((t,n)=>{let r=n*2,o=Nt.slice(r,r+2);o.length===2&&e.push(ee("combined",`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`))}),e}function jr(e,t){try{let n=t.createElement("math");n.innerHTML=e.replace(/<\/?math>/g,""),n.style.whiteSpace="nowrap",n.style.position="absolute",n.style.visibility="hidden",n.style.top="-9999px",t.body.appendChild(n);let r=n.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(n),s={dimensions:{width:r.width,height:r.height},fontInfo:{fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle,lineHeight:i.lineHeight,fontVariant:i.fontVariant||"normal",fontStretch:i.fontStretch||"normal",fontSizeAdjust:i.fontSizeAdjust||"none",textRendering:i.textRendering||"auto",fontFeatureSettings:i.fontFeatureSettings||"normal",fontVariantNumeric:i.fontVariantNumeric||"normal",fontKerning:i.fontKerning||"auto"}};return t.body.removeChild(n),s}catch(n){return{error:n.message}}}var Qr=800;async function ot(){return new Promise(e=>{try{if(typeof window>"u"||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!="function"){e({supported:!1,error:"Speech Synthesis API not supported"});return}let t=!1,n=null,r=s=>{if(!t){t=!0,n&&clearTimeout(n);try{let a=s.map(d=>{let u=f=>f.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(d.voiceURI||""),u(d.name||""),u(d.lang||""),d.localService?"1":"0",d.default?"1":"0"].join(",")});a.sort();let c={voiceCount:s.length,voicesHash:O(N(a))};e({details:c,hash:O(N(c))})}catch(a){e({supported:!0,error:`Voice processing failed: ${a.message}`})}}},o=window.speechSynthesis.getVoices();if(o.length>0){r(o);return}n=setTimeout(()=>{let s=window.speechSynthesis.getVoices();r(s)},Qr);let i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);let s=window.speechSynthesis.getVoices();r(s)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}})}var Mt={audio:Qe,canvas:We,fonts:$e,hardware:ze,locales:Ye,math:Je,permissions:Xe,plugins:Ze,screen:He,system:et,webgl:tt},Ct={webrtc:nt,mathml:rt,speech:ot},it={},Lt={timeout:"true"},st=(e,t,n)=>{it[e]=t};function Wr(e,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function Ft(e,t,n){return Promise.all(e.map(r=>{let o=performance.now();return Promise.race([r.then(i=>({value:i,elapsed:performance.now()-o})),Wr(t,n).then(i=>({value:i,elapsed:performance.now()-o}))])}))}function fe(e,t){let n=Y();if(n.name==="unknown"&&e.system&&typeof e.system=="object"&&!Array.isArray(e.system)){let l=e.system.browser;if(l&&typeof l=="object"&&!Array.isArray(l)){let f=l;n={name:f.name||"unknown",version:f.version||"unknown"}}}let r=n.name.toLowerCase(),o=n.version.split(".")[0]||"0",i=parseInt(o,10),s=[...t?.exclude||[]],a=t?.stabilize||[],c=t?.include||[];for(let u of a){let l=je[u];if(l)for(let f of l){let E=!("browsers"in f),y=!E&&f.browsers?.some(h=>{let w=h.match(/(.+?)(>=)(\d+)/);if(w){let[,g,,A]=w,x=parseInt(A,10);return r===g&&i>=x}return r===h});(E||y)&&s.push(...f.exclude)}}function d(u,l=""){let f={};for(let[E,y]of Object.entries(u)){let h=l?`${l}.${E}`:E;if(typeof y=="object"&&!Array.isArray(y)&&y!==null){let w=d(y,h);Object.keys(w).length>0&&(f[E]=w)}else{let w=s.some(A=>h.startsWith(A)),g=c.some(A=>h.startsWith(A));(!w||g)&&(f[E]=y)}}return f}return d(e)}async function at(e){let t={...z,...e},n=t.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,r={...Mt,...it},{elapsed:o,resolvedComponents:i}=await Ut(r,t),s={},a={};if(n||t.experimental){let{elapsed:w,resolvedComponents:g}=await Ut(Ct,t);s=g,a=w}let c={...o,...a},d=t.performance?{elapsed:c}:{},u=fe({},t),l={...i,...u},f={};return{thumbmark:O(N(l)),components:l,info:f,version:"",...d,...Object.keys(s).length>0&&t.experimental&&{experimental:s}}}async function Ut(e,t){let n={...z,...t},r=Object.entries(e).filter(([u])=>!n?.exclude?.includes(u)).filter(([u])=>n?.include?.some(l=>l.includes("."))?n?.include?.some(l=>l.startsWith(u)):n?.include?.length===0||n?.include?.includes(u)),o=r.map(([u])=>u),i=r.map(([u,l])=>l(t)),s=await Ft(i,n?.timeout||5e3,Lt),a={},c={};s.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,a[o[l]]=u.elapsed??0)});let d=fe(c,n);return{elapsed:a,resolvedComponents:d}}var te=class{options;constructor(t){this.options={...z,...t}}async get(t){let n={...this.options,...t};return at(n)}getVersion(){return""}includeComponent(t,n){st(t,n)}};var $r=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),zr=async(e,t)=>{if(!e.ok){let n=await e.text();throw new Error(n)}return t==="file"?e.blob():t==="json"?e.json():t==="text"?e.text():null},Bt=async({url:e,auth:t,body:n,method:r="GET",headers:o={},responseType:i="json"})=>{let s={method:r,headers:$r(t,o),...n?{body:n instanceof FormData?n:JSON.stringify(n)}:{}},a=await fetch(e,s);return zr(a,i)},ct=e=>Bt({...e,method:"GET"}),he=e=>Bt({...e,method:"POST"});function qt(e){let t=e?.qbc||!1,n=e?.mas||!1,r=e?.apd||!1,o=e?.scb||null,i=0,s=()=>{t=!1,n=!1,r=!1,o=void 0,i=0},a=()=>{let l=window?.getSelection()?.toString();l&&l.length>0&&(i=Date.now(),t=!0)},c=u=>{let l=u.clipboardData?.getData("text"),f=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&f&&(r=!0)},d=()=>{n=!0;let u=Date.now();if(i){let l=(u-i)/1e3;(o===void 0||l<o)&&(o=l)}};return document?.addEventListener("copy",a),document?.addEventListener("paste",c),window?.addEventListener("blur",d),{get qbc(){return t},get mas(){return n},get apd(){return r},get scb(){return o},reset:s,destroy(){document?.removeEventListener("copy",a),document?.removeEventListener("paste",c),window?.removeEventListener("blur",d)}}}var q=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var K=typeof window>"u"||"Deno"in globalThis;function M(){}function Vt(e,t){return typeof e=="function"?e(t):e}function jt(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lt(e,t){return typeof e=="function"?e(t):e}function Wt(e,t){return typeof e=="function"?e(t):e}function dt(e,t){let{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==ne(s,t.options))return!1}else if(!X(t.queryKey,s))return!1}if(n!=="all"){let c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function mt(e,t){let{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(J(t.options.mutationKey)!==J(i))return!1}else if(!X(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ne(e,t){return(t?.queryKeyHashFn||J)(e)}function J(e){return JSON.stringify(e,(t,n)=>ut(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function X(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!X(e[n],t[n])):!1}function $t(e,t){if(e===t)return e;let n=Kt(e)&&Kt(t);if(n||ut(e)&&ut(t)){let r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},c=0;for(let d=0;d<s;d++){let u=n?d:i[d];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,c++):(a[u]=$t(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&c++)}return o===s&&c===o?e:a}return t}function Kt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ut(e){if(!Gt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Gt(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gt(e){return Object.prototype.toString.call(e)==="[object Object]"}function zt(e){return new Promise(t=>{setTimeout(t,e)})}function Yt(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$t(e,t):t}function Jt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Xt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var re=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===re?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Yr=class extends q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ge=new Yr;var Jr=class extends q{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Z=new Jr;function Zt(){let e,t,n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Xr(e){return Math.min(1e3*2**e,3e4)}function ft(e){return(e??"online")==="online"?Z.isOnline():!0}var Ht=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){return e instanceof Ht}function Ee(e){let t=!1,n=0,r=!1,o,i=Zt(),s=h=>{r||(f(new Ht(h)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},d=()=>ge.isFocused()&&(e.networkMode==="always"||Z.isOnline())&&e.canRun(),u=()=>ft(e.networkMode)&&e.canRun(),l=h=>{r||(r=!0,e.onSuccess?.(h),o?.(),i.resolve(h))},f=h=>{r||(r=!0,e.onError?.(h),o?.(),i.reject(h))},E=()=>new Promise(h=>{o=w=>{(r||d())&&h(w)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let h,w=n===0?e.initialPromise:void 0;try{h=w??e.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{if(r)return;let A=e.retry??(K?0:3),x=e.retryDelay??Xr,v=typeof x=="function"?x(n,g):x,xe=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,g);if(t||!xe){f(g);return}n++,e.onFail?.(n,g),zt(v).then(()=>d()?void 0:E()).then(()=>{t?f(g):y()})})};return{promise:i,cancel:s,continue:()=>(o?.(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?y():E().then(y),i)}}function Zr(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0),i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{let a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||s()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var b=Zr();var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(K?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var en=class extends we{#e;#t;#n;#r;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=eo(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){let n=Yt(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Wt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===re||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!Qt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){let a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}let n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{let a=pe(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return r(c),this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});let s=a=>{ye(a)&&a.silent||this.#o({type:"error",error:a}),ye(a)||(this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this)),this.scheduleGc()};return this.#r=Ee({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(a)}catch(c){s(c);return}this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),this.scheduleGc()},onError:s,onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){let t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Hr(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;return ye(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),b.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Hr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ft(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function eo(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oe=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,o=t.queryHash??ne(r,t),i=this.get(o);return i||(i=new en({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){b.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(n=>dt(t,n))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(n=>dt(e,n)):t}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){b.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};var tn=class extends we{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||to(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=Ee({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);let o=await this.options.onMutate?.(e);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:n})}let r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#t.runNext(this)}}#r(e){let t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),b.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function to(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ie=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new tn({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);if(n)if(n.length>1){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=ve(e);if(typeof t=="string"){let r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){let t=ve(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){b.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(n=>mt(t,n))}findAll(e={}){return this.getAll().filter(t=>mt(e,t))}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(t=>t.state.isPaused);return b.batch(()=>Promise.all(e.map(t=>t.continue().catch(M))))}};function ve(e){return e.options.scope?.id}function ht(e){return{onFetch:(t,n)=>{let r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},c=0,d=async()=>{let u=!1,l=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=pe(t.options,t.fetchOptions),E=async(y,h,w)=>{if(u)return Promise.reject();if(h==null&&y.pages.length)return Promise.resolve(y);let g={queryKey:t.queryKey,pageParam:h,direction:w?"backward":"forward",meta:t.options.meta};l(g);let A=await f(g),{maxPages:x}=t.options,v=w?Xt:Jt;return{pages:v(y.pages,A,x),pageParams:v(y.pageParams,h,x)}};if(o&&i.length){let y=o==="backward",h=y?no:nn,w={pages:i,pageParams:s},g=h(r,w);a=await E(w,g,y)}else{let y=e??i.length;do{let h=c===0?s[0]??r.initialPageParam:nn(r,a);if(c>0&&h==null)break;a=await E(a,h),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function nn(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function no(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var pt=class{#e;#t;#n;#r;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new oe,this.#t=e.mutationCache||new ie,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Z.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(lt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{let r=n.data;return[t,r]})}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,s=Vt(t,i);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return b.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;b.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){let n=this.#e,r={type:"active",...e};return b.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=b.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(M).catch(M)}invalidateQueries(e,t={}){return b.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=b.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(M)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(M)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(lt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(M).catch(M)}fetchInfiniteQuery(e){return e.behavior=ht(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(M).catch(M)}ensureInfiniteQueryData(e){return e.behavior=ht(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Z.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(J(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(r=>{X(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(J(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#s.values()],n={};return t.forEach(r=>{X(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ne(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===re&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var ro=new pt({defaultOptions:{queries:{staleTime:3e4}},queryCache:new oe({onError:(e,t)=>{}}),mutationCache:new ie}),rn=ro;var oo=[{name:"lowCpuCores",weight:1,async check(){let e=navigator.hardwareConcurrency||0,t=e>0&&e<=2;return{value:e,triggered:t}}},{name:"lowDeviceMemory",weight:1,async check(){let e=navigator.deviceMemory||0,t=e>0&&e<=4;return{value:e,triggered:t}}},{name:"platformMismatch",weight:1,async check(){let e=navigator.userAgent||"",t=navigator.platform||"",n=e.includes("Mac")&&t.includes("Linux")||e.includes("Win")&&t.includes("Mac")||t===""||t==="Unknown";return{value:t,triggered:n}}},{name:"webglSoftwareRenderer",weight:2,async check(){let e=null,t=null,n=!1;try{let r=document.createElement("canvas"),o=r.getContext("webgl")||r.getContext("experimental-webgl");if(o){let i=o.getExtension("WEBGL_debug_renderer_info");if(i){e=o.getParameter(i.UNMASKED_VENDOR_WEBGL)||"",t=o.getParameter(i.UNMASKED_RENDERER_WEBGL)||"";let s=t.toLowerCase(),a=e.toLowerCase();n=s.includes("swiftshader")||s.includes("llvmpipe")||s.includes("softwar")||s.includes("basic render")||s.includes("vmware")||s.includes("virtualbox")||a.includes("vmware")||a.includes("parallels")}}}catch{}return{value:{vendor:e,renderer:t},triggered:n}}},{name:"missingWebGPUAdapter",weight:2,async check(){if(!("gpu"in navigator))return{value:"no WebGPU",triggered:!0};try{let e=await navigator.gpu.requestAdapter();return{value:e?"adapter-present":"adapter-null",triggered:!e}}catch{return{value:"adapter-error",triggered:!0}}}},{name:"reducedTimerPrecision",weight:1,async check(){let e=performance.now();await new Promise(r=>setTimeout(r,50));let t=performance.now()-e,n=t<30||t>80;return{value:t.toFixed(2),triggered:n}}},{name:"timerJitter",weight:1,async check(){let e=[];for(let r=0;r<10;r++){let o=performance.now();await new Promise(s=>setTimeout(s,10));let i=performance.now();e.push(i-o)}let t=Math.sqrt(e.map(r=>(r-10)**2).reduce((r,o)=>r+o)/e.length),n=t>5;return{value:t.toFixed(3),triggered:n}}},{name:"audioFingerprint",weight:1,async check(){try{let e=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,44100,44100),t=e.createOscillator();t.frequency.value=440,t.connect(e.destination),t.start(0);let r=(await e.startRendering()).getChannelData(0).reduce((i,s)=>i+Math.abs(s),0),o=r<100;return{value:r,triggered:o}}catch{return{value:"audio-error",triggered:!0}}}},{name:"canvasEntropy",weight:1,async check(){try{let e=document.createElement("canvas"),t=e.getContext("2d");t.textBaseline="top",t.font="14px 'Arial'",t.fillText("VM CHECK",2,2);let r=[...e.toDataURL()].reduce((i,s)=>(i+s.charCodeAt(0))%9999999,0);return{value:r,triggered:r===0||r===999999}}catch{return{value:"canvas-error",triggered:!0}}}},{name:"windowSizeWeird",weight:1,async check(){let e=window.innerWidth/window.innerHeight,t=e===1.333||e===1.6;return{value:e.toFixed(2),triggered:t}}},{name:"touchMismatch",weight:1,async check(){let e="ontouchstart"in window,t=navigator.maxTouchPoints||0;return{value:{hasTouch:e,maxTouch:t},triggered:e&&t===0}}},{name:"batteryVirtualized",weight:1,async check(){if(!navigator.getBattery)return{value:"no API",triggered:!0};try{let e=await navigator.getBattery(),t=e.chargingTime===0&&e.dischargingTime===1/0;return{value:{chargingTime:e.chargingTime,dischargingTime:e.dischargingTime},triggered:t}}catch{return{value:"battery-error",triggered:!0}}}},{name:"permissionsWeird",weight:1,async check(){try{let e=await navigator.permissions.query({name:"camera"}),t=e.state==="prompt";return{value:e.state,triggered:t}}catch{return{value:"perm-error",triggered:!0}}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.length===0;return{value:e.length,triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"virtualizedMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.some(n=>n.label.toLowerCase().includes("virtual"));return{value:e.map(n=>n.label),triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"webrtcIpPattern",weight:2,async check(){return new Promise(e=>{let t=new RTCPeerConnection({iceServers:[]});t.createDataChannel("x"),t.onicecandidate=n=>{if(!n||!n.candidate){e({value:"no candidate",triggered:!0});return}let r=n.candidate.candidate.toLowerCase(),o=r.includes("10.0.2.")||r.includes("172.16.")||r.includes("192.168.56.");e({value:r,triggered:o})},t.createOffer().then(n=>t.setLocalDescription(n))})}},{name:"gpuAccelerationDisabled",weight:2,async check(){let t=document.createElement("canvas").getContext("webgl");return{value:!!t,triggered:!t}}},{name:"noWebGL2",weight:1,async check(){let e=document.createElement("canvas").getContext("webgl2");return{value:!!e,triggered:!e}}},{name:"lowStorageQuota",weight:1,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<500*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"storage-error",triggered:!0}}}},{name:"lowEntropy",weight:1,async check(){let e=Object.keys(navigator).length+Object.keys(screen).length+Object.keys(window).length,t=e<200;return{value:e,triggered:t}}},{name:"noLanguages",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"uaEntropyLow",weight:1,async check(){let e=navigator.userAgent,t=e.length<30;return{value:e,triggered:t}}},{name:"weirdDPI",weight:1,async check(){let e=window.devicePixelRatio;return{value:e,triggered:e===1}}}];async function on({threshold:e=7}={}){let t={},n=0;for(let r of oo){let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isLikelyVM:n>=e,score:n,threshold:e,signals:t}}var io=[{name:"hookedFunctionToString",weight:2,async check(){let e=Function.prototype.toString.toString(),t=Function.prototype.toString+"";return{value:{native:e,current:t},triggered:e!==t}}},{name:"navigatorProxyTrap",weight:2,async check(){let e=!1;try{let t=Object.getOwnPropertyDescriptor(window,"navigator");t&&t.get&&t.get.toString()?.includes("[native code]")===!1&&(e=!0)}catch{}return{value:"navigator getter",triggered:e}}},{name:"uaMismatch",weight:2,async check(){let e=navigator.userAgent||"",t="";try{let r=await navigator.userAgentData?.getHighEntropyValues?.(["platform","brands"]);t=JSON.stringify(r)}catch{}let n=e?.includes("Mac")&&t?.includes("Windows")||e?.includes("Win")&&t?.includes("Mac")||t&&t.length>0&&!e;return{value:{ua:e,brandInfo:t},triggered:n}}},{name:"timezoneLocaleMismatch",weight:1,async check(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=navigator.language||"",n=t.startsWith("en")&&e==="Asia/Shanghai"||t.startsWith("zh")&&e==="America/New_York"||e===void 0;return{value:{tz:e,lang:t},triggered:n}}},{name:"canvasNoise",weight:2,async check(){let e=()=>{let o=document.createElement("canvas"),i=o.getContext("2d");return i.textBaseline="top",i.font="14px Arial",i.fillText("anti-detect-check",2,2),o.toDataURL()},t=e(),n=e();return{value:{a:t,b:n},triggered:t!==n}}},{name:"webglNoise",weight:2,async check(){try{let t=document.createElement("canvas").getContext("webgl");if(!t)return{value:"no-webgl",triggered:!0};let n=t.getExtension("WEBGL_debug_renderer_info");if(!n)return{value:"no-debug-extension",triggered:!1};let r=t.getParameter(n.UNMASKED_VENDOR_WEBGL),o=t.getParameter(n.UNMASKED_RENDERER_WEBGL),i=r===""||o===""||r?.includes(" ")===!1||o?.includes(" ")===!1;return{value:{v:r,r:o},triggered:i}}catch{return{value:"gl-error",triggered:!0}}}},{name:"webdriverFlag",weight:3,async check(){let e=navigator.webdriver===!0;return{value:navigator.webdriver,triggered:e}}},{name:"perfectEventTiming",weight:1,async check(){let e=performance.now();return{value:e,triggered:e%1===0}}},{name:"serviceWorkerBlocked",weight:1,async check(){let e=!("serviceWorker"in navigator);return{value:e,triggered:e}}},{name:"smallQuota",weight:2,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<50*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"quota-error",triggered:!0}}}},{name:"indexedDbBlocked",weight:2,async check(){try{let e=indexedDB.open("tamper-check");return await new Promise(t=>{e.onerror=()=>t({value:"error",triggered:!0}),e.onsuccess=()=>t({value:"ok",triggered:!1})})}catch{return{value:"throw",triggered:!0}}}},{name:"screenDprMismatch",weight:1,async check(){let e=window.screen.width,t=window.screen.height,n=window.devicePixelRatio,r=e===1920&&n===1&&t===1080||n%1!==0&&n%1!==.5;return{value:{w:e,h:t,dpr:n},triggered:r}}},{name:"missingCommonFonts",weight:1,async check(){return{value:"skipped",triggered:!1}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices();return{value:e.length,triggered:e.length===0}}catch{return{value:"error",triggered:!0}}}},{name:"languagesEmpty",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"pluginMismatch",weight:1,async check(){try{let e=navigator.plugins.length;return{value:e,triggered:e===0}}catch{return{value:"error",triggered:!0}}}},{name:"devtoolsDetected",weight:2,async check(){return new Promise(async e=>{let t={viewportBreakpoint:!1,consoleSpeed:!1},n=160,r=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(r>n||o>n)&&(t.viewportBreakpoint=!0);async function i(a=50){return new Promise(c=>{let d=performance.now();console.log("%c ","font-size:3000px");let u=performance.now();c(u-d>a)})}t.consoleSpeed=await i();let s=Object.values(t).some(Boolean);setTimeout(()=>{e({value:s,triggered:s})},50)})}},{name:"knownAntiDetectBrowser",weight:5,async check(){let e=navigator.userAgent.toLowerCase(),n=["incogniton","multilogin","morelogin","adspect","kameleo","goLogin"].some(r=>e?.includes(r));return{value:e,triggered:n}}}];async function sn({threshold:e=5}={}){let t={},n=0;for(let o of io){let i=await o.check();t[o.name]=i,i.triggered&&(n+=o.weight)}let r=Math.min(1,n/15);return{result:r>=.5||t.knownAntiDetectBrowser?.triggered,anomalyScore:r,antiDetectBrowser:t.knownAntiDetectBrowser?.triggered||!1,signals:t}}function so(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function ao(){let e=navigator.userAgent,t=so();return t===44||t===43?"Safari":t===51?"Chrome":t===25?"Firefox":navigator.msSaveBlob!==void 0?"MSIE":e.match(/Chrome/)?navigator.brave!==void 0?"Brave":e.includes("Edg")?"Edge":e.includes("OPR")?"Opera":"Chrome":"Unknown"}var co=[{name:"safari_currentStorageTest",weight:2,browser:"Safari",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("unknown transient reason"),value:t}}}},{name:"safari13to18_indexedDbBlobTest",weight:2,browser:"Safari",async check(){return await new Promise(e=>{let t=String(Math.random()),n=indexedDB.open(t,1);n.onupgradeneeded=r=>{let o=r.target.result;try{o.createObjectStore("t",{autoIncrement:!0}).put(new Blob),e({triggered:!1,value:"ok"})}catch(i){let s=i?.message??String(i);e({triggered:s.includes("are not yet supported"),value:s})}finally{o.close(),indexedDB.deleteDatabase(t)}},n.onerror=()=>e({triggered:!1,value:"idb-error"})})}},{name:"safari_oldWebkitTest",weight:1,browser:"Safari",async check(){let e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{return{triggered:!0,value:"openDatabase denied"}}try{t.setItem("test","1"),t.removeItem("test")}catch{return{triggered:!0,value:"localStorage denied"}}return{triggered:!1,value:"ok"}}},{name:"chrome_storageQuotaPrivateTest",weight:2,browser:"Chrome",async check(){return await new Promise((e,t)=>{let r=window?.performance?.memory?.jsHeapSizeLimit??1073741824;navigator.webkitTemporaryStorage.queryUsageAndQuota((o,i)=>{let s=Math.round(i/1048576),a=Math.round(r/(1024*1024))*2;e({triggered:s<a,value:{quotaMB:s,limitMB:a}})},o=>t(o))})}},{name:"chrome_oldFileSystemTest",weight:1,browser:"Chrome",async check(){let e=window.webkitRequestFileSystem;return e?await new Promise(t=>e(0,1,()=>t({triggered:!1,value:"ok"}),()=>t({triggered:!0,value:"denied"}))):{triggered:!1,value:"unsupported"}}},{name:"firefox_storageDirectoryTest",weight:2,browser:"Firefox",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("Security error"),value:t}}}},{name:"firefox_indexedDbInvalidStateTest",weight:1,browser:"Firefox",async check(){return await new Promise(e=>{let t=indexedDB.open("inPrivate");t.onerror=()=>{e({triggered:t.error?.name==="InvalidStateError",value:t.error?.name})},t.onsuccess=()=>{indexedDB.deleteDatabase("inPrivate"),e({triggered:!1,value:"ok"})}})}},{name:"msie_indexedDbMissing",weight:2,browser:"MSIE",async check(){return{triggered:window.indexedDB===void 0,value:"msie-idb-check"}}}];async function an(){let e=ao(),t={},n=0;for(let r of co){if(r.browser!==e)continue;let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isPrivate:n>0,browserName:e,score:n,signals:t}}typeof window<"u"&&(window.detectIncognito=an);var cn=an;var un=[{name:"globalPrivacyControl",weight:3,async check(){let e=navigator.globalPrivacyControl;return{triggered:e===!0,value:e}}},{name:"doNotTrack",weight:1,async check(){let e=navigator.doNotTrack;return{triggered:e==="1",value:e}}},{name:"cookiesDisabled",weight:3,async check(){let e=navigator.cookieEnabled;return{triggered:e===!1,value:e}}},{name:"thirdPartyCookiesBlocked",weight:3,async check(){try{if("hasStorageAccess"in document&&!await document.hasStorageAccess())try{return await document.requestStorageAccess(),{triggered:!1,value:"access_granted"}}catch{return{triggered:!0,value:"access_denied"}}let e=`__dtect_3p_test_${Date.now()}`;document.cookie=`${e}=1; SameSite=None; Secure`;let t=document.cookie.includes(e);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT`,{triggered:!1,value:t?"cookies_work":"may_be_blocked"}}catch(e){return{triggered:!1,value:`error: ${e?.message}`}}}},{name:"firefoxResistFingerprinting",weight:2,async check(){let e=[],t=new Date().getTimezoneOffset();t===0&&Intl.DateTimeFormat().resolvedOptions().timeZone==="UTC"&&e.push("timezone_utc");let n=navigator.hardwareConcurrency;n===2&&e.push("cores_capped");let r=window.screen.width,o=window.screen.height,i=window.innerWidth,s=window.innerHeight;r===i&&o===s&&e.push("screen_matches_inner");let a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return{triggered:e.length>=2,value:{signals:e,timezoneOffset:t,cores:n,prefersReducedMotion:a}}}},{name:"braveShields",weight:3,async check(){if(!(navigator.brave!==void 0))return{triggered:!1,value:"not_brave"};try{if(!await navigator.brave.isBrave())return{triggered:!1,value:"brave_check_false"};let r=document.createElement("canvas").getContext("2d");if(r){r.fillStyle="rgb(255, 0, 0)",r.fillRect(0,0,1,1);let o=r.getImageData(0,0,1,1).data;r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data;if(o[0]!==i[0]||o[1]!==i[1]||o[2]!==i[2])return{triggered:!0,value:"shields_active_canvas"}}try{let o=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});if(o.createDataChannel(""),await new Promise(s=>{let a=setTimeout(()=>{o.close(),s(!1)},1e3);o.onicecandidate=c=>{c.candidate?.candidate&&(/([0-9]{1,3}\.){3}[0-9]{1,3}/.test(c.candidate.candidate)||(clearTimeout(a),o.close(),s(!0)))},o.createOffer().then(c=>o.setLocalDescription(c))}))return{triggered:!0,value:"shields_active_webrtc"}}catch{return{triggered:!0,value:"shields_active_webrtc_blocked"}}return{triggered:!0,value:"brave_detected_shields_default"}}catch(t){return{triggered:!1,value:`error: ${t?.message}`}}}}];async function ln(){let e={},t=0,n=await Promise.allSettled(un.map(async r=>{let o=await r.check();return{name:r.name,weight:r.weight,result:o}}));for(let r of n)if(r.status==="fulfilled"){let{name:o,weight:i,result:s}=r.value;e[o]=s,s.triggered&&(t+=i)}else{let o=n.indexOf(r),i=un[o];i&&(e[i.name]={triggered:!1,value:`check_failed: ${r.reason}`})}return{isPrivacyEnabled:t>3,score:t,signals:e}}typeof window<"u"&&(window.detectPrivacy=ln);var dn=ln;var mn="dtect_security_sdk_state",fn=typeof window<"u",hn={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Ie={state:{...hn},securityKeys:{behaviorKey:"bwDZ0V3Zrb4SB6g4lZwW",automationKey:"7166bf18-b91e-407a-84fc-d57ac104de98",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}};function pn(){if(!fn)return Ie;try{let e=sessionStorage.getItem(mn);if(!e)return Ie;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Ie:{state:{...hn,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}}}catch{return Ie}}function G(e){if(fn)try{let t=Date.now()+864e5,n={...e,expiresAt:t};sessionStorage.setItem(mn,JSON.stringify(n))}catch{}}function gn(e){return e.token||Q()}async function D(e,t="info",n={}){let r=`${n.endpoint??"https://api.dtect.io/security"}/log`,o={message:e,type:t,payload:n};navigator.sendBeacon(r,JSON.stringify(o))}var Re,R="https://api.dtect.io/security",be=`${R}/client/check`,T="",V="",uo=["2d6803fb-8373-4771-897a-dfa18acf7da4","f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","58da2d43-45c0-49be-96f6-bd4651148a42"],lo=["f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","13b1fab5-c93c-48db-a50d-03c7df6c30b8","4c5dea4c-d1b7-4dc7-88fc-cf03e7a54a66","32014166-ed5f-4e30-a58b-587e2a2881d8","67107037-d5b5-483a-a046-bf39c38ce738","23b778f9-d07f-477d-9863-168c90a320d2","57392ff8-1733-41e7-b336-a9c7a01ef559","59073b5c-2b9a-4933-9d7e-655b0559196f"],yn="0.0.30",mo="20000000-aaaa-bbbb-cccc-000000000002",Te;var{state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}=pn(),En=Ot,se;async function fo({clientId:e,apiKey:t,endpoint:n}){if(Pe({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k};let r=await rn.fetchQuery({queryKey:["getClientConfig",e,t],queryFn:()=>ct({url:`${n}/client/config`,headers:{"client-id":T,"x-api-key":V}})});if(!Pe(r))throw new Error("Missing keys from get client config");return L=r.automationKey,U=r.behaviorKey,B=r.dtectSignalEnabled,k=r.dtectAutomationSignalEnabled,G({state:m,securityKeys:r}),r}function gt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(I.RATE_LIMIT_REACHED);switch(e?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_TOKEN)}function H(){if(In(m)&&Pe({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return!0;let e=ke(),t=document.querySelector("#dtect-h-captcha");return!!Re&&!!(!k&&t||e||k)}function wn(){return!!(T&&V)}function ho(){return new Promise(e=>{let t=()=>{window?.hcaptcha?e():requestAnimationFrame(t)};t()})}var ke=()=>window?.location?.href?.includes("localhost")||window?.location?.href?.includes("file:///");async function po({behaviorKey:e,dtectAutomationSignalEnabled:t=!1}){let n=performance.now();Re=await j.load({apiKey:e,endpoint:["https://fp.dtect.io",j.defaultEndpoint],scriptUrlPattern:["https://fp.dtect.io/web/v<version>/<apiKey>/loader_v<loaderVersion>.js",j.defaultScriptUrlPattern]});let o=(performance.now()-n).toFixed();if(D(`FingerprintJS loaded in ${o}ms`,"info",{function:"fpjs load",endpoint:R,diff:o,token:m.token,clientId:T}),!ke()&&!t&&(await ho(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:L,size:"invisible"})),!Re)throw new Error(I.SDK_INIT_ERROR)}async function go(){let e=performance.now();if(m.tokens){let c=(performance.now()-e).toFixed();return D(`getTokens finishes in ${c}ms`,"info",{function:"getTokens",endpoint:R,diff:c,token:m.token,clientId:T}),m.tokens}let t=new Promise(a=>{let c=Re?.get();a(c)}),n=new Promise(async a=>{ke()&&a({response:mo});let d=await window?.hcaptcha?.execute({async:!0});a(d)}),[r,o]=await Promise.all([k?{response:""}:n,t]);m.tokens={behaviorRequestId:o?.requestId,behaviorToken:o?.sealedResult,automationToken:r?.response};let s=(performance.now()-e).toFixed();return D(`getTokens finishes in ${s}ms`,"info",{function:"getTokens",endpoint:R,diff:s,token:m.token,clientId:T}),m.tokens}function yo(e){let t=e?.projectId,n=e?.visitorId||Q();return(typeof e?.projectId=="number"||typeof e?.visitorId=="number")&&(t=`${e?.projectId}`,n=`${e?.visitorId}`),{visitorId:n,projectId:t}}function yt(e){let{projectId:t,visitorId:n}=yo(e);return{projectId:t,visitorId:n}}async function vn(e,t){let n=performance.now();if(!H())throw new Error(I.NOT_INITIALIZED);if(!wn())throw new Error(I.MISSING_CREDENTIALS);let{projectId:r,visitorId:o}=yt(e);if(r!==m.projectId&&(m.token=Q()),m.visitorId=o,m.projectId=r,!e||!r?.trim())throw new Error(I.FAILED_TO_GET_SECURITY_RESULT);let i;try{let s=await go();if(B){let a=new te,[c,d,u,l,f]=await Promise.allSettled([a.get(),on(),sn(),cn(),dn()]);i={deviceRes:c,vmDtectResults:d,tamperingDtectResults:u,incognitoDtectResults:l,privacySettingsDtectResults:f}}if(s?.behaviorToken&&s?.behaviorRequestId&&(k||!k&&s?.automationToken)){let a={behaviorToken:s.behaviorToken,automationToken:s.automationToken,behaviorRequestId:s.behaviorRequestId,entryLink:window?.location?.href,securitySettings:e.securitySettings,metaData:e.metaData,...B?{vmDtectResults:i?.vmDtectResults?.value,tamperingDtectResults:i?.tamperingDtectResults?.value,incognitoDtectResults:i?.incognitoDtectResults?.value,deviceIdResults:i?.deviceRes?.value,privacySettingsDtectResults:i?.privacySettingsDtectResults?.value}:{}};m.clientData=a;let c={...e,projectId:r,visitorId:o,clientData:a,version:"0.0.30",token:m.token,questionData:m.questionData,aiCheckData:m.aiCheckData},d=await he({url:`${t}`,body:{...c},headers:{"client-id":T,"x-api-key":V}});if("token"in d||"results"in d){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let l=(performance.now()-n).toFixed();return D(`getResultBase finishes in ${l}ms`,"info",{function:"getResultBase",endpoint:R,diff:l,token:m.token,clientId:T}),d}}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(s){let c=(performance.now()-n).toFixed();if(D("getResultBase error","error",{function:"getResultBase",endpoint:R,error:s,diff:c,token:m.token,clientId:T}),s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(s?.message?.includes("rate-limited")||s?.message?.includes("429"))throw new Error(I.RATE_LIMIT_REACHED);switch(s?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_RESULT)}}async function Ae(e){return await vn(e,`${R}/client/check/result`)}async function Se(e){return await vn(e,`${R}/client/check`)}async function Oe(e){let t=performance.now();if(!H())throw new Error(I.NOT_INITIALIZED);let{respondentType:n,language:r}=e;try{let o=await ct({url:`${R}/client/quality-questions/${n}/${r}`,headers:{"client-id":T,"x-api-key":V}});if(o){let s=(performance.now()-t).toFixed();return D(`getQualityQuestions finishes in ${s}ms`,"info",{function:"getQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("getQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),gt(o)}}async function De(e){let t=performance.now();if(!H())throw new Error(I.NOT_INITIALIZED);m.questionData||(m.questionData={questions:e.questions});let{visitorId:n,projectId:r}=yt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:yn,questionData:m.questionData,aiCheckData:m.aiCheckData,clientData:m.clientData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`checkQualityQuestions finishes in ${s}ms`,"info",{function:"checkQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("checkQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),gt(o)}}async function _e(e){let t=performance.now();if(!H())throw new Error(I.NOT_INITIALIZED);m.aiCheckData={timeTakenSeconds:e.timeTakenSeconds,qbc:e.qbc||se.qbc,mas:e.mas||se.mas,scb:e.scb||se.scb,apd:e.apd||se.apd};let{visitorId:n,projectId:r}=yt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:yn,clientData:m.clientData,questionData:m.questionData,aiCheckData:m.aiCheckData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`isAIUsageDetected finishes in ${s}ms`,"info",{function:"isAIUsageDetected",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("isAIUsageDetected error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),gt(o)}}function Eo(){let e=performance.now(),t=document.querySelector("head"),n=document.querySelector("body");if(!ke()){n?.insertAdjacentHTML("beforeend",'<div id="dtect-h-captcha" ></div>');let o=document.createElement("script");o.setAttribute("src","https://js.hcaptcha.com/1/api.js"),o.setAttribute("async","true"),o.setAttribute("defer","true"),t?.append(o);let s=(performance.now()-e).toFixed()}}function Pe(e){return(e.dtectAutomationSignalEnabled||e?.automationKey)&&e?.behaviorKey}function In(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function Rn(e){let t=performance.now();if(!e?.clientId||!e?.apiKey)throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);let{clientId:n,apiKey:r,endpoint:o="https://api.dtect.io/security",includeResults:i}=e;R=o,be=`${R}/client/check`;let s=gn(m);if(m.isLoading){if(H())return Te;throw D(I.DUPLICATE_INITIALIZATION,"error",{endpoint:R,clientId:n,apiKey:r,token:m.token}),new Error(I.DUPLICATE_INITIALIZATION)}if(se=qt(m.aiCheckData),T=n,V=r,k=uo.includes(n),B=lo.includes(n),i&&(be=`${R}/client/check/result`),m={...m,isLoading:!0,token:s||""},In(m)&&Pe({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}),{getSecurityResult:Ae,getSecurityToken:Se,isAIUsageDetected:_e,checkQualityQuestions:De,getQualityQuestions:Oe,LanguageCodes:W,QualityQuestionsRespondentTypes:$};if(!wn())throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);if(H())return Te;try{let c=await fo({clientId:n,apiKey:r,endpoint:o});return c.dtectAutomationSignalEnabled||Eo(),po({behaviorKey:c.behaviorKey,dtectAutomationSignalEnabled:c.dtectAutomationSignalEnabled}).then(()=>{let u=(performance.now()-t).toFixed();return D(`init() finishes ${u}ms`,"info",{endpoint:R,function:"init",diff:u,token:m.token,clientId:T}),{getSecurityResult:Ae,getSecurityToken:Se,SecurityAPIError:En,isAIUsageDetected:_e,checkQualityQuestions:De,getQualityQuestions:Oe,LanguageCodes:W,QualityQuestionsRespondentTypes:$}}).catch(d=>{throw new Error(d.message)})}catch(c){if(c instanceof Error){if(D(c.message,"error",{function:"init",endpoint:R,error:c,token:m.token,clientId:T}),c?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if([I.INVALID_API_KEY,I.UNAUTHORIZED].includes(c?.message))throw new Error(I.INVALID_CREDENTIALS)}throw new Error(I.SDK_INIT_ERROR)}finally{m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}})}}Te={init:Rn,getSecurityResult:Ae,getSecurityToken:Se,isAIUsageDetected:_e,checkQualityQuestions:De,getQualityQuestions:Oe,QualityQuestionsRespondentTypes:$,LanguageCodes:W};var wo=Te;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- function vn(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function In(e,t,n,r){let o=document,i="securitypolicyviolation",s,a=d=>{let u=new URL(e,location.href),{blockedURI:l}=d;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(s=d,c())};o.addEventListener(i,a);let c=()=>o.removeEventListener(i,a);return r?.then(c,c),Promise.resolve().then(t).then(d=>(c(),d),d=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),s)return n(s);throw d}))}function F(e){let t="";for(let n=0;n<e.length;++n)if(n>0){let r=e[n].toLowerCase();r!==e[n]?t+=` ${r}`:t+=e[n]}else t+=e[n].toUpperCase();return t}var Rn={default:"endpoint"},bn={default:"tlsEndpoint"},Tn="Client timeout",An="Network connection error",Sn="Network request aborted",On="Response cannot be parsed",ke="Blocked by CSP",xe="The endpoint parameter is not a valid URL",Dn="Handle on demand agent data error",_n=F("WrongRegion"),Pn=F("SubscriptionNotActive"),kn=F("UnsupportedVersion"),xn=F("InstallationMethodRestricted"),Nn=F("HostnameRestricted"),Mn=F("IntegrationFailed"),Cn=F("NetworkRestricted"),Ln=F("InvalidProxyIntegrationSecret"),Fn=F("InvalidProxyIntegrationHeaders"),Un=F("ProxyIntegrationSecretEnvironmentMismatch"),Ne="API key required",yt="API key not found",Et="API key expired",Bn="Request cannot be parsed",qn="Request failed",Kn="Request failed to process",Gn="Too many requests, rate limit exceeded",Vn="Not available for this origin",jn="Not available with restricted header",Qn=Ne,Wn=yt,$n=Et,zn="3.12.0",ae="Failed to load the JS script of the agent",Me="9319";function Yn(e,t){let n=[],[r,o]=function(a){let c=function(l){let f=[...l];return{current:()=>f[0],postpone(){let E=f.shift();E!==void 0&&f.push(E)},exclude(){f.shift()}}}(a),d=function(l,f){let E=0;return()=>Math.random()*Math.min(f,l*Math.pow(2,E++))}(100,3e3),u=new Set;return[c.current(),(l,f)=>{let E,y=f instanceof Error?f.message:"";if(y===ke||y===xe)c.exclude(),E=0;else if(y===Me)c.exclude();else if(y===ae){let w=Date.now()-l.getTime()<50,g=c.current();g&&w&&!u.has(g)&&(u.add(g),E=0),c.postpone()}else c.postpone();let h=c.current();return h===void 0?void 0:[h,E??l.getTime()+d()-Date.now()]}]}(e),i;if(r===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));let s=a=>{let c=new Date,d=l=>n.push({url:a,startedAt:c,finishedAt:new Date,error:l}),u=t(a);return u.then(()=>d(),d),u.catch(l=>{if(i!=null||(i=l),n.length>=5)throw i;let f=o(c,l);if(!f)throw i;let[E,y]=f;return(h=y,new Promise(w=>setTimeout(w,h))).then(()=>s(E));var h})};return s(r).then(a=>[a,n])}var wt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",Jn=wt;function Xn(e){var t,n;let{picked:r,rest:o}=function(u,l){let f={},E={};for(let[y,h]of Object.entries(u))l.includes(y)?f[y]=h:E[y]=h;return{picked:f,rest:E}}(e,["scriptUrlPattern","token","apiKey"]),i=r.token,s=(t=r.apiKey)!==null&&t!==void 0?t:i,a=(n=vn(e,"scriptUrlPattern"))!==null&&n!==void 0?n:wt,[c,d]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},f=function(E,y,h,w){return E.addEventListener(y,h,w),()=>E.removeEventListener(y,h,w)}(document,"visibilitychange",l);return l(),[u,f]}();return Promise.resolve().then(()=>{if(!s||typeof s!="string")throw new Error(Ne);let u=function(l,f){return(Array.isArray(l)?l:[l]).map(E=>function(y,h){let w=encodeURIComponent;return y.replace(/<[^<>]+>/g,g=>g==="<version>"?"3":g==="<apiKey>"?w(h):g==="<loaderVersion>"?w(zn):g)}(String(E),f))}(a,s);return Yn(u,Zn)}).catch(u=>{throw d(),function(l){return l instanceof Error&&l.message===Me?new Error(ae):l}(u)}).then(([u,l])=>(d(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function Zn(e){return In(e,()=>function(t){return new Promise((n,r)=>{if(function(a){if(URL.prototype)try{return new URL(a,location.href),!1}catch(c){if(c instanceof Error&&c.name==="TypeError")return!0;throw c}}(t))throw new Error(xe);let o=document.createElement("script"),i=()=>{var a;return(a=o.parentNode)===null||a===void 0?void 0:a.removeChild(o)},s=document.head||document.getElementsByTagName("head")[0];o.onload=()=>{i(),n()},o.onerror=()=>{i(),r(new Error(ae))},o.async=!0,o.src=t,s.appendChild(o)})}(e),()=>{throw new Error(ke)}).then(Hn)}function Hn(){let e=window,t="__fpjs_p_l_b",n=e[t];if(function(r,o){var i;let s=(i=Object.getOwnPropertyDescriptor)===null||i===void 0?void 0:i.call(Object,r,o);s?.configurable?delete r[o]:s&&!s.writable||(r[o]=void 0)}(e,t),typeof n?.load!="function")throw new Error(Me);return n}var j={load:Xn,defaultScriptUrlPattern:Jn,ERROR_SCRIPT_LOAD_FAIL:ae,ERROR_API_KEY_EXPIRED:Et,ERROR_API_KEY_INVALID:yt,ERROR_API_KEY_MISSING:Ne,ERROR_BAD_REQUEST_FORMAT:Bn,ERROR_BAD_RESPONSE_FORMAT:On,ERROR_CLIENT_TIMEOUT:Tn,ERROR_CSP_BLOCK:ke,ERROR_FORBIDDEN_ENDPOINT:Nn,ERROR_FORBIDDEN_HEADER:jn,ERROR_FORBIDDEN_ORIGIN:Vn,ERROR_GENERAL_SERVER_FAILURE:qn,ERROR_HANDLE_AGENT_DATA:Dn,ERROR_INSTALLATION_METHOD_RESTRICTED:xn,ERROR_INTEGRATION_FAILURE:Mn,ERROR_INVALID_ENDPOINT:xe,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Fn,ERROR_INVALID_PROXY_INTEGRATION_SECRET:Ln,ERROR_NETWORK_ABORT:Sn,ERROR_NETWORK_CONNECTION:An,ERROR_NETWORK_RESTRICTED:Cn,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:Un,ERROR_RATE_LIMIT:Gn,ERROR_SERVER_TIMEOUT:Kn,ERROR_SUBSCRIPTION_NOT_ACTIVE:Pn,ERROR_TOKEN_EXPIRED:$n,ERROR_TOKEN_INVALID:Wn,ERROR_TOKEN_MISSING:Qn,ERROR_UNSUPPORTED_VERSION:kn,ERROR_WRONG_REGION:_n,defaultEndpoint:Rn,defaultTlsEndpoint:bn};var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function vt(e,t=0){return(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase()}var Ce,er=new Uint8Array(16);function Le(){if(!Ce){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ce=crypto.getRandomValues.bind(crypto)}return Ce(er)}var tr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fe={randomUUID:tr};function nr(e,t,n){if(Fe.randomUUID&&!t&&!e)return Fe.randomUUID();e=e||{};let r=e.random??e.rng?.()??Le();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=r[o];return t}return vt(r)}var X=nr;var rr={UNAUTHORIZED:"Unauthorized"},or={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},It={INTERNAL_SERVER_ERROR:"Internal Server Error during API Request",MISSING_CREDENTIALS:"Missing Public Client ID or Public API Key",MAINTENANCE_MODE:"API Under Maintenance",RATE_LIMIT_REACHED:"Too many requests. Rate limit exceeded"},Rt={SDK_INIT_ERROR:"Internal Server Error during SDK Initialization",DUPLICATE_INITIALIZATION:"Multiple SDK Initializations Detected",NOT_INITIALIZED:"SDK Not Initialized"},bt={INVALID_CREDENTIALS:"Invalid Public Client ID or Public API Key"},Tt={FAILED_TO_GET_SECURITY_RESULT:"Failed to Retrieve Security Result"},At={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},I={...rr,...or,...It,...Rt,...bt,...Tt,...At},St={...It,...Rt,...bt,...Tt,...At};var Z=(g=>(g.AR="ar",g.BN="bn",g.DE="de",g.EN="en",g.ES="es",g.FR="fr",g.HI="hi",g.ID="id",g.IT="it",g.JA="ja",g.KO="ko",g.MS="ms",g.NL="nl",g.PT="pt",g.RU="ru",g.YU="yu",g.ZH="zh",g))(Z||{}),H=(v=>(v.GeneralConsumer="general-consumer",v.HRManagerDirector="hr-manager-director",v.WebDeveloper="web-developer",v.SoftwareEngineer="software-engineer",v.ITDirector="it-director",v.BusinessAdministrator="business-administrator",v.AccountsPayableManager="accounts-payable-manager",v.Accountant="accountant",v.FinanceDirector="finance-director",v.SmallBusinessOwner="small-business-owner",v.GeneralContractor="general-contractor",v.MarketingManagerDirector="marketing-manager-director",v.ConsumerShopper="consumer-shopper",v.Travel="travel",v.Entertainment="entertainment",v.FinanceAndBanking="finance-and-banking",v.General="general",v.B2BWhiteCollar="b2b-white-collar",v.B2BBlueCollar="b2b-blue-collar",v.Lawyer="lawyer",v))(H||{});var Q={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},No={...Q},Ue={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}]};async function Be(){return ir()}async function ir(){return new Promise((t,n)=>{try{let i=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),s=i?.createBufferSource(),a=i.createOscillator();a.frequency.value=1e3;let c=i.createDynamicsCompressor();c.threshold.value=-50,c.knee.value=40,c.ratio.value=12,c.attack.value=0,c.release.value=.2,a.connect(c),c.connect(i.destination),a.start();let d;i.oncomplete=u=>{d=u.renderedBuffer.getChannelData(0),t({sampleHash:sr(d),maxChannels:i.destination.maxChannelCount,channelCountMode:s.channelCountMode})},i.startRendering()}catch(r){console.error("Error creating audio fingerprint:",r),n(r)}})}function sr(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function ce(e,t,n){let r=[];for(let s=0;s<e[0].data.length;s++){let a=[];for(let c=0;c<e.length;c++)a.push(e[c].data[s]);r.push(ar(a))}let o=r,i=new Uint8ClampedArray(o);return new ImageData(i,t,n)}function ar(e){if(e.length===0)return 0;let t={};for(let r of e)t[r]=(t[r]||0)+1;let n=e[0];for(let r in t)t[r]>t[n]&&(n=parseInt(r,10));return n}function cr(e){return new TextEncoder().encode(e).buffer}function ue(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^=e>>>16,e>>>0}var _=new Uint32Array([597399067,2869860233,951274213,2716044179]);function C(e,t){return e<<t|e>>>32-t}function ur(e,t){let n=e.byteLength/16|0,r=new Uint32Array(e,0,n*4);for(let o=0;o<n;o++){let i=r.subarray(o*4,(o+1)*4);i[0]=Math.imul(i[0],_[0]),i[0]=C(i[0],15),i[0]=Math.imul(i[0],_[1]),t[0]=t[0]^i[0],t[0]=C(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],_[1]),i[1]=C(i[1],16),i[1]=Math.imul(i[1],_[2]),t[1]=t[1]^i[1],t[1]=C(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],_[2]),i[2]=C(i[2],17),i[2]=Math.imul(i[2],_[3]),t[2]=t[2]^i[2],t[2]=C(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],_[3]),i[3]=C(i[3],18),i[3]=Math.imul(i[3],_[0]),t[3]=t[3]^i[3],t[3]=C(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function lr(e,t){let n=e.byteLength/16|0,r=e.byteLength%16,o=new Uint32Array(4),i=new Uint8Array(e,n*16,r);switch(r){case 15:o[3]=o[3]^i[14]<<16;case 14:o[3]=o[3]^i[13]<<8;case 13:o[3]=o[3]^i[12]<<0,o[3]=Math.imul(o[3],_[3]),o[3]=C(o[3],18),o[3]=Math.imul(o[3],_[0]),t[3]=t[3]^o[3];case 12:o[2]=o[2]^i[11]<<24;case 11:o[2]=o[2]^i[10]<<16;case 10:o[2]=o[2]^i[9]<<8;case 9:o[2]=o[2]^i[8]<<0,o[2]=Math.imul(o[2],_[2]),o[2]=C(o[2],17),o[2]=Math.imul(o[2],_[3]),t[2]=t[2]^o[2];case 8:o[1]=o[1]^i[7]<<24;case 7:o[1]=o[1]^i[6]<<16;case 6:o[1]=o[1]^i[5]<<8;case 5:o[1]=o[1]^i[4]<<0,o[1]=Math.imul(o[1],_[1]),o[1]=C(o[1],16),o[1]=Math.imul(o[1],_[2]),t[1]=t[1]^o[1];case 4:o[0]=o[0]^i[3]<<24;case 3:o[0]=o[0]^i[2]<<16;case 2:o[0]=o[0]^i[1]<<8;case 1:o[0]=o[0]^i[0]<<0,o[0]=Math.imul(o[0],_[0]),o[0]=C(o[0],15),o[0]=Math.imul(o[0],_[1]),t[0]=t[0]^o[0]}}function dr(e,t){t[0]=t[0]^e.byteLength,t[1]=t[1]^e.byteLength,t[2]=t[2]^e.byteLength,t[3]=t[3]^e.byteLength,t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0,t[0]=ue(t[0]),t[1]=ue(t[1]),t[2]=ue(t[2]),t[3]=ue(t[3]),t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0}function O(e,t=0){if(t=t?t|0:0,typeof e=="string"&&(e=cr(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([t,t,t,t]);ur(e,n),lr(e,n),dr(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}var mr=3,Ot=280,Dt=20;async function qe(){return fr()}function fr(){return new Promise(e=>{let t=Array.from({length:mr},()=>hr()),n=ce(t,Ot,Dt);e({commonPixelsHash:O(n.data.toString()).toString()})})}function hr(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Ot,e.height=Dt;let n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,"red"),n.addColorStop(1/6,"orange"),n.addColorStop(2/6,"yellow"),n.addColorStop(3/6,"green"),n.addColorStop(4/6,"blue"),n.addColorStop(5/6,"indigo"),n.addColorStop(1,"violet"),t.fillStyle=n,t.fillRect(0,0,e.width,e.height);let r="Random Text WMwmil10Oo";return t.font="23.123px Arial",t.fillStyle="black",t.fillText(r,-5,15),t.fillStyle="rgba(0, 0, 255, 0.5)",t.fillText(r,-3.3,17.7),t.beginPath(),t.moveTo(0,0),t.lineTo(e.width*2/7,e.height),t.strokeStyle="white",t.lineWidth=2,t.stroke(),t.getImageData(0,0,e.width,e.height)}async function le(e){for(;!document.body;)await pr(50);let t=document.createElement("iframe");t.setAttribute("frameBorder","0");let n=t.style;n.setProperty("position","fixed"),n.setProperty("display","block","important"),n.setProperty("visibility","visible"),n.setProperty("border","0"),n.setProperty("opacity","0"),t.src="about:blank",document.body.appendChild(t);let r=t.contentDocument||t.contentWindow?.document;if(!r)throw new Error("Iframe document is not accessible");e({iframe:r}),setTimeout(()=>{document.body.removeChild(t)},0)}function pr(e,t){return new Promise(n=>setTimeout(n,e,t))}var gr=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],yr=["monospace","sans-serif","serif"];async function Ke(e){return Er()}function Er(){return new Promise((e,t)=>{try{le(async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d"),i=yr.map(a=>_t(o,a)),s={};gr.forEach(a=>{let c=_t(o,a);i.includes(c)||(s[a]=c)}),e(s)})}catch{t({error:"unsupported"})}})}function _t(e,t){if(!e)return null;let n="WwMmLli0Oo";return e.font=`72px ${t}`,e.measureText(n).width}function Ge(){return new Promise((e,t)=>{let n=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,r=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:wr(),architecture:vr(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:r.jsHeapSizeLimit||0})})}function wr(){let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(t&&"getParameter"in t)try{let n=(t.getParameter(t.VENDOR)||"").toString(),r=(t.getParameter(t.RENDERER)||"").toString(),o={vendor:n,renderer:r,version:(t.getParameter(t.VERSION)||"").toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||"").toString()};if(!r.length||!n.length){let i=t.getExtension("WEBGL_debug_renderer_info");if(i){let s=(t.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),a=(t.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString();s&&(o.vendorUnmasked=s),a&&(o.rendererUnmasked=a)}}return o}catch{}return"undefined"}function vr(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Ve(){return new Promise(e=>{e({languages:Ir(),timezone:Rr()})})}function Ir(){let e=[];return navigator.language}function Rr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var de=(e,t,n,r)=>{let o=(n-t)/r,i=0;for(let s=0;s<r;s++){let a=t+(s+.5)*o;i+=e(a)}return i*o};function je(){return new Promise(e=>{e({acos:Math.acos(.5),asin:de(Math.asin,-1,1,97),cos:de(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:de(Math.sin,-Math.PI,Math.PI,97),tan:de(Math.tan,0,2*Math.PI,97)})})}function br(e){if(e.length===0)return null;let t={};e.forEach(o=>{let i=String(o);t[i]=(t[i]||0)+1});let n=e[0],r=1;return Object.keys(t).forEach(o=>{t[o]>r&&(n=o,r=t[o])}),n}function Pt(e,t){let n={};return t.forEach(r=>{let o=e.map(s=>r in s?s[r]:void 0).filter(s=>s!==void 0),i=br(o);i&&(n[r]=i)}),n}var Tr=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"];async function Qe(e){let t=e?.permissions_to_check||Tr,r=await Promise.all(Array.from({length:3},()=>Ar(t)));return Pt(r,t)}async function Ar(e){let t={};for(let n of e)try{let r=await navigator.permissions.query({name:n});t[n]=r.state.toString()}catch{}return t}async function We(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join("|"))}return new Promise(t=>{t({plugins:e})})}function W(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};let e=navigator.userAgent,t=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Brave)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],n={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(let r of t){let o=e.match(r);if(o){let i=o.groups?.name,s=o.groups?.version||o.groups?.version1||o.groups?.version2;if(!i&&(o.groups?.version1||o.groups?.version2)&&(i="Safari"),!i&&r.source.includes("Opera Mini")&&(i="Opera Mini"),!i&&r.source.includes("Opera Mobi")&&(i="Opera Mobi"),!i&&r.source.includes("Opera")&&(i="Opera"),!i&&o[1]&&(i=o[1]),!s&&o[2]&&(s=o[2]),i)return{name:n[i.toLowerCase()]||i,version:s||"unknown"}}}return{name:"unknown",version:"unknown"}}function me(){if(typeof navigator>"u"||!navigator.userAgent)return!1;let e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function $e(){return new Promise(e=>{let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:Or()};me()&&navigator.maxTouchPoints>0&&(t.resolution=Sr()),e(t)})}function Sr(){let e=window.screen.width,t=window.screen.height,n=Math.max(e,t).toString(),r=Math.min(e,t).toString();return`${n}x${r}`}function Or(){let e=[],t={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(t).forEach(n=>{t[n].forEach(r=>{matchMedia(`(${n}: ${r})`).matches&&e.push(`${n}: ${r}`)})}),e}function ze(){return new Promise(e=>{let t=W(),n=navigator.userAgent,r={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:me(),applePayVersion:Dr(),cookieEnabled:window.navigator.cookieEnabled};e(r)})}function Dr(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{let e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}var _r=W().name!=="SamsungBrowser"?1:3,P,p=null;function Pr(){typeof document<"u"&&(P=document.createElement("canvas"),P.width=200,P.height=100,p=P.getContext("webgl"))}async function Ye(){Pr();try{if(!p)throw new Error("WebGL not supported");let e=Array.from({length:_r},()=>kr()),t=ce(e,P.width,P.height);return{commonPixelsHash:O(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function kr(){try{if(!p)throw new Error("WebGL not supported");let e=`
1
+ function vn(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function In(e,t,n,r){let o=document,i="securitypolicyviolation",s,a=d=>{let u=new URL(e,location.href),{blockedURI:l}=d;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(s=d,c())};o.addEventListener(i,a);let c=()=>o.removeEventListener(i,a);return r?.then(c,c),Promise.resolve().then(t).then(d=>(c(),d),d=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),s)return n(s);throw d}))}function F(e){let t="";for(let n=0;n<e.length;++n)if(n>0){let r=e[n].toLowerCase();r!==e[n]?t+=` ${r}`:t+=e[n]}else t+=e[n].toUpperCase();return t}var Rn={default:"endpoint"},bn={default:"tlsEndpoint"},Tn="Client timeout",An="Network connection error",Sn="Network request aborted",On="Response cannot be parsed",ke="Blocked by CSP",xe="The endpoint parameter is not a valid URL",Dn="Handle on demand agent data error",_n=F("WrongRegion"),Pn=F("SubscriptionNotActive"),kn=F("UnsupportedVersion"),xn=F("InstallationMethodRestricted"),Nn=F("HostnameRestricted"),Mn=F("IntegrationFailed"),Cn=F("NetworkRestricted"),Ln=F("InvalidProxyIntegrationSecret"),Fn=F("InvalidProxyIntegrationHeaders"),Un=F("ProxyIntegrationSecretEnvironmentMismatch"),Ne="API key required",yt="API key not found",Et="API key expired",Bn="Request cannot be parsed",qn="Request failed",Kn="Request failed to process",Gn="Too many requests, rate limit exceeded",Vn="Not available for this origin",jn="Not available with restricted header",Qn=Ne,Wn=yt,$n=Et,zn="3.12.0",ae="Failed to load the JS script of the agent",Me="9319";function Yn(e,t){let n=[],[r,o]=function(a){let c=function(l){let f=[...l];return{current:()=>f[0],postpone(){let E=f.shift();E!==void 0&&f.push(E)},exclude(){f.shift()}}}(a),d=function(l,f){let E=0;return()=>Math.random()*Math.min(f,l*Math.pow(2,E++))}(100,3e3),u=new Set;return[c.current(),(l,f)=>{let E,y=f instanceof Error?f.message:"";if(y===ke||y===xe)c.exclude(),E=0;else if(y===Me)c.exclude();else if(y===ae){let w=Date.now()-l.getTime()<50,g=c.current();g&&w&&!u.has(g)&&(u.add(g),E=0),c.postpone()}else c.postpone();let h=c.current();return h===void 0?void 0:[h,E??l.getTime()+d()-Date.now()]}]}(e),i;if(r===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));let s=a=>{let c=new Date,d=l=>n.push({url:a,startedAt:c,finishedAt:new Date,error:l}),u=t(a);return u.then(()=>d(),d),u.catch(l=>{if(i!=null||(i=l),n.length>=5)throw i;let f=o(c,l);if(!f)throw i;let[E,y]=f;return(h=y,new Promise(w=>setTimeout(w,h))).then(()=>s(E));var h})};return s(r).then(a=>[a,n])}var wt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",Jn=wt;function Xn(e){var t,n;let{picked:r,rest:o}=function(u,l){let f={},E={};for(let[y,h]of Object.entries(u))l.includes(y)?f[y]=h:E[y]=h;return{picked:f,rest:E}}(e,["scriptUrlPattern","token","apiKey"]),i=r.token,s=(t=r.apiKey)!==null&&t!==void 0?t:i,a=(n=vn(e,"scriptUrlPattern"))!==null&&n!==void 0?n:wt,[c,d]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},f=function(E,y,h,w){return E.addEventListener(y,h,w),()=>E.removeEventListener(y,h,w)}(document,"visibilitychange",l);return l(),[u,f]}();return Promise.resolve().then(()=>{if(!s||typeof s!="string")throw new Error(Ne);let u=function(l,f){return(Array.isArray(l)?l:[l]).map(E=>function(y,h){let w=encodeURIComponent;return y.replace(/<[^<>]+>/g,g=>g==="<version>"?"3":g==="<apiKey>"?w(h):g==="<loaderVersion>"?w(zn):g)}(String(E),f))}(a,s);return Yn(u,Zn)}).catch(u=>{throw d(),function(l){return l instanceof Error&&l.message===Me?new Error(ae):l}(u)}).then(([u,l])=>(d(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function Zn(e){return In(e,()=>function(t){return new Promise((n,r)=>{if(function(a){if(URL.prototype)try{return new URL(a,location.href),!1}catch(c){if(c instanceof Error&&c.name==="TypeError")return!0;throw c}}(t))throw new Error(xe);let o=document.createElement("script"),i=()=>{var a;return(a=o.parentNode)===null||a===void 0?void 0:a.removeChild(o)},s=document.head||document.getElementsByTagName("head")[0];o.onload=()=>{i(),n()},o.onerror=()=>{i(),r(new Error(ae))},o.async=!0,o.src=t,s.appendChild(o)})}(e),()=>{throw new Error(ke)}).then(Hn)}function Hn(){let e=window,t="__fpjs_p_l_b",n=e[t];if(function(r,o){var i;let s=(i=Object.getOwnPropertyDescriptor)===null||i===void 0?void 0:i.call(Object,r,o);s?.configurable?delete r[o]:s&&!s.writable||(r[o]=void 0)}(e,t),typeof n?.load!="function")throw new Error(Me);return n}var j={load:Xn,defaultScriptUrlPattern:Jn,ERROR_SCRIPT_LOAD_FAIL:ae,ERROR_API_KEY_EXPIRED:Et,ERROR_API_KEY_INVALID:yt,ERROR_API_KEY_MISSING:Ne,ERROR_BAD_REQUEST_FORMAT:Bn,ERROR_BAD_RESPONSE_FORMAT:On,ERROR_CLIENT_TIMEOUT:Tn,ERROR_CSP_BLOCK:ke,ERROR_FORBIDDEN_ENDPOINT:Nn,ERROR_FORBIDDEN_HEADER:jn,ERROR_FORBIDDEN_ORIGIN:Vn,ERROR_GENERAL_SERVER_FAILURE:qn,ERROR_HANDLE_AGENT_DATA:Dn,ERROR_INSTALLATION_METHOD_RESTRICTED:xn,ERROR_INTEGRATION_FAILURE:Mn,ERROR_INVALID_ENDPOINT:xe,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Fn,ERROR_INVALID_PROXY_INTEGRATION_SECRET:Ln,ERROR_NETWORK_ABORT:Sn,ERROR_NETWORK_CONNECTION:An,ERROR_NETWORK_RESTRICTED:Cn,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:Un,ERROR_RATE_LIMIT:Gn,ERROR_SERVER_TIMEOUT:Kn,ERROR_SUBSCRIPTION_NOT_ACTIVE:Pn,ERROR_TOKEN_EXPIRED:$n,ERROR_TOKEN_INVALID:Wn,ERROR_TOKEN_MISSING:Qn,ERROR_UNSUPPORTED_VERSION:kn,ERROR_WRONG_REGION:_n,defaultEndpoint:Rn,defaultTlsEndpoint:bn};var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function vt(e,t=0){return(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase()}var Ce,er=new Uint8Array(16);function Le(){if(!Ce){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ce=crypto.getRandomValues.bind(crypto)}return Ce(er)}var tr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fe={randomUUID:tr};function nr(e,t,n){if(Fe.randomUUID&&!t&&!e)return Fe.randomUUID();e=e||{};let r=e.random??e.rng?.()??Le();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n=n||0,n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[n+o]=r[o];return t}return vt(r)}var Q=nr;var rr={UNAUTHORIZED:"Unauthorized"},or={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},It={INTERNAL_SERVER_ERROR:"Internal Server Error during API Request",MISSING_CREDENTIALS:"Missing Public Client ID or Public API Key",MAINTENANCE_MODE:"API Under Maintenance",RATE_LIMIT_REACHED:"Too many requests. Rate limit exceeded"},Rt={SDK_INIT_ERROR:"Internal Server Error during SDK Initialization",DUPLICATE_INITIALIZATION:"Multiple SDK Initializations Detected",NOT_INITIALIZED:"SDK Not Initialized"},bt={INVALID_CREDENTIALS:"Invalid Public Client ID or Public API Key"},Tt={FAILED_TO_GET_SECURITY_RESULT:"Failed to Retrieve Security Result"},At={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},I={...rr,...or,...It,...Rt,...bt,...Tt,...At},St={...It,...Rt,...bt,...Tt,...At};var Z=(g=>(g.AR="ar",g.BN="bn",g.DE="de",g.EN="en",g.ES="es",g.FR="fr",g.HI="hi",g.ID="id",g.IT="it",g.JA="ja",g.KO="ko",g.MS="ms",g.NL="nl",g.PT="pt",g.RU="ru",g.YU="yu",g.ZH="zh",g))(Z||{}),H=(v=>(v.GeneralConsumer="general-consumer",v.HRManagerDirector="hr-manager-director",v.WebDeveloper="web-developer",v.SoftwareEngineer="software-engineer",v.ITDirector="it-director",v.BusinessAdministrator="business-administrator",v.AccountsPayableManager="accounts-payable-manager",v.Accountant="accountant",v.FinanceDirector="finance-director",v.SmallBusinessOwner="small-business-owner",v.GeneralContractor="general-contractor",v.MarketingManagerDirector="marketing-manager-director",v.ConsumerShopper="consumer-shopper",v.Travel="travel",v.Entertainment="entertainment",v.FinanceAndBanking="finance-and-banking",v.General="general",v.B2BWhiteCollar="b2b-white-collar",v.B2BBlueCollar="b2b-blue-collar",v.Lawyer="lawyer",v))(H||{});var W={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},No={...W},Ue={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}]};async function Be(){return ir()}async function ir(){return new Promise((t,n)=>{try{let i=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),s=i?.createBufferSource(),a=i.createOscillator();a.frequency.value=1e3;let c=i.createDynamicsCompressor();c.threshold.value=-50,c.knee.value=40,c.ratio.value=12,c.attack.value=0,c.release.value=.2,a.connect(c),c.connect(i.destination),a.start();let d;i.oncomplete=u=>{d=u.renderedBuffer.getChannelData(0),t({sampleHash:sr(d),maxChannels:i.destination.maxChannelCount,channelCountMode:s.channelCountMode})},i.startRendering()}catch(r){console.error("Error creating audio fingerprint:",r),n(r)}})}function sr(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function ce(e,t,n){let r=[];for(let s=0;s<e[0].data.length;s++){let a=[];for(let c=0;c<e.length;c++)a.push(e[c].data[s]);r.push(ar(a))}let o=r,i=new Uint8ClampedArray(o);return new ImageData(i,t,n)}function ar(e){if(e.length===0)return 0;let t={};for(let r of e)t[r]=(t[r]||0)+1;let n=e[0];for(let r in t)t[r]>t[n]&&(n=parseInt(r,10));return n}function cr(e){return new TextEncoder().encode(e).buffer}function ue(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^=e>>>16,e>>>0}var _=new Uint32Array([597399067,2869860233,951274213,2716044179]);function C(e,t){return e<<t|e>>>32-t}function ur(e,t){let n=e.byteLength/16|0,r=new Uint32Array(e,0,n*4);for(let o=0;o<n;o++){let i=r.subarray(o*4,(o+1)*4);i[0]=Math.imul(i[0],_[0]),i[0]=C(i[0],15),i[0]=Math.imul(i[0],_[1]),t[0]=t[0]^i[0],t[0]=C(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],_[1]),i[1]=C(i[1],16),i[1]=Math.imul(i[1],_[2]),t[1]=t[1]^i[1],t[1]=C(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],_[2]),i[2]=C(i[2],17),i[2]=Math.imul(i[2],_[3]),t[2]=t[2]^i[2],t[2]=C(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],_[3]),i[3]=C(i[3],18),i[3]=Math.imul(i[3],_[0]),t[3]=t[3]^i[3],t[3]=C(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function lr(e,t){let n=e.byteLength/16|0,r=e.byteLength%16,o=new Uint32Array(4),i=new Uint8Array(e,n*16,r);switch(r){case 15:o[3]=o[3]^i[14]<<16;case 14:o[3]=o[3]^i[13]<<8;case 13:o[3]=o[3]^i[12]<<0,o[3]=Math.imul(o[3],_[3]),o[3]=C(o[3],18),o[3]=Math.imul(o[3],_[0]),t[3]=t[3]^o[3];case 12:o[2]=o[2]^i[11]<<24;case 11:o[2]=o[2]^i[10]<<16;case 10:o[2]=o[2]^i[9]<<8;case 9:o[2]=o[2]^i[8]<<0,o[2]=Math.imul(o[2],_[2]),o[2]=C(o[2],17),o[2]=Math.imul(o[2],_[3]),t[2]=t[2]^o[2];case 8:o[1]=o[1]^i[7]<<24;case 7:o[1]=o[1]^i[6]<<16;case 6:o[1]=o[1]^i[5]<<8;case 5:o[1]=o[1]^i[4]<<0,o[1]=Math.imul(o[1],_[1]),o[1]=C(o[1],16),o[1]=Math.imul(o[1],_[2]),t[1]=t[1]^o[1];case 4:o[0]=o[0]^i[3]<<24;case 3:o[0]=o[0]^i[2]<<16;case 2:o[0]=o[0]^i[1]<<8;case 1:o[0]=o[0]^i[0]<<0,o[0]=Math.imul(o[0],_[0]),o[0]=C(o[0],15),o[0]=Math.imul(o[0],_[1]),t[0]=t[0]^o[0]}}function dr(e,t){t[0]=t[0]^e.byteLength,t[1]=t[1]^e.byteLength,t[2]=t[2]^e.byteLength,t[3]=t[3]^e.byteLength,t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0,t[0]=ue(t[0]),t[1]=ue(t[1]),t[2]=ue(t[2]),t[3]=ue(t[3]),t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0}function O(e,t=0){if(t=t?t|0:0,typeof e=="string"&&(e=cr(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([t,t,t,t]);ur(e,n),lr(e,n),dr(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}var mr=3,Ot=280,Dt=20;async function qe(){return fr()}function fr(){return new Promise(e=>{let t=Array.from({length:mr},()=>hr()),n=ce(t,Ot,Dt);e({commonPixelsHash:O(n.data.toString()).toString()})})}function hr(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Ot,e.height=Dt;let n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,"red"),n.addColorStop(1/6,"orange"),n.addColorStop(2/6,"yellow"),n.addColorStop(3/6,"green"),n.addColorStop(4/6,"blue"),n.addColorStop(5/6,"indigo"),n.addColorStop(1,"violet"),t.fillStyle=n,t.fillRect(0,0,e.width,e.height);let r="Random Text WMwmil10Oo";return t.font="23.123px Arial",t.fillStyle="black",t.fillText(r,-5,15),t.fillStyle="rgba(0, 0, 255, 0.5)",t.fillText(r,-3.3,17.7),t.beginPath(),t.moveTo(0,0),t.lineTo(e.width*2/7,e.height),t.strokeStyle="white",t.lineWidth=2,t.stroke(),t.getImageData(0,0,e.width,e.height)}async function le(e){for(;!document.body;)await pr(50);let t=document.createElement("iframe");t.setAttribute("frameBorder","0");let n=t.style;n.setProperty("position","fixed"),n.setProperty("display","block","important"),n.setProperty("visibility","visible"),n.setProperty("border","0"),n.setProperty("opacity","0"),t.src="about:blank",document.body.appendChild(t);let r=t.contentDocument||t.contentWindow?.document;if(!r)throw new Error("Iframe document is not accessible");e({iframe:r}),setTimeout(()=>{document.body.removeChild(t)},0)}function pr(e,t){return new Promise(n=>setTimeout(n,e,t))}var gr=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],yr=["monospace","sans-serif","serif"];async function Ke(e){return Er()}function Er(){return new Promise((e,t)=>{try{le(async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d"),i=yr.map(a=>_t(o,a)),s={};gr.forEach(a=>{let c=_t(o,a);i.includes(c)||(s[a]=c)}),e(s)})}catch{t({error:"unsupported"})}})}function _t(e,t){if(!e)return null;let n="WwMmLli0Oo";return e.font=`72px ${t}`,e.measureText(n).width}function Ge(){return new Promise((e,t)=>{let n=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,r=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:wr(),architecture:vr(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:r.jsHeapSizeLimit||0})})}function wr(){let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(t&&"getParameter"in t)try{let n=(t.getParameter(t.VENDOR)||"").toString(),r=(t.getParameter(t.RENDERER)||"").toString(),o={vendor:n,renderer:r,version:(t.getParameter(t.VERSION)||"").toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||"").toString()};if(!r.length||!n.length){let i=t.getExtension("WEBGL_debug_renderer_info");if(i){let s=(t.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),a=(t.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString();s&&(o.vendorUnmasked=s),a&&(o.rendererUnmasked=a)}}return o}catch{}return"undefined"}function vr(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Ve(){return new Promise(e=>{e({languages:Ir(),timezone:Rr()})})}function Ir(){let e=[];return navigator.language}function Rr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var de=(e,t,n,r)=>{let o=(n-t)/r,i=0;for(let s=0;s<r;s++){let a=t+(s+.5)*o;i+=e(a)}return i*o};function je(){return new Promise(e=>{e({acos:Math.acos(.5),asin:de(Math.asin,-1,1,97),cos:de(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:de(Math.sin,-Math.PI,Math.PI,97),tan:de(Math.tan,0,2*Math.PI,97)})})}function br(e){if(e.length===0)return null;let t={};e.forEach(o=>{let i=String(o);t[i]=(t[i]||0)+1});let n=e[0],r=1;return Object.keys(t).forEach(o=>{t[o]>r&&(n=o,r=t[o])}),n}function Pt(e,t){let n={};return t.forEach(r=>{let o=e.map(s=>r in s?s[r]:void 0).filter(s=>s!==void 0),i=br(o);i&&(n[r]=i)}),n}var Tr=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"];async function Qe(e){let t=e?.permissions_to_check||Tr,r=await Promise.all(Array.from({length:3},()=>Ar(t)));return Pt(r,t)}async function Ar(e){let t={};for(let n of e)try{let r=await navigator.permissions.query({name:n});t[n]=r.state.toString()}catch{}return t}async function We(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join("|"))}return new Promise(t=>{t({plugins:e})})}function $(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};let e=navigator.userAgent,t=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Brave)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],n={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(let r of t){let o=e.match(r);if(o){let i=o.groups?.name,s=o.groups?.version||o.groups?.version1||o.groups?.version2;if(!i&&(o.groups?.version1||o.groups?.version2)&&(i="Safari"),!i&&r.source.includes("Opera Mini")&&(i="Opera Mini"),!i&&r.source.includes("Opera Mobi")&&(i="Opera Mobi"),!i&&r.source.includes("Opera")&&(i="Opera"),!i&&o[1]&&(i=o[1]),!s&&o[2]&&(s=o[2]),i)return{name:n[i.toLowerCase()]||i,version:s||"unknown"}}}return{name:"unknown",version:"unknown"}}function me(){if(typeof navigator>"u"||!navigator.userAgent)return!1;let e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function $e(){return new Promise(e=>{let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:Or()};me()&&navigator.maxTouchPoints>0&&(t.resolution=Sr()),e(t)})}function Sr(){let e=window.screen.width,t=window.screen.height,n=Math.max(e,t).toString(),r=Math.min(e,t).toString();return`${n}x${r}`}function Or(){let e=[],t={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(t).forEach(n=>{t[n].forEach(r=>{matchMedia(`(${n}: ${r})`).matches&&e.push(`${n}: ${r}`)})}),e}function ze(){return new Promise(e=>{let t=$(),n=navigator.userAgent,r={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:me(),applePayVersion:Dr(),cookieEnabled:window.navigator.cookieEnabled};e(r)})}function Dr(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{let e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}var _r=$().name!=="SamsungBrowser"?1:3,P,p=null;function Pr(){typeof document<"u"&&(P=document.createElement("canvas"),P.width=200,P.height=100,p=P.getContext("webgl"))}async function Ye(){Pr();try{if(!p)throw new Error("WebGL not supported");let e=Array.from({length:_r},()=>kr()),t=ce(e,P.width,P.height);return{commonPixelsHash:O(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function kr(){try{if(!p)throw new Error("WebGL not supported");let e=`
2
2
  attribute vec2 position;
3
3
  void main() {
4
4
  gl_Position = vec4(position, 0.0, 1.0);
@@ -8,4 +8,4 @@ function vn(e,t){return function(n,r){return Object.prototype.hasOwnProperty.cal
8
8
  void main() {
9
9
  gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
10
10
  }
11
- `,n=p.createShader(p.VERTEX_SHADER),r=p.createShader(p.FRAGMENT_SHADER);if(!n||!r)throw new Error("Failed to create shaders");if(p.shaderSource(n,e),p.shaderSource(r,t),p.compileShader(n),!p.getShaderParameter(n,p.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+p.getShaderInfoLog(n));if(p.compileShader(r),!p.getShaderParameter(r,p.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+p.getShaderInfoLog(r));let o=p.createProgram();if(!o)throw new Error("Failed to create shader program");if(p.attachShader(o,n),p.attachShader(o,r),p.linkProgram(o),!p.getProgramParameter(o,p.LINK_STATUS))throw new Error("Shader program linking failed: "+p.getProgramInfoLog(o));p.useProgram(o);let i=137,s=new Float32Array(i*4),a=2*Math.PI/i;for(let f=0;f<i;f++){let E=f*a;s[f*4]=0,s[f*4+1]=0,s[f*4+2]=Math.cos(E)*(P.width/2),s[f*4+3]=Math.sin(E)*(P.height/2)}let c=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,c),p.bufferData(p.ARRAY_BUFFER,s,p.STATIC_DRAW);let d=p.getAttribLocation(o,"position");p.enableVertexAttribArray(d),p.vertexAttribPointer(d,2,p.FLOAT,!1,0,0),p.viewport(0,0,P.width,P.height),p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.LINES,0,i*2);let u=new Uint8ClampedArray(P.width*P.height*4);return p.readPixels(0,0,P.width,P.height,p.RGBA,p.UNSIGNED_BYTE,u),new ImageData(u,P.width,P.height)}catch{return new ImageData(1,1)}finally{p&&(p.bindBuffer(p.ARRAY_BUFFER,null),p.useProgram(null),p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight),p.clearColor(0,0,0,0))}}function N(e){let t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let o,i;if(Array.isArray(r)){for(i="[",o=0;o<r.length;o++)o&&(i+=","),i+=n(r[o])||"null";return i+"]"}if(r===null)return"null";if(t.indexOf(r)!==-1)throw new TypeError("Converting circular structure to JSON");let s=t.push(r)-1,a=Object.keys(r).sort();for(i="",o=0;o<a.length;o++){let c=a[o],d=n(r[c]);d&&(i&&(i+=","),i+=JSON.stringify(c)+":"+d)}return t.splice(s,1),"{"+i+"}"}(e)||""}async function Je(){return new Promise(e=>{try{let t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t){e({supported:!1,error:"WebRTC not supported"});return}let n={iceCandidatePoolSize:1,iceServers:[]},r=new t(n);r.createDataChannel(""),(async()=>{try{let i={offerToReceiveAudio:!0,offerToReceiveVideo:!0},s=await r.createOffer(i);await r.setLocalDescription(s);let a=s.sdp||"",c=[...new Set((a.match(/extmap:\d+ [^\n\r]+/g)||[]).map(h=>h.replace(/extmap:\d+ /,"")))].sort(),d=h=>{let w=a.match(new RegExp(`m=${h} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},u=(h,w)=>w.map(g=>{let A=new RegExp(`(rtpmap|fmtp|rtcp-fb):${g} (.+)`,"g"),x=[...a.matchAll(A)];if(!x.length)return null;let v={};return x.forEach(Oe=>{let[mo,De,_e]=Oe,Pe=_e.split("/");De==="rtpmap"?(v.mimeType=`${h}/${Pe[0]}`,v.clockRate=+Pe[1],h==="audio"&&(v.channels=+Pe[2]||1)):De==="rtcp-fb"?(v.feedbackSupport=v.feedbackSupport||[],v.feedbackSupport.push(_e)):De==="fmtp"&&(v.sdpFmtpLine=_e)}),v}).filter(Boolean),l=u("audio",d("audio")),f=u("video",d("video")),E={audio:{count:l.length,hash:O(N(l))},video:{count:f.length,hash:O(N(f))},extensionsHash:O(N(c))},y=await new Promise(h=>{let w=setTimeout(()=>{r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,timeout:!0})},3e3),g=A=>{let x=A.candidate;!x||!x.candidate||(clearTimeout(w),r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,candidateType:x.type||""}))};r.addEventListener("icecandidate",g)});e({details:y,hash:O(N(y))})}catch(i){r.close(),e({supported:!0,error:`WebRTC offer failed: ${i.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}})}var kt=["\u{1D504}","\u{1D505}","\u212D","\u{1D507}","\u{1D508}","\u{1D509}","\u{1D538}","\u{1D539}","\u2102","\u{1D53B}","\u{1D53C}","\u{1D53D}"],xt=["\u03B2","\u03C8","\u03BB","\u03B5","\u03B6","\u03B1","\u03BE","\u03BC","\u03C1","\u03C6","\u03BA","\u03C4","\u03B7","\u03C3","\u03B9","\u03C9","\u03B3","\u03BD","\u03C7","\u03B4","\u03B8","\u03C0","\u03C5","\u03BF"];async function Xe(){return new Promise(e=>{try{le(async({iframe:t})=>{try{if(!xr(t)){e({supported:!1,error:"MathML not supported"});return}let n=[ee("integral","<msubsup><mo>\u222B</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>"),ee("fraction","<mfrac><mrow><mi>\u03C0</mi><mo>\xD7</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>\u03C3</mi></mrow></mfrac>"),ee("matrix","<mo>[</mo><mtable><mtr><mtd><mi>\u03B1</mi></mtd><mtd><mi>\u03B2</mi></mtd></mtr><mtr><mtd><mi>\u03B3</mi></mtd><mtd><mi>\u03B4</mi></mtd></mtr></mtable><mo>]</mo>"),Nr(),...Mr()],r=[],o="";n.forEach((s,a)=>{let c=Cr(s,t);r.push({width:c.dimensions.width,height:c.dimensions.height}),a===0&&c.fontInfo&&(o=O(N(c.fontInfo)))});let i={fontStyleHash:o,dimensions:r};e({details:i,hash:O(N(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function xr(e){try{let t=e.createElement("math");t.innerHTML="<mrow><mi>x</mi></mrow>",t.style.position="absolute",t.style.visibility="hidden",e.body.appendChild(t);let n=t.getBoundingClientRect();return e.body.removeChild(t),n.width>0&&n.height>0}catch{return!1}}function ee(e,t){return`<math><mrow>${t}</mrow></math>`}function Nr(){let e="<mo>\u220F</mo>";return kt.forEach((t,n)=>{let r=n*2,o=xt.slice(r,r+2);o.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`)}),ee("complex_nested",`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function Mr(){let e=[];return kt.forEach((t,n)=>{let r=n*2,o=xt.slice(r,r+2);o.length===2&&e.push(ee("combined",`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`))}),e}function Cr(e,t){try{let n=t.createElement("math");n.innerHTML=e.replace(/<\/?math>/g,""),n.style.whiteSpace="nowrap",n.style.position="absolute",n.style.visibility="hidden",n.style.top="-9999px",t.body.appendChild(n);let r=n.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(n),s={dimensions:{width:r.width,height:r.height},fontInfo:{fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle,lineHeight:i.lineHeight,fontVariant:i.fontVariant||"normal",fontStretch:i.fontStretch||"normal",fontSizeAdjust:i.fontSizeAdjust||"none",textRendering:i.textRendering||"auto",fontFeatureSettings:i.fontFeatureSettings||"normal",fontVariantNumeric:i.fontVariantNumeric||"normal",fontKerning:i.fontKerning||"auto"}};return t.body.removeChild(n),s}catch(n){return{error:n.message}}}var Lr=800;async function Ze(){return new Promise(e=>{try{if(typeof window>"u"||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!="function"){e({supported:!1,error:"Speech Synthesis API not supported"});return}let t=!1,n=null,r=s=>{if(!t){t=!0,n&&clearTimeout(n);try{let a=s.map(d=>{let u=f=>f.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(d.voiceURI||""),u(d.name||""),u(d.lang||""),d.localService?"1":"0",d.default?"1":"0"].join(",")});a.sort();let c={voiceCount:s.length,voicesHash:O(N(a))};e({details:c,hash:O(N(c))})}catch(a){e({supported:!0,error:`Voice processing failed: ${a.message}`})}}},o=window.speechSynthesis.getVoices();if(o.length>0){r(o);return}n=setTimeout(()=>{let s=window.speechSynthesis.getVoices();r(s)},Lr);let i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);let s=window.speechSynthesis.getVoices();r(s)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}})}var Nt={audio:Be,canvas:qe,fonts:Ke,hardware:Ge,locales:Ve,math:je,permissions:Qe,plugins:We,screen:$e,system:ze,webgl:Ye},Mt={webrtc:Je,mathml:Xe,speech:Ze},He={},Ct={timeout:"true"},et=(e,t,n)=>{He[e]=t};function Fr(e,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function Lt(e,t,n){return Promise.all(e.map(r=>{let o=performance.now();return Promise.race([r.then(i=>({value:i,elapsed:performance.now()-o})),Fr(t,n).then(i=>({value:i,elapsed:performance.now()-o}))])}))}function fe(e,t){let n=W();if(n.name==="unknown"&&e.system&&typeof e.system=="object"&&!Array.isArray(e.system)){let l=e.system.browser;if(l&&typeof l=="object"&&!Array.isArray(l)){let f=l;n={name:f.name||"unknown",version:f.version||"unknown"}}}let r=n.name.toLowerCase(),o=n.version.split(".")[0]||"0",i=parseInt(o,10),s=[...t?.exclude||[]],a=t?.stabilize||[],c=t?.include||[];for(let u of a){let l=Ue[u];if(l)for(let f of l){let E=!("browsers"in f),y=!E&&f.browsers?.some(h=>{let w=h.match(/(.+?)(>=)(\d+)/);if(w){let[,g,,A]=w,x=parseInt(A,10);return r===g&&i>=x}return r===h});(E||y)&&s.push(...f.exclude)}}function d(u,l=""){let f={};for(let[E,y]of Object.entries(u)){let h=l?`${l}.${E}`:E;if(typeof y=="object"&&!Array.isArray(y)&&y!==null){let w=d(y,h);Object.keys(w).length>0&&(f[E]=w)}else{let w=s.some(A=>h.startsWith(A)),g=c.some(A=>h.startsWith(A));(!w||g)&&(f[E]=y)}}return f}return d(e)}async function tt(e){let t={...Q,...e},n=t.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,r={...Nt,...He},{elapsed:o,resolvedComponents:i}=await Ft(r,t),s={},a={};if(n||t.experimental){let{elapsed:w,resolvedComponents:g}=await Ft(Mt,t);s=g,a=w}let c={...o,...a},d=t.performance?{elapsed:c}:{},u=fe({},t),l={...i,...u},f={};return{thumbmark:O(N(l)),components:l,info:f,version:"",...d,...Object.keys(s).length>0&&t.experimental&&{experimental:s}}}async function Ft(e,t){let n={...Q,...t},r=Object.entries(e).filter(([u])=>!n?.exclude?.includes(u)).filter(([u])=>n?.include?.some(l=>l.includes("."))?n?.include?.some(l=>l.startsWith(u)):n?.include?.length===0||n?.include?.includes(u)),o=r.map(([u])=>u),i=r.map(([u,l])=>l(t)),s=await Lt(i,n?.timeout||5e3,Ct),a={},c={};s.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,a[o[l]]=u.elapsed??0)});let d=fe(c,n);return{elapsed:a,resolvedComponents:d}}var te=class{options;constructor(t){this.options={...Q,...t}}async get(t){let n={...this.options,...t};return tt(n)}getVersion(){return""}includeComponent(t,n){et(t,n)}};var Ur=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),Br=async(e,t)=>{if(!e.ok){let n=await e.text();throw new Error(n)}return t==="file"?e.blob():t==="json"?e.json():t==="text"?e.text():null},Ut=async({url:e,auth:t,body:n,method:r="GET",headers:o={},responseType:i="json"})=>{let s={method:r,headers:Ur(t,o),...n?{body:n instanceof FormData?n:JSON.stringify(n)}:{}},a=await fetch(e,s);return Br(a,i)},nt=e=>Ut({...e,method:"GET"}),he=e=>Ut({...e,method:"POST"});function Bt(e){let t=e?.qbc||!1,n=e?.mas||!1,r=e?.apd||!1,o=e?.scb||null,i=0,s=()=>{t=!1,n=!1,r=!1,o=void 0,i=0},a=()=>{let l=window?.getSelection()?.toString();l&&l.length>0&&(i=Date.now(),t=!0)},c=u=>{let l=u.clipboardData?.getData("text"),f=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&f&&(r=!0)},d=()=>{n=!0;let u=Date.now();if(i){let l=(u-i)/1e3;(o===void 0||l<o)&&(o=l)}};return document?.addEventListener("copy",a),document?.addEventListener("paste",c),window?.addEventListener("blur",d),{get qbc(){return t},get mas(){return n},get apd(){return r},get scb(){return o},reset:s,destroy(){document?.removeEventListener("copy",a),document?.removeEventListener("paste",c),window?.removeEventListener("blur",d)}}}var q=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var K=typeof window>"u"||"Deno"in globalThis;function M(){}function Gt(e,t){return typeof e=="function"?e(t):e}function Vt(e){return typeof e=="number"&&e>=0&&e!==1/0}function jt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ot(e,t){return typeof e=="function"?e(t):e}function Qt(e,t){return typeof e=="function"?e(t):e}function it(e,t){let{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==ne(s,t.options))return!1}else if(!z(t.queryKey,s))return!1}if(n!=="all"){let c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function st(e,t){let{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if($(t.options.mutationKey)!==$(i))return!1}else if(!z(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ne(e,t){return(t?.queryKeyHashFn||$)(e)}function $(e){return JSON.stringify(e,(t,n)=>rt(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function z(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!z(e[n],t[n])):!1}function Wt(e,t){if(e===t)return e;let n=qt(e)&&qt(t);if(n||rt(e)&&rt(t)){let r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},c=0;for(let d=0;d<s;d++){let u=n?d:i[d];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,c++):(a[u]=Wt(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&c++)}return o===s&&c===o?e:a}return t}function qt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rt(e){if(!Kt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Kt(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Kt(e){return Object.prototype.toString.call(e)==="[object Object]"}function $t(e){return new Promise(t=>{setTimeout(t,e)})}function zt(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Wt(e,t):t}function Yt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var re=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===re?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var qr=class extends q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ge=new qr;var Kr=class extends q{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Y=new Kr;function Xt(){let e,t,n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Gr(e){return Math.min(1e3*2**e,3e4)}function at(e){return(e??"online")==="online"?Y.isOnline():!0}var Zt=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){return e instanceof Zt}function Ee(e){let t=!1,n=0,r=!1,o,i=Xt(),s=h=>{r||(f(new Zt(h)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},d=()=>ge.isFocused()&&(e.networkMode==="always"||Y.isOnline())&&e.canRun(),u=()=>at(e.networkMode)&&e.canRun(),l=h=>{r||(r=!0,e.onSuccess?.(h),o?.(),i.resolve(h))},f=h=>{r||(r=!0,e.onError?.(h),o?.(),i.reject(h))},E=()=>new Promise(h=>{o=w=>{(r||d())&&h(w)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let h,w=n===0?e.initialPromise:void 0;try{h=w??e.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{if(r)return;let A=e.retry??(K?0:3),x=e.retryDelay??Gr,v=typeof x=="function"?x(n,g):x,Oe=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,g);if(t||!Oe){f(g);return}n++,e.onFail?.(n,g),$t(v).then(()=>d()?void 0:E()).then(()=>{t?f(g):y()})})};return{promise:i,cancel:s,continue:()=>(o?.(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?y():E().then(y),i)}}function Vr(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0),i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{let a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||s()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var b=Vr();var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(K?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var Ht=class extends we{#e;#t;#n;#r;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Qr(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){let n=zt(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Qt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===re||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!jt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){let a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}let n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{let a=pe(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return r(c),this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});let s=a=>{ye(a)&&a.silent||this.#o({type:"error",error:a}),ye(a)||(this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this)),this.scheduleGc()};return this.#r=Ee({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(a)}catch(c){s(c);return}this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),this.scheduleGc()},onError:s,onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){let t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...jr(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;return ye(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),b.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function jr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:at(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Qr(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oe=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,o=t.queryHash??ne(r,t),i=this.get(o);return i||(i=new Ht({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){b.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(n=>it(t,n))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(n=>it(e,n)):t}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){b.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};var en=class extends we{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Wr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=Ee({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);let o=await this.options.onMutate?.(e);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:n})}let r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#t.runNext(this)}}#r(e){let t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),b.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Wr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ie=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new en({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);if(n)if(n.length>1){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=ve(e);if(typeof t=="string"){let r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){let t=ve(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){b.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(n=>st(t,n))}findAll(e={}){return this.getAll().filter(t=>st(e,t))}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(t=>t.state.isPaused);return b.batch(()=>Promise.all(e.map(t=>t.continue().catch(M))))}};function ve(e){return e.options.scope?.id}function ct(e){return{onFetch:(t,n)=>{let r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},c=0,d=async()=>{let u=!1,l=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=pe(t.options,t.fetchOptions),E=async(y,h,w)=>{if(u)return Promise.reject();if(h==null&&y.pages.length)return Promise.resolve(y);let g={queryKey:t.queryKey,pageParam:h,direction:w?"backward":"forward",meta:t.options.meta};l(g);let A=await f(g),{maxPages:x}=t.options,v=w?Jt:Yt;return{pages:v(y.pages,A,x),pageParams:v(y.pageParams,h,x)}};if(o&&i.length){let y=o==="backward",h=y?$r:tn,w={pages:i,pageParams:s},g=h(r,w);a=await E(w,g,y)}else{let y=e??i.length;do{let h=c===0?s[0]??r.initialPageParam:tn(r,a);if(c>0&&h==null)break;a=await E(a,h),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function tn(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $r(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ut=class{#e;#t;#n;#r;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new oe,this.#t=e.mutationCache||new ie,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ot(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{let r=n.data;return[t,r]})}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,s=Gt(t,i);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return b.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;b.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){let n=this.#e,r={type:"active",...e};return b.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=b.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(M).catch(M)}invalidateQueries(e,t={}){return b.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=b.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(M)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(M)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ot(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(M).catch(M)}fetchInfiniteQuery(e){return e.behavior=ct(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(M).catch(M)}ensureInfiniteQueryData(e){return e.behavior=ct(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Y.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set($(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(r=>{z(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set($(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#s.values()],n={};return t.forEach(r=>{z(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ne(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===re&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var zr=new ut({defaultOptions:{queries:{staleTime:3e4}},queryCache:new oe({onError:(e,t)=>{}}),mutationCache:new ie}),nn=zr;var Yr=[{name:"lowCpuCores",weight:1,async check(){let e=navigator.hardwareConcurrency||0,t=e>0&&e<=2;return{value:e,triggered:t}}},{name:"lowDeviceMemory",weight:1,async check(){let e=navigator.deviceMemory||0,t=e>0&&e<=4;return{value:e,triggered:t}}},{name:"platformMismatch",weight:1,async check(){let e=navigator.userAgent||"",t=navigator.platform||"",n=e.includes("Mac")&&t.includes("Linux")||e.includes("Win")&&t.includes("Mac")||t===""||t==="Unknown";return{value:t,triggered:n}}},{name:"webglSoftwareRenderer",weight:2,async check(){let e=null,t=null,n=!1;try{let r=document.createElement("canvas"),o=r.getContext("webgl")||r.getContext("experimental-webgl");if(o){let i=o.getExtension("WEBGL_debug_renderer_info");if(i){e=o.getParameter(i.UNMASKED_VENDOR_WEBGL)||"",t=o.getParameter(i.UNMASKED_RENDERER_WEBGL)||"";let s=t.toLowerCase(),a=e.toLowerCase();n=s.includes("swiftshader")||s.includes("llvmpipe")||s.includes("softwar")||s.includes("basic render")||s.includes("vmware")||s.includes("virtualbox")||a.includes("vmware")||a.includes("parallels")}}}catch{}return{value:{vendor:e,renderer:t},triggered:n}}},{name:"missingWebGPUAdapter",weight:2,async check(){if(!("gpu"in navigator))return{value:"no WebGPU",triggered:!0};try{let e=await navigator.gpu.requestAdapter();return{value:e?"adapter-present":"adapter-null",triggered:!e}}catch{return{value:"adapter-error",triggered:!0}}}},{name:"reducedTimerPrecision",weight:1,async check(){let e=performance.now();await new Promise(r=>setTimeout(r,50));let t=performance.now()-e,n=t<30||t>80;return{value:t.toFixed(2),triggered:n}}},{name:"timerJitter",weight:1,async check(){let e=[];for(let r=0;r<10;r++){let o=performance.now();await new Promise(s=>setTimeout(s,10));let i=performance.now();e.push(i-o)}let t=Math.sqrt(e.map(r=>(r-10)**2).reduce((r,o)=>r+o)/e.length),n=t>5;return{value:t.toFixed(3),triggered:n}}},{name:"audioFingerprint",weight:1,async check(){try{let e=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,44100,44100),t=e.createOscillator();t.frequency.value=440,t.connect(e.destination),t.start(0);let r=(await e.startRendering()).getChannelData(0).reduce((i,s)=>i+Math.abs(s),0),o=r<100;return{value:r,triggered:o}}catch{return{value:"audio-error",triggered:!0}}}},{name:"canvasEntropy",weight:1,async check(){try{let e=document.createElement("canvas"),t=e.getContext("2d");t.textBaseline="top",t.font="14px 'Arial'",t.fillText("VM CHECK",2,2);let r=[...e.toDataURL()].reduce((i,s)=>(i+s.charCodeAt(0))%9999999,0);return{value:r,triggered:r===0||r===999999}}catch{return{value:"canvas-error",triggered:!0}}}},{name:"windowSizeWeird",weight:1,async check(){let e=window.innerWidth/window.innerHeight,t=e===1.333||e===1.6;return{value:e.toFixed(2),triggered:t}}},{name:"touchMismatch",weight:1,async check(){let e="ontouchstart"in window,t=navigator.maxTouchPoints||0;return{value:{hasTouch:e,maxTouch:t},triggered:e&&t===0}}},{name:"batteryVirtualized",weight:1,async check(){if(!navigator.getBattery)return{value:"no API",triggered:!0};try{let e=await navigator.getBattery(),t=e.chargingTime===0&&e.dischargingTime===1/0;return{value:{chargingTime:e.chargingTime,dischargingTime:e.dischargingTime},triggered:t}}catch{return{value:"battery-error",triggered:!0}}}},{name:"permissionsWeird",weight:1,async check(){try{let e=await navigator.permissions.query({name:"camera"}),t=e.state==="prompt";return{value:e.state,triggered:t}}catch{return{value:"perm-error",triggered:!0}}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.length===0;return{value:e.length,triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"virtualizedMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.some(n=>n.label.toLowerCase().includes("virtual"));return{value:e.map(n=>n.label),triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"webrtcIpPattern",weight:2,async check(){return new Promise(e=>{let t=new RTCPeerConnection({iceServers:[]});t.createDataChannel("x"),t.onicecandidate=n=>{if(!n||!n.candidate){e({value:"no candidate",triggered:!0});return}let r=n.candidate.candidate.toLowerCase(),o=r.includes("10.0.2.")||r.includes("172.16.")||r.includes("192.168.56.");e({value:r,triggered:o})},t.createOffer().then(n=>t.setLocalDescription(n))})}},{name:"gpuAccelerationDisabled",weight:2,async check(){let t=document.createElement("canvas").getContext("webgl");return{value:!!t,triggered:!t}}},{name:"noWebGL2",weight:1,async check(){let e=document.createElement("canvas").getContext("webgl2");return{value:!!e,triggered:!e}}},{name:"lowStorageQuota",weight:1,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<500*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"storage-error",triggered:!0}}}},{name:"lowEntropy",weight:1,async check(){let e=Object.keys(navigator).length+Object.keys(screen).length+Object.keys(window).length,t=e<200;return{value:e,triggered:t}}},{name:"noLanguages",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"uaEntropyLow",weight:1,async check(){let e=navigator.userAgent,t=e.length<30;return{value:e,triggered:t}}},{name:"weirdDPI",weight:1,async check(){let e=window.devicePixelRatio;return{value:e,triggered:e===1}}}];async function rn({threshold:e=7}={}){let t={},n=0;for(let r of Yr){let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isLikelyVM:n>=e,score:n,threshold:e,signals:t}}var Jr=[{name:"hookedFunctionToString",weight:2,async check(){let e=Function.prototype.toString.toString(),t=Function.prototype.toString+"";return{value:{native:e,current:t},triggered:e!==t}}},{name:"navigatorProxyTrap",weight:2,async check(){let e=!1;try{let t=Object.getOwnPropertyDescriptor(window,"navigator");t&&t.get&&t.get.toString()?.includes("[native code]")===!1&&(e=!0)}catch{}return{value:"navigator getter",triggered:e}}},{name:"uaMismatch",weight:2,async check(){let e=navigator.userAgent||"",t="";try{let r=await navigator.userAgentData?.getHighEntropyValues?.(["platform","brands"]);t=JSON.stringify(r)}catch{}let n=e?.includes("Mac")&&t?.includes("Windows")||e?.includes("Win")&&t?.includes("Mac")||t&&t.length>0&&!e;return{value:{ua:e,brandInfo:t},triggered:n}}},{name:"timezoneLocaleMismatch",weight:1,async check(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=navigator.language||"",n=t.startsWith("en")&&e==="Asia/Shanghai"||t.startsWith("zh")&&e==="America/New_York"||e===void 0;return{value:{tz:e,lang:t},triggered:n}}},{name:"canvasNoise",weight:2,async check(){let e=()=>{let o=document.createElement("canvas"),i=o.getContext("2d");return i.textBaseline="top",i.font="14px Arial",i.fillText("anti-detect-check",2,2),o.toDataURL()},t=e(),n=e();return{value:{a:t,b:n},triggered:t!==n}}},{name:"webglNoise",weight:2,async check(){try{let t=document.createElement("canvas").getContext("webgl");if(!t)return{value:"no-webgl",triggered:!0};let n=t.getExtension("WEBGL_debug_renderer_info");if(!n)return{value:"no-debug-extension",triggered:!1};let r=t.getParameter(n.UNMASKED_VENDOR_WEBGL),o=t.getParameter(n.UNMASKED_RENDERER_WEBGL),i=r===""||o===""||r?.includes(" ")===!1||o?.includes(" ")===!1;return{value:{v:r,r:o},triggered:i}}catch{return{value:"gl-error",triggered:!0}}}},{name:"webdriverFlag",weight:3,async check(){let e=navigator.webdriver===!0;return{value:navigator.webdriver,triggered:e}}},{name:"perfectEventTiming",weight:1,async check(){let e=performance.now();return{value:e,triggered:e%1===0}}},{name:"serviceWorkerBlocked",weight:1,async check(){let e=!("serviceWorker"in navigator);return{value:e,triggered:e}}},{name:"smallQuota",weight:2,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<50*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"quota-error",triggered:!0}}}},{name:"indexedDbBlocked",weight:2,async check(){try{let e=indexedDB.open("tamper-check");return await new Promise(t=>{e.onerror=()=>t({value:"error",triggered:!0}),e.onsuccess=()=>t({value:"ok",triggered:!1})})}catch{return{value:"throw",triggered:!0}}}},{name:"screenDprMismatch",weight:1,async check(){let e=window.screen.width,t=window.screen.height,n=window.devicePixelRatio,r=e===1920&&n===1&&t===1080||n%1!==0&&n%1!==.5;return{value:{w:e,h:t,dpr:n},triggered:r}}},{name:"missingCommonFonts",weight:1,async check(){return{value:"skipped",triggered:!1}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices();return{value:e.length,triggered:e.length===0}}catch{return{value:"error",triggered:!0}}}},{name:"languagesEmpty",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"pluginMismatch",weight:1,async check(){try{let e=navigator.plugins.length;return{value:e,triggered:e===0}}catch{return{value:"error",triggered:!0}}}},{name:"devtoolsDetected",weight:2,async check(){return new Promise(async e=>{let t={viewportBreakpoint:!1,consoleSpeed:!1},n=160,r=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(r>n||o>n)&&(t.viewportBreakpoint=!0);async function i(a=50){return new Promise(c=>{let d=performance.now();console.log("%c ","font-size:3000px");let u=performance.now();c(u-d>a)})}t.consoleSpeed=await i();let s=Object.values(t).some(Boolean);setTimeout(()=>{e({value:s,triggered:s})},50)})}},{name:"knownAntiDetectBrowser",weight:5,async check(){let e=navigator.userAgent.toLowerCase(),n=["incogniton","multilogin","morelogin","adspect","kameleo","goLogin"].some(r=>e?.includes(r));return{value:e,triggered:n}}}];async function on({threshold:e=5}={}){let t={},n=0;for(let o of Jr){let i=await o.check();t[o.name]=i,i.triggered&&(n+=o.weight)}let r=Math.min(1,n/15);return{result:r>=.5||t.knownAntiDetectBrowser?.triggered,anomalyScore:r,antiDetectBrowser:t.knownAntiDetectBrowser?.triggered||!1,signals:t}}function Xr(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function Zr(){let e=navigator.userAgent,t=Xr();return t===44||t===43?"Safari":t===51?"Chrome":t===25?"Firefox":navigator.msSaveBlob!==void 0?"MSIE":e.match(/Chrome/)?navigator.brave!==void 0?"Brave":e.includes("Edg")?"Edge":e.includes("OPR")?"Opera":"Chrome":"Unknown"}var Hr=[{name:"safari_currentStorageTest",weight:2,browser:"Safari",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("unknown transient reason"),value:t}}}},{name:"safari13to18_indexedDbBlobTest",weight:2,browser:"Safari",async check(){return await new Promise(e=>{let t=String(Math.random()),n=indexedDB.open(t,1);n.onupgradeneeded=r=>{let o=r.target.result;try{o.createObjectStore("t",{autoIncrement:!0}).put(new Blob),e({triggered:!1,value:"ok"})}catch(i){let s=i?.message??String(i);e({triggered:s.includes("are not yet supported"),value:s})}finally{o.close(),indexedDB.deleteDatabase(t)}},n.onerror=()=>e({triggered:!1,value:"idb-error"})})}},{name:"safari_oldWebkitTest",weight:1,browser:"Safari",async check(){let e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{return{triggered:!0,value:"openDatabase denied"}}try{t.setItem("test","1"),t.removeItem("test")}catch{return{triggered:!0,value:"localStorage denied"}}return{triggered:!1,value:"ok"}}},{name:"chrome_storageQuotaPrivateTest",weight:2,browser:"Chrome",async check(){return await new Promise((e,t)=>{let r=window?.performance?.memory?.jsHeapSizeLimit??1073741824;navigator.webkitTemporaryStorage.queryUsageAndQuota((o,i)=>{let s=Math.round(i/1048576),a=Math.round(r/(1024*1024))*2;e({triggered:s<a,value:{quotaMB:s,limitMB:a}})},o=>t(o))})}},{name:"chrome_oldFileSystemTest",weight:1,browser:"Chrome",async check(){let e=window.webkitRequestFileSystem;return e?await new Promise(t=>e(0,1,()=>t({triggered:!1,value:"ok"}),()=>t({triggered:!0,value:"denied"}))):{triggered:!1,value:"unsupported"}}},{name:"firefox_storageDirectoryTest",weight:2,browser:"Firefox",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("Security error"),value:t}}}},{name:"firefox_indexedDbInvalidStateTest",weight:1,browser:"Firefox",async check(){return await new Promise(e=>{let t=indexedDB.open("inPrivate");t.onerror=()=>{e({triggered:t.error?.name==="InvalidStateError",value:t.error?.name})},t.onsuccess=()=>{indexedDB.deleteDatabase("inPrivate"),e({triggered:!1,value:"ok"})}})}},{name:"msie_indexedDbMissing",weight:2,browser:"MSIE",async check(){return{triggered:window.indexedDB===void 0,value:"msie-idb-check"}}}];async function sn(){let e=Zr(),t={},n=0;for(let r of Hr){if(r.browser!==e)continue;let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isPrivate:n>0,browserName:e,score:n,signals:t}}typeof window<"u"&&(window.detectIncognito=sn);var an=sn;var cn=[{name:"globalPrivacyControl",weight:3,async check(){let e=navigator.globalPrivacyControl;return{triggered:e===!0,value:e}}},{name:"doNotTrack",weight:1,async check(){let e=navigator.doNotTrack;return{triggered:e==="1",value:e}}},{name:"cookiesDisabled",weight:3,async check(){let e=navigator.cookieEnabled;return{triggered:e===!1,value:e}}},{name:"thirdPartyCookiesBlocked",weight:3,async check(){try{if("hasStorageAccess"in document&&!await document.hasStorageAccess())try{return await document.requestStorageAccess(),{triggered:!1,value:"access_granted"}}catch{return{triggered:!0,value:"access_denied"}}let e=`__dtect_3p_test_${Date.now()}`;document.cookie=`${e}=1; SameSite=None; Secure`;let t=document.cookie.includes(e);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT`,{triggered:!1,value:t?"cookies_work":"may_be_blocked"}}catch(e){return{triggered:!1,value:`error: ${e?.message}`}}}},{name:"firefoxResistFingerprinting",weight:2,async check(){let e=[],t=new Date().getTimezoneOffset();t===0&&Intl.DateTimeFormat().resolvedOptions().timeZone==="UTC"&&e.push("timezone_utc");let n=navigator.hardwareConcurrency;n===2&&e.push("cores_capped");let r=window.screen.width,o=window.screen.height,i=window.innerWidth,s=window.innerHeight;r===i&&o===s&&e.push("screen_matches_inner");let a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return{triggered:e.length>=2,value:{signals:e,timezoneOffset:t,cores:n,prefersReducedMotion:a}}}},{name:"braveShields",weight:3,async check(){if(!(navigator.brave!==void 0))return{triggered:!1,value:"not_brave"};try{if(!await navigator.brave.isBrave())return{triggered:!1,value:"brave_check_false"};let r=document.createElement("canvas").getContext("2d");if(r){r.fillStyle="rgb(255, 0, 0)",r.fillRect(0,0,1,1);let o=r.getImageData(0,0,1,1).data;r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data;if(o[0]!==i[0]||o[1]!==i[1]||o[2]!==i[2])return{triggered:!0,value:"shields_active_canvas"}}try{let o=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});if(o.createDataChannel(""),await new Promise(s=>{let a=setTimeout(()=>{o.close(),s(!1)},1e3);o.onicecandidate=c=>{c.candidate?.candidate&&(/([0-9]{1,3}\.){3}[0-9]{1,3}/.test(c.candidate.candidate)||(clearTimeout(a),o.close(),s(!0)))},o.createOffer().then(c=>o.setLocalDescription(c))}))return{triggered:!0,value:"shields_active_webrtc"}}catch{return{triggered:!0,value:"shields_active_webrtc_blocked"}}return{triggered:!0,value:"brave_detected_shields_default"}}catch(t){return{triggered:!1,value:`error: ${t?.message}`}}}}];async function un(){let e={},t=0,n=await Promise.allSettled(cn.map(async r=>{let o=await r.check();return{name:r.name,weight:r.weight,result:o}}));for(let r of n)if(r.status==="fulfilled"){let{name:o,weight:i,result:s}=r.value;e[o]=s,s.triggered&&(t+=i)}else{let o=n.indexOf(r),i=cn[o];i&&(e[i.name]={triggered:!1,value:`check_failed: ${r.reason}`})}return{isPrivacyEnabled:t>3,score:t,signals:e}}typeof window<"u"&&(window.detectPrivacy=un);var ln=un;var dn="dtect_security_sdk_state",mn=typeof window<"u",fn={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Ie={state:{...fn},securityKeys:{behaviorKey:"bwDZ0V3Zrb4SB6g4lZwW",automationKey:"7166bf18-b91e-407a-84fc-d57ac104de98",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}};function hn(){if(!mn)return Ie;try{let e=sessionStorage.getItem(dn);if(!e)return Ie;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Ie:{state:{...fn,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}}}catch{return Ie}}function G(e){if(mn)try{let t=Date.now()+864e5,n={...e,expiresAt:t};sessionStorage.setItem(dn,JSON.stringify(n))}catch{}}function pn(e){return e.token||X()}async function D(e,t="info",n={}){let r=`${n.endpoint??"https://api.dtect.io/security"}/log`,o={message:e,type:t,payload:n};navigator.sendBeacon(r,JSON.stringify(o))}var Re,R="https://api.dtect.io/security",be=`${R}/client/check`,T="",V="",eo=["2d6803fb-8373-4771-897a-dfa18acf7da4","f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","58da2d43-45c0-49be-96f6-bd4651148a42"],to=["f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","13b1fab5-c93c-48db-a50d-03c7df6c30b8","4c5dea4c-d1b7-4dc7-88fc-cf03e7a54a66","32014166-ed5f-4e30-a58b-587e2a2881d8","67107037-d5b5-483a-a046-bf39c38ce738","23b778f9-d07f-477d-9863-168c90a320d2","57392ff8-1733-41e7-b336-a9c7a01ef559","59073b5c-2b9a-4933-9d7e-655b0559196f"],gn="0.0.29",no="20000000-aaaa-bbbb-cccc-000000000002",Te;var{state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}=hn(),ro=St,se;async function oo({clientId:e,apiKey:t,endpoint:n}){if(Ae({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k};let r=await nn.fetchQuery({queryKey:["getClientConfig",e,t],queryFn:()=>nt({url:`${n}/client/config`,headers:{"client-id":T,"x-api-key":V}})});if(!Ae(r))throw new Error("Missing keys from get client config");return L=r.automationKey,U=r.behaviorKey,B=r.dtectSignalEnabled,k=r.dtectAutomationSignalEnabled,G({state:m,securityKeys:r}),r}function pt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(I.RATE_LIMIT_REACHED);switch(e?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_TOKEN)}function J(){if(wn(m)&&Ae({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return!0;let e=Se(),t=document.querySelector("#dtect-h-captcha");return!!Re&&!!(!k&&t||e||k)}function yn(){return!!(T&&V)}function io(){return new Promise(e=>{let t=()=>{window?.hcaptcha?e():requestAnimationFrame(t)};t()})}var Se=()=>window?.location?.href?.includes("localhost")||window?.location?.href?.includes("file:///");async function so({behaviorKey:e,dtectAutomationSignalEnabled:t=!1}){let n=performance.now();Re=await j.load({apiKey:e,endpoint:["https://fp.dtect.io",j.defaultEndpoint],scriptUrlPattern:["https://fp.dtect.io/web/v<version>/<apiKey>/loader_v<loaderVersion>.js",j.defaultScriptUrlPattern]});let o=(performance.now()-n).toFixed();if(D(`FingerprintJS loaded in ${o}ms`,"info",{function:"fpjs load",endpoint:R,diff:o,token:m.token,clientId:T}),!Se()&&!t&&(await io(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:L,size:"invisible"})),!Re)throw new Error(I.SDK_INIT_ERROR)}async function ao(){let e=performance.now();if(m.tokens){let c=(performance.now()-e).toFixed();return D(`getTokens finishes in ${c}ms`,"info",{function:"getTokens",endpoint:R,diff:c,token:m.token,clientId:T}),m.tokens}let t=new Promise(a=>{let c=Re?.get();a(c)}),n=new Promise(async a=>{Se()&&a({response:no});let d=await window?.hcaptcha?.execute({async:!0});a(d)}),[r,o]=await Promise.all([k?{response:""}:n,t]);m.tokens={behaviorRequestId:o?.requestId,behaviorToken:o?.sealedResult,automationToken:r?.response};let s=(performance.now()-e).toFixed();return D(`getTokens finishes in ${s}ms`,"info",{function:"getTokens",endpoint:R,diff:s,token:m.token,clientId:T}),m.tokens}function co(e){let t=e?.projectId,n=e?.visitorId||X();return(typeof e?.projectId=="number"||typeof e?.visitorId=="number")&&(t=`${e?.projectId}`,n=`${e?.visitorId}`),{visitorId:n,projectId:t}}function gt(e){if(m.projectId&&m.visitorId)return{visitorId:m.visitorId,projectId:m.projectId};let{projectId:t,visitorId:n}=co(e);return{projectId:t,visitorId:n}}async function En(e,t){let n=performance.now();if(!J())throw new Error(I.NOT_INITIALIZED);if(!yn())throw new Error(I.MISSING_CREDENTIALS);let{projectId:r,visitorId:o}=gt(e);if(m.projectId=r,m.visitorId=o,!e||!r?.trim())throw new Error(I.FAILED_TO_GET_SECURITY_RESULT);let i;try{let s=await ao();if(B){let a=new te,[c,d,u,l,f]=await Promise.allSettled([a.get(),rn(),on(),an(),ln()]);i={deviceRes:c,vmDtectResults:d,tamperingDtectResults:u,incognitoDtectResults:l,privacySettingsDtectResults:f}}if(s?.behaviorToken&&s?.behaviorRequestId&&(k||!k&&s?.automationToken)){let a={behaviorToken:s.behaviorToken,automationToken:s.automationToken,behaviorRequestId:s.behaviorRequestId,entryLink:window?.location?.href,securitySettings:e.securitySettings,metaData:e.metaData,...B?{vmDtectResults:i?.vmDtectResults?.value,tamperingDtectResults:i?.tamperingDtectResults?.value,incognitoDtectResults:i?.incognitoDtectResults?.value,deviceIdResults:i?.deviceRes?.value,privacySettingsDtectResults:i?.privacySettingsDtectResults?.value}:{}};m.clientData=a;let c={...e,projectId:r,visitorId:o,clientData:a,version:"0.0.29",token:m.token,questionData:m.questionData,aiCheckData:m.aiCheckData},d=await he({url:`${t}`,body:{...c},headers:{"client-id":T,"x-api-key":V}});if("token"in d||"results"in d){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let l=(performance.now()-n).toFixed();return D(`getResultBase finishes in ${l}ms`,"info",{function:"getResultBase",endpoint:R,diff:l,token:m.token,clientId:T}),d}}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(s){let c=(performance.now()-n).toFixed();if(D("getResultBase error","error",{function:"getResultBase",endpoint:R,error:s,diff:c,token:m.token,clientId:T}),s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(s?.message?.includes("rate-limited")||s?.message?.includes("429"))throw new Error(I.RATE_LIMIT_REACHED);switch(s?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_RESULT)}}async function lt(e){return await En(e,`${R}/client/check/result`)}async function dt(e){return await En(e,`${R}/client/check`)}async function mt(e){let t=performance.now();if(!J())throw new Error(I.NOT_INITIALIZED);let{respondentType:n,language:r}=e;try{let o=await nt({url:`${R}/client/quality-questions/${n}/${r}`,headers:{"client-id":T,"x-api-key":V}});if(o){let s=(performance.now()-t).toFixed();return D(`getQualityQuestions finishes in ${s}ms`,"info",{function:"getQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("getQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),pt(o)}}async function ft(e){let t=performance.now();if(!J())throw new Error(I.NOT_INITIALIZED);m.questionData||(m.questionData={questions:e.questions});let{visitorId:n,projectId:r}=gt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:gn,questionData:m.questionData,aiCheckData:m.aiCheckData,clientData:m.clientData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`checkQualityQuestions finishes in ${s}ms`,"info",{function:"checkQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("checkQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),pt(o)}}async function ht(e){let t=performance.now();if(!J())throw new Error(I.NOT_INITIALIZED);m.aiCheckData={timeTakenSeconds:e.timeTakenSeconds,qbc:e.qbc||se.qbc,mas:e.mas||se.mas,scb:e.scb||se.scb,apd:e.apd||se.apd};let{visitorId:n,projectId:r}=gt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:gn,clientData:m.clientData,questionData:m.questionData,aiCheckData:m.aiCheckData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`isAIUsageDetected finishes in ${s}ms`,"info",{function:"isAIUsageDetected",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("isAIUsageDetected error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),pt(o)}}function uo(){let e=performance.now(),t=document.querySelector("head"),n=document.querySelector("body");if(!Se()){n?.insertAdjacentHTML("beforeend",'<div id="dtect-h-captcha" ></div>');let o=document.createElement("script");o.setAttribute("src","https://js.hcaptcha.com/1/api.js"),o.setAttribute("async","true"),o.setAttribute("defer","true"),t?.append(o);let s=(performance.now()-e).toFixed()}}function Ae(e){return(e.dtectAutomationSignalEnabled||e?.automationKey)&&e?.behaviorKey}function wn(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function lo(e){let t=performance.now();if(!e?.clientId||!e?.apiKey)throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);let{clientId:n,apiKey:r,endpoint:o="https://api.dtect.io/security",includeResults:i}=e;R=o,be=`${R}/client/check`;let s=pn(m);if(m.isLoading){if(J())return Te;throw D(I.DUPLICATE_INITIALIZATION,"error",{endpoint:R,clientId:n,apiKey:r,token:m.token}),new Error(I.DUPLICATE_INITIALIZATION)}if(se=Bt(m.aiCheckData),T=n,V=r,k=eo.includes(n),B=to.includes(n),i&&(be=`${R}/client/check/result`),m={...m,isLoading:!0,token:s||""},wn(m)&&Ae({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}),{getSecurityResult:lt,getSecurityToken:dt,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:mt,LanguageCodes:Z,QualityQuestionsRespondentTypes:H};if(!yn())throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);if(J())return Te;try{let c=await oo({clientId:n,apiKey:r,endpoint:o});return c.dtectAutomationSignalEnabled||uo(),so({behaviorKey:c.behaviorKey,dtectAutomationSignalEnabled:c.dtectAutomationSignalEnabled}).then(()=>{let u=(performance.now()-t).toFixed();return D(`init() finishes ${u}ms`,"info",{endpoint:R,function:"init",diff:u,token:m.token,clientId:T}),{getSecurityResult:lt,getSecurityToken:dt,SecurityAPIError:ro,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:mt,LanguageCodes:Z,QualityQuestionsRespondentTypes:H}}).catch(d=>{throw new Error(d.message)})}catch(c){if(c instanceof Error){if(D(c.message,"error",{function:"init",endpoint:R,error:c,token:m.token,clientId:T}),c?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if([I.INVALID_API_KEY,I.UNAUTHORIZED].includes(c?.message))throw new Error(I.INVALID_CREDENTIALS)}throw new Error(I.SDK_INIT_ERROR)}finally{m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}})}}Te={init:lo,getSecurityResult:lt,getSecurityToken:dt,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:mt,QualityQuestionsRespondentTypes:H,LanguageCodes:Z};var Ha=Te;export{Z as LanguageCodes,H as QualityQuestionsRespondentTypes,ro as SecurityAPIError,ft as checkQualityQuestions,Ha as default,mt as getQualityQuestions,lt as getSecurityResult,dt as getSecurityToken,lo as init,ht as isAIUsageDetected};
11
+ `,n=p.createShader(p.VERTEX_SHADER),r=p.createShader(p.FRAGMENT_SHADER);if(!n||!r)throw new Error("Failed to create shaders");if(p.shaderSource(n,e),p.shaderSource(r,t),p.compileShader(n),!p.getShaderParameter(n,p.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+p.getShaderInfoLog(n));if(p.compileShader(r),!p.getShaderParameter(r,p.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+p.getShaderInfoLog(r));let o=p.createProgram();if(!o)throw new Error("Failed to create shader program");if(p.attachShader(o,n),p.attachShader(o,r),p.linkProgram(o),!p.getProgramParameter(o,p.LINK_STATUS))throw new Error("Shader program linking failed: "+p.getProgramInfoLog(o));p.useProgram(o);let i=137,s=new Float32Array(i*4),a=2*Math.PI/i;for(let f=0;f<i;f++){let E=f*a;s[f*4]=0,s[f*4+1]=0,s[f*4+2]=Math.cos(E)*(P.width/2),s[f*4+3]=Math.sin(E)*(P.height/2)}let c=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,c),p.bufferData(p.ARRAY_BUFFER,s,p.STATIC_DRAW);let d=p.getAttribLocation(o,"position");p.enableVertexAttribArray(d),p.vertexAttribPointer(d,2,p.FLOAT,!1,0,0),p.viewport(0,0,P.width,P.height),p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.LINES,0,i*2);let u=new Uint8ClampedArray(P.width*P.height*4);return p.readPixels(0,0,P.width,P.height,p.RGBA,p.UNSIGNED_BYTE,u),new ImageData(u,P.width,P.height)}catch{return new ImageData(1,1)}finally{p&&(p.bindBuffer(p.ARRAY_BUFFER,null),p.useProgram(null),p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight),p.clearColor(0,0,0,0))}}function N(e){let t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let o,i;if(Array.isArray(r)){for(i="[",o=0;o<r.length;o++)o&&(i+=","),i+=n(r[o])||"null";return i+"]"}if(r===null)return"null";if(t.indexOf(r)!==-1)throw new TypeError("Converting circular structure to JSON");let s=t.push(r)-1,a=Object.keys(r).sort();for(i="",o=0;o<a.length;o++){let c=a[o],d=n(r[c]);d&&(i&&(i+=","),i+=JSON.stringify(c)+":"+d)}return t.splice(s,1),"{"+i+"}"}(e)||""}async function Je(){return new Promise(e=>{try{let t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t){e({supported:!1,error:"WebRTC not supported"});return}let n={iceCandidatePoolSize:1,iceServers:[]},r=new t(n);r.createDataChannel(""),(async()=>{try{let i={offerToReceiveAudio:!0,offerToReceiveVideo:!0},s=await r.createOffer(i);await r.setLocalDescription(s);let a=s.sdp||"",c=[...new Set((a.match(/extmap:\d+ [^\n\r]+/g)||[]).map(h=>h.replace(/extmap:\d+ /,"")))].sort(),d=h=>{let w=a.match(new RegExp(`m=${h} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},u=(h,w)=>w.map(g=>{let A=new RegExp(`(rtpmap|fmtp|rtcp-fb):${g} (.+)`,"g"),x=[...a.matchAll(A)];if(!x.length)return null;let v={};return x.forEach(Oe=>{let[mo,De,_e]=Oe,Pe=_e.split("/");De==="rtpmap"?(v.mimeType=`${h}/${Pe[0]}`,v.clockRate=+Pe[1],h==="audio"&&(v.channels=+Pe[2]||1)):De==="rtcp-fb"?(v.feedbackSupport=v.feedbackSupport||[],v.feedbackSupport.push(_e)):De==="fmtp"&&(v.sdpFmtpLine=_e)}),v}).filter(Boolean),l=u("audio",d("audio")),f=u("video",d("video")),E={audio:{count:l.length,hash:O(N(l))},video:{count:f.length,hash:O(N(f))},extensionsHash:O(N(c))},y=await new Promise(h=>{let w=setTimeout(()=>{r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,timeout:!0})},3e3),g=A=>{let x=A.candidate;!x||!x.candidate||(clearTimeout(w),r.removeEventListener("icecandidate",g),r.close(),h({supported:!0,...E,candidateType:x.type||""}))};r.addEventListener("icecandidate",g)});e({details:y,hash:O(N(y))})}catch(i){r.close(),e({supported:!0,error:`WebRTC offer failed: ${i.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}})}var kt=["\u{1D504}","\u{1D505}","\u212D","\u{1D507}","\u{1D508}","\u{1D509}","\u{1D538}","\u{1D539}","\u2102","\u{1D53B}","\u{1D53C}","\u{1D53D}"],xt=["\u03B2","\u03C8","\u03BB","\u03B5","\u03B6","\u03B1","\u03BE","\u03BC","\u03C1","\u03C6","\u03BA","\u03C4","\u03B7","\u03C3","\u03B9","\u03C9","\u03B3","\u03BD","\u03C7","\u03B4","\u03B8","\u03C0","\u03C5","\u03BF"];async function Xe(){return new Promise(e=>{try{le(async({iframe:t})=>{try{if(!xr(t)){e({supported:!1,error:"MathML not supported"});return}let n=[ee("integral","<msubsup><mo>\u222B</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>"),ee("fraction","<mfrac><mrow><mi>\u03C0</mi><mo>\xD7</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>\u03C3</mi></mrow></mfrac>"),ee("matrix","<mo>[</mo><mtable><mtr><mtd><mi>\u03B1</mi></mtd><mtd><mi>\u03B2</mi></mtd></mtr><mtr><mtd><mi>\u03B3</mi></mtd><mtd><mi>\u03B4</mi></mtd></mtr></mtable><mo>]</mo>"),Nr(),...Mr()],r=[],o="";n.forEach((s,a)=>{let c=Cr(s,t);r.push({width:c.dimensions.width,height:c.dimensions.height}),a===0&&c.fontInfo&&(o=O(N(c.fontInfo)))});let i={fontStyleHash:o,dimensions:r};e({details:i,hash:O(N(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function xr(e){try{let t=e.createElement("math");t.innerHTML="<mrow><mi>x</mi></mrow>",t.style.position="absolute",t.style.visibility="hidden",e.body.appendChild(t);let n=t.getBoundingClientRect();return e.body.removeChild(t),n.width>0&&n.height>0}catch{return!1}}function ee(e,t){return`<math><mrow>${t}</mrow></math>`}function Nr(){let e="<mo>\u220F</mo>";return kt.forEach((t,n)=>{let r=n*2,o=xt.slice(r,r+2);o.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`)}),ee("complex_nested",`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function Mr(){let e=[];return kt.forEach((t,n)=>{let r=n*2,o=xt.slice(r,r+2);o.length===2&&e.push(ee("combined",`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`))}),e}function Cr(e,t){try{let n=t.createElement("math");n.innerHTML=e.replace(/<\/?math>/g,""),n.style.whiteSpace="nowrap",n.style.position="absolute",n.style.visibility="hidden",n.style.top="-9999px",t.body.appendChild(n);let r=n.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(n),s={dimensions:{width:r.width,height:r.height},fontInfo:{fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle,lineHeight:i.lineHeight,fontVariant:i.fontVariant||"normal",fontStretch:i.fontStretch||"normal",fontSizeAdjust:i.fontSizeAdjust||"none",textRendering:i.textRendering||"auto",fontFeatureSettings:i.fontFeatureSettings||"normal",fontVariantNumeric:i.fontVariantNumeric||"normal",fontKerning:i.fontKerning||"auto"}};return t.body.removeChild(n),s}catch(n){return{error:n.message}}}var Lr=800;async function Ze(){return new Promise(e=>{try{if(typeof window>"u"||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!="function"){e({supported:!1,error:"Speech Synthesis API not supported"});return}let t=!1,n=null,r=s=>{if(!t){t=!0,n&&clearTimeout(n);try{let a=s.map(d=>{let u=f=>f.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(d.voiceURI||""),u(d.name||""),u(d.lang||""),d.localService?"1":"0",d.default?"1":"0"].join(",")});a.sort();let c={voiceCount:s.length,voicesHash:O(N(a))};e({details:c,hash:O(N(c))})}catch(a){e({supported:!0,error:`Voice processing failed: ${a.message}`})}}},o=window.speechSynthesis.getVoices();if(o.length>0){r(o);return}n=setTimeout(()=>{let s=window.speechSynthesis.getVoices();r(s)},Lr);let i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);let s=window.speechSynthesis.getVoices();r(s)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}})}var Nt={audio:Be,canvas:qe,fonts:Ke,hardware:Ge,locales:Ve,math:je,permissions:Qe,plugins:We,screen:$e,system:ze,webgl:Ye},Mt={webrtc:Je,mathml:Xe,speech:Ze},He={},Ct={timeout:"true"},et=(e,t,n)=>{He[e]=t};function Fr(e,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function Lt(e,t,n){return Promise.all(e.map(r=>{let o=performance.now();return Promise.race([r.then(i=>({value:i,elapsed:performance.now()-o})),Fr(t,n).then(i=>({value:i,elapsed:performance.now()-o}))])}))}function fe(e,t){let n=$();if(n.name==="unknown"&&e.system&&typeof e.system=="object"&&!Array.isArray(e.system)){let l=e.system.browser;if(l&&typeof l=="object"&&!Array.isArray(l)){let f=l;n={name:f.name||"unknown",version:f.version||"unknown"}}}let r=n.name.toLowerCase(),o=n.version.split(".")[0]||"0",i=parseInt(o,10),s=[...t?.exclude||[]],a=t?.stabilize||[],c=t?.include||[];for(let u of a){let l=Ue[u];if(l)for(let f of l){let E=!("browsers"in f),y=!E&&f.browsers?.some(h=>{let w=h.match(/(.+?)(>=)(\d+)/);if(w){let[,g,,A]=w,x=parseInt(A,10);return r===g&&i>=x}return r===h});(E||y)&&s.push(...f.exclude)}}function d(u,l=""){let f={};for(let[E,y]of Object.entries(u)){let h=l?`${l}.${E}`:E;if(typeof y=="object"&&!Array.isArray(y)&&y!==null){let w=d(y,h);Object.keys(w).length>0&&(f[E]=w)}else{let w=s.some(A=>h.startsWith(A)),g=c.some(A=>h.startsWith(A));(!w||g)&&(f[E]=y)}}return f}return d(e)}async function tt(e){let t={...W,...e},n=t.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,r={...Nt,...He},{elapsed:o,resolvedComponents:i}=await Ft(r,t),s={},a={};if(n||t.experimental){let{elapsed:w,resolvedComponents:g}=await Ft(Mt,t);s=g,a=w}let c={...o,...a},d=t.performance?{elapsed:c}:{},u=fe({},t),l={...i,...u},f={};return{thumbmark:O(N(l)),components:l,info:f,version:"",...d,...Object.keys(s).length>0&&t.experimental&&{experimental:s}}}async function Ft(e,t){let n={...W,...t},r=Object.entries(e).filter(([u])=>!n?.exclude?.includes(u)).filter(([u])=>n?.include?.some(l=>l.includes("."))?n?.include?.some(l=>l.startsWith(u)):n?.include?.length===0||n?.include?.includes(u)),o=r.map(([u])=>u),i=r.map(([u,l])=>l(t)),s=await Lt(i,n?.timeout||5e3,Ct),a={},c={};s.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,a[o[l]]=u.elapsed??0)});let d=fe(c,n);return{elapsed:a,resolvedComponents:d}}var te=class{options;constructor(t){this.options={...W,...t}}async get(t){let n={...this.options,...t};return tt(n)}getVersion(){return""}includeComponent(t,n){et(t,n)}};var Ur=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),Br=async(e,t)=>{if(!e.ok){let n=await e.text();throw new Error(n)}return t==="file"?e.blob():t==="json"?e.json():t==="text"?e.text():null},Ut=async({url:e,auth:t,body:n,method:r="GET",headers:o={},responseType:i="json"})=>{let s={method:r,headers:Ur(t,o),...n?{body:n instanceof FormData?n:JSON.stringify(n)}:{}},a=await fetch(e,s);return Br(a,i)},nt=e=>Ut({...e,method:"GET"}),he=e=>Ut({...e,method:"POST"});function Bt(e){let t=e?.qbc||!1,n=e?.mas||!1,r=e?.apd||!1,o=e?.scb||null,i=0,s=()=>{t=!1,n=!1,r=!1,o=void 0,i=0},a=()=>{let l=window?.getSelection()?.toString();l&&l.length>0&&(i=Date.now(),t=!0)},c=u=>{let l=u.clipboardData?.getData("text"),f=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&f&&(r=!0)},d=()=>{n=!0;let u=Date.now();if(i){let l=(u-i)/1e3;(o===void 0||l<o)&&(o=l)}};return document?.addEventListener("copy",a),document?.addEventListener("paste",c),window?.addEventListener("blur",d),{get qbc(){return t},get mas(){return n},get apd(){return r},get scb(){return o},reset:s,destroy(){document?.removeEventListener("copy",a),document?.removeEventListener("paste",c),window?.removeEventListener("blur",d)}}}var q=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var K=typeof window>"u"||"Deno"in globalThis;function M(){}function Gt(e,t){return typeof e=="function"?e(t):e}function Vt(e){return typeof e=="number"&&e>=0&&e!==1/0}function jt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ot(e,t){return typeof e=="function"?e(t):e}function Qt(e,t){return typeof e=="function"?e(t):e}function it(e,t){let{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==ne(s,t.options))return!1}else if(!Y(t.queryKey,s))return!1}if(n!=="all"){let c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function st(e,t){let{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(z(t.options.mutationKey)!==z(i))return!1}else if(!Y(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ne(e,t){return(t?.queryKeyHashFn||z)(e)}function z(e){return JSON.stringify(e,(t,n)=>rt(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Y(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Y(e[n],t[n])):!1}function Wt(e,t){if(e===t)return e;let n=qt(e)&&qt(t);if(n||rt(e)&&rt(t)){let r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},c=0;for(let d=0;d<s;d++){let u=n?d:i[d];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,c++):(a[u]=Wt(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&c++)}return o===s&&c===o?e:a}return t}function qt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rt(e){if(!Kt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Kt(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Kt(e){return Object.prototype.toString.call(e)==="[object Object]"}function $t(e){return new Promise(t=>{setTimeout(t,e)})}function zt(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Wt(e,t):t}function Yt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var re=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===re?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var qr=class extends q{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ge=new qr;var Kr=class extends q{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!K&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},J=new Kr;function Xt(){let e,t,n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Gr(e){return Math.min(1e3*2**e,3e4)}function at(e){return(e??"online")==="online"?J.isOnline():!0}var Zt=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function ye(e){return e instanceof Zt}function Ee(e){let t=!1,n=0,r=!1,o,i=Xt(),s=h=>{r||(f(new Zt(h)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},d=()=>ge.isFocused()&&(e.networkMode==="always"||J.isOnline())&&e.canRun(),u=()=>at(e.networkMode)&&e.canRun(),l=h=>{r||(r=!0,e.onSuccess?.(h),o?.(),i.resolve(h))},f=h=>{r||(r=!0,e.onError?.(h),o?.(),i.reject(h))},E=()=>new Promise(h=>{o=w=>{(r||d())&&h(w)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let h,w=n===0?e.initialPromise:void 0;try{h=w??e.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{if(r)return;let A=e.retry??(K?0:3),x=e.retryDelay??Gr,v=typeof x=="function"?x(n,g):x,Oe=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,g);if(t||!Oe){f(g);return}n++,e.onFail?.(n,g),$t(v).then(()=>d()?void 0:E()).then(()=>{t?f(g):y()})})};return{promise:i,cancel:s,continue:()=>(o?.(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?y():E().then(y),i)}}function Vr(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0),i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{let a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||s()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var b=Vr();var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(K?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var Ht=class extends we{#e;#t;#n;#r;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Qr(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){let n=zt(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(M).catch(M):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Qt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===re||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!jt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){let a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}let n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{let a=pe(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return r(c),this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});let s=a=>{ye(a)&&a.silent||this.#o({type:"error",error:a}),ye(a)||(this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this)),this.scheduleGc()};return this.#r=Ee({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(a)}catch(c){s(c);return}this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),this.scheduleGc()},onError:s,onFail:(a,c)=>{this.#o({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){let t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...jr(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let r=e.error;return ye(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),b.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function jr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:at(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Qr(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oe=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,o=t.queryHash??ne(r,t),i=this.get(o);return i||(i=new Ht({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){b.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(n=>it(t,n))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(n=>it(e,n)):t}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){b.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){b.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};var en=class extends we{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Wr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=Ee({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);let o=await this.options.onMutate?.(e);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:n})}let r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#t.runNext(this)}}#r(e){let t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),b.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Wr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ie=class extends q{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new en({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){let t=ve(e);if(typeof t=="string"){let n=this.#t.get(t);if(n)if(n.length>1){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=ve(e);if(typeof t=="string"){let r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){let t=ve(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){b.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(n=>st(t,n))}findAll(e={}){return this.getAll().filter(t=>st(e,t))}notify(e){b.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(t=>t.state.isPaused);return b.batch(()=>Promise.all(e.map(t=>t.continue().catch(M))))}};function ve(e){return e.options.scope?.id}function ct(e){return{onFetch:(t,n)=>{let r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},c=0,d=async()=>{let u=!1,l=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=pe(t.options,t.fetchOptions),E=async(y,h,w)=>{if(u)return Promise.reject();if(h==null&&y.pages.length)return Promise.resolve(y);let g={queryKey:t.queryKey,pageParam:h,direction:w?"backward":"forward",meta:t.options.meta};l(g);let A=await f(g),{maxPages:x}=t.options,v=w?Jt:Yt;return{pages:v(y.pages,A,x),pageParams:v(y.pageParams,h,x)}};if(o&&i.length){let y=o==="backward",h=y?$r:tn,w={pages:i,pageParams:s},g=h(r,w);a=await E(w,g,y)}else{let y=e??i.length;do{let h=c===0?s[0]??r.initialPageParam:tn(r,a);if(c>0&&h==null)break;a=await E(a,h),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function tn(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $r(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ut=class{#e;#t;#n;#r;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new oe,this.#t=e.mutationCache||new ie,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=J.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ot(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{let r=n.data;return[t,r]})}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,s=Gt(t,i);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return b.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;b.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){let n=this.#e,r={type:"active",...e};return b.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=b.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(M).catch(M)}invalidateQueries(e,t={}){return b.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=b.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(M)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(M)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ot(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(M).catch(M)}fetchInfiniteQuery(e){return e.behavior=ct(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(M).catch(M)}ensureInfiniteQueryData(e){return e.behavior=ct(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return J.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(z(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(r=>{Y(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(z(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#s.values()],n={};return t.forEach(r=>{Y(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ne(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===re&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var zr=new ut({defaultOptions:{queries:{staleTime:3e4}},queryCache:new oe({onError:(e,t)=>{}}),mutationCache:new ie}),nn=zr;var Yr=[{name:"lowCpuCores",weight:1,async check(){let e=navigator.hardwareConcurrency||0,t=e>0&&e<=2;return{value:e,triggered:t}}},{name:"lowDeviceMemory",weight:1,async check(){let e=navigator.deviceMemory||0,t=e>0&&e<=4;return{value:e,triggered:t}}},{name:"platformMismatch",weight:1,async check(){let e=navigator.userAgent||"",t=navigator.platform||"",n=e.includes("Mac")&&t.includes("Linux")||e.includes("Win")&&t.includes("Mac")||t===""||t==="Unknown";return{value:t,triggered:n}}},{name:"webglSoftwareRenderer",weight:2,async check(){let e=null,t=null,n=!1;try{let r=document.createElement("canvas"),o=r.getContext("webgl")||r.getContext("experimental-webgl");if(o){let i=o.getExtension("WEBGL_debug_renderer_info");if(i){e=o.getParameter(i.UNMASKED_VENDOR_WEBGL)||"",t=o.getParameter(i.UNMASKED_RENDERER_WEBGL)||"";let s=t.toLowerCase(),a=e.toLowerCase();n=s.includes("swiftshader")||s.includes("llvmpipe")||s.includes("softwar")||s.includes("basic render")||s.includes("vmware")||s.includes("virtualbox")||a.includes("vmware")||a.includes("parallels")}}}catch{}return{value:{vendor:e,renderer:t},triggered:n}}},{name:"missingWebGPUAdapter",weight:2,async check(){if(!("gpu"in navigator))return{value:"no WebGPU",triggered:!0};try{let e=await navigator.gpu.requestAdapter();return{value:e?"adapter-present":"adapter-null",triggered:!e}}catch{return{value:"adapter-error",triggered:!0}}}},{name:"reducedTimerPrecision",weight:1,async check(){let e=performance.now();await new Promise(r=>setTimeout(r,50));let t=performance.now()-e,n=t<30||t>80;return{value:t.toFixed(2),triggered:n}}},{name:"timerJitter",weight:1,async check(){let e=[];for(let r=0;r<10;r++){let o=performance.now();await new Promise(s=>setTimeout(s,10));let i=performance.now();e.push(i-o)}let t=Math.sqrt(e.map(r=>(r-10)**2).reduce((r,o)=>r+o)/e.length),n=t>5;return{value:t.toFixed(3),triggered:n}}},{name:"audioFingerprint",weight:1,async check(){try{let e=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,44100,44100),t=e.createOscillator();t.frequency.value=440,t.connect(e.destination),t.start(0);let r=(await e.startRendering()).getChannelData(0).reduce((i,s)=>i+Math.abs(s),0),o=r<100;return{value:r,triggered:o}}catch{return{value:"audio-error",triggered:!0}}}},{name:"canvasEntropy",weight:1,async check(){try{let e=document.createElement("canvas"),t=e.getContext("2d");t.textBaseline="top",t.font="14px 'Arial'",t.fillText("VM CHECK",2,2);let r=[...e.toDataURL()].reduce((i,s)=>(i+s.charCodeAt(0))%9999999,0);return{value:r,triggered:r===0||r===999999}}catch{return{value:"canvas-error",triggered:!0}}}},{name:"windowSizeWeird",weight:1,async check(){let e=window.innerWidth/window.innerHeight,t=e===1.333||e===1.6;return{value:e.toFixed(2),triggered:t}}},{name:"touchMismatch",weight:1,async check(){let e="ontouchstart"in window,t=navigator.maxTouchPoints||0;return{value:{hasTouch:e,maxTouch:t},triggered:e&&t===0}}},{name:"batteryVirtualized",weight:1,async check(){if(!navigator.getBattery)return{value:"no API",triggered:!0};try{let e=await navigator.getBattery(),t=e.chargingTime===0&&e.dischargingTime===1/0;return{value:{chargingTime:e.chargingTime,dischargingTime:e.dischargingTime},triggered:t}}catch{return{value:"battery-error",triggered:!0}}}},{name:"permissionsWeird",weight:1,async check(){try{let e=await navigator.permissions.query({name:"camera"}),t=e.state==="prompt";return{value:e.state,triggered:t}}catch{return{value:"perm-error",triggered:!0}}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.length===0;return{value:e.length,triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"virtualizedMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices(),t=e.some(n=>n.label.toLowerCase().includes("virtual"));return{value:e.map(n=>n.label),triggered:t}}catch{return{value:"media-error",triggered:!0}}}},{name:"webrtcIpPattern",weight:2,async check(){return new Promise(e=>{let t=new RTCPeerConnection({iceServers:[]});t.createDataChannel("x"),t.onicecandidate=n=>{if(!n||!n.candidate){e({value:"no candidate",triggered:!0});return}let r=n.candidate.candidate.toLowerCase(),o=r.includes("10.0.2.")||r.includes("172.16.")||r.includes("192.168.56.");e({value:r,triggered:o})},t.createOffer().then(n=>t.setLocalDescription(n))})}},{name:"gpuAccelerationDisabled",weight:2,async check(){let t=document.createElement("canvas").getContext("webgl");return{value:!!t,triggered:!t}}},{name:"noWebGL2",weight:1,async check(){let e=document.createElement("canvas").getContext("webgl2");return{value:!!e,triggered:!e}}},{name:"lowStorageQuota",weight:1,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<500*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"storage-error",triggered:!0}}}},{name:"lowEntropy",weight:1,async check(){let e=Object.keys(navigator).length+Object.keys(screen).length+Object.keys(window).length,t=e<200;return{value:e,triggered:t}}},{name:"noLanguages",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"uaEntropyLow",weight:1,async check(){let e=navigator.userAgent,t=e.length<30;return{value:e,triggered:t}}},{name:"weirdDPI",weight:1,async check(){let e=window.devicePixelRatio;return{value:e,triggered:e===1}}}];async function rn({threshold:e=7}={}){let t={},n=0;for(let r of Yr){let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isLikelyVM:n>=e,score:n,threshold:e,signals:t}}var Jr=[{name:"hookedFunctionToString",weight:2,async check(){let e=Function.prototype.toString.toString(),t=Function.prototype.toString+"";return{value:{native:e,current:t},triggered:e!==t}}},{name:"navigatorProxyTrap",weight:2,async check(){let e=!1;try{let t=Object.getOwnPropertyDescriptor(window,"navigator");t&&t.get&&t.get.toString()?.includes("[native code]")===!1&&(e=!0)}catch{}return{value:"navigator getter",triggered:e}}},{name:"uaMismatch",weight:2,async check(){let e=navigator.userAgent||"",t="";try{let r=await navigator.userAgentData?.getHighEntropyValues?.(["platform","brands"]);t=JSON.stringify(r)}catch{}let n=e?.includes("Mac")&&t?.includes("Windows")||e?.includes("Win")&&t?.includes("Mac")||t&&t.length>0&&!e;return{value:{ua:e,brandInfo:t},triggered:n}}},{name:"timezoneLocaleMismatch",weight:1,async check(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=navigator.language||"",n=t.startsWith("en")&&e==="Asia/Shanghai"||t.startsWith("zh")&&e==="America/New_York"||e===void 0;return{value:{tz:e,lang:t},triggered:n}}},{name:"canvasNoise",weight:2,async check(){let e=()=>{let o=document.createElement("canvas"),i=o.getContext("2d");return i.textBaseline="top",i.font="14px Arial",i.fillText("anti-detect-check",2,2),o.toDataURL()},t=e(),n=e();return{value:{a:t,b:n},triggered:t!==n}}},{name:"webglNoise",weight:2,async check(){try{let t=document.createElement("canvas").getContext("webgl");if(!t)return{value:"no-webgl",triggered:!0};let n=t.getExtension("WEBGL_debug_renderer_info");if(!n)return{value:"no-debug-extension",triggered:!1};let r=t.getParameter(n.UNMASKED_VENDOR_WEBGL),o=t.getParameter(n.UNMASKED_RENDERER_WEBGL),i=r===""||o===""||r?.includes(" ")===!1||o?.includes(" ")===!1;return{value:{v:r,r:o},triggered:i}}catch{return{value:"gl-error",triggered:!0}}}},{name:"webdriverFlag",weight:3,async check(){let e=navigator.webdriver===!0;return{value:navigator.webdriver,triggered:e}}},{name:"perfectEventTiming",weight:1,async check(){let e=performance.now();return{value:e,triggered:e%1===0}}},{name:"serviceWorkerBlocked",weight:1,async check(){let e=!("serviceWorker"in navigator);return{value:e,triggered:e}}},{name:"smallQuota",weight:2,async check(){try{let e=await navigator.storage.estimate(),t=e.quota<50*1024*1024;return{value:e.quota,triggered:t}}catch{return{value:"quota-error",triggered:!0}}}},{name:"indexedDbBlocked",weight:2,async check(){try{let e=indexedDB.open("tamper-check");return await new Promise(t=>{e.onerror=()=>t({value:"error",triggered:!0}),e.onsuccess=()=>t({value:"ok",triggered:!1})})}catch{return{value:"throw",triggered:!0}}}},{name:"screenDprMismatch",weight:1,async check(){let e=window.screen.width,t=window.screen.height,n=window.devicePixelRatio,r=e===1920&&n===1&&t===1080||n%1!==0&&n%1!==.5;return{value:{w:e,h:t,dpr:n},triggered:r}}},{name:"missingCommonFonts",weight:1,async check(){return{value:"skipped",triggered:!1}}},{name:"noMediaDevices",weight:1,async check(){try{let e=await navigator.mediaDevices.enumerateDevices();return{value:e.length,triggered:e.length===0}}catch{return{value:"error",triggered:!0}}}},{name:"languagesEmpty",weight:1,async check(){let e=navigator.languages||[];return{value:e,triggered:e.length===0}}},{name:"pluginMismatch",weight:1,async check(){try{let e=navigator.plugins.length;return{value:e,triggered:e===0}}catch{return{value:"error",triggered:!0}}}},{name:"devtoolsDetected",weight:2,async check(){return new Promise(async e=>{let t={viewportBreakpoint:!1,consoleSpeed:!1},n=160,r=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(r>n||o>n)&&(t.viewportBreakpoint=!0);async function i(a=50){return new Promise(c=>{let d=performance.now();console.log("%c ","font-size:3000px");let u=performance.now();c(u-d>a)})}t.consoleSpeed=await i();let s=Object.values(t).some(Boolean);setTimeout(()=>{e({value:s,triggered:s})},50)})}},{name:"knownAntiDetectBrowser",weight:5,async check(){let e=navigator.userAgent.toLowerCase(),n=["incogniton","multilogin","morelogin","adspect","kameleo","goLogin"].some(r=>e?.includes(r));return{value:e,triggered:n}}}];async function on({threshold:e=5}={}){let t={},n=0;for(let o of Jr){let i=await o.check();t[o.name]=i,i.triggered&&(n+=o.weight)}let r=Math.min(1,n/15);return{result:r>=.5||t.knownAntiDetectBrowser?.triggered,anomalyScore:r,antiDetectBrowser:t.knownAntiDetectBrowser?.triggered||!1,signals:t}}function Xr(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function Zr(){let e=navigator.userAgent,t=Xr();return t===44||t===43?"Safari":t===51?"Chrome":t===25?"Firefox":navigator.msSaveBlob!==void 0?"MSIE":e.match(/Chrome/)?navigator.brave!==void 0?"Brave":e.includes("Edg")?"Edge":e.includes("OPR")?"Opera":"Chrome":"Unknown"}var Hr=[{name:"safari_currentStorageTest",weight:2,browser:"Safari",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("unknown transient reason"),value:t}}}},{name:"safari13to18_indexedDbBlobTest",weight:2,browser:"Safari",async check(){return await new Promise(e=>{let t=String(Math.random()),n=indexedDB.open(t,1);n.onupgradeneeded=r=>{let o=r.target.result;try{o.createObjectStore("t",{autoIncrement:!0}).put(new Blob),e({triggered:!1,value:"ok"})}catch(i){let s=i?.message??String(i);e({triggered:s.includes("are not yet supported"),value:s})}finally{o.close(),indexedDB.deleteDatabase(t)}},n.onerror=()=>e({triggered:!1,value:"idb-error"})})}},{name:"safari_oldWebkitTest",weight:1,browser:"Safari",async check(){let e=window.openDatabase,t=window.localStorage;try{e(null,null,null,null)}catch{return{triggered:!0,value:"openDatabase denied"}}try{t.setItem("test","1"),t.removeItem("test")}catch{return{triggered:!0,value:"localStorage denied"}}return{triggered:!1,value:"ok"}}},{name:"chrome_storageQuotaPrivateTest",weight:2,browser:"Chrome",async check(){return await new Promise((e,t)=>{let r=window?.performance?.memory?.jsHeapSizeLimit??1073741824;navigator.webkitTemporaryStorage.queryUsageAndQuota((o,i)=>{let s=Math.round(i/1048576),a=Math.round(r/(1024*1024))*2;e({triggered:s<a,value:{quotaMB:s,limitMB:a}})},o=>t(o))})}},{name:"chrome_oldFileSystemTest",weight:1,browser:"Chrome",async check(){let e=window.webkitRequestFileSystem;return e?await new Promise(t=>e(0,1,()=>t({triggered:!1,value:"ok"}),()=>t({triggered:!0,value:"denied"}))):{triggered:!1,value:"unsupported"}}},{name:"firefox_storageDirectoryTest",weight:2,browser:"Firefox",async check(){if(typeof navigator.storage?.getDirectory!="function")return{triggered:!1,value:"unsupported"};try{return await navigator.storage.getDirectory(),{triggered:!1,value:"ok"}}catch(e){let t=e?.message??String(e);return{triggered:t.includes("Security error"),value:t}}}},{name:"firefox_indexedDbInvalidStateTest",weight:1,browser:"Firefox",async check(){return await new Promise(e=>{let t=indexedDB.open("inPrivate");t.onerror=()=>{e({triggered:t.error?.name==="InvalidStateError",value:t.error?.name})},t.onsuccess=()=>{indexedDB.deleteDatabase("inPrivate"),e({triggered:!1,value:"ok"})}})}},{name:"msie_indexedDbMissing",weight:2,browser:"MSIE",async check(){return{triggered:window.indexedDB===void 0,value:"msie-idb-check"}}}];async function sn(){let e=Zr(),t={},n=0;for(let r of Hr){if(r.browser!==e)continue;let o=await r.check();t[r.name]=o,o.triggered&&(n+=r.weight)}return{isPrivate:n>0,browserName:e,score:n,signals:t}}typeof window<"u"&&(window.detectIncognito=sn);var an=sn;var cn=[{name:"globalPrivacyControl",weight:3,async check(){let e=navigator.globalPrivacyControl;return{triggered:e===!0,value:e}}},{name:"doNotTrack",weight:1,async check(){let e=navigator.doNotTrack;return{triggered:e==="1",value:e}}},{name:"cookiesDisabled",weight:3,async check(){let e=navigator.cookieEnabled;return{triggered:e===!1,value:e}}},{name:"thirdPartyCookiesBlocked",weight:3,async check(){try{if("hasStorageAccess"in document&&!await document.hasStorageAccess())try{return await document.requestStorageAccess(),{triggered:!1,value:"access_granted"}}catch{return{triggered:!0,value:"access_denied"}}let e=`__dtect_3p_test_${Date.now()}`;document.cookie=`${e}=1; SameSite=None; Secure`;let t=document.cookie.includes(e);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT`,{triggered:!1,value:t?"cookies_work":"may_be_blocked"}}catch(e){return{triggered:!1,value:`error: ${e?.message}`}}}},{name:"firefoxResistFingerprinting",weight:2,async check(){let e=[],t=new Date().getTimezoneOffset();t===0&&Intl.DateTimeFormat().resolvedOptions().timeZone==="UTC"&&e.push("timezone_utc");let n=navigator.hardwareConcurrency;n===2&&e.push("cores_capped");let r=window.screen.width,o=window.screen.height,i=window.innerWidth,s=window.innerHeight;r===i&&o===s&&e.push("screen_matches_inner");let a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return{triggered:e.length>=2,value:{signals:e,timezoneOffset:t,cores:n,prefersReducedMotion:a}}}},{name:"braveShields",weight:3,async check(){if(!(navigator.brave!==void 0))return{triggered:!1,value:"not_brave"};try{if(!await navigator.brave.isBrave())return{triggered:!1,value:"brave_check_false"};let r=document.createElement("canvas").getContext("2d");if(r){r.fillStyle="rgb(255, 0, 0)",r.fillRect(0,0,1,1);let o=r.getImageData(0,0,1,1).data;r.fillRect(0,0,1,1);let i=r.getImageData(0,0,1,1).data;if(o[0]!==i[0]||o[1]!==i[1]||o[2]!==i[2])return{triggered:!0,value:"shields_active_canvas"}}try{let o=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});if(o.createDataChannel(""),await new Promise(s=>{let a=setTimeout(()=>{o.close(),s(!1)},1e3);o.onicecandidate=c=>{c.candidate?.candidate&&(/([0-9]{1,3}\.){3}[0-9]{1,3}/.test(c.candidate.candidate)||(clearTimeout(a),o.close(),s(!0)))},o.createOffer().then(c=>o.setLocalDescription(c))}))return{triggered:!0,value:"shields_active_webrtc"}}catch{return{triggered:!0,value:"shields_active_webrtc_blocked"}}return{triggered:!0,value:"brave_detected_shields_default"}}catch(t){return{triggered:!1,value:`error: ${t?.message}`}}}}];async function un(){let e={},t=0,n=await Promise.allSettled(cn.map(async r=>{let o=await r.check();return{name:r.name,weight:r.weight,result:o}}));for(let r of n)if(r.status==="fulfilled"){let{name:o,weight:i,result:s}=r.value;e[o]=s,s.triggered&&(t+=i)}else{let o=n.indexOf(r),i=cn[o];i&&(e[i.name]={triggered:!1,value:`check_failed: ${r.reason}`})}return{isPrivacyEnabled:t>3,score:t,signals:e}}typeof window<"u"&&(window.detectPrivacy=un);var ln=un;var dn="dtect_security_sdk_state",mn=typeof window<"u",fn={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Ie={state:{...fn},securityKeys:{behaviorKey:"bwDZ0V3Zrb4SB6g4lZwW",automationKey:"7166bf18-b91e-407a-84fc-d57ac104de98",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}};function hn(){if(!mn)return Ie;try{let e=sessionStorage.getItem(dn);if(!e)return Ie;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Ie:{state:{...fn,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}}}catch{return Ie}}function G(e){if(mn)try{let t=Date.now()+864e5,n={...e,expiresAt:t};sessionStorage.setItem(dn,JSON.stringify(n))}catch{}}function pn(e){return e.token||Q()}async function D(e,t="info",n={}){let r=`${n.endpoint??"https://api.dtect.io/security"}/log`,o={message:e,type:t,payload:n};navigator.sendBeacon(r,JSON.stringify(o))}var Re,R="https://api.dtect.io/security",be=`${R}/client/check`,T="",V="",eo=["2d6803fb-8373-4771-897a-dfa18acf7da4","f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","58da2d43-45c0-49be-96f6-bd4651148a42"],to=["f2a1d9fe-9362-4922-b3e4-2180d48da8f9","876f4a4e-522d-4b52-aff6-d2f21f8d250c","13b1fab5-c93c-48db-a50d-03c7df6c30b8","4c5dea4c-d1b7-4dc7-88fc-cf03e7a54a66","32014166-ed5f-4e30-a58b-587e2a2881d8","67107037-d5b5-483a-a046-bf39c38ce738","23b778f9-d07f-477d-9863-168c90a320d2","57392ff8-1733-41e7-b336-a9c7a01ef559","59073b5c-2b9a-4933-9d7e-655b0559196f"],gn="0.0.30",no="20000000-aaaa-bbbb-cccc-000000000002",Te;var{state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}=hn(),ro=St,se;async function oo({clientId:e,apiKey:t,endpoint:n}){if(Ae({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k};let r=await nn.fetchQuery({queryKey:["getClientConfig",e,t],queryFn:()=>nt({url:`${n}/client/config`,headers:{"client-id":T,"x-api-key":V}})});if(!Ae(r))throw new Error("Missing keys from get client config");return L=r.automationKey,U=r.behaviorKey,B=r.dtectSignalEnabled,k=r.dtectAutomationSignalEnabled,G({state:m,securityKeys:r}),r}function pt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(I.RATE_LIMIT_REACHED);switch(e?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_TOKEN)}function X(){if(wn(m)&&Ae({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return!0;let e=Se(),t=document.querySelector("#dtect-h-captcha");return!!Re&&!!(!k&&t||e||k)}function yn(){return!!(T&&V)}function io(){return new Promise(e=>{let t=()=>{window?.hcaptcha?e():requestAnimationFrame(t)};t()})}var Se=()=>window?.location?.href?.includes("localhost")||window?.location?.href?.includes("file:///");async function so({behaviorKey:e,dtectAutomationSignalEnabled:t=!1}){let n=performance.now();Re=await j.load({apiKey:e,endpoint:["https://fp.dtect.io",j.defaultEndpoint],scriptUrlPattern:["https://fp.dtect.io/web/v<version>/<apiKey>/loader_v<loaderVersion>.js",j.defaultScriptUrlPattern]});let o=(performance.now()-n).toFixed();if(D(`FingerprintJS loaded in ${o}ms`,"info",{function:"fpjs load",endpoint:R,diff:o,token:m.token,clientId:T}),!Se()&&!t&&(await io(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:L,size:"invisible"})),!Re)throw new Error(I.SDK_INIT_ERROR)}async function ao(){let e=performance.now();if(m.tokens){let c=(performance.now()-e).toFixed();return D(`getTokens finishes in ${c}ms`,"info",{function:"getTokens",endpoint:R,diff:c,token:m.token,clientId:T}),m.tokens}let t=new Promise(a=>{let c=Re?.get();a(c)}),n=new Promise(async a=>{Se()&&a({response:no});let d=await window?.hcaptcha?.execute({async:!0});a(d)}),[r,o]=await Promise.all([k?{response:""}:n,t]);m.tokens={behaviorRequestId:o?.requestId,behaviorToken:o?.sealedResult,automationToken:r?.response};let s=(performance.now()-e).toFixed();return D(`getTokens finishes in ${s}ms`,"info",{function:"getTokens",endpoint:R,diff:s,token:m.token,clientId:T}),m.tokens}function co(e){let t=e?.projectId,n=e?.visitorId||Q();return(typeof e?.projectId=="number"||typeof e?.visitorId=="number")&&(t=`${e?.projectId}`,n=`${e?.visitorId}`),{visitorId:n,projectId:t}}function gt(e){let{projectId:t,visitorId:n}=co(e);return{projectId:t,visitorId:n}}async function En(e,t){let n=performance.now();if(!X())throw new Error(I.NOT_INITIALIZED);if(!yn())throw new Error(I.MISSING_CREDENTIALS);let{projectId:r,visitorId:o}=gt(e);if(r!==m.projectId&&(m.token=Q()),m.visitorId=o,m.projectId=r,!e||!r?.trim())throw new Error(I.FAILED_TO_GET_SECURITY_RESULT);let i;try{let s=await ao();if(B){let a=new te,[c,d,u,l,f]=await Promise.allSettled([a.get(),rn(),on(),an(),ln()]);i={deviceRes:c,vmDtectResults:d,tamperingDtectResults:u,incognitoDtectResults:l,privacySettingsDtectResults:f}}if(s?.behaviorToken&&s?.behaviorRequestId&&(k||!k&&s?.automationToken)){let a={behaviorToken:s.behaviorToken,automationToken:s.automationToken,behaviorRequestId:s.behaviorRequestId,entryLink:window?.location?.href,securitySettings:e.securitySettings,metaData:e.metaData,...B?{vmDtectResults:i?.vmDtectResults?.value,tamperingDtectResults:i?.tamperingDtectResults?.value,incognitoDtectResults:i?.incognitoDtectResults?.value,deviceIdResults:i?.deviceRes?.value,privacySettingsDtectResults:i?.privacySettingsDtectResults?.value}:{}};m.clientData=a;let c={...e,projectId:r,visitorId:o,clientData:a,version:"0.0.30",token:m.token,questionData:m.questionData,aiCheckData:m.aiCheckData},d=await he({url:`${t}`,body:{...c},headers:{"client-id":T,"x-api-key":V}});if("token"in d||"results"in d){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let l=(performance.now()-n).toFixed();return D(`getResultBase finishes in ${l}ms`,"info",{function:"getResultBase",endpoint:R,diff:l,token:m.token,clientId:T}),d}}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(s){let c=(performance.now()-n).toFixed();if(D("getResultBase error","error",{function:"getResultBase",endpoint:R,error:s,diff:c,token:m.token,clientId:T}),s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if(s?.message?.includes("rate-limited")||s?.message?.includes("429"))throw new Error(I.RATE_LIMIT_REACHED);switch(s?.message){case j.ERROR_RATE_LIMIT:throw new Error(I.RATE_LIMIT_REACHED);default:throw new Error(I.INTERNAL_SERVER_ERROR)}}throw new Error(I.FAILED_TO_GET_SECURITY_RESULT)}}async function lt(e){return await En(e,`${R}/client/check/result`)}async function dt(e){return await En(e,`${R}/client/check`)}async function mt(e){let t=performance.now();if(!X())throw new Error(I.NOT_INITIALIZED);let{respondentType:n,language:r}=e;try{let o=await nt({url:`${R}/client/quality-questions/${n}/${r}`,headers:{"client-id":T,"x-api-key":V}});if(o){let s=(performance.now()-t).toFixed();return D(`getQualityQuestions finishes in ${s}ms`,"info",{function:"getQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("getQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),pt(o)}}async function ft(e){let t=performance.now();if(!X())throw new Error(I.NOT_INITIALIZED);m.questionData||(m.questionData={questions:e.questions});let{visitorId:n,projectId:r}=gt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:gn,questionData:m.questionData,aiCheckData:m.aiCheckData,clientData:m.clientData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`checkQualityQuestions finishes in ${s}ms`,"info",{function:"checkQualityQuestions",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("checkQualityQuestions error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),pt(o)}}async function ht(e){let t=performance.now();if(!X())throw new Error(I.NOT_INITIALIZED);m.aiCheckData={timeTakenSeconds:e.timeTakenSeconds,qbc:e.qbc||se.qbc,mas:e.mas||se.mas,scb:e.scb||se.scb,apd:e.apd||se.apd};let{visitorId:n,projectId:r}=gt(e);m.visitorId=n,m.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:m.token,visitorId:n,projectId:r,version:gn,clientData:m.clientData,questionData:m.questionData,aiCheckData:m.aiCheckData}});if(o){G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}});let s=(performance.now()-t).toFixed();return D(`isAIUsageDetected finishes in ${s}ms`,"info",{function:"isAIUsageDetected",endpoint:R,diff:s,token:m.token,clientId:T}),o}throw new Error(I.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();D("isAIUsageDetected error","error",{endpoint:R,error:o,diff:s,token:m.token,clientId:T}),pt(o)}}function uo(){let e=performance.now(),t=document.querySelector("head"),n=document.querySelector("body");if(!Se()){n?.insertAdjacentHTML("beforeend",'<div id="dtect-h-captcha" ></div>');let o=document.createElement("script");o.setAttribute("src","https://js.hcaptcha.com/1/api.js"),o.setAttribute("async","true"),o.setAttribute("defer","true"),t?.append(o);let s=(performance.now()-e).toFixed()}}function Ae(e){return(e.dtectAutomationSignalEnabled||e?.automationKey)&&e?.behaviorKey}function wn(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function lo(e){let t=performance.now();if(!e?.clientId||!e?.apiKey)throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);let{clientId:n,apiKey:r,endpoint:o="https://api.dtect.io/security",includeResults:i}=e;R=o,be=`${R}/client/check`;let s=pn(m);if(m.isLoading){if(X())return Te;throw D(I.DUPLICATE_INITIALIZATION,"error",{endpoint:R,clientId:n,apiKey:r,token:m.token}),new Error(I.DUPLICATE_INITIALIZATION)}if(se=Bt(m.aiCheckData),T=n,V=r,k=eo.includes(n),B=to.includes(n),i&&(be=`${R}/client/check/result`),m={...m,isLoading:!0,token:s||""},wn(m)&&Ae({automationKey:L,behaviorKey:U,dtectAutomationSignalEnabled:k}))return m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}}),{getSecurityResult:lt,getSecurityToken:dt,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:mt,LanguageCodes:Z,QualityQuestionsRespondentTypes:H};if(!yn())throw D(I.MISSING_CREDENTIALS,"error",{endpoint:R,...e}),new Error(I.MISSING_CREDENTIALS);if(X())return Te;try{let c=await oo({clientId:n,apiKey:r,endpoint:o});return c.dtectAutomationSignalEnabled||uo(),so({behaviorKey:c.behaviorKey,dtectAutomationSignalEnabled:c.dtectAutomationSignalEnabled}).then(()=>{let u=(performance.now()-t).toFixed();return D(`init() finishes ${u}ms`,"info",{endpoint:R,function:"init",diff:u,token:m.token,clientId:T}),{getSecurityResult:lt,getSecurityToken:dt,SecurityAPIError:ro,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:mt,LanguageCodes:Z,QualityQuestionsRespondentTypes:H}}).catch(d=>{throw new Error(d.message)})}catch(c){if(c instanceof Error){if(D(c.message,"error",{function:"init",endpoint:R,error:c,token:m.token,clientId:T}),c?.message?.includes("maintenance_mode"))throw new Error(I.MAINTENANCE_MODE);if([I.INVALID_API_KEY,I.UNAUTHORIZED].includes(c?.message))throw new Error(I.INVALID_CREDENTIALS)}throw new Error(I.SDK_INIT_ERROR)}finally{m={...m,isLoading:!1,token:s},G({state:m,securityKeys:{automationKey:L,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:k}})}}Te={init:lo,getSecurityResult:lt,getSecurityToken:dt,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:mt,QualityQuestionsRespondentTypes:H,LanguageCodes:Z};var Ha=Te;export{Z as LanguageCodes,H as QualityQuestionsRespondentTypes,ro as SecurityAPIError,ft as checkQualityQuestions,Ha as default,mt as getQualityQuestions,lt as getSecurityResult,dt as getSecurityToken,lo as init,ht as isAIUsageDetected};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtect/security-sdk-js",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",