interview-widget 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +365 -364
- package/dist/assets/check-icon.d.ts +1 -0
- package/dist/assets/cross-icon.d.ts +1 -0
- package/dist/assets/hourglass-icon.d.ts +1 -0
- package/dist/assets/index.d.ts +10 -2
- package/dist/assets/mic-icon.d.ts +1 -0
- package/dist/assets/mic-off-icon.d.ts +1 -0
- package/dist/assets/video-icon.d.ts +1 -0
- package/dist/assets/video-off-icon.d.ts +1 -0
- package/dist/components/interview/interview-content.d.ts +12 -1
- package/dist/components/interview/interview-controller.d.ts +1 -0
- package/dist/components/interview/interview-header.d.ts +4 -1
- package/dist/components/interview/interview-timer-label.d.ts +8 -0
- package/dist/components/interview/question-display.d.ts +5 -0
- package/dist/components/interview/submit-response-button.d.ts +7 -0
- package/dist/components/interview/transcript/editable-answer.d.ts +10 -0
- package/dist/components/interview/transcript/interview-transcript-view.d.ts +15 -0
- package/dist/components/interview/transcript/interview-transcript.d.ts +19 -0
- package/dist/components/interview/transcript/transcript-phase-indicator.d.ts +8 -0
- package/dist/components/interview/transcript/transcript-qna-item.d.ts +15 -0
- package/dist/components/media/video-feed.d.ts +3 -0
- package/dist/components/modals/onboarding-media-controls.d.ts +16 -0
- package/dist/components/modals/onboarding-steps.d.ts +10 -0
- package/dist/components/ui/extended/chat-ui.d.ts +12 -0
- package/dist/dev.d.ts +2 -0
- package/dist/hooks/use-timer.d.ts +1 -1
- package/dist/services/api/endpoints.d.ts +1 -0
- package/dist/services/api/interview-api.d.ts +5 -1
- package/dist/services/timer/timer-service.d.ts +5 -0
- package/dist/types.d.ts +19 -0
- package/dist/utils/helper.d.ts +1 -0
- package/dist/widget.css +1 -1
- package/dist/widget.es.js +14631 -4716
- package/dist/widget.umd.js +31 -7
- package/package.json +66 -66
package/dist/widget.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(We,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],p):(We=typeof globalThis<"u"?globalThis:We||self,p(We.InterviewWidget={},We.React,We.ReactDOM))})(this,function(We,p,Zi){"use strict";var k7=Object.defineProperty;var O7=(We,p,Zi)=>p in We?k7(We,p,{enumerable:!0,configurable:!0,writable:!0,value:Zi}):We[p]=Zi;var Bt=(We,p,Zi)=>O7(We,typeof p!="symbol"?p+"":p,Zi);var Bu=typeof document<"u"?document.currentScript:null,J2={exports:{}},wr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Sl=Symbol.for("react.transitional.element"),Al=Symbol.for("react.fragment");function Xs(e,t,r){var i=null;if(r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),"key"in t){r={};for(var n in t)n!=="key"&&(r[n]=t[n])}else r=t;return t=r.ref,{$$typeof:Sl,type:e,key:i,ref:t!==void 0?t:null,props:r}}ei.Fragment=Al,ei.jsx=Xs,ei.jsxs=Xs,Ks.exports=ei;var o=Ks.exports;const nn={},it={api:{baseUrl:"/api",retryConfig:{attempts:3,backoff:"exponential",baseDelay:1e3}},ui:{baseColor:"#3B82F6",borderRadius:"8px"},interview:{timers:{thinkingDuration:30,answeringDuration:120,editingDuration:30},stt:{provider:"groq",model:"whisper-large-v3-turbo",language:"en"},tts:{provider:"piper"},proctoring:{enabled:!0,gazeAnalysisEnabled:!0}}},sn="iw-storage";function Tl(){if(!(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:rn&&rn.tagName.toUpperCase()==="SCRIPT"&&rn.src||new URL("widget.umd.js",document.baseURI).href}<"u"&&(nn!=null&&nn.VITE_IW_SECRET)))return typeof process<"u"&&process.env.NEXT_PUBLIC_IW_SECRET?process.env.NEXT_PUBLIC_IW_SECRET:typeof window<"u"&&window.__IW_SECRET__?window.__IW_SECRET__:"proctoring-data-seed"}const Qs=Tl(),ti=30,jl={SCREENSHOT:"screenshot"},on="AES-GCM",an=12;async function Js(e){const r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return crypto.subtle.importKey("raw",i,on,!1,["encrypt","decrypt"])}function Nl(){return crypto.getRandomValues(new Uint8Array(an))}async function Cl(e,t="default-seed"){try{const r=typeof e=="string"?e:JSON.stringify(e),n=new TextEncoder().encode(r),s=await Js(t),a=Nl(),c=await crypto.subtle.encrypt({name:on,iv:a},s,n),l=new Uint8Array(a.length+c.byteLength);return l.set(new Uint8Array(a),0),l.set(new Uint8Array(c),a.length),btoa(String.fromCharCode(...Array.from(l)))}catch(r){throw console.error("Encryption failed:",r),new Error("Failed to encrypt data")}}async function Il(e,t="default-seed"){try{const r=atob(e),i=new Uint8Array(r.length);for(let u=0;u<r.length;u++)i[u]=r.charCodeAt(u);const n=i.slice(0,an),s=i.slice(an),a=await Js(t),c=await crypto.subtle.decrypt({name:on,iv:n},a,s);return new TextDecoder().decode(c)}catch(r){throw console.error("Decryption failed:",r),new Error("Failed to decrypt data")}}async function Ml(e,t="default-seed"){return Cl(e,t)}async function Ll(e,t="default-seed"){const r=await Il(e,t);try{return JSON.parse(r)}catch{return r}}const Ir=d.createContext(null),Fl=async()=>{try{const e=sessionStorage.getItem(sn);if(e){const r=(await Ll(e,Qs)).state;return{logViolations:(r==null?void 0:r.logViolations)||[],totalViolations:(r==null?void 0:r.totalViolations)||0,gazeViolationCounters:(r==null?void 0:r.gazeViolationCounters)||{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:(r==null?void 0:r.referenceSet)??!1,referenceRef:(r==null?void 0:r.referenceRef)??{x:.5,y:.5,noseX:.5,noseY:.5}}}}catch(e){console.error("Failed to load proctoring data from session storage:",e)}return{logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}},Mr=async e=>{try{const t=await Ml({state:e,version:0},Qs);sessionStorage.setItem(sn,t)}catch(t){console.error("Failed to save proctoring data to session storage:",t)}},Pl=({children:e})=>{const t=d.useRef({logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}),r=d.useRef(new Set);d.useEffect(()=>{Fl().then(w=>{t.current=w,i()})},[]);const i=d.useCallback(()=>{r.current.forEach(w=>w())},[]),n=d.useCallback(w=>(r.current.add(w),()=>{r.current.delete(w)}),[]),s=d.useCallback(()=>t.current,[]),a=d.useCallback(w=>{t.current={...t.current,logViolations:[...t.current.logViolations,w],totalViolations:t.current.totalViolations+1},Mr(t.current),i()},[i]),c=d.useCallback(w=>{const m={...t.current.gazeViolationCounters};w==="looking_away"&&(m.lookingAwayCount+=1),w==="no_face_detected"&&(m.noFaceDetectedCount+=1),w==="multiple_faces"&&(m.multipleFacesCount+=1),m.totalGazeViolations=m.lookingAwayCount+m.noFaceDetectedCount+m.multipleFacesCount,t.current={...t.current,gazeViolationCounters:m},Mr(t.current),i()},[i]),l=d.useCallback(()=>{t.current={...t.current,logViolations:[],totalViolations:0},Mr(t.current),i()},[i]),u=d.useCallback(()=>{t.current={...t.current,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0}},Mr(t.current),i()},[i]),h=d.useCallback((w,m)=>{t.current={...t.current,referenceSet:w,referenceRef:m},Mr(t.current),i()},[i]),f=d.useMemo(()=>({getState:s,addViolation:a,clearViolations:l,subscribe:n,incrementGazeViolation:c,clearGazeViolationCounters:u,setReferenceData:h}),[s,a,l,n,c,u,h]);return o.jsx(Ir.Provider,{value:f,children:e})},Zs=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useProctoringStore must be used within a ProctoringProvider");const t=d.useSyncExternalStore(e.subscribe,e.getState,e.getState);return{logViolations:t.logViolations,totalViolations:t.totalViolations,addViolation:e.addViolation,clearViolations:e.clearViolations,gazeViolationCounters:t.gazeViolationCounters,referenceSet:t.referenceSet,referenceRef:t.referenceRef,incrementGazeViolation:e.incrementGazeViolation,clearGazeViolationCounters:e.clearGazeViolationCounters,setReferenceData:e.setReferenceData}},Dl=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().logViolations,()=>e.getState().logViolations)},Rl=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useTotalViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().totalViolations,()=>e.getState().totalViolations)},Ol=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useProctoringActions must be used within a ProctoringProvider");return{addViolation:e.addViolation,clearViolations:e.clearViolations}},eo=d.createContext(null);function to({config:e={},children:t}){var i,n,s,a;const r={api:{...it.api,...e.api,retryConfig:{...it.api.retryConfig,...(i=e.api)==null?void 0:i.retryConfig}},ui:{...it.ui,...e.ui},interview:{...it.interview,...e.interview,timers:{...it.interview.timers,...(n=e.interview)==null?void 0:n.timers},stt:{...it.interview.stt,...(s=e.interview)==null?void 0:s.stt},tts:{...it.interview.tts,...(a=e.interview)==null?void 0:a.tts}}};return o.jsx(eo.Provider,{value:r,children:o.jsx(Pl,{children:t})})}function ri(){const e=d.useContext(eo);if(!e)throw new Error("useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>");return e}function ro(){return ri().api||it.api}function rr(){return ri().ui||it.ui}function cn(){return ri().interview||it.interview}const io=({className:e,...t})=>o.jsx("div",{children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`iw-animate-spin ${e}`,...t,children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 6l0 -3"}),o.jsx("path",{d:"M16.25 7.75l2.15 -2.15"}),o.jsx("path",{d:"M18 12l3 0"}),o.jsx("path",{d:"M16.25 16.25l2.15 2.15"}),o.jsx("path",{d:"M12 18l0 3"}),o.jsx("path",{d:"M7.75 16.25l-2.15 2.15"}),o.jsx("path",{d:"M6 12l-3 0"}),o.jsx("path",{d:"M7.75 7.75l-2.15 -2.15"})]})}),no=({children:e,variant:t="primary",size:r="md",fullWidth:i=!1,isLoading:n=!1,disabled:s,className:a="",...c})=>{const l="iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2",u={primary:"iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",secondary:"iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",outline:"iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",text:"iw-bg-transparent iw-text-primary-600 iw-hover:bg-primary-50 iw-border iw-border-transparent",gradient:"iw-text-white iw-border iw-border-transparent iw-bg-gradient-to-r iw-from-purple-500 iw-to-indigo-500 hover:iw-from-purple-600 hover:iw-to-indigo-600"},h={sm:"iw-px-3 iw-py-1.5 iw-text-sm",md:"iw-px-4 iw-py-2.5 iw-text-sm",lg:"iw-px-5 iw-py-3 iw-text-base"},f="iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none",w=i?"iw-w-full":"";return o.jsxs("button",{className:`${l} ${u[t]} ${h[r]} ${w} ${f} ${a}`,disabled:s||n,...c,children:[n&&o.jsx(io,{height:16,width:16,style:{marginRight:"3px"}}),e]})};function Bl(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Ul(e,t,r){return"#"+[e,t,r].map(i=>{const n=Math.round(i).toString(16);return n.length===1?"0"+n:n}).join("")}function so(e,t){const r=Bl(e);if(!r)return e;const i=r.r+(255-r.r)*t,n=r.g+(255-r.g)*t,s=r.b+(255-r.b)*t;return Ul(i,n,s)}function Gl(e,t=.8){return{background:`linear-gradient(to bottom, ${so(e,t)}, #ffffff)`,color:"#1f2937"}}function Vl(e){return new Promise(t=>setTimeout(t,e))}function oo(e){return`linear-gradient(to left, ${so(e,.4)}, ${e})`}const $l=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);function Wl(e){try{const t=e.split(".");if(t.length!==3||!t[1])throw new Error("Invalid JWT token");const i=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=i.padEnd(i.length+(4-i.length%4)%4,"="),s=atob(n);return JSON.parse(s)}catch(t){return console.error("Error decoding JWT:",t),null}}const zl=e=>{var t;return!e||typeof e!="string"?"":(t=e.charAt(0))==null?void 0:t.toUpperCase()},ao=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),co=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),o.jsx("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),o.jsx("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),Hl=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M15 8a5 5 0 0 1 0 8"}),o.jsx("path",{d:"M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"})]}),Qe=e=>{const{baseColor:t,borderRadius:r}=rr(),{loading:i,children:n,...s}=e;return o.jsx(no,{style:{background:oo(t),borderRadius:r},...s,children:i?o.jsx(io,{}):n})},ii=({isOpen:e,onClose:t,children:r,title:i,showCloseButton:n=!0,closeOnOverlayClick:s=!0,closeOnEscape:a=!0,className:c=""})=>{if(d.useEffect(()=>{if(!e||!a)return;const h=f=>{f.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,a,t]),d.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const l=h=>{s&&h.target===h.currentTarget&&t()},u=o.jsxs("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center",children:[o.jsx("div",{className:"iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",onClick:l}),o.jsxs("div",{className:`iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${c}`,role:"dialog","aria-modal":"true","aria-labelledby":i?"dialog-title":void 0,children:[(i||n)&&o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200",children:[i&&o.jsx("h2",{id:"dialog-title",className:"iw-text-lg iw-font-semibold iw-text-gray-900",children:i}),n&&o.jsx("button",{onClick:t,className:"iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100","aria-label":"Close dialog",children:o.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),o.jsx("div",{className:"iw-p-4 iw-overflow-y-auto",children:r})]})]});return tr.createPortal(u,document.body)},ql=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-info-icon prefix__lucide-info",...e,children:[o.jsx("circle",{cx:12,cy:12,r:10}),o.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),Yl=e=>o.jsx("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-scan-face-icon prefix__lucide-scan-face",...e,children:o.jsx("path",{d:"M3 7V5a2 2 0 012-2h2M17 3h2a2 2 0 012 2v2M21 17v2a2 2 0 01-2 2h-2M7 21H5a2 2 0 01-2-2v-2M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01"})});function Kl({isOpen:e,onDecline:t,onContinue:r}){return o.jsx(ii,{isOpen:e,showCloseButton:!1,onClose:t,className:"iw-overflow-y-auto",children:e&&o.jsx("div",{className:"iw-bg-white iw-border-slate-200 iw-rounded-2xl iw-p-0 iw-shadow-xl sm:iw-max-w-xl",children:o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-4",children:[o.jsx("div",{className:"iw--mt-0.5 iw-h-2.5 iw-w-full iw-rounded-t-2xl iw-bg-gradient-to-r iw-from-blue-500 iw-to-indigo-500"}),o.jsx("div",{className:"iw-sr-only",children:"Face Data Usage Notice"}),o.jsx("div",{className:"iw-sr-only",children:"Permission to use face data for interview monitoring"}),o.jsxs("div",{className:"iw-px-8 iw-py-8",children:[o.jsxs("div",{className:"iw-text-center",children:[o.jsx("div",{className:"iw-mx-auto iw-mb-6 iw-flex iw-h-16 iw-w-16 iw-items-center iw-justify-center iw-rounded-full iw-border iw-border-blue-200 iw-bg-gradient-to-br iw-from-blue-50 iw-to-blue-100 iw-shadow-sm iw-ring-1 iw-ring-blue-100",children:o.jsx(Yl,{className:"iw-text-blue-600"})}),o.jsx("h1",{className:"iw-text-zinc-700 iw-mb-6 iw-text-2xl iw-font-semibold iw-tracking-tight",children:"Face Data Usage Notice"})]}),o.jsxs("ul",{className:"iw-mb-4 iw-list-item iw-space-y-4 iw-text-sm iw-leading-relaxed iw-text-gray-700",children:[o.jsx("li",{children:"To ensure the integrity of the interview process, this platform uses your device's camera to monitor your face and gaze direction."}),o.jsx("li",{children:"Your face data is processed only for proctoring purposes (e.g., detecting if you are looking away or off-screen)."}),o.jsx("li",{children:"All processing is limited to the interview session and is used solely to maintain fairness."})]}),o.jsxs("div",{className:"iw-text-zinc-700 iw-flex iw-items-start iw-gap-2 iw-rounded-md iw-border iw-border-blue-100 iw-bg-blue-50/60 iw-p-3 iw-text-sm iw-font-medium",children:[o.jsx(ql,{className:"iw-text-neutral-400 iw-mt-0.5 iw-inline-block iw-size-4 iw-flex-shrink-0"}),o.jsx("p",{className:"",children:"Please note that we do not store, share, or use your biometric data beyond the scope of this interview."})]}),o.jsx("p",{className:"iw-text-neutral-400 iw-my-4 iw-text-center iw-text-sm",children:"By continuing, you acknowledge and consent to the use of your face data exclusively for interview monitoring purposes."}),o.jsxs("div",{className:"iw-flex iw-gap-3 iw-border-t iw-border-gray-200/80 iw-pt-6",children:[o.jsx(Qe,{onClick:t,className:"iw-flex-1 iw-border",children:"Decline"}),o.jsx(Qe,{onClick:r,className:"iw-flex-1",children:"I Understand & Continue"})]})]})]})})})}function Xl(e){var t;if(!navigator.onLine)return{type:"network",message:"No internet connection",retryable:!0,userMessage:"Please check your internet connection and try again."};if(e.name==="AbortError"||(t=e.message)!=null&&t.includes("timeout"))return{type:"timeout",message:"Request timed out",retryable:!0,userMessage:"The request is taking longer than expected. Please try again."};if(e.status){const{status:r}=e;if(r===401||r===403)return{type:"auth",status:r,message:"Authentication failed",retryable:!1,userMessage:"Your session has expired. Please refresh the page."};if(r===429)return{type:"rate-limit",status:r,message:"Too many requests",retryable:!0,userMessage:"Please wait a moment before trying again."};if(r>=500)return{type:"server",status:r,message:`Server error: ${r}`,retryable:!0,userMessage:"Our servers are experiencing issues. Please try again in a few moments."};if(r>=400)return{type:"client",status:r,message:`Client error: ${r}`,retryable:!1,userMessage:"There was an issue with your request. Please check your input."}}return{type:"unknown",message:e.message||"Unknown error occurred",retryable:!0,userMessage:"Something unexpected happened. Please try again.",originalError:e}}async function Bt(e,t={},r={attempts:3,backoff:"exponential",baseDelay:1e3,maxDelay:1e4,jitter:!0}){let i;for(let n=1;n<=r.attempts;n++)try{const s=new AbortController,a=setTimeout(()=>s.abort(),6e4),c=await fetch(e,{...t,signal:s.signal});if(clearTimeout(a),c.status>=400&&c.status<500&&c.status!==429)return c;if(!c.ok)throw new Error(`HTTP ${c.status}: ${c.statusText}`);return c}catch(s){i=s;const a=Xl(s);if(!a.retryable||n===r.attempts)throw a;const c=Ql(n,r);console.warn(`API request failed (attempt ${n}/${r.attempts}), retrying in ${c}ms:`,a.message),await new Promise(l=>setTimeout(l,c))}throw i}function Ql(e,t){let r;return t.backoff==="exponential"?r=t.baseDelay*Math.pow(2,e-1):r=t.baseDelay,r=Math.min(r,t.maxDelay),t.jitter&&(r=r*(.5+Math.random()*.5)),Math.round(r)}const Ut={v2:"/v2"},Gt={GENERATE_QUESTION:e=>`${Ut.v2}/interviews/${e}/next-question`,SCREENSHOT_UPLOAD:e=>`${Ut.v2}/interviews/${e}/assets/upload-url`,CONFIRM_UPLOAD:e=>`${Ut.v2}/interviews/assets/${e}/confirm`,TRANSCRIBE_ANSWER:e=>`${Ut.v2}/interviews/${e}/transcribe-answer`,SUBMIT_ANSWER:e=>`${Ut.v2}/interviews/${e}/submit-answer`,EXIT:e=>`${Ut.v2}/interviews/${e}/exit`,CONFIG:e=>`${Ut.v2}/interviews/${e}/config`};class Jl{constructor(t={}){Oe(this,"config");this.config=t}updateConfig(t){this.config={...this.config,...t}}getHeaders(){var r;const t={"Content-Type":"application/json"};return(r=this.config)!=null&&r.authToken&&(t.Authorization=`Bearer ${this.config.authToken}`),t}getBaseUrl(){var t;return((t=this.config)==null?void 0:t.baseUrl)||"/api"}async generateQuestion({interviewId:t,isInterviewDone:r=!1}){const i=await Bt(`${this.getBaseUrl()}${Gt.GENERATE_QUESTION(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({interview_id:t,is_interview_done:r})});if(!i.ok)throw new Error(`Failed to get questions: ${i.status}`);return await i.json()}async submitAnswer({interviewId:t,qnaId:r,answer:i}){const n=await Bt(`${this.getBaseUrl()}${Gt.SUBMIT_ANSWER(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({qna_id:r,answer_text:i})});if(!n.ok)throw new Error(`Failed to submit answer: ${n.status}`);return await n.json()}async exitInterview(t){const r=await Bt(`${this.getBaseUrl()}${Gt.EXIT(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to exit interview: ${r.status}`)}async getInterviewConfig(t){const r=await Bt(`${this.getBaseUrl()}${Gt.CONFIG(t)}`,{method:"GET",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to get interview config: ${r.status}`);return await r.json()}async requestScreenshotUploadUrl(t,r=`screenshot-${Date.now()}.jpeg`){const i=await Bt(`${this.getBaseUrl()}${Gt.SCREENSHOT_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({filename:r,mime_type:"image/jpeg",asset_type:jl.SCREENSHOT})});if(!i.ok)throw new Error(`Failed to request screenshot upload URL: ${i.status}`);return await i.json()}async uploadScreenshot(t,r){const i=await fetch(t,{method:"PUT",body:r,headers:{"Content-Type":"image/jpeg"}});if(!i.ok)throw new Error(`Failed to upload screenshot: ${i.status}`)}async confirmScreenshotUpload(t){const r=await Bt(`${this.getBaseUrl()}${Gt.CONFIRM_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to confirm screenshot upload: ${r.status}`)}}function lo(){const e=ri();return d.useMemo(()=>{const r=e.api||{};return new Jl(r)},[e.api])}const Lr=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),o.jsx("path",{d:"M12 9v4"}),o.jsx("path",{d:"M12 17h.01"})]}),ln=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M12 2a10 10 0 0 1 7.38 16.75"}),o.jsx("path",{d:"M12 6v6l4 2"}),o.jsx("path",{d:"M2.5 8.875a10 10 0 0 0-.5 3"}),o.jsx("path",{d:"M2.83 16a10 10 0 0 0 2.43 3.4"}),o.jsx("path",{d:"M4.636 5.235a10 10 0 0 1 .891-.857"}),o.jsx("path",{d:"M8.644 21.42a10 10 0 0 0 7.631-.38"})]}),Zl=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M12 6v6l4 2"}),o.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),uo=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),eu=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),o.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),un=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),o.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),tu=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),o.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),ru=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-bolt-icon prefix__lucide-bolt",...e,children:[o.jsx("path",{d:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"}),o.jsx("circle",{cx:12,cy:12,r:4})]}),iu=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-camera-off-icon prefix__lucide-camera-off",...e,children:[o.jsx("path",{d:"M14.564 14.558a3 3 0 11-4.122-4.121M2 2l20 20"}),o.jsx("path",{d:"M20 20H4a2 2 0 01-2-2V9a2 2 0 012-2h1.997a2 2 0 00.819-.175M9.695 4.024A2 2 0 0110.004 4h3.993a2 2 0 011.76 1.05l.486.9A2 2 0 0018.003 7H20a2 2 0 012 2v7.344"})]}),nu=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-target-icon prefix__lucide-target",...e,children:[o.jsx("circle",{cx:12,cy:12,r:10}),o.jsx("circle",{cx:12,cy:12,r:6}),o.jsx("circle",{cx:12,cy:12,r:2})]}),su=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-users-icon prefix__lucide-users",...e,children:[o.jsx("path",{d:"M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2M16 3.128a4 4 0 010 7.744M22 21v-2a4 4 0 00-3-3.87"}),o.jsx("circle",{cx:9,cy:7,r:4})]}),Fr={FACE_DETECTED:"face_detected",NO_FACE:"no_face_detected",MULTIPLE_FACES:"multiple_faces",LOOKING_AWAY:"looking_away",CAMERA_ERROR:"camera_error"},ou={[Fr.FACE_DETECTED]:{icon:uo,iconColor:"iw-text-green-600",iconBg:"iw-bg-green-50",iconBorder:"iw-border-green-100",title:"All Good",subtitle:"Everything looks normal",description:"Your gaze is properly focused on the screen. Continue with your interview.",buttonText:"Continue"},[Fr.NO_FACE]:{icon:iu,iconColor:"iw-text-orange-600",iconBg:"iw-bg-orange-50",iconBorder:"iw-border-orange-100",title:"Face Not Detected",subtitle:"We can't see you in the camera",description:"Please ensure you're positioned properly in front of the camera and that your face is clearly visible.",buttonText:"I Understood"},[Fr.MULTIPLE_FACES]:{icon:su,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Multiple People Detected",subtitle:"More than one person is visible",description:"For interview integrity, please ensure you are alone in the room and only your face is visible to the camera.",buttonText:"I Understood"},[Fr.LOOKING_AWAY]:{icon:nu,iconColor:"iw-text-amber-600",iconBg:"iw-bg-amber-50",iconBorder:"iw-border-amber-200/75",title:"Stay Focused",subtitle:"We noticed you looked away from the screen",description:"To ensure interview integrity, please keep your attention on the screen throughout the session.",buttonText:"I Understood"},[Fr.CAMERA_ERROR]:{icon:Lr,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Camera Issue",subtitle:"There's a problem with your camera",description:"Please check your camera connection and permissions, then refresh the page to continue.",buttonText:"I Understood"}};function au({isOpen:e,onClose:t,warningType:r}){const i=ou[r],n=i.icon,s=()=>{t()};return r==="face_detected"?null:o.jsx(ii,{isOpen:e,onClose:t,children:e&&o.jsx("div",{className:"iw-bg-white iw-border-white iw-border iw-p-0 iw-shadow-lg sm:iw-max-w-md",children:o.jsxs("div",{children:[o.jsx("div",{className:"iw-sr-only",children:i.description}),o.jsxs("div",{className:"iw-px-8 iw-py-8 iw-text-center",children:[o.jsx("div",{className:`iw-mx-auto iw-mb-6 iw-flex iw-h-16 iw-w-16 iw-items-center iw-justify-center iw-rounded-full ${i.iconBg} border ${i.iconBorder}`,children:o.jsx(n,{className:`iw-h-7 iw-w-7 ${i.iconColor}`})}),o.jsx("h1",{className:"iw-text-foreground iw-mb-3 iw-text-2xl iw-font-bold iw-tracking-tight",children:i.title}),o.jsx("h2",{className:"iw-text-gray-500 iw-mb-6 iw-text-base iw-font-medium",children:i.subtitle}),o.jsx("p",{className:"iw-text-neutral-400 iw-mx-auto iw-mb-8 iw-max-w-sm iw-text-sm iw-leading-relaxed",children:i.description}),o.jsx(Qe,{onClick:s,className:"iw-w-full iw-bg-gray-800 iw-text-white hover:iw-bg-gray-800",children:i.buttonText})]})]})})})}const cu=({gazeAnalysisEnabled:e,isModelLoaded:t,stats:r,statusMessage:i,loadingProgress:n})=>o.jsx("div",{className:"iw-w-full",children:o.jsxs("div",{className:"iw-border-strock iw-rounded-md iw-border iw-bg-gray-50 iw-p-4",children:[o.jsxs("h3",{className:"iw-m-0 iw-mb-2.5",children:["Status: ",i]}),n>0&&n<100&&o.jsxs("div",{className:"iw-mb-2.5",children:[o.jsx("div",{className:"iw-h-2 iw-w-full iw-rounded iw-bg-gray-300",children:o.jsx("div",{className:"iw-h-full iw-rounded iw-bg-blue-600 iw-transition-all iw-duration-300 iw-ease-out",style:{width:`${n}%`}})}),o.jsxs("small",{className:"iw-text-gray-600",children:["Loading model... ",n.toFixed(1),"%"]})]}),o.jsxs("div",{className:"iw-grid iw-grid-cols-2 iw-gap-2.5 iw-text-sm",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"FPS:"})," ",o.jsx("span",{className:r.fps<15?"iw-text-red-600":r.fps<25?"iw-text-orange-500":"iw-text-green-600",children:r.fps})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Model:"})," ",t?"✓ Loaded":"✗ Loading"]}),e&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Engagement:"})," ",r.engagement.toFixed(1),"%"]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Looking:"})," ",o.jsx("span",{className:r.isLookingAway?"iw-text-red-600":"iw-text-green-600",children:r.isLookingAway?"Away":"At Screen"})]})]})]}),r.referenceFaceNotDetected&&o.jsxs("div",{className:"iw-text-gray-dark iw-mt-2.5 iw-w-full iw-rounded-md iw-bg-[#ffeb3b] iw-p-2.5 iw-text-sm",children:[o.jsx("strong",{children:"Reference Face Not Detected"}),o.jsx("br",{}),"The previously set reference face is no longer in view."]}),r.multipleFacesDetected&&o.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-red-50 iw-p-2.5 iw-text-sm iw-text-red-700",children:[o.jsx("strong",{children:"Multiple Faces Detected"}),o.jsx("br",{}),"Please ensure only one person is in the frame."]}),!e&&o.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-blue-50 iw-p-2.5 iw-text-sm iw-text-blue-700",children:[o.jsx("strong",{children:"Gaze Analysis Disabled"}),o.jsx("br",{}),"Enable to track engagement and attention levels."]})]})}),lu=({showControls:e,isBubbleOpen:t,setIsBubbleOpen:r,setReference:i,clearCache:n,isModelLoaded:s,gazeAnalysisEnabled:a,referenceSet:c,showLandmarks:l,setShowLandmarks:u,showEngagementBar:h,setShowEngagementBar:f,handleToggleGazeAnalysis:w,stats:m,statusMessage:g,loadingProgress:b})=>e?o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>r(!t),className:"iw-absolute iw-right-4 iw-bottom-4 iw-z-10 iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-full iw-text-white",children:o.jsx(ru,{className:"iw-size-4.5"})}),t&&o.jsxs("div",{className:"iw-absolute iw-right-4 iw-bottom-16 iw-z-10 iw-max-h-96 iw-w-80 iw-overflow-y-auto iw-rounded-md iw-bg-gray-50 iw-p-4 iw-shadow-lg",children:[o.jsx("h4",{className:"m-0 mb-2.5",children:"Controls"}),o.jsx("button",{onClick:i,disabled:!s||!a,className:`iw-mb-2.5 iw-block iw-w-full iw-rounded border-none iw-px-4 iw-py-2 iw-text-sm iw-text-white ${!s||!a?"iw-cursor-not-allowed iw-bg-gray-400":"iw-cursor-pointer iw-bg-blue-600 hover:iw-bg-blue-700"}`,children:c?"Reference Set ✓":"Set Reference"}),o.jsx("button",{onClick:n,className:"iw-mb-4 iw-block iw-w-full iw-cursor-pointer iw-rounded iw-border-none iw-bg-red-600 iw-px-4 iw-py-2 iw-text-sm iw-text-white hover:iw-bg-red-700",children:"Clear Model Cache"}),o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-2.5",children:[o.jsxs("label",{className:"iw-flex iw-cursor-pointer iw-items-center iw-gap-2",children:[o.jsx("input",{type:"checkbox",checked:a,onChange:_=>w(_.target.checked)}),o.jsx("strong",{children:"Enable Gaze Analysis"})]}),o.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${a?"iw-opacity-100":"iw-opacity-60"}`,children:[o.jsx("input",{type:"checkbox",checked:l,onChange:_=>u(_.target.checked),disabled:!a}),"Show Landmarks"]}),o.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${a?"iw-opacity-100":"iw-opacity-60"}`,children:[o.jsx("input",{type:"checkbox",checked:h,onChange:_=>f(_.target.checked),disabled:!a}),"Show Engagement Bar"]})]}),c&&o.jsx(cu,{gazeAnalysisEnabled:a,isModelLoaded:s,loadingProgress:b,stats:m,statusMessage:g})]})]}):null;var ir=typeof self<"u"?self:{};function Vt(){throw Error("Invalid UTF8")}function ho(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let ni,dn;const uu=typeof TextDecoder<"u";let du;const hu=typeof TextEncoder<"u";function fo(e){if(hu)e=(du||(du=new TextEncoder)).encode(e);else{let r=0;const i=new Uint8Array(3*e.length);for(let n=0;n<e.length;n++){var t=e.charCodeAt(n);if(t<128)i[r++]=t;else{if(t<2048)i[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&n<e.length){const s=e.charCodeAt(++n);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}n--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}var hn,si;e:{for(var wo=["CLOSURE_FLAGS"],fn=ir,wn=0;wn<wo.length;wn++)if((fn=fn[wo[wn]])==null){si=null;break e}si=fn}var Pr,mo=si&&si[610401301];hn=mo!=null&&mo;const go=ir.navigator;function mn(e){return!!hn&&!!Pr&&Pr.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Be(e){var t;return(t=ir.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function Et(){return!!hn&&!!Pr&&Pr.brands.length>0}function gn(){return Et()?mn("Chromium"):(Be("Chrome")||Be("CriOS"))&&!(!Et()&&Be("Edge"))||Be("Silk")}function oi(e){return oi[" "](e),e}Pr=go&&go.userAgentData||null,oi[" "]=function(){};var fu=!Et()&&(Be("Trident")||Be("MSIE"));!Be("Android")||gn(),gn(),Be("Safari")&&(gn()||!Et()&&Be("Coast")||!Et()&&Be("Opera")||!Et()&&Be("Edge")||(Et()?mn("Microsoft Edge"):Be("Edg/"))||Et()&&mn("Opera"));var po={},Dr=null;function wu(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const i=new Uint8Array(r);let n=0;return function(s,a){function c(u){for(;l<s.length;){const h=s.charAt(l++),f=Dr[h];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return u}xo();let l=0;for(;;){const u=c(-1),h=c(0),f=c(64),w=c(64);if(w===64&&u===-1)break;a(u<<2|h>>4),f!=64&&(a(h<<4&240|f>>2),w!=64&&a(f<<6&192|w))}}(e,function(s){i[n++]=s}),n!==r?i.subarray(0,n):i}function xo(){if(!Dr){Dr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const i=e.concat(t[r].split(""));po[r]=i;for(let n=0;n<i.length;n++){const s=i[n];Dr[s]===void 0&&(Dr[s]=n)}}}}var yo=typeof Uint8Array<"u",bo=!fu&&typeof btoa=="function";function vo(e){if(!bo){var t;t===void 0&&(t=0),xo(),t=po[t];var r=Array(Math.floor(e.length/3)),i=t[64]||"";let l=0,u=0;for(;l<e.length-2;l+=3){var n=e[l],s=e[l+1],a=e[l+2],c=t[n>>2];n=t[(3&n)<<4|s>>4],s=t[(15&s)<<2|a>>6],a=t[63&a],r[u++]=c+n+s+a}switch(c=0,a=i,e.length-l){case 2:a=t[(15&(c=e[l+1]))<<2]||i;case 1:e=e[l],r[u]=t[e>>2]+t[(3&e)<<4|c>>4]+a+i}return r.join("")}for(t="",r=0,i=e.length-10240;r<i;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}const _o=/[-_.]/g,mu={"-":"+",_:"/",".":"="};function gu(e){return mu[e]||""}function ko(e){if(!bo)return wu(e);_o.test(e)&&(e=e.replace(_o,gu)),e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function $t(e){return yo&&e!=null&&e instanceof Uint8Array}var nr={};function Wt(){return pu||(pu=new wt(null,nr))}function pn(e){Eo(nr);var t=e.g;return(t=t==null||$t(t)?t:typeof t=="string"?ko(t):null)==null?t:e.g=t}var wt=class{h(){return new Uint8Array(pn(this)||0)}constructor(e,t){if(Eo(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let pu,xu;function Eo(e){if(e!==nr)throw Error("illegal external caller")}function So(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function xn(e){return So(e=Error(e),"warning"),e}function yn(e){if(e!=null){var t=xu??(xu={}),r=t[e]||0;r>=5||(t[e]=r+1,So(e=Error(),"incident"),function(i){ir.setTimeout(()=>{throw i},0)}(e))}}var ai=typeof Symbol=="function"&&typeof Symbol()=="symbol";function sr(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var yu=sr("jas",void 0,!0),Ao=sr(void 0,"0di"),Rr=sr(void 0,"1oa"),or=sr(void 0,Symbol()),bu=sr(void 0,"0actk"),To=sr(void 0,"8utk");const k=ai?yu:"Ea",jo={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},No=Object.defineProperties;function ci(e,t){ai||k in e||No(e,jo),e[k]|=t}function ae(e,t){ai||k in e||No(e,jo),e[k]=t}function ar(e){return ci(e,34),e}function vu(e,t){ae(t,-15615&(0|e))}function bn(e,t){ae(t,-15581&(34|e))}function li(){return typeof BigInt=="function"}function ke(e){return Array.prototype.slice.call(e)}var vn,Or={};function ui(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function _n(e,t){if(e!=null){if(typeof e=="string")e=e?new wt(e,nr):Wt();else if(e.constructor!==wt)if($t(e))e=e.length?new wt(new Uint8Array(e),nr):Wt();else{if(!t)throw Error();e=void 0}}return e}const Co=[];function St(e){if(2&e)throw Error()}ae(Co,55),vn=Object.freeze(Co);class Io{constructor(t,r,i){this.g=t,this.h=r,this.l=i}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function kn(e){return or?e[or]:void 0}var _u=Object.freeze({});function di(e){return e.Na=!0,e}var ku=di(e=>typeof e=="number"),Mo=di(e=>typeof e=="string"),Eu=di(e=>typeof e=="boolean"),hi=typeof ir.BigInt=="function"&&typeof ir.BigInt(0)=="bigint";function At(e){var t=e;if(Mo(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(ku(t)&&!Number.isSafeInteger(t))throw Error(String(t));return hi?BigInt(e):e=Eu(e)?e?"1":"0":Mo(e)?e.trim()||"0":String(e)}var En=di(e=>hi?e>=Au&&e<=ju:e[0]==="-"?Lo(e,Su):Lo(e,Tu));const Su=Number.MIN_SAFE_INTEGER.toString(),Au=hi?BigInt(Number.MIN_SAFE_INTEGER):void 0,Tu=Number.MAX_SAFE_INTEGER.toString(),ju=hi?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Lo(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const i=e[r],n=t[r];if(i>n)return!1;if(i<n)return!0}}const Nu=typeof Uint8Array.prototype.slice=="function";let Fo,U=0,Z=0;function Po(e){const t=e>>>0;U=t,Z=(e-t)/4294967296>>>0}function zt(e){if(e<0){Po(-e);const[t,r]=jn(U,Z);U=t>>>0,Z=r>>>0}else Po(e)}function Sn(e){const t=Fo||(Fo=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),Z=0,U=t.getUint32(0,!0)}function An(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Br(e,t)}function Tn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=An(e,t))=="number"?r?-e:e:r?"-"+e:e}function Br(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else li()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Do(r)+Do(e));return r}function Do(e){return e=String(e),"0000000".slice(e.length)+e}function Ro(){var e=U,t=Z;if(2147483648&t)if(li())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,i]=jn(e,t);e="-"+Br(r,i)}else e=Br(e,t);return e}function fi(e){if(e.length<16)zt(Number(e));else if(li())e=BigInt(e),U=Number(e&BigInt(4294967295))>>>0,Z=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");Z=U=0;const r=e.length;for(let i=t,n=(r-t)%6+t;n<=r;i=n,n+=6){const s=Number(e.slice(i,n));Z*=1e6,U=1e6*U+s,U>=4294967296&&(Z+=Math.trunc(U/4294967296),Z>>>=0,U>>>=0)}if(t){const[i,n]=jn(U,Z);U=i,Z=n}}}function jn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const Ur=typeof BigInt=="function"?BigInt.asIntN:void 0,Cu=typeof BigInt=="function"?BigInt.asUintN:void 0,Tt=Number.isSafeInteger,wi=Number.isFinite,cr=Math.trunc,Iu=At(0);function jt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Oo(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Mu=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Gr(e){switch(typeof e){case"bigint":return!0;case"number":return wi(e);case"string":return Mu.test(e);default:return!1}}function lr(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return wi(e)?0|e:void 0}function Bo(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return wi(e)?e>>>0:void 0}function Uo(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function Go(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function Vo(e){return Go(e)?e:(fi(e),Ro())}function Nn(e){return e=cr(e),Tt(e)||(zt(e),e=Tn(U,Z)),e}function $o(e){var t=cr(Number(e));return Tt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Vo(e))}function Wo(e){var t=cr(Number(e));return Tt(t)?At(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),li()?At(Ur(64,BigInt(e))):At(Vo(e)))}function zo(e){if(Tt(e))e=At(Nn(e));else{if(e=cr(e),Tt(e))e=String(e);else{const t=String(e);Go(t)?e=t:(zt(e),e=Ro())}e=At(e)}return e}function Cn(e){return e==null?e:typeof e=="bigint"?(En(e)?e=Number(e):(e=Ur(64,e),e=En(e)?Number(e):String(e)),e):Gr(e)?typeof e=="number"?Nn(e):$o(e):void 0}function Lu(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Cu(64,e));if(Gr(e)){if(t==="string")return t=cr(Number(e)),Tt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Uo(e)||(fi(e),e=Br(U,Z))),e;if(t==="number")return(e=cr(e))>=0&&Tt(e)?e:function(r){if(r<0){zt(r);var i=Br(U,Z);return r=Number(i),Tt(r)?r:i}return Uo(i=String(r))?i:(zt(r),An(U,Z))}(e)}}function Ho(e){if(typeof e!="string")throw Error();return e}function ur(e){if(e!=null&&typeof e!="string")throw Error();return e}function dr(e){return e==null||typeof e=="string"?e:void 0}function In(e,t,r,i){if(e!=null&&typeof e=="object"&&e.W===Or)return e;if(!Array.isArray(e))return r?2&i?((e=t[Ao])||(ar((e=new t).u),e=t[Ao]=e),t=e):t=new t:t=void 0,t;let n=r=0|e[k];return n===0&&(n|=32&i),n|=2&i,n!==r&&ae(e,n),new t(e)}function Fu(e,t,r){if(t)e:{if(!Gr(t=e))throw xn("int64");switch(typeof t){case"string":t=Wo(t);break e;case"bigint":t=At(Ur(64,t));break e;default:t=zo(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?At(Ur(64,t)):Gr(t)?e==="string"?Wo(t):zo(t):void 0;return(e=t)==null?r?Iu:void 0:e}function Pu(e){return e}const Du={};let Ru=function(){try{return oi(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Mn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const Ou=Ru?(Object.setPrototypeOf(Mn.prototype,Map.prototype),Object.defineProperties(Mn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Mn):class extends Map{constructor(){super()}};function qo(e){return e}function Ln(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var nt=class extends Ou{constructor(e,t,r=qo,i=qo){super();let n=0|e[k];n|=64,ae(e,n),this.M=n,this.I=t,this.S=r,this.X=this.I?Bu:i;for(let s=0;s<e.length;s++){const a=e[s],c=r(a[0],!1,!0);let l=a[1];t?l===void 0&&(l=null):l=i(a[1],!1,!0,void 0,void 0,n),super.set(c,l)}}La(){var e=Wu;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=Uu){const t=[],r=super.entries();for(var i;!(i=r.next()).done;)(i=i.value)[0]=e(i[0]),i[1]=e(i[1]),t.push(i);return t}clear(){Ln(this),super.clear()}delete(e){return Ln(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new Io(e,Gu,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new Io(e,nt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((r,i,n)=>{e.call(t,n.get(i),i,n)}):super.forEach(e,t)}set(e,t){return Ln(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.I;return r?((r=this.X(t,!1,!0,r,this.pa,this.M))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function Bu(e,t,r,i,n,s){return e=In(e,i,r,s),n&&(e=pi(e)),e}function Uu(e){return e}function Gu(e){return[e,this.get(e)]}let Vu,Yo,Ko,$u;function Xo(){return Vu||(Vu=new nt(ar([]),void 0,void 0,void 0,Du))}function Fn(e,t,r,i,n){if(e!=null){if(Array.isArray(e)){const s=0|e[k];return e.length===0&&1&s?void 0:n&&2&s?e:mi(e,t,r,i!==void 0,n)}return t(e,i)}}function mi(e,t,r,i,n){const s=i||r?0|e[k]:0,a=i?!!(32&s):void 0;let c=0;const l=(i=ke(e)).length;for(let g=0;g<l;g++){var u=i[g];if(g===l-1&&ui(u)){var h=t,f=r,w=a,m=n;let b;for(let _ in u){const p=Fn(u[_],h,f,w,m);p!=null&&((b??(b={}))[_]=p)}u=b}else u=Fn(i[g],t,r,a,n);i[g]=u,u!=null&&(c=g+1)}return c<l&&(i.length=c),r&&((e=kn(e))&&(i[or]=ke(e)),r(s,i)),i}function Wu(e){return Fn(e,Pn,void 0,void 0,!1)}function Pn(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return En(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if($t(e))return $t(e)&&yn(To),vo(e);if(e.W===Or)return Qo(e);if(e instanceof wt){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=vo(t)}return e instanceof nt?e.La():void 0}return e}function Qo(e){var t=e.u;e=mi(t,Pn,void 0,void 0,!1);var r=0|t[k];if((t=e.length)&&!(512&r)){var i=e[t-1],n=!1;ui(i)?(t--,n=!0):i=void 0;var s=t-(r=512&r?0:-1),a=(Yo??Pu)(s,r,e,i);if(i&&(e[t]=void 0),s<a&&i){for(var c in s=!0,i){const l=+c;l<=a?(e[n=l+r]=i[c],t=Math.max(n+1,t),n=!1,delete i[c]):s=!1}s&&(i=void 0)}for(s=t-1;t>0;s=t-1)if((c=e[s])==null)t--,n=!0;else{if(!((s-=r)>=a))break;(i??(i={}))[s]=c,t--,n=!0}n&&(e.length=t),i&&e.push(i)}return e}function Nt(e,t,r){return e=Jo(e,t[0],t[1],r?1:2),t!==Ko&&r&&ci(e,8192),e}function Jo(e,t,r,i){if(e==null){var n=96;r?(e=[r],n|=512):e=[],t&&(n=-16760833&n|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(n=0|e[k])||!(64&n)||2&n||yn(bu),1024&n)throw Error("farr");if(64&n)return e;if(i===1||i===2||(n|=64),r&&(n|=512,r!==e[0]))throw Error("mid");e:{var s=(r=e).length;if(s){var a=s-1;if(ui(i=r[a])){if((a-=t=512&(n|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var c in i)(s=+c)<a&&(r[s+t]=i[c],delete i[c]);n=-16760833&n|(1023&a)<<14;break e}}if(t){if((c=Math.max(t,s-(512&n?0:-1)))>1024)throw Error("spvt");n=-16760833&n|(1023&c)<<14}}}return ae(e,n),e}function Dn(e,t,r=bn){if(e!=null){if(yo&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=0|e[k];return 2&i?e:(t&&(t=i===0||!!(32&i)&&!(64&i||!(16&i))),t?(ae(e,34|i),4&i&&Object.freeze(e),e):mi(e,Dn,4&i?bn:r,!0,!0))}return e.W===Or?e=2&(i=0|(r=e.u)[k])?e:new e.constructor(gi(r,i,!0)):e instanceof nt&&!(2&e.M)&&(r=ar(e.da(Dn)),e=new nt(r,e.I,e.S,e.X)),e}}function gi(e,t,r){const i=r||2&t?bn:vu,n=!!(32&t);return e=function(s,a,c){const l=ke(s);var u=l.length;const h=256&a?l[u-1]:void 0;for(u+=h?-1:0,a=512&a?1:0;a<u;a++)l[a]=c(l[a]);if(h){a=l[a]={};for(const f in h)a[f]=c(h[f])}return(s=kn(s))&&(l[or]=ke(s)),l}(e,t,s=>Dn(s,n,i)),ci(e,32|(r?2:0)),e}function pi(e){const t=e.u,r=0|t[k];return 2&r?new e.constructor(gi(t,r,!1)):e}function hr(e,t){return mt(e=e.u,0|e[k],t)}function mt(e,t,r){if(r===-1)return null;const i=r+(512&t?0:-1),n=e.length-1;return i>=n&&256&t?e[n][r]:i<=n?e[i]:void 0}function $(e,t,r){const i=e.u;let n=0|i[k];return St(n),K(i,n,t,r),e}function K(e,t,r,i){const n=512&t?0:-1,s=r+n;var a=e.length-1;return s>=a&&256&t?(e[a][r]=i,t):s<=a?(e[s]=i,t):(i!==void 0&&(r>=(a=t>>14&1023||536870912)?i!=null&&(e[a+n]={[r]:i},ae(e,t|=256)):e[s]=i),t)}function xi(e,t){let r=0|(e=e.u)[k];const i=mt(e,r,t),n=jt(i);return n!=null&&n!==i&&K(e,r,t,n),n}function Zo(e){let t=0|(e=e.u)[k];const r=mt(e,t,1),i=_n(r,!0);return i!=null&&i!==r&&K(e,t,1,i),i}function Ht(){return _u===void 0?2:4}function qt(e,t,r,i,n){const s=e.u,a=2&(e=0|s[k])?1:i;n=!!n;let c=0|(i=Rn(s,e,t))[k];if(!(4&c)){4&c&&(i=ke(i),c=xt(c,e),e=K(s,e,t,i));let l=0,u=0;for(;l<i.length;l++){const h=r(i[l]);h!=null&&(i[u++]=h)}u<l&&(i.length=u),c=On(c,e),r=-2049&(20|c),c=r&=-4097,ae(i,c),2&c&&Object.freeze(i)}return a===1||a===4&&32&c?gt(c)||(n=c,c|=2,c!==n&&ae(i,c),Object.freeze(i)):(a===2&>(c)&&(i=ke(i),c=xt(c,e),c=Ct(c,e,n),ae(i,c),e=K(s,e,t,i)),gt(c)||(t=c,c=Ct(c,e,n),c!==t&&ae(i,c))),i}function Rn(e,t,r){return e=mt(e,t,r),Array.isArray(e)?e:vn}function On(e,t){return e===0&&(e=xt(e,t)),1|e}function gt(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function ea(e){e=ke(e);for(let t=0;t<e.length;t++){const r=e[t]=ke(e[t]);Array.isArray(r[1])&&(r[1]=ar(r[1]))}return e}function Bn(e,t,r,i){let n=0|(e=e.u)[k];St(n),K(e,n,t,(i==="0"?Number(r)===0:r===i)?void 0:r)}function fr(e,t,r,i){St(t);let n=Rn(e,t,r);const s=n!==vn;if(64&t||!(8192&t)||!s){const a=s?0|n[k]:0;let c=a;(!s||2&c||gt(c)||4&c&&!(32&c))&&(n=ke(n),c=xt(c,t),t=K(e,t,r,n)),c=-13&On(c,t),c=Ct(i?-17&c:16|c,t,!0),c!==a&&ae(n,c)}return n}function Un(e,t){var r=rc;return Vn(Gn(e=e.u),e,0|e[k],r)===t?t:-1}function Gn(e){if(ai)return e[Rr]??(e[Rr]=new Map);if(Rr in e)return e[Rr];const t=new Map;return Object.defineProperty(e,Rr,{value:t}),t}function ta(e,t,r,i){const n=Gn(e),s=Vn(n,e,t,r);return s!==i&&(s&&(t=K(e,t,s)),n.set(r,i)),t}function Vn(e,t,r,i){let n=e.get(i);if(n!=null)return n;n=0;for(let s=0;s<i.length;s++){const a=i[s];mt(t,r,a)!=null&&(n!==0&&(r=K(t,r,n)),n=a)}return e.set(i,n),n}function $n(e,t,r){let i=0|e[k];const n=mt(e,i,r);let s;if(n!=null&&n.W===Or)return(t=pi(n))!==n&&K(e,i,r,t),t.u;if(Array.isArray(n)){const a=0|n[k];s=2&a?Nt(gi(n,a,!1),t,!0):64&a?n:Nt(s,t,!0)}else s=Nt(void 0,t,!0);return s!==n&&K(e,i,r,s),s}function ra(e,t,r){let i=0|(e=e.u)[k];const n=mt(e,i,r);return(t=In(n,t,!1,i))!==n&&t!=null&&K(e,i,r,t),t}function P(e,t,r){if((t=ra(e,t,r))==null)return t;let i=0|(e=e.u)[k];if(!(2&i)){const n=pi(t);n!==t&&K(e,i,r,t=n)}return t}function ia(e,t,r,i,n,s,a){e=e.u;var c=!!(2&t);const l=c?1:n;s=!!s,a&&(a=!c);var u=0|(n=Rn(e,t,i))[k];if(!(c=!!(4&u))){var h=n,f=t;const w=!!(2&(u=On(u,t)));w&&(f|=2);let m=!w,g=!0,b=0,_=0;for(;b<h.length;b++){const p=In(h[b],r,!1,f);if(p instanceof r){if(!w){const A=!!(2&(0|p.u[k]));m&&(m=!A),g&&(g=A)}h[_++]=p}}_<b&&(h.length=_),u|=4,u=g?16|u:-17&u,ae(h,u=m?8|u:-9&u),w&&Object.freeze(h)}if(a&&!(8&u||!n.length&&(l===1||l===4&&32&u))){for(gt(u)&&(n=ke(n),u=xt(u,t),t=K(e,t,i,n)),r=n,a=u,h=0;h<r.length;h++)(u=r[h])!==(f=pi(u))&&(r[h]=f);a|=8,ae(r,a=r.length?-17&a:16|a),u=a}return l===1||l===4&&32&u?gt(u)||(t=u,(u|=!n.length||16&u&&(!c||32&u)?2:1024)!==t&&ae(n,u),Object.freeze(n)):(l===2&>(u)&&(ae(n=ke(n),u=Ct(u=xt(u,t),t,s)),t=K(e,t,i,n)),gt(u)||(i=u,(u=Ct(u,t,s))!==i&&ae(n,u))),n}function pt(e,t,r){const i=0|e.u[k];return ia(e,i,t,r,Ht(),!1,!(2&i))}function S(e,t,r,i){return i==null&&(i=void 0),$(e,r,i)}function Vr(e,t,r,i){i==null&&(i=void 0);e:{let n=0|(e=e.u)[k];if(St(n),i==null){const s=Gn(e);if(Vn(s,e,n,r)!==t)break e;s.set(r,0)}else n=ta(e,n,r,t);K(e,n,t,i)}}function xt(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Ct(e,t,r){return 32&t&&r||(e&=-33),e}function yi(e,t,r){St(0|e.u[k]),qt(e,t,dr,2,!0).push(Ho(r))}function bi(e,t,r,i){const n=0|e.u[k];St(n),e=ia(e,n,r,t,2,!0),i=i??new r,e.push(i),e[k]=2&(0|i.u[k])?-9&e[k]:-17&e[k]}function Ue(e,t){return lr(hr(e,t))}function Ge(e,t){return dr(hr(e,t))}function ie(e,t){return xi(e,t)??0}function $r(e,t,r){if(r!=null&&typeof r!="boolean")throw e=typeof r,Error(`Expected boolean but got ${e!="object"?e:r?Array.isArray(r)?"array":e:"null"}: ${r}`);$(e,t,r)}function st(e,t,r){if(r!=null){if(typeof r!="number"||!wi(r))throw xn("int32");r|=0}$(e,t,r)}function v(e,t,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);$(e,t,r)}function vi(e,t,r){{const a=e.u;let c=0|a[k];if(St(c),r==null)K(a,c,t);else{var i=e=0|r[k],n=gt(e),s=n||Object.isFrozen(r);for(n||(e=0),s||(r=ke(r),i=0,e=Ct(e=xt(e,c),c,!0),s=!1),e|=21,n=0;n<r.length;n++){const l=r[n],u=Ho(l);Object.is(l,u)||(s&&(r=ke(r),i=0,e=Ct(e=xt(e,c),c,!0),s=!1),r[n]=u)}e!==i&&(s&&(r=ke(r),e=Ct(e=xt(e,c),c,!0)),ae(r,e)),K(a,c,t,r)}}}function na(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Wn(){return Error("Failed to read varint, encoding is invalid.")}function sa(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function zn(e){if(typeof e=="string")return{buffer:ko(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===wt)return{buffer:pn(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Hn(e,t){let r,i=0,n=0,s=0;const a=e.h;let c=e.g;do r=a[c++],i|=(127&r)<<s,s+=7;while(s<32&&128&r);for(s>32&&(n|=(127&r)>>4),s=3;s<32&&128&r;s+=7)r=a[c++],n|=(127&r)<<s;if(Yt(e,c),r<128)return t(i>>>0,n>>>0);throw Wn()}function qn(e){let t=0,r=e.g;const i=r+10,n=e.h;for(;r<i;){const s=n[r++];if(t|=s,(128&s)==0)return Yt(e,r),!!(127&t)}throw Wn()}function It(e){const t=e.h;let r=e.g,i=t[r++],n=127&i;if(128&i&&(i=t[r++],n|=(127&i)<<7,128&i&&(i=t[r++],n|=(127&i)<<14,128&i&&(i=t[r++],n|=(127&i)<<21,128&i&&(i=t[r++],n|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Wn();return Yt(e,r),n}function yt(e){return It(e)>>>0}function Yn(e){var t=e.h;const r=e.g,i=t[r],n=t[r+1],s=t[r+2];return t=t[r+3],Yt(e,e.g+4),(i<<0|n<<8|s<<16|t<<24)>>>0}function Kn(e){var t=Yn(e);e=2*(t>>31)+1;const r=t>>>23&255;return t&=8388607,r==255?t?NaN:e*(1/0):r==0?1401298464324817e-60*e*t:e*Math.pow(2,r-150)*(t+8388608)}function zu(e){return It(e)}function Xn(e,t,{aa:r=!1}={}){e.aa=r,t&&(t=zn(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function Yt(e,t){if(e.g=t,t>e.l)throw sa(e.l,t)}function oa(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const r=e.g,i=r+t;if(i>e.l)throw sa(t,e.l-r);return e.g=i,r}function aa(e,t){if(t==0)return Wt();var r=oa(e,t);return e.aa&&e.m?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):Nu?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Wt():new wt(r,nr)}nt.prototype.toJSON=void 0;var ca=[];function la(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var r=yt(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5))throw na(r,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=r,!0}function _i(e){switch(e.h){case 0:e.h!=0?_i(e):qn(e.g);break;case 1:Yt(e=e.g,e.g+8);break;case 2:if(e.h!=2)_i(e);else{var t=yt(e.g);Yt(e=e.g,e.g+t)}break;case 5:Yt(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!la(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}_i(e)}break;default:throw na(e.h,e.l)}}function Wr(e,t,r){const i=e.g.l,n=yt(e.g),s=e.g.g+n;let a=s-i;if(a<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),a=s-e.g.g),a)throw Error(`Message parsing ended unexpectedly. Expected to read ${n} bytes, instead read ${n-a} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=s,e.g.l=i,t}function Qn(e){var t=yt(e.g),r=oa(e=e.g,t);if(e=e.h,uu){var i,n=e;(i=dn)||(i=dn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,n=r===0&&t===n.length?n:n.subarray(r,t);try{var s=i.decode(n)}catch(c){if(ni===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),ni=!0}catch{ni=!1}}throw!ni&&(dn=void 0),c}}else{t=(s=r)+t,r=[];let c,l=null;for(;s<t;){var a=e[s++];a<128?r.push(a):a<224?s>=t?Vt():(c=e[s++],a<194||(192&c)!=128?(s--,Vt()):r.push((31&a)<<6|63&c)):a<240?s>=t-1?Vt():(c=e[s++],(192&c)!=128||a===224&&c<160||a===237&&c>=160||(192&(i=e[s++]))!=128?(s--,Vt()):r.push((15&a)<<12|(63&c)<<6|63&i)):a<=244?s>=t-2?Vt():(c=e[s++],(192&c)!=128||c-144+(a<<28)>>30||(192&(i=e[s++]))!=128||(192&(n=e[s++]))!=128?(s--,Vt()):(a=(7&a)<<18|(63&c)<<12|(63&i)<<6|63&n,a-=65536,r.push(55296+(a>>10&1023),56320+(1023&a)))):Vt(),r.length>=8192&&(l=ho(l,r),r.length=0)}s=ho(l,r)}return s}function ua(e){const t=yt(e.g);return aa(e.g,t)}function ki(e,t,r){var i=yt(e.g);for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var Ei=[];function Je(e,t,r){t.g?t.m(e,t.g,t.h,r):t.m(e,t.h,r)}var y=class{constructor(e,t){this.u=Jo(e,t)}toJSON(){try{var e=Qo(this)}finally{Yo=void 0}return e}l(){var e=Td;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(gi(e,0|e[k],!1))}O(){return!!(2&(0|this.u[k]))}};function da(e){return e?/^\d+$/.test(e)?(fi(e),new Jn(U,Z)):null:Hu||(Hu=new Jn(0,0))}y.prototype.W=Or,y.prototype.toString=function(){return this.u.toString()};var Jn=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Hu;function ha(e){return e?/^-?\d+$/.test(e)?(fi(e),new Zn(U,Z)):null:qu||(qu=new Zn(0,0))}var Zn=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let qu;function wr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function mr(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Si(e,t){if(t>=0)mr(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function zr(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function gr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ne(e,t,r){mr(e.g,8*t+r)}function es(e,t){return Ne(e,t,2),t=e.g.end(),gr(e,t),t.push(e.h),t}function ts(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function Ai(e,t,r){Ne(e,t,2),mr(e.g,r.length),gr(e,e.g.end()),gr(e,r)}function Ti(e,t,r,i){r!=null&&(t=es(e,t),i(r,e),ts(e,t))}function Ze(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var rs=Ze(),fa=Ze(),is=Ze(),ns=Ze(),wa=Ze(),ma=Ze(),ss=Ze(),ga=Ze(),pa=Ze(),pr=class{constructor(e,t,r){this.g=e,this.h=t,e=rs,this.l=!!e&&r===e||!1}};function ji(e,t){return new pr(e,t,rs)}function xa(e,t,r,i,n){Ti(e,r,Ea(t,i),n)}const Yu=ji(function(e,t,r,i,n){return e.h===2&&(Wr(e,$n(t,i,r),n),!0)},xa),Ku=ji(function(e,t,r,i,n){return e.h===2&&(Wr(e,$n(t,i,r),n),!0)},xa);var Ni=Symbol(),os=Symbol(),ya=Symbol(),ba=Symbol();let va,_a;function Kt(e,t,r,i){var n=i[e];if(n)return n;(n={}).Ma=i,n.T=function(f){switch(typeof f){case"boolean":return Ko||(Ko=[0,void 0,!0]);case"number":return f>0?void 0:f===0?$u||($u=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}}(i[0]);var s=i[1];let a=1;s&&s.constructor===Object&&(n.ga=s,typeof(s=i[++a])=="function"&&(n.la=!0,va??(va=s),_a??(_a=i[a+1]),s=i[a+=2]));const c={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var l=0;l<s.length;l++)c[s[l]]=s;s=i[++a]}for(l=1;s!==void 0;){let f;typeof s=="number"&&(l+=s,s=i[++a]);var u=void 0;if(s instanceof pr?f=s:(f=Yu,a--),f==null?void 0:f.l){s=i[++a],u=i;var h=a;typeof s=="function"&&(s=s(),u[h]=s),u=s}for(h=l+1,typeof(s=i[++a])=="number"&&s<0&&(h-=s,s=i[++a]);l<h;l++){const w=c[l];u?r(n,l,f,u,w):t(n,l,f,w)}}return i[e]=n}function ka(e){return Array.isArray(e)?e[0]instanceof pr?e:[Ku,e]:[e,void 0]}function Ea(e,t){return e instanceof y?e.u:Array.isArray(e)?Nt(e,t,!1):void 0}function as(e,t,r,i){const n=r.g;e[t]=i?(s,a,c)=>n(s,a,c,i):n}function cs(e,t,r,i,n){const s=r.g;let a,c;e[t]=(l,u,h)=>s(l,u,h,c||(c=Kt(os,as,cs,i).T),a||(a=ls(i)),n)}function ls(e){let t=e[ya];if(t!=null)return t;const r=Kt(os,as,cs,e);return t=r.la?(i,n)=>va(i,n,r):(i,n)=>{const s=0|i[k];for(;la(n)&&n.h!=4;){var a=n.m,c=r[a];if(c==null){var l=r.ga;l&&(l=l[a])&&(l=Xu(l))!=null&&(c=r[a]=l)}c!=null&&c(n,i,a)||(a=(c=n).l,_i(c),c.fa?c=void 0:(l=c.g.g-a,c.g.g=a,c=aa(c.g,l)),a=i,c&&((l=a[or])?l.push(c):a[or]=[c]))}return 8192&s&&ar(i),!0},e[ya]=t}function Xu(e){const t=(e=ka(e))[0].g;if(e=e[1]){const r=ls(e),i=Kt(os,as,cs,e).T;return(n,s,a)=>t(n,s,a,i,r)}return t}function Ci(e,t,r){e[t]=r.h}function Ii(e,t,r,i){let n,s;const a=r.h;e[t]=(c,l,u)=>a(c,l,u,s||(s=Kt(Ni,Ci,Ii,i).T),n||(n=Sa(i)))}function Sa(e){let t=e[ba];if(!t){const r=Kt(Ni,Ci,Ii,e);t=(i,n)=>Aa(i,n,r),e[ba]=t}return t}function Aa(e,t,r){(function(i,n,s){const a=512&n?0:-1,c=i.length,l=c+((n=64&n?256&n:!!c&&ui(i[c-1]))?-1:0);for(let u=0;u<l;u++)s(u-a,i[u]);if(n){i=i[c-1];for(const u in i)!isNaN(u)&&s(+u,i[u])}})(e,0|e[k]|(r.T[1]?512:0),(i,n)=>{if(n!=null){var s=function(a,c){var l=a[c];if(l)return l;if((l=a.ga)&&(l=l[c])){var u=(l=ka(l))[0].h;if(l=l[1]){const h=Sa(l),f=Kt(Ni,Ci,Ii,l).T;l=a.la?_a(f,h):(w,m,g)=>u(w,m,g,f,h)}else l=u;return a[c]=l}}(r,i);s&&s(t,n,i)}}),(e=kn(e))&&function(i,n){gr(i,i.g.end());for(let s=0;s<n.length;s++)gr(i,pn(n[s])||new Uint8Array(0))}(t,e)}function xr(e,t){if(Array.isArray(t)){var r=0|t[k];if(4&r)return t;for(var i=0,n=0;i<t.length;i++){const s=e(t[i]);s!=null&&(t[n++]=s)}return n<i&&(t.length=n),ae(t,-6145&(5|r)),2&r&&Object.freeze(t),t}}function pe(e,t,r){return new pr(e,t,r)}function yr(e,t,r){return new pr(e,t,r)}function xe(e,t,r){K(e,0|e[k],t,r)}var Qu=ji(function(e,t,r,i,n){return e.h===2&&(e=Wr(e,Nt([void 0,void 0],i,!0),n),St(i=0|t[k]),(n=mt(t,i,r))instanceof nt?2&n.M?((n=n.da()).push(e),K(t,i,r,n)):n.Ja(e):Array.isArray(n)?(2&(0|n[k])&&K(t,i,r,n=ea(n)),n.push(e)):K(t,i,r,[e]),!0)},function(e,t,r,i,n){if(t instanceof nt)t.forEach((s,a)=>{Ti(e,r,Nt([a,s],i,!1),n)});else if(Array.isArray(t))for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&Ti(e,r,Nt(a,i,!1),n)}});function Ta(e,t,r){if(t=function(i){if(i==null)return i;const n=typeof i;if(n==="bigint")return String(Ur(64,i));if(Gr(i)){if(n==="string")return $o(i);if(n==="number")return Nn(i)}}(t),t!=null&&(typeof t=="string"&&ha(t),t!=null))switch(Ne(e,r,0),typeof t){case"number":e=e.g,zt(t),wr(e,U,Z);break;case"bigint":r=BigInt.asUintN(64,t),r=new Zn(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),wr(e.g,r.h,r.g);break;default:r=ha(t),wr(e.g,r.h,r.g)}}function ja(e,t,r){(t=lr(t))!=null&&t!=null&&(Ne(e,r,0),Si(e.g,t))}function Na(e,t,r){(t=Oo(t))!=null&&(Ne(e,r,0),e.g.g.push(t?1:0))}function Ca(e,t,r){(t=dr(t))!=null&&Ai(e,r,fo(t))}function Ia(e,t,r,i,n){Ti(e,r,Ea(t,i),n)}function Ma(e,t,r){t==null||typeof t=="string"||t instanceof wt||($t(t)?$t(t)&&yn(To):t=void 0),t!=null&&Ai(e,r,zn(t).buffer)}function La(e,t,r){return(e.h===5||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,Kn,t):t.push(Kn(e.g)),!0)}var bt=pe(function(e,t,r){if(e.h!==1)return!1;var i=e.g;e=Yn(i);const n=Yn(i);i=2*(n>>31)+1;const s=n>>>20&2047;return e=4294967296*(1048575&n)+e,xe(t,r,s==2047?e?NaN:i*(1/0):s==0?5e-324*i*e:i*Math.pow(2,s-1075)*(e+4503599627370496)),!0},function(e,t,r){(t=jt(t))!=null&&(Ne(e,r,1),e=e.g,(r=Fo||(Fo=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),U=r.getUint32(0,!0),Z=r.getUint32(4,!0),zr(e,U),zr(e,Z))},Ze()),ce=pe(function(e,t,r){return e.h===5&&(xe(t,r,Kn(e.g)),!0)},function(e,t,r){(t=jt(t))!=null&&(Ne(e,r,5),e=e.g,Sn(t),zr(e,U))},ss),Ju=yr(La,function(e,t,r){if((t=xr(jt,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(Ne(i,n,5),i=i.g,Sn(s),zr(i,U))}},ss),us=yr(La,function(e,t,r){if((t=xr(jt,t))!=null&&t.length){Ne(e,r,2),mr(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,Sn(t[i]),zr(r,U)}},ss),Mt=pe(function(e,t,r){return e.h===0&&(xe(t,r,Hn(e.g,Tn)),!0)},Ta,ma),ds=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=Hn(e.g,Tn))===0?void 0:e),!0)},Ta,ma),Zu=pe(function(e,t,r){return e.h===0&&(xe(t,r,Hn(e.g,An)),!0)},function(e,t,r){if((t=Lu(t))!=null&&(typeof t=="string"&&da(t),t!=null))switch(Ne(e,r,0),typeof t){case"number":e=e.g,zt(t),wr(e,U,Z);break;case"bigint":r=BigInt.asUintN(64,t),r=new Jn(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),wr(e.g,r.h,r.g);break;default:r=da(t),wr(e.g,r.h,r.g)}},Ze()),ee=pe(function(e,t,r){return e.h===0&&(xe(t,r,It(e.g)),!0)},ja,ns),Mi=yr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,It,t):t.push(It(e.g)),!0)},function(e,t,r){if((t=xr(lr,t))!=null&&t.length){r=es(e,r);for(let i=0;i<t.length;i++)Si(e.g,t[i]);ts(e,r)}},ns),br=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=It(e.g))===0?void 0:e),!0)},ja,ns),H=pe(function(e,t,r){return e.h===0&&(xe(t,r,qn(e.g)),!0)},Na,fa),vr=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=qn(e.g))===!1?void 0:e),!0)},Na,fa),me=yr(function(e,t,r){return e.h===2&&(e=Qn(e),fr(t,0|t[k],r,!1).push(e),!0)},function(e,t,r){if((t=xr(dr,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&Ai(i,n,fo(s))}},is),Lt=pe(function(e,t,r){return e.h===2&&(xe(t,r,(e=Qn(e))===""?void 0:e),!0)},Ca,is),R=pe(function(e,t,r){return e.h===2&&(xe(t,r,Qn(e)),!0)},Ca,is),ue=function(e,t,r=rs){return new pr(e,t,r)}(function(e,t,r,i,n){return e.h===2&&(i=Nt(void 0,i,!0),fr(t,0|t[k],r,!0).push(i),Wr(e,i,n),!0)},function(e,t,r,i,n){if(Array.isArray(t))for(let s=0;s<t.length;s++)Ia(e,t[s],r,i,n)}),O=ji(function(e,t,r,i,n,s){return e.h===2&&(ta(t,0|t[k],s,r),Wr(e,t=$n(t,i,r),n),!0)},Ia),Fa=pe(function(e,t,r){return e.h===2&&(xe(t,r,ua(e)),!0)},Ma,ga),ed=yr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,yt,t):t.push(yt(e.g)),!0)},function(e,t,r){if((t=xr(Bo,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(Ne(i,n,0),mr(i.g,s))}},wa),td=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=yt(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Bo(t))!=null&&t!=null&&(Ne(e,r,0),mr(e.g,t))},wa),Ce=pe(function(e,t,r){return e.h===0&&(xe(t,r,It(e.g)),!0)},function(e,t,r){(t=lr(t))!=null&&(t=parseInt(t,10),Ne(e,r,0),Si(e.g,t))},pa);class rd{constructor(t,r){this.h=t,this.g=r,this.l=P,this.m=S,this.defaultValue=void 0}register(){oi(this)}}function et(e,t){return new rd(e,t)}function Ft(e,t){return(r,i)=>{if(Ei.length){const s=Ei.pop();s.o(i),Xn(s.g,r,i),r=s}else r=new class{constructor(s,a){if(ca.length){const c=ca.pop();Xn(c,s,a),s=c}else s=new class{constructor(c,l){this.h=null,this.m=!1,this.g=this.l=this.j=0,Xn(this,c,l)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,a);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(a)}o({fa:s=!1}={}){this.fa=s}}(r,i);try{const s=new e,a=s.u;ls(t)(a,r);var n=s}finally{r.g.clear(),r.m=-1,r.h=-1,Ei.length<100&&Ei.push(r)}return n}}function Li(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const a=this.g;return this.g=[],a}}}};Aa(this.u,t,Kt(Ni,Ci,Ii,e)),gr(t,t.g.end());const r=new Uint8Array(t.h),i=t.l,n=i.length;let s=0;for(let a=0;a<n;a++){const c=i[a];r.set(c,s),s+=c.length}return t.l=[r],r}}var Pa=class extends y{constructor(e){super(e)}},Da=[0,Lt,pe(function(e,t,r){return e.h===2&&(xe(t,r,(e=ua(e))===Wt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof y){const i=t.Oa;return void(i&&(t=i(t),t!=null&&Ai(e,r,zn(t).buffer)))}if(Array.isArray(t))return}Ma(e,t,r)},ga)];let hs,Ra=globalThis.trustedTypes;function Oa(e){hs===void 0&&(hs=function(){let r=null;if(!Ra)return r;try{const i=n=>n;r=Ra.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return r}());var t=hs;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function id(e,...t){if(t.length===0)return Oa(e[0]);let r=e[0];for(let i=0;i<t.length;i++)r+=encodeURIComponent(t[i])+e[i+1];return Oa(r)}var Ba=[0,ee,Ce,H,-1,Mi,Ce,-1],nd=class extends y{constructor(e){super(e)}},Ua=[0,H,R,H,Ce,-1,yr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,zu,t):t.push(It(e.g)),!0)},function(e,t,r){if((t=xr(lr,t))!=null&&t.length){r=es(e,r);for(let i=0;i<t.length;i++)Si(e.g,t[i]);ts(e,r)}},pa),R,-1,[0,H,-1],Ce,H,-1],Ga=[0,R,-2],Va=class extends y{constructor(e){super(e)}},$a=[0],Wa=[0,ee,H,1,H,-3],Ie=class extends y{constructor(e){super(e,2)}},le={};le[336783863]=[0,R,H,-1,ee,[0,[1,2,3,4,5,6,7,8,9],O,$a,O,Ua,O,Ga,O,Wa,O,Ba,O,[0,R,-2],O,[0,R,Ce],O,[0,Ce,R,-1],O,[0,Ce,-1]],[0,R],H,[0,[1,3],[2,4],O,[0,Mi],-1,O,[0,me],-1,ue,[0,R,-1]],R];var za=[0,ds,-1,vr,-3,ds,Mi,Lt,br,ds,-1,vr,br,vr,-2,Lt];function Me(e,t){Bn(e,2,ur(t),"")}function W(e,t){yi(e,3,t)}function L(e,t){yi(e,4,t)}var ye=class extends y{constructor(e){super(e,500)}o(e){return S(this,0,7,e)}},Hr=[-1,{}],Ha=[0,R,1,Hr],qa=[0,R,me,Hr];function Le(e,t){bi(e,1,ye,t)}function z(e,t){yi(e,10,t)}function D(e,t){yi(e,15,t)}var Ee=class extends y{constructor(e){super(e,500)}o(e){return S(this,0,1001,e)}},Ya=[-500,ue,[-500,Lt,-1,me,-3,[-2,le,H],ue,Da,br,-1,Ha,qa,ue,[0,Lt,vr],Lt,za,br,me,987,me],4,ue,[-500,R,-1,[-1,{}],998,R],ue,[-500,R,me,-1,[-2,{},H],997,me,-1],br,ue,[-500,R,me,Hr,998,me],me,br,Ha,qa,ue,[0,Lt,-1,Hr],me,-2,za,Lt,-1,vr,[0,vr,td],978,Hr,ue,Da];Ee.prototype.g=Li(Ya);var sd=Ft(Ee,Ya),od=class extends y{constructor(e){super(e)}},Ka=class extends y{constructor(e){super(e)}g(){return pt(this,od,1)}},Xa=[0,ue,[0,ee,ce,R,-1]],Fi=Ft(Ka,Xa),ad=class extends y{constructor(e){super(e)}},cd=class extends y{constructor(e){super(e)}},fs=class extends y{constructor(e){super(e)}h(){return P(this,ad,2)}g(){return pt(this,cd,5)}},Qa=Ft(class extends y{constructor(e){super(e)}},[0,me,Mi,us,[0,Ce,[0,ee,-3],[0,ce,-3],[0,ee,-1,[0,ue,[0,ee,-2]]],ue,[0,ce,-1,R,ce]],R,-1,Mt,ue,[0,ee,ce],me,Mt]),Ja=class extends y{constructor(e){super(e)}},_r=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,ce,-4]]),Za=class extends y{constructor(e){super(e)}},qr=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,ce,-4]]),ld=class extends y{constructor(e){super(e)}},ud=[0,ee,-1,us,Ce],ec=class extends y{constructor(e){super(e)}};ec.prototype.g=Li([0,ce,-4,Mt]);var dd=class extends y{constructor(e){super(e)}},hd=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,1,ee,R,Xa],Mt]),tc=class extends y{constructor(e){super(e)}},fd=class extends y{constructor(e){super(e)}ma(){const e=Zo(this);return e??Wt()}},wd=class extends y{constructor(e){super(e)}},rc=[1,2],md=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,rc,O,[0,us],O,[0,Fa],ee,R],Mt]),ws=class extends y{constructor(e){super(e)}},ic=[0,R,ee,ce,me,-1],nc=class extends y{constructor(e){super(e)}},gd=[0,H,-1],sc=class extends y{constructor(e){super(e)}},Pi=[1,2,3,4,5],Di=class extends y{constructor(e){super(e)}g(){return Zo(this)!=null}h(){return Ge(this,2)!=null}},q=class extends y{constructor(e){super(e)}g(){return Oo(hr(this,2))??!1}},oc=[0,Fa,R,[0,ee,Mt,-1],[0,Zu,Mt]],ne=[0,oc,H,[0,Pi,O,Wa,O,Ua,O,Ba,O,$a,O,Ga],Ce],Ri=class extends y{constructor(e){super(e)}},ms=[0,ne,ce,-1,ee],pd=et(502141897,Ri);le[502141897]=ms;var xd=Ft(class extends y{constructor(e){super(e)}},[0,[0,Ce,-1,Ju,ed],ud]),ac=class extends y{constructor(e){super(e)}},cc=class extends y{constructor(e){super(e)}},gs=[0,ne,ce,[0,ne],H],lc=[0,ne,ms,gs,ce,[0,[0,oc]]],yd=et(508968150,cc);le[508968150]=lc,le[508968149]=gs;var uc=class extends y{constructor(e){super(e)}},bd=et(513916220,uc);le[513916220]=[0,ne,lc,ee];var kr=class extends y{constructor(e){super(e)}h(){return P(this,ws,2)}g(){$(this,2)}},dc=[0,ne,ic];le[478825465]=dc;var vd=class extends y{constructor(e){super(e)}},hc=class extends y{constructor(e){super(e)}},ps=class extends y{constructor(e){super(e)}},xs=class extends y{constructor(e){super(e)}},fc=class extends y{constructor(e){super(e)}},wc=[0,ne,[0,ne],dc,-1],mc=[0,ne,ce,ee],ys=[0,ne,ce],gc=[0,ne,mc,ys,ce],_d=et(479097054,fc);le[479097054]=[0,ne,gc,wc],le[463370452]=wc,le[464864288]=mc;var kd=et(462713202,xs);le[462713202]=gc,le[474472470]=ys;var Ed=class extends y{constructor(e){super(e)}},pc=class extends y{constructor(e){super(e)}},xc=class extends y{constructor(e){super(e)}},yc=class extends y{constructor(e){super(e)}},bs=[0,ne,ce,-1,ee],vs=[0,ne,ce,H];yc.prototype.g=Li([0,ne,ys,[0,ne],ms,gs,bs,vs]);var bc=class extends y{constructor(e){super(e)}},Sd=et(456383383,bc);le[456383383]=[0,ne,ic];var vc=class extends y{constructor(e){super(e)}},Ad=et(476348187,vc);le[476348187]=[0,ne,gd];var _c=class extends y{constructor(e){super(e)}},kc=class extends y{constructor(e){super(e)}},Ec=[0,Ce,-1],Td=et(458105876,class extends y{constructor(e){super(e)}g(){var e=this.u;const t=0|e[k],r=2&t;return e=function(i,n,s){var a=kc;const c=2&n;let l=!1;if(s==null){if(c)return Xo();s=[]}else if(s.constructor===nt){if(!(2&s.M)||c)return s;s=s.da()}else Array.isArray(s)?l=!!(2&(0|s[k])):s=[];if(c){if(!s.length)return Xo();l||(l=!0,ar(s))}else l&&(l=!1,s=ea(s));return l||(64&(0|s[k])?s[k]&=-33:32&n&&ci(s,32)),K(i,n,2,a=new nt(s,a,Fu,void 0)),a}(e,t,mt(e,t,2)),!r&&kc&&(e.pa=!0),e}});le[458105876]=[0,Ec,Qu,[!0,Mt,[0,R,-1,me]]];var _s=class extends y{constructor(e){super(e)}},Sc=et(458105758,_s);le[458105758]=[0,ne,R,Ec];var Ac=class extends y{constructor(e){super(e)}},jd=et(443442058,Ac);le[443442058]=[0,ne,R,ee,ce,me,-1,H,ce],le[514774813]=bs;var Tc=class extends y{constructor(e){super(e)}},Nd=et(516587230,Tc);function ks(e,t){return t=t?t.clone():new ws,e.displayNamesLocale!==void 0?$(t,1,ur(e.displayNamesLocale)):e.displayNamesLocale===void 0&&$(t,1),e.maxResults!==void 0?st(t,2,e.maxResults):"maxResults"in e&&$(t,2),e.scoreThreshold!==void 0?v(t,3,e.scoreThreshold):"scoreThreshold"in e&&$(t,3),e.categoryAllowlist!==void 0?vi(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&$(t,4),e.categoryDenylist!==void 0?vi(t,5,e.categoryDenylist):"categoryDenylist"in e&&$(t,5),t}function Es(e,t=-1,r=""){return{categories:e.map(i=>({index:Ue(i,1)??0??-1,score:ie(i,2)??0,categoryName:Ge(i,3)??""??"",displayName:Ge(i,4)??""??""})),headIndex:t,headName:r}}function jc(e){var a,c;var t=qt(e,3,jt,Ht()),r=qt(e,2,lr,Ht()),i=qt(e,1,dr,Ht()),n=qt(e,9,dr,Ht());const s={categories:[],keypoints:[]};for(let l=0;l<t.length;l++)s.categories.push({score:t[l],index:r[l]??-1,categoryName:i[l]??"",displayName:n[l]??""});if((t=(a=P(e,fs,4))==null?void 0:a.h())&&(s.boundingBox={originX:Ue(t,1)??0,originY:Ue(t,2)??0,width:Ue(t,3)??0,height:Ue(t,4)??0,angle:0}),(c=P(e,fs,4))==null?void 0:c.g().length)for(const l of P(e,fs,4).g())s.keypoints.push({x:xi(l,1)??0,y:xi(l,2)??0,score:xi(l,4)??0,label:Ge(l,3)??""});return s}function Oi(e){const t=[];for(const r of pt(e,Za,1))t.push({x:ie(r,1)??0,y:ie(r,2)??0,z:ie(r,3)??0,visibility:ie(r,4)??0});return t}function Yr(e){const t=[];for(const r of pt(e,Ja,1))t.push({x:ie(r,1)??0,y:ie(r,2)??0,z:ie(r,3)??0,visibility:ie(r,4)??0});return t}function Nc(e){return Array.from(e,t=>t>127?t-256:t)}function Cc(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,i=0,n=0;for(let s=0;s<e.length;s++)r+=e[s]*t[s],i+=e[s]*e[s],n+=t[s]*t[s];if(i<=0||n<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(i*n)}let Bi;le[516587230]=[0,ne,bs,vs,ce],le[518928384]=vs;const Cd=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Ic(){if(Bi===void 0)try{await WebAssembly.instantiate(Cd),Bi=!0}catch{Bi=!1}return Bi}async function Kr(e,t=id``){const r=await Ic()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Xt=class{};function Mc(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Lc(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",n=>{i(n)},!1),document.body.appendChild(t)})}importScripts(e.toString())}function Fc(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function E(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Pc(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[i,n]=Fc(t);return!e.l||i===e.i.canvas.width&&n===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=n),[i,n]}function Dc(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const i=new Uint32Array(t.length);for(let n=0;n<t.length;n++)i[n]=e.i.stringToNewUTF8(t[n]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),r(t);for(const n of i)e.i._free(n);e.i._free(t)}function ot(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function Pt(e,t,r){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(n,s,a)=>{s?(r(i,a),i=[]):i.push(n)}}Xt.forVisionTasks=function(e){return Kr("vision",e)},Xt.forTextTasks=function(e){return Kr("text",e)},Xt.forGenAiExperimentalTasks=function(e){return Kr("genai_experimental",e)},Xt.forGenAiTasks=function(e){return Kr("genai",e)},Xt.forAudioTasks=function(e){return Kr("audio",e)},Xt.isSimdSupported=function(){return Ic()};async function Id(e,t,r,i){return e=await(async(n,s,a,c,l)=>{if(s&&await Lc(s),!self.ModuleFactory||a&&(await Lc(a),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&l&&((s=self.Module).locateFile=l.locateFile,l.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=l.mainScriptUrlOrBlob)),l=await self.ModuleFactory(self.Module||l),self.ModuleFactory=self.Module=void 0,new n(l,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:n=>n.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&n.endsWith(".data")?r.assetBinaryPath.toString():n}),await e.o(i),e}function Ss(e,t){const r=P(e.baseOptions,Di,1)||new Di;typeof t=="string"?($(r,2,ur(t)),$(r,1)):t instanceof Uint8Array&&($(r,1,_n(t,!1)),$(r,2)),S(e.baseOptions,0,1,r)}function Rc(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(r=>r.message).join(", "))}finally{e.G=[]}}function x(e,t){e.B=Math.max(e.B,t)}function Ui(e,t){e.A=new ye,Me(e.A,"PassThroughCalculator"),W(e.A,"free_memory"),L(e.A,"free_memory_unused_out"),z(t,"free_memory"),Le(t,e.A)}function Er(e,t){W(e.A,t),L(e.A,t+"_unused_out")}function Gi(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var As=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,i,n,s,a,c;if(t){const l=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((i=e.baseOptions)!=null&&i.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((n=P(this.baseOptions,Di,1))!=null&&n.g()||(s=P(this.baseOptions,Di,1))!=null&&s.h()||(a=e.baseOptions)!=null&&a.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(u,h){let f=P(u.baseOptions,sc,3);if(!f){var w=f=new sc,m=new Va;Vr(w,4,Pi,m)}"delegate"in h&&(h.delegate==="GPU"?(h=f,w=new nd,Vr(h,2,Pi,w)):(h=f,w=new Va,Vr(h,4,Pi,w))),S(u.baseOptions,0,3,f)}(this,l),l.modelAssetPath)return fetch(l.modelAssetPath.toString()).then(u=>{if(u.ok)return u.arrayBuffer();throw Error(`Failed to fetch model: ${l.modelAssetPath} (${u.status})`)}).then(u=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(u),!0,!1,!1),Ss(this,"/model.dat"),this.m(),this.J()});if(l.modelAssetBuffer instanceof Uint8Array)Ss(this,l.modelAssetBuffer);else if(l.modelAssetBuffer)return async function(u){const h=[];for(var f=0;;){const{done:w,value:m}=await u.read();if(w)break;h.push(m),f+=m.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];u=new Uint8Array(f),f=0;for(const w of h)u.set(w,f),f+=w.length;return u}(l.modelAssetBuffer).then(u=>{Ss(this,u),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=sd(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.G.push(Error(i))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Rc(this)}finishProcessing(){this.g.finishProcessing(),Rc(this)}close(){this.A=void 0,this.g.closeGraph()}};function vt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}As.prototype.close=As.prototype.close;class Md{constructor(t,r,i,n){this.g=t,this.h=r,this.m=i,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Oc(e,t,r){const i=e.g;if(r=vt(i.createShader(r),"Failed to create WebGL shader"),i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(r)}`);return i.attachShader(e.h,r),r}function Bc(e,t){const r=e.g,i=vt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(i);const n=vt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,n),r.enableVertexAttribArray(e.P),r.vertexAttribPointer(e.P,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const s=vt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.J),r.vertexAttribPointer(e.J,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new Md(r,i,n,s)}function Ts(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function js(e,t,r,i){return Ts(e,t),e.h||(e.m(),e.C()),r?(e.s||(e.s=Bc(e,!0)),r=e.s):(e.v||(e.v=Bc(e,!1)),r=e.v),t.useProgram(e.h),r.bind(),e.l(),e=i(),r.g.bindVertexArray(null),e}function Vi(e,t,r){return Ts(e,t),e=vt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function $i(e,t,r){Ts(e,t),e.A||(e.A=vt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function Ns(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Cs=class{G(){return`
|
|
9
|
+
*/var Mg=Symbol.for("react.transitional.element"),Cg=Symbol.for("react.fragment");function P2(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:Mg,type:e,key:i,ref:t!==void 0?t:null,props:n}}wr.Fragment=Cg,wr.jsx=P2,wr.jsxs=P2,J2.exports=wr;var u=J2.exports;const Gu={},pn={api:{baseUrl:"/api",retryConfig:{attempts:3,backoff:"exponential",baseDelay:1e3}},ui:{baseColor:"#3B82F6",borderRadius:"8px"},interview:{allow_answer_editing:!0,timers:{thinkingDuration:30,answeringDuration:120,editingDuration:30},stt:{provider:"groq",model:"whisper-large-v3-turbo",language:"en"},tts:{provider:"piper"},proctoring:{enabled:!0,gazeAnalysisEnabled:!0}}},Hu="iw-storage";function Dg(){if(!(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Bu&&Bu.tagName.toUpperCase()==="SCRIPT"&&Bu.src||new URL("widget.umd.js",document.baseURI).href}<"u"&&(Gu!=null&&Gu.VITE_IW_SECRET)))return typeof process<"u"&&process.env.NEXT_PUBLIC_IW_SECRET?process.env.NEXT_PUBLIC_IW_SECRET:typeof window<"u"&&window.__IW_SECRET__?window.__IW_SECRET__:"proctoring-data-seed"}const $2=Dg(),gr=30,kg={SCREENSHOT:"screenshot"},Vu="AES-GCM",Fu=12;async function eh(e){const n=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",n);return crypto.subtle.importKey("raw",i,Vu,!1,["encrypt","decrypt"])}function Og(){return crypto.getRandomValues(new Uint8Array(Fu))}async function Lg(e,t="default-seed"){try{const n=typeof e=="string"?e:JSON.stringify(e),a=new TextEncoder().encode(n),l=await eh(t),s=Og(),r=await crypto.subtle.encrypt({name:Vu,iv:s},l,a),o=new Uint8Array(s.length+r.byteLength);return o.set(new Uint8Array(s),0),o.set(new Uint8Array(r),s.length),btoa(String.fromCharCode(...Array.from(o)))}catch(n){throw console.error("Encryption failed:",n),new Error("Failed to encrypt data")}}async function Ug(e,t="default-seed"){try{const n=atob(e),i=new Uint8Array(n.length);for(let c=0;c<n.length;c++)i[c]=n.charCodeAt(c);const a=i.slice(0,Fu),l=i.slice(Fu),s=await eh(t),r=await crypto.subtle.decrypt({name:Vu,iv:a},s,l);return new TextDecoder().decode(r)}catch(n){throw console.error("Decryption failed:",n),new Error("Failed to decrypt data")}}async function zg(e,t="default-seed"){return Lg(e,t)}async function Rg(e,t="default-seed"){const n=await Ug(e,t);try{return JSON.parse(n)}catch{return n}}const ql=p.createContext(null),Bg=async()=>{try{const e=sessionStorage.getItem(Hu);if(e){const n=(await Rg(e,$2)).state;return{logViolations:(n==null?void 0:n.logViolations)||[],totalViolations:(n==null?void 0:n.totalViolations)||0,gazeViolationCounters:(n==null?void 0:n.gazeViolationCounters)||{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:(n==null?void 0:n.referenceSet)??!1,referenceRef:(n==null?void 0:n.referenceRef)??{x:.5,y:.5,noseX:.5,noseY:.5}}}}catch(e){console.error("Failed to load proctoring data from session storage:",e)}return{logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}},Yl=async e=>{try{const t=await zg({state:e,version:0},$2);sessionStorage.setItem(Hu,t)}catch(t){console.error("Failed to save proctoring data to session storage:",t)}},Gg=({children:e})=>{const t=p.useRef({logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}),n=p.useRef(new Set);p.useEffect(()=>{Bg().then(f=>{t.current=f,i()})},[]);const i=p.useCallback(()=>{n.current.forEach(f=>f())},[]),a=p.useCallback(f=>(n.current.add(f),()=>{n.current.delete(f)}),[]),l=p.useCallback(()=>t.current,[]),s=p.useCallback(f=>{t.current={...t.current,logViolations:[...t.current.logViolations,f],totalViolations:t.current.totalViolations+1},Yl(t.current),i()},[i]),r=p.useCallback(f=>{const w={...t.current.gazeViolationCounters};f==="looking_away"&&(w.lookingAwayCount+=1),f==="no_face_detected"&&(w.noFaceDetectedCount+=1),f==="multiple_faces"&&(w.multipleFacesCount+=1),w.totalGazeViolations=w.lookingAwayCount+w.noFaceDetectedCount+w.multipleFacesCount,t.current={...t.current,gazeViolationCounters:w},Yl(t.current),i()},[i]),o=p.useCallback(()=>{t.current={...t.current,logViolations:[],totalViolations:0},Yl(t.current),i()},[i]),c=p.useCallback(()=>{t.current={...t.current,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0}},Yl(t.current),i()},[i]),d=p.useCallback((f,w)=>{t.current={...t.current,referenceSet:f,referenceRef:w},Yl(t.current),i()},[i]),h=p.useMemo(()=>({getState:l,addViolation:s,clearViolations:o,subscribe:a,incrementGazeViolation:r,clearGazeViolationCounters:c,setReferenceData:d}),[l,s,o,a,r,c,d]);return u.jsx(ql.Provider,{value:h,children:e})},th=()=>{const e=p.useContext(ql);if(!e)throw new Error("useProctoringStore must be used within a ProctoringProvider");const t=p.useSyncExternalStore(e.subscribe,e.getState,e.getState);return{logViolations:t.logViolations,totalViolations:t.totalViolations,addViolation:e.addViolation,clearViolations:e.clearViolations,gazeViolationCounters:t.gazeViolationCounters,referenceSet:t.referenceSet,referenceRef:t.referenceRef,incrementGazeViolation:e.incrementGazeViolation,clearGazeViolationCounters:e.clearGazeViolationCounters,setReferenceData:e.setReferenceData}},Hg=()=>{const e=p.useContext(ql);if(!e)throw new Error("useViolations must be used within a ProctoringProvider");return p.useSyncExternalStore(e.subscribe,()=>e.getState().logViolations,()=>e.getState().logViolations)},Vg=()=>{const e=p.useContext(ql);if(!e)throw new Error("useTotalViolations must be used within a ProctoringProvider");return p.useSyncExternalStore(e.subscribe,()=>e.getState().totalViolations,()=>e.getState().totalViolations)},Fg=()=>{const e=p.useContext(ql);if(!e)throw new Error("useProctoringActions must be used within a ProctoringProvider");return{addViolation:e.addViolation,clearViolations:e.clearViolations}},nh=p.createContext(null);function qu({config:e={},children:t}){var i,a,l,s;const n={api:{...pn.api,...e.api,retryConfig:{...pn.api.retryConfig,...(i=e.api)==null?void 0:i.retryConfig}},ui:{...pn.ui,...e.ui},interview:{...pn.interview,...e.interview,timers:{...pn.interview.timers,...(a=e.interview)==null?void 0:a.timers},stt:{...pn.interview.stt,...(l=e.interview)==null?void 0:l.stt},tts:{...pn.interview.tts,...(s=e.interview)==null?void 0:s.tts}}};return u.jsx(nh.Provider,{value:n,children:u.jsx(Gg,{children:t})})}function pr(){const e=p.useContext(nh);if(!e)throw new Error("useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>");return e}function ih(){return pr().api||pn.api}function yr(){return pr().ui||pn.ui}function Yu(){return pr().interview||pn.interview}function qg(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Yg(e,t,n){return"#"+[e,t,n].map(i=>{const a=Math.round(i).toString(16);return a.length===1?"0"+a:a}).join("")}function Xg(e,t){const n=qg(e);if(!n)return e;const i=n.r+(255-n.r)*t,a=n.g+(255-n.g)*t,l=n.b+(255-n.b)*t;return Yg(i,a,l)}function Qg(e){return new Promise(t=>setTimeout(t,e))}function Zg(e){return`linear-gradient(to left, ${Xg(e,.4)}, ${e})`}const Kg=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);function Ig(e){try{const t=e.split(".");if(t.length!==3||!t[1])throw new Error("Invalid JWT token");const i=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=i.padEnd(i.length+(4-i.length%4)%4,"="),l=atob(a);return JSON.parse(l)}catch(t){return console.error("Error decoding JWT:",t),null}}const ah=e=>{var t;return!e||typeof e!="string"?"":(t=e.charAt(0))==null?void 0:t.toUpperCase()},Xu=e=>{const t=Math.max(0,Math.floor(e)),n=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${n}:${i}`},Xl=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),u.jsx("path",{d:"M12 9v4"}),u.jsx("path",{d:"M12 17h.01"})]}),Wg=e=>u.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-bolt-icon prefix__lucide-bolt",...e,children:[u.jsx("path",{d:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"}),u.jsx("circle",{cx:12,cy:12,r:4})]}),Jg=e=>u.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-camera-off-icon prefix__lucide-camera-off",...e,children:[u.jsx("path",{d:"M14.564 14.558a3 3 0 11-4.122-4.121M2 2l20 20"}),u.jsx("path",{d:"M20 20H4a2 2 0 01-2-2V9a2 2 0 012-2h1.997a2 2 0 00.819-.175M9.695 4.024A2 2 0 0110.004 4h3.993a2 2 0 011.76 1.05l.486.9A2 2 0 0018.003 7H20a2 2 0 012 2v7.344"})]}),vr=e=>u.jsx("svg",{width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.jsx("path",{d:"M0.75 5.5C0.75 5.5 2.35 6.4125 3.15 7.75C3.15 7.75 5.55 2.5 8.75 0.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),lh=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("path",{d:"M12 2a10 10 0 0 1 7.38 16.75"}),u.jsx("path",{d:"M12 6v6l4 2"}),u.jsx("path",{d:"M2.5 8.875a10 10 0 0 0-.5 3"}),u.jsx("path",{d:"M2.83 16a10 10 0 0 0 2.43 3.4"}),u.jsx("path",{d:"M4.636 5.235a10 10 0 0 1 .891-.857"}),u.jsx("path",{d:"M8.644 21.42a10 10 0 0 0 7.631-.38"})]}),Pg=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("path",{d:"M12 6v6l4 2"}),u.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),sh=e=>u.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",...e,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),rh=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),u.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),$g=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),u.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),u.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),u.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),e5=e=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M2.66797 2H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M3.66797 2V3.35359C3.66797 4.18151 4.05252 4.96247 4.70874 5.46726L8.0013 8L11.2938 5.46726C11.9501 4.96247 12.3346 4.18151 12.3346 3.35359V2",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M3.66797 14V12.6464C3.66797 11.8185 4.05252 11.0375 4.70874 10.5327L8.0013 8L11.2938 10.5327C11.9501 11.0375 12.3346 11.8185 12.3346 12.6464V14",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M2.66797 14H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"})]}),Qu=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),u.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),u.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),u.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),oh=({className:e,...t})=>u.jsx("div",{children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`iw-animate-spin ${e}`,...t,children:[u.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),u.jsx("path",{d:"M12 6l0 -3"}),u.jsx("path",{d:"M16.25 7.75l2.15 -2.15"}),u.jsx("path",{d:"M18 12l3 0"}),u.jsx("path",{d:"M16.25 16.25l2.15 2.15"}),u.jsx("path",{d:"M12 18l0 3"}),u.jsx("path",{d:"M7.75 16.25l-2.15 2.15"}),u.jsx("path",{d:"M6 12l-3 0"}),u.jsx("path",{d:"M7.75 7.75l-2.15 -2.15"})]})}),t5=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M17 7V11C17 13.7614 14.7614 16 12 16C9.23858 16 7 13.7614 7 11V7C7 4.23858 9.23858 2 12 2C14.7614 2 17 4.23858 17 7Z",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M20 11C20 15.4183 16.4183 19 12 19M12 19C7.58172 19 4 15.4183 4 11M12 19V22M12 22H15M12 22H9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),n5=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M2 2L22 22",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M4 11C4 15.4183 7.58172 19 12 19M12 19C13.9545 19 15.7454 18.2991 17.1348 17.1348M12 19V22M12 22H15M12 22H9M20 11C20 12.6514 19.4996 14.1859 18.6422 15.4603",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M7 6.98V11C7 13.7614 9.23858 16 12 16C13.1354 16 14.1647 15.6096 15.004 14.972M16.4387 13.244C16.7973 12.5545 17 11.8309 17 11V6.98C17 4.21858 14.7614 2 12 2C10.1312 2 8.53009 2.96527 7.672 4.484",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"})]}),i5=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),u.jsx("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),u.jsx("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),a5=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),u.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),u.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),u.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),l5=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),u.jsx("path",{d:"m9 12 2 2 4-4"})]}),s5=e=>u.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-target-icon prefix__lucide-target",...e,children:[u.jsx("circle",{cx:12,cy:12,r:10}),u.jsx("circle",{cx:12,cy:12,r:6}),u.jsx("circle",{cx:12,cy:12,r:2})]}),r5=e=>u.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-users-icon prefix__lucide-users",...e,children:[u.jsx("path",{d:"M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2M16 3.128a4 4 0 010 7.744M22 21v-2a4 4 0 00-3-3.87"}),u.jsx("circle",{cx:9,cy:7,r:4})]}),o5=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M11 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M2 11C2 7.70017 2 6.05025 3.02513 5.02513C4.05025 4 5.70017 4 9 4H10C13.2998 4 14.9497 4 15.9749 5.02513C17 6.05025 17 7.70017 17 11V13C17 16.2998 17 17.9497 15.9749 18.9749C14.9497 20 13.2998 20 10 20H9C5.70017 20 4.05025 20 3.02513 18.9749C2 17.9497 2 16.2998 2 13V11Z",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M17 8.90585L17.1259 8.80196C19.2417 7.05623 20.2996 6.18336 21.1498 6.60482C22 7.02628 22 8.42355 22 11.2181V12.7819C22 15.5765 22 16.9737 21.1498 17.3952C20.2996 17.8166 19.2417 16.9438 17.1259 15.198L17 15.0941",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),u5=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M2.00195 2L21.9773 22",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M16.8517 16.8668C16.7225 17.8052 16.4666 18.4659 15.9596 18.9735C14.9357 19.9987 13.2878 19.9987 9.99206 19.9987H8.99329C5.69755 19.9987 4.04967 19.9987 3.02581 18.9735C2.00195 17.9484 2.00195 16.2985 2.00195 12.9987V10.9987C2.00195 7.69885 2.00195 6.04893 3.02581 5.0238C3.36833 4.68086 3.78068 4.45265 4.3012 4.30078",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M8.23633 4.00052C8.47821 4 8.73001 4 8.99223 4H9.99099C13.2868 4 14.9347 4 15.9585 5.02513C16.9823 6.05025 16.9823 7.70017 16.9823 11V12.7574M16.9823 9.23142L19.3019 7.52913C20.773 6.54073 21.449 7.17196 21.6675 7.64847C22.1192 8.92813 21.9769 11.3936 21.9769 14.5417C21.8704 16.555 21.5953 16.7719 21.3138 16.9939L21.3108 16.9962",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ql={FACE_DETECTED:"face_detected",NO_FACE:"no_face_detected",MULTIPLE_FACES:"multiple_faces",LOOKING_AWAY:"looking_away",CAMERA_ERROR:"camera_error"},uh={[Ql.FACE_DETECTED]:{icon:rh,iconColor:"iw-text-green-600",iconBg:"iw-bg-green-50",iconBorder:"iw-border-green-100",title:"All Good",subtitle:"Everything looks normal",description:"Your gaze is properly focused on the screen. Continue with your interview.",buttonText:"Continue"},[Ql.NO_FACE]:{icon:Jg,iconColor:"iw-text-orange-600",iconBg:"iw-bg-orange-50",iconBorder:"iw-border-orange-100",title:"Face Not Detected",subtitle:"We can't see you in the camera",description:"Please ensure you're positioned properly in front of the camera and that your face is clearly visible.",buttonText:"I Understood"},[Ql.MULTIPLE_FACES]:{icon:r5,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Multiple People Detected",subtitle:"More than one person is visible",description:"For interview integrity, please ensure you are alone in the room and only your face is visible to the camera.",buttonText:"I Understood"},[Ql.LOOKING_AWAY]:{icon:s5,iconColor:"iw-text-amber-600",iconBg:"iw-bg-amber-50",iconBorder:"iw-border-amber-200/75",title:"Stay Focused",subtitle:"We noticed you looked away from the screen",description:"To ensure interview integrity, please keep your attention on the screen throughout the session.",buttonText:"I Understood"},[Ql.CAMERA_ERROR]:{icon:Xl,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Camera Issue",subtitle:"There's a problem with your camera",description:"Please check your camera connection and permissions, then refresh the page to continue.",buttonText:"I Understood"}};function c5(e){var t;if(!navigator.onLine)return{type:"network",message:"No internet connection",retryable:!0,userMessage:"Please check your internet connection and try again."};if(e.name==="AbortError"||(t=e.message)!=null&&t.includes("timeout"))return{type:"timeout",message:"Request timed out",retryable:!0,userMessage:"The request is taking longer than expected. Please try again."};if(e.status){const{status:n}=e;if(n===401||n===403)return{type:"auth",status:n,message:"Authentication failed",retryable:!1,userMessage:"Your session has expired. Please refresh the page."};if(n===429)return{type:"rate-limit",status:n,message:"Too many requests",retryable:!0,userMessage:"Please wait a moment before trying again."};if(n>=500)return{type:"server",status:n,message:`Server error: ${n}`,retryable:!0,userMessage:"Our servers are experiencing issues. Please try again in a few moments."};if(n>=400)return{type:"client",status:n,message:`Client error: ${n}`,retryable:!1,userMessage:"There was an issue with your request. Please check your input."}}return{type:"unknown",message:e.message||"Unknown error occurred",retryable:!0,userMessage:"Something unexpected happened. Please try again.",originalError:e}}async function si(e,t={},n={attempts:3,backoff:"exponential",baseDelay:1e3,maxDelay:1e4,jitter:!0}){let i;for(let a=1;a<=n.attempts;a++)try{const l=new AbortController,s=setTimeout(()=>l.abort(),6e4),r=await fetch(e,{...t,signal:l.signal});if(clearTimeout(s),r.status>=400&&r.status<500&&r.status!==429)return r;if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);return r}catch(l){i=l;const s=c5(l);if(!s.retryable||a===n.attempts)throw s;const r=f5(a,n);console.warn(`API request failed (attempt ${a}/${n.attempts}), retrying in ${r}ms:`,s.message),await new Promise(o=>setTimeout(o,r))}throw i}function f5(e,t){let n;return t.backoff==="exponential"?n=t.baseDelay*Math.pow(2,e-1):n=t.baseDelay,n=Math.min(n,t.maxDelay),t.jitter&&(n=n*(.5+Math.random()*.5)),Math.round(n)}const ri={v2:"/v2"},oi={GENERATE_QUESTION:e=>`${ri.v2}/interviews/${e}/next-question`,SCREENSHOT_UPLOAD:e=>`${ri.v2}/interviews/${e}/assets/upload-url`,CONFIRM_UPLOAD:e=>`${ri.v2}/interviews/assets/${e}/confirm`,TRANSCRIBE_ANSWER:e=>`${ri.v2}/interviews/${e}/transcribe-answer`,SUBMIT_ANSWER:e=>`${ri.v2}/interviews/${e}/submit-answer`,EXIT:e=>`${ri.v2}/interviews/${e}/exit`,CONFIG:e=>`${ri.v2}/interviews/${e}/config`,TRANSCRIPTION:e=>`${ri.v2}/interviews/${e}/transcript`};class ch{constructor(t={}){Bt(this,"config");this.config=t}updateConfig(t){this.config={...this.config,...t}}getHeaders(){var n;const t={"Content-Type":"application/json"};return(n=this.config)!=null&&n.authToken&&(t.Authorization=`Bearer ${this.config.authToken}`),t}getBaseUrl(){var t;return((t=this.config)==null?void 0:t.baseUrl)||"/api"}async generateQuestion({interviewId:t,isInterviewDone:n=!1}){const i=await si(`${this.getBaseUrl()}${oi.GENERATE_QUESTION(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({interview_id:t,is_interview_done:n})});if(!i.ok)throw new Error(`Failed to get questions: ${i.status}`);return await i.json()}async submitAnswer({interviewId:t,qnaId:n,answer:i}){const a=await si(`${this.getBaseUrl()}${oi.SUBMIT_ANSWER(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({qna_id:n,answer_text:i})});if(!a.ok)throw new Error(`Failed to submit answer: ${a.status}`);return await a.json()}async exitInterview(t){const n=await si(`${this.getBaseUrl()}${oi.EXIT(t)}`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to exit interview: ${n.status}`)}async getInterviewConfig(t){const n=await si(`${this.getBaseUrl()}${oi.CONFIG(t)}`,{method:"GET",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get interview config: ${n.status}`);return await n.json()}async requestScreenshotUploadUrl(t,n=`screenshot-${Date.now()}.jpeg`){const i=await si(`${this.getBaseUrl()}${oi.SCREENSHOT_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({filename:n,mime_type:"image/jpeg",asset_type:kg.SCREENSHOT})});if(!i.ok)throw new Error(`Failed to request screenshot upload URL: ${i.status}`);return await i.json()}async uploadScreenshot(t,n){const i=await fetch(t,{method:"PUT",body:n,headers:{"Content-Type":"image/jpeg"}});if(!i.ok)throw new Error(`Failed to upload screenshot: ${i.status}`)}async confirmScreenshotUpload(t){const n=await si(`${this.getBaseUrl()}${oi.CONFIRM_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to confirm screenshot upload: ${n.status}`)}async getInterviewTranscription(t){const n=await si(`${this.getBaseUrl()}${oi.TRANSCRIPTION(t)}`,{method:"GET",headers:{...this.getHeaders(),"x-auth-token":"interview-engine-api-key"}});if(!n.ok)throw new Error(`Failed to get interview transcription: ${n.status}`);return await n.json()}}const d5=new ch,h5=({gazeAnalysisEnabled:e,isModelLoaded:t,stats:n,statusMessage:i,loadingProgress:a})=>u.jsx("div",{className:"iw-w-full",children:u.jsxs("div",{className:"iw-border-strock iw-rounded-md iw-border iw-bg-gray-50 iw-p-4",children:[u.jsxs("h3",{className:"iw-m-0 iw-mb-2.5",children:["Status: ",i]}),a>0&&a<100&&u.jsxs("div",{className:"iw-mb-2.5",children:[u.jsx("div",{className:"iw-h-2 iw-w-full iw-rounded iw-bg-gray-300",children:u.jsx("div",{className:"iw-h-full iw-rounded iw-bg-blue-600 iw-transition-all iw-duration-300 iw-ease-out",style:{width:`${a}%`}})}),u.jsxs("small",{className:"iw-text-gray-600",children:["Loading model... ",a.toFixed(1),"%"]})]}),u.jsxs("div",{className:"iw-grid iw-grid-cols-2 iw-gap-2.5 iw-text-sm",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"FPS:"})," ",u.jsx("span",{className:n.fps<15?"iw-text-red-600":n.fps<25?"iw-text-orange-500":"iw-text-green-600",children:n.fps})]}),u.jsxs("div",{children:[u.jsx("strong",{children:"Model:"})," ",t?"✓ Loaded":"✗ Loading"]}),e&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Engagement:"})," ",n.engagement.toFixed(1),"%"]}),u.jsxs("div",{children:[u.jsx("strong",{children:"Looking:"})," ",u.jsx("span",{className:n.isLookingAway?"iw-text-red-600":"iw-text-green-600",children:n.isLookingAway?"Away":"At Screen"})]})]})]}),n.referenceFaceNotDetected&&u.jsxs("div",{className:"iw-text-gray-dark iw-mt-2.5 iw-w-full iw-rounded-md iw-bg-[#ffeb3b] iw-p-2.5 iw-text-sm",children:[u.jsx("strong",{children:"Reference Face Not Detected"}),u.jsx("br",{}),"The previously set reference face is no longer in view."]}),n.multipleFacesDetected&&u.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-red-50 iw-p-2.5 iw-text-sm iw-text-red-700",children:[u.jsx("strong",{children:"Multiple Faces Detected"}),u.jsx("br",{}),"Please ensure only one person is in the frame."]}),!e&&u.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-blue-50 iw-p-2.5 iw-text-sm iw-text-blue-700",children:[u.jsx("strong",{children:"Gaze Analysis Disabled"}),u.jsx("br",{}),"Enable to track engagement and attention levels."]})]})}),m5=({showControls:e,isBubbleOpen:t,setIsBubbleOpen:n,setReference:i,clearCache:a,isModelLoaded:l,gazeAnalysisEnabled:s,referenceSet:r,showLandmarks:o,setShowLandmarks:c,showEngagementBar:d,setShowEngagementBar:h,handleToggleGazeAnalysis:f,stats:w,statusMessage:v,loadingProgress:x})=>e?u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:()=>n(!t),className:"iw-absolute iw-right-4 iw-bottom-4 iw-z-10 iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-full iw-text-white",children:u.jsx(Wg,{className:"iw-size-4.5"})}),t&&u.jsxs("div",{className:"iw-absolute iw-right-4 iw-bottom-16 iw-z-10 iw-max-h-96 iw-w-80 iw-overflow-y-auto iw-rounded-md iw-bg-gray-50 iw-p-4 iw-shadow-lg",children:[u.jsx("h4",{className:"m-0 mb-2.5",children:"Controls"}),u.jsx("button",{onClick:i,disabled:!l||!s,className:`iw-mb-2.5 iw-block iw-w-full iw-rounded border-none iw-px-4 iw-py-2 iw-text-sm iw-text-white ${!l||!s?"iw-cursor-not-allowed iw-bg-gray-400":"iw-cursor-pointer iw-bg-blue-600 hover:iw-bg-blue-700"}`,children:r?"Reference Set ✓":"Set Reference"}),u.jsx("button",{onClick:a,className:"iw-mb-4 iw-block iw-w-full iw-cursor-pointer iw-rounded iw-border-none iw-bg-red-600 iw-px-4 iw-py-2 iw-text-sm iw-text-white hover:iw-bg-red-700",children:"Clear Model Cache"}),u.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-2.5",children:[u.jsxs("label",{className:"iw-flex iw-cursor-pointer iw-items-center iw-gap-2",children:[u.jsx("input",{type:"checkbox",checked:s,onChange:_=>f(_.target.checked)}),u.jsx("strong",{children:"Enable Gaze Analysis"})]}),u.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${s?"iw-opacity-100":"iw-opacity-60"}`,children:[u.jsx("input",{type:"checkbox",checked:o,onChange:_=>c(_.target.checked),disabled:!s}),"Show Landmarks"]}),u.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${s?"iw-opacity-100":"iw-opacity-60"}`,children:[u.jsx("input",{type:"checkbox",checked:d,onChange:_=>h(_.target.checked),disabled:!s}),"Show Engagement Bar"]})]}),r&&u.jsx(h5,{gazeAnalysisEnabled:s,isModelLoaded:l,loadingProgress:x,stats:w,statusMessage:v})]})]}):null;var Ma=typeof self<"u"?self:{};function Ki(){throw Error("Invalid UTF8")}function fh(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let br,Zu;const w5=typeof TextDecoder<"u";let g5;const p5=typeof TextEncoder<"u";function dh(e){if(p5)e=(g5||(g5=new TextEncoder)).encode(e);else{let n=0;const i=new Uint8Array(3*e.length);for(let a=0;a<e.length;a++){var t=e.charCodeAt(a);if(t<128)i[n++]=t;else{if(t<2048)i[n++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&a<e.length){const l=e.charCodeAt(++a);if(l>=56320&&l<=57343){t=1024*(t-55296)+l-56320+65536,i[n++]=t>>18|240,i[n++]=t>>12&63|128,i[n++]=t>>6&63|128,i[n++]=63&t|128;continue}a--}t=65533}i[n++]=t>>12|224,i[n++]=t>>6&63|128}i[n++]=63&t|128}}e=n===i.length?i:i.subarray(0,n)}return e}var Ku,xr;e:{for(var hh=["CLOSURE_FLAGS"],Iu=Ma,Wu=0;Wu<hh.length;Wu++)if((Iu=Iu[hh[Wu]])==null){xr=null;break e}xr=Iu}var Zl,mh=xr&&xr[610401301];Ku=mh!=null&&mh;const wh=Ma.navigator;function Ju(e){return!!Ku&&!!Zl&&Zl.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Gt(e){var t;return(t=Ma.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function ui(){return!!Ku&&!!Zl&&Zl.brands.length>0}function Pu(){return ui()?Ju("Chromium"):(Gt("Chrome")||Gt("CriOS"))&&!(!ui()&&Gt("Edge"))||Gt("Silk")}function Er(e){return Er[" "](e),e}Zl=wh&&wh.userAgentData||null,Er[" "]=function(){};var y5=!ui()&&(Gt("Trident")||Gt("MSIE"));!Gt("Android")||Pu(),Pu(),Gt("Safari")&&(Pu()||!ui()&&Gt("Coast")||!ui()&&Gt("Opera")||!ui()&&Gt("Edge")||(ui()?Ju("Microsoft Edge"):Gt("Edg/"))||ui()&&Ju("Opera"));var gh={},Kl=null;function v5(e){const t=e.length;let n=3*t/4;n%3?n=Math.floor(n):"=.".indexOf(e[t-1])!=-1&&(n="=.".indexOf(e[t-2])!=-1?n-2:n-1);const i=new Uint8Array(n);let a=0;return function(l,s){function r(c){for(;o<l.length;){const d=l.charAt(o++),h=Kl[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return c}ph();let o=0;for(;;){const c=r(-1),d=r(0),h=r(64),f=r(64);if(f===64&&c===-1)break;s(c<<2|d>>4),h!=64&&(s(d<<4&240|h>>2),f!=64&&s(h<<6&192|f))}}(e,function(l){i[a++]=l}),a!==n?i.subarray(0,a):i}function ph(){if(!Kl){Kl={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const i=e.concat(t[n].split(""));gh[n]=i;for(let a=0;a<i.length;a++){const l=i[a];Kl[l]===void 0&&(Kl[l]=a)}}}}var yh=typeof Uint8Array<"u",vh=!y5&&typeof btoa=="function";function bh(e){if(!vh){var t;t===void 0&&(t=0),ph(),t=gh[t];var n=Array(Math.floor(e.length/3)),i=t[64]||"";let o=0,c=0;for(;o<e.length-2;o+=3){var a=e[o],l=e[o+1],s=e[o+2],r=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|s>>6],s=t[63&s],n[c++]=r+a+l+s}switch(r=0,s=i,e.length-o){case 2:s=t[(15&(r=e[o+1]))<<2]||i;case 1:e=e[o],n[c]=t[e>>2]+t[(3&e)<<4|r>>4]+s+i}return n.join("")}for(t="",n=0,i=e.length-10240;n<i;)t+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));return t+=String.fromCharCode.apply(null,n?e.subarray(n):e),btoa(t)}const xh=/[-_.]/g,b5={"-":"+",_:"/",".":"="};function x5(e){return b5[e]||""}function Eh(e){if(!vh)return v5(e);xh.test(e)&&(e=e.replace(xh,x5)),e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Ii(e){return yh&&e!=null&&e instanceof Uint8Array}var Ca={};function Wi(){return E5||(E5=new On(null,Ca))}function $u(e){Sh(Ca);var t=e.g;return(t=t==null||Ii(t)?t:typeof t=="string"?Eh(t):null)==null?t:e.g=t}var On=class{h(){return new Uint8Array($u(this)||0)}constructor(e,t){if(Sh(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let E5,S5;function Sh(e){if(e!==Ca)throw Error("illegal external caller")}function _h(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function ec(e){return _h(e=Error(e),"warning"),e}function tc(e){if(e!=null){var t=S5??(S5={}),n=t[e]||0;n>=5||(t[e]=n+1,_h(e=Error(),"incident"),function(i){Ma.setTimeout(()=>{throw i},0)}(e))}}var Sr=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Da(e,t,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var _5=Da("jas",void 0,!0),Th=Da(void 0,"0di"),Il=Da(void 0,"1oa"),ka=Da(void 0,Symbol()),T5=Da(void 0,"0actk"),Ah=Da(void 0,"8utk");const L=Sr?_5:"Ea",Nh={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},jh=Object.defineProperties;function _r(e,t){Sr||L in e||jh(e,Nh),e[L]|=t}function De(e,t){Sr||L in e||jh(e,Nh),e[L]=t}function Oa(e){return _r(e,34),e}function A5(e,t){De(t,-15615&(0|e))}function nc(e,t){De(t,-15581&(34|e))}function Tr(){return typeof BigInt=="function"}function ct(e){return Array.prototype.slice.call(e)}var ic,Wl={};function Ar(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function ac(e,t){if(e!=null){if(typeof e=="string")e=e?new On(e,Ca):Wi();else if(e.constructor!==On)if(Ii(e))e=e.length?new On(new Uint8Array(e),Ca):Wi();else{if(!t)throw Error();e=void 0}}return e}const Mh=[];function ci(e){if(2&e)throw Error()}De(Mh,55),ic=Object.freeze(Mh);class Ch{constructor(t,n,i){this.g=t,this.h=n,this.l=i}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function lc(e){return ka?e[ka]:void 0}var N5=Object.freeze({});function Nr(e){return e.Na=!0,e}var j5=Nr(e=>typeof e=="number"),Dh=Nr(e=>typeof e=="string"),M5=Nr(e=>typeof e=="boolean"),jr=typeof Ma.BigInt=="function"&&typeof Ma.BigInt(0)=="bigint";function fi(e){var t=e;if(Dh(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(j5(t)&&!Number.isSafeInteger(t))throw Error(String(t));return jr?BigInt(e):e=M5(e)?e?"1":"0":Dh(e)?e.trim()||"0":String(e)}var sc=Nr(e=>jr?e>=D5&&e<=O5:e[0]==="-"?kh(e,C5):kh(e,k5));const C5=Number.MIN_SAFE_INTEGER.toString(),D5=jr?BigInt(Number.MIN_SAFE_INTEGER):void 0,k5=Number.MAX_SAFE_INTEGER.toString(),O5=jr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function kh(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i>a)return!1;if(i<a)return!0}}const L5=typeof Uint8Array.prototype.slice=="function";let Oh,ne=0,xe=0;function Lh(e){const t=e>>>0;ne=t,xe=(e-t)/4294967296>>>0}function Ji(e){if(e<0){Lh(-e);const[t,n]=cc(ne,xe);ne=t>>>0,xe=n>>>0}else Lh(e)}function rc(e){const t=Oh||(Oh=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),xe=0,ne=t.getUint32(0,!0)}function oc(e,t){const n=4294967296*t+(e>>>0);return Number.isSafeInteger(n)?n:Jl(e,t)}function uc(e,t){const n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=oc(e,t))=="number"?n?-e:e:n?"-"+e:e}function Jl(e,t){if(e>>>=0,(t>>>=0)<=2097151)var n=""+(4294967296*t+e);else Tr()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,e>=1e7&&(n+=e/1e7>>>0,e%=1e7),n>=1e7&&(t+=n/1e7>>>0,n%=1e7),n=t+Uh(n)+Uh(e));return n}function Uh(e){return e=String(e),"0000000".slice(e.length)+e}function zh(){var e=ne,t=xe;if(2147483648&t)if(Tr())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[n,i]=cc(e,t);e="-"+Jl(n,i)}else e=Jl(e,t);return e}function Mr(e){if(e.length<16)Ji(Number(e));else if(Tr())e=BigInt(e),ne=Number(e&BigInt(4294967295))>>>0,xe=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");xe=ne=0;const n=e.length;for(let i=t,a=(n-t)%6+t;a<=n;i=a,a+=6){const l=Number(e.slice(i,a));xe*=1e6,ne=1e6*ne+l,ne>=4294967296&&(xe+=Math.trunc(ne/4294967296),xe>>>=0,ne>>>=0)}if(t){const[i,a]=cc(ne,xe);ne=i,xe=a}}}function cc(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const Pl=typeof BigInt=="function"?BigInt.asIntN:void 0,U5=typeof BigInt=="function"?BigInt.asUintN:void 0,di=Number.isSafeInteger,Cr=Number.isFinite,La=Math.trunc,z5=fi(0);function hi(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Rh(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const R5=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function $l(e){switch(typeof e){case"bigint":return!0;case"number":return Cr(e);case"string":return R5.test(e);default:return!1}}function Ua(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Cr(e)?0|e:void 0}function Bh(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Cr(e)?e>>>0:void 0}function Gh(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function Hh(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function Vh(e){return Hh(e)?e:(Mr(e),zh())}function fc(e){return e=La(e),di(e)||(Ji(e),e=uc(ne,xe)),e}function Fh(e){var t=La(Number(e));return di(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Vh(e))}function qh(e){var t=La(Number(e));return di(t)?fi(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Tr()?fi(Pl(64,BigInt(e))):fi(Vh(e)))}function Yh(e){if(di(e))e=fi(fc(e));else{if(e=La(e),di(e))e=String(e);else{const t=String(e);Hh(t)?e=t:(Ji(e),e=zh())}e=fi(e)}return e}function dc(e){return e==null?e:typeof e=="bigint"?(sc(e)?e=Number(e):(e=Pl(64,e),e=sc(e)?Number(e):String(e)),e):$l(e)?typeof e=="number"?fc(e):Fh(e):void 0}function B5(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(U5(64,e));if($l(e)){if(t==="string")return t=La(Number(e)),di(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Gh(e)||(Mr(e),e=Jl(ne,xe))),e;if(t==="number")return(e=La(e))>=0&&di(e)?e:function(n){if(n<0){Ji(n);var i=Jl(ne,xe);return n=Number(i),di(n)?n:i}return Gh(i=String(n))?i:(Ji(n),oc(ne,xe))}(e)}}function Xh(e){if(typeof e!="string")throw Error();return e}function za(e){if(e!=null&&typeof e!="string")throw Error();return e}function Ra(e){return e==null||typeof e=="string"?e:void 0}function hc(e,t,n,i){if(e!=null&&typeof e=="object"&&e.W===Wl)return e;if(!Array.isArray(e))return n?2&i?((e=t[Th])||(Oa((e=new t).u),e=t[Th]=e),t=e):t=new t:t=void 0,t;let a=n=0|e[L];return a===0&&(a|=32&i),a|=2&i,a!==n&&De(e,a),new t(e)}function G5(e,t,n){if(t)e:{if(!$l(t=e))throw ec("int64");switch(typeof t){case"string":t=qh(t);break e;case"bigint":t=fi(Pl(64,t));break e;default:t=Yh(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?fi(Pl(64,t)):$l(t)?e==="string"?qh(t):Yh(t):void 0;return(e=t)==null?n?z5:void 0:e}function H5(e){return e}const V5={};let F5=function(){try{return Er(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class mc{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,n){return this.g.set(t,n),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,n){return this.g.forEach(t,n)}[Symbol.iterator](){return this.entries()}}const q5=F5?(Object.setPrototypeOf(mc.prototype,Map.prototype),Object.defineProperties(mc.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),mc):class extends Map{constructor(){super()}};function Qh(e){return e}function wc(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var yn=class extends q5{constructor(e,t,n=Qh,i=Qh){super();let a=0|e[L];a|=64,De(e,a),this.M=a,this.I=t,this.S=n,this.X=this.I?Y5:i;for(let l=0;l<e.length;l++){const s=e[l],r=n(s[0],!1,!0);let o=s[1];t?o===void 0&&(o=null):o=i(s[1],!1,!0,void 0,void 0,a),super.set(r,o)}}La(){var e=I5;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=X5){const t=[],n=super.entries();for(var i;!(i=n.next()).done;)(i=i.value)[0]=e(i[0]),i[1]=e(i[1]),t.push(i);return t}clear(){wc(this),super.clear()}delete(e){return wc(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new Ch(e,Q5,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new Ch(e,yn.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((n,i,a)=>{e.call(t,a.get(i),i,a)}):super.forEach(e,t)}set(e,t){return wc(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var n=this.I;return n?((n=this.X(t,!1,!0,n,this.pa,this.M))!==t&&super.set(e,n),n):t}}[Symbol.iterator](){return this.entries()}};function Y5(e,t,n,i,a,l){return e=hc(e,i,n,l),a&&(e=Or(e)),e}function X5(e){return e}function Q5(e){return[e,this.get(e)]}let Z5,Zh,Kh,K5;function Ih(){return Z5||(Z5=new yn(Oa([]),void 0,void 0,void 0,V5))}function gc(e,t,n,i,a){if(e!=null){if(Array.isArray(e)){const l=0|e[L];return e.length===0&&1&l?void 0:a&&2&l?e:Dr(e,t,n,i!==void 0,a)}return t(e,i)}}function Dr(e,t,n,i,a){const l=i||n?0|e[L]:0,s=i?!!(32&l):void 0;let r=0;const o=(i=ct(e)).length;for(let v=0;v<o;v++){var c=i[v];if(v===o-1&&Ar(c)){var d=t,h=n,f=s,w=a;let x;for(let _ in c){const m=gc(c[_],d,h,f,w);m!=null&&((x??(x={}))[_]=m)}c=x}else c=gc(i[v],t,n,s,a);i[v]=c,c!=null&&(r=v+1)}return r<o&&(i.length=r),n&&((e=lc(e))&&(i[ka]=ct(e)),n(l,i)),i}function I5(e){return gc(e,pc,void 0,void 0,!1)}function pc(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return sc(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Ii(e))return Ii(e)&&tc(Ah),bh(e);if(e.W===Wl)return Wh(e);if(e instanceof On){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=bh(t)}return e instanceof yn?e.La():void 0}return e}function Wh(e){var t=e.u;e=Dr(t,pc,void 0,void 0,!1);var n=0|t[L];if((t=e.length)&&!(512&n)){var i=e[t-1],a=!1;Ar(i)?(t--,a=!0):i=void 0;var l=t-(n=512&n?0:-1),s=(Zh??H5)(l,n,e,i);if(i&&(e[t]=void 0),l<s&&i){for(var r in l=!0,i){const o=+r;o<=s?(e[a=o+n]=i[r],t=Math.max(a+1,t),a=!1,delete i[r]):l=!1}l&&(i=void 0)}for(l=t-1;t>0;l=t-1)if((r=e[l])==null)t--,a=!0;else{if(!((l-=n)>=s))break;(i??(i={}))[l]=r,t--,a=!0}a&&(e.length=t),i&&e.push(i)}return e}function mi(e,t,n){return e=Jh(e,t[0],t[1],n?1:2),t!==Kh&&n&&_r(e,8192),e}function Jh(e,t,n,i){if(e==null){var a=96;n?(e=[n],a|=512):e=[],t&&(a=-16760833&a|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(a=0|e[L])||!(64&a)||2&a||tc(T5),1024&a)throw Error("farr");if(64&a)return e;if(i===1||i===2||(a|=64),n&&(a|=512,n!==e[0]))throw Error("mid");e:{var l=(n=e).length;if(l){var s=l-1;if(Ar(i=n[s])){if((s-=t=512&(a|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var r in i)(l=+r)<s&&(n[l+t]=i[r],delete i[r]);a=-16760833&a|(1023&s)<<14;break e}}if(t){if((r=Math.max(t,l-(512&a?0:-1)))>1024)throw Error("spvt");a=-16760833&a|(1023&r)<<14}}}return De(e,a),e}function yc(e,t,n=nc){if(e!=null){if(yh&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=0|e[L];return 2&i?e:(t&&(t=i===0||!!(32&i)&&!(64&i||!(16&i))),t?(De(e,34|i),4&i&&Object.freeze(e),e):Dr(e,yc,4&i?nc:n,!0,!0))}return e.W===Wl?e=2&(i=0|(n=e.u)[L])?e:new e.constructor(kr(n,i,!0)):e instanceof yn&&!(2&e.M)&&(n=Oa(e.da(yc)),e=new yn(n,e.I,e.S,e.X)),e}}function kr(e,t,n){const i=n||2&t?nc:A5,a=!!(32&t);return e=function(l,s,r){const o=ct(l);var c=o.length;const d=256&s?o[c-1]:void 0;for(c+=d?-1:0,s=512&s?1:0;s<c;s++)o[s]=r(o[s]);if(d){s=o[s]={};for(const h in d)s[h]=r(d[h])}return(l=lc(l))&&(o[ka]=ct(l)),o}(e,t,l=>yc(l,a,i)),_r(e,32|(n?2:0)),e}function Or(e){const t=e.u,n=0|t[L];return 2&n?new e.constructor(kr(t,n,!1)):e}function Ba(e,t){return Ln(e=e.u,0|e[L],t)}function Ln(e,t,n){if(n===-1)return null;const i=n+(512&t?0:-1),a=e.length-1;return i>=a&&256&t?e[a][n]:i<=a?e[i]:void 0}function le(e,t,n){const i=e.u;let a=0|i[L];return ci(a),pe(i,a,t,n),e}function pe(e,t,n,i){const a=512&t?0:-1,l=n+a;var s=e.length-1;return l>=s&&256&t?(e[s][n]=i,t):l<=s?(e[l]=i,t):(i!==void 0&&(n>=(s=t>>14&1023||536870912)?i!=null&&(e[s+a]={[n]:i},De(e,t|=256)):e[l]=i),t)}function Lr(e,t){let n=0|(e=e.u)[L];const i=Ln(e,n,t),a=hi(i);return a!=null&&a!==i&&pe(e,n,t,a),a}function Ph(e){let t=0|(e=e.u)[L];const n=Ln(e,t,1),i=ac(n,!0);return i!=null&&i!==n&&pe(e,t,1,i),i}function Pi(){return N5===void 0?2:4}function $i(e,t,n,i,a){const l=e.u,s=2&(e=0|l[L])?1:i;a=!!a;let r=0|(i=vc(l,e,t))[L];if(!(4&r)){4&r&&(i=ct(i),r=Rn(r,e),e=pe(l,e,t,i));let o=0,c=0;for(;o<i.length;o++){const d=n(i[o]);d!=null&&(i[c++]=d)}c<o&&(i.length=c),r=bc(r,e),n=-2049&(20|r),r=n&=-4097,De(i,r),2&r&&Object.freeze(i)}return s===1||s===4&&32&r?Un(r)||(a=r,r|=2,r!==a&&De(i,r),Object.freeze(i)):(s===2&&Un(r)&&(i=ct(i),r=Rn(r,e),r=wi(r,e,a),De(i,r),e=pe(l,e,t,i)),Un(r)||(t=r,r=wi(r,e,a),r!==t&&De(i,r))),i}function vc(e,t,n){return e=Ln(e,t,n),Array.isArray(e)?e:ic}function bc(e,t){return e===0&&(e=Rn(e,t)),1|e}function Un(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function $h(e){e=ct(e);for(let t=0;t<e.length;t++){const n=e[t]=ct(e[t]);Array.isArray(n[1])&&(n[1]=Oa(n[1]))}return e}function xc(e,t,n,i){let a=0|(e=e.u)[L];ci(a),pe(e,a,t,(i==="0"?Number(n)===0:n===i)?void 0:n)}function Ga(e,t,n,i){ci(t);let a=vc(e,t,n);const l=a!==ic;if(64&t||!(8192&t)||!l){const s=l?0|a[L]:0;let r=s;(!l||2&r||Un(r)||4&r&&!(32&r))&&(a=ct(a),r=Rn(r,t),t=pe(e,t,n,a)),r=-13&bc(r,t),r=wi(i?-17&r:16|r,t,!0),r!==s&&De(a,r)}return a}function Ec(e,t){var n=t0;return _c(Sc(e=e.u),e,0|e[L],n)===t?t:-1}function Sc(e){if(Sr)return e[Il]??(e[Il]=new Map);if(Il in e)return e[Il];const t=new Map;return Object.defineProperty(e,Il,{value:t}),t}function e1(e,t,n,i){const a=Sc(e),l=_c(a,e,t,n);return l!==i&&(l&&(t=pe(e,t,l)),a.set(n,i)),t}function _c(e,t,n,i){let a=e.get(i);if(a!=null)return a;a=0;for(let l=0;l<i.length;l++){const s=i[l];Ln(t,n,s)!=null&&(a!==0&&(n=pe(t,n,a)),a=s)}return e.set(i,a),a}function Tc(e,t,n){let i=0|e[L];const a=Ln(e,i,n);let l;if(a!=null&&a.W===Wl)return(t=Or(a))!==a&&pe(e,i,n,t),t.u;if(Array.isArray(a)){const s=0|a[L];l=2&s?mi(kr(a,s,!1),t,!0):64&s?a:mi(l,t,!0)}else l=mi(void 0,t,!0);return l!==a&&pe(e,i,n,l),l}function t1(e,t,n){let i=0|(e=e.u)[L];const a=Ln(e,i,n);return(t=hc(a,t,!1,i))!==a&&t!=null&&pe(e,i,n,t),t}function Z(e,t,n){if((t=t1(e,t,n))==null)return t;let i=0|(e=e.u)[L];if(!(2&i)){const a=Or(t);a!==t&&pe(e,i,n,t=a)}return t}function n1(e,t,n,i,a,l,s){e=e.u;var r=!!(2&t);const o=r?1:a;l=!!l,s&&(s=!r);var c=0|(a=vc(e,t,i))[L];if(!(r=!!(4&c))){var d=a,h=t;const f=!!(2&(c=bc(c,t)));f&&(h|=2);let w=!f,v=!0,x=0,_=0;for(;x<d.length;x++){const m=hc(d[x],n,!1,h);if(m instanceof n){if(!f){const g=!!(2&(0|m.u[L]));w&&(w=!g),v&&(v=g)}d[_++]=m}}_<x&&(d.length=_),c|=4,c=v?16|c:-17&c,De(d,c=w?8|c:-9&c),f&&Object.freeze(d)}if(s&&!(8&c||!a.length&&(o===1||o===4&&32&c))){for(Un(c)&&(a=ct(a),c=Rn(c,t),t=pe(e,t,i,a)),n=a,s=c,d=0;d<n.length;d++)(c=n[d])!==(h=Or(c))&&(n[d]=h);s|=8,De(n,s=n.length?-17&s:16|s),c=s}return o===1||o===4&&32&c?Un(c)||(t=c,(c|=!a.length||16&c&&(!r||32&c)?2:1024)!==t&&De(a,c),Object.freeze(a)):(o===2&&Un(c)&&(De(a=ct(a),c=wi(c=Rn(c,t),t,l)),t=pe(e,t,i,a)),Un(c)||(i=c,(c=wi(c,t,l))!==i&&De(a,c))),a}function zn(e,t,n){const i=0|e.u[L];return n1(e,i,t,n,Pi(),!1,!(2&i))}function z(e,t,n,i){return i==null&&(i=void 0),le(e,n,i)}function es(e,t,n,i){i==null&&(i=void 0);e:{let a=0|(e=e.u)[L];if(ci(a),i==null){const l=Sc(e);if(_c(l,e,a,n)!==t)break e;l.set(n,0)}else a=e1(e,a,n,t);pe(e,a,t,i)}}function Rn(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function wi(e,t,n){return 32&t&&n||(e&=-33),e}function Ur(e,t,n){ci(0|e.u[L]),$i(e,t,Ra,2,!0).push(Xh(n))}function zr(e,t,n,i){const a=0|e.u[L];ci(a),e=n1(e,a,n,t,2,!0),i=i??new n,e.push(i),e[L]=2&(0|i.u[L])?-9&e[L]:-17&e[L]}function Ht(e,t){return Ua(Ba(e,t))}function Vt(e,t){return Ra(Ba(e,t))}function Ne(e,t){return Lr(e,t)??0}function ts(e,t,n){if(n!=null&&typeof n!="boolean")throw e=typeof n,Error(`Expected boolean but got ${e!="object"?e:n?Array.isArray(n)?"array":e:"null"}: ${n}`);le(e,t,n)}function vn(e,t,n){if(n!=null){if(typeof n!="number"||!Cr(n))throw ec("int32");n|=0}le(e,t,n)}function O(e,t,n){if(n!=null&&typeof n!="number")throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);le(e,t,n)}function Rr(e,t,n){{const s=e.u;let r=0|s[L];if(ci(r),n==null)pe(s,r,t);else{var i=e=0|n[L],a=Un(e),l=a||Object.isFrozen(n);for(a||(e=0),l||(n=ct(n),i=0,e=wi(e=Rn(e,r),r,!0),l=!1),e|=21,a=0;a<n.length;a++){const o=n[a],c=Xh(o);Object.is(o,c)||(l&&(n=ct(n),i=0,e=wi(e=Rn(e,r),r,!0),l=!1),n[a]=c)}e!==i&&(l&&(n=ct(n),e=wi(e=Rn(e,r),r,!0)),De(n,e)),pe(s,r,t,n)}}}function i1(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Ac(){return Error("Failed to read varint, encoding is invalid.")}function a1(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function Nc(e){if(typeof e=="string")return{buffer:Eh(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===On)return{buffer:$u(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function jc(e,t){let n,i=0,a=0,l=0;const s=e.h;let r=e.g;do n=s[r++],i|=(127&n)<<l,l+=7;while(l<32&&128&n);for(l>32&&(a|=(127&n)>>4),l=3;l<32&&128&n;l+=7)n=s[r++],a|=(127&n)<<l;if(ea(e,r),n<128)return t(i>>>0,a>>>0);throw Ac()}function Mc(e){let t=0,n=e.g;const i=n+10,a=e.h;for(;n<i;){const l=a[n++];if(t|=l,(128&l)==0)return ea(e,n),!!(127&t)}throw Ac()}function gi(e){const t=e.h;let n=e.g,i=t[n++],a=127&i;if(128&i&&(i=t[n++],a|=(127&i)<<7,128&i&&(i=t[n++],a|=(127&i)<<14,128&i&&(i=t[n++],a|=(127&i)<<21,128&i&&(i=t[n++],a|=i<<28,128&i&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw Ac();return ea(e,n),a}function Bn(e){return gi(e)>>>0}function Cc(e){var t=e.h;const n=e.g,i=t[n],a=t[n+1],l=t[n+2];return t=t[n+3],ea(e,e.g+4),(i<<0|a<<8|l<<16|t<<24)>>>0}function Dc(e){var t=Cc(e);e=2*(t>>31)+1;const n=t>>>23&255;return t&=8388607,n==255?t?NaN:e*(1/0):n==0?1401298464324817e-60*e*t:e*Math.pow(2,n-150)*(t+8388608)}function W5(e){return gi(e)}function kc(e,t,{aa:n=!1}={}){e.aa=n,t&&(t=Nc(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function ea(e,t){if(e.g=t,t>e.l)throw a1(e.l,t)}function l1(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const n=e.g,i=n+t;if(i>e.l)throw a1(t,e.l-n);return e.g=i,n}function s1(e,t){if(t==0)return Wi();var n=l1(e,t);return e.aa&&e.m?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?new Uint8Array(0):L5?e.slice(n,t):new Uint8Array(e.subarray(n,t))),n.length==0?Wi():new On(n,Ca)}yn.prototype.toJSON=void 0;var r1=[];function o1(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var n=Bn(e.g);if(t=n>>>3,!((n&=7)>=0&&n<=5))throw i1(n,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=n,!0}function Br(e){switch(e.h){case 0:e.h!=0?Br(e):Mc(e.g);break;case 1:ea(e=e.g,e.g+8);break;case 2:if(e.h!=2)Br(e);else{var t=Bn(e.g);ea(e=e.g,e.g+t)}break;case 5:ea(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!o1(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}Br(e)}break;default:throw i1(e.h,e.l)}}function ns(e,t,n){const i=e.g.l,a=Bn(e.g),l=e.g.g+a;let s=l-i;if(s<=0&&(e.g.l=l,n(t,e,void 0,void 0,void 0),s=l-e.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${a} bytes, instead read ${a-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=l,e.g.l=i,t}function Oc(e){var t=Bn(e.g),n=l1(e=e.g,t);if(e=e.h,w5){var i,a=e;(i=Zu)||(i=Zu=new TextDecoder("utf-8",{fatal:!0})),t=n+t,a=n===0&&t===a.length?a:a.subarray(n,t);try{var l=i.decode(a)}catch(r){if(br===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),br=!0}catch{br=!1}}throw!br&&(Zu=void 0),r}}else{t=(l=n)+t,n=[];let r,o=null;for(;l<t;){var s=e[l++];s<128?n.push(s):s<224?l>=t?Ki():(r=e[l++],s<194||(192&r)!=128?(l--,Ki()):n.push((31&s)<<6|63&r)):s<240?l>=t-1?Ki():(r=e[l++],(192&r)!=128||s===224&&r<160||s===237&&r>=160||(192&(i=e[l++]))!=128?(l--,Ki()):n.push((15&s)<<12|(63&r)<<6|63&i)):s<=244?l>=t-2?Ki():(r=e[l++],(192&r)!=128||r-144+(s<<28)>>30||(192&(i=e[l++]))!=128||(192&(a=e[l++]))!=128?(l--,Ki()):(s=(7&s)<<18|(63&r)<<12|(63&i)<<6|63&a,s-=65536,n.push(55296+(s>>10&1023),56320+(1023&s)))):Ki(),n.length>=8192&&(o=fh(o,n),n.length=0)}l=fh(o,n)}return l}function u1(e){const t=Bn(e.g);return s1(e.g,t)}function Gr(e,t,n){var i=Bn(e.g);for(i=e.g.g+i;e.g.g<i;)n.push(t(e.g))}var Hr=[];function on(e,t,n){t.g?t.m(e,t.g,t.h,n):t.m(e,t.h,n)}var k=class{constructor(e,t){this.u=Jh(e,t)}toJSON(){try{var e=Wh(this)}finally{Zh=void 0}return e}l(){var e=kp;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(kr(e,0|e[L],!1))}O(){return!!(2&(0|this.u[L]))}};function c1(e){return e?/^\d+$/.test(e)?(Mr(e),new Lc(ne,xe)):null:J5||(J5=new Lc(0,0))}k.prototype.W=Wl,k.prototype.toString=function(){return this.u.toString()};var Lc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let J5;function f1(e){return e?/^-?\d+$/.test(e)?(Mr(e),new Uc(ne,xe)):null:P5||(P5=new Uc(0,0))}var Uc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let P5;function Ha(e,t,n){for(;n>0||t>127;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function Va(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Vr(e,t){if(t>=0)Va(e,t);else{for(let n=0;n<9;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function is(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Fa(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function xt(e,t,n){Va(e.g,8*t+n)}function zc(e,t){return xt(e,t,2),t=e.g.end(),Fa(e,t),t.push(e.h),t}function Rc(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;n>127;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function Fr(e,t,n){xt(e,t,2),Va(e.g,n.length),Fa(e,e.g.end()),Fa(e,n)}function qr(e,t,n,i){n!=null&&(t=zc(e,t),i(n,e),Rc(e,t))}function un(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var Bc=un(),d1=un(),Gc=un(),Hc=un(),h1=un(),m1=un(),Vc=un(),w1=un(),g1=un(),qa=class{constructor(e,t,n){this.g=e,this.h=t,e=Bc,this.l=!!e&&n===e||!1}};function Yr(e,t){return new qa(e,t,Bc)}function p1(e,t,n,i,a){qr(e,n,S1(t,i),a)}const $5=Yr(function(e,t,n,i,a){return e.h===2&&(ns(e,Tc(t,i,n),a),!0)},p1),ep=Yr(function(e,t,n,i,a){return e.h===2&&(ns(e,Tc(t,i,n),a),!0)},p1);var Xr=Symbol(),Fc=Symbol(),y1=Symbol(),v1=Symbol();let b1,x1;function ta(e,t,n,i){var a=i[e];if(a)return a;(a={}).Ma=i,a.T=function(h){switch(typeof h){case"boolean":return Kh||(Kh=[0,void 0,!0]);case"number":return h>0?void 0:h===0?K5||(K5=[0,void 0]):[-h,void 0];case"string":return[0,h];case"object":return h}}(i[0]);var l=i[1];let s=1;l&&l.constructor===Object&&(a.ga=l,typeof(l=i[++s])=="function"&&(a.la=!0,b1??(b1=l),x1??(x1=i[s+1]),l=i[s+=2]));const r={};for(;l&&Array.isArray(l)&&l.length&&typeof l[0]=="number"&&l[0]>0;){for(var o=0;o<l.length;o++)r[l[o]]=l;l=i[++s]}for(o=1;l!==void 0;){let h;typeof l=="number"&&(o+=l,l=i[++s]);var c=void 0;if(l instanceof qa?h=l:(h=$5,s--),h==null?void 0:h.l){l=i[++s],c=i;var d=s;typeof l=="function"&&(l=l(),c[d]=l),c=l}for(d=o+1,typeof(l=i[++s])=="number"&&l<0&&(d-=l,l=i[++s]);o<d;o++){const f=r[o];c?n(a,o,h,c,f):t(a,o,h,f)}}return i[e]=a}function E1(e){return Array.isArray(e)?e[0]instanceof qa?e:[ep,e]:[e,void 0]}function S1(e,t){return e instanceof k?e.u:Array.isArray(e)?mi(e,t,!1):void 0}function qc(e,t,n,i){const a=n.g;e[t]=i?(l,s,r)=>a(l,s,r,i):a}function Yc(e,t,n,i,a){const l=n.g;let s,r;e[t]=(o,c,d)=>l(o,c,d,r||(r=ta(Fc,qc,Yc,i).T),s||(s=Xc(i)),a)}function Xc(e){let t=e[y1];if(t!=null)return t;const n=ta(Fc,qc,Yc,e);return t=n.la?(i,a)=>b1(i,a,n):(i,a)=>{const l=0|i[L];for(;o1(a)&&a.h!=4;){var s=a.m,r=n[s];if(r==null){var o=n.ga;o&&(o=o[s])&&(o=tp(o))!=null&&(r=n[s]=o)}r!=null&&r(a,i,s)||(s=(r=a).l,Br(r),r.fa?r=void 0:(o=r.g.g-s,r.g.g=s,r=s1(r.g,o)),s=i,r&&((o=s[ka])?o.push(r):s[ka]=[r]))}return 8192&l&&Oa(i),!0},e[y1]=t}function tp(e){const t=(e=E1(e))[0].g;if(e=e[1]){const n=Xc(e),i=ta(Fc,qc,Yc,e).T;return(a,l,s)=>t(a,l,s,i,n)}return t}function Qr(e,t,n){e[t]=n.h}function Zr(e,t,n,i){let a,l;const s=n.h;e[t]=(r,o,c)=>s(r,o,c,l||(l=ta(Xr,Qr,Zr,i).T),a||(a=_1(i)))}function _1(e){let t=e[v1];if(!t){const n=ta(Xr,Qr,Zr,e);t=(i,a)=>T1(i,a,n),e[v1]=t}return t}function T1(e,t,n){(function(i,a,l){const s=512&a?0:-1,r=i.length,o=r+((a=64&a?256&a:!!r&&Ar(i[r-1]))?-1:0);for(let c=0;c<o;c++)l(c-s,i[c]);if(a){i=i[r-1];for(const c in i)!isNaN(c)&&l(+c,i[c])}})(e,0|e[L]|(n.T[1]?512:0),(i,a)=>{if(a!=null){var l=function(s,r){var o=s[r];if(o)return o;if((o=s.ga)&&(o=o[r])){var c=(o=E1(o))[0].h;if(o=o[1]){const d=_1(o),h=ta(Xr,Qr,Zr,o).T;o=s.la?x1(h,d):(f,w,v)=>c(f,w,v,h,d)}else o=c;return s[r]=o}}(n,i);l&&l(t,a,i)}}),(e=lc(e))&&function(i,a){Fa(i,i.g.end());for(let l=0;l<a.length;l++)Fa(i,$u(a[l])||new Uint8Array(0))}(t,e)}function Ya(e,t){if(Array.isArray(t)){var n=0|t[L];if(4&n)return t;for(var i=0,a=0;i<t.length;i++){const l=e(t[i]);l!=null&&(t[a++]=l)}return a<i&&(t.length=a),De(t,-6145&(5|n)),2&n&&Object.freeze(t),t}}function tt(e,t,n){return new qa(e,t,n)}function Xa(e,t,n){return new qa(e,t,n)}function nt(e,t,n){pe(e,0|e[L],t,n)}var np=Yr(function(e,t,n,i,a){return e.h===2&&(e=ns(e,mi([void 0,void 0],i,!0),a),ci(i=0|t[L]),(a=Ln(t,i,n))instanceof yn?2&a.M?((a=a.da()).push(e),pe(t,i,n,a)):a.Ja(e):Array.isArray(a)?(2&(0|a[L])&&pe(t,i,n,a=$h(a)),a.push(e)):pe(t,i,n,[e]),!0)},function(e,t,n,i,a){if(t instanceof yn)t.forEach((l,s)=>{qr(e,n,mi([s,l],i,!1),a)});else if(Array.isArray(t))for(let l=0;l<t.length;l++){const s=t[l];Array.isArray(s)&&qr(e,n,mi(s,i,!1),a)}});function A1(e,t,n){if(t=function(i){if(i==null)return i;const a=typeof i;if(a==="bigint")return String(Pl(64,i));if($l(i)){if(a==="string")return Fh(i);if(a==="number")return fc(i)}}(t),t!=null&&(typeof t=="string"&&f1(t),t!=null))switch(xt(e,n,0),typeof t){case"number":e=e.g,Ji(t),Ha(e,ne,xe);break;case"bigint":n=BigInt.asUintN(64,t),n=new Uc(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Ha(e.g,n.h,n.g);break;default:n=f1(t),Ha(e.g,n.h,n.g)}}function N1(e,t,n){(t=Ua(t))!=null&&t!=null&&(xt(e,n,0),Vr(e.g,t))}function j1(e,t,n){(t=Rh(t))!=null&&(xt(e,n,0),e.g.g.push(t?1:0))}function M1(e,t,n){(t=Ra(t))!=null&&Fr(e,n,dh(t))}function C1(e,t,n,i,a){qr(e,n,S1(t,i),a)}function D1(e,t,n){t==null||typeof t=="string"||t instanceof On||(Ii(t)?Ii(t)&&tc(Ah):t=void 0),t!=null&&Fr(e,n,Nc(t).buffer)}function k1(e,t,n){return(e.h===5||e.h===2)&&(t=Ga(t,0|t[L],n,!1),e.h==2?Gr(e,Dc,t):t.push(Dc(e.g)),!0)}var Gn=tt(function(e,t,n){if(e.h!==1)return!1;var i=e.g;e=Cc(i);const a=Cc(i);i=2*(a>>31)+1;const l=a>>>20&2047;return e=4294967296*(1048575&a)+e,nt(t,n,l==2047?e?NaN:i*(1/0):l==0?5e-324*i*e:i*Math.pow(2,l-1075)*(e+4503599627370496)),!0},function(e,t,n){(t=hi(t))!=null&&(xt(e,n,1),e=e.g,(n=Oh||(Oh=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),ne=n.getUint32(0,!0),xe=n.getUint32(4,!0),is(e,ne),is(e,xe))},un()),ke=tt(function(e,t,n){return e.h===5&&(nt(t,n,Dc(e.g)),!0)},function(e,t,n){(t=hi(t))!=null&&(xt(e,n,5),e=e.g,rc(t),is(e,ne))},Vc),ip=Xa(k1,function(e,t,n){if((t=Ya(hi,t))!=null)for(let s=0;s<t.length;s++){var i=e,a=n,l=t[s];l!=null&&(xt(i,a,5),i=i.g,rc(l),is(i,ne))}},Vc),Qc=Xa(k1,function(e,t,n){if((t=Ya(hi,t))!=null&&t.length){xt(e,n,2),Va(e.g,4*t.length);for(let i=0;i<t.length;i++)n=e.g,rc(t[i]),is(n,ne)}},Vc),pi=tt(function(e,t,n){return e.h===0&&(nt(t,n,jc(e.g,uc)),!0)},A1,m1),Zc=tt(function(e,t,n){return e.h===0&&(nt(t,n,(e=jc(e.g,uc))===0?void 0:e),!0)},A1,m1),ap=tt(function(e,t,n){return e.h===0&&(nt(t,n,jc(e.g,oc)),!0)},function(e,t,n){if((t=B5(t))!=null&&(typeof t=="string"&&c1(t),t!=null))switch(xt(e,n,0),typeof t){case"number":e=e.g,Ji(t),Ha(e,ne,xe);break;case"bigint":n=BigInt.asUintN(64,t),n=new Lc(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Ha(e.g,n.h,n.g);break;default:n=c1(t),Ha(e.g,n.h,n.g)}},un()),Ee=tt(function(e,t,n){return e.h===0&&(nt(t,n,gi(e.g)),!0)},N1,Hc),Kr=Xa(function(e,t,n){return(e.h===0||e.h===2)&&(t=Ga(t,0|t[L],n,!1),e.h==2?Gr(e,gi,t):t.push(gi(e.g)),!0)},function(e,t,n){if((t=Ya(Ua,t))!=null&&t.length){n=zc(e,n);for(let i=0;i<t.length;i++)Vr(e.g,t[i]);Rc(e,n)}},Hc),Qa=tt(function(e,t,n){return e.h===0&&(nt(t,n,(e=gi(e.g))===0?void 0:e),!0)},N1,Hc),de=tt(function(e,t,n){return e.h===0&&(nt(t,n,Mc(e.g)),!0)},j1,d1),Za=tt(function(e,t,n){return e.h===0&&(nt(t,n,(e=Mc(e.g))===!1?void 0:e),!0)},j1,d1),Je=Xa(function(e,t,n){return e.h===2&&(e=Oc(e),Ga(t,0|t[L],n,!1).push(e),!0)},function(e,t,n){if((t=Ya(Ra,t))!=null)for(let s=0;s<t.length;s++){var i=e,a=n,l=t[s];l!=null&&Fr(i,a,dh(l))}},Gc),yi=tt(function(e,t,n){return e.h===2&&(nt(t,n,(e=Oc(e))===""?void 0:e),!0)},M1,Gc),P=tt(function(e,t,n){return e.h===2&&(nt(t,n,Oc(e)),!0)},M1,Gc),Re=function(e,t,n=Bc){return new qa(e,t,n)}(function(e,t,n,i,a){return e.h===2&&(i=mi(void 0,i,!0),Ga(t,0|t[L],n,!0).push(i),ns(e,i,a),!0)},function(e,t,n,i,a){if(Array.isArray(t))for(let l=0;l<t.length;l++)C1(e,t[l],n,i,a)}),$=Yr(function(e,t,n,i,a,l){return e.h===2&&(e1(t,0|t[L],l,n),ns(e,t=Tc(t,i,n),a),!0)},C1),O1=tt(function(e,t,n){return e.h===2&&(nt(t,n,u1(e)),!0)},D1,w1),lp=Xa(function(e,t,n){return(e.h===0||e.h===2)&&(t=Ga(t,0|t[L],n,!1),e.h==2?Gr(e,Bn,t):t.push(Bn(e.g)),!0)},function(e,t,n){if((t=Ya(Bh,t))!=null)for(let s=0;s<t.length;s++){var i=e,a=n,l=t[s];l!=null&&(xt(i,a,0),Va(i.g,l))}},h1),sp=tt(function(e,t,n){return e.h===0&&(nt(t,n,(e=Bn(e.g))===0?void 0:e),!0)},function(e,t,n){(t=Bh(t))!=null&&t!=null&&(xt(e,n,0),Va(e.g,t))},h1),Et=tt(function(e,t,n){return e.h===0&&(nt(t,n,gi(e.g)),!0)},function(e,t,n){(t=Ua(t))!=null&&(t=parseInt(t,10),xt(e,n,0),Vr(e.g,t))},g1);class rp{constructor(t,n){this.h=t,this.g=n,this.l=Z,this.m=z,this.defaultValue=void 0}register(){Er(this)}}function cn(e,t){return new rp(e,t)}function vi(e,t){return(n,i)=>{if(Hr.length){const l=Hr.pop();l.o(i),kc(l.g,n,i),n=l}else n=new class{constructor(l,s){if(r1.length){const r=r1.pop();kc(r,l,s),l=r}else l=new class{constructor(r,o){this.h=null,this.m=!1,this.g=this.l=this.j=0,kc(this,r,o)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(l,s);this.g=l,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({fa:l=!1}={}){this.fa=l}}(n,i);try{const l=new e,s=l.u;Xc(t)(s,n);var a=l}finally{n.g.clear(),n.m=-1,n.h=-1,Hr.length<100&&Hr.push(n)}return a}}function Ir(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const s=this.g;return this.g=[],s}}}};T1(this.u,t,ta(Xr,Qr,Zr,e)),Fa(t,t.g.end());const n=new Uint8Array(t.h),i=t.l,a=i.length;let l=0;for(let s=0;s<a;s++){const r=i[s];n.set(r,l),l+=r.length}return t.l=[n],n}}var L1=class extends k{constructor(e){super(e)}},U1=[0,yi,tt(function(e,t,n){return e.h===2&&(nt(t,n,(e=u1(e))===Wi()?void 0:e),!0)},function(e,t,n){if(t!=null){if(t instanceof k){const i=t.Oa;return void(i&&(t=i(t),t!=null&&Fr(e,n,Nc(t).buffer)))}if(Array.isArray(t))return}D1(e,t,n)},w1)];let Kc,z1=globalThis.trustedTypes;function R1(e){Kc===void 0&&(Kc=function(){let n=null;if(!z1)return n;try{const i=a=>a;n=z1.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return n}());var t=Kc;return new class{constructor(n){this.g=n}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function op(e,...t){if(t.length===0)return R1(e[0]);let n=e[0];for(let i=0;i<t.length;i++)n+=encodeURIComponent(t[i])+e[i+1];return R1(n)}var B1=[0,Ee,Et,de,-1,Kr,Et,-1],up=class extends k{constructor(e){super(e)}},G1=[0,de,P,de,Et,-1,Xa(function(e,t,n){return(e.h===0||e.h===2)&&(t=Ga(t,0|t[L],n,!1),e.h==2?Gr(e,W5,t):t.push(gi(e.g)),!0)},function(e,t,n){if((t=Ya(Ua,t))!=null&&t.length){n=zc(e,n);for(let i=0;i<t.length;i++)Vr(e.g,t[i]);Rc(e,n)}},g1),P,-1,[0,de,-1],Et,de,-1],H1=[0,P,-2],V1=class extends k{constructor(e){super(e)}},F1=[0],q1=[0,Ee,de,1,de,-3],St=class extends k{constructor(e){super(e,2)}},Oe={};Oe[336783863]=[0,P,de,-1,Ee,[0,[1,2,3,4,5,6,7,8,9],$,F1,$,G1,$,H1,$,q1,$,B1,$,[0,P,-2],$,[0,P,Et],$,[0,Et,P,-1],$,[0,Et,-1]],[0,P],de,[0,[1,3],[2,4],$,[0,Kr],-1,$,[0,Je],-1,Re,[0,P,-1]],P];var Y1=[0,Zc,-1,Za,-3,Zc,Kr,yi,Qa,Zc,-1,Za,Qa,Za,-2,yi];function _t(e,t){xc(e,2,za(t),"")}function se(e,t){Ur(e,3,t)}function Y(e,t){Ur(e,4,t)}var it=class extends k{constructor(e){super(e,500)}o(e){return z(this,0,7,e)}},as=[-1,{}],X1=[0,P,1,as],Q1=[0,P,Je,as];function Tt(e,t){zr(e,1,it,t)}function ue(e,t){Ur(e,10,t)}function I(e,t){Ur(e,15,t)}var ft=class extends k{constructor(e){super(e,500)}o(e){return z(this,0,1001,e)}},Z1=[-500,Re,[-500,yi,-1,Je,-3,[-2,Oe,de],Re,U1,Qa,-1,X1,Q1,Re,[0,yi,Za],yi,Y1,Qa,Je,987,Je],4,Re,[-500,P,-1,[-1,{}],998,P],Re,[-500,P,Je,-1,[-2,{},de],997,Je,-1],Qa,Re,[-500,P,Je,as,998,Je],Je,Qa,X1,Q1,Re,[0,yi,-1,as],Je,-2,Y1,yi,-1,Za,[0,Za,sp],978,as,Re,U1];ft.prototype.g=Ir(Z1);var cp=vi(ft,Z1),fp=class extends k{constructor(e){super(e)}},K1=class extends k{constructor(e){super(e)}g(){return zn(this,fp,1)}},I1=[0,Re,[0,Ee,ke,P,-1]],Wr=vi(K1,I1),dp=class extends k{constructor(e){super(e)}},hp=class extends k{constructor(e){super(e)}},Ic=class extends k{constructor(e){super(e)}h(){return Z(this,dp,2)}g(){return zn(this,hp,5)}},W1=vi(class extends k{constructor(e){super(e)}},[0,Je,Kr,Qc,[0,Et,[0,Ee,-3],[0,ke,-3],[0,Ee,-1,[0,Re,[0,Ee,-2]]],Re,[0,ke,-1,P,ke]],P,-1,pi,Re,[0,Ee,ke],Je,pi]),J1=class extends k{constructor(e){super(e)}},Ka=vi(class extends k{constructor(e){super(e)}},[0,Re,[0,ke,-4]]),P1=class extends k{constructor(e){super(e)}},ls=vi(class extends k{constructor(e){super(e)}},[0,Re,[0,ke,-4]]),mp=class extends k{constructor(e){super(e)}},wp=[0,Ee,-1,Qc,Et],$1=class extends k{constructor(e){super(e)}};$1.prototype.g=Ir([0,ke,-4,pi]);var gp=class extends k{constructor(e){super(e)}},pp=vi(class extends k{constructor(e){super(e)}},[0,Re,[0,1,Ee,P,I1],pi]),e0=class extends k{constructor(e){super(e)}},yp=class extends k{constructor(e){super(e)}ma(){const e=Ph(this);return e??Wi()}},vp=class extends k{constructor(e){super(e)}},t0=[1,2],bp=vi(class extends k{constructor(e){super(e)}},[0,Re,[0,t0,$,[0,Qc],$,[0,O1],Ee,P],pi]),Wc=class extends k{constructor(e){super(e)}},n0=[0,P,Ee,ke,Je,-1],i0=class extends k{constructor(e){super(e)}},xp=[0,de,-1],a0=class extends k{constructor(e){super(e)}},Jr=[1,2,3,4,5],Pr=class extends k{constructor(e){super(e)}g(){return Ph(this)!=null}h(){return Vt(this,2)!=null}},he=class extends k{constructor(e){super(e)}g(){return Rh(Ba(this,2))??!1}},l0=[0,O1,P,[0,Ee,pi,-1],[0,ap,pi]],je=[0,l0,de,[0,Jr,$,q1,$,G1,$,B1,$,F1,$,H1],Et],$r=class extends k{constructor(e){super(e)}},Jc=[0,je,ke,-1,Ee],Ep=cn(502141897,$r);Oe[502141897]=Jc;var Sp=vi(class extends k{constructor(e){super(e)}},[0,[0,Et,-1,ip,lp],wp]),s0=class extends k{constructor(e){super(e)}},r0=class extends k{constructor(e){super(e)}},Pc=[0,je,ke,[0,je],de],o0=[0,je,Jc,Pc,ke,[0,[0,l0]]],_p=cn(508968150,r0);Oe[508968150]=o0,Oe[508968149]=Pc;var u0=class extends k{constructor(e){super(e)}},Tp=cn(513916220,u0);Oe[513916220]=[0,je,o0,Ee];var Ia=class extends k{constructor(e){super(e)}h(){return Z(this,Wc,2)}g(){le(this,2)}},c0=[0,je,n0];Oe[478825465]=c0;var Ap=class extends k{constructor(e){super(e)}},f0=class extends k{constructor(e){super(e)}},$c=class extends k{constructor(e){super(e)}},ef=class extends k{constructor(e){super(e)}},d0=class extends k{constructor(e){super(e)}},h0=[0,je,[0,je],c0,-1],m0=[0,je,ke,Ee],tf=[0,je,ke],w0=[0,je,m0,tf,ke],Np=cn(479097054,d0);Oe[479097054]=[0,je,w0,h0],Oe[463370452]=h0,Oe[464864288]=m0;var jp=cn(462713202,ef);Oe[462713202]=w0,Oe[474472470]=tf;var Mp=class extends k{constructor(e){super(e)}},g0=class extends k{constructor(e){super(e)}},p0=class extends k{constructor(e){super(e)}},y0=class extends k{constructor(e){super(e)}},nf=[0,je,ke,-1,Ee],af=[0,je,ke,de];y0.prototype.g=Ir([0,je,tf,[0,je],Jc,Pc,nf,af]);var v0=class extends k{constructor(e){super(e)}},Cp=cn(456383383,v0);Oe[456383383]=[0,je,n0];var b0=class extends k{constructor(e){super(e)}},Dp=cn(476348187,b0);Oe[476348187]=[0,je,xp];var x0=class extends k{constructor(e){super(e)}},E0=class extends k{constructor(e){super(e)}},S0=[0,Et,-1],kp=cn(458105876,class extends k{constructor(e){super(e)}g(){var e=this.u;const t=0|e[L],n=2&t;return e=function(i,a,l){var s=E0;const r=2&a;let o=!1;if(l==null){if(r)return Ih();l=[]}else if(l.constructor===yn){if(!(2&l.M)||r)return l;l=l.da()}else Array.isArray(l)?o=!!(2&(0|l[L])):l=[];if(r){if(!l.length)return Ih();o||(o=!0,Oa(l))}else o&&(o=!1,l=$h(l));return o||(64&(0|l[L])?l[L]&=-33:32&a&&_r(l,32)),pe(i,a,2,s=new yn(l,s,G5,void 0)),s}(e,t,Ln(e,t,2)),!n&&E0&&(e.pa=!0),e}});Oe[458105876]=[0,S0,np,[!0,pi,[0,P,-1,Je]]];var lf=class extends k{constructor(e){super(e)}},_0=cn(458105758,lf);Oe[458105758]=[0,je,P,S0];var T0=class extends k{constructor(e){super(e)}},Op=cn(443442058,T0);Oe[443442058]=[0,je,P,Ee,ke,Je,-1,de,ke],Oe[514774813]=nf;var A0=class extends k{constructor(e){super(e)}},Lp=cn(516587230,A0);function sf(e,t){return t=t?t.clone():new Wc,e.displayNamesLocale!==void 0?le(t,1,za(e.displayNamesLocale)):e.displayNamesLocale===void 0&&le(t,1),e.maxResults!==void 0?vn(t,2,e.maxResults):"maxResults"in e&&le(t,2),e.scoreThreshold!==void 0?O(t,3,e.scoreThreshold):"scoreThreshold"in e&&le(t,3),e.categoryAllowlist!==void 0?Rr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&le(t,4),e.categoryDenylist!==void 0?Rr(t,5,e.categoryDenylist):"categoryDenylist"in e&&le(t,5),t}function rf(e,t=-1,n=""){return{categories:e.map(i=>({index:Ht(i,1)??0??-1,score:Ne(i,2)??0,categoryName:Vt(i,3)??""??"",displayName:Vt(i,4)??""??""})),headIndex:t,headName:n}}function N0(e){var s,r;var t=$i(e,3,hi,Pi()),n=$i(e,2,Ua,Pi()),i=$i(e,1,Ra,Pi()),a=$i(e,9,Ra,Pi());const l={categories:[],keypoints:[]};for(let o=0;o<t.length;o++)l.categories.push({score:t[o],index:n[o]??-1,categoryName:i[o]??"",displayName:a[o]??""});if((t=(s=Z(e,Ic,4))==null?void 0:s.h())&&(l.boundingBox={originX:Ht(t,1)??0,originY:Ht(t,2)??0,width:Ht(t,3)??0,height:Ht(t,4)??0,angle:0}),(r=Z(e,Ic,4))==null?void 0:r.g().length)for(const o of Z(e,Ic,4).g())l.keypoints.push({x:Lr(o,1)??0,y:Lr(o,2)??0,score:Lr(o,4)??0,label:Vt(o,3)??""});return l}function eo(e){const t=[];for(const n of zn(e,P1,1))t.push({x:Ne(n,1)??0,y:Ne(n,2)??0,z:Ne(n,3)??0,visibility:Ne(n,4)??0});return t}function ss(e){const t=[];for(const n of zn(e,J1,1))t.push({x:Ne(n,1)??0,y:Ne(n,2)??0,z:Ne(n,3)??0,visibility:Ne(n,4)??0});return t}function j0(e){return Array.from(e,t=>t>127?t-256:t)}function M0(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let n=0,i=0,a=0;for(let l=0;l<e.length;l++)n+=e[l]*t[l],i+=e[l]*e[l],a+=t[l]*t[l];if(i<=0||a<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(i*a)}let to;Oe[516587230]=[0,je,nf,af,ke],Oe[518928384]=af;const Up=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function C0(){if(to===void 0)try{await WebAssembly.instantiate(Up),to=!0}catch{to=!1}return to}async function rs(e,t=op``){const n=await C0()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${n}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}}var na=class{};function D0(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function k0(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((n,i)=>{t.addEventListener("load",()=>{n()},!1),t.addEventListener("error",a=>{i(a)},!1),document.body.appendChild(t)})}importScripts(e.toString())}function O0(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function U(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function L0(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[i,a]=O0(t);return!e.l||i===e.i.canvas.width&&a===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=a),[i,a]}function U0(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const i=new Uint32Array(t.length);for(let a=0;a<t.length;a++)i[a]=e.i.stringToNewUTF8(t[a]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),n(t);for(const a of i)e.i._free(a);e.i._free(t)}function bn(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function bi(e,t,n){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(a,l,s)=>{l?(n(i,s),i=[]):i.push(a)}}na.forVisionTasks=function(e){return rs("vision",e)},na.forTextTasks=function(e){return rs("text",e)},na.forGenAiExperimentalTasks=function(e){return rs("genai_experimental",e)},na.forGenAiTasks=function(e){return rs("genai",e)},na.forAudioTasks=function(e){return rs("audio",e)},na.isSimdSupported=function(){return C0()};async function zp(e,t,n,i){return e=await(async(a,l,s,r,o)=>{if(l&&await k0(l),!self.ModuleFactory||s&&(await k0(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&o&&((l=self.Module).locateFile=o.locateFile,o.mainScriptUrlOrBlob&&(l.mainScriptUrlOrBlob=o.mainScriptUrlOrBlob)),o=await self.ModuleFactory(self.Module||o),self.ModuleFactory=self.Module=void 0,new a(o,r)})(e,n.wasmLoaderPath,n.assetLoaderPath,t,{locateFile:a=>a.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&a.endsWith(".data")?n.assetBinaryPath.toString():a}),await e.o(i),e}function of(e,t){const n=Z(e.baseOptions,Pr,1)||new Pr;typeof t=="string"?(le(n,2,za(t)),le(n,1)):t instanceof Uint8Array&&(le(n,1,ac(t,!1)),le(n,2)),z(e.baseOptions,0,1,n)}function z0(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(n=>n.message).join(", "))}finally{e.G=[]}}function C(e,t){e.B=Math.max(e.B,t)}function no(e,t){e.A=new it,_t(e.A,"PassThroughCalculator"),se(e.A,"free_memory"),Y(e.A,"free_memory_unused_out"),ue(t,"free_memory"),Tt(t,e.A)}function Wa(e,t){se(e.A,t),Y(e.A,t+"_unused_out")}function io(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var uf=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var n,i,a,l,s,r;if(t){const o=e.baseOptions||{};if((n=e.baseOptions)!=null&&n.modelAssetBuffer&&((i=e.baseOptions)!=null&&i.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((a=Z(this.baseOptions,Pr,1))!=null&&a.g()||(l=Z(this.baseOptions,Pr,1))!=null&&l.h()||(s=e.baseOptions)!=null&&s.modelAssetBuffer||(r=e.baseOptions)!=null&&r.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(c,d){let h=Z(c.baseOptions,a0,3);if(!h){var f=h=new a0,w=new V1;es(f,4,Jr,w)}"delegate"in d&&(d.delegate==="GPU"?(d=h,f=new up,es(d,2,Jr,f)):(d=h,f=new V1,es(d,4,Jr,f))),z(c.baseOptions,0,3,h)}(this,o),o.modelAssetPath)return fetch(o.modelAssetPath.toString()).then(c=>{if(c.ok)return c.arrayBuffer();throw Error(`Failed to fetch model: ${o.modelAssetPath} (${c.status})`)}).then(c=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(c),!0,!1,!1),of(this,"/model.dat"),this.m(),this.J()});if(o.modelAssetBuffer instanceof Uint8Array)of(this,o.modelAssetBuffer);else if(o.modelAssetBuffer)return async function(c){const d=[];for(var h=0;;){const{done:f,value:w}=await c.read();if(f)break;d.push(w),h+=w.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];c=new Uint8Array(h),h=0;for(const f of d)c.set(f,h),h+=f.length;return c}(o.modelAssetBuffer).then(c=>{of(this,c),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=cp(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((n,i)=>{this.G.push(Error(i))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,z0(this)}finishProcessing(){this.g.finishProcessing(),z0(this)}close(){this.A=void 0,this.g.closeGraph()}};function Hn(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}uf.prototype.close=uf.prototype.close;class Rp{constructor(t,n,i,a){this.g=t,this.h=n,this.m=i,this.l=a}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function R0(e,t,n){const i=e.g;if(n=Hn(i.createShader(n),"Failed to create WebGL shader"),i.shaderSource(n,t),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(n)}`);return i.attachShader(e.h,n),n}function B0(e,t){const n=e.g,i=Hn(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(i);const a=Hn(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,a),n.enableVertexAttribArray(e.P),n.vertexAttribPointer(e.P,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const l=Hn(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,l),n.enableVertexAttribArray(e.J),n.vertexAttribPointer(e.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new Rp(n,i,a,l)}function cf(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function ff(e,t,n,i){return cf(e,t),e.h||(e.m(),e.C()),n?(e.s||(e.s=B0(e,!0)),n=e.s):(e.v||(e.v=B0(e,!1)),n=e.v),t.useProgram(e.h),n.bind(),e.l(),e=i(),n.g.bindVertexArray(null),e}function ao(e,t,n){return cf(e,t),e=Hn(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function lo(e,t,n){cf(e,t),e.A||(e.A=Hn(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function df(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var hf=class{G(){return`
|
|
10
10
|
precision mediump float;
|
|
11
11
|
varying vec2 vTex;
|
|
12
12
|
uniform sampler2D inputTexture;
|
|
13
13
|
void main() {
|
|
14
14
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
15
15
|
}
|
|
16
|
-
`}m(){const e=this.g;if(this.h=
|
|
16
|
+
`}m(){const e=this.g;if(this.h=Hn(e.createProgram(),"Failed to create WebGL program"),this.Z=R0(this,`
|
|
17
17
|
attribute vec2 aVertex;
|
|
18
18
|
attribute vec2 aTex;
|
|
19
19
|
varying vec2 vTex;
|
|
20
20
|
void main(void) {
|
|
21
21
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
22
22
|
vTex = aTex;
|
|
23
|
-
}`,e.VERTEX_SHADER),this.Y=Oc(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}};function _t(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Is(e){var t=_t(e,1);if(!t){if(t=_t(e,0))t=new Float32Array(t).map(i=>i/255);else{t=new Float32Array(e.width*e.height);const i=Sr(e);var r=Ms(e);if($i(r,i,Uc(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,r);for(let n=0,s=0;n<t.length;++n,s+=4)t[n]=r[s]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function Uc(e){let t=_t(e,2);if(!t){const r=Sr(e);t=Vc(e);const i=Is(e),n=Gc(e);r.texImage2D(r.TEXTURE_2D,0,n,e.width,e.height,0,r.RED,r.FLOAT,i),Ls(e)}return t}function Sr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=vt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Gc(e){if(e=Sr(e),!Wi)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Wi=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Wi=e.R16F}return Wi}function Ms(e){return e.l||(e.l=new Cs),e.l}function Vc(e){const t=Sr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=_t(e,2);return r||(r=Vi(Ms(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Ls(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Wi,he=class{constructor(e,t,r,i,n,s,a){this.g=e,this.m=t,this.j=r,this.canvas=i,this.l=n,this.width=s,this.height=a,this.j&&--$c===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!_t(this,0)}ja(){return!!_t(this,1)}R(){return!!_t(this,2)}ia(){return(t=_t(e=this,0))||(t=Is(e),t=new Uint8Array(t.map(r=>255*r)),e.g.push(t)),t;var e,t}ha(){return Is(this)}N(){return Uc(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const i=Sr(this),n=Ms(this);i.activeTexture(i.TEXTURE1),r=Vi(n,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,r);const s=Gc(this);i.texImage2D(i.TEXTURE_2D,0,s,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),$i(n,i,r),js(n,i,!1,()=>{Vc(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Ls(this)}),Ns(n),Ls(this)}}e.push(r)}return new he(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Sr(this).deleteTexture(_t(this,2)),$c=-1}};he.prototype.close=he.prototype.close,he.prototype.clone=he.prototype.clone,he.prototype.getAsWebGLTexture=he.prototype.N,he.prototype.getAsFloat32Array=he.prototype.ha,he.prototype.getAsUint8Array=he.prototype.ia,he.prototype.hasWebGLTexture=he.prototype.R,he.prototype.hasFloat32Array=he.prototype.ja,he.prototype.hasUint8Array=he.prototype.Da;var $c=250;function at(e,t){switch(t){case 0:return e.g.find(r=>r instanceof ImageData);case 1:return e.g.find(r=>typeof ImageBitmap<"u"&&r instanceof ImageBitmap);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Wc(e){var t=at(e,0);if(!t){t=Ar(e);const r=Hi(e),i=new Uint8Array(e.width*e.height*4);$i(r,t,zi(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,i),Ns(r),t=new ImageData(new Uint8ClampedArray(i.buffer),e.width,e.height),e.g.push(t)}return t}function zi(e){let t=at(e,2);if(!t){const r=Ar(e);t=qi(e);const i=at(e,1)||Wc(e);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i),Xr(e)}return t}function Ar(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=vt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Hi(e){return e.l||(e.l=new Cs),e.l}function qi(e){const t=Ar(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=at(e,2);return r||(r=Vi(Hi(e),t),e.g.push(r),e.m=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Xr(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function zc(e){const t=Ar(e);return js(Hi(e),t,!0,()=>function(r,i){const n=r.canvas;if(n.width===r.width&&n.height===r.height)return i();const s=n.width,a=n.height;return n.width=r.width,n.height=r.height,r=i(),n.width=s,n.height=a,r}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}var fe=class{constructor(e,t,r,i,n,s,a){this.g=e,this.j=t,this.m=r,this.canvas=i,this.l=n,this.width=s,this.height=a,(this.j||this.m)&&--Hc===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!at(this,0)}ka(){return!!at(this,1)}R(){return!!at(this,2)}Aa(){return Wc(this)}za(){var e=at(this,1);return e||(zi(this),qi(this),e=zc(this),Xr(this),this.g.push(e),this.j=!0),e}N(){return zi(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof ImageData)r=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const i=Ar(this),n=Hi(this);i.activeTexture(i.TEXTURE1),r=Vi(n,i),i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindTexture(i.TEXTURE_2D,null),$i(n,i,r),js(n,i,!1,()=>{qi(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Xr(this)}),Ns(n),Xr(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);zi(this),qi(this),r=zc(this),Xr(this)}e.push(r)}return new fe(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&at(this,1).close(),this.m&&Ar(this).deleteTexture(at(this,2)),Hc=-1}};fe.prototype.close=fe.prototype.close,fe.prototype.clone=fe.prototype.clone,fe.prototype.getAsWebGLTexture=fe.prototype.N,fe.prototype.getAsImageBitmap=fe.prototype.za,fe.prototype.getAsImageData=fe.prototype.Aa,fe.prototype.hasWebGLTexture=fe.prototype.R,fe.prototype.hasImageBitmap=fe.prototype.ka,fe.prototype.hasImageData=fe.prototype.Ca;var Hc=250;function tt(...e){return e.map(([t,r])=>({start:t,end:r}))}const Ld=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((qc=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Mc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,i=this.i._malloc(r);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(r,i):this.i._changeTextGraph(r,i),this.i._free(i)}configureAudio(e,t,r,i,n){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),E(this,i||"input_audio",s=>{E(this,n=n||"audio_header",a=>{this.i._configureAudio(s,a,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){ot(this,"__graph_config__",t=>{e(t)}),E(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,i,n){const s=4*e.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(e,this.g/4),E(this,i,a=>{this.i._addAudioToInputStream(this.g,t,r,a,n)})}addGpuBufferToStream(e,t,r){E(this,t,i=>{const[n,s]=Pc(this,e,i);this.i._addBoundTextureToStream(i,n,s,r)})}addBoolToStream(e,t,r){E(this,t,i=>{this.i._addBoolToInputStream(e,i,r)})}addDoubleToStream(e,t,r){E(this,t,i=>{this.i._addDoubleToInputStream(e,i,r)})}addFloatToStream(e,t,r){E(this,t,i=>{this.i._addFloatToInputStream(e,i,r)})}addIntToStream(e,t,r){E(this,t,i=>{this.i._addIntToInputStream(e,i,r)})}addUintToStream(e,t,r){E(this,t,i=>{this.i._addUintToInputStream(e,i,r)})}addStringToStream(e,t,r){E(this,t,i=>{E(this,e,n=>{this.i._addStringToInputStream(n,i,r)})})}addStringRecordToStream(e,t,r){E(this,t,i=>{Dc(this,Object.keys(e),n=>{Dc(this,Object.values(e),s=>{this.i._addFlatHashMapToInputStream(n,s,Object.keys(e).length,i,r)})})})}addProtoToStream(e,t,r,i){E(this,r,n=>{E(this,t,s=>{const a=this.i._malloc(e.length);this.i.HEAPU8.set(e,a),this.i._addProtoToInputStream(a,e.length,s,n,i),this.i._free(a)})})}addEmptyPacketToStream(e,t){E(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputStream(n,i,r)})}addDoubleVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputStream(n,i,r)})}addFloatVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputStream(n,i,r)})}addIntVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputStream(n,i,r)})}addUintVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputStream(n,i,r)})}addStringVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)E(this,s,a=>{this.i._addStringVectorEntry(n,a)});this.i._addStringVectorToInputStream(n,i,r)})}addBoolToInputSidePacket(e,t){E(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){E(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){E(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){E(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){E(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){E(this,t,r=>{E(this,e,i=>{this.i._addStringToInputSidePacket(i,r)})})}addProtoToInputSidePacket(e,t,r){E(this,r,i=>{E(this,t,n=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputSidePacket(s,e.length,n,i),this.i._free(s)})})}addBoolVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const n of e)this.i._addBoolVectorEntry(i,n);this.i._addBoolVectorToInputSidePacket(i,r)})}addDoubleVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const n of e)this.i._addDoubleVectorEntry(i,n);this.i._addDoubleVectorToInputSidePacket(i,r)})}addFloatVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const n of e)this.i._addFloatVectorEntry(i,n);this.i._addFloatVectorToInputSidePacket(i,r)})}addIntVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const n of e)this.i._addIntVectorEntry(i,n);this.i._addIntVectorToInputSidePacket(i,r)})}addUintVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(const n of e)this.i._addUintVectorEntry(i,n);this.i._addUintVectorToInputSidePacket(i,r)})}addStringVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const n of e)E(this,n,s=>{this.i._addStringVectorEntry(i,s)});this.i._addStringVectorToInputSidePacket(i,r)})}attachBoolListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){ot(this,e,t),E(this,e,i=>{this.i._attachProtoListener(i,r||!1)})}attachProtoVectorListener(e,t,r){Pt(this,e,t),E(this,e,i=>{this.i._attachProtoVectorListener(i,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ot(this,e,(i,n)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,n)}),E(this,e,i=>{this.i._attachAudioListener(i,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends qc{get ea(){return this.i}oa(e,t,r){E(this,t,i=>{const[n,s]=Pc(this,e,i);this.ea._addBoundTextureAsImageToStream(i,n,s,r)})}V(e,t){ot(this,e,t),E(this,e,r=>{this.ea._attachImageListener(r)})}ba(e,t){Pt(this,e,t),E(this,e,r=>{this.ea._attachImageVectorListener(r)})}}));var qc,Ve=class extends Ld{};async function I(e,t,r){return async function(i,n,s,a){return Id(i,n,s,a)}(e,r.canvas??(Mc()?void 0:document.createElement("canvas")),t,r)}function Yc(e,t,r,i){if(e.U){const s=new ec;if(r!=null&&r.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var n=r.regionOfInterest;if(n.left>=n.right||n.top>=n.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(n.left<0||n.top<0||n.right>1||n.bottom>1)throw Error("Expected RectF values to be in [0,1].");v(s,1,(n.left+n.right)/2),v(s,2,(n.top+n.bottom)/2),v(s,4,n.right-n.left),v(s,3,n.bottom-n.top)}else v(s,1,.5),v(s,2,.5),v(s,4,1),v(s,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(v(s,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[a,c]=Fc(t);r=ie(s,3)*c/a,n=ie(s,4)*a/c,v(s,4,r),v(s,3,n)}}e.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",e.U,i)}e.g.oa(t,e.Z,i??performance.now()),e.finishProcessing()}function $e(e,t,r){var i;if((i=e.baseOptions)!=null&&i.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Yc(e,t,r,e.B+1)}function ct(e,t,r,i){var n;if(!((n=e.baseOptions)!=null&&n.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Yc(e,t,r,i)}function Tr(e,t,r,i){var n=t.data;const s=t.width,a=s*(t=t.height);if((n instanceof Uint8Array||n instanceof Float32Array)&&n.length!==a)throw Error("Unsupported channel count: "+n.length/a);return e=new he([n],r,!1,e.g.i.canvas,e.P,s,t),i?e.clone():e}var Se=class extends As{constructor(e,t,r,i){super(e),this.g=e,this.Z=t,this.U=r,this.na=i,this.P=new Cs}l(e,t=!0){if("runningMode"in e&&$r(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Se.prototype.close=Se.prototype.close;var We=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},S(e=this.h=new Ri,0,1,t=new q),v(this.h,2,.5),v(this.h,3,.3)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&v(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&v(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}D(e,t){return this.j={detections:[]},$e(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect_in"),D(e,"detections");const t=new Ie;Je(t,pd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect_in"),L(r,"DETECTIONS:detections"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("detections",(i,n)=>{for(const s of i)i=Qa(s),this.j.detections.push(jc(i));x(this,n)}),this.g.attachEmptyPacketListener("detections",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};We.prototype.detectForVideo=We.prototype.F,We.prototype.detect=We.prototype.D,We.prototype.setOptions=We.prototype.o,We.createFromModelPath=async function(e,t){return I(We,e,{baseOptions:{modelAssetPath:t}})},We.createFromModelBuffer=function(e,t){return I(We,e,{baseOptions:{modelAssetBuffer:t}})},We.createFromOptions=function(e,t){return I(We,e,t)};var Fs=tt([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Ps=tt([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),Ds=tt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Kc=tt([474,475],[475,476],[476,477],[477,474]),Rs=tt([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Os=tt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Xc=tt([469,470],[470,471],[471,472],[472,469]),Bs=tt([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),Qc=[...Fs,...Ps,...Ds,...Rs,...Os,...Bs],Jc=tt([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Zc(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var X=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,S(e=this.h=new cc,0,1,t=new q),this.v=new ac,S(this.h,0,3,this.v),this.s=new Ri,S(this.h,0,2,this.s),st(this.s,4,1),v(this.s,2,.5),v(this.v,2,.5),v(this.h,4,.5)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"numFaces"in e&&st(this.s,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&v(this.s,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&v(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return Zc(this),$e(this,e,t),this.j}F(e,t,r){return Zc(this),ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"face_landmarks");const t=new Ie;Je(t,yd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("face_landmarks",(i,n)=>{for(const s of i)i=qr(s),this.j.faceLandmarks.push(Oi(i));x(this,n)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{x(this,i)}),this.outputFaceBlendshapes&&(D(e,"blendshapes"),L(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(i,n)=>{if(this.outputFaceBlendshapes)for(const s of i)i=Fi(s),this.j.faceBlendshapes.push(Es(i.g()??[]));x(this,n)}),this.g.attachEmptyPacketListener("blendshapes",i=>{x(this,i)})),this.outputFacialTransformationMatrixes&&(D(e,"face_geometry"),L(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(i,n)=>{if(this.outputFacialTransformationMatrixes)for(const s of i)(i=P(xd(s),ld,2))&&this.j.facialTransformationMatrixes.push({rows:Ue(i,1)??0??0,columns:Ue(i,2)??0??0,data:qt(i,3,jt,Ht()).slice()??[]});x(this,n)}),this.g.attachEmptyPacketListener("face_geometry",i=>{x(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};X.prototype.detectForVideo=X.prototype.F,X.prototype.detect=X.prototype.D,X.prototype.setOptions=X.prototype.o,X.createFromModelPath=function(e,t){return I(X,e,{baseOptions:{modelAssetPath:t}})},X.createFromModelBuffer=function(e,t){return I(X,e,{baseOptions:{modelAssetBuffer:t}})},X.createFromOptions=function(e,t){return I(X,e,t)},X.FACE_LANDMARKS_LIPS=Fs,X.FACE_LANDMARKS_LEFT_EYE=Ps,X.FACE_LANDMARKS_LEFT_EYEBROW=Ds,X.FACE_LANDMARKS_LEFT_IRIS=Kc,X.FACE_LANDMARKS_RIGHT_EYE=Rs,X.FACE_LANDMARKS_RIGHT_EYEBROW=Os,X.FACE_LANDMARKS_RIGHT_IRIS=Xc,X.FACE_LANDMARKS_FACE_OVAL=Bs,X.FACE_LANDMARKS_CONTOURS=Qc,X.FACE_LANDMARKS_TESSELATION=Jc;var lt=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!0),S(e=this.j=new uc,0,1,t=new q)}get baseOptions(){return P(this.j,q,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,r){const i=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:r,$e(this,e,i??{}),!this.h)return this.s}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"stylized_image");const t=new Ie;Je(t,bd,this.j);const r=new ye;Me(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"STYLIZED_IMAGE:stylized_image"),r.o(t),Le(e,r),this.g.V("stylized_image",(i,n)=>{var s=!this.h,a=i.data,c=i.width;const l=c*(i=i.height);if(a instanceof Uint8Array)if(a.length===3*l){const u=new Uint8ClampedArray(4*l);for(let h=0;h<l;++h)u[4*h]=a[3*h],u[4*h+1]=a[3*h+1],u[4*h+2]=a[3*h+2],u[4*h+3]=255;a=new ImageData(u,c,i)}else{if(a.length!==4*l)throw Error("Unsupported channel count: "+a.length/l);a=new ImageData(new Uint8ClampedArray(a.buffer,a.byteOffset,a.length),c,i)}else if(!(a instanceof WebGLTexture))throw Error(`Unsupported format: ${a.constructor.name}`);c=new fe([a],!1,!1,this.g.i.canvas,this.P,c,i),this.s=s=s?c.clone():c,this.h&&this.h(s),x(this,n)}),this.g.attachEmptyPacketListener("stylized_image",i=>{this.s=null,this.h&&this.h(null),x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};lt.prototype.stylize=lt.prototype.Ka,lt.prototype.setOptions=lt.prototype.o,lt.createFromModelPath=function(e,t){return I(lt,e,{baseOptions:{modelAssetPath:t}})},lt.createFromModelBuffer=function(e,t){return I(lt,e,{baseOptions:{modelAssetBuffer:t}})},lt.createFromOptions=function(e,t){return I(lt,e,t)};var Us=tt([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function el(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function tl(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function rl(e,t=!0){const r=[];for(const n of e){var i=Fi(n);e=[];for(const s of i.g())i=t&&Ue(s,1)!=null?Ue(s,1)??0:-1,e.push({score:ie(s,2)??0,index:i,categoryName:Ge(s,3)??""??"",displayName:Ge(s,4)??""??""});r.push(e)}return r}var Fe=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.j=new fc,0,1,t=new q),this.s=new xs,S(this.j,0,2,this.s),this.C=new ps,S(this.s,0,3,this.C),this.v=new hc,S(this.s,0,2,this.v),this.h=new vd,S(this.j,0,3,this.h),v(this.v,2,.5),v(this.s,4,.5),v(this.C,2,.5)}get baseOptions(){return P(this.j,q,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){var n,s,a,c;if(st(this.v,3,e.numHands??1),"minHandDetectionConfidence"in e&&v(this.v,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.s,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&v(this.C,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new kr,r=t,i=ks(e.cannedGesturesClassifierOptions,(n=P(this.h,kr,3))==null?void 0:n.h());S(r,0,2,i),S(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((s=P(this.h,kr,3))==null||s.g());return e.customGesturesClassifierOptions?(S(r=t=new kr,0,2,i=ks(e.customGesturesClassifierOptions,(a=P(this.h,kr,4))==null?void 0:a.h())),S(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=P(this.h,kr,4))==null||c.g()),this.l(e)}Fa(e,t){return el(this),$e(this,e,t),tl(this)}Ga(e,t,r){return el(this),ct(this,e,r,t),tl(this)}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"hand_gestures"),D(e,"hand_landmarks"),D(e,"world_hand_landmarks"),D(e,"handedness");const t=new Ie;Je(t,_d,this.j);const r=new ye;Me(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"HAND_GESTURES:hand_gestures"),L(r,"LANDMARKS:hand_landmarks"),L(r,"WORLD_LANDMARKS:world_hand_landmarks"),L(r,"HANDEDNESS:handedness"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,n)=>{for(const s of i){i=qr(s);const a=[];for(const c of pt(i,Za,1))a.push({x:ie(c,1)??0,y:ie(c,2)??0,z:ie(c,3)??0,visibility:ie(c,4)??0});this.landmarks.push(a)}x(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,n)=>{for(const s of i){i=_r(s);const a=[];for(const c of pt(i,Ja,1))a.push({x:ie(c,1)??0,y:ie(c,2)??0,z:ie(c,3)??0,visibility:ie(c,4)??0});this.worldLandmarks.push(a)}x(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("hand_gestures",(i,n)=>{this.gestures.push(...rl(i,!1)),x(this,n)}),this.g.attachEmptyPacketListener("hand_gestures",i=>{x(this,i)}),this.g.attachProtoVectorListener("handedness",(i,n)=>{this.handedness.push(...rl(i)),x(this,n)}),this.g.attachEmptyPacketListener("handedness",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function il(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Fe.prototype.recognizeForVideo=Fe.prototype.Ga,Fe.prototype.recognize=Fe.prototype.Fa,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return I(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return I(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return I(Fe,e,t)},Fe.HAND_CONNECTIONS=Us;var Pe=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.h=new xs,0,1,t=new q),this.s=new ps,S(this.h,0,3,this.s),this.j=new hc,S(this.h,0,2,this.j),st(this.j,3,1),v(this.j,2,.5),v(this.s,2,.5),v(this.h,4,.5)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"numHands"in e&&st(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&v(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&v(this.s,2,e.minHandPresenceConfidence??.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],$e(this,e,t),il(this)}F(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ct(this,e,r,t),il(this)}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"hand_landmarks"),D(e,"world_hand_landmarks"),D(e,"handedness");const t=new Ie;Je(t,kd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"LANDMARKS:hand_landmarks"),L(r,"WORLD_LANDMARKS:world_hand_landmarks"),L(r,"HANDEDNESS:handedness"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,n)=>{for(const s of i)i=qr(s),this.landmarks.push(Oi(i));x(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,n)=>{for(const s of i)i=_r(s),this.worldLandmarks.push(Yr(i));x(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("handedness",(i,n)=>{var s=this.handedness,a=s.push;const c=[];for(const l of i){i=Fi(l);const u=[];for(const h of i.g())u.push({score:ie(h,2)??0,index:Ue(h,1)??0??-1,categoryName:Ge(h,3)??""??"",displayName:Ge(h,4)??""??""});c.push(u)}a.call(s,...c),x(this,n)}),this.g.attachEmptyPacketListener("handedness",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Pe.prototype.detectForVideo=Pe.prototype.F,Pe.prototype.detect=Pe.prototype.D,Pe.prototype.setOptions=Pe.prototype.o,Pe.createFromModelPath=function(e,t){return I(Pe,e,{baseOptions:{modelAssetPath:t}})},Pe.createFromModelBuffer=function(e,t){return I(Pe,e,{baseOptions:{modelAssetBuffer:t}})},Pe.createFromOptions=function(e,t){return I(Pe,e,t)},Pe.HAND_CONNECTIONS=Us;var nl=tt([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function sl(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function ol(e){try{if(!e.C)return e.h;e.C(e.h)}finally{Gi(e)}}function Yi(e,t){e=qr(e),t.push(Oi(e))}var Y=class extends Se{constructor(e,t){super(new Ve(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,S(e=this.j=new yc,0,1,t=new q),this.K=new ps,S(this.j,0,2,this.K),this.Y=new Ed,S(this.j,0,3,this.Y),this.s=new Ri,S(this.j,0,4,this.s),this.H=new ac,S(this.j,0,5,this.H),this.v=new pc,S(this.j,0,6,this.v),this.L=new xc,S(this.j,0,7,this.L),v(this.s,2,.5),v(this.s,3,.3),v(this.H,2,.5),v(this.v,2,.5),v(this.v,3,.3),v(this.L,2,.5),v(this.K,2,.5)}get baseOptions(){return P(this.j,q,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&v(this.s,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&v(this.s,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&v(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&v(this.v,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&v(this.v,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&v(this.L,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&v(this.K,2,e.minHandLandmarksConfidence??.5),this.l(e)}D(e,t,r){const i=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:r,sl(this),$e(this,e,i),ol(this)}F(e,t,r,i){const n=typeof r!="function"?r:{};return this.C=typeof r=="function"?r:i,sl(this),ct(this,e,n,t),ol(this)}m(){var e=new Ee;z(e,"input_frames_image"),D(e,"pose_landmarks"),D(e,"pose_world_landmarks"),D(e,"face_landmarks"),D(e,"left_hand_landmarks"),D(e,"left_hand_world_landmarks"),D(e,"right_hand_landmarks"),D(e,"right_hand_world_landmarks");const t=new Ie,r=new Pa;Bn(r,1,ur("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(n,s){if(s!=null)if(Array.isArray(s))$(n,2,mi(s,Pn,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof wt||$t(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Bn(n,2,_n(s,!1),Wt())}}(r,this.j.g());const i=new ye;Me(i,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),bi(i,8,Pa,r),W(i,"IMAGE:input_frames_image"),L(i,"POSE_LANDMARKS:pose_landmarks"),L(i,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),L(i,"FACE_LANDMARKS:face_landmarks"),L(i,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),L(i,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),L(i,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),L(i,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),i.o(t),Le(e,i),Ui(this,e),this.g.attachProtoListener("pose_landmarks",(n,s)=>{Yi(n,this.h.poseLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("pose_world_landmarks",(n,s)=>{var a=this.h.poseWorldLandmarks;n=_r(n),a.push(Yr(n)),x(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",n=>{x(this,n)}),this.outputPoseSegmentationMasks&&(L(i,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Er(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(n,s)=>{this.h.poseSegmentationMasks=[Tr(this,n,!0,!this.C)],x(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",n=>{this.h.poseSegmentationMasks=[],x(this,n)})),this.g.attachProtoListener("face_landmarks",(n,s)=>{Yi(n,this.h.faceLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{x(this,n)}),this.outputFaceBlendshapes&&(D(e,"extra_blendshapes"),L(i,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(n,s)=>{var a=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(n=Fi(n),a.push(Es(n.g()??[]))),x(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",n=>{x(this,n)})),this.g.attachProtoListener("left_hand_landmarks",(n,s)=>{Yi(n,this.h.leftHandLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("left_hand_world_landmarks",(n,s)=>{var a=this.h.leftHandWorldLandmarks;n=_r(n),a.push(Yr(n)),x(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("right_hand_landmarks",(n,s)=>{Yi(n,this.h.rightHandLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("right_hand_world_landmarks",(n,s)=>{var a=this.h.rightHandWorldLandmarks;n=_r(n),a.push(Yr(n)),x(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",n=>{x(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Y.prototype.detectForVideo=Y.prototype.F,Y.prototype.detect=Y.prototype.D,Y.prototype.setOptions=Y.prototype.o,Y.createFromModelPath=function(e,t){return I(Y,e,{baseOptions:{modelAssetPath:t}})},Y.createFromModelBuffer=function(e,t){return I(Y,e,{baseOptions:{modelAssetBuffer:t}})},Y.createFromOptions=function(e,t){return I(Y,e,t)},Y.HAND_CONNECTIONS=Us,Y.POSE_CONNECTIONS=nl,Y.FACE_LANDMARKS_LIPS=Fs,Y.FACE_LANDMARKS_LEFT_EYE=Ps,Y.FACE_LANDMARKS_LEFT_EYEBROW=Ds,Y.FACE_LANDMARKS_LEFT_IRIS=Kc,Y.FACE_LANDMARKS_RIGHT_EYE=Rs,Y.FACE_LANDMARKS_RIGHT_EYEBROW=Os,Y.FACE_LANDMARKS_RIGHT_IRIS=Xc,Y.FACE_LANDMARKS_FACE_OVAL=Bs,Y.FACE_LANDMARKS_CONTOURS=Qc,Y.FACE_LANDMARKS_TESSELATION=Jc;var ze=class extends Se{constructor(e,t){super(new Ve(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},S(e=this.h=new bc,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return S(this.h,0,2,ks(e,P(this.h,ws,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},$e(this,e,t),this.j}ra(e,t,r){return this.j={classifications:[]},ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"input_image"),z(e,"norm_rect"),D(e,"classifications");const t=new Ie;Je(t,Sd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),W(r,"IMAGE:input_image"),W(r,"NORM_RECT:norm_rect"),L(r,"CLASSIFICATIONS:classifications"),r.o(t),Le(e,r),this.g.attachProtoListener("classifications",(i,n)=>{this.j=function(s){const a={classifications:pt(s,dd,1).map(c=>{var l;return Es(((l=P(c,Ka,4))==null?void 0:l.g())??[],Ue(c,2)??0,Ge(c,3)??"")})};return Cn(hr(s,2))!=null&&(a.timestampMs=Cn(hr(s,2))??0),a}(hd(i)),x(this,n)}),this.g.attachEmptyPacketListener("classifications",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ze.prototype.classifyForVideo=ze.prototype.ra,ze.prototype.classify=ze.prototype.qa,ze.prototype.setOptions=ze.prototype.o,ze.createFromModelPath=function(e,t){return I(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return I(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return I(ze,e,t)};var De=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!0),this.h=new vc,this.embeddings={embeddings:[]},S(e=this.h,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t=this.h,r=P(this.h,nc,2);return r=r?r.clone():new nc,e.l2Normalize!==void 0?$r(r,1,e.l2Normalize):"l2Normalize"in e&&$(r,1),e.quantize!==void 0?$r(r,2,e.quantize):"quantize"in e&&$(r,2),S(t,0,2,r),this.l(e)}xa(e,t){return $e(this,e,t),this.embeddings}ya(e,t,r){return ct(this,e,r,t),this.embeddings}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"embeddings_out");const t=new Ie;Je(t,Ad,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"EMBEDDINGS:embeddings_out"),r.o(t),Le(e,r),this.g.attachProtoListener("embeddings_out",(i,n)=>{i=md(i),this.embeddings=function(s){return{embeddings:pt(s,wd,1).map(a=>{var l,u;const c={headIndex:Ue(a,3)??0??-1,headName:Ge(a,4)??""??""};if(ra(a,tc,Un(a,1))!==void 0)a=qt(a=P(a,tc,Un(a,1)),1,jt,Ht()),c.floatEmbedding=a.slice();else{const h=new Uint8Array(0);c.quantizedEmbedding=((u=(l=P(a,fd,Un(a,2)))==null?void 0:l.ma())==null?void 0:u.h())??h}return c}),timestampMs:Cn(hr(s,2))??0}}(i),x(this,n)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Cc(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Cc(Nc(e.quantizedEmbedding),Nc(t.quantizedEmbedding))}return e},De.prototype.embedForVideo=De.prototype.ya,De.prototype.embed=De.prototype.xa,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=function(e,t){return I(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return I(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return I(De,e,t)};var Gs=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function al(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function cl(e){try{const t=new Gs(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Gi(e)}}Gs.prototype.close=Gs.prototype.close;var Ae=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new _s,this.v=new _c,S(this.h,0,3,this.v),S(e=this.h,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?$(this.h,2,ur(e.displayNamesLocale)):"displayNamesLocale"in e&&$(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}J(){(function(e){var r,i;const t=pt(e.ca(),ye,1).filter(n=>(Ge(n,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((i=(r=P(t[0],Ie,7))==null?void 0:r.l())==null?void 0:i.g())??new Map).forEach((n,s)=>{e.s[Number(s)]=Ge(n,1)??""})})(this)}segment(e,t,r){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,al(this),$e(this,e,i),cl(this)}Ia(e,t,r,i){const n=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:i,al(this),ct(this,e,n,t),cl(this)}Ba(){return this.s}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect");const t=new Ie;Je(t,Sc,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),r.o(t),Le(e,r),Ui(this,e),this.outputConfidenceMasks&&(D(e,"confidence_masks"),L(r,"CONFIDENCE_MASKS:confidence_masks"),Er(this,"confidence_masks"),this.g.ba("confidence_masks",(i,n)=>{this.confidenceMasks=i.map(s=>Tr(this,s,!0,!this.j)),x(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],x(this,i)})),this.outputCategoryMask&&(D(e,"category_mask"),L(r,"CATEGORY_MASK:category_mask"),Er(this,"category_mask"),this.g.V("category_mask",(i,n)=>{this.categoryMask=Tr(this,i,!1,!this.j),x(this,n)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,x(this,i)})),D(e,"quality_scores"),L(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,n)=>{this.qualityScores=i,x(this,n)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ae.prototype.getLabels=Ae.prototype.Ba,Ae.prototype.segmentForVideo=Ae.prototype.Ia,Ae.prototype.segment=Ae.prototype.segment,Ae.prototype.setOptions=Ae.prototype.o,Ae.createFromModelPath=function(e,t){return I(Ae,e,{baseOptions:{modelAssetPath:t}})},Ae.createFromModelBuffer=function(e,t){return I(Ae,e,{baseOptions:{modelAssetBuffer:t}})},Ae.createFromOptions=function(e,t){return I(Ae,e,t)};var Vs=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};Vs.prototype.close=Vs.prototype.close;var Fd=class extends y{constructor(e){super(e)}},jr=[0,ee,-2],Ki=[0,bt,-3,H,bt,-1],ll=[0,Ki],ul=[0,Ki,ee,-1],$s=class extends y{constructor(e){super(e)}},dl=[0,bt,-1,H],Pd=class extends y{constructor(e){super(e)}},hl=class extends y{constructor(e){super(e)}},Ws=[1,2,3,4,5,6,7,8,9,10,14,15],fl=class extends y{constructor(e){super(e)}};fl.prototype.g=Li([0,ue,[0,Ws,O,Ki,O,[0,Ki,jr],O,ll,O,[0,ll,jr],O,dl,O,[0,bt,-3,H,Ce],O,[0,bt,-3,H],O,[0,R,bt,-2,H,ee,H,-1,2,bt,jr],O,ul,O,[0,ul,jr],bt,jr,R,O,[0,bt,-3,H,jr,-1],O,[0,ue,dl]],R,[0,R,ee,-1,H]]);var ut=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new _s,this.s=new _c,S(this.h,0,3,this.s),S(e=this.h,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,i){const n=typeof r!="function"?r:{};this.j=typeof r=="function"?r:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.B+1,i=new fl;const s=new hl;var a=new Fd;if(st(a,1,255),S(s,0,12,a),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var c=new $s;$r(c,3,!0),v(c,1,t.keypoint.x),v(c,2,t.keypoint.y),Vr(s,5,Ws,c)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(c of(a=new Pd,t.scribble))$r(t=new $s,3,!0),v(t,1,c.x),v(t,2,c.y),bi(a,1,$s,t);Vr(s,15,Ws,a)}bi(i,1,hl,s),this.g.addProtoToStream(i.g(),"drishti.RenderData","roi_in",r),$e(this,e,n);e:{try{const u=new Vs(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var l=u;break e}this.j(u)}finally{Gi(this)}l=void 0}return l}m(){var e=new Ee;z(e,"image_in"),z(e,"roi_in"),z(e,"norm_rect_in");const t=new Ie;Je(t,Sc,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),W(r,"IMAGE:image_in"),W(r,"ROI:roi_in"),W(r,"NORM_RECT:norm_rect_in"),r.o(t),Le(e,r),Ui(this,e),this.outputConfidenceMasks&&(D(e,"confidence_masks"),L(r,"CONFIDENCE_MASKS:confidence_masks"),Er(this,"confidence_masks"),this.g.ba("confidence_masks",(i,n)=>{this.confidenceMasks=i.map(s=>Tr(this,s,!0,!this.j)),x(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],x(this,i)})),this.outputCategoryMask&&(D(e,"category_mask"),L(r,"CATEGORY_MASK:category_mask"),Er(this,"category_mask"),this.g.V("category_mask",(i,n)=>{this.categoryMask=Tr(this,i,!1,!this.j),x(this,n)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,x(this,i)})),D(e,"quality_scores"),L(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,n)=>{this.qualityScores=i,x(this,n)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ut.prototype.segment=ut.prototype.segment,ut.prototype.setOptions=ut.prototype.o,ut.createFromModelPath=function(e,t){return I(ut,e,{baseOptions:{modelAssetPath:t}})},ut.createFromModelBuffer=function(e,t){return I(ut,e,{baseOptions:{modelAssetBuffer:t}})},ut.createFromOptions=function(e,t){return I(ut,e,t)};var He=class extends Se{constructor(e,t){super(new Ve(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},S(e=this.h=new Ac,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?$(this.h,2,ur(e.displayNamesLocale)):"displayNamesLocale"in e&&$(this.h,2),e.maxResults!==void 0?st(this.h,3,e.maxResults):"maxResults"in e&&$(this.h,3),e.scoreThreshold!==void 0?v(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&$(this.h,4),e.categoryAllowlist!==void 0?vi(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&$(this.h,5),e.categoryDenylist!==void 0?vi(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&$(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},$e(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"input_frame_gpu"),z(e,"norm_rect"),D(e,"detections");const t=new Ie;Je(t,jd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),W(r,"IMAGE:input_frame_gpu"),W(r,"NORM_RECT:norm_rect"),L(r,"DETECTIONS:detections"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("detections",(i,n)=>{for(const s of i)i=Qa(s),this.j.detections.push(jc(i));x(this,n)}),this.g.attachEmptyPacketListener("detections",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};He.prototype.detectForVideo=He.prototype.F,He.prototype.detect=He.prototype.D,He.prototype.setOptions=He.prototype.o,He.createFromModelPath=async function(e,t){return I(He,e,{baseOptions:{modelAssetPath:t}})},He.createFromModelBuffer=function(e,t){return I(He,e,{baseOptions:{modelAssetBuffer:t}})},He.createFromOptions=function(e,t){return I(He,e,t)};var zs=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function wl(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function ml(e){try{const t=new zs(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{Gi(e)}}zs.prototype.close=zs.prototype.close;var Re=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,S(e=this.h=new Tc,0,1,t=new q),this.v=new xc,S(this.h,0,3,this.v),this.j=new pc,S(this.h,0,2,this.j),st(this.j,4,1),v(this.j,2,.5),v(this.v,2,.5),v(this.h,4,.5)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"numPoses"in e&&st(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&v(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&v(this.v,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}D(e,t,r){const i=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:r,wl(this),$e(this,e,i),ml(this)}F(e,t,r,i){const n=typeof r!="function"?r:{};return this.s=typeof r=="function"?r:i,wl(this),ct(this,e,n,t),ml(this)}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"normalized_landmarks"),D(e,"world_landmarks"),D(e,"segmentation_masks");const t=new Ie;Je(t,Nd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"NORM_LANDMARKS:normalized_landmarks"),L(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Le(e,r),Ui(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(i,n)=>{this.landmarks=[];for(const s of i)i=qr(s),this.landmarks.push(Oi(i));x(this,n)}),this.g.attachEmptyPacketListener("normalized_landmarks",i=>{this.landmarks=[],x(this,i)}),this.g.attachProtoVectorListener("world_landmarks",(i,n)=>{this.worldLandmarks=[];for(const s of i)i=_r(s),this.worldLandmarks.push(Yr(i));x(this,n)}),this.g.attachEmptyPacketListener("world_landmarks",i=>{this.worldLandmarks=[],x(this,i)}),this.outputSegmentationMasks&&(L(r,"SEGMENTATION_MASK:segmentation_masks"),Er(this,"segmentation_masks"),this.g.ba("segmentation_masks",(i,n)=>{this.segmentationMasks=i.map(s=>Tr(this,s,!0,!this.s)),x(this,n)}),this.g.attachEmptyPacketListener("segmentation_masks",i=>{this.segmentationMasks=[],x(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Re.prototype.detectForVideo=Re.prototype.F,Re.prototype.detect=Re.prototype.D,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return I(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return I(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return I(Re,e,t)},Re.POSE_CONNECTIONS=nl;const Xi="https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task",Dd="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm",Rd=()=>{const e=d.useRef(null),[t,r]=d.useState(!1),[i,n]=d.useState("Initializing..."),[s,a]=d.useState(0),[c,l]=d.useState(!1);d.useEffect(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(w=>{console.log("ServiceWorker registered:",w)}).catch(w=>{console.log("ServiceWorker registration failed:",w)})},[]);const u=async()=>"caches"in window?await(await caches.open("mediapipe-models-v1")).match(Xi)!==void 0:!1,h=async()=>{try{const w=await fetch(Xi),m=w.headers.get("content-length"),g=m?parseInt(m,10):0;if(!w.body)throw new Error("No response body");const b=w.body.getReader();let _=0;const p=[];for(;;){const{done:A,value:F}=await b.read();if(A)break;if(p.push(F),_+=F.length,g){const T=Math.round(_/g*100);a(T),n(`Downloading model... ${T}%`)}}return"caches"in window&&await(await caches.open("mediapipe-models-v1")).put(Xi,new Response(new Blob(p),{headers:{"Content-Type":"application/octet-stream"}})),!0}catch(w){return console.error("Failed to preload model:",w),!1}};return d.useEffect(()=>{(async()=>{try{n("Checking cached models..."),await u()?n("Using cached model..."):(n("Model not cached. Downloading..."),await h()),n("Loading MediaPipe WASM...");const g=await Xt.forVisionTasks(Dd);n("Creating face landmarker...");const b=await X.createFromOptions(g,{baseOptions:{modelAssetPath:Xi,delegate:"GPU"},runningMode:"VIDEO",outputFaceBlendshapes:!0,numFaces:2});e.current=b,r(!0),n("Model loaded successfully ✅")}catch(m){console.error("Model init error:",m),n(`Error: ${m==null?void 0:m.message}`),(m==null?void 0:m.name)==="NotAllowedError"&&l(!0)}})()},[]),{faceLandmarkerRef:e,isModelLoaded:t,statusMessage:i,setStatusMessage:n,loadingProgress:s,permissionDenied:c,clearCache:async()=>{"caches"in window&&(await caches.delete("mediapipe-models-v1"),n("Cache cleared. Please refresh to re-download models."))}}},Od=()=>{const[e,t]=d.useState(0),r=d.useRef({lastTime:0,frames:0,fps:0}),i=d.useCallback(()=>{const n=performance.now(),s=r.current;if(s.frames++,n-s.lastTime>=1e3){const a=Math.round(s.frames*1e3/(n-s.lastTime));t(a),s.frames=0,s.lastTime=n}},[]);return{fps:e,updateFPS:i}},Bd=()=>{const e=d.useRef({value:100,isLookingAway:!1}),t=d.useCallback((s,a,c,l)=>{if(!s||!c||!a)return;const u=s.getContext("2d");if(!u)return;const{width:h,height:f}=s;if(u.clearRect(0,0,h,f),u.drawImage(a,0,0,h,f),l){u.fillStyle="#00FF00";for(const w of c)u.fillRect(w.x*h-.5,w.y*f-.5,1,1)}},[]),r=d.useCallback(s=>{const a=e.current.value/100,c=100,l=20,u=10,h=10;s.fillStyle="rgba(0, 0, 0, 0.3)",s.fillRect(u,h,l,c),s.fillStyle=`rgba(${Math.floor(255*(1-a))}, ${Math.floor(255*a)}, 0, 0.8)`;const f=c*a;s.fillRect(u,h+c-f,l,f),s.fillStyle="#FFFFFF",s.fillRect(u,h+c*(1-a),l,2)},[]),i=d.useCallback((s,a,c,l,u,h,f)=>{if(t(s,a,c,l),u&&h&&f){const w=s.getContext("2d");w&&r(w)}},[t,r]),n=d.useCallback((s,a)=>{const c=s.getContext("2d");c&&(c.clearRect(0,0,s.width,s.height),c.drawImage(a,0,0,s.width,s.height))},[]);return{drawLandmarks:t,drawEngagementBar:r,drawWithEngagementBar:i,clearCanvas:n,engagementRef:e}},Ud=70,Gd=()=>{const[e,t]=d.useState(100),[r,i]=d.useState(!1),n=d.useRef(0),s=d.useCallback((a,c,l)=>{if(!l||a.length<468)return;const u=a[33],h=a[263],f=a[1];if(!u||!h||!f)return;const w=(u.x+h.x)*.5,m=(u.y+h.y)*.5,g=w-c.x,b=m-c.y,_=Math.sqrt(g*g+b*b),p=Math.abs(f.y-c.noseY)*100,A=Math.abs(f.x-c.noseX)*100,F=Math.max(0,100-(_*200+p+A)),T=F<Ud,C=performance.now();return C-n.current>100&&(t(F),i(T),n.current=C),{engagement:F,isLookingAway:T}},[]);return{engagement:e,isLookingAway:r,analyzeGaze:s,setEngagement:t,setIsLookingAway:i}},Vd=.05,$d=()=>{const[e,t]=d.useState(!1),[r,i]=d.useState(!1),n=d.useCallback((c,l)=>Math.sqrt(Math.pow(c.x-l.x,2)+Math.pow(c.y-l.y,2)),[]),s=d.useCallback((c,l)=>{if(!c||!l)return 0;const u=[1,33,263,61,291,10,152];let h=0,f=0;const w=l[33],m=l[263],g=c[33],b=c[263];if(!w||!m||!g||!b)return 0;const _=n(w,m),p=n(g,b);if(_===0||p===0)return 0;for(const F of u){const T=l[F],C=c[F];if(T&&C){const M=w.x+(C.x-g.x)*_/p,B=w.y+(C.y-g.y)*_/p;h+=n(T,{x:M,y:B}),f++}}return f===0?0:h/f},[n]),a=d.useCallback((c,l,u,h)=>{if(!c.faceLandmarks||c.faceLandmarks.length===0)return l?(h("Reference face not detected."),i(!0),t(!1)):i(!1),null;if(l&&u){let f=null,w=0;for(const m of c.faceLandmarks)s(m,u)<Vd&&(f=m,w++);return w===1?(t(!1),i(!1),h("Reference face tracked."),f):w>1?(t(!0),i(!1),h("Multiple matching faces detected. Tracking suspended."),null):(t(!1),i(!0),h("Reference face not detected."),null)}else{c.faceLandmarks.length>1?(t(!0),h("Multiple faces detected. Set reference for single face tracking.")):(t(!1),h("No reference set. Detecting first face."));const f=c.faceLandmarks[0];return!f||f.length<468?null:f}},[s]);return{multipleFacesDetected:e,referenceFaceNotDetected:r,analyzeFace:a,setMultipleFacesDetected:t,setReferenceFaceNotDetected:i}},Wd=1e3,zd=(e,t)=>{const[r,i]=d.useState(!1),[n,s]=d.useState("face_detected"),{incrementGazeViolation:a}=Zs(),{multipleFacesDetected:c,referenceFaceNotDetected:l,isLookingAway:u}=e;d.useEffect(()=>{let w;return(u||c||l)&&t?w=setTimeout(()=>{i(!0),u?(s("looking_away"),a("looking_away")):c?(s("multiple_faces"),a("multiple_faces")):l&&(s("no_face_detected"),a("no_face_detected"))},Wd):(i(!1),s("face_detected")),()=>{clearTimeout(w)}},[u,c,l,t,a]);const h=d.useCallback(()=>c?"multiple_faces":l?"no_face_detected":u?"looking_away":"face_detected",[c,l,u]),f=d.useCallback(()=>{i(!1),s("face_detected")},[]);return{showGazeWarningModal:r,faceDetectionState:n,getWarningType:h,closeWarningModal:f,setShowGazeWarningModal:i,setFaceDetectionState:s}};class te extends Error{constructor(t,r,i=!1){super(t),this.code=r,this.recoverable=i,this.name="STTError"}}class Hd{constructor(t={}){Oe(this,"config");Oe(this,"mediaRecorder",null);Oe(this,"audioChunks",[]);Oe(this,"recordingStream",null);Oe(this,"autoStopTimeoutId",null);this.config={baseUrl:"http://localhost:8000",provider:"groq",model:"whisper-large-v3-turbo",language:"en",includeTimestamps:!1,temperature:0,...t}}updateConfig(t){this.config={...this.config,...t}}isRecordingSupported(){return!!(navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&window.MediaRecorder)}async startRecording(t,r){var i;if(!this.isRecordingSupported())throw new te("Audio recording is not supported in this browser","RECORDING_NOT_SUPPORTED",!1);if(this.isRecording())throw new te("Recording is already in progress","ALREADY_RECORDING",!0);try{this.recordingStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:44100}}),this.audioChunks=[];const n=this.getSupportedMimeType();this.mediaRecorder=new MediaRecorder(this.recordingStream,{mimeType:n}),this.mediaRecorder.ondataavailable=s=>{var a;s.data.size>0&&(this.audioChunks.push(s.data),(a=r==null?void 0:r.onDataAvailable)==null||a.call(r,s.data))},this.mediaRecorder.onstop=()=>{var s;(s=r==null?void 0:r.onStop)==null||s.call(r)},this.mediaRecorder.onerror=s=>{var c;const a=new te(`Recording failed: ${s.error}`,"RECORDING_ERROR",!0);(c=r==null?void 0:r.onError)==null||c.call(r,a),this.cleanup()},this.mediaRecorder.start(100),(i=r==null?void 0:r.onStart)==null||i.call(r),t&&t>0&&(this.autoStopTimeoutId=setTimeout(()=>{this.isRecording()&&this.stopRecording()},t*1e3))}catch(n){if(this.cleanup(),n instanceof Error){if(n.name==="NotAllowedError"||n.name==="PermissionDeniedError")throw new te("Microphone permission was denied","PERMISSION_DENIED",!1);if(n.name==="NotFoundError")throw new te("No microphone found","NO_MICROPHONE",!1)}throw new te(`Failed to start recording: ${n instanceof Error?n.message:String(n)}`,"START_RECORDING_FAILED",!0)}}async stopRecording(){if(this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),!this.mediaRecorder||!this.isRecording())throw new te("No active recording to stop","NO_ACTIVE_RECORDING",!1);return new Promise((t,r)=>{if(!this.mediaRecorder){r(new te("MediaRecorder is null","MEDIARECORDER_NULL",!1));return}const i=this.mediaRecorder,n=()=>{try{const s=i.mimeType||"audio/webm",a=new Blob(this.audioChunks,{type:s});this.cleanup(),t(a)}catch(s){r(new te(`Failed to create audio blob: ${s instanceof Error?s.message:String(s)}`,"BLOB_CREATION_FAILED",!1))}};i.addEventListener("stop",n,{once:!0}),i.stop()})}async transcribe(t){const{audioBlob:r}=t;if(!r||r.size===0)throw new te("Audio blob is empty or invalid","INVALID_AUDIO",!1);try{const i=new FormData,n=new File([r],"recording.wav",{type:r.type||"audio/wav"});if(i.append("file",n),i.append("qna_id",this.config.qnaId||""),!this.config.interviewId)throw new te("Interview ID is missing from configuration","MISSING_INTERVIEW_ID",!1);const s=await Bt(`${this.config.baseUrl}${Gt.TRANSCRIBE_ANSWER(this.config.interviewId)}`,{method:"POST",headers:{accept:"application/json","X-STT-Provider":this.config.provider||"groq",...this.config.authToken&&{Authorization:`Bearer ${this.config.authToken}`}},body:i},{attempts:1,backoff:"exponential",baseDelay:1e3,maxDelay:3e3,jitter:!0});if(!s.ok){const c=await s.text();let l=`STT request failed: ${s.status} ${s.statusText}`;try{const u=JSON.parse(c);l=u.message||u.error||l}catch{l=c||l}throw new te(l,`HTTP_${s.status}`,s.status>=500)}return{transcript:(await s.json()).data.transcribed_text??""}}catch(i){throw i instanceof te?i:new te(`Transcription failed: ${i instanceof Error?i.message:String(i)}`,"TRANSCRIPTION_FAILED",!0)}}cancelRecording(){this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),this.mediaRecorder&&this.isRecording()&&this.mediaRecorder.stop(),this.cleanup()}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}getSupportedMimeType(){const t=["audio/webm","audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/wav"];for(const r of t)if(MediaRecorder.isTypeSupported(r))return r;return"audio/webm"}getRecordingStream(){return this.recordingStream}cleanup(){this.recordingStream&&(this.recordingStream.getTracks().forEach(t=>t.stop()),this.recordingStream=null),this.mediaRecorder=null,this.audioChunks=[],this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null)}}const Nr=new Hd,qd=(e,t,r,i)=>{const n=d.useRef(null);return d.useEffect(()=>{if(!t)return;const s=async()=>{try{const l=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:640},height:{ideal:480},facingMode:"user"}});e.current&&(e.current.srcObject=l,e.current.onloadeddata=()=>{r()})}catch(l){console.error("Camera access error:",l),i("Camera access failed")}},a=n.current,c=e.current;return s(),()=>{a&&cancelAnimationFrame(a),c!=null&&c.srcObject&&c.srcObject.getTracks().forEach(u=>u.stop())}},[t,r]),d.useEffect(()=>{const s=Nr.getRecordingStream();if(s&&e.current){e.current.srcObject=s;const a=s.getVideoTracks(),c=s.getAudioTracks(),l=()=>{console.log("Media track ended - permission may have been revoked")};[...a,...c].forEach(u=>{u.addEventListener("ended",l)})}},[]),{animationFrameRef:n}},Yd=(e,t,r,i,n,s,a,c,l,u,h,f,w,m,g)=>{const b=d.useRef(null),_=d.useCallback(()=>{var T;const p=e.current,A=t.current,F=r.current;if(!p||p.readyState<2||!F||!A){b.current=requestAnimationFrame(_);return}i();try{const C=performance.now(),M=F.detectForVideo(p,C);if(((T=M.faceLandmarks)==null?void 0:T.length)>0){g(!1);const B=n(M,l,u.current,m);B?(s(A,p,B,h,f,w,l),l&&w&&c(B,u.current,w)):a(A,p)}else a(A,p),l?(g(!0),m("Reference face not detected.")):g(!1)}catch(C){console.error("Face detection error:",C)}b.current=requestAnimationFrame(_)},[e,t,r,i,n,s,a,c,l,u,h,f,w,m,g]);return{renderLoop:_,animationFrameRef:b}},Kd=(e,t,r,i)=>{const{referenceSet:n,referenceRef:s,setReferenceData:a}=Zs(),c=d.useRef(s),l=d.useCallback(()=>{c.current=s},[s]),u=d.useCallback(()=>{var w;const h=e.current,f=t.current;if(console.log({faceLandmarker:h,video:f}),!(!h||!f))try{const m=performance.now(),g=h.detectForVideo(f,m);if((w=g.faceLandmarks)!=null&&w[0]){const b=g.faceLandmarks[0],_=b[33],p=b[263],A=b[1];_&&p&&A&&(c.current={x:(_.x+p.x)*.5,y:(_.y+p.y)*.5,noseX:A.x,noseY:A.y},a(!0,c.current),r("Reference set. Gaze tracking active."),console.log("Reference set. Gaze tracking active.",c.current),i&&i())}}catch(m){console.error("Set reference error:",m),r("Failed to set reference")}},[e,t,r,a,i]);return{referenceSet:n,referenceRef:c,setReference:u,syncReference:l}},gl=d.forwardRef(({className:e="",interviewId:t="",interview_duration:r,showProctoringUI:i=!0,onSetReference:n},s)=>{var El;const{authToken:a}=ro(),c=a?Wl(a):null,l=lo(),{borderRadius:u}=rr(),h=u??18,{proctoring:f}=cn(),w=!!(f!=null&&f.gazeAnalysisEnabled),[m,g]=d.useState(!1),[b,_]=d.useState((f==null?void 0:f.showLandmarks)??!1),[p,A]=d.useState(i&&((f==null?void 0:f.showEngagementBar)??!0)),[F,T]=d.useState(w),C=d.useRef(null),M=d.useRef(null),B=d.useRef(null),G=d.useRef(null),Q=d.useCallback(async ft=>{var tn;const Jr=C.current,ve=B.current;if(!Jr||!ve)return;const Cr=ve.getContext("2d");if(!Cr)return;ve.width=Jr.videoWidth,ve.height=Jr.videoHeight,Cr.save(),Cr.scale(-1,1),Cr.drawImage(Jr,-ve.width,0,ve.width,ve.height),Cr.restore();const Zr=await new Promise(er=>ve.toBlob(er,"image/jpeg"));if(Zr&&t)try{const er=`${ft}-${Date.now()}.jpeg`,_e=await l.requestScreenshotUploadUrl(t,er);_e.data&&_e.data.upload_url&&(await l.uploadScreenshot((tn=_e==null?void 0:_e.data)==null?void 0:tn.upload_url,Zr),_e.data.asset_id&&await l.confirmScreenshotUpload(_e.data.asset_id))}catch(er){console.error(`Failed to upload screenshot for ${ft}:`,er)}},[l,t]),{faceLandmarkerRef:oe,isModelLoaded:qe,statusMessage:de,setStatusMessage:Ye,loadingProgress:Te,permissionDenied:be,clearCache:kt}=Rd(),{fps:dt,updateFPS:ge}=Od(),{drawWithEngagementBar:Qt,clearCanvas:Ke,engagementRef:re}=Bd(),{engagement:Xe,isLookingAway:V,analyzeGaze:ht,setEngagement:j,setIsLookingAway:J}=Gd(),{multipleFacesDetected:Dt,referenceFaceNotDetected:Rt,analyzeFace:Jt,setMultipleFacesDetected:Ji,setReferenceFaceNotDetected:Zt}=$d(),{referenceSet:Qr,referenceRef:Zi,setReference:N,syncReference:je}=Kd(oe,C,Ye,n),rt={multipleFacesDetected:Dt,referenceFaceNotDetected:Rt,isLookingAway:V},{showGazeWarningModal:en,getWarningType:Ch,closeWarningModal:vl,setShowGazeWarningModal:_l,setFaceDetectionState:kl}=zd(rt,w),{renderLoop:Ih}=Yd(C,M,oe,ge,Jt,Qt,Ke,ht,Qr,Zi,b,p,w,Ye,Zt);qd(C,qe,Ih,Ye),d.useEffect(()=>{je()},[je]),d.useEffect(()=>{re&&re.current&&(re.current.value=Xe,re.current.isLookingAway=V)},[Xe,V,re]);const Mh=d.useCallback(ft=>{T(ft),ft||(j(100),J(!1))},[j,J]),Lh=d.useCallback(()=>{J(!1),Ji(!1),Zt(!1),kl("face_detected"),_l(!1),vl()},[J,Ji,Zt,kl,_l,vl]),Fh={engagement:Xe,fps:dt,isLookingAway:V,multipleFacesDetected:Dt,referenceFaceNotDetected:Rt};return d.useEffect(()=>{const ft=[];return(async()=>{try{const ve=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1});G.current=ve,C.current&&(C.current.srcObject=ve);const Zr=(r??ti)*60*1e3/3,tn=[0,1,2].map((_e,Ot)=>({label:`capture-${Ot+1}`,start:Ot*Zr,end:(Ot+1)*Zr})),er=(_e,Ot)=>_e===Ot?_e:Math.random()*(Ot-_e)+_e;tn.forEach(({label:_e,start:Ot,end:Ph},Dh)=>{let Ys;Dh===0?Ys=3e3:Ys=er(Ot,Ph),ft.push(setTimeout(()=>{Q(_e)},Ys))})}catch(ve){console.error("Error accessing camera:",ve)}})(),()=>{G.current&&G.current.getTracks().forEach(ve=>ve.stop()),ft.forEach(clearTimeout)}},[Q]),d.useImperativeHandle(s,()=>({setReference:()=>{N()},stopCamera:()=>{G.current&&(G.current.getTracks().forEach(ft=>ft.stop()),G.current=null)}}),[N]),o.jsxs("div",{className:`iw-relative iw-h-full ${e}`,children:[be?o.jsxs("div",{className:"iw-rounded-md iw-border iw-border-red-600 iw-p-5 iw-text-red-600",children:[o.jsx("h2",{children:"Camera Permission Denied"}),o.jsx("p",{children:"Please allow camera access to use this application."})]}):o.jsx("div",{className:"iw-flex iw-w-full iw-h-full iw-flex-wrap iw-gap-5",children:o.jsxs("div",{className:"iw-relative iw-flex-1",children:[o.jsx("video",{ref:C,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-w-full iw-h-full iw-object-cover iw-scale-75 iw-rounded-r-xl iw-min-h-[200px] iw-max-h-[600px] iw-aspect-video",style:{transform:"scaleX(-1)"}}),w&&o.jsx("canvas",{ref:M,width:420,height:240,className:"iw-absolute iw-top-0 iw-left-0 iw-w-full iw-h-full iw-object-cover iw-scale-75 iw-rounded-r-xl iw-min-h-[200px] iw-max-h-[600px] iw-aspect-video",style:{transform:"scaleX(-1)",borderRadius:h}}),o.jsx("canvas",{ref:B,style:{display:"none"}}),i&&o.jsxs("div",{className:"iw-absolute iw-top-4 iw-left-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md",children:[o.jsx("div",{className:"iw-size-2 iw-animate-pulse iw-rounded-full iw-bg-red-500"}),o.jsx("span",{className:"iw-font-medium iw-text-white",children:"Recording"})]}),i&&((El=c==null?void 0:c.data)==null?void 0:El.user_name)&&o.jsx("div",{className:"iw-absolute iw-z-50 iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md",children:o.jsx("span",{className:"iw-font-medium iw-text-white",children:c.data.user_name})}),i&&o.jsx("div",{className:"iw-absolute iw-bottom-4 iw-right-4",children:o.jsx(lu,{showControls:(f==null?void 0:f.showControls)??!1,isBubbleOpen:m,setIsBubbleOpen:g,setReference:N,clearCache:kt,isModelLoaded:qe,gazeAnalysisEnabled:F&&w,referenceSet:Qr,showLandmarks:b,setShowLandmarks:_,showEngagementBar:p,setShowEngagementBar:A,handleToggleGazeAnalysis:Mh,stats:Fh,statusMessage:de,loadingProgress:Te})})]})}),w&&en&&o.jsx(au,{isOpen:en,onClose:Lh,warningType:Ch()})]})}),Xd=["Do not refresh or reload the page during your assessment","Refrain from switching tabs or opening other applications while the session is in progress","Ensure your face remains clearly visible on camera at all times","Avoid frequent distractions or leaving your seat during the session","Do not disable or interfere with audio/video monitoring"],Qd=({isOpen:e,onStart:t,onClose:r,gazeEnabled:i=!1,videoFeedRef:n,interviewId:s="",interview_duration:a=ti})=>{var ht;const c=d.useRef(null),l=d.useRef(null),{baseColor:u,borderRadius:h}=rr(),[f,w]=d.useState(!1),[m,g]=d.useState(!1),[b,_]=d.useState(!1),[p,A]=d.useState(!1),[F,T]=d.useState(!1),[C,M]=d.useState(null),[B,G]=d.useState(!1),Q=d.useRef(null),oe=d.useRef(null),qe=j=>{Q.current=j,n&&(typeof n=="function"?n(j):n.current=j)},de=u??"#2563eb",Ye=oo(de),Te=h??18,be=(j,J)=>j.startsWith("#")&&j.length===7?`${j}${J}`:j,kt=[`radial-gradient(120% 85% at 50% 125%, ${be(de,"34")} 0%, transparent 70%)`,`radial-gradient(90% 70% at 10% 130%, ${be(de,"24")} 0%, transparent 72%)`,`radial-gradient(90% 70% at 90% 130%, ${be(de,"24")} 0%, transparent 72%)`,`repeating-linear-gradient(135deg, ${be(de,"14")} 0, ${be(de,"14")} 16px, transparent 16px, transparent 32px)`].join(", "),dt=f?{label:"Camera & microphone ready",toneClass:"iw-bg-white/15 iw-text-white",dotClass:"iw-bg-emerald-400"}:B?{label:"Checking device access…",toneClass:"iw-bg-white/15 iw-text-white",dotClass:"iw-bg-amber-300"}:{label:"Allow access to continue",toneClass:"iw-bg-white/15 iw-text-white",dotClass:"iw-bg-rose-300"},ge=f?{badge:"Ready",toneClass:"iw-bg-emerald-50 iw-text-emerald-600",cameraCopy:"Framing looks good for identity verification.",micCopy:"We can hear you clearly for your responses."}:B?{badge:"Checking",toneClass:"iw-bg-amber-50 iw-text-amber-600",cameraCopy:"Hang tight while we confirm camera access.",micCopy:"Listening for microphone permission from your browser."}:{badge:"Action needed",toneClass:"iw-bg-rose-50 iw-text-rose-600",cameraCopy:"Grant camera access to continue with the interview.",micCopy:"Enable microphone access so we can capture your answers."},Qt=[{label:"Camera feed",description:ge.cameraCopy,status:ge.badge,toneClass:ge.toneClass,Icon:co},{label:"Microphone input",description:ge.micCopy,status:ge.badge,toneClass:ge.toneClass,Icon:Hl}],Ke=()=>{l.current&&(l.current.getTracks().forEach(j=>j.stop()),l.current=null)},re=async()=>{G(!0),M(null);try{const j=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1280},height:{ideal:720}},audio:!0});l.current=j,c.current&&(c.current.srcObject=j),w(!0)}catch(j){console.error("Media permission error:",j);let J="Unable to access camera or microphone.";(j==null?void 0:j.name)==="NotAllowedError"?J="Permissions denied. Please allow access to camera and microphone.":(j==null?void 0:j.name)==="NotFoundError"?J="No camera/microphone found. Please connect a device and retry.":j!=null&&j.message&&(J=j.message),w(!1),M(J)}finally{G(!1)}};if(d.useEffect(()=>{if(!e){Ke();return}return re(),()=>Ke()},[e]),d.useEffect(()=>()=>{oe.current&&(clearInterval(oe.current),oe.current=null)},[]),!e)return null;const Xe=()=>{i?_(!0):(t(),Ke())},V=async()=>{A(!0);const j=()=>{var J;return(J=Q.current)==null?void 0:J.setReference()};j(),oe.current&&clearInterval(oe.current),oe.current=setInterval(j,500)};return o.jsxs("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-gray-900/25 iw-backdrop-blur-md iw-p-4",children:[o.jsxs("div",{className:" iw-w-full iw-max-w-[920px] iw-max-h-[96vh] iw-overflow-auto iw-rounded-3xl iw-bg-white iw-shadow-[0_40px_80px_-28px_rgba(15,23,42,0.25)]",children:[o.jsxs("div",{className:"iw-relative iw-overflow-hidden",style:{background:Ye},children:[o.jsx("div",{"aria-hidden":!0,className:"iw-absolute iw-pointer-events-none",style:{top:-90,right:-100,width:240,height:240,background:"radial-gradient(circle, rgba(255,255,255,0.6), transparent 70%)",filter:"blur(12px)"}}),o.jsx("div",{"aria-hidden":!0,className:"iw-absolute iw-pointer-events-none",style:{bottom:-110,left:-60,width:220,height:220,background:"radial-gradient(circle, rgba(255,255,255,0.35), transparent 70%)",filter:"blur(14px)"}}),o.jsxs("div",{className:"iw-relative iw-grid md:iw-grid-cols-[minmax(0,1fr)_auto] iw-items-start iw-gap-6 iw-px-6 iw-py-7",children:[o.jsx("div",{className:"iw-flex iw-flex-col iw-gap-4 iw-text-white",children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-4",children:[o.jsx("div",{className:"iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner",children:o.jsx(ao,{className:"iw-h-6 iw-w-6"})}),o.jsxs("div",{children:[o.jsx("p",{className:"iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-white/70",children:"Pre-interview checklist"}),o.jsx("h2",{className:"iw-mt-1 iw-text-xl iw-font-semibold iw-leading-tight",children:"Final checks before you go live"}),o.jsx("p",{className:"iw-mt-2 iw-text-sm iw-text-white/80",children:"Align your space, confirm device access, and step confidently into your secure session."})]})]})}),o.jsx("div",{className:"iw-flex iw-items-start iw-justify-end",children:o.jsxs("div",{className:`iw-inline-flex iw-items-center iw-gap-2 iw-rounded-full iw-bg-white/10 iw-px-4 iw-py-1.5 iw-text-xs iw-font-medium iw-text-white/85 iw-backdrop-blur-sm ${dt.toneClass}`,children:[o.jsx("span",{className:`iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${dt.dotClass}`}),dt.label]})}),r&&o.jsx("button",{"aria-label":"Close",className:"iw-absolute iw-top-5 iw-right-5 iw-text-white/70 transition-colors hover:iw-text-white",onClick:()=>{Ke(),r==null||r()},children:"✕"})]})]}),o.jsxs("div",{className:"iw-relative iw-flex iw-flex-col iw-gap-6 iw-px-6 iw-pb-8 iw-pt-6",children:[o.jsxs("div",{className:"iw-grid xl:iw-grid-cols-[0.95fr_1.05fr] iw-gap-6",children:[o.jsx("section",{className:"iw-flex iw-flex-col iw-gap-5",children:o.jsxs("div",{className:"iw-rounded-2xl iw-border iw-border-slate-100 iw-bg-white iw-p-5 iw-shadow-sm",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[o.jsx("h3",{className:"iw-text-sm iw-font-semibold iw-text-slate-900",children:"Proctoring guidelines"}),o.jsx("span",{className:"iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400",children:"Required"})]}),o.jsx("ul",{className:"iw-mt-5 iw-flex iw-flex-col iw-gap-4",children:Xd.map((j,J)=>o.jsx("li",{className:"iw-group iw-overflow-hidden iw-rounded-xl iw-border iw-border-slate-100 iw-bg-slate-50/60 iw-p-4 iw-transition-all hover:iw-border-slate-200 hover:iw-bg-white",children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3",children:[o.jsx("span",{className:"iw-flex iw-h-8 iw-w-8 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-text-sm iw-font-semibold iw-text-white",style:{background:Ye},children:J+1}),o.jsx("span",{className:"iw-text-sm iw-text-slate-600",children:j})]})},j))})]})}),o.jsxs("section",{className:"iw-flex iw-flex-col iw-gap-5",children:[o.jsxs("div",{className:"iw-relative iw-flex iw-flex-col iw-gap-6 iw-overflow-hidden iw-rounded-3xl iw-bg-white ",style:{borderRadius:Te},children:[o.jsx("div",{className:"iw-relative iw-z-10 iw-rounded-2xl iw-border iw-border-slate-200 iw-bg-slate-50/80 iw-p-3",children:i&&(F||p)?o.jsx(gl,{ref:qe,interviewId:s,interview_duration:a,showProctoringUI:!1,onSetReference:()=>{oe.current&&(clearInterval(oe.current),oe.current=null),A(!1),t()}}):o.jsx("video",{ref:c,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-h-64 iw-w-full iw-rounded-2xl iw-object-cover",style:{transform:"scaleX(-1)",borderRadius:Te}})}),o.jsx("div",{className:"iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1",children:!b&&!F?o.jsxs(o.Fragment,{children:[o.jsx(no,{onClick:re,disabled:B,variant:"outline",size:"sm",className:"iw-font-medium",style:{borderColor:de,borderRadius:Te,color:de},children:f?"Recheck permissions":"Enable camera & mic"}),o.jsx(Qe,{onClick:Xe,disabled:!f,className:"iw-h-10 iw-px-6 iw-text-sm",style:{backgroundColor:de},children:"Proceed"})]}):i&&(b&&!F?o.jsx(Qe,{onClick:()=>g(!0),disabled:!f,className:"iw-h-10 iw-px-6 iw-text-sm iw-col-span-2",style:{backgroundColor:de},children:"Calibrate Face Position"}):o.jsxs(Qe,{onClick:V,disabled:p||!f,className:"iw-h-10 iw-px-6 iw-text-sm iw-col-span-2",style:{backgroundColor:de},children:[p?"Calibrating":"Start Calibration",p&&o.jsx("span",{className:"iw-ml-2 iw-animate-spin iw-inline-block iw-border-2 iw-border-t-transparent iw-border-stone-200 iw-size-4 iw-rounded-full","aria-label":"loading"})]}))})]}),i&&F?o.jsxs("span",{className:"iw-text-slate-700 iw-text-center iw-text-md",children:["Sit upright and look directly into the camera, then press the",o.jsx("span",{className:"iw-font-semibold",children:" Start Calibration "}),"button. Proper calibration is required and incorrect setup may affect your assessment."]}):o.jsx("ul",{className:"iw-grid sm:iw-grid-cols-1 iw-gap-3",children:Qt.map(({Icon:j,label:J,description:Dt,status:Rt,toneClass:Jt})=>o.jsx("li",{className:"iw-rounded-2xl iw-border iw-border-slate-200/65 iw-bg-white iw-p-4 iw-shadow-sm iw-transition-all hover:iw-border-slate-200",children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3",children:[o.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-xl iw-bg-slate-100",children:o.jsx(j,{className:"iw-h-5 iw-w-5 iw-text-slate-600"})}),o.jsxs("div",{className:"iw-flex-1",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-gap-3",children:[o.jsx("p",{className:"iw-text-sm iw-font-medium iw-text-slate-800",children:J}),o.jsx("span",{className:`iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${Jt}`,children:Rt})]}),o.jsx("p",{className:"iw-mt-1.5 iw-text-xs iw-text-slate-500",children:Dt})]})]})},J))}),C&&o.jsx("div",{className:"iw-rounded-lg iw-border iw-border-rose-200 iw-bg-rose-50 iw-px-3 iw-py-2 iw-text-xs iw-text-rose-600",children:C}),!((ht=navigator.mediaDevices)!=null&&ht.getUserMedia)&&o.jsx("div",{className:"iw-rounded-lg iw-border iw-border-amber-200 iw-bg-amber-50 iw-px-3 iw-py-2 iw-text-xs iw-text-amber-700",children:"Your browser does not support media devices. Please use a modern browser like Chrome, Edge, or Firefox."})]})]}),o.jsx("div",{className:" iw-rounded-2xl iw-border iw-border-dashed iw-border-slate-200 iw-bg-slate-50/85 iw-px-5 iw-py-4 iw-text-center",children:o.jsx("div",{className:"iw-text-xs iw-text-slate-500",children:"Your session is monitored to protect exam integrity. Continuing confirms you have reviewed and accept these safeguards."})}),o.jsx("div",{"aria-hidden":!0,className:"iw-pointer-events-none iw-absolute iw-inset-x-0 iw-bottom-1 iw-h-20",style:{backgroundImage:kt,backgroundSize:"100% 120%, 100% 120%, 100% 120%, 32px 32px",backgroundPosition:"center bottom, left 95% bottom, right 95% bottom, center bottom",backgroundRepeat:"no-repeat, no-repeat, no-repeat, repeat",opacity:.9,transform:"translateY(4px)",maskImage:"linear-gradient(to top, rgba(0,0,0,0.92), transparent)",WebkitMaskImage:"linear-gradient(to top, rgba(0,0,0,0.92), transparent)"}})]})]}),o.jsx(Kl,{isOpen:m,onDecline:()=>g(!1),onContinue:()=>{g(!1),Ke(),T(!0)}})]})};var se=(e=>(e.IDLE="idle",e.FETCHING_QUESTION="fetching_question",e.READING_QUESTION="reading_question",e.THINKING="thinking",e.ANSWERING="answering",e.TRANSCRIBING="transcribing",e.EDITING="editing",e.SUBMITTING="submitting",e.COMPLETED="completed",e))(se||{});const Jd={thinkingDuration:30,answeringDuration:120,editingDuration:30},Zd={idle:{next:"fetching_question"},fetching_question:{next:"reading_question"},reading_question:{next:"thinking"},thinking:{next:"answering",duration:30},answering:{next:"transcribing",duration:120},transcribing:{next:"editing"},editing:{next:"submitting",duration:30},submitting:{next:"completed"},completed:{next:"completed"}};class eh{constructor(t={},r={}){Oe(this,"config");Oe(this,"state");Oe(this,"phaseIntervalId",null);Oe(this,"globalIntervalId",null);Oe(this,"callbacks");this.config={...Jd,...t},this.callbacks=r,this.state={phase:"idle",currentPhaseTimeRemaining:0,totalTimeElapsed:0,currentQuestionNumber:0}}getState(){return{...this.state}}startQuestion(){this.state.currentQuestionNumber===0&&this.startGlobalTimer(),this.state.currentQuestionNumber=this.state.currentQuestionNumber+1,this.state.phase="fetching_question",this.notifyChange()}nextPhase(){const t=this.state.phase,r=Zd[t];if(!r)return;this.stopPhaseTimer(),this.state.phase=r.next;const i=this.getDurationForPhase(r.next);i>0?(this.state.currentPhaseTimeRemaining=i,this.startPhaseTimer()):this.state.currentPhaseTimeRemaining=0,this.notifyChange()}completeInterview(){var t,r;this.stopGlobalTimer(),this.stopPhaseTimer(),this.state.phase="completed",(r=(t=this.callbacks).onInterviewEnd)==null||r.call(t),this.notifyChange()}destroy(){this.stopPhaseTimer(),this.stopGlobalTimer()}getDurationForPhase(t){switch(t){case"thinking":return this.config.thinkingDuration;case"answering":return this.config.answeringDuration;case"editing":return this.config.editingDuration;default:return 0}}startGlobalTimer(){this.globalIntervalId=setInterval(()=>{var t,r;this.state.totalTimeElapsed++,(r=(t=this.callbacks).onTick)==null||r.call(t,this.getState())},1e3)}stopGlobalTimer(){this.globalIntervalId&&(clearInterval(this.globalIntervalId),this.globalIntervalId=null)}startPhaseTimer(){this.phaseIntervalId=setInterval(()=>{this.state.currentPhaseTimeRemaining--,this.state.currentPhaseTimeRemaining<=0&&this.nextPhase()},1e3)}stopPhaseTimer(){this.phaseIntervalId&&(clearInterval(this.phaseIntervalId),this.phaseIntervalId=null)}notifyChange(){var t,r;(r=(t=this.callbacks).onPhaseChange)==null||r.call(t,this.state.phase,this.getState())}}function th(e={}){const{config:t={},callbacks:r={}}=e,i=d.useRef(null);i.current||(i.current=new eh(t,{}));const n=i.current,[s,a]=d.useState(n.getState()),c=d.useCallback(()=>{a(n.getState())},[n]);d.useEffect(()=>{const f={onPhaseChange:(w,m)=>{var g;c(),(g=r.onPhaseChange)==null||g.call(r,w,m)},onTick:w=>{var m;c(),(m=r.onTick)==null||m.call(r,w)},onInterviewEnd:()=>{var w;c(),(w=r.onInterviewEnd)==null||w.call(r)}};n.callbacks=f},[n,r,c]),d.useEffect(()=>()=>{n.destroy()},[n]);const l=d.useCallback(()=>{n.startQuestion(),c()},[n,c]),u=d.useCallback(()=>{n.nextPhase(),c()},[n,c]),h=d.useCallback(()=>{n.completeInterview(),c()},[n,c]);return{state:s,startQuestion:l,nextPhase:u,completeInterview:h,timerService:n}}function rh(e,t={}){const[r,i]=d.useState({data:null,loading:!1,error:null}),n=d.useCallback(async(...s)=>{var a,c,l,u;i(h=>({...h,loading:!0,error:null}));try{const h=await e(...s);i(f=>({...f,data:h,loading:!1,error:null})),(a=t.onSuccess)==null||a.call(t,h),(c=t.onSettled)==null||c.call(t,h,null)}catch(h){const f=h.type?h:{type:"unknown",message:h.message||"Unknown error",retryable:!0,userMessage:"Something went wrong. Please try again.",originalError:h};i(w=>({...w,loading:!1,error:f})),(l=t.onError)==null||l.call(t,f),(u=t.onSettled)==null||u.call(t,null,f)}},[e,t]);return{...r,execute:n}}const ih=e=>{const[t,r]=d.useState(null),[i,n]=d.useState(!1),s=document,a=()=>!!(s.fullscreenEnabled||s.webkitFullscreenEnabled||s.mozFullScreenEnabled||s.msFullscreenEnabled),c=()=>s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement,l=async m=>{var g;try{if(!a())throw new Error("Fullscreen is not supported in this environment");m.requestFullscreen?await m.requestFullscreen():m.webkitRequestFullscreen?await m.webkitRequestFullscreen():m.mozRequestFullScreen?await m.mozRequestFullScreen():m.msRequestFullscreen&&await m.msRequestFullscreen()}catch(b){const _={name:"FullscreenError",message:b instanceof Error?b.message:"Failed to enter fullscreen"};r(_),(g=e==null?void 0:e.onError)==null||g.call(e,_)}},u=async()=>{var m;try{s.exitFullscreen?await s.exitFullscreen():s.webkitExitFullscreen?await s.webkitExitFullscreen():s.mozCancelFullScreen?await s.mozCancelFullScreen():s.msExitFullscreen&&await s.msExitFullscreen()}catch(g){const b={name:"FullscreenError",message:g instanceof Error?g.message:"Failed to exit fullscreen"};r(b),(m=e==null?void 0:e.onError)==null||m.call(e,b)}},h=d.useCallback(()=>{var g;const m=!!c();n(m),(g=e==null?void 0:e.onFullScreenChange)==null||g.call(e,m)},[e]);d.useEffect(()=>{const m=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];return m.forEach(g=>{document.addEventListener(g,h)}),()=>{m.forEach(g=>{document.removeEventListener(g,h)})}},[h]);const f=async m=>{r(null);const g=m??document.documentElement;await l(g)};return{isFullScreen:i,toggleFullScreen:async m=>{i?await u():await f(m)},enterFullScreen:f,exitFullScreen:u,error:t}},nh=e=>{d.useEffect(()=>{const t=i=>{(i.ctrlKey||i.metaKey)&&["c","v","a","t","n","w","r","s","p"].includes(i.key.toLowerCase())&&(i.preventDefault(),e({type:"blocked_shortcut",severity:"low",details:{action:"shortcut_pressed",reason:`Attempted to use a blocked keyboard shortcut: Ctrl + ${i.key}`}})),i.key.startsWith("F")&&i.key.length<=3&&(i.preventDefault(),e({type:"blocked_function_key",severity:"low",details:{action:"function_key_pressed",reason:`Attempted to use a blocked function key: ${i.key}`}})),i.altKey&&i.key==="Tab"&&(i.preventDefault(),e({type:"alt_tab_attempt",severity:"medium",details:{action:"alt_tab",reason:"Attempted to use the Alt + Tab shortcut"}}))},r=i=>{i.preventDefault(),e({type:"right_click_attempt",severity:"low",details:{action:"right_click",reason:"Attempted to use the right click"}})};return document.addEventListener("keydown",t),document.addEventListener("contextmenu",r),()=>{document.removeEventListener("keydown",t),document.removeEventListener("contextmenu",r)}},[e])},sh=(e={})=>{const[t,r]=d.useState(!1),[i,n]=d.useState(!1),[s,a]=d.useState(null),[c,l]=d.useState(null),[u,h]=d.useState(null);e.config&&Nr.updateConfig(e.config);const f=d.useCallback(async b=>{var _;try{l(null),a(null),h(null),await Nr.startRecording(b,{onStart:()=>{var p;r(!0),(p=e.onStart)==null||p.call(e)},onStop:()=>{var p;r(!1),(p=e.onStop)==null||p.call(e)},onError:p=>{var F;const A=p instanceof te?p:new te(p.message,"RECORDING_ERROR",!0);l(A),r(!1),(F=e.onError)==null||F.call(e,A)}})}catch(p){const A=p instanceof te?p:new te(p instanceof Error?p.message:String(p),"START_FAILED",!1);throw l(A),r(!1),(_=e.onError)==null||_.call(e,A),A}},[]),w=d.useCallback(async()=>{var b,_;try{const p=await Nr.stopRecording();return h(p),r(!1),(b=e.onStop)==null||b.call(e),p}catch(p){const A=p instanceof te?p:new te(p instanceof Error?p.message:String(p),"STOP_FAILED",!1);throw l(A),r(!1),(_=e.onError)==null||_.call(e,A),A}},[]),m=d.useCallback(async(b,_={})=>{var p,A;try{l(null),n(!0);const F={audioBlob:b,..._},T=await Nr.transcribe(F);return a(T.transcript),n(!1),(p=e.onTranscriptionComplete)==null||p.call(e,T),T}catch(F){const T=F instanceof te?F:new te(F instanceof Error?F.message:String(F),"TRANSCRIPTION_FAILED",!0);throw l(T),n(!1),(A=e.onError)==null||A.call(e,T),T}},[]),g=d.useCallback(()=>{Nr.cancelRecording(),r(!1),h(null)},[]);return{startRecording:f,stopRecording:w,transcribe:m,cancelRecording:g,isRecording:t,isTranscribing:i,transcript:s,error:c,audioBlob:u}},oh=e=>{const t=d.useRef(null),r=d.useRef(!1);d.useEffect(()=>{const i=()=>{document.hidden&&(r.current=!0,t.current&&(clearTimeout(t.current),t.current=null),e({type:"tab_switch",severity:"high",details:{action:"tab_hidden",reason:"Attempted to switch tabs or applications"}}),setTimeout(()=>{r.current=!1},100))},n=()=>{r.current||(t.current=setTimeout(()=>{r.current||e({type:"focus_loss",severity:"medium",details:{action:"window_blur",reason:"Focus lost from the interview window"}}),t.current=null},50))};return document.addEventListener("visibilitychange",i),window.addEventListener("blur",n),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",n),t.current&&clearTimeout(t.current)}},[e])},ah=()=>{d.useEffect(()=>{const e=document.createElement("style");return e.textContent=`
|
|
23
|
+
}`,e.VERTEX_SHADER),this.Y=R0(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}};function Vn(e,t){switch(t){case 0:return e.g.find(n=>n instanceof Uint8Array);case 1:return e.g.find(n=>n instanceof Float32Array);case 2:return e.g.find(n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function mf(e){var t=Vn(e,1);if(!t){if(t=Vn(e,0))t=new Float32Array(t).map(i=>i/255);else{t=new Float32Array(e.width*e.height);const i=Ja(e);var n=wf(e);if(lo(n,i,G0(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){n=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,n);for(let a=0,l=0;a<t.length;++a,l+=4)t[a]=n[l]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function G0(e){let t=Vn(e,2);if(!t){const n=Ja(e);t=V0(e);const i=mf(e),a=H0(e);n.texImage2D(n.TEXTURE_2D,0,a,e.width,e.height,0,n.RED,n.FLOAT,i),gf(e)}return t}function Ja(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Hn(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function H0(e){if(e=Ja(e),!so)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))so=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");so=e.R16F}return so}function wf(e){return e.l||(e.l=new hf),e.l}function V0(e){const t=Ja(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=Vn(e,2);return n||(n=ao(wf(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function gf(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var so,Ve=class{constructor(e,t,n,i,a,l,s){this.g=e,this.m=t,this.j=n,this.canvas=i,this.l=a,this.width=l,this.height=s,this.j&&--F0===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Vn(this,0)}ja(){return!!Vn(this,1)}R(){return!!Vn(this,2)}ia(){return(t=Vn(e=this,0))||(t=mf(e),t=new Uint8Array(t.map(n=>255*n)),e.g.push(t)),t;var e,t}ha(){return mf(this)}N(){return G0(this)}clone(){const e=[];for(const t of this.g){let n;if(t instanceof Uint8Array)n=new Uint8Array(t);else if(t instanceof Float32Array)n=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const i=Ja(this),a=wf(this);i.activeTexture(i.TEXTURE1),n=ao(a,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,n);const l=H0(this);i.texImage2D(i.TEXTURE_2D,0,l,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),lo(a,i,n),ff(a,i,!1,()=>{V0(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),gf(this)}),df(a),gf(this)}}e.push(n)}return new Ve(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ja(this).deleteTexture(Vn(this,2)),F0=-1}};Ve.prototype.close=Ve.prototype.close,Ve.prototype.clone=Ve.prototype.clone,Ve.prototype.getAsWebGLTexture=Ve.prototype.N,Ve.prototype.getAsFloat32Array=Ve.prototype.ha,Ve.prototype.getAsUint8Array=Ve.prototype.ia,Ve.prototype.hasWebGLTexture=Ve.prototype.R,Ve.prototype.hasFloat32Array=Ve.prototype.ja,Ve.prototype.hasUint8Array=Ve.prototype.Da;var F0=250;function xn(e,t){switch(t){case 0:return e.g.find(n=>n instanceof ImageData);case 1:return e.g.find(n=>typeof ImageBitmap<"u"&&n instanceof ImageBitmap);case 2:return e.g.find(n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function q0(e){var t=xn(e,0);if(!t){t=Pa(e);const n=oo(e),i=new Uint8Array(e.width*e.height*4);lo(n,t,ro(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,i),df(n),t=new ImageData(new Uint8ClampedArray(i.buffer),e.width,e.height),e.g.push(t)}return t}function ro(e){let t=xn(e,2);if(!t){const n=Pa(e);t=uo(e);const i=xn(e,1)||q0(e);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i),os(e)}return t}function Pa(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Hn(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function oo(e){return e.l||(e.l=new hf),e.l}function uo(e){const t=Pa(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=xn(e,2);return n||(n=ao(oo(e),t),e.g.push(n),e.m=!0),t.bindTexture(t.TEXTURE_2D,n),n}function os(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function Y0(e){const t=Pa(e);return ff(oo(e),t,!0,()=>function(n,i){const a=n.canvas;if(a.width===n.width&&a.height===n.height)return i();const l=a.width,s=a.height;return a.width=n.width,a.height=n.height,n=i(),a.width=l,a.height=s,n}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}var Fe=class{constructor(e,t,n,i,a,l,s){this.g=e,this.j=t,this.m=n,this.canvas=i,this.l=a,this.width=l,this.height=s,(this.j||this.m)&&--X0===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!xn(this,0)}ka(){return!!xn(this,1)}R(){return!!xn(this,2)}Aa(){return q0(this)}za(){var e=xn(this,1);return e||(ro(this),uo(this),e=Y0(this),os(this),this.g.push(e),this.j=!0),e}N(){return ro(this)}clone(){const e=[];for(const t of this.g){let n;if(t instanceof ImageData)n=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const i=Pa(this),a=oo(this);i.activeTexture(i.TEXTURE1),n=ao(a,i),i.bindTexture(i.TEXTURE_2D,n),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindTexture(i.TEXTURE_2D,null),lo(a,i,n),ff(a,i,!1,()=>{uo(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),os(this)}),df(a),os(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);ro(this),uo(this),n=Y0(this),os(this)}e.push(n)}return new Fe(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&xn(this,1).close(),this.m&&Pa(this).deleteTexture(xn(this,2)),X0=-1}};Fe.prototype.close=Fe.prototype.close,Fe.prototype.clone=Fe.prototype.clone,Fe.prototype.getAsWebGLTexture=Fe.prototype.N,Fe.prototype.getAsImageBitmap=Fe.prototype.za,Fe.prototype.getAsImageData=Fe.prototype.Aa,Fe.prototype.hasWebGLTexture=Fe.prototype.R,Fe.prototype.hasImageBitmap=Fe.prototype.ka,Fe.prototype.hasImageData=Fe.prototype.Ca;var X0=250;function fn(...e){return e.map(([t,n])=>({start:t,end:n}))}const Bp=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((Q0=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:D0()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const n=e.length,i=this.i._malloc(n);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(n,i):this.i._changeTextGraph(n,i),this.i._free(i)}configureAudio(e,t,n,i,a){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),U(this,i||"input_audio",l=>{U(this,a=a||"audio_header",s=>{this.i._configureAudio(l,s,e,t??0,n)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){bn(this,"__graph_config__",t=>{e(t)}),U(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)}addAudioToStreamWithShape(e,t,n,i,a){const l=4*e.length;this.h!==l&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(l),this.h=l),this.i.HEAPF32.set(e,this.g/4),U(this,i,s=>{this.i._addAudioToInputStream(this.g,t,n,s,a)})}addGpuBufferToStream(e,t,n){U(this,t,i=>{const[a,l]=L0(this,e,i);this.i._addBoundTextureToStream(i,a,l,n)})}addBoolToStream(e,t,n){U(this,t,i=>{this.i._addBoolToInputStream(e,i,n)})}addDoubleToStream(e,t,n){U(this,t,i=>{this.i._addDoubleToInputStream(e,i,n)})}addFloatToStream(e,t,n){U(this,t,i=>{this.i._addFloatToInputStream(e,i,n)})}addIntToStream(e,t,n){U(this,t,i=>{this.i._addIntToInputStream(e,i,n)})}addUintToStream(e,t,n){U(this,t,i=>{this.i._addUintToInputStream(e,i,n)})}addStringToStream(e,t,n){U(this,t,i=>{U(this,e,a=>{this.i._addStringToInputStream(a,i,n)})})}addStringRecordToStream(e,t,n){U(this,t,i=>{U0(this,Object.keys(e),a=>{U0(this,Object.values(e),l=>{this.i._addFlatHashMapToInputStream(a,l,Object.keys(e).length,i,n)})})})}addProtoToStream(e,t,n,i){U(this,n,a=>{U(this,t,l=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,l,a,i),this.i._free(s)})})}addEmptyPacketToStream(e,t){U(this,e,n=>{this.i._addEmptyPacketToInputStream(n,t)})}addBoolVectorToStream(e,t,n){U(this,t,i=>{const a=this.i._allocateBoolVector(e.length);if(!a)throw Error("Unable to allocate new bool vector on heap.");for(const l of e)this.i._addBoolVectorEntry(a,l);this.i._addBoolVectorToInputStream(a,i,n)})}addDoubleVectorToStream(e,t,n){U(this,t,i=>{const a=this.i._allocateDoubleVector(e.length);if(!a)throw Error("Unable to allocate new double vector on heap.");for(const l of e)this.i._addDoubleVectorEntry(a,l);this.i._addDoubleVectorToInputStream(a,i,n)})}addFloatVectorToStream(e,t,n){U(this,t,i=>{const a=this.i._allocateFloatVector(e.length);if(!a)throw Error("Unable to allocate new float vector on heap.");for(const l of e)this.i._addFloatVectorEntry(a,l);this.i._addFloatVectorToInputStream(a,i,n)})}addIntVectorToStream(e,t,n){U(this,t,i=>{const a=this.i._allocateIntVector(e.length);if(!a)throw Error("Unable to allocate new int vector on heap.");for(const l of e)this.i._addIntVectorEntry(a,l);this.i._addIntVectorToInputStream(a,i,n)})}addUintVectorToStream(e,t,n){U(this,t,i=>{const a=this.i._allocateUintVector(e.length);if(!a)throw Error("Unable to allocate new unsigned int vector on heap.");for(const l of e)this.i._addUintVectorEntry(a,l);this.i._addUintVectorToInputStream(a,i,n)})}addStringVectorToStream(e,t,n){U(this,t,i=>{const a=this.i._allocateStringVector(e.length);if(!a)throw Error("Unable to allocate new string vector on heap.");for(const l of e)U(this,l,s=>{this.i._addStringVectorEntry(a,s)});this.i._addStringVectorToInputStream(a,i,n)})}addBoolToInputSidePacket(e,t){U(this,t,n=>{this.i._addBoolToInputSidePacket(e,n)})}addDoubleToInputSidePacket(e,t){U(this,t,n=>{this.i._addDoubleToInputSidePacket(e,n)})}addFloatToInputSidePacket(e,t){U(this,t,n=>{this.i._addFloatToInputSidePacket(e,n)})}addIntToInputSidePacket(e,t){U(this,t,n=>{this.i._addIntToInputSidePacket(e,n)})}addUintToInputSidePacket(e,t){U(this,t,n=>{this.i._addUintToInputSidePacket(e,n)})}addStringToInputSidePacket(e,t){U(this,t,n=>{U(this,e,i=>{this.i._addStringToInputSidePacket(i,n)})})}addProtoToInputSidePacket(e,t,n){U(this,n,i=>{U(this,t,a=>{const l=this.i._malloc(e.length);this.i.HEAPU8.set(e,l),this.i._addProtoToInputSidePacket(l,e.length,a,i),this.i._free(l)})})}addBoolVectorToInputSidePacket(e,t){U(this,t,n=>{const i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const a of e)this.i._addBoolVectorEntry(i,a);this.i._addBoolVectorToInputSidePacket(i,n)})}addDoubleVectorToInputSidePacket(e,t){U(this,t,n=>{const i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const a of e)this.i._addDoubleVectorEntry(i,a);this.i._addDoubleVectorToInputSidePacket(i,n)})}addFloatVectorToInputSidePacket(e,t){U(this,t,n=>{const i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const a of e)this.i._addFloatVectorEntry(i,a);this.i._addFloatVectorToInputSidePacket(i,n)})}addIntVectorToInputSidePacket(e,t){U(this,t,n=>{const i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const a of e)this.i._addIntVectorEntry(i,a);this.i._addIntVectorToInputSidePacket(i,n)})}addUintVectorToInputSidePacket(e,t){U(this,t,n=>{const i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(const a of e)this.i._addUintVectorEntry(i,a);this.i._addUintVectorToInputSidePacket(i,n)})}addStringVectorToInputSidePacket(e,t){U(this,t,n=>{const i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const a of e)U(this,a,l=>{this.i._addStringVectorEntry(i,l)});this.i._addStringVectorToInputSidePacket(i,n)})}attachBoolListener(e,t){bn(this,e,t),U(this,e,n=>{this.i._attachBoolListener(n)})}attachBoolVectorListener(e,t){bi(this,e,t),U(this,e,n=>{this.i._attachBoolVectorListener(n)})}attachIntListener(e,t){bn(this,e,t),U(this,e,n=>{this.i._attachIntListener(n)})}attachIntVectorListener(e,t){bi(this,e,t),U(this,e,n=>{this.i._attachIntVectorListener(n)})}attachUintListener(e,t){bn(this,e,t),U(this,e,n=>{this.i._attachUintListener(n)})}attachUintVectorListener(e,t){bi(this,e,t),U(this,e,n=>{this.i._attachUintVectorListener(n)})}attachDoubleListener(e,t){bn(this,e,t),U(this,e,n=>{this.i._attachDoubleListener(n)})}attachDoubleVectorListener(e,t){bi(this,e,t),U(this,e,n=>{this.i._attachDoubleVectorListener(n)})}attachFloatListener(e,t){bn(this,e,t),U(this,e,n=>{this.i._attachFloatListener(n)})}attachFloatVectorListener(e,t){bi(this,e,t),U(this,e,n=>{this.i._attachFloatVectorListener(n)})}attachStringListener(e,t){bn(this,e,t),U(this,e,n=>{this.i._attachStringListener(n)})}attachStringVectorListener(e,t){bi(this,e,t),U(this,e,n=>{this.i._attachStringVectorListener(n)})}attachProtoListener(e,t,n){bn(this,e,t),U(this,e,i=>{this.i._attachProtoListener(i,n||!1)})}attachProtoVectorListener(e,t,n){bi(this,e,t),U(this,e,i=>{this.i._attachProtoVectorListener(i,n||!1)})}attachAudioListener(e,t,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),bn(this,e,(i,a)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,a)}),U(this,e,i=>{this.i._attachAudioListener(i,n||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Q0{get ea(){return this.i}oa(e,t,n){U(this,t,i=>{const[a,l]=L0(this,e,i);this.ea._addBoundTextureAsImageToStream(i,a,l,n)})}V(e,t){bn(this,e,t),U(this,e,n=>{this.ea._attachImageListener(n)})}ba(e,t){bi(this,e,t),U(this,e,n=>{this.ea._attachImageVectorListener(n)})}}));var Q0,Ft=class extends Bp{};async function q(e,t,n){return async function(i,a,l,s){return zp(i,a,l,s)}(e,n.canvas??(D0()?void 0:document.createElement("canvas")),t,n)}function Z0(e,t,n,i){if(e.U){const l=new $1;if(n!=null&&n.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var a=n.regionOfInterest;if(a.left>=a.right||a.top>=a.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(a.left<0||a.top<0||a.right>1||a.bottom>1)throw Error("Expected RectF values to be in [0,1].");O(l,1,(a.left+a.right)/2),O(l,2,(a.top+a.bottom)/2),O(l,4,a.right-a.left),O(l,3,a.bottom-a.top)}else O(l,1,.5),O(l,2,.5),O(l,4,1),O(l,3,1);if(n!=null&&n.rotationDegrees){if((n==null?void 0:n.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(O(l,5,-Math.PI*n.rotationDegrees/180),(n==null?void 0:n.rotationDegrees)%180!=0){const[s,r]=O0(t);n=Ne(l,3)*r/s,a=Ne(l,4)*s/r,O(l,4,n),O(l,3,a)}}e.g.addProtoToStream(l.g(),"mediapipe.NormalizedRect",e.U,i)}e.g.oa(t,e.Z,i??performance.now()),e.finishProcessing()}function qt(e,t,n){var i;if((i=e.baseOptions)!=null&&i.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Z0(e,t,n,e.B+1)}function En(e,t,n,i){var a;if(!((a=e.baseOptions)!=null&&a.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Z0(e,t,n,i)}function $a(e,t,n,i){var a=t.data;const l=t.width,s=l*(t=t.height);if((a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==s)throw Error("Unsupported channel count: "+a.length/s);return e=new Ve([a],n,!1,e.g.i.canvas,e.P,l,t),i?e.clone():e}var dt=class extends uf{constructor(e,t,n,i){super(e),this.g=e,this.Z=t,this.U=n,this.na=i,this.P=new hf}l(e,t=!0){if("runningMode"in e&&ts(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};dt.prototype.close=dt.prototype.close;var Yt=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},z(e=this.h=new $r,0,1,t=new he),O(this.h,2,.5),O(this.h,3,.3)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&O(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&O(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}D(e,t){return this.j={detections:[]},qt(this,e,t),this.j}F(e,t,n){return this.j={detections:[]},En(this,e,n,t),this.j}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect_in"),I(e,"detections");const t=new St;on(t,Ep,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect_in"),Y(n,"DETECTIONS:detections"),n.o(t),Tt(e,n),this.g.attachProtoVectorListener("detections",(i,a)=>{for(const l of i)i=W1(l),this.j.detections.push(N0(i));C(this,a)}),this.g.attachEmptyPacketListener("detections",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Yt.prototype.detectForVideo=Yt.prototype.F,Yt.prototype.detect=Yt.prototype.D,Yt.prototype.setOptions=Yt.prototype.o,Yt.createFromModelPath=async function(e,t){return q(Yt,e,{baseOptions:{modelAssetPath:t}})},Yt.createFromModelBuffer=function(e,t){return q(Yt,e,{baseOptions:{modelAssetBuffer:t}})},Yt.createFromOptions=function(e,t){return q(Yt,e,t)};var pf=fn([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),yf=fn([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),vf=fn([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),K0=fn([474,475],[475,476],[476,477],[477,474]),bf=fn([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),xf=fn([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),I0=fn([469,470],[470,471],[471,472],[472,469]),Ef=fn([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),W0=[...pf,...yf,...vf,...bf,...xf,...Ef],J0=fn([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function P0(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var ye=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,z(e=this.h=new r0,0,1,t=new he),this.v=new s0,z(this.h,0,3,this.v),this.s=new $r,z(this.h,0,2,this.s),vn(this.s,4,1),O(this.s,2,.5),O(this.v,2,.5),O(this.h,4,.5)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return"numFaces"in e&&vn(this.s,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&O(this.s,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&O(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&O(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return P0(this),qt(this,e,t),this.j}F(e,t,n){return P0(this),En(this,e,n,t),this.j}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect"),I(e,"face_landmarks");const t=new St;on(t,_p,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),Y(n,"NORM_LANDMARKS:face_landmarks"),n.o(t),Tt(e,n),this.g.attachProtoVectorListener("face_landmarks",(i,a)=>{for(const l of i)i=ls(l),this.j.faceLandmarks.push(eo(i));C(this,a)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{C(this,i)}),this.outputFaceBlendshapes&&(I(e,"blendshapes"),Y(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(i,a)=>{if(this.outputFaceBlendshapes)for(const l of i)i=Wr(l),this.j.faceBlendshapes.push(rf(i.g()??[]));C(this,a)}),this.g.attachEmptyPacketListener("blendshapes",i=>{C(this,i)})),this.outputFacialTransformationMatrixes&&(I(e,"face_geometry"),Y(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(i,a)=>{if(this.outputFacialTransformationMatrixes)for(const l of i)(i=Z(Sp(l),mp,2))&&this.j.facialTransformationMatrixes.push({rows:Ht(i,1)??0??0,columns:Ht(i,2)??0??0,data:$i(i,3,hi,Pi()).slice()??[]});C(this,a)}),this.g.attachEmptyPacketListener("face_geometry",i=>{C(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ye.prototype.detectForVideo=ye.prototype.F,ye.prototype.detect=ye.prototype.D,ye.prototype.setOptions=ye.prototype.o,ye.createFromModelPath=function(e,t){return q(ye,e,{baseOptions:{modelAssetPath:t}})},ye.createFromModelBuffer=function(e,t){return q(ye,e,{baseOptions:{modelAssetBuffer:t}})},ye.createFromOptions=function(e,t){return q(ye,e,t)},ye.FACE_LANDMARKS_LIPS=pf,ye.FACE_LANDMARKS_LEFT_EYE=yf,ye.FACE_LANDMARKS_LEFT_EYEBROW=vf,ye.FACE_LANDMARKS_LEFT_IRIS=K0,ye.FACE_LANDMARKS_RIGHT_EYE=bf,ye.FACE_LANDMARKS_RIGHT_EYEBROW=xf,ye.FACE_LANDMARKS_RIGHT_IRIS=I0,ye.FACE_LANDMARKS_FACE_OVAL=Ef,ye.FACE_LANDMARKS_CONTOURS=W0,ye.FACE_LANDMARKS_TESSELATION=J0;var Sn=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!0),z(e=this.j=new u0,0,1,t=new he)}get baseOptions(){return Z(this.j,he,1)}set baseOptions(e){z(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,n){const i=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:n,qt(this,e,i??{}),!this.h)return this.s}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect"),I(e,"stylized_image");const t=new St;on(t,Tp,this.j);const n=new it;_t(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),Y(n,"STYLIZED_IMAGE:stylized_image"),n.o(t),Tt(e,n),this.g.V("stylized_image",(i,a)=>{var l=!this.h,s=i.data,r=i.width;const o=r*(i=i.height);if(s instanceof Uint8Array)if(s.length===3*o){const c=new Uint8ClampedArray(4*o);for(let d=0;d<o;++d)c[4*d]=s[3*d],c[4*d+1]=s[3*d+1],c[4*d+2]=s[3*d+2],c[4*d+3]=255;s=new ImageData(c,r,i)}else{if(s.length!==4*o)throw Error("Unsupported channel count: "+s.length/o);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),r,i)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);r=new Fe([s],!1,!1,this.g.i.canvas,this.P,r,i),this.s=l=l?r.clone():r,this.h&&this.h(l),C(this,a)}),this.g.attachEmptyPacketListener("stylized_image",i=>{this.s=null,this.h&&this.h(null),C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Sn.prototype.stylize=Sn.prototype.Ka,Sn.prototype.setOptions=Sn.prototype.o,Sn.createFromModelPath=function(e,t){return q(Sn,e,{baseOptions:{modelAssetPath:t}})},Sn.createFromModelBuffer=function(e,t){return q(Sn,e,{baseOptions:{modelAssetBuffer:t}})},Sn.createFromOptions=function(e,t){return q(Sn,e,t)};var Sf=fn([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function $0(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function e3(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function t3(e,t=!0){const n=[];for(const a of e){var i=Wr(a);e=[];for(const l of i.g())i=t&&Ht(l,1)!=null?Ht(l,1)??0:-1,e.push({score:Ne(l,2)??0,index:i,categoryName:Vt(l,3)??""??"",displayName:Vt(l,4)??""??""});n.push(e)}return n}var At=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],z(e=this.j=new d0,0,1,t=new he),this.s=new ef,z(this.j,0,2,this.s),this.C=new $c,z(this.s,0,3,this.C),this.v=new f0,z(this.s,0,2,this.v),this.h=new Ap,z(this.j,0,3,this.h),O(this.v,2,.5),O(this.s,4,.5),O(this.C,2,.5)}get baseOptions(){return Z(this.j,he,1)}set baseOptions(e){z(this.j,0,1,e)}o(e){var a,l,s,r;if(vn(this.v,3,e.numHands??1),"minHandDetectionConfidence"in e&&O(this.v,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&O(this.s,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&O(this.C,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new Ia,n=t,i=sf(e.cannedGesturesClassifierOptions,(a=Z(this.h,Ia,3))==null?void 0:a.h());z(n,0,2,i),z(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=Z(this.h,Ia,3))==null||l.g());return e.customGesturesClassifierOptions?(z(n=t=new Ia,0,2,i=sf(e.customGesturesClassifierOptions,(s=Z(this.h,Ia,4))==null?void 0:s.h())),z(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((r=Z(this.h,Ia,4))==null||r.g()),this.l(e)}Fa(e,t){return $0(this),qt(this,e,t),e3(this)}Ga(e,t,n){return $0(this),En(this,e,n,t),e3(this)}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect"),I(e,"hand_gestures"),I(e,"hand_landmarks"),I(e,"world_hand_landmarks"),I(e,"handedness");const t=new St;on(t,Np,this.j);const n=new it;_t(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),Y(n,"HAND_GESTURES:hand_gestures"),Y(n,"LANDMARKS:hand_landmarks"),Y(n,"WORLD_LANDMARKS:world_hand_landmarks"),Y(n,"HANDEDNESS:handedness"),n.o(t),Tt(e,n),this.g.attachProtoVectorListener("hand_landmarks",(i,a)=>{for(const l of i){i=ls(l);const s=[];for(const r of zn(i,P1,1))s.push({x:Ne(r,1)??0,y:Ne(r,2)??0,z:Ne(r,3)??0,visibility:Ne(r,4)??0});this.landmarks.push(s)}C(this,a)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,a)=>{for(const l of i){i=Ka(l);const s=[];for(const r of zn(i,J1,1))s.push({x:Ne(r,1)??0,y:Ne(r,2)??0,z:Ne(r,3)??0,visibility:Ne(r,4)??0});this.worldLandmarks.push(s)}C(this,a)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("hand_gestures",(i,a)=>{this.gestures.push(...t3(i,!1)),C(this,a)}),this.g.attachEmptyPacketListener("hand_gestures",i=>{C(this,i)}),this.g.attachProtoVectorListener("handedness",(i,a)=>{this.handedness.push(...t3(i)),C(this,a)}),this.g.attachEmptyPacketListener("handedness",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function n3(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}At.prototype.recognizeForVideo=At.prototype.Ga,At.prototype.recognize=At.prototype.Fa,At.prototype.setOptions=At.prototype.o,At.createFromModelPath=function(e,t){return q(At,e,{baseOptions:{modelAssetPath:t}})},At.createFromModelBuffer=function(e,t){return q(At,e,{baseOptions:{modelAssetBuffer:t}})},At.createFromOptions=function(e,t){return q(At,e,t)},At.HAND_CONNECTIONS=Sf;var Nt=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],z(e=this.h=new ef,0,1,t=new he),this.s=new $c,z(this.h,0,3,this.s),this.j=new f0,z(this.h,0,2,this.j),vn(this.j,3,1),O(this.j,2,.5),O(this.s,2,.5),O(this.h,4,.5)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return"numHands"in e&&vn(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&O(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&O(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&O(this.s,2,e.minHandPresenceConfidence??.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],qt(this,e,t),n3(this)}F(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],En(this,e,n,t),n3(this)}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect"),I(e,"hand_landmarks"),I(e,"world_hand_landmarks"),I(e,"handedness");const t=new St;on(t,jp,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),Y(n,"LANDMARKS:hand_landmarks"),Y(n,"WORLD_LANDMARKS:world_hand_landmarks"),Y(n,"HANDEDNESS:handedness"),n.o(t),Tt(e,n),this.g.attachProtoVectorListener("hand_landmarks",(i,a)=>{for(const l of i)i=ls(l),this.landmarks.push(eo(i));C(this,a)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,a)=>{for(const l of i)i=Ka(l),this.worldLandmarks.push(ss(i));C(this,a)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("handedness",(i,a)=>{var l=this.handedness,s=l.push;const r=[];for(const o of i){i=Wr(o);const c=[];for(const d of i.g())c.push({score:Ne(d,2)??0,index:Ht(d,1)??0??-1,categoryName:Vt(d,3)??""??"",displayName:Vt(d,4)??""??""});r.push(c)}s.call(l,...r),C(this,a)}),this.g.attachEmptyPacketListener("handedness",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Nt.prototype.detectForVideo=Nt.prototype.F,Nt.prototype.detect=Nt.prototype.D,Nt.prototype.setOptions=Nt.prototype.o,Nt.createFromModelPath=function(e,t){return q(Nt,e,{baseOptions:{modelAssetPath:t}})},Nt.createFromModelBuffer=function(e,t){return q(Nt,e,{baseOptions:{modelAssetBuffer:t}})},Nt.createFromOptions=function(e,t){return q(Nt,e,t)},Nt.HAND_CONNECTIONS=Sf;var i3=fn([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function a3(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function l3(e){try{if(!e.C)return e.h;e.C(e.h)}finally{io(e)}}function co(e,t){e=ls(e),t.push(eo(e))}var me=class extends dt{constructor(e,t){super(new Ft(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,z(e=this.j=new y0,0,1,t=new he),this.K=new $c,z(this.j,0,2,this.K),this.Y=new Mp,z(this.j,0,3,this.Y),this.s=new $r,z(this.j,0,4,this.s),this.H=new s0,z(this.j,0,5,this.H),this.v=new g0,z(this.j,0,6,this.v),this.L=new p0,z(this.j,0,7,this.L),O(this.s,2,.5),O(this.s,3,.3),O(this.H,2,.5),O(this.v,2,.5),O(this.v,3,.3),O(this.L,2,.5),O(this.K,2,.5)}get baseOptions(){return Z(this.j,he,1)}set baseOptions(e){z(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&O(this.s,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&O(this.s,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&O(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&O(this.v,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&O(this.v,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&O(this.L,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&O(this.K,2,e.minHandLandmarksConfidence??.5),this.l(e)}D(e,t,n){const i=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:n,a3(this),qt(this,e,i),l3(this)}F(e,t,n,i){const a=typeof n!="function"?n:{};return this.C=typeof n=="function"?n:i,a3(this),En(this,e,a,t),l3(this)}m(){var e=new ft;ue(e,"input_frames_image"),I(e,"pose_landmarks"),I(e,"pose_world_landmarks"),I(e,"face_landmarks"),I(e,"left_hand_landmarks"),I(e,"left_hand_world_landmarks"),I(e,"right_hand_landmarks"),I(e,"right_hand_world_landmarks");const t=new St,n=new L1;xc(n,1,za("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(a,l){if(l!=null)if(Array.isArray(l))le(a,2,Dr(l,pc,void 0,void 0,!1));else{if(!(typeof l=="string"||l instanceof On||Ii(l)))throw Error("invalid value in Any.value field: "+l+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");xc(a,2,ac(l,!1),Wi())}}(n,this.j.g());const i=new it;_t(i,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),zr(i,8,L1,n),se(i,"IMAGE:input_frames_image"),Y(i,"POSE_LANDMARKS:pose_landmarks"),Y(i,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Y(i,"FACE_LANDMARKS:face_landmarks"),Y(i,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Y(i,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Y(i,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Y(i,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),i.o(t),Tt(e,i),no(this,e),this.g.attachProtoListener("pose_landmarks",(a,l)=>{co(a,this.h.poseLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("pose_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("pose_world_landmarks",(a,l)=>{var s=this.h.poseWorldLandmarks;a=Ka(a),s.push(ss(a)),C(this,l)}),this.g.attachEmptyPacketListener("pose_world_landmarks",a=>{C(this,a)}),this.outputPoseSegmentationMasks&&(Y(i,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Wa(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(a,l)=>{this.h.poseSegmentationMasks=[$a(this,a,!0,!this.C)],C(this,l)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",a=>{this.h.poseSegmentationMasks=[],C(this,a)})),this.g.attachProtoListener("face_landmarks",(a,l)=>{co(a,this.h.faceLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("face_landmarks",a=>{C(this,a)}),this.outputFaceBlendshapes&&(I(e,"extra_blendshapes"),Y(i,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(a,l)=>{var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(a=Wr(a),s.push(rf(a.g()??[]))),C(this,l)}),this.g.attachEmptyPacketListener("extra_blendshapes",a=>{C(this,a)})),this.g.attachProtoListener("left_hand_landmarks",(a,l)=>{co(a,this.h.leftHandLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("left_hand_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("left_hand_world_landmarks",(a,l)=>{var s=this.h.leftHandWorldLandmarks;a=Ka(a),s.push(ss(a)),C(this,l)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("right_hand_landmarks",(a,l)=>{co(a,this.h.rightHandLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("right_hand_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("right_hand_world_landmarks",(a,l)=>{var s=this.h.rightHandWorldLandmarks;a=Ka(a),s.push(ss(a)),C(this,l)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",a=>{C(this,a)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};me.prototype.detectForVideo=me.prototype.F,me.prototype.detect=me.prototype.D,me.prototype.setOptions=me.prototype.o,me.createFromModelPath=function(e,t){return q(me,e,{baseOptions:{modelAssetPath:t}})},me.createFromModelBuffer=function(e,t){return q(me,e,{baseOptions:{modelAssetBuffer:t}})},me.createFromOptions=function(e,t){return q(me,e,t)},me.HAND_CONNECTIONS=Sf,me.POSE_CONNECTIONS=i3,me.FACE_LANDMARKS_LIPS=pf,me.FACE_LANDMARKS_LEFT_EYE=yf,me.FACE_LANDMARKS_LEFT_EYEBROW=vf,me.FACE_LANDMARKS_LEFT_IRIS=K0,me.FACE_LANDMARKS_RIGHT_EYE=bf,me.FACE_LANDMARKS_RIGHT_EYEBROW=xf,me.FACE_LANDMARKS_RIGHT_IRIS=I0,me.FACE_LANDMARKS_FACE_OVAL=Ef,me.FACE_LANDMARKS_CONTOURS=W0,me.FACE_LANDMARKS_TESSELATION=J0;var Xt=class extends dt{constructor(e,t){super(new Ft(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},z(e=this.h=new v0,0,1,t=new he)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return z(this.h,0,2,sf(e,Z(this.h,Wc,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},qt(this,e,t),this.j}ra(e,t,n){return this.j={classifications:[]},En(this,e,n,t),this.j}m(){var e=new ft;ue(e,"input_image"),ue(e,"norm_rect"),I(e,"classifications");const t=new St;on(t,Cp,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),se(n,"IMAGE:input_image"),se(n,"NORM_RECT:norm_rect"),Y(n,"CLASSIFICATIONS:classifications"),n.o(t),Tt(e,n),this.g.attachProtoListener("classifications",(i,a)=>{this.j=function(l){const s={classifications:zn(l,gp,1).map(r=>{var o;return rf(((o=Z(r,K1,4))==null?void 0:o.g())??[],Ht(r,2)??0,Vt(r,3)??"")})};return dc(Ba(l,2))!=null&&(s.timestampMs=dc(Ba(l,2))??0),s}(pp(i)),C(this,a)}),this.g.attachEmptyPacketListener("classifications",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Xt.prototype.classifyForVideo=Xt.prototype.ra,Xt.prototype.classify=Xt.prototype.qa,Xt.prototype.setOptions=Xt.prototype.o,Xt.createFromModelPath=function(e,t){return q(Xt,e,{baseOptions:{modelAssetPath:t}})},Xt.createFromModelBuffer=function(e,t){return q(Xt,e,{baseOptions:{modelAssetBuffer:t}})},Xt.createFromOptions=function(e,t){return q(Xt,e,t)};var jt=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!0),this.h=new b0,this.embeddings={embeddings:[]},z(e=this.h,0,1,t=new he)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){var t=this.h,n=Z(this.h,i0,2);return n=n?n.clone():new i0,e.l2Normalize!==void 0?ts(n,1,e.l2Normalize):"l2Normalize"in e&&le(n,1),e.quantize!==void 0?ts(n,2,e.quantize):"quantize"in e&&le(n,2),z(t,0,2,n),this.l(e)}xa(e,t){return qt(this,e,t),this.embeddings}ya(e,t,n){return En(this,e,n,t),this.embeddings}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect"),I(e,"embeddings_out");const t=new St;on(t,Dp,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),Y(n,"EMBEDDINGS:embeddings_out"),n.o(t),Tt(e,n),this.g.attachProtoListener("embeddings_out",(i,a)=>{i=bp(i),this.embeddings=function(l){return{embeddings:zn(l,vp,1).map(s=>{var o,c;const r={headIndex:Ht(s,3)??0??-1,headName:Vt(s,4)??""??""};if(t1(s,e0,Ec(s,1))!==void 0)s=$i(s=Z(s,e0,Ec(s,1)),1,hi,Pi()),r.floatEmbedding=s.slice();else{const d=new Uint8Array(0);r.quantizedEmbedding=((c=(o=Z(s,yp,Ec(s,2)))==null?void 0:o.ma())==null?void 0:c.h())??d}return r}),timestampMs:dc(Ba(l,2))??0}}(i),C(this,a)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};jt.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=M0(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=M0(j0(e.quantizedEmbedding),j0(t.quantizedEmbedding))}return e},jt.prototype.embedForVideo=jt.prototype.ya,jt.prototype.embed=jt.prototype.xa,jt.prototype.setOptions=jt.prototype.o,jt.createFromModelPath=function(e,t){return q(jt,e,{baseOptions:{modelAssetPath:t}})},jt.createFromModelBuffer=function(e,t){return q(jt,e,{baseOptions:{modelAssetBuffer:t}})},jt.createFromOptions=function(e,t){return q(jt,e,t)};var _f=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(n=>{n.close()}),(t=this.categoryMask)==null||t.close()}};function s3(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function r3(e){try{const t=new _f(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{io(e)}}_f.prototype.close=_f.prototype.close;var ht=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new lf,this.v=new x0,z(this.h,0,3,this.v),z(e=this.h,0,1,t=new he)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?le(this.h,2,za(e.displayNamesLocale)):"displayNamesLocale"in e&&le(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}J(){(function(e){var n,i;const t=zn(e.ca(),it,1).filter(a=>(Vt(a,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((i=(n=Z(t[0],St,7))==null?void 0:n.l())==null?void 0:i.g())??new Map).forEach((a,l)=>{e.s[Number(l)]=Vt(a,1)??""})})(this)}segment(e,t,n){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:n,s3(this),qt(this,e,i),r3(this)}Ia(e,t,n,i){const a=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:i,s3(this),En(this,e,a,t),r3(this)}Ba(){return this.s}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect");const t=new St;on(t,_0,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),n.o(t),Tt(e,n),no(this,e),this.outputConfidenceMasks&&(I(e,"confidence_masks"),Y(n,"CONFIDENCE_MASKS:confidence_masks"),Wa(this,"confidence_masks"),this.g.ba("confidence_masks",(i,a)=>{this.confidenceMasks=i.map(l=>$a(this,l,!0,!this.j)),C(this,a)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],C(this,i)})),this.outputCategoryMask&&(I(e,"category_mask"),Y(n,"CATEGORY_MASK:category_mask"),Wa(this,"category_mask"),this.g.V("category_mask",(i,a)=>{this.categoryMask=$a(this,i,!1,!this.j),C(this,a)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,C(this,i)})),I(e,"quality_scores"),Y(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,a)=>{this.qualityScores=i,C(this,a)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ht.prototype.getLabels=ht.prototype.Ba,ht.prototype.segmentForVideo=ht.prototype.Ia,ht.prototype.segment=ht.prototype.segment,ht.prototype.setOptions=ht.prototype.o,ht.createFromModelPath=function(e,t){return q(ht,e,{baseOptions:{modelAssetPath:t}})},ht.createFromModelBuffer=function(e,t){return q(ht,e,{baseOptions:{modelAssetBuffer:t}})},ht.createFromOptions=function(e,t){return q(ht,e,t)};var Tf=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(n=>{n.close()}),(t=this.categoryMask)==null||t.close()}};Tf.prototype.close=Tf.prototype.close;var Gp=class extends k{constructor(e){super(e)}},el=[0,Ee,-2],fo=[0,Gn,-3,de,Gn,-1],o3=[0,fo],u3=[0,fo,Ee,-1],Af=class extends k{constructor(e){super(e)}},c3=[0,Gn,-1,de],Hp=class extends k{constructor(e){super(e)}},f3=class extends k{constructor(e){super(e)}},Nf=[1,2,3,4,5,6,7,8,9,10,14,15],d3=class extends k{constructor(e){super(e)}};d3.prototype.g=Ir([0,Re,[0,Nf,$,fo,$,[0,fo,el],$,o3,$,[0,o3,el],$,c3,$,[0,Gn,-3,de,Et],$,[0,Gn,-3,de],$,[0,P,Gn,-2,de,Ee,de,-1,2,Gn,el],$,u3,$,[0,u3,el],Gn,el,P,$,[0,Gn,-3,de,el,-1],$,[0,Re,c3]],P,[0,P,Ee,-1,de]]);var _n=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new lf,this.s=new x0,z(this.h,0,3,this.s),z(e=this.h,0,1,t=new he)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,n,i){const a=typeof n!="function"?n:{};this.j=typeof n=="function"?n:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.B+1,i=new d3;const l=new f3;var s=new Gp;if(vn(s,1,255),z(l,0,12,s),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var r=new Af;ts(r,3,!0),O(r,1,t.keypoint.x),O(r,2,t.keypoint.y),es(l,5,Nf,r)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(r of(s=new Hp,t.scribble))ts(t=new Af,3,!0),O(t,1,r.x),O(t,2,r.y),zr(s,1,Af,t);es(l,15,Nf,s)}zr(i,1,f3,l),this.g.addProtoToStream(i.g(),"drishti.RenderData","roi_in",n),qt(this,e,a);e:{try{const c=new Tf(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{io(this)}o=void 0}return o}m(){var e=new ft;ue(e,"image_in"),ue(e,"roi_in"),ue(e,"norm_rect_in");const t=new St;on(t,_0,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),se(n,"IMAGE:image_in"),se(n,"ROI:roi_in"),se(n,"NORM_RECT:norm_rect_in"),n.o(t),Tt(e,n),no(this,e),this.outputConfidenceMasks&&(I(e,"confidence_masks"),Y(n,"CONFIDENCE_MASKS:confidence_masks"),Wa(this,"confidence_masks"),this.g.ba("confidence_masks",(i,a)=>{this.confidenceMasks=i.map(l=>$a(this,l,!0,!this.j)),C(this,a)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],C(this,i)})),this.outputCategoryMask&&(I(e,"category_mask"),Y(n,"CATEGORY_MASK:category_mask"),Wa(this,"category_mask"),this.g.V("category_mask",(i,a)=>{this.categoryMask=$a(this,i,!1,!this.j),C(this,a)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,C(this,i)})),I(e,"quality_scores"),Y(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,a)=>{this.qualityScores=i,C(this,a)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_n.prototype.segment=_n.prototype.segment,_n.prototype.setOptions=_n.prototype.o,_n.createFromModelPath=function(e,t){return q(_n,e,{baseOptions:{modelAssetPath:t}})},_n.createFromModelBuffer=function(e,t){return q(_n,e,{baseOptions:{modelAssetBuffer:t}})},_n.createFromOptions=function(e,t){return q(_n,e,t)};var Qt=class extends dt{constructor(e,t){super(new Ft(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},z(e=this.h=new T0,0,1,t=new he)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?le(this.h,2,za(e.displayNamesLocale)):"displayNamesLocale"in e&&le(this.h,2),e.maxResults!==void 0?vn(this.h,3,e.maxResults):"maxResults"in e&&le(this.h,3),e.scoreThreshold!==void 0?O(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&le(this.h,4),e.categoryAllowlist!==void 0?Rr(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&le(this.h,5),e.categoryDenylist!==void 0?Rr(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&le(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},qt(this,e,t),this.j}F(e,t,n){return this.j={detections:[]},En(this,e,n,t),this.j}m(){var e=new ft;ue(e,"input_frame_gpu"),ue(e,"norm_rect"),I(e,"detections");const t=new St;on(t,Op,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),se(n,"IMAGE:input_frame_gpu"),se(n,"NORM_RECT:norm_rect"),Y(n,"DETECTIONS:detections"),n.o(t),Tt(e,n),this.g.attachProtoVectorListener("detections",(i,a)=>{for(const l of i)i=W1(l),this.j.detections.push(N0(i));C(this,a)}),this.g.attachEmptyPacketListener("detections",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Qt.prototype.detectForVideo=Qt.prototype.F,Qt.prototype.detect=Qt.prototype.D,Qt.prototype.setOptions=Qt.prototype.o,Qt.createFromModelPath=async function(e,t){return q(Qt,e,{baseOptions:{modelAssetPath:t}})},Qt.createFromModelBuffer=function(e,t){return q(Qt,e,{baseOptions:{modelAssetBuffer:t}})},Qt.createFromOptions=function(e,t){return q(Qt,e,t)};var jf=class{constructor(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function h3(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function m3(e){try{const t=new jf(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{io(e)}}jf.prototype.close=jf.prototype.close;var Mt=class extends dt{constructor(e,t){super(new Ft(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,z(e=this.h=new A0,0,1,t=new he),this.v=new p0,z(this.h,0,3,this.v),this.j=new g0,z(this.h,0,2,this.j),vn(this.j,4,1),O(this.j,2,.5),O(this.v,2,.5),O(this.h,4,.5)}get baseOptions(){return Z(this.h,he,1)}set baseOptions(e){z(this.h,0,1,e)}o(e){return"numPoses"in e&&vn(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&O(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&O(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&O(this.v,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}D(e,t,n){const i=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:n,h3(this),qt(this,e,i),m3(this)}F(e,t,n,i){const a=typeof n!="function"?n:{};return this.s=typeof n=="function"?n:i,h3(this),En(this,e,a,t),m3(this)}m(){var e=new ft;ue(e,"image_in"),ue(e,"norm_rect"),I(e,"normalized_landmarks"),I(e,"world_landmarks"),I(e,"segmentation_masks");const t=new St;on(t,Lp,this.h);const n=new it;_t(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),se(n,"IMAGE:image_in"),se(n,"NORM_RECT:norm_rect"),Y(n,"NORM_LANDMARKS:normalized_landmarks"),Y(n,"WORLD_LANDMARKS:world_landmarks"),n.o(t),Tt(e,n),no(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(i,a)=>{this.landmarks=[];for(const l of i)i=ls(l),this.landmarks.push(eo(i));C(this,a)}),this.g.attachEmptyPacketListener("normalized_landmarks",i=>{this.landmarks=[],C(this,i)}),this.g.attachProtoVectorListener("world_landmarks",(i,a)=>{this.worldLandmarks=[];for(const l of i)i=Ka(l),this.worldLandmarks.push(ss(i));C(this,a)}),this.g.attachEmptyPacketListener("world_landmarks",i=>{this.worldLandmarks=[],C(this,i)}),this.outputSegmentationMasks&&(Y(n,"SEGMENTATION_MASK:segmentation_masks"),Wa(this,"segmentation_masks"),this.g.ba("segmentation_masks",(i,a)=>{this.segmentationMasks=i.map(l=>$a(this,l,!0,!this.s)),C(this,a)}),this.g.attachEmptyPacketListener("segmentation_masks",i=>{this.segmentationMasks=[],C(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Mt.prototype.detectForVideo=Mt.prototype.F,Mt.prototype.detect=Mt.prototype.D,Mt.prototype.setOptions=Mt.prototype.o,Mt.createFromModelPath=function(e,t){return q(Mt,e,{baseOptions:{modelAssetPath:t}})},Mt.createFromModelBuffer=function(e,t){return q(Mt,e,{baseOptions:{modelAssetBuffer:t}})},Mt.createFromOptions=function(e,t){return q(Mt,e,t)},Mt.POSE_CONNECTIONS=i3;const ho="https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task",Vp="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm",Fp=()=>{const e=p.useRef(null),[t,n]=p.useState(!1),[i,a]=p.useState("Initializing..."),[l,s]=p.useState(0),[r,o]=p.useState(!1);p.useEffect(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(f=>{console.log("ServiceWorker registered:",f)}).catch(f=>{console.log("ServiceWorker registration failed:",f)})},[]);const c=async()=>"caches"in window?await(await caches.open("mediapipe-models-v1")).match(ho)!==void 0:!1,d=async()=>{try{const f=await fetch(ho),w=f.headers.get("content-length"),v=w?parseInt(w,10):0;if(!f.body)throw new Error("No response body");const x=f.body.getReader();let _=0;const m=[];for(;;){const{done:g,value:y}=await x.read();if(g)break;if(m.push(y),_+=y.length,v){const b=Math.round(_/v*100);s(b),a(`Downloading model... ${b}%`)}}return"caches"in window&&await(await caches.open("mediapipe-models-v1")).put(ho,new Response(new Blob(m),{headers:{"Content-Type":"application/octet-stream"}})),!0}catch(f){return console.error("Failed to preload model:",f),!1}};return p.useEffect(()=>{(async()=>{try{a("Checking cached models..."),await c()?a("Using cached model..."):(a("Model not cached. Downloading..."),await d()),a("Loading MediaPipe WASM...");const v=await na.forVisionTasks(Vp);a("Creating face landmarker...");const x=await ye.createFromOptions(v,{baseOptions:{modelAssetPath:ho,delegate:"GPU"},runningMode:"VIDEO",outputFaceBlendshapes:!0,numFaces:2});e.current=x,n(!0),a("Model loaded successfully ✅")}catch(w){console.error("Model init error:",w),a(`Error: ${w==null?void 0:w.message}`),(w==null?void 0:w.name)==="NotAllowedError"&&o(!0)}})()},[]),{faceLandmarkerRef:e,isModelLoaded:t,statusMessage:i,setStatusMessage:a,loadingProgress:l,permissionDenied:r,clearCache:async()=>{"caches"in window&&(await caches.delete("mediapipe-models-v1"),a("Cache cleared. Please refresh to re-download models."))}}},qp=()=>{const[e,t]=p.useState(0),n=p.useRef({lastTime:0,frames:0,fps:0}),i=p.useCallback(()=>{const a=performance.now(),l=n.current;if(l.frames++,a-l.lastTime>=1e3){const s=Math.round(l.frames*1e3/(a-l.lastTime));t(s),l.frames=0,l.lastTime=a}},[]);return{fps:e,updateFPS:i}},Yp=()=>{const e=p.useRef({value:100,isLookingAway:!1}),t=p.useCallback((l,s,r,o)=>{if(!l||!r||!s)return;const c=l.getContext("2d");if(!c)return;const{width:d,height:h}=l;if(c.clearRect(0,0,d,h),c.drawImage(s,0,0,d,h),o){c.fillStyle="#00FF00";for(const f of r)c.fillRect(f.x*d-.5,f.y*h-.5,1,1)}},[]),n=p.useCallback(l=>{const s=e.current.value/100,r=100,o=20,c=20,d=40;l.fillStyle="rgba(0, 0, 0, 0.3)",l.fillRect(c,d,o,r),l.fillStyle=`rgba(${Math.floor(255*(1-s))}, ${Math.floor(255*s)}, 0, 0.8)`;const h=r*s;l.fillRect(c,d+r-h,o,h),l.fillStyle="#FFFFFF",l.fillRect(c,d+r*(1-s),o,2)},[]),i=p.useCallback((l,s,r,o,c,d,h)=>{if(t(l,s,r,o),c&&d&&h){const f=l.getContext("2d");f&&n(f)}},[t,n]),a=p.useCallback((l,s)=>{const r=l.getContext("2d");r&&(r.clearRect(0,0,l.width,l.height),r.drawImage(s,0,0,l.width,l.height))},[]);return{drawLandmarks:t,drawEngagementBar:n,drawWithEngagementBar:i,clearCanvas:a,engagementRef:e}},Xp=50,Qp=()=>{const[e,t]=p.useState(100),[n,i]=p.useState(!1),a=p.useRef(0),l=p.useCallback((s,r,o)=>{if(!o||s.length<468)return;const c=s[33],d=s[263],h=s[1];if(!c||!d||!h)return;const f=(c.x+d.x)*.5,w=(c.y+d.y)*.5,v=f-r.x,x=w-r.y,_=Math.sqrt(v*v+x*x),m=Math.abs(h.y-r.noseY)*100,g=Math.abs(h.x-r.noseX)*100,y=Math.max(0,100-(_*200+m+g)),b=y<Xp,S=performance.now();return S-a.current>100&&(t(y),i(b),a.current=S),{engagement:y,isLookingAway:b}},[]);return{engagement:e,isLookingAway:n,analyzeGaze:l,setEngagement:t,setIsLookingAway:i}},Zp=.05,Kp=()=>{const[e,t]=p.useState(!1),[n,i]=p.useState(!1),a=p.useCallback((r,o)=>Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),[]),l=p.useCallback((r,o)=>{if(!r||!o)return 0;const c=[1,33,263,61,291,10,152];let d=0,h=0;const f=o[33],w=o[263],v=r[33],x=r[263];if(!f||!w||!v||!x)return 0;const _=a(f,w),m=a(v,x);if(_===0||m===0)return 0;for(const y of c){const b=o[y],S=r[y];if(b&&S){const A=f.x+(S.x-v.x)*_/m,T=f.y+(S.y-v.y)*_/m;d+=a(b,{x:A,y:T}),h++}}return h===0?0:d/h},[a]),s=p.useCallback((r,o,c,d)=>{if(!r.faceLandmarks||r.faceLandmarks.length===0)return o?(d("Reference face not detected."),i(!0),t(!1)):i(!1),null;if(o&&c){let h=null,f=0;for(const w of r.faceLandmarks)l(w,c)<Zp&&(h=w,f++);return f===1?(t(!1),i(!1),d("Reference face tracked."),h):f>1?(t(!0),i(!1),d("Multiple matching faces detected. Tracking suspended."),null):(t(!1),i(!0),d("Reference face not detected."),null)}else{r.faceLandmarks.length>1?(t(!0),d("Multiple faces detected. Set reference for single face tracking.")):(t(!1),d("No reference set. Detecting first face."));const h=r.faceLandmarks[0];return!h||h.length<468?null:h}},[l]);return{multipleFacesDetected:e,referenceFaceNotDetected:n,analyzeFace:s,setMultipleFacesDetected:t,setReferenceFaceNotDetected:i}},Ip=1e3,Wp=(e,t)=>{const[n,i]=p.useState(!1),[a,l]=p.useState("face_detected"),{incrementGazeViolation:s}=th(),{multipleFacesDetected:r,referenceFaceNotDetected:o,isLookingAway:c}=e;p.useEffect(()=>{let f;return(c||r||o)&&t?f=setTimeout(()=>{i(!0),c?(l("looking_away"),s("looking_away")):r?(l("multiple_faces"),s("multiple_faces")):o&&(l("no_face_detected"),s("no_face_detected"))},Ip):(i(!1),l("face_detected")),()=>{clearTimeout(f)}},[c,r,o,t,s]);const d=p.useCallback(()=>r?"multiple_faces":o?"no_face_detected":c?"looking_away":"face_detected",[r,o,c]),h=p.useCallback(()=>{i(!1),l("face_detected")},[]);return{showGazeWarningModal:n,faceDetectionState:a,getWarningType:d,closeWarningModal:h,setShowGazeWarningModal:i,setFaceDetectionState:l}};class Se extends Error{constructor(t,n,i=!1){super(t),this.code=n,this.recoverable=i,this.name="STTError"}}class Jp{constructor(t={}){Bt(this,"config");Bt(this,"mediaRecorder",null);Bt(this,"audioChunks",[]);Bt(this,"recordingStream",null);Bt(this,"autoStopTimeoutId",null);this.config={baseUrl:"http://localhost:8000",provider:"groq",model:"whisper-large-v3-turbo",language:"en",includeTimestamps:!1,temperature:0,...t}}updateConfig(t){this.config={...this.config,...t}}isRecordingSupported(){return!!(navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&window.MediaRecorder)}async startRecording(t,n){var i;if(!this.isRecordingSupported())throw new Se("Audio recording is not supported in this browser","RECORDING_NOT_SUPPORTED",!1);if(this.isRecording())throw new Se("Recording is already in progress","ALREADY_RECORDING",!0);try{this.recordingStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:44100}}),this.audioChunks=[];const a=this.getSupportedMimeType();this.mediaRecorder=new MediaRecorder(this.recordingStream,{mimeType:a}),this.mediaRecorder.ondataavailable=l=>{var s;l.data.size>0&&(this.audioChunks.push(l.data),(s=n==null?void 0:n.onDataAvailable)==null||s.call(n,l.data))},this.mediaRecorder.onstop=()=>{var l;(l=n==null?void 0:n.onStop)==null||l.call(n)},this.mediaRecorder.onerror=l=>{var r;const s=new Se(`Recording failed: ${l.error}`,"RECORDING_ERROR",!0);(r=n==null?void 0:n.onError)==null||r.call(n,s),this.cleanup()},this.mediaRecorder.start(100),(i=n==null?void 0:n.onStart)==null||i.call(n),t&&t>0&&(this.autoStopTimeoutId=setTimeout(()=>{this.isRecording()&&this.stopRecording()},t*1e3))}catch(a){if(this.cleanup(),a instanceof Error){if(a.name==="NotAllowedError"||a.name==="PermissionDeniedError")throw new Se("Microphone permission was denied","PERMISSION_DENIED",!1);if(a.name==="NotFoundError")throw new Se("No microphone found","NO_MICROPHONE",!1)}throw new Se(`Failed to start recording: ${a instanceof Error?a.message:String(a)}`,"START_RECORDING_FAILED",!0)}}async stopRecording(){if(this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),!this.mediaRecorder||!this.isRecording())throw new Se("No active recording to stop","NO_ACTIVE_RECORDING",!1);return new Promise((t,n)=>{if(!this.mediaRecorder){n(new Se("MediaRecorder is null","MEDIARECORDER_NULL",!1));return}const i=this.mediaRecorder,a=()=>{try{const l=i.mimeType||"audio/webm",s=new Blob(this.audioChunks,{type:l});this.cleanup(),t(s)}catch(l){n(new Se(`Failed to create audio blob: ${l instanceof Error?l.message:String(l)}`,"BLOB_CREATION_FAILED",!1))}};i.addEventListener("stop",a,{once:!0}),i.stop()})}async transcribe(t){const{audioBlob:n}=t;if(!n||n.size===0)throw new Se("Audio blob is empty or invalid","INVALID_AUDIO",!1);try{const i=new FormData,a=new File([n],"recording.wav",{type:n.type||"audio/wav"});if(i.append("file",a),i.append("qna_id",this.config.qnaId||""),!this.config.interviewId)throw new Se("Interview ID is missing from configuration","MISSING_INTERVIEW_ID",!1);const l=await si(`${this.config.baseUrl}${oi.TRANSCRIBE_ANSWER(this.config.interviewId)}`,{method:"POST",headers:{accept:"application/json","X-STT-Provider":this.config.provider||"groq",...this.config.authToken&&{Authorization:`Bearer ${this.config.authToken}`}},body:i},{attempts:1,backoff:"exponential",baseDelay:1e3,maxDelay:3e3,jitter:!0});if(!l.ok){const r=await l.text();let o=`STT request failed: ${l.status} ${l.statusText}`;try{const c=JSON.parse(r);o=c.message||c.error||o}catch{o=r||o}throw new Se(o,`HTTP_${l.status}`,l.status>=500)}return{transcript:(await l.json()).data.transcribed_text??""}}catch(i){throw i instanceof Se?i:new Se(`Transcription failed: ${i instanceof Error?i.message:String(i)}`,"TRANSCRIPTION_FAILED",!0)}}cancelRecording(){this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),this.mediaRecorder&&this.isRecording()&&this.mediaRecorder.stop(),this.cleanup()}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}getSupportedMimeType(){const t=["audio/webm","audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/wav"];for(const n of t)if(MediaRecorder.isTypeSupported(n))return n;return"audio/webm"}getRecordingStream(){return this.recordingStream}cleanup(){this.recordingStream&&(this.recordingStream.getTracks().forEach(t=>t.stop()),this.recordingStream=null),this.mediaRecorder=null,this.audioChunks=[],this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null)}}const tl=new Jp,Pp=(e,t,n,i)=>{const a=p.useRef(null);return p.useEffect(()=>{if(!t)return;const l=async()=>{try{const o=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:640},height:{ideal:480},facingMode:"user"}});e.current&&(e.current.srcObject=o,e.current.onloadeddata=()=>{n()})}catch(o){console.error("Camera access error:",o),i("Camera access failed")}},s=a.current,r=e.current;return l(),()=>{s&&cancelAnimationFrame(s),r!=null&&r.srcObject&&r.srcObject.getTracks().forEach(c=>c.stop())}},[t,n]),p.useEffect(()=>{const l=tl.getRecordingStream();if(l&&e.current){e.current.srcObject=l;const s=l.getVideoTracks(),r=l.getAudioTracks(),o=()=>{console.log("Media track ended - permission may have been revoked")};[...s,...r].forEach(c=>{c.addEventListener("ended",o)})}},[]),{animationFrameRef:a}},$p=(e,t,n,i,a,l,s,r,o,c,d,h,f,w,v)=>{const x=p.useRef(null),_=p.useCallback(()=>{var b;const m=e.current,g=t.current,y=n.current;if(!m||m.readyState<2||!y||!g){x.current=requestAnimationFrame(_);return}i();try{const S=performance.now(),A=y.detectForVideo(m,S);if(((b=A.faceLandmarks)==null?void 0:b.length)>0){v(!1);const T=a(A,o,c.current,w);T?(l(g,m,T,d,h,f,o),o&&f&&r(T,c.current,f)):s(g,m)}else s(g,m),o?(v(!0),w("Reference face not detected.")):v(!1)}catch(S){console.error("Face detection error:",S)}x.current=requestAnimationFrame(_)},[e,t,n,i,a,l,s,r,o,c,d,h,f,w,v]);return{renderLoop:_,animationFrameRef:x}},e6=(e,t,n,i)=>{const{referenceSet:a,referenceRef:l,setReferenceData:s}=th(),r=p.useRef(l),o=p.useCallback(()=>{r.current=l},[l]),c=p.useCallback(()=>{var f;const d=e.current,h=t.current;if(console.log({faceLandmarker:d,video:h}),!(!d||!h))try{const w=performance.now(),v=d.detectForVideo(h,w);if((f=v.faceLandmarks)!=null&&f[0]){const x=v.faceLandmarks[0],_=x[33],m=x[263],g=x[1];_&&m&&g&&(r.current={x:(_.x+m.x)*.5,y:(_.y+m.y)*.5,noseX:g.x,noseY:g.y},s(!0,r.current),n("Reference set. Gaze tracking active."),console.log("Reference set. Gaze tracking active.",r.current),i&&i())}}catch(w){console.error("Set reference error:",w),n("Failed to set reference")}},[e,t,n,s,i]);return{referenceSet:a,referenceRef:r,setReference:c,syncReference:o}},Mf=({isOpen:e,onClose:t,children:n,title:i,showCloseButton:a=!0,closeOnOverlayClick:l=!0,closeOnEscape:s=!0,className:r=""})=>{if(p.useEffect(()=>{if(!e||!s)return;const d=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,s,t]),p.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const o=d=>{l&&d.target===d.currentTarget&&t()},c=u.jsxs("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center",children:[u.jsx("div",{className:"iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",onClick:o}),u.jsxs("div",{className:`iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${r}`,role:"dialog","aria-modal":"true","aria-labelledby":i?"dialog-title":void 0,children:[(i||a)&&u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200",children:[i&&u.jsx("h2",{id:"dialog-title",className:"iw-text-lg iw-font-semibold iw-text-gray-900",children:i}),a&&u.jsx("button",{onClick:t,className:"iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100","aria-label":"Close dialog",children:u.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsx("div",{className:"iw-p-4 iw-overflow-y-auto",children:n})]})]});return Zi.createPortal(c,document.body)},w3=({children:e,variant:t="primary",size:n="md",fullWidth:i=!1,isLoading:a=!1,disabled:l,className:s="",...r})=>{const o="iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2",c={primary:"iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",secondary:"iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",outline:"iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",text:"iw-bg-transparent iw-text-primary-600 iw-hover:bg-primary-50 iw-border iw-border-transparent",gradient:"iw-text-white iw-border iw-border-transparent iw-bg-gradient-to-r iw-from-purple-500 iw-to-indigo-500 hover:iw-from-purple-600 hover:iw-to-indigo-600"},d={sm:"iw-px-3 iw-py-1.5 iw-text-sm",md:"iw-px-4 iw-py-2.5 iw-text-sm",lg:"iw-px-5 iw-py-3 iw-text-base"},h="iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none",f=i?"iw-w-full":"";return u.jsxs("button",{className:`${o} ${c[t]} ${d[n]} ${f} ${h} ${s}`,disabled:l||a,...r,children:[a&&u.jsx(oh,{height:16,width:16,style:{marginRight:"3px"}}),e]})},us=e=>{const{baseColor:t,borderRadius:n}=yr(),{loading:i,children:a,...l}=e;return u.jsx(w3,{style:{background:Zg(t),borderRadius:n},...l,children:i?u.jsx(oh,{}):a})};function t6({isOpen:e,onClose:t,warningType:n}){const i=uh[n],a=i.icon,l=()=>{t()};return n==="face_detected"?null:u.jsx(Mf,{isOpen:e,onClose:t,children:e&&u.jsx("div",{className:"iw-bg-white iw-border-white iw-border iw-p-0 iw-shadow-lg sm:iw-max-w-md",children:u.jsxs("div",{children:[u.jsx("div",{className:"iw-sr-only",children:i.description}),u.jsxs("div",{className:"iw-px-8 iw-py-8 iw-text-center",children:[u.jsx("div",{className:`iw-mx-auto iw-mb-6 iw-flex iw-h-16 iw-w-16 iw-items-center iw-justify-center iw-rounded-full ${i.iconBg} border ${i.iconBorder}`,children:u.jsx(a,{className:`iw-h-7 iw-w-7 ${i.iconColor}`})}),u.jsx("h1",{className:"iw-text-foreground iw-mb-3 iw-text-2xl iw-font-bold iw-tracking-tight",children:i.title}),u.jsx("h2",{className:"iw-text-gray-500 iw-mb-6 iw-text-base iw-font-medium",children:i.subtitle}),u.jsx("p",{className:"iw-text-neutral-400 iw-mx-auto iw-mb-8 iw-max-w-sm iw-text-sm iw-leading-relaxed",children:i.description}),u.jsx(us,{onClick:l,className:"iw-w-full iw-bg-gray-800 iw-text-white hover:iw-bg-gray-800",children:i.buttonText})]})]})})})}const g3=p.forwardRef(({className:e="",interviewId:t="",interview_duration:n,showProctoringUI:i=!0,onSetReference:a,isAnswering:l,onProctoringStatusChange:s,showStatusOverlay:r=!1},o)=>{var jg;const{authToken:c}=ih(),d=c?Ig(c):null,{borderRadius:h}=yr(),f=h??18,{proctoring:w}=Yu(),v=!!(w!=null&&w.gazeAnalysisEnabled),[x,_]=p.useState(!1),[m,g]=p.useState((w==null?void 0:w.showLandmarks)??!1),[y,b]=p.useState(i&&((w==null?void 0:w.showEngagementBar)??!0)),[S,A]=p.useState(v),[T,N]=p.useState(!1),M=p.useRef(null),D=p.useRef(null),ge=p.useRef(null),et=p.useRef(null),pt=p.useCallback(async bt=>{const mr=M.current,ut=ge.current;if(!mr||!ut)return;const Fl=ut.getContext("2d");Fl&&(ut.width=mr.videoWidth,ut.height=mr.videoHeight,Fl.save(),Fl.scale(-1,1),Fl.drawImage(mr,-ut.width,0,ut.width,ut.height),Fl.restore(),await new Promise(Ru=>ut.toBlob(Ru,"image/jpeg")))},[d5,t]);p.useEffect(()=>{let bt;return l&&(N(!0),bt=setTimeout(()=>N(!1),1e3)),()=>{bt&&clearTimeout(bt)}},[l]);const{faceLandmarkerRef:yt,isModelLoaded:vt,statusMessage:j,setStatusMessage:B,loadingProgress:R,permissionDenied:J,clearCache:ae}=Fp(),{fps:st,updateFPS:gn}=qp(),{drawWithEngagementBar:sn,clearCanvas:Rt,engagementRef:rt}=Yp(),{engagement:ot,isLookingAway:rn,analyzeGaze:Ce,setEngagement:Xi,setIsLookingAway:Vl}=Qp(),{multipleFacesDetected:fr,referenceFaceNotDetected:dr,analyzeFace:I2,setMultipleFacesDetected:Ou,setReferenceFaceNotDetected:Aa}=Kp(),{referenceSet:hr,referenceRef:Lu,setReference:H,syncReference:Ae}=e6(yt,M,B,a),Na={multipleFacesDetected:fr,referenceFaceNotDetected:dr,isLookingAway:rn},{showGazeWarningModal:Uu,getWarningType:zu,closeWarningModal:Tg,setShowGazeWarningModal:Ag,setFaceDetectionState:Ng}=Wp(Na,v&&!r);p.useEffect(()=>{if(s){const bt=zu()||"face_detected";s(bt)}},[fr,dr,rn,zu,s]);const{renderLoop:_7}=$p(M,D,yt,gn,I2,sn,Rt,Ce,hr,Lu,m,y,v,B,Aa);Pp(M,vt,_7,B),p.useEffect(()=>{Ae()},[Ae]),p.useEffect(()=>{rt&&rt.current&&(rt.current.value=ot,rt.current.isLookingAway=rn)},[ot,rn,rt]);const T7=p.useCallback(bt=>{A(bt),bt||(Xi(100),Vl(!1))},[Xi,Vl]),A7=p.useCallback(()=>{Vl(!1),Ou(!1),Aa(!1),Ng("face_detected"),Ag(!1),Tg()},[Vl,Ou,Aa,Ng,Ag,Tg]),N7={engagement:ot,fps:st,isLookingAway:rn,multipleFacesDetected:fr,referenceFaceNotDetected:dr};return p.useEffect(()=>{const bt=[];return(async()=>{try{const ut=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1});et.current=ut,M.current&&(M.current.srcObject=ut);const Ru=(n??gr)*60*1e3/3,j7=[0,1,2].map((ja,Qi)=>({label:`capture-${Qi+1}`,start:Qi*Ru,end:(Qi+1)*Ru})),M7=(ja,Qi)=>ja===Qi?ja:Math.random()*(Qi-ja)+ja;j7.forEach(({label:ja,start:Qi,end:C7},D7)=>{let W2;D7===0?W2=3e3:W2=M7(Qi,C7),bt.push(setTimeout(()=>{pt(ja)},W2))})}catch(ut){console.error("Error accessing camera:",ut)}})(),()=>{et.current&&et.current.getTracks().forEach(ut=>ut.stop()),bt.forEach(clearTimeout)}},[pt]),p.useImperativeHandle(o,()=>({setReference:()=>{H()},stopCamera:()=>{et.current&&(et.current.getTracks().forEach(bt=>bt.stop()),et.current=null)}}),[H]),u.jsxs("div",{className:`iw-relative iw-h-full iw-w-full ${e}`,children:[J?u.jsxs("div",{className:"iw-rounded-md iw-border iw-border-red-600 iw-p-5 iw-text-red-600",children:[u.jsx("h2",{children:"Camera Permission Denied"}),u.jsx("p",{children:"Please allow camera access to use this application."})]}):u.jsx("div",{className:"iw-flex iw-w-full iw-h-full iw-justify-start iw-items-start",children:u.jsxs("div",{className:`iw-relative iw-max-w-full iw-max-h-full iw-aspect-video iw-rounded-2xl iw-overflow-hidden iw-bg-black ${T?"iw-animate-answer-start":""} ${l?"iw-border-4 iw-border-[#6296FB]":""}`,style:{width:"100%",height:"auto",minHeight:"0"},children:[u.jsx("video",{ref:M,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-absolute iw-inset-0 iw-w-full iw-h-full iw-object-cover",style:{transform:"scaleX(-1)"}}),v&&u.jsx("canvas",{ref:D,width:320,height:240,className:"iw-absolute iw-inset-0 iw-w-full iw-h-full iw-object-cover",style:{transform:"scaleX(-1)",borderRadius:f}}),u.jsx("canvas",{ref:ge,style:{display:"none"}}),i&&u.jsxs("div",{className:"iw-absolute iw-top-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-[#FFEBE6] iw-px-2 iw-py-1 iw-backdrop-blur-md",children:[u.jsx("div",{className:"iw-size-2 iw-animate-pulse iw-rounded-full iw-bg-red-500"}),u.jsx("span",{className:"iw-font-medium iw-text-xs iw-text-[#E94315]",children:"RECORDING"})]}),i&&((jg=d==null?void 0:d.data)==null?void 0:jg.user_name)&&u.jsx("div",{className:"iw-absolute iw-z-50 iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-[#F1F5FE] iw-px-3 iw-py-1 iw-backdrop-blur-md",children:u.jsx("span",{className:"iw-font-medium iw-text-xs iw-text-[#062260]",children:d.data.user_name})}),i&&u.jsx("div",{className:"iw-absolute iw-bottom-4 iw-right-4",children:u.jsx(m5,{showControls:(w==null?void 0:w.showControls)??!1,isBubbleOpen:x,setIsBubbleOpen:_,setReference:H,clearCache:ae,isModelLoaded:vt,gazeAnalysisEnabled:S&&v,referenceSet:hr,showLandmarks:m,setShowLandmarks:g,showEngagementBar:y,setShowEngagementBar:b,handleToggleGazeAnalysis:T7,stats:N7,statusMessage:j,loadingProgress:R})}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"iw-absolute iw-inset-0 iw-pointer-events-none iw-z-10 ",style:{background:"radial-gradient(ellipse 20% 40% at 50% 45%, transparent 99.5%, rgba(0,0,0,0.35) 100%)"}}),u.jsx("div",{className:"iw-absolute iw-bottom-2 iw-inset-x-0 iw-flex iw-justify-center iw-pointer-events-none iw-z-20",children:u.jsx(n6,{status:zu()??"face_detected"})})]})]})}),v&&Uu&&!r&&u.jsx(t6,{isOpen:Uu,onClose:A7,warningType:zu()})]})}),n6=({status:e})=>{const t=uh[e];if(!t)return null;const n=e!=="face_detected";return u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-gap-2",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2 iw-px-3 iw-py-1 iw-rounded-full iw-backdrop-blur-md iw-shadow-sm transition-colors duration-300 iw-text-white",children:[u.jsx("div",{className:`iw-flex iw-h-4 iw-w-4 iw-items-center iw-size-2.5 iw-justify-center iw-rounded-full iw-text-white ${n?"iw-bg-[#E94315]":"iw-bg-[#22C55E]"}`,children:n?u.jsx(sh,{}):u.jsx(vr,{})}),u.jsx("span",{className:"iw-text-sm iw-font-medium",children:e==="face_detected"?"Face detected clearly":t.title})]}),n&&u.jsx("span",{className:"iw-text-white iw-text-center iw-text-sm iw-drop-shadow-sm iw-max-w-[400px] iw-px-3 ",children:"Sit upright & look directly into the camera"})]})},p3=({micEnabled:e=!1,videoEnabled:t=!1,buttonText:n,onButtonClick:i,isAgreed:a,onAgreedToggle:l,showCheckbox:s=!0,showMediaIcons:r=!0,disabled:o=!1})=>{const c=o||!a||r&&(!e||!t);return u.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-6 iw-w-full",children:[s&&u.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3 iw-bg-[#F1F5FE] iw-rounded-xl iw-p-4 iw-border iw-border-[#E7EAF1]",children:[u.jsx("div",{className:`iw-mt-0.5 iw-h-5 iw-w-5 iw-min-w-[20px] iw-rounded iw-border iw-flex iw-items-center iw-justify-center iw-cursor-pointer iw-transition-colors ${a?"iw-bg-[#062260] iw-border-[#062260]":"iw-bg-white iw-border-[#B3B9CB]"}`,onClick:d=>{d.stopPropagation(),l(!a)},children:a&&u.jsx(vr,{className:"iw-size-3 iw-text-white"})}),u.jsx("label",{onClick:()=>l(!a),className:"iw-text-sm iw-text-[#062260] iw-font-medium iw-cursor-pointer iw-select-none",children:"By continuing, you acknowledge and consent to the use of your face data exclusively for interview monitoring"})]}),u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-4",children:[r&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"iw-relative",children:[u.jsx("div",{className:`iw-flex iw-h-12 iw-w-16 iw-items-center iw-justify-center iw-rounded-xl iw-border iw-transition-all ${e?"iw-border-[#E7EAF1] iw-bg-white iw-text-[#062260]":"iw-border-rose-200 iw-bg-rose-50 iw-text-rose-600"}`,children:e?u.jsx(t5,{className:"iw-h-6 iw-w-6"}):u.jsx(n5,{className:"iw-h-6 iw-w-6"})}),e&&u.jsx("div",{className:"iw-absolute -iw-right-1 -iw-top-1 iw-flex iw-h-4 iw-w-4 iw-items-center iw-justify-center iw-rounded-full iw-bg-[#22C55E] iw-text-white",children:u.jsx(vr,{className:"iw-h-2.5 iw-w-2.5"})})]}),u.jsxs("div",{className:"iw-relative",children:[u.jsx("div",{className:`iw-flex iw-h-12 iw-w-16 iw-items-center iw-justify-center iw-rounded-xl iw-border iw-transition-all ${t?"iw-border-[#E7EAF1] iw-bg-white iw-text-[#062260]":"iw-border-rose-200 iw-bg-rose-50 iw-text-rose-600"}`,children:t?u.jsx(o5,{className:"iw-h-6 iw-w-6"}):u.jsx(u5,{className:"iw-h-6 iw-w-6"})}),t&&u.jsx("div",{className:"iw-absolute -iw-right-1 -iw-top-1 iw-flex iw-h-4 iw-w-4 iw-items-center iw-justify-center iw-rounded-full iw-bg-[#22C55E] iw-text-white",children:u.jsx(vr,{className:"iw-h-2.5 iw-w-2.5"})})]})]}),u.jsx(w3,{onClick:i,disabled:c,className:`iw-h-12 iw-flex-1 iw-max-w-[220px] !iw-bg-[#F1F5FE] !iw-text-[#062260] !iw-font-bold iw-border-none iw-rounded-lg ${c?"iw-opacity-50":"hover:iw-opacity-75"}`,children:n})]})]})},i6=({steps:e,currentStepIndex:t})=>u.jsx("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-4 iw-w-full iw-py-6",children:e.map((n,i)=>{const a=i<t,l=i===t;return u.jsxs(p.Fragment,{children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[u.jsx("div",{className:`iw-flex iw-size-9 iw-text-[#062260] iw-items-center iw-justify-center iw-rounded-full iw-font-semibold iw-border ${l||a?"iw-border-[#0EB00E] iw-bg-[#E9FFE6]":"iw-border-[#BDE0FD] iw-bg-[#E6F3FF]"}`,children:a?u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("polyline",{points:"20 6 9 17 4 12"})}):i+1}),u.jsx("span",{className:`iw-text-sm iw-font-medium ${l||a?"iw-text-[#062260]":"iw-text-[#5C6686]"}`,children:n.label})]}),i<e.length-1&&u.jsx("div",{className:"iw-flex-1 iw-max-w-[120px] iw-border-t iw-border-dotted iw-border-[#B3B9CB]"})]},i)})}),a6=["Don't refresh or reload the page during your assessment","Don't switch tabs or open other applications while session is ongoing","Don't leave your position during the session","Don't disable or interfere with video/audio monitoring"],l6=({isOpen:e,onStart:t,gazeEnabled:n=!1,videoFeedRef:i,interviewId:a="",interview_duration:l=gr})=>{const s=p.useRef(null),r=p.useRef(null),[o,c]=p.useState(!1),[d,h]=p.useState(!1),[f,w]=p.useState(0),[v,x]=p.useState(!1),_=p.useRef(null),m=p.useRef(null),g=M=>{_.current=M,i&&(typeof i=="function"?i(M):i.current=M)},y=()=>{r.current&&(r.current.getTracks().forEach(M=>M.stop()),r.current=null)},b=async()=>{try{const M=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1280},height:{ideal:720}},audio:!0});r.current=M,s.current&&(s.current.srcObject=M),c(!0)}catch(M){console.error("Media permission error:",M);let D="Unable to access camera or microphone.";(M==null?void 0:M.name)==="NotAllowedError"?D="Permissions denied. Please allow access to camera and microphone.":(M==null?void 0:M.name)==="NotFoundError"?D="No camera/microphone found. Please connect a device and retry.":M!=null&&M.message&&(D=M.message),c(!1),console.log(D)}finally{}};if(p.useEffect(()=>{if(!e){y();return}return b(),()=>y()},[e]),p.useEffect(()=>()=>{m.current&&(clearInterval(m.current),m.current=null)},[]),!e)return null;const[S,A]=p.useState("face_detected"),T=async()=>{h(!0);const M=()=>{var D;return(D=_.current)==null?void 0:D.setReference()};M(),m.current&&clearInterval(m.current),m.current=setInterval(M,500)},N=[{label:n?"Calibrate your camera":"Camera & Mic permission"},{label:"Basic guidelines"}];return u.jsx("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-gray-900/40 iw-backdrop-blur-sm iw-p-4 iw-overflow-auto",children:u.jsxs("div",{className:"iw-w-full iw-max-w-[700px] iw-bg-white iw-rounded-xl iw-shadow-2xl iw-overflow-auto",children:[u.jsxs("div",{className:"iw-px-5 iw-pt-5",children:[u.jsx("h2",{className:"iw-text-[#062260] iw-text-2xl iw-font-medium iw-tracking-tight",children:"Final checks before you go live"}),u.jsx("div",{className:"iw-mt-4 iw-bg-[#F1F5FE] iw-rounded-xl iw-p-3 iw-border iw-border-[#E7EAF1]",children:u.jsx("p",{className:"iw-text-[#5C6686] iw-text-sm iw-leading-relaxed",children:"To ensure the integrity of the interview process, this platform uses your device’s camera to monitor your face and gaze direction. We do not store any outside this session"})}),u.jsx("div",{className:"iw-mt-6 iw-border-b iw-border-dashed iw-border-[#B3B9CB] iw-w-full"}),u.jsx(i6,{steps:N,currentStepIndex:f})]}),u.jsx("div",{className:"iw-px-5 iw-pb-5 iw-flex iw-flex-col iw-items-center",children:f===0?u.jsxs("div",{className:"iw-w-full iw-flex iw-flex-col iw-items-center iw-gap-6",children:[u.jsx("div",{className:"iw-w-full iw-max-w-[600px] iw-aspect-video iw-bg-slate-100 iw-rounded-2xl iw-overflow-hidden iw-relative iw-border iw-border-slate-200",children:n?u.jsx(g3,{ref:g,interviewId:a,interview_duration:l,showProctoringUI:!1,showStatusOverlay:!0,onProctoringStatusChange:A,onSetReference:()=>{m.current&&(clearInterval(m.current),m.current=null),h(!1),w(1)}}):u.jsx("video",{ref:s,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-w-full iw-h-full iw-object-cover",style:{transform:"scaleX(-1)"}})}),u.jsx(p3,{micEnabled:o,videoEnabled:o,buttonText:n?d?"Calibrating...":"Start calibrate":"Next",onButtonClick:()=>{n?T():w(1)},disabled:!v||n&&S!=="face_detected"||!n&&!o,isAgreed:v,onAgreedToggle:x})]}):u.jsxs("div",{className:"iw-w-full iw-flex iw-flex-col iw-gap-6",children:[u.jsx("div",{className:"iw-w-full iw-bg-[#F8FAFF] iw-rounded-2xl iw-p-8 iw-flex iw-flex-col iw-gap-5",children:a6.map((M,D)=>u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-4",children:[u.jsx("div",{className:"iw-flex iw-h-7 iw-w-7 iw-min-w-[28px] iw-items-center iw-justify-center iw-rounded-full iw-bg-[#DBEAFE] iw-text-[#062260] iw-text-xs iw-font-bold",children:D+1}),u.jsx("span",{className:"iw-text-[#5C6686] iw-font-medium",children:M})]},D))}),u.jsx(p3,{buttonText:"Start interview",onButtonClick:()=>{t(),y()},isAgreed:v,onAgreedToggle:x,showMediaIcons:!1})]})})]})})};var K=(e=>(e.IDLE="idle",e.FETCHING_QUESTION="fetching_question",e.READING_QUESTION="reading_question",e.THINKING="thinking",e.ANSWERING="answering",e.TRANSCRIBING="transcribing",e.EDITING="editing",e.SUBMITTING="submitting",e.COMPLETED="completed",e))(K||{});const y3={thinkingDuration:0,answeringDuration:120,editingDuration:30},v3={idle:{next:"fetching_question"},fetching_question:{next:"reading_question"},reading_question:{next:"answering"},thinking:{next:"answering",duration:0},answering:{next:"transcribing",duration:120},transcribing:{next:"editing"},editing:{next:"submitting",duration:30},submitting:{next:"completed"},completed:{next:"completed"}};class s6{constructor(t={},n={}){Bt(this,"config");Bt(this,"state");Bt(this,"phaseIntervalId",null);Bt(this,"globalIntervalId",null);Bt(this,"callbacks");this.config={...y3,...t},this.callbacks=n,this.state={phase:"idle",currentPhaseTimeRemaining:0,totalTimeElapsed:0,currentQuestionNumber:0}}updateConfig(t){this.config={...this.config,...t}}getState(){return{...this.state}}startQuestion(){this.state.currentQuestionNumber===0&&this.startGlobalTimer(),this.state.currentQuestionNumber=this.state.currentQuestionNumber+1,this.state.phase="fetching_question",this.notifyChange()}nextPhase(){const t=this.state.phase;let n=v3[t];if(!n)return;if(n.next==="editing"&&this.config.editingDuration===0){const a=v3.editing;a&&(n=a)}this.stopPhaseTimer(),this.state.phase=n.next;const i=this.getDurationForPhase(n.next);i>0?(this.state.currentPhaseTimeRemaining=i,this.startPhaseTimer()):this.state.currentPhaseTimeRemaining=0,this.notifyChange()}completeInterview(){var t,n;this.stopGlobalTimer(),this.stopPhaseTimer(),this.state.phase="completed",(n=(t=this.callbacks).onInterviewEnd)==null||n.call(t),this.notifyChange()}destroy(){this.stopPhaseTimer(),this.stopGlobalTimer()}getDurationForPhase(t){switch(t){case"thinking":return this.config.thinkingDuration;case"answering":return this.config.answeringDuration;case"editing":return this.config.editingDuration;default:return 0}}startGlobalTimer(){this.globalIntervalId=setInterval(()=>{var t,n;this.state.totalTimeElapsed++,(n=(t=this.callbacks).onTick)==null||n.call(t,this.getState())},1e3)}stopGlobalTimer(){this.globalIntervalId&&(clearInterval(this.globalIntervalId),this.globalIntervalId=null)}startPhaseTimer(){this.phaseIntervalId=setInterval(()=>{this.state.currentPhaseTimeRemaining--,this.state.currentPhaseTimeRemaining<=0&&this.nextPhase()},1e3)}stopPhaseTimer(){this.phaseIntervalId&&(clearInterval(this.phaseIntervalId),this.phaseIntervalId=null)}notifyChange(){var t,n;(n=(t=this.callbacks).onPhaseChange)==null||n.call(t,this.state.phase,this.getState())}}function r6(e={}){const{config:t={},callbacks:n={}}=e,i=p.useRef(null);i.current||(i.current=new s6(t,{}));const a=i.current,[l,s]=p.useState(a.getState()),r=p.useCallback(()=>{s(a.getState())},[a]);p.useEffect(()=>{const h={onPhaseChange:(f,w)=>{var v;r(),(v=n.onPhaseChange)==null||v.call(n,f,w)},onTick:f=>{var w;r(),(w=n.onTick)==null||w.call(n,f)},onInterviewEnd:()=>{var f;r(),(f=n.onInterviewEnd)==null||f.call(n)}};a.callbacks=h},[a,n,r]),p.useEffect(()=>{a.updateConfig(t)},[a,t]),p.useEffect(()=>()=>{a.destroy()},[a]);const o=p.useCallback(()=>{a.startQuestion(),r()},[a,r]),c=p.useCallback(()=>{a.nextPhase(),r()},[a,r]),d=p.useCallback(()=>{a.completeInterview(),r()},[a,r]);return{state:l,startQuestion:o,nextPhase:c,completeInterview:d,timerService:a}}function o6(e,t={}){const[n,i]=p.useState({data:null,loading:!1,error:null}),a=p.useCallback(async(...l)=>{var s,r,o,c;i(d=>({...d,loading:!0,error:null}));try{const d=await e(...l);i(h=>({...h,data:d,loading:!1,error:null})),(s=t.onSuccess)==null||s.call(t,d),(r=t.onSettled)==null||r.call(t,d,null)}catch(d){const h=d.type?d:{type:"unknown",message:d.message||"Unknown error",retryable:!0,userMessage:"Something went wrong. Please try again.",originalError:d};i(f=>({...f,loading:!1,error:h})),(o=t.onError)==null||o.call(t,h),(c=t.onSettled)==null||c.call(t,null,h)}},[e,t]);return{...n,execute:a}}const u6=e=>{const[t,n]=p.useState(null),[i,a]=p.useState(!1),l=document,s=()=>!!(l.fullscreenEnabled||l.webkitFullscreenEnabled||l.mozFullScreenEnabled||l.msFullscreenEnabled),r=()=>l.fullscreenElement||l.webkitFullscreenElement||l.mozFullScreenElement||l.msFullscreenElement,o=async w=>{var v;try{if(!s())throw new Error("Fullscreen is not supported in this environment");w.requestFullscreen?await w.requestFullscreen():w.webkitRequestFullscreen?await w.webkitRequestFullscreen():w.mozRequestFullScreen?await w.mozRequestFullScreen():w.msRequestFullscreen&&await w.msRequestFullscreen()}catch(x){const _={name:"FullscreenError",message:x instanceof Error?x.message:"Failed to enter fullscreen"};n(_),(v=e==null?void 0:e.onError)==null||v.call(e,_)}},c=async()=>{var w;try{l.exitFullscreen?await l.exitFullscreen():l.webkitExitFullscreen?await l.webkitExitFullscreen():l.mozCancelFullScreen?await l.mozCancelFullScreen():l.msExitFullscreen&&await l.msExitFullscreen()}catch(v){const x={name:"FullscreenError",message:v instanceof Error?v.message:"Failed to exit fullscreen"};n(x),(w=e==null?void 0:e.onError)==null||w.call(e,x)}},d=p.useCallback(()=>{var v;const w=!!r();a(w),(v=e==null?void 0:e.onFullScreenChange)==null||v.call(e,w)},[e]);p.useEffect(()=>{const w=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];return w.forEach(v=>{document.addEventListener(v,d)}),()=>{w.forEach(v=>{document.removeEventListener(v,d)})}},[d]);const h=async w=>{n(null);const v=w??document.documentElement;await o(v)};return{isFullScreen:i,toggleFullScreen:async w=>{i?await c():await h(w)},enterFullScreen:h,exitFullScreen:c,error:t}};function b3(){const e=pr();return p.useMemo(()=>{const n=e.api||{};return new ch(n)},[e.api])}const c6=e=>{p.useEffect(()=>{const t=i=>{(i.ctrlKey||i.metaKey)&&["c","v","a","t","n","w","r","s","p"].includes(i.key.toLowerCase())&&(i.preventDefault(),e({type:"blocked_shortcut",severity:"low",details:{action:"shortcut_pressed",reason:`Attempted to use a blocked keyboard shortcut: Ctrl + ${i.key}`}})),i.key.startsWith("F")&&i.key.length<=3&&(i.preventDefault(),e({type:"blocked_function_key",severity:"low",details:{action:"function_key_pressed",reason:`Attempted to use a blocked function key: ${i.key}`}})),i.altKey&&i.key==="Tab"&&(i.preventDefault(),e({type:"alt_tab_attempt",severity:"medium",details:{action:"alt_tab",reason:"Attempted to use the Alt + Tab shortcut"}}))},n=i=>{i.preventDefault(),e({type:"right_click_attempt",severity:"low",details:{action:"right_click",reason:"Attempted to use the right click"}})};return document.addEventListener("keydown",t),document.addEventListener("contextmenu",n),()=>{document.removeEventListener("keydown",t),document.removeEventListener("contextmenu",n)}},[e])},f6=(e={})=>{const[t,n]=p.useState(!1),[i,a]=p.useState(!1),[l,s]=p.useState(null),[r,o]=p.useState(null),[c,d]=p.useState(null);e.config&&tl.updateConfig(e.config);const h=p.useCallback(async x=>{var _;try{o(null),s(null),d(null),await tl.startRecording(x,{onStart:()=>{var m;n(!0),(m=e.onStart)==null||m.call(e)},onStop:()=>{var m;n(!1),(m=e.onStop)==null||m.call(e)},onError:m=>{var y;const g=m instanceof Se?m:new Se(m.message,"RECORDING_ERROR",!0);o(g),n(!1),(y=e.onError)==null||y.call(e,g)}})}catch(m){const g=m instanceof Se?m:new Se(m instanceof Error?m.message:String(m),"START_FAILED",!1);throw o(g),n(!1),(_=e.onError)==null||_.call(e,g),g}},[]),f=p.useCallback(async()=>{var x,_;try{const m=await tl.stopRecording();return d(m),n(!1),(x=e.onStop)==null||x.call(e),m}catch(m){const g=m instanceof Se?m:new Se(m instanceof Error?m.message:String(m),"STOP_FAILED",!1);throw o(g),n(!1),(_=e.onError)==null||_.call(e,g),g}},[]),w=p.useCallback(async(x,_={})=>{var m,g;try{o(null),a(!0);const y={audioBlob:x,..._},b=await tl.transcribe(y);return s(b.transcript),a(!1),(m=e.onTranscriptionComplete)==null||m.call(e,b),b}catch(y){const b=y instanceof Se?y:new Se(y instanceof Error?y.message:String(y),"TRANSCRIPTION_FAILED",!0);throw o(b),a(!1),(g=e.onError)==null||g.call(e,b),b}},[]),v=p.useCallback(()=>{tl.cancelRecording(),n(!1),d(null)},[]);return{startRecording:h,stopRecording:f,transcribe:w,cancelRecording:v,isRecording:t,isTranscribing:i,transcript:l,error:r,audioBlob:c}},d6=e=>{const t=p.useRef(null),n=p.useRef(!1);p.useEffect(()=>{const i=()=>{document.hidden&&(n.current=!0,t.current&&(clearTimeout(t.current),t.current=null),e({type:"tab_switch",severity:"high",details:{action:"tab_hidden",reason:"Attempted to switch tabs or applications"}}),setTimeout(()=>{n.current=!1},100))},a=()=>{n.current||(t.current=setTimeout(()=>{n.current||e({type:"focus_loss",severity:"medium",details:{action:"window_blur",reason:"Focus lost from the interview window"}}),t.current=null},50))};return document.addEventListener("visibilitychange",i),window.addEventListener("blur",a),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",a),t.current&&clearTimeout(t.current)}},[e])},h6=()=>{p.useEffect(()=>{const e=document.createElement("style");return e.textContent=`
|
|
24
24
|
* {
|
|
25
25
|
-webkit-user-select: none !important;
|
|
26
26
|
-moz-user-select: none !important;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
-ms-user-select: text !important;
|
|
34
34
|
user-select: text !important;
|
|
35
35
|
}
|
|
36
|
-
`,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[])};class
|
|
36
|
+
`,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[])};class m6{constructor(){Bt(this,"currentAudio",null)}async play(t,n){var i,a;try{if(this.stop(),(i=n==null?void 0:n.onStart)==null||i.call(n),!t)throw new Error("No audio data provided");const l=window.atob(t),s=new Uint8Array(l==null?void 0:l.length);for(let c=0;c<(l==null?void 0:l.length);c++)s[c]=l==null?void 0:l.charCodeAt(c);const r=new Blob([s],{type:"audio/wav"}),o=URL.createObjectURL(r);return this.currentAudio=new Audio(o),new Promise((c,d)=>{if(!this.currentAudio){d(new Error("Audio element not created"));return}const h=this.currentAudio;h.onended=()=>{var f;URL.revokeObjectURL(o),this.currentAudio=null,(f=n==null?void 0:n.onEnd)==null||f.call(n),c()},h.onerror=f=>{var v;URL.revokeObjectURL(o),this.currentAudio=null;const w=new Error(`Audio playback failed: ${f}`);(v=n==null?void 0:n.onError)==null||v.call(n,w),d(w)},h.play().catch(f=>{var v;URL.revokeObjectURL(o),this.currentAudio=null;const w=new Error(`Failed to play audio: ${f.message}`);(v=n==null?void 0:n.onError)==null||v.call(n,w),d(w)})})}catch(l){const s=l instanceof Error?l:new Error(`TTS Error: ${String(l)}`);throw(a=n==null?void 0:n.onError)==null||a.call(n,s),s}}stop(){this.currentAudio&&(this.currentAudio.pause(),this.currentAudio.currentTime=0,this.currentAudio=null)}isPlaying(){return this.currentAudio!==null&&!this.currentAudio.paused}}const x3=new m6,w6=(e={})=>{const[t,n]=p.useState(!1),[i,a]=p.useState(!1),[l,s]=p.useState(null),r=p.useCallback(async c=>{var d;try{s(null),a(!0),await x3.play(c,{onStart:()=>{var h;a(!1),n(!0),(h=e.onStart)==null||h.call(e)},onEnd:()=>{var h;n(!1),(h=e.onEnd)==null||h.call(e)},onError:h=>{var f;n(!1),a(!1),s(h),(f=e.onError)==null||f.call(e,h)}})}catch(h){const f=h instanceof Error?h:new Error(String(h));throw s(f),n(!1),a(!1),(d=e.onError)==null||d.call(e,f),f}},[e]),o=p.useCallback(()=>{x3.stop(),n(!1),a(!1)},[]);return{speak:r,stop:o,isPlaying:t,isLoading:i,error:l}},g6=({onViolation:e,onEnd:t,maxViolations:n=5})=>{const{addViolation:i}=Fg(),a=Hg(),l=Vg(),s=p.useRef(l);p.useEffect(()=>{s.current=l},[l]);const r=p.useCallback(c=>{t&&t(c,s.current)},[t]);return{logViolation:p.useCallback(({type:c,severity:d,details:h})=>{const f={id:Kg(),type:c,severity:d,details:h,timestamp:Date.now()};i(f);const w=s.current+1;e&&e(f,w),w>=n&&r("excessive_violations")},[i,e,n,r]),onInterviewEnd:r,violationCount:l,logList:a}},p6=()=>{p.useEffect(()=>{function e(){console.clear(),console.log(`
|
|
37
37
|
%c
|
|
38
38
|
╔═══════════════════════════════════════════════════════════════════════╗
|
|
39
39
|
║ ║
|
|
@@ -79,7 +79,31 @@
|
|
|
79
79
|
│ │
|
|
80
80
|
│ 💡 IMMEDIATE ACTION REQUIRED: │
|
|
81
81
|
│ Close developer tools to continue interview │
|
|
82
|
-
└─────────────────────────────────────────────────────────────┘`,"color: #ffd93d; font-size: 14px; font-family: monospace; background: rgba(255, 217, 61, 0.1); padding: 10px;")}const t={open:!1,orientation:null},r=160,i=setInterval(()=>{window.outerHeight-window.innerHeight>r||window.outerWidth-window.innerWidth>r?t.open||(t.open=!0,t.orientation=window.outerWidth-window.innerWidth>r?"vertical":"horizontal",e()):t.open&&(t.open=!1,console.log("%c🌟 Developer tools closed. Interview continues smoothly! ✨","color: #4ecdc4; font-weight: bold; text-shadow: 0 0 10px #4ecdc4;"))},500),n=a=>{if(a.keyCode===123||a.ctrlKey&&a.shiftKey&&(a.keyCode===73||a.keyCode===74)||a.ctrlKey&&a.keyCode===85)return a.preventDefault(),console.log("%c🎭 Nice try! Keyboard shortcuts are disabled during interviews ✨","color: #ffd93d; font-weight: bold; text-shadow: 0 0 10px #ffd93d;"),!1},s=a=>(a.preventDefault(),console.log("%c🌈 Right-click menu disabled for interview integrity! 🎪","color: #ff9ff3; font-weight: bold; text-shadow: 0 0 10px #ff9ff3;"),!1);return document.addEventListener("keydown",n),document.addEventListener("contextmenu",s),()=>{clearInterval(i),document.removeEventListener("keydown",n),document.removeEventListener("contextmenu",s),delete window.showStats,delete window.interviewTips}},[])},hh=(e,t,r)=>Math.max(t,Math.min(r,e)),xl=e=>{const t=Math.max(0,Math.floor(e)),r=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${r}:${i}`},Hs=({total:e,remaining:t,size:r=64,strokeWidth:i=6,className:n="",showLabel:s=!0})=>{const a=Math.max(1,e||1),c=hh(t/a,0,1),{radius:l,circumference:u,dashOffset:h,center:f}=d.useMemo(()=>{const g=(r-i)/2,b=2*Math.PI*g,_=b*(1-c),p=Math.round(i)%2===1,A=r/2+(p?.5:0);return{radius:g,circumference:b,dashOffset:_,center:A}},[r,i,c]),w=d.useMemo(()=>c<=.25?"iw-stroke-red-500":c<=.5?"iw-stroke-yellow-500":"iw-stroke-green-500",[c]),m=c<=.25?"iw-animate-pulse":"";return o.jsxs("div",{className:`iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,style:{width:r,height:r},"aria-label":`Time remaining ${xl(t)}`,role:"timer","aria-live":"polite",children:[o.jsx("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,preserveAspectRatio:"xMidYMid meet",children:o.jsxs("g",{transform:`rotate(-90 ${f} ${f})`,children:[o.jsx("circle",{cx:f,cy:f,r:l,className:"iw-stroke-gray-200",strokeWidth:i,fill:"none",shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke"}),o.jsx("circle",{cx:f,cy:f,r:l,className:`${w} ${m}`,strokeWidth:i,strokeLinecap:"round",fill:"none",strokeDasharray:u,strokeDashoffset:h,shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke",style:{transition:"stroke-dashoffset 0.3s ease, stroke 0.2s ease"}})]})}),s&&o.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0",children:o.jsx("span",{className:`iw-text-[11px] iw-font-semibold iw-tabular-nums ${c<=.25?"iw-text-red-600":c<=.5?"iw-text-yellow-600":"iw-text-green-600"}`,children:xl(t)})})]})},fh=({label:e,error:t,fullWidth:r=!1,className:i="",id:n,...s})=>{const a=n||`textarea-${Math.random().toString(36).substring(2,9)}`,c="iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all",l=t?"iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500":"",u=r?"iw-w-full":"",h=i.includes("iw-h-full")||r?"iw-h-full":"";return o.jsxs("div",{className:`iw-h-full iw-flex iw-flex-col ${r?"iw-w-full":""}`,children:[e&&o.jsx("label",{htmlFor:a,className:"iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",children:e}),o.jsx("textarea",{id:a,className:`${c} ${l} ${u} ${h} ${i}`,"aria-invalid":t?"true":"false",...s}),t&&o.jsx("p",{className:"iw-mt-1 iw-text-sm iw-text-red-600",children:t})]})},wh=({value:e,onChange:t,onSubmit:r,isSubmitDisabled:i,state:n,editingTime:s})=>{const a=c=>{c.key==="Enter"&&(c.ctrlKey||c.metaKey)&&!i&&(c.preventDefault(),r())};return o.jsxs("div",{className:"iw-flex iw-flex-col iw-h-full ",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Your Answer"}),o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[o.jsx(ln,{className:"iw-size-4 iw-text-orange-600"}),o.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to edit: "})]}),o.jsx(Hs,{total:s,remaining:n.currentPhaseTimeRemaining,size:50,strokeWidth:4})]})]}),o.jsxs("div",{className:" iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2",children:[o.jsx(fh,{value:e,onChange:t,onKeyDown:a,placeholder:"Type your answer here...",className:" iw-w-full iw-h-full iw-flex-1 iw-resize-none !iw-p-4 iw-bg-transparent iw-min-h-full focus-visible:iw-outline-0",onPaste:c=>c.preventDefault(),onCopy:c=>c.preventDefault(),onCut:c=>c.preventDefault(),onDrop:c=>c.preventDefault(),onDragOver:c=>c.preventDefault(),disabled:n.phase===se.SUBMITTING}),o.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1 iw-mt-4",children:o.jsx(Qe,{onClick:r,disabled:i,className:n.phase===se.SUBMITTING?"iw-opacity-75":"",children:n.phase===se.SUBMITTING?"Submitting...":"Submit Answer"})})]})]})},mh=({question:e,isLoading:t=!1})=>{const{baseColor:r}=rr();return o.jsx("div",{className:"iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",style:Gl(r,.85),children:o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-8",children:[o.jsx("div",{className:"iw-flex iw-flex-col iw-items-center iw-relative iw-h-32 iw-w-32 iw-shrink-0 iw-shadow iw-rounded-lg iw-bg-white",children:o.jsx("div",{className:"iw-mt-2",children:o.jsx("img",{src:"https://duf9q5sx7u.ufs.sh/f/va7H6eSeKAux755zByRN5Nq9LZurgIoJGYX6c0CEdRSDm8y2",alt:"brand_logo",className:"iw-h-28 iw-w-28"})})}),t?o.jsxs("div",{className:"iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10",children:[o.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full"}),o.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4"})]}):o.jsx("p",{className:"iw-text-lg iw-leading-8",children:e==null?void 0:e.question})]})})},yl=({currentQuestion:e,phase:t,className:r="",children:i,interviewId:n="",interview_duration:s=ti,videoFeedRef:a})=>o.jsxs("div",{className:`iw-p-4 iw-space-y-4 iw-pb-6 ${r} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,children:[o.jsx("div",{className:"iw-flex iw-items-start iw-justify-between iw-gap-3",children:o.jsx("div",{className:"iw-flex-1",children:o.jsx(mh,{question:e,isLoading:t===se.FETCHING_QUESTION||t===se.IDLE})})}),o.jsxs("div",{className:"iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6",children:[o.jsx("div",{className:"iw-min-h-[400px] iw-max-h-[600px]",children:o.jsx(gl,{ref:a,interviewId:n,interview_duration:s})}),o.jsx("div",{className:"iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6",children:i})]})]}),gh=({confirmExitInterview:e,isOpen:t,onClose:r})=>o.jsx(ii,{isOpen:t,onClose:r,title:"Exit Interview",closeOnOverlayClick:!1,children:o.jsxs("div",{className:"iw-space-y-5",children:[o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3 iw-rounded-xl iw-p-2",children:[o.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-bg-rose-100 iw-text-rose-600",children:"!"}),o.jsxs("div",{className:"iw-space-y-2",children:[o.jsx("p",{className:"iw-text-sm iw-font-semibold iw-text-rose-600",children:"Leaving now will end your interview !"}),o.jsx("p",{className:"iw-text-sm iw-text-slate-500",children:"Are you sure you want to exit? All progress will be lost and you will not be able to resume."})]})]}),o.jsxs("div",{className:"iw-flex iw-flex-col-reverse iw-gap-2 sm:iw-flex-row sm:iw-items-center sm:iw-justify-end iw-pb-1",children:[o.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-border iw-border-slate-200 iw-bg-white iw-px-4 iw-py-2 iw-text-sm iw-font-medium iw-text-slate-600 iw-shadow-sm iw-transition hover:iw-bg-slate-50",onClick:r,children:"Stay in interview"}),o.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-px-4 iw-py-2 iw-text-sm iw-font-semibold iw-text-white iw-transition hover:iw-brightness-110",style:{background:"linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))",boxShadow:"0 12px 30px -16px rgba(244, 63, 94, 0.65)"},onClick:e,children:"Confirm exit"})]})]})}),bl=({title:e,brandName:t,onExit:r})=>{const{baseColor:i}=rr(),[n,s]=d.useState(!1);return o.jsxs("header",{className:"iw-w-full iw-text-gray-900",children:[o.jsxs("div",{className:"iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-pb-4 iw-pt-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-space-x-2",children:[o.jsx("div",{className:"iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",style:{backgroundColor:i},children:zl(t)}),o.jsx("p",{className:"iw-text-sm iw-font-medium",children:t})]}),o.jsx("h1",{className:"iw-text-base iw-font-bold",children:e}),o.jsx("button",{className:"iw-text-sm iw-text-white iw-px-4 iw-py-2 iw-rounded-md",style:{background:"linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))"},onClick:()=>s(!0),children:"Exit Interview"})]}),o.jsx("div",{className:"iw-h-px iw-bg-gray-200"}),o.jsx(gh,{isOpen:n,confirmExitInterview:()=>{r(),s(!1)},onClose:()=>s(!1)})]})},ph=({className:e="",width:t,height:r=56,barWidth:i=3,gap:n=2,fftSize:s=1024,smoothingTimeConstant:a=.8,mediaStream:c,startOnMount:l=!0})=>{const{baseColor:u}=rr(),h=d.useRef(null),f=d.useRef(null),w=d.useRef(null),m=d.useRef(null),g=d.useRef(null),b=d.useRef(null),_=d.useRef(!1),[p,A]=d.useState(null);d.useEffect(()=>{if(t||!f.current)return;const T=f.current,C=()=>{const B=h.current;if(!B)return;const G=T.clientWidth,Q=r;B.width=Math.max(1,Math.floor(G*window.devicePixelRatio||1)),B.height=Math.max(1,Math.floor(Q*window.devicePixelRatio||1))},M=new ResizeObserver(C);return M.observe(T),C(),()=>M.disconnect()},[t,r]),d.useEffect(()=>{if(!t)return;const T=h.current;T&&(T.width=Math.max(1,Math.floor(t*(window.devicePixelRatio||1))),T.height=Math.max(1,Math.floor(r*(window.devicePixelRatio||1))))},[t,r]),d.useEffect(()=>{let T=!1;return(async()=>{try{const M=new(window.AudioContext||window.webkitAudioContext);w.current=M;let B=c;if(!B){if(!l)return;B=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),_.current=!0}if(T)return;const G=M.createAnalyser();G.fftSize=s,G.smoothingTimeConstant=a,m.current=G;const Q=M.createMediaStreamSource(B);g.current=Q,Q.connect(G),F()}catch(M){A((M==null?void 0:M.message)||"Failed to initialize microphone")}})(),()=>{var M,B,G,Q;T=!0,b.current&&cancelAnimationFrame(b.current);try{(M=g.current)==null||M.disconnect()}catch{}try{(B=m.current)==null||B.disconnect()}catch{}_.current&&((Q=((G=g.current)==null?void 0:G.mediaStream)||void 0)==null||Q.getTracks().forEach(oe=>oe.stop())),w.current&&w.current.state!=="closed"&&w.current.close()}},[c,s,a,l]);const F=()=>{const T=h.current,C=m.current;if(!T||!C)return;const M=T.getContext("2d");if(!M)return;const B=window.devicePixelRatio||1,G=T.width,Q=T.height,oe=C.frequencyBinCount,qe=new Uint8Array(oe),de=()=>{b.current=requestAnimationFrame(de),C.getByteTimeDomainData(qe),M.clearRect(0,0,G,Q),M.fillStyle="rgba(0,0,0,0)",M.fillRect(0,0,G,Q);const Ye=Math.max(1,Math.floor(i*B)),Te=Math.max(1,Math.floor(n*B)),be=Ye+Te,kt=Math.max(8,Math.floor((G+Te)/be)),dt=Math.floor(qe.length/kt);for(let ge=0;ge<kt;ge++){const Qt=Math.min(qe.length-1,ge*dt),Ke=qe[Qt]/128-1,re=Math.abs(Ke),Xe=Math.pow(re,.6),V=Math.max(Q*.06,Xe*(Q*.9)),ht=ge*be,j=(Q-V)/2,J=140-Math.min(140,140*re),Dt=85,Rt=48+Math.floor(12*(1-re));M.fillStyle=`${u}`,M.shadowColor=`hsla(${J}, ${Dt}%, ${Rt}%, ${.25*re})`,M.shadowBlur=8*re;const Jt=Math.min(Ye/2,V/2);xh(M,ht,j,Ye,V,Jt),M.fill()}};de()};return o.jsxs("div",{ref:f,className:`iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${e}`,style:{height:r},children:[o.jsx("canvas",{ref:h,className:"iw-w-full iw-h-full"}),p&&o.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center",children:o.jsx("span",{className:"iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded",children:p})})]})};function xh(e,t,r,i,n,s){const a=Math.min(s,i/2,n/2);e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+i-a,r),e.quadraticCurveTo(t+i,r,t+i,r+a),e.lineTo(t+i,r+n-a),e.quadraticCurveTo(t+i,r+n,t+i-a,r+n),e.lineTo(t+a,r+n),e.quadraticCurveTo(t,r+n,t,r+n-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}const yh=({state:e,answeringTime:t,nextPhase:r,sttError:i})=>o.jsxs("div",{className:"iw-flex iw-flex-col iw-justify-between iw-h-full ",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"You may start speaking now. We're listening...."}),o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[o.jsx(ln,{className:"iw-size-4 iw-text-orange-600"}),o.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to talk: "})]}),o.jsx(Hs,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]})]}),o.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"Done talking? Click the button to review your answer."})]}),o.jsxs("div",{children:[o.jsx(ph,{}),i&&o.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Recording error: ",i.message]})]}),o.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:o.jsx(Qe,{onClick:()=>{r()},children:"Transcribe My Answer"})})]});function bh(){const[e,t]=d.useState(!0),r=d.useMemo(()=>[0,1,2].map(i=>({id:i})),[]);return d.useEffect(()=>{const i=setInterval(()=>{t(n=>!n)},1500);return()=>clearInterval(i)},[]),o.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full",children:[o.jsx("div",{className:"iw-relative iw-w-80 iw-h-48 ","aria-hidden":!0,children:r.map((i,n)=>{const s=n*50,a=e?s:s+12,c=e?1:.08,l=n*140;return o.jsx("div",{role:"presentation",className:"iw-absolute iw-w-full iw-rounded-lg iw-p-4 iw-shadow-md iw-bg-gradient-to-b iw-from-gray-50 iw-to-gray-100 iw-overflow-hidden",style:{top:0,transform:`translateY(${a}px)`,opacity:c,transition:`transform 600ms cubic-bezier(.2,.9,.3,1) ${l}ms, opacity 400ms ease ${l}ms`},children:o.jsxs("div",{className:"iw-flex iw-gap-3 iw-items-center",children:[o.jsx("div",{className:"iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0"}),o.jsxs("div",{className:"iw-flex-1 iw-space-y-2",children:[o.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-24"}),o.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-32"})]})]})},i.id)})}),o.jsx("div",{className:"iw-text-center",children:o.jsx("p",{className:"iw-text-gray-500 iw-font-medium",children:"Preparing your question..."})})]})}const vh=({size:e="192px",className:t,colors:r,animationDuration:i=20})=>{const s={...{bg:"oklch(95% 0.02 264.695)",c1:"oklch(75% 0.15 350)",c2:"oklch(80% 0.12 200)",c3:"oklch(78% 0.14 280)"},...r},a=parseInt(e.replace("px",""),10),c=a<50?Math.max(a*.008,1):Math.max(a*.015,4),l=a<50?Math.max(a*.004,1.2):Math.max(a*.008,1.5),u=a<50?Math.max(a*.004,.05):Math.max(a*.008,.1),h=a<50?Math.max(a*.004,.5):Math.max(a*.008,2),f=a<30?"0%":a<50?"5%":a<100?"15%":"25%",w=a<30?1.1:a<50?Math.max(l*1.2,1.3):l;return o.jsx("div",{className:`siri-orb ${t}`,style:{width:e,height:e,"--bg":s.bg,"--c1":s.c1,"--c2":s.c2,"--c3":s.c3,"--animation-duration":`${i}s`,"--blur-amount":`${c}px`,"--contrast-amount":w,"--dot-size":`${u}px`,"--shadow-spread":`${h}px`,"--mask-radius":f},children:o.jsx("style",{children:`
|
|
82
|
+
└─────────────────────────────────────────────────────────────┘`,"color: #ffd93d; font-size: 14px; font-family: monospace; background: rgba(255, 217, 61, 0.1); padding: 10px;")}const t={open:!1,orientation:null},n=160,i=setInterval(()=>{window.outerHeight-window.innerHeight>n||window.outerWidth-window.innerWidth>n?t.open||(t.open=!0,t.orientation=window.outerWidth-window.innerWidth>n?"vertical":"horizontal",e()):t.open&&(t.open=!1,console.log("%c🌟 Developer tools closed. Interview continues smoothly! ✨","color: #4ecdc4; font-weight: bold; text-shadow: 0 0 10px #4ecdc4;"))},500),a=s=>{if(s.keyCode===123||s.ctrlKey&&s.shiftKey&&(s.keyCode===73||s.keyCode===74)||s.ctrlKey&&s.keyCode===85)return s.preventDefault(),console.log("%c🎭 Nice try! Keyboard shortcuts are disabled during interviews ✨","color: #ffd93d; font-weight: bold; text-shadow: 0 0 10px #ffd93d;"),!1},l=s=>(s.preventDefault(),console.log("%c🌈 Right-click menu disabled for interview integrity! 🎪","color: #ff9ff3; font-weight: bold; text-shadow: 0 0 10px #ff9ff3;"),!1);return document.addEventListener("keydown",a),document.addEventListener("contextmenu",l),()=>{clearInterval(i),document.removeEventListener("keydown",a),document.removeEventListener("contextmenu",l),delete window.showStats,delete window.interviewTips}},[])};var E3={exports:{}},mo={},S3={exports:{}},_3={};/**
|
|
83
|
+
* @license React
|
|
84
|
+
* scheduler.production.js
|
|
85
|
+
*
|
|
86
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the MIT license found in the
|
|
89
|
+
* LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/(function(e){function t(j,B){var R=j.length;j.push(B);e:for(;0<R;){var J=R-1>>>1,ae=j[J];if(0<a(ae,B))j[J]=B,j[R]=ae,R=J;else break e}}function n(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var B=j[0],R=j.pop();if(R!==B){j[0]=R;e:for(var J=0,ae=j.length,st=ae>>>1;J<st;){var gn=2*(J+1)-1,sn=j[gn],Rt=gn+1,rt=j[Rt];if(0>a(sn,R))Rt<ae&&0>a(rt,sn)?(j[J]=rt,j[Rt]=R,J=Rt):(j[J]=sn,j[gn]=R,J=gn);else if(Rt<ae&&0>a(rt,R))j[J]=rt,j[Rt]=R,J=Rt;else break e}}return B}function a(j,B){var R=j.sortIndex-B.sortIndex;return R!==0?R:j.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,r=s.now();e.unstable_now=function(){return s.now()-r}}var o=[],c=[],d=1,h=null,f=3,w=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;function y(j){for(var B=n(c);B!==null;){if(B.callback===null)i(c);else if(B.startTime<=j)i(c),B.sortIndex=B.expirationTime,t(o,B);else break;B=n(c)}}function b(j){if(x=!1,y(j),!v)if(n(o)!==null)v=!0,yt();else{var B=n(c);B!==null&&vt(b,B.startTime-j)}}var S=!1,A=-1,T=5,N=-1;function M(){return!(e.unstable_now()-N<T)}function D(){if(S){var j=e.unstable_now();N=j;var B=!0;try{e:{v=!1,x&&(x=!1,m(A),A=-1),w=!0;var R=f;try{t:{for(y(j),h=n(o);h!==null&&!(h.expirationTime>j&&M());){var J=h.callback;if(typeof J=="function"){h.callback=null,f=h.priorityLevel;var ae=J(h.expirationTime<=j);if(j=e.unstable_now(),typeof ae=="function"){h.callback=ae,y(j),B=!0;break t}h===n(o)&&i(o),y(j)}else i(o);h=n(o)}if(h!==null)B=!0;else{var st=n(c);st!==null&&vt(b,st.startTime-j),B=!1}}break e}finally{h=null,f=R,w=!1}B=void 0}}finally{B?ge():S=!1}}}var ge;if(typeof g=="function")ge=function(){g(D)};else if(typeof MessageChannel<"u"){var et=new MessageChannel,pt=et.port2;et.port1.onmessage=D,ge=function(){pt.postMessage(null)}}else ge=function(){_(D,0)};function yt(){S||(S=!0,ge())}function vt(j,B){A=_(function(){j(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){v||w||(v=!0,yt())},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(o)},e.unstable_next=function(j){switch(f){case 1:case 2:case 3:var B=3;break;default:B=f}var R=f;f=B;try{return j()}finally{f=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,B){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var R=f;f=j;try{return B()}finally{f=R}},e.unstable_scheduleCallback=function(j,B,R){var J=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?J+R:J):R=J,j){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=R+ae,j={id:d++,callback:B,priorityLevel:j,startTime:R,expirationTime:ae,sortIndex:-1},R>J?(j.sortIndex=R,t(c,j),n(o)===null&&j===n(c)&&(x?(m(A),A=-1):x=!0,vt(b,R-J))):(j.sortIndex=ae,t(o,j),v||w||(v=!0,yt())),j},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(j){var B=f;return function(){var R=f;f=B;try{return j.apply(this,arguments)}finally{f=R}}}})(_3),S3.exports=_3;var y6=S3.exports;/**
|
|
91
|
+
* @license React
|
|
92
|
+
* react-dom-client.production.js
|
|
93
|
+
*
|
|
94
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the MIT license found in the
|
|
97
|
+
* LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/var Be=y6,T3=p,v6=Zi;function E(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function A3(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}var b6=Symbol.for("react.element"),wo=Symbol.for("react.transitional.element"),cs=Symbol.for("react.portal"),nl=Symbol.for("react.fragment"),N3=Symbol.for("react.strict_mode"),Cf=Symbol.for("react.profiler"),x6=Symbol.for("react.provider"),j3=Symbol.for("react.consumer"),Fn=Symbol.for("react.context"),Df=Symbol.for("react.forward_ref"),kf=Symbol.for("react.suspense"),Of=Symbol.for("react.suspense_list"),Lf=Symbol.for("react.memo"),xi=Symbol.for("react.lazy"),M3=Symbol.for("react.offscreen"),E6=Symbol.for("react.memo_cache_sentinel"),C3=Symbol.iterator;function fs(e){return e===null||typeof e!="object"?null:(e=C3&&e[C3]||e["@@iterator"],typeof e=="function"?e:null)}var S6=Symbol.for("react.client.reference");function Uf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===S6?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case nl:return"Fragment";case cs:return"Portal";case Cf:return"Profiler";case N3:return"StrictMode";case kf:return"Suspense";case Of:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Fn:return(e.displayName||"Context")+".Provider";case j3:return(e._context.displayName||"Context")+".Consumer";case Df:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Lf:return t=e.displayName||null,t!==null?t:Uf(e.type)||"Memo";case xi:t=e._payload,e=e._init;try{return Uf(e(t))}catch{}}return null}var G=T3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=Object.assign,zf,D3;function ds(e){if(zf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zf=t&&t[1]||"",D3=-1<n.stack.indexOf(`
|
|
99
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
100
|
+
`+zf+e+D3}var Rf=!1;function Bf(e,t){if(!e||Rf)return"";Rf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(w){var f=w}Reflect.construct(e,[],h)}else{try{h.call()}catch(w){f=w}e.call(h.prototype)}}else{try{throw Error()}catch(w){f=w}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(w){if(w&&f&&typeof w.stack=="string")return[w.stack,f.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=i.DetermineComponentFrameRoot(),s=l[0],r=l[1];if(s&&r){var o=s.split(`
|
|
101
|
+
`),c=r.split(`
|
|
102
|
+
`);for(a=i=0;i<o.length&&!o[i].includes("DetermineComponentFrameRoot");)i++;for(;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;if(i===o.length||a===c.length)for(i=o.length-1,a=c.length-1;1<=i&&0<=a&&o[i]!==c[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==c[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==c[a]){var d=`
|
|
103
|
+
`+o[i].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=i&&0<=a);break}}}finally{Rf=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ds(n):""}function _6(e){switch(e.tag){case 26:case 27:case 5:return ds(e.type);case 16:return ds("Lazy");case 13:return ds("Suspense");case 19:return ds("SuspenseList");case 0:case 15:return e=Bf(e.type,!1),e;case 11:return e=Bf(e.type.render,!1),e;case 1:return e=Bf(e.type,!0),e;default:return""}}function k3(e){try{var t="";do t+=_6(e),e=e.return;while(e);return t}catch(n){return`
|
|
104
|
+
Error generating stack: `+n.message+`
|
|
105
|
+
`+n.stack}}function il(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function O3(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function L3(e){if(il(e)!==e)throw Error(E(188))}function T6(e){var t=e.alternate;if(!t){if(t=il(e),t===null)throw Error(E(188));return t!==e?null:e}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var l=a.alternate;if(l===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===l.child){for(l=a.child;l;){if(l===n)return L3(a),e;if(l===i)return L3(a),t;l=l.sibling}throw Error(E(188))}if(n.return!==i.return)n=a,i=l;else{for(var s=!1,r=a.child;r;){if(r===n){s=!0,n=a,i=l;break}if(r===i){s=!0,i=a,n=l;break}r=r.sibling}if(!s){for(r=l.child;r;){if(r===n){s=!0,n=l,i=a;break}if(r===i){s=!0,i=l,n=a;break}r=r.sibling}if(!s)throw Error(E(189))}}if(n.alternate!==i)throw Error(E(190))}if(n.tag!==3)throw Error(E(188));return n.stateNode.current===n?e:t}function U3(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=U3(e),t!==null)return t;e=e.sibling}return null}var hs=Array.isArray,fe=v6.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ia={pending:!1,data:null,method:null,action:null},Gf=[],al=-1;function Tn(e){return{current:e}}function qe(e){0>al||(e.current=Gf[al],Gf[al]=null,al--)}function we(e,t){al++,Gf[al]=e.current,e.current=t}var An=Tn(null),ms=Tn(null),Ei=Tn(null),go=Tn(null);function po(e,t){switch(we(Ei,t),we(ms,e),we(An,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?Zw(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=Zw(e),t=Kw(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}qe(An),we(An,t)}function ll(){qe(An),qe(ms),qe(Ei)}function Hf(e){e.memoizedState!==null&&we(go,e);var t=An.current,n=Kw(t,e.type);t!==n&&(we(ms,e),we(An,n))}function yo(e){ms.current===e&&(qe(An),qe(ms)),go.current===e&&(qe(go),sr._currentValue=ia)}var Vf=Object.prototype.hasOwnProperty,Ff=Be.unstable_scheduleCallback,qf=Be.unstable_cancelCallback,A6=Be.unstable_shouldYield,N6=Be.unstable_requestPaint,Nn=Be.unstable_now,j6=Be.unstable_getCurrentPriorityLevel,z3=Be.unstable_ImmediatePriority,R3=Be.unstable_UserBlockingPriority,vo=Be.unstable_NormalPriority,M6=Be.unstable_LowPriority,B3=Be.unstable_IdlePriority,C6=Be.log,D6=Be.unstable_setDisableYieldValue,ws=null,Ct=null;function k6(e){if(Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(ws,e,void 0,(e.current.flags&128)===128)}catch{}}function Si(e){if(typeof C6=="function"&&D6(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(ws,e)}catch{}}var Dt=Math.clz32?Math.clz32:U6,O6=Math.log,L6=Math.LN2;function U6(e){return e>>>=0,e===0?32:31-(O6(e)/L6|0)|0}var bo=128,xo=4194304;function aa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Eo(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,a=e.suspendedLanes,l=e.pingedLanes,s=e.warmLanes;e=e.finishedLanes!==0;var r=n&134217727;return r!==0?(n=r&~a,n!==0?i=aa(n):(l&=r,l!==0?i=aa(l):e||(s=r&~s,s!==0&&(i=aa(s))))):(r=n&~a,r!==0?i=aa(r):l!==0?i=aa(l):e||(s=n&~s,s!==0&&(i=aa(s)))),i===0?0:t!==0&&t!==i&&!(t&a)&&(a=i&-i,s=t&-t,a>=s||a===32&&(s&4194176)!==0)?t:i}function gs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function z6(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function G3(){var e=bo;return bo<<=1,!(bo&4194176)&&(bo=128),e}function H3(){var e=xo;return xo<<=1,!(xo&62914560)&&(xo=4194304),e}function Yf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ps(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function R6(e,t,n,i,a,l){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var r=e.entanglements,o=e.expirationTimes,c=e.hiddenUpdates;for(n=s&~n;0<n;){var d=31-Dt(n),h=1<<d;r[d]=0,o[d]=-1;var f=c[d];if(f!==null)for(c[d]=null,d=0;d<f.length;d++){var w=f[d];w!==null&&(w.lane&=-536870913)}n&=~h}i!==0&&V3(e,i,0),l!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=l&~(s&~t))}function V3(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Dt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&4194218}function F3(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Dt(n),a=1<<i;a&t|e[i]&t&&(e[i]|=t),n&=~a}}function q3(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Y3(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:dg(e.type))}function B6(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var _i=Math.random().toString(36).slice(2),Pe="__reactFiber$"+_i,mt="__reactProps$"+_i,sl="__reactContainer$"+_i,Xf="__reactEvents$"+_i,G6="__reactListeners$"+_i,H6="__reactHandles$"+_i,X3="__reactResources$"+_i,ys="__reactMarker$"+_i;function Qf(e){delete e[Pe],delete e[mt],delete e[Xf],delete e[G6],delete e[H6]}function la(e){var t=e[Pe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[sl]||n[Pe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jw(e);e!==null;){if(n=e[Pe])return n;e=Jw(e)}return t}e=n,n=e.parentNode}return null}function rl(e){if(e=e[Pe]||e[sl]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function vs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(E(33))}function ol(e){var t=e[X3];return t||(t=e[X3]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ye(e){e[ys]=!0}var Q3=new Set,Z3={};function sa(e,t){ul(e,t),ul(e+"Capture",t)}function ul(e,t){for(Z3[e]=t,e=0;e<t.length;e++)Q3.add(t[e])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V6=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),K3={},I3={};function F6(e){return Vf.call(I3,e)?!0:Vf.call(K3,e)?!1:V6.test(e)?I3[e]=!0:(K3[e]=!0,!1)}function So(e,t,n){if(F6(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function _o(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Yn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function Zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function W3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function q6(e){var t=W3(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){i=""+s,l.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function To(e){e._valueTracker||(e._valueTracker=q6(e))}function J3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=W3(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Ao(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Y6=/[\n"\\]/g;function Kt(e){return e.replace(Y6,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zf(e,t,n,i,a,l,s,r){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?Kf(e,s,Zt(t)):n!=null?Kf(e,s,Zt(n)):i!=null&&e.removeAttribute("value"),a==null&&l!=null&&(e.defaultChecked=!!l),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.name=""+Zt(r):e.removeAttribute("name")}function P3(e,t,n,i,a,l,s,r){if(l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.type=l),t!=null||n!=null){if(!(l!=="submit"&&l!=="reset"||t!=null))return;n=n!=null?""+Zt(n):"",t=t!=null?""+Zt(t):n,r||t===e.value||(e.value=t),e.defaultValue=t}i=i??a,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=r?e.checked:!!i,e.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s)}function Kf(e,t,n){t==="number"&&Ao(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function cl(e,t,n,i){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&i&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function $3(e,t,n){if(t!=null&&(t=""+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Zt(n):""}function e4(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(E(92));if(hs(i)){if(1<i.length)throw Error(E(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Zt(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i)}function fl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var X6=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function t4(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||X6.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function n4(e,t,n){if(t!=null&&typeof t!="object")throw Error(E(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var a in t)i=t[a],t.hasOwnProperty(a)&&n[a]!==i&&t4(e,a,i)}else for(var l in t)t.hasOwnProperty(l)&&t4(e,l,t[l])}function If(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Q6=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Z6=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function No(e){return Z6.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Wf=null;function Jf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dl=null,hl=null;function i4(e){var t=rl(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zf(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Kt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=i[mt]||null;if(!a)throw Error(E(90));Zf(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&J3(i)}break e;case"textarea":$3(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&cl(e,!!n.multiple,t,!1)}}}var Pf=!1;function a4(e,t,n){if(Pf)return e(t,n);Pf=!0;try{var i=e(t);return i}finally{if(Pf=!1,(dl!==null||hl!==null)&&(cu(),dl&&(t=dl,e=hl,hl=dl=null,i4(t),e)))for(t=0;t<e.length;t++)i4(e[t])}}function bs(e,t){var n=e.stateNode;if(n===null)return null;var i=n[mt]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(E(231,t,typeof n));return n}var $f=!1;if(qn)try{var xs={};Object.defineProperty(xs,"passive",{get:function(){$f=!0}}),window.addEventListener("test",xs,xs),window.removeEventListener("test",xs,xs)}catch{$f=!1}var Ti=null,ed=null,jo=null;function l4(){if(jo)return jo;var e,t=ed,n=t.length,i,a="value"in Ti?Ti.value:Ti.textContent,l=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(i=1;i<=s&&t[n-i]===a[l-i];i++);return jo=a.slice(e,1<i?1-i:void 0)}function Mo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Co(){return!0}function s4(){return!1}function wt(e){function t(n,i,a,l,s){this._reactName=n,this._targetInst=a,this.type=i,this.nativeEvent=l,this.target=s,this.currentTarget=null;for(var r in e)e.hasOwnProperty(r)&&(n=e[r],this[r]=n?n(l):l[r]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Co:s4,this.isPropagationStopped=s4,this}return ce(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Co)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Co)},persist:function(){},isPersistent:Co}),t}var ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Do=wt(ra),Es=ce({},ra,{view:0,detail:0}),K6=wt(Es),td,nd,Ss,ko=ce({},Es,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ad,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ss&&(Ss&&e.type==="mousemove"?(td=e.screenX-Ss.screenX,nd=e.screenY-Ss.screenY):nd=td=0,Ss=e),td)},movementY:function(e){return"movementY"in e?e.movementY:nd}}),r4=wt(ko),I6=ce({},ko,{dataTransfer:0}),W6=wt(I6),J6=ce({},Es,{relatedTarget:0}),id=wt(J6),P6=ce({},ra,{animationName:0,elapsedTime:0,pseudoElement:0}),$6=wt(P6),ey=ce({},ra,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ty=wt(ey),ny=ce({},ra,{data:0}),o4=wt(ny),iy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ay={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ly={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ly[e])?!!t[e]:!1}function ad(){return sy}var ry=ce({},Es,{key:function(e){if(e.key){var t=iy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ay[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ad,charCode:function(e){return e.type==="keypress"?Mo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),oy=wt(ry),uy=ce({},ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),u4=wt(uy),cy=ce({},Es,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ad}),fy=wt(cy),dy=ce({},ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),hy=wt(dy),my=ce({},ko,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wy=wt(my),gy=ce({},ra,{newState:0,oldState:0}),py=wt(gy),yy=[9,13,27,32],ld=qn&&"CompositionEvent"in window,_s=null;qn&&"documentMode"in document&&(_s=document.documentMode);var vy=qn&&"TextEvent"in window&&!_s,c4=qn&&(!ld||_s&&8<_s&&11>=_s),f4=" ",d4=!1;function h4(e,t){switch(e){case"keyup":return yy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m4(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ml=!1;function by(e,t){switch(e){case"compositionend":return m4(t);case"keypress":return t.which!==32?null:(d4=!0,f4);case"textInput":return e=t.data,e===f4&&d4?null:e;default:return null}}function xy(e,t){if(ml)return e==="compositionend"||!ld&&h4(e,t)?(e=l4(),jo=ed=Ti=null,ml=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return c4&&t.locale!=="ko"?null:t.data;default:return null}}var Ey={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function w4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ey[e.type]:t==="textarea"}function g4(e,t,n,i){dl?hl?hl.push(i):hl=[i]:dl=i,t=wu(t,"onChange"),0<t.length&&(n=new Do("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Ts=null,As=null;function Sy(e){Fw(e,0)}function Oo(e){var t=vs(e);if(J3(t))return e}function p4(e,t){if(e==="change")return t}var y4=!1;if(qn){var sd;if(qn){var rd="oninput"in document;if(!rd){var v4=document.createElement("div");v4.setAttribute("oninput","return;"),rd=typeof v4.oninput=="function"}sd=rd}else sd=!1;y4=sd&&(!document.documentMode||9<document.documentMode)}function b4(){Ts&&(Ts.detachEvent("onpropertychange",x4),As=Ts=null)}function x4(e){if(e.propertyName==="value"&&Oo(As)){var t=[];g4(t,As,e,Jf(e)),a4(Sy,t)}}function _y(e,t,n){e==="focusin"?(b4(),Ts=t,As=n,Ts.attachEvent("onpropertychange",x4)):e==="focusout"&&b4()}function Ty(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oo(As)}function Ay(e,t){if(e==="click")return Oo(t)}function Ny(e,t){if(e==="input"||e==="change")return Oo(t)}function jy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:jy;function Ns(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var a=n[i];if(!Vf.call(t,a)||!kt(e[a],t[a]))return!1}return!0}function E4(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function S4(e,t){var n=E4(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=E4(n)}}function _4(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_4(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function T4(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ao(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ao(e.document)}return t}function od(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function My(e,t){var n=T4(t);t=e.focusedElem;var i=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&_4(t.ownerDocument.documentElement,t)){if(i!==null&&od(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var a=t.textContent.length,l=Math.min(i.start,a);i=i.end===void 0?l:Math.min(i.end,a),!n.extend&&l>i&&(a=i,i=l,l=a),a=S4(t,l);var s=S4(t,i);a&&s&&(n.rangeCount!==1||n.anchorNode!==a.node||n.anchorOffset!==a.offset||n.focusNode!==s.node||n.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),n.removeAllRanges(),l>i?(n.addRange(e),n.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var Cy=qn&&"documentMode"in document&&11>=document.documentMode,wl=null,ud=null,js=null,cd=!1;function A4(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cd||wl==null||wl!==Ao(i)||(i=wl,"selectionStart"in i&&od(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),js&&Ns(js,i)||(js=i,i=wu(ud,"onSelect"),0<i.length&&(t=new Do("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=wl)))}function oa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var gl={animationend:oa("Animation","AnimationEnd"),animationiteration:oa("Animation","AnimationIteration"),animationstart:oa("Animation","AnimationStart"),transitionrun:oa("Transition","TransitionRun"),transitionstart:oa("Transition","TransitionStart"),transitioncancel:oa("Transition","TransitionCancel"),transitionend:oa("Transition","TransitionEnd")},fd={},N4={};qn&&(N4=document.createElement("div").style,"AnimationEvent"in window||(delete gl.animationend.animation,delete gl.animationiteration.animation,delete gl.animationstart.animation),"TransitionEvent"in window||delete gl.transitionend.transition);function ua(e){if(fd[e])return fd[e];if(!gl[e])return e;var t=gl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in N4)return fd[e]=t[n];return e}var j4=ua("animationend"),M4=ua("animationiteration"),C4=ua("animationstart"),Dy=ua("transitionrun"),ky=ua("transitionstart"),Oy=ua("transitioncancel"),D4=ua("transitionend"),k4=new Map,O4="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function dn(e,t){k4.set(e,t),sa(t,[e])}var It=[],pl=0,dd=0;function Lo(){for(var e=pl,t=dd=pl=0;t<e;){var n=It[t];It[t++]=null;var i=It[t];It[t++]=null;var a=It[t];It[t++]=null;var l=It[t];if(It[t++]=null,i!==null&&a!==null){var s=i.pending;s===null?a.next=a:(a.next=s.next,s.next=a),i.pending=a}l!==0&&L4(n,a,l)}}function Uo(e,t,n,i){It[pl++]=e,It[pl++]=t,It[pl++]=n,It[pl++]=i,dd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function hd(e,t,n,i){return Uo(e,t,n,i),zo(e)}function Ai(e,t){return Uo(e,null,null,t),zo(e)}function L4(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var a=!1,l=e.return;l!==null;)l.childLanes|=n,i=l.alternate,i!==null&&(i.childLanes|=n),l.tag===22&&(e=l.stateNode,e===null||e._visibility&1||(a=!0)),e=l,l=l.return;a&&t!==null&&e.tag===3&&(l=e.stateNode,a=31-Dt(n),l=l.hiddenUpdates,e=l[a],e===null?l[a]=[t]:e.push(t),t.lane=n|536870912)}function zo(e){if(50<$s)throw $s=0,v2=null,Error(E(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var yl={},U4=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var n=U4.get(e);return n!==void 0?n:(t={value:e,source:t,stack:k3(t)},U4.set(e,t),t)}return{value:e,source:t,stack:k3(t)}}var vl=[],bl=0,Ro=null,Bo=0,Jt=[],Pt=0,ca=null,Xn=1,Qn="";function fa(e,t){vl[bl++]=Bo,vl[bl++]=Ro,Ro=e,Bo=t}function z4(e,t,n){Jt[Pt++]=Xn,Jt[Pt++]=Qn,Jt[Pt++]=ca,ca=e;var i=Xn;e=Qn;var a=32-Dt(i)-1;i&=~(1<<a),n+=1;var l=32-Dt(t)+a;if(30<l){var s=a-a%5;l=(i&(1<<s)-1).toString(32),i>>=s,a-=s,Xn=1<<32-Dt(t)+a|n<<a|i,Qn=l+e}else Xn=1<<l|n<<a|i,Qn=e}function md(e){e.return!==null&&(fa(e,1),z4(e,1,0))}function wd(e){for(;e===Ro;)Ro=vl[--bl],vl[bl]=null,Bo=vl[--bl],vl[bl]=null;for(;e===ca;)ca=Jt[--Pt],Jt[Pt]=null,Qn=Jt[--Pt],Jt[Pt]=null,Xn=Jt[--Pt],Jt[Pt]=null}var at=null,Ze=null,W=!1,hn=null,jn=!1,gd=Error(E(519));function da(e){var t=Error(E(418,""));throw Ds(Wt(t,e)),gd}function R4(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[Pe]=e,t[mt]=i,n){case"dialog":X("cancel",t),X("close",t);break;case"iframe":case"object":case"embed":X("load",t);break;case"video":case"audio":for(n=0;n<tr.length;n++)X(tr[n],t);break;case"source":X("error",t);break;case"img":case"image":case"link":X("error",t),X("load",t);break;case"details":X("toggle",t);break;case"input":X("invalid",t),P3(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),To(t);break;case"select":X("invalid",t);break;case"textarea":X("invalid",t),e4(t,i.value,i.defaultValue,i.children),To(t)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||Qw(t.textContent,n)?(i.popover!=null&&(X("beforetoggle",t),X("toggle",t)),i.onScroll!=null&&X("scroll",t),i.onScrollEnd!=null&&X("scrollend",t),i.onClick!=null&&(t.onclick=gu),t=!0):t=!1,t||da(e)}function B4(e){for(at=e.return;at;)switch(at.tag){case 3:case 27:jn=!0;return;case 5:case 13:jn=!1;return;default:at=at.return}}function Ms(e){if(e!==at)return!1;if(!W)return B4(e),W=!0,!1;var t=!1,n;if((n=e.tag!==3&&e.tag!==27)&&((n=e.tag===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||z2(e.type,e.memoizedProps)),n=!n),n&&(t=!0),t&&Ze&&da(e),B4(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){Ze=wn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}Ze=null}}else Ze=at?wn(e.stateNode.nextSibling):null;return!0}function Cs(){Ze=at=null,W=!1}function Ds(e){hn===null?hn=[e]:hn.push(e)}var ks=Error(E(460)),G4=Error(E(474)),pd={then:function(){}};function H4(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Go(){}function V4(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Go,Go),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===ks?Error(E(483)):e;default:if(typeof t.status=="string")t.then(Go,Go);else{if(e=re,e!==null&&100<e.shellSuspendCounter)throw Error(E(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=i}},function(i){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===ks?Error(E(483)):e}throw Os=t,ks}}var Os=null;function F4(){if(Os===null)throw Error(E(459));var e=Os;return Os=null,e}var xl=null,Ls=0;function Ho(e){var t=Ls;return Ls+=1,xl===null&&(xl=[]),V4(xl,e,t)}function Us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Vo(e,t){throw t.$$typeof===b6?Error(E(525)):(e=Object.prototype.toString.call(t),Error(E(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function q4(e){var t=e._init;return t(e._payload)}function Y4(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.push(g)}}function n(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function i(m){for(var g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function a(m,g){return m=Bi(m,g),m.index=0,m.sibling=null,m}function l(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=33554434,g):y):(m.flags|=33554434,g)):(m.flags|=1048576,g)}function s(m){return e&&m.alternate===null&&(m.flags|=33554434),m}function r(m,g,y,b){return g===null||g.tag!==6?(g=f2(y,m.mode,b),g.return=m,g):(g=a(g,y),g.return=m,g)}function o(m,g,y,b){var S=y.type;return S===nl?d(m,g,y.props.children,b,y.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===xi&&q4(S)===g.type)?(g=a(g,y.props),Us(g,y),g.return=m,g):(g=lu(y.type,y.key,y.props,null,m.mode,b),Us(g,y),g.return=m,g)}function c(m,g,y,b){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=d2(y,m.mode,b),g.return=m,g):(g=a(g,y.children||[]),g.return=m,g)}function d(m,g,y,b,S){return g===null||g.tag!==7?(g=Ea(y,m.mode,b,S),g.return=m,g):(g=a(g,y),g.return=m,g)}function h(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=f2(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case wo:return y=lu(g.type,g.key,g.props,null,m.mode,y),Us(y,g),y.return=m,y;case cs:return g=d2(g,m.mode,y),g.return=m,g;case xi:var b=g._init;return g=b(g._payload),h(m,g,y)}if(hs(g)||fs(g))return g=Ea(g,m.mode,y,null),g.return=m,g;if(typeof g.then=="function")return h(m,Ho(g),y);if(g.$$typeof===Fn)return h(m,nu(m,g),y);Vo(m,g)}return null}function f(m,g,y,b){var S=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return S!==null?null:r(m,g,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case wo:return y.key===S?o(m,g,y,b):null;case cs:return y.key===S?c(m,g,y,b):null;case xi:return S=y._init,y=S(y._payload),f(m,g,y,b)}if(hs(y)||fs(y))return S!==null?null:d(m,g,y,b,null);if(typeof y.then=="function")return f(m,g,Ho(y),b);if(y.$$typeof===Fn)return f(m,g,nu(m,y),b);Vo(m,y)}return null}function w(m,g,y,b,S){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return m=m.get(y)||null,r(g,m,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case wo:return m=m.get(b.key===null?y:b.key)||null,o(g,m,b,S);case cs:return m=m.get(b.key===null?y:b.key)||null,c(g,m,b,S);case xi:var A=b._init;return b=A(b._payload),w(m,g,y,b,S)}if(hs(b)||fs(b))return m=m.get(y)||null,d(g,m,b,S,null);if(typeof b.then=="function")return w(m,g,y,Ho(b),S);if(b.$$typeof===Fn)return w(m,g,y,nu(g,b),S);Vo(g,b)}return null}function v(m,g,y,b){for(var S=null,A=null,T=g,N=g=0,M=null;T!==null&&N<y.length;N++){T.index>N?(M=T,T=null):M=T.sibling;var D=f(m,T,y[N],b);if(D===null){T===null&&(T=M);break}e&&T&&D.alternate===null&&t(m,T),g=l(D,g,N),A===null?S=D:A.sibling=D,A=D,T=M}if(N===y.length)return n(m,T),W&&fa(m,N),S;if(T===null){for(;N<y.length;N++)T=h(m,y[N],b),T!==null&&(g=l(T,g,N),A===null?S=T:A.sibling=T,A=T);return W&&fa(m,N),S}for(T=i(T);N<y.length;N++)M=w(T,m,N,y[N],b),M!==null&&(e&&M.alternate!==null&&T.delete(M.key===null?N:M.key),g=l(M,g,N),A===null?S=M:A.sibling=M,A=M);return e&&T.forEach(function(ge){return t(m,ge)}),W&&fa(m,N),S}function x(m,g,y,b){if(y==null)throw Error(E(151));for(var S=null,A=null,T=g,N=g=0,M=null,D=y.next();T!==null&&!D.done;N++,D=y.next()){T.index>N?(M=T,T=null):M=T.sibling;var ge=f(m,T,D.value,b);if(ge===null){T===null&&(T=M);break}e&&T&&ge.alternate===null&&t(m,T),g=l(ge,g,N),A===null?S=ge:A.sibling=ge,A=ge,T=M}if(D.done)return n(m,T),W&&fa(m,N),S;if(T===null){for(;!D.done;N++,D=y.next())D=h(m,D.value,b),D!==null&&(g=l(D,g,N),A===null?S=D:A.sibling=D,A=D);return W&&fa(m,N),S}for(T=i(T);!D.done;N++,D=y.next())D=w(T,m,N,D.value,b),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?N:D.key),g=l(D,g,N),A===null?S=D:A.sibling=D,A=D);return e&&T.forEach(function(et){return t(m,et)}),W&&fa(m,N),S}function _(m,g,y,b){if(typeof y=="object"&&y!==null&&y.type===nl&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case wo:e:{for(var S=y.key;g!==null;){if(g.key===S){if(S=y.type,S===nl){if(g.tag===7){n(m,g.sibling),b=a(g,y.props.children),b.return=m,m=b;break e}}else if(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===xi&&q4(S)===g.type){n(m,g.sibling),b=a(g,y.props),Us(b,y),b.return=m,m=b;break e}n(m,g);break}else t(m,g);g=g.sibling}y.type===nl?(b=Ea(y.props.children,m.mode,b,y.key),b.return=m,m=b):(b=lu(y.type,y.key,y.props,null,m.mode,b),Us(b,y),b.return=m,m=b)}return s(m);case cs:e:{for(S=y.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(m,g.sibling),b=a(g,y.children||[]),b.return=m,m=b;break e}else{n(m,g);break}else t(m,g);g=g.sibling}b=d2(y,m.mode,b),b.return=m,m=b}return s(m);case xi:return S=y._init,y=S(y._payload),_(m,g,y,b)}if(hs(y))return v(m,g,y,b);if(fs(y)){if(S=fs(y),typeof S!="function")throw Error(E(150));return y=S.call(y),x(m,g,y,b)}if(typeof y.then=="function")return _(m,g,Ho(y),b);if(y.$$typeof===Fn)return _(m,g,nu(m,y),b);Vo(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,g!==null&&g.tag===6?(n(m,g.sibling),b=a(g,y),b.return=m,m=b):(n(m,g),b=f2(y,m.mode,b),b.return=m,m=b),s(m)):n(m,g)}return function(m,g,y,b){try{Ls=0;var S=_(m,g,y,b);return xl=null,S}catch(T){if(T===ks)throw T;var A=nn(29,T,null,m.mode);return A.lanes=b,A.return=m,A}finally{}}}var ha=Y4(!0),X4=Y4(!1),El=Tn(null),Fo=Tn(0);function Q4(e,t){e=ii,we(Fo,e),we(El,t),ii=e|t.baseLanes}function yd(){we(Fo,ii),we(El,El.current)}function vd(){ii=Fo.current,qe(El),qe(Fo)}var $t=Tn(null),Mn=null;function Ni(e){var t=e.alternate;we(Ge,Ge.current&1),we($t,e),Mn===null&&(t===null||El.current!==null||t.memoizedState!==null)&&(Mn=e)}function Z4(e){if(e.tag===22){if(we(Ge,Ge.current),we($t,e),Mn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Mn=e)}}else ji()}function ji(){we(Ge,Ge.current),we($t,$t.current)}function Zn(e){qe($t),Mn===e&&(Mn=null),qe(Ge)}var Ge=Tn(0);function qo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ly=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Uy=Be.unstable_scheduleCallback,zy=Be.unstable_NormalPriority,He={$$typeof:Fn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bd(){return{controller:new Ly,data:new Map,refCount:0}}function zs(e){e.refCount--,e.refCount===0&&Uy(zy,function(){e.controller.abort()})}var Rs=null,xd=0,Sl=0,_l=null;function Ry(e,t){if(Rs===null){var n=Rs=[];xd=0,Sl=N2(),_l={status:"pending",value:void 0,then:function(i){n.push(i)}}}return xd++,t.then(K4,K4),t}function K4(){if(--xd===0&&Rs!==null){_l!==null&&(_l.status="fulfilled");var e=Rs;Rs=null,Sl=0,_l=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function By(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(i.status="rejected",i.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),i}var I4=G.S;G.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ry(e,t),I4!==null&&I4(e,t)};var ma=Tn(null);function Ed(){var e=ma.current;return e!==null?e:re.pooledCache}function Yo(e,t){t===null?we(ma,ma.current):we(ma,t.pool)}function W4(){var e=Ed();return e===null?null:{parent:He._currentValue,pool:e}}var Mi=0,V=null,ee=null,Le=null,Xo=!1,Tl=!1,wa=!1,Qo=0,Bs=0,Al=null,Gy=0;function Me(){throw Error(E(321))}function Sd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function _d(e,t,n,i,a,l){return Mi=l,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?ga:Ci,wa=!1,l=n(i,a),wa=!1,Tl&&(l=P4(t,n,i,a)),J4(e),l}function J4(e){G.H=Cn;var t=ee!==null&&ee.next!==null;if(Mi=0,Le=ee=V=null,Xo=!1,Bs=0,Al=null,t)throw Error(E(300));e===null||Xe||(e=e.dependencies,e!==null&&tu(e)&&(Xe=!0))}function P4(e,t,n,i){V=e;var a=0;do{if(Tl&&(Al=null),Bs=0,Tl=!1,25<=a)throw Error(E(301));if(a+=1,Le=ee=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}G.H=pa,l=t(n,i)}while(Tl);return l}function Hy(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(ee!==null?ee.memoizedState:null)!==e&&(V.flags|=1024),t}function Td(){var e=Qo!==0;return Qo=0,e}function Ad(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Nd(e){if(Xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xo=!1}Mi=0,Le=ee=V=null,Tl=!1,Bs=Qo=0,Al=null}function gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?V.memoizedState=Le=e:Le=Le.next=e,Le}function Ue(){if(ee===null){var e=V.alternate;e=e!==null?e.memoizedState:null}else e=ee.next;var t=Le===null?V.memoizedState:Le.next;if(t!==null)Le=t,ee=e;else{if(e===null)throw V.alternate===null?Error(E(467)):Error(E(310));ee=e,e={memoizedState:ee.memoizedState,baseState:ee.baseState,baseQueue:ee.baseQueue,queue:ee.queue,next:null},Le===null?V.memoizedState=Le=e:Le=Le.next=e}return Le}var Zo;Zo=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function Gs(e){var t=Bs;return Bs+=1,Al===null&&(Al=[]),e=V4(Al,e,t),t=V,(Le===null?t.memoizedState:Le.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?ga:Ci),e}function Ko(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===Fn)return $e(e)}throw Error(E(438,String(e)))}function jd(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=V.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Zo(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=E6;return t.index++,n}function Kn(e,t){return typeof t=="function"?t(e):t}function Io(e){var t=Ue();return Md(t,ee,e)}function Md(e,t,n){var i=e.queue;if(i===null)throw Error(E(311));i.lastRenderedReducer=n;var a=e.baseQueue,l=i.pending;if(l!==null){if(a!==null){var s=a.next;a.next=l.next,l.next=s}t.baseQueue=a=l,i.pending=null}if(l=e.baseState,a===null)e.memoizedState=l;else{t=a.next;var r=s=null,o=null,c=t,d=!1;do{var h=c.lane&-536870913;if(h!==c.lane?(Q&h)===h:(Mi&h)===h){var f=c.revertLane;if(f===0)o!==null&&(o=o.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),h===Sl&&(d=!0);else if((Mi&f)===f){c=c.next,f===Sl&&(d=!0);continue}else h={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},o===null?(r=o=h,s=l):o=o.next=h,V.lanes|=f,Gi|=f;h=c.action,wa&&n(l,h),l=c.hasEagerState?c.eagerState:n(l,h)}else f={lane:h,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},o===null?(r=o=f,s=l):o=o.next=f,V.lanes|=h,Gi|=h;c=c.next}while(c!==null&&c!==t);if(o===null?s=l:o.next=r,!kt(l,e.memoizedState)&&(Xe=!0,d&&(n=_l,n!==null)))throw n;e.memoizedState=l,e.baseState=s,e.baseQueue=o,i.lastRenderedState=l}return a===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Cd(e){var t=Ue(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,l=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do l=e(l,s.action),s=s.next;while(s!==a);kt(l,t.memoizedState)||(Xe=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,i]}function $4(e,t,n){var i=V,a=Ue(),l=W;if(l){if(n===void 0)throw Error(E(407));n=n()}else n=t();var s=!kt((ee||a).memoizedState,n);if(s&&(a.memoizedState=n,Xe=!0),a=a.queue,Od(nm.bind(null,i,a,e),[e]),a.getSnapshot!==t||s||Le!==null&&Le.memoizedState.tag&1){if(i.flags|=2048,Nl(9,tm.bind(null,i,a,n,t),{destroy:void 0},null),re===null)throw Error(E(349));l||Mi&60||em(i,t,n)}return n}function em(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=Zo(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tm(e,t,n,i){t.value=n,t.getSnapshot=i,im(t)&&am(e)}function nm(e,t,n){return n(function(){im(t)&&am(e)})}function im(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function am(e){var t=Ai(e,2);t!==null&<(t,e,2)}function Dd(e){var t=gt();if(typeof e=="function"){var n=e;if(e=n(),wa){Si(!0);try{n()}finally{Si(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},t}function lm(e,t,n,i){return e.baseState=n,Md(e,ee,typeof i=="function"?i:Kn)}function Vy(e,t,n,i,a){if(Po(e))throw Error(E(485));if(e=t.action,e!==null){var l={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){l.listeners.push(s)}};G.T!==null?n(!0):l.isTransition=!1,i(l),n=t.pending,n===null?(l.next=t.pending=l,sm(t,l)):(l.next=n.next,t.pending=n.next=l)}}function sm(e,t){var n=t.action,i=t.payload,a=e.state;if(t.isTransition){var l=G.T,s={};G.T=s;try{var r=n(a,i),o=G.S;o!==null&&o(s,r),rm(e,t,r)}catch(c){kd(e,t,c)}finally{G.T=l}}else try{l=n(a,i),rm(e,t,l)}catch(c){kd(e,t,c)}}function rm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){om(e,t,i)},function(i){return kd(e,t,i)}):om(e,t,n)}function om(e,t,n){t.status="fulfilled",t.value=n,um(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sm(e,n)))}function kd(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,um(t),t=t.next;while(t!==i)}e.action=null}function um(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cm(e,t){return t}function fm(e,t){if(W){var n=re.formState;if(n!==null){e:{var i=V;if(W){if(Ze){t:{for(var a=Ze,l=jn;a.nodeType!==8;){if(!l){a=null;break t}if(a=wn(a.nextSibling),a===null){a=null;break t}}l=a.data,a=l==="F!"||l==="F"?a:null}if(a){Ze=wn(a.nextSibling),i=a.data==="F!";break e}}da(i)}i=!1}i&&(t=n[0])}}return n=gt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cm,lastRenderedState:t},n.queue=i,n=Mm.bind(null,V,i),i.dispatch=n,i=Dd(!1),l=Bd.bind(null,V,!1,i.queue),i=gt(),a={state:t,dispatch:null,action:e,pending:null},i.queue=a,n=Vy.bind(null,V,a,l,n),a.dispatch=n,i.memoizedState=e,[t,n,!1]}function dm(e){var t=Ue();return hm(t,ee,e)}function hm(e,t,n){t=Md(e,t,cm)[0],e=Io(Kn)[0],t=typeof t=="object"&&t!==null&&typeof t.then=="function"?Gs(t):t;var i=Ue(),a=i.queue,l=a.dispatch;return n!==i.memoizedState&&(V.flags|=2048,Nl(9,Fy.bind(null,a,n),{destroy:void 0},null)),[t,l,e]}function Fy(e,t){e.action=t}function mm(e){var t=Ue(),n=ee;if(n!==null)return hm(t,n,e);Ue(),t=t.memoizedState,n=Ue();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function Nl(e,t,n,i){return e={tag:e,create:t,inst:n,deps:i,next:null},t=V.updateQueue,t===null&&(t=Zo(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function wm(){return Ue().memoizedState}function Wo(e,t,n,i){var a=gt();V.flags|=e,a.memoizedState=Nl(1|t,n,{destroy:void 0},i===void 0?null:i)}function Jo(e,t,n,i){var a=Ue();i=i===void 0?null:i;var l=a.memoizedState.inst;ee!==null&&i!==null&&Sd(i,ee.memoizedState.deps)?a.memoizedState=Nl(t,n,l,i):(V.flags|=e,a.memoizedState=Nl(1|t,n,l,i))}function gm(e,t){Wo(8390656,8,e,t)}function Od(e,t){Jo(2048,8,e,t)}function pm(e,t){return Jo(4,2,e,t)}function ym(e,t){return Jo(4,4,e,t)}function vm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bm(e,t,n){n=n!=null?n.concat([e]):null,Jo(4,4,vm.bind(null,t,e),n)}function Ld(){}function xm(e,t){var n=Ue();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Sd(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Em(e,t){var n=Ue();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Sd(t,i[1]))return i[0];if(i=e(),wa){Si(!0);try{e()}finally{Si(!1)}}return n.memoizedState=[i,t],i}function Ud(e,t,n){return n===void 0||Mi&1073741824?e.memoizedState=t:(e.memoizedState=n,e=_w(),V.lanes|=e,Gi|=e,n)}function Sm(e,t,n,i){return kt(n,t)?n:El.current!==null?(e=Ud(e,n,i),kt(e,t)||(Xe=!0),e):Mi&42?(e=_w(),V.lanes|=e,Gi|=e,t):(Xe=!0,e.memoizedState=n)}function _m(e,t,n,i,a){var l=fe.p;fe.p=l!==0&&8>l?l:8;var s=G.T,r={};G.T=r,Bd(e,!1,t,n);try{var o=a(),c=G.S;if(c!==null&&c(r,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var d=By(o,i);Hs(e,t,d,zt(e))}else Hs(e,t,i,zt(e))}catch(h){Hs(e,t,{then:function(){},status:"rejected",reason:h},zt())}finally{fe.p=l,G.T=s}}function qy(){}function zd(e,t,n,i){if(e.tag!==5)throw Error(E(476));var a=Tm(e).queue;_m(e,a,t,ia,n===null?qy:function(){return Am(e),n(i)})}function Tm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ia,baseState:ia,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:ia},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Am(e){var t=Tm(e).next.queue;Hs(e,t,{},zt())}function Rd(){return $e(sr)}function Nm(){return Ue().memoizedState}function jm(){return Ue().memoizedState}function Yy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=zt();e=Oi(n);var i=Li(t,e,n);i!==null&&(lt(i,t,n),qs(i,t,n)),t={cache:bd()},e.payload=t;return}t=t.return}}function Xy(e,t,n){var i=zt();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Po(e)?Cm(t,n):(n=hd(e,t,n,i),n!==null&&(lt(n,e,i),Dm(n,t,i)))}function Mm(e,t,n){var i=zt();Hs(e,t,n,i)}function Hs(e,t,n,i){var a={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Po(e))Cm(t,a);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var s=t.lastRenderedState,r=l(s,n);if(a.hasEagerState=!0,a.eagerState=r,kt(r,s))return Uo(e,t,a,0),re===null&&Lo(),!1}catch{}finally{}if(n=hd(e,t,a,i),n!==null)return lt(n,e,i),Dm(n,t,i),!0}return!1}function Bd(e,t,n,i){if(i={lane:2,revertLane:N2(),action:i,hasEagerState:!1,eagerState:null,next:null},Po(e)){if(t)throw Error(E(479))}else t=hd(e,n,i,2),t!==null&<(t,e,2)}function Po(e){var t=e.alternate;return e===V||t!==null&&t===V}function Cm(e,t){Tl=Xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Dm(e,t,n){if(n&4194176){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,F3(e,n)}}var Cn={readContext:$e,use:Ko,useCallback:Me,useContext:Me,useEffect:Me,useImperativeHandle:Me,useLayoutEffect:Me,useInsertionEffect:Me,useMemo:Me,useReducer:Me,useRef:Me,useState:Me,useDebugValue:Me,useDeferredValue:Me,useTransition:Me,useSyncExternalStore:Me,useId:Me};Cn.useCacheRefresh=Me,Cn.useMemoCache=Me,Cn.useHostTransitionStatus=Me,Cn.useFormState=Me,Cn.useActionState=Me,Cn.useOptimistic=Me;var ga={readContext:$e,use:Ko,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:gm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Wo(4194308,4,vm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wo(4194308,4,e,t)},useInsertionEffect:function(e,t){Wo(4,2,e,t)},useMemo:function(e,t){var n=gt();t=t===void 0?null:t;var i=e();if(wa){Si(!0);try{e()}finally{Si(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=gt();if(n!==void 0){var a=n(t);if(wa){Si(!0);try{n(t)}finally{Si(!1)}}}else a=t;return i.memoizedState=i.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},i.queue=e,e=e.dispatch=Xy.bind(null,V,e),[i.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:function(e){e=Dd(e);var t=e.queue,n=Mm.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ld,useDeferredValue:function(e,t){var n=gt();return Ud(n,e,t)},useTransition:function(){var e=Dd(!1);return e=_m.bind(null,V,e.queue,!0,!1),gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=V,a=gt();if(W){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),re===null)throw Error(E(349));Q&60||em(i,t,n)}a.memoizedState=n;var l={value:n,getSnapshot:t};return a.queue=l,gm(nm.bind(null,i,l,e),[e]),i.flags|=2048,Nl(9,tm.bind(null,i,l,n,t),{destroy:void 0},null),n},useId:function(){var e=gt(),t=re.identifierPrefix;if(W){var n=Qn,i=Xn;n=(i&~(1<<32-Dt(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Qo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Gy++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return gt().memoizedState=Yy.bind(null,V)}};ga.useMemoCache=jd,ga.useHostTransitionStatus=Rd,ga.useFormState=fm,ga.useActionState=fm,ga.useOptimistic=function(e){var t=gt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bd.bind(null,V,!0,n),n.dispatch=t,[e,t]};var Ci={readContext:$e,use:Ko,useCallback:xm,useContext:$e,useEffect:Od,useImperativeHandle:bm,useInsertionEffect:pm,useLayoutEffect:ym,useMemo:Em,useReducer:Io,useRef:wm,useState:function(){return Io(Kn)},useDebugValue:Ld,useDeferredValue:function(e,t){var n=Ue();return Sm(n,ee.memoizedState,e,t)},useTransition:function(){var e=Io(Kn)[0],t=Ue().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:$4,useId:Nm};Ci.useCacheRefresh=jm,Ci.useMemoCache=jd,Ci.useHostTransitionStatus=Rd,Ci.useFormState=dm,Ci.useActionState=dm,Ci.useOptimistic=function(e,t){var n=Ue();return lm(n,ee,e,t)};var pa={readContext:$e,use:Ko,useCallback:xm,useContext:$e,useEffect:Od,useImperativeHandle:bm,useInsertionEffect:pm,useLayoutEffect:ym,useMemo:Em,useReducer:Cd,useRef:wm,useState:function(){return Cd(Kn)},useDebugValue:Ld,useDeferredValue:function(e,t){var n=Ue();return ee===null?Ud(n,e,t):Sm(n,ee.memoizedState,e,t)},useTransition:function(){var e=Cd(Kn)[0],t=Ue().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:$4,useId:Nm};pa.useCacheRefresh=jm,pa.useMemoCache=jd,pa.useHostTransitionStatus=Rd,pa.useFormState=mm,pa.useActionState=mm,pa.useOptimistic=function(e,t){var n=Ue();return ee!==null?lm(n,ee,e,t):(n.baseState=e,[e,n.queue.dispatch])};function Gd(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:ce({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hd={isMounted:function(e){return(e=e._reactInternals)?il(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=zt(),a=Oi(i);a.payload=t,n!=null&&(a.callback=n),t=Li(e,a,i),t!==null&&(lt(t,e,i),qs(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=zt(),a=Oi(i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Li(e,a,i),t!==null&&(lt(t,e,i),qs(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),i=Oi(n);i.tag=2,t!=null&&(i.callback=t),t=Li(e,i,n),t!==null&&(lt(t,e,n),qs(t,e,n))}};function km(e,t,n,i,a,l,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,l,s):t.prototype&&t.prototype.isPureReactComponent?!Ns(n,i)||!Ns(a,l):!0}function Om(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Hd.enqueueReplaceState(t,t.state,null)}function ya(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=ce({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}var $o=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Lm(e){$o(e)}function Um(e){console.error(e)}function zm(e){$o(e)}function eu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Rm(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Vd(e,t,n){return n=Oi(n),n.tag=3,n.payload={element:null},n.callback=function(){eu(e,t)},n}function Bm(e){return e=Oi(e),e.tag=3,e}function Gm(e,t,n,i){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var l=i.value;e.payload=function(){return a(l)},e.callback=function(){Rm(t,n,i)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Rm(t,n,i),typeof a!="function"&&(Hi===null?Hi=new Set([this]):Hi.add(this));var r=i.stack;this.componentDidCatch(i.value,{componentStack:r!==null?r:""})})}function Qy(e,t,n,i,a){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&Fs(t,n,a,!0),n=$t.current,n!==null){switch(n.tag){case 13:return Mn===null?E2():n.alternate===null&&Te===0&&(Te=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===pd?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),_2(e,i,a)),!1;case 22:return n.flags|=65536,i===pd?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),_2(e,i,a)),!1}throw Error(E(435,n.tag))}return _2(e,i,a),E2(),!1}if(W)return t=$t.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==gd&&(e=Error(E(422),{cause:i}),Ds(Wt(e,n)))):(i!==gd&&(t=Error(E(423),{cause:i}),Ds(Wt(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,i=Wt(i,n),a=Vd(e.stateNode,i,a),n2(e,a),Te!==4&&(Te=2)),!1;var l=Error(E(520),{cause:i});if(l=Wt(l,n),Js===null?Js=[l]:Js.push(l),Te!==4&&(Te=2),t===null)return!0;i=Wt(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Vd(n.stateNode,i,e),n2(n,e),!1;case 1:if(t=n.type,l=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(Hi===null||!Hi.has(l))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Bm(a),Gm(a,e,n,i),n2(n,a),!1}n=n.return}while(n!==null);return!1}var Hm=Error(E(461)),Xe=!1;function Ke(e,t,n,i){t.child=e===null?X4(t,null,n,i):ha(t,e.child,n,i)}function Vm(e,t,n,i,a){n=n.render;var l=t.ref;if("ref"in i){var s={};for(var r in i)r!=="ref"&&(s[r]=i[r])}else s=i;return ba(t),i=_d(e,t,n,s,l,a),r=Td(),e!==null&&!Xe?(Ad(e,t,a),In(e,t,a)):(W&&r&&md(t),t.flags|=1,Ke(e,t,i,a),t.child)}function Fm(e,t,n,i,a){if(e===null){var l=n.type;return typeof l=="function"&&!c2(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,qm(e,t,l,i,a)):(e=lu(n.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!Wd(e,a)){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:Ns,n(s,i)&&e.ref===t.ref)return In(e,t,a)}return t.flags|=1,e=Bi(l,i),e.ref=t.ref,e.return=t,t.child=e}function qm(e,t,n,i,a){if(e!==null){var l=e.memoizedProps;if(Ns(l,i)&&e.ref===t.ref)if(Xe=!1,t.pendingProps=i=l,Wd(e,a))e.flags&131072&&(Xe=!0);else return t.lanes=e.lanes,In(e,t,a)}return Fd(e,t,n,i,a)}function Ym(e,t,n){var i=t.pendingProps,a=i.children,l=(t.stateNode._pendingVisibility&2)!==0,s=e!==null?e.memoizedState:null;if(Vs(e,t),i.mode==="hidden"||l){if(t.flags&128){if(i=s!==null?s.baseLanes|n:n,e!==null){for(a=t.child=e.child,l=0;a!==null;)l=l|a.lanes|a.childLanes,a=a.sibling;t.childLanes=l&~i}else t.childLanes=0,t.child=null;return Xm(e,t,i,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yo(t,s!==null?s.cachePool:null),s!==null?Q4(t,s):yd(),Z4(t);else return t.lanes=t.childLanes=536870912,Xm(e,t,s!==null?s.baseLanes|n:n,n)}else s!==null?(Yo(t,s.cachePool),Q4(t,s),ji(),t.memoizedState=null):(e!==null&&Yo(t,null),yd(),ji());return Ke(e,t,a,n),t.child}function Xm(e,t,n,i){var a=Ed();return a=a===null?null:{parent:He._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Yo(t,null),yd(),Z4(t),e!==null&&Fs(e,t,i,!0),null}function Vs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=2097664);else{if(typeof n!="function"&&typeof n!="object")throw Error(E(284));(e===null||e.ref!==n)&&(t.flags|=2097664)}}function Fd(e,t,n,i,a){return ba(t),n=_d(e,t,n,i,void 0,a),i=Td(),e!==null&&!Xe?(Ad(e,t,a),In(e,t,a)):(W&&i&&md(t),t.flags|=1,Ke(e,t,n,a),t.child)}function Qm(e,t,n,i,a,l){return ba(t),t.updateQueue=null,n=P4(t,i,n,a),J4(e),i=Td(),e!==null&&!Xe?(Ad(e,t,l),In(e,t,l)):(W&&i&&md(t),t.flags|=1,Ke(e,t,n,l),t.child)}function Zm(e,t,n,i,a){if(ba(t),t.stateNode===null){var l=yl,s=n.contextType;typeof s=="object"&&s!==null&&(l=$e(s)),l=new n(i,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Hd,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=i,l.state=t.memoizedState,l.refs={},e2(t),s=n.contextType,l.context=typeof s=="object"&&s!==null?$e(s):yl,l.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Gd(t,n,s,i),l.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(s=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),s!==l.state&&Hd.enqueueReplaceState(l,l.state,null),Xs(t,i,l,a),Ys(),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){l=t.stateNode;var r=t.memoizedProps,o=ya(n,r);l.props=o;var c=l.context,d=n.contextType;s=yl,typeof d=="object"&&d!==null&&(s=$e(d));var h=n.getDerivedStateFromProps;d=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function",r=t.pendingProps!==r,d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(r||c!==s)&&Om(t,l,i,s),ki=!1;var f=t.memoizedState;l.state=f,Xs(t,i,l,a),Ys(),c=t.memoizedState,r||f!==c||ki?(typeof h=="function"&&(Gd(t,n,h,i),c=t.memoizedState),(o=ki||km(t,n,o,i,f,c,s))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),l.props=i,l.state=c,l.context=s,i=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{l=t.stateNode,t2(e,t),s=t.memoizedProps,d=ya(n,s),l.props=d,h=t.pendingProps,f=l.context,c=n.contextType,o=yl,typeof c=="object"&&c!==null&&(o=$e(c)),r=n.getDerivedStateFromProps,(c=typeof r=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==h||f!==o)&&Om(t,l,i,o),ki=!1,f=t.memoizedState,l.state=f,Xs(t,i,l,a),Ys();var w=t.memoizedState;s!==h||f!==w||ki||e!==null&&e.dependencies!==null&&tu(e.dependencies)?(typeof r=="function"&&(Gd(t,n,r,i),w=t.memoizedState),(d=ki||km(t,n,d,i,f,w,o)||e!==null&&e.dependencies!==null&&tu(e.dependencies))?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(i,w,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(i,w,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),l.props=i,l.state=w,l.context=o,i=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),i=!1)}return l=i,Vs(e,t),i=(t.flags&128)!==0,l||i?(l=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:l.render(),t.flags|=1,e!==null&&i?(t.child=ha(t,e.child,null,a),t.child=ha(t,null,n,a)):Ke(e,t,n,a),t.memoizedState=l.state,e=t.child):e=In(e,t,a),e}function Km(e,t,n,i){return Cs(),t.flags|=256,Ke(e,t,n,i),t.child}var qd={dehydrated:null,treeContext:null,retryLane:0};function Yd(e){return{baseLanes:e,cachePool:W4()}}function Xd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=an),e}function Im(e,t,n){var i=t.pendingProps,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(W){if(a?Ni(t):ji(),W){var r=Ze,o;if(o=r){e:{for(o=r,r=jn;o.nodeType!==8;){if(!r){r=null;break e}if(o=wn(o.nextSibling),o===null){r=null;break e}}r=o}r!==null?(t.memoizedState={dehydrated:r,treeContext:ca!==null?{id:Xn,overflow:Qn}:null,retryLane:536870912},o=nn(18,null,null,0),o.stateNode=r,o.return=t,t.child=o,at=t,Ze=null,o=!0):o=!1}o||da(t)}if(r=t.memoizedState,r!==null&&(r=r.dehydrated,r!==null))return r.data==="$!"?t.lanes=16:t.lanes=536870912,null;Zn(t)}return r=i.children,i=i.fallback,a?(ji(),a=t.mode,r=Zd({mode:"hidden",children:r},a),i=Ea(i,a,n,null),r.return=t,i.return=t,r.sibling=i,t.child=r,a=t.child,a.memoizedState=Yd(n),a.childLanes=Xd(e,s,n),t.memoizedState=qd,i):(Ni(t),Qd(t,r))}if(o=e.memoizedState,o!==null&&(r=o.dehydrated,r!==null)){if(l)t.flags&256?(Ni(t),t.flags&=-257,t=Kd(e,t,n)):t.memoizedState!==null?(ji(),t.child=e.child,t.flags|=128,t=null):(ji(),a=i.fallback,r=t.mode,i=Zd({mode:"visible",children:i.children},r),a=Ea(a,r,n,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,ha(t,e.child,null,n),i=t.child,i.memoizedState=Yd(n),i.childLanes=Xd(e,s,n),t.memoizedState=qd,t=a);else if(Ni(t),r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var c=s.dgst;s=c,i=Error(E(419)),i.stack="",i.digest=s,Ds({value:i,source:null,stack:null}),t=Kd(e,t,n)}else if(Xe||Fs(e,t,n,!1),s=(n&e.childLanes)!==0,Xe||s){if(s=re,s!==null){if(i=n&-n,i&42)i=1;else switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=64;break;case 268435456:i=134217728;break;default:i=0}if(i=i&(s.suspendedLanes|n)?0:i,i!==0&&i!==o.retryLane)throw o.retryLane=i,Ai(e,i),lt(s,e,i),Hm}r.data==="$?"||E2(),t=Kd(e,t,n)}else r.data==="$?"?(t.flags|=128,t.child=e.child,t=rv.bind(null,e),r._reactRetry=t,t=null):(e=o.treeContext,Ze=wn(r.nextSibling),at=t,W=!0,hn=null,jn=!1,e!==null&&(Jt[Pt++]=Xn,Jt[Pt++]=Qn,Jt[Pt++]=ca,Xn=e.id,Qn=e.overflow,ca=t),t=Qd(t,i.children),t.flags|=4096);return t}return a?(ji(),a=i.fallback,r=t.mode,o=e.child,c=o.sibling,i=Bi(o,{mode:"hidden",children:i.children}),i.subtreeFlags=o.subtreeFlags&31457280,c!==null?a=Bi(c,a):(a=Ea(a,r,n,null),a.flags|=2),a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,r=e.child.memoizedState,r===null?r=Yd(n):(o=r.cachePool,o!==null?(c=He._currentValue,o=o.parent!==c?{parent:c,pool:c}:o):o=W4(),r={baseLanes:r.baseLanes|n,cachePool:o}),a.memoizedState=r,a.childLanes=Xd(e,s,n),t.memoizedState=qd,i):(Ni(t),n=e.child,e=n.sibling,n=Bi(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Qd(e,t){return t=Zd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Zd(e,t){return xw(e,t,0,null)}function Kd(e,t,n){return ha(t,e.child,null,n),e=Qd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wm(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Pd(e.return,t,n)}function Id(e,t,n,i,a){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:a}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=i,l.tail=n,l.tailMode=a)}function Jm(e,t,n){var i=t.pendingProps,a=i.revealOrder,l=i.tail;if(Ke(e,t,i.children,n),i=Ge.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wm(e,n,t);else if(e.tag===19)Wm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(we(Ge,i),a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&qo(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Id(t,!1,a,n,l);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&qo(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Id(t,!0,n,null,l);break;case"together":Id(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function In(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gi|=t.lanes,!(n&t.childLanes))if(e!==null){if(Fs(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(E(153));if(t.child!==null){for(e=t.child,n=Bi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Wd(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&tu(e)))}function Zy(e,t,n){switch(t.tag){case 3:po(t,t.stateNode.containerInfo),Di(t,He,e.memoizedState.cache),Cs();break;case 27:case 5:Hf(t);break;case 4:po(t,t.stateNode.containerInfo);break;case 10:Di(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Ni(t),t.flags|=128,null):n&t.child.childLanes?Im(e,t,n):(Ni(t),e=In(e,t,n),e!==null?e.sibling:null);Ni(t);break;case 19:var a=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Fs(e,t,n,!1),i=(n&t.childLanes)!==0),a){if(i)return Jm(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),we(Ge,Ge.current),i)break;return null;case 22:case 23:return t.lanes=0,Ym(e,t,n);case 24:Di(t,He,e.memoizedState.cache)}return In(e,t,n)}function Pm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xe=!0;else{if(!Wd(e,n)&&!(t.flags&128))return Xe=!1,Zy(e,t,n);Xe=!!(e.flags&131072)}else Xe=!1,W&&t.flags&1048576&&z4(t,Bo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,a=i._init;if(i=a(i._payload),t.type=i,typeof i=="function")c2(i)?(e=ya(i,e),t.tag=1,t=Zm(null,t,i,e,n)):(t.tag=0,t=Fd(null,t,i,e,n));else{if(i!=null){if(a=i.$$typeof,a===Df){t.tag=11,t=Vm(null,t,i,e,n);break e}else if(a===Lf){t.tag=14,t=Fm(null,t,i,e,n);break e}}throw t=Uf(i)||i,Error(E(306,t,""))}}return t;case 0:return Fd(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,a=ya(i,t.pendingProps),Zm(e,t,i,a,n);case 3:e:{if(po(t,t.stateNode.containerInfo),e===null)throw Error(E(387));var l=t.pendingProps;a=t.memoizedState,i=a.element,t2(e,t),Xs(t,l,null,n);var s=t.memoizedState;if(l=s.cache,Di(t,He,l),l!==a.cache&&$d(t,[He],n,!0),Ys(),l=s.element,a.isDehydrated)if(a={element:l,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Km(e,t,l,n);break e}else if(l!==i){i=Wt(Error(E(424)),t),Ds(i),t=Km(e,t,l,n);break e}else for(Ze=wn(t.stateNode.containerInfo.firstChild),at=t,W=!0,hn=null,jn=!0,n=X4(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cs(),l===i){t=In(e,t,n);break e}Ke(e,t,l,n)}t=t.child}return t;case 26:return Vs(e,t),e===null?(n=tg(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,i=pu(Ei.current).createElement(n),i[Pe]=t,i[mt]=e,Ie(i,n,e),Ye(i),t.stateNode=i):t.memoizedState=tg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Hf(t),e===null&&W&&(i=t.stateNode=Pw(t.type,t.pendingProps,Ei.current),at=t,jn=!0,Ze=wn(i.firstChild)),i=t.pendingProps.children,e!==null||W?Ke(e,t,i,n):t.child=ha(t,null,i,n),Vs(e,t),t.child;case 5:return e===null&&W&&((a=i=Ze)&&(i=Sv(i,t.type,t.pendingProps,jn),i!==null?(t.stateNode=i,at=t,Ze=wn(i.firstChild),jn=!1,a=!0):a=!1),a||da(t)),Hf(t),a=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,i=l.children,z2(a,l)?i=null:s!==null&&z2(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_d(e,t,Hy,null,null,n),sr._currentValue=a),Vs(e,t),Ke(e,t,i,n),t.child;case 6:return e===null&&W&&((e=n=Ze)&&(n=_v(n,t.pendingProps,jn),n!==null?(t.stateNode=n,at=t,Ze=null,e=!0):e=!1),e||da(t)),null;case 13:return Im(e,t,n);case 4:return po(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ha(t,null,i,n):Ke(e,t,i,n),t.child;case 11:return Vm(e,t,t.type,t.pendingProps,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Di(t,t.type,i.value),Ke(e,t,i.children,n),t.child;case 9:return a=t.type._context,i=t.pendingProps.children,ba(t),a=$e(a),i=i(a),t.flags|=1,Ke(e,t,i,n),t.child;case 14:return Fm(e,t,t.type,t.pendingProps,n);case 15:return qm(e,t,t.type,t.pendingProps,n);case 19:return Jm(e,t,n);case 22:return Ym(e,t,n);case 24:return ba(t),i=$e(He),e===null?(a=Ed(),a===null&&(a=re,l=bd(),a.pooledCache=l,l.refCount++,l!==null&&(a.pooledCacheLanes|=n),a=l),t.memoizedState={parent:i,cache:a},e2(t),Di(t,He,a)):(e.lanes&n&&(t2(e,t),Xs(t,null,null,n),Ys()),a=e.memoizedState,l=t.memoizedState,a.parent!==i?(a={parent:i,cache:i},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Di(t,He,i)):(i=l.cache,Di(t,He,i),i!==a.cache&&$d(t,[He],n,!0))),Ke(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(E(156,t.tag))}var Jd=Tn(null),va=null,Wn=null;function Di(e,t,n){we(Jd,t._currentValue),t._currentValue=n}function Jn(e){e._currentValue=Jd.current,qe(Jd)}function Pd(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function $d(e,t,n,i){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var l=a.dependencies;if(l!==null){var s=a.child;l=l.firstContext;e:for(;l!==null;){var r=l;l=a;for(var o=0;o<t.length;o++)if(r.context===t[o]){l.lanes|=n,r=l.alternate,r!==null&&(r.lanes|=n),Pd(l.return,n,e),i||(s=null);break e}l=r.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(E(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Pd(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Fs(e,t,n,i){e=null;for(var a=t,l=!1;a!==null;){if(!l){if(a.flags&524288)l=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(E(387));if(s=s.memoizedProps,s!==null){var r=a.type;kt(a.pendingProps.value,s.value)||(e!==null?e.push(r):e=[r])}}else if(a===go.current){if(s=a.alternate,s===null)throw Error(E(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(sr):e=[sr])}a=a.return}e!==null&&$d(t,e,n,i),t.flags|=262144}function tu(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){va=e,Wn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $e(e){return $m(va,e)}function nu(e,t){return va===null&&ba(e),$m(e,t)}function $m(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wn===null){if(e===null)throw Error(E(308));Wn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wn=Wn.next=t;return n}var ki=!1;function e2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function t2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Oi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Li(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,be&2){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,t=zo(e),L4(e,null,n),t}return Uo(e,i,t,n),zo(e)}function qs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194176)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,F3(e,n)}}function n2(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var a=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};l===null?a=l=s:l=l.next=s,n=n.next}while(n!==null);l===null?a=l=t:l=l.next=t}else a=l=t;n={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:l,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var i2=!1;function Ys(){if(i2){var e=_l;if(e!==null)throw e}}function Xs(e,t,n,i){i2=!1;var a=e.updateQueue;ki=!1;var l=a.firstBaseUpdate,s=a.lastBaseUpdate,r=a.shared.pending;if(r!==null){a.shared.pending=null;var o=r,c=o.next;o.next=null,s===null?l=c:s.next=c,s=o;var d=e.alternate;d!==null&&(d=d.updateQueue,r=d.lastBaseUpdate,r!==s&&(r===null?d.firstBaseUpdate=c:r.next=c,d.lastBaseUpdate=o))}if(l!==null){var h=a.baseState;s=0,d=c=o=null,r=l;do{var f=r.lane&-536870913,w=f!==r.lane;if(w?(Q&f)===f:(i&f)===f){f!==0&&f===Sl&&(i2=!0),d!==null&&(d=d.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});e:{var v=e,x=r;f=t;var _=n;switch(x.tag){case 1:if(v=x.payload,typeof v=="function"){h=v.call(_,h,f);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,f=typeof v=="function"?v.call(_,h,f):v,f==null)break e;h=ce({},h,f);break e;case 2:ki=!0}}f=r.callback,f!==null&&(e.flags|=64,w&&(e.flags|=8192),w=a.callbacks,w===null?a.callbacks=[f]:w.push(f))}else w={lane:f,tag:r.tag,payload:r.payload,callback:r.callback,next:null},d===null?(c=d=w,o=h):d=d.next=w,s|=f;if(r=r.next,r===null){if(r=a.shared.pending,r===null)break;w=r,r=w.next,w.next=null,a.lastBaseUpdate=w,a.shared.pending=null}}while(!0);d===null&&(o=h),a.baseState=o,a.firstBaseUpdate=c,a.lastBaseUpdate=d,l===null&&(a.shared.lanes=0),Gi|=s,e.lanes=s,e.memoizedState=h}}function ew(e,t){if(typeof e!="function")throw Error(E(191,e));e.call(t)}function tw(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ew(n[e],t)}function Qs(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var a=i.next;n=a;do{if((n.tag&e)===e){i=void 0;var l=n.create,s=n.inst;i=l(),s.destroy=i}n=n.next}while(n!==a)}}catch(r){ie(t,t.return,r)}}function Ui(e,t,n){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var l=a.next;i=l;do{if((i.tag&e)===e){var s=i.inst,r=s.destroy;if(r!==void 0){s.destroy=void 0,a=t;var o=n;try{r()}catch(c){ie(a,o,c)}}}i=i.next}while(i!==l)}}catch(c){ie(t,t.return,c)}}function nw(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{tw(t,n)}catch(i){ie(e,e.return,i)}}}function iw(e,t,n){n.props=ya(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){ie(e,t,i)}}function xa(e,t){try{var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 26:case 27:case 5:var a=i;break;default:a=i}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(l){ie(e,t,l)}}function Ot(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(a){ie(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){ie(e,t,a)}else n.current=null}function aw(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(a){ie(e,e.return,a)}}function lw(e,t,n){try{var i=e.stateNode;yv(i,e.type,n,t),i[mt]=t}catch(a){ie(e,e.return,a)}}function sw(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27||e.tag===4}function a2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==27&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function l2(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gu));else if(i!==4&&i!==27&&(e=e.child,e!==null))for(l2(e,t,n),e=e.sibling;e!==null;)l2(e,t,n),e=e.sibling}function iu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&i!==27&&(e=e.child,e!==null))for(iu(e,t,n),e=e.sibling;e!==null;)iu(e,t,n),e=e.sibling}var Pn=!1,_e=!1,s2=!1,rw=typeof WeakSet=="function"?WeakSet:Set,Qe=null,ow=!1;function Ky(e,t){if(e=e.containerInfo,L2=Su,e=T4(e),od(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,l=i.focusNode;i=i.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,r=-1,o=-1,c=0,d=0,h=e,f=null;t:for(;;){for(var w;h!==n||a!==0&&h.nodeType!==3||(r=s+a),h!==l||i!==0&&h.nodeType!==3||(o=s+i),h.nodeType===3&&(s+=h.nodeValue.length),(w=h.firstChild)!==null;)f=h,h=w;for(;;){if(h===e)break t;if(f===n&&++c===a&&(r=s),f===l&&++d===i&&(o=s),(w=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=w}n=r===-1||o===-1?null:{start:r,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(U2={focusedElem:e,selectionRange:n},Su=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){switch(t=Qe,l=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&l!==null){e=void 0,n=t,a=l.memoizedProps,l=l.memoizedState,i=n.stateNode;try{var v=ya(n.type,a,n.elementType===n.type);e=i.getSnapshotBeforeUpdate(v,l),i.__reactInternalSnapshotBeforeUpdate=e}catch(x){ie(n,n.return,x)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)G2(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":G2(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(E(163))}if(e=t.sibling,e!==null){e.return=t.return,Qe=e;break}Qe=t.return}return v=ow,ow=!1,v}function uw(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ei(e,n),i&4&&Qs(5,n);break;case 1:if(ei(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(r){ie(n,n.return,r)}else{var a=ya(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(r){ie(n,n.return,r)}}i&64&&nw(n),i&512&&xa(n,n.return);break;case 3:if(ei(e,n),i&64&&(i=n.updateQueue,i!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{tw(i,e)}catch(r){ie(n,n.return,r)}}break;case 26:ei(e,n),i&512&&xa(n,n.return);break;case 27:case 5:ei(e,n),t===null&&i&4&&aw(n),i&512&&xa(n,n.return);break;case 12:ei(e,n);break;case 13:ei(e,n),i&4&&dw(e,n);break;case 22:if(a=n.memoizedState!==null||Pn,!a){t=t!==null&&t.memoizedState!==null||_e;var l=Pn,s=_e;Pn=a,(_e=t)&&!s?zi(e,n,(n.subtreeFlags&8772)!==0):ei(e,n),Pn=l,_e=s}i&512&&(n.memoizedProps.mode==="manual"?xa(n,n.return):Ot(n,n.return));break;default:ei(e,n)}}function cw(e){var t=e.alternate;t!==null&&(e.alternate=null,cw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qf(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ze=null,Lt=!1;function $n(e,t,n){for(n=n.child;n!==null;)fw(e,t,n),n=n.sibling}function fw(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(ws,n)}catch{}switch(n.tag){case 26:_e||Ot(n,t),$n(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_e||Ot(n,t);var i=ze,a=Lt;for(ze=n.stateNode,$n(e,t,n),n=n.stateNode,t=n.attributes;t.length;)n.removeAttributeNode(t[0]);Qf(n),ze=i,Lt=a;break;case 5:_e||Ot(n,t);case 6:a=ze;var l=Lt;if(ze=null,$n(e,t,n),ze=a,Lt=l,ze!==null)if(Lt)try{e=ze,i=n.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)}catch(s){ie(n,t,s)}else try{ze.removeChild(n.stateNode)}catch(s){ie(n,t,s)}break;case 18:ze!==null&&(Lt?(t=ze,n=n.stateNode,t.nodeType===8?B2(t.parentNode,n):t.nodeType===1&&B2(t,n),cr(t)):B2(ze,n.stateNode));break;case 4:i=ze,a=Lt,ze=n.stateNode.containerInfo,Lt=!0,$n(e,t,n),ze=i,Lt=a;break;case 0:case 11:case 14:case 15:_e||Ui(2,n,t),_e||Ui(4,n,t),$n(e,t,n);break;case 1:_e||(Ot(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&iw(n,t,i)),$n(e,t,n);break;case 21:$n(e,t,n);break;case 22:_e||Ot(n,t),_e=(i=_e)||n.memoizedState!==null,$n(e,t,n),_e=i;break;default:$n(e,t,n)}}function dw(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{cr(e)}catch(n){ie(t,t.return,n)}}function Iy(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rw),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rw),t;default:throw Error(E(435,e.tag))}}function r2(e,t){var n=Iy(e);t.forEach(function(i){var a=ov.bind(null,e,i);n.has(i)||(n.add(i),i.then(a,a))})}function en(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i],l=e,s=t,r=s;e:for(;r!==null;){switch(r.tag){case 27:case 5:ze=r.stateNode,Lt=!1;break e;case 3:ze=r.stateNode.containerInfo,Lt=!0;break e;case 4:ze=r.stateNode.containerInfo,Lt=!0;break e}r=r.return}if(ze===null)throw Error(E(160));fw(l,s,a),ze=null,Lt=!1,l=a.alternate,l!==null&&(l.return=null),a.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)hw(t,e),t=t.sibling}var mn=null;function hw(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:en(t,e),tn(e),i&4&&(Ui(3,e,e.return),Qs(3,e),Ui(5,e,e.return));break;case 1:en(t,e),tn(e),i&512&&(_e||n===null||Ot(n,n.return)),i&64&&Pn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var a=mn;if(en(t,e),tn(e),i&512&&(_e||n===null||Ot(n,n.return)),i&4){var l=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(i){case"title":l=a.getElementsByTagName("title")[0],(!l||l[ys]||l[Pe]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=a.createElement(i),a.head.insertBefore(l,a.querySelector("head > title"))),Ie(l,i,n),l[Pe]=e,Ye(l),i=l;break e;case"link":var s=ag("link","href",a).get(i+(n.href||""));if(s){for(var r=0;r<s.length;r++)if(l=s[r],l.getAttribute("href")===(n.href==null?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(r,1);break t}}l=a.createElement(i),Ie(l,i,n),a.head.appendChild(l);break;case"meta":if(s=ag("meta","content",a).get(i+(n.content||""))){for(r=0;r<s.length;r++)if(l=s[r],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(r,1);break t}}l=a.createElement(i),Ie(l,i,n),a.head.appendChild(l);break;default:throw Error(E(468,i))}l[Pe]=e,Ye(l),i=l}e.stateNode=i}else lg(a,e.type,e.stateNode);else e.stateNode=ig(a,i,e.memoizedProps);else l!==i?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,i===null?lg(a,e.type,e.stateNode):ig(a,i,e.memoizedProps)):i===null&&e.stateNode!==null&&lw(e,e.memoizedProps,n.memoizedProps)}break;case 27:if(i&4&&e.alternate===null){a=e.stateNode,l=e.memoizedProps;try{for(var o=a.firstChild;o;){var c=o.nextSibling,d=o.nodeName;o[ys]||d==="HEAD"||d==="BODY"||d==="SCRIPT"||d==="STYLE"||d==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=c}for(var h=e.type,f=a.attributes;f.length;)a.removeAttributeNode(f[0]);Ie(a,h,l),a[Pe]=e,a[mt]=l}catch(v){ie(e,e.return,v)}}case 5:if(en(t,e),tn(e),i&512&&(_e||n===null||Ot(n,n.return)),e.flags&32){a=e.stateNode;try{fl(a,"")}catch(v){ie(e,e.return,v)}}i&4&&e.stateNode!=null&&(a=e.memoizedProps,lw(e,a,n!==null?n.memoizedProps:a)),i&1024&&(s2=!0);break;case 6:if(en(t,e),tn(e),i&4){if(e.stateNode===null)throw Error(E(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(v){ie(e,e.return,v)}}break;case 3:if(bu=null,a=mn,mn=yu(t.containerInfo),en(t,e),mn=a,tn(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{cr(t.containerInfo)}catch(v){ie(e,e.return,v)}s2&&(s2=!1,mw(e));break;case 4:i=mn,mn=yu(e.stateNode.containerInfo),en(t,e),tn(e),mn=i;break;case 12:en(t,e),tn(e);break;case 13:en(t,e),tn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(g2=Nn()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,r2(e,i)));break;case 22:if(i&512&&(_e||n===null||Ot(n,n.return)),o=e.memoizedState!==null,c=n!==null&&n.memoizedState!==null,d=Pn,h=_e,Pn=d||o,_e=h||c,en(t,e),_e=h,Pn=d,tn(e),t=e.stateNode,t._current=e,t._visibility&=-3,t._visibility|=t._pendingVisibility&2,i&8192&&(t._visibility=o?t._visibility&-2:t._visibility|1,o&&(t=Pn||_e,n===null||c||t||jl(e)),e.memoizedProps===null||e.memoizedProps.mode!=="manual"))e:for(n=null,t=e;;){if(t.tag===5||t.tag===26||t.tag===27){if(n===null){c=n=t;try{if(a=c.stateNode,o)l=a.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none";else{s=c.stateNode,r=c.memoizedProps.style;var w=r!=null&&r.hasOwnProperty("display")?r.display:null;s.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(v){ie(c,c.return,v)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=o?"":c.memoizedProps}catch(v){ie(c,c.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,r2(e,n))));break;case 19:en(t,e),tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,r2(e,i)));break;case 21:break;default:en(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{if(e.tag!==27){e:{for(var n=e.return;n!==null;){if(sw(n)){var i=n;break e}n=n.return}throw Error(E(160))}switch(i.tag){case 27:var a=i.stateNode,l=a2(e);iu(e,l,a);break;case 5:var s=i.stateNode;i.flags&32&&(fl(s,""),i.flags&=-33);var r=a2(e);iu(e,r,s);break;case 3:case 4:var o=i.stateNode.containerInfo,c=a2(e);l2(e,c,o);break;default:throw Error(E(161))}}}catch(d){ie(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mw(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mw(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ei(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uw(e,t.alternate,t),t=t.sibling}function jl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ui(4,t,t.return),jl(t);break;case 1:Ot(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&iw(t,t.return,n),jl(t);break;case 26:case 27:case 5:Ot(t,t.return),jl(t);break;case 22:Ot(t,t.return),t.memoizedState===null&&jl(t);break;default:jl(t)}e=e.sibling}}function zi(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,a=e,l=t,s=l.flags;switch(l.tag){case 0:case 11:case 15:zi(a,l,n),Qs(4,l);break;case 1:if(zi(a,l,n),i=l,a=i.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(c){ie(i,i.return,c)}if(i=l,a=i.updateQueue,a!==null){var r=i.stateNode;try{var o=a.shared.hiddenCallbacks;if(o!==null)for(a.shared.hiddenCallbacks=null,a=0;a<o.length;a++)ew(o[a],r)}catch(c){ie(i,i.return,c)}}n&&s&64&&nw(l),xa(l,l.return);break;case 26:case 27:case 5:zi(a,l,n),n&&i===null&&s&4&&aw(l),xa(l,l.return);break;case 12:zi(a,l,n);break;case 13:zi(a,l,n),n&&s&4&&dw(a,l);break;case 22:l.memoizedState===null&&zi(a,l,n),xa(l,l.return);break;default:zi(a,l,n)}t=t.sibling}}function o2(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&zs(n))}function u2(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&zs(e))}function Ri(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ww(e,t,n,i),t=t.sibling}function ww(e,t,n,i){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ri(e,t,n,i),a&2048&&Qs(9,t);break;case 3:Ri(e,t,n,i),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&zs(e)));break;case 12:if(a&2048){Ri(e,t,n,i),e=t.stateNode;try{var l=t.memoizedProps,s=l.id,r=l.onPostCommit;typeof r=="function"&&r(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(o){ie(t,t.return,o)}}else Ri(e,t,n,i);break;case 23:break;case 22:l=t.stateNode,t.memoizedState!==null?l._visibility&4?Ri(e,t,n,i):Zs(e,t):l._visibility&4?Ri(e,t,n,i):(l._visibility|=4,Ml(e,t,n,i,(t.subtreeFlags&10256)!==0)),a&2048&&o2(t.alternate,t);break;case 24:Ri(e,t,n,i),a&2048&&u2(t.alternate,t);break;default:Ri(e,t,n,i)}}function Ml(e,t,n,i,a){for(a=a&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var l=e,s=t,r=n,o=i,c=s.flags;switch(s.tag){case 0:case 11:case 15:Ml(l,s,r,o,a),Qs(8,s);break;case 23:break;case 22:var d=s.stateNode;s.memoizedState!==null?d._visibility&4?Ml(l,s,r,o,a):Zs(l,s):(d._visibility|=4,Ml(l,s,r,o,a)),a&&c&2048&&o2(s.alternate,s);break;case 24:Ml(l,s,r,o,a),a&&c&2048&&u2(s.alternate,s);break;default:Ml(l,s,r,o,a)}t=t.sibling}}function Zs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,a=i.flags;switch(i.tag){case 22:Zs(n,i),a&2048&&o2(i.alternate,i);break;case 24:Zs(n,i),a&2048&&u2(i.alternate,i);break;default:Zs(n,i)}t=t.sibling}}var Ks=8192;function Cl(e){if(e.subtreeFlags&Ks)for(e=e.child;e!==null;)gw(e),e=e.sibling}function gw(e){switch(e.tag){case 26:Cl(e),e.flags&Ks&&e.memoizedState!==null&&Rv(mn,e.memoizedState,e.memoizedProps);break;case 5:Cl(e);break;case 3:case 4:var t=mn;mn=yu(e.stateNode.containerInfo),Cl(e),mn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Ks,Ks=16777216,Cl(e),Ks=t):Cl(e));break;default:Cl(e)}}function pw(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Is(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Qe=i,vw(i,e)}pw(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yw(e),e=e.sibling}function yw(e){switch(e.tag){case 0:case 11:case 15:Is(e),e.flags&2048&&Ui(9,e,e.return);break;case 3:Is(e);break;case 12:Is(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&4&&(e.return===null||e.return.tag!==13)?(t._visibility&=-5,au(e)):Is(e);break;default:Is(e)}}function au(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Qe=i,vw(i,e)}pw(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ui(8,t,t.return),au(t);break;case 22:n=t.stateNode,n._visibility&4&&(n._visibility&=-5,au(t));break;default:au(t)}e=e.sibling}}function vw(e,t){for(;Qe!==null;){var n=Qe;switch(n.tag){case 0:case 11:case 15:Ui(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:zs(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Qe=i;else e:for(n=e;Qe!==null;){i=Qe;var a=i.sibling,l=i.return;if(cw(i),i===n){Qe=null;break e}if(a!==null){a.return=l,Qe=a;break e}Qe=l}}}function Wy(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,n,i){return new Wy(e,t,n,i)}function c2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bi(e,t){var n=e.alternate;return n===null?(n=nn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&31457280,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function bw(e,t){e.flags&=31457282;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lu(e,t,n,i,a,l){var s=0;if(i=e,typeof e=="function")c2(e)&&(s=1);else if(typeof e=="string")s=Uv(e,n,An.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case nl:return Ea(n.children,a,l,t);case N3:s=8,a|=24;break;case Cf:return e=nn(12,n,t,a|2),e.elementType=Cf,e.lanes=l,e;case kf:return e=nn(13,n,t,a),e.elementType=kf,e.lanes=l,e;case Of:return e=nn(19,n,t,a),e.elementType=Of,e.lanes=l,e;case M3:return xw(n,a,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x6:case Fn:s=10;break e;case j3:s=9;break e;case Df:s=11;break e;case Lf:s=14;break e;case xi:s=16,i=null;break e}s=29,n=Error(E(130,e===null?"null":typeof e,"")),i=null}return t=nn(s,n,t,a),t.elementType=e,t.type=i,t.lanes=l,t}function Ea(e,t,n,i){return e=nn(7,e,i,t),e.lanes=n,e}function xw(e,t,n,i){e=nn(22,e,i,t),e.elementType=M3,e.lanes=n;var a={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var l=a._current;if(l===null)throw Error(E(456));if(!(a._pendingVisibility&2)){var s=Ai(l,2);s!==null&&(a._pendingVisibility|=2,lt(s,l,2))}},attach:function(){var l=a._current;if(l===null)throw Error(E(456));if(a._pendingVisibility&2){var s=Ai(l,2);s!==null&&(a._pendingVisibility&=-3,lt(s,l,2))}}};return e.stateNode=a,e}function f2(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function d2(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ti(e){e.flags|=4}function Ew(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!sg(t)){if(t=$t.current,t!==null&&((Q&4194176)===Q?Mn!==null:(Q&62914560)!==Q&&!(Q&536870912)||t!==Mn))throw Os=pd,G4;e.flags|=8192}}function su(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?H3():536870912,e.lanes|=t,kl|=t)}function Ws(e,t){if(!W)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags&31457280,i|=a.flags&31457280,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Jy(e,t,n){var i=t.pendingProps;switch(wd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ve(t),null;case 1:return ve(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Jn(He),ll(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ms(t)?ti(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,hn!==null&&(b2(hn),hn=null))),ve(t),null;case 26:return n=t.memoizedState,e===null?(ti(t),n!==null?(ve(t),Ew(t,n)):(ve(t),t.flags&=-16777217)):n?n!==e.memoizedState?(ti(t),ve(t),Ew(t,n)):(ve(t),t.flags&=-16777217):(e.memoizedProps!==i&&ti(t),ve(t),t.flags&=-16777217),null;case 27:yo(t),n=Ei.current;var a=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ti(t);else{if(!i){if(t.stateNode===null)throw Error(E(166));return ve(t),null}e=An.current,Ms(t)?R4(t):(e=Pw(a,i,n),t.stateNode=e,ti(t))}return ve(t),null;case 5:if(yo(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ti(t);else{if(!i){if(t.stateNode===null)throw Error(E(166));return ve(t),null}if(e=An.current,Ms(t))R4(t);else{switch(a=pu(Ei.current),e){case 1:e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof i.is=="string"?a.createElement("select",{is:i.is}):a.createElement("select"),i.multiple?e.multiple=!0:i.size&&(e.size=i.size);break;default:e=typeof i.is=="string"?a.createElement(n,{is:i.is}):a.createElement(n)}}e[Pe]=t,e[mt]=i;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=e;e:switch(Ie(e,n,i),n){case"button":case"input":case"select":case"textarea":e=!!i.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&ti(t)}}return ve(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ti(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(E(166));if(e=Ei.current,Ms(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,a=at,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}e[Pe]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Qw(e.nodeValue,n)),e||da(t)}else e=pu(e).createTextNode(i),e[Pe]=t,t.stateNode=e}return ve(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ms(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(E(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(E(317));a[Pe]=t}else Cs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ve(t),a=!1}else hn!==null&&(b2(hn),hn=null),a=!0;if(!a)return t.flags&256?(Zn(t),t):(Zn(t),null)}if(Zn(t),t.flags&128)return t.lanes=n,t;if(n=i!==null,e=e!==null&&e.memoizedState!==null,n){i=t.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool);var l=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==a&&(i.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),su(t,t.updateQueue),ve(t),null;case 4:return ll(),e===null&&D2(t.stateNode.containerInfo),ve(t),null;case 10:return Jn(t.type),ve(t),null;case 19:if(qe(Ge),a=t.memoizedState,a===null)return ve(t),null;if(i=(t.flags&128)!==0,l=a.rendering,l===null)if(i)Ws(a,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=qo(e),l!==null){for(t.flags|=128,Ws(a,!1),e=l.updateQueue,t.updateQueue=e,su(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bw(n,e),n=n.sibling;return we(Ge,Ge.current&1|2),t.child}e=e.sibling}a.tail!==null&&Nn()>ru&&(t.flags|=128,i=!0,Ws(a,!1),t.lanes=4194304)}else{if(!i)if(e=qo(l),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,su(t,e),Ws(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!W)return ve(t),null}else 2*Nn()-a.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,i=!0,Ws(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(e=a.last,e!==null?e.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Nn(),t.sibling=null,e=Ge.current,we(Ge,i?e&1|2:e&1),t):(ve(t),null);case 22:case 23:return Zn(t),vd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(ve(t),t.subtreeFlags&6&&(t.flags|=8192)):ve(t),n=t.updateQueue,n!==null&&su(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&qe(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jn(He),ve(t),null;case 25:return null}throw Error(E(156,t.tag))}function Py(e,t){switch(wd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(He),ll(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return yo(t),null;case 13:if(Zn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Ge),null;case 4:return ll(),null;case 10:return Jn(t.type),null;case 22:case 23:return Zn(t),vd(),e!==null&&qe(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jn(He),null;case 25:return null;default:return null}}function Sw(e,t){switch(wd(t),t.tag){case 3:Jn(He),ll();break;case 26:case 27:case 5:yo(t);break;case 4:ll();break;case 13:Zn(t);break;case 19:qe(Ge);break;case 10:Jn(t.type);break;case 22:case 23:Zn(t),vd(),e!==null&&qe(ma);break;case 24:Jn(He)}}var $y={getCacheForType:function(e){var t=$e(He),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},ev=typeof WeakMap=="function"?WeakMap:Map,be=0,re=null,F=null,Q=0,oe=0,Ut=null,ni=!1,Dl=!1,h2=!1,ii=0,Te=0,Gi=0,Sa=0,m2=0,an=0,kl=0,Js=null,Dn=null,w2=!1,g2=0,ru=1/0,ou=null,Hi=null,uu=!1,_a=null,Ps=0,p2=0,y2=null,$s=0,v2=null;function zt(){if(be&2&&Q!==0)return Q&-Q;if(G.T!==null){var e=Sl;return e!==0?e:N2()}return Y3()}function _w(){an===0&&(an=!(Q&536870912)||W?G3():536870912);var e=$t.current;return e!==null&&(e.flags|=32),an}function lt(e,t,n){(e===re&&oe===2||e.cancelPendingCommit!==null)&&(Ol(e,0),ai(e,Q,an,!1)),ps(e,n),(!(be&2)||e!==re)&&(e===re&&(!(be&2)&&(Sa|=n),Te===4&&ai(e,Q,an,!1)),kn(e))}function Tw(e,t,n){if(be&6)throw Error(E(327));var i=!n&&(t&60)===0&&(t&e.expiredLanes)===0||gs(e,t),a=i?iv(e,t):S2(e,t,!0),l=i;do{if(a===0){Dl&&!i&&ai(e,t,0,!1);break}else if(a===6)ai(e,t,0,!ni);else{if(n=e.current.alternate,l&&!tv(n)){a=S2(e,t,!1),l=!1;continue}if(a===2){if(l=t,e.errorRecoveryDisabledLanes&l)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var r=e;a=Js;var o=r.current.memoizedState.isDehydrated;if(o&&(Ol(r,s).flags|=256),s=S2(r,s,!1),s!==2){if(h2&&!o){r.errorRecoveryDisabledLanes|=l,Sa|=l,a=4;break e}l=Dn,Dn=a,l!==null&&b2(l)}a=s}if(l=!1,a!==2)continue}}if(a===1){Ol(e,0),ai(e,t,0,!0);break}e:{switch(i=e,a){case 0:case 1:throw Error(E(345));case 4:if((t&4194176)===t){ai(i,t,an,!ni);break e}break;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(E(329))}if(i.finishedWork=n,i.finishedLanes=t,(t&62914560)===t&&(l=g2+300-Nn(),10<l)){if(ai(i,t,an,!ni),Eo(i,0)!==0)break e;i.timeoutHandle=Iw(Aw.bind(null,i,n,Dn,ou,w2,t,an,Sa,kl,ni,2,-0,0),l);break e}Aw(i,n,Dn,ou,w2,t,an,Sa,kl,ni,0,-0,0)}}break}while(!0);kn(e)}function b2(e){Dn===null?Dn=e:Dn.push.apply(Dn,e)}function Aw(e,t,n,i,a,l,s,r,o,c,d,h,f){var w=t.subtreeFlags;if((w&8192||(w&16785408)===16785408)&&(lr={stylesheets:null,count:0,unsuspend:zv},gw(t),t=Bv(),t!==null)){e.cancelPendingCommit=t(Ow.bind(null,e,n,i,a,s,r,o,1,h,f)),ai(e,l,s,!c);return}Ow(e,n,i,a,s,r,o,d,h,f)}function tv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var a=n[i],l=a.getSnapshot;a=a.value;try{if(!kt(l(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ai(e,t,n,i){t&=~m2,t&=~Sa,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var a=t;0<a;){var l=31-Dt(a),s=1<<l;i[l]=-1,a&=~s}n!==0&&V3(e,n,t)}function cu(){return be&6?!0:(er(0),!1)}function x2(){if(F!==null){if(oe===0)var e=F.return;else e=F,Wn=va=null,Nd(e),xl=null,Ls=0,e=F;for(;e!==null;)Sw(e.alternate,e),e=e.return;F=null}}function Ol(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,bv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),x2(),re=e,F=n=Bi(e.current,null),Q=t,oe=0,Ut=null,ni=!1,Dl=gs(e,t),h2=!1,kl=an=m2=Sa=Gi=Te=0,Dn=Js=null,w2=!1,t&8&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var a=31-Dt(i),l=1<<a;t|=e[a],i&=~l}return ii=t,Lo(),n}function Nw(e,t){V=null,G.H=Cn,t===ks?(t=F4(),oe=3):t===G4?(t=F4(),oe=4):oe=t===Hm?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,F===null&&(Te=1,eu(e,Wt(t,e.current)))}function jw(){var e=G.H;return G.H=Cn,e===null?Cn:e}function Mw(){var e=G.A;return G.A=$y,e}function E2(){Te=4,ni||(Q&4194176)!==Q&&$t.current!==null||(Dl=!0),!(Gi&134217727)&&!(Sa&134217727)||re===null||ai(re,Q,an,!1)}function S2(e,t,n){var i=be;be|=2;var a=jw(),l=Mw();(re!==e||Q!==t)&&(ou=null,Ol(e,t)),t=!1;var s=Te;e:do try{if(oe!==0&&F!==null){var r=F,o=Ut;switch(oe){case 8:x2(),s=6;break e;case 3:case 2:case 6:$t.current===null&&(t=!0);var c=oe;if(oe=0,Ut=null,Ll(e,r,o,c),n&&Dl){s=0;break e}break;default:c=oe,oe=0,Ut=null,Ll(e,r,o,c)}}nv(),s=Te;break}catch(d){Nw(e,d)}while(!0);return t&&e.shellSuspendCounter++,Wn=va=null,be=i,G.H=a,G.A=l,F===null&&(re=null,Q=0,Lo()),s}function nv(){for(;F!==null;)Cw(F)}function iv(e,t){var n=be;be|=2;var i=jw(),a=Mw();re!==e||Q!==t?(ou=null,ru=Nn()+500,Ol(e,t)):Dl=gs(e,t);e:do try{if(oe!==0&&F!==null){t=F;var l=Ut;t:switch(oe){case 1:oe=0,Ut=null,Ll(e,t,l,1);break;case 2:if(H4(l)){oe=0,Ut=null,Dw(t);break}t=function(){oe===2&&re===e&&(oe=7),kn(e)},l.then(t,t);break e;case 3:oe=7;break e;case 4:oe=5;break e;case 7:H4(l)?(oe=0,Ut=null,Dw(t)):(oe=0,Ut=null,Ll(e,t,l,7));break;case 5:var s=null;switch(F.tag){case 26:s=F.memoizedState;case 5:case 27:var r=F;if(!s||sg(s)){oe=0,Ut=null;var o=r.sibling;if(o!==null)F=o;else{var c=r.return;c!==null?(F=c,fu(c)):F=null}break t}}oe=0,Ut=null,Ll(e,t,l,5);break;case 6:oe=0,Ut=null,Ll(e,t,l,6);break;case 8:x2(),Te=6;break e;default:throw Error(E(462))}}av();break}catch(d){Nw(e,d)}while(!0);return Wn=va=null,G.H=i,G.A=a,be=n,F!==null?0:(re=null,Q=0,Lo(),Te)}function av(){for(;F!==null&&!A6();)Cw(F)}function Cw(e){var t=Pm(e.alternate,e,ii);e.memoizedProps=e.pendingProps,t===null?fu(e):F=t}function Dw(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qm(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Qm(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Nd(t);default:Sw(n,t),t=F=bw(t,ii),t=Pm(n,t,ii)}e.memoizedProps=e.pendingProps,t===null?fu(e):F=t}function Ll(e,t,n,i){Wn=va=null,Nd(t),xl=null,Ls=0;var a=t.return;try{if(Qy(e,a,t,n,Q)){Te=1,eu(e,Wt(n,e.current)),F=null;return}}catch(l){if(a!==null)throw F=a,l;Te=1,eu(e,Wt(n,e.current)),F=null;return}t.flags&32768?(W||i===1?e=!0:Dl||Q&536870912?e=!1:(ni=e=!0,(i===2||i===3||i===6)&&(i=$t.current,i!==null&&i.tag===13&&(i.flags|=16384))),kw(t,e)):fu(t)}function fu(e){var t=e;do{if(t.flags&32768){kw(t,ni);return}e=t.return;var n=Jy(t.alternate,t,ii);if(n!==null){F=n;return}if(t=t.sibling,t!==null){F=t;return}F=t=e}while(t!==null);Te===0&&(Te=5)}function kw(e,t){do{var n=Py(e.alternate,e);if(n!==null){n.flags&=32767,F=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){F=e;return}F=e=n}while(e!==null);Te=6,F=null}function Ow(e,t,n,i,a,l,s,r,o,c){var d=G.T,h=fe.p;try{fe.p=2,G.T=null,lv(e,t,n,i,h,a,l,s,r,o,c)}finally{G.T=d,fe.p=h}}function lv(e,t,n,i,a,l,s,r){do Ul();while(_a!==null);if(be&6)throw Error(E(327));var o=e.finishedWork;if(i=e.finishedLanes,o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(E(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var c=o.lanes|o.childLanes;if(c|=dd,R6(e,i,c,l,s,r),e===re&&(F=re=null,Q=0),!(o.subtreeFlags&10256)&&!(o.flags&10256)||uu||(uu=!0,p2=c,y2=n,uv(vo,function(){return Ul(),null})),n=(o.flags&15990)!==0,o.subtreeFlags&15990||n?(n=G.T,G.T=null,l=fe.p,fe.p=2,s=be,be|=4,Ky(e,o),hw(o,e),My(U2,e.containerInfo),Su=!!L2,U2=L2=null,e.current=o,uw(e,o.alternate,o),N6(),be=s,fe.p=l,G.T=n):e.current=o,uu?(uu=!1,_a=e,Ps=i):Lw(e,c),c=e.pendingLanes,c===0&&(Hi=null),k6(o.stateNode),kn(e),t!==null)for(a=e.onRecoverableError,o=0;o<t.length;o++)c=t[o],a(c.value,{componentStack:c.stack});return Ps&3&&Ul(),c=e.pendingLanes,i&4194218&&c&42?e===v2?$s++:($s=0,v2=e):$s=0,er(0),null}function Lw(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,zs(t)))}function Ul(){if(_a!==null){var e=_a,t=p2;p2=0;var n=q3(Ps),i=G.T,a=fe.p;try{if(fe.p=32>n?32:n,G.T=null,_a===null)var l=!1;else{n=y2,y2=null;var s=_a,r=Ps;if(_a=null,Ps=0,be&6)throw Error(E(331));var o=be;if(be|=4,yw(s.current),ww(s,s.current,r,n),be=o,er(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(ws,s)}catch{}l=!0}return l}finally{fe.p=a,G.T=i,Lw(e,t)}}return!1}function Uw(e,t,n){t=Wt(n,t),t=Vd(e.stateNode,t,2),e=Li(e,t,2),e!==null&&(ps(e,2),kn(e))}function ie(e,t,n){if(e.tag===3)Uw(e,e,n);else for(;t!==null;){if(t.tag===3){Uw(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Hi===null||!Hi.has(i))){e=Wt(n,e),n=Bm(2),i=Li(t,n,2),i!==null&&(Gm(n,i,t,e),ps(i,2),kn(i));break}}t=t.return}}function _2(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new ev;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(n)||(h2=!0,a.add(n),e=sv.bind(null,e,t,n),t.then(e,e))}function sv(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,re===e&&(Q&n)===n&&(Te===4||Te===3&&(Q&62914560)===Q&&300>Nn()-g2?!(be&2)&&Ol(e,0):m2|=n,kl===Q&&(kl=0)),kn(e)}function zw(e,t){t===0&&(t=H3()),e=Ai(e,t),e!==null&&(ps(e,t),kn(e))}function rv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zw(e,n)}function ov(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(E(314))}i!==null&&i.delete(t),zw(e,n)}function uv(e,t){return Ff(e,t)}var du=null,zl=null,T2=!1,hu=!1,A2=!1,Ta=0;function kn(e){e!==zl&&e.next===null&&(zl===null?du=zl=e:zl=zl.next=e),hu=!0,T2||(T2=!0,fv(cv))}function er(e,t){if(!A2&&hu){A2=!0;do for(var n=!1,i=du;i!==null;){if(e!==0){var a=i.pendingLanes;if(a===0)var l=0;else{var s=i.suspendedLanes,r=i.pingedLanes;l=(1<<31-Dt(42|e)+1)-1,l&=a&~(s&~r),l=l&201326677?l&201326677|1:l?l|2:0}l!==0&&(n=!0,Gw(i,l))}else l=Q,l=Eo(i,i===re?l:0),!(l&3)||gs(i,l)||(n=!0,Gw(i,l));i=i.next}while(n);A2=!1}}function cv(){hu=T2=!1;var e=0;Ta!==0&&(vv()&&(e=Ta),Ta=0);for(var t=Nn(),n=null,i=du;i!==null;){var a=i.next,l=Rw(i,t);l===0?(i.next=null,n===null?du=a:n.next=a,a===null&&(zl=n)):(n=i,(e!==0||l&3)&&(hu=!0)),i=a}er(e)}function Rw(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var s=31-Dt(l),r=1<<s,o=a[s];o===-1?(!(r&n)||r&i)&&(a[s]=z6(r,t)):o<=t&&(e.expiredLanes|=r),l&=~r}if(t=re,n=Q,n=Eo(e,e===t?n:0),i=e.callbackNode,n===0||e===t&&oe===2||e.cancelPendingCommit!==null)return i!==null&&i!==null&&qf(i),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||gs(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&qf(i),q3(n)){case 2:case 8:n=R3;break;case 32:n=vo;break;case 268435456:n=B3;break;default:n=vo}return i=Bw.bind(null,e),n=Ff(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&qf(i),e.callbackPriority=2,e.callbackNode=null,2}function Bw(e,t){var n=e.callbackNode;if(Ul()&&e.callbackNode!==n)return null;var i=Q;return i=Eo(e,e===re?i:0),i===0?null:(Tw(e,i,t),Rw(e,Nn()),e.callbackNode!=null&&e.callbackNode===n?Bw.bind(null,e):null)}function Gw(e,t){if(Ul())return null;Tw(e,t,!0)}function fv(e){xv(function(){be&6?Ff(z3,e):e()})}function N2(){return Ta===0&&(Ta=G3()),Ta}function Hw(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:No(""+e)}function Vw(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function dv(e,t,n,i,a){if(t==="submit"&&n&&n.stateNode===a){var l=Hw((a[mt]||null).action),s=i.submitter;s&&(t=(t=s[mt]||null)?Hw(t.formAction):s.getAttribute("formAction"),t!==null&&(l=t,s=null));var r=new Do("action","action",null,i,a);e.push({event:r,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Ta!==0){var o=s?Vw(a,s):new FormData(a);zd(n,{pending:!0,data:o,method:a.method,action:l},null,o)}}else typeof l=="function"&&(r.preventDefault(),o=s?Vw(a,s):new FormData(a),zd(n,{pending:!0,data:o,method:a.method,action:l},l,o))},currentTarget:a}]})}}for(var j2=0;j2<O4.length;j2++){var M2=O4[j2],hv=M2.toLowerCase(),mv=M2[0].toUpperCase()+M2.slice(1);dn(hv,"on"+mv)}dn(j4,"onAnimationEnd"),dn(M4,"onAnimationIteration"),dn(C4,"onAnimationStart"),dn("dblclick","onDoubleClick"),dn("focusin","onFocus"),dn("focusout","onBlur"),dn(Dy,"onTransitionRun"),dn(ky,"onTransitionStart"),dn(Oy,"onTransitionCancel"),dn(D4,"onTransitionEnd"),ul("onMouseEnter",["mouseout","mouseover"]),ul("onMouseLeave",["mouseout","mouseover"]),ul("onPointerEnter",["pointerout","pointerover"]),ul("onPointerLeave",["pointerout","pointerover"]),sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(tr));function Fw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],a=i.event;i=i.listeners;e:{var l=void 0;if(t)for(var s=i.length-1;0<=s;s--){var r=i[s],o=r.instance,c=r.currentTarget;if(r=r.listener,o!==l&&a.isPropagationStopped())break e;l=r,a.currentTarget=c;try{l(a)}catch(d){$o(d)}a.currentTarget=null,l=o}else for(s=0;s<i.length;s++){if(r=i[s],o=r.instance,c=r.currentTarget,r=r.listener,o!==l&&a.isPropagationStopped())break e;l=r,a.currentTarget=c;try{l(a)}catch(d){$o(d)}a.currentTarget=null,l=o}}}}function X(e,t){var n=t[Xf];n===void 0&&(n=t[Xf]=new Set);var i=e+"__bubble";n.has(i)||(qw(t,e,2,!1),n.add(i))}function C2(e,t,n){var i=0;t&&(i|=4),qw(n,e,i,t)}var mu="_reactListening"+Math.random().toString(36).slice(2);function D2(e){if(!e[mu]){e[mu]=!0,Q3.forEach(function(n){n!=="selectionchange"&&(wv.has(n)||C2(n,!1,e),C2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mu]||(t[mu]=!0,C2("selectionchange",!1,t))}}function qw(e,t,n,i){switch(dg(t)){case 2:var a=Vv;break;case 8:a=Fv;break;default:a=Y2}n=a.bind(null,t,n,e),a=void 0,!$f||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function k2(e,t,n,i,a){var l=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var r=i.stateNode.containerInfo;if(r===a||r.nodeType===8&&r.parentNode===a)break;if(s===4)for(s=i.return;s!==null;){var o=s.tag;if((o===3||o===4)&&(o=s.stateNode.containerInfo,o===a||o.nodeType===8&&o.parentNode===a))return;s=s.return}for(;r!==null;){if(s=la(r),s===null)return;if(o=s.tag,o===5||o===6||o===26||o===27){i=l=s;continue e}r=r.parentNode}}i=i.return}a4(function(){var c=l,d=Jf(n),h=[];e:{var f=k4.get(e);if(f!==void 0){var w=Do,v=e;switch(e){case"keypress":if(Mo(n)===0)break e;case"keydown":case"keyup":w=oy;break;case"focusin":v="focus",w=id;break;case"focusout":v="blur",w=id;break;case"beforeblur":case"afterblur":w=id;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=r4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=W6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=fy;break;case j4:case M4:case C4:w=$6;break;case D4:w=hy;break;case"scroll":case"scrollend":w=K6;break;case"wheel":w=wy;break;case"copy":case"cut":case"paste":w=ty;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=u4;break;case"toggle":case"beforetoggle":w=py}var x=(t&4)!==0,_=!x&&(e==="scroll"||e==="scrollend"),m=x?f!==null?f+"Capture":null:f;x=[];for(var g=c,y;g!==null;){var b=g;if(y=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||y===null||m===null||(b=bs(g,m),b!=null&&x.push(nr(g,b,y))),_)break;g=g.return}0<x.length&&(f=new w(f,v,null,n,d),h.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",f&&n!==Wf&&(v=n.relatedTarget||n.fromElement)&&(la(v)||v[sl]))break e;if((w||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,w?(v=n.relatedTarget||n.toElement,w=c,v=v?la(v):null,v!==null&&(_=il(v),x=v.tag,v!==_||x!==5&&x!==27&&x!==6)&&(v=null)):(w=null,v=c),w!==v)){if(x=r4,b="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(x=u4,b="onPointerLeave",m="onPointerEnter",g="pointer"),_=w==null?f:vs(w),y=v==null?f:vs(v),f=new x(b,g+"leave",w,n,d),f.target=_,f.relatedTarget=y,b=null,la(d)===c&&(x=new x(m,g+"enter",v,n,d),x.target=y,x.relatedTarget=_,b=x),_=b,w&&v)t:{for(x=w,m=v,g=0,y=x;y;y=Rl(y))g++;for(y=0,b=m;b;b=Rl(b))y++;for(;0<g-y;)x=Rl(x),g--;for(;0<y-g;)m=Rl(m),y--;for(;g--;){if(x===m||m!==null&&x===m.alternate)break t;x=Rl(x),m=Rl(m)}x=null}else x=null;w!==null&&Yw(h,f,w,x,!1),v!==null&&_!==null&&Yw(h,_,v,x,!0)}}e:{if(f=c?vs(c):window,w=f.nodeName&&f.nodeName.toLowerCase(),w==="select"||w==="input"&&f.type==="file")var S=p4;else if(w4(f))if(y4)S=Ny;else{S=Ty;var A=_y}else w=f.nodeName,!w||w.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?c&&If(c.elementType)&&(S=p4):S=Ay;if(S&&(S=S(e,c))){g4(h,S,n,d);break e}A&&A(e,f,c),e==="focusout"&&c&&f.type==="number"&&c.memoizedProps.value!=null&&Kf(f,"number",f.value)}switch(A=c?vs(c):window,e){case"focusin":(w4(A)||A.contentEditable==="true")&&(wl=A,ud=c,js=null);break;case"focusout":js=ud=wl=null;break;case"mousedown":cd=!0;break;case"contextmenu":case"mouseup":case"dragend":cd=!1,A4(h,n,d);break;case"selectionchange":if(Cy)break;case"keydown":case"keyup":A4(h,n,d)}var T;if(ld)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else ml?h4(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(c4&&n.locale!=="ko"&&(ml||N!=="onCompositionStart"?N==="onCompositionEnd"&&ml&&(T=l4()):(Ti=d,ed="value"in Ti?Ti.value:Ti.textContent,ml=!0)),A=wu(c,N),0<A.length&&(N=new o4(N,e,null,n,d),h.push({event:N,listeners:A}),T?N.data=T:(T=m4(n),T!==null&&(N.data=T)))),(T=vy?by(e,n):xy(e,n))&&(N=wu(c,"onBeforeInput"),0<N.length&&(A=new o4("onBeforeInput","beforeinput",null,n,d),h.push({event:A,listeners:N}),A.data=T)),dv(h,e,c,n,d)}Fw(h,t)})}function nr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wu(e,t){for(var n=t+"Capture",i=[];e!==null;){var a=e,l=a.stateNode;a=a.tag,a!==5&&a!==26&&a!==27||l===null||(a=bs(e,n),a!=null&&i.unshift(nr(e,a,l)),a=bs(e,t),a!=null&&i.push(nr(e,a,l))),e=e.return}return i}function Rl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yw(e,t,n,i,a){for(var l=t._reactName,s=[];n!==null&&n!==i;){var r=n,o=r.alternate,c=r.stateNode;if(r=r.tag,o!==null&&o===i)break;r!==5&&r!==26&&r!==27||c===null||(o=c,a?(c=bs(n,l),c!=null&&s.unshift(nr(n,c,o))):a||(c=bs(n,l),c!=null&&s.push(nr(n,c,o)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var gv=/\r\n?/g,pv=/\u0000|\uFFFD/g;function Xw(e){return(typeof e=="string"?e:""+e).replace(gv,`
|
|
106
|
+
`).replace(pv,"")}function Qw(e,t){return t=Xw(t),Xw(e)===t}function gu(){}function te(e,t,n,i,a,l){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||fl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&fl(e,""+i);break;case"className":_o(e,"class",i);break;case"tabIndex":_o(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":_o(e,n,i);break;case"style":n4(e,i,l);break;case"data":if(t!=="object"){_o(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=No(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof l=="function"&&(n==="formAction"?(t!=="input"&&te(e,t,"name",a.name,a,null),te(e,t,"formEncType",a.formEncType,a,null),te(e,t,"formMethod",a.formMethod,a,null),te(e,t,"formTarget",a.formTarget,a,null)):(te(e,t,"encType",a.encType,a,null),te(e,t,"method",a.method,a,null),te(e,t,"target",a.target,a,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=No(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=gu);break;case"onScroll":i!=null&&X("scroll",e);break;case"onScrollEnd":i!=null&&X("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(E(61));if(n=i.__html,n!=null){if(a.children!=null)throw Error(E(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=No(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":X("beforetoggle",e),X("toggle",e),So(e,"popover",i);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":So(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Q6.get(n)||n,So(e,n,i))}}function O2(e,t,n,i,a,l){switch(n){case"style":n4(e,i,l);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(E(61));if(n=i.__html,n!=null){if(a.children!=null)throw Error(E(60));e.innerHTML=n}}break;case"children":typeof i=="string"?fl(e,i):(typeof i=="number"||typeof i=="bigint")&&fl(e,""+i);break;case"onScroll":i!=null&&X("scroll",e);break;case"onScrollEnd":i!=null&&X("scrollend",e);break;case"onClick":i!=null&&(e.onclick=gu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Z3.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),l=e[mt]||null,l=l!=null?l[n]:null,typeof l=="function"&&e.removeEventListener(t,l,a),typeof i=="function")){typeof l!="function"&&l!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,a);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):So(e,n,i)}}}function Ie(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":X("error",e),X("load",e);var i=!1,a=!1,l;for(l in n)if(n.hasOwnProperty(l)){var s=n[l];if(s!=null)switch(l){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(E(137,t));default:te(e,t,l,s,n,null)}}a&&te(e,t,"srcSet",n.srcSet,n,null),i&&te(e,t,"src",n.src,n,null);return;case"input":X("invalid",e);var r=l=s=a=null,o=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var d=n[i];if(d!=null)switch(i){case"name":a=d;break;case"type":s=d;break;case"checked":o=d;break;case"defaultChecked":c=d;break;case"value":l=d;break;case"defaultValue":r=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(E(137,t));break;default:te(e,t,i,d,n,null)}}P3(e,l,r,o,c,s,a,!1),To(e);return;case"select":X("invalid",e),i=s=l=null;for(a in n)if(n.hasOwnProperty(a)&&(r=n[a],r!=null))switch(a){case"value":l=r;break;case"defaultValue":s=r;break;case"multiple":i=r;default:te(e,t,a,r,n,null)}t=l,n=s,e.multiple=!!i,t!=null?cl(e,!!i,t,!1):n!=null&&cl(e,!!i,n,!0);return;case"textarea":X("invalid",e),l=a=i=null;for(s in n)if(n.hasOwnProperty(s)&&(r=n[s],r!=null))switch(s){case"value":i=r;break;case"defaultValue":a=r;break;case"children":l=r;break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(E(91));break;default:te(e,t,s,r,n,null)}e4(e,i,a,l),To(e);return;case"option":for(o in n)if(n.hasOwnProperty(o)&&(i=n[o],i!=null))switch(o){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:te(e,t,o,i,n,null)}return;case"dialog":X("cancel",e),X("close",e);break;case"iframe":case"object":X("load",e);break;case"video":case"audio":for(i=0;i<tr.length;i++)X(tr[i],e);break;case"image":X("error",e),X("load",e);break;case"details":X("toggle",e);break;case"embed":case"source":case"link":X("error",e),X("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(E(137,t));default:te(e,t,c,i,n,null)}return;default:if(If(t)){for(d in n)n.hasOwnProperty(d)&&(i=n[d],i!==void 0&&O2(e,t,d,i,n,void 0));return}}for(r in n)n.hasOwnProperty(r)&&(i=n[r],i!=null&&te(e,t,r,i,n,null))}function yv(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,l=null,s=null,r=null,o=null,c=null,d=null;for(w in n){var h=n[w];if(n.hasOwnProperty(w)&&h!=null)switch(w){case"checked":break;case"value":break;case"defaultValue":o=h;default:i.hasOwnProperty(w)||te(e,t,w,null,i,h)}}for(var f in i){var w=i[f];if(h=n[f],i.hasOwnProperty(f)&&(w!=null||h!=null))switch(f){case"type":l=w;break;case"name":a=w;break;case"checked":c=w;break;case"defaultChecked":d=w;break;case"value":s=w;break;case"defaultValue":r=w;break;case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(E(137,t));break;default:w!==h&&te(e,t,f,w,i,h)}}Zf(e,s,r,o,c,d,l,a);return;case"select":w=s=r=f=null;for(l in n)if(o=n[l],n.hasOwnProperty(l)&&o!=null)switch(l){case"value":break;case"multiple":w=o;default:i.hasOwnProperty(l)||te(e,t,l,null,i,o)}for(a in i)if(l=i[a],o=n[a],i.hasOwnProperty(a)&&(l!=null||o!=null))switch(a){case"value":f=l;break;case"defaultValue":r=l;break;case"multiple":s=l;default:l!==o&&te(e,t,a,l,i,o)}t=r,n=s,i=w,f!=null?cl(e,!!n,f,!1):!!i!=!!n&&(t!=null?cl(e,!!n,t,!0):cl(e,!!n,n?[]:"",!1));return;case"textarea":w=f=null;for(r in n)if(a=n[r],n.hasOwnProperty(r)&&a!=null&&!i.hasOwnProperty(r))switch(r){case"value":break;case"children":break;default:te(e,t,r,null,i,a)}for(s in i)if(a=i[s],l=n[s],i.hasOwnProperty(s)&&(a!=null||l!=null))switch(s){case"value":f=a;break;case"defaultValue":w=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(E(91));break;default:a!==l&&te(e,t,s,a,i,l)}$3(e,f,w);return;case"option":for(var v in n)if(f=n[v],n.hasOwnProperty(v)&&f!=null&&!i.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:te(e,t,v,null,i,f)}for(o in i)if(f=i[o],w=n[o],i.hasOwnProperty(o)&&f!==w&&(f!=null||w!=null))switch(o){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:te(e,t,o,f,i,w)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in n)f=n[x],n.hasOwnProperty(x)&&f!=null&&!i.hasOwnProperty(x)&&te(e,t,x,null,i,f);for(c in i)if(f=i[c],w=n[c],i.hasOwnProperty(c)&&f!==w&&(f!=null||w!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(E(137,t));break;default:te(e,t,c,f,i,w)}return;default:if(If(t)){for(var _ in n)f=n[_],n.hasOwnProperty(_)&&f!==void 0&&!i.hasOwnProperty(_)&&O2(e,t,_,void 0,i,f);for(d in i)f=i[d],w=n[d],!i.hasOwnProperty(d)||f===w||f===void 0&&w===void 0||O2(e,t,d,f,i,w);return}}for(var m in n)f=n[m],n.hasOwnProperty(m)&&f!=null&&!i.hasOwnProperty(m)&&te(e,t,m,null,i,f);for(h in i)f=i[h],w=n[h],!i.hasOwnProperty(h)||f===w||f==null&&w==null||te(e,t,h,f,i,w)}var L2=null,U2=null;function pu(e){return e.nodeType===9?e:e.ownerDocument}function Zw(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Kw(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function z2(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var R2=null;function vv(){var e=window.event;return e&&e.type==="popstate"?e===R2?!1:(R2=e,!0):(R2=null,!1)}var Iw=typeof setTimeout=="function"?setTimeout:void 0,bv=typeof clearTimeout=="function"?clearTimeout:void 0,Ww=typeof Promise=="function"?Promise:void 0,xv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ww<"u"?function(e){return Ww.resolve(null).then(e).catch(Ev)}:Iw;function Ev(e){setTimeout(function(){throw e})}function B2(e,t){var n=t,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(i===0){e.removeChild(a),cr(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=a}while(n);cr(t)}function G2(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":G2(n),Qf(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Sv(e,t,n,i){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ys])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(l=e.getAttribute("rel"),l==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(l!==a.rel||e.getAttribute("href")!==(a.href==null?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(l=e.getAttribute("src"),(l!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&l&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var l=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===l)return e}else return e;if(e=wn(e.nextSibling),e===null)break}return null}function _v(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=wn(e.nextSibling),e===null))return null;return e}function wn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}function Jw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function Pw(e,t,n){switch(t=pu(n),e){case"html":if(e=t.documentElement,!e)throw Error(E(452));return e;case"head":if(e=t.head,!e)throw Error(E(453));return e;case"body":if(e=t.body,!e)throw Error(E(454));return e;default:throw Error(E(451))}}var ln=new Map,$w=new Set;function yu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.ownerDocument}var li=fe.d;fe.d={f:Tv,r:Av,D:Nv,C:jv,L:Mv,m:Cv,X:kv,S:Dv,M:Ov};function Tv(){var e=li.f(),t=cu();return e||t}function Av(e){var t=rl(e);t!==null&&t.tag===5&&t.type==="form"?Am(t):li.r(e)}var Bl=typeof document>"u"?null:document;function eg(e,t,n){var i=Bl;if(i&&typeof t=="string"&&t){var a=Kt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),$w.has(a)||($w.add(a),e={rel:e,crossOrigin:n,href:t},i.querySelector(a)===null&&(t=i.createElement("link"),Ie(t,"link",e),Ye(t),i.head.appendChild(t)))}}function Nv(e){li.D(e),eg("dns-prefetch",e,null)}function jv(e,t){li.C(e,t),eg("preconnect",e,t)}function Mv(e,t,n){li.L(e,t,n);var i=Bl;if(i&&e&&t){var a='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Kt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Kt(n.imageSizes)+'"]')):a+='[href="'+Kt(e)+'"]';var l=a;switch(t){case"style":l=Gl(e);break;case"script":l=Hl(e)}ln.has(l)||(e=ce({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ln.set(l,e),i.querySelector(a)!==null||t==="style"&&i.querySelector(ir(l))||t==="script"&&i.querySelector(ar(l))||(t=i.createElement("link"),Ie(t,"link",e),Ye(t),i.head.appendChild(t)))}}function Cv(e,t){li.m(e,t);var n=Bl;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Kt(i)+'"][href="'+Kt(e)+'"]',l=a;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=Hl(e)}if(!ln.has(l)&&(e=ce({rel:"modulepreload",href:e},t),ln.set(l,e),n.querySelector(a)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ar(l)))return}i=n.createElement("link"),Ie(i,"link",e),Ye(i),n.head.appendChild(i)}}}function Dv(e,t,n){li.S(e,t,n);var i=Bl;if(i&&e){var a=ol(i).hoistableStyles,l=Gl(e);t=t||"default";var s=a.get(l);if(!s){var r={loading:0,preload:null};if(s=i.querySelector(ir(l)))r.loading=5;else{e=ce({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ln.get(l))&&H2(e,n);var o=s=i.createElement("link");Ye(o),Ie(o,"link",e),o._p=new Promise(function(c,d){o.onload=c,o.onerror=d}),o.addEventListener("load",function(){r.loading|=1}),o.addEventListener("error",function(){r.loading|=2}),r.loading|=4,vu(s,t,i)}s={type:"stylesheet",instance:s,count:1,state:r},a.set(l,s)}}}function kv(e,t){li.X(e,t);var n=Bl;if(n&&e){var i=ol(n).hoistableScripts,a=Hl(e),l=i.get(a);l||(l=n.querySelector(ar(a)),l||(e=ce({src:e,async:!0},t),(t=ln.get(a))&&V2(e,t),l=n.createElement("script"),Ye(l),Ie(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},i.set(a,l))}}function Ov(e,t){li.M(e,t);var n=Bl;if(n&&e){var i=ol(n).hoistableScripts,a=Hl(e),l=i.get(a);l||(l=n.querySelector(ar(a)),l||(e=ce({src:e,async:!0,type:"module"},t),(t=ln.get(a))&&V2(e,t),l=n.createElement("script"),Ye(l),Ie(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},i.set(a,l))}}function tg(e,t,n,i){var a=(a=Ei.current)?yu(a):null;if(!a)throw Error(E(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Gl(n.href),n=ol(a).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Gl(n.href);var l=ol(a).hoistableStyles,s=l.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},l.set(e,s),(l=a.querySelector(ir(e)))&&!l._p&&(s.instance=l,s.state.loading=5),ln.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ln.set(e,n),l||Lv(a,e,n,s.state))),t&&i===null)throw Error(E(528,""));return s}if(t&&i!==null)throw Error(E(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Hl(n),n=ol(a).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(E(444,e))}}function Gl(e){return'href="'+Kt(e)+'"'}function ir(e){return'link[rel="stylesheet"]['+e+"]"}function ng(e){return ce({},e,{"data-precedence":e.precedence,precedence:null})}function Lv(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Ie(t,"link",n),Ye(t),e.head.appendChild(t))}function Hl(e){return'[src="'+Kt(e)+'"]'}function ar(e){return"script[async]"+e}function ig(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Kt(n.href)+'"]');if(i)return t.instance=i,Ye(i),i;var a=ce({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ye(i),Ie(i,"style",a),vu(i,n.precedence,e),t.instance=i;case"stylesheet":a=Gl(n.href);var l=e.querySelector(ir(a));if(l)return t.state.loading|=4,t.instance=l,Ye(l),l;i=ng(n),(a=ln.get(a))&&H2(i,a),l=(e.ownerDocument||e).createElement("link"),Ye(l);var s=l;return s._p=new Promise(function(r,o){s.onload=r,s.onerror=o}),Ie(l,"link",i),t.state.loading|=4,vu(l,n.precedence,e),t.instance=l;case"script":return l=Hl(n.src),(a=e.querySelector(ar(l)))?(t.instance=a,Ye(a),a):(i=n,(a=ln.get(l))&&(i=ce({},n),V2(i,a)),e=e.ownerDocument||e,a=e.createElement("script"),Ye(a),Ie(a,"link",i),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(E(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,vu(i,n.precedence,e));return t.instance}function vu(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=i.length?i[i.length-1]:null,l=a,s=0;s<i.length;s++){var r=i[s];if(r.dataset.precedence===t)l=r;else if(l!==a)break}l?l.parentNode.insertBefore(e,l.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function H2(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function V2(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var bu=null;function ag(e,t,n){if(bu===null){var i=new Map,a=bu=new Map;a.set(n,i)}else a=bu,i=a.get(n),i||(i=new Map,a.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var l=n[a];if(!(l[ys]||l[Pe]||e==="link"&&l.getAttribute("rel")==="stylesheet")&&l.namespaceURI!=="http://www.w3.org/2000/svg"){var s=l.getAttribute(t)||"";s=e+s;var r=i.get(s);r?r.push(l):i.set(s,[l])}}return i}function lg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Uv(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function sg(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var lr=null;function zv(){}function Rv(e,t,n){if(lr===null)throw Error(E(475));var i=lr;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var a=Gl(n.href),l=e.querySelector(ir(a));if(l){e=l._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=xu.bind(i),e.then(i,i)),t.state.loading|=4,t.instance=l,Ye(l);return}l=e.ownerDocument||e,n=ng(n),(a=ln.get(a))&&H2(n,a),l=l.createElement("link"),Ye(l);var s=l;s._p=new Promise(function(r,o){s.onload=r,s.onerror=o}),Ie(l,"link",n),t.instance=l}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(i.count++,t=xu.bind(i),e.addEventListener("load",t),e.addEventListener("error",t))}}function Bv(){if(lr===null)throw Error(E(475));var e=lr;return e.stylesheets&&e.count===0&&F2(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&F2(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function xu(){if(this.count--,this.count===0){if(this.stylesheets)F2(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Eu=null;function F2(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Eu=new Map,t.forEach(Gv,e),Eu=null,xu.call(e))}function Gv(e,t){if(!(t.state.loading&4)){var n=Eu.get(e);if(n)var i=n.get(null);else{n=new Map,Eu.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),l=0;l<a.length;l++){var s=a[l];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}a=t.instance,s=a.getAttribute("data-precedence"),l=n.get(s)||i,l===i&&n.set(null,a),n.set(s,a),this.count++,i=xu.bind(this),a.addEventListener("load",i),a.addEventListener("error",i),l?l.parentNode.insertBefore(a,l.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var sr={$$typeof:Fn,Provider:null,Consumer:null,_currentValue:ia,_currentValue2:ia,_threadCount:0};function Hv(e,t,n,i,a,l,s,r){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.hiddenUpdates=Yf(null),this.identifierPrefix=i,this.onUncaughtError=a,this.onCaughtError=l,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=r,this.incompleteTransitions=new Map}function rg(e,t,n,i,a,l,s,r,o,c,d,h){return e=new Hv(e,t,n,s,r,o,c,h),t=1,l===!0&&(t|=24),l=nn(3,null,null,t),e.current=l,l.stateNode=e,t=bd(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:i,isDehydrated:n,cache:t},e2(l),e}function og(e){return e?(e=yl,e):yl}function ug(e,t,n,i,a,l){a=og(a),i.context===null?i.context=a:i.pendingContext=a,i=Oi(t),i.payload={element:n},l=l===void 0?null:l,l!==null&&(i.callback=l),n=Li(e,i,t),n!==null&&(lt(n,e,t),qs(n,e,t))}function cg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function q2(e,t){cg(e,t),(e=e.alternate)&&cg(e,t)}function fg(e){if(e.tag===13){var t=Ai(e,67108864);t!==null&<(t,e,67108864),q2(e,67108864)}}var Su=!0;function Vv(e,t,n,i){var a=G.T;G.T=null;var l=fe.p;try{fe.p=2,Y2(e,t,n,i)}finally{fe.p=l,G.T=a}}function Fv(e,t,n,i){var a=G.T;G.T=null;var l=fe.p;try{fe.p=8,Y2(e,t,n,i)}finally{fe.p=l,G.T=a}}function Y2(e,t,n,i){if(Su){var a=X2(i);if(a===null)k2(e,t,i,_u,n),hg(e,i);else if(Yv(a,e,t,n,i))i.stopPropagation();else if(hg(e,i),t&4&&-1<qv.indexOf(e)){for(;a!==null;){var l=rl(a);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var s=aa(l.pendingLanes);if(s!==0){var r=l;for(r.pendingLanes|=2,r.entangledLanes|=2;s;){var o=1<<31-Dt(s);r.entanglements[1]|=o,s&=~o}kn(l),!(be&6)&&(ru=Nn()+500,er(0))}}break;case 13:r=Ai(l,2),r!==null&<(r,l,2),cu(),q2(l,2)}if(l=X2(i),l===null&&k2(e,t,i,_u,n),l===a)break;a=l}a!==null&&i.stopPropagation()}else k2(e,t,i,null,n)}}function X2(e){return e=Jf(e),Q2(e)}var _u=null;function Q2(e){if(_u=null,e=la(e),e!==null){var t=il(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=O3(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _u=e,null}function dg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(j6()){case z3:return 2;case R3:return 8;case vo:case M6:return 32;case B3:return 268435456;default:return 32}default:return 32}}var Z2=!1,Vi=null,Fi=null,qi=null,rr=new Map,or=new Map,Yi=[],qv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hg(e,t){switch(e){case"focusin":case"focusout":Vi=null;break;case"dragenter":case"dragleave":Fi=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":rr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":or.delete(t.pointerId)}}function ur(e,t,n,i,a,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:l,targetContainers:[a]},t!==null&&(t=rl(t),t!==null&&fg(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Yv(e,t,n,i,a){switch(t){case"focusin":return Vi=ur(Vi,e,t,n,i,a),!0;case"dragenter":return Fi=ur(Fi,e,t,n,i,a),!0;case"mouseover":return qi=ur(qi,e,t,n,i,a),!0;case"pointerover":var l=a.pointerId;return rr.set(l,ur(rr.get(l)||null,e,t,n,i,a)),!0;case"gotpointercapture":return l=a.pointerId,or.set(l,ur(or.get(l)||null,e,t,n,i,a)),!0}return!1}function mg(e){var t=la(e.target);if(t!==null){var n=il(t);if(n!==null){if(t=n.tag,t===13){if(t=O3(n),t!==null){e.blockedOn=t,B6(e.priority,function(){if(n.tag===13){var i=zt(),a=Ai(n,i);a!==null&<(a,n,i),q2(n,i)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Tu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=X2(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Wf=i,n.target.dispatchEvent(i),Wf=null}else return t=rl(n),t!==null&&fg(t),e.blockedOn=n,!1;t.shift()}return!0}function wg(e,t,n){Tu(e)&&n.delete(t)}function Xv(){Z2=!1,Vi!==null&&Tu(Vi)&&(Vi=null),Fi!==null&&Tu(Fi)&&(Fi=null),qi!==null&&Tu(qi)&&(qi=null),rr.forEach(wg),or.forEach(wg)}function Au(e,t){e.blockedOn===t&&(e.blockedOn=null,Z2||(Z2=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,Xv)))}var Nu=null;function gg(e){Nu!==e&&(Nu=e,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,function(){Nu===e&&(Nu=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],a=e[t+2];if(typeof i!="function"){if(Q2(i||n)===null)continue;break}var l=rl(n);l!==null&&(e.splice(t,3),t-=3,zd(l,{pending:!0,data:a,method:n.method,action:i},i,a))}}))}function cr(e){function t(o){return Au(o,e)}Vi!==null&&Au(Vi,e),Fi!==null&&Au(Fi,e),qi!==null&&Au(qi,e),rr.forEach(t),or.forEach(t);for(var n=0;n<Yi.length;n++){var i=Yi[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Yi.length&&(n=Yi[0],n.blockedOn===null);)mg(n),n.blockedOn===null&&Yi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var a=n[i],l=n[i+1],s=a[mt]||null;if(typeof l=="function")s||gg(n);else if(s){var r=null;if(l&&l.hasAttribute("formAction")){if(a=l,s=l[mt]||null)r=s.formAction;else if(Q2(a)!==null)continue}else r=s.action;typeof r=="function"?n[i+1]=r:(n.splice(i,3),i-=3),gg(n)}}}function K2(e){this._internalRoot=e}ju.prototype.render=K2.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(E(409));var n=t.current,i=zt();ug(n,i,e,t,null,null)},ju.prototype.unmount=K2.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e.tag===0&&Ul(),ug(e.current,2,null,e,null,null),cu(),t[sl]=null}};function ju(e){this._internalRoot=e}ju.prototype.unstable_scheduleHydration=function(e){if(e){var t=Y3();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yi.length&&t!==0&&t<Yi[n].priority;n++);Yi.splice(n,0,e),n===0&&mg(e)}};var pg=T3.version;if(pg!=="19.0.0")throw Error(E(527,pg,"19.0.0"));fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(E(188)):(e=Object.keys(e).join(","),Error(E(268,e)));return e=T6(t),e=e!==null?U3(e):null,e=e===null?null:e.stateNode,e};var Qv={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:G,findFiberByHostInstance:la,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mu.isDisabled&&Mu.supportsFiber)try{ws=Mu.inject(Qv),Ct=Mu}catch{}}mo.createRoot=function(e,t){if(!A3(e))throw Error(E(299));var n=!1,i="",a=Lm,l=Um,s=zm,r=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(l=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(r=t.unstable_transitionCallbacks)),t=rg(e,1,!1,null,null,n,i,a,l,s,r,null),e[sl]=t.current,D2(e.nodeType===8?e.parentNode:e),new K2(t)},mo.hydrateRoot=function(e,t,n){if(!A3(e))throw Error(E(299));var i=!1,a="",l=Lm,s=Um,r=zm,o=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(l=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(r=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(o=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),t=rg(e,1,!0,t,n??null,i,a,l,s,r,o,c),t.context=og(null),n=t.current,i=zt(),a=Oi(i),a.callback=null,Li(n,a,i),t.current.lanes=i,ps(t,i),kn(t),e[sl]=t.current,D2(e),new ju(t)},mo.version="19.0.0";function yg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yg)}catch(e){console.error(e)}}yg(),E3.exports=mo;var Zv=E3.exports;const vg=e=>u.jsx("span",{className:"iw-text-2xl",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...e,children:[u.jsx("path",{d:"M0 0C9.01627 8.39148 22.9837 8.39148 32 0C23.6085 9.01627 23.6085 22.9837 32 32C22.9837 23.6085 9.01627 23.6085 0 32C8.39148 22.9837 8.39148 9.01627 0 0Z",fill:"url(#paint0_linear_6039_13039)"}),u.jsx("defs",{children:u.jsxs("linearGradient",{id:"paint0_linear_6039_13039",x1:"16",y1:"-3.5",x2:"41.5",y2:"29",gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{offset:"0.210966",stopColor:"#1E06CB"}),u.jsx("stop",{offset:"0.740385",stopColor:"#DB38EF"})]})})]})}),Kv=()=>u.jsx(qu,{config:{api:{baseUrl:"http://localhost:8000/api",authToken:""},interview:{proctoring:{enabled:!1,gazeAnalysisEnabled:!1,showControls:!1,showEngagementBar:!1,showLandmarks:!1}}},children:u.jsx("div",{className:"interview-widget-container",children:u.jsx(ku,{title:"Frontend Developer",brandName:"Previa",brandLogo:u.jsx(vg,{}),interviewId:"ea3cb06a-c168-4ad3-8084-4165a79473d3",className:"iw-rounded-none iw-shadow-none",onInterviewEnd:()=>{console.log("🎉🎉 Interview ended 🎉🎉"),window.location.reload(),sessionStorage.clear()},onInterviewDisqualify:()=>{console.log("❌ Interview disqualified ❌")}})})}),Iv=document.getElementById("root");Zv.createRoot(Iv).render(u.jsx(Kv,{}));const Wv=(e,t,n)=>Math.max(t,Math.min(n,e)),bg=e=>{const t=Math.max(0,Math.floor(e)),n=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${n}:${i}`},Cu=({total:e,remaining:t,size:n=64,strokeWidth:i=6,className:a="",showLabel:l=!0})=>{const s=Math.max(1,e||1),r=Wv(t/s,0,1),{radius:o,circumference:c,dashOffset:d,center:h}=p.useMemo(()=>{const v=(n-i)/2,x=2*Math.PI*v,_=x*(1-r),m=Math.round(i)%2===1,g=n/2+(m?.5:0);return{radius:v,circumference:x,dashOffset:_,center:g}},[n,i,r]),f=p.useMemo(()=>r<=.25?"iw-stroke-red-500":r<=.5?"iw-stroke-yellow-500":"iw-stroke-green-500",[r]),w=r<=.25?"iw-animate-pulse":"";return u.jsxs("div",{className:`iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${a}`,style:{width:n,height:n},"aria-label":`Time remaining ${bg(t)}`,role:"timer","aria-live":"polite",children:[u.jsx("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,preserveAspectRatio:"xMidYMid meet",children:u.jsxs("g",{transform:`rotate(-90 ${h} ${h})`,children:[u.jsx("circle",{cx:h,cy:h,r:o,className:"iw-stroke-gray-200",strokeWidth:i,fill:"none",shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke"}),u.jsx("circle",{cx:h,cy:h,r:o,className:`${f} ${w}`,strokeWidth:i,strokeLinecap:"round",fill:"none",strokeDasharray:c,strokeDashoffset:d,shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke",style:{transition:"stroke-dashoffset 0.3s ease, stroke 0.2s ease"}})]})}),l?u.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0",children:u.jsx("span",{className:`iw-text-[11px] iw-font-semibold iw-tabular-nums ${r<=.25?"iw-text-red-600":r<=.5?"iw-text-yellow-600":"iw-text-green-600"}`,children:bg(t)})}):u.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0",children:u.jsx(e5,{})})]})},Jv=({timerState:e,answeringTime:t})=>{const n=(e==null?void 0:e.currentPhaseTimeRemaining)||0,i=t||y3.answeringDuration;return u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[u.jsx(Cu,{total:i,remaining:n,size:50,strokeWidth:4,showLabel:!1,className:"iw-shadow-sm iw-border iw-border-gray-100"}),u.jsxs("div",{className:"iw-flex iw-flex-col",children:[u.jsx("span",{className:"iw-text-[#5C6686]",children:"Time left to answer"}),u.jsxs("span",{className:"iw-text-xl iw-font-bold iw-text-[#062260]",children:[Xu(n)," mins"]})]})]})},Pv=({question:e,isLoading:t=!1,phase:n,brandName:i,timerState:a,answeringTime:l})=>u.jsx("div",{className:"iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-py-1",children:u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-4",children:[u.jsx("div",{className:`iw-flex iw-flex-col iw-items-center iw-justify-center iw-relative iw-h-16 iw-w-16 iw-shrink-0 iw-shadow iw-rounded-full iw-border-[#E8EEFE] iw-border-4 ${n===K.READING_QUESTION?"iw-animate-speaking":""}`,children:u.jsx("div",{className:"iw-bg-transparent iw-flex iw-items-center iw-justify-center iw-rounded-full iw-size-full",style:{backgroundImage:"linear-gradient(#B5D0FD, #FFFFFF)"},children:u.jsx(vg,{className:"iw-size-8"})})}),u.jsx($v,{phase:n,question:e,isLoading:t,brandName:i,timerState:a,answeringTime:l})]})}),$v=({phase:e,question:t,isLoading:n,brandName:i,timerState:a,answeringTime:l})=>{const s=i||"We",r=i?"is":"are";if(n||e===K.FETCHING_QUESTION||e===K.IDLE)return u.jsxs("div",{className:"iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10",children:[u.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full"}),u.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4"})]});const o=()=>u.jsxs("span",{className:"iw-animate-dot-wave iw-ml-1",children:[u.jsx("span",{children:"."}),u.jsx("span",{children:"."}),u.jsx("span",{children:"."})]});switch(e){case K.ANSWERING:return u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-w-full",children:[u.jsxs("p",{className:"iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600",children:["Listening",u.jsx(o,{})]}),u.jsx(Jv,{timerState:a,answeringTime:l})]});case K.TRANSCRIBING:return u.jsxs("p",{className:"iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600",children:[s," ",r," analyzing your answer",u.jsx(o,{})]});case(K.EDITING||K.SUBMITTING):return u.jsxs("p",{className:"iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600",children:[s," ",r," waiting for your answer..."]});default:return u.jsx("p",{className:"iw-text-lg iw-leading-7",children:t==null?void 0:t.question})}},e7=({label:e,error:t,fullWidth:n=!1,className:i="",id:a,...l})=>{const s=a||`textarea-${Math.random().toString(36).substring(2,9)}`,r="iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all",o=t?"iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500":"",c=n?"iw-w-full":"",d=i.includes("iw-h-full")||n?"iw-h-full":"";return u.jsxs("div",{className:`iw-h-full iw-flex iw-flex-col ${n?"iw-w-full":""}`,children:[e&&u.jsx("label",{htmlFor:s,className:"iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",children:e}),u.jsx("textarea",{id:s,className:`${r} ${o} ${c} ${d} ${i}`,"aria-invalid":t?"true":"false",...l}),t&&u.jsx("p",{className:"iw-mt-1 iw-text-sm iw-text-red-600",children:t})]})},t7=({answerText:e,onAnswerChange:t,timerState:n,editingTime:i})=>u.jsxs("div",{className:"iw-w-full iw-bg-white iw-rounded-xl iw-border iw-border-[#84bbf5] iw-overflow-hidden iw-rounded-tr-none",children:[u.jsx("div",{className:"iw-p-2 iw-pb-0",children:u.jsx(e7,{value:e,onChange:t,placeholder:"Type your answer here...",className:"iw-w-full iw-h-64 iw-resize-none iw-bg-transparent iw-border-none iw-text-[#062260] iw-text-base iw-leading-relaxed focus-visible:iw-outline-0 iw-p-0",disabled:n.phase===K.SUBMITTING})}),u.jsxs("div",{className:"iw-bg-[#F1F5FE] iw-px-2 iw-py-2 iw-flex iw-items-center iw-justify-between iw-border-t iw-border-[#E8EEFE]",children:[u.jsx("span",{className:"iw-text-[#062260] iw-text-sm iw-font-medium iw-line-clamp-1",children:"Time left to edit answer"}),u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[u.jsx(Cu,{total:i,remaining:n.currentPhaseTimeRemaining,size:32,strokeWidth:3,showLabel:!1}),u.jsx("span",{className:"iw-text-[#062260] iw-text-sm iw-font-bold",children:`${Xu(n.currentPhaseTimeRemaining)} mins`})]})]})]}),xg=({children:e})=>u.jsx("div",{className:"iw-flex iw-flex-col iw-items-start iw-mt-3 iw-gap-1",children:e}),n7=({children:e})=>u.jsx("div",{className:"iw-flex iw-flex-col iw-items-end iw-mt-3 iw-gap-1",children:e}),i7=({questionNumber:e})=>u.jsxs("div",{className:"iw-px-4 iw-py-1.5 iw-rounded-full iw-mb-2 iw-text-sm iw-font-semibold",style:{color:"#062260",backgroundColor:"#E6F3FF",border:"1px solid #BDE0FD"},children:[" Q",e]}),Eg=({label:e})=>u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2 iw-text-sm iw-text-gray-500 iw-bg-[#F1F5FE] iw-px-4 iw-py-1.5 iw-rounded-full iw-my-2 iw-font-semibold",children:[e&&u.jsx("span",{className:"iw-font-medium",children:e}),u.jsxs("span",{className:"iw-animate-dot-wave iw-text-2xl",children:[u.jsx("span",{children:"."}),u.jsx("span",{children:"."}),u.jsx("span",{children:"."})]})]}),a7=({phase:e,questionNumber:t})=>{switch(e){case K.FETCHING_QUESTION:return u.jsxs(xg,{children:[u.jsx(i7,{questionNumber:t+1}),u.jsx(Eg,{})]});case K.ANSWERING:return u.jsx(n7,{children:u.jsx(Eg,{label:"You"})});case K.TRANSCRIBING:return u.jsx(xg,{children:u.jsxs("div",{className:"iw-flex iw-items-center iw-px-1 iw-py-1.5 iw-rounded-lg iw-mb-2 iw-text-sm iw-bg-[#F2E8FE]",children:[u.jsx("img",{src:"../../../../src/assets/transcribing.gif",alt:"Transcribing",className:"iw-h-8 iw-w-12"}),u.jsx("span",{className:"iw-text-sm iw-text-[#062260]",children:"Analyzing answer…"})]})});default:return null}},l7=({item:e,index:t,isCurrentQuestion:n=!1,isEditable:i=!1,answerText:a="",onAnswerChange:l,timerState:s,editingTime:r})=>{const o=i&&s&&r!==void 0,c=o||e.answer;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-start",children:[u.jsxs("div",{className:"iw-px-4 iw-py-1.5 iw-rounded-full iw-mb-2 iw-text-sm iw-font-semibold",style:{color:"#062260",backgroundColor:"#E6F3FF",border:"1px solid #BDE0FD"},children:["Q",t+1]}),u.jsx("div",{className:"iw-w-full iw-p-4 iw-rounded-xl iw-text-[#062260] iw-text-base iw-leading-relaxed iw-rounded-tl-none",style:{backgroundColor:"#F1F5FE",border:n?"2px solid #84bbf5":"1px solid transparent"},children:e.question})]}),c&&u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-end iw-mt-4",children:[u.jsx("div",{className:"iw-px-4 iw-py-1.5 iw-rounded-full iw-mb-2 iw-text-sm iw-font-semibold",style:{color:"#062260",backgroundColor:"#F2E8FE",border:"1px solid #E9D5FF"},children:"You"}),o?u.jsx(t7,{answerText:a||"",onAnswerChange:l,timerState:s,editingTime:r}):u.jsx("div",{className:"iw-w-full iw-p-4 iw-rounded-xl iw-text-[#062260] iw-text-base iw-leading-relaxed iw-rounded-tr-none",style:{backgroundColor:"#F7F1FE"},children:e.answer})]}),n&&u.jsx(a7,{phase:s==null?void 0:s.phase,questionNumber:t+1})]})},s7=()=>u.jsx("div",{className:"iw-space-y-6 iw-animate-pulse",children:[1,2,3].map(e=>u.jsxs("div",{className:`iw-flex iw-flex-col ${e%2===0?"iw-items-end":"iw-items-start"} iw-gap-2`,children:[u.jsx("div",{className:"iw-h-8 iw-w-16 iw-bg-gray-200 iw-rounded-full"}),u.jsx("div",{className:"iw-h-24 iw-w-full iw-bg-gray-100 iw-rounded-xl"})]},e))}),r7=({transcript:e,isLoading:t,className:n="",bottomRef:i,isEditing:a,answerText:l,onAnswerChange:s,timerState:r,editingTime:o})=>u.jsxs("div",{className:`iw-h-full iw-flex iw-flex-col iw-bg-white iw-scroll-smooth iw-p-6 iw-pr-2 iw-min-w-32 iw-border iw-rounded-tr-2xl iw-rounded-br-2xl iw-border-[#E8EEFE] ${n}`,children:[u.jsxs("div",{className:"iw-mb-6",children:[u.jsx("h2",{className:"iw-text-lg iw-font-semibold iw-mb-4",style:{color:"#062260"},children:"Interview transcript"}),u.jsx("div",{className:"iw-h-px iw-w-full iw-border-t iw-border-dashed iw-border-gray-300"})]}),u.jsxs("div",{className:"iw-flex-1 iw-overflow-y-auto iw-pr-2 iw-space-y-6 iw-scrollbar-thin iw-max-w-xl iw-pb-5",children:[t?u.jsx(s7,{}):e==null?void 0:e.map((c,d)=>u.jsx(l7,{item:c,index:d,isCurrentQuestion:d===(e==null?void 0:e.length)-1,isEditable:!!(d===(e==null?void 0:e.length)-1&&a),answerText:l||"",onAnswerChange:s||(()=>{}),timerState:r,editingTime:o},c.qna_id)),u.jsx("div",{ref:i})]})]}),o7=({interviewId:e,className:t="",currentQuestion:n,lastSubmittedAnswer:i,isEditing:a,answerText:l,onAnswerChange:s,timerState:r,editingTime:o})=>{const c=b3(),[d,h]=p.useState([]),[f,w]=p.useState(!0),v=p.useRef(null);return p.useEffect(()=>{var x;(x=v.current)==null||x.scrollIntoView({behavior:"smooth"})},[d,l,r==null?void 0:r.phase]),p.useEffect(()=>{(async()=>{var _;try{const m=await c.getInterviewTranscription(e);h(((_=m==null?void 0:m.data)==null?void 0:_.question_answers)||[])}catch(m){console.error("Failed to fetch transcript:",m)}finally{w(!1)}})()},[e,c]),p.useEffect(()=>{n&&h(x=>{if(x.some(g=>g.qna_id===n.qna_id))return x;const m={qna_id:n.qna_id,question:n.question,answer:null,question_generated_at:new Date().toISOString(),answer_submitted_at:null};return[...x,m]})},[n]),p.useEffect(()=>{i!=null&&i.answer?h(x=>x.map(_=>_.qna_id===i.qnaId?{..._,answer:i.answer,answer_submitted_at:new Date().toISOString()}:_)):l&&h(x=>x.map(_=>_.qna_id===(i==null?void 0:i.qnaId)?{..._,answer:l,answer_submitted_at:new Date().toISOString()}:_))},[i,l]),u.jsx(r7,{transcript:d,isLoading:f||(d==null?void 0:d.length)===0,className:t,bottomRef:v,isEditing:a,answerText:l,onAnswerChange:s,timerState:r,editingTime:o})},u7=({onClick:e,text:t="Submit response"})=>(p.useEffect(()=>{if(typeof window>"u")return;const n=i=>{const a=i.metaKey||i.ctrlKey,l=i.key===" ",s=i.target;s.tagName==="INPUT"||s.isContentEditable||a&&l&&(i.preventDefault(),e())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e]),u.jsx("div",{className:"iw-fixed iw-bottom-10 iw-left-1/4 iw-transform iw--translate-x-1/2 iw-z-50",children:u.jsxs("button",{onClick:e,className:"iw-flex iw-items-center iw-gap-3 iw-bg-[#4C6CFF] hover:iw-bg-[#4c6dffd5] iw-text-white iw-px-5 iw-py-3 iw-rounded-lg iw-shadow-lg iw-transition-all iw-duration-200 iw-group",children:[u.jsx("span",{className:"iw-font-semibold iw-text-sm",children:t}),u.jsx("span",{className:"iw-bg-white/90 iw-text-[#062260] iw-px-2 iw-py-1 iw-rounded iw-text-xs iw-font-mono iw-font-bold group-hover:iw-bg-white iw-transition-colors",children:"Press Ctrl / ⌘ + Space"})]})})),Sg=({brandName:e,currentQuestion:t,state:n,phase:i,className:a="",interviewId:l="",interview_duration:s=gr,videoFeedRef:r,lastSubmittedAnswer:o,onNextPhase:c,answerText:d,onAnswerChange:h,editingTime:f,answeringTime:w})=>u.jsxs("div",{className:`iw-px-4 iw-py-3 ${a} iw-h-[calc(100vh_-_120px)] iw-max-h-[calc(100vh_-_120px)] iw-flex iw-gap-0 iw-relative`,children:[u.jsxs("div",{className:"iw-flex iw-flex-col iw-flex-1 iw-p-5 iw-bg-white/50 iw-border iw-border-[#E8EEFE] iw-rounded-s-3xl iw-overflow-hidden",children:[u.jsx("div",{className:"iw-flex iw-items-start iw-justify-between iw-gap-3 iw-mb-4",children:u.jsx("div",{className:"iw-flex-1",children:u.jsx(Pv,{question:t,isLoading:i===K.FETCHING_QUESTION||i===K.IDLE,phase:i,brandName:e,timerState:n,answeringTime:w})})}),u.jsx("div",{className:"iw-flex-1 iw-min-h-0 iw-rounded-[16px] iw-overflow-hidden iw-relative",children:u.jsx(g3,{ref:r,interviewId:l,interview_duration:s,isAnswering:i===K.ANSWERING})})]}),u.jsx("div",{className:"iw-interview-transcription iw-w-1/4 iw-min-w-32 iw-h-full",children:u.jsx(o7,{interviewId:l,currentQuestion:t,lastSubmittedAnswer:o,isEditing:i===K.EDITING,answerText:d,onAnswerChange:h,timerState:n,editingTime:f})}),c&&(i===K.ANSWERING||i===K.EDITING)&&u.jsx(u7,{onClick:c,text:i===K.ANSWERING?"Submit Response":"Submit Final Response"})]}),c7=({confirmExitInterview:e,isOpen:t,onClose:n})=>u.jsx(Mf,{isOpen:t,onClose:n,title:"Exit Interview",closeOnOverlayClick:!1,children:u.jsxs("div",{className:"iw-space-y-5",children:[u.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3 iw-rounded-xl iw-p-2",children:[u.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-bg-rose-100 iw-text-rose-600",children:"!"}),u.jsxs("div",{className:"iw-space-y-2",children:[u.jsx("p",{className:"iw-text-sm iw-font-semibold iw-text-rose-600",children:"Leaving now will end your interview !"}),u.jsx("p",{className:"iw-text-sm iw-text-slate-500",children:"Are you sure you want to exit? All progress will be lost and you will not be able to resume."})]})]}),u.jsxs("div",{className:"iw-flex iw-flex-col-reverse iw-gap-2 sm:iw-flex-row sm:iw-items-center sm:iw-justify-end iw-pb-1",children:[u.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-border iw-border-slate-200 iw-bg-white iw-px-4 iw-py-2 iw-text-sm iw-font-medium iw-text-slate-600 iw-shadow-sm iw-transition hover:iw-bg-slate-50",onClick:n,children:"Stay in interview"}),u.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-px-4 iw-py-2 iw-text-sm iw-font-semibold iw-text-white iw-transition hover:iw-brightness-110",style:{background:"linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))",boxShadow:"0 12px 30px -16px rgba(244, 63, 94, 0.65)"},onClick:e,children:"Confirm exit"})]})]})}),_g=({title:e,brandName:t,brandLogo:n,onExit:i,totalDuration:a=30,elapsedTime:l=0})=>{const{baseColor:s}=yr(),[r,o]=p.useState(!1),c=Math.min(l/(a*60)*100,100),d=()=>u.jsxs("div",{className:"iw-px-4 iw-pb-2 iw-flex iw-items-center iw-gap-3",children:[u.jsx("div",{className:"iw-flex-1 iw-h-4 iw-bg-[#F2F4F7] iw-rounded-full iw-overflow-hidden iw-border iw-border-blue-100 iw-relative",children:u.jsx("div",{className:"iw-h-full iw-bg-[#0EB00E] iw-rounded-full iw-transition-all iw-duration-1000 iw-ease-linear",style:{width:`${c}%`}})}),u.jsxs("div",{className:"iw-text-sm iw-font-medium iw-whitespace-nowrap",children:[u.jsx("span",{className:"iw-text-[#062260]",children:Xu(l)}),u.jsxs("span",{className:"iw-text-[#667085]",children:["/",a," Min"]})]})]});return u.jsxs("header",{className:"iw-w-full iw-text-gray-900 iw-shadow-sm",children:[u.jsxs("div",{className:"iw-mx-auto iw-flex iw-items-center iw-justify-between iw-p-4 iw-pt-1 iw-mb-2 iw-border-b iw-border-[#B3B9CB] iw-border-dashed",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-space-x-2",children:[n||u.jsx("div",{className:"iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",style:{backgroundColor:s},children:ah(t)}),u.jsx("p",{className:"iw-text-xl iw-font-semibold",children:t})]}),u.jsx("h1",{className:"iw-text-2xl iw-font-semibold iw-text-gradient-silver",children:e}),u.jsx("button",{className:"iw-text-sm iw-text-[#E94315] iw-min-w-10 iw-rounded-md hover:iw-bg-orange-100 iw-p-2",onClick:()=>o(!0),children:u.jsxs("span",{className:"iw-flex iw-items-center iw-gap-1 iw-text-[18px] iw-font-semibold iw-whitespace-nowrap",children:[u.jsx(sh,{className:"iw-text-[#E94315] iw-size-5"}),"Leave interview"]})})]}),u.jsx(d,{}),u.jsx("div",{className:"iw-h-px iw-bg-gray-200"}),u.jsx(c7,{isOpen:r,confirmExitInterview:()=>{i(),o(!1)},onClose:()=>o(!1)})]})},f7=({className:e="",width:t,height:n=56,barWidth:i=3,gap:a=2,fftSize:l=1024,smoothingTimeConstant:s=.8,mediaStream:r,startOnMount:o=!0})=>{const{baseColor:c}=yr(),d=p.useRef(null),h=p.useRef(null),f=p.useRef(null),w=p.useRef(null),v=p.useRef(null),x=p.useRef(null),_=p.useRef(!1),[m,g]=p.useState(null);p.useEffect(()=>{if(t||!h.current)return;const b=h.current,S=()=>{const T=d.current;if(!T)return;const N=b.clientWidth,M=n;T.width=Math.max(1,Math.floor(N*window.devicePixelRatio||1)),T.height=Math.max(1,Math.floor(M*window.devicePixelRatio||1))},A=new ResizeObserver(S);return A.observe(b),S(),()=>A.disconnect()},[t,n]),p.useEffect(()=>{if(!t)return;const b=d.current;b&&(b.width=Math.max(1,Math.floor(t*(window.devicePixelRatio||1))),b.height=Math.max(1,Math.floor(n*(window.devicePixelRatio||1))))},[t,n]),p.useEffect(()=>{let b=!1;return(async()=>{try{const A=new(window.AudioContext||window.webkitAudioContext);f.current=A;let T=r;if(!T){if(!o)return;T=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),_.current=!0}if(b)return;const N=A.createAnalyser();N.fftSize=l,N.smoothingTimeConstant=s,w.current=N;const M=A.createMediaStreamSource(T);v.current=M,M.connect(N),y()}catch(A){g((A==null?void 0:A.message)||"Failed to initialize microphone")}})(),()=>{var A,T,N,M;b=!0,x.current&&cancelAnimationFrame(x.current);try{(A=v.current)==null||A.disconnect()}catch{}try{(T=w.current)==null||T.disconnect()}catch{}_.current&&((M=((N=v.current)==null?void 0:N.mediaStream)||void 0)==null||M.getTracks().forEach(D=>D.stop())),f.current&&f.current.state!=="closed"&&f.current.close()}},[r,l,s,o]);const y=()=>{const b=d.current,S=w.current;if(!b||!S)return;const A=b.getContext("2d");if(!A)return;const T=window.devicePixelRatio||1,N=b.width,M=b.height,D=S.frequencyBinCount,ge=new Uint8Array(D),et=()=>{x.current=requestAnimationFrame(et),S.getByteTimeDomainData(ge),A.clearRect(0,0,N,M),A.fillStyle="rgba(0,0,0,0)",A.fillRect(0,0,N,M);const pt=Math.max(1,Math.floor(i*T)),yt=Math.max(1,Math.floor(a*T)),vt=pt+yt,j=Math.max(8,Math.floor((N+yt)/vt)),B=Math.floor(ge.length/j);for(let R=0;R<j;R++){const J=Math.min(ge.length-1,R*B),ae=ge[J]/128-1,st=Math.abs(ae),gn=Math.pow(st,.6),sn=Math.max(M*.06,gn*(M*.9)),Rt=R*vt,rt=(M-sn)/2,ot=140-Math.min(140,140*st),rn=85,Ce=48+Math.floor(12*(1-st));A.fillStyle=`${c}`,A.shadowColor=`hsla(${ot}, ${rn}%, ${Ce}%, ${.25*st})`,A.shadowBlur=8*st;const Xi=Math.min(pt/2,sn/2);d7(A,Rt,rt,pt,sn,Xi),A.fill()}};et()};return u.jsxs("div",{ref:h,className:`iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${e}`,style:{height:n},children:[u.jsx("canvas",{ref:d,className:"iw-w-full iw-h-full"}),m&&u.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center",children:u.jsx("span",{className:"iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded",children:m})})]})};function d7(e,t,n,i,a,l){const s=Math.min(l,i/2,a/2);e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+i-s,n),e.quadraticCurveTo(t+i,n,t+i,n+s),e.lineTo(t+i,n+a-s),e.quadraticCurveTo(t+i,n+a,t+i-s,n+a),e.lineTo(t+s,n+a),e.quadraticCurveTo(t,n+a,t,n+a-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath()}const h7=({state:e,answeringTime:t,nextPhase:n,sttError:i})=>u.jsxs("div",{className:"iw-flex iw-flex-col iw-justify-between iw-h-full ",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"You may start speaking now. We're listening...."}),u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[u.jsx(lh,{className:"iw-size-4 iw-text-orange-600"}),u.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to talk: "})]}),u.jsx(Cu,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]})]}),u.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"Done talking? Click the button to review your answer."})]}),u.jsxs("div",{children:[u.jsx(f7,{}),i&&u.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Recording error: ",i.message]})]}),u.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:u.jsx(us,{onClick:()=>{n()},children:"Transcribe My Answer"})})]});function m7(){const[e,t]=p.useState(!0),n=p.useMemo(()=>[0,1,2].map(i=>({id:i})),[]);return p.useEffect(()=>{const i=setInterval(()=>{t(a=>!a)},1500);return()=>clearInterval(i)},[]),u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full",children:[u.jsx("div",{className:"iw-relative iw-w-80 iw-h-48 ","aria-hidden":!0,children:n.map((i,a)=>{const l=a*50,s=e?l:l+12,r=e?1:.08,o=a*140;return u.jsx("div",{role:"presentation",className:"iw-absolute iw-w-full iw-rounded-lg iw-p-4 iw-shadow-md iw-bg-gradient-to-b iw-from-gray-50 iw-to-gray-100 iw-overflow-hidden",style:{top:0,transform:`translateY(${s}px)`,opacity:r,transition:`transform 600ms cubic-bezier(.2,.9,.3,1) ${o}ms, opacity 400ms ease ${o}ms`},children:u.jsxs("div",{className:"iw-flex iw-gap-3 iw-items-center",children:[u.jsx("div",{className:"iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0"}),u.jsxs("div",{className:"iw-flex-1 iw-space-y-2",children:[u.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-24"}),u.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-32"})]})]})},i.id)})}),u.jsx("div",{className:"iw-text-center",children:u.jsx("p",{className:"iw-text-gray-500 iw-font-medium",children:"Preparing your question..."})})]})}const w7=({size:e="192px",className:t,colors:n,animationDuration:i=20})=>{const l={...{bg:"oklch(95% 0.02 264.695)",c1:"oklch(75% 0.15 350)",c2:"oklch(80% 0.12 200)",c3:"oklch(78% 0.14 280)"},...n},s=parseInt(e.replace("px",""),10),r=s<50?Math.max(s*.008,1):Math.max(s*.015,4),o=s<50?Math.max(s*.004,1.2):Math.max(s*.008,1.5),c=s<50?Math.max(s*.004,.05):Math.max(s*.008,.1),d=s<50?Math.max(s*.004,.5):Math.max(s*.008,2),h=s<30?"0%":s<50?"5%":s<100?"15%":"25%",f=s<30?1.1:s<50?Math.max(o*1.2,1.3):o;return u.jsx("div",{className:`siri-orb ${t}`,style:{width:e,height:e,"--bg":l.bg,"--c1":l.c1,"--c2":l.c2,"--c3":l.c3,"--animation-duration":`${i}s`,"--blur-amount":`${r}px`,"--contrast-amount":f,"--dot-size":`${c}px`,"--shadow-spread":`${d}px`,"--mask-radius":h},children:u.jsx("style",{children:`
|
|
83
107
|
@property --angle {
|
|
84
108
|
syntax: "<angle>";
|
|
85
109
|
inherits: false;
|
|
@@ -184,4 +208,4 @@
|
|
|
184
208
|
animation: none;
|
|
185
209
|
}
|
|
186
210
|
}
|
|
187
|
-
`})})};function _h({ttsError:e}){return o.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full",children:[o.jsx(vh,{size:"80px"}),e&&o.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Audio playback failed: ",e.message]}),o.jsx("p",{className:"iw-text- iw-text-gray-700",children:"Your AI interviewer is speaking..."})]})}const kh=({state:e,thinkingTime:t,nextPhase:r})=>o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Get Ready to Answer"}),o.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below."})]}),o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[o.jsx(ln,{className:"iw-size-4 iw-text-orange-600"}),o.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to think: "})]}),o.jsx(Hs,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]}),o.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:o.jsx(Qe,{onClick:()=>{r()},children:"Start Answering"})})]}),Eh=({sttError:e,editingDuration:t})=>o.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full",children:[o.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 60 60",fill:"none",children:[o.jsx("rect",{width:60,height:60,rx:30,fill:"url(#prefix__paint0_linear_1460_12482)"}),o.jsx("path",{d:"M28.127 14c.276 7.685 6.442 13.851 14.127 14.127-7.684.276-13.85 6.442-14.127 14.127-.275-7.685-6.442-13.851-14.126-14.127 7.684-.276 13.85-6.442 14.126-14.127zM38.937 31.873A7.331 7.331 0 0046 38.937 7.331 7.331 0 0038.937 46a7.331 7.331 0 00-7.064-7.063 7.331 7.331 0 007.064-7.064z",fill:"#fff"}),o.jsx("defs",{children:o.jsxs("linearGradient",{id:"prefix__paint0_linear_1460_12482",x1:30,y1:-6.563,x2:77.813,y2:54.375,gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:.211,stopColor:"#5C92FA"}),o.jsx("stop",{offset:1,stopColor:"#A75FFD"})]})})]}),o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3",children:"Just a moment... We're analyzing your response"}),o.jsxs("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:["After transcription, you'll have ",t||30," sec to review your answer."]}),e&&o.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Transcription error: ",e.message,e.recoverable&&" (attempting to continue)"]})]}),Qi=5;function Sh({isOpen:e,onClose:t,warningCount:r,violationType:i,onDisqualify:n}){const[s,a]=d.useState(10),c=d.useRef(t);if(d.useEffect(()=>{c.current=t},[t]),d.useEffect(()=>{if(!e)return;const w=setInterval(()=>{a(m=>m<=1?(c.current(),10):m-1)},1e3);return()=>clearInterval(w)},[e]),d.useEffect(()=>{e&&a(10)},[e]),d.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const u=(()=>{switch(i){case"tab_switch":return{title:"Tab Switch Detected",description:"You attempted to switch to another tab or reload application.",icon:o.jsx(uo,{className:"iw-h-5 iw-w-5"})};case"fullscreen_exit":return{title:"Full Screen Exit Detected",description:"You attempted to exit full screen mode.",icon:o.jsx(co,{className:"iw-h-5 iw-w-5"})};case"focus_loss":return{title:"Focus Loss Detected",description:"You lost focus from the interview window.",icon:o.jsx(eu,{className:"iw-h-5 iw-w-5"})};case"blocked_shortcut":return{title:"Keyboard Shortcut Blocked",description:"You attempted to use a blocked keyboard shortcut.",icon:o.jsx(un,{className:"iw-h-5 iw-w-5"})};case"right_click_attempt":return{title:"Right Click Attempted",description:"You attempted to use the right click.",icon:o.jsx(tu,{className:"iw-h-5 iw-w-5"})};case"alt_tab_attempt":return{title:"Alt + Tab Attempted",description:"You attempted to use the Alt + Tab shortcut.",icon:o.jsx(un,{className:"iw-h-5 iw-w-5"})};case"blocked_function_key":return{title:"Function Key Blocked",description:"You attempted to use a blocked function key.",icon:o.jsx(un,{className:"iw-h-5 iw-w-5"})};default:return{title:"Violation Detected",description:"You attempted to perform an action that is not allowed.",icon:o.jsx(Lr,{className:"iw-h-5 iw-w-5"})}}})(),h=Qi-r,f=()=>{r+1>Qi?n():t()};return o.jsx("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/60 iw-p-4 iw-backdrop-blur-sm",children:o.jsxs("div",{className:"iw-w-full iw-max-w-md iw-rounded-2xl iw-border iw-border-gray-100 iw-bg-white iw-shadow-xl",children:[o.jsxs("div",{className:"iw-p-6 iw-pb-0",children:[o.jsxs("div",{className:"iw-mb-6 iw-flex iw-items-start iw-gap-4",children:[o.jsx("div",{className:"iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50",children:o.jsx(Lr,{className:"iw-h-6 iw-w-6 iw-text-red-500"})}),o.jsxs("div",{className:"iw-flex-1",children:[o.jsx("h2",{className:"iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900",children:"Security Violation"}),o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[o.jsx("span",{className:"iw-text-sm iw-text-gray-500",children:"Warning"}),o.jsx("div",{className:"iw-flex iw-gap-1",children:Array.from({length:Qi}).map((w,m)=>o.jsx("div",{className:`iw-h-2 iw-w-2 iw-rounded-full ${m<=r-1?"iw-bg-red-500":"iw-bg-gray-200"}`},m))}),o.jsxs("span",{className:"iw-text-sm iw-text-gray-500",children:["(",r,"/",Qi,")"]})]})]})]}),o.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-border iw-border-red-100 iw-p-5",style:{background:"linear-gradient(to right, rgb(254, 242, 242), rgb(254, 245, 235))",borderColor:"rgb(254, 226, 226)"},children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-4",children:[o.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-xl iw-bg-white iw-shadow-sm",children:u.icon}),o.jsxs("div",{className:"iw-flex-1",children:[o.jsx("h3",{className:"iw-mb-2 iw-font-semibold iw-text-gray-900",children:u.title}),o.jsx("p",{className:"iw-text-sm iw-leading-relaxed iw-text-gray-700",children:u.description}),o.jsxs("div",{className:"iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600",children:[o.jsx(ao,{className:"iw-h-3 iw-w-3"}),o.jsx("span",{children:"This action is monitored for interview integrity"})]})]})]})}),o.jsxs("div",{className:"iw-mb-5 iw-grid iw-grid-cols-2 iw-gap-3",children:[o.jsx("div",{className:"iw-rounded-xl iw-border iw-border-amber-200 iw-bg-amber-50 iw-p-4",children:o.jsxs("div",{className:"iw-text-center",children:[o.jsx("div",{className:"iw-mb-1 iw-text-2xl iw-font-bold iw-text-amber-600",children:h}),o.jsx("div",{className:"iw-text-xs iw-font-medium iw-text-amber-700",children:"Warnings Left"})]})}),o.jsx("div",{className:"iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4",children:o.jsxs("div",{className:"iw-text-center",children:[o.jsxs("div",{className:"iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5",children:[o.jsx(Zl,{className:"iw-text-primary-600 iw-h-4 iw-w-4"}),o.jsx("span",{className:"iw-text-primary-600 iw-text-2xl iw-font-bold",children:s})]}),o.jsx("div",{className:"iw-text-primary-700 iw-text-xs iw-font-medium",children:"Auto Close"})]})})]}),h===1&&o.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-p-4 iw-text-white",style:{background:"linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"},children:o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[o.jsx("div",{className:"iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20",children:o.jsx(Lr,{className:"iw-h-4 iw-w-4"})}),o.jsxs("div",{children:[o.jsx("div",{className:"iw-text-sm iw-font-semibold",children:"Final Warning"}),o.jsx("div",{className:"iw-text-xs iw-text-red-100",children:"Next violation will disqualify you from this interview"})]})]})})]}),o.jsxs("div",{className:"iw-p-6 iw-pt-0",children:[o.jsx(Qe,{onClick:f,className:"iw-h-12 iw-w-full iw-rounded-xl iw-bg-gray-800 iw-text-sm iw-font-medium iw-text-white iw-hover:bg-gray-800",children:"I Understand - Continue Interview"}),o.jsx("p",{className:"iw-text-gray-500 iw-mt-3 iw-text-center iw-text-xs",children:"Please maintain focus and avoid switching tabs, exiting fullscreen, using shortcuts or right-clicking."})]})]})})}const Ah=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z"}),o.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),Th=({showHardReloadWarning:e,onContinue:t})=>{const r=()=>{t()};return o.jsxs(ii,{isOpen:e,onClose:r,closeOnOverlayClick:!1,closeOnEscape:!1,showCloseButton:!1,className:"iw-max-w-lg iw-px-2 iw-rounded-xl",children:[o.jsx("div",{className:"iw-absolute iw-inset-x-0 iw-top-0 iw-h-1 iw-bg-gradient-to-r iw-from-red-500 iw-to-red-600"}),o.jsx("div",{className:"iw-space-y-1 iw-pb-2 iw-pt-3",children:o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[o.jsx(Lr,{className:"iw-w-5 iw-h-5 iw-text-red-500"}),o.jsx("h3",{className:"iw-text-xl iw-font-semibold iw-text-red-500",children:"Full Screen Exit Detected"})]})}),o.jsx("div",{className:"iw-pt-4 iw-pb-6",children:o.jsx("p",{className:"iw-text-center iw-text-sm iw-leading-relaxed iw-text-gray-500/90",children:"Exiting full screen mode or reloading this page during the session is strictly prohibited. Any attempt to do so will be recorded and may lead to penalties."})}),o.jsx("div",{className:"iw-pt-2 iw-pb-4",children:o.jsxs("button",{onClick:r,className:"iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",children:[o.jsx(Ah,{className:"iw-size-4"}),"Continue Session"]})})]})},jh=d.forwardRef(({children:e,onDisqualify:t},r)=>{const[i,n]=d.useState(!1),[s,a]=d.useState(!1),[c,l]=d.useState(!1),[u,h]=d.useState("fullscreen_exit"),{logViolation:f,violationCount:w}=uh({maxViolations:5,onViolation:p=>{s||(n(!0),h(p.type))}}),{enterFullScreen:m,isFullScreen:g,exitFullScreen:b}=ih({onFullScreenChange(p){!p&&!s&&!c&&(n(!0),f({type:"fullscreen_exit",severity:"high",details:{action:"fullscreen_exit",reason:"Attempted to exit full screen mode"}})),p&&l(!1)}});d.useEffect(()=>{m()},[]),d.useImperativeHandle(r,()=>({exitFullScreenIntentionally:async()=>{l(!0),n(!1),a(!1);try{document.fullscreenElement&&await document.exitFullscreen()}catch(p){console.error("Failed to exit fullscreen:",p)}}}),[]),oh(f),nh(f),ah(),dh();const _=()=>{a(!0),b(),n(!1),t==null||t()};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"iw-relative iw-h-full iw-w-full",children:e}),o.jsx(Sh,{warningCount:w,isOpen:i,violationType:u,onClose:()=>{n(!1),m()},onDisqualify:_}),!i&&w>0&&!s&&!c&&o.jsx(Th,{showHardReloadWarning:!g,logViolation:f,onContinue:m})]})}),Nh=({interviewTitle:e,brandName:t="Novara",interviewId:r,onComplete:i,onDisqualify:n,className:s="",videoFeedRef:a})=>{var Zi;const c=lo(),{baseUrl:l,authToken:u}=ro(),{timers:h,stt:f,proctoring:w}=cn(),m=d.useRef(null),[g,b]=d.useState(null),[_,p]=d.useState(""),[A,F]=d.useState(ti),T=d.useRef(""),C=d.useRef(null);d.useEffect(()=>{(async()=>{var je;try{const rt=await c.getInterviewConfig(r);(je=rt==null?void 0:rt.data)!=null&&je.duration_in_minutes&&F(rt.data.duration_in_minutes)}catch(rt){console.error("Failed to fetch interview config:",rt)}})()},[r]);const M={thinkingTime:(h==null?void 0:h.thinkingDuration)||30,answeringTime:(h==null?void 0:h.answeringDuration)||120,editingTime:(h==null?void 0:h.editingDuration)||30},{thinkingTime:B,answeringTime:G,editingTime:Q}=M;d.useEffect(()=>{T.current=_},[_]);const oe=d.useRef(!1),{speak:qe,stop:de,error:Ye}=lh({onEnd:()=>{oe.current=!1,V()},onError:()=>{oe.current||(oe.current=!0,V())}}),Te=d.useRef(!1),be=d.useRef(!1),{startRecording:kt,stopRecording:dt,transcribe:ge,cancelRecording:Qt,error:Ke}=sh({config:{baseUrl:l,provider:f==null?void 0:f.provider,model:f==null?void 0:f.model,language:f==null?void 0:f.language,authToken:u,qnaId:((Zi=C.current)==null?void 0:Zi.qna_id)||"",interviewId:r},onStart:()=>{Te.current=!1,be.current=!1},onStop:()=>{},onTranscriptionComplete:N=>{p(N.transcript),be.current||(be.current=!0,V())},onError:N=>{console.error("STT Error:",N),Te.current||(Te.current=!0,V())}}),{state:re,startQuestion:Xe,nextPhase:V,completeInterview:ht}=th({config:{thinkingDuration:B,answeringDuration:G,editingDuration:Q},callbacks:{onPhaseChange:N=>{switch(N){case se.FETCHING_QUESTION:j();break;case se.READING_QUESTION:Rt();break;case se.ANSWERING:Jt();break;case se.TRANSCRIBING:Ji();break;case se.SUBMITTING:Dt();break}},onInterviewEnd:()=>{i==null||i()}}});d.useEffect(()=>{Xe()},[]);const{execute:j,loading:J}=rh(async()=>{const N=await c.generateQuestion({interviewId:r});return C.current=N.data,N},{onSuccess:async N=>{N&&N.data&&(p(""),b(N.data),V())},onError:N=>{console.error("Failed to fetch questions:",N)}}),Dt=d.useCallback(async()=>{var N;try{await c.submitAnswer({interviewId:r,qnaId:((N=C.current)==null?void 0:N.qna_id)||"",answer:T.current})}catch(je){console.error("Failed to submit answer:",je)}Xe()},[c,r,Xe]),Rt=d.useCallback(async()=>{var N;if((N=C.current)!=null&&N.question)if(C.current.question_audio_data_base64)try{oe.current=!1,await qe(C.current.question_audio_data_base64),C.current.is_interview_done&&ht()}catch(je){console.error("Failed to speak question:",je),V()}else console.warn("No audio data available for question"),await Vl(2e3),V();else V()},[qe,V,ht]),Jt=d.useCallback(async()=>{try{await kt(G)}catch(N){console.error("Failed to start recording:",N),V()}},[kt,V]),Ji=d.useCallback(async()=>{try{const N=await dt();await ge(N)}catch(N){console.error("STT processing failed:",N),!Te.current&&!be.current&&(Te.current=!0,V())}},[dt,ge,V]),Zt=d.useCallback(async N=>{var je,rt;de(),Qt(),a&&"current"in a&&((je=a.current)==null||je.stopCamera()),await((rt=m.current)==null?void 0:rt.exitFullScreenIntentionally());try{await c.exitInterview(r)}catch(en){console.error("API call failed:",en)}finally{N==null||N(),ht(),sessionStorage.removeItem(sn)}},[r,de,c]),Qr=()=>{const{phase:N}=re;switch(N){case se.IDLE:return o.jsxs("div",{className:"iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full",children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Ready to start the Interview?"}),o.jsx("p",{className:"iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:`You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.`}),o.jsx(Qe,{onClick:Xe,className:"iw-mt-2 iw-w-40",children:"Start Interview"})]});case se.FETCHING_QUESTION:return o.jsx(bh,{});case se.READING_QUESTION:return o.jsx(_h,{ttsError:Ye});case se.THINKING:return o.jsx(kh,{state:re,thinkingTime:B,nextPhase:V});case se.ANSWERING:return o.jsx(yh,{state:re,answeringTime:G,nextPhase:V,sttError:Ke});case se.TRANSCRIBING:return o.jsx(Eh,{sttError:Ke,editingDuration:Q});case se.EDITING:case se.SUBMITTING:return o.jsx("div",{className:"iw-space-y-4 iw-h-full",children:o.jsx(wh,{value:_,onChange:je=>p(je.target.value),onSubmit:()=>V(),isSubmitDisabled:!_.trim()||J||re.phase===se.SUBMITTING,state:re,editingTime:Q})});case se.COMPLETED:return null;default:return null}};return o.jsx(o.Fragment,{children:w!=null&&w.enabled?o.jsxs(jh,{ref:m,onDisqualify:()=>Zt(n),children:[o.jsx(bl,{title:e,brandName:t,onExit:()=>Zt()}),o.jsx(yl,{currentQuestion:g,phase:re.phase,className:s,interviewId:r,interview_duration:A,videoFeedRef:a,children:Qr()})]}):o.jsxs(o.Fragment,{children:[o.jsx(bl,{title:e,brandName:t,onExit:()=>Zt()}),o.jsx(yl,{currentQuestion:g,phase:re.phase,className:s,interviewId:r,interview_duration:A,videoFeedRef:a,children:Qr()})]})})},qs=({title:e,brandName:t,interviewId:r,onInterviewEnd:i,onInterviewDisqualify:n,className:s=""})=>{const[a,c]=d.useState(!1),[l,u]=d.useState(!0),[h,f]=d.useState(!1),{proctoring:w}=cn(),m=d.useRef(null),g=d.useRef(null),b=(w==null?void 0:w.gazeAnalysisEnabled)===!0,_=()=>{c(!0),u(!1)};return d.useEffect(()=>{if(a&&h&&g.current&&b)try{g.current.setReference()}finally{f(!1)}},[a,h,b]),a?o.jsx("div",{className:"interview-widget-container",children:o.jsx("div",{ref:m,className:`iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${s}`,children:o.jsx("div",{className:"iw-h-full iw-flex iw-flex-col",children:o.jsx(Nh,{interviewTitle:e??"Interview",brandName:t??"Novara",interviewId:r,className:s,onComplete:i??(()=>{}),onDisqualify:n,videoFeedRef:g})})})}):o.jsx("div",{className:"interview-widget-container",children:o.jsx(Qd,{isOpen:l,gazeEnabled:b,onStart:_,onRequestCalibration:()=>f(!0),videoFeedRef:g,interviewId:r})})};typeof window<"u"&&(window.InterviewWidget={InterviewWidget:qs,InterviewWidgetProvider:to}),we.InterviewWidget=qs,we.InterviewWidgetProvider=to,we.default=qs,Object.defineProperties(we,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
211
|
+
`})})};function g7({ttsError:e}){return u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full",children:[u.jsx(w7,{size:"80px"}),e&&u.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Audio playback failed: ",e.message]}),u.jsx("p",{className:"iw-text- iw-text-gray-700",children:"Your AI interviewer is speaking..."})]})}const p7=({state:e,thinkingTime:t,nextPhase:n})=>u.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Get Ready to Answer"}),u.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below."})]}),u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[u.jsx(lh,{className:"iw-size-4 iw-text-orange-600"}),u.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to think: "})]}),u.jsx(Cu,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]}),u.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:u.jsx(us,{onClick:()=>{n()},children:"Start Answering"})})]}),y7=({sttError:e,editingDuration:t})=>u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full",children:[u.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 60 60",fill:"none",children:[u.jsx("rect",{width:60,height:60,rx:30,fill:"url(#prefix__paint0_linear_1460_12482)"}),u.jsx("path",{d:"M28.127 14c.276 7.685 6.442 13.851 14.127 14.127-7.684.276-13.85 6.442-14.127 14.127-.275-7.685-6.442-13.851-14.126-14.127 7.684-.276 13.85-6.442 14.126-14.127zM38.937 31.873A7.331 7.331 0 0046 38.937 7.331 7.331 0 0038.937 46a7.331 7.331 0 00-7.064-7.063 7.331 7.331 0 007.064-7.064z",fill:"#fff"}),u.jsx("defs",{children:u.jsxs("linearGradient",{id:"prefix__paint0_linear_1460_12482",x1:30,y1:-6.563,x2:77.813,y2:54.375,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{offset:.211,stopColor:"#5C92FA"}),u.jsx("stop",{offset:1,stopColor:"#A75FFD"})]})})]}),u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3",children:"Just a moment... We're analyzing your response"}),u.jsxs("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:["After transcription, you'll have ",t||30," sec to review your answer."]}),e&&u.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Transcription error: ",e.message,e.recoverable&&" (attempting to continue)"]})]}),Du=5;function v7({isOpen:e,onClose:t,warningCount:n,violationType:i,onDisqualify:a}){const[l,s]=p.useState(10),r=p.useRef(t);if(p.useEffect(()=>{r.current=t},[t]),p.useEffect(()=>{if(!e)return;const f=setInterval(()=>{s(w=>w<=1?(r.current(),10):w-1)},1e3);return()=>clearInterval(f)},[e]),p.useEffect(()=>{e&&s(10)},[e]),p.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const c=(()=>{switch(i){case"tab_switch":return{title:"Tab Switch Detected",description:"You attempted to switch to another tab or reload application.",icon:u.jsx(rh,{className:"iw-h-5 iw-w-5"})};case"fullscreen_exit":return{title:"Full Screen Exit Detected",description:"You attempted to exit full screen mode.",icon:u.jsx(i5,{className:"iw-h-5 iw-w-5"})};case"focus_loss":return{title:"Focus Loss Detected",description:"You lost focus from the interview window.",icon:u.jsx($g,{className:"iw-h-5 iw-w-5"})};case"blocked_shortcut":return{title:"Keyboard Shortcut Blocked",description:"You attempted to use a blocked keyboard shortcut.",icon:u.jsx(Qu,{className:"iw-h-5 iw-w-5"})};case"right_click_attempt":return{title:"Right Click Attempted",description:"You attempted to use the right click.",icon:u.jsx(a5,{className:"iw-h-5 iw-w-5"})};case"alt_tab_attempt":return{title:"Alt + Tab Attempted",description:"You attempted to use the Alt + Tab shortcut.",icon:u.jsx(Qu,{className:"iw-h-5 iw-w-5"})};case"blocked_function_key":return{title:"Function Key Blocked",description:"You attempted to use a blocked function key.",icon:u.jsx(Qu,{className:"iw-h-5 iw-w-5"})};default:return{title:"Violation Detected",description:"You attempted to perform an action that is not allowed.",icon:u.jsx(Xl,{className:"iw-h-5 iw-w-5"})}}})(),d=Du-n,h=()=>{n+1>Du?a():t()};return u.jsx("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/60 iw-p-4 iw-backdrop-blur-sm",children:u.jsxs("div",{className:"iw-w-full iw-max-w-md iw-rounded-2xl iw-border iw-border-gray-100 iw-bg-white iw-shadow-xl",children:[u.jsxs("div",{className:"iw-p-6 iw-pb-0",children:[u.jsxs("div",{className:"iw-mb-6 iw-flex iw-items-start iw-gap-4",children:[u.jsx("div",{className:"iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50",children:u.jsx(Xl,{className:"iw-h-6 iw-w-6 iw-text-red-500"})}),u.jsxs("div",{className:"iw-flex-1",children:[u.jsx("h2",{className:"iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900",children:"Security Violation"}),u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[u.jsx("span",{className:"iw-text-sm iw-text-gray-500",children:"Warning"}),u.jsx("div",{className:"iw-flex iw-gap-1",children:Array.from({length:Du}).map((f,w)=>u.jsx("div",{className:`iw-h-2 iw-w-2 iw-rounded-full ${w<=n-1?"iw-bg-red-500":"iw-bg-gray-200"}`},w))}),u.jsxs("span",{className:"iw-text-sm iw-text-gray-500",children:["(",n,"/",Du,")"]})]})]})]}),u.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-border iw-border-red-100 iw-p-5",style:{background:"linear-gradient(to right, rgb(254, 242, 242), rgb(254, 245, 235))",borderColor:"rgb(254, 226, 226)"},children:u.jsxs("div",{className:"iw-flex iw-items-start iw-gap-4",children:[u.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-xl iw-bg-white iw-shadow-sm",children:c.icon}),u.jsxs("div",{className:"iw-flex-1",children:[u.jsx("h3",{className:"iw-mb-2 iw-font-semibold iw-text-gray-900",children:c.title}),u.jsx("p",{className:"iw-text-sm iw-leading-relaxed iw-text-gray-700",children:c.description}),u.jsxs("div",{className:"iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600",children:[u.jsx(l5,{className:"iw-h-3 iw-w-3"}),u.jsx("span",{children:"This action is monitored for interview integrity"})]})]})]})}),u.jsxs("div",{className:"iw-mb-5 iw-grid iw-grid-cols-2 iw-gap-3",children:[u.jsx("div",{className:"iw-rounded-xl iw-border iw-border-amber-200 iw-bg-amber-50 iw-p-4",children:u.jsxs("div",{className:"iw-text-center",children:[u.jsx("div",{className:"iw-mb-1 iw-text-2xl iw-font-bold iw-text-amber-600",children:d}),u.jsx("div",{className:"iw-text-xs iw-font-medium iw-text-amber-700",children:"Warnings Left"})]})}),u.jsx("div",{className:"iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4",children:u.jsxs("div",{className:"iw-text-center",children:[u.jsxs("div",{className:"iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5",children:[u.jsx(Pg,{className:"iw-text-primary-600 iw-h-4 iw-w-4"}),u.jsx("span",{className:"iw-text-primary-600 iw-text-2xl iw-font-bold",children:l})]}),u.jsx("div",{className:"iw-text-primary-700 iw-text-xs iw-font-medium",children:"Auto Close"})]})})]}),d===1&&u.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-p-4 iw-text-white",style:{background:"linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"},children:u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[u.jsx("div",{className:"iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20",children:u.jsx(Xl,{className:"iw-h-4 iw-w-4"})}),u.jsxs("div",{children:[u.jsx("div",{className:"iw-text-sm iw-font-semibold",children:"Final Warning"}),u.jsx("div",{className:"iw-text-xs iw-text-red-100",children:"Next violation will disqualify you from this interview"})]})]})})]}),u.jsxs("div",{className:"iw-p-6 iw-pt-0",children:[u.jsx(us,{onClick:h,className:"iw-h-12 iw-w-full iw-rounded-xl iw-bg-gray-800 iw-text-sm iw-font-medium iw-text-white iw-hover:bg-gray-800",children:"I Understand - Continue Interview"}),u.jsx("p",{className:"iw-text-gray-500 iw-mt-3 iw-text-center iw-text-xs",children:"Please maintain focus and avoid switching tabs, exiting fullscreen, using shortcuts or right-clicking."})]})]})})}const b7=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[u.jsx("path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z"}),u.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),x7=({showHardReloadWarning:e,onContinue:t})=>{const n=()=>{t()};return u.jsxs(Mf,{isOpen:e,onClose:n,closeOnOverlayClick:!1,closeOnEscape:!1,showCloseButton:!1,className:"iw-max-w-lg iw-px-2 iw-rounded-xl",children:[u.jsx("div",{className:"iw-absolute iw-inset-x-0 iw-top-0 iw-h-1 iw-bg-gradient-to-r iw-from-red-500 iw-to-red-600"}),u.jsx("div",{className:"iw-space-y-1 iw-pb-2 iw-pt-3",children:u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[u.jsx(Xl,{className:"iw-w-5 iw-h-5 iw-text-red-500"}),u.jsx("h3",{className:"iw-text-xl iw-font-semibold iw-text-red-500",children:"Full Screen Exit Detected"})]})}),u.jsx("div",{className:"iw-pt-4 iw-pb-6",children:u.jsx("p",{className:"iw-text-center iw-text-sm iw-leading-relaxed iw-text-gray-500/90",children:"Exiting full screen mode or reloading this page during the session is strictly prohibited. Any attempt to do so will be recorded and may lead to penalties."})}),u.jsx("div",{className:"iw-pt-2 iw-pb-4",children:u.jsxs("button",{onClick:n,className:"iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",children:[u.jsx(b7,{className:"iw-size-4"}),"Continue Session"]})})]})},E7=p.forwardRef(({children:e,onDisqualify:t},n)=>{const[i,a]=p.useState(!1),[l,s]=p.useState(!1),[r,o]=p.useState(!1),[c,d]=p.useState("fullscreen_exit"),{logViolation:h,violationCount:f}=g6({maxViolations:5,onViolation:m=>{l||(a(!0),d(m.type))}}),{enterFullScreen:w,isFullScreen:v,exitFullScreen:x}=u6({onFullScreenChange(m){!m&&!l&&!r&&(a(!0),h({type:"fullscreen_exit",severity:"high",details:{action:"fullscreen_exit",reason:"Attempted to exit full screen mode"}})),m&&o(!1)}});p.useEffect(()=>{w()},[]),p.useImperativeHandle(n,()=>({exitFullScreenIntentionally:async()=>{o(!0),a(!1),s(!1);try{document.fullscreenElement&&await document.exitFullscreen()}catch(m){console.error("Failed to exit fullscreen:",m)}}}),[]),d6(h),c6(h),h6(),p6();const _=()=>{s(!0),x(),a(!1),t==null||t()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"iw-relative iw-h-full iw-w-full",children:e}),u.jsx(v7,{warningCount:f,isOpen:i,violationType:c,onClose:()=>{a(!1),w()},onDisqualify:_}),!i&&f>0&&!l&&!r&&u.jsx(x7,{showHardReloadWarning:!v,logViolation:h,onContinue:w})]})}),S7=({interviewTitle:e,brandName:t="Novara",brandLogo:n,interviewId:i,onComplete:a,onDisqualify:l,className:s="",videoFeedRef:r})=>{var Lu;const o=b3(),{baseUrl:c,authToken:d}=ih(),{timers:h,stt:f,proctoring:w}=Yu(),v=p.useRef(null),[x,_]=p.useState(null),[m,g]=p.useState(""),[y,b]=p.useState(null),[S,A]=p.useState(gr),[T,N]=p.useState(!0),M=p.useRef(""),D=p.useRef(null);p.useEffect(()=>{(async()=>{try{const Ae=await o.getInterviewConfig(i);Ae!=null&&Ae.data&&(Ae.data.duration_in_minutes&&A(Ae.data.duration_in_minutes),typeof Ae.data.allow_answer_editing=="boolean"&&N(Ae.data.allow_answer_editing))}catch(Ae){console.error("Failed to fetch interview config:",Ae)}})()},[i]);const ge={thinkingTime:(h==null?void 0:h.thinkingDuration)||0,answeringTime:(h==null?void 0:h.answeringDuration)||120,editingTime:T?(h==null?void 0:h.editingDuration)||30:0},{thinkingTime:et,answeringTime:pt,editingTime:yt}=ge;p.useEffect(()=>{M.current=m},[m]);const vt=p.useRef(!1),{speak:j,stop:B,error:R}=w6({onEnd:()=>{vt.current=!1,Ce()},onError:()=>{vt.current||(vt.current=!0,Ce())}}),J=p.useRef(!1),ae=p.useRef(!1),{startRecording:st,stopRecording:gn,transcribe:sn,cancelRecording:Rt,error:rt}=f6({config:{baseUrl:c,provider:f==null?void 0:f.provider,model:f==null?void 0:f.model,language:f==null?void 0:f.language,authToken:d,qnaId:((Lu=D.current)==null?void 0:Lu.qna_id)||"",interviewId:i},onStart:()=>{J.current=!1,ae.current=!1},onStop:()=>{},onTranscriptionComplete:H=>{g(H.transcript),ae.current||(ae.current=!0,Ce())},onError:H=>{console.error("STT Error:",H),J.current||(J.current=!0,Ce())}}),{state:ot,startQuestion:rn,nextPhase:Ce,completeInterview:Xi}=r6({config:{answeringDuration:pt,editingDuration:yt},callbacks:{onPhaseChange:H=>{switch(H){case K.FETCHING_QUESTION:Vl();break;case K.READING_QUESTION:dr();break;case K.ANSWERING:I2();break;case K.TRANSCRIBING:Ou();break;case K.SUBMITTING:fr();break}},onInterviewEnd:()=>{a==null||a()}}});p.useEffect(()=>{rn()},[]);const{execute:Vl}=o6(async()=>{const H=await o.generateQuestion({interviewId:i});return D.current=H.data,H},{onSuccess:async H=>{H&&H.data&&(g(""),_(H.data),Ce())},onError:H=>{console.error("Failed to fetch questions:",H)}}),fr=p.useCallback(async()=>{var H;try{const Ae=M.current,Na=((H=D.current)==null?void 0:H.qna_id)||"";await o.submitAnswer({interviewId:i,qnaId:Na,answer:Ae}),b({qnaId:Na,answer:Ae})}catch(Ae){console.error("Failed to submit answer:",Ae)}rn()},[o,i,rn]),dr=p.useCallback(async()=>{var H;if((H=D.current)!=null&&H.question)if(D.current.question_audio_data_base64)try{vt.current=!1,await j(D.current.question_audio_data_base64),D.current.is_interview_done&&Xi()}catch(Ae){console.error("Failed to speak question:",Ae),Ce()}else console.warn("No audio data available for question"),await Qg(2e3),Ce();else Ce()},[j,Ce,Xi]),I2=p.useCallback(async()=>{try{await st(pt)}catch(H){console.error("Failed to start recording:",H),Ce()}},[st,Ce]),Ou=p.useCallback(async()=>{try{const H=await gn();await sn(H)}catch(H){console.error("STT processing failed:",H),!J.current&&!ae.current&&(J.current=!0,Ce())}},[gn,sn,Ce]),Aa=p.useCallback(async H=>{var Ae,Na;B(),Rt(),r&&"current"in r&&((Ae=r.current)==null||Ae.stopCamera()),await((Na=v.current)==null?void 0:Na.exitFullScreenIntentionally());try{await o.exitInterview(i)}catch(Uu){console.error("API call failed:",Uu)}finally{H==null||H(),Xi(),sessionStorage.removeItem(Hu)}},[i,B,o]),hr=()=>{const{phase:H}=ot;switch(H){case K.IDLE:return u.jsxs("div",{className:"iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full",children:[u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Ready to start the Interview?"}),u.jsx("p",{className:"iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:`You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.`}),u.jsx(us,{onClick:rn,className:"iw-mt-2 iw-w-40",children:"Start Interview"})]});case K.FETCHING_QUESTION:return u.jsx(m7,{});case K.READING_QUESTION:return u.jsx(g7,{ttsError:R});case K.THINKING:return u.jsx(p7,{state:ot,thinkingTime:et,nextPhase:Ce});case K.ANSWERING:return u.jsx(h7,{state:ot,answeringTime:pt,nextPhase:Ce,sttError:rt});case K.TRANSCRIBING:return u.jsx(y7,{sttError:rt,editingDuration:yt});case K.EDITING:case K.SUBMITTING:return null;case K.COMPLETED:return null;default:return null}};return u.jsx(u.Fragment,{children:w!=null&&w.enabled?u.jsxs(E7,{ref:v,onDisqualify:()=>Aa(l),children:[u.jsx(_g,{title:e,brandName:t,brandLogo:n,totalDuration:S,elapsedTime:ot.totalTimeElapsed,onExit:()=>Aa()}),u.jsx(Sg,{brandName:t,currentQuestion:x,state:ot,phase:ot.phase,className:s,interviewId:i,interview_duration:S,videoFeedRef:r,lastSubmittedAnswer:y,onNextPhase:Ce,answerText:m,onAnswerChange:H=>g(H.target.value),editingTime:yt,answeringTime:pt,children:hr()})]}):u.jsxs(u.Fragment,{children:[u.jsx(_g,{title:e,brandName:t,brandLogo:n,totalDuration:S,elapsedTime:ot.totalTimeElapsed,onExit:()=>Aa()}),u.jsx(Sg,{brandName:t,currentQuestion:x,state:ot,phase:ot.phase,className:s,interviewId:i,interview_duration:S,videoFeedRef:r,lastSubmittedAnswer:y,onNextPhase:Ce,answerText:m,onAnswerChange:H=>g(H.target.value),editingTime:yt,answeringTime:pt,children:hr()})]})})},ku=({title:e,brandName:t,brandLogo:n,interviewId:i,onInterviewEnd:a,onInterviewDisqualify:l,className:s=""})=>{const[r,o]=p.useState(!1),[c,d]=p.useState(!0),[h,f]=p.useState(!1),{proctoring:w}=Yu(),v=p.useRef(null),x=p.useRef(null),_=(w==null?void 0:w.gazeAnalysisEnabled)===!0,m=()=>{o(!0),d(!1)};return p.useEffect(()=>{if(r&&h&&x.current&&_)try{x.current.setReference()}finally{f(!1)}},[r,h,_]),r?u.jsx("div",{className:"interview-widget-container",children:u.jsx("div",{ref:v,className:`iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${s}`,children:u.jsx("div",{className:"iw-h-[calc(100vh-1rem)] iw-flex iw-flex-col iw-justify-between gap-1",children:u.jsx(S7,{interviewTitle:e??"Interview",brandName:t??"Novara",brandLogo:n,interviewId:i,className:s,onComplete:a??(()=>{}),onDisqualify:l,videoFeedRef:x})})})}):u.jsxs("div",{className:"interview-widget-container",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-space-x-2 iw-mx-auto iw-p-2 iw-max-w-[1800px]",children:[n||u.jsx("div",{className:"iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",children:ah(t)}),u.jsx("p",{className:"iw-text-xl iw-font-semibold",children:t})]}),u.jsx(l6,{isOpen:c,gazeEnabled:_,onStart:m,onRequestCalibration:()=>f(!0),videoFeedRef:x,interviewId:i})]})};typeof window<"u"&&(window.InterviewWidget={InterviewWidget:ku,InterviewWidgetProvider:qu}),We.InterviewWidget=ku,We.InterviewWidgetProvider=qu,We.default=ku,Object.defineProperties(We,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|