@haystackeditor/cli 0.24.1 → 0.25.0
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/assets/capture/capture.cb4204fcc997d8e8.js +2 -0
- package/dist/assets/capture/release.json +4 -0
- package/dist/assets/telemetry/runtime.cjs +829 -1254
- package/dist/capture/adapters/client-routes.js +383 -0
- package/dist/capture/adapters/django.js +127 -0
- package/dist/capture/adapters/files.js +77 -0
- package/dist/capture/adapters/index.js +64 -0
- package/dist/capture/adapters/jsx-edit.js +81 -0
- package/dist/capture/adapters/next.js +327 -0
- package/dist/capture/adapters/nuxt.js +192 -0
- package/dist/capture/adapters/rails.js +171 -0
- package/dist/capture/adapters/react-router.js +432 -0
- package/dist/capture/adapters/sveltekit.js +102 -0
- package/dist/capture/adapters/types.js +4 -0
- package/dist/capture/adapters/vite.js +121 -0
- package/dist/capture/app-config.js +106 -0
- package/dist/capture/consent.js +127 -0
- package/dist/capture/csp.js +331 -0
- package/dist/capture/html.js +74 -0
- package/dist/capture/js-ast.js +400 -0
- package/dist/capture/manifest.js +95 -0
- package/dist/capture/project.js +177 -0
- package/dist/capture/route-pattern.js +119 -0
- package/dist/capture/script-release.js +47 -0
- package/dist/capture/tag.js +74 -0
- package/dist/capture-step.js +53 -0
- package/dist/commands/capture-brief.js +92 -0
- package/dist/commands/capture-contract.js +46 -0
- package/dist/commands/capture-manifest.js +78 -0
- package/dist/commands/init-capture.js +409 -0
- package/dist/commands/init-telemetry.js +1011 -0
- package/dist/commands/init.js +68 -5
- package/dist/commands/server-telemetry-contract.d.ts +66 -0
- package/dist/commands/server-telemetry-contract.js +127 -0
- package/dist/commands/telemetry-token.js +238 -0
- package/dist/commands/telemetry.d.ts +161 -8
- package/dist/commands/telemetry.js +940 -158
- package/dist/commands/verify-onboarding.js +5 -1
- package/dist/commands/verify.js +54 -7
- package/dist/index.js +83 -6
- package/dist/schema.js +2 -2
- package/dist/telemetry/next-loader.cjs +66 -9
- package/dist/telemetry/next.d.ts +11 -3
- package/dist/telemetry/next.js +95 -15
- package/dist/telemetry/typed-source.d.ts +47 -0
- package/dist/telemetry/typed-source.js +379 -0
- package/package.json +4 -2
- package/schemas/init.v1.json +63 -4
- package/schemas/pre-verify.v1.json +60 -3
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* Haystack capture tag, CAPTURE-V1: github.com/haystackeditor/haystack-review packages/haystack-capture */
|
|
2
|
+
try{"use strict";(()=>{var N="capture-v1",Ke=/^hc_[a-z2-7]{26}$/;var He="https://c.haystack.sh/v1/events";var Xe=["0","1","3","10","30","120","600"],Ye=["0","5","15","60","300"],pe=["0","200","500","1000","2500","5000","10000"];function fe(e,t){let n=["a","abbr","address","article","aside","audio","b","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","s","samp","search","section","select","slot","small","source","span","strong","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video"],o=["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","marquee","math","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","meter","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem"],r=["body","main","nav","header","footer","aside","form","dialog","search"],i=["main","navigation","banner","contentinfo","complementary","form","search","region","dialog","alertdialog"],s=globalThis,u=s.Element,a=s.Node,l=typeof u=="function"&&typeof a=="function"&&e instanceof u,f=l?Object.getOwnPropertyDescriptor(u.prototype,"localName").get:null,T=l?Object.getOwnPropertyDescriptor(a.prototype,"parentElement").get:null,p=l?Object.getOwnPropertyDescriptor(u.prototype,"previousElementSibling").get:null,m=l?u.prototype.getAttribute:null,ae=[],y=e,Le=!0;for(;y!==null&&ae.length<t;){let I=(f?f.call(y):y.localName).toLowerCase(),Ve=n.indexOf(I)>=0?I:I.indexOf("-")>=0?"custom":"other",le=m?m.call(y,"role"):y.getAttribute("role"),Be=le===null?"":le.trim().toLowerCase().split(/\s+/)[0]||"",G=le===null?null:o.indexOf(Be)>=0?Be:"other",ce=0,v=p?p.call(y):y.previousElementSibling;for(;v!==null;)(f?f.call(v):v.localName).toLowerCase()===I&&(ce+=1),v=p?p.call(v):v.previousElementSibling;if(ae.unshift(G===null?Ve+":"+ce:Ve+"["+G+"]:"+ce),!Le&&(r.indexOf(I)>=0||G!==null&&i.indexOf(G)>=0))break;Le=!1,y=T?T.call(y):y.parentElement}return ae.join(">")}var Ge=256*1024,Nt=/^[0-9a-f]{16}$/,Ut=512,Fe=8192,Mt=5e4,Dt=/^[A-Za-z0-9_]+$/,Lt=0,We=1,ze=2,de=3;function Vt(e,t){let n=t.charCodeAt(0)===35,o=n?t.slice(1):t;if(o.charCodeAt(0)!==47)return null;let r=o==="/"?[]:o.slice(1).split("/"),i=[];for(let s=0;s<r.length;s++){let u=r[s];if(u==="")return null;let a=u[0];if(a!==":"&&a!=="*"){i.push(u);continue}let l=u.charCodeAt(u.length-1)===63;if(!Dt.test(u.slice(1,l?-1:void 0))||a==="*"&&s!==r.length-1)return null;i.push(a===":"?l?We:Lt:l?de:ze)}return{id:e,hash:n,segments:i}}function Je(e,t,n){if(t.length>Fe||n.length>Fe)return"unknown";let o=je(t),r=n.replace(/^#/,"").split("?")[0],i=r.charCodeAt(0)===47?je(r):null,s={steps:Mt};for(let u of e){let a=u.hash?i:o;if(a&&me(u.segments,a,0,0,s))return s.steps>0?u.id:"unknown";if(s.steps<=0)return"unknown"}return"unknown"}function je(e){if(e.charCodeAt(0)!==47)return null;let t=e.length;for(;t>0&&e.charCodeAt(t-1)===47;)t--;if(t===0)return[];try{return e.slice(1,t).split("/").map(n=>decodeURIComponent(n))}catch(n){return null}}function me(e,t,n,o,r){if(--r.steps<=0)return!1;if(n===e.length)return o===t.length;let i=e[n];return i===ze||i===de?t.length-o>=(i===de?0:1):i===We&&me(e,t,n+1,o,r)?!0:o===t.length||(typeof i=="string"?t[o]!==i:t[o]==="")?!1:me(e,t,n+1,o+1,r)}function $e(e){if(!qe(e)||e.version!==N||!Nt.test(String(e.release))||!w(e.repositoryId)||!w(e.applicationId)||!w(e.adapter)||!Array.isArray(e.routes)||!Array.isArray(e.chunks))return null;let t=new Set,n=[],o=[];for(let i of e.routes){if(!qe(i)||!w(i.id)||i.id.length>200||i.id==="unknown"||t.has(i.id)||!w(i.match)||!w(i.source))return null;let s=Vt(i.id,i.match);if(!s)return null;t.add(i.id),n.push(s),o.push({id:i.id,match:i.match,source:i.source})}let r=e.chunks;return!r.every(w)||new Set(r).size!==r.length?null:{manifest:{version:N,repositoryId:e.repositoryId,applicationId:e.applicationId,release:e.release,adapter:e.adapter,routes:o,chunks:r},routes:n}}function qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function w(e){return typeof e=="string"&&e.length>0&&e.length<=Ut&&!/[\u0000-\u001f\u007f]/.test(e)}var d=window,E=document,V=navigator,qt=30*6e4,Gt=12*36e5,Wt=50,zt=1e4,Jt=20,$t=1e3,Qe=100,Zt=["xs","sm","md","lg","xl"],Qt=[480,768,1024,1440],ot=new Set(["body","main","nav","header","footer","aside","form","dialog","search"]),en=new Set(["main","navigation","banner","contentinfo","complementary","form","dialog","alertdialog","search","region"]),tn=new Set(["button","link","menuitem","tab"]),nn=new Map([["radio","radio"],["menuitemradio","radio"],["checkbox","checkbox"],["menuitemcheckbox","checkbox"],["switch","switch"],["option","option"]]),rn="fieldset,[role=radiogroup],[role=listbox],[role=menu],[role=menubar],[role=tablist],[role=group],[role=tree],[role=grid]",on="[role=menuitemradio],[role=menuitemcheckbox]",sn="input[type=radio],input[type=checkbox],select,[role=radio],[role=checkbox],[role=switch],[role=option],[aria-checked],[aria-pressed],[aria-selected]",un=new Set(["button","submit","reset","image"]),an=new Set(["hidden","button","submit","reset","image"]),ln=3,cn=128,x=!1,Ee=!1,B=!1,A=!1,ge="",j="",st="",Te=[],it=new Set,ut=!1,c=null,S=null,Z="",at=0,Q="",_e="unknown",C=[],k=null,M=0,D=0,lt=Jt,he=!1,be=null,ee,K=[],W=new Map,te=new WeakMap,L=null,ye=[],_=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t).get;return o=>n.call(o)},P=(e,t)=>{let n=e[t];return(o,...r)=>n.apply(o,r)},h,ne,Se,Re,ct,Ie,pt,J,Ce,ft,dt,re,Ae,Ne,O,et,mt,se;function we(){x||(x=!0,yt(!1))}function g(e){return(...t)=>{if(!x)try{e(...t)}catch(n){we()}}}function b(e,t,n){let o=g(n),r={capture:!0,passive:!0},i=EventTarget.prototype.addEventListener,s=EventTarget.prototype.removeEventListener;i.call(e,t,o,r),K.push(()=>s.call(e,t,o,r))}function H(e){let t=g(()=>{A&&e()});typeof d.requestIdleCallback=="function"?d.requestIdleCallback(t,{timeout:2e3}):setTimeout(t,0)}function pn(){let e=_(Document.prototype,"currentScript")(E),t=e?e.getAttribute("data-key"):null;if(!t||!Ke.test(t))return;ge=t,j="_hc_"+ge;let n=[],o=Object.getOwnPropertyDescriptor(d,"HaystackCapture");if(o){let s=o.value,u=s&&typeof s=="object"?Object.getOwnPropertyDescriptor(s,"q"):void 0;if(!u||!Array.isArray(u.value))return;n=u.value.slice()}let r=Object.freeze({consent:g(s=>{Pe=!0,ke(s===!0)}),q:Object.freeze({push:(...s)=>(s.forEach(g(fn)),0)})});d.HaystackCapture=r;let i=e.getAttribute("data-consent")==="not-required"?!0:null;for(let s of n)Et(s)&&(i=s[1]===!0);if(i!==null){let s=i;setTimeout(g(()=>{Pe||ke(s)}),0)}}var Pe=!1;function Et(e){return Array.isArray(e)&&e[0]==="consent"}function fn(e){Et(e)&&(Pe=!0,ke(e[1]===!0))}var z=0;function ke(e){if(x)return;if(Ee=e&&!(V.globalPrivacyControl===!0||V.doNotTrack==="1"),!Ee){yt(!0);return}if(A||B)return;if(!(d.crypto&&crypto.subtle)){we();return}if(B=!0,dn(),z===2&&ve(),z)return;z=1;let t=new AbortController,n=setTimeout(g(()=>t.abort()),zt),o=new TextDecoder,r="",i=0;d.fetch(location.origin+"/.well-known/haystack-capture/current.json",{credentials:"omit",redirect:"error",signal:t.signal}).then(s=>{if(!s.ok||!s.body)throw 0;let u=s.body.getReader(),a=()=>u.read().then(l=>{if(!l.done){if(i+=l.value.length,i>Ge)throw u.cancel().then(void 0,()=>0),0;return r+=o.decode(l.value,{stream:!0}),a()}});return a()}).then(()=>{clearTimeout(n);let s=$e(JSON.parse(r+o.decode()));if(!s)throw 0;st=s.manifest.release,Te=s.routes,it=new Set(s.manifest.chunks),ut=Te.some(u=>u.hash),z=2,ve()}).then(void 0,()=>{clearTimeout(n),we()})}function ve(){if(x||!Ee||A||!B)return;let e=at+Wt-Date.now();if(e>0){setTimeout(g(ve),e);return}B=!1,mn()}function Ue(){try{return d.sessionStorage}catch(e){return null}}function gt(){try{let e=Ue(),t=e&&e.getItem(j),n=t?JSON.parse(t):null;return n&&/^[0-9a-f]{16}$/.test(n.s)&&Number.isInteger(n.q)&&n.q>=0&&typeof n.t=="number"&&typeof n.c=="number"&&(n.r===null||typeof n.r=="string")?n:null}catch(e){return null}}function Me(){try{let e=Ue();e&&e.setItem(j,JSON.stringify(c))}catch(e){}}function Tt(e){return kt(crypto.getRandomValues(new Uint8Array(e)))}function X(e){return{s:Tt(8),q:0,r:null,t:e,c:e}}function dn(){let e=Date.now();if(typeof BroadcastChannel!="function"){c=X(e);return}let t=gt();c=t||X(e),_t(),t&&bt()}function _t(){S||typeof BroadcastChannel!="function"||(S=new BroadcastChannel(j),S.onmessage=g(e=>{let t=e.data;!c||!t||typeof t!="object"||(t.q===c.s&&t.n!==Z?S.postMessage({a:c.s,n:t.n}):t.a===c.s&&t.n===Z&&(c=X(Date.now()),Me()))}))}function ht(){S&&(S.onmessage=null,S.close(),S=null)}function bt(){!S||!c||(Z=Tt(8),at=Date.now(),S.postMessage({q:c.s,n:Z}))}function mn(){A=!0,h=_(Element.prototype,"localName"),ne=_(Node.prototype,"nodeType"),Se=_(Document.prototype,"visibilityState"),Re=P(Document.prototype,"getElementsByTagName"),ct=P(Document.prototype,"createTreeWalker"),Ie=P(Element.prototype,"matches"),pt=_(Node.prototype,"parentNode"),J=_(Node.prototype,"parentElement"),Ce=_(Element.prototype,"previousElementSibling"),ft=_(Element.prototype,"nextElementSibling"),dt=_(Element.prototype,"firstElementChild"),re=_(ShadowRoot.prototype,"host"),Ae=P(Node.prototype,"getRootNode"),Ne=P(Element.prototype,"getAttribute"),O=P(Element.prototype,"hasAttribute"),et=P(Element.prototype,"closest"),mt=_(HTMLFormElement.prototype,"elements"),se=_(HTMLInputElement.prototype,"type"),L||(L=Tn()),ye.length||(ye=Qt.map(t=>d.matchMedia("(min-width: "+t+"px)"))),c||(c=X(Date.now())),Me(),b(E,"click",bn),b(E,"change",yn),b(E,"submit",Sn),b(E,"focusin",t=>{let n=ie(t.target)&&et(t.target,"form");n&&!te.has(n)&&te.set(n,Date.now())}),b(d,"error",wn),b(d,"unhandledrejection",t=>{lt-- >0&&q("error",{errorType:vt(t.reason),chunk:null,lineBucket:null})}),b(E,"visibilitychange",()=>{Se(E)==="hidden"?rt():(R(),Oe())}),b(d,"pagehide",()=>{rt(),ht()}),b(d,"pageshow",t=>{t.persisted&&(_t(),bt(),Q="",R())});let e=d.navigation;e&&typeof e.addEventListener=="function"?b(e,"currententrychange",R):(b(d,"popstate",R),b(d,"hashchange",R),Oe()),H(Pn),H(Ot),K.push(()=>{clearTimeout(M),clearTimeout(D),M=D=0}),Q="",R()}function yt(e){A=!1,B=!1;let t=K;K=[];for(let n of t)try{n()}catch(o){}C=[];try{k&&k.abort()}catch(n){}k=null;try{ht()}catch(n){}if(e)try{let n=Ue();n&&n.removeItem(j)}catch(n){}c=null}function Oe(){D||d.navigation||(D=setTimeout(g(()=>{D=0,Se(E)==="visible"&&(R(),Oe())}),1e3))}function En(){return ut?location.pathname+location.hash.split("?")[0]:location.pathname}function R(){if(!A)return;let e=En();e!==Q&&(Q=e,_e=Je(Te,location.pathname,location.hash),q("view",{fromRoute:null}))}function gn(){let e=0;for(let t of ye)t.matches&&e++;return Zt[e]}function Tn(){let e=V.userAgent,t=/iPad/.test(e)||/Macintosh/.test(e)&&V.maxTouchPoints>1,n=/CrOS/.test(e)?"chromeos":/Android/.test(e)?"android":t||/iPhone|iPod/.test(e)?"ios":/Windows/.test(e)?"windows":/Macintosh|Mac OS X/.test(e)?"macos":/Linux/.test(e)?"linux":"other",o=n==="ios"?"webkit":/Gecko\//.test(e)&&!/like Gecko/.test(e)?"gecko":/Chrome\/|Chromium\/|Edg\//.test(e)?"blink":/AppleWebKit/.test(e)?"webkit":"other";return{device:t||/Tablet/.test(e)||/Android/.test(e)&&!/Mobile/.test(e)?"tablet":/Mobi|iPhone|iPod|Android/.test(e)?"mobile":"desktop",os:n,engine:o}}function oe(e,t){let n=e[0];for(let o of e)t>=+o&&(n=o);return n}function q(e,t,n,o){if(!A||!c)return;let r=Date.now(),i=gt();if(i&&(c=i),(r-c.t>qt||r-c.c>Gt)&&(c=X(r)),c.q>=2e3)return;let s={session:c.s,seq:c.q,gap:oe(Xe,(r-c.t)/1e3),route:_e,device:L.device,os:L.os,engine:L.engine,viewport:gn(),release:st,kind:e};if(Object.assign(s,t),e==="view"&&(s.fromRoute=c.r,c.r=_e),c.q++,c.t=r,Me(),C.length>=100)return;let u={e:s,p:n,f:o};C.push(u),n!==void 0&&Cn(n).then(g(a=>{u.e[o]=a,u.p=void 0}),g(()=>{u.p=null})),C.length>=100?H(()=>De(!1)):xe()}function xe(){C.length&&!M&&(M=setTimeout(g(()=>{M=0,H(()=>De(!1))}),1e4))}function Y(e,t,n,o,r=St()){he||H(xt);let i=Rn(n,e!=="input",r);e!=="input"&&(t.ambiguous=i.a),q(e,t,i.p,o)}function ie(e){try{return ne(e)===1}catch(t){return!1}}function F(e){let t=Ne(e,"role");return t===null?"":t.trim().toLowerCase().split(/\s+/)[0]||""}function St(){return{left:2e3,until:performance.now()+ln}}function ue(e){return--e.left>=0&&!(e.left&63)&&performance.now()>e.until&&(e.left=-1),e.left>=0}function Rt(e,t,n){let o=ct(E,e,1);for(let r=o.nextNode();r;r=o.nextNode()){if(!ue(t))return;if(n(r))return r}return null}function tt(e){let t=pt(e);return t?ne(t)===11?re(t):ne(t)===1?t:null:null}function Ct(e,t,n){return t==="select"||t==="option"||t==="input"&&!un.has(se(e))?"native":nn.get(n)||(O(e,"aria-checked")?"checkbox":O(e,"aria-pressed")?"switch":O(e,"aria-selected")?"option":null)}function _n(e,t,n){return tn.has(n)?n:(t==="a"||t==="area")&&O(e,"href")?"link":t==="button"||t==="summary"||t==="input"?"button":null}function hn(e,t,n,o){if(n==="radiogroup"||n==="listbox")return!0;let r=n==="menu"||n==="menubar"?on:t==="fieldset"?sn:null;return r!==null&&Rt(e,o,i=>Ie(i,r))!==null}function bn(e){R();let t=St(),n=null,o=null,r=!1,i=0;for(let s of e.composedPath()){if(!ie(s))continue;if(++i>cn)return;let u=h(s).toLowerCase(),a=F(s),l=Ct(s,u,a);if(l==="native")return;if(l){let f=At(s);f&&Y("input",{control:l,group:""},f,"group",t);return}r=r||hn(s,u,a,t),!n&&(o=_n(s,u,a))&&(n=s)}n&&!r&&Y("press",{control:o,key:"",ambiguous:!1},n,"key",t)}function yn(e){let t=e.composedPath()[0];if(!ie(t))return;let n=h(t);if(n==="select"){Y("input",{control:"select",group:""},t,"group");return}if(n!=="input")return;let o=se(t),r=o==="checkbox"||o==="radio"?At(t):null;r&&Y("input",{control:o,group:""},r,"group")}function Sn(e){R();let t=e.target;if(!ie(t)||h(t)!=="form")return;let n=mt(t),o=0;for(let i=0;i<n.length&&i<$t;i++){let s=h(n[i]);(s==="select"||s==="textarea"||s==="input"&&!an.has(se(n[i])))&&o++}let r=te.get(t);te.delete(t),Y("submit",{key:"",ambiguous:!1,fields:o,duration:oe(Ye,r?(Date.now()-r)/1e3:0)},t,"key")}function At(e){for(let t=tt(e),n=0;t&&n<32;t=tt(t),n++){let o=h(t).toLowerCase();if(Ct(t,o,F(t))===null&&(Ie(t,rn)||$(t)))return t}return null}function $(e){return ot.has(h(e).toLowerCase())||en.has(F(e))}function wt(e,t){let n=fe({localName:h(e),getAttribute:o=>Ne(e,o),parentElement:null,previousElementSibling:null},1);return n.slice(0,n.lastIndexOf(":")+1)+t}function nt(e,t){let n=h(e).toLowerCase(),o=0;for(let r=Ce(e);r;r=Ce(r)){if(!ue(t))return-1;h(r).toLowerCase()===n&&o++}return o}function Rn(e,t,n){for(let p=e,m=0;p&&m<32;p=J(p),m++){if(nt(p,n)<0)return{p:"cut",a:!0};if(m&&$(p))break}let o=fe(e,32),r={p:o,a:!0};if(!t)return{p:o,a:!1};let i=o.split(">"),s=e;for(let p=1;p<i.length;p++)s=J(s);let u=!J(s);if(!u&&(s===e||!$(s)))return r;let a=Ae(s);if(a!==E&&(Ae(re(a))!==E||Re(E,h(re(a))).length!==1))return r;if(u)return{p:o,a:!1};let l=h(s).toLowerCase(),f=F(s),T=[];if(a===E&&ot.has(l))T=Re(E,l);else{let p=[];if(Rt(a,n,m=>(m!==s&&F(m)===f&&p.push(m),!1))===void 0)return r;T=p}if(performance.now()>n.until)return r;for(let p=0;p<T.length;p++){let m=T[p];if(!ue(n))return r;if(!(m===s||!$(m)||wt(m,nt(m,n))!==i[0])&&(Pt(m,i,1,e,n)||n.left<0))return r}return{p:o,a:!1}}function Pt(e,t,n,o,r){if(n===t.length)return e!==o;let i=t[n],s=i.indexOf("[")>=0,u=i.split(/[[:]/)[0],a=new Map;for(let l=dt(e);l;l=ft(l)){if(!ue(r))return!1;let f=h(l).toLowerCase(),T=a.get(f)||0;if(a.set(f,T+1),!(u!=="custom"&&u!=="other"&&f!==u||u==="custom"&&f.indexOf("-")<0||O(l,"role")!==s||wt(l,T)!==i)&&Pt(l,t,n+1,o,r))return!0}return!1}function Cn(e){let t=W.get(e);return t||(W.size>=512&&W.clear(),t=crypto.subtle.digest("SHA-256",new TextEncoder().encode(e)).then(n=>kt(new Uint8Array(n,0,8))),W.set(e,t)),t}function kt(e){return Array.from(e,t=>(t+256).toString(16).slice(1)).join("")}var An=[TypeError,RangeError,SyntaxError,ReferenceError];function vt(e){try{if(!e||typeof e!="object")return"other";let t=Object.getOwnPropertyDescriptor(e,"name");if(t&&t.value==="ChunkLoadError")return"ChunkLoadError";let n=Object.getPrototypeOf(e);for(let o=0;n&&o<8;o++,n=Object.getPrototypeOf(n)){for(let r of An)if(n===r.prototype)return r.name;if(typeof DOMException=="function"&&n===DOMException.prototype){let r=_(DOMException.prototype,"name")(e);return r==="NetworkError"||r==="SecurityError"?r:"other"}}}catch(t){}return"other"}function wn(e){if(!(e instanceof ErrorEvent)||lt--<=0)return;let t=null;try{let n=new URL(e.filename).pathname;t=it.has(n)?n:null}catch(n){}q("error",{errorType:vt(e.error),chunk:t,lineBucket:t===null?null:Math.floor(e.lineno/Qe)*Qe})}function Pn(){if(typeof PerformanceObserver!="function"||!(PerformanceObserver.supportedEntryTypes||[]).includes("largest-contentful-paint"))return;let e=new PerformanceObserver(g(t=>{let n=t.getEntries();n.length&&(be=n[n.length-1].startTime)}));e.observe({type:"largest-contentful-paint",buffered:!0}),K.push(()=>e.disconnect())}function Ot(){if(ee!==void 0)return;let e=performance.getEntriesByType("navigation")[0];ee=e&&e.responseStart>0?Math.max(0,e.responseStart-(e.activationStart||0)):null}function xt(){if(he)return;he=!0,Ot();let e=V.connection,t=e&&e.effectiveType;q("vital",{ttfb:ee==null?null:oe(pe,ee),lcp:be===null?null:oe(pe,be),connection:t==="4g"||t==="3g"||t==="2g"||t==="slow-2g"?t:null})}function rt(){xt(),De(!0)}function De(e){if(!A||k||!C.length)return;let t=e?16384:32768,n='{"version":"'+N+'","key":"'+ge+'","events":[',o=new TextEncoder,r=[],i=n.length+2,s=0;for(let l of C){if(l.p)break;if(l.p!==null){let f=JSON.stringify(l.e),T=o.encode(f).length+1;if(i+T>t){r.length||s++;break}i+=T,r.push(f)}s++}if(C=e?[]:C.slice(s),!r.length){xe();return}let u=new AbortController;k=u;let a=g(()=>{k===u&&(k=null,xe())});d.fetch(He,{method:"POST",body:n+r.join(",")+"]}",credentials:"omit",referrerPolicy:"no-referrer",mode:"cors",cache:"no-store",keepalive:e,signal:u.signal,priority:"low"}).then(a,a)}try{pn()}catch(e){x=!0}})();}catch(e){}
|