@tscircuit/runframe 0.0.768 → 0.0.769

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.
@@ -1002,7 +1002,7 @@ ${r.stack}`),n.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffect
1002
1002
  `);const x=v.state[s];if(x==null)return;JSON.stringify(r.getState())!==JSON.stringify(x)&&h(x);return}r.dispatchFromDevtools&&typeof r.dispatch=="function"&&r.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return h(A),s===void 0?u==null?void 0:u.init(r.getState()):u==null?void 0:u.init(ZY(l.name));case"COMMIT":if(s===void 0){u==null||u.init(r.getState());return}return u==null?void 0:u.init(ZY(l.name));case"ROLLBACK":return gde(m.state,v=>{if(s===void 0){h(v),u==null||u.init(r.getState());return}h(v[s]),u==null||u.init(ZY(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return gde(m.state,v=>{if(s===void 0){h(v);return}JSON.stringify(r.getState())!==JSON.stringify(v[s])&&h(v[s])});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,x=(_=v.computedStates.slice(-1)[0])==null?void 0:_.state;if(!x)return;h(s===void 0?x:x[s]),u==null||u.send(null,v);return}case"PAUSE_RECORDING":return f=!f}return}}),A},gde=(i,e)=>{let t;try{t=JSON.parse(i)}catch(n){console.error("[zustand devtools middleware] Could not parse the received json",n)}t!==void 0&&e(t)},R4=window.TSCIRCUIT_FILESERVER_API_BASE_URL??"/api",mde=OGe.extend("store");async function tze(i,e){return(await(await fetch(`${R4}/files/upsert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:i,text_content:e})})).json()).file}async function yde(i){return(await(await fetch(`${R4}/files/get?file_path=${encodeURIComponent(i)}`)).json()).file}async function Onn(i){const e=i?`${R4}/events/list?since=${encodeURIComponent(i)}`:`${R4}/events/list`;return(await(await fetch(e)).json()).event_list}async function Gnn(){const i=await fetch(`${R4}/files/list`),{file_list:e}=await i.json(),t=new Map;for(const n of e){const r=await yde(n.file_path);t.set(n.file_path,r.text_content)}return t}const q2=$Ge()(eze((i,e)=>({fsMap:new Map,lastEventTime:new Date().toISOString(),isPolling:!1,error:null,circuitJson:null,lastManualEditsChangeSentAt:0,recentEvents:[],simulateScenarioOrder:void 0,loadInitialFiles:async()=>{const t=await Gnn();mde("loaded initial files",{fsMap:t}),i({fsMap:t})},upsertFile:async(t,n)=>{try{const r=await tze(t,n);i(o=>({fsMap:new Map(o.fsMap).set(r.file_path,r.text_content)}))}catch(r){i({error:r})}},getFile:async t=>{try{const n=await yde(t);i(r=>({fsMap:new Map(r.fsMap).set(n.file_path,n.text_content)}))}catch(n){i({error:n})}},setCircuitJson:t=>{t!==e().circuitJson&&i({circuitJson:t})},startPolling:()=>{const t=async()=>{const n=e();if(n.isPolling){try{const r=await Onn(n.lastEventTime);if(r.length>0){i(s=>({recentEvents:[...s.recentEvents,...r].slice(0,100)}));const o=r[r.length-1].created_at,a=new Map(n.fsMap);for(const s of r)if(s.event_type==="FILE_UPDATED"){const l=await yde(s.file_path);if(s.file_path==="manual_edits.json"&&Date.now()-n.lastManualEditsChangeSentAt<1e3)continue;a.set(l.file_path,l.text_content)}i({fsMap:a,lastEventTime:o})}}catch(r){i({error:r})}setTimeout(t,1e3)}};i({isPolling:!0}),t()},stopPolling:()=>{i({isPolling:!1})},pushEvent:async t=>{await fetch(`${window.TSCIRCUIT_FILESERVER_API_BASE_URL??""}/api/events/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},applyEditEventsAndUpdateManualEditsJson:async t=>{mde("applyEditEventsAndUpdateManualEditsJson",{editEvents:t});const n=e();if(!n.circuitJson)return;const r=n.fsMap.get("manual-edits.json"),o=r?JSON.parse(r):{},a=PGe({circuitJson:n.circuitJson,editEvents:t,manualEditsFile:o});mde("updatedManualEditsFileContent",a),i(s=>({lastManualEditsChangeSentAt:Date.now(),fsMap:new Map(s.fsMap).set("manual-edits.json",JSON.stringify(a))})),await tze("manual-edits.json",JSON.stringify(a,null,2))},setSimulateScenarioOrder:t=>i({simulateScenarioOrder:t})}),{name:"run-frame-store"})),znn=OGe.extend("useEditEventController"),Hnn=()=>{const i=q2(h=>h.applyEditEventsAndUpdateManualEditsJson),[e,t]=mt.useState([]),[n,r]=mt.useState(!1),o=e.filter(h=>!h._applied),a=e.filter(h=>h._applied),s=n?e:o,l=mt.useCallback(h=>{t(A=>[...A,{...h,_applied:!1}])},[]),c=mt.useCallback(h=>{t(A=>A.map(m=>m===h?{...m,_applied:!0}:m))},[]),u=mt.useCallback(()=>{t(h=>h.map(A=>({...A,_applied:!0})))},[]),d=mt.useCallback(()=>{r(!0),e.length!==0&&(znn("removing edit events that are applied"),t(h=>h.filter(A=>!A._applied)))},[e]),f=mt.useCallback(()=>{r(!1)},[]);return mt.useEffect(()=>{if(e.filter(A=>!A._applied).length===0)return;const h=setTimeout(()=>{u(),i(e)},1e3);return()=>clearTimeout(h)},[e]),{unappliedEditEvents:o,appliedEditEvents:a,editEventsForRender:s,pushEditEvent:l,markEditEventApplied:c,markRenderStarted:d,markRenderComplete:f,markAllEditEventsApplied:u}};function Lg(i,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(i==null||i(r),t===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}function Ynn(i,e){const t=mt.createContext(e),n=o=>{const{children:a,...s}=o,l=mt.useMemo(()=>s,Object.values(s));return st.jsx(t.Provider,{value:l,children:a})};n.displayName=i+"Provider";function r(o){const a=mt.useContext(t);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${i}\``)}return[n,r]}function cS(i,e=[]){let t=[];function n(o,a){const s=mt.createContext(a),l=t.length;t=[...t,a];const c=d=>{var v;const{scope:f,children:h,...A}=d,m=((v=f==null?void 0:f[i])==null?void 0:v[l])||s,_=mt.useMemo(()=>A,Object.values(A));return st.jsx(m.Provider,{value:_,children:h})};c.displayName=o+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[i])==null?void 0:m[l])||s,A=mt.useContext(h);if(A)return A;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const r=()=>{const o=t.map(a=>mt.createContext(a));return function(s){const l=(s==null?void 0:s[i])||o;return mt.useMemo(()=>({[`__scope${i}`]:{...s,[i]:l}}),[s,l])}};return r.scopeName=i,[n,Vnn(r,...e)]}function Vnn(...i){const e=i[0];if(i.length===1)return e;const t=()=>{const n=i.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const a=n.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return mt.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return t.scopeName=e.scopeName,t}function nze(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function Q4(...i){return e=>{let t=!1;const n=i.map(r=>{const o=nze(r,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<n.length;r++){const o=n[r];typeof o=="function"?o():nze(i[r],null)}}}}function fI(...i){return mt.useCallback(Q4(...i),i)}function RM(i){const e=Knn(i),t=mt.forwardRef((n,r)=>{const{children:o,...a}=n,s=mt.Children.toArray(o),l=s.find(qnn);if(l){const c=l.props.children,u=s.map(d=>d===l?mt.Children.count(c)>1?mt.Children.only(null):mt.isValidElement(c)?c.props.children:null:d);return st.jsx(e,{...a,ref:r,children:mt.isValidElement(c)?mt.cloneElement(c,void 0,u):null})}return st.jsx(e,{...a,ref:r,children:o})});return t.displayName=`${i}.Slot`,t}var jnn=RM("Slot");function Knn(i){const e=mt.forwardRef((t,n)=>{const{children:r,...o}=t;if(mt.isValidElement(r)){const a=Znn(r),s=Jnn(o,r.props);return r.type!==mt.Fragment&&(s.ref=n?Q4(n,a):a),mt.cloneElement(r,s)}return mt.Children.count(r)>1?mt.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var ize=Symbol("radix.slottable");function Xnn(i){const e=({children:t})=>st.jsx(st.Fragment,{children:t});return e.displayName=`${i}.Slottable`,e.__radixId=ize,e}function qnn(i){return mt.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===ize}function Jnn(i,e){const t={...e};for(const n in e){const r=i[n],o=e[n];/^on[A-Z]/.test(n)?r&&o?t[n]=(...s)=>{const l=o(...s);return r(...s),l}:r&&(t[n]=r):n==="style"?t[n]={...r,...o}:n==="className"&&(t[n]=[r,o].filter(Boolean).join(" "))}return{...i,...t}}function Znn(i){var n,r;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(r=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}function rze(i){const e=i+"CollectionProvider",[t,n]=cS(e),[r,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:_,children:v}=m,x=ep.useRef(null),I=ep.useRef(new Map).current;return st.jsx(r,{scope:_,itemMap:I,collectionRef:x,children:v})};a.displayName=e;const s=i+"CollectionSlot",l=RM(s),c=ep.forwardRef((m,_)=>{const{scope:v,children:x}=m,I=o(s,v),M=fI(_,I.collectionRef);return st.jsx(l,{ref:M,children:x})});c.displayName=s;const u=i+"CollectionItemSlot",d="data-radix-collection-item",f=RM(u),h=ep.forwardRef((m,_)=>{const{scope:v,children:x,...I}=m,M=ep.useRef(null),G=fI(_,M),k=o(u,v);return ep.useEffect(()=>(k.itemMap.set(M,{ref:M,...I}),()=>void k.itemMap.delete(M))),st.jsx(f,{[d]:"",ref:G,children:x})});h.displayName=u;function A(m){const _=o(i+"CollectionConsumer",m);return ep.useCallback(()=>{const x=_.collectionRef.current;if(!x)return[];const I=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(_.itemMap.values()).sort((k,L)=>I.indexOf(k.ref.current)-I.indexOf(L.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:a,Slot:c,ItemSlot:h},A,n]}var IB=globalThis!=null&&globalThis.document?mt.useLayoutEffect:()=>{},Wnn=aDe[" useId ".trim().toString()]||(()=>{}),$nn=0;function eE(i){const[e,t]=mt.useState(Wnn());return IB(()=>{t(n=>n??String($nn++))},[i]),e?`radix-${e}`:""}var _de=eDe();const oze=BI(_de);var ein=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],d1=ein.reduce((i,e)=>{const t=RM(`Primitive.${e}`),n=mt.forwardRef((r,o)=>{const{asChild:a,...s}=r,l=a?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),st.jsx(l,{...s,ref:o})});return n.displayName=`Primitive.${e}`,{...i,[e]:n}},{});function aze(i,e){i&&_de.flushSync(()=>i.dispatchEvent(e))}function uS(i){const e=mt.useRef(i);return mt.useEffect(()=>{e.current=i}),mt.useMemo(()=>(...t)=>{var n;return(n=e.current)==null?void 0:n.call(e,...t)},[])}var tin=aDe[" useInsertionEffect ".trim().toString()]||IB;function QM({prop:i,defaultProp:e,onChange:t=()=>{},caller:n}){const[r,o,a]=nin({defaultProp:e,onChange:t}),s=i!==void 0,l=s?i:r;{const u=mt.useRef(i!==void 0);mt.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}const c=mt.useCallback(u=>{var d;if(s){const f=iin(u)?u(i):u;f!==i&&((d=a.current)==null||d.call(a,f))}else o(u)},[s,i,o,a]);return[l,c]}function nin({defaultProp:i,onChange:e}){const[t,n]=mt.useState(i),r=mt.useRef(t),o=mt.useRef(e);return tin(()=>{o.current=e},[e]),mt.useEffect(()=>{var a;r.current!==t&&((a=o.current)==null||a.call(o,t),r.current=t)},[t,r]),[t,n,o]}function iin(i){return typeof i=="function"}var rin=mt.createContext(void 0);function vde(i){const e=mt.useContext(rin);return i||e||"ltr"}var xde="rovingFocusGroup.onEntryFocus",oin={bubbles:!1,cancelable:!0},ik="RovingFocusGroup",[Ide,sze,ain]=rze(ik),[sin,WY]=cS(ik,[ain]),[lin,cin]=sin(ik),lze=mt.forwardRef((i,e)=>st.jsx(Ide.Provider,{scope:i.__scopeRovingFocusGroup,children:st.jsx(Ide.Slot,{scope:i.__scopeRovingFocusGroup,children:st.jsx(uin,{...i,ref:e})})}));lze.displayName=ik;var uin=mt.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=i,f=mt.useRef(null),h=fI(e,f),A=vde(o),[m,_]=QM({prop:a,defaultProp:s??null,onChange:l,caller:ik}),[v,x]=mt.useState(!1),I=uS(c),M=sze(t),G=mt.useRef(!1),[k,L]=mt.useState(0);return mt.useEffect(()=>{const R=f.current;if(R)return R.addEventListener(xde,I),()=>R.removeEventListener(xde,I)},[I]),st.jsx(lin,{scope:t,orientation:n,dir:A,loop:r,currentTabStopId:m,onItemFocus:mt.useCallback(R=>_(R),[_]),onItemShiftTab:mt.useCallback(()=>x(!0),[]),onFocusableItemAdd:mt.useCallback(()=>L(R=>R+1),[]),onFocusableItemRemove:mt.useCallback(()=>L(R=>R-1),[]),children:st.jsx(d1.div,{tabIndex:v||k===0?-1:0,"data-orientation":n,...d,ref:h,style:{outline:"none",...i.style},onMouseDown:Lg(i.onMouseDown,()=>{G.current=!0}),onFocus:Lg(i.onFocus,R=>{const U=!G.current;if(R.target===R.currentTarget&&U&&!v){const D=new CustomEvent(xde,oin);if(R.currentTarget.dispatchEvent(D),!D.defaultPrevented){const Z=M().filter(ae=>ae.focusable),Y=Z.find(ae=>ae.active),W=Z.find(ae=>ae.id===m),he=[Y,W,...Z].filter(Boolean).map(ae=>ae.ref.current);dze(he,u)}}G.current=!1}),onBlur:Lg(i.onBlur,()=>x(!1))})})}),cze="RovingFocusGroupItem",uze=mt.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:o,children:a,...s}=i,l=eE(),c=o||l,u=cin(cze,t),d=u.currentTabStopId===c,f=sze(t),{onFocusableItemAdd:h,onFocusableItemRemove:A,currentTabStopId:m}=u;return mt.useEffect(()=>{if(n)return h(),()=>A()},[n,h,A]),st.jsx(Ide.ItemSlot,{scope:t,id:c,focusable:n,active:r,children:st.jsx(d1.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:Lg(i.onMouseDown,_=>{n?u.onItemFocus(c):_.preventDefault()}),onFocus:Lg(i.onFocus,()=>u.onItemFocus(c)),onKeyDown:Lg(i.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){u.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const v=hin(_,u.orientation,u.dir);if(v!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let I=f().filter(M=>M.focusable).map(M=>M.ref.current);if(v==="last")I.reverse();else if(v==="prev"||v==="next"){v==="prev"&&I.reverse();const M=I.indexOf(_.currentTarget);I=u.loop?pin(I,M+1):I.slice(M+1)}setTimeout(()=>dze(I))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:m!=null}):a})})});uze.displayName=cze;var din={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function fin(i,e){return e!=="rtl"?i:i==="ArrowLeft"?"ArrowRight":i==="ArrowRight"?"ArrowLeft":i}function hin(i,e,t){const n=fin(i.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return din[n]}function dze(i,e=!1){const t=document.activeElement;for(const n of i)if(n===t||(n.focus({preventScroll:e}),document.activeElement!==t))return}function pin(i,e){return i.map((t,n)=>i[(e+n)%i.length])}var fze=lze,hze=uze;function Ain(i,e){return mt.useReducer((t,n)=>e[t][n]??t,i)}var E5=i=>{const{present:e,children:t}=i,n=gin(e),r=typeof t=="function"?t({present:n.isPresent}):mt.Children.only(t),o=fI(n.ref,min(r));return typeof t=="function"||n.isPresent?mt.cloneElement(r,{ref:o}):null};E5.displayName="Presence";function gin(i){const[e,t]=mt.useState(),n=mt.useRef(null),r=mt.useRef(i),o=mt.useRef("none"),a=i?"mounted":"unmounted",[s,l]=Ain(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return mt.useEffect(()=>{const c=$Y(n.current);o.current=s==="mounted"?c:"none"},[s]),IB(()=>{const c=n.current,u=r.current;if(u!==i){const f=o.current,h=$Y(c);i?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=i}},[i,l]),IB(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=h=>{const m=$Y(n.current).includes(h.animationName);if(h.target===e&&m&&(l("ANIMATION_END"),!r.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},f=h=>{h.target===e&&(o.current=$Y(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:mt.useCallback(c=>{n.current=c?getComputedStyle(c):null,t(c)},[])}}function $Y(i){return(i==null?void 0:i.animationName)||"none"}function min(i){var n,r;let e=(n=Object.getOwnPropertyDescriptor(i.props,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=(r=Object.getOwnPropertyDescriptor(i,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var eV="Tabs",[yin,mNi]=cS(eV,[WY]),pze=WY(),[_in,bde]=yin(eV),Aze=mt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,onValueChange:r,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=i,u=vde(s),[d,f]=QM({prop:n,onChange:r,defaultProp:o??"",caller:eV});return st.jsx(_in,{scope:t,baseId:eE(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:l,children:st.jsx(d1.div,{dir:u,"data-orientation":a,...c,ref:e})})});Aze.displayName=eV;var gze="TabsList",mze=mt.forwardRef((i,e)=>{const{__scopeTabs:t,loop:n=!0,...r}=i,o=bde(gze,t),a=pze(t);return st.jsx(fze,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:n,children:st.jsx(d1.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});mze.displayName=gze;var yze="TabsTrigger",_ze=mt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,disabled:r=!1,...o}=i,a=bde(yze,t),s=pze(t),l=Ize(a.baseId,n),c=bze(a.baseId,n),u=n===a.value;return st.jsx(hze,{asChild:!0,...s,focusable:!r,active:u,children:st.jsx(d1.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:e,onMouseDown:Lg(i.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?a.onValueChange(n):d.preventDefault()}),onKeyDown:Lg(i.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(n)}),onFocus:Lg(i.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!r&&d&&a.onValueChange(n)})})})});_ze.displayName=yze;var vze="TabsContent",xze=mt.forwardRef((i,e)=>{const{__scopeTabs:t,value:n,forceMount:r,children:o,...a}=i,s=bde(vze,t),l=Ize(s.baseId,n),c=bze(s.baseId,n),u=n===s.value,d=mt.useRef(u);return mt.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),st.jsx(E5,{present:r||u,children:({present:f})=>st.jsx(d1.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:e,style:{...i.style,animationDuration:d.current?"0s":void 0},children:f&&o})})});xze.displayName=vze;function Ize(i,e){return`${i}-trigger-${e}`}function bze(i,e){return`${i}-content-${e}`}var vin=Aze,Cze=mze,Eze=_ze,Sze=xze;function wze(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=wze(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function dS(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=wze(i))&&(n&&(n+=" "),n+=e);return n}const Cde="-",xin=i=>{const e=bin(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:n}=i;return{getClassGroupId:a=>{const s=a.split(Cde);return s[0]===""&&s.length!==1&&s.shift(),Bze(s,e)||Iin(a)},getConflictingClassGroupIds:(a,s)=>{const l=t[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},Bze=(i,e)=>{var a;if(i.length===0)return e.classGroupId;const t=i[0],n=e.nextPart.get(t),r=n?Bze(i.slice(1),n):void 0;if(r)return r;if(e.validators.length===0)return;const o=i.join(Cde);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},Mze=/^\[(.+)\]$/,Iin=i=>{if(Mze.test(i)){const e=Mze.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},bin=i=>{const{theme:e,prefix:t}=i,n={nextPart:new Map,validators:[]};return Ein(Object.entries(i.classGroups),t).forEach(([o,a])=>{Ede(a,n,o,e)}),n},Ede=(i,e,t,n)=>{i.forEach(r=>{if(typeof r=="string"){const o=r===""?e:Rze(e,r);o.classGroupId=t;return}if(typeof r=="function"){if(Cin(r)){Ede(r(n),e,t,n);return}e.validators.push({validator:r,classGroupId:t});return}Object.entries(r).forEach(([o,a])=>{Ede(a,Rze(e,o),t,n)})})},Rze=(i,e)=>{let t=i;return e.split(Cde).forEach(n=>{t.nextPart.has(n)||t.nextPart.set(n,{nextPart:new Map,validators:[]}),t=t.nextPart.get(n)}),t},Cin=i=>i.isThemeGetter,Ein=(i,e)=>e?i.map(([t,n])=>{const r=n.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[t,r]}):i,Sin=i=>{if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,n=new Map;const r=(o,a)=>{t.set(o,a),e++,e>i&&(e=0,n=t,t=new Map)};return{get(o){let a=t.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return r(o,a),a},set(o,a){t.has(o)?t.set(o,a):r(o,a)}}},Qze="!",win=i=>{const{separator:e,experimentalParseClassName:t}=i,n=e.length===1,r=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,d;for(let _=0;_<s.length;_++){let v=s[_];if(c===0){if(v===r&&(n||s.slice(_,_+o)===e)){l.push(s.slice(u,_)),u=_+o;continue}if(v==="/"){d=_;continue}}v==="["?c++:v==="]"&&c--}const f=l.length===0?s:s.substring(u),h=f.startsWith(Qze),A=h?f.substring(1):f,m=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:A,maybePostfixModifierPosition:m}};return t?s=>t({className:s,parseClassName:a}):a},Bin=i=>{if(i.length<=1)return i;const e=[];let t=[];return i.forEach(n=>{n[0]==="["?(e.push(...t.sort(),n),t=[]):t.push(n)}),e.push(...t.sort()),e},Min=i=>({cache:Sin(i.cacheSize),parseClassName:win(i),...xin(i)}),Rin=/\s+/,Qin=(i,e)=>{const{parseClassName:t,getClassGroupId:n,getConflictingClassGroupIds:r}=e,o=[],a=i.trim().split(Rin);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=t(c);let A=!!h,m=n(A?f.substring(0,h):f);if(!m){if(!A){s=c+(s.length>0?" "+s:s);continue}if(m=n(f),!m){s=c+(s.length>0?" "+s:s);continue}A=!1}const _=Bin(u).join(":"),v=d?_+Qze:_,x=v+m;if(o.includes(x))continue;o.push(x);const I=r(m,A);for(let M=0;M<I.length;++M){const G=I[M];o.push(v+G)}s=c+(s.length>0?" "+s:s)}return s};function Din(){let i=0,e,t,n="";for(;i<arguments.length;)(e=arguments[i++])&&(t=Dze(e))&&(n&&(n+=" "),n+=t);return n}const Dze=i=>{if(typeof i=="string")return i;let e,t="";for(let n=0;n<i.length;n++)i[n]&&(e=Dze(i[n]))&&(t&&(t+=" "),t+=e);return t};function Nin(i,...e){let t,n,r,o=a;function a(l){const c=e.reduce((u,d)=>d(u),i());return t=Min(c),n=t.cache.get,r=t.cache.set,o=s,s(l)}function s(l){const c=n(l);if(c)return c;const u=Qin(l,t);return r(l,u),u}return function(){return o(Din.apply(null,arguments))}}const jx=i=>{const e=t=>t[i]||[];return e.isThemeGetter=!0,e},Nze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Tin=/^\d+\/\d+$/,kin=new Set(["px","full","screen"]),Pin=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lin=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fin=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uin=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Oin=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,D4=i=>DQ(i)||kin.has(i)||Tin.test(i),bB=i=>NQ(i,"length",Xin),DQ=i=>!!i&&!Number.isNaN(Number(i)),Sde=i=>NQ(i,"number",DQ),rk=i=>!!i&&Number.isInteger(Number(i)),Gin=i=>i.endsWith("%")&&DQ(i.slice(0,-1)),o_=i=>Nze.test(i),CB=i=>Pin.test(i),zin=new Set(["length","size","percentage"]),Hin=i=>NQ(i,zin,Tze),Yin=i=>NQ(i,"position",Tze),Vin=new Set(["image","url"]),jin=i=>NQ(i,Vin,Jin),Kin=i=>NQ(i,"",qin),ok=()=>!0,NQ=(i,e,t)=>{const n=Nze.exec(i);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):t(n[2]):!1},Xin=i=>Lin.test(i)&&!Fin.test(i),Tze=()=>!1,qin=i=>Uin.test(i),Jin=i=>Oin.test(i),Zin=Nin(()=>{const i=jx("colors"),e=jx("spacing"),t=jx("blur"),n=jx("brightness"),r=jx("borderColor"),o=jx("borderRadius"),a=jx("borderSpacing"),s=jx("borderWidth"),l=jx("contrast"),c=jx("grayscale"),u=jx("hueRotate"),d=jx("invert"),f=jx("gap"),h=jx("gradientColorStops"),A=jx("gradientColorStopPositions"),m=jx("inset"),_=jx("margin"),v=jx("opacity"),x=jx("padding"),I=jx("saturate"),M=jx("scale"),G=jx("sepia"),k=jx("skew"),L=jx("space"),R=jx("translate"),U=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto",o_,e],Y=()=>[o_,e],W=()=>["",D4,bB],ce=()=>["auto",DQ,o_],he=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ae=()=>["solid","dashed","dotted","double","none"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>["start","end","center","between","around","evenly","stretch"],Me=()=>["","0",o_],De=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Te=()=>[DQ,o_];return{cacheSize:500,separator:":",theme:{colors:[ok],spacing:[D4,bB],blur:["none","",CB,o_],brightness:Te(),borderColor:[i],borderRadius:["none","","full",CB,o_],borderSpacing:Y(),borderWidth:W(),contrast:Te(),grayscale:Me(),hueRotate:Te(),invert:Me(),gap:Y(),gradientColorStops:[i],gradientColorStopPositions:[Gin,bB],inset:Z(),margin:Z(),opacity:Te(),padding:Y(),saturate:Te(),scale:Te(),sepia:Me(),skew:Te(),space:Y(),translate:Y()},classGroups:{aspect:[{aspect:["auto","square","video",o_]}],container:["container"],columns:[{columns:[CB]}],"break-after":[{"break-after":De()}],"break-before":[{"break-before":De()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...he(),o_]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rk,o_]}],basis:[{basis:Z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",o_]}],grow:[{grow:Me()}],shrink:[{shrink:Me()}],order:[{order:["first","last","none",rk,o_]}],"grid-cols":[{"grid-cols":[ok]}],"col-start-end":[{col:["auto",{span:["full",rk,o_]},o_]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[ok]}],"row-start-end":[{row:["auto",{span:[rk,o_]},o_]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",o_]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",o_]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ge()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ge(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ge(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",o_,e]}],"min-w":[{"min-w":[o_,e,"min","max","fit"]}],"max-w":[{"max-w":[o_,e,"none","full","min","max","fit","prose",{screen:[CB]},CB]}],h:[{h:[o_,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[o_,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[o_,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[o_,e,"auto","min","max","fit"]}],"font-size":[{text:["base",CB,bB]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sde]}],"font-family":[{font:[ok]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",o_]}],"line-clamp":[{"line-clamp":["none",DQ,Sde]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",D4,o_]}],"list-image":[{"list-image":["none",o_]}],"list-style-type":[{list:["none","disc","decimal",o_]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",D4,bB]}],"underline-offset":[{"underline-offset":["auto",D4,o_]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",o_]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",o_]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...he(),Yin]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Hin]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jin]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...ae(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:ae()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...ae()]}],"outline-offset":[{"outline-offset":[D4,o_]}],"outline-w":[{outline:[D4,bB]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[D4,bB]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",CB,Kin]}],"shadow-color":[{shadow:[ok]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...ve(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ve()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",CB,o_]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[I]}],sepia:[{sepia:[G]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",o_]}],duration:[{duration:Te()}],ease:[{ease:["linear","in","out","in-out",o_]}],delay:[{delay:Te()}],animate:[{animate:["none","spin","ping","pulse","bounce",o_]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[rk,o_]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",o_]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",o_]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",o_]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[D4,bB,Sde]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}});var $a=typeof window<"u"?window:void 0,u2=typeof globalThis<"u"?globalThis:$a,kze=Array.prototype,Pze=kze.forEach,Lze=kze.indexOf,J2=u2==null?void 0:u2.navigator,ih=u2==null?void 0:u2.document,d2=u2==null?void 0:u2.location,wde=u2==null?void 0:u2.fetch,Bde=u2!=null&&u2.XMLHttpRequest&&"withCredentials"in new u2.XMLHttpRequest?u2.XMLHttpRequest:void 0,Fze=u2==null?void 0:u2.AbortController,f2=J2==null?void 0:J2.userAgent,Fm=$a??{},N4={DEBUG:!1,LIB_VERSION:"1.257.2"},Mde="$copy_autocapture",Win=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],T4=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),$in=["fatal","error","warning","log","info","debug"];function f1(i,e){return i.indexOf(e)!==-1}var tV=function(i){return i.trim()},Rde=function(i){return i.replace(/^\$/,"")},ern=Array.isArray,Uze=Object.prototype,Oze=Uze.hasOwnProperty,nV=Uze.toString,tI=ern||function(i){return nV.call(i)==="[object Array]"},S5=i=>typeof i=="function",QI=i=>i===Object(i)&&!tI(i),TQ=i=>{if(QI(i)){for(var e in i)if(Oze.call(i,e))return!1;return!0}return!1},m0=i=>i===void 0,DI=i=>nV.call(i)=="[object String]",Qde=i=>DI(i)&&i.trim().length===0,EB=i=>i===null,tv=i=>m0(i)||EB(i),tE=i=>nV.call(i)=="[object Number]",fS=i=>nV.call(i)==="[object Boolean]",trn=i=>i instanceof FormData,nrn=i=>f1(Win,i),Gze=i=>{var e={t:function(t){if($a&&(N4.DEBUG||Fm.POSTHOG_DEBUG)&&!m0($a.console)&&$a.console){for(var n=("__rrweb_original__"in $a.console[t])?$a.console[t].__rrweb_original__:$a.console[t],r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];n(i,...o)}},info:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("log",...n)},warn:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("warn",...n)},error:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.t("error",...n)},critical:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.error(i,...n)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>Gze(i+" "+t)};return e},Sh=Gze("[PostHog.js]"),uC=Sh.createLogger,irn=uC("[ExternalScriptsLoader]"),zze=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return irn.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var n=ih==null?void 0:ih.querySelectorAll("script");if(n){for(var r=0;r<n.length;r++)if(n[r].src===e)return t()}var o=()=>{if(!ih)return t("document not found");var a=ih.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=e,a.onload=c=>t(void 0,c),a.onerror=c=>t(c),i.config.prepare_external_dependency_script&&(a=i.config.prepare_external_dependency_script(a)),!a)return t("prepare_external_dependency_script returned null");var s,l=ih.querySelectorAll("body > script");l.length>0?(s=l[0].parentNode)==null||s.insertBefore(a,l[0]):ih.body.appendChild(a)};ih!=null&&ih.body?o():ih==null||ih.addEventListener("DOMContentLoaded",o)};function Mf(){return Mf=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Mf.apply(null,arguments)}function Hze(i,e){if(i==null)return{};var t={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(e.indexOf(n)!==-1)continue;t[n]=i[n]}return t}Fm.__PosthogExtensions__=Fm.__PosthogExtensions__||{},Fm.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{var n="/static/"+e+".js?v="+i.version;if(e==="remote-config"&&(n="/array/"+i.config.token+"/config.js"),e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}var o=i.requestRouter.endpointFor("assets",n);zze(i,o,t)},Fm.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var n=i.requestRouter.endpointFor("api",e);zze(i,n,t)};var iV={};function SB(i,e,t){if(tI(i)){if(Pze&&i.forEach===Pze)i.forEach(e,t);else if("length"in i&&i.length===+i.length){for(var n=0,r=i.length;n<r;n++)if(n in i&&e.call(t,i[n],n)===iV)return}}}function Zv(i,e,t){if(!tv(i)){if(tI(i))return SB(i,e,t);if(trn(i)){for(var n of i.entries())if(e.call(t,n[1],n[0])===iV)return}else for(var r in i)if(Oze.call(i,r)&&e.call(t,i[r],r)===iV)return}}var jI=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return SB(t,function(r){for(var o in r)r[o]!==void 0&&(i[o]=r[o])}),i},rV=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return SB(t,function(r){SB(r,function(o){i.push(o)})}),i};function oV(i){for(var e=Object.keys(i),t=e.length,n=new Array(t);t--;)n[t]=[e[t],i[e[t]]];return n}var Yze=function(i){try{return i()}catch{return}},rrn=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.apply(this,t)}catch(r){Sh.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Sh.critical(r)}}},Dde=function(i){var e={};return Zv(i,function(t,n){(DI(t)&&t.length>0||tE(t))&&(e[n]=t)}),e};function orn(i,e){return t=i,n=o=>DI(o)&&!EB(e)?o.slice(0,e):o,r=new Set,function o(a,s){return a!==Object(a)?n?n(a,s):a:r.has(a)?void 0:(r.add(a),tI(a)?(l=[],SB(a,c=>{l.push(o(c))})):(l={},Zv(a,(c,u)=>{r.has(c)||(l[u]=o(c,u))})),l);var l}(t);var t,n,r}var arn=["herokuapp.com","vercel.app","netlify.app"];function srn(i){var e=i==null?void 0:i.hostname;if(!DI(e))return!1;var t=e.split(".").slice(-2).join(".");for(var n of arn)if(t===n)return!1;return!0}function Vze(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return i[t]}function hI(i,e,t,n){var{capture:r=!1,passive:o=!0}=n??{};i==null||i.addEventListener(e,t,{capture:r,passive:o})}var jze="$people_distinct_id",ak="__alias",sk="__timers",Kze="$autocapture_disabled_server_side",Nde="$heatmaps_enabled_server_side",Xze="$exception_capture_enabled_server_side",Tde="$error_tracking_suppression_rules",qze="$web_vitals_enabled_server_side",Jze="$dead_clicks_enabled_server_side",Zze="$web_vitals_allowed_metrics",kde="$session_recording_enabled_server_side",Wze="$console_log_recording_enabled_server_side",$ze="$session_recording_network_payload_capture",eHe="$session_recording_masking",tHe="$session_recording_canvas_recording",nHe="$replay_sample_rate",iHe="$replay_minimum_duration",rHe="$replay_script_config",aV="$sesid",lk="$session_is_sampled",Pde="$session_recording_url_trigger_activated_session",Lde="$session_recording_event_trigger_activated_session",kQ="$enabled_feature_flags",sV="$early_access_features",Fde="$feature_flag_details",ck="$stored_person_properties",DM="$stored_group_properties",Ude="$surveys",lV="$surveys_activated",cV="$flag_call_reported",k4="$user_state",Ode="$client_session_props",Gde="$capture_rate_limit",zde="$initial_campaign_params",Hde="$initial_referrer_info",uV="$initial_person_info",dV="$epp",oHe="__POSTHOG_TOOLBAR__",fV="$posthog_cookieless",lrn=[jze,ak,"__cmpns",sk,kde,Nde,aV,kQ,Tde,k4,sV,Fde,DM,ck,Ude,cV,Ode,Gde,zde,Hde,dV,uV];function aHe(i){return i instanceof Element&&(i.id===oHe||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function hV(i){return!!i&&i.nodeType===1}function wB(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function sHe(i){return!!i&&i.nodeType===3}function lHe(i){return!!i&&i.nodeType===11}function Yde(i){return i?tV(i).split(/\s+/):[]}function cHe(i){var e=$a==null?void 0:$a.location.href;return!!(e&&i&&i.some(t=>e.match(t)))}function pV(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return Yde(e)}function uHe(i){return tv(i)?null:tV(i).split(/(\s+)/).filter(e=>PQ(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function AV(i){var e="";return jde(i)&&!hHe(i)&&i.childNodes&&i.childNodes.length&&Zv(i.childNodes,function(t){var n;sHe(t)&&t.textContent&&(e+=(n=uHe(t.textContent))!==null&&n!==void 0?n:"")}),tV(e)}function dHe(i){return m0(i.target)?i.srcElement||null:(e=i.target)!=null&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var Vde=["a","button","form","input","select","textarea","label"];function fHe(i){var e=i.parentNode;return!(!e||!hV(e))&&e}function crn(i,e,t,n,r){var o,a,s;if(t===void 0&&(t=void 0),!$a||!i||wB(i,"html")||!hV(i)||(o=t)!=null&&o.url_allowlist&&!cHe(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&cHe(t.url_ignorelist))return!1;if((s=t)!=null&&s.dom_event_allowlist){var l=t.dom_event_allowlist;if(l&&!l.some(_=>e.type===_))return!1}for(var c=!1,u=[i],d=!0,f=i;f.parentNode&&!wB(f,"body");)if(lHe(f.parentNode))u.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=fHe(f)))break;if(n||Vde.indexOf(d.tagName.toLowerCase())>-1)c=!0;else{var h=$a.getComputedStyle(d);h&&h.getPropertyValue("cursor")==="pointer"&&(c=!0)}u.push(d),f=d}if(!function(_,v){var x=v==null?void 0:v.element_allowlist;if(m0(x))return!0;var I,M=function(k){if(x.some(L=>k.tagName.toLowerCase()===L))return{v:!0}};for(var G of _)if(I=M(G))return I.v;return!1}(u,t)||!function(_,v){var x=v==null?void 0:v.css_selector_allowlist;if(m0(x))return!0;var I,M=function(k){if(x.some(L=>k.matches(L)))return{v:!0}};for(var G of _)if(I=M(G))return I.v;return!1}(u,t))return!1;var A=$a.getComputedStyle(i);if(A&&A.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var m=i.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return c?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Vde.indexOf(m)>-1||i.getAttribute("contenteditable")==="true")}}function jde(i){for(var e=i;e.parentNode&&!wB(e,"body");e=e.parentNode){var t=pV(e);if(f1(t,"ph-sensitive")||f1(t,"ph-no-capture"))return!1}if(f1(pV(i),"ph-include"))return!0;var n=i.type||"";if(DI(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=i.name||i.id||"";return!(DI(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function hHe(i){return!!(wB(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||wB(i,"select")||wB(i,"textarea")||i.getAttribute("contenteditable")==="true")}var pHe="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",urn=new RegExp("^(?:"+pHe+")$"),drn=new RegExp(pHe),AHe="\\d{3}-?\\d{2}-?\\d{4}",frn=new RegExp("^("+AHe+")$"),hrn=new RegExp("("+AHe+")");function PQ(i,e){return e===void 0&&(e=!0),!(tv(i)||DI(i)&&(i=tV(i),(e?urn:drn).test((i||"").replace(/[- ]/g,""))||(e?frn:hrn).test(i)))}function gHe(i){var e=AV(i);return PQ(e=(e+" "+mHe(i)).trim())?e:""}function mHe(i){var e="";return i&&i.childNodes&&i.childNodes.length&&Zv(i.childNodes,function(t){var n;if(t&&((n=t.tagName)==null?void 0:n.toLowerCase())==="span")try{var r=AV(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+mHe(t)).trim())}catch(o){Sh.error("[AutoCapture]",o)}}),e}function prn(i){return function(e){var t=e.map(n=>{var r,o,a="";if(n.tag_name&&(a+=n.tag_name),n.attr_class)for(var s of(n.attr_class.sort(),n.attr_class))a+="."+s.replace(/"/g,"");var l=Mf({},n.text?{text:n.text}:{},{"nth-child":(r=n.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(o=n.nth_of_type)!==null&&o!==void 0?o:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),c={};return oV(l).sort((u,d)=>{var[f]=u,[h]=d;return f.localeCompare(h)}).forEach(u=>{var[d,f]=u;return c[yHe(d.toString())]=yHe(f.toString())}),a+=":",a+=oV(c).map(u=>{var[d,f]=u;return d+'="'+f+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var n,r,o={text:(n=t.$el_text)==null?void 0:n.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)==null?void 0:r.slice(0,2048),attr_class:Arn(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return oV(t).filter(a=>{var[s]=a;return s.indexOf("attr__")===0}).forEach(a=>{var[s,l]=a;return o.attributes[s]=l}),o})}(i))}function yHe(i){return i.replace(/"|\\"/g,'\\"')}function Arn(i){var e=i.attr__class;return e?tI(e)?e:Yde(e):void 0}class _He{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}var grn=["localhost","127.0.0.1"],LQ=i=>{var e=ih==null?void 0:ih.createElement("a");return m0(e)?null:(e.href=i,e)},mrn=function(i,e){var t,n;e===void 0&&(e="&");var r=[];return Zv(i,function(o,a){m0(o)||m0(a)||a==="undefined"||(t=encodeURIComponent((s=>s instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(a),r[r.length]=n+"="+t)}),r.join(e)},gV=function(i,e){for(var t,n=((i.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<n.length;r++){var o=n[r].split("=");if(o[0]===e){t=o;break}}if(!tI(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{Sh.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Kde=function(i,e,t){if(!i||!e||!e.length)return i;for(var n=i.split("#"),r=n[0]||"",o=n[1],a=r.split("?"),s=a[1],l=a[0],c=(s||"").split("&"),u=[],d=0;d<c.length;d++){var f=c[d].split("=");tI(f)&&(e.includes(f[0])?u.push(f[0]+"="+t):u.push(c[d]))}var h=l;return s!=null&&(h+="?"+u.join("&")),o!=null&&(h+="#"+o),h},mV=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},vHe=uC("[AutoCapture]");function Xde(i,e){return e.length>i?e.slice(0,i)+"...":e}function yrn(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!hV(e));return e}function _rn(i,e,t,n){var r=i.tagName.toLowerCase(),o={tag_name:r};Vde.indexOf(r)>-1&&!t&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?o.$el_text=Xde(1024,gHe(i)):o.$el_text=Xde(1024,AV(i)));var a=pV(i);a.length>0&&(o.classes=a.filter(function(u){return u!==""})),Zv(i.attributes,function(u){var d;if((!hHe(i)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(n==null||!n.includes(u.name))&&!e&&PQ(u.value)&&(d=u.name,!DI(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=u.value;u.name==="class"&&(f=Yde(f).join(" ")),o["attr__"+u.name]=Xde(1024,f)}});for(var s=1,l=1,c=i;c=yrn(c);)s++,c.tagName===i.tagName&&l++;return o.nth_child=s,o.nth_of_type=l,o}function vrn(i,e){for(var t,n,{e:r,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:s,elementsChainAsString:l}=e,c=[i],u=i;u.parentNode&&!wB(u,"body");)lHe(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,f=[],h={},A=!1,m=!1;if(Zv(c,M=>{var G=jde(M);M.tagName.toLowerCase()==="a"&&(A=M.getAttribute("href"),A=G&&A&&PQ(A)&&A),f1(pV(M),"ph-no-capture")&&(m=!0),f.push(_rn(M,o,a,s));var k=function(L){if(!jde(L))return{};var R={};return Zv(L.attributes,function(U){if(U.name&&U.name.indexOf("data-ph-capture-attribute")===0){var D=U.name.replace("data-ph-capture-attribute-",""),Z=U.value;D&&Z&&PQ(Z)&&(R[D]=Z)}}),R}(M);jI(h,k)}),m)return{props:{},explicitNoCapture:m};if(a||(i.tagName.toLowerCase()==="a"||i.tagName.toLowerCase()==="button"?f[0].$el_text=gHe(i):f[0].$el_text=AV(i)),A){var _,v;f[0].attr__href=A;var x=(_=LQ(A))==null?void 0:_.host,I=$a==null||(v=$a.location)==null?void 0:v.host;x&&I&&x!==I&&(d=A)}return{props:jI({$event_type:r.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:prn(f)},(t=f[0])!=null&&t.$el_text?{$el_text:(n=f[0])==null?void 0:n.$el_text}:{},d&&r.type==="click"?{$external_click_url:d}:{},h)}}class xrn{constructor(e){this.i=!1,this.o=null,this.rageclicks=new _He,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,n=QI(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}$(){if(this.isBrowserSupported()){if($a&&ih){var e=n=>{n=n||($a==null?void 0:$a.event);try{this.k(n)}catch(r){vHe.error("Failed to capture event",r)}};if(hI(ih,"submit",e,{capture:!0}),hI(ih,"change",e,{capture:!0}),hI(ih,"click",e,{capture:!0}),this.S.capture_copied_text){var t=n=>{n=n||($a==null?void 0:$a.event),this.k(n,Mde)};hI(ih,"copy",t,{capture:!0}),hI(ih,"cut",t,{capture:!0})}}}else vHe.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Kze]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,n=[];return(t=this.m)==null||t.forEach(r=>{var o=ih==null?void 0:ih.querySelectorAll(r);o==null||o.forEach(a=>{e===a&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[Kze],r=this.o;if(EB(r)&&!fS(n)&&!this.instance.I())return!1;var o=(t=this.o)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!o}k(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=dHe(e);sHe(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.k(e,"$rageclick");var o=t===Mde;if(r&&crn(r,e,this.S,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:s}=vrn(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(s)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===Mde){var c,u=uHe($a==null||(c=$a.getSelection())==null?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=d}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return S5(ih==null?void 0:ih.querySelectorAll)}}Math.trunc||(Math.trunc=function(i){return i<0?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return tE(i)&&isFinite(i)&&Math.floor(i)===i});var xHe="0123456789abcdef";class yV{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|t>>>8,o[7]=t,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new yV(o)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+xHe.charAt(this.bytes[t]>>>4)+xHe.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new yV(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}}class Irn{constructor(){this.P=0,this.R=0,this.T=new brn}generate(){var e=this.generateOrAbort();if(m0(e)){this.P=0;var t=this.generateOrAbort();if(m0(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.M())}return yV.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var IHe,bHe=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<i.length;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};$a&&!m0($a.crypto)&&crypto.getRandomValues&&(bHe=i=>crypto.getRandomValues(i));class brn{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(bHe(this.C),this.F=0),this.C[this.F++]}}var BB=()=>Crn().toString(),Crn=()=>(IHe||(IHe=new Irn)).generate(),uk="",Ern=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Srn(i,e){if(e){var t=function(r,o){if(o===void 0&&(o=ih),uk)return uk;if(!o||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),s=Math.min(a.length,8),l="dmn_chk_"+BB();!uk&&s--;){var c=a.slice(s).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",uk=c)}return uk}(i);if(!t){var n=(r=>{var o=r.match(Ern);return o?o[0]:""})(i);n!==t&&Sh.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}var hS={O:()=>!!ih,A:function(i){Sh.error("cookieStore error: "+i)},D:function(i){if(ih){try{for(var e=i+"=",t=ih.cookie.split(";").filter(o=>o.length),n=0;n<t.length;n++){for(var r=t[n];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},L:function(i){var e;try{e=JSON.parse(hS.D(i))||{}}catch{}return e},j:function(i,e,t,n,r){if(ih)try{var o="",a="",s=Srn(ih.location.hostname,n);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),o="; expires="+l.toUTCString()}r&&(a="; secure");var c=i+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&Sh.warn("cookieStore warning: large cookie, len="+c.length),ih.cookie=c,c}catch{return}},N:function(i,e){try{hS.j(i,"",-1,e)}catch{return}}},qde=null,Db={O:function(){if(!EB(qde))return qde;var i=!0;if(m0($a))i=!1;else try{var e="__mplssupport__";Db.j(e,"xyz"),Db.D(e)!=='"xyz"'&&(i=!1),Db.N(e)}catch{i=!1}return i||Sh.error("localStorage unsupported; falling back to cookie store"),qde=i,i},A:function(i){Sh.error("localStorage error: "+i)},D:function(i){try{return $a==null?void 0:$a.localStorage.getItem(i)}catch(e){Db.A(e)}return null},L:function(i){try{return JSON.parse(Db.D(i))||{}}catch{}return null},j:function(i,e){try{$a==null||$a.localStorage.setItem(i,JSON.stringify(e))}catch(t){Db.A(t)}},N:function(i){try{$a==null||$a.localStorage.removeItem(i)}catch(e){Db.A(e)}}},wrn=["distinct_id",aV,lk,dV,uV],_V=Mf({},Db,{L:function(i){try{var e={};try{e=hS.L(i)||{}}catch{}var t=jI(e,JSON.parse(Db.D(i)||"{}"));return Db.j(i,t),t}catch{}return null},j:function(i,e,t,n,r,o){try{Db.j(i,e,void 0,void 0,o);var a={};wrn.forEach(s=>{e[s]&&(a[s]=e[s])}),Object.keys(a).length&&hS.j(i,a,t,n,r,o)}catch(s){Db.A(s)}},N:function(i,e){try{$a==null||$a.localStorage.removeItem(i),hS.N(i,e)}catch(t){Db.A(t)}}}),vV={},Brn={O:function(){return!0},A:function(i){Sh.error("memoryStorage error: "+i)},D:function(i){return vV[i]||null},L:function(i){return vV[i]||null},j:function(i,e){vV[i]=e},N:function(i){delete vV[i]}},NM=null,bC={O:function(){if(!EB(NM))return NM;if(NM=!0,m0($a))NM=!1;else try{var i="__support__";bC.j(i,"xyz"),bC.D(i)!=='"xyz"'&&(NM=!1),bC.N(i)}catch{NM=!1}return NM},A:function(i){Sh.error("sessionStorage error: ",i)},D:function(i){try{return $a==null?void 0:$a.sessionStorage.getItem(i)}catch(e){bC.A(e)}return null},L:function(i){try{return JSON.parse(bC.D(i))||null}catch{}return null},j:function(i,e){try{$a==null||$a.sessionStorage.setItem(i,JSON.stringify(e))}catch(t){bC.A(t)}},N:function(i){try{$a==null||$a.sessionStorage.removeItem(i)}catch(e){bC.A(e)}}},FQ=function(i){return i[i.PENDING=-1]="PENDING",i[i.DENIED=0]="DENIED",i[i.GRANTED=1]="GRANTED",i}({});class Mrn{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?FQ.DENIED:this.q}isOptedOut(){return this.consent===FQ.DENIED||this.consent===FQ.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get q(){var e=this.B.D(this.H);return e==="1"?FQ.GRANTED:e==="0"?FQ.DENIED:FQ.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W=e==="localStorage"?Db:hS;var t=e==="localStorage"?hS:Db;t.D(this.H)&&(this.W.D(this.H)||this.optInOut(t.D(this.H)==="1"),t.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!Vze([J2==null?void 0:J2.doNotTrack,J2==null?void 0:J2.msDoNotTrack,Fm.doNotTrack],e=>f1([!0,1,"1","yes"],e))}}var xV=uC("[Dead Clicks]"),Rrn=()=>!0,Qrn=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(Jze)),n=i.instance.config.capture_dead_clicks;return fS(n)?n:t};let CHe=class{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Jze]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(e){var t,n;(t=Fm.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?xV.error("failed to load script",r):e()})}V(){var e;if(ih){if(!this.G&&(e=Fm.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=QI(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=Fm.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(ih),xV.info("starting...")}}else xV.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,xV.info("stopping..."))}};function Z2(i,e,t,n,r){return e>t&&(Sh.warn("min cannot be greater than max."),e=t),tE(i)?i>t?(n&&Sh.warn(n+" cannot be greater than max: "+t+". Using max value instead."),t):i<e?(n&&Sh.warn(n+" cannot be less than min: "+e+". Using min value instead."),e):i:(n&&Sh.warn(n+" must be a number. using max or fallback. max: "+t+", fallback: "+r),Z2(r||t,e,t,n))}let EHe=class{constructor(e){this.K={},this.Y=()=>{Object.keys(this.K).forEach(t=>{var n=this.X(t)+this.Z;n>=this.tt?delete this.K[t]:this.it(t,n)})},this.X=t=>this.K[String(t)],this.it=(t,n)=>{this.K[String(t)]=n},this.consumeRateLimit=t=>{var n,r=(n=this.X(t))!==null&&n!==void 0?n:this.tt;if((r=Math.max(r-1,0))===0)return!0;this.it(t,r);var o,a=r===0;return a&&((o=this.et)==null||o.call(this,t)),a},this.rt=e,this.et=this.rt.et,this.tt=Z2(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=Z2(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=Z2(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}};var IV=uC("[ExceptionAutocapture]");class Drn{constructor(e){var t,n,r;this.nt=()=>{var o;if($a&&this.isEnabled&&(o=Fm.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var a=Fm.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Fm.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=Fm.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=a(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=s(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=l(this.captureException.bind(this)))}catch(c){IV.error("failed to start",c),this.ht()}}},this._instance=e,this.dt=!((t=this._instance.persistence)==null||!t.props[Xze]),this.S=this.vt(),this.ct=new EHe({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return QI(e)?t=Mf({},t,e):(m0(e)?this.dt:e)&&(t=Mf({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(IV.info("enabled"),this.J(this.nt))}J(e){var t,n;(t=Fm.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return IV.error("failed to load script",r);e()})}ht(){var e,t,n;(e=this.ot)==null||e.call(this),this.ot=void 0,(t=this.lt)==null||t.call(this),this.lt=void 0,(n=this.ut)==null||n.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[Xze]:this.dt}),this.startIfEnabled()}captureException(e){var t,n=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=n+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var r=(t=e.$exception_list[0].type)!==null&&t!==void 0?t:"Exception";this.ct.consumeRateLimit(r)?IV.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function SHe(i){return!m0(Event)&&wHe(i,Event)}function wHe(i,e){try{return i instanceof e}catch{return!1}}function BHe(i){switch(Object.prototype.toString.call(i)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return wHe(i,Error)}}function bV(i,e){return Object.prototype.toString.call(i)==="[object "+e+"]"}function Jde(i){return bV(i,"DOMError")}var MHe=/\(error: (.*)\)/,RHe=50,UQ="?";function Zde(i,e,t,n){var r={platform:"web:javascript",filename:i,function:e==="<anonymous>"?UQ:e,in_app:!0};return m0(t)||(r.lineno=t),m0(n)||(r.colno=n),r}var Nrn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Trn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,krn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Prn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Lrn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Frn=function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];var n=e.sort((r,o)=>r[0]-o[0]).map(r=>r[1]);return function(r,o){o===void 0&&(o=0);for(var a=[],s=r.split(`
1003
1003
  `),l=o;l<s.length;l++){var c=s[l];if(!(c.length>1024)){var u=MHe.test(c)?c.replace(MHe,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var f=d(u);if(f){a.push(f);break}}if(a.length>=RHe)break}}}return function(h){if(!h.length)return[];var A=Array.from(h);return A.reverse(),A.slice(0,RHe).map(m=>Mf({},m,{filename:m.filename||Urn(A).filename,function:m.function||UQ}))}(a)}}([30,i=>{var e=Nrn.exec(i);if(e){var[,t,n,r]=e;return Zde(t,UQ,+n,+r)}var o=Trn.exec(i);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=krn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[s,l]=DHe(o[1]||UQ,o[2]);return Zde(l,s,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,i=>{var e=Prn.exec(i);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=Lrn.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var n=e[3],r=e[1]||UQ;return[r,n]=DHe(r,n),Zde(n,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]);function Urn(i){return i[i.length-1]||{}}var CV,QHe,Wde,DHe=(i,e)=>{var t=i.indexOf("safari-extension")!==-1,n=i.indexOf("safari-web-extension")!==-1;return t||n?[i.indexOf("@")!==-1?i.split("@")[0]:UQ,t?"safari-extension:"+e:"safari-web-extension:"+e]:[i,e]},Orn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function $de(i,e){e===void 0&&(e=0);var t=i.stacktrace||i.stack||"",n=function(a){return a&&Grn.test(a.message)?1:0}(i);try{var r=Frn,o=function(a,s){var l=function(c){var u=globalThis._posthogChunkIds;if(!u)return{};var d=Object.keys(u);return Wde&&d.length===QHe||(QHe=d.length,Wde=d.reduce((f,h)=>{CV||(CV={});var A=CV[h];if(A)f[A[0]]=A[1];else for(var m=c(h),_=m.length-1;_>=0;_--){var v=m[_],x=v==null?void 0:v.filename,I=u[h];if(x&&I){f[x]=I,CV[h]=[x,I];break}}return f},{})),Wde}(s);return a.forEach(c=>{c.filename&&(c.chunk_id=l[c.filename])}),a}(r(t,n),r);return o.slice(0,o.length-e)}catch{}return[]}var Grn=/Minified React error #\d+;/i;function zrn(i,e){var t,n,r=$de(i),o=(t=e==null?void 0:e.handled)===null||t===void 0||t,a=(n=e==null?void 0:e.synthetic)!==null&&n!==void 0&&n;return{type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:i.name,value:function(s){var l=s.message;return l.error&&typeof l.error.message=="string"?String(l.error.message):String(l)}(i),stacktrace:{frames:r,type:"raw"},mechanism:{handled:o,synthetic:a}}}function NHe(i,e){var t=zrn(i,e);return i.cause&&BHe(i.cause)&&i.cause!==i?[t,...NHe(i.cause,{handled:e==null?void 0:e.handled,synthetic:e==null?void 0:e.synthetic})]:[t]}function e0e(i,e){return{$exception_list:NHe(i,e),$exception_level:"error"}}function t0e(i,e){var t,n,r,o=(t=e==null?void 0:e.handled)===null||t===void 0||t,a=(n=e==null?void 0:e.synthetic)===null||n===void 0||n,s={type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:(r=e==null?void 0:e.defaultExceptionType)!==null&&r!==void 0?r:"Error",value:i||(e==null?void 0:e.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};if(e!=null&&e.syntheticException){var l=$de(e.syntheticException,1);l.length&&(s.stacktrace={frames:l,type:"raw"})}return{$exception_list:[s],$exception_level:"error"}}function Hrn(i){return DI(i)&&!Qde(i)&&$in.indexOf(i)>=0}function Yrn(i,e){var t,n,r=(t=e==null?void 0:e.handled)===null||t===void 0||t,o=(n=e==null?void 0:e.synthetic)===null||n===void 0||n,a=e!=null&&e.overrideExceptionType?e.overrideExceptionType:SHe(i)?i.constructor.name:"Error",s="Non-Error 'exception' captured with keys: "+function(u,d){d===void 0&&(d=40);var f=Object.keys(u);if(f.sort(),!f.length)return"[object has no keys]";for(var h=f.length;h>0;h--){var A=f.slice(0,h).join(", ");if(!(A.length>d))return h===f.length||A.length<=d?A:A.slice(0,d)+"..."}return""}(i),l={type:a,value:s,mechanism:{handled:r,synthetic:o}};if(e!=null&&e.syntheticException){var c=$de(e==null?void 0:e.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Hrn(i.level)?i.level:"error"}}function Vrn(i,e){var{error:t,event:n}=i,r={$exception_list:[]},o=t||n;if(Jde(o)||function(f){return bV(f,"DOMException")}(o)){var a=o;if(function(f){return"stack"in f}(o))r=e0e(o,e);else{var s=a.name||(Jde(a)?"DOMError":"DOMException"),l=a.message?s+": "+a.message:s;r=t0e(l,Mf({},e,{overrideExceptionType:Jde(a)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in a&&(r.$exception_DOMException_code=""+a.code),r}if(function(f){return bV(f,"ErrorEvent")}(o)&&o.error)return e0e(o.error,e);if(BHe(o))return e0e(o,e);if(function(f){return bV(f,"Object")}(o)||SHe(o))return Yrn(o,e);if(m0(t)&&DI(n)){var c="Error",u=n,d=n.match(Orn);return d&&(c=d[1],u=d[2]),t0e(u,Mf({},e,{overrideExceptionType:c,defaultExceptionMessage:u}))}return t0e(o,e)}function THe(i,e,t){try{if(!(e in i))return()=>{};var n=i[e],r=t(n);return S5(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),i[e]=r,()=>{i[e]=n}}catch{return()=>{}}}class jrn{constructor(e){var t;this._instance=e,this.ft=($a==null||(t=$a.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Sh.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.gt&&this.gt(),this.gt=void 0,Sh.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if($a&&$a.history){var n=this;(e=$a.history.pushState)!=null&&e.__posthog_wrapped__||THe($a.history,"pushState",r=>function(o,a,s){r.call(this,o,a,s),n._t("pushState")}),(t=$a.history.replaceState)!=null&&t.__posthog_wrapped__||THe($a.history,"replaceState",r=>function(o,a,s){r.call(this,o,a,s),n._t("replaceState")}),this.bt()}}_t(e){try{var t,n=$a==null||(t=$a.location)==null?void 0:t.pathname;if(!n)return;n!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=n}catch(r){Sh.error("Error capturing "+e+" pageview",r)}}bt(){if(!this.gt){var e=()=>{this._t("popstate")};hI($a,"popstate",e),this.gt=()=>{$a&&$a.removeEventListener("popstate",e)}}}}function EV(i){var e,t;return((e=JSON.stringify(i,(t=[],function(n,r){if(QI(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r})))==null?void 0:e.length)||0}function n0e(i,e){if(e===void 0&&(e=66060288e-1),i.size>=e&&i.data.length>1){var t=Math.floor(i.data.length/2),n=i.data.slice(0,t),r=i.data.slice(t);return[n0e({size:EV(n),data:n,sessionId:i.sessionId,windowId:i.windowId}),n0e({size:EV(r),data:r,sessionId:i.sessionId,windowId:i.windowId})].flatMap(o=>o)}return[i]}var P4=(i=>(i[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i))(P4||{}),c3=(i=>(i[i.Mutation=0]="Mutation",i[i.MouseMove=1]="MouseMove",i[i.MouseInteraction=2]="MouseInteraction",i[i.Scroll=3]="Scroll",i[i.ViewportResize=4]="ViewportResize",i[i.Input=5]="Input",i[i.TouchMove=6]="TouchMove",i[i.MediaInteraction=7]="MediaInteraction",i[i.StyleSheetRule=8]="StyleSheetRule",i[i.CanvasMutation=9]="CanvasMutation",i[i.Font=10]="Font",i[i.Log=11]="Log",i[i.Drag=12]="Drag",i[i.StyleDeclaration=13]="StyleDeclaration",i[i.Selection=14]="Selection",i[i.AdoptedStyleSheet=15]="AdoptedStyleSheet",i[i.CustomElement=16]="CustomElement",i))(c3||{}),i0e="[SessionRecording]",r0e="redacted",SV={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:i=>i,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Krn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Xrn=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qrn=["/s/","/e/","/i/"];function kHe(i,e,t,n){if(tv(i))return i;var r=(e==null?void 0:e["content-length"])||function(o){return new Blob([o]).size}(i);return DI(r)&&(r=parseInt(r)),r>t?i0e+" "+n+" body too large to record ("+r+" bytes)":i}function PHe(i,e){if(tv(i))return i;var t=i;return PQ(t,!1)||(t=i0e+" "+e+" body "+r0e),Zv(Xrn,n=>{var r,o;(r=t)!=null&&r.length&&((o=t)==null?void 0:o.indexOf(n))!==-1&&(t=i0e+" "+e+" body "+r0e+" as might contain: "+n)}),t}var Jrn=(i,e)=>{var t,n,r,o={payloadSizeLimitBytes:SV.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...SV.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...SV.payloadHostDenyList]},a=i.session_recording.recordHeaders!==!1&&e.recordHeaders,s=i.session_recording.recordBody!==!1&&e.recordBody,l=i.capture_performance!==!1&&e.recordPerformance,c=(t=o,r=Math.min(1e6,(n=t.payloadSizeLimitBytes)!==null&&n!==void 0?n:1e6),f=>(f!=null&&f.requestBody&&(f.requestBody=kHe(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=kHe(f.responseBody,f.responseHeaders,r,"Response")),f)),u=f=>{return c(((m,_)=>{var v,x=LQ(m.name),I=_.indexOf("http")===0?(v=LQ(_))==null?void 0:v.pathname:_;I==="/"&&(I="");var M=x==null?void 0:x.pathname.replace(I||"","");if(!(x&&M&&qrn.some(G=>M.indexOf(G)===0)))return m})((A=(h=f).requestHeaders,tv(A)||Zv(Object.keys(A??{}),m=>{Krn.includes(m.toLowerCase())&&(A[m]=r0e)}),h),i.api_host));var h,A},d=S5(i.session_recording.maskNetworkRequestFn);return d&&S5(i.session_recording.maskCapturedNetworkRequestFn)&&Sh.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(i.session_recording.maskCapturedNetworkRequestFn=f=>{var h=i.session_recording.maskNetworkRequestFn({url:f.name});return Mf({},f,{name:h==null?void 0:h.url})}),o.maskRequestFn=S5(i.session_recording.maskCapturedNetworkRequestFn)?f=>{var h,A=u(f);return A&&(h=i.session_recording.maskCapturedNetworkRequestFn==null?void 0:i.session_recording.maskCapturedNetworkRequestFn(A))!==null&&h!==void 0?h:void 0}:f=>function(h){if(!m0(h))return h.requestBody=PHe(h.requestBody,"Request"),h.responseBody=PHe(h.responseBody,"Response"),h}(u(f)),Mf({},SV,o,{recordHeaders:a,recordBody:s,recordPerformance:l,recordInitialRequests:l})};class Zrn{constructor(e,t){var n,r;t===void 0&&(t={}),this.yt={},this.wt=o=>{if(!this.yt[o]){var a,s;this.yt[o]=!0;var l=this.St(o);(a=(s=this.rt).onBlockedNode)==null||a.call(s,o,l)}},this.$t=o=>{var a=this.St(o);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var s=a.closest("svg");if(s)return[this._rrweb.mirror.getId(s),s]}return[o,a]},this.St=o=>this._rrweb.mirror.getNode(o),this.kt=o=>{var a,s,l,c,u,d,f,h;return((a=(s=o.removes)==null?void 0:s.length)!==null&&a!==void 0?a:0)+((l=(c=o.attributes)==null?void 0:c.length)!==null&&l!==void 0?l:0)+((u=(d=o.texts)==null?void 0:d.length)!==null&&u!==void 0?u:0)+((f=(h=o.adds)==null?void 0:h.length)!==null&&f!==void 0?f:0)},this.throttleMutations=o=>{if(o.type!==3||o.data.source!==0)return o;var a=o.data,s=this.kt(a);a.attributes&&(a.attributes=a.attributes.filter(c=>{var[u]=this.$t(c.id);return!this.ct.consumeRateLimit(u)&&c}));var l=this.kt(a);return l!==0||s===l?o:void 0},this._rrweb=e,this.rt=t,this.ct=new EHe({bucketSize:(n=this.rt.bucketSize)!==null&&n!==void 0?n:100,refillRate:(r=this.rt.refillRate)!==null&&r!==void 0?r:10,refillInterval:1e3,et:this.wt})}}var w5=Uint8Array,h2=Uint16Array,OQ=Uint32Array,o0e=new w5([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a0e=new w5([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),LHe=new w5([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),FHe=function(i,e){for(var t=new h2(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];var r=new OQ(t[30]);for(n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return[t,r]},UHe=FHe(o0e,2),Wrn=UHe[0],s0e=UHe[1];Wrn[28]=258,s0e[258]=28;for(var OHe=FHe(a0e,0)[1],GHe=new h2(32768),Kx=0;Kx<32768;++Kx){var TM=(43690&Kx)>>>1|(21845&Kx)<<1;TM=(61680&(TM=(52428&TM)>>>2|(13107&TM)<<2))>>>4|(3855&TM)<<4,GHe[Kx]=((65280&TM)>>>8|(255&TM)<<8)>>>1}var dk=function(i,e,t){for(var n=i.length,r=0,o=new h2(e);r<n;++r)++o[i[r]-1];var a,s=new h2(e);for(r=0;r<e;++r)s[r]=s[r-1]+o[r-1]<<1;for(a=new h2(n),r=0;r<n;++r)a[r]=GHe[s[i[r]-1]++]>>>15-i[r];return a},kM=new w5(288);for(Kx=0;Kx<144;++Kx)kM[Kx]=8;for(Kx=144;Kx<256;++Kx)kM[Kx]=9;for(Kx=256;Kx<280;++Kx)kM[Kx]=7;for(Kx=280;Kx<288;++Kx)kM[Kx]=8;var wV=new w5(32);for(Kx=0;Kx<32;++Kx)wV[Kx]=5;var $rn=dk(kM,9),eon=dk(wV,5),zHe=function(i){return(i/8>>0)+(7&i&&1)},HHe=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var n=new(i instanceof h2?h2:i instanceof OQ?OQ:w5)(t-e);return n.set(i.subarray(e,t)),n},L4=function(i,e,t){t<<=7&e;var n=e/8>>0;i[n]|=t,i[n+1]|=t>>>8},fk=function(i,e,t){t<<=7&e;var n=e/8>>0;i[n]|=t,i[n+1]|=t>>>8,i[n+2]|=t>>>16},l0e=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return[new w5(0),0];if(r==1){var a=new w5(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(G,k){return G.f-k.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],c=0,u=1,d=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=t[t[c].f<t[d].f?c++:d++],l=t[c!=u&&t[c].f<t[d].f?c++:d++],t[u++]={s:-1,f:s.f+l.f,l:s,r:l};var f=o[0].s;for(n=1;n<r;++n)o[n].s>f&&(f=o[n].s);var h=new h2(f+1),A=c0e(t[u-1],h,0);if(A>e){n=0;var m=0,_=A-e,v=1<<_;for(o.sort(function(G,k){return h[k.s]-h[G.s]||G.f-k.f});n<r;++n){var x=o[n].s;if(!(h[x]>e))break;m+=v-(1<<A-h[x]),h[x]=e}for(m>>>=_;m>0;){var I=o[n].s;h[I]<e?m-=1<<e-h[I]++-1:++n}for(;n>=0&&m;--n){var M=o[n].s;h[M]==e&&(--h[M],++m)}A=e}return[new w5(h),A]},c0e=function(i,e,t){return i.s==-1?Math.max(c0e(i.l,e,t+1),c0e(i.r,e,t+1)):e[i.s]=t},YHe=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new h2(++e),n=0,r=i[0],o=1,a=function(l){t[n++]=l},s=1;s<=e;++s)if(i[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=i[s]}return[t.subarray(0,n),e]},hk=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},u0e=function(i,e,t){var n=t.length,r=zHe(e+2);i[r]=255&n,i[r+1]=n>>>8,i[r+2]=255^i[r],i[r+3]=255^i[r+1];for(var o=0;o<n;++o)i[r+o+4]=t[o];return 8*(r+4+n)},VHe=function(i,e,t,n,r,o,a,s,l,c,u){L4(e,u++,t),++r[256];for(var d=l0e(r,15),f=d[0],h=d[1],A=l0e(o,15),m=A[0],_=A[1],v=YHe(f),x=v[0],I=v[1],M=YHe(m),G=M[0],k=M[1],L=new h2(19),R=0;R<x.length;++R)L[31&x[R]]++;for(R=0;R<G.length;++R)L[31&G[R]]++;for(var U=l0e(L,7),D=U[0],Z=U[1],Y=19;Y>4&&!D[LHe[Y-1]];--Y);var W,ce,he,ae,ve=c+5<<3,ge=hk(r,kM)+hk(o,wV)+a,Me=hk(r,f)+hk(o,m)+a+14+3*Y+hk(L,D)+(2*L[16]+3*L[17]+7*L[18]);if(ve<=ge&&ve<=Me)return u0e(e,u,i.subarray(l,l+c));if(L4(e,u,1+(Me<ge)),u+=2,Me<ge){W=dk(f,h),ce=f,he=dk(m,_),ae=m;var De=dk(D,Z);for(L4(e,u,I-257),L4(e,u+5,k-1),L4(e,u+10,Y-4),u+=14,R=0;R<Y;++R)L4(e,u+3*R,D[LHe[R]]);u+=3*Y;for(var Te=[x,G],Be=0;Be<2;++Be){var ze=Te[Be];for(R=0;R<ze.length;++R){var et=31&ze[R];L4(e,u,De[et]),u+=D[et],et>15&&(L4(e,u,ze[R]>>>5&127),u+=ze[R]>>>12)}}}else W=$rn,ce=kM,he=eon,ae=wV;for(R=0;R<s;++R)if(n[R]>255){et=n[R]>>>18&31,fk(e,u,W[et+257]),u+=ce[et+257],et>7&&(L4(e,u,n[R]>>>23&31),u+=o0e[et]);var lt=31&n[R];fk(e,u,he[lt]),u+=ae[lt],lt>3&&(fk(e,u,n[R]>>>5&8191),u+=a0e[lt])}else fk(e,u,W[n[R]]),u+=ce[n[R]];return fk(e,u,W[256]),u+ce[256]},ton=new OQ([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),non=function(){for(var i=new OQ(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),ion=function(){var i=4294967295;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=non[255&t^e[n]]^t>>>8;i=t},d:function(){return 4294967295^i}}},ron=function(i,e,t,n,r){return function(o,a,s,l,c,u){var d=o.length,f=new w5(l+d+5*(1+Math.floor(d/7e3))+c),h=f.subarray(l,f.length-c),A=0;if(!a||d<8)for(var m=0;m<=d;m+=65535){var _=m+65535;_<d?A=u0e(h,A,o.subarray(m,_)):(h[m]=u,A=u0e(h,A,o.subarray(m,d)))}else{for(var v=ton[a-1],x=v>>>13,I=8191&v,M=(1<<s)-1,G=new h2(32768),k=new h2(M+1),L=Math.ceil(s/3),R=2*L,U=function(Tt){return(o[Tt]^o[Tt+1]<<L^o[Tt+2]<<R)&M},D=new OQ(25e3),Z=new h2(288),Y=new h2(32),W=0,ce=0,he=(m=0,0),ae=0,ve=0;m<d;++m){var ge=U(m),Me=32767&m,De=k[ge];if(G[Me]=De,k[ge]=Me,ae<=m){var Te=d-m;if((W>7e3||he>24576)&&Te>423){A=VHe(o,h,0,D,Z,Y,ce,he,ve,m-ve,A),he=W=ce=0,ve=m;for(var Be=0;Be<286;++Be)Z[Be]=0;for(Be=0;Be<30;++Be)Y[Be]=0}var ze=2,et=0,lt=I,At=Me-De&32767;if(Te>2&&ge==U(m-At))for(var Pt=Math.min(x,Te)-1,yt=Math.min(32767,m),Qe=Math.min(258,Te);At<=yt&&--lt&&Me!=De;){if(o[m+ze]==o[m+ze-At]){for(var Ke=0;Ke<Qe&&o[m+Ke]==o[m+Ke-At];++Ke);if(Ke>ze){if(ze=Ke,et=At,Ke>Pt)break;var We=Math.min(At,Ke-2),_t=0;for(Be=0;Be<We;++Be){var Bt=m-At+Be+32768&32767,It=Bt-G[Bt]+32768&32767;It>_t&&(_t=It,De=Bt)}}}At+=(Me=De)-(De=G[Me])+32768&32767}if(et){D[he++]=268435456|s0e[ze]<<18|OHe[et];var ot=31&s0e[ze],Lt=31&OHe[et];ce+=o0e[ot]+a0e[Lt],++Z[257+ot],++Y[Lt],ae=m+ze,++W}else D[he++]=o[m],++Z[o[m]]}}A=VHe(o,h,u,D,Z,Y,ce,he,ve,m-ve,A)}return HHe(f,0,l+zHe(A)+c)}(i,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+e.mem,t,n,!0)},d0e=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},oon=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&d0e(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},aon=function(i){return 10+(i.filename&&i.filename.length+1||0)};function jHe(i,e){e===void 0&&(e={});var t=ion(),n=i.length;t.p(i);var r=ron(i,e,aon(e),8),o=r.length;return oon(r,e),d0e(r,o-8,t.d()),d0e(r,o-4,n),r}function KHe(i,e){var t=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var n=new w5(i.length+(i.length>>>1)),r=0,o=function(c){n[r++]=c},a=0;a<t;++a){if(r+5>n.length){var s=new w5(r+8+(t-a<<1));s.set(n),n=s}var l=i.charCodeAt(a);l<128||e?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&i.charCodeAt(++a))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return HHe(n,0,r)}function son(i,e){return function(t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n|=0;return Math.abs(n)}(i)%100<Z2(100*e,0,100)}var MB="disabled",f0e="sampled",BV="active",PM="buffering",h0e="paused",p0e="trigger",pS=p0e+"_activated",nE=p0e+"_pending",AS=p0e+"_"+MB;function XHe(i,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(i))}class qHe{constructor(e){this.xt=e}triggerStatus(e){var t=this.xt.map(n=>n.triggerStatus(e));return t.includes(pS)?pS:t.includes(nE)?nE:AS}stop(){this.xt.forEach(e=>e.stop())}}class JHe{constructor(e){this.xt=e}triggerStatus(e){var t=new Set;for(var n of this.xt)t.add(n.triggerStatus(e));switch(t.delete(AS),t.size){case 0:return AS;case 1:return Array.from(t)[0];default:return nE}}stop(){this.xt.forEach(e=>e.stop())}}class lon{triggerStatus(){return nE}stop(){}}class con{constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,n;this.Et=((t=e.sessionRecording)==null?void 0:t.urlTriggers)||[],this.It=((n=e.sessionRecording)==null?void 0:n.urlBlocklist)||[]}Pt(e){var t;return this.Et.length===0?AS:((t=this._instance)==null?void 0:t.get_property(Pde))===e?pS:nE}triggerStatus(e){var t=this.Pt(e),n=t===pS?pS:t===nE?nE:AS;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:n}),n}checkUrlTriggerConditions(e,t,n){if($a!==void 0&&$a.location.href){var r=$a.location.href,o=this.urlBlocked,a=XHe(r,this.It);o&&a||(a&&!o?e():!a&&o&&t(),XHe(r,this.Et)&&n("url"))}}stop(){}}class uon{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=nE;return tv(this.linkedFlag)&&(e=AS),this.linkedFlagSeen&&(e=pS),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var n;if(this.linkedFlag=((n=e.sessionRecording)==null?void 0:n.linkedFlag)||null,!tv(this.linkedFlag)&&!this.linkedFlagSeen){var r=DI(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,o=DI(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags((a,s)=>{var l=!1;if(QI(s)&&r in s){var c=s[r];l=fS(c)?c===!0:o?c===o:!!c}this.linkedFlagSeen=l,l&&t(r,o)})}}stop(){this.Rt()}}class don{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=((t=e.sessionRecording)==null?void 0:t.eventTriggers)||[]}Mt(e){var t;return this.Tt.length===0?AS:((t=this._instance)==null?void 0:t.get_property(Lde))===e?pS:nE}triggerStatus(e){var t=this.Mt(e),n=t===pS?pS:t===nE?nE:AS;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:n}),n}stop(){}}function fon(i){return i.isRecordingEnabled?PM:MB}function hon(i){if(!i.receivedFlags)return PM;if(!i.isRecordingEnabled)return MB;if(i.urlTriggerMatching.urlBlocked)return h0e;var e=i.isSampled===!0,t=new qHe([i.eventTriggerMatching,i.urlTriggerMatching,i.linkedFlagMatching]).triggerStatus(i.sessionId);return e?f0e:t===pS?BV:t===nE?PM:i.isSampled===!1?MB:BV}function pon(i){if(!i.receivedFlags)return PM;if(!i.isRecordingEnabled)return MB;if(i.urlTriggerMatching.urlBlocked)return h0e;var e=new JHe([i.eventTriggerMatching,i.urlTriggerMatching,i.linkedFlagMatching]).triggerStatus(i.sessionId),t=e!==AS,n=fS(i.isSampled);return t&&e===nE?PM:t&&e===AS||n&&!i.isSampled?MB:i.isSampled===!0?f0e:BV}var pk="[SessionRecording]",iE=uC(pk);function MV(){var i;return Fm==null||(i=Fm.__PosthogExtensions__)==null||(i=i.rrweb)==null?void 0:i.record}var Aon=3e5,gon=[c3.MouseMove,c3.MouseInteraction,c3.Scroll,c3.ViewportResize,c3.Input,c3.TouchMove,c3.MediaInteraction,c3.Drag],ZHe=i=>({rrwebMethod:i,enqueuedAt:Date.now(),attempt:1});function LM(i){return function(e,t){for(var n="",r=0;r<e.length;){var o=e[r++];n+=String.fromCharCode(o)}return n}(jHe(KHe(JSON.stringify(i))))}function WHe(i){return i.type===P4.Custom&&i.data.tag==="sessionIdle"}class mon{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(pk+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===nE?6e4:(e=(t=this._instance.config.session_recording)==null?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:Aon}get jt(){var e=this._instance.get_property(lk);return fS(e)?e:null}get Nt(){var e,t,n=(e=this.C)==null?void 0:e.data[((t=this.C)==null?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.At.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get zt(){var e=!!this._instance.get_property(kde),t=!this._instance.config.disable_session_recording;return $a&&e&&t}get Ut(){var e=!!this._instance.get_property(Wze),t=this._instance.config.enable_recording_console_log;return t??e}get qt(){var e,t,n,r,o,a,s=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(tHe),c=(e=(t=s==null?void 0:s.recordCanvas)!==null&&t!==void 0?t:l==null?void 0:l.enabled)!==null&&e!==void 0&&e,u=(n=(r=s==null?void 0:s.canvasFps)!==null&&r!==void 0?r:l==null?void 0:l.fps)!==null&&n!==void 0?n:4,d=(o=(a=s==null?void 0:s.canvasQuality)!==null&&a!==void 0?a:l==null?void 0:l.quality)!==null&&o!==void 0?o:.4;if(typeof d=="string"){var f=parseFloat(d);d=isNaN(f)?.4:f}return{enabled:c,fps:Z2(u,0,12,"canvas recording fps",4),quality:Z2(d,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,n=this._instance.get_property($ze),r={recordHeaders:(e=this._instance.config.session_recording)==null?void 0:e.recordHeaders,recordBody:(t=this._instance.config.session_recording)==null?void 0:t.recordBody},o=(r==null?void 0:r.recordHeaders)||(n==null?void 0:n.recordHeaders),a=(r==null?void 0:r.recordBody)||(n==null?void 0:n.recordBody),s=QI(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,l=!!(fS(s)?s:n!=null&&n.capturePerformance);return o||a||l?{recordHeaders:o,recordBody:a,recordPerformance:l}:void 0}get Ht(){var e,t,n,r,o,a,s=this._instance.get_property(eHe),l={maskAllInputs:(e=this._instance.config.session_recording)==null?void 0:e.maskAllInputs,maskTextSelector:(t=this._instance.config.session_recording)==null?void 0:t.maskTextSelector,blockSelector:(n=this._instance.config.session_recording)==null?void 0:n.blockSelector},c=(r=l==null?void 0:l.maskAllInputs)!==null&&r!==void 0?r:s==null?void 0:s.maskAllInputs,u=(o=l==null?void 0:l.maskTextSelector)!==null&&o!==void 0?o:s==null?void 0:s.maskTextSelector,d=(a=l==null?void 0:l.blockSelector)!==null&&a!==void 0?a:s==null?void 0:s.blockSelector;return m0(c)&&m0(u)&&m0(d)?void 0:{maskAllInputs:c==null||c,maskTextSelector:u,blockSelector:d}}get Wt(){var e=this._instance.get_property(nHe);return tE(e)?e:null}get Gt(){var e=this._instance.get_property(iHe);return tE(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):PM}constructor(e){if(this.Vt=fon,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=new lon,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(ih!=null&&ih.visibilityState){var r="window "+ih.visibilityState;this.ui(r,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw iE.error("started without valid sessionManager"),new Error(pk+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(pk+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new uon(this._instance),this.Kt=new con(this._instance),this.Yt=new don(this._instance);var{sessionId:t,windowId:n}=this.At.checkAndGetSessionAndWindowId();this.Ct=t,this.fi=n,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&iE.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),hI($a,"beforeunload",this.oi),hI($a,"offline",this.li),hI($a,"online",this.hi),hI($a,"visibilitychange",this.di),this.mi(),this.bi(),tv(this.ii)&&(this.ii=this._instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var n=t!=null&&t.properties.$current_url?this.yi(t==null?void 0:t.properties.$current_url):"";if(!n)return;this.ui("$pageview",{href:n})}}catch(r){iE.error("Could not add $pageview to rrweb session",r)}})),this.ei||(this.ei=this.At.onSessionId((t,n,r)=>{var o,a;r&&(this.ui("$session_id_change",{sessionId:t,windowId:n,changeReason:r}),(o=this._instance)==null||(o=o.persistence)==null||o.unregister(Lde),(a=this._instance)==null||(a=a.persistence)==null||a.unregister(Pde))}))):this.stopRecording()}stopRecording(){var e,t,n,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,$a==null||$a.removeEventListener("beforeunload",this.oi),$a==null||$a.removeEventListener("offline",this.li),$a==null||$a.removeEventListener("online",this.hi),$a==null||$a.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),(e=this.ii)==null||e.call(this),this.ii=void 0,(t=this.ni)==null||t.call(this),this.ni=void 0,(n=this.ei)==null||n.call(this),this.ei=void 0,(r=this.si)==null||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),iE.info("stopped"))}Si(){var e;(e=this._instance.persistence)==null||e.unregister(lk)}$i(e){var t,n=this.Ct!==e,r=this.Wt;if(tE(r)){var o=this.jt,a=n||!fS(o),s=a?son(e,r):o;a&&(s?this.ki(f0e):iE.warn("Sample rate ("+r+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:r,isSampled:s})),(t=this._instance.persistence)==null||t.register({[lk]:s})}else this.Si()}onRemoteConfig(e){var t,n,r,o;this.ui("$remote_config_received",e),this.xi(e),(t=e.sessionRecording)!=null&&t.endpoint&&(this.vi=(o=e.sessionRecording)==null?void 0:o.endpoint),this.mi(),((n=e.sessionRecording)==null?void 0:n.triggerMatchType)==="any"?(this.Vt=hon,this.Lt=new qHe([this.Yt,this.Kt])):(this.Vt=pon,this.Lt=new JHe([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:(r=e.sessionRecording)==null?void 0:r.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,(a,s)=>{this.ki("linked_flag_matched",{flag:a,variant:s})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){tE(this.Wt)&&tv(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}xi(e){if(this._instance.persistence){var t,n=this._instance.persistence,r=()=>{var o,a,s,l,c,u,d,f,h,A=(o=e.sessionRecording)==null?void 0:o.sampleRate,m=tv(A)?null:parseFloat(A);tv(m)&&this.Si();var _=(a=e.sessionRecording)==null?void 0:a.minimumDurationMilliseconds;n.register({[kde]:!!e.sessionRecording,[Wze]:(s=e.sessionRecording)==null?void 0:s.consoleLogRecordingEnabled,[$ze]:Mf({capturePerformance:e.capturePerformance},(l=e.sessionRecording)==null?void 0:l.networkPayloadCapture),[eHe]:(c=e.sessionRecording)==null?void 0:c.masking,[tHe]:{enabled:(u=e.sessionRecording)==null?void 0:u.recordCanvas,fps:(d=e.sessionRecording)==null?void 0:d.canvasFps,quality:(f=e.sessionRecording)==null?void 0:f.canvasQuality},[nHe]:m,[iHe]:m0(_)?null:_,[rHe]:(h=e.sessionRecording)==null?void 0:h.scriptConfig})};r(),(t=this.ri)==null||t.call(this),this.ri=this.At.onSessionId(r)}}log(e,t){var n;t===void 0&&(t="log"),(n=this._instance.sessionRecording)==null||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}gi(e){if(!m0(Object.assign)&&!m0(Array.from)&&!(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),MV()?this.Ei():(t=Fm.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.Ii,n=>{if(n)return iE.error("could not load recorder",n);this.Ei()}),iE.info("starting"),this.status===BV&&this.ki(e||"recording_initialized")}}get Ii(){var e;return((e=this._instance)==null||(e=e.persistence)==null||(e=e.get_property(rHe))==null?void 0:e.script)||"recorder"}Pi(e){var t;return e.type===3&&gon.indexOf((t=e.data)==null?void 0:t.source)!==-1}Ri(e){var t=this.Pi(e);t||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai());var n=!1;if(t&&(this.ti=e.timestamp,this.Zt)){var r=this.Zt==="unknown";this.Zt=!1,r||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this.Zt){var{windowId:o,sessionId:a}=this.At.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.Ct!==a,l=this.fi!==o;this.fi=o,this.Ct=a,s||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this.Ti()}}Mi(e){try{return e.rrwebMethod(),!0}catch(t){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):iE.warn("could not emit queued rrweb event.",t,e),!1}}ui(e,t){return this.Mi(ZHe(()=>MV().addCustomEvent(e,t)))}Ci(){return this.Mi(ZHe(()=>MV().takeFullSnapshot()))}Ei(){var e,t,n,r,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this._instance.config.session_recording;for(var[s,l]of Object.entries(a||{}))s in o&&(s==="maskInputOptions"?o.maskInputOptions=Mf({password:!0},l):o[s]=l);this.qt&&this.qt.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.qt.fps},o.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(o.maskAllInputs=(t=this.Ht.maskAllInputs)===null||t===void 0||t,o.maskTextSelector=(n=this.Ht.maskTextSelector)!==null&&n!==void 0?n:void 0,o.blockSelector=(r=this.Ht.blockSelector)!==null&&r!==void 0?r:void 0);var c=MV();if(c){this.Fi=(e=this.Fi)!==null&&e!==void 0?e:new Zrn(c,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(d,f)=>{var h="Too many mutations on node '"+d+"'. Rate limiting. This could be due to SVG animations or something similar";iE.info(h,{node:f}),this.log(pk+" "+h,"warn")}});var u=this.Oi();this.ci=c(Mf({emit:d=>{this.onRRwebEmit(d)},plugins:u},o)),this.ti=Date.now(),this.Zt=fS(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:o,activePlugins:u.map(d=>d==null?void 0:d.name)}),this.ui("$posthog_config",{config:this._instance.config})}else iE.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),this.Zt!==!0){var e=this.Dt;e&&(this.wi=setInterval(()=>{this.Ci()},e))}}Oi(){var e,t,n=[],r=(e=Fm.__PosthogExtensions__)==null||(e=e.rrwebPlugins)==null?void 0:e.getRecordConsolePlugin;r&&this.Ut&&n.push(r());var o=(t=Fm.__PosthogExtensions__)==null||(t=t.rrwebPlugins)==null?void 0:t.getRecordNetworkPlugin;return this.Bt&&S5(o)&&(!grn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?n.push(o(Jrn(this._instance.config,this.Bt))):iE.info("NetworkCapture not started because we are on localhost.")),n}onRRwebEmit(e){var t;if(this.Ai(),e&&QI(e)){if(e.type===P4.Meta){var n=this.yi(e.data.href);if(this.Di=n,!n)return;e.data.href=n}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),f=>this.zi(f)),!this.Kt.urlBlocked||(r=e).type===P4.Custom&&r.data.tag==="recording paused"){var r;e.type===P4.FullSnapshot&&this.Ti(),e.type===P4.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===nE&&this.pi();var o=this.Fi?this.Fi.throttleMutations(e):e;if(o){var a=function(f){var h=f;if(h&&QI(h)&&h.type===6&&QI(h.data)&&h.data.plugin==="rrweb/console@1"){h.data.payload.payload.length>10&&(h.data.payload.payload=h.data.payload.payload.slice(0,10),h.data.payload.payload.push("...[truncated]"));for(var A=[],m=0;m<h.data.payload.payload.length;m++)h.data.payload.payload[m]&&h.data.payload.payload[m].length>2e3?A.push(h.data.payload.payload[m].slice(0,2e3)+"...[truncated]"):A.push(h.data.payload.payload[m]);return h.data.payload.payload=A,f}return f}(o);if(this.Ri(a),this.Zt!==!0||WHe(a)){if(WHe(a)){var s=a.data.payload;if(s){var l=s.lastActivityTimestamp,c=s.threshold;a.timestamp=l+c}}var u=(t=this._instance.config.session_recording.compress_events)===null||t===void 0||t?function(f){if(EV(f)<1024)return f;try{if(f.type===P4.FullSnapshot)return Mf({},f,{data:LM(f.data),cv:"2024-10"});if(f.type===P4.IncrementalSnapshot&&f.data.source===c3.Mutation)return Mf({},f,{cv:"2024-10",data:Mf({},f.data,{texts:LM(f.data.texts),attributes:LM(f.data.attributes),removes:LM(f.data.removes),adds:LM(f.data.adds)})});if(f.type===P4.IncrementalSnapshot&&f.data.source===c3.StyleSheetRule)return Mf({},f,{cv:"2024-10",data:Mf({},f.data,{adds:f.data.adds?LM(f.data.adds):void 0,removes:f.data.removes?LM(f.data.removes):void 0})})}catch(h){iE.error("could not compress event - will use uncompressed event",h)}return f}(a):a,d={$snapshot_bytes:EV(u),$snapshot_data:u,$session_id:this.Ct,$window_id:this.fi};this.status!==MB?this.Ui(d):this.pi()}}}}}Li(){if(!this._instance.config.capture_pageview&&$a){var e=this.yi($a.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];this.Qt=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this.Mi(t)})}}yi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return(n=r=t.maskNetworkRequestFn(r))==null?void 0:n.url}return e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,n=tE(t)&&t>=0,r=tE(e)&&n&&t<e;return this.status===PM||this.status===h0e||this.status===MB||r?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&n0e(this.C).forEach(o=>{this.Bi({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId,$lib:"web",$lib_version:N4.LIB_VERSION})}),this.pi())}Ui(e){var t,n=2+(((t=this.C)==null?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+n>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Lt.triggerStatus(this.sessionId)===nE&&((t=this._instance)==null||(t=t.persistence)==null||t.register({[e==="url"?Pde:Lde]:this.Ct}),this.ai(),this.ki(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),iE.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),iE.info("recording resumed"))}bi(){this.Yt.Tt.length!==0&&tv(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(t){iE.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.ki("linked_flag_overridden")}overrideSampling(){var e;(e=this._instance.persistence)==null||e.register({[lk]:!0}),this.Ci(),this.ki("sampling_overridden")}overrideTrigger(e){this.zi(e)}ki(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),iE.info(e.replace("_"," "),t),f1(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var A0e=uC("[SegmentIntegration]");function yon(i,e){var t=i.config.segment;if(!t)return e();(function(n,r){var o=n.config.segment;if(!o)return r();var a=l=>{var c=()=>l.anonymousId()||BB();n.config.get_device_id=c,l.id()&&(n.register({distinct_id:l.id(),$device_id:c()}),n.persistence.set_property(k4,"identified")),r()},s=o.user();"then"in s&&S5(s.then)?s.then(l=>a(l)):a(s)})(i,()=>{t.register((n=>{Promise&&Promise.resolve||A0e.warn("This browser does not have Promise support, and can not use the segment integration");var r=(o,a)=>{if(!a)return o;o.event.userId||o.event.anonymousId===n.get_distinct_id()||(A0e.info("No userId set, resetting PostHog"),n.reset()),o.event.userId&&o.event.userId!==n.get_distinct_id()&&(A0e.info("UserId set, identifying with PostHog"),n.identify(o.event.userId));var s=n.calculateEventProperties(a,o.event.properties);return o.event.properties=Object.assign({},s,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>r(o,o.event.event),page:o=>r(o,"$pageview"),identify:o=>r(o,"$identify"),screen:o=>r(o,"$screen")}})(i)).then(()=>{e()})})}var $He="posthog-js";function eYe(i,e){var{organization:t,projectId:n,prefix:r,severityAllowList:o=["error"]}=e===void 0?{}:e;return a=>{var s,l,c,u,d;if(!(o==="*"||o.includes(a.level))||!i.__loaded)return a;a.tags||(a.tags={});var f=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());a.tags["PostHog Person URL"]=f,i.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var h=((s=a.exception)==null?void 0:s.values)||[],A=h.map(_=>Mf({},_,{stacktrace:_.stacktrace?Mf({},_.stacktrace,{type:"raw",frames:(_.stacktrace.frames||[]).map(v=>Mf({},v,{platform:"web:javascript"}))}):void 0})),m={$exception_message:((l=h[0])==null?void 0:l.value)||a.message,$exception_type:(c=h[0])==null?void 0:c.type,$exception_personURL:f,$exception_level:a.level,$exception_list:A,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((u=h[0])==null?void 0:u.value)||a.message,$sentry_exception_type:(d=h[0])==null?void 0:d.type,$sentry_tags:a.tags};return t&&n&&(m.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+a.event_id),i.exceptions.sendExceptionEvent(m),a}}class _on{constructor(e,t,n,r,o){this.name=$He,this.setupOnce=function(a){a(eYe(e,{organization:t,projectId:n,prefix:r,severityAllowList:o}))}}}var von=$a!=null&&$a.location?mV($a.location.hash,"__posthog")||mV(location.hash,"state"):null,tYe="_postHogToolbarParams",nYe=uC("[Toolbar]"),RB=function(i){return i[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.LOADING=1]="LOADING",i[i.LOADED=2]="LOADED",i}(RB||{});class xon{constructor(e){this.instance=e}Hi(e){Fm.ph_toolbar_state=e}Wi(){var e;return(e=Fm.ph_toolbar_state)!==null&&e!==void 0?e:RB.UNINITIALIZED}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),!$a||!ih)return!1;e=e??$a.location,n=n??$a.history;try{if(!t){try{$a.localStorage.setItem("test","test"),$a.localStorage.removeItem("test")}catch{return!1}t=$a==null?void 0:$a.localStorage}var r,o=von||mV(e.hash,"__posthog")||mV(e.hash,"state"),a=o?Yze(()=>JSON.parse(atob(decodeURIComponent(o))))||Yze(()=>JSON.parse(decodeURIComponent(o))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(tYe)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}Gi(e){var t=Fm.ph_load_toolbar||Fm.ph_load_editor;!tv(t)&&S5(t)?t(e,this.instance):nYe.warn("No toolbar load function found")}loadToolbar(e){var t=!(ih==null||!ih.getElementById(oHe));if(!$a||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=Mf({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if($a.localStorage.setItem(tYe,JSON.stringify(Mf({},r,{source:void 0}))),this.Wi()===RB.LOADED)this.Gi(r);else if(this.Wi()===RB.UNINITIALIZED){var o;this.Hi(RB.LOADING),(o=Fm.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return nYe.error("[Toolbar] Failed to load",a),void this.Hi(RB.UNINITIALIZED);this.Hi(RB.LOADED),this.Gi(r)}),hI($a,"turbolinks:load",()=>{this.Hi(RB.UNINITIALIZED),this.loadToolbar(r)})}return!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}var Ion=uC("[TracingHeaders]");class bon{constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var t,n;m0(this.Vi)&&((t=Fm.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),m0(this.Ki)&&((n=Fm.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}J(e){var t,n;(t=Fm.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return Ion.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):((e=this.Vi)==null||e.call(this),(t=this.Ki)==null||t.call(this),this.Vi=void 0,this.Ki=void 0)}}var QB=uC("[Web Vitals]"),iYe=9e5;class Con{constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((n,r)=>Mf({},n,{["$web_vitals_"+r.name+"_event"]:Mf({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=n=>{var r,o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(m0(o))QB.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.te();m0(a)||(tv(n==null?void 0:n.name)||tv(n==null?void 0:n.value)?QB.error("Invalid metric received",n):this.ie&&n.value>=this.ie?QB.error("Ignoring metric with value >= "+this.ie,n):(this.C.url!==a&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),m0(this.C.url)&&(this.C.url=a),this.C.firstMetricTimestamp=m0(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(Mf({},n,{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var n,r,o,a,s=Fm.__PosthogExtensions__;m0(s)||m0(s.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:o,onINP:a}=s.postHogWebVitalsCallbacks),n&&r&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Zi.bind(this)),this.i=!0):QB.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!((t=this._instance.persistence)==null||!t.props[qze]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=QI(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return m0(n)?((t=this._instance.persistence)==null?void 0:t.props[Zze])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(QI(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var e=QI(this._instance.config.capture_performance)&&tE(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:iYe;return 0<e&&e<=6e4?iYe:e}get isEnabled(){var e=d2==null?void 0:d2.protocol;if(e!=="http:"&&e!=="https:")return QB.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=QI(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:fS(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return fS(t)?t:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(QB.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(e){var t=QI(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=QI(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qze]:t}),this._instance.persistence.register({[Zze]:n})),this.Yi=t,this.startIfEnabled()}J(e){var t,n;(t=Fm.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"web-vitals",r=>{r?QB.error("failed to load script",r):e()})}te(){var e=$a?$a.location.href:void 0;return e||QB.error("Could not determine current URL"),e}}var Eon=uC("[Heatmaps]");function rYe(i){return QI(i)&&"clientX"in i&&"clientY"in i&&tE(i.clientX)&&tE(i.clientY)}class Son{constructor(e){var t;this.rageclicks=new _He,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!((t=this.instance.persistence)==null||!t.props[Nde])}get flushIntervalMilliseconds(){var e=5e3;return QI(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return m0(this.instance.config.capture_heatmaps)?m0(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.i)return;Eon.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this.ee)!==null&&e!==void 0?e:void 0),(t=this.ne)==null||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Nde]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){$a&&ih&&(hI($a,"beforeunload",this.se.bind(this)),hI(ih,"click",e=>this.ae(e||($a==null?void 0:$a.event)),{capture:!0}),hI(ih,"mousemove",e=>this.le(e||($a==null?void 0:$a.event)),{capture:!0}),this.ne=new CHe(this.instance,Rrn,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=function(s,l,c){for(var u=s;u&&hV(u)&&!wB(u,"body");){if(u===c)return!1;if(f1(l,$a==null?void 0:$a.getComputedStyle(u).position))return!0;u=fHe(u)}return!1}(dHe(e),["fixed","sticky"],o);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}ae(e,t){var n;if(t===void 0&&(t="click"),!aHe(e.target)&&rYe(e)){var r=this.ue(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.he(Mf({},r,{type:"rageclick"})),this.he(r)}}le(e){!aHe(e.target)&&rYe(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if($a){var t=$a.location.href;this.C=this.C||{},this.C[t]||(this.C[t]=[]),this.C[t].push(e)}}se(){this.C&&!TQ(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class won{constructor(e){this._instance=e}doPageView(e,t){var n,r=this.ve(e,t);return this.ce={pathname:(n=$a==null?void 0:$a.location.pathname)!==null&&n!==void 0?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,(t=this.ce)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ce)==null?void 0:e.pageViewId}}ve(e,t){var n=this.ce;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:s,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=o;if(!(m0(a)||m0(s)||m0(l)||m0(c)||m0(u)||m0(d))){a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var f=a<=1?1:Z2(s/a,0,1),h=a<=1?1:Z2(l/a,0,1),A=c<=1?1:Z2(u/c,0,1),m=c<=1?1:Z2(d/c,0,1);r=jI(r,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:A,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}}var Bon=function(i){var e,t,n,r,o="";for(e=t=0,n=(i=(i+"").replace(/\r\n/g,`
1004
1004
  `).replace(/\r/g,`
1005
- `)).length,r=0;r<n;r++){var a=i.charCodeAt(r),s=null;a<128?t++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),EB(s)||(t>e&&(o+=i.substring(e,t)),o+=s,e=t=r+1)}return t>e&&(o+=i.substring(e,i.length)),o},Mon=!!Bde||!!wde,oYe="text/plain",RV=(i,e)=>{var[t,n]=i.split("?"),r=Mf({},e);n==null||n.split("&").forEach(a=>{var[s]=a.split("=");delete r[s]});var o=mrn(r);return t+"?"+(o=o?(n?n+"&":"")+o:n)},Ak=(i,e)=>JSON.stringify(i,(t,n)=>typeof n=="bigint"?n.toString():n,e),g0e=i=>{var{data:e,compression:t}=i;if(e){if(t===T4.GZipJS){var n=jHe(KHe(Ak(e)),{mtime:0}),r=new Blob([n],{type:oYe});return{contentType:oYe,body:r,estimatedSize:r.size}}if(t===T4.Base64){var o=function(l){var c,u,d,f,h,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,_=0,v="",x=[];if(!l)return l;l=Bon(l);do c=(h=l.charCodeAt(m++)<<16|l.charCodeAt(m++)<<8|l.charCodeAt(m++))>>18&63,u=h>>12&63,d=h>>6&63,f=63&h,x[_++]=A.charAt(c)+A.charAt(u)+A.charAt(d)+A.charAt(f);while(m<l.length);switch(v=x.join(""),l.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(Ak(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ak(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=Ak(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},gk=[];wde&&gk.push({transport:"fetch",method:i=>{var e,t,{contentType:n,body:r,estimatedSize:o}=(e=g0e(i))!==null&&e!==void 0?e:{},a=new Headers;Zv(i.headers,function(u,d){a.append(d,u)}),n&&a.append("Content-Type",n);var s=i.url,l=null;if(Fze){var c=new Fze;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}wde(s,Mf({method:(i==null?void 0:i.method)||"GET",headers:a,keepalive:i.method==="POST"&&(o||0)<52428.8,body:r,signal:(t=l)==null?void 0:t.signal},i.fetchOptions)).then(u=>u.text().then(d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(h){Sh.error(h)}i.callback==null||i.callback(f)})).catch(u=>{Sh.error(u),i.callback==null||i.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),Bde&&gk.push({transport:"XHR",method:i=>{var e,t=new Bde;t.open(i.method||"GET",i.url,!0);var{contentType:n,body:r}=(e=g0e(i))!==null&&e!==void 0?e:{};Zv(i.headers,function(o,a){t.setRequestHeader(a,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(r)}}),J2!=null&&J2.sendBeacon&&gk.push({transport:"sendBeacon",method:i=>{var e=RV(i.url,{beacon:"1"});try{var t,{contentType:n,body:r}=(t=g0e(i))!==null&&t!==void 0?t:{},o=typeof r=="string"?new Blob([r],{type:n}):r;J2.sendBeacon(e,o)}catch{}}});var GQ=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function aYe(i,e,t){return Ak({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Ron={exact:(i,e)=>e.some(t=>i.some(n=>t===n)),is_not:(i,e)=>e.every(t=>i.every(n=>t!==n)),regex:(i,e)=>e.some(t=>i.some(n=>GQ(t,n))),not_regex:(i,e)=>e.every(t=>i.every(n=>!GQ(t,n))),icontains:(i,e)=>e.map(QV).some(t=>i.map(QV).some(n=>t.includes(n))),not_icontains:(i,e)=>e.map(QV).every(t=>i.map(QV).every(n=>!t.includes(n)))},QV=i=>i.toLowerCase(),Qon=uC("[Error tracking]");class Don{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=(t=(n=this._instance.persistence)==null?void 0:n.get_property(Tde))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[];this.fe=r,this._instance.persistence&&this._instance.persistence.register({[Tde]:this.fe})}sendExceptionEvent(e){if(!this.pe(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Qon.info("Skipping exception capture because a suppression rule matched")}pe(e){var t=e.$exception_list;if(!t||!tI(t)||t.length===0)return!1;var n=t.reduce((r,o)=>{var{type:a,value:s}=o;return DI(a)&&a.length>0&&r.$exception_types.push(a),DI(s)&&s.length>0&&r.$exception_values.push(s),r},{$exception_types:[],$exception_values:[]});return this.fe.some(r=>{var o=r.values.map(a=>{var s,l=Ron[a.operator],c=tI(a.value)?a.value:[a.value],u=(s=n[a.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,u)});return r.type==="OR"?o.some(Boolean):o.every(Boolean)})}}var B5="Mobile",DV="iOS",gS="Android",mk="Tablet",sYe=gS+" "+mk,lYe="iPad",cYe="Apple",uYe=cYe+" Watch",yk="Safari",zQ="BlackBerry",dYe="Samsung",fYe=dYe+"Browser",hYe=dYe+" Internet",FM="Chrome",Non=FM+" OS",pYe=FM+" "+DV,m0e="Internet Explorer",AYe=m0e+" "+B5,y0e="Opera",Ton=y0e+" Mini",_0e="Edge",gYe="Microsoft "+_0e,HQ="Firefox",mYe=HQ+" "+DV,_k="Nintendo",vk="PlayStation",YQ="Xbox",yYe=gS+" "+B5,_Ye=B5+" "+yk,xk="Windows",v0e=xk+" Phone",vYe="Nokia",x0e="Ouya",xYe="Generic",kon=xYe+" "+B5.toLowerCase(),IYe=xYe+" "+mk.toLowerCase(),I0e="Konqueror",RE="(\\d+(\\.\\d+)?)",b0e=new RegExp("Version/"+RE),Pon=new RegExp(YQ,"i"),Lon=new RegExp(vk+" \\w+","i"),Fon=new RegExp(_k+" \\w+","i"),C0e=new RegExp(zQ+"|PlayBook|BB10","i"),Uon={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Oon=(i,e)=>e&&f1(e,cYe)||function(t){return f1(t,yk)&&!f1(t,FM)&&!f1(t,gS)}(i),bYe=function(i,e){return e=e||"",f1(i," OPR/")&&f1(i,"Mini")?Ton:f1(i," OPR/")?y0e:C0e.test(i)?zQ:f1(i,"IE"+B5)||f1(i,"WPDesktop")?AYe:f1(i,fYe)?hYe:f1(i,_0e)||f1(i,"Edg/")?gYe:f1(i,"FBIOS")?"Facebook "+B5:f1(i,"UCWEB")||f1(i,"UCBrowser")?"UC Browser":f1(i,"CriOS")?pYe:f1(i,"CrMo")||f1(i,FM)?FM:f1(i,gS)&&f1(i,yk)?yYe:f1(i,"FxiOS")?mYe:f1(i.toLowerCase(),I0e.toLowerCase())?I0e:Oon(i,e)?f1(i,B5)?_Ye:yk:f1(i,HQ)?HQ:f1(i,"MSIE")||f1(i,"Trident/")?m0e:f1(i,"Gecko")?HQ:""},Gon={[AYe]:[new RegExp("rv:"+RE)],[gYe]:[new RegExp(_0e+"?\\/"+RE)],[FM]:[new RegExp("("+FM+"|CrMo)\\/"+RE)],[pYe]:[new RegExp("CriOS\\/"+RE)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+RE)],[yk]:[b0e],[_Ye]:[b0e],[y0e]:[new RegExp("(Opera|OPR)\\/"+RE)],[HQ]:[new RegExp(HQ+"\\/"+RE)],[mYe]:[new RegExp("FxiOS\\/"+RE)],[I0e]:[new RegExp("Konqueror[:/]?"+RE,"i")],[zQ]:[new RegExp(zQ+" "+RE),b0e],[yYe]:[new RegExp("android\\s"+RE,"i")],[hYe]:[new RegExp(fYe+"\\/"+RE)],[m0e]:[new RegExp("(rv:|MSIE )"+RE)],Mozilla:[new RegExp("rv:"+RE)]},zon=function(i,e){var t=bYe(i,e),n=Gon[t];if(m0(n))return null;for(var r=0;r<n.length;r++){var o=n[r],a=i.match(o);if(a)return parseFloat(a[a.length-2])}return null},CYe=[[new RegExp(YQ+"; "+YQ+" (.*?)[);]","i"),i=>[YQ,i&&i[1]||""]],[new RegExp(_k,"i"),[_k,""]],[new RegExp(vk,"i"),[vk,""]],[C0e,[zQ,""]],[new RegExp(xk,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[v0e,""];if(new RegExp(B5).test(e)&&!/IEMobile\b/.test(e))return[xk+" "+B5,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],r=Uon[n]||"";return/arm/i.test(e)&&(r="RT"),[xk,r]}return[xk,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[DV,e.join(".")]}return[DV,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=m0(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+gS+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+gS+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[gS,e.join(".")]}return[gS,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Non,""]],[/Linux|debian/i,["Linux",""]]],EYe=function(i){return Fon.test(i)?_k:Lon.test(i)?vk:Pon.test(i)?YQ:new RegExp(x0e,"i").test(i)?x0e:new RegExp("("+v0e+"|WPDesktop)","i").test(i)?v0e:/iPad/.test(i)?lYe:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?uYe:C0e.test(i)?zQ:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(vYe,"i").test(i)?vYe:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(B5).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?gS:sYe:gS:new RegExp("(pda|"+B5+")","i").test(i)?kon:new RegExp(mk,"i").test(i)&&!new RegExp(mk+" pc","i").test(i)?IYe:""},NV="https?://(.*)",TV=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Hon=rV(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],TV),E0e="<masked>",Yon=["li_fat_id"];function SYe(i,e,t){if(!ih)return{};var n,r=e?rV([],TV,t||[]):[],o=wYe(Kde(ih.URL,r,E0e),i),a=(n={},Zv(Yon,function(s){var l=hS.D(s);n[s]=l||null}),n);return jI(a,o)}function wYe(i,e){var t=Hon.concat(e||[]),n={};return Zv(t,function(r){var o=gV(i,r);n[r]=o||null}),n}function BYe(i){var e=function(o){return o?o.search(NV+"google.([^/?]*)")===0?"google":o.search(NV+"bing.com")===0?"bing":o.search(NV+"yahoo.com")===0?"yahoo":o.search(NV+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",n={};if(!EB(e)){n.$search_engine=e;var r=ih?gV(ih.referrer,t):"";r.length&&(n.ph_keyword=r)}return n}function MYe(){return navigator.language||navigator.userLanguage}function RYe(){return(ih==null?void 0:ih.referrer)||"$direct"}function QYe(i,e){var t=i?rV([],TV,e||[]):[],n=d2==null?void 0:d2.href.substring(0,1e3);return{r:RYe().substring(0,1e3),u:n?Kde(n,t,E0e):void 0}}function DYe(i){var e,{r:t,u:n}=i,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=LQ(t))==null?void 0:e.host};if(n){r.$current_url=n;var o=LQ(n);r.$host=o==null?void 0:o.host,r.$pathname=o==null?void 0:o.pathname;var a=wYe(n);jI(r,a)}if(t){var s=BYe(t);jI(r,s)}return r}function NYe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Von(){try{return new Date().getTimezoneOffset()}catch{return}}function jon(i,e){if(!f2)return{};var t,n,r,o=i?rV([],TV,e||[]):[],[a,s]=function(l){for(var c=0;c<CYe.length;c++){var[u,d]=CYe[c],f=u.exec(l),h=f&&(S5(d)?d(f,l):d);if(h)return h}return["",""]}(f2);return jI(Dde({$os:a,$os_version:s,$browser:bYe(f2,navigator.vendor),$device:EYe(f2),$device_type:(n=f2,r=EYe(n),r===lYe||r===sYe||r==="Kobo"||r==="Kindle Fire"||r===IYe?mk:r===_k||r===YQ||r===vk||r===x0e?"Console":r===uYe?"Wearable":r?B5:"Desktop"),$timezone:NYe(),$timezone_offset:Von()}),{$current_url:Kde(d2==null?void 0:d2.href,o,E0e),$host:d2==null?void 0:d2.host,$pathname:d2==null?void 0:d2.pathname,$raw_user_agent:f2.length>1e3?f2.substring(0,997)+"...":f2,$browser_version:zon(f2,navigator.vendor),$browser_language:MYe(),$browser_language_prefix:(t=MYe(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:$a==null?void 0:$a.screen.height,$screen_width:$a==null?void 0:$a.screen.width,$viewport_height:$a==null?void 0:$a.innerHeight,$viewport_width:$a==null?void 0:$a.innerWidth,$lib:"web",$lib_version:N4.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var mS=uC("[FeatureFlags]"),S0e="$active_feature_flags",VQ="$override_feature_flags",TYe="$feature_flag_payloads",Ik="$override_feature_flag_payloads",kYe="$feature_flag_request_id",PYe=i=>{var e={};for(var[t,n]of oV(i||{}))n&&(e[t]=n);return e},Kon=i=>{var e=i.flags;return e?(i.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),i.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):mS.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},Xon=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({});class qon{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Fde),t=this._instance.get_property(VQ),n=this._instance.get_property(Ik);if(!n&&!t)return e||{};var r=jI({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var a of o){var s,l,c=r[a],u=t==null?void 0:t[a],d=m0(u)?(s=c==null?void 0:c.enabled)!==null&&s!==void 0&&s:!!u,f=m0(u)?c.variant:typeof u=="string"?u:void 0,h=n==null?void 0:n[a],A=Mf({},c,{enabled:d,variant:d?f??(c==null?void 0:c.variant):void 0});d!==(c==null?void 0:c.enabled)&&(A.original_enabled=c==null?void 0:c.enabled),f!==(c==null?void 0:c.variant)&&(A.original_variant=c==null?void 0:c.variant),h&&(A.metadata=Mf({},c==null?void 0:c.metadata,{payload:h,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=A}return this.ge||(mS.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ge=!0),r}getFlagVariants(){var e=this._instance.get_property(kQ),t=this._instance.get_property(VQ);if(!t)return e||{};for(var n=jI({},e),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(mS.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ge=!0),n}getFlagPayloads(){var e=this._instance.get_property(TYe),t=this._instance.get_property(Ik);if(!t)return e||{};for(var n=jI({},e||{}),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(mS.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ge=!0),n}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t;if(this.xe(),!this._instance.I())if(this.me)this.ye=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Mf({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(ck)||{}),group_properties:this._instance.get_property(DM)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("api",o+a);r&&(n.timezone=NYe()),this.me=!0,this._instance.Ee({method:"POST",url:s,data:n,compression:this._instance.config.disable_compression?void 0:T4.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ye||(this.$anon_distinct_id=void 0),d=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie((u=l.json)!==null&&u!==void 0?u:{})),!n.disable_flags||this.ye)if(this.Se=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(Xon.FeatureFlags))mS.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var f;n.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},d),this.ye&&(this.ye=!1,this.ke())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(kYe)||void 0,a=this._instance.get_property(cV)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(r))){var s,l,c,u,d,f,h,A,m;tI(a[e])?a[e].push(r):a[e]=[r],(s=this._instance.persistence)==null||s.register({[cV]:a});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.Se};m0(_==null||(u=_.metadata)==null?void 0:u.version)||(v.$feature_flag_version=_.metadata.version);var x,I=(d=_==null||(f=_.reason)==null?void 0:f.description)!==null&&d!==void 0?d:_==null||(h=_.reason)==null?void 0:h.code;I&&(v.$feature_flag_reason=I),_!=null&&(A=_.metadata)!=null&&A.id&&(v.$feature_flag_id=_.metadata.id),m0(_==null?void 0:_.original_variant)&&m0(_==null?void 0:_.original_enabled)||(v.$feature_flag_original_response=m0(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(m=_.metadata)!=null&&m.original_payload&&(v.$feature_flag_original_payload=_==null||(x=_.metadata)==null?void 0:x.original_payload),this._instance.capture("$feature_flag_called",v)}return n}mS.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Ee({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:T4.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var o,a=(o=r.json)==null?void 0:o.featureFlagPayloads;t((a==null?void 0:a[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);mS.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this._e=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=Kon(a),f=d.flags,h=d.featureFlags,A=d.featureFlagPayloads;if(h){var m=a.requestId;if(tI(h)){mS.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(h)for(var v=0;v<h.length;v++)_[h[v]]=!0;s&&s.register({[S0e]:h,[kQ]:_})}else{var x=h,I=A,M=f;a.errorsWhileComputingFlags&&(x=Mf({},l,x),I=Mf({},c,I),M=Mf({},u,M)),s&&s.register(Mf({[S0e]:Object.keys(PYe(x)),[kQ]:x||{},[TYe]:I||{},[Fde]:M||{}},m?{[kYe]:m}:{}))}}})(e,this._instance.persistence,n,r,o),this.Pe(t)}}override(e,t){t===void 0&&(t=!1),mS.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return mS.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(VQ),this._instance.persistence.unregister(Ik),void this.Pe();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.ge=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(VQ);else if(n.flags)if(tI(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[VQ]:r})}else this._instance.persistence.register({[VQ]:n.flags})}return"payloads"in n&&(n.payloads===!1?this._instance.persistence.unregister(Ik):n.payloads&&this._instance.persistence.register({[Ik]:n.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:n}=this.Re();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this._instance.get_property(sV)||[]).find(l=>l.flagKey===e),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(a.$early_access_feature_name=r.name),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var s=Mf({},this.getFlagVariants(),{[e]:t});(n=this._instance.persistence)==null||n.register({[S0e]:Object.keys(PYe(s)),[kQ]:s}),this.Pe()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(sV),o=n?"&"+n.map(a=>"stage="+a).join("&"):"";if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s;if(a.json){var l=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.register({[sV]:l}),e(l)}}})}Re(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Pe(e){var{flags:t,flagVariants:n}=this.Re();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(ck)||{};this._instance.register({[ck]:Mf({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ck)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(DM)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=Mf({},n[r],e[r]),delete e[r]}),this._instance.register({[DM]:Mf({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(DM)||{};this._instance.register({[DM]:Mf({},t,{[e]:{}})})}else this._instance.unregister(DM)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}}var Jon=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class w0e{constructor(e,t){this.S=e,this.props={},this.Te=!1,this.Me=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.Ce(e),this.load(),e.debug&&Sh.info("Persistence loaded",e.persistence,Mf({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Fe}Ce(e){Jon.indexOf(e.persistence.toLowerCase())===-1&&(Sh.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&Db.O()?Db:t==="localstorage+cookie"&&_V.O()?_V:t==="sessionstorage"&&bC.O()?bC:t==="memory"?Brn:t==="cookie"?hS:_V.O()?_V:hS}properties(){var e={};return Zv(this.props,function(t,n){if(n===kQ&&QI(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else s=n,l=!1,(EB(a=lrn)?l:Lze&&a.indexOf===Lze?a.indexOf(s)!=-1:(Zv(a,function(c){if(l||(l=c===s))return iV}),l))||(e[n]=t);var a,s,l}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=jI({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(QI(e)){m0(t)&&(t="None"),this.Oe=m0(n)?this.Le:n;var r=!1;if(Zv(e,(o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=o,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(QI(e)){this.Oe=m0(t)?this.Le:t;var n=!1;if(Zv(e,(r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Te){var e=SYe(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);TQ(Dde(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=ih==null?void 0:ih.referrer)?BYe(e):{})}update_referrer_info(){var e;this.register_once({$referrer:RYe(),$referring_domain:ih!=null&&ih.referrer&&((e=LQ(ih.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[zde]||this.props[Hde]||this.register_once({[uV]:QYe(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Zv([Hde,zde],a=>{var s=this.props[a];s&&Zv(s,function(l,c){e["$initial_"+Rde(c)]=l})});var t,n,r=this.props[uV];if(r){var o=(t=DYe(r),n={},Zv(t,function(a,s){n["$initial_"+Rde(s)]=a}),n);jI(e,o)}return e}safe_merge(e){return Zv(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Le=this.Oe=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.Ce(e),o=this.props;this.clear(),this.B=r,this.props=o,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[sk]||{};n[e]=t,this.props[sk]=n,this.save()}remove_event_timer(e){var t=(this.props[sk]||{})[e];return m0(t)||(delete this.props[sk][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class LYe{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.je[e]||[])n(t);for(var r of this.je["*"]||[])r(e,t)}}class UM{constructor(e){this.Ne=new LYe,this.ze=(t,n)=>this.Ue(t,n)&&this.qe(t,n)&&this.Be(t,n),this.Ue=(t,n)=>n==null||!n.event||(t==null?void 0:t.event)===(n==null?void 0:n.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e;if(!m0((e=this._instance)==null?void 0:e.Ge)){var t;(t=this._instance)==null||t.Ge((n,r)=>{this.on(n,r)})}}register(e){var t,n;if(!m0((t=this._instance)==null?void 0:t.Ge)&&(e.forEach(a=>{var s,l;(s=this.We)==null||s.add(a),(l=a.steps)==null||l.forEach(c=>{var u;(u=this.He)==null||u.add((c==null?void 0:c.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach(a=>{var s;(s=a.steps)==null||s.forEach(l=>{l!=null&&l.selector&&o.add(l==null?void 0:l.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,t){var n;t!=null&&e.length!=0&&(this.He.has(e)||this.He.has(t==null?void 0:t.event))&&this.We&&((n=this.We)==null?void 0:n.size)>0&&this.We.forEach(r=>{this.Je(t,r)&&this.Ne.emit("actionCaptured",r.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var n of t.steps)if(this.ze(e,n))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!UM.Ke(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Ke(e,t,n){switch(n){case"regex":return!!$a&&GQ(e,t);case"exact":return t===e;case"contains":var r=UM.Ye(t).replace(/_/g,".").replace(/%/g,".*");return GQ(e,r);default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Xe(e).some(o=>!(t!=null&&t.href&&!UM.Ke(o.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||o.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!UM.Ke(o.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!UM.Ke(o.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var n,r=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Xe(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var dC=uC("[Surveys]"),B0e="seenSurvey_",Zon=(i,e)=>{var t="$survey_"+e+"/"+i.id;return i.current_iteration&&i.current_iteration>0&&(t="$survey_"+e+"/"+i.id+"/"+i.current_iteration),t};class Won{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;m0((t=this._instance)==null?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(e){var t=e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});t.length!==0&&(this.er==null&&(this.er=new UM(this._instance),this.er.init(),this.er.Ve(n=>{this.onAction(n)})),t.forEach(n=>{var r,o,a,s,l;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=n.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.er)==null||s.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Ze.get(c.name);u&&u.push(n.id),this.Ze.set(c.name,u||[n.id])}}))}))}tr(e){var t;e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((t=this._instance)==null||t.Ge((n,r)=>{this.onEvent(n,r)}),e.forEach(n=>{var r;(r=n.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(o=>{if(o&&o.name){var a=this.Qe.get(o.name);a&&a.push(n.id),this.Qe.set(o.name,a||[n.id])}})}))}onEvent(e,t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[lV])||[];if(e==="survey shown"&&t&&r.length>0){var o;dC.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var a=t==null||(o=t.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.rr(r))}}else this.Qe.has(e)&&(dC.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(r.concat(this.Qe.get(e)||[])))}onAction(e){var t,n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[lV])||[];this.Ze.has(e)&&this.rr(n.concat(this.Ze.get(e)||[]))}rr(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[lV]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[lV];return t||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class $on{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(tv(t))return dC.warn("Flags not loaded yet. Not loading surveys.");var n=tI(t);this.nr=n?t.length>0:t,dC.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(B0e)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this.ar)if(this.ur)dC.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)dC.info("Disabled. Not loading surveys.");else{var e=Fm==null?void 0:Fm.__PosthogExtensions__;if(e){var t=this.nr;if(!m0(t)){this.ur=!0;try{var n=e.generateSurveys;if(n)return void this.dr(n,t);var r=e.loadExternalDependency;if(!r)return void this.vr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",o=>{o||!e.generateSurveys?this.vr("Could not load surveys script",o):this.dr(e.generateSurveys,t)})}catch(o){throw this.vr("Error initializing surveys",o),o}finally{this.ur=!1}}}else dC.error("PostHog Extensions not found.")}}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new Won(this._instance),dC.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){dC.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return dC.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(Ude);if(n&&!t)return e(n,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.lr=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return dC.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter(d=>function(f){return!(!f.start_date||f.end_date)}(d)&&(function(f){var h;return!((h=f.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)}(d)||function(f){var h;return!((h=f.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)}(d)));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[Ude]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.lr=!1,r}}cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(n){dC.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!tv(this.ar))return this.ar.getActiveMatchingSurveys(e,t);dC.warn("init was not called")}pr(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(o=>o.id===e))!==null&&r!==void 0?r:null}),t}gr(e){if(tv(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(tv(this.ar))return dC.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return tv(this.ar)?(dC.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var o,a=(o=r.find(l=>l.id===e))!==null&&o!==void 0?o:null;if(a){var s=this.gr(a);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(tv(this.ar))dC.warn("init was not called");else{var n=this.pr(e),r=ih==null?void 0:ih.querySelector(t);n?r?this.ar.renderSurvey(n,r):dC.warn("Survey element not found"):dC.warn("Survey not found")}}}(function(i){return i.Button="button",i.Tab="tab",i.Selector="selector",i})({}),function(i){return i.TopLeft="top_left",i.TopRight="top_right",i.TopCenter="top_center",i.MiddleLeft="middle_left",i.MiddleRight="middle_right",i.MiddleCenter="middle_center",i.Left="left",i.Center="center",i.Right="right",i.NextToTrigger="next_to_trigger",i}({}),function(i){return i.Popover="popover",i.API="api",i.Widget="widget",i}({}),function(i){return i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link",i}({}),function(i){return i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question",i}({}),function(i){return i.Once="once",i.Recurring="recurring",i.Always="always",i}({});var M0e=function(i){return i.SHOWN="survey shown",i.DISMISSED="survey dismissed",i.SENT="survey sent",i}({}),FYe=function(i){return i.SURVEY_ID="$survey_id",i.SURVEY_NAME="$survey_name",i.SURVEY_RESPONSE="$survey_response",i.SURVEY_ITERATION="$survey_iteration",i.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",i.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",i.SURVEY_SUBMISSION_ID="$survey_submission_id",i.SURVEY_QUESTIONS="$survey_questions",i.SURVEY_COMPLETED="$survey_completed",i}({}),UYe=uC("[RateLimiter]");class ean{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(a=>{UYe.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void UYe.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(t=(n=this.instance.persistence)==null?void 0:n.get_property(Gde))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(Gde,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var OM=uC("[RemoteConfig]");class tan{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Fm._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}_r(e){var t,n;(t=Fm.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(OM.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return OM.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void OM.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return OM.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(t=>{this.Ie(t)});this.Ie(e)})}catch(e){OM.error("Error loading remote config",e)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):OM.info("__preview_remote_config is disabled. Logging config instead",e):OM.error("Failed to fetch remote config from PostHog.")}}var R0e=3e3;class nan{constructor(e,t){this.br=!0,this.yr=[],this.wr=Z2((t==null?void 0:t.flush_interval_ms)||R0e,250,5e3,"flush interval",R0e),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=this.yr.length>0?this.Ir():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.Sr(Mf({},n,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var t=this.Ir(),n=function(){var o=t[r],a=new Date().getTime();o.data&&tI(o.data)&&Zv(o.data,s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp}),e.Sr(o)};for(var r in t)n()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return Zv(this.yr,t=>{var n,r=t,o=(r?r.batchKey:null)||r.url;m0(e[o])&&(e[o]=Mf({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)}),this.yr=[],e}}var ian=["retriesPerformedSoFar"];class ran{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!m0($a)&&"onLine"in $a.navigator&&(this.Tr=$a.navigator.onLine,hI($a,"online",()=>{this.Tr=!0,this.se()}),hI($a,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Hze(e,ian);tE(t)&&t>0&&(n.url=RV(n.url,{retry_count:t})),this._instance.Ee(Mf({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Mr(Mf({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(r)}}))}Mr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(t),r=Date.now()+n;this.yr.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),Sh.warn(o),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],n=this.yr.filter(o=>o.retryAt<e||(t.push(o),!1));if(this.yr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(Mf({},e,{transport:"sendBeacon"}))}catch(t){Sh.error(t)}this.yr=[]}}class oan{constructor(e){this.Or=()=>{var t,n,r,o;this.Ar||(this.Ar={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.Ar.lastScrollY=Math.ceil(s),this.Ar.maxScrollY=Math.max(s,(t=this.Ar.maxScrollY)!==null&&t!==void 0?t:0),this.Ar.maxScrollHeight=Math.max(l,(n=this.Ar.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ar.lastContentY=c,this.Ar.maxContentY=Math.max(c,(r=this.Ar.maxContentY)!==null&&r!==void 0?r:0),this.Ar.maxContentHeight=Math.max(u,(o=this.Ar.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){hI($a,"scroll",this.Or,{capture:!0}),hI($a,"scrollend",this.Or,{capture:!0}),hI($a,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return $a==null?void 0:$a.document.documentElement;var e=tI(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=$a==null?void 0:$a.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return $a&&($a.scrollY||$a.pageYOffset||$a.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return $a&&($a.scrollX||$a.pageXOffset||$a.document.documentElement.scrollLeft)||0}}var aan=i=>QYe(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class san{constructor(e,t,n,r){this.Dr=o=>{var a=this.Lr();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.jr(this._instance)};this.Nr.register({[Ode]:s})}},this._instance=e,this.zr=t,this.Nr=n,this.jr=r||aan,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[Ode]}getSetOnceProps(){var e,t=(e=this.Lr())==null?void 0:e.props;return t?"r"in t?DYe(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Zv(Dde(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+Rde(n)]=t}),e}}var OYe=uC("[SessionId]");class lan{constructor(e,t,n){var r;if(this.Ur=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||BB,this.Br=n||BB;var o=this.S.persistence_name||this.S.token,a=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Z2(a,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+o+"_window_id",this.Gr="ph_"+o+"_primary_window_exists",this.Jr()){var s=bC.L(this.Wr),l=bC.L(this.Gr);s&&!l?this.fi=s:bC.N(this.Wr),bC.j(this.Gr,!0)}if((r=this.S.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Vr(this.S.bootstrap.sessionID,new Date().getTime(),c)}catch(u){OYe.error("Invalid sessionID in bootstrap",u)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return m0(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return this.S.persistence!=="memory"&&!this.Nr.Fe&&bC.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&bC.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?bC.L(this.Wr):null}Vr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[aV]:[t,e,n]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[aV];return tI(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){hI($a,"beforeunload",()=>{this.Jr()&&bC.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||new Date().getTime(),[r,o,a]=this.Qr(),s=this.Xr(),l=tE(a)&&a>0&&Math.abs(n-a)>864e5,c=!1,u=!o,d=!e&&Math.abs(n-r)>this.sessionTimeoutMs;u||d||l?(o=this.qr(),s=this.Br(),OYe.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=n,c=!0):s||(s=this.Br(),c=!0);var f=r===0||!e||l?n:r,h=a===0?new Date().getTime():a;return this.Yr(s),this.Vr(o,f,h),e||this.Hr(),c&&this.Ur.forEach(A=>A(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:o,windowId:s,sessionStartTimestamp:h,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var can=["$set_once","$set"],DB=uC("[SiteApps]");class uan{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=Fm._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,h]of Object.entries(d))c[f]={id:u[f],type:f,properties:h};var{$set_once:A,$set:m}=e;return{event:Mf({},Hze(e,can),{properties:Mf({},e.properties,m?{$set:Mf({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},m)}:{},A?{$set_once:Mf({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},A)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var s;!t.errored&&this.ts.length&&(DB.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((s=this.rs)==null||s.call(this))},r=!1,o=s=>{t.errored=!s,t.loaded=!0,DB.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(t.processEvent=a),r=!0}catch(s){DB.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&t.loaded)try{n()}catch(s){DB.error("Error while processing buffered events PostHog app with config id "+e.id,s),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){DB.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",c=>this.ns(c))):void DB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;Fm["__$$ph_site_app_"+c]=o._instance,(u=Fm.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,d=>{if(d)return DB.error("Error while initializing PostHog app with config id "+c,d)})};for(var{id:s,url:l}of e.siteApps)a(s)}else DB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var dan=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],GYe=function(i,e){if(!i)return!1;var t=i.toLowerCase();return dan.concat(e||[]).some(n=>{var r=n.toLowerCase();return t.indexOf(r)!==-1})},zYe=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&GYe(t,e))return!0;try{var n=i==null?void 0:i.userAgentData;if(n!=null&&n.brands&&n.brands.some(r=>GYe(r==null?void 0:r.brand,e)))return!0}catch{}return!!i.webdriver},bk=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),HYe="i.posthog.com";class fan{constructor(e){this.os={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+HYe,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=bk.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=bk.EU:this.os[this.apiHost]=bk.CUSTOM),this.os[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===bk.CUSTOM)return this.apiHost+t;var n=HYe+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var han={icontains:(i,e)=>!!$a&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!$a&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!$a&&GQ(e.href,i),not_regex:(i,e)=>!!$a&&!GQ(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class rE{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(r=>{rE.ls("retrieved web experiments from the server"),t.us=new Map,r.forEach(o=>{if(o.feature_flag_key){var a;t.us&&(rE.ls("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=t.us)==null||a.set(o.feature_flag_key,o));var s=t._instance.getFeatureFlag(o.feature_flag_key);DI(s)&&o.variants[s]&&t.hs(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];rE.ds(c)&&t.hs(o.name,l,c.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())rE.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(tv(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();rE.ls("applying feature flags",e),e.forEach(t=>{var n;if(this.us&&(n=this.us)!=null&&n.has(t)){var r,o=this._instance.getFeatureFlag(t),a=(r=this.us)==null?void 0:r.get(t);o&&a!=null&&a.variants[o]&&this.hs(a.name,o,a.variants[o].transforms)}})}}previewWebExperiment(){var e=rE.getWindowLocation();if(e!=null&&e.search){var t=gV(e==null?void 0:e.search,"__experiment_id"),n=gV(e==null?void 0:e.search,"__experiment_variant");t&&n&&(rE.ls("previewing web experiments "+t+" && "+n),this.getWebExperiments(r=>{this.vs(parseInt(t),n,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}vs(e,t,n){var r=n.filter(o=>o.id===e);r&&r.length>0&&(rE.ls("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.hs(r[0].name,t,r[0].variants[t].transforms))}static ds(e){return!tv(e.conditions)&&rE.cs(e)&&rE.fs(e)}static cs(e){var t;if(tv(e.conditions)||tv((t=e.conditions)==null?void 0:t.url))return!0;var n,r,o,a=rE.getWindowLocation();return!!a&&((n=e.conditions)==null||!n.url||han[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return $a==null?void 0:$a.location}static fs(e){var t;if(tv(e.conditions)||tv((t=e.conditions)==null?void 0:t.utm))return!0;var n=SYe();if(n.utm_source){var r,o,a,s,l,c,u,d,f=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,h=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==n.utm_source,A=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==n.utm_medium,m=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return f&&A&&m&&h}return!1}static ls(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Sh.info("[WebExperiments] "+e,n)}hs(e,t,n){this._is_bot()?rE.ls("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(r=>{if(r.selector){var o;rE.ls("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a==null||a.forEach(s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):rE.ls("Control variants leave the page unmodified.")}_is_bot(){return J2&&this._instance?zYe(J2,this._instance.config.custom_blocked_useragents):void 0}}var pan=uC("[PostHog ExternalIntegrations]"),Aan={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class gan{constructor(e){this._instance=e}J(e,t){var n;(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,r=>{if(r)return pan.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var s,l,c;!r||(s=Fm.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.J(Aan[a],()=>{var u;(u=Fm.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)}),!r&&(l=Fm.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=Fm.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;t(n)}}}var Ck={},Q0e=()=>{},jQ="posthog",YYe=!Mon&&(f2==null?void 0:f2.indexOf("MSIE"))===-1&&(f2==null?void 0:f2.indexOf("Mozilla"))===-1,VYe=i=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:srn(ih==null?void 0:ih.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Q0e,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:i!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:i??"unset",debug:d2&&DI(d2==null?void 0:d2.search)&&d2.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:($a==null||(e=$a.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Sh.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:R0e},error_tracking:{},_onCapture:Q0e}},jYe=i=>{var e={};m0(i.process_person)||(e.person_profiles=i.process_person),m0(i.xhr_headers)||(e.request_headers=i.xhr_headers),m0(i.cookie_name)||(e.persistence_name=i.cookie_name),m0(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),m0(i.store_google)||(e.save_campaign_params=i.store_google),m0(i.verbose)||(e.debug=i.verbose);var t=jI({},e,i);return tI(i.property_blacklist)&&(m0(i.property_denylist)?t.property_denylist=i.property_blacklist:tI(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:Sh.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class man{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){Sh.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class kV{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new man,this.gs=!1,this.version=N4.LIB_VERSION,this._s=new LYe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=VYe(),this.SentryIntegration=_on,this.sentryIntegration=e=>function(t,n){var r=eYe(t,n);return{name:$He,processEvent:o=>r(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new qon(this),this.toolbar=new xon(this),this.scrollManager=new oan(this),this.pageViewManager=new won(this),this.surveys=new $on(this),this.experiments=new rE(this),this.exceptions=new Don(this),this.rateLimiter=new ean(this),this.requestRouter=new fan(this),this.consent=new Mrn(this),this.externalIntegrations=new gan(this),this.people={set:(e,t,n)=>{var r=DI(e)?{[e]:t}:e;this.setPersonProperties(r),n==null||n({})},set_once:(e,t,n)=>{var r=DI(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n==null||n({})}},this.on("eventCaptured",e=>Sh.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==jQ){var r,o=(r=Ck[n])!==null&&r!==void 0?r:new kV;return o._init(e,t,n),Ck[n]=o,Ck[jQ][n]=o,o}return this._init(e,t,n)}_init(e,t,n){var r,o;if(t===void 0&&(t={}),m0(e)||Qde(e))return Sh.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return Sh.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(jI({},VYe(t.defaults),jYe(t),{name:n,token:e})),this.config.on_xhr_error&&Sh.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:T4.GZipJS;var a=this.xs();this.persistence=new w0e(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w0e(Mf({},this.config,{persistence:"sessionStorage"}),a);var s=Mf({},this.persistence.props),l=Mf({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.Es=new nan(x=>this.Is(x),this.config.request_queue_config),this.Ps=new ran(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new lan(this),this.sessionPropsManager=new san(this,this.sessionManager,this.persistence)),new bon(this).startIfEnabledOrStop(),this.siteApps=new uan(this),(r=this.siteApps)==null||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new mon(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new xrn(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Son(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Con(this),this.exceptionObserver=new Drn(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new CHe(this,Qrn),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new jrn(this),this.historyAutocapture.startIfEnabled(),N4.DEBUG=N4.DEBUG||this.config.debug,N4.DEBUG&&Sh.info("Starting in debug mode",{this:this,config:t,thisC:Mf({},this.config),p:s,s:l}),((o=t.bootstrap)==null?void 0:o.distinctID)!==void 0){var c,u,d=this.config.get_device_id(BB()),f=(c=t.bootstrap)!=null&&c.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(k4,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:f})}if(this.Rs()){var h,A,m=Object.keys(((h=t.bootstrap)==null?void 0:h.featureFlags)||{}).filter(x=>{var I;return!((I=t.bootstrap)==null||(I=I.featureFlags)==null||!I[x])}).reduce((x,I)=>{var M;return x[I]=((M=t.bootstrap)==null||(M=M.featureFlags)==null?void 0:M[I])||!1,x},{}),_=Object.keys(((A=t.bootstrap)==null?void 0:A.featureFlagPayloads)||{}).filter(x=>m[x]).reduce((x,I)=>{var M,G;return(M=t.bootstrap)!=null&&(M=M.featureFlagPayloads)!=null&&M[I]&&(x[I]=(G=t.bootstrap)==null||(G=G.featureFlagPayloads)==null?void 0:G[I]),x},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:fV,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(BB());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(k4,"anonymous")}return hI($a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?yon(this,()=>this.Ts()):this.Ts(),S5(this.config._onCapture)&&this.config._onCapture!==Q0e&&(Sh.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",x=>this.config._onCapture(x.event,x))),this.config.ip&&Sh.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ie(e){var t,n,r,o,a,s,l,c;if(!ih||!ih.body)return Sh.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=f1(e.supportedCompression,T4.GZipJS)?T4.GZipJS:f1(e.supportedCompression,T4.Base64)?T4.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Ts(){try{this.config.loaded(this)}catch(e){Sh.critical("`loaded` function failed",e)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new tan(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.Es)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||SB(this.__request_queue,e=>this.Is(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),(e=this.Es)==null||e.unload(),(t=this.Ps)==null||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(e){this.__loaded&&(YYe?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=RV(e.url,{ip:this.config.ip?1:0}),e.headers=Mf({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,r,o,a=Mf({},t);a.timeout=a.timeout||6e4,a.url=RV(a.url,{_:new Date().getTime().toString(),ver:N4.LIB_VERSION,compression:a.compression});var s=(n=a.transport)!==null&&n!==void 0?n:"fetch",l=(r=(o=Vze(gk,c=>c.transport===s))==null?void 0:o.method)!==null&&r!==void 0?r:gk[0].method;if(!l)throw new Error("No available transport method");l(a)})(Mf({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,t)),e.callback==null||e.callback(t)}}))))}Is(e){this.Ps?this.Ps.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,n=[],r=[],o=[];SB(e,s=>{s&&(t=s[0],tI(t)?o.push(s):S5(s)?s.call(this):tI(s)&&t==="alias"?n.push(s):tI(s)&&t.indexOf("capture")!==-1&&S5(this[t])?o.push(s):r.push(s))});var a=function(s,l){SB(s,function(c){if(tI(c[0])){var u=l;Zv(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};a(n,this),a(r,this),a(o,this)}Rs(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Es){if(!this.consent.isOptedOut())if(!m0(e)&&DI(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!DI(t==null?void 0:t.$current_url)&&(Sh.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,s=(n==null?void 0:n.timestamp)||a,l=BB(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},s,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n!=null&&n.$set&&(c.$set=n==null?void 0:n.$set);var u,d,f=this.Os(n==null?void 0:n.$set_once);if(f&&(c.$set_once=f),(c=orn(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,m0(n==null?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===M0e.DISMISSED||e===M0e.SENT){var h=t==null?void 0:t[FYe.SURVEY_ID],A=t==null?void 0:t[FYe.SURVEY_ITERATION];localStorage.setItem((d=""+B0e+(u={id:h,current_iteration:A}).id,u.current_iteration&&u.current_iteration>0&&(d=""+B0e+u.id+"_"+u.current_iteration),d),"true"),c.$set=Mf({},c.$set,{[Zon({id:h,current_iteration:A},e===M0e.SENT?"responded":"dismissed")]:!0})}var m=Mf({},c.properties.$set,c.$set);if(TQ(m)||this.setPersonPropertiesForFlags(m),!tv(this.config.before_send)){var _=this.As(c);if(!_)return;c=_}this._s.emit("eventCaptured",c);var v={method:"POST",url:(r=n==null?void 0:n._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Is(v):this.Es.enqueue(v),c}Sh.critical("This capture call is ignored due to client rate limiting.")}}else Sh.error("No event name provided to posthog.capture")}else Sh.uninitializedWarning("posthog.capture")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var a=o?void 0:this.persistence.remove_event_timer(e),s=Mf({},t);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=Mf({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!DI(s.distinct_id)&&!tE(s.distinct_id)||Qde(s.distinct_id))&&Sh.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=jon(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&jI(s,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&jI(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(h=this.Ps)==null?void 0:h.length}catch(v){s.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===bk.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=jI(s,c),e==="$pageview"&&ih&&(s.title=ih.title),!m0(a)){var A=n.getTime()-a;s.$duration=parseFloat((A/1e3).toFixed(3))}f2&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=jI({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),tI(this.config.property_denylist)?Zv(this.config.property_denylist,function(v){delete s[v]}):Sh.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Sh.error("sanitize_properties is deprecated. Use before_send instead"),s=m(s,e));var _=this.Ds();return s.$process_person_profile=_,_&&!o&&this.Ls("_calculate_event_properties"),s}Os(e){var t;if(!this.persistence||!this.Ds()||this.gs)return e;var n=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),o=jI({},n,r||{},e||{}),a=this.config.sanitize_properties;return a&&(Sh.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.gs=!0,TQ(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}js(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this._s.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Sh.uninitializedWarning("posthog.identify");if(tE(e)&&(e=e.toString(),Sh.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Sh.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==fV){if(this.Ls("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(ak)&&(this.unregister(ak),this.register({distinct_id:e}));var a=(this.persistence.get_property(k4)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(k4,"identified"),this.setPersonPropertiesForFlags(Mf({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ss=aYe(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(cV))}}else Sh.critical('The string "'+fV+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Sh.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ls("posthog.setPersonProperties")){var n=aYe(this.get_distinct_id(),e,t);this.Ss!==n?(this.setPersonPropertiesForFlags(Mf({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=n):Sh.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ls("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Mf({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else Sh.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,o;if(Sh.info("reset"),!this.__loaded)return Sh.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(k4,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:fV,$device_id:null},"");else{var s=this.config.get_device_id(BB());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(jze)?(Sh.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(m0(t)&&(t=this.get_distinct_id()),e!==t?(this.js(ak,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Sh.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=Mf({},this.config);if(QI(e)){var n,r,o,a,s;jI(this.config,jYe(e));var l=this.xs();(n=this.persistence)==null||n.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w0e(Mf({},this.config,{persistence:"sessionStorage"}),l),Db.O()&&Db.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(N4.DEBUG=!0,Sh.info("set_config",{config:e,oldConfig:t,newConfig:Mf({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ns(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),n.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),n.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(Mf({},Vrn((r=>r instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:jQ;return t!==jQ&&(t=jQ+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(k4))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(k4))==="identified"}Ds(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&TQ(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ak])&&((t=this.persistence)==null||(t=t.props)==null||!t[dV]))}Fs(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(e){return this.config.person_profiles==="never"?(Sh.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(dV,!0),!0)}xs(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Ns(){var e,t,n,r,o=this.xs();return((e=this.persistence)==null?void 0:e.Fe)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.Fe)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ns(),(m0(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ns()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ns()}_is_bot(){return J2?zYe(J2,this.config.custom_blocked_useragents):void 0}Cs(){ih&&(ih.visibilityState==="visible"?this.bs||(this.bs=!0,this.capture("$pageview",{title:ih.title},{send_instantly:!0}),this.ys&&(ih.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),hI(ih,"visibilitychange",this.ys)))}debug(e){e===!1?($a==null||$a.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):($a==null||$a.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,o,a,s,l=this.$s||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Sh.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",r=!1,o=Sh,a=(t="advanced_disable_flags")in(e=l)&&!m0(e[t]),s=n in e&&!m0(e[n]),a?e[t]:s?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):r)}As(e){if(tv(this.config.before_send))return e;var t=tI(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),tv(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return nrn(e.event)?Sh.warn(o+". This can cause unexpected behavior."):Sh.info(o),null}n.properties&&!TQ(n.properties)||Sh.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.ce)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=rrn(i.prototype[e[t]])})(kV,["identify"]);var KYe,PV=(KYe=Ck[jQ]=new kV,function(){function i(){i.done||(i.done=!0,YYe=!1,Zv(Ck,function(e){e._dom_loaded()}))}ih!=null&&ih.addEventListener?ih.readyState==="complete"?i():hI(ih,"DOMContentLoaded",i,{capture:!1}):$a&&Sh.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),KYe);!window.location.hostname.includes("localhost")&&!window.location.hostname.includes("127.0.0.1")&&(PV.__loaded||PV.init("phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",{api_host:"https://postpig.tscircuit.com",person_profiles:"always"}));function yan(i){const e=String.fromCodePoint(...i);return btoa(e)}var W2=Uint8Array,$2=Uint16Array,D0e=Int32Array,N0e=new W2([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),T0e=new W2([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),XYe=new W2([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qYe=function(i,e){for(var t=new $2(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var r=new D0e(t[30]),n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return{b:t,r}},JYe=qYe(N0e,2),_an=JYe.b,k0e=JYe.r;_an[28]=258,k0e[258]=28;for(var van=qYe(T0e,0),ZYe=van.r,P0e=new $2(32768),Xx=0;Xx<32768;++Xx){var NB=(Xx&43690)>>1|(Xx&21845)<<1;NB=(NB&52428)>>2|(NB&13107)<<2,NB=(NB&61680)>>4|(NB&3855)<<4,P0e[Xx]=((NB&65280)>>8|(NB&255)<<8)>>1}for(var Ek=function(i,e,t){for(var n=i.length,r=0,o=new $2(e);r<n;++r)i[r]&&++o[i[r]-1];var a=new $2(e);for(r=1;r<e;++r)a[r]=a[r-1]+o[r-1]<<1;var s;if(t){s=new $2(1<<e);var l=15-e;for(r=0;r<n;++r)if(i[r])for(var c=r<<4|i[r],u=e-i[r],d=a[i[r]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[P0e[d]>>l]=c}else for(s=new $2(n),r=0;r<n;++r)i[r]&&(s[r]=P0e[a[i[r]-1]++]>>15-i[r]);return s},GM=new W2(288),Xx=0;Xx<144;++Xx)GM[Xx]=8;for(var Xx=144;Xx<256;++Xx)GM[Xx]=9;for(var Xx=256;Xx<280;++Xx)GM[Xx]=7;for(var Xx=280;Xx<288;++Xx)GM[Xx]=8;for(var LV=new W2(32),Xx=0;Xx<32;++Xx)LV[Xx]=5;var xan=Ek(GM,9,0),Ian=Ek(LV,5,0),WYe=function(i){return(i+7)/8|0},$Ye=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new W2(i.subarray(e,t))},F4=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},Sk=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},L0e=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return{t:iVe,l:0};if(r==1){var a=new W2(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(G,k){return G.f-k.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],c=0,u=1,d=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=t[t[c].f<t[d].f?c++:d++],l=t[c!=u&&t[c].f<t[d].f?c++:d++],t[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var f=o[0].s,n=1;n<r;++n)o[n].s>f&&(f=o[n].s);var h=new $2(f+1),A=F0e(t[u-1],h,0);if(A>e){var n=0,m=0,_=A-e,v=1<<_;for(o.sort(function(k,L){return h[L.s]-h[k.s]||k.f-L.f});n<r;++n){var x=o[n].s;if(h[x]>e)m+=v-(1<<A-h[x]),h[x]=e;else break}for(m>>=_;m>0;){var I=o[n].s;h[I]<e?m-=1<<e-h[I]++-1:++n}for(;n>=0&&m;--n){var M=o[n].s;h[M]==e&&(--h[M],++m)}A=e}return{t:new W2(h),l:A}},F0e=function(i,e,t){return i.s==-1?Math.max(F0e(i.l,e,t+1),F0e(i.r,e,t+1)):e[i.s]=t},eVe=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new $2(++e),n=0,r=i[0],o=1,a=function(l){t[n++]=l},s=1;s<=e;++s)if(i[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=i[s]}return{c:t.subarray(0,n),n:e}},wk=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},tVe=function(i,e,t){var n=t.length,r=WYe(e+2);i[r]=n&255,i[r+1]=n>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var o=0;o<n;++o)i[r+o+4]=t[o];return(r+4+n)*8},nVe=function(i,e,t,n,r,o,a,s,l,c,u){F4(e,u++,t),++r[256];for(var d=L0e(r,15),f=d.t,h=d.l,A=L0e(o,15),m=A.t,_=A.l,v=eVe(f),x=v.c,I=v.n,M=eVe(m),G=M.c,k=M.n,L=new $2(19),R=0;R<x.length;++R)++L[x[R]&31];for(var R=0;R<G.length;++R)++L[G[R]&31];for(var U=L0e(L,7),D=U.t,Z=U.l,Y=19;Y>4&&!D[XYe[Y-1]];--Y);var W=c+5<<3,ce=wk(r,GM)+wk(o,LV)+a,he=wk(r,f)+wk(o,m)+a+14+3*Y+wk(L,D)+2*L[16]+3*L[17]+7*L[18];if(l>=0&&W<=ce&&W<=he)return tVe(e,u,i.subarray(l,l+c));var ae,ve,ge,Me;if(F4(e,u,1+(he<ce)),u+=2,he<ce){ae=Ek(f,h,0),ve=f,ge=Ek(m,_,0),Me=m;var De=Ek(D,Z,0);F4(e,u,I-257),F4(e,u+5,k-1),F4(e,u+10,Y-4),u+=14;for(var R=0;R<Y;++R)F4(e,u+3*R,D[XYe[R]]);u+=3*Y;for(var Te=[x,G],Be=0;Be<2;++Be)for(var ze=Te[Be],R=0;R<ze.length;++R){var et=ze[R]&31;F4(e,u,De[et]),u+=D[et],et>15&&(F4(e,u,ze[R]>>5&127),u+=ze[R]>>12)}}else ae=xan,ve=GM,ge=Ian,Me=LV;for(var R=0;R<s;++R){var lt=n[R];if(lt>255){var et=lt>>18&31;Sk(e,u,ae[et+257]),u+=ve[et+257],et>7&&(F4(e,u,lt>>23&31),u+=N0e[et]);var At=lt&31;Sk(e,u,ge[At]),u+=Me[At],At>3&&(Sk(e,u,lt>>5&8191),u+=T0e[At])}else Sk(e,u,ae[lt]),u+=ve[lt]}return Sk(e,u,ae[256]),u+ve[256]},ban=new D0e([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iVe=new W2(0),Can=function(i,e,t,n,r,o){var a=o.z||i.length,s=new W2(n+a+5*(1+Math.ceil(a/7e3))+r),l=s.subarray(n,s.length-r),c=o.l,u=(o.r||0)&7;if(e){u&&(l[0]=o.r>>3);for(var d=ban[e-1],f=d>>13,h=d&8191,A=(1<<t)-1,m=o.p||new $2(32768),_=o.h||new $2(A+1),v=Math.ceil(t/3),x=2*v,I=function(It){return(i[It]^i[It+1]<<v^i[It+2]<<x)&A},M=new D0e(25e3),G=new $2(288),k=new $2(32),L=0,R=0,U=o.i||0,D=0,Z=o.w||0,Y=0;U+2<a;++U){var W=I(U),ce=U&32767,he=_[W];if(m[ce]=he,_[W]=ce,Z<=U){var ae=a-U;if((L>7e3||D>24576)&&(ae>423||!c)){u=nVe(i,l,0,M,G,k,R,D,Y,U-Y,u),D=L=R=0,Y=U;for(var ve=0;ve<286;++ve)G[ve]=0;for(var ve=0;ve<30;++ve)k[ve]=0}var ge=2,Me=0,De=h,Te=ce-he&32767;if(ae>2&&W==I(U-Te))for(var Be=Math.min(f,ae)-1,ze=Math.min(32767,U),et=Math.min(258,ae);Te<=ze&&--De&&ce!=he;){if(i[U+ge]==i[U+ge-Te]){for(var lt=0;lt<et&&i[U+lt]==i[U+lt-Te];++lt);if(lt>ge){if(ge=lt,Me=Te,lt>Be)break;for(var At=Math.min(Te,lt-2),Pt=0,ve=0;ve<At;++ve){var yt=U-Te+ve&32767,Qe=m[yt],Ke=yt-Qe&32767;Ke>Pt&&(Pt=Ke,he=yt)}}}ce=he,he=m[ce],Te+=ce-he&32767}if(Me){M[D++]=268435456|k0e[ge]<<18|ZYe[Me];var We=k0e[ge]&31,_t=ZYe[Me]&31;R+=N0e[We]+T0e[_t],++G[257+We],++k[_t],Z=U+ge,++L}else M[D++]=i[U],++G[i[U]]}}for(U=Math.max(U,Z);U<a;++U)M[D++]=i[U],++G[i[U]];u=nVe(i,l,c,M,G,k,R,D,Y,U-Y,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=_,o.p=m,o.i=U,o.w=Z)}else{for(var U=o.w||0;U<a+c;U+=65535){var Bt=U+65535;Bt>=a&&(l[u/8|0]=c,Bt=a),u=tVe(l,u+1,i.subarray(U,Bt))}o.i=a}return $Ye(s,0,n+WYe(u)+r)},Ean=function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i}(),San=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Ean[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},wan=function(i,e,t,n,r){if(!r&&(r={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new W2(o.length+i.length);a.set(o),a.set(i,o.length),i=a,r.w=o.length}return Can(i,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,r)},U0e=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},Ban=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&U0e(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},Man=function(i){return 10+(i.filename?i.filename.length+1:0)};function rVe(i,e){e||(e={});var t=San(),n=i.length;t.p(i);var r=wan(i,e,Man(e),8),o=r.length;return Ban(r,e),U0e(r,o-8,t.d()),U0e(r,o-4,n),r}var oVe=typeof TextEncoder<"u"&&new TextEncoder,Ran=typeof TextDecoder<"u"&&new TextDecoder,Qan=0;try{Ran.decode(iVe,{stream:!0}),Qan=1}catch{}function aVe(i,e){var t;if(oVe)return oVe.encode(i);for(var n=i.length,r=new W2(i.length+(i.length>>1)),o=0,a=function(c){r[o++]=c},t=0;t<n;++t){if(o+5>r.length){var s=new W2(o+8+(n-t<<1));s.set(r),r=s}var l=i.charCodeAt(t);l<128||e?a(l):l<2048?(a(192|l>>6),a(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|i.charCodeAt(++t)&1023,a(240|l>>18),a(128|l>>12&63),a(128|l>>6&63),a(128|l&63)):(a(224|l>>12),a(128|l>>6&63),a(128|l&63))}return $Ye(r,0,o)}function Dan(i,e){const t=JSON.stringify(i),n=rVe(aVe(t)),r=yan(n);return`${window.location.origin}/editor?#data:application/gzip;base64,${r}`}function $A(...i){return Zin(dS(i))}const sVe=i=>i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),O0e=vin,FV=mt.forwardRef(({className:i,...e},t)=>st.jsx(Cze,{ref:t,className:$A("rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400",i),...e}));FV.displayName=Cze.displayName;const yS=mt.forwardRef(({className:i,...e},t)=>st.jsx(Eze,{ref:t,className:$A("rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",i),...e}));yS.displayName=Eze.displayName;const M5=mt.forwardRef(({className:i,...e},t)=>st.jsx(Sze,{ref:t,className:$A("rf-h-full rf-mt-2 rf-ring-offset-white focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300",i),...e}));M5.displayName=Sze.displayName;/**
1005
+ `)).length,r=0;r<n;r++){var a=i.charCodeAt(r),s=null;a<128?t++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),EB(s)||(t>e&&(o+=i.substring(e,t)),o+=s,e=t=r+1)}return t>e&&(o+=i.substring(e,i.length)),o},Mon=!!Bde||!!wde,oYe="text/plain",RV=(i,e)=>{var[t,n]=i.split("?"),r=Mf({},e);n==null||n.split("&").forEach(a=>{var[s]=a.split("=");delete r[s]});var o=mrn(r);return t+"?"+(o=o?(n?n+"&":"")+o:n)},Ak=(i,e)=>JSON.stringify(i,(t,n)=>typeof n=="bigint"?n.toString():n,e),g0e=i=>{var{data:e,compression:t}=i;if(e){if(t===T4.GZipJS){var n=jHe(KHe(Ak(e)),{mtime:0}),r=new Blob([n],{type:oYe});return{contentType:oYe,body:r,estimatedSize:r.size}}if(t===T4.Base64){var o=function(l){var c,u,d,f,h,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,_=0,v="",x=[];if(!l)return l;l=Bon(l);do c=(h=l.charCodeAt(m++)<<16|l.charCodeAt(m++)<<8|l.charCodeAt(m++))>>18&63,u=h>>12&63,d=h>>6&63,f=63&h,x[_++]=A.charAt(c)+A.charAt(u)+A.charAt(d)+A.charAt(f);while(m<l.length);switch(v=x.join(""),l.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(Ak(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ak(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var s=Ak(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},gk=[];wde&&gk.push({transport:"fetch",method:i=>{var e,t,{contentType:n,body:r,estimatedSize:o}=(e=g0e(i))!==null&&e!==void 0?e:{},a=new Headers;Zv(i.headers,function(u,d){a.append(d,u)}),n&&a.append("Content-Type",n);var s=i.url,l=null;if(Fze){var c=new Fze;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),i.timeout)}}wde(s,Mf({method:(i==null?void 0:i.method)||"GET",headers:a,keepalive:i.method==="POST"&&(o||0)<52428.8,body:r,signal:(t=l)==null?void 0:t.signal},i.fetchOptions)).then(u=>u.text().then(d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(h){Sh.error(h)}i.callback==null||i.callback(f)})).catch(u=>{Sh.error(u),i.callback==null||i.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),Bde&&gk.push({transport:"XHR",method:i=>{var e,t=new Bde;t.open(i.method||"GET",i.url,!0);var{contentType:n,body:r}=(e=g0e(i))!==null&&e!==void 0?e:{};Zv(i.headers,function(o,a){t.setRequestHeader(a,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(r)}}),J2!=null&&J2.sendBeacon&&gk.push({transport:"sendBeacon",method:i=>{var e=RV(i.url,{beacon:"1"});try{var t,{contentType:n,body:r}=(t=g0e(i))!==null&&t!==void 0?t:{},o=typeof r=="string"?new Blob([r],{type:n}):r;J2.sendBeacon(e,o)}catch{}}});var GQ=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function aYe(i,e,t){return Ak({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Ron={exact:(i,e)=>e.some(t=>i.some(n=>t===n)),is_not:(i,e)=>e.every(t=>i.every(n=>t!==n)),regex:(i,e)=>e.some(t=>i.some(n=>GQ(t,n))),not_regex:(i,e)=>e.every(t=>i.every(n=>!GQ(t,n))),icontains:(i,e)=>e.map(QV).some(t=>i.map(QV).some(n=>t.includes(n))),not_icontains:(i,e)=>e.map(QV).every(t=>i.map(QV).every(n=>!t.includes(n)))},QV=i=>i.toLowerCase(),Qon=uC("[Error tracking]");class Don{constructor(e){var t,n;this.fe=[],this._instance=e,this.fe=(t=(n=this._instance.persistence)==null?void 0:n.get_property(Tde))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[];this.fe=r,this._instance.persistence&&this._instance.persistence.register({[Tde]:this.fe})}sendExceptionEvent(e){if(!this.pe(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Qon.info("Skipping exception capture because a suppression rule matched")}pe(e){var t=e.$exception_list;if(!t||!tI(t)||t.length===0)return!1;var n=t.reduce((r,o)=>{var{type:a,value:s}=o;return DI(a)&&a.length>0&&r.$exception_types.push(a),DI(s)&&s.length>0&&r.$exception_values.push(s),r},{$exception_types:[],$exception_values:[]});return this.fe.some(r=>{var o=r.values.map(a=>{var s,l=Ron[a.operator],c=tI(a.value)?a.value:[a.value],u=(s=n[a.key])!==null&&s!==void 0?s:[];return c.length>0&&l(c,u)});return r.type==="OR"?o.some(Boolean):o.every(Boolean)})}}var B5="Mobile",DV="iOS",gS="Android",mk="Tablet",sYe=gS+" "+mk,lYe="iPad",cYe="Apple",uYe=cYe+" Watch",yk="Safari",zQ="BlackBerry",dYe="Samsung",fYe=dYe+"Browser",hYe=dYe+" Internet",FM="Chrome",Non=FM+" OS",pYe=FM+" "+DV,m0e="Internet Explorer",AYe=m0e+" "+B5,y0e="Opera",Ton=y0e+" Mini",_0e="Edge",gYe="Microsoft "+_0e,HQ="Firefox",mYe=HQ+" "+DV,_k="Nintendo",vk="PlayStation",YQ="Xbox",yYe=gS+" "+B5,_Ye=B5+" "+yk,xk="Windows",v0e=xk+" Phone",vYe="Nokia",x0e="Ouya",xYe="Generic",kon=xYe+" "+B5.toLowerCase(),IYe=xYe+" "+mk.toLowerCase(),I0e="Konqueror",RE="(\\d+(\\.\\d+)?)",b0e=new RegExp("Version/"+RE),Pon=new RegExp(YQ,"i"),Lon=new RegExp(vk+" \\w+","i"),Fon=new RegExp(_k+" \\w+","i"),C0e=new RegExp(zQ+"|PlayBook|BB10","i"),Uon={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Oon=(i,e)=>e&&f1(e,cYe)||function(t){return f1(t,yk)&&!f1(t,FM)&&!f1(t,gS)}(i),bYe=function(i,e){return e=e||"",f1(i," OPR/")&&f1(i,"Mini")?Ton:f1(i," OPR/")?y0e:C0e.test(i)?zQ:f1(i,"IE"+B5)||f1(i,"WPDesktop")?AYe:f1(i,fYe)?hYe:f1(i,_0e)||f1(i,"Edg/")?gYe:f1(i,"FBIOS")?"Facebook "+B5:f1(i,"UCWEB")||f1(i,"UCBrowser")?"UC Browser":f1(i,"CriOS")?pYe:f1(i,"CrMo")||f1(i,FM)?FM:f1(i,gS)&&f1(i,yk)?yYe:f1(i,"FxiOS")?mYe:f1(i.toLowerCase(),I0e.toLowerCase())?I0e:Oon(i,e)?f1(i,B5)?_Ye:yk:f1(i,HQ)?HQ:f1(i,"MSIE")||f1(i,"Trident/")?m0e:f1(i,"Gecko")?HQ:""},Gon={[AYe]:[new RegExp("rv:"+RE)],[gYe]:[new RegExp(_0e+"?\\/"+RE)],[FM]:[new RegExp("("+FM+"|CrMo)\\/"+RE)],[pYe]:[new RegExp("CriOS\\/"+RE)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+RE)],[yk]:[b0e],[_Ye]:[b0e],[y0e]:[new RegExp("(Opera|OPR)\\/"+RE)],[HQ]:[new RegExp(HQ+"\\/"+RE)],[mYe]:[new RegExp("FxiOS\\/"+RE)],[I0e]:[new RegExp("Konqueror[:/]?"+RE,"i")],[zQ]:[new RegExp(zQ+" "+RE),b0e],[yYe]:[new RegExp("android\\s"+RE,"i")],[hYe]:[new RegExp(fYe+"\\/"+RE)],[m0e]:[new RegExp("(rv:|MSIE )"+RE)],Mozilla:[new RegExp("rv:"+RE)]},zon=function(i,e){var t=bYe(i,e),n=Gon[t];if(m0(n))return null;for(var r=0;r<n.length;r++){var o=n[r],a=i.match(o);if(a)return parseFloat(a[a.length-2])}return null},CYe=[[new RegExp(YQ+"; "+YQ+" (.*?)[);]","i"),i=>[YQ,i&&i[1]||""]],[new RegExp(_k,"i"),[_k,""]],[new RegExp(vk,"i"),[vk,""]],[C0e,[zQ,""]],[new RegExp(xk,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[v0e,""];if(new RegExp(B5).test(e)&&!/IEMobile\b/.test(e))return[xk+" "+B5,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var n=t[1],r=Uon[n]||"";return/arm/i.test(e)&&(r="RT"),[xk,r]}return[xk,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>{if(i&&i[3]){var e=[i[3],i[4],i[5]||"0"];return[DV,e.join(".")]}return[DV,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=m0(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+gS+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+gS+")","i"),i=>{if(i&&i[2]){var e=[i[2],i[3],i[4]||"0"];return[gS,e.join(".")]}return[gS,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];if(i&&i[1]){var t=[i[1],i[2],i[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Non,""]],[/Linux|debian/i,["Linux",""]]],EYe=function(i){return Fon.test(i)?_k:Lon.test(i)?vk:Pon.test(i)?YQ:new RegExp(x0e,"i").test(i)?x0e:new RegExp("("+v0e+"|WPDesktop)","i").test(i)?v0e:/iPad/.test(i)?lYe:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?uYe:C0e.test(i)?zQ:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(vYe,"i").test(i)?vYe:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?!new RegExp(B5).test(i)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)?/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?gS:sYe:gS:new RegExp("(pda|"+B5+")","i").test(i)?kon:new RegExp(mk,"i").test(i)&&!new RegExp(mk+" pc","i").test(i)?IYe:""},NV="https?://(.*)",TV=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Hon=rV(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],TV),E0e="<masked>",Yon=["li_fat_id"];function SYe(i,e,t){if(!ih)return{};var n,r=e?rV([],TV,t||[]):[],o=wYe(Kde(ih.URL,r,E0e),i),a=(n={},Zv(Yon,function(s){var l=hS.D(s);n[s]=l||null}),n);return jI(a,o)}function wYe(i,e){var t=Hon.concat(e||[]),n={};return Zv(t,function(r){var o=gV(i,r);n[r]=o||null}),n}function BYe(i){var e=function(o){return o?o.search(NV+"google.([^/?]*)")===0?"google":o.search(NV+"bing.com")===0?"bing":o.search(NV+"yahoo.com")===0?"yahoo":o.search(NV+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",n={};if(!EB(e)){n.$search_engine=e;var r=ih?gV(ih.referrer,t):"";r.length&&(n.ph_keyword=r)}return n}function MYe(){return navigator.language||navigator.userLanguage}function RYe(){return(ih==null?void 0:ih.referrer)||"$direct"}function QYe(i,e){var t=i?rV([],TV,e||[]):[],n=d2==null?void 0:d2.href.substring(0,1e3);return{r:RYe().substring(0,1e3),u:n?Kde(n,t,E0e):void 0}}function DYe(i){var e,{r:t,u:n}=i,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=LQ(t))==null?void 0:e.host};if(n){r.$current_url=n;var o=LQ(n);r.$host=o==null?void 0:o.host,r.$pathname=o==null?void 0:o.pathname;var a=wYe(n);jI(r,a)}if(t){var s=BYe(t);jI(r,s)}return r}function NYe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Von(){try{return new Date().getTimezoneOffset()}catch{return}}function jon(i,e){if(!f2)return{};var t,n,r,o=i?rV([],TV,e||[]):[],[a,s]=function(l){for(var c=0;c<CYe.length;c++){var[u,d]=CYe[c],f=u.exec(l),h=f&&(S5(d)?d(f,l):d);if(h)return h}return["",""]}(f2);return jI(Dde({$os:a,$os_version:s,$browser:bYe(f2,navigator.vendor),$device:EYe(f2),$device_type:(n=f2,r=EYe(n),r===lYe||r===sYe||r==="Kobo"||r==="Kindle Fire"||r===IYe?mk:r===_k||r===YQ||r===vk||r===x0e?"Console":r===uYe?"Wearable":r?B5:"Desktop"),$timezone:NYe(),$timezone_offset:Von()}),{$current_url:Kde(d2==null?void 0:d2.href,o,E0e),$host:d2==null?void 0:d2.host,$pathname:d2==null?void 0:d2.pathname,$raw_user_agent:f2.length>1e3?f2.substring(0,997)+"...":f2,$browser_version:zon(f2,navigator.vendor),$browser_language:MYe(),$browser_language_prefix:(t=MYe(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:$a==null?void 0:$a.screen.height,$screen_width:$a==null?void 0:$a.screen.width,$viewport_height:$a==null?void 0:$a.innerHeight,$viewport_width:$a==null?void 0:$a.innerWidth,$lib:"web",$lib_version:N4.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var mS=uC("[FeatureFlags]"),S0e="$active_feature_flags",VQ="$override_feature_flags",TYe="$feature_flag_payloads",Ik="$override_feature_flag_payloads",kYe="$feature_flag_request_id",PYe=i=>{var e={};for(var[t,n]of oV(i||{}))n&&(e[t]=n);return e},Kon=i=>{var e=i.flags;return e?(i.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var n;return[t,(n=e[t].variant)!==null&&n!==void 0?n:e[t].enabled]})),i.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var n;return(n=e[t].metadata)==null?void 0:n.payload}).map(t=>{var n;return[t,(n=e[t].metadata)==null?void 0:n.payload]}))):mS.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),i},Xon=function(i){return i.FeatureFlags="feature_flags",i.Recordings="recordings",i}({});class qon{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Fde),t=this._instance.get_property(VQ),n=this._instance.get_property(Ik);if(!n&&!t)return e||{};var r=jI({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var a of o){var s,l,c=r[a],u=t==null?void 0:t[a],d=m0(u)?(s=c==null?void 0:c.enabled)!==null&&s!==void 0&&s:!!u,f=m0(u)?c.variant:typeof u=="string"?u:void 0,h=n==null?void 0:n[a],A=Mf({},c,{enabled:d,variant:d?f??(c==null?void 0:c.variant):void 0});d!==(c==null?void 0:c.enabled)&&(A.original_enabled=c==null?void 0:c.enabled),f!==(c==null?void 0:c.variant)&&(A.original_variant=c==null?void 0:c.variant),h&&(A.metadata=Mf({},c==null?void 0:c.metadata,{payload:h,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=A}return this.ge||(mS.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ge=!0),r}getFlagVariants(){var e=this._instance.get_property(kQ),t=this._instance.get_property(VQ);if(!t)return e||{};for(var n=jI({},e),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(mS.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ge=!0),n}getFlagPayloads(){var e=this._instance.get_property(TYe),t=this._instance.get_property(Ik);if(!t)return e||{};for(var n=jI({},e||{}),r=Object.keys(t),o=0;o<r.length;o++)n[r[o]]=t[r[o]];return this.ge||(mS.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ge=!0),n}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t;if(this.xe(),!this._instance.I())if(this.me)this.ye=!0;else{var n={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Mf({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(ck)||{}),group_properties:this._instance.get_property(DM)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0);var r=this._instance.config.__preview_remote_config,o=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",s=this._instance.requestRouter.endpointFor("api",o+a);r&&(n.timezone=NYe()),this.me=!0,this._instance.Ee({method:"POST",url:s,data:n,compression:this._instance.config.disable_compression?void 0:T4.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(l.statusCode===200&&(this.ye||(this.$anon_distinct_id=void 0),d=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie((u=l.json)!==null&&u!==void 0?u:{})),!n.disable_flags||this.ye)if(this.Se=!d,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(Xon.FeatureFlags))mS.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var f;n.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},d),this.ye&&(this.ye=!1,this.ke())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],r=""+n,o=this._instance.get_property(kYe)||void 0,a=this._instance.get_property(cV)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(r))){var s,l,c,u,d,f,h,A,m;tI(a[e])?a[e].push(r):a[e]=[r],(s=this._instance.persistence)==null||s.register({[cV]:a});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.Se};m0(_==null||(u=_.metadata)==null?void 0:u.version)||(v.$feature_flag_version=_.metadata.version);var x,I=(d=_==null||(f=_.reason)==null?void 0:f.description)!==null&&d!==void 0?d:_==null||(h=_.reason)==null?void 0:h.code;I&&(v.$feature_flag_reason=I),_!=null&&(A=_.metadata)!=null&&A.id&&(v.$feature_flag_id=_.metadata.id),m0(_==null?void 0:_.original_variant)&&m0(_==null?void 0:_.original_enabled)||(v.$feature_flag_original_response=m0(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(m=_.metadata)!=null&&m.original_payload&&(v.$feature_flag_original_payload=_==null||(x=_.metadata)==null?void 0:x.original_payload),this._instance.capture("$feature_flag_called",v)}return n}mS.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var n=this._instance.config.token;this._instance.Ee({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:n},compression:this._instance.config.disable_compression?void 0:T4.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var o,a=(o=r.json)==null?void 0:o.featureFlagPayloads;t((a==null?void 0:a[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);mS.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this._e=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,s,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var d=Kon(a),f=d.flags,h=d.featureFlags,A=d.featureFlagPayloads;if(h){var m=a.requestId;if(tI(h)){mS.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(h)for(var v=0;v<h.length;v++)_[h[v]]=!0;s&&s.register({[S0e]:h,[kQ]:_})}else{var x=h,I=A,M=f;a.errorsWhileComputingFlags&&(x=Mf({},l,x),I=Mf({},c,I),M=Mf({},u,M)),s&&s.register(Mf({[S0e]:Object.keys(PYe(x)),[kQ]:x||{},[TYe]:I||{},[Fde]:M||{}},m?{[kYe]:m}:{}))}}})(e,this._instance.persistence,n,r,o),this.Pe(t)}}override(e,t){t===void 0&&(t=!1),mS.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return mS.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(VQ),this._instance.persistence.unregister(Ik),void this.Pe();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.ge=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(VQ);else if(n.flags)if(tI(n.flags)){for(var r={},o=0;o<n.flags.length;o++)r[n.flags[o]]=!0;this._instance.persistence.register({[VQ]:r})}else this._instance.persistence.register({[VQ]:n.flags})}return"payloads"in n&&(n.payloads===!1?this._instance.persistence.unregister(Ik):n.payloads&&this._instance.persistence.register({[Ik]:n.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:n}=this.Re();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this._instance.get_property(sV)||[]).find(l=>l.flagKey===e),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(a.$early_access_feature_name=r.name),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var s=Mf({},this.getFlagVariants(),{[e]:t});(n=this._instance.persistence)==null||n.register({[S0e]:Object.keys(PYe(s)),[kQ]:s}),this.Pe()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(sV),o=n?"&"+n.map(a=>"stage="+a).join("&"):"";if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:a=>{var s;if(a.json){var l=a.json.earlyAccessFeatures;return(s=this._instance.persistence)==null||s.register({[sV]:l}),e(l)}}})}Re(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Pe(e){var{flags:t,flagVariants:n}=this.Re();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(ck)||{};this._instance.register({[ck]:Mf({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ck)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(DM)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=Mf({},n[r],e[r]),delete e[r]}),this._instance.register({[DM]:Mf({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(DM)||{};this._instance.register({[DM]:Mf({},t,{[e]:{}})})}else this._instance.unregister(DM)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}}var Jon=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class w0e{constructor(e,t){this.S=e,this.props={},this.Te=!1,this.Me=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.Ce(e),this.load(),e.debug&&Sh.info("Persistence loaded",e.persistence,Mf({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Fe}Ce(e){Jon.indexOf(e.persistence.toLowerCase())===-1&&(Sh.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&Db.O()?Db:t==="localstorage+cookie"&&_V.O()?_V:t==="sessionstorage"&&bC.O()?bC:t==="memory"?Brn:t==="cookie"?hS:_V.O()?_V:hS}properties(){var e={};return Zv(this.props,function(t,n){if(n===kQ&&QI(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/"+r[o]]=t[r[o]];else s=n,l=!1,(EB(a=lrn)?l:Lze&&a.indexOf===Lze?a.indexOf(s)!=-1:(Zv(a,function(c){if(l||(l=c===s))return iV}),l))||(e[n]=t);var a,s,l}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=jI({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(QI(e)){m0(t)&&(t="None"),this.Oe=m0(n)?this.Le:n;var r=!1;if(Zv(e,(o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=o,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(QI(e)){this.Oe=m0(t)?this.Le:t;var n=!1;if(Zv(e,(r,o)=>{e.hasOwnProperty(o)&&this.props[o]!==r&&(this.props[o]=r,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Te){var e=SYe(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);TQ(Dde(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=ih==null?void 0:ih.referrer)?BYe(e):{})}update_referrer_info(){var e;this.register_once({$referrer:RYe(),$referring_domain:ih!=null&&ih.referrer&&((e=LQ(ih.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[zde]||this.props[Hde]||this.register_once({[uV]:QYe(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};Zv([Hde,zde],a=>{var s=this.props[a];s&&Zv(s,function(l,c){e["$initial_"+Rde(c)]=l})});var t,n,r=this.props[uV];if(r){var o=(t=DYe(r),n={},Zv(t,function(a,s){n["$initial_"+Rde(s)]=a}),n);jI(e,o)}return e}safe_merge(e){return Zv(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t,n){if(this.Le=this.Oe=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.Ce(e),o=this.props;this.clear(),this.B=r,this.props=o,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[sk]||{};n[e]=t,this.props[sk]=n,this.save()}remove_event_timer(e){var t=(this.props[sk]||{})[e];return m0(t)||(delete this.props[sk][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class LYe{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(n=>n!==t)}}emit(e,t){for(var n of this.je[e]||[])n(t);for(var r of this.je["*"]||[])r(e,t)}}class UM{constructor(e){this.Ne=new LYe,this.ze=(t,n)=>this.Ue(t,n)&&this.qe(t,n)&&this.Be(t,n),this.Ue=(t,n)=>n==null||!n.event||(t==null?void 0:t.event)===(n==null?void 0:n.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e;if(!m0((e=this._instance)==null?void 0:e.Ge)){var t;(t=this._instance)==null||t.Ge((n,r)=>{this.on(n,r)})}}register(e){var t,n;if(!m0((t=this._instance)==null?void 0:t.Ge)&&(e.forEach(a=>{var s,l;(s=this.We)==null||s.add(a),(l=a.steps)==null||l.forEach(c=>{var u;(u=this.He)==null||u.add((c==null?void 0:c.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var r,o=new Set;e.forEach(a=>{var s;(s=a.steps)==null||s.forEach(l=>{l!=null&&l.selector&&o.add(l==null?void 0:l.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(o)}}on(e,t){var n;t!=null&&e.length!=0&&(this.He.has(e)||this.He.has(t==null?void 0:t.event))&&this.We&&((n=this.We)==null?void 0:n.size)>0&&this.We.forEach(r=>{this.Je(t,r)&&this.Ne.emit("actionCaptured",r.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var n of t.steps)if(this.ze(e,n))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!="string"||!UM.Ke(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Ke(e,t,n){switch(n){case"regex":return!!$a&&GQ(e,t);case"exact":return t===e;case"contains":var r=UM.Ye(t).replace(/_/g,".").replace(/%/g,".*");return GQ(e,r);default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Xe(e).some(o=>!(t!=null&&t.href&&!UM.Ke(o.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||o.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!UM.Ke(o.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!UM.Ke(o.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var n,r=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Xe(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var dC=uC("[Surveys]"),B0e="seenSurvey_",Zon=(i,e)=>{var t="$survey_"+e+"/"+i.id;return i.current_iteration&&i.current_iteration>0&&(t="$survey_"+e+"/"+i.id+"/"+i.current_iteration),t};class Won{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;m0((t=this._instance)==null?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(e){var t=e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});t.length!==0&&(this.er==null&&(this.er=new UM(this._instance),this.er.init(),this.er.Ve(n=>{this.onAction(n)})),t.forEach(n=>{var r,o,a,s,l;n.conditions&&(r=n.conditions)!=null&&r.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((a=n.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((s=this.er)==null||s.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Ze.get(c.name);u&&u.push(n.id),this.Ze.set(c.name,u||[n.id])}}))}))}tr(e){var t;e.filter(n=>{var r,o;return((r=n.conditions)==null?void 0:r.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((t=this._instance)==null||t.Ge((n,r)=>{this.onEvent(n,r)}),e.forEach(n=>{var r;(r=n.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(o=>{if(o&&o.name){var a=this.Qe.get(o.name);a&&a.push(n.id),this.Qe.set(o.name,a||[n.id])}})}))}onEvent(e,t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[lV])||[];if(e==="survey shown"&&t&&r.length>0){var o;dC.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var a=t==null||(o=t.properties)==null?void 0:o.$survey_id;if(a){var s=r.indexOf(a);s>=0&&(r.splice(s,1),this.rr(r))}}else this.Qe.has(e)&&(dC.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(r.concat(this.Qe.get(e)||[])))}onAction(e){var t,n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[lV])||[];this.Ze.has(e)&&this.rr(n.concat(this.Ze.get(e)||[]))}rr(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[lV]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[lV];return t||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class $on{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(tv(t))return dC.warn("Flags not loaded yet. Not loading surveys.");var n=tI(t);this.nr=n?t.length>0:t,dC.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(B0e)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this.ar)if(this.ur)dC.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)dC.info("Disabled. Not loading surveys.");else{var e=Fm==null?void 0:Fm.__PosthogExtensions__;if(e){var t=this.nr;if(!m0(t)){this.ur=!0;try{var n=e.generateSurveys;if(n)return void this.dr(n,t);var r=e.loadExternalDependency;if(!r)return void this.vr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",o=>{o||!e.generateSurveys?this.vr("Could not load surveys script",o):this.dr(e.generateSurveys,t)})}catch(o){throw this.vr("Error initializing surveys",o),o}finally{this.ur=!1}}}else dC.error("PostHog Extensions not found.")}}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new Won(this._instance),dC.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){dC.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return dC.info("Disabled. Not loading surveys."),e([]);var n=this._instance.get_property(Ude);if(n&&!t)return e(n,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var o;this.lr=!1;var a=r.statusCode;if(a!==200||!r.json){var s="Surveys API could not be loaded, status: "+a;return dC.error(s),e([],{isLoaded:!1,error:s})}var l,c=r.json.surveys||[],u=c.filter(d=>function(f){return!(!f.start_date||f.end_date)}(d)&&(function(f){var h;return!((h=f.conditions)==null||(h=h.events)==null||(h=h.values)==null||!h.length)}(d)||function(f){var h;return!((h=f.conditions)==null||(h=h.actions)==null||(h=h.values)==null||!h.length)}(d)));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[Ude]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.lr=!1,r}}cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(n){dC.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!tv(this.ar))return this.ar.getActiveMatchingSurveys(e,t);dC.warn("init was not called")}pr(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(o=>o.id===e))!==null&&r!==void 0?r:null}),t}gr(e){if(tv(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(tv(this.ar))return dC.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return tv(this.ar)?(dC.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var o,a=(o=r.find(l=>l.id===e))!==null&&o!==void 0?o:null;if(a){var s=this.gr(a);n({visible:s.eligible,disabledReason:s.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(tv(this.ar))dC.warn("init was not called");else{var n=this.pr(e),r=ih==null?void 0:ih.querySelector(t);n?r?this.ar.renderSurvey(n,r):dC.warn("Survey element not found"):dC.warn("Survey not found")}}}(function(i){return i.Button="button",i.Tab="tab",i.Selector="selector",i})({}),function(i){return i.TopLeft="top_left",i.TopRight="top_right",i.TopCenter="top_center",i.MiddleLeft="middle_left",i.MiddleRight="middle_right",i.MiddleCenter="middle_center",i.Left="left",i.Center="center",i.Right="right",i.NextToTrigger="next_to_trigger",i}({}),function(i){return i.Popover="popover",i.API="api",i.Widget="widget",i}({}),function(i){return i.Open="open",i.MultipleChoice="multiple_choice",i.SingleChoice="single_choice",i.Rating="rating",i.Link="link",i}({}),function(i){return i.NextQuestion="next_question",i.End="end",i.ResponseBased="response_based",i.SpecificQuestion="specific_question",i}({}),function(i){return i.Once="once",i.Recurring="recurring",i.Always="always",i}({});var M0e=function(i){return i.SHOWN="survey shown",i.DISMISSED="survey dismissed",i.SENT="survey sent",i}({}),FYe=function(i){return i.SURVEY_ID="$survey_id",i.SURVEY_NAME="$survey_name",i.SURVEY_RESPONSE="$survey_response",i.SURVEY_ITERATION="$survey_iteration",i.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",i.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",i.SURVEY_SUBMISSION_ID="$survey_submission_id",i.SURVEY_QUESTIONS="$survey_questions",i.SURVEY_COMPLETED="$survey_completed",i}({}),UYe=uC("[RateLimiter]");class ean{constructor(e){var t,n;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var o=r.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(a=>{UYe.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void UYe.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=e.config.rate_limiting)==null?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,n,r;e===void 0&&(e=!1);var o=new Date().getTime(),a=(t=(n=this.instance.persistence)==null?void 0:n.get_property(Gde))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var s=a.tokens<1;return s||e||(a.tokens=Math.max(0,a.tokens-1)),!s||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,(r=this.instance.persistence)==null||r.set_property(Gde,a),{isRateLimited:s,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var OM=uC("[RemoteConfig]");class tan{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Fm._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}_r(e){var t,n;(t=Fm.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(OM.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return OM.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void OM.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return OM.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(t=>{this.Ie(t)});this.Ie(e)})}catch(e){OM.error("Error loading remote config",e)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):OM.info("__preview_remote_config is disabled. Logging config instead",e):OM.error("Failed to fetch remote config from PostHog.")}}var R0e=3e3;class nan{constructor(e,t){this.br=!0,this.yr=[],this.wr=Z2((t==null?void 0:t.flush_interval_ms)||R0e,250,5e3,"flush interval",R0e),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=this.yr.length>0?this.Ir():{},t=Object.values(e);[...t.filter(n=>n.url.indexOf("/e")===0),...t.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.Sr(Mf({},n,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var t=this.Ir(),n=function(){var o=t[r],a=new Date().getTime();o.data&&tI(o.data)&&Zv(o.data,s=>{s.offset=Math.abs(s.timestamp-a),delete s.timestamp}),e.Sr(o)};for(var r in t)n()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return Zv(this.yr,t=>{var n,r=t,o=(r?r.batchKey:null)||r.url;m0(e[o])&&(e[o]=Mf({},r,{data:[]})),(n=e[o].data)==null||n.push(r.data)}),this.yr=[],e}}var ian=["retriesPerformedSoFar"];class ran{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!m0($a)&&"onLine"in $a.navigator&&(this.Tr=$a.navigator.onLine,hI($a,"online",()=>{this.Tr=!0,this.se()}),hI($a,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Hze(e,ian);tE(t)&&t>0&&(n.url=RV(n.url,{retry_count:t})),this._instance.Ee(Mf({},n,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Mr(Mf({retriesPerformedSoFar:t},n)):n.callback==null||n.callback(r)}}))}Mr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(a){var s=3e3*Math.pow(2,a),l=s/2,c=Math.min(18e5,s),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(t),r=Date.now()+n;this.yr.push({retryAt:r,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),Sh.warn(o),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],n=this.yr.filter(o=>o.retryAt<e||(t.push(o),!1));if(this.yr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(Mf({},e,{transport:"sendBeacon"}))}catch(t){Sh.error(t)}this.yr=[]}}class oan{constructor(e){this.Or=()=>{var t,n,r,o;this.Ar||(this.Ar={});var a=this.scrollElement(),s=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=s+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.Ar.lastScrollY=Math.ceil(s),this.Ar.maxScrollY=Math.max(s,(t=this.Ar.maxScrollY)!==null&&t!==void 0?t:0),this.Ar.maxScrollHeight=Math.max(l,(n=this.Ar.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ar.lastContentY=c,this.Ar.maxContentY=Math.max(c,(r=this.Ar.maxContentY)!==null&&r!==void 0?r:0),this.Ar.maxContentHeight=Math.max(u,(o=this.Ar.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){hI($a,"scroll",this.Or,{capture:!0}),hI($a,"scrollend",this.Or,{capture:!0}),hI($a,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return $a==null?void 0:$a.document.documentElement;var e=tI(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var n=$a==null?void 0:$a.document.querySelector(t);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return $a&&($a.scrollY||$a.pageYOffset||$a.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return $a&&($a.scrollX||$a.pageXOffset||$a.document.documentElement.scrollLeft)||0}}var aan=i=>QYe(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties);class san{constructor(e,t,n,r){this.Dr=o=>{var a=this.Lr();if(!a||a.sessionId!==o){var s={sessionId:o,props:this.jr(this._instance)};this.Nr.register({[Ode]:s})}},this._instance=e,this.zr=t,this.Nr=n,this.jr=r||aan,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[Ode]}getSetOnceProps(){var e,t=(e=this.Lr())==null?void 0:e.props;return t?"r"in t?DYe(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Zv(Dde(this.getSetOnceProps()),(t,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+Rde(n)]=t}),e}}var OYe=uC("[SessionId]");class lan{constructor(e,t,n){var r;if(this.Ur=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||BB,this.Br=n||BB;var o=this.S.persistence_name||this.S.token,a=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Z2(a,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+o+"_window_id",this.Gr="ph_"+o+"_primary_window_exists",this.Jr()){var s=bC.L(this.Wr),l=bC.L(this.Gr);s&&!l?this.fi=s:bC.N(this.Wr),bC.j(this.Gr,!0)}if((r=this.S.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Vr(this.S.bootstrap.sessionID,new Date().getTime(),c)}catch(u){OYe.error("Invalid sessionID in bootstrap",u)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return m0(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return this.S.persistence!=="memory"&&!this.Nr.Fe&&bC.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&bC.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?bC.L(this.Wr):null}Vr(e,t,n){e===this.Ct&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[aV]:[t,e,n]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[aV];return tI(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){hI($a,"beforeunload",()=>{this.Jr()&&bC.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||new Date().getTime(),[r,o,a]=this.Qr(),s=this.Xr(),l=tE(a)&&a>0&&Math.abs(n-a)>864e5,c=!1,u=!o,d=!e&&Math.abs(n-r)>this.sessionTimeoutMs;u||d||l?(o=this.qr(),s=this.Br(),OYe.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),a=n,c=!0):s||(s=this.Br(),c=!0);var f=r===0||!e||l?n:r,h=a===0?new Date().getTime():a;return this.Yr(s),this.Vr(o,f,h),e||this.Hr(),c&&this.Ur.forEach(A=>A(o,s,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:o,windowId:s,sessionStartTimestamp:h,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var can=["$set_once","$set"],DB=uC("[SiteApps]");class uan{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=Fm._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,o,a,s,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[f,h]of Object.entries(d))c[f]={id:u[f],type:f,properties:h};var{$set_once:A,$set:m}=e;return{event:Mf({},Hze(e,can),{properties:Mf({},e.properties,m?{$set:Mf({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},m)}:{},A?{$set_once:Mf({},(r=(o=e.properties)==null?void 0:o.$set_once)!==null&&r!==void 0?r:{},A)}:{}),elements_chain:(a=(s=e.properties)==null?void 0:s.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var s;!t.errored&&this.ts.length&&(DB.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((s=this.rs)==null||s.call(this))},r=!1,o=s=>{t.errored=!s,t.loaded=!0,DB.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:s=>{o(s)}});a&&(t.processEvent=a),r=!0}catch(s){DB.error("Error while initializing PostHog app with config id "+e.id,s),o(!1)}if(r&&t.loaded)try{n()}catch(s){DB.error("Error while processing buffered events PostHog app with config id "+e.id,s),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){DB.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,o=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",c=>this.ns(c))):void DB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;Fm["__$$ph_site_app_"+c]=o._instance,(u=Fm.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,d=>{if(d)return DB.error("Error while initializing PostHog app with config id "+c,d)})};for(var{id:s,url:l}of e.siteApps)a(s)}else DB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var dan=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],GYe=function(i,e){if(!i)return!1;var t=i.toLowerCase();return dan.concat(e||[]).some(n=>{var r=n.toLowerCase();return t.indexOf(r)!==-1})},zYe=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&GYe(t,e))return!0;try{var n=i==null?void 0:i.userAgentData;if(n!=null&&n.brands&&n.brands.some(r=>GYe(r==null?void 0:r.brand,e)))return!0}catch{}return!!i.webdriver},bk=function(i){return i.US="us",i.EU="eu",i.CUSTOM="custom",i}({}),HYe="i.posthog.com";class fan{constructor(e){this.os={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+HYe,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=bk.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=bk.EU:this.os[this.apiHost]=bk.CUSTOM),this.os[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===bk.CUSTOM)return this.apiHost+t;var n=HYe+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}var han={icontains:(i,e)=>!!$a&&e.href.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>!!$a&&e.href.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>!!$a&&GQ(e.href,i),not_regex:(i,e)=>!!$a&&!GQ(e.href,i),exact:(i,e)=>e.href===i,is_not:(i,e)=>e.href!==i};class rE{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),t.getWebExperiments(r=>{rE.ls("retrieved web experiments from the server"),t.us=new Map,r.forEach(o=>{if(o.feature_flag_key){var a;t.us&&(rE.ls("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=t.us)==null||a.set(o.feature_flag_key,o));var s=t._instance.getFeatureFlag(o.feature_flag_key);DI(s)&&o.variants[s]&&t.hs(o.name,s,o.variants[s].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];rE.ds(c)&&t.hs(o.name,l,c.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}onFeatureFlags(e){if(this._is_bot())rE.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(tv(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();rE.ls("applying feature flags",e),e.forEach(t=>{var n;if(this.us&&(n=this.us)!=null&&n.has(t)){var r,o=this._instance.getFeatureFlag(t),a=(r=this.us)==null?void 0:r.get(t);o&&a!=null&&a.variants[o]&&this.hs(a.name,o,a.variants[o].transforms)}})}}previewWebExperiment(){var e=rE.getWindowLocation();if(e!=null&&e.search){var t=gV(e==null?void 0:e.search,"__experiment_id"),n=gV(e==null?void 0:e.search,"__experiment_variant");t&&n&&(rE.ls("previewing web experiments "+t+" && "+n),this.getWebExperiments(r=>{this.vs(parseInt(t),n,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var a=o.json.experiments||[];return e(a)}})}vs(e,t,n){var r=n.filter(o=>o.id===e);r&&r.length>0&&(rE.ls("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.hs(r[0].name,t,r[0].variants[t].transforms))}static ds(e){return!tv(e.conditions)&&rE.cs(e)&&rE.fs(e)}static cs(e){var t;if(tv(e.conditions)||tv((t=e.conditions)==null?void 0:t.url))return!0;var n,r,o,a=rE.getWindowLocation();return!!a&&((n=e.conditions)==null||!n.url||han[(r=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return $a==null?void 0:$a.location}static fs(e){var t;if(tv(e.conditions)||tv((t=e.conditions)==null?void 0:t.utm))return!0;var n=SYe();if(n.utm_source){var r,o,a,s,l,c,u,d,f=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,h=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_source)==n.utm_source,A=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==n.utm_medium,m=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return f&&A&&m&&h}return!1}static ls(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Sh.info("[WebExperiments] "+e,n)}hs(e,t,n){this._is_bot()?rE.ls("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?n.forEach(r=>{if(r.selector){var o;rE.ls("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(o=document)==null?void 0:o.querySelectorAll(r.selector);a==null||a.forEach(s=>{var l=s;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):rE.ls("Control variants leave the page unmodified.")}_is_bot(){return J2&&this._instance?zYe(J2,this._instance.config.custom_blocked_useragents):void 0}}var pan=uC("[PostHog ExternalIntegrations]"),Aan={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class gan{constructor(e){this._instance=e}J(e,t){var n;(n=Fm.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,r=>{if(r)return pan.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var s,l,c;!r||(s=Fm.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[a]||e.J(Aan[a],()=>{var u;(u=Fm.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)}),!r&&(l=Fm.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=Fm.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[n,r]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;t(n)}}}var Ck={},Q0e=()=>{},jQ="posthog",YYe=!Mon&&(f2==null?void 0:f2.indexOf("MSIE"))===-1&&(f2==null?void 0:f2.indexOf("Mozilla"))===-1,VYe=i=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:srn(ih==null?void 0:ih.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Q0e,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:i!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:i??"unset",debug:d2&&DI(d2==null?void 0:d2.search)&&d2.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:($a==null||(e=$a.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;Sh.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:R0e},error_tracking:{},_onCapture:Q0e}},jYe=i=>{var e={};m0(i.process_person)||(e.person_profiles=i.process_person),m0(i.xhr_headers)||(e.request_headers=i.xhr_headers),m0(i.cookie_name)||(e.persistence_name=i.cookie_name),m0(i.disable_cookie)||(e.disable_persistence=i.disable_cookie),m0(i.store_google)||(e.save_campaign_params=i.store_google),m0(i.verbose)||(e.debug=i.verbose);var t=jI({},e,i);return tI(i.property_blacklist)&&(m0(i.property_denylist)?t.property_denylist=i.property_blacklist:tI(i.property_denylist)?t.property_denylist=[...i.property_blacklist,...i.property_denylist]:Sh.error("Invalid value for property_denylist config: "+i.property_denylist)),t};class man{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){Sh.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class kV{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new man,this.gs=!1,this.version=N4.LIB_VERSION,this._s=new LYe,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=VYe(),this.SentryIntegration=_on,this.sentryIntegration=e=>function(t,n){var r=eYe(t,n);return{name:$He,processEvent:o=>r(o)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new qon(this),this.toolbar=new xon(this),this.scrollManager=new oan(this),this.pageViewManager=new won(this),this.surveys=new $on(this),this.experiments=new rE(this),this.exceptions=new Don(this),this.rateLimiter=new ean(this),this.requestRouter=new fan(this),this.consent=new Mrn(this),this.externalIntegrations=new gan(this),this.people={set:(e,t,n)=>{var r=DI(e)?{[e]:t}:e;this.setPersonProperties(r),n==null||n({})},set_once:(e,t,n)=>{var r=DI(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n==null||n({})}},this.on("eventCaptured",e=>Sh.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,n){if(n&&n!==jQ){var r,o=(r=Ck[n])!==null&&r!==void 0?r:new kV;return o._init(e,t,n),Ck[n]=o,Ck[jQ][n]=o,o}return this._init(e,t,n)}_init(e,t,n){var r,o;if(t===void 0&&(t={}),m0(e)||Qde(e))return Sh.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return Sh.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(jI({},VYe(t.defaults),jYe(t),{name:n,token:e})),this.config.on_xhr_error&&Sh.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:T4.GZipJS;var a=this.xs();this.persistence=new w0e(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w0e(Mf({},this.config,{persistence:"sessionStorage"}),a);var s=Mf({},this.persistence.props),l=Mf({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.Es=new nan(x=>this.Is(x),this.config.request_queue_config),this.Ps=new ran(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new lan(this),this.sessionPropsManager=new san(this,this.sessionManager,this.persistence)),new bon(this).startIfEnabledOrStop(),this.siteApps=new uan(this),(r=this.siteApps)==null||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new mon(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new xrn(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Son(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Con(this),this.exceptionObserver=new Drn(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new CHe(this,Qrn),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new jrn(this),this.historyAutocapture.startIfEnabled(),N4.DEBUG=N4.DEBUG||this.config.debug,N4.DEBUG&&Sh.info("Starting in debug mode",{this:this,config:t,thisC:Mf({},this.config),p:s,s:l}),((o=t.bootstrap)==null?void 0:o.distinctID)!==void 0){var c,u,d=this.config.get_device_id(BB()),f=(c=t.bootstrap)!=null&&c.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(k4,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:f})}if(this.Rs()){var h,A,m=Object.keys(((h=t.bootstrap)==null?void 0:h.featureFlags)||{}).filter(x=>{var I;return!((I=t.bootstrap)==null||(I=I.featureFlags)==null||!I[x])}).reduce((x,I)=>{var M;return x[I]=((M=t.bootstrap)==null||(M=M.featureFlags)==null?void 0:M[I])||!1,x},{}),_=Object.keys(((A=t.bootstrap)==null?void 0:A.featureFlagPayloads)||{}).filter(x=>m[x]).reduce((x,I)=>{var M,G;return(M=t.bootstrap)!=null&&(M=M.featureFlagPayloads)!=null&&M[I]&&(x[I]=(G=t.bootstrap)==null||(G=G.featureFlagPayloads)==null?void 0:G[I]),x},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:fV,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(BB());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(k4,"anonymous")}return hI($a,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?yon(this,()=>this.Ts()):this.Ts(),S5(this.config._onCapture)&&this.config._onCapture!==Q0e&&(Sh.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",x=>this.config._onCapture(x.event,x))),this.config.ip&&Sh.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ie(e){var t,n,r,o,a,s,l,c;if(!ih||!ih.body)return Sh.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=f1(e.supportedCompression,T4.GZipJS)?T4.GZipJS:f1(e.supportedCompression,T4.Base64)?T4.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(s=this.webVitalsAutocapture)==null||s.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Ts(){try{this.config.loaded(this)}catch(e){Sh.critical("`loaded` function failed",e)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new tan(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.Es)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||SB(this.__request_queue,e=>this.Is(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),(e=this.Es)==null||e.unload(),(t=this.Ps)==null||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(e){this.__loaded&&(YYe?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=RV(e.url,{ip:this.config.ip?1:0}),e.headers=Mf({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var n,r,o,a=Mf({},t);a.timeout=a.timeout||6e4,a.url=RV(a.url,{_:new Date().getTime().toString(),ver:N4.LIB_VERSION,compression:a.compression});var s=(n=a.transport)!==null&&n!==void 0?n:"fetch",l=(r=(o=Vze(gk,c=>c.transport===s))==null?void 0:o.method)!==null&&r!==void 0?r:gk[0].method;if(!l)throw new Error("No available transport method");l(a)})(Mf({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((n=(r=this.config).on_request_error)==null||n.call(r,t)),e.callback==null||e.callback(t)}}))))}Is(e){this.Ps?this.Ps.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,n=[],r=[],o=[];SB(e,s=>{s&&(t=s[0],tI(t)?o.push(s):S5(s)?s.call(this):tI(s)&&t==="alias"?n.push(s):tI(s)&&t.indexOf("capture")!==-1&&S5(this[t])?o.push(s):r.push(s))});var a=function(s,l){SB(s,function(c){if(tI(c[0])){var u=l;Zv(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};a(n,this),a(r,this),a(o,this)}Rs(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Es){if(!this.consent.isOptedOut())if(!m0(e)&&DI(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){t!=null&&t.$current_url&&!DI(t==null?void 0:t.$current_url)&&(Sh.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,s=(n==null?void 0:n.timestamp)||a,l=BB(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},s,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),n!=null&&n.$set&&(c.$set=n==null?void 0:n.$set);var u,d,f=this.Os(n==null?void 0:n.$set_once);if(f&&(c.$set_once=f),(c=orn(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,m0(n==null?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===M0e.DISMISSED||e===M0e.SENT){var h=t==null?void 0:t[FYe.SURVEY_ID],A=t==null?void 0:t[FYe.SURVEY_ITERATION];localStorage.setItem((d=""+B0e+(u={id:h,current_iteration:A}).id,u.current_iteration&&u.current_iteration>0&&(d=""+B0e+u.id+"_"+u.current_iteration),d),"true"),c.$set=Mf({},c.$set,{[Zon({id:h,current_iteration:A},e===M0e.SENT?"responded":"dismissed")]:!0})}var m=Mf({},c.properties.$set,c.$set);if(TQ(m)||this.setPersonPropertiesForFlags(m),!tv(this.config.before_send)){var _=this.As(c);if(!_)return;c=_}this._s.emit("eventCaptured",c);var v={method:"POST",url:(r=n==null?void 0:n._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Is(v):this.Es.enqueue(v),c}Sh.critical("This capture call is ignored due to client rate limiting.")}}else Sh.error("No event name provided to posthog.capture")}else Sh.uninitializedWarning("posthog.capture")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,n,r,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var a=o?void 0:this.persistence.remove_event_timer(e),s=Mf({},t);if(s.token=this.config.token,s.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),e==="$snapshot"){var l=Mf({},this.persistence.properties(),this.sessionPersistence.properties());return s.distinct_id=l.distinct_id,(!DI(s.distinct_id)&&!tE(s.distinct_id)||Qde(s.distinct_id))&&Sh.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var c,u=jon(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());s.$session_id=d,s.$window_id=f}this.sessionPropsManager&&jI(s,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&jI(s,this.sessionRecording.sdkDebugProperties),s.$sdk_debug_retry_queue_size=(h=this.Ps)==null?void 0:h.length}catch(v){s.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===bk.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),s=jI(s,c),e==="$pageview"&&ih&&(s.title=ih.title),!m0(a)){var A=n.getTime()-a;s.$duration=parseFloat((A/1e3).toFixed(3))}f2&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=jI({},u,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),tI(this.config.property_denylist)?Zv(this.config.property_denylist,function(v){delete s[v]}):Sh.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Sh.error("sanitize_properties is deprecated. Use before_send instead"),s=m(s,e));var _=this.Ds();return s.$process_person_profile=_,_&&!o&&this.Ls("_calculate_event_properties"),s}Os(e){var t;if(!this.persistence||!this.Ds()||this.gs)return e;var n=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),o=jI({},n,r||{},e||{}),a=this.config.sanitize_properties;return a&&(Sh.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this.gs=!0,TQ(o)?void 0:o}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}js(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,n)}on(e,t){return this._s.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,n){if(!this.__loaded||!this.persistence)return Sh.uninitializedWarning("posthog.identify");if(tE(e)&&(e=e.toString(),Sh.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Sh.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==fV){if(this.Ls("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(ak)&&(this.unregister(ak),this.register({distinct_id:e}));var a=(this.persistence.get_property(k4)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(k4,"identified"),this.setPersonPropertiesForFlags(Mf({},n||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ss=aYe(e,t,n),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(cV))}}else Sh.critical('The string "'+fV+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Sh.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ls("posthog.setPersonProperties")){var n=aYe(this.get_distinct_id(),e,t);this.Ss!==n?(this.setPersonPropertiesForFlags(Mf({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=n):Sh.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,n){if(e&&t){if(this.Ls("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Mf({},r,{[e]:t})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else Sh.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,o;if(Sh.info("reset"),!this.__loaded)return Sh.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(k4,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:fV,$device_id:null},"");else{var s=this.config.get_device_id(BB());this.register_once({distinct_id:s,$device_id:e?s:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&n){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(jze)?(Sh.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(m0(t)&&(t=this.get_distinct_id()),e!==t?(this.js(ak,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Sh.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=Mf({},this.config);if(QI(e)){var n,r,o,a,s;jI(this.config,jYe(e));var l=this.xs();(n=this.persistence)==null||n.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new w0e(Mf({},this.config,{persistence:"sessionStorage"}),l),Db.O()&&Db.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(N4.DEBUG=!0,Sh.info("set_config",{config:e,oldConfig:t,newConfig:Mf({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ns(),(s=this.externalIntegrations)==null||s.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,o,a,s,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),n.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),n.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var n=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(Mf({},Vrn((r=>r instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:n}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:jQ;return t!==jQ&&(t=jQ+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(k4))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(k4))==="identified"}Ds(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&TQ(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ak])&&((t=this.persistence)==null||(t=t.props)==null||!t[dV]))}Fs(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(e){return this.config.person_profiles==="never"?(Sh.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(dV,!0),!0)}xs(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Ns(){var e,t,n,r,o=this.xs();return((e=this.persistence)==null?void 0:e.Fe)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.Fe)!==o&&((r=this.sessionPersistence)==null||r.set_disabled(o)),o}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ns(),(m0(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ns()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ns()}_is_bot(){return J2?zYe(J2,this.config.custom_blocked_useragents):void 0}Cs(){ih&&(ih.visibilityState==="visible"?this.bs||(this.bs=!0,this.capture("$pageview",{title:ih.title},{send_instantly:!0}),this.ys&&(ih.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),hI(ih,"visibilitychange",this.ys)))}debug(e){e===!1?($a==null||$a.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):($a==null||$a.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,n,r,o,a,s,l=this.$s||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Sh.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",r=!1,o=Sh,a=(t="advanced_disable_flags")in(e=l)&&!m0(e[t]),s=n in e&&!m0(e[n]),a?e[t]:s?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n]):r)}As(e){if(tv(this.config.before_send))return e;var t=tI(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),tv(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return nrn(e.event)?Sh.warn(o+". This can cause unexpected behavior."):Sh.info(o),null}n.properties&&!TQ(n.properties)||Sh.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var e;return(e=this.pageViewManager.ce)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}(function(i,e){for(var t=0;t<e.length;t++)i.prototype[e[t]]=rrn(i.prototype[e[t]])})(kV,["identify"]);var KYe,PV=(KYe=Ck[jQ]=new kV,function(){function i(){i.done||(i.done=!0,YYe=!1,Zv(Ck,function(e){e._dom_loaded()}))}ih!=null&&ih.addEventListener?ih.readyState==="complete"?i():hI(ih,"DOMContentLoaded",i,{capture:!1}):$a&&Sh.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),KYe);!window.location.hostname.includes("localhost")&&!window.location.hostname.includes("127.0.0.1")&&(PV.__loaded||PV.init("phc_htd8AQjSfVEsFCLQMAiUooG4Q0DKBCjqYuQglc9V3Wo",{api_host:"https://postpig.tscircuit.com",person_profiles:"always"}));function yan(i){const e=String.fromCodePoint(...i);return btoa(e)}var W2=Uint8Array,$2=Uint16Array,D0e=Int32Array,N0e=new W2([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),T0e=new W2([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),XYe=new W2([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qYe=function(i,e){for(var t=new $2(31),n=0;n<31;++n)t[n]=e+=1<<i[n-1];for(var r=new D0e(t[30]),n=1;n<30;++n)for(var o=t[n];o<t[n+1];++o)r[o]=o-t[n]<<5|n;return{b:t,r}},JYe=qYe(N0e,2),_an=JYe.b,k0e=JYe.r;_an[28]=258,k0e[258]=28;for(var van=qYe(T0e,0),ZYe=van.r,P0e=new $2(32768),Xx=0;Xx<32768;++Xx){var NB=(Xx&43690)>>1|(Xx&21845)<<1;NB=(NB&52428)>>2|(NB&13107)<<2,NB=(NB&61680)>>4|(NB&3855)<<4,P0e[Xx]=((NB&65280)>>8|(NB&255)<<8)>>1}for(var Ek=function(i,e,t){for(var n=i.length,r=0,o=new $2(e);r<n;++r)i[r]&&++o[i[r]-1];var a=new $2(e);for(r=1;r<e;++r)a[r]=a[r-1]+o[r-1]<<1;var s;if(t){s=new $2(1<<e);var l=15-e;for(r=0;r<n;++r)if(i[r])for(var c=r<<4|i[r],u=e-i[r],d=a[i[r]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[P0e[d]>>l]=c}else for(s=new $2(n),r=0;r<n;++r)i[r]&&(s[r]=P0e[a[i[r]-1]++]>>15-i[r]);return s},GM=new W2(288),Xx=0;Xx<144;++Xx)GM[Xx]=8;for(var Xx=144;Xx<256;++Xx)GM[Xx]=9;for(var Xx=256;Xx<280;++Xx)GM[Xx]=7;for(var Xx=280;Xx<288;++Xx)GM[Xx]=8;for(var LV=new W2(32),Xx=0;Xx<32;++Xx)LV[Xx]=5;var xan=Ek(GM,9,0),Ian=Ek(LV,5,0),WYe=function(i){return(i+7)/8|0},$Ye=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new W2(i.subarray(e,t))},F4=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8},Sk=function(i,e,t){t<<=e&7;var n=e/8|0;i[n]|=t,i[n+1]|=t>>8,i[n+2]|=t>>16},L0e=function(i,e){for(var t=[],n=0;n<i.length;++n)i[n]&&t.push({s:n,f:i[n]});var r=t.length,o=t.slice();if(!r)return{t:iVe,l:0};if(r==1){var a=new W2(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(G,k){return G.f-k.f}),t.push({s:-1,f:25001});var s=t[0],l=t[1],c=0,u=1,d=2;for(t[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=r-1;)s=t[t[c].f<t[d].f?c++:d++],l=t[c!=u&&t[c].f<t[d].f?c++:d++],t[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var f=o[0].s,n=1;n<r;++n)o[n].s>f&&(f=o[n].s);var h=new $2(f+1),A=F0e(t[u-1],h,0);if(A>e){var n=0,m=0,_=A-e,v=1<<_;for(o.sort(function(k,L){return h[L.s]-h[k.s]||k.f-L.f});n<r;++n){var x=o[n].s;if(h[x]>e)m+=v-(1<<A-h[x]),h[x]=e;else break}for(m>>=_;m>0;){var I=o[n].s;h[I]<e?m-=1<<e-h[I]++-1:++n}for(;n>=0&&m;--n){var M=o[n].s;h[M]==e&&(--h[M],++m)}A=e}return{t:new W2(h),l:A}},F0e=function(i,e,t){return i.s==-1?Math.max(F0e(i.l,e,t+1),F0e(i.r,e,t+1)):e[i.s]=t},eVe=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new $2(++e),n=0,r=i[0],o=1,a=function(l){t[n++]=l},s=1;s<=e;++s)if(i[s]==r&&s!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(r),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(r);o=1,r=i[s]}return{c:t.subarray(0,n),n:e}},wk=function(i,e){for(var t=0,n=0;n<e.length;++n)t+=i[n]*e[n];return t},tVe=function(i,e,t){var n=t.length,r=WYe(e+2);i[r]=n&255,i[r+1]=n>>8,i[r+2]=i[r]^255,i[r+3]=i[r+1]^255;for(var o=0;o<n;++o)i[r+o+4]=t[o];return(r+4+n)*8},nVe=function(i,e,t,n,r,o,a,s,l,c,u){F4(e,u++,t),++r[256];for(var d=L0e(r,15),f=d.t,h=d.l,A=L0e(o,15),m=A.t,_=A.l,v=eVe(f),x=v.c,I=v.n,M=eVe(m),G=M.c,k=M.n,L=new $2(19),R=0;R<x.length;++R)++L[x[R]&31];for(var R=0;R<G.length;++R)++L[G[R]&31];for(var U=L0e(L,7),D=U.t,Z=U.l,Y=19;Y>4&&!D[XYe[Y-1]];--Y);var W=c+5<<3,ce=wk(r,GM)+wk(o,LV)+a,he=wk(r,f)+wk(o,m)+a+14+3*Y+wk(L,D)+2*L[16]+3*L[17]+7*L[18];if(l>=0&&W<=ce&&W<=he)return tVe(e,u,i.subarray(l,l+c));var ae,ve,ge,Me;if(F4(e,u,1+(he<ce)),u+=2,he<ce){ae=Ek(f,h,0),ve=f,ge=Ek(m,_,0),Me=m;var De=Ek(D,Z,0);F4(e,u,I-257),F4(e,u+5,k-1),F4(e,u+10,Y-4),u+=14;for(var R=0;R<Y;++R)F4(e,u+3*R,D[XYe[R]]);u+=3*Y;for(var Te=[x,G],Be=0;Be<2;++Be)for(var ze=Te[Be],R=0;R<ze.length;++R){var et=ze[R]&31;F4(e,u,De[et]),u+=D[et],et>15&&(F4(e,u,ze[R]>>5&127),u+=ze[R]>>12)}}else ae=xan,ve=GM,ge=Ian,Me=LV;for(var R=0;R<s;++R){var lt=n[R];if(lt>255){var et=lt>>18&31;Sk(e,u,ae[et+257]),u+=ve[et+257],et>7&&(F4(e,u,lt>>23&31),u+=N0e[et]);var At=lt&31;Sk(e,u,ge[At]),u+=Me[At],At>3&&(Sk(e,u,lt>>5&8191),u+=T0e[At])}else Sk(e,u,ae[lt]),u+=ve[lt]}return Sk(e,u,ae[256]),u+ve[256]},ban=new D0e([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iVe=new W2(0),Can=function(i,e,t,n,r,o){var a=o.z||i.length,s=new W2(n+a+5*(1+Math.ceil(a/7e3))+r),l=s.subarray(n,s.length-r),c=o.l,u=(o.r||0)&7;if(e){u&&(l[0]=o.r>>3);for(var d=ban[e-1],f=d>>13,h=d&8191,A=(1<<t)-1,m=o.p||new $2(32768),_=o.h||new $2(A+1),v=Math.ceil(t/3),x=2*v,I=function(It){return(i[It]^i[It+1]<<v^i[It+2]<<x)&A},M=new D0e(25e3),G=new $2(288),k=new $2(32),L=0,R=0,U=o.i||0,D=0,Z=o.w||0,Y=0;U+2<a;++U){var W=I(U),ce=U&32767,he=_[W];if(m[ce]=he,_[W]=ce,Z<=U){var ae=a-U;if((L>7e3||D>24576)&&(ae>423||!c)){u=nVe(i,l,0,M,G,k,R,D,Y,U-Y,u),D=L=R=0,Y=U;for(var ve=0;ve<286;++ve)G[ve]=0;for(var ve=0;ve<30;++ve)k[ve]=0}var ge=2,Me=0,De=h,Te=ce-he&32767;if(ae>2&&W==I(U-Te))for(var Be=Math.min(f,ae)-1,ze=Math.min(32767,U),et=Math.min(258,ae);Te<=ze&&--De&&ce!=he;){if(i[U+ge]==i[U+ge-Te]){for(var lt=0;lt<et&&i[U+lt]==i[U+lt-Te];++lt);if(lt>ge){if(ge=lt,Me=Te,lt>Be)break;for(var At=Math.min(Te,lt-2),Pt=0,ve=0;ve<At;++ve){var yt=U-Te+ve&32767,Qe=m[yt],Ke=yt-Qe&32767;Ke>Pt&&(Pt=Ke,he=yt)}}}ce=he,he=m[ce],Te+=ce-he&32767}if(Me){M[D++]=268435456|k0e[ge]<<18|ZYe[Me];var We=k0e[ge]&31,_t=ZYe[Me]&31;R+=N0e[We]+T0e[_t],++G[257+We],++k[_t],Z=U+ge,++L}else M[D++]=i[U],++G[i[U]]}}for(U=Math.max(U,Z);U<a;++U)M[D++]=i[U],++G[i[U]];u=nVe(i,l,c,M,G,k,R,D,Y,U-Y,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=_,o.p=m,o.i=U,o.w=Z)}else{for(var U=o.w||0;U<a+c;U+=65535){var Bt=U+65535;Bt>=a&&(l[u/8|0]=c,Bt=a),u=tVe(l,u+1,i.subarray(U,Bt))}o.i=a}return $Ye(s,0,n+WYe(u)+r)},Ean=function(){for(var i=new Int32Array(256),e=0;e<256;++e){for(var t=e,n=9;--n;)t=(t&1&&-306674912)^t>>>1;i[e]=t}return i}(),San=function(){var i=-1;return{p:function(e){for(var t=i,n=0;n<e.length;++n)t=Ean[t&255^e[n]]^t>>>8;i=t},d:function(){return~i}}},wan=function(i,e,t,n,r){if(!r&&(r={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new W2(o.length+i.length);a.set(o),a.set(i,o.length),i=a,r.w=o.length}return Can(i,e.level==null?6:e.level,e.mem==null?r.l?Math.ceil(Math.max(8,Math.min(13,Math.log(i.length)))*1.5):20:12+e.mem,t,n,r)},U0e=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8},Ban=function(i,e){var t=e.filename;if(i[0]=31,i[1]=139,i[2]=8,i[8]=e.level<2?4:e.level==9?2:0,i[9]=3,e.mtime!=0&&U0e(i,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){i[3]=8;for(var n=0;n<=t.length;++n)i[n+10]=t.charCodeAt(n)}},Man=function(i){return 10+(i.filename?i.filename.length+1:0)};function rVe(i,e){e||(e={});var t=San(),n=i.length;t.p(i);var r=wan(i,e,Man(e),8),o=r.length;return Ban(r,e),U0e(r,o-8,t.d()),U0e(r,o-4,n),r}var oVe=typeof TextEncoder<"u"&&new TextEncoder,Ran=typeof TextDecoder<"u"&&new TextDecoder,Qan=0;try{Ran.decode(iVe,{stream:!0}),Qan=1}catch{}function aVe(i,e){var t;if(oVe)return oVe.encode(i);for(var n=i.length,r=new W2(i.length+(i.length>>1)),o=0,a=function(c){r[o++]=c},t=0;t<n;++t){if(o+5>r.length){var s=new W2(o+8+(n-t<<1));s.set(r),r=s}var l=i.charCodeAt(t);l<128||e?a(l):l<2048?(a(192|l>>6),a(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|i.charCodeAt(++t)&1023,a(240|l>>18),a(128|l>>12&63),a(128|l>>6&63),a(128|l&63)):(a(224|l>>12),a(128|l>>6&63),a(128|l&63))}return $Ye(r,0,o)}function Dan(i,e){const t=JSON.stringify(i),n=rVe(aVe(t));return`https://tscircuit.com/editor?#data:application/gzip;base64,${yan(n)}`}function $A(...i){return Zin(dS(i))}const sVe=i=>i.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),O0e=vin,FV=mt.forwardRef(({className:i,...e},t)=>st.jsx(Cze,{ref:t,className:$A("rf-inline-flex rf-h-9 rf-items-center rf-justify-center rf-rounded-lg rf-bg-zinc-100 rf-p-1 rf-text-zinc-500 dark:rf-bg-zinc-800 dark:rf-text-zinc-400",i),...e}));FV.displayName=Cze.displayName;const yS=mt.forwardRef(({className:i,...e},t)=>st.jsx(Eze,{ref:t,className:$A("rf-inline-flex rf-items-center rf-justify-center rf-whitespace-nowrap rf-rounded-md rf-px-3 rf-py-1 rf-text-sm rf-font-medium rf-ring-offset-white rf-transition-all focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 disabled:rf-pointer-events-none disabled:rf-opacity-50 data-[state=active]:rf-bg-white data-[state=active]:rf-text-zinc-950 data-[state=active]:rf-shadow dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=active]:rf-bg-zinc-950 dark:data-[state=active]:rf-text-zinc-50",i),...e}));yS.displayName=Eze.displayName;const M5=mt.forwardRef(({className:i,...e},t)=>st.jsx(Sze,{ref:t,className:$A("rf-h-full rf-mt-2 rf-ring-offset-white focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-950 focus-visible:rf-ring-offset-2 dark:rf-ring-offset-zinc-950 dark:focus-visible:rf-ring-zinc-300",i),...e}));M5.displayName=Sze.displayName;/**
1006
1006
  * @license
1007
1007
  * Copyright 2010-2024 Three.js Authors
1008
1008
  * SPDX-License-Identifier: MIT
@@ -14101,7 +14101,7 @@ ${r.stack}`),n.complete=!0,"root"in this&&this.root&&this.root.emit("asyncEffect
14101
14101
  * Copyright (c) 2013-2015, 2017, Jon Schlinkert.
14102
14102
  * Released under the MIT License.
14103
14103
  *)
14104
- */const pci=({containerClassName:i,...e})=>{const t=mt.useRef(null),[n,r]=mt.useState(620);return mt.useLayoutEffect(()=>{const o=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};o();const a=new ResizeObserver(o);return t.current&&a.observe(t.current),window.addEventListener("resize",o),()=>{a.disconnect(),window.removeEventListener("resize",o)}},[]),st.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:st.jsx(hci,{...e,height:n})})},Aci='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',gci=()=>{mt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=Aci,document.head.appendChild(e)},[])},mci=i=>{mt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},PIt=i=>`hsl(${c2.indexOf(i)*137.5%360}, 70%, 50%)`,yci=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return st.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[st.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:c2.map(t=>{const n=i[t]||0,r=n/e*100;return st.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:PIt(t)},children:st.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),st.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},_ci=({renderLog:i})=>{const[e,t]=mt.useState("chronological");if(!i)return st.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,a)=>c2.indexOf(o[0])-c2.indexOf(a[0])):n.sort((o,a)=>a[1]-o[1]);const r=n.reduce((o,[a,s])=>o+s,0);return st.jsxs("div",{className:"rf-bg-white",children:[st.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[st.jsx("div",{children:"Render Logs"}),st.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[st.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),st.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[st.jsx("option",{value:"chronological",children:"Phase Order"}),st.jsx("option",{value:"longest",children:"Duration"})]})]})]}),st.jsx(yci,{phaseTimings:i.phaseTimings}),st.jsxs("table",{className:"rf-w-full rf-text-xs",children:[st.jsx("thead",{children:st.jsxs("tr",{children:[st.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),st.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),st.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),st.jsx("tbody",{children:n.map(([o,a])=>st.jsxs("tr",{children:[st.jsx("td",{className:"rf-p-2",children:c2.indexOf(o)}),st.jsx("td",{className:"rf-p-2",children:o}),st.jsx("td",{className:"rf-p-2",children:st.jsx("div",{className:"rf-w-8",children:st.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:PIt(o),width:`${a/r*100}%`}})})}),st.jsx("td",{className:"rf-p-2",children:st.jsxs("div",{className:"rf-flex w-full",children:[st.jsxs("span",{className:"rf-flex-grow",children:[a,"ms"]}),st.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(a/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},LIt=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{mt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{PV.captureException(n)}catch{}}},[i,e]),mt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{PV.captureException(r,{error_type:n.type})}catch{}}},[t])},vci="0.0.767";function FIt(i,e){const[t,n]=mt.useState(()=>{try{const r=window.localStorage.getItem(i);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return mt.useEffect(()=>{try{window.localStorage.setItem(i,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[i,t]),[t,n]}const pee=$Ge()(eze(i=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{i({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"})),xci=i=>{const[e,t]=mt.useState([]),[n,r]=mt.useState(null),[o,a]=mt.useState(""),[s,l]=FIt("eval-version-selection",null),c=pee(h=>h.setLastRunEvalVersion),u=pee(h=>h.lastRunEvalVersion);return mt.useEffect(()=>{i&&fetch("https://data.jsdelivr.com/v1/package/npm/@tscircuit/eval").then(h=>h.json()).then(h=>{var A;if(Array.isArray(h==null?void 0:h.versions)){let m=[...h.versions];(A=h.tags)!=null&&A.latest&&(r(h.tags.latest),m=m.filter(_=>_!==h.tags.latest)),t(m)}}).catch(()=>{})},[i]),mt.useEffect(()=>{i&&(s?(window.TSCIRCUIT_LATEST_EVAL_VERSION=s,c(s)):n&&(window.TSCIRCUIT_LATEST_EVAL_VERSION=n,c(n)))},[i,s,n]),{versions:mt.useMemo(()=>e.filter(h=>h.includes(o)).slice(0,50),[e,o]),latestVersion:n,lastRunEvalVersion:u,search:o,setSearch:a,selectVersion:h=>{l(h),a("")}}},Ici=["assembly","bom","circuit_json","errors","render_log"],bci=({code:i,fsMap:e,onRunClicked:t=void 0,errorMessage:n,errorStack:r,circuitJson:o,autoroutingGraphics:a,showRightHeaderContent:s=!0,showCodeTab:l=!1,codeTabContent:c,showJsonTab:u=!0,showRenderLogTab:d=!0,onActiveTabChange:f,renderLog:h,showImportAndFormatButtons:A=!0,className:m,headerClassName:_,leftHeaderContent:v,readOnly:x,isStreaming:I,autoroutingLog:M,onReportAutoroutingLog:G,isRunningCode:k,hasCodeChangedSinceLastRun:L,onEditEvent:R,editEvents:U,defaultActiveTab:D,defaultTab:Z,availableTabs:Y,autoRotate3dViewerDisabled:W,showSchematicDebugGrid:ce=!1,showToggleFullScreen:he=!0,defaultToFullScreen:ae=!1,activeEffectName:ve,allowSelectingVersion:ge=!0})=>{var Lt,Tt;gci();const{versions:Me,latestVersion:De,lastRunEvalVersion:Te,search:Be,setSearch:ze,selectVersion:et}=xci(ge),lt=mt.useMemo(()=>o?o.filter(Qt=>Qt&&"error_type"in Qt||Qt.type.includes("error")):null,[o]),At=mt.useMemo(()=>o?o.filter(Qt=>Qt&&"warning_type"in Qt||Qt.type.includes("warning")):null,[o]);LIt({errorMessage:n,errorStack:r,circuitJsonErrors:lt});const[Pt,yt]=mt.useState(D??Z??(Y==null?void 0:Y[0])??"pcb"),[Qe,Ke]=mt.useState(null),[We,_t]=mt.useState(ae);mci(We);const Bt=mt.useCallback(Qt=>{yt(Qt),f==null||f(Qt)},[f]),It=()=>{_t(!We)};mt.useEffect(()=>{n&&(Pt!=="errors"&&Ke(Pt),Bt("errors"))},[n]),mt.useEffect(()=>{(Pt==="code"||Pt==="errors")&&o&&!n&&Bt(Qe??D??Z??(Y==null?void 0:Y[0])??"pcb")},[o]);const ot=mt.useCallback(Qt=>{window.TSCIRCUIT_3D_OBJECT_REF=Qt===null?void 0:Qt},[]);return st.jsx("div",{className:$A("flex flex-col relative rf-overflow-x-hidden rf-h-full",m),children:st.jsx("div",{className:$A("rf-md:sticky rf-md:top-2 rf-h-full",We&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-h-full rf-bg-white rf-overflow-hidden"),children:st.jsxs(O0e,{value:Pt,onValueChange:Bt,className:"rf-flex-grow rf-flex rf-flex-col rf-h-full",children:[st.jsxs("div",{className:$A("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",_),children:[v,v&&st.jsx("div",{className:"rf-flex-grow"}),!v&&k&&st.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!v&&st.jsx("div",{className:"rf-flex-grow"}),h&&h.progress!==1&&!n&&st.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2 rf-min-w-0 rf-max-w-xs",children:[ve?st.jsx("div",{className:"rf-text-xs rf-text-gray-500 rf-truncate rf-min-w-0",title:ve,children:ve}):h.lastRenderEvent&&st.jsx("div",{className:"rf-text-xs rf-text-gray-500 rf-truncate rf-min-w-0",title:((Lt=h.lastRenderEvent)==null?void 0:Lt.phase)??"",children:((Tt=h.lastRenderEvent)==null?void 0:Tt.phase)??""}),st.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white rf-flex-shrink-0",children:st.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),st.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums rf-flex-shrink-0",children:[((h.progress??0)*100).toFixed(1),"%"]})]}),s&&st.jsxs(FV,{children:[l&&st.jsx(yS,{value:"code",children:"Code"}),!Y||Y.includes("pcb")?st.jsxs(yS,{value:"pcb",className:"rf-whitespace-nowrap",children:[o&&st.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}):null,!Y||Y.includes("schematic")?st.jsxs(yS,{value:"schematic",className:"rf-whitespace-nowrap",children:[o&&st.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}):null,!Y||Y.includes("cad")?st.jsxs(yS,{value:"cad",children:[o&&st.jsx("span",{className:$A("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}):null,!["pcb","cad","schematic"].includes(Pt)&&st.jsx(yS,{value:Pt,children:sVe(Pt)}),st.jsxs(Lbe,{children:[st.jsx(Fbe,{asChild:!0,children:st.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[st.jsx(K6n,{className:"rf-w-4 rf-h-4"}),(lt&&lt.length>0||n)&&st.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),st.jsxs(xJ,{className:"rf-*:text-xs",children:[Ici.filter(Qt=>!Y||Y.includes(Qt)).map(Qt=>st.jsxs(kE,{onSelect:()=>Bt(Qt),children:[Pt!==Qt&&st.jsx(Aft,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),Pt===Qt&&st.jsx(Kq,{className:"rf-w-3 rf-h-3"}),st.jsx("div",{className:"rf-pr-2",children:sVe(Qt)}),Qt==="errors"&&(lt&&lt.length>0||n)&&st.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:n?1:lt==null?void 0:lt.length})]},Qt)),st.jsx(kE,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:st.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",vci.split(".").map((Qt,$t)=>$t===2?parseInt(Qt)+1:Qt).join(".")]})}),ge?st.jsxs(Obe,{onOpenChange:Qt=>!Qt&&ze(""),children:[st.jsx(_J,{className:"rf-text-xs rf-opacity-60",children:st.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",Te??De??"latest"]})}),st.jsx(Ube,{children:st.jsxs(vJ,{className:"rf-*:text-xs rf-w-40 rf-max-h-[200px] rf-overflow-y-auto",children:[st.jsx("div",{className:"rf-p-1",children:st.jsx(Xbe,{value:Be,onChange:Qt=>ze(Qt.target.value),placeholder:"Search...",className:"rf-h-7 rf-text-xs"})}),st.jsx(_pt,{}),st.jsx(kE,{onSelect:()=>et(null),children:De?`${De} (latest)`:"latest"}),Me.map(Qt=>st.jsx(kE,{onSelect:()=>et(Qt),children:Qt},Qt))]})})]}):Te&&st.jsx(kE,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:st.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",Te]})})]})]})]}),he&&st.jsx(yI,{onClick:It,variant:"ghost",children:We?st.jsx(Z6n,{size:16}):st.jsx(q6n,{size:16})})]}),l&&st.jsx(M5,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:st.jsx("div",{className:"rf-h-full",children:c})}),(!Y||Y.includes("pcb"))&&st.jsx(M5,{value:"pcb",children:st.jsx("div",{className:$A("rf-overflow-hidden",We?"rf-h-[calc(100vh-52px)]":"rf-h-full"),children:st.jsx(l7,{fallbackRender:({error:Qt})=>st.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:st.jsxs("div",{className:"rf-p-4",children:[st.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),st.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Qt==null?void 0:Qt.message)||"An unknown error occurred"})]})}),children:o?st.jsx(pci,{focusOnHover:!1,circuitJson:o,debugGraphics:a,containerClassName:$A("rf-h-full rf-w-full",We?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Qt=>{if(R)for(const $t of Qt)R($t)}}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("assembly"))&&st.jsx(M5,{value:"assembly",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallback:st.jsx("div",{children:"Error loading Assembly"}),children:o?st.jsx(mTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("schematic"))&&st.jsx(M5,{value:"schematic",children:st.jsx("div",{className:$A("rf-overflow-auto rf-bg-white",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallbackRender:({error:Qt})=>st.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:st.jsxs("div",{className:"rf-p-4",children:[st.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),st.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Qt==null?void 0:Qt.message)||"An unknown error occurred"})]})}),children:o?st.jsx(pTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Qt=>{R==null||R(Qt)},debugGrid:ce}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("cad"))&&st.jsx(M5,{value:"cad",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{FallbackComponent:T6n,children:o?st.jsx(D6n,{ref:ot,circuitJson:o,autoRotateDisabled:W}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("bom"))&&st.jsx(M5,{value:"bom",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallbackRender:({error:Qt})=>st.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:st.jsxs("div",{className:"rf-p-4",children:[st.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),st.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Qt==null?void 0:Qt.message)||"An unknown error occurred"})]})}),children:o?st.jsx(ITn,{circuitJson:o}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("circuit_json"))&&st.jsx(M5,{value:"circuit_json",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallback:st.jsx("div",{children:"Error loading JSON viewer"}),children:o?st.jsx(vTn,{elements:o}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("errors"))&&st.jsx(M5,{value:"errors",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:n||lt&&lt.length>0||o?st.jsx(F7n,{code:i,fsMap:e,circuitJsonErrors:lt,circuitJsonWarnings:At,errorMessage:n,errorStack:r,circuitJson:o,evalVersion:Te,autoroutingLog:M,onReportAutoroutingLog:G}):st.jsx($6,{onRunClicked:t})})}),d&&(!Y||Y.includes("render_log"))&&st.jsx(M5,{value:"render_log",children:st.jsx(_ci,{renderLog:h})})]})})})};var Aee="Dialog",[UIt,OIt]=cS(Aee),[Cci,N3]=UIt(Aee),GIt=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:o,modal:a=!0}=i,s=mt.useRef(null),l=mt.useRef(null),[c,u]=QM({prop:n,defaultProp:r??!1,onChange:o,caller:Aee});return st.jsx(Cci,{scope:e,triggerRef:s,contentRef:l,contentId:eE(),titleId:eE(),descriptionId:eE(),open:c,onOpenChange:u,onOpenToggle:mt.useCallback(()=>u(d=>!d),[u]),modal:a,children:t})};GIt.displayName=Aee;var zIt="DialogTrigger",HIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(zIt,t),o=fI(e,r.triggerRef);return st.jsx(d1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":KSe(r.open),...n,ref:o,onClick:Lg(i.onClick,r.onOpenToggle)})});HIt.displayName=zIt;var VSe="DialogPortal",[Eci,YIt]=UIt(VSe,{forceMount:void 0}),VIt=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=i,o=N3(VSe,e);return st.jsx(Eci,{scope:e,forceMount:t,children:mt.Children.map(n,a=>st.jsx(E5,{present:t||o.open,children:st.jsx(aJ,{asChild:!0,container:r,children:a})}))})};VIt.displayName=VSe;var gee="DialogOverlay",jIt=mt.forwardRef((i,e)=>{const t=YIt(gee,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(gee,i.__scopeDialog);return o.modal?st.jsx(E5,{present:n||o.open,children:st.jsx(wci,{...r,ref:e})}):null});jIt.displayName=gee;var Sci=RM("DialogOverlay.RemoveScroll"),wci=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(gee,t);return st.jsx(pJ,{as:Sci,allowPinchZoom:!0,shards:[r.contentRef],children:st.jsx(d1.div,{"data-state":KSe(r.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),xR="DialogContent",KIt=mt.forwardRef((i,e)=>{const t=YIt(xR,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(xR,i.__scopeDialog);return st.jsx(E5,{present:n||o.open,children:o.modal?st.jsx(Bci,{...r,ref:e}):st.jsx(Mci,{...r,ref:e})})});KIt.displayName=xR;var Bci=mt.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=mt.useRef(null),r=fI(e,t.contentRef,n);return mt.useEffect(()=>{const o=n.current;if(o)return bbe(o)},[]),st.jsx(XIt,{...i,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lg(i.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Lg(i.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Lg(i.onFocusOutside,o=>o.preventDefault())})}),Mci=mt.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=mt.useRef(!1),r=mt.useRef(!1);return st.jsx(XIt,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=i.onCloseAutoFocus)==null||a.call(i,o),o.defaultPrevented||(n.current||(s=t.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:o=>{var l,c;(l=i.onInteractOutside)==null||l.call(i,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=o.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&r.current&&o.preventDefault()}})}),XIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:o,...a}=i,s=N3(xR,t),l=mt.useRef(null),c=fI(e,l);return ibe(),st.jsxs(st.Fragment,{children:[st.jsx(qq,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:o,children:st.jsx(Xq,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":KSe(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),st.jsxs(st.Fragment,{children:[st.jsx(Qci,{titleId:s.titleId}),st.jsx(Nci,{contentRef:l,descriptionId:s.descriptionId})]})]})}),jSe="DialogTitle",qIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(jSe,t);return st.jsx(d1.h2,{id:r.titleId,...n,ref:e})});qIt.displayName=jSe;var JIt="DialogDescription",ZIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(JIt,t);return st.jsx(d1.p,{id:r.descriptionId,...n,ref:e})});ZIt.displayName=JIt;var WIt="DialogClose",$It=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(WIt,t);return st.jsx(d1.button,{type:"button",...n,ref:e,onClick:Lg(i.onClick,()=>r.onOpenChange(!1))})});$It.displayName=WIt;function KSe(i){return i?"open":"closed"}var ebt="DialogTitleWarning",[Rci,tbt]=Ynn(ebt,{contentName:xR,titleName:jSe,docsSlug:"dialog"}),Qci=({titleId:i})=>{const e=tbt(ebt),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
14104
+ */const pci=({containerClassName:i,...e})=>{const t=mt.useRef(null),[n,r]=mt.useState(620);return mt.useLayoutEffect(()=>{const o=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};o();const a=new ResizeObserver(o);return t.current&&a.observe(t.current),window.addEventListener("resize",o),()=>{a.disconnect(),window.removeEventListener("resize",o)}},[]),st.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:st.jsx(hci,{...e,height:n})})},Aci='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-1{right:.25rem}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-10{z-index:10}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-4{margin-left:1rem;margin-right:1rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline-block{display:inline-block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-7{height:1.75rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[200px\\]{max-height:200px}.rf-max-h-\\[300px\\]{max-height:300px}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-20{width:5rem}.rf-w-28{width:7rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-40{width:10rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-w-screen{width:100vw}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-max-w-xs{max-width:20rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.rf-origin-\\[--radix-popover-content-transform-origin\\]{transform-origin:var(--radix-popover-content-transform-origin)}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf--translate-x-1\\/2{--tw-translate-x:-50%}.rf--translate-x-1\\/2,.rf--translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-y-1{--tw-translate-y:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-items-stretch{align-items:stretch}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-2{border-width:2px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-400{--tw-border-opacity:1;border-color:rgb(248 113 113/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-transparent{background-color:transparent}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-6{padding-bottom:1.5rem;padding-top:1.5rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-0{padding-top:0}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.\\!rf-font-normal{font-weight:400!important}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-100{opacity:1}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\=true\\]\\:rf-pointer-events-none[data-disabled=true],.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[selected\\=true\\]\\:rf-bg-zinc-100[data-selected=true]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[selected\\=true\\]\\:rf-text-zinc-900[data-selected=true]{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\=true\\]\\:rf-opacity-50[data-disabled=true],.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:placeholder\\:rf-text-zinc-400:is(.rf-dark *)::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-bg-zinc-800[data-selected=true]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[selected\\=true\\]\\:rf-text-zinc-50[data-selected=true]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-py-1\\.5 [cmdk-group-heading]{padding-bottom:.375rem;padding-top:.375rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-font-medium [cmdk-group-heading]{font-weight:500}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-500 [cmdk-group-heading]{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.dark\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:rf-text-zinc-400 [cmdk-group-heading]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:rf-pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\\[\\&_\\[cmdk-group\\]\\]\\:rf-px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:rf-w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\\[\\&_\\[cmdk-input\\]\\]\\:rf-h-12 [cmdk-input]{height:3rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\\[\\&_\\[cmdk-item\\]\\]\\:rf-py-3 [cmdk-item]{padding-bottom:.75rem;padding-top:.75rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-h-5 [cmdk-item] svg{height:1.25rem}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:rf-w-5 [cmdk-item] svg{width:1.25rem}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',gci=()=>{mt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=Aci,document.head.appendChild(e)},[])},mci=i=>{mt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},PIt=i=>`hsl(${c2.indexOf(i)*137.5%360}, 70%, 50%)`,yci=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return st.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[st.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:c2.map(t=>{const n=i[t]||0,r=n/e*100;return st.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:PIt(t)},children:st.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),st.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},_ci=({renderLog:i})=>{const[e,t]=mt.useState("chronological");if(!i)return st.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((o,a)=>c2.indexOf(o[0])-c2.indexOf(a[0])):n.sort((o,a)=>a[1]-o[1]);const r=n.reduce((o,[a,s])=>o+s,0);return st.jsxs("div",{className:"rf-bg-white",children:[st.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[st.jsx("div",{children:"Render Logs"}),st.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[st.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),st.jsxs("select",{value:e,onChange:o=>t(o.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[st.jsx("option",{value:"chronological",children:"Phase Order"}),st.jsx("option",{value:"longest",children:"Duration"})]})]})]}),st.jsx(yci,{phaseTimings:i.phaseTimings}),st.jsxs("table",{className:"rf-w-full rf-text-xs",children:[st.jsx("thead",{children:st.jsxs("tr",{children:[st.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),st.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),st.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),st.jsx("tbody",{children:n.map(([o,a])=>st.jsxs("tr",{children:[st.jsx("td",{className:"rf-p-2",children:c2.indexOf(o)}),st.jsx("td",{className:"rf-p-2",children:o}),st.jsx("td",{className:"rf-p-2",children:st.jsx("div",{className:"rf-w-8",children:st.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:PIt(o),width:`${a/r*100}%`}})})}),st.jsx("td",{className:"rf-p-2",children:st.jsxs("div",{className:"rf-flex w-full",children:[st.jsxs("span",{className:"rf-flex-grow",children:[a,"ms"]}),st.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(a/r*100).toFixed(1),"%"]})]})})]},o))})]})]})},LIt=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{mt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{PV.captureException(n)}catch{}}},[i,e]),mt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{PV.captureException(r,{error_type:n.type})}catch{}}},[t])},vci="0.0.768";function FIt(i,e){const[t,n]=mt.useState(()=>{try{const r=window.localStorage.getItem(i);return r?JSON.parse(r):e}catch(r){return console.error("Error reading from localStorage:",r),e}});return mt.useEffect(()=>{try{window.localStorage.setItem(i,JSON.stringify(t))}catch(r){console.error("Error writing to localStorage:",r)}},[i,t]),[t,n]}const pee=$Ge()(eze(i=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{i({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"})),xci=i=>{const[e,t]=mt.useState([]),[n,r]=mt.useState(null),[o,a]=mt.useState(""),[s,l]=FIt("eval-version-selection",null),c=pee(h=>h.setLastRunEvalVersion),u=pee(h=>h.lastRunEvalVersion);return mt.useEffect(()=>{i&&fetch("https://data.jsdelivr.com/v1/package/npm/@tscircuit/eval").then(h=>h.json()).then(h=>{var A;if(Array.isArray(h==null?void 0:h.versions)){let m=[...h.versions];(A=h.tags)!=null&&A.latest&&(r(h.tags.latest),m=m.filter(_=>_!==h.tags.latest)),t(m)}}).catch(()=>{})},[i]),mt.useEffect(()=>{i&&(s?(window.TSCIRCUIT_LATEST_EVAL_VERSION=s,c(s)):n&&(window.TSCIRCUIT_LATEST_EVAL_VERSION=n,c(n)))},[i,s,n]),{versions:mt.useMemo(()=>e.filter(h=>h.includes(o)).slice(0,50),[e,o]),latestVersion:n,lastRunEvalVersion:u,search:o,setSearch:a,selectVersion:h=>{l(h),a("")}}},Ici=["assembly","bom","circuit_json","errors","render_log"],bci=({code:i,fsMap:e,onRunClicked:t=void 0,errorMessage:n,errorStack:r,circuitJson:o,autoroutingGraphics:a,showRightHeaderContent:s=!0,showCodeTab:l=!1,codeTabContent:c,showJsonTab:u=!0,showRenderLogTab:d=!0,onActiveTabChange:f,renderLog:h,showImportAndFormatButtons:A=!0,className:m,headerClassName:_,leftHeaderContent:v,readOnly:x,isStreaming:I,autoroutingLog:M,onReportAutoroutingLog:G,isRunningCode:k,hasCodeChangedSinceLastRun:L,onEditEvent:R,editEvents:U,defaultActiveTab:D,defaultTab:Z,availableTabs:Y,autoRotate3dViewerDisabled:W,showSchematicDebugGrid:ce=!1,showToggleFullScreen:he=!0,defaultToFullScreen:ae=!1,activeEffectName:ve,allowSelectingVersion:ge=!0})=>{var Lt,Tt;gci();const{versions:Me,latestVersion:De,lastRunEvalVersion:Te,search:Be,setSearch:ze,selectVersion:et}=xci(ge),lt=mt.useMemo(()=>o?o.filter(Qt=>Qt&&"error_type"in Qt||Qt.type.includes("error")):null,[o]),At=mt.useMemo(()=>o?o.filter(Qt=>Qt&&"warning_type"in Qt||Qt.type.includes("warning")):null,[o]);LIt({errorMessage:n,errorStack:r,circuitJsonErrors:lt});const[Pt,yt]=mt.useState(D??Z??(Y==null?void 0:Y[0])??"pcb"),[Qe,Ke]=mt.useState(null),[We,_t]=mt.useState(ae);mci(We);const Bt=mt.useCallback(Qt=>{yt(Qt),f==null||f(Qt)},[f]),It=()=>{_t(!We)};mt.useEffect(()=>{n&&(Pt!=="errors"&&Ke(Pt),Bt("errors"))},[n]),mt.useEffect(()=>{(Pt==="code"||Pt==="errors")&&o&&!n&&Bt(Qe??D??Z??(Y==null?void 0:Y[0])??"pcb")},[o]);const ot=mt.useCallback(Qt=>{window.TSCIRCUIT_3D_OBJECT_REF=Qt===null?void 0:Qt},[]);return st.jsx("div",{className:$A("flex flex-col relative rf-overflow-x-hidden rf-h-full",m),children:st.jsx("div",{className:$A("rf-md:sticky rf-md:top-2 rf-h-full",We&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-h-full rf-bg-white rf-overflow-hidden"),children:st.jsxs(O0e,{value:Pt,onValueChange:Bt,className:"rf-flex-grow rf-flex rf-flex-col rf-h-full",children:[st.jsxs("div",{className:$A("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",_),children:[v,v&&st.jsx("div",{className:"rf-flex-grow"}),!v&&k&&st.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!v&&st.jsx("div",{className:"rf-flex-grow"}),h&&h.progress!==1&&!n&&st.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2 rf-min-w-0 rf-max-w-xs",children:[ve?st.jsx("div",{className:"rf-text-xs rf-text-gray-500 rf-truncate rf-min-w-0",title:ve,children:ve}):h.lastRenderEvent&&st.jsx("div",{className:"rf-text-xs rf-text-gray-500 rf-truncate rf-min-w-0",title:((Lt=h.lastRenderEvent)==null?void 0:Lt.phase)??"",children:((Tt=h.lastRenderEvent)==null?void 0:Tt.phase)??""}),st.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white rf-flex-shrink-0",children:st.jsx(q6,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),st.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums rf-flex-shrink-0",children:[((h.progress??0)*100).toFixed(1),"%"]})]}),s&&st.jsxs(FV,{children:[l&&st.jsx(yS,{value:"code",children:"Code"}),!Y||Y.includes("pcb")?st.jsxs(yS,{value:"pcb",className:"rf-whitespace-nowrap",children:[o&&st.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}):null,!Y||Y.includes("schematic")?st.jsxs(yS,{value:"schematic",className:"rf-whitespace-nowrap",children:[o&&st.jsx("span",{className:$A("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}):null,!Y||Y.includes("cad")?st.jsxs(yS,{value:"cad",children:[o&&st.jsx("span",{className:$A("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",L?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}):null,!["pcb","cad","schematic"].includes(Pt)&&st.jsx(yS,{value:Pt,children:sVe(Pt)}),st.jsxs(Lbe,{children:[st.jsx(Fbe,{asChild:!0,children:st.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[st.jsx(K6n,{className:"rf-w-4 rf-h-4"}),(lt&&lt.length>0||n)&&st.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),st.jsxs(xJ,{className:"rf-*:text-xs",children:[Ici.filter(Qt=>!Y||Y.includes(Qt)).map(Qt=>st.jsxs(kE,{onSelect:()=>Bt(Qt),children:[Pt!==Qt&&st.jsx(Aft,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),Pt===Qt&&st.jsx(Kq,{className:"rf-w-3 rf-h-3"}),st.jsx("div",{className:"rf-pr-2",children:sVe(Qt)}),Qt==="errors"&&(lt&&lt.length>0||n)&&st.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:n?1:lt==null?void 0:lt.length})]},Qt)),st.jsx(kE,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:st.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",vci.split(".").map((Qt,$t)=>$t===2?parseInt(Qt)+1:Qt).join(".")]})}),ge?st.jsxs(Obe,{onOpenChange:Qt=>!Qt&&ze(""),children:[st.jsx(_J,{className:"rf-text-xs rf-opacity-60",children:st.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",Te??De??"latest"]})}),st.jsx(Ube,{children:st.jsxs(vJ,{className:"rf-*:text-xs rf-w-40 rf-max-h-[200px] rf-overflow-y-auto",children:[st.jsx("div",{className:"rf-p-1",children:st.jsx(Xbe,{value:Be,onChange:Qt=>ze(Qt.target.value),placeholder:"Search...",className:"rf-h-7 rf-text-xs"})}),st.jsx(_pt,{}),st.jsx(kE,{onSelect:()=>et(null),children:De?`${De} (latest)`:"latest"}),Me.map(Qt=>st.jsx(kE,{onSelect:()=>et(Qt),children:Qt},Qt))]})})]}):Te&&st.jsx(kE,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:st.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",Te]})})]})]})]}),he&&st.jsx(yI,{onClick:It,variant:"ghost",children:We?st.jsx(Z6n,{size:16}):st.jsx(q6n,{size:16})})]}),l&&st.jsx(M5,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:st.jsx("div",{className:"rf-h-full",children:c})}),(!Y||Y.includes("pcb"))&&st.jsx(M5,{value:"pcb",children:st.jsx("div",{className:$A("rf-overflow-hidden",We?"rf-h-[calc(100vh-52px)]":"rf-h-full"),children:st.jsx(l7,{fallbackRender:({error:Qt})=>st.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:st.jsxs("div",{className:"rf-p-4",children:[st.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),st.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Qt==null?void 0:Qt.message)||"An unknown error occurred"})]})}),children:o?st.jsx(pci,{focusOnHover:!1,circuitJson:o,debugGraphics:a,containerClassName:$A("rf-h-full rf-w-full",We?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Qt=>{if(R)for(const $t of Qt)R($t)}}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("assembly"))&&st.jsx(M5,{value:"assembly",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallback:st.jsx("div",{children:"Error loading Assembly"}),children:o?st.jsx(mTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("schematic"))&&st.jsx(M5,{value:"schematic",children:st.jsx("div",{className:$A("rf-overflow-auto rf-bg-white",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallbackRender:({error:Qt})=>st.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:st.jsxs("div",{className:"rf-p-4",children:[st.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),st.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Qt==null?void 0:Qt.message)||"An unknown error occurred"})]})}),children:o?st.jsx(pTn,{circuitJson:o,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Qt=>{R==null||R(Qt)},debugGrid:ce}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("cad"))&&st.jsx(M5,{value:"cad",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{FallbackComponent:T6n,children:o?st.jsx(D6n,{ref:ot,circuitJson:o,autoRotateDisabled:W}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("bom"))&&st.jsx(M5,{value:"bom",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallbackRender:({error:Qt})=>st.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:st.jsxs("div",{className:"rf-p-4",children:[st.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),st.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Qt==null?void 0:Qt.message)||"An unknown error occurred"})]})}),children:o?st.jsx(ITn,{circuitJson:o}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("circuit_json"))&&st.jsx(M5,{value:"circuit_json",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:st.jsx(l7,{fallback:st.jsx("div",{children:"Error loading JSON viewer"}),children:o?st.jsx(vTn,{elements:o}):st.jsx($6,{onRunClicked:t})})})}),(!Y||Y.includes("errors"))&&st.jsx(M5,{value:"errors",children:st.jsx("div",{className:$A("rf-overflow-auto",We?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:n||lt&&lt.length>0||o?st.jsx(F7n,{code:i,fsMap:e,circuitJsonErrors:lt,circuitJsonWarnings:At,errorMessage:n,errorStack:r,circuitJson:o,evalVersion:Te,autoroutingLog:M,onReportAutoroutingLog:G}):st.jsx($6,{onRunClicked:t})})}),d&&(!Y||Y.includes("render_log"))&&st.jsx(M5,{value:"render_log",children:st.jsx(_ci,{renderLog:h})})]})})})};var Aee="Dialog",[UIt,OIt]=cS(Aee),[Cci,N3]=UIt(Aee),GIt=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:o,modal:a=!0}=i,s=mt.useRef(null),l=mt.useRef(null),[c,u]=QM({prop:n,defaultProp:r??!1,onChange:o,caller:Aee});return st.jsx(Cci,{scope:e,triggerRef:s,contentRef:l,contentId:eE(),titleId:eE(),descriptionId:eE(),open:c,onOpenChange:u,onOpenToggle:mt.useCallback(()=>u(d=>!d),[u]),modal:a,children:t})};GIt.displayName=Aee;var zIt="DialogTrigger",HIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(zIt,t),o=fI(e,r.triggerRef);return st.jsx(d1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":KSe(r.open),...n,ref:o,onClick:Lg(i.onClick,r.onOpenToggle)})});HIt.displayName=zIt;var VSe="DialogPortal",[Eci,YIt]=UIt(VSe,{forceMount:void 0}),VIt=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=i,o=N3(VSe,e);return st.jsx(Eci,{scope:e,forceMount:t,children:mt.Children.map(n,a=>st.jsx(E5,{present:t||o.open,children:st.jsx(aJ,{asChild:!0,container:r,children:a})}))})};VIt.displayName=VSe;var gee="DialogOverlay",jIt=mt.forwardRef((i,e)=>{const t=YIt(gee,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(gee,i.__scopeDialog);return o.modal?st.jsx(E5,{present:n||o.open,children:st.jsx(wci,{...r,ref:e})}):null});jIt.displayName=gee;var Sci=RM("DialogOverlay.RemoveScroll"),wci=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(gee,t);return st.jsx(pJ,{as:Sci,allowPinchZoom:!0,shards:[r.contentRef],children:st.jsx(d1.div,{"data-state":KSe(r.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),xR="DialogContent",KIt=mt.forwardRef((i,e)=>{const t=YIt(xR,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,o=N3(xR,i.__scopeDialog);return st.jsx(E5,{present:n||o.open,children:o.modal?st.jsx(Bci,{...r,ref:e}):st.jsx(Mci,{...r,ref:e})})});KIt.displayName=xR;var Bci=mt.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=mt.useRef(null),r=fI(e,t.contentRef,n);return mt.useEffect(()=>{const o=n.current;if(o)return bbe(o)},[]),st.jsx(XIt,{...i,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lg(i.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Lg(i.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Lg(i.onFocusOutside,o=>o.preventDefault())})}),Mci=mt.forwardRef((i,e)=>{const t=N3(xR,i.__scopeDialog),n=mt.useRef(!1),r=mt.useRef(!1);return st.jsx(XIt,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=i.onCloseAutoFocus)==null||a.call(i,o),o.defaultPrevented||(n.current||(s=t.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:o=>{var l,c;(l=i.onInteractOutside)==null||l.call(i,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=o.target;((c=t.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&r.current&&o.preventDefault()}})}),XIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:o,...a}=i,s=N3(xR,t),l=mt.useRef(null),c=fI(e,l);return ibe(),st.jsxs(st.Fragment,{children:[st.jsx(qq,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:o,children:st.jsx(Xq,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":KSe(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),st.jsxs(st.Fragment,{children:[st.jsx(Qci,{titleId:s.titleId}),st.jsx(Nci,{contentRef:l,descriptionId:s.descriptionId})]})]})}),jSe="DialogTitle",qIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(jSe,t);return st.jsx(d1.h2,{id:r.titleId,...n,ref:e})});qIt.displayName=jSe;var JIt="DialogDescription",ZIt=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(JIt,t);return st.jsx(d1.p,{id:r.descriptionId,...n,ref:e})});ZIt.displayName=JIt;var WIt="DialogClose",$It=mt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=N3(WIt,t);return st.jsx(d1.button,{type:"button",...n,ref:e,onClick:Lg(i.onClick,()=>r.onOpenChange(!1))})});$It.displayName=WIt;function KSe(i){return i?"open":"closed"}var ebt="DialogTitleWarning",[Rci,tbt]=Ynn(ebt,{contentName:xR,titleName:jSe,docsSlug:"dialog"}),Qci=({titleId:i})=>{const e=tbt(ebt),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
14105
14105
 
14106
14106
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
14107
14107