@dtect/security-sdk-js 0.0.18 → 0.0.20
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 +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ne=Object.defineProperty;var Er=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Ir=Object.prototype.hasOwnProperty;var vr=(e,t)=>{for(var r in t)Ne(e,r,{get:t[r],enumerable:!0})},Rr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wr(t))!Ir.call(e,o)&&o!==r&&Ne(e,o,{get:()=>t[o],enumerable:!(n=Er(t,o))||n.enumerable});return e};var br=e=>Rr(Ne({},"__esModule",{value:!0}),e);var ho={};vr(ho,{LanguageCodes:()=>V,QualityQuestionsRespondentTypes:()=>j,SecurityAPIError:()=>fr,checkQualityQuestions:()=>Oe,default:()=>fo,getQualityQuestions:()=>Te,getSecurityResult:()=>Re,getSecurityToken:()=>be,init:()=>yr,isAIUsageDetected:()=>Ae});module.exports=br(ho);function Tr(e,t){return function(r,n){return Object.prototype.hasOwnProperty.call(r,n)}(e,t)?e[t]:void 0}function Or(e,t,r,n){let o=document,i="securitypolicyviolation",a,s=m=>{let u=new URL(e,location.href),{blockedURI:l}=m;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(a=m,c())};o.addEventListener(i,s);let c=()=>o.removeEventListener(i,s);return n?.then(c,c),Promise.resolve().then(t).then(m=>(c(),m),m=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),a)return r(a);throw m}))}function N(e){let t="";for(let r=0;r<e.length;++r)if(r>0){let n=e[r].toLowerCase();n!==e[r]?t+=` ${n}`:t+=e[r]}else t+=e[r].toUpperCase();return t}var Ar={default:"endpoint"},Dr={default:"tlsEndpoint"},Sr="Client timeout",_r="Network connection error",Pr="Network request aborted",xr="Response cannot be parsed",Me="Blocked by CSP",Le="The endpoint parameter is not a valid URL",kr="Handle on demand agent data error",Nr=N("WrongRegion"),Mr=N("SubscriptionNotActive"),Lr=N("UnsupportedVersion"),Cr=N("InstallationMethodRestricted"),Fr=N("HostnameRestricted"),Ur=N("IntegrationFailed"),Br=N("NetworkRestricted"),qr=N("InvalidProxyIntegrationSecret"),Kr=N("InvalidProxyIntegrationHeaders"),Gr=N("ProxyIntegrationSecretEnvironmentMismatch"),Ce="API key required",pt="API key not found",gt="API key expired",Vr="Request cannot be parsed",jr="Request failed",Wr="Request failed to process",Qr="Too many requests, rate limit exceeded",$r="Not available for this origin",zr="Not available with restricted header",Yr=Ce,Xr=pt,Jr=gt,Zr="3.12.0",oe="Failed to load the JS script of the agent",Fe="9319";function Hr(e,t){let r=[],[n,o]=function(s){let c=function(l){let d=[...l];return{current:()=>d[0],postpone(){let y=d.shift();y!==void 0&&d.push(y)},exclude(){d.shift()}}}(s),m=function(l,d){let y=0;return()=>Math.random()*Math.min(d,l*Math.pow(2,y++))}(100,3e3),u=new Set;return[c.current(),(l,d)=>{let y,E=d instanceof Error?d.message:"";if(E===Me||E===Le)c.exclude(),y=0;else if(E===Fe)c.exclude();else if(E===oe){let w=Date.now()-l.getTime()<50,p=c.current();p&&w&&!u.has(p)&&(u.add(p),y=0),c.postpone()}else c.postpone();let f=c.current();return f===void 0?void 0:[f,y??l.getTime()+m()-Date.now()]}]}(e),i;if(n===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));let a=s=>{let c=new Date,m=l=>r.push({url:s,startedAt:c,finishedAt:new Date,error:l}),u=t(s);return u.then(()=>m(),m),u.catch(l=>{if(i!=null||(i=l),r.length>=5)throw i;let d=o(c,l);if(!d)throw i;let[y,E]=d;return(f=E,new Promise(w=>setTimeout(w,f))).then(()=>a(y));var f})};return a(n).then(s=>[s,r])}var yt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",en=yt;function tn(e){var t,r;let{picked:n,rest:o}=function(u,l){let d={},y={};for(let[E,f]of Object.entries(u))l.includes(E)?d[E]=f:y[E]=f;return{picked:d,rest:y}}(e,["scriptUrlPattern","token","apiKey"]),i=n.token,a=(t=n.apiKey)!==null&&t!==void 0?t:i,s=(r=Tr(e,"scriptUrlPattern"))!==null&&r!==void 0?r:yt,[c,m]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},d=function(y,E,f,w){return y.addEventListener(E,f,w),()=>y.removeEventListener(E,f,w)}(document,"visibilitychange",l);return l(),[u,d]}();return Promise.resolve().then(()=>{if(!a||typeof a!="string")throw new Error(Ce);let u=function(l,d){return(Array.isArray(l)?l:[l]).map(y=>function(E,f){let w=encodeURIComponent;return E.replace(/<[^<>]+>/g,p=>p==="<version>"?"3":p==="<apiKey>"?w(f):p==="<loaderVersion>"?w(Zr):p)}(String(y),d))}(s,a);return Hr(u,rn)}).catch(u=>{throw m(),function(l){return l instanceof Error&&l.message===Fe?new Error(oe):l}(u)}).then(([u,l])=>(m(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function rn(e){return Or(e,()=>function(t){return new Promise((r,n)=>{if(function(s){if(URL.prototype)try{return new URL(s,location.href),!1}catch(c){if(c instanceof Error&&c.name==="TypeError")return!0;throw c}}(t))throw new Error(Le);let o=document.createElement("script"),i=()=>{var s;return(s=o.parentNode)===null||s===void 0?void 0:s.removeChild(o)},a=document.head||document.getElementsByTagName("head")[0];o.onload=()=>{i(),r()},o.onerror=()=>{i(),n(new Error(oe))},o.async=!0,o.src=t,a.appendChild(o)})}(e),()=>{throw new Error(Me)}).then(nn)}function nn(){let e=window,t="__fpjs_p_l_b",r=e[t];if(function(n,o){var i;let a=(i=Object.getOwnPropertyDescriptor)===null||i===void 0?void 0:i.call(Object,n,o);a?.configurable?delete n[o]:a&&!a.writable||(n[o]=void 0)}(e,t),typeof r?.load!="function")throw new Error(Fe);return r}var G={load:tn,defaultScriptUrlPattern:en,ERROR_SCRIPT_LOAD_FAIL:oe,ERROR_API_KEY_EXPIRED:gt,ERROR_API_KEY_INVALID:pt,ERROR_API_KEY_MISSING:Ce,ERROR_BAD_REQUEST_FORMAT:Vr,ERROR_BAD_RESPONSE_FORMAT:xr,ERROR_CLIENT_TIMEOUT:Sr,ERROR_CSP_BLOCK:Me,ERROR_FORBIDDEN_ENDPOINT:Fr,ERROR_FORBIDDEN_HEADER:zr,ERROR_FORBIDDEN_ORIGIN:$r,ERROR_GENERAL_SERVER_FAILURE:jr,ERROR_HANDLE_AGENT_DATA:kr,ERROR_INSTALLATION_METHOD_RESTRICTED:Cr,ERROR_INTEGRATION_FAILURE:Ur,ERROR_INVALID_ENDPOINT:Le,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Kr,ERROR_INVALID_PROXY_INTEGRATION_SECRET:qr,ERROR_NETWORK_ABORT:Pr,ERROR_NETWORK_CONNECTION:_r,ERROR_NETWORK_RESTRICTED:Br,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:Gr,ERROR_RATE_LIMIT:Qr,ERROR_SERVER_TIMEOUT:Wr,ERROR_SUBSCRIPTION_NOT_ACTIVE:Mr,ERROR_TOKEN_EXPIRED:Jr,ERROR_TOKEN_INVALID:Xr,ERROR_TOKEN_MISSING:Yr,ERROR_UNSUPPORTED_VERSION:Lr,ERROR_WRONG_REGION:Nr,defaultEndpoint:Ar,defaultTlsEndpoint:Dr};var T=[];for(let e=0;e<256;++e)T.push((e+256).toString(16).slice(1));function Et(e,t=0){return(T[e[t+0]]+T[e[t+1]]+T[e[t+2]]+T[e[t+3]]+"-"+T[e[t+4]]+T[e[t+5]]+"-"+T[e[t+6]]+T[e[t+7]]+"-"+T[e[t+8]]+T[e[t+9]]+"-"+T[e[t+10]]+T[e[t+11]]+T[e[t+12]]+T[e[t+13]]+T[e[t+14]]+T[e[t+15]]).toLowerCase()}var Ue,on=new Uint8Array(16);function Be(){if(!Ue){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ue=crypto.getRandomValues.bind(crypto)}return Ue(on)}var sn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qe={randomUUID:sn};function an(e,t,r){if(qe.randomUUID&&!t&&!e)return qe.randomUUID();e=e||{};let n=e.random??e.rng?.()??Be();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Et(n)}var X=an;var cn={UNAUTHORIZED:"Unauthorized"},un={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},wt={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"},It={SDK_INIT_ERROR:"Internal Server Error during SDK Initialization",DUPLICATE_INITIALIZATION:"Multiple SDK Initializations Detected",NOT_INITIALIZED:"SDK Not Initialized"},vt={INVALID_CREDENTIALS:"Invalid Public Client ID or Public API Key"},Rt={FAILED_TO_GET_SECURITY_RESULT:"Failed to Retrieve Security Result"},bt={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},v={...cn,...un,...wt,...It,...vt,...Rt,...bt},Tt={...wt,...It,...vt,...Rt,...bt};var V=(p=>(p.AR="ar",p.BN="bn",p.DE="de",p.EN="en",p.ES="es",p.FR="fr",p.HI="hi",p.ID="id",p.IT="it",p.JA="ja",p.KO="ko",p.MS="ms",p.NL="nl",p.PT="pt",p.RU="ru",p.YU="yu",p.ZH="zh",p))(V||{}),j=(I=>(I.GeneralConsumer="general-consumer",I.HRManagerDirector="hr-manager-director",I.WebDeveloper="web-developer",I.SoftwareEngineer="software-engineer",I.ITDirector="it-director",I.BusinessAdministrator="business-administrator",I.AccountsPayableManager="accounts-payable-manager",I.Accountant="accountant",I.FinanceDirector="finance-director",I.SmallBusinessOwner="small-business-owner",I.GeneralContractor="general-contractor",I.MarketingManagerDirector="marketing-manager-director",I.ConsumerShopper="consumer-shopper",I.Travel="travel",I.Entertainment="entertainment",I.FinanceAndBanking="finance-and-banking",I.General="general",I.B2BWhiteCollar="b2b-white-collar",I.B2BBlueCollar="b2b-blue-collar",I.Lawyer="lawyer",I))(j||{});var W={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},Fo={...W},Ke={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 Ge(){return ln()}async function ln(){return new Promise((t,r)=>{try{let i=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),a=i?.createBufferSource(),s=i.createOscillator();s.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,s.connect(c),c.connect(i.destination),s.start();let m;i.oncomplete=u=>{m=u.renderedBuffer.getChannelData(0),t({sampleHash:mn(m),maxChannels:i.destination.maxChannelCount,channelCountMode:a.channelCountMode})},i.startRendering()}catch(n){console.error("Error creating audio fingerprint:",n),r(n)}})}function mn(e){let t=0;for(let r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function ie(e,t,r){let n=[];for(let a=0;a<e[0].data.length;a++){let s=[];for(let c=0;c<e.length;c++)s.push(e[c].data[a]);n.push(dn(s))}let o=n,i=new Uint8ClampedArray(o);return new ImageData(i,t,r)}function dn(e){if(e.length===0)return 0;let t={};for(let n of e)t[n]=(t[n]||0)+1;let r=e[0];for(let n in t)t[n]>t[r]&&(r=parseInt(n,10));return r}function fn(e){return new TextEncoder().encode(e).buffer}function se(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^=e>>>16,e>>>0}var A=new Uint32Array([597399067,2869860233,951274213,2716044179]);function x(e,t){return e<<t|e>>>32-t}function hn(e,t){let r=e.byteLength/16|0,n=new Uint32Array(e,0,r*4);for(let o=0;o<r;o++){let i=n.subarray(o*4,(o+1)*4);i[0]=Math.imul(i[0],A[0]),i[0]=x(i[0],15),i[0]=Math.imul(i[0],A[1]),t[0]=t[0]^i[0],t[0]=x(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],A[1]),i[1]=x(i[1],16),i[1]=Math.imul(i[1],A[2]),t[1]=t[1]^i[1],t[1]=x(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],A[2]),i[2]=x(i[2],17),i[2]=Math.imul(i[2],A[3]),t[2]=t[2]^i[2],t[2]=x(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],A[3]),i[3]=x(i[3],18),i[3]=Math.imul(i[3],A[0]),t[3]=t[3]^i[3],t[3]=x(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function pn(e,t){let r=e.byteLength/16|0,n=e.byteLength%16,o=new Uint32Array(4),i=new Uint8Array(e,r*16,n);switch(n){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],A[3]),o[3]=x(o[3],18),o[3]=Math.imul(o[3],A[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],A[2]),o[2]=x(o[2],17),o[2]=Math.imul(o[2],A[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],A[1]),o[1]=x(o[1],16),o[1]=Math.imul(o[1],A[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],A[0]),o[0]=x(o[0],15),o[0]=Math.imul(o[0],A[1]),t[0]=t[0]^o[0]}}function gn(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]=se(t[0]),t[1]=se(t[1]),t[2]=se(t[2]),t[3]=se(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=fn(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let r=new Uint32Array([t,t,t,t]);hn(e,r),pn(e,r),gn(e,r);let n=new Uint8Array(r.buffer);return Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("")}var yn=3,Ot=280,At=20;async function Ve(){return En()}function En(){return new Promise(e=>{let t=Array.from({length:yn},()=>wn()),r=ie(t,Ot,At);e({commonPixelsHash:O(r.data.toString()).toString()})})}function wn(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Ot,e.height=At;let r=t.createLinearGradient(0,0,e.width,e.height);r.addColorStop(0,"red"),r.addColorStop(1/6,"orange"),r.addColorStop(2/6,"yellow"),r.addColorStop(3/6,"green"),r.addColorStop(4/6,"blue"),r.addColorStop(5/6,"indigo"),r.addColorStop(1,"violet"),t.fillStyle=r,t.fillRect(0,0,e.width,e.height);let n="Random Text WMwmil10Oo";return t.font="23.123px Arial",t.fillStyle="black",t.fillText(n,-5,15),t.fillStyle="rgba(0, 0, 255, 0.5)",t.fillText(n,-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 ae(e){for(;!document.body;)await In(50);let t=document.createElement("iframe");t.setAttribute("frameBorder","0");let r=t.style;r.setProperty("position","fixed"),r.setProperty("display","block","important"),r.setProperty("visibility","visible"),r.setProperty("border","0"),r.setProperty("opacity","0"),t.src="about:blank",document.body.appendChild(t);let n=t.contentDocument||t.contentWindow?.document;if(!n)throw new Error("Iframe document is not accessible");e({iframe:n}),setTimeout(()=>{document.body.removeChild(t)},0)}function In(e,t){return new Promise(r=>setTimeout(r,e,t))}var vn=["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"],Rn=["monospace","sans-serif","serif"];async function je(e){return bn()}function bn(){return new Promise((e,t)=>{try{ae(async({iframe:r})=>{let o=r.createElement("canvas").getContext("2d"),i=Rn.map(s=>Dt(o,s)),a={};vn.forEach(s=>{let c=Dt(o,s);i.includes(c)||(a[s]=c)}),e(a)})}catch{t({error:"unsupported"})}})}function Dt(e,t){if(!e)return null;let r="WwMmLli0Oo";return e.font=`72px ${t}`,e.measureText(r).width}function We(){return new Promise((e,t)=>{let r=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,n=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:Tn(),architecture:On(),deviceMemory:r.toString()||"undefined",jsHeapSizeLimit:n.jsHeapSizeLimit||0})})}function Tn(){let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(t&&"getParameter"in t)try{let r=(t.getParameter(t.VENDOR)||"").toString(),n=(t.getParameter(t.RENDERER)||"").toString(),o={vendor:r,renderer:n,version:(t.getParameter(t.VERSION)||"").toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||"").toString()};if(!n.length||!r.length){let i=t.getExtension("WEBGL_debug_renderer_info");if(i){let a=(t.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),s=(t.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString();a&&(o.vendorUnmasked=a),s&&(o.rendererUnmasked=s)}}return o}catch{}return"undefined"}function On(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Qe(){return new Promise(e=>{e({languages:An(),timezone:Dn()})})}function An(){let e=[];return navigator.language}function Dn(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var ce=(e,t,r,n)=>{let o=(r-t)/n,i=0;for(let a=0;a<n;a++){let s=t+(a+.5)*o;i+=e(s)}return i*o};function $e(){return new Promise(e=>{e({acos:Math.acos(.5),asin:ce(Math.asin,-1,1,97),cos:ce(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:ce(Math.sin,-Math.PI,Math.PI,97),tan:ce(Math.tan,0,2*Math.PI,97)})})}function Sn(e){if(e.length===0)return null;let t={};e.forEach(o=>{let i=String(o);t[i]=(t[i]||0)+1});let r=e[0],n=1;return Object.keys(t).forEach(o=>{t[o]>n&&(r=o,n=t[o])}),r}function St(e,t){let r={};return t.forEach(n=>{let o=e.map(a=>n in a?a[n]:void 0).filter(a=>a!==void 0),i=Sn(o);i&&(r[n]=i)}),r}var _n=["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 ze(e){let t=e?.permissions_to_check||_n,n=await Promise.all(Array.from({length:3},()=>Pn(t)));return St(n,t)}async function Pn(e){let t={};for(let r of e)try{let n=await navigator.permissions.query({name:r});t[r]=n.state.toString()}catch{}return t}async function Ye(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let r=navigator.plugins[t];e.push([r.name,r.filename,r.description].join("|"))}return new Promise(t=>{t({plugins:e})})}function Q(){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+)+)/],r={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(let n of t){let o=e.match(n);if(o){let i=o.groups?.name,a=o.groups?.version||o.groups?.version1||o.groups?.version2;if(!i&&(o.groups?.version1||o.groups?.version2)&&(i="Safari"),!i&&n.source.includes("Opera Mini")&&(i="Opera Mini"),!i&&n.source.includes("Opera Mobi")&&(i="Opera Mobi"),!i&&n.source.includes("Opera")&&(i="Opera"),!i&&o[1]&&(i=o[1]),!a&&o[2]&&(a=o[2]),i)return{name:r[i.toLowerCase()]||i,version:a||"unknown"}}}return{name:"unknown",version:"unknown"}}function ue(){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 Xe(){return new Promise(e=>{let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:kn()};ue()&&navigator.maxTouchPoints>0&&(t.resolution=xn()),e(t)})}function xn(){let e=window.screen.width,t=window.screen.height,r=Math.max(e,t).toString(),n=Math.min(e,t).toString();return`${r}x${n}`}function kn(){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(r=>{t[r].forEach(n=>{matchMedia(`(${r}: ${n})`).matches&&e.push(`${r}: ${n}`)})}),e}function Je(){return new Promise(e=>{let t=Q(),r=navigator.userAgent,n={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:ue(),applePayVersion:Nn(),cookieEnabled:window.navigator.cookieEnabled};e(n)})}function Nn(){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 Mn=Q().name!=="SamsungBrowser"?1:3,D,h=null;function Ln(){typeof document<"u"&&(D=document.createElement("canvas"),D.width=200,D.height=100,h=D.getContext("webgl"))}async function Ze(){Ln();try{if(!h)throw new Error("WebGL not supported");let e=Array.from({length:Mn},()=>Cn()),t=ie(e,D.width,D.height);return{commonPixelsHash:O(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function Cn(){try{if(!h)throw new Error("WebGL not supported");let e=`
|
|
1
|
+
"use strict";var Ce=Object.defineProperty;var wn=Object.getOwnPropertyDescriptor;var Rn=Object.getOwnPropertyNames;var vn=Object.prototype.hasOwnProperty;var bn=(e,t)=>{for(var n in t)Ce(e,n,{get:t[n],enumerable:!0})},Tn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rn(t))!vn.call(e,o)&&o!==n&&Ce(e,o,{get:()=>t[o],enumerable:!(r=wn(t,o))||r.enumerable});return e};var An=e=>Tn(Ce({},"__esModule",{value:!0}),e);var po={};bn(po,{LanguageCodes:()=>Q,QualityQuestionsRespondentTypes:()=>W,SecurityAPIError:()=>pn,checkQualityQuestions:()=>Se,default:()=>ho,getQualityQuestions:()=>De,getSecurityResult:()=>Ae,getSecurityToken:()=>Oe,init:()=>In,isAIUsageDetected:()=>_e});module.exports=An(po);function On(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function Dn(e,t,n,r){let o=document,i="securitypolicyviolation",s,a=m=>{let u=new URL(e,location.href),{blockedURI:l}=m;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(s=m,c())};o.addEventListener(i,a);let c=()=>o.removeEventListener(i,a);return r?.then(c,c),Promise.resolve().then(t).then(m=>(c(),m),m=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),s)return n(s);throw m}))}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 Sn={default:"endpoint"},_n={default:"tlsEndpoint"},Pn="Client timeout",kn="Network connection error",xn="Network request aborted",Nn="Response cannot be parsed",Fe="Blocked by CSP",Ue="The endpoint parameter is not a valid URL",Mn="Handle on demand agent data error",Ln=F("WrongRegion"),Cn=F("SubscriptionNotActive"),Fn=F("UnsupportedVersion"),Un=F("InstallationMethodRestricted"),Bn=F("HostnameRestricted"),qn=F("IntegrationFailed"),Kn=F("NetworkRestricted"),Gn=F("InvalidProxyIntegrationSecret"),Vn=F("InvalidProxyIntegrationHeaders"),jn=F("ProxyIntegrationSecretEnvironmentMismatch"),Be="API key required",Et="API key not found",It="API key expired",Qn="Request cannot be parsed",Wn="Request failed",$n="Request failed to process",zn="Too many requests, rate limit exceeded",Yn="Not available for this origin",Jn="Not available with restricted header",Xn=Be,Zn=Et,Hn=It,er="3.12.0",ae="Failed to load the JS script of the agent",qe="9319";function tr(e,t){let n=[],[r,o]=function(a){let c=function(l){let h=[...l];return{current:()=>h[0],postpone(){let E=h.shift();E!==void 0&&h.push(E)},exclude(){h.shift()}}}(a),m=function(l,h){let E=0;return()=>Math.random()*Math.min(h,l*Math.pow(2,E++))}(100,3e3),u=new Set;return[c.current(),(l,h)=>{let E,y=h instanceof Error?h.message:"";if(y===Fe||y===Ue)c.exclude(),E=0;else if(y===qe)c.exclude();else if(y===ae){let I=Date.now()-l.getTime()<50,g=c.current();g&&I&&!u.has(g)&&(u.add(g),E=0),c.postpone()}else c.postpone();let f=c.current();return f===void 0?void 0:[f,E??l.getTime()+m()-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,m=l=>n.push({url:a,startedAt:c,finishedAt:new Date,error:l}),u=t(a);return u.then(()=>m(),m),u.catch(l=>{if(i!=null||(i=l),n.length>=5)throw i;let h=o(c,l);if(!h)throw i;let[E,y]=h;return(f=y,new Promise(I=>setTimeout(I,f))).then(()=>s(E));var f})};return s(r).then(a=>[a,n])}var wt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",nr=wt;function rr(e){var t,n;let{picked:r,rest:o}=function(u,l){let h={},E={};for(let[y,f]of Object.entries(u))l.includes(y)?h[y]=f:E[y]=f;return{picked:h,rest:E}}(e,["scriptUrlPattern","token","apiKey"]),i=r.token,s=(t=r.apiKey)!==null&&t!==void 0?t:i,a=(n=On(e,"scriptUrlPattern"))!==null&&n!==void 0?n:wt,[c,m]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},h=function(E,y,f,I){return E.addEventListener(y,f,I),()=>E.removeEventListener(y,f,I)}(document,"visibilitychange",l);return l(),[u,h]}();return Promise.resolve().then(()=>{if(!s||typeof s!="string")throw new Error(Be);let u=function(l,h){return(Array.isArray(l)?l:[l]).map(E=>function(y,f){let I=encodeURIComponent;return y.replace(/<[^<>]+>/g,g=>g==="<version>"?"3":g==="<apiKey>"?I(f):g==="<loaderVersion>"?I(er):g)}(String(E),h))}(a,s);return tr(u,or)}).catch(u=>{throw m(),function(l){return l instanceof Error&&l.message===qe?new Error(ae):l}(u)}).then(([u,l])=>(m(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function or(e){return Dn(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(ir)}function ir(){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:rr,defaultScriptUrlPattern:nr,ERROR_SCRIPT_LOAD_FAIL:ae,ERROR_API_KEY_EXPIRED:It,ERROR_API_KEY_INVALID:Et,ERROR_API_KEY_MISSING:Be,ERROR_BAD_REQUEST_FORMAT:Qn,ERROR_BAD_RESPONSE_FORMAT:Nn,ERROR_CLIENT_TIMEOUT:Pn,ERROR_CSP_BLOCK:Fe,ERROR_FORBIDDEN_ENDPOINT:Bn,ERROR_FORBIDDEN_HEADER:Jn,ERROR_FORBIDDEN_ORIGIN:Yn,ERROR_GENERAL_SERVER_FAILURE:Wn,ERROR_HANDLE_AGENT_DATA:Mn,ERROR_INSTALLATION_METHOD_RESTRICTED:Un,ERROR_INTEGRATION_FAILURE:qn,ERROR_INVALID_ENDPOINT:Ue,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Vn,ERROR_INVALID_PROXY_INTEGRATION_SECRET:Gn,ERROR_NETWORK_ABORT:xn,ERROR_NETWORK_CONNECTION:kn,ERROR_NETWORK_RESTRICTED:Kn,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:jn,ERROR_RATE_LIMIT:zn,ERROR_SERVER_TIMEOUT:$n,ERROR_SUBSCRIPTION_NOT_ACTIVE:Cn,ERROR_TOKEN_EXPIRED:Hn,ERROR_TOKEN_INVALID:Zn,ERROR_TOKEN_MISSING:Xn,ERROR_UNSUPPORTED_VERSION:Fn,ERROR_WRONG_REGION:Ln,defaultEndpoint:Sn,defaultTlsEndpoint:_n};var O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function Rt(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}var Ke,sr=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(sr)}var ar=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ve={randomUUID:ar};function cr(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 Rt(r)}var H=cr;var ur={UNAUTHORIZED:"Unauthorized"},lr={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},vt={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"},Ot={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},R={...ur,...lr,...vt,...bt,...Tt,...At,...Ot},Dt={...vt,...bt,...Tt,...At,...Ot};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=(w=>(w.GeneralConsumer="general-consumer",w.HRManagerDirector="hr-manager-director",w.WebDeveloper="web-developer",w.SoftwareEngineer="software-engineer",w.ITDirector="it-director",w.BusinessAdministrator="business-administrator",w.AccountsPayableManager="accounts-payable-manager",w.Accountant="accountant",w.FinanceDirector="finance-director",w.SmallBusinessOwner="small-business-owner",w.GeneralContractor="general-contractor",w.MarketingManagerDirector="marketing-manager-director",w.ConsumerShopper="consumer-shopper",w.Travel="travel",w.Entertainment="entertainment",w.FinanceAndBanking="finance-and-banking",w.General="general",w.B2BWhiteCollar="b2b-white-collar",w.B2BBlueCollar="b2b-blue-collar",w.Lawyer="lawyer",w))(W||{});var $={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},Uo={...$},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 mr()}async function mr(){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 m;i.oncomplete=u=>{m=u.renderedBuffer.getChannelData(0),t({sampleHash:dr(m),maxChannels:i.destination.maxChannelCount,channelCountMode:s.channelCountMode})},i.startRendering()}catch(r){console.error("Error creating audio fingerprint:",r),n(r)}})}function dr(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(fr(a))}let o=r,i=new Uint8ClampedArray(o);return new ImageData(i,t,n)}function fr(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 hr(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 S=new Uint32Array([597399067,2869860233,951274213,2716044179]);function L(e,t){return e<<t|e>>>32-t}function pr(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],S[0]),i[0]=L(i[0],15),i[0]=Math.imul(i[0],S[1]),t[0]=t[0]^i[0],t[0]=L(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],S[1]),i[1]=L(i[1],16),i[1]=Math.imul(i[1],S[2]),t[1]=t[1]^i[1],t[1]=L(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],S[2]),i[2]=L(i[2],17),i[2]=Math.imul(i[2],S[3]),t[2]=t[2]^i[2],t[2]=L(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],S[3]),i[3]=L(i[3],18),i[3]=Math.imul(i[3],S[0]),t[3]=t[3]^i[3],t[3]=L(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function gr(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],S[3]),o[3]=L(o[3],18),o[3]=Math.imul(o[3],S[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],S[2]),o[2]=L(o[2],17),o[2]=Math.imul(o[2],S[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],S[1]),o[1]=L(o[1],16),o[1]=Math.imul(o[1],S[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],S[0]),o[0]=L(o[0],15),o[0]=Math.imul(o[0],S[1]),t[0]=t[0]^o[0]}}function yr(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 D(e,t=0){if(t=t?t|0:0,typeof e=="string"&&(e=hr(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([t,t,t,t]);pr(e,n),gr(e,n),yr(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}var Er=3,St=280,_t=20;async function We(){return Ir()}function Ir(){return new Promise(e=>{let t=Array.from({length:Er},()=>wr()),n=ce(t,St,_t);e({commonPixelsHash:D(n.data.toString()).toString()})})}function wr(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=St,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 Rr(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 Rr(e,t){return new Promise(n=>setTimeout(n,e,t))}var vr=["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"],br=["monospace","sans-serif","serif"];async function $e(e){return Tr()}function Tr(){return new Promise((e,t)=>{try{le(async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d"),i=br.map(a=>Pt(o,a)),s={};vr.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:Ar(),architecture:Or(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:r.jsHeapSizeLimit||0})})}function Ar(){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 Or(){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:Dr(),timezone:Sr()})})}function Dr(){let e=[];return navigator.language}function Sr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var me=(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:me(Math.asin,-1,1,97),cos:me(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:me(Math.sin,-Math.PI,Math.PI,97),tan:me(Math.tan,0,2*Math.PI,97)})})}function _r(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=_r(o);i&&(n[r]=i)}),n}var Pr=["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||Pr,r=await Promise.all(Array.from({length:3},()=>kr(t)));return kt(r,t)}async function kr(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 de(){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:Nr()};de()&&navigator.maxTouchPoints>0&&(t.resolution=xr()),e(t)})}function xr(){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 Nr(){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:de(),applePayVersion:Mr(),cookieEnabled:window.navigator.cookieEnabled};e(r)})}function Mr(){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 Lr=z().name!=="SamsungBrowser"?1:3,_,p=null;function Cr(){typeof document<"u"&&(_=document.createElement("canvas"),_.width=200,_.height=100,p=_.getContext("webgl"))}async function tt(){Cr();try{if(!p)throw new Error("WebGL not supported");let e=Array.from({length:Lr},()=>Fr()),t=ce(e,_.width,_.height);return{commonPixelsHash:D(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function Fr(){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
|
-
`,r=h.createShader(h.VERTEX_SHADER),n=h.createShader(h.FRAGMENT_SHADER);if(!r||!n)throw new Error("Failed to create shaders");if(h.shaderSource(r,e),h.shaderSource(n,t),h.compileShader(r),!h.getShaderParameter(r,h.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+h.getShaderInfoLog(r));if(h.compileShader(n),!h.getShaderParameter(n,h.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+h.getShaderInfoLog(n));let o=h.createProgram();if(!o)throw new Error("Failed to create shader program");if(h.attachShader(o,r),h.attachShader(o,n),h.linkProgram(o),!h.getProgramParameter(o,h.LINK_STATUS))throw new Error("Shader program linking failed: "+h.getProgramInfoLog(o));h.useProgram(o);let i=137,a=new Float32Array(i*4),s=2*Math.PI/i;for(let d=0;d<i;d++){let y=d*s;a[d*4]=0,a[d*4+1]=0,a[d*4+2]=Math.cos(y)*(D.width/2),a[d*4+3]=Math.sin(y)*(D.height/2)}let c=h.createBuffer();h.bindBuffer(h.ARRAY_BUFFER,c),h.bufferData(h.ARRAY_BUFFER,a,h.STATIC_DRAW);let m=h.getAttribLocation(o,"position");h.enableVertexAttribArray(m),h.vertexAttribPointer(m,2,h.FLOAT,!1,0,0),h.viewport(0,0,D.width,D.height),h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT),h.drawArrays(h.LINES,0,i*2);let u=new Uint8ClampedArray(D.width*D.height*4);return h.readPixels(0,0,D.width,D.height,h.RGBA,h.UNSIGNED_BYTE,u),new ImageData(u,D.width,D.height)}catch{return new ImageData(1,1)}finally{h&&(h.bindBuffer(h.ARRAY_BUFFER,null),h.useProgram(null),h.viewport(0,0,h.drawingBufferWidth,h.drawingBufferHeight),h.clearColor(0,0,0,0))}}function _(e){let t=[];return function r(n){if(n&&n.toJSON&&typeof n.toJSON=="function"&&(n=n.toJSON()),n===void 0)return;if(typeof n=="number")return isFinite(n)?""+n:"null";if(typeof n!="object")return JSON.stringify(n);let o,i;if(Array.isArray(n)){for(i="[",o=0;o<n.length;o++)o&&(i+=","),i+=r(n[o])||"null";return i+"]"}if(n===null)return"null";if(t.indexOf(n)!==-1)throw new TypeError("Converting circular structure to JSON");let a=t.push(n)-1,s=Object.keys(n).sort();for(i="",o=0;o<s.length;o++){let c=s[o],m=r(n[c]);m&&(i&&(i+=","),i+=JSON.stringify(c)+":"+m)}return t.splice(a,1),"{"+i+"}"}(e)||""}async function He(){return new Promise(e=>{try{let t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t){e({supported:!1,error:"WebRTC not supported"});return}let r={iceCandidatePoolSize:1,iceServers:[]},n=new t(r);n.createDataChannel(""),(async()=>{try{let i={offerToReceiveAudio:!0,offerToReceiveVideo:!0},a=await n.createOffer(i);await n.setLocalDescription(a);let s=a.sdp||"",c=[...new Set((s.match(/extmap:\d+ [^\n\r]+/g)||[]).map(f=>f.replace(/extmap:\d+ /,"")))].sort(),m=f=>{let w=s.match(new RegExp(`m=${f} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},u=(f,w)=>w.map(p=>{let b=new RegExp(`(rtpmap|fmtp|rtcp-fb):${p} (.+)`,"g"),S=[...s.matchAll(b)];if(!S.length)return null;let I={};return S.forEach(_e=>{let[po,Pe,xe]=_e,ke=xe.split("/");Pe==="rtpmap"?(I.mimeType=`${f}/${ke[0]}`,I.clockRate=+ke[1],f==="audio"&&(I.channels=+ke[2]||1)):Pe==="rtcp-fb"?(I.feedbackSupport=I.feedbackSupport||[],I.feedbackSupport.push(xe)):Pe==="fmtp"&&(I.sdpFmtpLine=xe)}),I}).filter(Boolean),l=u("audio",m("audio")),d=u("video",m("video")),y={audio:{count:l.length,hash:O(_(l))},video:{count:d.length,hash:O(_(d))},extensionsHash:O(_(c))},E=await new Promise(f=>{let w=setTimeout(()=>{n.removeEventListener("icecandidate",p),n.close(),f({supported:!0,...y,timeout:!0})},3e3),p=b=>{let S=b.candidate;!S||!S.candidate||(clearTimeout(w),n.removeEventListener("icecandidate",p),n.close(),f({supported:!0,...y,candidateType:S.type||""}))};n.addEventListener("icecandidate",p)});e({details:E,hash:O(_(E))})}catch(i){n.close(),e({supported:!0,error:`WebRTC offer failed: ${i.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}})}var _t=["\u{1D504}","\u{1D505}","\u212D","\u{1D507}","\u{1D508}","\u{1D509}","\u{1D538}","\u{1D539}","\u2102","\u{1D53B}","\u{1D53C}","\u{1D53D}"],Pt=["\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 et(){return new Promise(e=>{try{ae(async({iframe:t})=>{try{if(!Fn(t)){e({supported:!1,error:"MathML not supported"});return}let r=[J("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>"),J("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>"),J("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>"),Un(),...Bn()],n=[],o="";r.forEach((a,s)=>{let c=qn(a,t);n.push({width:c.dimensions.width,height:c.dimensions.height}),s===0&&c.fontInfo&&(o=O(_(c.fontInfo)))});let i={fontStyleHash:o,dimensions:n};e({details:i,hash:O(_(i))})}catch(r){e({supported:!1,error:`MathML error: ${r.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function Fn(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 r=t.getBoundingClientRect();return e.body.removeChild(t),r.width>0&&r.height>0}catch{return!1}}function J(e,t){return`<math><mrow>${t}</mrow></math>`}function Un(){let e="<mo>\u220F</mo>";return _t.forEach((t,r)=>{let n=r*2,o=Pt.slice(n,n+2);o.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`)}),J("complex_nested",`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function Bn(){let e=[];return _t.forEach((t,r)=>{let n=r*2,o=Pt.slice(n,n+2);o.length===2&&e.push(J("combined",`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`))}),e}function qn(e,t){try{let r=t.createElement("math");r.innerHTML=e.replace(/<\/?math>/g,""),r.style.whiteSpace="nowrap",r.style.position="absolute",r.style.visibility="hidden",r.style.top="-9999px",t.body.appendChild(r);let n=r.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(r),a={dimensions:{width:n.width,height:n.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(r),a}catch(r){return{error:r.message}}}var Kn=800;async function tt(){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,r=null,n=a=>{if(!t){t=!0,r&&clearTimeout(r);try{let s=a.map(m=>{let u=d=>d.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(m.voiceURI||""),u(m.name||""),u(m.lang||""),m.localService?"1":"0",m.default?"1":"0"].join(",")});s.sort();let c={voiceCount:a.length,voicesHash:O(_(s))};e({details:c,hash:O(_(c))})}catch(s){e({supported:!0,error:`Voice processing failed: ${s.message}`})}}},o=window.speechSynthesis.getVoices();if(o.length>0){n(o);return}r=setTimeout(()=>{let a=window.speechSynthesis.getVoices();n(a)},Kn);let i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);let a=window.speechSynthesis.getVoices();n(a)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}})}var xt={audio:Ge,canvas:Ve,fonts:je,hardware:We,locales:Qe,math:$e,permissions:ze,plugins:Ye,screen:Xe,system:Je,webgl:Ze},kt={webrtc:He,mathml:et,speech:tt},rt={},Nt={timeout:"true"},nt=(e,t,r)=>{rt[e]=t};function Gn(e,t){return new Promise(r=>{setTimeout(()=>r(t),e)})}function Mt(e,t,r){return Promise.all(e.map(n=>{let o=performance.now();return Promise.race([n.then(i=>({value:i,elapsed:performance.now()-o})),Gn(t,r).then(i=>({value:i,elapsed:performance.now()-o}))])}))}function le(e,t){let r=Q();if(r.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 d=l;r={name:d.name||"unknown",version:d.version||"unknown"}}}let n=r.name.toLowerCase(),o=r.version.split(".")[0]||"0",i=parseInt(o,10),a=[...t?.exclude||[]],s=t?.stabilize||[],c=t?.include||[];for(let u of s){let l=Ke[u];if(l)for(let d of l){let y=!("browsers"in d),E=!y&&d.browsers?.some(f=>{let w=f.match(/(.+?)(>=)(\d+)/);if(w){let[,p,,b]=w,S=parseInt(b,10);return n===p&&i>=S}return n===f});(y||E)&&a.push(...d.exclude)}}function m(u,l=""){let d={};for(let[y,E]of Object.entries(u)){let f=l?`${l}.${y}`:y;if(typeof E=="object"&&!Array.isArray(E)&&E!==null){let w=m(E,f);Object.keys(w).length>0&&(d[y]=w)}else{let w=a.some(b=>f.startsWith(b)),p=c.some(b=>f.startsWith(b));(!w||p)&&(d[y]=E)}}return d}return m(e)}async function ot(e){let t={...W,...e},r=t.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,n={...xt,...rt},{elapsed:o,resolvedComponents:i}=await Lt(n,t),a={},s={};if(r||t.experimental){let{elapsed:w,resolvedComponents:p}=await Lt(kt,t);a=p,s=w}let c={...o,...s},m=t.performance?{elapsed:c}:{},u=le({},t),l={...i,...u},d={};return{thumbmark:O(_(l)),components:l,info:d,version:"",...m,...Object.keys(a).length>0&&t.experimental&&{experimental:a}}}async function Lt(e,t){let r={...W,...t},n=Object.entries(e).filter(([u])=>!r?.exclude?.includes(u)).filter(([u])=>r?.include?.some(l=>l.includes("."))?r?.include?.some(l=>l.startsWith(u)):r?.include?.length===0||r?.include?.includes(u)),o=n.map(([u])=>u),i=n.map(([u,l])=>l(t)),a=await Mt(i,r?.timeout||5e3,Nt),s={},c={};a.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,s[o[l]]=u.elapsed??0)});let m=le(c,r);return{elapsed:s,resolvedComponents:m}}var Z=class{options;constructor(t){this.options={...W,...t}}async get(t){let r={...this.options,...t};return ot(r)}getVersion(){return""}includeComponent(t,r){nt(t,r)}};var Vn=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),jn=async(e,t)=>{if(!e.ok){let r=await e.text();throw new Error(r)}return t==="file"?e.blob():t==="json"?e.json():t==="text"?e.text():null},Ct=async({url:e,auth:t,body:r,method:n="GET",headers:o={},responseType:i="json"})=>{let a={method:n,headers:Vn(t,o),...r?{body:r instanceof FormData?r:JSON.stringify(r)}:{}},s=await fetch(e,a);return jn(s,i)},it=e=>Ct({...e,method:"GET"}),me=e=>Ct({...e,method:"POST"});function Ft(e){let t=e?.qbc||!1,r=e?.mas||!1,n=e?.apd||!1,o=e?.scb||null,i=0,a=()=>{t=!1,r=!1,n=!1,o=void 0,i=0},s=()=>{let l=window?.getSelection()?.toString();l&&l.length>0&&(i=Date.now(),t=!0)},c=u=>{let l=u.clipboardData?.getData("text"),d=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&d&&(n=!0)},m=()=>{r=!0;let u=Date.now();if(i){let l=(u-i)/1e3;(o===void 0||l<o)&&(o=l)}};return document?.addEventListener("copy",s),document?.addEventListener("paste",c),window?.addEventListener("blur",m),{get qbc(){return t},get mas(){return r},get apd(){return n},get scb(){return o},reset:a,destroy(){document?.removeEventListener("copy",s),document?.removeEventListener("paste",c),window?.removeEventListener("blur",m)}}}var L=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 C=typeof window>"u"||"Deno"in globalThis;function P(){}function qt(e,t){return typeof e=="function"?e(t):e}function Kt(e){return typeof e=="number"&&e>=0&&e!==1/0}function Gt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function at(e,t){return typeof e=="function"?e(t):e}function Vt(e,t){return typeof e=="function"?e(t):e}function ct(e,t){let{type:r="all",exact:n,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==H(a,t.options))return!1}else if(!z(t.queryKey,a))return!1}if(r!=="all"){let c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function ut(e,t){let{exact:r,status:n,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if($(t.options.mutationKey)!==$(i))return!1}else if(!z(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function H(e,t){return(t?.queryKeyHashFn||$)(e)}function $(e){return JSON.stringify(e,(t,r)=>st(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}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(r=>!z(e[r],t[r])):!1}function jt(e,t){if(e===t)return e;let r=Ut(e)&&Ut(t);if(r||st(e)&&st(t)){let n=r?e:Object.keys(e),o=n.length,i=r?t:Object.keys(t),a=i.length,s=r?[]:{},c=0;for(let m=0;m<a;m++){let u=r?m:i[m];(!r&&n.includes(u)||r)&&e[u]===void 0&&t[u]===void 0?(s[u]=void 0,c++):(s[u]=jt(e[u],t[u]),s[u]===e[u]&&e[u]!==void 0&&c++)}return o===a&&c===o?e:s}return t}function Ut(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function st(e){if(!Bt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(!Bt(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wt(e){return new Promise(t=>{setTimeout(t,e)})}function Qt(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?jt(e,t):t}function $t(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function zt(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var ee=Symbol();function de(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ee?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Wn=class extends L{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!C&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=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"}},fe=new Wn;var Qn=class extends L{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!C&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},Y=new Qn;function Yt(){let e,t,r=new Promise((o,i)=>{e=o,t=i});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}function $n(e){return Math.min(1e3*2**e,3e4)}function lt(e){return(e??"online")==="online"?Y.isOnline():!0}var Xt=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function he(e){return e instanceof Xt}function pe(e){let t=!1,r=0,n=!1,o,i=Yt(),a=f=>{n||(d(new Xt(f)),e.abort?.())},s=()=>{t=!0},c=()=>{t=!1},m=()=>fe.isFocused()&&(e.networkMode==="always"||Y.isOnline())&&e.canRun(),u=()=>lt(e.networkMode)&&e.canRun(),l=f=>{n||(n=!0,e.onSuccess?.(f),o?.(),i.resolve(f))},d=f=>{n||(n=!0,e.onError?.(f),o?.(),i.reject(f))},y=()=>new Promise(f=>{o=w=>{(n||m())&&f(w)},e.onPause?.()}).then(()=>{o=void 0,n||e.onContinue?.()}),E=()=>{if(n)return;let f,w=r===0?e.initialPromise:void 0;try{f=w??e.fn()}catch(p){f=Promise.reject(p)}Promise.resolve(f).then(l).catch(p=>{if(n)return;let b=e.retry??(C?0:3),S=e.retryDelay??$n,I=typeof S=="function"?S(r,p):S,_e=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,p);if(t||!_e){d(p);return}r++,e.onFail?.(r,p),Wt(I).then(()=>m()?void 0:y()).then(()=>{t?d(p):E()})})};return{promise:i,cancel:a,continue:()=>(o?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?E():y().then(E),i)}}function zn(){let e=[],t=0,r=s=>{s()},n=s=>{s()},o=s=>setTimeout(s,0),i=s=>{t?e.push(s):o(()=>{r(s)})},a=()=>{let s=e;e=[],s.length&&o(()=>{n(()=>{s.forEach(c=>{r(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||a()}return c},batchCalls:s=>(...c)=>{i(()=>{s(...c)})},schedule:i,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{o=s}}}var R=zn();var ge=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Kt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(C?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var Jt=class extends ge{#e;#t;#r;#n;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Xn(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){let r=Qt(this.state.data,e,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(P).catch(P):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Vt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ee||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||!Gt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#n&&(this.#i?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.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.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){let s=this.observers.find(c=>c.options.queryFn);s&&this.setOptions(s.options)}let r=new AbortController,n=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#i=!0,r.signal)})},o=()=>{let s=de(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return n(c),this.#i=!1,this.options.persister?this.options.persister(s,c,this):s(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};n(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 a=s=>{he(s)&&s.silent||this.#o({type:"error",error:s}),he(s)||(this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#n=pe({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(c){a(c);return}this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,c)=>{this.#o({type:"failed",failureCount:s,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.#n.start()}#o(e){let t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Yn(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;return he(n)&&n.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),R.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Yn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xn(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var te=class extends L{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let n=t.queryKey,o=t.queryHash??H(n,t),i=this.get(o);return i||(i=new Jt({cache:this,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),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(){R.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(r=>ct(t,r))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(r=>ct(e,r)):t}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){R.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){R.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};var Zt=class extends ge{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Jn(),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.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=pe({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(n,o)=>{this.#n({type:"failed",failureCount:n,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({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",r=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);let o=await this.options.onMutate?.(e);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:r})}let n=await this.#r.start();return await this.#t.config.onSuccess?.(n,e,this.state.context,this),await this.options.onSuccess?.(n,e,this.state.context),await this.#t.config.onSettled?.(n,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(n,null,e,this.state.context),this.#n({type:"success",data:n}),n}catch(n){try{throw await this.#t.config.onError?.(n,e,this.state.context,this),await this.options.onError?.(n,e,this.state.context),await this.#t.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,n,e,this.state.context),n}finally{this.#n({type:"error",error:n})}}finally{this.#t.runNext(this)}}#n(e){let t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),R.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Jn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var re=class extends L{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){let n=new Zt({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);let t=ye(e);if(typeof t=="string"){let r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){let t=ye(e);if(typeof t=="string"){let r=this.#t.get(t);if(r)if(r.length>1){let n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=ye(e);if(typeof t=="string"){let n=this.#t.get(t)?.find(o=>o.state.status==="pending");return!n||n===e}else return!0}runNext(e){let t=ye(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){R.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(r=>ut(t,r))}findAll(e={}){return this.getAll().filter(t=>ut(e,t))}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(t=>t.state.isPaused);return R.batch(()=>Promise.all(e.map(t=>t.continue().catch(P))))}};function ye(e){return e.options.scope?.id}function mt(e){return{onFetch:(t,r)=>{let n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,m=async()=>{let u=!1,l=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=de(t.options,t.fetchOptions),y=async(E,f,w)=>{if(u)return Promise.reject();if(f==null&&E.pages.length)return Promise.resolve(E);let p={queryKey:t.queryKey,pageParam:f,direction:w?"backward":"forward",meta:t.options.meta};l(p);let b=await d(p),{maxPages:S}=t.options,I=w?zt:$t;return{pages:I(E.pages,b,S),pageParams:I(E.pageParams,f,S)}};if(o&&i.length){let E=o==="backward",f=E?Zn:Ht,w={pages:i,pageParams:a},p=f(n,w);s=await y(w,p,E)}else{let E=e??i.length;do{let f=c===0?a[0]??n.initialPageParam:Ht(n,s);if(c>0&&f==null)break;s=await y(s,f),c++}while(c<E)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=m}}}function Ht(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Zn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var dt=class{#e;#t;#r;#n;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new te,this.#t=e.mutationCache||new re,this.#r=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=fe.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),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(at(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{let n=r.data;return[t,n]})}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(n.queryHash)?.state.data,a=qt(t,i);if(a!==void 0)return this.#e.build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return R.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;R.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){let r=this.#e,n={type:"active",...e};return R.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(n,t)))}cancelQueries(e,t={}){let r={revert:!0,...t},n=R.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(P).catch(P)}invalidateQueries(e,t={}){return R.batch(()=>{if(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none")return Promise.resolve();let r={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0},n=R.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,r);return r.throwOnError||(i=i.catch(P)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(P)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let r=this.#e.build(this,t);return r.isStaleByTime(at(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(P).catch(P)}fetchInfiniteQuery(e){return e.behavior=mt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(P).catch(P)}ensureInfiniteQueryData(e){return e.behavior=mt(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.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set($(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#n.values()],r={};return t.forEach(n=>{z(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#s.set($(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#s.values()],r={};return t.forEach(n=>{z(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=H(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===ee&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var Hn=new dt({defaultOptions:{queries:{staleTime:3e4}},queryCache:new te({onError:(e,t)=>{}}),mutationCache:new re}),er=Hn;var eo=[{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||"",r=e.includes("Mac")&&t.includes("Linux")||e.includes("Win")&&t.includes("Mac")||t===""||t==="Unknown";return{value:t,triggered:r}}},{name:"webglSoftwareRenderer",weight:2,async check(){let e=null,t=null,r=!1;try{let n=document.createElement("canvas"),o=n.getContext("webgl")||n.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 a=t.toLowerCase(),s=e.toLowerCase();r=a.includes("swiftshader")||a.includes("llvmpipe")||a.includes("softwar")||a.includes("basic render")||a.includes("vmware")||a.includes("virtualbox")||s.includes("vmware")||s.includes("parallels")}}}catch{}return{value:{vendor:e,renderer:t},triggered:r}}},{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(n=>setTimeout(n,50));let t=performance.now()-e,r=t<30||t>80;return{value:t.toFixed(2),triggered:r}}},{name:"timerJitter",weight:1,async check(){let e=[];for(let n=0;n<10;n++){let o=performance.now();await new Promise(a=>setTimeout(a,10));let i=performance.now();e.push(i-o)}let t=Math.sqrt(e.map(n=>(n-10)**2).reduce((n,o)=>n+o)/e.length),r=t>5;return{value:t.toFixed(3),triggered:r}}},{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 n=(await e.startRendering()).getChannelData(0).reduce((i,a)=>i+Math.abs(a),0),o=n<100;return{value:n,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 n=[...e.toDataURL()].reduce((i,a)=>(i+a.charCodeAt(0))%9999999,0);return{value:n,triggered:n===0||n===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(r=>r.label.toLowerCase().includes("virtual"));return{value:e.map(r=>r.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=r=>{if(!r||!r.candidate){e({value:"no candidate",triggered:!0});return}let n=r.candidate.candidate.toLowerCase(),o=n.includes("10.0.2.")||n.includes("172.16.")||n.includes("192.168.56.");e({value:n,triggered:o})},t.createOffer().then(r=>t.setLocalDescription(r))})}},{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 tr({threshold:e=6}={}){let t={},r=0;for(let n of eo){let o=await n.check();t[n.name]=o,o.triggered&&(r+=n.weight)}return{isLikelyVM:r>=e,score:r,threshold:e,signals:t}}var to=[{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 n=await navigator.userAgentData?.getHighEntropyValues?.(["platform","brands"]);t=JSON.stringify(n)}catch{}let r=e?.includes("Mac")&&t?.includes("Windows")||e?.includes("Win")&&t?.includes("Mac")||t&&t.length>0&&!e;return{value:{ua:e,brandInfo:t},triggered:r}}},{name:"timezoneLocaleMismatch",weight:1,async check(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=navigator.language||"",r=t.startsWith("en")&&e==="Asia/Shanghai"||t.startsWith("zh")&&e==="America/New_York"||e===void 0;return{value:{tz:e,lang:t},triggered:r}}},{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(),r=e();return{value:{a:t,b:r},triggered:t!==r}}},{name:"webglNoise",weight:2,async check(){try{let t=document.createElement("canvas").getContext("webgl");if(!t)return{value:"no-webgl",triggered:!0};let r=t.getExtension("WEBGL_debug_renderer_info");if(!r)return{value:"no-debug-extension",triggered:!1};let n=t.getParameter(r.UNMASKED_VENDOR_WEBGL),o=t.getParameter(r.UNMASKED_RENDERER_WEBGL),i=n===""||o===""||n?.includes(" ")===!1||o?.includes(" ")===!1;return{value:{v:n,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,r=window.devicePixelRatio,n=e===1920&&r===1&&t===1080||r%1!==0&&r%1!==.5;return{value:{w:e,h:t,dpr:r},triggered:n}}},{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,debuggerLatency:!1,consoleSpeed:!1},r=160,n=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(n>r||o>r)&&(t.viewportBreakpoint=!0);function i(c=200){let m=performance.now();debugger;return performance.now()-m>c}t.debuggerLatency=i();async function a(c=50){return new Promise(m=>{let u=performance.now();console.log("%c ","font-size:3000px");let l=performance.now();m(l-u>c)})}t.consoleSpeed=await a();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(),r=["incogniton","multilogin","morelogin","adspect","kameleo","goLogin"].some(n=>e?.includes(n));return{value:e,triggered:r}}}];async function rr({threshold:e=5}={}){let t={},r=0;for(let o of to){let i=await o.check();t[o.name]=i,i.triggered&&(r+=o.weight)}let n=Math.min(1,r/15);return{result:n>=.5||t.knownAntiDetectBrowser?.triggered,anomalyScore:n,antiDetectBrowser:t.knownAntiDetectBrowser?.triggered||!1,signals:t}}function ro(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function no(){let e=navigator.userAgent,t=ro();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 oo=[{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()),r=indexedDB.open(t,1);r.onupgradeneeded=n=>{let o=n.target.result;try{o.createObjectStore("t",{autoIncrement:!0}).put(new Blob),e({triggered:!1,value:"ok"})}catch(i){let a=i?.message??String(i);e({triggered:a.includes("are not yet supported"),value:a})}finally{o.close(),indexedDB.deleteDatabase(t)}},r.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 n=window?.performance?.memory?.jsHeapSizeLimit??1073741824;navigator.webkitTemporaryStorage.queryUsageAndQuota((o,i)=>{let a=Math.round(i/1048576),s=Math.round(n/(1024*1024))*2;e({triggered:a<s,value:{quotaMB:a,limitMB:s}})},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 nr(){let e=no(),t={},r=0;for(let n of oo){if(n.browser!==e)continue;let o=await n.check();t[n.name]=o,o.triggered&&(r+=n.weight)}return{isPrivate:r>0,browserName:e,score:r,signals:t}}typeof window<"u"&&(window.detectIncognito=nr);var or=nr;var ir="dtect_security_sdk_state",sr=typeof window<"u",ar={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Ee={state:{...ar},securityKeys:{behaviorKey:"",automationKey:""}};function cr(){if(!sr)return Ee;try{let e=sessionStorage.getItem(ir);if(!e)return Ee;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Ee:{state:{...ar,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:""}}}catch{return Ee}}function U(e){if(sr)try{let t=Date.now()+864e5,r={...e,expiresAt:t};sessionStorage.setItem(ir,JSON.stringify(r))}catch{}}function ur(e){return e.token||X()}var we,B="https://api.dtect.io/security",Ie=`${B}/client/check`,F="",K="",mr="0.0.18",dr,lr,io="20000000-aaaa-bbbb-cccc-000000000002",ve;var{state:g,securityKeys:{automationKey:k,behaviorKey:M}}=cr(),fr=Tt,ne;async function so({clientId:e,apiKey:t,endpoint:r}){if(De({automationKey:k,behaviorKey:M}))return{automationKey:k,behaviorKey:M};let n=await er.fetchQuery({queryKey:["getClientConfig",e,t],queryFn:()=>it({url:`${r}/client/config`,headers:{"client-id":F,"x-api-key":K}})});if(!De(n))throw new Error;return k=n.automationKey,M=n.behaviorKey,U({state:g,securityKeys:n}),n}function ft(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(v.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(v.RATE_LIMIT_REACHED);switch(e?.message){case G.ERROR_RATE_LIMIT:throw new Error(v.RATE_LIMIT_REACHED);default:throw new Error(v.INTERNAL_SERVER_ERROR)}}throw new Error(v.FAILED_TO_GET_SECURITY_TOKEN)}function q(){if(gr(g)&&De({automationKey:k,behaviorKey:M}))return!0;let e=Se(),t=document.querySelector("#dtect-h-captcha");return!!we&&!!(t||e)}function hr(){return!!(F&&K)}function ao(){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 co({behaviorKey:e}){if(we=await G.load({apiKey:e,endpoint:["https://fp.dtect.io",G.defaultEndpoint],scriptUrlPattern:["https://fp.dtect.io/web/v<version>/<apiKey>/loader_v<loaderVersion>.js",G.defaultScriptUrlPattern]}),Se()||(await ao(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:k,size:"invisible"})),!we)throw new Error(v.SDK_INIT_ERROR)}async function uo(){if(g.tokens)return g.tokens;let e=new Promise(o=>{let i=we?.get();o(i)}),t=new Promise(async o=>{Se()&&o({response:io});let a=await window?.hcaptcha?.execute({async:!0});o(a)}),[r,n]=await Promise.all([t,e]);return g.tokens={behaviorRequestId:n?.requestId,behaviorToken:n?.sealedResult,automationToken:r?.response},g.tokens}function lo(e){let t=e?.projectId,r=e?.visitorId||X();return(typeof e?.projectId=="number"||typeof e?.visitorId=="number")&&(t=`${e?.projectId}`,r=`${e?.visitorId}`),{visitorId:r,projectId:t}}function ht(e){if(g.projectId&&g.visitorId)return{visitorId:g.visitorId,projectId:g.projectId};let{projectId:t,visitorId:r}=lo(e);return{projectId:t,visitorId:r}}async function pr(e,t){if(!q())throw new Error(v.NOT_INITIALIZED);if(!hr())throw new Error(v.MISSING_CREDENTIALS);let{projectId:r,visitorId:n}=ht(e);if(g.projectId=r,g.visitorId=n,!e||!r?.trim())throw new Error(v.FAILED_TO_GET_SECURITY_RESULT);try{let o=await uo(),i=new Z,[a,s,c,m]=await Promise.allSettled([i.get(),tr(),rr(),or()]);if(o?.behaviorToken&&o?.behaviorRequestId&&o?.automationToken){let u={behaviorToken:o.behaviorToken,automationToken:o.automationToken,behaviorRequestId:o.behaviorRequestId,entryLink:window?.location?.href,securitySettings:e.securitySettings,metaData:e.metaData,vmDtectResults:s?.value,tamperingDtectResults:c?.value,incognitoDtectResults:m?.value,deviceIdResults:a?.value};g.clientData=u;let l={...e,projectId:r,visitorId:n,clientData:u,version:"0.0.18",token:g.token,questionData:g.questionData,aiCheckData:g.aiCheckData};lr=performance.now();let d=(lr-dr).toFixed(),y=await me({url:`${t}?clientId=${F}&diff=${d}`,body:{...l},headers:{"client-id":F,"x-api-key":K}});if("token"in y||"results"in y)return U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),y}throw new Error(v.INTERNAL_SERVER_ERROR)}catch(o){if(o instanceof Error){if(o?.message?.includes("maintenance_mode"))throw new Error(v.MAINTENANCE_MODE);if(o?.message?.includes("rate-limited")||o?.message?.includes("429"))throw new Error(v.RATE_LIMIT_REACHED);switch(o?.message){case G.ERROR_RATE_LIMIT:throw new Error(v.RATE_LIMIT_REACHED);default:throw new Error(v.INTERNAL_SERVER_ERROR)}}throw new Error(v.FAILED_TO_GET_SECURITY_RESULT)}}async function Re(e){return await pr(e,`${B}/client/check/result`)}async function be(e){return await pr(e,`${B}/client/check`)}async function Te(e){if(!q())throw new Error(v.NOT_INITIALIZED);let{respondentType:t,language:r}=e;try{let n=await it({url:`${B}/client/quality-questions/${t}/${r}`,headers:{"client-id":F,"x-api-key":K}});if(n)return n;throw new Error(v.INTERNAL_SERVER_ERROR)}catch(n){ft(n)}}async function Oe(e){if(!q())throw new Error(v.NOT_INITIALIZED);g.questionData||(g.questionData={questions:e.questions});let{visitorId:t,projectId:r}=ht(e);g.visitorId=t,g.projectId=r;try{let n=await me({url:Ie,headers:{"client-id":F,"x-api-key":K},body:{token:g.token,visitorId:t,projectId:r,version:mr,questionData:g.questionData,aiCheckData:g.aiCheckData,clientData:g.clientData}});if(n)return U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),n;throw new Error(v.INTERNAL_SERVER_ERROR)}catch(n){ft(n)}}async function Ae(e){if(!q())throw new Error(v.NOT_INITIALIZED);g.aiCheckData={timeTakenSeconds:e.timeTakenSeconds,qbc:e.qbc||ne.qbc,mas:e.mas||ne.mas,scb:e.scb||ne.scb,apd:e.apd||ne.apd};let{visitorId:t,projectId:r}=ht(e);g.visitorId=t,g.projectId=r;try{let n=await me({url:Ie,headers:{"client-id":F,"x-api-key":K},body:{token:g.token,visitorId:t,projectId:r,version:mr,clientData:g.clientData,questionData:g.questionData,aiCheckData:g.aiCheckData}});if(n)return U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),n;throw new Error(v.INTERNAL_SERVER_ERROR)}catch(n){ft(n)}}function mo(){let e=document.querySelector("head"),t=document.querySelector("body");if(!Se()){t?.insertAdjacentHTML("beforeend",'<div id="dtect-h-captcha" ></div>');let n=document.createElement("script");n.setAttribute("src","https://js.hcaptcha.com/1/api.js"),n.setAttribute("async","true"),n.setAttribute("defer","true"),e?.append(n)}}function De(e){return e?.automationKey&&e?.behaviorKey}function gr(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function yr(e){if(!e?.clientId||!e?.apiKey)throw new Error(v.MISSING_CREDENTIALS);dr=performance.now();let{clientId:t,apiKey:r,endpoint:n="https://api.dtect.io/security",includeResults:o}=e;B=n,Ie=`${B}/client/check`;let i=ur(g);if(g.isLoading){if(q())return ve;throw new Error(v.DUPLICATE_INITIALIZATION)}if(ne=Ft(g.aiCheckData),F=t,K=r,o&&(Ie=`${B}/client/check/result`),g={...g,isLoading:!0,token:i||""},gr(g)&&De({automationKey:k,behaviorKey:M}))return g={...g,isLoading:!1,token:i},U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),{getSecurityResult:Re,getSecurityToken:be,isAIUsageDetected:Ae,checkQualityQuestions:Oe,getQualityQuestions:Te,LanguageCodes:V,QualityQuestionsRespondentTypes:j};if(!hr())throw new Error(v.MISSING_CREDENTIALS);if(q())return ve;mo();try{let s=await so({clientId:t,apiKey:r,endpoint:n});if(q())throw new Error;return co({behaviorKey:s.behaviorKey}).then(()=>({getSecurityResult:Re,getSecurityToken:be,SecurityAPIError:fr,isAIUsageDetected:Ae,checkQualityQuestions:Oe,getQualityQuestions:Te,LanguageCodes:V,QualityQuestionsRespondentTypes:j})).catch(c=>{throw new Error(c.message)})}catch(s){if(s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(v.MAINTENANCE_MODE);if([v.INVALID_API_KEY,v.UNAUTHORIZED].includes(s?.message))throw new Error(v.INVALID_CREDENTIALS)}throw new Error(v.SDK_INIT_ERROR)}finally{g={...g,isLoading:!1,token:i},U({state:g,securityKeys:{automationKey:k,behaviorKey:M}})}}ve={init:yr,getSecurityResult:Re,getSecurityToken:be,isAIUsageDetected:Ae,checkQualityQuestions:Oe,getQualityQuestions:Te,QualityQuestionsRespondentTypes:j,LanguageCodes:V};var fo=ve;
|
|
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 h=0;h<i;h++){let E=h*a;s[h*4]=0,s[h*4+1]=0,s[h*4+2]=Math.cos(E)*(_.width/2),s[h*4+3]=Math.sin(E)*(_.height/2)}let c=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,c),p.bufferData(p.ARRAY_BUFFER,s,p.STATIC_DRAW);let m=p.getAttribLocation(o,"position");p.enableVertexAttribArray(m),p.vertexAttribPointer(m,2,p.FLOAT,!1,0,0),p.viewport(0,0,_.width,_.height),p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.LINES,0,i*2);let u=new Uint8ClampedArray(_.width*_.height*4);return p.readPixels(0,0,_.width,_.height,p.RGBA,p.UNSIGNED_BYTE,u),new ImageData(u,_.width,_.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],m=n(r[c]);m&&(i&&(i+=","),i+=JSON.stringify(c)+":"+m)}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(f=>f.replace(/extmap:\d+ /,"")))].sort(),m=f=>{let I=a.match(new RegExp(`m=${f} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return I?I[1].split(" "):[]},u=(f,I)=>I.map(g=>{let A=new RegExp(`(rtpmap|fmtp|rtcp-fb):${g} (.+)`,"g"),k=[...a.matchAll(A)];if(!k.length)return null;let w={};return k.forEach(xe=>{let[go,Ne,Me]=xe,Le=Me.split("/");Ne==="rtpmap"?(w.mimeType=`${f}/${Le[0]}`,w.clockRate=+Le[1],f==="audio"&&(w.channels=+Le[2]||1)):Ne==="rtcp-fb"?(w.feedbackSupport=w.feedbackSupport||[],w.feedbackSupport.push(Me)):Ne==="fmtp"&&(w.sdpFmtpLine=Me)}),w}).filter(Boolean),l=u("audio",m("audio")),h=u("video",m("video")),E={audio:{count:l.length,hash:D(N(l))},video:{count:h.length,hash:D(N(h))},extensionsHash:D(N(c))},y=await new Promise(f=>{let I=setTimeout(()=>{r.removeEventListener("icecandidate",g),r.close(),f({supported:!0,...E,timeout:!0})},3e3),g=A=>{let k=A.candidate;!k||!k.candidate||(clearTimeout(I),r.removeEventListener("icecandidate",g),r.close(),f({supported:!0,...E,candidateType:k.type||""}))};r.addEventListener("icecandidate",g)});e({details:y,hash:D(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(!Ur(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>"),Br(),...qr()],r=[],o="";n.forEach((s,a)=>{let c=Kr(s,t);r.push({width:c.dimensions.width,height:c.dimensions.height}),a===0&&c.fontInfo&&(o=D(N(c.fontInfo)))});let i={fontStyleHash:o,dimensions:r};e({details:i,hash:D(N(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function Ur(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 Br(){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 qr(){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 Kr(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 Gr=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(m=>{let u=h=>h.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(m.voiceURI||""),u(m.name||""),u(m.lang||""),m.localService?"1":"0",m.default?"1":"0"].join(",")});a.sort();let c={voiceCount:s.length,voicesHash:D(N(a))};e({details:c,hash:D(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)},Gr);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},Lt={webrtc:nt,mathml:rt,speech:ot},it={},Ct={timeout:"true"},st=(e,t,n)=>{it[e]=t};function Vr(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})),Vr(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 h=l;n={name:h.name||"unknown",version:h.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 h of l){let E=!("browsers"in h),y=!E&&h.browsers?.some(f=>{let I=f.match(/(.+?)(>=)(\d+)/);if(I){let[,g,,A]=I,k=parseInt(A,10);return r===g&&i>=k}return r===f});(E||y)&&s.push(...h.exclude)}}function m(u,l=""){let h={};for(let[E,y]of Object.entries(u)){let f=l?`${l}.${E}`:E;if(typeof y=="object"&&!Array.isArray(y)&&y!==null){let I=m(y,f);Object.keys(I).length>0&&(h[E]=I)}else{let I=s.some(A=>f.startsWith(A)),g=c.some(A=>f.startsWith(A));(!I||g)&&(h[E]=y)}}return h}return m(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:I,resolvedComponents:g}=await Ut(Lt,t);s=g,a=I}let c={...o,...a},m=t.performance?{elapsed:c}:{},u=fe({},t),l={...i,...u},h={};return{thumbmark:D(N(l)),components:l,info:h,version:"",...m,...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,Ct),a={},c={};s.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,a[o[l]]=u.elapsed??0)});let m=fe(c,n);return{elapsed:a,resolvedComponents:m}}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 jr=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),Qr=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:jr(t,o),...n?{body:n instanceof FormData?n:JSON.stringify(n)}:{}},a=await fetch(e,s);return Qr(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"),h=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&h&&(r=!0)},m=()=>{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",m),{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",m)}}}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 mt(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 dt(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 m=0;m<s;m++){let u=n?m:i[m];(!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 Wr=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 Wr;var $r=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 $r;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 zr(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=f=>{r||(h(new Ht(f)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},m=()=>ge.isFocused()&&(e.networkMode==="always"||X.isOnline())&&e.canRun(),u=()=>ft(e.networkMode)&&e.canRun(),l=f=>{r||(r=!0,e.onSuccess?.(f),o?.(),i.resolve(f))},h=f=>{r||(r=!0,e.onError?.(f),o?.(),i.reject(f))},E=()=>new Promise(f=>{o=I=>{(r||m())&&f(I)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let f,I=n===0?e.initialPromise:void 0;try{f=I??e.fn()}catch(g){f=Promise.reject(g)}Promise.resolve(f).then(l).catch(g=>{if(r)return;let A=e.retry??(K?0:3),k=e.retryDelay??zr,w=typeof k=="function"?k(n,g):k,xe=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,g);if(t||!xe){h(g);return}n++,e.onFail?.(n,g),zt(w).then(()=>m()?void 0:E()).then(()=>{t?h(g):y()})})};return{promise:i,cancel:s,continue:()=>(o?.(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?y():E().then(y),i)}}function Yr(){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=Yr();var Ie=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 Ie{#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=Xr(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,...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:ft(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xr(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=>mt(t,n))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(n=>mt(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 Ie{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Zr(),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 Zr(){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=we(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=we(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=we(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=we(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=>dt(t,n))}findAll(e={}){return this.getAll().filter(t=>dt(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 we(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,m=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)})},h=pe(t.options,t.fetchOptions),E=async(y,f,I)=>{if(u)return Promise.reject();if(f==null&&y.pages.length)return Promise.resolve(y);let g={queryKey:t.queryKey,pageParam:f,direction:I?"backward":"forward",meta:t.options.meta};l(g);let A=await h(g),{maxPages:k}=t.options,w=I?Xt:Jt;return{pages:w(y.pages,A,k),pageParams:w(y.pageParams,f,k)}};if(o&&i.length){let y=o==="backward",f=y?Hr:nn,I={pages:i,pageParams:s},g=f(r,I);a=await E(I,g,y)}else{let y=e??i.length;do{let f=c===0?s[0]??r.initialPageParam:nn(r,a);if(c>0&&f==null)break;a=await E(a,f),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=m}}}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 Hr(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 eo=new pt({defaultOptions:{queries:{staleTime:3e4}},queryCache:new oe({onError:(e,t)=>{}}),mutationCache:new ie}),rn=eo;var to=[{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=6}={}){let t={},n=0;for(let r of to){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 no=[{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,debuggerLatency:!1,consoleSpeed:!1},n=160,r=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(r>n||o>n)&&(t.viewportBreakpoint=!0);function i(c=200){let m=performance.now();debugger;return performance.now()-m>c}t.debuggerLatency=i();async function s(c=50){return new Promise(m=>{let u=performance.now();console.log("%c ","font-size:3000px");let l=performance.now();m(l-u>c)})}t.consoleSpeed=await s();let a=Object.values(t).some(Boolean);setTimeout(()=>{e({value:a,triggered:a})},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 no){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 ro(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function oo(){let e=navigator.userAgent,t=ro();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 io=[{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=oo(),t={},n=0;for(let r of io){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="dtect_security_sdk_state",ln=typeof window<"u",mn={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Re={state:{...mn},securityKeys:{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}};function dn(){if(!ln)return Re;try{let e=sessionStorage.getItem(un);if(!e)return Re;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Re:{state:{...mn,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}}}catch{return Re}}function G(e){if(ln)try{let t=Date.now()+864e5,n={...e,expiresAt:t};sessionStorage.setItem(un,JSON.stringify(n))}catch{}}function fn(e){return e.token||H()}async function P(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 ve,v="https://api.dtect.io/security",be=`${v}/client/check`,T="",V="",hn="0.0.20";var so="20000000-aaaa-bbbb-cccc-000000000002",Te;var{state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}}=dn(),pn=Dt,se;async function ao({clientId:e,apiKey:t,endpoint:n}){if(Pe({automationKey:C,behaviorKey:U,dtectAutomationSignalEnabled:x}))return{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x};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 C=r.automationKey,U=r.behaviorKey,B=r.dtectSignalEnabled,x=r.dtectAutomationSignalEnabled,G({state:d,securityKeys:r}),r}function gt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(R.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(R.RATE_LIMIT_REACHED);switch(e?.message){case j.ERROR_RATE_LIMIT:throw new Error(R.RATE_LIMIT_REACHED);default:throw new Error(R.INTERNAL_SERVER_ERROR)}}throw new Error(R.FAILED_TO_GET_SECURITY_TOKEN)}function Z(){if(En(d)&&Pe({automationKey:C,behaviorKey:U,dtectAutomationSignalEnabled:x}))return!0;let e=ke(),t=document.querySelector("#dtect-h-captcha");return!!ve&&!!(!x&&t||e||x)}function gn(){return!!(T&&V)}function co(){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 uo({behaviorKey:e,dtectAutomationSignalEnabled:t=!1}){if(ve=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]}),!ke()&&!t&&(await co(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:C,size:"invisible"})),!ve)throw new Error(R.SDK_INIT_ERROR)}async function lo(){let e=performance.now();if(d.tokens){let c=(performance.now()-e).toFixed();return P(`getTokens finishes in ${c}ms`,"info",{function:"getTokens",endpoint:v,diff:c,token:d.token,clientId:T}),d.tokens}let t=new Promise(a=>{let c=ve?.get();a(c)}),n=new Promise(async a=>{ke()&&a({response:so});let m=await window?.hcaptcha?.execute({async:!0});a(m)}),[r,o]=await Promise.all([x?{response:""}:n,t]);d.tokens={behaviorRequestId:o?.requestId,behaviorToken:o?.sealedResult,automationToken:r?.response};let s=(performance.now()-e).toFixed();return P(`getTokens finishes in ${s}ms`,"info",{function:"getTokens",endpoint:v,diff:s,token:d.token,clientId:T}),d.tokens}function mo(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(d.projectId&&d.visitorId)return{visitorId:d.visitorId,projectId:d.projectId};let{projectId:t,visitorId:n}=mo(e);return{projectId:t,visitorId:n}}async function yn(e,t){let n=performance.now();if(!Z())throw new Error(R.NOT_INITIALIZED);if(!gn())throw new Error(R.MISSING_CREDENTIALS);let{projectId:r,visitorId:o}=yt(e);if(d.projectId=r,d.visitorId=o,!e||!r?.trim())throw new Error(R.FAILED_TO_GET_SECURITY_RESULT);let i;try{let s=await lo();if(B){let a=new te,[c,m,u,l]=await Promise.allSettled([a.get(),on(),sn(),cn()]);i={deviceRes:c,vmDtectResults:m,tamperingDtectResults:u,incognitoDtectResults:l}}if(s?.behaviorToken&&s?.behaviorRequestId&&(x||!x&&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}:{}};d.clientData=a;let c={...e,projectId:r,visitorId:o,clientData:a,version:"0.0.20",token:d.token,questionData:d.questionData,aiCheckData:d.aiCheckData},m=await he({url:`${t}`,body:{...c},headers:{"client-id":T,"x-api-key":V}});if("token"in m||"results"in m){G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}});let l=(performance.now()-n).toFixed();return P(`getResultBase finishes in ${l}ms`,"info",{function:"getResultBase",endpoint:v,diff:l,token:d.token,clientId:T}),m}}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(s){let c=(performance.now()-n).toFixed();if(P("getResultBase error","error",{function:"getResultBase",endpoint:v,error:s,diff:c,token:d.token,clientId:T}),s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(R.MAINTENANCE_MODE);if(s?.message?.includes("rate-limited")||s?.message?.includes("429"))throw new Error(R.RATE_LIMIT_REACHED);switch(s?.message){case j.ERROR_RATE_LIMIT:throw new Error(R.RATE_LIMIT_REACHED);default:throw new Error(R.INTERNAL_SERVER_ERROR)}}throw new Error(R.FAILED_TO_GET_SECURITY_RESULT)}}async function Ae(e){return await yn(e,`${v}/client/check/result`)}async function Oe(e){return await yn(e,`${v}/client/check`)}async function De(e){let t=performance.now();if(!Z())throw new Error(R.NOT_INITIALIZED);let{respondentType:n,language:r}=e;try{let o=await ct({url:`${v}/client/quality-questions/${n}/${r}`,headers:{"client-id":T,"x-api-key":V}});if(o){let s=(performance.now()-t).toFixed();return P(`getQualityQuestions finishes in ${s}ms`,"info",{function:"getQualityQuestions",endpoint:v,diff:s,token:d.token,clientId:T}),o}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();P("getQualityQuestions error","error",{endpoint:v,error:o,diff:s,token:d.token,clientId:T}),gt(o)}}async function Se(e){let t=performance.now();if(!Z())throw new Error(R.NOT_INITIALIZED);d.questionData||(d.questionData={questions:e.questions});let{visitorId:n,projectId:r}=yt(e);d.visitorId=n,d.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:d.token,visitorId:n,projectId:r,version:hn,questionData:d.questionData,aiCheckData:d.aiCheckData,clientData:d.clientData}});if(o){G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}});let s=(performance.now()-t).toFixed();return P(`checkQualityQuestions finishes in ${s}ms`,"info",{function:"checkQualityQuestions",endpoint:v,diff:s,token:d.token,clientId:T}),o}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();P("checkQualityQuestions error","error",{endpoint:v,error:o,diff:s,token:d.token,clientId:T}),gt(o)}}async function _e(e){let t=performance.now();if(!Z())throw new Error(R.NOT_INITIALIZED);d.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);d.visitorId=n,d.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:d.token,visitorId:n,projectId:r,version:hn,clientData:d.clientData,questionData:d.questionData,aiCheckData:d.aiCheckData}});if(o){G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}});let s=(performance.now()-t).toFixed();return P(`isAIUsageDetected finishes in ${s}ms`,"info",{function:"isAIUsageDetected",endpoint:v,diff:s,token:d.token,clientId:T}),o}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();P("isAIUsageDetected error","error",{endpoint:v,error:o,diff:s,token:d.token,clientId:T}),gt(o)}}function fo(){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 En(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function In(e){let t=performance.now();if(!e?.clientId||!e?.apiKey)throw P(R.MISSING_CREDENTIALS,"error",{endpoint:v,...e}),new Error(R.MISSING_CREDENTIALS);let{clientId:n,apiKey:r,endpoint:o="https://api.dtect.io/security",includeResults:i}=e;v=o,be=`${v}/client/check`;let s=fn(d);if(d.isLoading){if(Z())return Te;throw P(R.DUPLICATE_INITIALIZATION,"error",{endpoint:v,clientId:n,apiKey:r,token:d.token}),new Error(R.DUPLICATE_INITIALIZATION)}if(se=qt(d.aiCheckData),T=n,V=r,i&&(be=`${v}/client/check/result`),d={...d,isLoading:!0,token:s||""},En(d)&&Pe({automationKey:C,behaviorKey:U,dtectAutomationSignalEnabled:x}))return d={...d,isLoading:!1,token:s},G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}}),{getSecurityResult:Ae,getSecurityToken:Oe,isAIUsageDetected:_e,checkQualityQuestions:Se,getQualityQuestions:De,LanguageCodes:Q,QualityQuestionsRespondentTypes:W};if(!gn())throw P(R.MISSING_CREDENTIALS,"error",{endpoint:v,...e}),new Error(R.MISSING_CREDENTIALS);if(Z())return Te;try{let c=await ao({clientId:n,apiKey:r,endpoint:o});return c.dtectAutomationSignalEnabled||fo(),uo({behaviorKey:c.behaviorKey,dtectAutomationSignalEnabled:c.dtectAutomationSignalEnabled}).then(()=>{let u=(performance.now()-t).toFixed();return P(`init() finishes ${u}ms`,"info",{endpoint:v,function:"init",diff:u,token:d.token,clientId:T}),{getSecurityResult:Ae,getSecurityToken:Oe,SecurityAPIError:pn,isAIUsageDetected:_e,checkQualityQuestions:Se,getQualityQuestions:De,LanguageCodes:Q,QualityQuestionsRespondentTypes:W}}).catch(m=>{throw new Error(m.message)})}catch(c){if(c instanceof Error){if(P(c.message,"error",{function:"init",endpoint:v,error:c,token:d.token,clientId:T}),c?.message?.includes("maintenance_mode"))throw new Error(R.MAINTENANCE_MODE);if([R.INVALID_API_KEY,R.UNAUTHORIZED].includes(c?.message))throw new Error(R.INVALID_CREDENTIALS)}throw new Error(R.SDK_INIT_ERROR)}finally{d={...d,isLoading:!1,token:s},G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}})}}Te={init:In,getSecurityResult:Ae,getSecurityToken:Oe,isAIUsageDetected:_e,checkQualityQuestions:Se,getQualityQuestions:De,QualityQuestionsRespondentTypes:W,LanguageCodes:Q};var ho=Te;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function pr(e,t){return function(r,n){return Object.prototype.hasOwnProperty.call(r,n)}(e,t)?e[t]:void 0}function gr(e,t,r,n){let o=document,i="securitypolicyviolation",a,s=m=>{let u=new URL(e,location.href),{blockedURI:l}=m;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(a=m,c())};o.addEventListener(i,s);let c=()=>o.removeEventListener(i,s);return n?.then(c,c),Promise.resolve().then(t).then(m=>(c(),m),m=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),a)return r(a);throw m}))}function N(e){let t="";for(let r=0;r<e.length;++r)if(r>0){let n=e[r].toLowerCase();n!==e[r]?t+=` ${n}`:t+=e[r]}else t+=e[r].toUpperCase();return t}var yr={default:"endpoint"},Er={default:"tlsEndpoint"},wr="Client timeout",Ir="Network connection error",vr="Network request aborted",Rr="Response cannot be parsed",Se="Blocked by CSP",_e="The endpoint parameter is not a valid URL",br="Handle on demand agent data error",Tr=N("WrongRegion"),Or=N("SubscriptionNotActive"),Ar=N("UnsupportedVersion"),Dr=N("InstallationMethodRestricted"),Sr=N("HostnameRestricted"),_r=N("IntegrationFailed"),Pr=N("NetworkRestricted"),xr=N("InvalidProxyIntegrationSecret"),kr=N("InvalidProxyIntegrationHeaders"),Nr=N("ProxyIntegrationSecretEnvironmentMismatch"),Pe="API key required",ht="API key not found",pt="API key expired",Mr="Request cannot be parsed",Lr="Request failed",Cr="Request failed to process",Fr="Too many requests, rate limit exceeded",Ur="Not available for this origin",Br="Not available with restricted header",qr=Pe,Kr=ht,Gr=pt,Vr="3.12.0",oe="Failed to load the JS script of the agent",xe="9319";function jr(e,t){let r=[],[n,o]=function(s){let c=function(l){let d=[...l];return{current:()=>d[0],postpone(){let y=d.shift();y!==void 0&&d.push(y)},exclude(){d.shift()}}}(s),m=function(l,d){let y=0;return()=>Math.random()*Math.min(d,l*Math.pow(2,y++))}(100,3e3),u=new Set;return[c.current(),(l,d)=>{let y,E=d instanceof Error?d.message:"";if(E===Se||E===_e)c.exclude(),y=0;else if(E===xe)c.exclude();else if(E===oe){let w=Date.now()-l.getTime()<50,p=c.current();p&&w&&!u.has(p)&&(u.add(p),y=0),c.postpone()}else c.postpone();let f=c.current();return f===void 0?void 0:[f,y??l.getTime()+m()-Date.now()]}]}(e),i;if(n===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));let a=s=>{let c=new Date,m=l=>r.push({url:s,startedAt:c,finishedAt:new Date,error:l}),u=t(s);return u.then(()=>m(),m),u.catch(l=>{if(i!=null||(i=l),r.length>=5)throw i;let d=o(c,l);if(!d)throw i;let[y,E]=d;return(f=E,new Promise(w=>setTimeout(w,f))).then(()=>a(y));var f})};return a(n).then(s=>[s,r])}var gt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",Wr=gt;function Qr(e){var t,r;let{picked:n,rest:o}=function(u,l){let d={},y={};for(let[E,f]of Object.entries(u))l.includes(E)?d[E]=f:y[E]=f;return{picked:d,rest:y}}(e,["scriptUrlPattern","token","apiKey"]),i=n.token,a=(t=n.apiKey)!==null&&t!==void 0?t:i,s=(r=pr(e,"scriptUrlPattern"))!==null&&r!==void 0?r:gt,[c,m]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},d=function(y,E,f,w){return y.addEventListener(E,f,w),()=>y.removeEventListener(E,f,w)}(document,"visibilitychange",l);return l(),[u,d]}();return Promise.resolve().then(()=>{if(!a||typeof a!="string")throw new Error(Pe);let u=function(l,d){return(Array.isArray(l)?l:[l]).map(y=>function(E,f){let w=encodeURIComponent;return E.replace(/<[^<>]+>/g,p=>p==="<version>"?"3":p==="<apiKey>"?w(f):p==="<loaderVersion>"?w(Vr):p)}(String(y),d))}(s,a);return jr(u,$r)}).catch(u=>{throw m(),function(l){return l instanceof Error&&l.message===xe?new Error(oe):l}(u)}).then(([u,l])=>(m(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function $r(e){return gr(e,()=>function(t){return new Promise((r,n)=>{if(function(s){if(URL.prototype)try{return new URL(s,location.href),!1}catch(c){if(c instanceof Error&&c.name==="TypeError")return!0;throw c}}(t))throw new Error(_e);let o=document.createElement("script"),i=()=>{var s;return(s=o.parentNode)===null||s===void 0?void 0:s.removeChild(o)},a=document.head||document.getElementsByTagName("head")[0];o.onload=()=>{i(),r()},o.onerror=()=>{i(),n(new Error(oe))},o.async=!0,o.src=t,a.appendChild(o)})}(e),()=>{throw new Error(Se)}).then(zr)}function zr(){let e=window,t="__fpjs_p_l_b",r=e[t];if(function(n,o){var i;let a=(i=Object.getOwnPropertyDescriptor)===null||i===void 0?void 0:i.call(Object,n,o);a?.configurable?delete n[o]:a&&!a.writable||(n[o]=void 0)}(e,t),typeof r?.load!="function")throw new Error(xe);return r}var G={load:Qr,defaultScriptUrlPattern:Wr,ERROR_SCRIPT_LOAD_FAIL:oe,ERROR_API_KEY_EXPIRED:pt,ERROR_API_KEY_INVALID:ht,ERROR_API_KEY_MISSING:Pe,ERROR_BAD_REQUEST_FORMAT:Mr,ERROR_BAD_RESPONSE_FORMAT:Rr,ERROR_CLIENT_TIMEOUT:wr,ERROR_CSP_BLOCK:Se,ERROR_FORBIDDEN_ENDPOINT:Sr,ERROR_FORBIDDEN_HEADER:Br,ERROR_FORBIDDEN_ORIGIN:Ur,ERROR_GENERAL_SERVER_FAILURE:Lr,ERROR_HANDLE_AGENT_DATA:br,ERROR_INSTALLATION_METHOD_RESTRICTED:Dr,ERROR_INTEGRATION_FAILURE:_r,ERROR_INVALID_ENDPOINT:_e,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:kr,ERROR_INVALID_PROXY_INTEGRATION_SECRET:xr,ERROR_NETWORK_ABORT:vr,ERROR_NETWORK_CONNECTION:Ir,ERROR_NETWORK_RESTRICTED:Pr,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:Nr,ERROR_RATE_LIMIT:Fr,ERROR_SERVER_TIMEOUT:Cr,ERROR_SUBSCRIPTION_NOT_ACTIVE:Or,ERROR_TOKEN_EXPIRED:Gr,ERROR_TOKEN_INVALID:Kr,ERROR_TOKEN_MISSING:qr,ERROR_UNSUPPORTED_VERSION:Ar,ERROR_WRONG_REGION:Tr,defaultEndpoint:yr,defaultTlsEndpoint:Er};var T=[];for(let e=0;e<256;++e)T.push((e+256).toString(16).slice(1));function yt(e,t=0){return(T[e[t+0]]+T[e[t+1]]+T[e[t+2]]+T[e[t+3]]+"-"+T[e[t+4]]+T[e[t+5]]+"-"+T[e[t+6]]+T[e[t+7]]+"-"+T[e[t+8]]+T[e[t+9]]+"-"+T[e[t+10]]+T[e[t+11]]+T[e[t+12]]+T[e[t+13]]+T[e[t+14]]+T[e[t+15]]).toLowerCase()}var ke,Yr=new Uint8Array(16);function Ne(){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(Yr)}var Xr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Me={randomUUID:Xr};function Jr(e,t,r){if(Me.randomUUID&&!t&&!e)return Me.randomUUID();e=e||{};let n=e.random??e.rng?.()??Ne();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return yt(n)}var z=Jr;var Zr={UNAUTHORIZED:"Unauthorized"},Hr={EXPIRED:"EXPIRED_TOKEN",INVALID_API_KEY:"INVALID_API_KEY",MISSING_AUTHENTICATION_TOKEN:"MISSING_AUTHENTICATION_TOKEN"},Et={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"},wt={SDK_INIT_ERROR:"Internal Server Error during SDK Initialization",DUPLICATE_INITIALIZATION:"Multiple SDK Initializations Detected",NOT_INITIALIZED:"SDK Not Initialized"},It={INVALID_CREDENTIALS:"Invalid Public Client ID or Public API Key"},vt={FAILED_TO_GET_SECURITY_RESULT:"Failed to Retrieve Security Result"},Rt={FAILED_TO_GET_SECURITY_TOKEN:" Failed to Generate Security Token"},v={...Zr,...Hr,...Et,...wt,...It,...vt,...Rt},bt={...Et,...wt,...It,...vt,...Rt};var Y=(p=>(p.AR="ar",p.BN="bn",p.DE="de",p.EN="en",p.ES="es",p.FR="fr",p.HI="hi",p.ID="id",p.IT="it",p.JA="ja",p.KO="ko",p.MS="ms",p.NL="nl",p.PT="pt",p.RU="ru",p.YU="yu",p.ZH="zh",p))(Y||{}),X=(I=>(I.GeneralConsumer="general-consumer",I.HRManagerDirector="hr-manager-director",I.WebDeveloper="web-developer",I.SoftwareEngineer="software-engineer",I.ITDirector="it-director",I.BusinessAdministrator="business-administrator",I.AccountsPayableManager="accounts-payable-manager",I.Accountant="accountant",I.FinanceDirector="finance-director",I.SmallBusinessOwner="small-business-owner",I.GeneralContractor="general-contractor",I.MarketingManagerDirector="marketing-manager-director",I.ConsumerShopper="consumer-shopper",I.Travel="travel",I.Entertainment="entertainment",I.FinanceAndBanking="finance-and-banking",I.General="general",I.B2BWhiteCollar="b2b-white-collar",I.B2BBlueCollar="b2b-blue-collar",I.Lawyer="lawyer",I))(X||{});var V={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},Do={...V},Le={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 Ce(){return en()}async function en(){return new Promise((t,r)=>{try{let i=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,5e3,44100),a=i?.createBufferSource(),s=i.createOscillator();s.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,s.connect(c),c.connect(i.destination),s.start();let m;i.oncomplete=u=>{m=u.renderedBuffer.getChannelData(0),t({sampleHash:tn(m),maxChannels:i.destination.maxChannelCount,channelCountMode:a.channelCountMode})},i.startRendering()}catch(n){console.error("Error creating audio fingerprint:",n),r(n)}})}function tn(e){let t=0;for(let r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function ie(e,t,r){let n=[];for(let a=0;a<e[0].data.length;a++){let s=[];for(let c=0;c<e.length;c++)s.push(e[c].data[a]);n.push(rn(s))}let o=n,i=new Uint8ClampedArray(o);return new ImageData(i,t,r)}function rn(e){if(e.length===0)return 0;let t={};for(let n of e)t[n]=(t[n]||0)+1;let r=e[0];for(let n in t)t[n]>t[r]&&(r=parseInt(n,10));return r}function nn(e){return new TextEncoder().encode(e).buffer}function se(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^=e>>>16,e>>>0}var A=new Uint32Array([597399067,2869860233,951274213,2716044179]);function x(e,t){return e<<t|e>>>32-t}function on(e,t){let r=e.byteLength/16|0,n=new Uint32Array(e,0,r*4);for(let o=0;o<r;o++){let i=n.subarray(o*4,(o+1)*4);i[0]=Math.imul(i[0],A[0]),i[0]=x(i[0],15),i[0]=Math.imul(i[0],A[1]),t[0]=t[0]^i[0],t[0]=x(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],A[1]),i[1]=x(i[1],16),i[1]=Math.imul(i[1],A[2]),t[1]=t[1]^i[1],t[1]=x(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],A[2]),i[2]=x(i[2],17),i[2]=Math.imul(i[2],A[3]),t[2]=t[2]^i[2],t[2]=x(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],A[3]),i[3]=x(i[3],18),i[3]=Math.imul(i[3],A[0]),t[3]=t[3]^i[3],t[3]=x(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function sn(e,t){let r=e.byteLength/16|0,n=e.byteLength%16,o=new Uint32Array(4),i=new Uint8Array(e,r*16,n);switch(n){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],A[3]),o[3]=x(o[3],18),o[3]=Math.imul(o[3],A[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],A[2]),o[2]=x(o[2],17),o[2]=Math.imul(o[2],A[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],A[1]),o[1]=x(o[1],16),o[1]=Math.imul(o[1],A[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],A[0]),o[0]=x(o[0],15),o[0]=Math.imul(o[0],A[1]),t[0]=t[0]^o[0]}}function an(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]=se(t[0]),t[1]=se(t[1]),t[2]=se(t[2]),t[3]=se(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=nn(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let r=new Uint32Array([t,t,t,t]);on(e,r),sn(e,r),an(e,r);let n=new Uint8Array(r.buffer);return Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("")}var cn=3,Tt=280,Ot=20;async function Fe(){return un()}function un(){return new Promise(e=>{let t=Array.from({length:cn},()=>ln()),r=ie(t,Tt,Ot);e({commonPixelsHash:O(r.data.toString()).toString()})})}function ln(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Tt,e.height=Ot;let r=t.createLinearGradient(0,0,e.width,e.height);r.addColorStop(0,"red"),r.addColorStop(1/6,"orange"),r.addColorStop(2/6,"yellow"),r.addColorStop(3/6,"green"),r.addColorStop(4/6,"blue"),r.addColorStop(5/6,"indigo"),r.addColorStop(1,"violet"),t.fillStyle=r,t.fillRect(0,0,e.width,e.height);let n="Random Text WMwmil10Oo";return t.font="23.123px Arial",t.fillStyle="black",t.fillText(n,-5,15),t.fillStyle="rgba(0, 0, 255, 0.5)",t.fillText(n,-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 ae(e){for(;!document.body;)await mn(50);let t=document.createElement("iframe");t.setAttribute("frameBorder","0");let r=t.style;r.setProperty("position","fixed"),r.setProperty("display","block","important"),r.setProperty("visibility","visible"),r.setProperty("border","0"),r.setProperty("opacity","0"),t.src="about:blank",document.body.appendChild(t);let n=t.contentDocument||t.contentWindow?.document;if(!n)throw new Error("Iframe document is not accessible");e({iframe:n}),setTimeout(()=>{document.body.removeChild(t)},0)}function mn(e,t){return new Promise(r=>setTimeout(r,e,t))}var dn=["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"],fn=["monospace","sans-serif","serif"];async function Ue(e){return hn()}function hn(){return new Promise((e,t)=>{try{ae(async({iframe:r})=>{let o=r.createElement("canvas").getContext("2d"),i=fn.map(s=>At(o,s)),a={};dn.forEach(s=>{let c=At(o,s);i.includes(c)||(a[s]=c)}),e(a)})}catch{t({error:"unsupported"})}})}function At(e,t){if(!e)return null;let r="WwMmLli0Oo";return e.font=`72px ${t}`,e.measureText(r).width}function Be(){return new Promise((e,t)=>{let r=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,n=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:pn(),architecture:gn(),deviceMemory:r.toString()||"undefined",jsHeapSizeLimit:n.jsHeapSizeLimit||0})})}function pn(){let e=document.createElement("canvas"),t=e.getContext("webgl")??e.getContext("experimental-webgl");if(t&&"getParameter"in t)try{let r=(t.getParameter(t.VENDOR)||"").toString(),n=(t.getParameter(t.RENDERER)||"").toString(),o={vendor:r,renderer:n,version:(t.getParameter(t.VERSION)||"").toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||"").toString()};if(!n.length||!r.length){let i=t.getExtension("WEBGL_debug_renderer_info");if(i){let a=(t.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),s=(t.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString();a&&(o.vendorUnmasked=a),s&&(o.rendererUnmasked=s)}}return o}catch{}return"undefined"}function gn(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function qe(){return new Promise(e=>{e({languages:yn(),timezone:En()})})}function yn(){let e=[];return navigator.language}function En(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var ce=(e,t,r,n)=>{let o=(r-t)/n,i=0;for(let a=0;a<n;a++){let s=t+(a+.5)*o;i+=e(s)}return i*o};function Ke(){return new Promise(e=>{e({acos:Math.acos(.5),asin:ce(Math.asin,-1,1,97),cos:ce(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:ce(Math.sin,-Math.PI,Math.PI,97),tan:ce(Math.tan,0,2*Math.PI,97)})})}function wn(e){if(e.length===0)return null;let t={};e.forEach(o=>{let i=String(o);t[i]=(t[i]||0)+1});let r=e[0],n=1;return Object.keys(t).forEach(o=>{t[o]>n&&(r=o,n=t[o])}),r}function Dt(e,t){let r={};return t.forEach(n=>{let o=e.map(a=>n in a?a[n]:void 0).filter(a=>a!==void 0),i=wn(o);i&&(r[n]=i)}),r}var In=["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 Ge(e){let t=e?.permissions_to_check||In,n=await Promise.all(Array.from({length:3},()=>vn(t)));return Dt(n,t)}async function vn(e){let t={};for(let r of e)try{let n=await navigator.permissions.query({name:r});t[r]=n.state.toString()}catch{}return t}async function Ve(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let r=navigator.plugins[t];e.push([r.name,r.filename,r.description].join("|"))}return new Promise(t=>{t({plugins:e})})}function j(){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+)+)/],r={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(let n of t){let o=e.match(n);if(o){let i=o.groups?.name,a=o.groups?.version||o.groups?.version1||o.groups?.version2;if(!i&&(o.groups?.version1||o.groups?.version2)&&(i="Safari"),!i&&n.source.includes("Opera Mini")&&(i="Opera Mini"),!i&&n.source.includes("Opera Mobi")&&(i="Opera Mobi"),!i&&n.source.includes("Opera")&&(i="Opera"),!i&&o[1]&&(i=o[1]),!a&&o[2]&&(a=o[2]),i)return{name:r[i.toLowerCase()]||i,version:a||"unknown"}}}return{name:"unknown",version:"unknown"}}function ue(){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 je(){return new Promise(e=>{let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:bn()};ue()&&navigator.maxTouchPoints>0&&(t.resolution=Rn()),e(t)})}function Rn(){let e=window.screen.width,t=window.screen.height,r=Math.max(e,t).toString(),n=Math.min(e,t).toString();return`${r}x${n}`}function bn(){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(r=>{t[r].forEach(n=>{matchMedia(`(${r}: ${n})`).matches&&e.push(`${r}: ${n}`)})}),e}function We(){return new Promise(e=>{let t=j(),r=navigator.userAgent,n={platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:ue(),applePayVersion:Tn(),cookieEnabled:window.navigator.cookieEnabled};e(n)})}function Tn(){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 On=j().name!=="SamsungBrowser"?1:3,D,h=null;function An(){typeof document<"u"&&(D=document.createElement("canvas"),D.width=200,D.height=100,h=D.getContext("webgl"))}async function Qe(){An();try{if(!h)throw new Error("WebGL not supported");let e=Array.from({length:On},()=>Dn()),t=ie(e,D.width,D.height);return{commonPixelsHash:O(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function Dn(){try{if(!h)throw new Error("WebGL not supported");let e=`
|
|
1
|
+
function yn(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function En(e,t,n,r){let o=document,i="securitypolicyviolation",s,a=m=>{let u=new URL(e,location.href),{blockedURI:l}=m;l!==u.href&&l!==u.protocol.slice(0,-1)&&l!==u.origin||(s=m,c())};o.addEventListener(i,a);let c=()=>o.removeEventListener(i,a);return r?.then(c,c),Promise.resolve().then(t).then(m=>(c(),m),m=>new Promise(u=>{let l=new MessageChannel;l.port1.onmessage=()=>u(),l.port2.postMessage(null)}).then(()=>{if(c(),s)return n(s);throw m}))}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 In={default:"endpoint"},wn={default:"tlsEndpoint"},Rn="Client timeout",vn="Network connection error",bn="Network request aborted",Tn="Response cannot be parsed",ke="Blocked by CSP",xe="The endpoint parameter is not a valid URL",An="Handle on demand agent data error",On=F("WrongRegion"),Dn=F("SubscriptionNotActive"),Sn=F("UnsupportedVersion"),_n=F("InstallationMethodRestricted"),Pn=F("HostnameRestricted"),kn=F("IntegrationFailed"),xn=F("NetworkRestricted"),Nn=F("InvalidProxyIntegrationSecret"),Mn=F("InvalidProxyIntegrationHeaders"),Ln=F("ProxyIntegrationSecretEnvironmentMismatch"),Ne="API key required",yt="API key not found",Et="API key expired",Cn="Request cannot be parsed",Fn="Request failed",Un="Request failed to process",Bn="Too many requests, rate limit exceeded",qn="Not available for this origin",Kn="Not available with restricted header",Gn=Ne,Vn=yt,jn=Et,Qn="3.12.0",ae="Failed to load the JS script of the agent",Me="9319";function Wn(e,t){let n=[],[r,o]=function(a){let c=function(l){let h=[...l];return{current:()=>h[0],postpone(){let E=h.shift();E!==void 0&&h.push(E)},exclude(){h.shift()}}}(a),m=function(l,h){let E=0;return()=>Math.random()*Math.min(h,l*Math.pow(2,E++))}(100,3e3),u=new Set;return[c.current(),(l,h)=>{let E,y=h instanceof Error?h.message:"";if(y===ke||y===xe)c.exclude(),E=0;else if(y===Me)c.exclude();else if(y===ae){let I=Date.now()-l.getTime()<50,g=c.current();g&&I&&!u.has(g)&&(u.add(g),E=0),c.postpone()}else c.postpone();let f=c.current();return f===void 0?void 0:[f,E??l.getTime()+m()-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,m=l=>n.push({url:a,startedAt:c,finishedAt:new Date,error:l}),u=t(a);return u.then(()=>m(),m),u.catch(l=>{if(i!=null||(i=l),n.length>=5)throw i;let h=o(c,l);if(!h)throw i;let[E,y]=h;return(f=y,new Promise(I=>setTimeout(I,f))).then(()=>s(E));var f})};return s(r).then(a=>[a,n])}var It="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",$n=It;function zn(e){var t,n;let{picked:r,rest:o}=function(u,l){let h={},E={};for(let[y,f]of Object.entries(u))l.includes(y)?h[y]=f:E[y]=f;return{picked:h,rest:E}}(e,["scriptUrlPattern","token","apiKey"]),i=r.token,s=(t=r.apiKey)!==null&&t!==void 0?t:i,a=(n=yn(e,"scriptUrlPattern"))!==null&&n!==void 0?n:It,[c,m]=function(){let u=[],l=()=>{u.push({time:new Date,state:document.visibilityState})},h=function(E,y,f,I){return E.addEventListener(y,f,I),()=>E.removeEventListener(y,f,I)}(document,"visibilitychange",l);return l(),[u,h]}();return Promise.resolve().then(()=>{if(!s||typeof s!="string")throw new Error(Ne);let u=function(l,h){return(Array.isArray(l)?l:[l]).map(E=>function(y,f){let I=encodeURIComponent;return y.replace(/<[^<>]+>/g,g=>g==="<version>"?"3":g==="<apiKey>"?I(f):g==="<loaderVersion>"?I(Qn):g)}(String(E),h))}(a,s);return Wn(u,Yn)}).catch(u=>{throw m(),function(l){return l instanceof Error&&l.message===Me?new Error(ae):l}(u)}).then(([u,l])=>(m(),u.load({...o,ldi:{attempts:l,visibilityStates:c}})))}function Yn(e){return En(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(Jn)}function Jn(){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:zn,defaultScriptUrlPattern:$n,ERROR_SCRIPT_LOAD_FAIL:ae,ERROR_API_KEY_EXPIRED:Et,ERROR_API_KEY_INVALID:yt,ERROR_API_KEY_MISSING:Ne,ERROR_BAD_REQUEST_FORMAT:Cn,ERROR_BAD_RESPONSE_FORMAT:Tn,ERROR_CLIENT_TIMEOUT:Rn,ERROR_CSP_BLOCK:ke,ERROR_FORBIDDEN_ENDPOINT:Pn,ERROR_FORBIDDEN_HEADER:Kn,ERROR_FORBIDDEN_ORIGIN:qn,ERROR_GENERAL_SERVER_FAILURE:Fn,ERROR_HANDLE_AGENT_DATA:An,ERROR_INSTALLATION_METHOD_RESTRICTED:_n,ERROR_INTEGRATION_FAILURE:kn,ERROR_INVALID_ENDPOINT:xe,ERROR_INVALID_PROXY_INTEGRATION_HEADERS:Mn,ERROR_INVALID_PROXY_INTEGRATION_SECRET:Nn,ERROR_NETWORK_ABORT:bn,ERROR_NETWORK_CONNECTION:vn,ERROR_NETWORK_RESTRICTED:xn,ERROR_PROXY_INTEGRATION_SECRET_ENVIRONMENT_MISMATCH:Ln,ERROR_RATE_LIMIT:Bn,ERROR_SERVER_TIMEOUT:Un,ERROR_SUBSCRIPTION_NOT_ACTIVE:Dn,ERROR_TOKEN_EXPIRED:jn,ERROR_TOKEN_INVALID:Vn,ERROR_TOKEN_MISSING:Gn,ERROR_UNSUPPORTED_VERSION:Sn,ERROR_WRONG_REGION:On,defaultEndpoint:In,defaultTlsEndpoint:wn};var O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function wt(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}var Le,Xn=new Uint8Array(16);function Ce(){if(!Le){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Le=crypto.getRandomValues.bind(crypto)}return Le(Xn)}var Zn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fe={randomUUID:Zn};function Hn(e,t,n){if(Fe.randomUUID&&!t&&!e)return Fe.randomUUID();e=e||{};let r=e.random??e.rng?.()??Ce();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 wt(r)}var X=Hn;var er={UNAUTHORIZED:"Unauthorized"},tr={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"},vt={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"},R={...er,...tr,...Rt,...vt,...bt,...Tt,...At},Ot={...Rt,...vt,...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=(w=>(w.GeneralConsumer="general-consumer",w.HRManagerDirector="hr-manager-director",w.WebDeveloper="web-developer",w.SoftwareEngineer="software-engineer",w.ITDirector="it-director",w.BusinessAdministrator="business-administrator",w.AccountsPayableManager="accounts-payable-manager",w.Accountant="accountant",w.FinanceDirector="finance-director",w.SmallBusinessOwner="small-business-owner",w.GeneralContractor="general-contractor",w.MarketingManagerDirector="marketing-manager-director",w.ConsumerShopper="consumer-shopper",w.Travel="travel",w.Entertainment="entertainment",w.FinanceAndBanking="finance-and-banking",w.General="general",w.B2BWhiteCollar="b2b-white-collar",w.B2BBlueCollar="b2b-blue-collar",w.Lawyer="lawyer",w))(H||{});var Q={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,performance:!1,experimental:!1},So={...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 nr()}async function nr(){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 m;i.oncomplete=u=>{m=u.renderedBuffer.getChannelData(0),t({sampleHash:rr(m),maxChannels:i.destination.maxChannelCount,channelCountMode:s.channelCountMode})},i.startRendering()}catch(r){console.error("Error creating audio fingerprint:",r),n(r)}})}function rr(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(or(a))}let o=r,i=new Uint8ClampedArray(o);return new ImageData(i,t,n)}function or(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 ir(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 S=new Uint32Array([597399067,2869860233,951274213,2716044179]);function L(e,t){return e<<t|e>>>32-t}function sr(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],S[0]),i[0]=L(i[0],15),i[0]=Math.imul(i[0],S[1]),t[0]=t[0]^i[0],t[0]=L(t[0],19),t[0]=t[0]+t[1],t[0]=Math.imul(t[0],5)+1444728091,i[1]=Math.imul(i[1],S[1]),i[1]=L(i[1],16),i[1]=Math.imul(i[1],S[2]),t[1]=t[1]^i[1],t[1]=L(t[1],17),t[1]=t[1]+t[2],t[1]=Math.imul(t[1],5)+197830471,i[2]=Math.imul(i[2],S[2]),i[2]=L(i[2],17),i[2]=Math.imul(i[2],S[3]),t[2]=t[2]^i[2],t[2]=L(t[2],15),t[2]=t[2]+t[3],t[2]=Math.imul(t[2],5)+2530024501,i[3]=Math.imul(i[3],S[3]),i[3]=L(i[3],18),i[3]=Math.imul(i[3],S[0]),t[3]=t[3]^i[3],t[3]=L(t[3],13),t[3]=t[3]+t[0],t[3]=Math.imul(t[3],5)+850148119}}function ar(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],S[3]),o[3]=L(o[3],18),o[3]=Math.imul(o[3],S[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],S[2]),o[2]=L(o[2],17),o[2]=Math.imul(o[2],S[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],S[1]),o[1]=L(o[1],16),o[1]=Math.imul(o[1],S[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],S[0]),o[0]=L(o[0],15),o[0]=Math.imul(o[0],S[1]),t[0]=t[0]^o[0]}}function cr(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 D(e,t=0){if(t=t?t|0:0,typeof e=="string"&&(e=ir(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([t,t,t,t]);sr(e,n),ar(e,n),cr(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}var ur=3,Dt=280,St=20;async function qe(){return lr()}function lr(){return new Promise(e=>{let t=Array.from({length:ur},()=>mr()),n=ce(t,Dt,St);e({commonPixelsHash:D(n.data.toString()).toString()})})}function mr(){let e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return new ImageData(1,1);e.width=Dt,e.height=St;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 dr(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 dr(e,t){return new Promise(n=>setTimeout(n,e,t))}var fr=["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"],hr=["monospace","sans-serif","serif"];async function Ke(e){return pr()}function pr(){return new Promise((e,t)=>{try{le(async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d"),i=hr.map(a=>_t(o,a)),s={};fr.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:gr(),architecture:yr(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:r.jsHeapSizeLimit||0})})}function gr(){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 yr(){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:Er(),timezone:Ir()})})}function Er(){let e=[];return navigator.language}function Ir(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var me=(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:me(Math.asin,-1,1,97),cos:me(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:me(Math.sin,-Math.PI,Math.PI,97),tan:me(Math.tan,0,2*Math.PI,97)})})}function wr(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=wr(o);i&&(n[r]=i)}),n}var Rr=["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||Rr,r=await Promise.all(Array.from({length:3},()=>vr(t)));return Pt(r,t)}async function vr(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 de(){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:Tr()};de()&&navigator.maxTouchPoints>0&&(t.resolution=br()),e(t)})}function br(){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 Tr(){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:de(),applePayVersion:Ar(),cookieEnabled:window.navigator.cookieEnabled};e(r)})}function Ar(){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 Or=W().name!=="SamsungBrowser"?1:3,_,p=null;function Dr(){typeof document<"u"&&(_=document.createElement("canvas"),_.width=200,_.height=100,p=_.getContext("webgl"))}async function Ye(){Dr();try{if(!p)throw new Error("WebGL not supported");let e=Array.from({length:Or},()=>Sr()),t=ce(e,_.width,_.height);return{commonPixelsHash:D(t.data.toString()).toString()}}catch{return{webgl:"unsupported"}}}function Sr(){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 pr(e,t){return function(r,n){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
|
-
`,r=h.createShader(h.VERTEX_SHADER),n=h.createShader(h.FRAGMENT_SHADER);if(!r||!n)throw new Error("Failed to create shaders");if(h.shaderSource(r,e),h.shaderSource(n,t),h.compileShader(r),!h.getShaderParameter(r,h.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+h.getShaderInfoLog(r));if(h.compileShader(n),!h.getShaderParameter(n,h.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+h.getShaderInfoLog(n));let o=h.createProgram();if(!o)throw new Error("Failed to create shader program");if(h.attachShader(o,r),h.attachShader(o,n),h.linkProgram(o),!h.getProgramParameter(o,h.LINK_STATUS))throw new Error("Shader program linking failed: "+h.getProgramInfoLog(o));h.useProgram(o);let i=137,a=new Float32Array(i*4),s=2*Math.PI/i;for(let d=0;d<i;d++){let y=d*s;a[d*4]=0,a[d*4+1]=0,a[d*4+2]=Math.cos(y)*(D.width/2),a[d*4+3]=Math.sin(y)*(D.height/2)}let c=h.createBuffer();h.bindBuffer(h.ARRAY_BUFFER,c),h.bufferData(h.ARRAY_BUFFER,a,h.STATIC_DRAW);let m=h.getAttribLocation(o,"position");h.enableVertexAttribArray(m),h.vertexAttribPointer(m,2,h.FLOAT,!1,0,0),h.viewport(0,0,D.width,D.height),h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT),h.drawArrays(h.LINES,0,i*2);let u=new Uint8ClampedArray(D.width*D.height*4);return h.readPixels(0,0,D.width,D.height,h.RGBA,h.UNSIGNED_BYTE,u),new ImageData(u,D.width,D.height)}catch{return new ImageData(1,1)}finally{h&&(h.bindBuffer(h.ARRAY_BUFFER,null),h.useProgram(null),h.viewport(0,0,h.drawingBufferWidth,h.drawingBufferHeight),h.clearColor(0,0,0,0))}}function _(e){let t=[];return function r(n){if(n&&n.toJSON&&typeof n.toJSON=="function"&&(n=n.toJSON()),n===void 0)return;if(typeof n=="number")return isFinite(n)?""+n:"null";if(typeof n!="object")return JSON.stringify(n);let o,i;if(Array.isArray(n)){for(i="[",o=0;o<n.length;o++)o&&(i+=","),i+=r(n[o])||"null";return i+"]"}if(n===null)return"null";if(t.indexOf(n)!==-1)throw new TypeError("Converting circular structure to JSON");let a=t.push(n)-1,s=Object.keys(n).sort();for(i="",o=0;o<s.length;o++){let c=s[o],m=r(n[c]);m&&(i&&(i+=","),i+=JSON.stringify(c)+":"+m)}return t.splice(a,1),"{"+i+"}"}(e)||""}async function $e(){return new Promise(e=>{try{let t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t){e({supported:!1,error:"WebRTC not supported"});return}let r={iceCandidatePoolSize:1,iceServers:[]},n=new t(r);n.createDataChannel(""),(async()=>{try{let i={offerToReceiveAudio:!0,offerToReceiveVideo:!0},a=await n.createOffer(i);await n.setLocalDescription(a);let s=a.sdp||"",c=[...new Set((s.match(/extmap:\d+ [^\n\r]+/g)||[]).map(f=>f.replace(/extmap:\d+ /,"")))].sort(),m=f=>{let w=s.match(new RegExp(`m=${f} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},u=(f,w)=>w.map(p=>{let b=new RegExp(`(rtpmap|fmtp|rtcp-fb):${p} (.+)`,"g"),S=[...s.matchAll(b)];if(!S.length)return null;let I={};return S.forEach(Te=>{let[io,Oe,Ae]=Te,De=Ae.split("/");Oe==="rtpmap"?(I.mimeType=`${f}/${De[0]}`,I.clockRate=+De[1],f==="audio"&&(I.channels=+De[2]||1)):Oe==="rtcp-fb"?(I.feedbackSupport=I.feedbackSupport||[],I.feedbackSupport.push(Ae)):Oe==="fmtp"&&(I.sdpFmtpLine=Ae)}),I}).filter(Boolean),l=u("audio",m("audio")),d=u("video",m("video")),y={audio:{count:l.length,hash:O(_(l))},video:{count:d.length,hash:O(_(d))},extensionsHash:O(_(c))},E=await new Promise(f=>{let w=setTimeout(()=>{n.removeEventListener("icecandidate",p),n.close(),f({supported:!0,...y,timeout:!0})},3e3),p=b=>{let S=b.candidate;!S||!S.candidate||(clearTimeout(w),n.removeEventListener("icecandidate",p),n.close(),f({supported:!0,...y,candidateType:S.type||""}))};n.addEventListener("icecandidate",p)});e({details:E,hash:O(_(E))})}catch(i){n.close(),e({supported:!0,error:`WebRTC offer failed: ${i.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}})}var St=["\u{1D504}","\u{1D505}","\u212D","\u{1D507}","\u{1D508}","\u{1D509}","\u{1D538}","\u{1D539}","\u2102","\u{1D53B}","\u{1D53C}","\u{1D53D}"],_t=["\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 ze(){return new Promise(e=>{try{ae(async({iframe:t})=>{try{if(!Sn(t)){e({supported:!1,error:"MathML not supported"});return}let r=[J("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>"),J("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>"),J("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>"),_n(),...Pn()],n=[],o="";r.forEach((a,s)=>{let c=xn(a,t);n.push({width:c.dimensions.width,height:c.dimensions.height}),s===0&&c.fontInfo&&(o=O(_(c.fontInfo)))});let i={fontStyleHash:o,dimensions:n};e({details:i,hash:O(_(i))})}catch(r){e({supported:!1,error:`MathML error: ${r.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function Sn(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 r=t.getBoundingClientRect();return e.body.removeChild(t),r.width>0&&r.height>0}catch{return!1}}function J(e,t){return`<math><mrow>${t}</mrow></math>`}function _n(){let e="<mo>\u220F</mo>";return St.forEach((t,r)=>{let n=r*2,o=_t.slice(n,n+2);o.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`)}),J("complex_nested",`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function Pn(){let e=[];return St.forEach((t,r)=>{let n=r*2,o=_t.slice(n,n+2);o.length===2&&e.push(J("combined",`<mmultiscripts><mi>${t}</mi><none/><mi>${o[1]}</mi><mprescripts></mprescripts><mi>${o[0]}</mi><none/></mmultiscripts>`))}),e}function xn(e,t){try{let r=t.createElement("math");r.innerHTML=e.replace(/<\/?math>/g,""),r.style.whiteSpace="nowrap",r.style.position="absolute",r.style.visibility="hidden",r.style.top="-9999px",t.body.appendChild(r);let n=r.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(r),a={dimensions:{width:n.width,height:n.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(r),a}catch(r){return{error:r.message}}}var kn=800;async function Ye(){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,r=null,n=a=>{if(!t){t=!0,r&&clearTimeout(r);try{let s=a.map(m=>{let u=d=>d.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(m.voiceURI||""),u(m.name||""),u(m.lang||""),m.localService?"1":"0",m.default?"1":"0"].join(",")});s.sort();let c={voiceCount:a.length,voicesHash:O(_(s))};e({details:c,hash:O(_(c))})}catch(s){e({supported:!0,error:`Voice processing failed: ${s.message}`})}}},o=window.speechSynthesis.getVoices();if(o.length>0){n(o);return}r=setTimeout(()=>{let a=window.speechSynthesis.getVoices();n(a)},kn);let i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);let a=window.speechSynthesis.getVoices();n(a)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}})}var Pt={audio:Ce,canvas:Fe,fonts:Ue,hardware:Be,locales:qe,math:Ke,permissions:Ge,plugins:Ve,screen:je,system:We,webgl:Qe},xt={webrtc:$e,mathml:ze,speech:Ye},Xe={},kt={timeout:"true"},Je=(e,t,r)=>{Xe[e]=t};function Nn(e,t){return new Promise(r=>{setTimeout(()=>r(t),e)})}function Nt(e,t,r){return Promise.all(e.map(n=>{let o=performance.now();return Promise.race([n.then(i=>({value:i,elapsed:performance.now()-o})),Nn(t,r).then(i=>({value:i,elapsed:performance.now()-o}))])}))}function le(e,t){let r=j();if(r.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 d=l;r={name:d.name||"unknown",version:d.version||"unknown"}}}let n=r.name.toLowerCase(),o=r.version.split(".")[0]||"0",i=parseInt(o,10),a=[...t?.exclude||[]],s=t?.stabilize||[],c=t?.include||[];for(let u of s){let l=Le[u];if(l)for(let d of l){let y=!("browsers"in d),E=!y&&d.browsers?.some(f=>{let w=f.match(/(.+?)(>=)(\d+)/);if(w){let[,p,,b]=w,S=parseInt(b,10);return n===p&&i>=S}return n===f});(y||E)&&a.push(...d.exclude)}}function m(u,l=""){let d={};for(let[y,E]of Object.entries(u)){let f=l?`${l}.${y}`:y;if(typeof E=="object"&&!Array.isArray(E)&&E!==null){let w=m(E,f);Object.keys(w).length>0&&(d[y]=w)}else{let w=a.some(b=>f.startsWith(b)),p=c.some(b=>f.startsWith(b));(!w||p)&&(d[y]=E)}}return d}return m(e)}async function Ze(e){let t={...V,...e},r=t.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,n={...Pt,...Xe},{elapsed:o,resolvedComponents:i}=await Mt(n,t),a={},s={};if(r||t.experimental){let{elapsed:w,resolvedComponents:p}=await Mt(xt,t);a=p,s=w}let c={...o,...s},m=t.performance?{elapsed:c}:{},u=le({},t),l={...i,...u},d={};return{thumbmark:O(_(l)),components:l,info:d,version:"",...m,...Object.keys(a).length>0&&t.experimental&&{experimental:a}}}async function Mt(e,t){let r={...V,...t},n=Object.entries(e).filter(([u])=>!r?.exclude?.includes(u)).filter(([u])=>r?.include?.some(l=>l.includes("."))?r?.include?.some(l=>l.startsWith(u)):r?.include?.length===0||r?.include?.includes(u)),o=n.map(([u])=>u),i=n.map(([u,l])=>l(t)),a=await Nt(i,r?.timeout||5e3,kt),s={},c={};a.forEach((u,l)=>{u.value!=null&&(c[o[l]]=u.value,s[o[l]]=u.elapsed??0)});let m=le(c,r);return{elapsed:s,resolvedComponents:m}}var Z=class{options;constructor(t){this.options={...V,...t}}async get(t){let r={...this.options,...t};return Ze(r)}getVersion(){return""}includeComponent(t,r){Je(t,r)}};var Mn=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),Ln=async(e,t)=>{if(!e.ok){let r=await e.text();throw new Error(r)}return t==="file"?e.blob():t==="json"?e.json():t==="text"?e.text():null},Lt=async({url:e,auth:t,body:r,method:n="GET",headers:o={},responseType:i="json"})=>{let a={method:n,headers:Mn(t,o),...r?{body:r instanceof FormData?r:JSON.stringify(r)}:{}},s=await fetch(e,a);return Ln(s,i)},He=e=>Lt({...e,method:"GET"}),me=e=>Lt({...e,method:"POST"});function Ct(e){let t=e?.qbc||!1,r=e?.mas||!1,n=e?.apd||!1,o=e?.scb||null,i=0,a=()=>{t=!1,r=!1,n=!1,o=void 0,i=0},s=()=>{let l=window?.getSelection()?.toString();l&&l.length>0&&(i=Date.now(),t=!0)},c=u=>{let l=u.clipboardData?.getData("text"),d=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&d&&(n=!0)},m=()=>{r=!0;let u=Date.now();if(i){let l=(u-i)/1e3;(o===void 0||l<o)&&(o=l)}};return document?.addEventListener("copy",s),document?.addEventListener("paste",c),window?.addEventListener("blur",m),{get qbc(){return t},get mas(){return r},get apd(){return n},get scb(){return o},reset:a,destroy(){document?.removeEventListener("copy",s),document?.removeEventListener("paste",c),window?.removeEventListener("blur",m)}}}var L=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 C=typeof window>"u"||"Deno"in globalThis;function P(){}function Bt(e,t){return typeof e=="function"?e(t):e}function qt(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function tt(e,t){return typeof e=="function"?e(t):e}function Gt(e,t){return typeof e=="function"?e(t):e}function rt(e,t){let{type:r="all",exact:n,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==H(a,t.options))return!1}else if(!Q(t.queryKey,a))return!1}if(r!=="all"){let c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function nt(e,t){let{exact:r,status:n,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(W(t.options.mutationKey)!==W(i))return!1}else if(!Q(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function H(e,t){return(t?.queryKeyHashFn||W)(e)}function W(e){return JSON.stringify(e,(t,r)=>et(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Q(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Q(e[r],t[r])):!1}function Vt(e,t){if(e===t)return e;let r=Ft(e)&&Ft(t);if(r||et(e)&&et(t)){let n=r?e:Object.keys(e),o=n.length,i=r?t:Object.keys(t),a=i.length,s=r?[]:{},c=0;for(let m=0;m<a;m++){let u=r?m:i[m];(!r&&n.includes(u)||r)&&e[u]===void 0&&t[u]===void 0?(s[u]=void 0,c++):(s[u]=Vt(e[u],t[u]),s[u]===e[u]&&e[u]!==void 0&&c++)}return o===a&&c===o?e:s}return t}function Ft(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function et(e){if(!Ut(e))return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(!Ut(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ut(e){return Object.prototype.toString.call(e)==="[object Object]"}function jt(e){return new Promise(t=>{setTimeout(t,e)})}function Wt(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Vt(e,t):t}function Qt(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function $t(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var ee=Symbol();function de(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ee?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Cn=class extends L{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!C&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=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"}},fe=new Cn;var Fn=class extends L{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!C&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},$=new Fn;function zt(){let e,t,r=new Promise((o,i)=>{e=o,t=i});r.status="pending",r.catch(()=>{});function n(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{n({status:"fulfilled",value:o}),e(o)},r.reject=o=>{n({status:"rejected",reason:o}),t(o)},r}function Un(e){return Math.min(1e3*2**e,3e4)}function ot(e){return(e??"online")==="online"?$.isOnline():!0}var Yt=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function he(e){return e instanceof Yt}function pe(e){let t=!1,r=0,n=!1,o,i=zt(),a=f=>{n||(d(new Yt(f)),e.abort?.())},s=()=>{t=!0},c=()=>{t=!1},m=()=>fe.isFocused()&&(e.networkMode==="always"||$.isOnline())&&e.canRun(),u=()=>ot(e.networkMode)&&e.canRun(),l=f=>{n||(n=!0,e.onSuccess?.(f),o?.(),i.resolve(f))},d=f=>{n||(n=!0,e.onError?.(f),o?.(),i.reject(f))},y=()=>new Promise(f=>{o=w=>{(n||m())&&f(w)},e.onPause?.()}).then(()=>{o=void 0,n||e.onContinue?.()}),E=()=>{if(n)return;let f,w=r===0?e.initialPromise:void 0;try{f=w??e.fn()}catch(p){f=Promise.reject(p)}Promise.resolve(f).then(l).catch(p=>{if(n)return;let b=e.retry??(C?0:3),S=e.retryDelay??Un,I=typeof S=="function"?S(r,p):S,Te=b===!0||typeof b=="number"&&r<b||typeof b=="function"&&b(r,p);if(t||!Te){d(p);return}r++,e.onFail?.(r,p),jt(I).then(()=>m()?void 0:y()).then(()=>{t?d(p):E()})})};return{promise:i,cancel:a,continue:()=>(o?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?E():y().then(E),i)}}function Bn(){let e=[],t=0,r=s=>{s()},n=s=>{s()},o=s=>setTimeout(s,0),i=s=>{t?e.push(s):o(()=>{r(s)})},a=()=>{let s=e;e=[],s.length&&o(()=>{n(()=>{s.forEach(c=>{r(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||a()}return c},batchCalls:s=>(...c)=>{i(()=>{s(...c)})},schedule:i,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{o=s}}}var R=Bn();var ge=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qt(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(C?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var Xt=class extends ge{#e;#t;#r;#n;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Kn(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){let r=Wt(this.state.data,e,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(P).catch(P):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Gt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ee||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||!Kt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#n&&(this.#i?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.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.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){let s=this.observers.find(c=>c.options.queryFn);s&&this.setOptions(s.options)}let r=new AbortController,n=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#i=!0,r.signal)})},o=()=>{let s=de(this.options,t),c={queryKey:this.queryKey,meta:this.meta};return n(c),this.#i=!1,this.options.persister?this.options.persister(s,c,this):s(c)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};n(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 a=s=>{he(s)&&s.silent||this.#o({type:"error",error:s}),he(s)||(this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#n=pe({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(c){a(c);return}this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,c)=>{this.#o({type:"failed",failureCount:s,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.#n.start()}#o(e){let t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qn(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;return he(n)&&n.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),R.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function qn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ot(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kn(e){let t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var te=class extends L{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let n=t.queryKey,o=t.queryHash??H(n,t),i=this.get(o);return i||(i=new Xt({cache:this,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),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(){R.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(r=>rt(t,r))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(r=>rt(e,r)):t}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){R.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){R.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}};var Jt=class extends ge{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Gn(),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.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=pe({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(n,o)=>{this.#n({type:"failed",failureCount:n,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({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",r=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);let o=await this.options.onMutate?.(e);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:r})}let n=await this.#r.start();return await this.#t.config.onSuccess?.(n,e,this.state.context,this),await this.options.onSuccess?.(n,e,this.state.context),await this.#t.config.onSettled?.(n,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(n,null,e,this.state.context),this.#n({type:"success",data:n}),n}catch(n){try{throw await this.#t.config.onError?.(n,e,this.state.context,this),await this.options.onError?.(n,e,this.state.context),await this.#t.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,n,e,this.state.context),n}finally{this.#n({type:"error",error:n})}}finally{this.#t.runNext(this)}}#n(e){let t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),R.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Gn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var re=class extends L{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){let n=new Jt({mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);let t=ye(e);if(typeof t=="string"){let r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){let t=ye(e);if(typeof t=="string"){let r=this.#t.get(t);if(r)if(r.length>1){let n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=ye(e);if(typeof t=="string"){let n=this.#t.get(t)?.find(o=>o.state.status==="pending");return!n||n===e}else return!0}runNext(e){let t=ye(e);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){R.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(r=>nt(t,r))}findAll(e={}){return this.getAll().filter(t=>nt(e,t))}notify(e){R.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(t=>t.state.isPaused);return R.batch(()=>Promise.all(e.map(t=>t.continue().catch(P))))}};function ye(e){return e.options.scope?.id}function it(e){return{onFetch:(t,r)=>{let n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,m=async()=>{let u=!1,l=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=de(t.options,t.fetchOptions),y=async(E,f,w)=>{if(u)return Promise.reject();if(f==null&&E.pages.length)return Promise.resolve(E);let p={queryKey:t.queryKey,pageParam:f,direction:w?"backward":"forward",meta:t.options.meta};l(p);let b=await d(p),{maxPages:S}=t.options,I=w?$t:Qt;return{pages:I(E.pages,b,S),pageParams:I(E.pageParams,f,S)}};if(o&&i.length){let E=o==="backward",f=E?Vn:Zt,w={pages:i,pageParams:a},p=f(n,w);s=await y(w,p,E)}else{let E=e??i.length;do{let f=c===0?a[0]??n.initialPageParam:Zt(n,s);if(c>0&&f==null)break;s=await y(s,f),c++}while(c<E)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=m}}}function Zt(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Vn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var st=class{#e;#t;#r;#n;#s;#i;#o;#a;constructor(e={}){this.#e=e.queryCache||new te,this.#t=e.mutationCache||new re,this.#r=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=fe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=$.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),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(tt(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{let n=r.data;return[t,n]})}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(n.queryHash)?.state.data,a=Bt(t,i);if(a!==void 0)return this.#e.build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return R.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;R.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){let r=this.#e,n={type:"active",...e};return R.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(n,t)))}cancelQueries(e,t={}){let r={revert:!0,...t},n=R.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(P).catch(P)}invalidateQueries(e,t={}){return R.batch(()=>{if(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none")return Promise.resolve();let r={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0},n=R.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,r);return r.throwOnError||(i=i.catch(P)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(P)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let r=this.#e.build(this,t);return r.isStaleByTime(tt(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(P).catch(P)}fetchInfiniteQuery(e){return e.behavior=it(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(P).catch(P)}ensureInfiniteQueryData(e){return e.behavior=it(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return $.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(W(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#n.values()],r={};return t.forEach(n=>{Q(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#s.set(W(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#s.values()],r={};return t.forEach(n=>{Q(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=H(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===ee&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var jn=new st({defaultOptions:{queries:{staleTime:3e4}},queryCache:new te({onError:(e,t)=>{}}),mutationCache:new re}),Ht=jn;var Wn=[{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||"",r=e.includes("Mac")&&t.includes("Linux")||e.includes("Win")&&t.includes("Mac")||t===""||t==="Unknown";return{value:t,triggered:r}}},{name:"webglSoftwareRenderer",weight:2,async check(){let e=null,t=null,r=!1;try{let n=document.createElement("canvas"),o=n.getContext("webgl")||n.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 a=t.toLowerCase(),s=e.toLowerCase();r=a.includes("swiftshader")||a.includes("llvmpipe")||a.includes("softwar")||a.includes("basic render")||a.includes("vmware")||a.includes("virtualbox")||s.includes("vmware")||s.includes("parallels")}}}catch{}return{value:{vendor:e,renderer:t},triggered:r}}},{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(n=>setTimeout(n,50));let t=performance.now()-e,r=t<30||t>80;return{value:t.toFixed(2),triggered:r}}},{name:"timerJitter",weight:1,async check(){let e=[];for(let n=0;n<10;n++){let o=performance.now();await new Promise(a=>setTimeout(a,10));let i=performance.now();e.push(i-o)}let t=Math.sqrt(e.map(n=>(n-10)**2).reduce((n,o)=>n+o)/e.length),r=t>5;return{value:t.toFixed(3),triggered:r}}},{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 n=(await e.startRendering()).getChannelData(0).reduce((i,a)=>i+Math.abs(a),0),o=n<100;return{value:n,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 n=[...e.toDataURL()].reduce((i,a)=>(i+a.charCodeAt(0))%9999999,0);return{value:n,triggered:n===0||n===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(r=>r.label.toLowerCase().includes("virtual"));return{value:e.map(r=>r.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=r=>{if(!r||!r.candidate){e({value:"no candidate",triggered:!0});return}let n=r.candidate.candidate.toLowerCase(),o=n.includes("10.0.2.")||n.includes("172.16.")||n.includes("192.168.56.");e({value:n,triggered:o})},t.createOffer().then(r=>t.setLocalDescription(r))})}},{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 er({threshold:e=6}={}){let t={},r=0;for(let n of Wn){let o=await n.check();t[n.name]=o,o.triggered&&(r+=n.weight)}return{isLikelyVM:r>=e,score:r,threshold:e,signals:t}}var Qn=[{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 n=await navigator.userAgentData?.getHighEntropyValues?.(["platform","brands"]);t=JSON.stringify(n)}catch{}let r=e?.includes("Mac")&&t?.includes("Windows")||e?.includes("Win")&&t?.includes("Mac")||t&&t.length>0&&!e;return{value:{ua:e,brandInfo:t},triggered:r}}},{name:"timezoneLocaleMismatch",weight:1,async check(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone,t=navigator.language||"",r=t.startsWith("en")&&e==="Asia/Shanghai"||t.startsWith("zh")&&e==="America/New_York"||e===void 0;return{value:{tz:e,lang:t},triggered:r}}},{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(),r=e();return{value:{a:t,b:r},triggered:t!==r}}},{name:"webglNoise",weight:2,async check(){try{let t=document.createElement("canvas").getContext("webgl");if(!t)return{value:"no-webgl",triggered:!0};let r=t.getExtension("WEBGL_debug_renderer_info");if(!r)return{value:"no-debug-extension",triggered:!1};let n=t.getParameter(r.UNMASKED_VENDOR_WEBGL),o=t.getParameter(r.UNMASKED_RENDERER_WEBGL),i=n===""||o===""||n?.includes(" ")===!1||o?.includes(" ")===!1;return{value:{v:n,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,r=window.devicePixelRatio,n=e===1920&&r===1&&t===1080||r%1!==0&&r%1!==.5;return{value:{w:e,h:t,dpr:r},triggered:n}}},{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,debuggerLatency:!1,consoleSpeed:!1},r=160,n=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(n>r||o>r)&&(t.viewportBreakpoint=!0);function i(c=200){let m=performance.now();debugger;return performance.now()-m>c}t.debuggerLatency=i();async function a(c=50){return new Promise(m=>{let u=performance.now();console.log("%c ","font-size:3000px");let l=performance.now();m(l-u>c)})}t.consoleSpeed=await a();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(),r=["incogniton","multilogin","morelogin","adspect","kameleo","goLogin"].some(n=>e?.includes(n));return{value:e,triggered:r}}}];async function tr({threshold:e=5}={}){let t={},r=0;for(let o of Qn){let i=await o.check();t[o.name]=i,i.triggered&&(r+=o.weight)}let n=Math.min(1,r/15);return{result:n>=.5||t.knownAntiDetectBrowser?.triggered,anomalyScore:n,antiDetectBrowser:t.knownAntiDetectBrowser?.triggered||!1,signals:t}}function $n(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function zn(){let e=navigator.userAgent,t=$n();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 Yn=[{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()),r=indexedDB.open(t,1);r.onupgradeneeded=n=>{let o=n.target.result;try{o.createObjectStore("t",{autoIncrement:!0}).put(new Blob),e({triggered:!1,value:"ok"})}catch(i){let a=i?.message??String(i);e({triggered:a.includes("are not yet supported"),value:a})}finally{o.close(),indexedDB.deleteDatabase(t)}},r.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 n=window?.performance?.memory?.jsHeapSizeLimit??1073741824;navigator.webkitTemporaryStorage.queryUsageAndQuota((o,i)=>{let a=Math.round(i/1048576),s=Math.round(n/(1024*1024))*2;e({triggered:a<s,value:{quotaMB:a,limitMB:s}})},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 rr(){let e=zn(),t={},r=0;for(let n of Yn){if(n.browser!==e)continue;let o=await n.check();t[n.name]=o,o.triggered&&(r+=n.weight)}return{isPrivate:r>0,browserName:e,score:r,signals:t}}typeof window<"u"&&(window.detectIncognito=rr);var nr=rr;var or="dtect_security_sdk_state",ir=typeof window<"u",sr={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Ee={state:{...sr},securityKeys:{behaviorKey:"",automationKey:""}};function ar(){if(!ir)return Ee;try{let e=sessionStorage.getItem(or);if(!e)return Ee;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Ee:{state:{...sr,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:""}}}catch{return Ee}}function U(e){if(ir)try{let t=Date.now()+864e5,r={...e,expiresAt:t};sessionStorage.setItem(or,JSON.stringify(r))}catch{}}function cr(e){return e.token||z()}var we,B="https://api.dtect.io/security",Ie=`${B}/client/check`,F="",K="",lr="0.0.18",mr,ur,Xn="20000000-aaaa-bbbb-cccc-000000000002",ve;var{state:g,securityKeys:{automationKey:k,behaviorKey:M}}=ar(),Jn=bt,ne;async function Zn({clientId:e,apiKey:t,endpoint:r}){if(Re({automationKey:k,behaviorKey:M}))return{automationKey:k,behaviorKey:M};let n=await Ht.fetchQuery({queryKey:["getClientConfig",e,t],queryFn:()=>He({url:`${r}/client/config`,headers:{"client-id":F,"x-api-key":K}})});if(!Re(n))throw new Error;return k=n.automationKey,M=n.behaviorKey,U({state:g,securityKeys:n}),n}function dt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(v.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(v.RATE_LIMIT_REACHED);switch(e?.message){case G.ERROR_RATE_LIMIT:throw new Error(v.RATE_LIMIT_REACHED);default:throw new Error(v.INTERNAL_SERVER_ERROR)}}throw new Error(v.FAILED_TO_GET_SECURITY_TOKEN)}function q(){if(hr(g)&&Re({automationKey:k,behaviorKey:M}))return!0;let e=be(),t=document.querySelector("#dtect-h-captcha");return!!we&&!!(t||e)}function dr(){return!!(F&&K)}function Hn(){return new Promise(e=>{let t=()=>{window?.hcaptcha?e():requestAnimationFrame(t)};t()})}var be=()=>window?.location?.href?.includes("localhost")||window?.location?.href?.includes("file:///");async function eo({behaviorKey:e}){if(we=await G.load({apiKey:e,endpoint:["https://fp.dtect.io",G.defaultEndpoint],scriptUrlPattern:["https://fp.dtect.io/web/v<version>/<apiKey>/loader_v<loaderVersion>.js",G.defaultScriptUrlPattern]}),be()||(await Hn(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:k,size:"invisible"})),!we)throw new Error(v.SDK_INIT_ERROR)}async function to(){if(g.tokens)return g.tokens;let e=new Promise(o=>{let i=we?.get();o(i)}),t=new Promise(async o=>{be()&&o({response:Xn});let a=await window?.hcaptcha?.execute({async:!0});o(a)}),[r,n]=await Promise.all([t,e]);return g.tokens={behaviorRequestId:n?.requestId,behaviorToken:n?.sealedResult,automationToken:r?.response},g.tokens}function ro(e){let t=e?.projectId,r=e?.visitorId||z();return(typeof e?.projectId=="number"||typeof e?.visitorId=="number")&&(t=`${e?.projectId}`,r=`${e?.visitorId}`),{visitorId:r,projectId:t}}function ft(e){if(g.projectId&&g.visitorId)return{visitorId:g.visitorId,projectId:g.projectId};let{projectId:t,visitorId:r}=ro(e);return{projectId:t,visitorId:r}}async function fr(e,t){if(!q())throw new Error(v.NOT_INITIALIZED);if(!dr())throw new Error(v.MISSING_CREDENTIALS);let{projectId:r,visitorId:n}=ft(e);if(g.projectId=r,g.visitorId=n,!e||!r?.trim())throw new Error(v.FAILED_TO_GET_SECURITY_RESULT);try{let o=await to(),i=new Z,[a,s,c,m]=await Promise.allSettled([i.get(),er(),tr(),nr()]);if(o?.behaviorToken&&o?.behaviorRequestId&&o?.automationToken){let u={behaviorToken:o.behaviorToken,automationToken:o.automationToken,behaviorRequestId:o.behaviorRequestId,entryLink:window?.location?.href,securitySettings:e.securitySettings,metaData:e.metaData,vmDtectResults:s?.value,tamperingDtectResults:c?.value,incognitoDtectResults:m?.value,deviceIdResults:a?.value};g.clientData=u;let l={...e,projectId:r,visitorId:n,clientData:u,version:"0.0.18",token:g.token,questionData:g.questionData,aiCheckData:g.aiCheckData};ur=performance.now();let d=(ur-mr).toFixed(),y=await me({url:`${t}?clientId=${F}&diff=${d}`,body:{...l},headers:{"client-id":F,"x-api-key":K}});if("token"in y||"results"in y)return U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),y}throw new Error(v.INTERNAL_SERVER_ERROR)}catch(o){if(o instanceof Error){if(o?.message?.includes("maintenance_mode"))throw new Error(v.MAINTENANCE_MODE);if(o?.message?.includes("rate-limited")||o?.message?.includes("429"))throw new Error(v.RATE_LIMIT_REACHED);switch(o?.message){case G.ERROR_RATE_LIMIT:throw new Error(v.RATE_LIMIT_REACHED);default:throw new Error(v.INTERNAL_SERVER_ERROR)}}throw new Error(v.FAILED_TO_GET_SECURITY_RESULT)}}async function at(e){return await fr(e,`${B}/client/check/result`)}async function ct(e){return await fr(e,`${B}/client/check`)}async function ut(e){if(!q())throw new Error(v.NOT_INITIALIZED);let{respondentType:t,language:r}=e;try{let n=await He({url:`${B}/client/quality-questions/${t}/${r}`,headers:{"client-id":F,"x-api-key":K}});if(n)return n;throw new Error(v.INTERNAL_SERVER_ERROR)}catch(n){dt(n)}}async function lt(e){if(!q())throw new Error(v.NOT_INITIALIZED);g.questionData||(g.questionData={questions:e.questions});let{visitorId:t,projectId:r}=ft(e);g.visitorId=t,g.projectId=r;try{let n=await me({url:Ie,headers:{"client-id":F,"x-api-key":K},body:{token:g.token,visitorId:t,projectId:r,version:lr,questionData:g.questionData,aiCheckData:g.aiCheckData,clientData:g.clientData}});if(n)return U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),n;throw new Error(v.INTERNAL_SERVER_ERROR)}catch(n){dt(n)}}async function mt(e){if(!q())throw new Error(v.NOT_INITIALIZED);g.aiCheckData={timeTakenSeconds:e.timeTakenSeconds,qbc:e.qbc||ne.qbc,mas:e.mas||ne.mas,scb:e.scb||ne.scb,apd:e.apd||ne.apd};let{visitorId:t,projectId:r}=ft(e);g.visitorId=t,g.projectId=r;try{let n=await me({url:Ie,headers:{"client-id":F,"x-api-key":K},body:{token:g.token,visitorId:t,projectId:r,version:lr,clientData:g.clientData,questionData:g.questionData,aiCheckData:g.aiCheckData}});if(n)return U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),n;throw new Error(v.INTERNAL_SERVER_ERROR)}catch(n){dt(n)}}function no(){let e=document.querySelector("head"),t=document.querySelector("body");if(!be()){t?.insertAdjacentHTML("beforeend",'<div id="dtect-h-captcha" ></div>');let n=document.createElement("script");n.setAttribute("src","https://js.hcaptcha.com/1/api.js"),n.setAttribute("async","true"),n.setAttribute("defer","true"),e?.append(n)}}function Re(e){return e?.automationKey&&e?.behaviorKey}function hr(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function oo(e){if(!e?.clientId||!e?.apiKey)throw new Error(v.MISSING_CREDENTIALS);mr=performance.now();let{clientId:t,apiKey:r,endpoint:n="https://api.dtect.io/security",includeResults:o}=e;B=n,Ie=`${B}/client/check`;let i=cr(g);if(g.isLoading){if(q())return ve;throw new Error(v.DUPLICATE_INITIALIZATION)}if(ne=Ct(g.aiCheckData),F=t,K=r,o&&(Ie=`${B}/client/check/result`),g={...g,isLoading:!0,token:i||""},hr(g)&&Re({automationKey:k,behaviorKey:M}))return g={...g,isLoading:!1,token:i},U({state:g,securityKeys:{automationKey:k,behaviorKey:M}}),{getSecurityResult:at,getSecurityToken:ct,isAIUsageDetected:mt,checkQualityQuestions:lt,getQualityQuestions:ut,LanguageCodes:Y,QualityQuestionsRespondentTypes:X};if(!dr())throw new Error(v.MISSING_CREDENTIALS);if(q())return ve;no();try{let s=await Zn({clientId:t,apiKey:r,endpoint:n});if(q())throw new Error;return eo({behaviorKey:s.behaviorKey}).then(()=>({getSecurityResult:at,getSecurityToken:ct,SecurityAPIError:Jn,isAIUsageDetected:mt,checkQualityQuestions:lt,getQualityQuestions:ut,LanguageCodes:Y,QualityQuestionsRespondentTypes:X})).catch(c=>{throw new Error(c.message)})}catch(s){if(s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(v.MAINTENANCE_MODE);if([v.INVALID_API_KEY,v.UNAUTHORIZED].includes(s?.message))throw new Error(v.INVALID_CREDENTIALS)}throw new Error(v.SDK_INIT_ERROR)}finally{g={...g,isLoading:!1,token:i},U({state:g,securityKeys:{automationKey:k,behaviorKey:M}})}}ve={init:oo,getSecurityResult:at,getSecurityToken:ct,isAIUsageDetected:mt,checkQualityQuestions:lt,getQualityQuestions:ut,QualityQuestionsRespondentTypes:X,LanguageCodes:Y};var Va=ve;export{Y as LanguageCodes,X as QualityQuestionsRespondentTypes,Jn as SecurityAPIError,lt as checkQualityQuestions,Va as default,ut as getQualityQuestions,at as getSecurityResult,ct as getSecurityToken,oo as init,mt 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 h=0;h<i;h++){let E=h*a;s[h*4]=0,s[h*4+1]=0,s[h*4+2]=Math.cos(E)*(_.width/2),s[h*4+3]=Math.sin(E)*(_.height/2)}let c=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,c),p.bufferData(p.ARRAY_BUFFER,s,p.STATIC_DRAW);let m=p.getAttribLocation(o,"position");p.enableVertexAttribArray(m),p.vertexAttribPointer(m,2,p.FLOAT,!1,0,0),p.viewport(0,0,_.width,_.height),p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.LINES,0,i*2);let u=new Uint8ClampedArray(_.width*_.height*4);return p.readPixels(0,0,_.width,_.height,p.RGBA,p.UNSIGNED_BYTE,u),new ImageData(u,_.width,_.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],m=n(r[c]);m&&(i&&(i+=","),i+=JSON.stringify(c)+":"+m)}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(f=>f.replace(/extmap:\d+ /,"")))].sort(),m=f=>{let I=a.match(new RegExp(`m=${f} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return I?I[1].split(" "):[]},u=(f,I)=>I.map(g=>{let A=new RegExp(`(rtpmap|fmtp|rtcp-fb):${g} (.+)`,"g"),k=[...a.matchAll(A)];if(!k.length)return null;let w={};return k.forEach(De=>{let[so,Se,_e]=De,Pe=_e.split("/");Se==="rtpmap"?(w.mimeType=`${f}/${Pe[0]}`,w.clockRate=+Pe[1],f==="audio"&&(w.channels=+Pe[2]||1)):Se==="rtcp-fb"?(w.feedbackSupport=w.feedbackSupport||[],w.feedbackSupport.push(_e)):Se==="fmtp"&&(w.sdpFmtpLine=_e)}),w}).filter(Boolean),l=u("audio",m("audio")),h=u("video",m("video")),E={audio:{count:l.length,hash:D(N(l))},video:{count:h.length,hash:D(N(h))},extensionsHash:D(N(c))},y=await new Promise(f=>{let I=setTimeout(()=>{r.removeEventListener("icecandidate",g),r.close(),f({supported:!0,...E,timeout:!0})},3e3),g=A=>{let k=A.candidate;!k||!k.candidate||(clearTimeout(I),r.removeEventListener("icecandidate",g),r.close(),f({supported:!0,...E,candidateType:k.type||""}))};r.addEventListener("icecandidate",g)});e({details:y,hash:D(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(!_r(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>"),Pr(),...kr()],r=[],o="";n.forEach((s,a)=>{let c=xr(s,t);r.push({width:c.dimensions.width,height:c.dimensions.height}),a===0&&c.fontInfo&&(o=D(N(c.fontInfo)))});let i={fontStyleHash:o,dimensions:r};e({details:i,hash:D(N(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}})}function _r(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 Pr(){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 kr(){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 xr(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 Nr=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(m=>{let u=h=>h.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[u(m.voiceURI||""),u(m.name||""),u(m.lang||""),m.localService?"1":"0",m.default?"1":"0"].join(",")});a.sort();let c={voiceCount:s.length,voicesHash:D(N(a))};e({details:c,hash:D(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)},Nr);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={},Lt={timeout:"true"},et=(e,t,n)=>{He[e]=t};function Mr(e,t){return new Promise(n=>{setTimeout(()=>n(t),e)})}function Ct(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})),Mr(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 h=l;n={name:h.name||"unknown",version:h.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 h of l){let E=!("browsers"in h),y=!E&&h.browsers?.some(f=>{let I=f.match(/(.+?)(>=)(\d+)/);if(I){let[,g,,A]=I,k=parseInt(A,10);return r===g&&i>=k}return r===f});(E||y)&&s.push(...h.exclude)}}function m(u,l=""){let h={};for(let[E,y]of Object.entries(u)){let f=l?`${l}.${E}`:E;if(typeof y=="object"&&!Array.isArray(y)&&y!==null){let I=m(y,f);Object.keys(I).length>0&&(h[E]=I)}else{let I=s.some(A=>f.startsWith(A)),g=c.some(A=>f.startsWith(A));(!I||g)&&(h[E]=y)}}return h}return m(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:I,resolvedComponents:g}=await Ft(Mt,t);s=g,a=I}let c={...o,...a},m=t.performance?{elapsed:c}:{},u=fe({},t),l={...i,...u},h={};return{thumbmark:D(N(l)),components:l,info:h,version:"",...m,...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 Ct(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 m=fe(c,n);return{elapsed:a,resolvedComponents:m}}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 Lr=(e,t={})=>({"Content-Type":"application/json",...e?.accessToken&&{Authorization:`Bearer ${e?.accessToken}`},...t}),Cr=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:Lr(t,o),...n?{body:n instanceof FormData?n:JSON.stringify(n)}:{}},a=await fetch(e,s);return Cr(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"),h=u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement;l&&h&&(r=!0)},m=()=>{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",m),{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",m)}}}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 m=0;m<s;m++){let u=n?m:i[m];(!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 Fr=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 Fr;var Ur=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 Ur;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 Br(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=f=>{r||(h(new Zt(f)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},m=()=>ge.isFocused()&&(e.networkMode==="always"||Y.isOnline())&&e.canRun(),u=()=>at(e.networkMode)&&e.canRun(),l=f=>{r||(r=!0,e.onSuccess?.(f),o?.(),i.resolve(f))},h=f=>{r||(r=!0,e.onError?.(f),o?.(),i.reject(f))},E=()=>new Promise(f=>{o=I=>{(r||m())&&f(I)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let f,I=n===0?e.initialPromise:void 0;try{f=I??e.fn()}catch(g){f=Promise.reject(g)}Promise.resolve(f).then(l).catch(g=>{if(r)return;let A=e.retry??(K?0:3),k=e.retryDelay??Br,w=typeof k=="function"?k(n,g):k,De=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,g);if(t||!De){h(g);return}n++,e.onFail?.(n,g),$t(w).then(()=>m()?void 0:E()).then(()=>{t?h(g):y()})})};return{promise:i,cancel:s,continue:()=>(o?.(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?y():E().then(y),i)}}function qr(){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=qr();var Ie=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 Ie{#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=Gr(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,...Kr(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 Kr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:at(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gr(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 Ie{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Vr(),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 Vr(){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=we(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=we(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=we(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=we(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 we(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,m=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)})},h=pe(t.options,t.fetchOptions),E=async(y,f,I)=>{if(u)return Promise.reject();if(f==null&&y.pages.length)return Promise.resolve(y);let g={queryKey:t.queryKey,pageParam:f,direction:I?"backward":"forward",meta:t.options.meta};l(g);let A=await h(g),{maxPages:k}=t.options,w=I?Jt:Yt;return{pages:w(y.pages,A,k),pageParams:w(y.pageParams,f,k)}};if(o&&i.length){let y=o==="backward",f=y?jr:tn,I={pages:i,pageParams:s},g=f(r,I);a=await E(I,g,y)}else{let y=e??i.length;do{let f=c===0?s[0]??r.initialPageParam:tn(r,a);if(c>0&&f==null)break;a=await E(a,f),c++}while(c<y)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=m}}}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 jr(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 Qr=new ut({defaultOptions:{queries:{staleTime:3e4}},queryCache:new oe({onError:(e,t)=>{}}),mutationCache:new ie}),nn=Qr;var Wr=[{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=6}={}){let t={},n=0;for(let r of Wr){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 $r=[{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,debuggerLatency:!1,consoleSpeed:!1},n=160,r=window.outerWidth-window.innerWidth,o=window.outerHeight-window.innerHeight;(r>n||o>n)&&(t.viewportBreakpoint=!0);function i(c=200){let m=performance.now();debugger;return performance.now()-m>c}t.debuggerLatency=i();async function s(c=50){return new Promise(m=>{let u=performance.now();console.log("%c ","font-size:3000px");let l=performance.now();m(l-u>c)})}t.consoleSpeed=await s();let a=Object.values(t).some(Boolean);setTimeout(()=>{e({value:a,triggered:a})},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 $r){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 zr(){let e=0;try{0 .toFixed(-1)}catch(t){e=t.message.length}return e}function Yr(){let e=navigator.userAgent,t=zr();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 Jr=[{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=Yr(),t={},n=0;for(let r of Jr){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="dtect_security_sdk_state",un=typeof window<"u",ln={isLoading:!1,token:"",visitorId:"",projectId:"",questionData:null,clientData:null,aiCheckData:null,tokens:null},Re={state:{...ln},securityKeys:{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}};function mn(){if(!un)return Re;try{let e=sessionStorage.getItem(cn);if(!e)return Re;let t=JSON.parse(e);return t.expiresAt&&t.expiresAt<Date.now()?Re:{state:{...ln,...t.state},securityKeys:t.securityKeys||{behaviorKey:"",automationKey:"",dtectSignalEnabled:!1,dtectAutomationSignalEnabled:!1}}}catch{return Re}}function G(e){if(un)try{let t=Date.now()+864e5,n={...e,expiresAt:t};sessionStorage.setItem(cn,JSON.stringify(n))}catch{}}function dn(e){return e.token||X()}async function P(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 ve,v="https://api.dtect.io/security",be=`${v}/client/check`,T="",V="",fn="0.0.20";var Xr="20000000-aaaa-bbbb-cccc-000000000002",Te;var{state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}}=mn(),Zr=Ot,se;async function Hr({clientId:e,apiKey:t,endpoint:n}){if(Ae({automationKey:C,behaviorKey:U,dtectAutomationSignalEnabled:x}))return{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x};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 C=r.automationKey,U=r.behaviorKey,B=r.dtectSignalEnabled,x=r.dtectAutomationSignalEnabled,G({state:d,securityKeys:r}),r}function pt(e){if(e instanceof Error){if(e?.message?.includes("maintenance_mode"))throw new Error(R.MAINTENANCE_MODE);if(e?.message?.includes("rate-limited"))throw new Error(R.RATE_LIMIT_REACHED);switch(e?.message){case j.ERROR_RATE_LIMIT:throw new Error(R.RATE_LIMIT_REACHED);default:throw new Error(R.INTERNAL_SERVER_ERROR)}}throw new Error(R.FAILED_TO_GET_SECURITY_TOKEN)}function J(){if(gn(d)&&Ae({automationKey:C,behaviorKey:U,dtectAutomationSignalEnabled:x}))return!0;let e=Oe(),t=document.querySelector("#dtect-h-captcha");return!!ve&&!!(!x&&t||e||x)}function hn(){return!!(T&&V)}function eo(){return new Promise(e=>{let t=()=>{window?.hcaptcha?e():requestAnimationFrame(t)};t()})}var Oe=()=>window?.location?.href?.includes("localhost")||window?.location?.href?.includes("file:///");async function to({behaviorKey:e,dtectAutomationSignalEnabled:t=!1}){if(ve=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]}),!Oe()&&!t&&(await eo(),await window.hcaptcha.render("dtect-h-captcha",{sitekey:C,size:"invisible"})),!ve)throw new Error(R.SDK_INIT_ERROR)}async function no(){let e=performance.now();if(d.tokens){let c=(performance.now()-e).toFixed();return P(`getTokens finishes in ${c}ms`,"info",{function:"getTokens",endpoint:v,diff:c,token:d.token,clientId:T}),d.tokens}let t=new Promise(a=>{let c=ve?.get();a(c)}),n=new Promise(async a=>{Oe()&&a({response:Xr});let m=await window?.hcaptcha?.execute({async:!0});a(m)}),[r,o]=await Promise.all([x?{response:""}:n,t]);d.tokens={behaviorRequestId:o?.requestId,behaviorToken:o?.sealedResult,automationToken:r?.response};let s=(performance.now()-e).toFixed();return P(`getTokens finishes in ${s}ms`,"info",{function:"getTokens",endpoint:v,diff:s,token:d.token,clientId:T}),d.tokens}function ro(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(d.projectId&&d.visitorId)return{visitorId:d.visitorId,projectId:d.projectId};let{projectId:t,visitorId:n}=ro(e);return{projectId:t,visitorId:n}}async function pn(e,t){let n=performance.now();if(!J())throw new Error(R.NOT_INITIALIZED);if(!hn())throw new Error(R.MISSING_CREDENTIALS);let{projectId:r,visitorId:o}=gt(e);if(d.projectId=r,d.visitorId=o,!e||!r?.trim())throw new Error(R.FAILED_TO_GET_SECURITY_RESULT);let i;try{let s=await no();if(B){let a=new te,[c,m,u,l]=await Promise.allSettled([a.get(),rn(),on(),an()]);i={deviceRes:c,vmDtectResults:m,tamperingDtectResults:u,incognitoDtectResults:l}}if(s?.behaviorToken&&s?.behaviorRequestId&&(x||!x&&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}:{}};d.clientData=a;let c={...e,projectId:r,visitorId:o,clientData:a,version:"0.0.20",token:d.token,questionData:d.questionData,aiCheckData:d.aiCheckData},m=await he({url:`${t}`,body:{...c},headers:{"client-id":T,"x-api-key":V}});if("token"in m||"results"in m){G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}});let l=(performance.now()-n).toFixed();return P(`getResultBase finishes in ${l}ms`,"info",{function:"getResultBase",endpoint:v,diff:l,token:d.token,clientId:T}),m}}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(s){let c=(performance.now()-n).toFixed();if(P("getResultBase error","error",{function:"getResultBase",endpoint:v,error:s,diff:c,token:d.token,clientId:T}),s instanceof Error){if(s?.message?.includes("maintenance_mode"))throw new Error(R.MAINTENANCE_MODE);if(s?.message?.includes("rate-limited")||s?.message?.includes("429"))throw new Error(R.RATE_LIMIT_REACHED);switch(s?.message){case j.ERROR_RATE_LIMIT:throw new Error(R.RATE_LIMIT_REACHED);default:throw new Error(R.INTERNAL_SERVER_ERROR)}}throw new Error(R.FAILED_TO_GET_SECURITY_RESULT)}}async function lt(e){return await pn(e,`${v}/client/check/result`)}async function mt(e){return await pn(e,`${v}/client/check`)}async function dt(e){let t=performance.now();if(!J())throw new Error(R.NOT_INITIALIZED);let{respondentType:n,language:r}=e;try{let o=await nt({url:`${v}/client/quality-questions/${n}/${r}`,headers:{"client-id":T,"x-api-key":V}});if(o){let s=(performance.now()-t).toFixed();return P(`getQualityQuestions finishes in ${s}ms`,"info",{function:"getQualityQuestions",endpoint:v,diff:s,token:d.token,clientId:T}),o}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();P("getQualityQuestions error","error",{endpoint:v,error:o,diff:s,token:d.token,clientId:T}),pt(o)}}async function ft(e){let t=performance.now();if(!J())throw new Error(R.NOT_INITIALIZED);d.questionData||(d.questionData={questions:e.questions});let{visitorId:n,projectId:r}=gt(e);d.visitorId=n,d.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:d.token,visitorId:n,projectId:r,version:fn,questionData:d.questionData,aiCheckData:d.aiCheckData,clientData:d.clientData}});if(o){G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}});let s=(performance.now()-t).toFixed();return P(`checkQualityQuestions finishes in ${s}ms`,"info",{function:"checkQualityQuestions",endpoint:v,diff:s,token:d.token,clientId:T}),o}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();P("checkQualityQuestions error","error",{endpoint:v,error:o,diff:s,token:d.token,clientId:T}),pt(o)}}async function ht(e){let t=performance.now();if(!J())throw new Error(R.NOT_INITIALIZED);d.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);d.visitorId=n,d.projectId=r;try{let o=await he({url:be,headers:{"client-id":T,"x-api-key":V},body:{token:d.token,visitorId:n,projectId:r,version:fn,clientData:d.clientData,questionData:d.questionData,aiCheckData:d.aiCheckData}});if(o){G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}});let s=(performance.now()-t).toFixed();return P(`isAIUsageDetected finishes in ${s}ms`,"info",{function:"isAIUsageDetected",endpoint:v,diff:s,token:d.token,clientId:T}),o}throw new Error(R.INTERNAL_SERVER_ERROR)}catch(o){let s=(performance.now()-t).toFixed();P("isAIUsageDetected error","error",{endpoint:v,error:o,diff:s,token:d.token,clientId:T}),pt(o)}}function oo(){let e=performance.now(),t=document.querySelector("head"),n=document.querySelector("body");if(!Oe()){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 gn(e){let t=e.tokens;return!!(t&&t.behaviorToken&&t.behaviorRequestId&&t.automationToken)}async function io(e){let t=performance.now();if(!e?.clientId||!e?.apiKey)throw P(R.MISSING_CREDENTIALS,"error",{endpoint:v,...e}),new Error(R.MISSING_CREDENTIALS);let{clientId:n,apiKey:r,endpoint:o="https://api.dtect.io/security",includeResults:i}=e;v=o,be=`${v}/client/check`;let s=dn(d);if(d.isLoading){if(J())return Te;throw P(R.DUPLICATE_INITIALIZATION,"error",{endpoint:v,clientId:n,apiKey:r,token:d.token}),new Error(R.DUPLICATE_INITIALIZATION)}if(se=Bt(d.aiCheckData),T=n,V=r,i&&(be=`${v}/client/check/result`),d={...d,isLoading:!0,token:s||""},gn(d)&&Ae({automationKey:C,behaviorKey:U,dtectAutomationSignalEnabled:x}))return d={...d,isLoading:!1,token:s},G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}}),{getSecurityResult:lt,getSecurityToken:mt,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:dt,LanguageCodes:Z,QualityQuestionsRespondentTypes:H};if(!hn())throw P(R.MISSING_CREDENTIALS,"error",{endpoint:v,...e}),new Error(R.MISSING_CREDENTIALS);if(J())return Te;try{let c=await Hr({clientId:n,apiKey:r,endpoint:o});return c.dtectAutomationSignalEnabled||oo(),to({behaviorKey:c.behaviorKey,dtectAutomationSignalEnabled:c.dtectAutomationSignalEnabled}).then(()=>{let u=(performance.now()-t).toFixed();return P(`init() finishes ${u}ms`,"info",{endpoint:v,function:"init",diff:u,token:d.token,clientId:T}),{getSecurityResult:lt,getSecurityToken:mt,SecurityAPIError:Zr,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:dt,LanguageCodes:Z,QualityQuestionsRespondentTypes:H}}).catch(m=>{throw new Error(m.message)})}catch(c){if(c instanceof Error){if(P(c.message,"error",{function:"init",endpoint:v,error:c,token:d.token,clientId:T}),c?.message?.includes("maintenance_mode"))throw new Error(R.MAINTENANCE_MODE);if([R.INVALID_API_KEY,R.UNAUTHORIZED].includes(c?.message))throw new Error(R.INVALID_CREDENTIALS)}throw new Error(R.SDK_INIT_ERROR)}finally{d={...d,isLoading:!1,token:s},G({state:d,securityKeys:{automationKey:C,behaviorKey:U,dtectSignalEnabled:B,dtectAutomationSignalEnabled:x}})}}Te={init:io,getSecurityResult:lt,getSecurityToken:mt,isAIUsageDetected:ht,checkQualityQuestions:ft,getQualityQuestions:dt,QualityQuestionsRespondentTypes:H,LanguageCodes:Z};var Wa=Te;export{Z as LanguageCodes,H as QualityQuestionsRespondentTypes,Zr as SecurityAPIError,ft as checkQualityQuestions,Wa as default,dt as getQualityQuestions,lt as getSecurityResult,mt as getSecurityToken,io as init,ht as isAIUsageDetected};
|