harperdb 4.7.0-beta.2 → 4.7.0-beta.3
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/README.md +1 -1
- package/bin/harperdb.js +31 -31
- package/bin/lite.js +3 -3
- package/launchServiceScripts/launchNatsIngestService.js +3 -3
- package/launchServiceScripts/launchNatsReplyService.js +3 -3
- package/launchServiceScripts/launchUpdateNodes4-0-0.js +3 -3
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/resources/RequestTarget.d.ts +2 -0
- package/resources/analytics/hostnames.d.ts +5 -477
- package/resources/databases.d.ts +1 -478
- package/server/jobs/jobProcess.js +3 -3
- package/server/threads/threadServer.js +3 -3
- package/studio/web/assets/{index-CXaPu3wc.js → index-BqOgGOeU.js} +2 -2
- package/studio/web/assets/{index-B797owPM.js → index-C4VX60Fd.js} +1 -1
- package/studio/web/assets/{profiler-CgmzpljF.js → profiler-OUXA1uul.js} +1 -1
- package/studio/web/assets/{startRecording-DiD-ht9H.js → startRecording-D8PRkhto.js} +1 -1
- package/studio/web/index.html +1 -1
- package/utility/scripts/restartHdb.js +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as h,a as f,o as P,s as t,b as N,c as g,d as y,e as k,f as C,g as F,r as v,t as b,l as U,j as e,F as S,h as u,i as p,k as n,m as i,I as l,n as x,B as z,S as I}from"./index-
|
|
1
|
+
import{u as h,a as f,o as P,s as t,b as N,c as g,d as y,e as k,f as C,g as F,r as v,t as b,l as U,j as e,F as S,h as u,i as p,k as n,m as i,I as l,n as x,B as z,S as I}from"./index-BqOgGOeU.js";async function L(a){const{id:d,newPassword:o,confirmNewPassword:r,...c}=a,m={...c};o&&o===r&&(m.password=o);const{data:w}=await f.patch(`/User/${d}`,m);return w}function E(){return h({mutationFn:a=>L(a)})}const M=P({id:t(),firstname:t({error:"Please enter your first name."}).min(2,{error:"First name is required."}).max(50,{error:"First name must be less than 50 characters."}),lastname:t({error:"Please enter your last name."}).min(2,{error:"Last name is required."}).max(50,{error:"Last name must be less than 50 characters."}),newPassword:t({error:"Please enter your new password."}).min(8,{error:"Password must be 8 characters or more."}).or(t().max(0)),confirmNewPassword:t().optional()}).refine(a=>a.newPassword===a.confirmNewPassword,{error:"Passwords do not match",path:["confirmNewPassword"]});function q(){const a=N(),d=g(),{user:o}=y(),r=k({resolver:C(M),defaultValues:async()=>{const s=await F();return{confirmNewPassword:"",firstname:s.firstname,id:s.id,lastname:s.lastname,newPassword:""}}}),{mutate:c,isPending:m}=E(),w=v.useCallback(async s=>{s&&c(s,{onSuccess:j=>{r.reset(j),s.newPassword?(b.success("Profile updated successfully!",{description:"Please sign in with your new password."}),U(),d({to:"/sign-in"}),a.invalidate()):b.success("Profile updated successfully!")}})},[r,d,a,c]);return e.jsxs("div",{className:"mt-20 px-4 pt-4 md:px-12",children:[e.jsx("h2",{className:"text-2xl font-light",children:"Profile"}),e.jsx(S,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(w),className:"grid gap-4 my-4",children:[e.jsx(u,{control:r.control,name:"firstname",render:({field:s})=>e.jsxs(p,{children:[e.jsx(n,{className:"pb-1",children:"First Name"}),e.jsx(i,{children:e.jsx(l,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...s})}),e.jsx(x,{})]})}),e.jsx(u,{control:r.control,name:"lastname",render:({field:s})=>e.jsxs(p,{children:[e.jsx(n,{className:"pb-1",children:"Last Name"}),e.jsx(i,{children:e.jsx(l,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...s})}),e.jsx(x,{})]})}),e.jsx(n,{className:"pb-1",children:"Email"}),e.jsx(i,{children:e.jsx(l,{type:"email",enterKeyHint:"next",autoComplete:"email",autoCapitalize:"none",value:o?.email||"",disabled:!0,readOnly:!0})}),e.jsx(u,{control:r.control,name:"newPassword",render:({field:s})=>e.jsxs(p,{children:[e.jsx(n,{className:"pb-1",children:"New Password"}),e.jsx(i,{children:e.jsx(l,{type:"password",placeholder:"Optional",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoComplete:"new-password",autoCapitalize:"none",...s})}),e.jsx(x,{})]})}),e.jsx(u,{control:r.control,name:"confirmNewPassword",render:({field:s})=>e.jsxs(p,{children:[e.jsx(n,{className:"pb-1",children:"Confirm New Password"}),e.jsx(i,{children:e.jsx(l,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoComplete:"new-password",autoCapitalize:"none",...s})}),e.jsx(x,{})]})}),e.jsx("div",{className:"flex justify-between w-full",children:e.jsxs(z,{type:"submit",variant:"submit",className:"rounded-full",disabled:m||!r.formState.isDirty||!r.formState.isValid,children:[e.jsx(I,{})," Update Profile"]})})]})})]})}export{q as ProfileIndex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as q,T as z,ak as K,al as X,am as $,an as Q,ao as b,V as P,ap as W,aq as g,ar as Y,ad as Z,ac as x,M as ee,as as te,at as ne}from"./index-
|
|
1
|
+
import{$ as q,T as z,ak as K,al as X,am as $,an as Q,ao as b,V as P,ap as W,aq as g,ar as Y,ad as Z,ac as x,M as ee,as as te,at as ne}from"./index-BqOgGOeU.js";function se(e){let n=0;for(const i of e)i.stackId!==void 0&&n++;return n}const h=new Map;function re(e,n){h.set(n,e)}function oe(e){return h.get(e)}function _(e){for(const n of h.keys())n<e&&h.delete(n)}function ae({rawRumEvent:e,startTime:n}){if(e.type!==q.LONG_TASK)return;const i=e.long_task.id;re(i,n)}const ie=(e,n,i)=>{const{profilingEndpointBuilder:r,applicationId:l}=n,p=le(e,n,i),c=ue(e,p),m=r.build("fetch",c);return z("Sending profile to public profiling intake",{profilingIntakeURL:m,applicationId:l,sessionId:i}),fetch(m,{body:c.data,method:"POST"})};function le(e,n,i){const r=K(n),l=de(e,n.applicationId,i),p=ce(r);return{...l,attachments:["wall-time.json"],start:new Date(e.startClocks.timeStamp).toISOString(),end:new Date(e.endClocks.timeStamp).toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:p.join(","),_dd:{clock_drift:X()}}}function ce(e){return e.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}function ue(e,n){const i=new Blob([JSON.stringify(e)],{type:"application/json"}),r=new FormData;return r.append("event",new Blob([JSON.stringify(n)],{type:"application/json"}),"event.json"),r.append("wall-time.json",i,"wall-time.json"),{data:r,bytesCount:0}}function de(e,n,i){const r={application:{id:n}};i&&(r.session={id:i});const l=Array.from(new Set(e.views.map(c=>c.viewId)));l.length&&(r.view={id:l});const p=e.longTasks.map(c=>c.id).filter(c=>c!==void 0);return p.length&&(r.long_task={id:p}),r}const pe={sendProfile:ie},fe=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;function me(e){return e?e.replace(fe,"/?"):"/"}const O=(e,n)=>e||me(n),ve={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};function ge(e,n,i,r,l=ve){const p=$(Q.LONG_ANIMATION_FRAME);let c;const m=[];let o={state:"stopped"};function L(t){o.state!=="running"&&(c=t?{startClocks:t.startClocks,viewId:t.id,viewName:O(t.name,document.location.pathname)}:void 0,m.push(P(e,window,"visibilitychange",R).stop,P(e,window,"beforeunload",j).stop),v())}async function N(){await k("stopped"),m.forEach(t=>t()),_(b().relative),r.set({status:"stopped",error_reason:void 0})}function D(t){if(t.state==="running")return{cleanupTasks:t.cleanupTasks,observer:t.observer};const s=[];let a;if(e.trackLongTasks){a=new PerformanceObserver(A),a.observe({entryTypes:[B()]});const u=n.subscribe(12,f=>{ae(f)});s.push(()=>a?.disconnect()),s.push(u.unsubscribe)}const d=n.subscribe(2,u=>{const f={viewId:u.id,viewName:O(u.name,document.location.pathname),startClocks:u.startClocks};y(f),c=f});return s.push(d.unsubscribe),{cleanupTasks:s,observer:a}}function v(){const t=W().Profiler;if(!t)throw r.set({status:"error",error_reason:"not-supported-by-browser"}),new Error("RUM Profiler is not supported in this browser.");T(o).catch(g);const{cleanupTasks:s,observer:a}=D(o);let d;try{d=new t({sampleInterval:l.sampleIntervalMs,maxBufferSize:Math.round(l.collectIntervalMs*1.5/l.sampleIntervalMs)})}catch(u){u instanceof Error&&u.message.includes("disabled by Document Policy")?(Y.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",u),r.set({status:"error",error_reason:"missing-document-policy-header"})):r.set({status:"error",error_reason:"unexpected-exception"});return}r.set({status:"running",error_reason:void 0}),o={state:"running",startClocks:b(),profiler:d,timeoutId:Z(v,l.collectIntervalMs),longTasks:[],views:[],cleanupTasks:s,observer:a},y(c),d.addEventListener("samplebufferfull",w)}async function T(t){var s,a;if(t.state!=="running")return;E((a=(s=t.observer)===null||s===void 0?void 0:s.takeRecords())!==null&&a!==void 0?a:[]),x(t.timeoutId),t.profiler.removeEventListener("samplebufferfull",w);const{startClocks:d,longTasks:u,views:f}=t,V=b();await t.profiler.stop().then(I=>{const S=b(),G=u.length>0,H=ee(d.timeStamp,S.timeStamp)<l.minProfileDurationMs,J=se(I.samples)<l.minNumberOfSamples;!G&&(H||J)||(M(Object.assign(I,{startClocks:d,endClocks:S,clocksOrigin:te(),longTasks:u,views:f,sampleInterval:l.sampleIntervalMs})),_(V.relative))}).catch(g)}async function k(t){o.state==="running"&&(o.cleanupTasks.forEach(s=>s()),await T(o),o={state:t})}function y(t){o.state!=="running"||!t||o.views.push(t)}function M(t){var s;const a=(s=i.findTrackedSession())===null||s===void 0?void 0:s.id;pe.sendProfile(t,e,a).catch(g)}function w(){v()}function A(t){E(t.getEntries())}function E(t){if(o.state==="running")for(const s of t){if(s.duration<l.sampleIntervalMs)continue;const a=ne(s.startTime),d=oe(a.relative);o.longTasks.push({id:d,duration:s.duration,entryType:s.entryType,startClocks:a})}}function R(){document.visibilityState==="hidden"&&o.state==="running"?k("paused").catch(g):document.visibilityState==="visible"&&o.state==="paused"&&v()}function j(){v()}function B(){return p?"long-animation-frame":"longtask"}function C(){return o.state==="stopped"}function F(){return o.state==="running"}function U(){return o.state==="paused"}return{start:L,stop:N,isStopped:C,isRunning:F,isPaused:U}}export{ve as DEFAULT_RUM_PROFILER_CONFIGURATION,ge as createRumProfiler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as O,C as b,q as Tt,v as j,w as V,N as S,P as q,x as Et,y as G,z as yt,A as Nt,D as J,E as wt,G as Mt,H as vt,J as It,K as Z,L as M,M as Q,O as tt,Q as A,R as C,T as et,U as v,V as Rt,W as nt,X as st,Y as Ct,Z as R,_ as D,$ as xt,a0 as bt,a1 as x,a2 as _t,a3 as Dt,a4 as Lt,a5 as At,a6 as zt,a7 as Ot,a8 as Vt,a9 as Pt,aa as kt,ab as Ft,ac as Ut,ad as Bt,ae as Ht,af as Gt,ag as Wt,ah as Yt,ai as $t,aj as Xt}from"./index-CXaPu3wc.js";const P=new WeakMap;function w(t){return P.has(t)}function Kt(t){let n=t;for(;n;){if(!w(n)&&!j(n))return!1;n=V(n)}return!0}function g(t){return P.get(t)}function jt(t,n){P.set(t,n)}function k(t,n){const e=t.tagName,o=t.value;if(O(t,n)){const s=t.type;return e==="INPUT"&&(s==="button"||s==="submit"||s==="reset")?o:!o||e==="OPTION"?void 0:b}if(e==="OPTION"||e==="SELECT")return t.value;if(!(e!=="INPUT"&&e!=="TEXTAREA"))return o}const qt=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Jt=/^[A-Za-z]+:|^\/\//,Zt=/^["']?data:.*,/i;function Qt(t,n){return t.replace(qt,(e,o,s,r,a,i)=>{const u=s||a||i;if(!n||!u||Jt.test(u)||Zt.test(u))return e;const f=o||r||"";return`url(${f}${te(u,n)}${f})`})}function te(t,n){try{return Tt(t,n).href}catch{return t}}const ee=/[^a-z1-6-_]/;function ot(t){const n=t.toLowerCase().trim();return ee.test(n)?"div":n}function W(t,n){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' style='background-color:silver'%3E%3C/svg%3E`}const N={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},I={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},T={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},E={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},Y={Play:0,Pause:1};function rt(t){if(!(t===void 0||t.length===0))return t.map(n=>{const e=n.cssRules||n.rules;return{cssRules:Array.from(e,r=>r.cssText),disabled:n.disabled||void 0,media:n.media.length>0?Array.from(n.media):void 0}})}const ne=1e6;function it(t,n,e,o){if(n===S.HIDDEN)return null;const s=t.getAttribute(e);if(n===S.MASK&&e!==q&&!Et.includes(e)&&e!==o.actionNameAttribute){const r=t.tagName;switch(e){case"title":case"alt":case"placeholder":return b}if(r==="IMG"&&(e==="src"||e==="srcset")){const a=t;if(a.naturalWidth>0)return W(a.naturalWidth,a.naturalHeight);const{width:i,height:u}=t.getBoundingClientRect();return i>0||u>0?W(i,u):G}if(r==="SOURCE"&&(e==="src"||e==="srcset"))return G;if(r==="A"&&e==="href")return b;if(s&&e.startsWith("data-"))return b;if(r==="IFRAME"&&e==="srcdoc")return b}return!s||typeof s!="string"?s:yt(s,ne)}function F(){return{cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}}}function L(t,n,e){t[n].count+=1,t[n].max=Math.max(t[n].max,e),t[n].sum+=e}function se(t,n){for(const e of["cssText","serializationDuration"])t[e].count+=n[e].count,t[e].max=Math.max(t[e].max,n[e].max),t[e].sum+=n[e].sum}function oe(t,n,e){if(n===S.HIDDEN)return{};const o={},s=ot(t.tagName),r=t.ownerDocument;for(let c=0;c<t.attributes.length;c+=1){const l=t.attributes.item(c).name,m=it(t,n,l,e.configuration);m!==null&&(o[l]=m)}if(t.value&&(s==="textarea"||s==="select"||s==="option"||s==="input")){const c=k(t,n);c!==void 0&&(o.value=c)}if(s==="option"&&n===S.ALLOW){const c=t;c.selected&&(o.selected=c.selected)}if(s==="link"){const c=Array.from(r.styleSheets).find(l=>l.href===t.href),d=z(c);d&&c&&(L(e.serializationContext.serializationStats,"cssText",d.length),o._cssText=d)}if(s==="style"&&t.sheet){const c=z(t.sheet);c&&(L(e.serializationContext.serializationStats,"cssText",c.length),o._cssText=c)}const a=t;if(s==="input"&&(a.type==="radio"||a.type==="checkbox")&&(n===S.ALLOW?o.checked=!!a.checked:O(a,n)&&delete o.checked),s==="audio"||s==="video"){const c=t;o.rr_mediaState=c.paused?"paused":"played"}let i,u;const f=e.serializationContext;switch(f.status){case 0:i=Math.round(t.scrollTop),u=Math.round(t.scrollLeft),(i||u)&&f.elementsScrollPositions.set(t,{scrollTop:i,scrollLeft:u});break;case 1:f.elementsScrollPositions.has(t)&&({scrollTop:i,scrollLeft:u}=f.elementsScrollPositions.get(t));break}return u&&(o.rr_scrollLeft=u),i&&(o.rr_scrollTop=i),o}function z(t){if(!t)return null;let n;try{n=t.rules||t.cssRules}catch{}if(!n)return null;const e=Array.from(n,Nt()?re:at).join("");return Qt(e,t.href)}function re(t){if(ae(t)&&t.selectorText.includes(":")){const n=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return t.cssText.replace(n,"$1\\$2")}return at(t)}function at(t){return ie(t)&&z(t.styleSheet)||t.cssText}function ie(t){return"styleSheet"in t}function ae(t){return"selectorText"in t}function U(t,n){const e=le(t,n);if(!e)return null;const o=g(t)||ce(),s=e;return s.id=o,jt(t,o),n.serializedNodeIds&&n.serializedNodeIds.add(o),s}let ue=1;function ce(){return ue++}function B(t,n){const e=[];return Z(t,o=>{const s=U(o,n);s&&e.push(s)}),e}function le(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return de(t,n);case t.DOCUMENT_FRAGMENT_NODE:return fe(t,n);case t.DOCUMENT_TYPE_NODE:return pe(t);case t.ELEMENT_NODE:return he(t,n);case t.TEXT_NODE:return Se(t,n);case t.CDATA_SECTION_NODE:return ge()}}function de(t,n){return{type:I.Document,childNodes:B(t,n),adoptedStyleSheets:rt(t.adoptedStyleSheets)}}function fe(t,n){const e=j(t);return e&&n.serializationContext.shadowRootsController.addShadowRoot(t),{type:I.DocumentFragment,childNodes:B(t,n),isShadowRoot:e,adoptedStyleSheets:e?rt(t.adoptedStyleSheets):void 0}}function pe(t){return{type:I.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId}}function he(t,n){const e=ot(t.tagName),o=me(t)||void 0,s=wt(Mt(t),n.parentNodePrivacyLevel);if(s===S.HIDDEN){const{width:i,height:u}=t.getBoundingClientRect();return{type:I.Element,tagName:e,attributes:{rr_width:`${i}px`,rr_height:`${u}px`,[q]:vt},childNodes:[],isSVG:o}}if(s===S.IGNORE)return;const r=oe(t,s,n);let a=[];if(It(t)&&e!=="style"){let i;n.parentNodePrivacyLevel===s&&n.ignoreWhiteSpace===(e==="head")?i=n:i={...n,parentNodePrivacyLevel:s,ignoreWhiteSpace:e==="head"},a=B(t,i)}return{type:I.Element,tagName:e,attributes:r,childNodes:a,isSVG:o}}function me(t){return t.tagName==="svg"||t instanceof SVGElement}function Se(t,n){const e=J(t,n.ignoreWhiteSpace||!1,n.parentNodePrivacyLevel);if(e!==void 0)return{type:I.Text,textContent:e}}function ge(){return{type:I.CDATA,textContent:""}}function Te(t,n,e){const o=M(),s=U(t,{serializationContext:e,parentNodePrivacyLevel:n.defaultPrivacyLevel,configuration:n});return L(e.serializationStats,"serializationDuration",Q(o,M())),s}function ut(t){return!!t.changedTouches}function _(t){return t.composed===!0&&tt(t.target)?t.composedPath()[0]:t.target}const $=25;function Ee(t){return Math.abs(t.pageTop-t.offsetTop-window.scrollY)>$||Math.abs(t.pageLeft-t.offsetLeft-window.scrollX)>$}const ye=(t,n)=>{const e=window.visualViewport,o={layoutViewportX:t,layoutViewportY:n,visualViewportX:t,visualViewportY:n};if(e)Ee(e)?(o.layoutViewportX=Math.round(t+e.offsetLeft),o.layoutViewportY=Math.round(n+e.offsetTop)):(o.visualViewportX=Math.round(t-e.offsetLeft),o.visualViewportY=Math.round(n-e.offsetTop));else return o;return o},ct=t=>({scale:t.scale,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,pageLeft:t.pageLeft,pageTop:t.pageTop,height:t.height,width:t.width});function y(t,n){return{data:{source:t,...n},type:N.IncrementalSnapshot,timestamp:M()}}const Ne=50;function we(t,n){const{throttled:e,cancel:o}=A(r=>{const a=_(r);if(w(a)){const i=lt(r);if(!i)return;const u={id:g(a),timeOffset:0,x:i.x,y:i.y};n(y(ut(r)?T.TouchMove:T.MouseMove,{positions:[u]}))}},Ne,{trailing:!1}),{stop:s}=C(t,document,["mousemove","touchmove"],e,{capture:!0,passive:!0});return{stop:()=>{s(),o()}}}function lt(t){let{clientX:n,clientY:e}=ut(t)?t.changedTouches[0]:t;if(window.visualViewport){const{visualViewportX:o,visualViewportY:s}=ye(n,e);n=o,e=s}if(!Number.isFinite(n)||!Number.isFinite(e)){t.isTrusted&&et("mouse/touch event without x/y");return}return{x:n,y:e}}const X={pointerup:E.MouseUp,mousedown:E.MouseDown,click:E.Click,contextmenu:E.ContextMenu,dblclick:E.DblClick,focus:E.Focus,blur:E.Blur,touchstart:E.TouchStart,touchend:E.TouchEnd};function Me(t,n,e){const o=s=>{const r=_(s);if(v(r,t.defaultPrivacyLevel)===S.HIDDEN||!w(r))return;const a=g(r),i=X[s.type];let u;if(i!==E.Blur&&i!==E.Focus){const c=lt(s);if(!c)return;u={id:a,type:i,x:c.x,y:c.y}}else u={id:a,type:i};const f={id:e.getIdForEvent(s),...y(T.MouseInteraction,u)};n(f)};return C(t,document,Object.keys(X),o,{capture:!0,passive:!0})}const ve=100;function dt(t,n,e,o=document){const{throttled:s,cancel:r}=A(i=>{const u=_(i);if(!u||v(u,t.defaultPrivacyLevel)===S.HIDDEN||!w(u))return;const f=g(u),c=u===document?{scrollTop:st(),scrollLeft:nt()}:{scrollTop:Math.round(u.scrollTop),scrollLeft:Math.round(u.scrollLeft)};e.set(u,c),n(y(T.Scroll,{id:f,x:c.scrollLeft,y:c.scrollTop}))},ve),{stop:a}=Rt(t,o,"scroll",s,{capture:!0,passive:!0});return{stop:()=>{a(),r()}}}const Ie=200;function Re(t,n){const e=Ct(t).subscribe(o=>{n(y(T.ViewportResize,o))});return{stop:()=>{e.unsubscribe()}}}function Ce(t,n){const e=window.visualViewport;if(!e)return{stop:R};const{throttled:o,cancel:s}=A(()=>{n({data:ct(e),type:N.VisualViewport,timestamp:M()})},Ie,{trailing:!1}),{stop:r}=C(t,e,["resize","scroll"],o,{capture:!0,passive:!0});return{stop:()=>{r(),s()}}}function xe(t,n){return C(t,document,["play","pause"],e=>{const o=_(e);!o||v(o,t.defaultPrivacyLevel)===S.HIDDEN||!w(o)||n(y(T.MediaInteraction,{id:g(o),type:e.type==="play"?Y.Play:Y.Pause}))},{capture:!0,passive:!0})}function be(t){function n(s,r){s&&w(s.ownerNode)&&r(g(s.ownerNode))}const e=[D(CSSStyleSheet.prototype,"insertRule",({target:s,parameters:[r,a]})=>{n(s,i=>t(y(T.StyleSheetRule,{id:i,adds:[{rule:r,index:a}]})))}),D(CSSStyleSheet.prototype,"deleteRule",({target:s,parameters:[r]})=>{n(s,a=>t(y(T.StyleSheetRule,{id:a,removes:[{index:r}]})))})];typeof CSSGroupingRule<"u"?o(CSSGroupingRule):(o(CSSMediaRule),o(CSSSupportsRule));function o(s){e.push(D(s.prototype,"insertRule",({target:r,parameters:[a,i]})=>{n(r.parentStyleSheet,u=>{const f=K(r);f&&(f.push(i||0),t(y(T.StyleSheetRule,{id:u,adds:[{rule:a,index:f}]})))})}),D(s.prototype,"deleteRule",({target:r,parameters:[a]})=>{n(r.parentStyleSheet,i=>{const u=K(r);u&&(u.push(a),t(y(T.StyleSheetRule,{id:i,removes:[{index:u}]})))})}))}return{stop:()=>{e.forEach(s=>s.stop())}}}function K(t){const n=[];let e=t;for(;e.parentRule;){const a=Array.from(e.parentRule.cssRules).indexOf(e);n.unshift(a),e=e.parentRule}if(!e.parentStyleSheet)return;const s=Array.from(e.parentStyleSheet.cssRules).indexOf(e);return n.unshift(s),n}function _e(t,n){return C(t,window,["focus","blur"],()=>{n({data:{has_focus:document.hasFocus()},type:N.Focus,timestamp:M()})})}function De(t,n,e){const o=t.subscribe(12,s=>{var r,a;s.rawRumEvent.type===xt.ACTION&&s.rawRumEvent.action.type===bt.CLICK&&(!((a=(r=s.rawRumEvent.action.frustration)===null||r===void 0?void 0:r.type)===null||a===void 0)&&a.length)&&"events"in s.domainContext&&s.domainContext.events&&s.domainContext.events.length&&n({timestamp:s.rawRumEvent.date,type:N.FrustrationRecord,data:{frustrationTypes:s.rawRumEvent.action.frustration.type,recordIds:s.domainContext.events.map(i=>e.getIdForEvent(i))}})});return{stop:()=>{o.unsubscribe()}}}function Le(t,n){const e=t.subscribe(5,()=>{n({timestamp:M(),type:N.ViewEnd})});return{stop:()=>{e.unsubscribe()}}}function ft(t,n,e=document){const o=t.defaultPrivacyLevel,s=new WeakMap,r=e!==document,{stop:a}=C(t,e,r?["change"]:["input","change"],c=>{const d=_(c);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&u(d)},{capture:!0,passive:!0});let i;if(r)i=R;else{const c=[x(HTMLInputElement.prototype,"value",u),x(HTMLInputElement.prototype,"checked",u),x(HTMLSelectElement.prototype,"value",u),x(HTMLTextAreaElement.prototype,"value",u),x(HTMLSelectElement.prototype,"selectedIndex",u)];i=()=>{c.forEach(d=>d.stop())}}return{stop:()=>{i(),a()}};function u(c){const d=v(c,o);if(d===S.HIDDEN)return;const l=c.type;let m;if(l==="radio"||l==="checkbox"){if(O(c,d))return;m={isChecked:c.checked}}else{const p=k(c,d);if(p===void 0)return;m={text:p}}f(c,m);const h=c.name;l==="radio"&&h&&c.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(h)}"]`).forEach(p=>{p!==c&&f(p,{isChecked:!1})})}function f(c,d){if(!w(c))return;const l=s.get(c);(!l||l.text!==d.text||l.isChecked!==d.isChecked)&&(s.set(c,d),n(y(T.Input,{id:g(c),...d})))}}const Ae=100,ze=16;function Oe(t){let n=R,e=[];function o(){n(),t(e),e=[]}const{throttled:s,cancel:r}=A(o,ze,{leading:!1});return{addMutations:a=>{e.length===0&&(n=_t(s,{timeout:Ae})),e.push(...a)},flush:o,stop:()=>{n(),r()}}}function pt(t,n,e,o){const s=Dt();if(!s)return{stop:R,flush:R};const r=Oe(i=>{Ve(i.concat(a.takeRecords()),t,n,e)}),a=new s(Lt(r.addMutations));return a.observe(o,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{a.disconnect(),r.stop()},flush:()=>{r.flush()}}}function Ve(t,n,e,o){const s=new Map;t.filter(l=>l.type==="childList").forEach(l=>{l.removedNodes.forEach(m=>{ht(m,o.removeShadowRoot)})});const r=t.filter(l=>l.target.isConnected&&Kt(l.target)&&v(l.target,e.defaultPrivacyLevel,s)!==S.HIDDEN),a=F(),{adds:i,removes:u,hasBeenSerialized:f}=Pe(r.filter(l=>l.type==="childList"),e,a,o,s),c=ke(r.filter(l=>l.type==="characterData"&&!f(l.target)),e,s),d=Fe(r.filter(l=>l.type==="attributes"&&!f(l.target)),e,s);!c.length&&!d.length&&!u.length&&!i.length||n(y(T.Mutation,{adds:i,removes:u,texts:c,attributes:d}),a)}function Pe(t,n,e,o,s){const r=new Set,a=new Map;for(const h of t)h.addedNodes.forEach(p=>{r.add(p)}),h.removedNodes.forEach(p=>{r.has(p)||a.set(p,h.target),r.delete(p)});const i=Array.from(r);Ue(i);const u=new Set,f={status:2,serializationStats:e,shadowRootsController:o},c=[];for(const h of i){if(l(h))continue;const p=v(h.parentNode,n.defaultPrivacyLevel,s);if(p===S.HIDDEN||p===S.IGNORE)continue;const St=M(),H=U(h,{serializedNodeIds:u,parentNodePrivacyLevel:p,serializationContext:f,configuration:n});if(L(e,"serializationDuration",Q(St,M())),!H)continue;const gt=V(h);c.push({nextId:m(h),parentId:g(gt),node:H})}const d=[];return a.forEach((h,p)=>{w(p)&&d.push({parentId:g(h),id:g(p)})}),{adds:c,removes:d,hasBeenSerialized:l};function l(h){return w(h)&&u.has(g(h))}function m(h){let p=h.nextSibling;for(;p;){if(w(p))return g(p);p=p.nextSibling}return null}}function ke(t,n,e){var o;const s=[],r=new Set,a=t.filter(i=>r.has(i.target)?!1:(r.add(i.target),!0));for(const i of a){if(i.target.textContent===i.oldValue)continue;const f=v(V(i.target),n.defaultPrivacyLevel,e);f===S.HIDDEN||f===S.IGNORE||s.push({id:g(i.target),value:(o=J(i.target,!1,f))!==null&&o!==void 0?o:null})}return s}function Fe(t,n,e){const o=[],s=new Map,r=t.filter(i=>{const u=s.get(i.target);return u&&u.has(i.attributeName)?!1:(u?u.add(i.attributeName):s.set(i.target,new Set([i.attributeName])),!0)}),a=new Map;for(const i of r){if(i.target.getAttribute(i.attributeName)===i.oldValue)continue;const f=v(i.target,n.defaultPrivacyLevel,e),c=it(i.target,f,i.attributeName,n);let d;if(i.attributeName==="value"){const m=k(i.target,f);if(m===void 0)continue;d=m}else typeof c=="string"?d=c:d=null;let l=a.get(i.target);l||(l={id:g(i.target),attributes:{}},o.push(l),a.set(i.target,l)),l.attributes[i.attributeName]=d}return o}function Ue(t){t.sort((n,e)=>{const o=n.compareDocumentPosition(e);return o&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:o&Node.DOCUMENT_POSITION_CONTAINS||o&Node.DOCUMENT_POSITION_FOLLOWING?1:o&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function ht(t,n){tt(t)&&n(t.shadowRoot),Z(t,e=>ht(e,n))}function Be(){const t=new WeakMap;return{set(n,e){n===document&&!document.scrollingElement||t.set(n===document?document.scrollingElement:n,e)},get(n){return t.get(n)},has(n){return t.has(n)}}}const He=(t,n,e)=>{const o=new Map,s={addShadowRoot:r=>{if(o.has(r))return;const a=pt(n,t,s,r),i=ft(t,n,r),u=dt(t,n,e,r);o.set(r,{flush:()=>a.flush(),stop:()=>{a.stop(),i.stop(),u.stop()}})},removeShadowRoot:r=>{const a=o.get(r);a&&(a.stop(),o.delete(r))},stop:()=>{o.forEach(({stop:r})=>r())},flush:()=>{o.forEach(({flush:r})=>r())}};return s};function Ge(t,n,e,o,s,r){const a=(u,f)=>{const{width:c,height:d}=At();r({data:{height:d,href:window.location.href,width:c},type:N.Meta,timestamp:u}),r({data:{has_focus:document.hasFocus()},type:N.Focus,timestamp:u});const l=F();r({data:{node:Te(document,o,{status:f,elementsScrollPositions:t,serializationStats:l,shadowRootsController:n}),initialOffset:{left:nt(),top:st()}},type:N.FullSnapshot,timestamp:u},l),window.visualViewport&&r({data:ct(window.visualViewport),type:N.VisualViewport,timestamp:u})};a(M(),0);const{unsubscribe:i}=e.subscribe(2,u=>{s(),a(u.startClocks.timeStamp,1)});return{stop:i}}function We(){const t=new WeakMap;let n=1;return{getIdForEvent(e){return t.has(e)||t.set(e,n++),t.get(e)}}}function Ye(t){const{emit:n,configuration:e,lifeCycle:o}=t;if(!n)throw new Error("emit function is required");const s=(l,m)=>{n(l,m),zt("record",{record:l});const h=t.viewHistory.findView();Ot(h.id)},r=Be(),a=He(e,s,r),{stop:i}=Ge(r,a,o,e,u,s);function u(){a.flush(),c.flush()}const f=We(),c=pt(s,e,a,document),d=[c,we(e,s),Me(e,s,f),dt(e,s,r,document),Re(e,s),ft(e,s),xe(e,s),be(s),_e(e,s),Ce(e,s),De(o,s,f),Le(o,l=>{u(),s(l)})];return{stop:()=>{a.stop(),d.forEach(l=>l.stop()),i()},flushMutations:u,shadowRootsController:a}}function $e(t,n,e,o){const s=new FormData;s.append("segment",new Blob([t],{type:"application/octet-stream"}),`${n.session.id}-${n.start}`);const r={raw_segment_size:o,compressed_segment_size:t.byteLength,...n},a=JSON.stringify(r);return s.append("event",new Blob([a],{type:"application/json"})),{data:s,bytesCount:t.byteLength,cssText:e.cssText,isFullSnapshot:n.index_in_view===0,rawSize:o,recordCount:n.records_count,serializationDuration:e.serializationDuration}}function Xe({context:t,creationReason:n,encoder:e}){let o=0;const s=t.view.id,r=Vt(s),a={start:1/0,end:-1/0,creation_reason:n,records_count:0,has_full_snapshot:!1,index_in_view:r,source:"browser",...t},i=F();Pt(s);function u(c,d,l){a.start=Math.min(a.start,c.timestamp),a.end=Math.max(a.end,c.timestamp),a.records_count+=1,a.has_full_snapshot||(a.has_full_snapshot=c.type===N.FullSnapshot),d&&se(i,d);const m=e.isEmpty?'{"records":[':",";e.write(m+JSON.stringify(c),h=>{o+=h,l(o)})}function f(c){if(e.isEmpty)throw new Error("Empty segment flushed");e.write(`],${JSON.stringify(a).slice(1)}
|
|
1
|
+
import{p as O,C as b,q as Tt,v as j,w as V,N as S,P as q,x as Et,y as G,z as yt,A as Nt,D as J,E as wt,G as Mt,H as vt,J as It,K as Z,L as M,M as Q,O as tt,Q as A,R as C,T as et,U as v,V as Rt,W as nt,X as st,Y as Ct,Z as R,_ as D,$ as xt,a0 as bt,a1 as x,a2 as _t,a3 as Dt,a4 as Lt,a5 as At,a6 as zt,a7 as Ot,a8 as Vt,a9 as Pt,aa as kt,ab as Ft,ac as Ut,ad as Bt,ae as Ht,af as Gt,ag as Wt,ah as Yt,ai as $t,aj as Xt}from"./index-BqOgGOeU.js";const P=new WeakMap;function w(t){return P.has(t)}function Kt(t){let n=t;for(;n;){if(!w(n)&&!j(n))return!1;n=V(n)}return!0}function g(t){return P.get(t)}function jt(t,n){P.set(t,n)}function k(t,n){const e=t.tagName,o=t.value;if(O(t,n)){const s=t.type;return e==="INPUT"&&(s==="button"||s==="submit"||s==="reset")?o:!o||e==="OPTION"?void 0:b}if(e==="OPTION"||e==="SELECT")return t.value;if(!(e!=="INPUT"&&e!=="TEXTAREA"))return o}const qt=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Jt=/^[A-Za-z]+:|^\/\//,Zt=/^["']?data:.*,/i;function Qt(t,n){return t.replace(qt,(e,o,s,r,a,i)=>{const u=s||a||i;if(!n||!u||Jt.test(u)||Zt.test(u))return e;const f=o||r||"";return`url(${f}${te(u,n)}${f})`})}function te(t,n){try{return Tt(t,n).href}catch{return t}}const ee=/[^a-z1-6-_]/;function ot(t){const n=t.toLowerCase().trim();return ee.test(n)?"div":n}function W(t,n){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' style='background-color:silver'%3E%3C/svg%3E`}const N={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},I={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},T={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},E={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},Y={Play:0,Pause:1};function rt(t){if(!(t===void 0||t.length===0))return t.map(n=>{const e=n.cssRules||n.rules;return{cssRules:Array.from(e,r=>r.cssText),disabled:n.disabled||void 0,media:n.media.length>0?Array.from(n.media):void 0}})}const ne=1e6;function it(t,n,e,o){if(n===S.HIDDEN)return null;const s=t.getAttribute(e);if(n===S.MASK&&e!==q&&!Et.includes(e)&&e!==o.actionNameAttribute){const r=t.tagName;switch(e){case"title":case"alt":case"placeholder":return b}if(r==="IMG"&&(e==="src"||e==="srcset")){const a=t;if(a.naturalWidth>0)return W(a.naturalWidth,a.naturalHeight);const{width:i,height:u}=t.getBoundingClientRect();return i>0||u>0?W(i,u):G}if(r==="SOURCE"&&(e==="src"||e==="srcset"))return G;if(r==="A"&&e==="href")return b;if(s&&e.startsWith("data-"))return b;if(r==="IFRAME"&&e==="srcdoc")return b}return!s||typeof s!="string"?s:yt(s,ne)}function F(){return{cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}}}function L(t,n,e){t[n].count+=1,t[n].max=Math.max(t[n].max,e),t[n].sum+=e}function se(t,n){for(const e of["cssText","serializationDuration"])t[e].count+=n[e].count,t[e].max=Math.max(t[e].max,n[e].max),t[e].sum+=n[e].sum}function oe(t,n,e){if(n===S.HIDDEN)return{};const o={},s=ot(t.tagName),r=t.ownerDocument;for(let c=0;c<t.attributes.length;c+=1){const l=t.attributes.item(c).name,m=it(t,n,l,e.configuration);m!==null&&(o[l]=m)}if(t.value&&(s==="textarea"||s==="select"||s==="option"||s==="input")){const c=k(t,n);c!==void 0&&(o.value=c)}if(s==="option"&&n===S.ALLOW){const c=t;c.selected&&(o.selected=c.selected)}if(s==="link"){const c=Array.from(r.styleSheets).find(l=>l.href===t.href),d=z(c);d&&c&&(L(e.serializationContext.serializationStats,"cssText",d.length),o._cssText=d)}if(s==="style"&&t.sheet){const c=z(t.sheet);c&&(L(e.serializationContext.serializationStats,"cssText",c.length),o._cssText=c)}const a=t;if(s==="input"&&(a.type==="radio"||a.type==="checkbox")&&(n===S.ALLOW?o.checked=!!a.checked:O(a,n)&&delete o.checked),s==="audio"||s==="video"){const c=t;o.rr_mediaState=c.paused?"paused":"played"}let i,u;const f=e.serializationContext;switch(f.status){case 0:i=Math.round(t.scrollTop),u=Math.round(t.scrollLeft),(i||u)&&f.elementsScrollPositions.set(t,{scrollTop:i,scrollLeft:u});break;case 1:f.elementsScrollPositions.has(t)&&({scrollTop:i,scrollLeft:u}=f.elementsScrollPositions.get(t));break}return u&&(o.rr_scrollLeft=u),i&&(o.rr_scrollTop=i),o}function z(t){if(!t)return null;let n;try{n=t.rules||t.cssRules}catch{}if(!n)return null;const e=Array.from(n,Nt()?re:at).join("");return Qt(e,t.href)}function re(t){if(ae(t)&&t.selectorText.includes(":")){const n=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return t.cssText.replace(n,"$1\\$2")}return at(t)}function at(t){return ie(t)&&z(t.styleSheet)||t.cssText}function ie(t){return"styleSheet"in t}function ae(t){return"selectorText"in t}function U(t,n){const e=le(t,n);if(!e)return null;const o=g(t)||ce(),s=e;return s.id=o,jt(t,o),n.serializedNodeIds&&n.serializedNodeIds.add(o),s}let ue=1;function ce(){return ue++}function B(t,n){const e=[];return Z(t,o=>{const s=U(o,n);s&&e.push(s)}),e}function le(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return de(t,n);case t.DOCUMENT_FRAGMENT_NODE:return fe(t,n);case t.DOCUMENT_TYPE_NODE:return pe(t);case t.ELEMENT_NODE:return he(t,n);case t.TEXT_NODE:return Se(t,n);case t.CDATA_SECTION_NODE:return ge()}}function de(t,n){return{type:I.Document,childNodes:B(t,n),adoptedStyleSheets:rt(t.adoptedStyleSheets)}}function fe(t,n){const e=j(t);return e&&n.serializationContext.shadowRootsController.addShadowRoot(t),{type:I.DocumentFragment,childNodes:B(t,n),isShadowRoot:e,adoptedStyleSheets:e?rt(t.adoptedStyleSheets):void 0}}function pe(t){return{type:I.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId}}function he(t,n){const e=ot(t.tagName),o=me(t)||void 0,s=wt(Mt(t),n.parentNodePrivacyLevel);if(s===S.HIDDEN){const{width:i,height:u}=t.getBoundingClientRect();return{type:I.Element,tagName:e,attributes:{rr_width:`${i}px`,rr_height:`${u}px`,[q]:vt},childNodes:[],isSVG:o}}if(s===S.IGNORE)return;const r=oe(t,s,n);let a=[];if(It(t)&&e!=="style"){let i;n.parentNodePrivacyLevel===s&&n.ignoreWhiteSpace===(e==="head")?i=n:i={...n,parentNodePrivacyLevel:s,ignoreWhiteSpace:e==="head"},a=B(t,i)}return{type:I.Element,tagName:e,attributes:r,childNodes:a,isSVG:o}}function me(t){return t.tagName==="svg"||t instanceof SVGElement}function Se(t,n){const e=J(t,n.ignoreWhiteSpace||!1,n.parentNodePrivacyLevel);if(e!==void 0)return{type:I.Text,textContent:e}}function ge(){return{type:I.CDATA,textContent:""}}function Te(t,n,e){const o=M(),s=U(t,{serializationContext:e,parentNodePrivacyLevel:n.defaultPrivacyLevel,configuration:n});return L(e.serializationStats,"serializationDuration",Q(o,M())),s}function ut(t){return!!t.changedTouches}function _(t){return t.composed===!0&&tt(t.target)?t.composedPath()[0]:t.target}const $=25;function Ee(t){return Math.abs(t.pageTop-t.offsetTop-window.scrollY)>$||Math.abs(t.pageLeft-t.offsetLeft-window.scrollX)>$}const ye=(t,n)=>{const e=window.visualViewport,o={layoutViewportX:t,layoutViewportY:n,visualViewportX:t,visualViewportY:n};if(e)Ee(e)?(o.layoutViewportX=Math.round(t+e.offsetLeft),o.layoutViewportY=Math.round(n+e.offsetTop)):(o.visualViewportX=Math.round(t-e.offsetLeft),o.visualViewportY=Math.round(n-e.offsetTop));else return o;return o},ct=t=>({scale:t.scale,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,pageLeft:t.pageLeft,pageTop:t.pageTop,height:t.height,width:t.width});function y(t,n){return{data:{source:t,...n},type:N.IncrementalSnapshot,timestamp:M()}}const Ne=50;function we(t,n){const{throttled:e,cancel:o}=A(r=>{const a=_(r);if(w(a)){const i=lt(r);if(!i)return;const u={id:g(a),timeOffset:0,x:i.x,y:i.y};n(y(ut(r)?T.TouchMove:T.MouseMove,{positions:[u]}))}},Ne,{trailing:!1}),{stop:s}=C(t,document,["mousemove","touchmove"],e,{capture:!0,passive:!0});return{stop:()=>{s(),o()}}}function lt(t){let{clientX:n,clientY:e}=ut(t)?t.changedTouches[0]:t;if(window.visualViewport){const{visualViewportX:o,visualViewportY:s}=ye(n,e);n=o,e=s}if(!Number.isFinite(n)||!Number.isFinite(e)){t.isTrusted&&et("mouse/touch event without x/y");return}return{x:n,y:e}}const X={pointerup:E.MouseUp,mousedown:E.MouseDown,click:E.Click,contextmenu:E.ContextMenu,dblclick:E.DblClick,focus:E.Focus,blur:E.Blur,touchstart:E.TouchStart,touchend:E.TouchEnd};function Me(t,n,e){const o=s=>{const r=_(s);if(v(r,t.defaultPrivacyLevel)===S.HIDDEN||!w(r))return;const a=g(r),i=X[s.type];let u;if(i!==E.Blur&&i!==E.Focus){const c=lt(s);if(!c)return;u={id:a,type:i,x:c.x,y:c.y}}else u={id:a,type:i};const f={id:e.getIdForEvent(s),...y(T.MouseInteraction,u)};n(f)};return C(t,document,Object.keys(X),o,{capture:!0,passive:!0})}const ve=100;function dt(t,n,e,o=document){const{throttled:s,cancel:r}=A(i=>{const u=_(i);if(!u||v(u,t.defaultPrivacyLevel)===S.HIDDEN||!w(u))return;const f=g(u),c=u===document?{scrollTop:st(),scrollLeft:nt()}:{scrollTop:Math.round(u.scrollTop),scrollLeft:Math.round(u.scrollLeft)};e.set(u,c),n(y(T.Scroll,{id:f,x:c.scrollLeft,y:c.scrollTop}))},ve),{stop:a}=Rt(t,o,"scroll",s,{capture:!0,passive:!0});return{stop:()=>{a(),r()}}}const Ie=200;function Re(t,n){const e=Ct(t).subscribe(o=>{n(y(T.ViewportResize,o))});return{stop:()=>{e.unsubscribe()}}}function Ce(t,n){const e=window.visualViewport;if(!e)return{stop:R};const{throttled:o,cancel:s}=A(()=>{n({data:ct(e),type:N.VisualViewport,timestamp:M()})},Ie,{trailing:!1}),{stop:r}=C(t,e,["resize","scroll"],o,{capture:!0,passive:!0});return{stop:()=>{r(),s()}}}function xe(t,n){return C(t,document,["play","pause"],e=>{const o=_(e);!o||v(o,t.defaultPrivacyLevel)===S.HIDDEN||!w(o)||n(y(T.MediaInteraction,{id:g(o),type:e.type==="play"?Y.Play:Y.Pause}))},{capture:!0,passive:!0})}function be(t){function n(s,r){s&&w(s.ownerNode)&&r(g(s.ownerNode))}const e=[D(CSSStyleSheet.prototype,"insertRule",({target:s,parameters:[r,a]})=>{n(s,i=>t(y(T.StyleSheetRule,{id:i,adds:[{rule:r,index:a}]})))}),D(CSSStyleSheet.prototype,"deleteRule",({target:s,parameters:[r]})=>{n(s,a=>t(y(T.StyleSheetRule,{id:a,removes:[{index:r}]})))})];typeof CSSGroupingRule<"u"?o(CSSGroupingRule):(o(CSSMediaRule),o(CSSSupportsRule));function o(s){e.push(D(s.prototype,"insertRule",({target:r,parameters:[a,i]})=>{n(r.parentStyleSheet,u=>{const f=K(r);f&&(f.push(i||0),t(y(T.StyleSheetRule,{id:u,adds:[{rule:a,index:f}]})))})}),D(s.prototype,"deleteRule",({target:r,parameters:[a]})=>{n(r.parentStyleSheet,i=>{const u=K(r);u&&(u.push(a),t(y(T.StyleSheetRule,{id:i,removes:[{index:u}]})))})}))}return{stop:()=>{e.forEach(s=>s.stop())}}}function K(t){const n=[];let e=t;for(;e.parentRule;){const a=Array.from(e.parentRule.cssRules).indexOf(e);n.unshift(a),e=e.parentRule}if(!e.parentStyleSheet)return;const s=Array.from(e.parentStyleSheet.cssRules).indexOf(e);return n.unshift(s),n}function _e(t,n){return C(t,window,["focus","blur"],()=>{n({data:{has_focus:document.hasFocus()},type:N.Focus,timestamp:M()})})}function De(t,n,e){const o=t.subscribe(12,s=>{var r,a;s.rawRumEvent.type===xt.ACTION&&s.rawRumEvent.action.type===bt.CLICK&&(!((a=(r=s.rawRumEvent.action.frustration)===null||r===void 0?void 0:r.type)===null||a===void 0)&&a.length)&&"events"in s.domainContext&&s.domainContext.events&&s.domainContext.events.length&&n({timestamp:s.rawRumEvent.date,type:N.FrustrationRecord,data:{frustrationTypes:s.rawRumEvent.action.frustration.type,recordIds:s.domainContext.events.map(i=>e.getIdForEvent(i))}})});return{stop:()=>{o.unsubscribe()}}}function Le(t,n){const e=t.subscribe(5,()=>{n({timestamp:M(),type:N.ViewEnd})});return{stop:()=>{e.unsubscribe()}}}function ft(t,n,e=document){const o=t.defaultPrivacyLevel,s=new WeakMap,r=e!==document,{stop:a}=C(t,e,r?["change"]:["input","change"],c=>{const d=_(c);(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement)&&u(d)},{capture:!0,passive:!0});let i;if(r)i=R;else{const c=[x(HTMLInputElement.prototype,"value",u),x(HTMLInputElement.prototype,"checked",u),x(HTMLSelectElement.prototype,"value",u),x(HTMLTextAreaElement.prototype,"value",u),x(HTMLSelectElement.prototype,"selectedIndex",u)];i=()=>{c.forEach(d=>d.stop())}}return{stop:()=>{i(),a()}};function u(c){const d=v(c,o);if(d===S.HIDDEN)return;const l=c.type;let m;if(l==="radio"||l==="checkbox"){if(O(c,d))return;m={isChecked:c.checked}}else{const p=k(c,d);if(p===void 0)return;m={text:p}}f(c,m);const h=c.name;l==="radio"&&h&&c.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(h)}"]`).forEach(p=>{p!==c&&f(p,{isChecked:!1})})}function f(c,d){if(!w(c))return;const l=s.get(c);(!l||l.text!==d.text||l.isChecked!==d.isChecked)&&(s.set(c,d),n(y(T.Input,{id:g(c),...d})))}}const Ae=100,ze=16;function Oe(t){let n=R,e=[];function o(){n(),t(e),e=[]}const{throttled:s,cancel:r}=A(o,ze,{leading:!1});return{addMutations:a=>{e.length===0&&(n=_t(s,{timeout:Ae})),e.push(...a)},flush:o,stop:()=>{n(),r()}}}function pt(t,n,e,o){const s=Dt();if(!s)return{stop:R,flush:R};const r=Oe(i=>{Ve(i.concat(a.takeRecords()),t,n,e)}),a=new s(Lt(r.addMutations));return a.observe(o,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{a.disconnect(),r.stop()},flush:()=>{r.flush()}}}function Ve(t,n,e,o){const s=new Map;t.filter(l=>l.type==="childList").forEach(l=>{l.removedNodes.forEach(m=>{ht(m,o.removeShadowRoot)})});const r=t.filter(l=>l.target.isConnected&&Kt(l.target)&&v(l.target,e.defaultPrivacyLevel,s)!==S.HIDDEN),a=F(),{adds:i,removes:u,hasBeenSerialized:f}=Pe(r.filter(l=>l.type==="childList"),e,a,o,s),c=ke(r.filter(l=>l.type==="characterData"&&!f(l.target)),e,s),d=Fe(r.filter(l=>l.type==="attributes"&&!f(l.target)),e,s);!c.length&&!d.length&&!u.length&&!i.length||n(y(T.Mutation,{adds:i,removes:u,texts:c,attributes:d}),a)}function Pe(t,n,e,o,s){const r=new Set,a=new Map;for(const h of t)h.addedNodes.forEach(p=>{r.add(p)}),h.removedNodes.forEach(p=>{r.has(p)||a.set(p,h.target),r.delete(p)});const i=Array.from(r);Ue(i);const u=new Set,f={status:2,serializationStats:e,shadowRootsController:o},c=[];for(const h of i){if(l(h))continue;const p=v(h.parentNode,n.defaultPrivacyLevel,s);if(p===S.HIDDEN||p===S.IGNORE)continue;const St=M(),H=U(h,{serializedNodeIds:u,parentNodePrivacyLevel:p,serializationContext:f,configuration:n});if(L(e,"serializationDuration",Q(St,M())),!H)continue;const gt=V(h);c.push({nextId:m(h),parentId:g(gt),node:H})}const d=[];return a.forEach((h,p)=>{w(p)&&d.push({parentId:g(h),id:g(p)})}),{adds:c,removes:d,hasBeenSerialized:l};function l(h){return w(h)&&u.has(g(h))}function m(h){let p=h.nextSibling;for(;p;){if(w(p))return g(p);p=p.nextSibling}return null}}function ke(t,n,e){var o;const s=[],r=new Set,a=t.filter(i=>r.has(i.target)?!1:(r.add(i.target),!0));for(const i of a){if(i.target.textContent===i.oldValue)continue;const f=v(V(i.target),n.defaultPrivacyLevel,e);f===S.HIDDEN||f===S.IGNORE||s.push({id:g(i.target),value:(o=J(i.target,!1,f))!==null&&o!==void 0?o:null})}return s}function Fe(t,n,e){const o=[],s=new Map,r=t.filter(i=>{const u=s.get(i.target);return u&&u.has(i.attributeName)?!1:(u?u.add(i.attributeName):s.set(i.target,new Set([i.attributeName])),!0)}),a=new Map;for(const i of r){if(i.target.getAttribute(i.attributeName)===i.oldValue)continue;const f=v(i.target,n.defaultPrivacyLevel,e),c=it(i.target,f,i.attributeName,n);let d;if(i.attributeName==="value"){const m=k(i.target,f);if(m===void 0)continue;d=m}else typeof c=="string"?d=c:d=null;let l=a.get(i.target);l||(l={id:g(i.target),attributes:{}},o.push(l),a.set(i.target,l)),l.attributes[i.attributeName]=d}return o}function Ue(t){t.sort((n,e)=>{const o=n.compareDocumentPosition(e);return o&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:o&Node.DOCUMENT_POSITION_CONTAINS||o&Node.DOCUMENT_POSITION_FOLLOWING?1:o&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function ht(t,n){tt(t)&&n(t.shadowRoot),Z(t,e=>ht(e,n))}function Be(){const t=new WeakMap;return{set(n,e){n===document&&!document.scrollingElement||t.set(n===document?document.scrollingElement:n,e)},get(n){return t.get(n)},has(n){return t.has(n)}}}const He=(t,n,e)=>{const o=new Map,s={addShadowRoot:r=>{if(o.has(r))return;const a=pt(n,t,s,r),i=ft(t,n,r),u=dt(t,n,e,r);o.set(r,{flush:()=>a.flush(),stop:()=>{a.stop(),i.stop(),u.stop()}})},removeShadowRoot:r=>{const a=o.get(r);a&&(a.stop(),o.delete(r))},stop:()=>{o.forEach(({stop:r})=>r())},flush:()=>{o.forEach(({flush:r})=>r())}};return s};function Ge(t,n,e,o,s,r){const a=(u,f)=>{const{width:c,height:d}=At();r({data:{height:d,href:window.location.href,width:c},type:N.Meta,timestamp:u}),r({data:{has_focus:document.hasFocus()},type:N.Focus,timestamp:u});const l=F();r({data:{node:Te(document,o,{status:f,elementsScrollPositions:t,serializationStats:l,shadowRootsController:n}),initialOffset:{left:nt(),top:st()}},type:N.FullSnapshot,timestamp:u},l),window.visualViewport&&r({data:ct(window.visualViewport),type:N.VisualViewport,timestamp:u})};a(M(),0);const{unsubscribe:i}=e.subscribe(2,u=>{s(),a(u.startClocks.timeStamp,1)});return{stop:i}}function We(){const t=new WeakMap;let n=1;return{getIdForEvent(e){return t.has(e)||t.set(e,n++),t.get(e)}}}function Ye(t){const{emit:n,configuration:e,lifeCycle:o}=t;if(!n)throw new Error("emit function is required");const s=(l,m)=>{n(l,m),zt("record",{record:l});const h=t.viewHistory.findView();Ot(h.id)},r=Be(),a=He(e,s,r),{stop:i}=Ge(r,a,o,e,u,s);function u(){a.flush(),c.flush()}const f=We(),c=pt(s,e,a,document),d=[c,we(e,s),Me(e,s,f),dt(e,s,r,document),Re(e,s),ft(e,s),xe(e,s),be(s),_e(e,s),Ce(e,s),De(o,s,f),Le(o,l=>{u(),s(l)})];return{stop:()=>{a.stop(),d.forEach(l=>l.stop()),i()},flushMutations:u,shadowRootsController:a}}function $e(t,n,e,o){const s=new FormData;s.append("segment",new Blob([t],{type:"application/octet-stream"}),`${n.session.id}-${n.start}`);const r={raw_segment_size:o,compressed_segment_size:t.byteLength,...n},a=JSON.stringify(r);return s.append("event",new Blob([a],{type:"application/json"})),{data:s,bytesCount:t.byteLength,cssText:e.cssText,isFullSnapshot:n.index_in_view===0,rawSize:o,recordCount:n.records_count,serializationDuration:e.serializationDuration}}function Xe({context:t,creationReason:n,encoder:e}){let o=0;const s=t.view.id,r=Vt(s),a={start:1/0,end:-1/0,creation_reason:n,records_count:0,has_full_snapshot:!1,index_in_view:r,source:"browser",...t},i=F();Pt(s);function u(c,d,l){a.start=Math.min(a.start,c.timestamp),a.end=Math.max(a.end,c.timestamp),a.records_count+=1,a.has_full_snapshot||(a.has_full_snapshot=c.type===N.FullSnapshot),d&&se(i,d);const m=e.isEmpty?'{"records":[':",";e.write(m+JSON.stringify(c),h=>{o+=h,l(o)})}function f(c){if(e.isEmpty)throw new Error("Empty segment flushed");e.write(`],${JSON.stringify(a).slice(1)}
|
|
2
2
|
`),e.finish(d=>{kt(a.view.id,d.rawBytesCount),c(a,i,d)})}return{addRecord:u,flush:f}}const Ke=5*Ht;let mt=6e4;function je(t,n,e,o,s,r){return qe(t,()=>Je(n.applicationId,e,o),s,r)}function qe(t,n,e,o){let s={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:r}=t.subscribe(2,()=>{i("view_change")}),{unsubscribe:a}=t.subscribe(11,u=>{i(u.reason)});function i(u){s.status===1&&(s.segment.flush((f,c,d)=>{const l=$e(d.output,f,c,d.rawBytesCount);Ft(u)?e.sendOnExit(l):e.send(l)}),Ut(s.expirationTimeoutId)),u!=="stop"?s={status:0,nextSegmentCreationReason:u}:s={status:2}}return{addRecord:(u,f)=>{if(s.status!==2){if(s.status===0){const c=n();if(!c)return;s={status:1,segment:Xe({encoder:o,context:c,creationReason:s.nextSegmentCreationReason}),expirationTimeoutId:Bt(()=>{i("segment_duration_limit")},Ke)}}s.segment.addRecord(u,f,c=>{c>mt&&i("segment_bytes_limit")})}},stop:()=>{i("stop"),r(),a()}}}function Je(t,n,e){const o=n.findTrackedSession(),s=e.findView();if(!(!o||!s))return{application:{id:t},session:{id:o.id},view:{id:s.id}}}const Ze="Segment network request metrics";function Qe(t,n,e){if(!(n.enabled&&Gt(t.replayTelemetrySampleRate)))return{stop:R};const{unsubscribe:s}=e.subscribe(r=>{if(r.type==="failure"||r.type==="queue-full"||r.type==="success"&&r.payload.isFullSnapshot){const a=tn(r.type,r.bandwidth,r.payload);Wt(Ze,{metrics:a})}});return{stop:s}}function tn(t,n,e){return{cssText:{count:e.cssText.count,max:e.cssText.max,sum:e.cssText.sum},isFullSnapshot:e.isFullSnapshot,ongoingRequests:{count:n.ongoingRequestCount,totalSize:n.ongoingByteCount},recordCount:e.recordCount,result:t,serializationDuration:{count:e.serializationDuration.count,max:e.serializationDuration.max,sum:e.serializationDuration.sum},size:{compressed:e.bytesCount,raw:e.rawSize}}}function en(t){const n=Yt();return{addRecord:e=>{const o=t.findView();n.send("record",e,o.id)}}}function sn(t,n,e,o,s,r,a){const i=[],u=l=>{t.notify(14,{error:l}),et("Error reported to customer",{"error.message":l.message})},f=a||$t([n.sessionReplayEndpointBuilder],mt,u);let c;if(Xt())({addRecord:c}=en(o));else{const l=je(t,n,e,o,f,s);c=l.addRecord,i.push(l.stop);const m=Qe(n,r,f.observable);i.push(m.stop)}const{stop:d}=Ye({emit:c,configuration:n,lifeCycle:t,viewHistory:o});return i.push(d),{stop:()=>{i.forEach(l=>l())}}}export{sn as startRecording};
|
package/studio/web/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="icon" type="dynamic-favicon" href="/favicon_purple.png" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
9
|
<title>Harper Studio</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-BqOgGOeU.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-Dj8x6atJ.css">
|
|
12
12
|
</head>
|
|
13
13
|
|