(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))S(m);new MutationObserver(m=>{for(const C of m)if(C.type==="childList")for(const j of C.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&S(j)}).observe(document,{childList:!0,subtree:!0});function y(m){const C={};return m.integrity&&(C.integrity=m.integrity),m.referrerPolicy&&(C.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?C.credentials="include":m.crossOrigin==="anonymous"?C.credentials="omit":C.credentials="same-origin",C}function S(m){if(m.ep)return;m.ep=!0;const C=y(m);fetch(m.href,C)}})();const Sn=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.bottom-1{bottom:.25rem}.left-1{left:.25rem}.z-10{z-index:10}.inline{display:inline}.flex{display:flex}.hidden{display:none}.w-32{width:8rem}.w-full{width:100%}.items-end{align-items:flex-end}.rounded-lg{border-radius:.5rem}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.font-bold{font-weight:700}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb;--tw-content: ""}:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;margin:0;line-height:inherit} `;function Bt(){}function He(a){return a()}function Ye(){return Object.create(null)}function ie(a){a.forEach(He)}function Je(a){return typeof a=="function"}function Tn(a,f){return a!=a?f==f:a!==f||a&&typeof a=="object"||typeof a=="function"}function Rn(a){return Object.keys(a).length===0}function wt(a,f){a.appendChild(f)}function Fn(a,f,y){const S=Mn(a);if(!S.getElementById(f)){const m=Ft("style");m.id=f,m.textContent=y,Ln(S,m)}}function Mn(a){if(!a)return document;const f=a.getRootNode?a.getRootNode():a.ownerDocument;return f&&f.host?f:a.ownerDocument}function Ln(a,f){return wt(a.head||a,f),f.sheet}function Cn(a,f,y){a.insertBefore(f,y||null)}function Ke(a){a.parentNode&&a.parentNode.removeChild(a)}function Ft(a){return document.createElement(a)}function Pn(a){return document.createTextNode(a)}function de(){return Pn(" ")}function Nn(a,f,y,S){return a.addEventListener(f,y,S),()=>a.removeEventListener(f,y,S)}function gt(a,f,y){y==null?a.removeAttribute(f):a.getAttribute(f)!==y&&a.setAttribute(f,y)}function Un(a){return Array.from(a.childNodes)}let Kt;function Ht(a){Kt=a}function In(){if(!Kt)throw new Error("Function called outside component initialization");return Kt}function Gn(a){In().$$.on_mount.push(a)}const Gt=[],Jt=[];let $t=[];const De=[],Bn=Promise.resolve();let pe=!1;function $n(){pe||(pe=!0,Bn.then(Ze))}function ve(a){$t.push(a)}const ge=new Set;let It=0;function Ze(){if(It!==0)return;const a=Kt;do{try{for(;Ita.indexOf(S)===-1?f.push(S):y.push(S)),y.forEach(S=>S()),$t=f}const Wn=new Set;function Xn(a,f){a&&a.i&&(Wn.delete(a),a.i(f))}function Yn(a,f,y,S){const{fragment:m,after_update:C}=a.$$;m&&m.m(f,y),S||ve(()=>{const j=a.$$.on_mount.map(He).filter(Je);a.$$.on_destroy?a.$$.on_destroy.push(...j):ie(j),a.$$.on_mount=[]}),C.forEach(ve)}function Dn(a,f){const y=a.$$;y.fragment!==null&&(Vn(y.after_update),ie(y.on_destroy),y.fragment&&y.fragment.d(f),y.on_destroy=y.fragment=null,y.ctx=[])}function Hn(a,f){a.$$.dirty[0]===-1&&(Gt.push(a),$n(),a.$$.dirty.fill(0)),a.$$.dirty[f/31|0]|=1<{const Q=it.length?it[0]:et;return O.ctx&&m(O.ctx[W],O.ctx[W]=Q)&&(!O.skip_bound&&O.bound[W]&&O.bound[W](Q),K&&Hn(a,W)),et}):[],O.update(),K=!0,ie(O.before_update),O.fragment=S?S(O.ctx):!1,f.target){if(f.hydrate){const W=Un(f.target);O.fragment&&O.fragment.l(W),W.forEach(Ke)}else O.fragment&&O.fragment.c();f.intro&&Xn(a.$$.fragment),Yn(a,f.target,f.anchor,f.customElement),Ze()}Ht(N)}class Kn{$destroy(){Dn(this,1),this.$destroy=Bt}$on(f,y){if(!Je(y))return Bt;const S=this.$$.callbacks[f]||(this.$$.callbacks[f]=[]);return S.push(y),()=>{const m=S.indexOf(y);m!==-1&&S.splice(m,1)}}$set(f){this.$$set&&!Rn(f)&&(this.$$.skip_bound=!0,this.$$set(f),this.$$.skip_bound=!1)}}var zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zn={};(function(){var a;function f(t){var e=0;return function(){return e>>0)+"_",i=0;return e}),C("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var e="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n"u"?!0:(typeof o=="function"?o=new o("unhandledrejection",{cancelable:!0}):typeof c=="function"?o=new c("unhandledrejection",{cancelable:!0}):(o=m.document.createEvent("CustomEvent"),o.initCustomEvent("unhandledrejection",!1,!0,o)),o.promise=this,o.reason=this.i,h(o))},e.prototype.A=function(){if(this.g!=null){for(var o=0;on&&(n=Math.max(n+i,0));n"u"||n.execScript("var "+t[0]);for(var r;t.length&&(r=t.shift());)t.length||e===void 0?n[r]&&n[r]!==Object.prototype[r]?n=n[r]:n=n[r]={}:n[r]=e}function M(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}var ot,d=typeof TextDecoder<"u",b,$=typeof TextEncoder<"u";function Z(t){if($)t=(b||(b=new TextEncoder)).encode(t);else{var e=void 0;e=e===void 0?!1:e;for(var n=0,r=new Uint8Array(3*t.length),i=0;iu)r[n++]=u;else{if(2048>u)r[n++]=u>>6|192;else{if(55296<=u&&57343>=u){if(56319>=u&&i=o){u=1024*(u-55296)+o-56320+65536,r[n++]=u>>18|240,r[n++]=u>>12&63|128,r[n++]=u>>6&63|128,r[n++]=u&63|128;continue}else i--}if(e)throw Error("Found an unpaired surrogate");u=65533}r[n++]=u>>12|224,r[n++]=u>>6&63|128}r[n++]=u&63|128}}t=r.subarray(0,n)}return t}var ct={},pt=null;function ft(t,e){e===void 0&&(e=0),Mt(),e=ct[e];for(var n=Array(Math.floor(t.length/3)),r=e[64]||"",i=0,u=0;i>2];o=e[(o&3)<<4|c>>4],c=e[(c&15)<<2|h>>6],h=e[h&63],n[u++]=g+o+c+h}switch(g=0,h=r,t.length-i){case 2:g=t[i+1],h=e[(g&15)<<2]||r;case 1:t=t[i],n[u]=e[t>>2]+e[(t&3)<<4|g>>4]+h+r}return n.join("")}function vt(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):"=.".indexOf(t[e-1])!=-1&&(n="=.".indexOf(t[e-2])!=-1?n-2:n-1);var r=new Uint8Array(n),i=0;return Wt(t,function(u){r[i++]=u}),r.subarray(0,i)}function Wt(t,e){function n(h){for(;r>4),o!=64&&(e(u<<4&240|o>>2),c!=64&&e(o<<6&192|c))}}function Mt(){if(!pt){pt={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));ct[n]=r;for(var i=0;ii&&128<=e;i++)e=t.h[t.g++],n|=(e&127)<<7*i;if(128<=e&&(e=t.h[t.g++],n|=(e&127)<<28,r|=(e&127)>>4),128<=e)for(i=0;5>i&&128<=e;i++)e=t.h[t.g++],r|=(e&127)<<7*i+3;if(128>e)return t=n>>>0,e=r>>>0,(r=e&2147483648)&&(t=~t+1>>>0,e=~e>>>0,t==0&&(e=e+1>>>0)),t=4294967296*e+(t>>>0),r?-t:t;t.m=!0}Lt.prototype.i=function(){var t=this.h,e=t[this.g],n=e&127;return 128>e?(this.g+=1,n):(e=t[this.g+1],n|=(e&127)<<7,128>e?(this.g+=2,n):(e=t[this.g+2],n|=(e&127)<<14,128>e?(this.g+=3,n):(e=t[this.g+3],n|=(e&127)<<21,128>e?(this.g+=4,n):(e=t[this.g+4],n|=(e&15)<<28,128>e?(this.g+=5,n>>>0):(this.g+=5,128<=t[this.g++]&&128<=t[this.g++]&&128<=t[this.g++]&&128<=t[this.g++]&&this.g++,n)))))},Lt.prototype.o=function(){var t=this.h[this.g],e=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,n=(t<<0|e<<8|n<<16|r<<24)>>>0,t=2*(n>>31)+1,e=n>>>23&255,n&=8388607,e==255?n?NaN:1/0*t:e==0?t*Math.pow(2,-149)*n:t*Math.pow(2,e-150)*(n+Math.pow(2,23))};var be=[];function Qt(){this.g=new Uint8Array(64),this.h=0}Qt.prototype.push=function(t){if(!(this.h+1>>=7;t.push(e)}function Xt(t){var e={},n=e.N===void 0?!1:e.N;this.o={v:e.v===void 0?!1:e.v},this.N=n,e=this.o,be.length?(n=be.pop(),e&&(n.v=e.v),t&&we(n,t),t=n):t=new Lt(t,e),this.g=t,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}Xt.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};function mt(t){var e=t.g;if((e=e.g==e.j)||(e=t.j)||(e=t.g,e=e.m||0>e.g||e.g>e.j),e)return!1;t.m=t.g.g,e=t.g.i();var n=e&7;return n!=0&&n!=5&&n!=1&&n!=2&&n!=3&&n!=4?(t.j=!0,!1):(t.i=e,t.l=e>>>3,t.h=n,!0)}function Ct(t){switch(t.h){case 0:if(t.h!=0)Ct(t);else{for(t=t.g;t.h[t.g]&128;)t.g++;t.g++}break;case 1:t.h!=1?Ct(t):(t=t.g,t.g+=8);break;case 2:if(t.h!=2)Ct(t);else{var e=t.g.i();t=t.g,t.g+=e}break;case 5:t.h!=5?Ct(t):(t=t.g,t.g+=4);break;case 3:e=t.l;do{if(!mt(t)){t.j=!0;break}if(t.h==4){t.l!=e&&(t.j=!0);break}Ct(t)}while(1);break;default:t.j=!0}}function qt(t,e,n){var r=t.g.j,i=t.g.i(),u=t.g.g+i;if(t.g.j=u,n(e,t),n=u-t.g.g,n!==0)throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.g.g=u,t.g.j=r,e}function lt(t){return t.g.o()}function xe(t){var e=t.g.i();t=t.g;var n=t.g;t.g+=e,t=t.h;var r;if(d)(r=ot)||(r=ot=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(t.subarray(n,n+e));else{e=n+e;for(var i=[],u=null,o,c,h;no?i.push(o):224>o?n>=e?i.push(65533):(c=t[n++],194>o||(c&192)!==128?(n--,i.push(65533)):i.push((o&31)<<6|c&63)):240>o?n>=e-1?i.push(65533):(c=t[n++],(c&192)!==128||o===224&&160>c||o===237&&160<=c||((r=t[n++])&192)!==128?(n--,i.push(65533)):i.push((o&15)<<12|(c&63)<<6|r&63)):244>=o?n>=e-2?i.push(65533):(c=t[n++],(c&192)!==128||(o<<28)+(c-144)>>30||((r=t[n++])&192)!==128||((h=t[n++])&192)!==128?(n--,i.push(65533)):(o=(o&7)<<18|(c&63)<<12|(r&63)<<6|h&63,o-=65536,i.push((o>>10&1023)+55296,(o&1023)+56320))):i.push(65533),8192<=i.length&&(u=M(u,i),i.length=0);r=M(u,i)}return r}function _e(t,e,n){var r=t.g.i();for(r=t.g.g+r;t.g.gr?1:0)?-r:r,r===0?0<1/r?yt=bt=0:(bt=0,yt=2147483648):isNaN(r)?(bt=0,yt=2147483647):34028234663852886e22>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),bt=0,yt=(n<<31|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),r=Math.round(8388608*r),16777216<=r&&++e,bt=0,yt=(n<<31|e+127<<23|r&8388607)>>>0),n=yt,t.push(n>>>0&255),t.push(n>>>8&255),t.push(n>>>16&255),t.push(n>>>24&255)}}var Ee=typeof Uint8Array=="function";function je(t,e,n){if(t!=null)return typeof t=="object"?Ee&&t instanceof Uint8Array?n(t):Ae(t,e,n):e(t)}function Ae(t,e,n){if(Array.isArray(t)){for(var r=Array(t.length),i=0;i=t.l?t.i?t.i[e]:void 0:t.h[e+t.j]}function ee(t,e){var n=n===void 0?!1:n,r=J(t,e,n);return r==null&&(r=te),r===te&&(r=Yt([]),L(t,e,r,n)),r}function Te(t){var e=ee(t,3);if(t.m||(t.m={}),!t.m[3]){for(var n=0;n=t.l?(Se(t),t.i[e]=n):t.h[e+t.j]=n}function Re(t,e,n){if(n===-1)return null;if(t.g||(t.g={}),!t.g[n]){var r=J(t,n,!1);r&&(t.g[n]=new e(r))}return t.g[n]}function ne(t,e){t.g||(t.g={});var n=t.g[1];if(!n){var r=ee(t,1);n=[];for(var i=0;iI,I=Math.abs(I);var B=I>>>0;for(I=Math.floor((I-B)/4294967296),I>>>=0,G&&(I=~I>>>0,B=(~B>>>0)+1,4294967295>>7|B<<25)>>>0,B>>>=7;F.push(G)}if(ae(A,U),tt=se(tt),Y.call(rt,at,tt),P.O)for(rt=0;rtI;I++)G.push(B&127|128),B>>=7;G.push(1)}ht(F,2,J(U,2)),G=J(U,3),G!=null&&(G=Z(G),xt(F.g,26),xt(F.g,G.length),Pt(F,F.g.end()),Pt(F,G)),G=J(U,4),G!=null&&(G=Z(G),xt(F.g,34),xt(F.g,G.length),Pt(F,F.g.end()),Pt(F,G)),ae(U,F),A=se(A),at.call(Y,tt,A)}}v=v.data;break t;default:v={}}}switch(x=v,V=g.stream,g.type){case"video":u.pushTexture2d(Object.assign(Object.assign({},x),{stream:V,timestamp:i}));break;case"detections":R=x,R.stream=V,R.timestamp=i,u.pushDetectionList(R);break;default:throw Error("Unknown input config type: '"+g.type+"'")}}return r.i.send(u),D(E,r.C,4);case 4:u.delete(),E.g=0}})})};function _n(t,e,n){return st(t,function r(){var i,u,o,c,h,g,x=this,V,R,E,v,_,T,P,rt;return X(r,function(Y){switch(Y.g){case 1:if(!n)return Y.return(e);for(i={},u=0,o=z(Object.keys(n)),c=o.next();!c.done;c=o.next())h=c.value,g=n[h],typeof g!="string"&&g.type==="texture"&&e[g.stream]!==void 0&&++u;1>>0)+"_",M=0;return l}),m("Symbol.iterator",function(s){if(s)return s;s=Symbol("Symbol.iterator");for(var l="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),w=0;w"u"?!0:(typeof d=="function"?d=new d("unhandledrejection",{cancelable:!0}):typeof b=="function"?d=new b("unhandledrejection",{cancelable:!0}):(d=S.document.createEvent("CustomEvent"),d.initCustomEvent("unhandledrejection",!1,!0,d)),d.promise=this,d.reason=this.i,$(d))},l.prototype.H=function(){if(this.g!=null){for(var d=0;d"u"||q.execScript("var "+H[0]);for(var X;H.length&&(X=H.shift());)H.length||D===void 0?q[X]&&q[X]!==Object.prototype[X]?q=q[X]:q=q[X]={}:q[X]=D}).call(zt);const qn=[33,7,163,144,145,153,154,155,133,173,157,157,158,159,160,161,246],t1=[263,249,390,373,374,380,381,382,362,398,384,384,385,386,387,388,466],e1=[156,70,63,105,66,107],n1=[383,300,293,334,296,336],r1=[78,191,80,81,82,13,312,311,310,415,308,324,318,402,317,14,87,178,88,95,78],i1=[61,185,40,39,37,0,267,269,270,409,291,375,321,405,314,17,84,181,91,146],o1=[6,197,195,5,4],s1=[98,97,2,328,327],a1=[454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234];function u1(a){Fn(a,"svelte-39b13y","canvas.svelte-39b13y{border-radius:0.5rem;--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.capture-btn.svelte-39b13y{z-index:10;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(248 250 252 / var(--tw-bg-opacity));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.capture-btn.svelte-39b13y:hover{--tw-bg-opacity:1;background-color:rgb(207 250 254 / var(--tw-bg-opacity))}.container.svelte-39b13y *{color:black !important}")}function c1(a){let f,y,S,m,C,j,z,N,O,K,W;return{c(){f=Ft("div"),y=Ft("video"),S=de(),m=Ft("canvas"),C=de(),j=Ft("div"),z=Ft("button"),z.textContent="Snap",N=de(),O=Ft("canvas"),gt(y,"class","hidden"),y.muted=!0,y.playsInline=!0,gt(m,"width","720px"),gt(m,"height","720px"),gt(m,"class","w-full svelte-39b13y"),gt(z,"class","capture-btn svelte-39b13y"),gt(O,"width","720px"),gt(O,"height","720px"),gt(O,"class","w-32 svelte-39b13y"),gt(j,"class","flex absolute bottom-1 left-1 items-end"),gt(f,"class","relative container svelte-39b13y")},m(et,it){Cn(et,f,it),wt(f,y),a[4](y),wt(f,S),wt(f,m),a[5](m),wt(f,C),wt(f,j),wt(j,z),wt(j,N),wt(j,O),a[6](O),K||(W=Nn(z,"click",a[3]),K=!0)},p:Bt,i:Bt,o:Bt,d(et){et&&Ke(f),a[4](null),a[5](null),a[6](null),K=!1,W()}}}function l1(a,f,y){const S=Zn.FaceMesh||window.FaceMesh,m=Qn.Camera||window.Camera;let C,j,z,N,O,K,W,et,it="landmarks",Q=ut;Gn(()=>{if(et=document.getElementById("canvas-root"),et._data||(et._data={image:null}),et.dataset.mode){const q=et.dataset.mode;it=q,Q=q==="points"?kt:ut}z=j.getContext("2d"),K=document.createElement("canvas"),W=K.getContext("2d"),K.width=j.width,K.height=j.height;const k=new S({locateFile:q=>`https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh/${q}`});k.setOptions({maxNumFaces:1,refineLandmarks:!0,minDetectionConfidence:.5,minTrackingConfidence:.5}),k.onResults(Et),new m(C,{onFrame:async()=>{await k.send({image:C})},width:720,height:720}).start()});function ut(k,H,q,X="lime",s=4,l=!1){k.save(),k.beginPath(),k.strokeStyle=X,k.fillStyle=X,k.lineWidth=s;for(const[w,p]of q.entries()){const M=H[p];w===0?k.moveTo(M.x*j.width,M.y*j.height):k.lineTo(M.x*j.width,M.y*j.height)}l?(k.closePath(),k.fill()):k.stroke(),k.restore()}function kt(k,H,q,X="black",s=4,l=!1){k.save(),X="black",k.strokeStyle=X;for(const[w,p]of q.entries()){const M=H[p];k.beginPath(),k.ellipse(M.x*j.width,M.y*j.height,2.5,2.5,0,0,2*Math.PI),k.closePath(),k.stroke(),k.fill()}k.restore()}function Et(k){if(z.save(),z.clearRect(0,0,j.width,j.height),z.drawImage(k.image,0,0,j.width,j.height),W.clearRect(0,0,K.width,K.height),k.multiFaceLandmarks)for(const H of k.multiFaceLandmarks)Q(W,H,t1,"magenta",8,!0),Q(W,H,qn,"magenta",8,!0),Q(W,H,e1,"yellow",8,!1),Q(W,H,n1,"yellow",8,!1),Q(W,H,i1,"cyan",8,!0),Q(W,H,r1,"blue",8,!0),Q(W,H,o1,"orange",8,!1),Q(W,H,s1,"orange",8,!1),Q(W,H,a1,"lime",8,!1);z.drawImage(K,0,0,j.width,j.height)}function jt(){O=N.getContext("2d"),O.save(),O.fillStyle=it==="landmarks"?"black":"white",O.fillRect(0,0,N.width,N.height),O.drawImage(K,0,0,N.width,N.height),it==="points"&&(O.globalCompositeOperation="difference",O.fillStyle="white",O.fillRect(0,0,N.width,N.height),O.drawImage(K,0,0,N.width,N.height)),O.restore(),et._data.image=N.toDataURL()}function D(k){Jt[k?"unshift":"push"](()=>{C=k,y(0,C)})}function At(k){Jt[k?"unshift":"push"](()=>{j=k,y(1,j)})}function Vt(k){Jt[k?"unshift":"push"](()=>{N=k,y(2,N)})}return[C,j,N,jt,D,At,Vt]}class f1 extends Kn{constructor(f){super(),Jn(this,f,l1,c1,Tn,{},u1)}}class h1 extends HTMLElement{constructor(){super()}connectedCallback(){const f=this.attachShadow({mode:"open"}),y=document.createElement("style");y.appendChild(document.createTextNode(Sn)),f.appendChild(y),new f1({target:f})}}customElements.define("face-canvas",h1);