@microblink/capture 1.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 +175 -0
- package/dist/capture.js +16647 -0
- package/dist/capture.umd.cjs +238 -0
- package/dist/resources/advanced/capture-wasm.data +0 -0
- package/dist/resources/advanced/capture-wasm.js +159 -0
- package/dist/resources/advanced/capture-wasm.wasm +0 -0
- package/dist/resources/advanced-threads/capture-wasm.data +0 -0
- package/dist/resources/advanced-threads/capture-wasm.js +178 -0
- package/dist/resources/advanced-threads/capture-wasm.wasm +0 -0
- package/dist/resources/advanced-threads/capture-wasm.worker.js +1 -0
- package/dist/resources/basic/capture-wasm.data +0 -0
- package/dist/resources/basic/capture-wasm.js +159 -0
- package/dist/resources/basic/capture-wasm.wasm +0 -0
- package/dist/resources/capture-worker.js +5 -0
- package/dist/style.css +1 -0
- package/package.json +62 -0
- package/types/index.d.cts +12 -0
- package/types/index.d.ts +913 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
(function(Ht,En){typeof exports=="object"&&typeof module<"u"?En(exports):typeof define=="function"&&define.amd?define(["exports"],En):(Ht=typeof globalThis<"u"?globalThis:Ht||self,En(Ht.capture={}))})(this,function(Ht){"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/const En=Symbol("Comlink.proxy"),$d=Symbol("Comlink.endpoint"),Vd=Symbol("Comlink.releaseProxy"),zr=Symbol("Comlink.finalizer"),Oi=Symbol("Comlink.thrown"),Va=t=>typeof t=="object"&&t!==null||typeof t=="function",Wd={canHandle:t=>Va(t)&&t[En],serialize(t){const{port1:e,port2:n}=new MessageChannel;return Za(t,e),[n,[n]]},deserialize(t){return t.start(),Xa(t)}},Zd={canHandle:t=>Va(t)&&Oi in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},Wa=new Map([["proxy",Wd],["throw",Zd]]);function qd(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function Za(t,e=globalThis,n=["*"]){e.addEventListener("message",function i(r){if(!r||!r.data)return;if(!qd(n,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}const{id:o,type:a,path:s}=Object.assign({path:[]},r.data),u=(r.data.argumentList||[]).map(sn);let l;try{const g=s.slice(0,-1).reduce((c,f)=>c[f],t),M=s.reduce((c,f)=>c[f],t);switch(a){case"GET":l=M;break;case"SET":g[s.slice(-1)[0]]=sn(r.data.value),l=!0;break;case"APPLY":l=M.apply(g,u);break;case"CONSTRUCT":{const c=new M(...u);l=ng(c)}break;case"ENDPOINT":{const{port1:c,port2:f}=new MessageChannel;Za(t,f),l=ns(c,[c])}break;case"RELEASE":l=void 0;break;default:return}}catch(g){l={value:g,[Oi]:0}}Promise.resolve(l).catch(g=>({value:g,[Oi]:0})).then(g=>{const[M,c]=Ui(g);e.postMessage(Object.assign(Object.assign({},M),{id:o}),c),a==="RELEASE"&&(e.removeEventListener("message",i),qa(e),zr in t&&typeof t[zr]=="function"&&t[zr]())}).catch(g=>{const[M,c]=Ui({value:new TypeError("Unserializable return value"),[Oi]:0});e.postMessage(Object.assign(Object.assign({},M),{id:o}),c)})}),e.start&&e.start()}function Xd(t){return t.constructor.name==="MessagePort"}function qa(t){Xd(t)&&t.close()}function Xa(t,e){return kr(t,[],e)}function Ci(t){if(t)throw new Error("Proxy has been released and is not useable")}function Ja(t){return Sn(t,{type:"RELEASE"}).then(()=>{qa(t)})}const zi=new WeakMap,ki="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(zi.get(t)||0)-1;zi.set(t,e),e===0&&Ja(t)});function Jd(t,e){const n=(zi.get(e)||0)+1;zi.set(e,n),ki&&ki.register(t,e,t)}function tg(t){ki&&ki.unregister(t)}function kr(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(o,a){if(Ci(i),a===Vd)return()=>{tg(r),Ja(t),i=!0};if(a==="then"){if(e.length===0)return{then:()=>r};const s=Sn(t,{type:"GET",path:e.map(u=>u.toString())}).then(sn);return s.then.bind(s)}return kr(t,[...e,a])},set(o,a,s){Ci(i);const[u,l]=Ui(s);return Sn(t,{type:"SET",path:[...e,a].map(g=>g.toString()),value:u},l).then(sn)},apply(o,a,s){Ci(i);const u=e[e.length-1];if(u===$d)return Sn(t,{type:"ENDPOINT"}).then(sn);if(u==="bind")return kr(t,e.slice(0,-1));const[l,g]=ts(s);return Sn(t,{type:"APPLY",path:e.map(M=>M.toString()),argumentList:l},g).then(sn)},construct(o,a){Ci(i);const[s,u]=ts(a);return Sn(t,{type:"CONSTRUCT",path:e.map(l=>l.toString()),argumentList:s},u).then(sn)}});return Jd(r,t),r}function eg(t){return Array.prototype.concat.apply([],t)}function ts(t){const e=t.map(Ui);return[e.map(n=>n[0]),eg(e.map(n=>n[1]))]}const es=new WeakMap;function ns(t,e){return es.set(t,e),t}function ng(t){return Object.assign(t,{[En]:!0})}function Ui(t){for(const[e,n]of Wa)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},es.get(t)||[]]}function sn(t){switch(t.type){case"HANDLER":return Wa.get(t.name).deserialize(t.value);case"RAW":return t.value}}function Sn(t,e,n){return new Promise(i=>{const r=ig();t.addEventListener("message",function o(a){!a.data||!a.data.id||a.data.id!==r||(t.removeEventListener("message",o),i(a.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:r},e),n)})}function ig(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Ur=(t=>(t[t.Invalid=0]="Invalid",t[t.RequiresServerPermission=1]="RequiresServerPermission",t[t.Valid=2]="Valid",t))(Ur||{}),Yr=(t=>(t[t.Ok=0]="Ok",t[t.NetworkError=1]="NetworkError",t[t.RemoteLock=2]="RemoteLock",t[t.PermissionExpired=3]="PermissionExpired",t[t.PayloadCorrupted=4]="PayloadCorrupted",t[t.PayloadSignatureVerificationFailed=5]="PayloadSignatureVerificationFailed",t[t.IncorrectTokenState=6]="IncorrectTokenState",t))(Yr||{});(function(t){/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2019 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
9
|
+
*/const e=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),o=Symbol("Comlink.thrown"),a=L=>typeof L=="object"&&L!==null||typeof L=="function",s={canHandle:L=>a(L)&&L[e],serialize(L){const{port1:A,port2:Q}=new MessageChannel;return M(L,A),[Q,[Q]]},deserialize(L){return L.start(),d(L)}},u={canHandle:L=>a(L)&&o in L,serialize({value:L}){let A;return L instanceof Error?A={isError:!0,value:{message:L.message,name:L.name,stack:L.stack}}:A={isError:!1,value:L},[A,[]]},deserialize(L){throw L.isError?Object.assign(new Error(L.value.message),L.value):L.value}},l=new Map([["proxy",s],["throw",u]]);function g(L,A){for(const Q of L)if(A===Q||Q==="*"||Q instanceof RegExp&&Q.test(A))return!0;return!1}function M(L,A=globalThis,Q=["*"]){A.addEventListener("message",function lt(rt){if(!rt||!rt.data)return;if(!g(Q,rt.origin)){console.warn(`Invalid origin '${rt.origin}' for comlink proxy`);return}const{id:At,type:q,path:ft}=Object.assign({path:[]},rt.data),jt=(rt.data.argumentList||[]).map(C);let dt;try{const Mt=ft.slice(0,-1).reduce((ot,Ct)=>ot[Ct],L),et=ft.reduce((ot,Ct)=>ot[Ct],L);switch(q){case"GET":dt=et;break;case"SET":Mt[ft.slice(-1)[0]]=C(rt.data.value),dt=!0;break;case"APPLY":dt=et.apply(Mt,jt);break;case"CONSTRUCT":{const ot=new et(...jt);dt=Y(ot)}break;case"ENDPOINT":{const{port1:ot,port2:Ct}=new MessageChannel;M(L,Ct),dt=F(ot,[ot])}break;case"RELEASE":dt=void 0;break;default:return}}catch(Mt){dt={value:Mt,[o]:0}}Promise.resolve(dt).catch(Mt=>({value:Mt,[o]:0})).then(Mt=>{const[et,ot]=U(Mt);A.postMessage(Object.assign(Object.assign({},et),{id:At}),ot),q==="RELEASE"&&(A.removeEventListener("message",lt),f(A),r in L&&typeof L[r]=="function"&&L[r]())}).catch(Mt=>{const[et,ot]=U({value:new TypeError("Unserializable return value"),[o]:0});A.postMessage(Object.assign(Object.assign({},et),{id:At}),ot)})}),A.start&&A.start()}function c(L){return L.constructor.name==="MessagePort"}function f(L){c(L)&&L.close()}function d(L,A){return j(L,[],A)}function h(L){if(L)throw new Error("Proxy has been released and is not useable")}function y(L){return I(L,{type:"RELEASE"}).then(()=>{f(L)})}const p=new WeakMap,w="FinalizationRegistry"in globalThis&&new FinalizationRegistry(L=>{const A=(p.get(L)||0)-1;p.set(L,A),A===0&&y(L)});function m(L,A){const Q=(p.get(A)||0)+1;p.set(A,Q),w&&w.register(L,A,L)}function N(L){w&&w.unregister(L)}function j(L,A=[],Q=function(){}){let lt=!1;const rt=new Proxy(Q,{get(At,q){if(h(lt),q===i)return()=>{N(rt),y(L),lt=!0};if(q==="then"){if(A.length===0)return{then:()=>rt};const ft=I(L,{type:"GET",path:A.map(jt=>jt.toString())}).then(C);return ft.then.bind(ft)}return j(L,[...A,q])},set(At,q,ft){h(lt);const[jt,dt]=U(ft);return I(L,{type:"SET",path:[...A,q].map(Mt=>Mt.toString()),value:jt},dt).then(C)},apply(At,q,ft){h(lt);const jt=A[A.length-1];if(jt===n)return I(L,{type:"ENDPOINT"}).then(C);if(jt==="bind")return j(L,A.slice(0,-1));const[dt,Mt]=S(ft);return I(L,{type:"APPLY",path:A.map(et=>et.toString()),argumentList:dt},Mt).then(C)},construct(At,q){h(lt);const[ft,jt]=S(q);return I(L,{type:"CONSTRUCT",path:A.map(dt=>dt.toString()),argumentList:ft},jt).then(C)}});return m(rt,L),rt}function b(L){return Array.prototype.concat.apply([],L)}function S(L){const A=L.map(U);return[A.map(Q=>Q[0]),b(A.map(Q=>Q[1]))]}const v=new WeakMap;function F(L,A){return v.set(L,A),L}function Y(L){return Object.assign(L,{[e]:!0})}function U(L){for(const[A,Q]of l)if(Q.canHandle(L)){const[lt,rt]=Q.serialize(L);return[{type:"HANDLER",name:A,value:lt},rt]}return[{type:"RAW",value:L},v.get(L)||[]]}function C(L){switch(L.type){case"HANDLER":return l.get(L.name).deserialize(L.value);case"RAW":return L.value}}function I(L,A,Q){return new Promise(lt=>{const rt=x();L.addEventListener("message",function At(q){!q.data||!q.data.id||q.data.id!==rt||(L.removeEventListener("message",At),lt(q.data))}),L.start&&L.start(),L.postMessage(Object.assign({id:rt},A),Q)})}function x(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const k=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),D=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])),P=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),R=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),H=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),Z=async()=>WebAssembly.validate(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])),tt=()=>(async L=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(L)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function at(){return/iOS|iPhone|iPad|iPod/i.test(navigator.userAgent)}async function bt(){if(!await tt())return!1;if(!("importScripts"in self))throw Error("Not implemented");return at()?!1:"Worker"in self}async function Ft(){const L=[D(),P(),k(),R(),H()];if(!(await Promise.all(L)).every(Boolean))throw new Error("Browser doesn't meet minimum requirements!");return await Z()?await bt()?"advanced-threads":"advanced":"basic"}let Lt,B;async function ct(){const L=await Ft();console.log(`Requesting ${L} Wasm build`);const A=new URL(`resources/${L}/capture-wasm.js`,self.location.origin);try{importScripts(A)}catch(Q){console.error("loading scripts failed",Q)}return Lt=await self.createModule({locateFile:Q=>new URL(`resources/${L}/`+Q,self.location.origin).toString(),mainScriptUrlOrBlob:A.toString(),setStatus:Q=>{}}),Lt[r]=()=>{console.log("finalizer wasmModule")},Y(Lt)}function Nt(){return Lt||console.warn("Wasm is not initialized yet. Call loadWasm() first."),B=new Lt.Analyzer,B[r]=()=>{console.log("Comlink.finalizer called on Analyzer instance. Deleting instance."),B.delete()},Y(B)}function Ee(L){const A=B.analyze(L);return self.postMessage({},[L.data.buffer]),L=null,A}const oe={createAnalyzer:Nt,loadWasm:ct,analyze:Ee,terminate:()=>self.close(),[r]:()=>{console.log("Comlink.finalizer called on proxyWorker")}};return M(oe),t.proxyWorker=oe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t})({}),!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),n=this.getVideoPlaybackQuality(),i=this.mozPresentedFrames||this.mozPaintedFrames||n.totalVideoFrames-n.droppedVideoFrames,r=(o,a)=>{const s=this.getVideoPlaybackQuality(),u=this.mozPresentedFrames||this.mozPaintedFrames||s.totalVideoFrames-s.droppedVideoFrames;if(u>i){const l=this.mozFrameDelay||s.totalFrameDelay-n.totalFrameDelay||0,g=a-o;t(a,{presentationTime:a+l*1e3,expectedDisplayTime:a+g,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+g/1e3,presentedFrames:u,processingDuration:l}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(l=>r(a,l))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(o=>r(e,o)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]});const is=Element.prototype.attachShadow;function Pr(){return typeof window.ShadyDOM<"u"&&typeof ShadowRoot<"u"}function rg(){return typeof ShadowRoot<"u"}function og(t){is==null||Pr()||(Element.prototype.attachShadow=function(e){const n=is.call(this,e);return t(n),n})}function ag(t,...e){const n=new Set(e);let i=!1;const r=()=>{for(const o of n)t(o);n.clear()};return{isRunning(){return i},schedule(o){n.add(o),i&&r()},stop(){i=!1},run(){i||(i=!0,r())}}}const sg={childList:!0,subtree:!0},ug=t=>{typeof queueMicrotask<"u"?queueMicrotask(t):typeof Promise<"u"?Promise.resolve().then(()=>t()):setTimeout(()=>t(),0)};function rs(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null)return[...t];{const e=[];for(let n=0;n<t.length;n++)e[n]=t[n];return e}}function cg(t,e){return Pr()?new Set(rs(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement,e))):new Set("querySelectorAll"in t?rs(t.querySelectorAll(e)):[])}function lg(t,e){return new Set([...t??[],...e??[]])}function dg(t){return"activeElement"in t}function os(t=document.documentElement){if(dg(t)&&as(t),Pr()&&t instanceof ShadowRoot||!rg())return;const e=t.childNodes,n="shadowRoot"in t&&t.shadowRoot!=null?[t.shadowRoot]:[];for(const i of[...e,...n])os(i)}function gg(t){return"isConnected"in Node.prototype?t.isConnected:t.ownerDocument==null||!(t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED)}const ri=new Map;function hg(t,e){const n=new Set,i=new Set,r=new Map,o=new WeakMap;let a=!1,s=!1,u=!1;const l=()=>{s=!0;const p=[...n];p.length>0&&e(p,t),n.clear(),a=!1,s=!1},g=()=>{a||(a=!0,ug(l))},M=p=>{n.add(p),s||g()},c=()=>{const p=[...n];return n.clear(),p},f=()=>{i.clear()},d=(p,w)=>{let m=r.get(p);const N=cg(p,w),j=m?.get(w),b=lg(N,j);h(b),m==null&&(m=new Map,r.set(p,m)),m.set(w,N)},h=p=>{for(const w of p){const m=o.get(w),N=gg(w);m!==N&&(o.set(w,N),M({connected:N,target:w}))}},y={observedTargets:i,queryRootAndHandleMutationChanges:d,handleMutationChange:h,addObservedTarget:p=>{if(Rr.run(),u||(u=!0,os()),i.add(p),typeof p!="string")h([p]);else for(const w of _r)d(w,p)},clearObservedTargets:f,clearQueue:c};ri.set(t,y)}const fg=t=>{for(const e of t)if(e.type==="childList")for(const n of ri.values())for(const i of n.observedTargets)typeof i=="string"?n.queryRootAndHandleMutationChanges(e.target,i):n.handleMutationChange([i])},_r=new Set,as=(()=>{let t;return function(e){_r.has(e)||(_r.add(e),t==null&&(t=new MutationObserver(fg)),t.observe(e,sg))}})(),Rr=ag(as,document.documentElement);class un{constructor(e){if(new.target===void 0)throw new TypeError(`Constructor ${un.name} requires 'new'`);if(e===void 0)throw new ReferenceError(`Failed to construct '${un.name}': 1 argument required, but only 0 present.`);if(typeof e!="function")throw new TypeError(`Failed to construct '${un.name}': The callback provided as parameter 1 is not a function.`);hg(this,e)}get[Symbol.toStringTag](){return"ConnectionObserver"}observe(e){if(e===void 0)throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${un.name}': 1 argument required, but only 0 present.`);if(typeof e!="string"&&!(e instanceof Node))throw new TypeError(`Failed to execute '${this.observe.name}' on '${un.name}': parameter 1 is not of type 'Node' or a DOMString.`);ri.get(this)?.addObservedTarget(e)}takeRecords(){const e=ri.get(this);return e==null?[]:e.clearQueue()}disconnect(){ri.get(this)?.clearObservedTargets()}}og(Rr.schedule.bind(Rr));var Mg=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),yg=pg(["",""],["",""]);function pg(t,e){return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function mg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var qt=function(){function t(){for(var e=this,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return mg(this,t),this.tag=function(o){for(var a=arguments.length,s=Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];return typeof o=="function"?e.interimTag.bind(e,o):typeof o=="string"?e.transformEndResult(o):(o=o.map(e.transformString.bind(e)),e.transformEndResult(o.reduce(e.processSubstitutions.bind(e,s))))},i.length>0&&Array.isArray(i[0])&&(i=i[0]),this.transformers=i.map(function(o){return typeof o=="function"?o():o}),this.tag}return Mg(t,[{key:"interimTag",value:function(e,n){for(var i=arguments.length,r=Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return this.tag(yg,e.apply(void 0,[n].concat(r)))}},{key:"processSubstitutions",value:function(e,n,i){var r=this.transformSubstitution(e.shift(),n);return"".concat(n,r,i)}},{key:"transformString",value:function(e){var n=function(i,r){return r.onString?r.onString(i):i};return this.transformers.reduce(n,e)}},{key:"transformSubstitution",value:function(e,n){var i=function(r,o){return o.onSubstitution?o.onSubstitution(r,n):r};return this.transformers.reduce(i,e)}},{key:"transformEndResult",value:function(e){var n=function(i,r){return r.onEndResult?r.onEndResult(i):i};return this.transformers.reduce(n,e)}}]),t}(),Xt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return{onEndResult:function(e){if(t==="")return e.trim();if(t=t.toLowerCase(),t==="start"||t==="left")return e.replace(/^\s*/,"");if(t==="end"||t==="right")return e.replace(/\s*$/,"");throw new Error("Side not supported: "+t)}}};function Ng(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}else return Array.from(t)}var He=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"initial";return{onEndResult:function(e){if(t==="initial"){var n=e.match(/^[^\S\n]*(?=\S)/gm),i=n&&Math.min.apply(Math,Ng(n.map(function(o){return o.length})));if(i){var r=new RegExp("^.{"+i+"}","gm");return e.replace(r,"")}return e}if(t==="all")return e.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+t)}}},bn=function(t,e){return{onEndResult:function(n){if(t==null||e==null)throw new Error("replaceResultTransformer requires at least 2 arguments.");return n.replace(t,e)}}},An=function(t,e){return{onSubstitution:function(n,i){if(t==null||e==null)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return n==null?n:n.toString().replace(t,e)}}},wg={separator:"",conjunction:"",serial:!1},De=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wg;return{onSubstitution:function(e,n){if(Array.isArray(e)){var i=e.length,r=t.separator,o=t.conjunction,a=t.serial,s=n.match(/(\n?[^\S\n]+)$/);if(s?e=e.join(r+s[1]):e=e.join(r+" "),o&&i>1){var u=e.lastIndexOf(r);e=e.slice(0,u)+(a?r:"")+" "+o+e.slice(u+1)}}return e}}},ss=function(t){return{onSubstitution:function(e,n){if(t!=null&&typeof t=="string")typeof e=="string"&&e.includes(t)&&(e=e.split(t));else throw new Error("You need to specify a string character to split by.");return e}}},us=function(t){return t!=null&&!Number.isNaN(t)&&typeof t!="boolean"},Lg=function(){return{onSubstitution:function(t){return Array.isArray(t)?t.filter(us):us(t)?t:""}}};new qt(De({separator:","}),He,Xt),new qt(De({separator:",",conjunction:"and"}),He,Xt),new qt(De({separator:",",conjunction:"or"}),He,Xt),new qt(ss(`
|
|
10
|
+
`),Lg,De,He,Xt),new qt(ss(`
|
|
11
|
+
`),De,He,Xt,An(/&/g,"&"),An(/</g,"<"),An(/>/g,">"),An(/"/g,"""),An(/'/g,"'"),An(/`/g,"`")),new qt(bn(/(?:\n(?:\s*))+/g," "),Xt),new qt(bn(/(?:\n\s*)/g,""),Xt),new qt(De({separator:","}),bn(/(?:\s+)/g," "),Xt),new qt(De({separator:",",conjunction:"or"}),bn(/(?:\s+)/g," "),Xt),new qt(De({separator:",",conjunction:"and"}),bn(/(?:\s+)/g," "),Xt),new qt(De,He,Xt),new qt(De,bn(/(?:\s+)/g," "),Xt),new qt(He,Xt);var cs=new qt(He("all"),Xt),Tg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fr={exports:{}};(function(t,e){(function(n,i){var r="1.0.35",o="",a="?",s="function",u="undefined",l="object",g="string",M="major",c="model",f="name",d="type",h="vendor",y="version",p="architecture",w="console",m="mobile",N="tablet",j="smarttv",b="wearable",S="embedded",v=350,F="Amazon",Y="Apple",U="ASUS",C="BlackBerry",I="Browser",x="Chrome",k="Edge",D="Firefox",P="Google",R="Huawei",H="LG",Z="Microsoft",tt="Motorola",at="Opera",bt="Samsung",Ft="Sharp",Lt="Sony",B="Xiaomi",ct="Zebra",Nt="Facebook",Ee="Chromium OS",oe="Mac OS",L=function(_,K){var z={};for(var $ in _)K[$]&&K[$].length%2===0?z[$]=K[$].concat(_[$]):z[$]=_[$];return z},A=function(_){for(var K={},z=0;z<_.length;z++)K[_[z].toUpperCase()]=_[z];return K},Q=function(_,K){return typeof _===g?lt(K).indexOf(lt(_))!==-1:!1},lt=function(_){return _.toLowerCase()},rt=function(_){return typeof _===g?_.replace(/[^\d\.]/g,o).split(".")[0]:i},At=function(_,K){if(typeof _===g)return _=_.replace(/^\s\s*/,o),typeof K===u?_:_.substring(0,v)},q=function(_,K){for(var z=0,$,Bt,zt,G,O,Yt;z<K.length&&!O;){var jn=K[z],xi=K[z+1];for($=Bt=0;$<jn.length&&!O&&jn[$];)if(O=jn[$++].exec(_),O)for(zt=0;zt<xi.length;zt++)Yt=O[++Bt],G=xi[zt],typeof G===l&&G.length>0?G.length===2?typeof G[1]==s?this[G[0]]=G[1].call(this,Yt):this[G[0]]=G[1]:G.length===3?typeof G[1]===s&&!(G[1].exec&&G[1].test)?this[G[0]]=Yt?G[1].call(this,Yt,G[2]):i:this[G[0]]=Yt?Yt.replace(G[1],G[2]):i:G.length===4&&(this[G[0]]=Yt?G[3].call(this,Yt.replace(G[1],G[2])):i):this[G]=Yt||i;z+=2}},ft=function(_,K){for(var z in K)if(typeof K[z]===l&&K[z].length>0){for(var $=0;$<K[z].length;$++)if(Q(K[z][$],_))return z===a?i:z}else if(Q(K[z],_))return z===a?i:z;return _},jt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},dt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,y],[/opios[\/ ]+([\w\.]+)/i],[y,[f,at+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[f,at]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[f,"UC"+I]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[y,[f,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[y,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[f,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+I],y],[/\bfocus\/([\w\.]+)/i],[y,[f,D+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[f,at+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[f,at+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[f,"MIUI "+I]],[/fxios\/([-\w\.]+)/i],[y,[f,D]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+I]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+I],y],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[f,y],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Nt],y],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[f,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[f,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,x+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[f,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[y,ft,jt]],[/(webkit|khtml)\/([\w\.]+)/i],[f,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[f,D+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,y],[/(cobalt)\/([\w\.]+)/i],[f,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,lt]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,o,lt]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,lt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,bt],[d,N]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,bt],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[h,Y],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,Y],[d,N]],[/(macintosh);/i],[c,[h,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,Ft],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,R],[d,N]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,R],[d,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[h,B],[d,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,B],[d,N]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[d,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,tt],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,tt],[d,N]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,H],[d,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,H],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[d,N]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[h,P],[d,N]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,P],[d,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,Lt],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,Lt],[d,N]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,F],[d,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,F],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[d,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,C],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,U],[d,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,U],[d,m]],[/(nexus 9)/i],[c,[h,"HTC"],[d,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[d,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[d,N]],[/(surface duo)/i],[c,[h,Z],[d,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[d,m]],[/(u304aa)/i],[c,[h,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[d,N]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[d,N]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[d,N]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[d,N]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[d,N]],[/\b(k88) b/i],[c,[h,"ZTE"],[d,N]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[d,N]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[d,N]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[d,N]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[d,N]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[d,N]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[d,m]],[/\b(ph-1) /i],[c,[h,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[d,N]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[d,N]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[d,N]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[d,N]],[/(sprint) (\w+)/i],[h,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,Z],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,ct],[d,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,ct],[d,m]],[/smart-tv.+(samsung)/i],[h,[d,j]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,bt],[d,j]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,H],[d,j]],[/(apple) ?tv/i],[h,[c,Y+" TV"],[d,j]],[/crkey/i],[[c,x+"cast"],[h,P],[d,j]],[/droid.+aft(\w)( bui|\))/i],[c,[h,F],[d,j]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,Ft],[d,j]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,Lt],[d,j]],[/(mitv-\w{5}) bui/i],[c,[h,B],[d,j]],[/Hbbtv.*(technisat) (.*);/i],[h,c,[d,j]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,At],[c,At],[d,j]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,j]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[d,w]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[d,w]],[/(playstation [345portablevi]+)/i],[c,[h,Lt],[d,w]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,Z],[d,w]],[/((pebble))app/i],[h,c,[d,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[h,Y],[d,b]],[/droid.+; (glass) \d/i],[c,[h,P],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,ct],[d,b]],[/(quest( 2| pro)?)/i],[c,[h,Nt],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,S]],[/(aeobc)\b/i],[c,[h,F],[d,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,N]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[f,k+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,y],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[f,[y,ft,dt]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,"Windows"],[y,ft,dt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,oe],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,y],[/\(bb(10);/i],[y,[f,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[f,D+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[f,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,Ee],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,y],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,y]]},et=function(_,K){if(typeof _===l&&(K=_,_=i),!(this instanceof et))return new et(_,K).getResult();var z=typeof n!==u&&n.navigator?n.navigator:i,$=_||(z&&z.userAgent?z.userAgent:o),Bt=z&&z.userAgentData?z.userAgentData:i,zt=K?L(Mt,K):Mt,G=z&&z.userAgent==$;return this.getBrowser=function(){var O={};return O[f]=i,O[y]=i,q.call(O,$,zt.browser),O[M]=rt(O[y]),G&&z&&z.brave&&typeof z.brave.isBrave==s&&(O[f]="Brave"),O},this.getCPU=function(){var O={};return O[p]=i,q.call(O,$,zt.cpu),O},this.getDevice=function(){var O={};return O[h]=i,O[c]=i,O[d]=i,q.call(O,$,zt.device),G&&!O[d]&&Bt&&Bt.mobile&&(O[d]=m),G&&O[c]=="Macintosh"&&z&&typeof z.standalone!==u&&z.maxTouchPoints&&z.maxTouchPoints>2&&(O[c]="iPad",O[d]=N),O},this.getEngine=function(){var O={};return O[f]=i,O[y]=i,q.call(O,$,zt.engine),O},this.getOS=function(){var O={};return O[f]=i,O[y]=i,q.call(O,$,zt.os),G&&!O[f]&&Bt&&Bt.platform!="Unknown"&&(O[f]=Bt.platform.replace(/chrome os/i,Ee).replace(/macos/i,oe)),O},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return $},this.setUA=function(O){return $=typeof O===g&&O.length>v?At(O,v):O,this},this.setUA($),this};et.VERSION=r,et.BROWSER=A([f,y,M]),et.CPU=A([p]),et.DEVICE=A([c,h,d,w,m,j,N,b,S]),et.ENGINE=et.OS=A([f,y]),t.exports&&(e=t.exports=et),e.UAParser=et;var ot=typeof n!==u&&(n.jQuery||n.Zepto);if(ot&&!ot.ua){var Ct=new et;ot.ua=Ct.getResult(),ot.ua.get=function(){return Ct.getUA()},ot.ua.set=function(_){Ct.setUA(_);var K=Ct.getResult();for(var z in K)ot.ua[z]=K[z]}}})(typeof window=="object"?window:Tg)})(Fr,Fr.exports);var Eg=Fr.exports;const Sg=jg(Eg);function ls(t){const e=Object.keys(t);if(e.length===0)throw new Error("No members in object!");let n=e[0],i=-1/0;for(const[r,o]of Object.entries(t))o>i&&(i=o,n=r);return n}const ds=t=>{if(t instanceof Error)return t;try{return new Error(JSON.stringify(t))}catch{return new Error(String(t))}};let gs=class{deviceInfo;settings;activeStream;name;#t;constructor(e,n){this.deviceInfo=e,this.name=e.label,this.activeStream=null,this.#t=fs(e),this.settings=n}async startStream(){if(this.activeStream)return this.activeStream;const e=await navigator.mediaDevices.getUserMedia(this.#t);this.activeStream=e,e.onaddtrack=i=>console.log("added track",i),e.onremovetrack=i=>console.log("removed track",i);const n=e.getVideoTracks()[0];return n.onended=i=>{console.log("track ended",i),this.stopStream()},e}stopStream(){this.activeStream&&(console.log(`Stopping active stream on ${this.name}`),Qr(this.activeStream),this.activeStream=null)}getVideoTrack(){if(this.activeStream)return this.activeStream.getVideoTracks()[0]}};const Br=new Sg,Hr=Br.getOS().name==="Android",hs=Br.getOS().name==="iOS",bg=async()=>{try{const t=await navigator.mediaDevices.getUserMedia({video:!0});Qr(t)}catch{throw new Error("Camera permission not given")}},Ag=async()=>{if(!navigator.mediaDevices)throw new Error(cs`
|
|
12
|
+
Cameras can only be used in a secure context:
|
|
13
|
+
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
14
|
+
`);return await bg(),(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="videoinput")};async function vg(t){try{const e=await xg(t),n=e.getVideoTracks()[0].getSettings();return Qr(e),new gs(t,n)}catch{return console.warn(`DEBUG: Device ${t.deviceId} doesn't support this constraint.`),null}}const Dg=t=>{if(Br.getOS().name!=="Android")return;if(t.some(i=>i.settings.facingMode===void 0)){console.warn("Not all devices have facingMode");return}let e=0,n=0;for(const i of t){const r=i.settings.facingMode;r==="environment"&&(i.name=`Back camera ${++n}`),r==="user"&&(i.name=`Front camera ${++e}`)}},Qr=t=>{const e=t.getTracks();for(const n of e)n.stop()},Ig=t=>{const e={};for(const n of t){const i=n.deviceInfo.deviceId;e[i]=0,n.settings.facingMode==="environment"&&(e[i]+=2),Hr&&"torch"in n.settings&&(e[i]+=2),Hr&&n.settings.focusMode==="single-shot"&&(e[i]+=2),Hr&&n===t[t.length]&&(e[i]+=1),hs&&n.name==="Back Triple Camera"&&(e[i]+=5),hs&&n.name==="Back Dual Wide Camera"&&(e[i]+=3)}return ls(e)};function fs(t){return{video:{deviceId:{exact:t.deviceId},frameRate:{exact:30},width:{exact:1920},height:{exact:1080}},audio:!1}}async function xg(t){const e=fs(t);return await navigator.mediaDevices.getUserMedia(e)}async function Og(){const t=await Ag(),e=[];for await(const n of t){const i=await vg(n);i!==null&&e.push(i)}return e}const Cg=(t=window.location.href)=>{const e=new Worker(t+"/resources/capture-worker.js");return e.onerror=n=>console.error(n),Xa(e)};let zg=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const Ms="capture-userid";function kg(){const t=localStorage.getItem(Ms);if(t)return t;const e=zg();return localStorage.setItem(Ms,e),e}function Ug(t){return{licenseId:t.licenseId,licensee:t.licensee,packageName:t.packageName,platform:"Browser",sdkName:t.sdkName,sdkVersion:t.sdkVersion}}async function Yg(t){try{return await(await fetch("https://baltazar.microblink.com/api/v1/status/check",{method:"POST",headers:{"Content-Type":"application/json"},cache:"no-cache",body:JSON.stringify(Ug(t))})).json()}catch(e){throw console.error(e),e}}const Jt=Symbol.for("@ts-pattern/matcher"),ys=Symbol.for("@ts-pattern/isVariadic"),Yi="@ts-pattern/anonymous-select-key",Gr=t=>!!(t&&typeof t=="object"),Pi=t=>t&&!!t[Jt],_t=(t,e,n)=>{if(Pi(t)){const i=t[Jt](),{matched:r,selections:o}=i.match(e);return r&&o&&Object.keys(o).forEach(a=>n(a,o[a])),r}if(Gr(t)){if(!Gr(e))return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let i=[],r=[],o=[];for(const a of t.keys()){const s=t[a];Pi(s)&&s[ys]?o.push(s):o.length?r.push(s):i.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(e.length<i.length+r.length)return!1;const a=e.slice(0,i.length),s=r.length===0?[]:e.slice(-r.length),u=e.slice(i.length,r.length===0?1/0:-r.length);return i.every((l,g)=>_t(l,a[g],n))&&r.every((l,g)=>_t(l,s[g],n))&&(o.length===0||_t(o[0],u,n))}return t.length===e.length&&t.every((a,s)=>_t(a,e[s],n))}return Object.keys(t).every(i=>{const r=t[i];return(i in e||Pi(o=r)&&o[Jt]().matcherType==="optional")&&_t(r,e[i],n);var o})}return Object.is(e,t)},ae=t=>{var e,n,i;return Gr(t)?Pi(t)?(e=(n=(i=t[Jt]()).getSelectionKeys)==null?void 0:n.call(i))!=null?e:[]:Array.isArray(t)?oi(t,ae):oi(Object.values(t),ae):[]},oi=(t,e)=>t.reduce((n,i)=>n.concat(e(i)),[]);function Pg(...t){if(t.length===1){const[e]=t;return n=>_t(e,n,()=>{})}if(t.length===2){const[e,n]=t;return _t(e,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function Qt(t){return Object.assign(t,{optional:()=>$r(t),and:e=>vt(t,e),or:e=>ps(t,e),select:e=>e===void 0?ai(t):ai(e,t)})}function Kr(t){return Object.assign((e=>Object.assign(e,{*[Symbol.iterator](){yield Object.assign(e,{[ys]:!0})}}))(t),{optional:()=>Kr($r(t)),select:e=>Kr(e===void 0?ai(t):ai(e,t))})}function $r(t){return Qt({[Jt]:()=>({match:e=>{let n={};const i=(r,o)=>{n[r]=o};return e===void 0?(ae(t).forEach(r=>i(r,void 0)),{matched:!0,selections:n}):{matched:_t(t,e,i),selections:n}},getSelectionKeys:()=>ae(t),matcherType:"optional"})})}const _g=(t,e)=>{for(const n of t)if(!e(n))return!1;return!0},Rg=(t,e)=>{for(const[n,i]of t.entries())if(!e(i,n))return!1;return!0};function vt(...t){return Qt({[Jt]:()=>({match:e=>{let n={};const i=(r,o)=>{n[r]=o};return{matched:t.every(r=>_t(r,e,i)),selections:n}},getSelectionKeys:()=>oi(t,ae),matcherType:"and"})})}function ps(...t){return Qt({[Jt]:()=>({match:e=>{let n={};const i=(r,o)=>{n[r]=o};return oi(t,ae).forEach(r=>i(r,void 0)),{matched:t.some(r=>_t(r,e,i)),selections:n}},getSelectionKeys:()=>oi(t,ae),matcherType:"or"})})}function yt(t){return{[Jt]:()=>({match:e=>({matched:!!t(e)})})}}function ai(...t){const e=typeof t[0]=="string"?t[0]:void 0,n=t.length===2?t[1]:typeof t[0]=="string"?void 0:t[0];return Qt({[Jt]:()=>({match:i=>{let r={[e??Yi]:i};return{matched:n===void 0||_t(n,i,(o,a)=>{r[o]=a}),selections:r}},getSelectionKeys:()=>[e??Yi].concat(n===void 0?[]:ae(n))})})}function Ie(t){return typeof t=="number"}function cn(t){return typeof t=="string"}function Qe(t){return typeof t=="bigint"}const ms=Qt(yt(function(t){return!0})),Fg=ms,ln=t=>Object.assign(Qt(t),{startsWith:e=>{return ln(vt(t,(n=e,yt(i=>cn(i)&&i.startsWith(n)))));var n},endsWith:e=>{return ln(vt(t,(n=e,yt(i=>cn(i)&&i.endsWith(n)))));var n},minLength:e=>ln(vt(t,(n=>yt(i=>cn(i)&&i.length>=n))(e))),maxLength:e=>ln(vt(t,(n=>yt(i=>cn(i)&&i.length<=n))(e))),includes:e=>{return ln(vt(t,(n=e,yt(i=>cn(i)&&i.includes(n)))));var n},regex:e=>{return ln(vt(t,(n=e,yt(i=>cn(i)&&!!i.match(n)))));var n}}),Bg=ln(yt(cn)),Ns=(t,e)=>yt(n=>Ie(n)&&t<=n&&e>=n),ws=t=>yt(e=>Ie(e)&&e<t),Ls=t=>yt(e=>Ie(e)&&e>t),Ts=t=>yt(e=>Ie(e)&&e<=t),js=t=>yt(e=>Ie(e)&&e>=t),Es=()=>yt(t=>Ie(t)&&Number.isInteger(t)),Ss=()=>yt(t=>Ie(t)&&Number.isFinite(t)),bs=()=>yt(t=>Ie(t)&&t>0),As=()=>yt(t=>Ie(t)&&t<0),xe=t=>Object.assign(Qt(t),{between:(e,n)=>xe(vt(t,Ns(e,n))),lt:e=>xe(vt(t,ws(e))),gt:e=>xe(vt(t,Ls(e))),lte:e=>xe(vt(t,Ts(e))),gte:e=>xe(vt(t,js(e))),int:()=>xe(vt(t,Es())),finite:()=>xe(vt(t,Ss())),positive:()=>xe(vt(t,bs())),negative:()=>xe(vt(t,As()))}),Hg=xe(yt(Ie)),vs=(t,e)=>yt(n=>Qe(n)&&t<=n&&e>=n),Ds=t=>yt(e=>Qe(e)&&e<t),Is=t=>yt(e=>Qe(e)&&e>t),xs=t=>yt(e=>Qe(e)&&e<=t),Os=t=>yt(e=>Qe(e)&&e>=t),Cs=()=>yt(t=>Qe(t)&&t>0),zs=()=>yt(t=>Qe(t)&&t<0),Ge=t=>Object.assign(Qt(t),{between:(e,n)=>Ge(vt(t,vs(e,n))),lt:e=>Ge(vt(t,Ds(e))),gt:e=>Ge(vt(t,Is(e))),lte:e=>Ge(vt(t,xs(e))),gte:e=>Ge(vt(t,Os(e))),positive:()=>Ge(vt(t,Cs())),negative:()=>Ge(vt(t,zs()))}),Qg=Ge(yt(Qe)),Gg=Qt(yt(function(t){return typeof t=="boolean"})),Kg=Qt(yt(function(t){return typeof t=="symbol"})),$g=Qt(yt(function(t){return t==null}));var Vg={__proto__:null,matcher:Jt,optional:$r,array:function(...t){return Kr({[Jt]:()=>({match:e=>{if(!Array.isArray(e))return{matched:!1};if(t.length===0)return{matched:!0};const n=t[0];let i={};if(e.length===0)return ae(n).forEach(o=>{i[o]=[]}),{matched:!0,selections:i};const r=(o,a)=>{i[o]=(i[o]||[]).concat([a])};return{matched:e.every(o=>_t(n,o,r)),selections:i}},getSelectionKeys:()=>t.length===0?[]:ae(t[0])})})},set:function(...t){return Qt({[Jt]:()=>({match:e=>{if(!(e instanceof Set))return{matched:!1};let n={};if(e.size===0)return{matched:!0,selections:n};if(t.length===0)return{matched:!0};const i=(o,a)=>{n[o]=(n[o]||[]).concat([a])},r=t[0];return{matched:_g(e,o=>_t(r,o,i)),selections:n}},getSelectionKeys:()=>t.length===0?[]:ae(t[0])})})},map:function(...t){return Qt({[Jt]:()=>({match:e=>{if(!(e instanceof Map))return{matched:!1};let n={};if(e.size===0)return{matched:!0,selections:n};const i=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(t.length===0)return{matched:!0};var r;if(t.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(r=t[0])==null?void 0:r.toString()}`);const[o,a]=t;return{matched:Rg(e,(s,u)=>{const l=_t(o,u,i),g=_t(a,s,i);return l&&g}),selections:n}},getSelectionKeys:()=>t.length===0?[]:[...ae(t[0]),...ae(t[1])]})})},intersection:vt,union:ps,not:function(t){return Qt({[Jt]:()=>({match:e=>({matched:!_t(t,e,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:yt,select:ai,any:ms,_:Fg,string:Bg,between:Ns,lt:ws,gt:Ls,lte:Ts,gte:js,int:Es,finite:Ss,positive:bs,negative:As,number:Hg,betweenBigInt:vs,ltBigInt:Ds,gtBigInt:Is,lteBigInt:xs,gteBigInt:Os,positiveBigInt:Cs,negativeBigInt:zs,bigint:Qg,boolean:Gg,symbol:Kg,nullish:$g,instanceOf:function(t){return Qt(yt(function(e){return n=>n instanceof e}(t)))},shape:function(t){return Qt(yt(Pg(t)))}};const Vr={matched:!1,value:void 0};function Wg(t){return new Zg(t,Vr)}let Zg=class $a{constructor(e,n){this.input=void 0,this.state=void 0,this.input=e,this.state=n}with(...e){if(this.state.matched)return this;const n=e[e.length-1],i=[e[0]];let r;e.length===3&&typeof e[1]=="function"?(i.push(e[0]),r=e[1]):e.length>2&&i.push(...e.slice(1,e.length-1));let o=!1,a={};const s=(l,g)=>{o=!0,a[l]=g},u=!i.some(l=>_t(l,this.input,s))||r&&!r(this.input)?Vr:{matched:!0,value:n(o?Yi in a?a[Yi]:a:this.input,this.input)};return new $a(this.input,u)}when(e,n){if(this.state.matched)return this;const i=!!e(this.input);return new $a(this.input,i?{matched:!0,value:n(this.input,this.input)}:Vr)}otherwise(e){return this.state.matched?this.state.value:e(this.input)}exhaustive(){return this.run()}run(){if(this.state.matched)return this.state.value;let e;try{e=JSON.stringify(this.input)}catch{e=this.input}throw new Error(`Pattern matching error: no pattern matches value ${e}`)}returnType(){return this}};const Me={PROCESSING:{key:"PROCESSING",reticleType:"processing",minDuration:1e3},SIDE_CAPTURED:{key:"SIDE_CAPTURED",reticleType:"done",minDuration:1e3},FLIP_CARD:{key:"FLIP_CARD",reticleType:"flip",minDuration:3e3},DOCUMENT_CAPTURED:{key:"DOCUMENT_CAPTURED",reticleType:"done",minDuration:1e3},SENSING_FRONT:{key:"SENSING_FRONT",reticleType:"searching",minDuration:1e3},SENSING_BACK:{key:"SENSING_BACK",reticleType:"searching",minDuration:1e3},DOCUMENT_FRAMING_CAMERA_TOO_FAR:{key:"DOCUMENT_FRAMING_CAMERA_TOO_FAR",reticleType:"error",minDuration:1500},DOCUMENT_FRAMING_CAMERA_TOO_CLOSE:{key:"DOCUMENT_FRAMING_CAMERA_TOO_CLOSE",reticleType:"error",minDuration:1500},DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP:{key:"DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP",reticleType:"error",minDuration:1500},DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE:{key:"DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE",reticleType:"error",minDuration:1500},LIGHTING_TOO_DARK:{key:"LIGHTING_TOO_DARK",reticleType:"error",minDuration:1500},LIGHTING_TOO_BRIGHT:{key:"LIGHTING_TOO_BRIGHT",reticleType:"error",minDuration:1500},BLUR_DETECTED:{key:"BLUR_DETECTED",reticleType:"error",minDuration:1500},GLARE_DETECTED:{key:"GLARE_DETECTED",reticleType:"error",minDuration:1500},OCCLUDED:{key:"OCCLUDED",reticleType:"error",minDuration:1500},WRONG_SIDE:{key:"WRONG_SIDE",reticleType:"error",minDuration:1500}};let ks=class{timeWindow=3e3;decayRate=.95;eventStack=[];analyzerSettings;currentUiState=Me.SENSING_FRONT;currentStateStartTime=performance.now();constructor(e){this.analyzerSettings=e}reset(){this.eventStack=[]}updateSettings(e){this.analyzerSettings=e}getUiState(e){const n=performance.now(),i={stateKey:this.getUiStateKeyFromResult(e),timeStamp:n,currentWeight:1};if(i.stateKey==="SIDE_CAPTURED"||i.stateKey==="DOCUMENT_CAPTURED")return this.eventStack=[],Me[i.stateKey];this.eventStack.push(i);const r={};if(this.eventStack.forEach(a=>{if(n-a.timeStamp>this.timeWindow){this.eventStack.shift();return}const s=a.timeStamp/n;a.currentWeight*=this.decayRate*s,r[a.stateKey]||(r[a.stateKey]=[]),r[a.stateKey].push(a.currentWeight)}),n-this.currentStateStartTime<this.currentUiState.minDuration)return this.currentUiState;const o={};for(const a in r){const s=a,u=a.length/this.eventStack.length,l=r[s].reduce((g,M)=>g+M,0);o[s]=l*u}try{const a=ls(o),s=Me[a];return s!==this.currentUiState&&(this.currentUiState=s,this.currentStateStartTime=n),s}catch{return this.currentUiState}}getUiStateKeyFromResult(e){return Wg(e).with({frameCaptured:!0,captureState:Vg.when(n=>n==="first-side-capture-in-progress"||n==="second-side-capture-in-progress")},()=>"PROCESSING").with({captureState:"first-side-capture-in-progress",frameAnalysisStatus:{framingStatus:"no-document"}},()=>"SENSING_FRONT").with({captureState:"second-side-capture-in-progress",frameAnalysisStatus:{framingStatus:"no-document"}},()=>"SENSING_BACK").with({captureState:"document-captured"},()=>"DOCUMENT_CAPTURED").with({captureState:"side-captured"},()=>"SIDE_CAPTURED").with({frameAnalysisStatus:{sideAnalysisStatus:"side-already-captured"}},()=>"WRONG_SIDE").with({frameAnalysisStatus:{framingStatus:"camera-angle-too-steep"}},()=>"DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP").with({frameAnalysisStatus:{framingStatus:"camera-too-close"}},()=>"DOCUMENT_FRAMING_CAMERA_TOO_CLOSE").with({frameAnalysisStatus:{framingStatus:"camera-too-far"}},()=>"DOCUMENT_FRAMING_CAMERA_TOO_FAR").with({frameAnalysisStatus:{framingStatus:"document-too-close-to-frame-edge"}},()=>"DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE").with({frameAnalysisStatus:{lightingStatus:"too-bright"}},()=>"LIGHTING_TOO_BRIGHT").with({frameAnalysisStatus:{lightingStatus:"too-dark"}},()=>"LIGHTING_TOO_DARK").with({frameAnalysisStatus:{blurStatus:"blur-detected"}},()=>"BLUR_DETECTED").with({frameAnalysisStatus:{glareStatus:"glare-detected"}},()=>"GLARE_DETECTED").with({frameAnalysisStatus:{occlusionStatus:"occluded"}},()=>"OCCLUDED").otherwise(()=>"SENSING_FRONT")}};const Wr=document.createElement("canvas"),Zr=Wr.getContext("2d",{willReadFrequently:!0,alpha:!1});function qg(t){if(!Zr)throw new Error("CanvasRenderingContext2D is missing!");const e=t.videoWidth,n=t.videoHeight;Wr.width=e,Wr.height=n,Zr.drawImage(t,0,0,e,n);const i=Zr.getImageData(0,0,e,n);return Xg(i)}function Xg(t){return{data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace}}const Jg=t=>(e,n,i)=>{const r=i.subscribe;return i.subscribe=(o,a,s)=>{let u=o;if(a){const l=s?.equalityFn||Object.is;let g=o(i.getState());u=M=>{const c=o(M);if(!l(g,c)){const f=g;a(g=c,f)}},s?.fireImmediately&&a(g,g)}return r(u)},t(e,n,i)},th=Jg,Us=t=>{let e;const n=new Set,i=(a,s)=>{const u=typeof a=="function"?a(e):a;if(!Object.is(u,e)){const l=e;e=s??typeof u!="object"?u:Object.assign({},e,u),n.forEach(g=>g(e,l))}},r=()=>e,o={setState:i,getState:r,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return e=t(i,r,o),o},eh=t=>t?Us(t):Us,Ys={cameras:[],videoElement:null,selectedCamera:null,isPlaying:!1,isCapturing:!1,isSwappingCamera:!1,isQueryingCameras:!1,callbacks:{},uiState:structuredClone(Me.SENSING_FRONT),initialized:!1,errorState:null,analyzerSettings:{}},X=eh()(th(()=>structuredClone(Ys)));X.subscribe(t=>t.videoElement,(t,e)=>{!t&&e&&qr()});const qr=()=>{console.log("resetting zustand store"),X.getState().cameras.forEach(t=>{t.stopStream()}),X.setState(structuredClone(Ys))};let _i,Xr,si,dn,Jr;async function nh(t,e=!0){if(X.getState().isPlaying){console.warn("Already streaming");return}if(X.getState().selectedCamera)console.log("Reusing previous device");else try{await Bs()}catch(o){X.setState({errorState:ds(o)});return}const n=X.getState();if(!n.selectedCamera){console.warn("No selected camera!");return}const i=await n.selectedCamera.startStream(),r=i.getVideoTracks()[0].getSettings();if(!r.width||!r.height)throw new Error("Video doesn't have dimensions!");if(!t.isConnected)throw new Error("Video element needs to be in the document!");X.getState().videoElement||ih(t),t.srcObject=i,t.width=r.width,t.height=r.height,X.setState({videoElement:t}),e&&await eo()}async function Ps(){qr(),await si.terminate()}function ih(t){new un(e=>{e[0].connected||Ps()}).observe(t),t.playsInline=!0,t.setAttribute("muted","")}async function rh(t){if(X.getState().isCapturing){console.warn("Cancel the capture process using `cancelCapture()` before updating settings");return}const e={...X.getState().analyzerSettings,...t};await dn.updateSettings(e),_i.updateSettings(e)}async function oh(t){const e=X.getState();if(e.selectedCamera===t){console.warn("Already selected");return}if(e.isSwappingCamera)return;const n=e.selectedCamera;X.setState({isSwappingCamera:!0}),n&&n.stopStream(),e.videoElement&&(e.videoElement.srcObject=null);try{const i=await t.startStream();e.videoElement&&(e.videoElement.srcObject=i,e.isPlaying&&await e.videoElement.play()),X.setState({selectedCamera:t,isSwappingCamera:!1})}catch(i){console.error(i)}}async function ah(){console.log("stopStream called");const t=X.getState();if(t.selectedCamera?.stopStream(),!t.videoElement){console.log("no video element");return}t.videoElement.srcObject=null,await Rs(),no()}async function to(){const t=X.getState();if(!t.isCapturing||!t.isPlaying)return;if(!t.videoElement){console.error("Missing video element");return}const e=t.callbacks?.onFrameAnalysis,n=typeof e=="function",i=qg(t.videoElement);Jr=new ImageData(Uint8ClampedArray.from(i.data),i.width,i.height);const r=await si.analyze(ns(i,[i.data.buffer])),o=_i.getUiState(r);if(X.setState({uiState:o}),n)try{e(Jr,r)}catch(a){throw console.warn("onFrameAnalysis callback exception"),a}if(n&&window.setTimeout(()=>Jr=null,0),o.key==="SIDE_CAPTURED"){Ri(),X.setState({uiState:Me.SIDE_CAPTURED}),await new Promise(a=>setTimeout(a,Me.SIDE_CAPTURED.minDuration)),X.setState({uiState:Me.FLIP_CARD}),await new Promise(a=>setTimeout(a,Me.FLIP_CARD.minDuration)),await _s();return}if(o.key==="DOCUMENT_CAPTURED"){no(),X.setState({uiState:Me.DOCUMENT_CAPTURED}),await new Promise(s=>setTimeout(s,Me.DOCUMENT_CAPTURED.minDuration));const a=await dn.getResult();try{t.callbacks?.onCaptureResult?.(a)}catch{console.warn("onCaptureResult callback exception")}return}Xr=t.videoElement.requestVideoFrameCallback(()=>void to())}async function _s(){console.log("startCapture called");const t=X.getState();if(!t.isCapturing){if(!t.videoElement){console.warn("Missing video element");return}if(!t.selectedCamera){console.warn("No active camera!");return}await eo(),X.getState().isPlaying&&(X.setState({isCapturing:!0}),Xr=t.videoElement.requestVideoFrameCallback(()=>void to()))}}function Ri(){console.log("pauseCapture called");const t=X.getState().videoElement;t&&t.cancelVideoFrameCallback(Xr),X.setState({isCapturing:!1})}async function Rs(){console.log("cancelCapture called"),await Fs(),_i.reset(),Ri(),X.setState({uiState:Me.SENSING_FRONT})}async function Fs(){await dn.reset()}async function sh(){await dn.finishSideCapture()}async function Bs(){if(X.getState().isQueryingCameras||X.getState().isSwappingCamera)return;X.setState({isQueryingCameras:!0});const t=await Og();if(t.length<1)throw new Error("No capable devices found! Your camera needs to have a minimum resolution of 1920x1080");Dg(t);const e=Ig(t),n=t.find(i=>i.deviceInfo.deviceId===e);X.setState({cameras:t,selectedCamera:n,isQueryingCameras:!1})}async function eo(){const t=X.getState();if(!t.isPlaying){if(!t.videoElement){console.warn("No video element present.");return}if(!t.videoElement.srcObject){console.warn("No source present. Start a camera stream first.");return}if(!t.selectedCamera){console.warn("No selected camera");return}await t.selectedCamera.startStream(),await t.videoElement.play(),X.setState({isPlaying:!0}),t.isCapturing===!0&&t.videoElement.requestVideoFrameCallback(()=>void to())}}function no(){console.log("pausePlayback called");const t=X.getState();if(!t.videoElement){X.setState({isPlaying:!1});return}Ri(),t.videoElement.pause(),X.setState({isPlaying:!1})}function Hs(t){X.setState({callbacks:t})}async function uh(t){try{if(!window.isSecureContext)throw new Error(cs`
|
|
15
|
+
Can't load the SDK outside a secure context:
|
|
16
|
+
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
17
|
+
`);if(X.getState().initialized)return console.warn("Already initialized"),Qs;si=Cg(t.resourceUrl);const e=kg(),n=await si.loadWasm(),i=await n.initializeWithLicenseKey(t.licenseKey,e,!1);if(i.unlockResult===Ur.RequiresServerPermission){const o=await Yg(i),a=await n.submitServerPermission(JSON.stringify(o));if(console.log(a),a.status!==Yr.Ok)throw new Error("Server unlock not ok.")}dn=await si.createAnalyzer();const r={...await dn.getSettings(),minimumDocumentDpi:200,...t.analyzerSettings};return _i=new ks(r),t.analyzerSettings&&await dn.updateSettings(r),X.setState({analyzerSettings:r}),t.callbacks&&Hs(t.callbacks),X.setState({initialized:!0}),Qs}catch(e){throw X.setState({errorState:ds(e)}),e}}const Qs={startCameraStream:nh,stopStream:ah,startPlayback:eo,pausePlayback:no,startCapture:_s,pauseCapture:Ri,cancelCapture:Rs,finishSideCapture:sh,resetAnalyzer:Fs,selectCamera:oh,updateCameraDevices:Bs,setCallbacks:Hs,updateAnalyzerSettings:rh,subscribe:X.subscribe,getState:X.getState,destroy:Ps},ch=t=>{const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");if(!n)throw new Error("missing canvas");return n.putImageData(t,0,0),e.toDataURL()},lh=t=>t.replace("data:","").replace(/^.+,/,""),Gs={context:void 0,registry:void 0},dh=(t,e)=>t===e,ye=Symbol("solid-proxy"),Fi=Symbol("solid-track"),gh=Symbol("solid-dev-component"),Bi={equals:dh};let Ks=Xs;const Ue=1,Hi=2,$s={owned:null,cleanups:null,context:null,owner:null};var Et=null;let io=null,Tt=null,Gt=null,Ye=null,Qi=0;const[hh,pN]=W(!1);function gn(t,e){const n=Tt,i=Et,r=t.length===0,o=r?$s:{owned:null,cleanups:null,context:null,owner:e===void 0?i:e},a=r?t:()=>t(()=>Ut(()=>Wi(o)));Et=o,Tt=null;try{return $e(a,!0)}finally{Tt=n,Et=i}}function W(t,e){e=e?Object.assign({},Bi,e):Bi;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},i=r=>(typeof r=="function"&&(r=r(n.value)),qs(n,r));return[Zs.bind(n),i]}function Vs(t,e,n){const i=Ki(t,e,!0,Ue);vn(i)}function pe(t,e,n){const i=Ki(t,e,!1,Ue);vn(i)}function nt(t,e,n){Ks=wh;const i=Ki(t,e,!1,Ue);(!n||!n.render)&&(i.user=!0),Ye?Ye.push(i):vn(i)}function V(t,e,n){n=n?Object.assign({},Bi,n):Bi;const i=Ki(t,e,!0,0);return i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,vn(i),Zs.bind(i)}function ro(t){return $e(t,!1)}function Ut(t){if(Tt===null)return t();const e=Tt;Tt=null;try{return t()}finally{Tt=e}}function Se(t,e,n){const i=Array.isArray(t);let r,o=n&&n.defer;return a=>{let s;if(i){s=Array(t.length);for(let l=0;l<t.length;l++)s[l]=t[l]()}else s=t();if(o){o=!1;return}const u=Ut(()=>e(s,r,a));return r=s,u}}function Ke(t){nt(()=>Ut(t))}function st(t){return Et===null||(Et.cleanups===null?Et.cleanups=[t]:Et.cleanups.push(t)),t}function Ws(){return Tt}function fh(){return Et}function Mh(t,e){const n=Et,i=Tt;Et=t,Tt=null;try{return $e(e,!0)}catch(r){oo(r)}finally{Et=n,Tt=i}}function yh(t){const e=Tt,n=Et;return Promise.resolve().then(()=>{Tt=e,Et=n;let i;return $e(t,!1),Tt=Et=null,i?i.done:void 0})}function ph(){return[hh,yh]}function se(t,e){const n=Symbol("context");return{id:n,Provider:Th(n),defaultValue:t}}function ue(t){let e;return(e=tu(Et,t.id))!==void 0?e:t.defaultValue}function Gi(t){const e=V(t),n=V(()=>ao(e()));return n.toArray=()=>{const i=n();return Array.isArray(i)?i:i!=null?[i]:[]},n}function Zs(){if(this.sources&&this.state)if(this.state===Ue)vn(this);else{const t=Gt;Gt=null,$e(()=>Vi(this),!1),Gt=t}if(Tt){const t=this.observers?this.observers.length:0;Tt.sources?(Tt.sources.push(this),Tt.sourceSlots.push(t)):(Tt.sources=[this],Tt.sourceSlots=[t]),this.observers?(this.observers.push(Tt),this.observerSlots.push(Tt.sources.length-1)):(this.observers=[Tt],this.observerSlots=[Tt.sources.length-1])}return this.value}function qs(t,e,n){let i=t.value;return(!t.comparator||!t.comparator(i,e))&&(t.value=e,t.observers&&t.observers.length&&$e(()=>{for(let r=0;r<t.observers.length;r+=1){const o=t.observers[r],a=io&&io.running;a&&io.disposed.has(o),(a?!o.tState:!o.state)&&(o.pure?Gt.push(o):Ye.push(o),o.observers&&Js(o)),a||(o.state=Ue)}if(Gt.length>1e6)throw Gt=[],new Error},!1)),e}function vn(t){if(!t.fn)return;Wi(t);const e=Et,n=Tt,i=Qi;Tt=Et=t,mh(t,t.value,i),Tt=n,Et=e}function mh(t,e,n){let i;try{i=t.fn(e)}catch(r){return t.pure&&(t.state=Ue,t.owned&&t.owned.forEach(Wi),t.owned=null),t.updatedAt=n+1,oo(r)}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?qs(t,i):t.value=i,t.updatedAt=n)}function Ki(t,e,n,i=Ue,r){const o={fn:t,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:Et,context:null,pure:n};return Et===null||Et!==$s&&(Et.owned?Et.owned.push(o):Et.owned=[o]),o}function $i(t){if(t.state===0)return;if(t.state===Hi)return Vi(t);if(t.suspense&&Ut(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<Qi);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===Ue)vn(t);else if(t.state===Hi){const i=Gt;Gt=null,$e(()=>Vi(t,e[0]),!1),Gt=i}}function $e(t,e){if(Gt)return t();let n=!1;e||(Gt=[]),Ye?n=!0:Ye=[],Qi++;try{const i=t();return Nh(n),i}catch(i){n||(Ye=null),Gt=null,oo(i)}}function Nh(t){if(Gt&&(Xs(Gt),Gt=null),t)return;const e=Ye;Ye=null,e.length&&$e(()=>Ks(e),!1)}function Xs(t){for(let e=0;e<t.length;e++)$i(t[e])}function wh(t){let e,n=0;for(e=0;e<t.length;e++){const i=t[e];i.user?t[n++]=i:$i(i)}for(e=0;e<n;e++)$i(t[e])}function Vi(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const i=t.sources[n];if(i.sources){const r=i.state;r===Ue?i!==e&&(!i.updatedAt||i.updatedAt<Qi)&&$i(i):r===Hi&&Vi(i,e)}}}function Js(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Hi,n.pure?Gt.push(n):Ye.push(n),n.observers&&Js(n))}}function Wi(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),i=t.sourceSlots.pop(),r=n.observers;if(r&&r.length){const o=r.pop(),a=n.observerSlots.pop();i<r.length&&(o.sourceSlots[a]=i,r[i]=o,n.observerSlots[i]=a)}}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Wi(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0,t.context=null}function Lh(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function oo(t,e=Et){throw Lh(t)}function tu(t,e){return t?t.context&&t.context[e]!==void 0?t.context[e]:tu(t.owner,e):void 0}function ao(t){if(typeof t=="function"&&!t.length)return ao(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const i=ao(t[n]);Array.isArray(i)?e.push.apply(e,i):e.push(i)}return e}return t}function Th(t,e){return function(n){let i;return pe(()=>i=Ut(()=>(Et.context={[t]:n.value},Gi(()=>n.children))),void 0),i}}const jh=Symbol("fallback");function eu(t){for(let e=0;e<t.length;e++)t[e]()}function Eh(t,e,n={}){let i=[],r=[],o=[],a=0,s=e.length>1?[]:null;return st(()=>eu(o)),()=>{let u=t()||[],l,g;return u[Fi],Ut(()=>{let c=u.length,f,d,h,y,p,w,m,N,j;if(c===0)a!==0&&(eu(o),o=[],i=[],r=[],a=0,s&&(s=[])),n.fallback&&(i=[jh],r[0]=gn(b=>(o[0]=b,n.fallback())),a=1);else if(a===0){for(r=new Array(c),g=0;g<c;g++)i[g]=u[g],r[g]=gn(M);a=c}else{for(h=new Array(c),y=new Array(c),s&&(p=new Array(c)),w=0,m=Math.min(a,c);w<m&&i[w]===u[w];w++);for(m=a-1,N=c-1;m>=w&&N>=w&&i[m]===u[N];m--,N--)h[N]=r[m],y[N]=o[m],s&&(p[N]=s[m]);for(f=new Map,d=new Array(N+1),g=N;g>=w;g--)j=u[g],l=f.get(j),d[g]=l===void 0?-1:l,f.set(j,g);for(l=w;l<=m;l++)j=i[l],g=f.get(j),g!==void 0&&g!==-1?(h[g]=r[l],y[g]=o[l],s&&(p[g]=s[l]),g=d[g],f.set(j,g)):o[l]();for(g=w;g<c;g++)g in h?(r[g]=h[g],o[g]=y[g],s&&(s[g]=p[g],s[g](g))):r[g]=gn(M);r=r.slice(0,a=c),i=u.slice(0)}return r});function M(c){if(o[g]=c,s){const[f,d]=W(g);return s[g]=d,e(u[g],f)}return e(u[g])}}}function T(t,e){return Ut(()=>t(e||{}))}function Zi(){return!0}const so={get(t,e,n){return e===ye?n:t.get(e)},has(t,e){return e===ye?!0:t.has(e)},set:Zi,deleteProperty:Zi,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:Zi,deleteProperty:Zi}},ownKeys(t){return t.keys()}};function uo(t){return(t=typeof t=="function"?t():t)?t:{}}function Sh(){for(let t=0,e=this.length;t<e;++t){const n=this[t]();if(n!==void 0)return n}}function ht(...t){let e=!1;for(let o=0;o<t.length;o++){const a=t[o];e=e||!!a&&ye in a,t[o]=typeof a=="function"?(e=!0,V(a)):a}if(e)return new Proxy({get(o){for(let a=t.length-1;a>=0;a--){const s=uo(t[a])[o];if(s!==void 0)return s}},has(o){for(let a=t.length-1;a>=0;a--)if(o in uo(t[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<t.length;a++)o.push(...Object.keys(uo(t[a])));return[...new Set(o)]}},so);const n={},i={},r=new Set;for(let o=t.length-1;o>=0;o--){const a=t[o];if(!a)continue;const s=Object.getOwnPropertyNames(a);for(let u=0,l=s.length;u<l;u++){const g=s[u];if(g==="__proto__"||g==="constructor")continue;const M=Object.getOwnPropertyDescriptor(a,g);if(!r.has(g))M.get?(r.add(g),Object.defineProperty(n,g,{enumerable:!0,configurable:!0,get:Sh.bind(i[g]=[M.get.bind(a)])})):(M.value!==void 0&&r.add(g),n[g]=M.value);else{const c=i[g];c?M.get?c.push(M.get.bind(a)):M.value!==void 0&&c.push(()=>M.value):n[g]===void 0&&(n[g]=M.value)}}}return n}function St(t,...e){if(ye in t){const r=new Set(e.length>1?e.flat():e[0]),o=e.map(a=>new Proxy({get(s){return a.includes(s)?t[s]:void 0},has(s){return a.includes(s)&&s in t},keys(){return a.filter(s=>s in t)}},so));return o.push(new Proxy({get(a){return r.has(a)?void 0:t[a]},has(a){return r.has(a)?!1:a in t},keys(){return Object.keys(t).filter(a=>!r.has(a))}},so)),o}const n={},i=e.map(()=>({}));for(const r of Object.getOwnPropertyNames(t)){const o=Object.getOwnPropertyDescriptor(t,r),a=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let s=!1,u=0;for(const l of e)l.includes(r)&&(s=!0,a?i[u][r]=o.value:Object.defineProperty(i[u],r,o)),++u;s||(a?n[r]=o.value:Object.defineProperty(n,r,o))}return[...i,n]}let bh=0;function Dn(){const t=Gs.context;return t?`${t.id}${t.count++}`:`cl-${bh++}`}const nu=t=>`Stale read from <${t}>.`;function iu(t){const e="fallback"in t&&{fallback:()=>t.fallback};return V(Eh(()=>t.each,t.children,e||void 0))}function kt(t){const e=t.keyed,n=V(()=>t.when,void 0,{equals:(i,r)=>e?i===r:!i==!r});return V(()=>{const i=n();if(i){const r=t.children;return typeof r=="function"&&r.length>0?Ut(()=>r(e?i:()=>{if(!Ut(n))throw nu("Show");return t.when})):r}return t.fallback},void 0,void 0)}function co(t){let e=!1;const n=(o,a)=>o[0]===a[0]&&(e?o[1]===a[1]:!o[1]==!a[1])&&o[2]===a[2],i=Gi(()=>t.children),r=V(()=>{let o=i();Array.isArray(o)||(o=[o]);for(let a=0;a<o.length;a++){const s=o[a].when;if(s)return e=!!o[a].keyed,[a,s,o[a]]}return[-1]},void 0,{equals:n});return V(()=>{const[o,a,s]=r();if(o<0)return t.fallback;const u=s.children;return typeof u=="function"&&u.length>0?Ut(()=>u(e?a:()=>{if(Ut(r)[0]!==o)throw nu("Match");return s.when})):u},void 0,void 0)}function Pe(t){return t}const Ah=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],vh=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ah]),Dh=new Set(["innerHTML","textContent","innerText","children"]),Ih=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),xh=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Oh(t,e){const n=xh[t];return typeof n=="object"?n[e]?n.$:void 0:n}const Ch=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),zh=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),kh={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Uh(t,e,n){let i=n.length,r=e.length,o=i,a=0,s=0,u=e[r-1].nextSibling,l=null;for(;a<r||s<o;){if(e[a]===n[s]){a++,s++;continue}for(;e[r-1]===n[o-1];)r--,o--;if(r===a){const g=o<i?s?n[s-1].nextSibling:n[o-s]:u;for(;s<o;)t.insertBefore(n[s++],g)}else if(o===s)for(;a<r;)(!l||!l.has(e[a]))&&e[a].remove(),a++;else if(e[a]===n[o-1]&&n[s]===e[r-1]){const g=e[--r].nextSibling;t.insertBefore(n[s++],e[a++].nextSibling),t.insertBefore(n[--o],g),e[r]=n[o]}else{if(!l){l=new Map;let M=s;for(;M<o;)l.set(n[M],M++)}const g=l.get(e[a]);if(g!=null)if(s<g&&g<o){let M=a,c=1,f;for(;++M<r&&M<o&&!((f=l.get(e[M]))==null||f!==g+c);)c++;if(c>g-s){const d=e[a];for(;s<g;)t.insertBefore(n[s++],d)}else t.replaceChild(n[s++],e[a++])}else a++;else e[a++].remove()}}}const ru="_$DX_DELEGATE";function Yh(t,e,n,i={}){let r;return gn(o=>{r=o,e===document?t():it(e,t(),e.firstChild?null:void 0,n)},i.owner),()=>{r(),e.textContent=""}}function wt(t,e,n){let i;const r=()=>{const a=document.createElement("template");return a.innerHTML=t,n?a.content.firstChild.firstChild:a.content.firstChild},o=e?()=>Ut(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return o.cloneNode=o,o}function Ph(t,e=window.document){const n=e[ru]||(e[ru]=new Set);for(let i=0,r=t.length;i<r;i++){const o=t[i];n.has(o)||(n.add(o),e.addEventListener(o,Gh))}}function Ve(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function _h(t,e,n,i){i==null?t.removeAttributeNS(e,n):t.setAttributeNS(e,n,i)}function xt(t,e){e==null?t.removeAttribute("class"):t.className=e}function Rh(t,e,n,i){if(i)Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n;else if(Array.isArray(n)){const r=n[0];t.addEventListener(e,n[0]=o=>r.call(t,n[1],o))}else t.addEventListener(e,n)}function Fh(t,e,n={}){const i=Object.keys(e||{}),r=Object.keys(n);let o,a;for(o=0,a=r.length;o<a;o++){const s=r[o];!s||s==="undefined"||e[s]||(au(t,s,!1),delete n[s])}for(o=0,a=i.length;o<a;o++){const s=i[o],u=!!e[s];!s||s==="undefined"||n[s]===u||!u||(au(t,s,!0),n[s]=u)}return n}function Bh(t,e,n){if(!e)return n?Ve(t,"style"):e;const i=t.style;if(typeof e=="string")return i.cssText=e;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),e||(e={});let r,o;for(o in n)e[o]==null&&i.removeProperty(o),delete n[o];for(o in e)r=e[o],r!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}function te(t,e={},n,i){const r={};return i||pe(()=>r.children=In(t,e.children,r.children)),pe(()=>e.ref&&e.ref(t)),pe(()=>Hh(t,e,n,!0,r,!0)),r}function ou(t,e,n){return Ut(()=>t(e,n))}function it(t,e,n,i){if(n!==void 0&&!i&&(i=[]),typeof e!="function")return In(t,e,i,n);pe(r=>In(t,e(),r,n),i)}function Hh(t,e,n,i,r={},o=!1){e||(e={});for(const a in r)if(!(a in e)){if(a==="children")continue;r[a]=su(t,a,null,r[a],n,o)}for(const a in e){if(a==="children"){i||In(t,e.children);continue}const s=e[a];r[a]=su(t,a,s,r[a],n,o)}}function Qh(t){return t.toLowerCase().replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function au(t,e,n){const i=e.trim().split(/\s+/);for(let r=0,o=i.length;r<o;r++)t.classList.toggle(i[r],n)}function su(t,e,n,i,r,o){let a,s,u,l,g;if(e==="style")return Bh(t,n,i);if(e==="classList")return Fh(t,n,i);if(n===i)return i;if(e==="ref")o||n(t);else if(e.slice(0,3)==="on:"){const M=e.slice(3);i&&t.removeEventListener(M,i),n&&t.addEventListener(M,n)}else if(e.slice(0,10)==="oncapture:"){const M=e.slice(10);i&&t.removeEventListener(M,i,!0),n&&t.addEventListener(M,n,!0)}else if(e.slice(0,2)==="on"){const M=e.slice(2).toLowerCase(),c=Ch.has(M);if(!c&&i){const f=Array.isArray(i)?i[0]:i;t.removeEventListener(M,f)}(c||n)&&(Rh(t,M,n,c),c&&Ph([M]))}else if(e.slice(0,5)==="attr:")Ve(t,e.slice(5),n);else if((g=e.slice(0,5)==="prop:")||(u=Dh.has(e))||!r&&((l=Oh(e,t.tagName))||(s=vh.has(e)))||(a=t.nodeName.includes("-")))g&&(e=e.slice(5),s=!0),e==="class"||e==="className"?xt(t,n):a&&!s&&!u?t[Qh(e)]=n:t[l||e]=n;else{const M=r&&e.indexOf(":")>-1&&kh[e.split(":")[0]];M?_h(t,M,e,n):Ve(t,Ih[e]||e,n)}return n}function Gh(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const i=n[e];if(i&&!n.disabled){const r=n[`${e}Data`];if(r!==void 0?i.call(n,r,t):i.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function In(t,e,n,i,r){for(;typeof n=="function";)n=n();if(e===n)return n;const o=typeof e,a=i!==void 0;if(t=a&&n[0]&&n[0].parentNode||t,o==="string"||o==="number")if(o==="number"&&(e=e.toString()),a){let s=n[0];s&&s.nodeType===3?s.data=e:s=document.createTextNode(e),n=xn(t,n,i,s)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e;else if(e==null||o==="boolean")n=xn(t,n,i);else{if(o==="function")return pe(()=>{let s=e();for(;typeof s=="function";)s=s();n=In(t,s,n,i)}),()=>n;if(Array.isArray(e)){const s=[],u=n&&Array.isArray(n);if(lo(s,e,n,r))return pe(()=>n=In(t,s,n,i,!0)),()=>n;if(s.length===0){if(n=xn(t,n,i),a)return n}else u?n.length===0?uu(t,s,i):Uh(t,n,s):(n&&xn(t),uu(t,s));n=s}else if(e.nodeType){if(Array.isArray(n)){if(a)return n=xn(t,n,i,e);xn(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}else console.warn("Unrecognized value. Skipped inserting",e)}return n}function lo(t,e,n,i){let r=!1;for(let o=0,a=e.length;o<a;o++){let s=e[o],u=n&&n[o],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)t.push(s);else if(Array.isArray(s))r=lo(t,s,u)||r;else if(l==="function")if(i){for(;typeof s=="function";)s=s();r=lo(t,Array.isArray(s)?s:[s],Array.isArray(u)?u:[u])||r}else t.push(s),r=!0;else{const g=String(s);u&&u.nodeType===3&&u.data===g?t.push(u):t.push(document.createTextNode(g))}}return r}function uu(t,e,n=null){for(let i=0,r=e.length;i<r;i++)t.insertBefore(e[i],n)}function xn(t,e,n,i){if(n===void 0)return t.textContent="";const r=i||document.createTextNode("");if(e.length){let o=!1;for(let a=e.length-1;a>=0;a--){const s=e[a];if(r!==s){const u=s.parentNode===t;!o&&!a?u?t.replaceChild(r,s):t.insertBefore(r,n):u&&s.remove()}else o=!0}}else t.insertBefore(r,n);return[r]}const Kh="http://www.w3.org/2000/svg";function cu(t,e=!1){return e?document.createElementNS(Kh,t):document.createElement(t)}function go(t){const{useShadow:e}=t,n=document.createTextNode(""),i=()=>t.mount||document.body,r=fh();let o,a=!!Gs.context;return nt(()=>{o||(o=Mh(r,()=>V(()=>t.children)));const s=i();if(s instanceof HTMLHeadElement){const[u,l]=W(!1),g=()=>l(!0);gn(M=>it(s,()=>u()?M():o(),null)),st(g)}else{const u=cu(t.isSVG?"g":"div",t.isSVG),l=e&&u.attachShadow?u.attachShadow({mode:"open"}):u;Object.defineProperty(u,"_$host",{get(){return n.parentNode},configurable:!0}),it(l,o),s.appendChild(u),t.ref&&t.ref(u),st(()=>s.removeChild(u))}},void 0,{render:!a}),n}function ui(t){const[e,n]=St(t,["component"]),i=V(()=>e.component);return V(()=>{const r=i();switch(typeof r){case"function":return Object.assign(r,{[gh]:!0}),Ut(()=>r(n));case"string":const o=zh.has(r),a=cu(r,o);return te(a,n,o),a}})}const ho=Symbol("store-raw"),ci=Symbol("store-node");function lu(t){let e=t[ye];if(!e&&(Object.defineProperty(t,ye,{value:e=new Proxy(t,Wh)}),!Array.isArray(t))){const n=Object.keys(t),i=Object.getOwnPropertyDescriptors(t);for(let r=0,o=n.length;r<o;r++){const a=n[r];i[a].get&&Object.defineProperty(t,a,{enumerable:i[a].enumerable,get:i[a].get.bind(e)})}}return e}function We(t){let e;return t!=null&&typeof t=="object"&&(t[ye]||!(e=Object.getPrototypeOf(t))||e===Object.prototype||Array.isArray(t))}function On(t,e=new Set){let n,i,r,o;if(n=t!=null&&t[ho])return n;if(!We(t)||e.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):e.add(t);for(let a=0,s=t.length;a<s;a++)r=t[a],(i=On(r,e))!==r&&(t[a]=i)}else{Object.isFrozen(t)?t=Object.assign({},t):e.add(t);const a=Object.keys(t),s=Object.getOwnPropertyDescriptors(t);for(let u=0,l=a.length;u<l;u++)o=a[u],!s[o].get&&(r=t[o],(i=On(r,e))!==r&&(t[o]=i))}return t}function fo(t){let e=t[ci];return e||Object.defineProperty(t,ci,{value:e=Object.create(null)}),e}function Mo(t,e,n){return t[e]||(t[e]=gu(n))}function $h(t,e){const n=Reflect.getOwnPropertyDescriptor(t,e);return!n||n.get||!n.configurable||e===ye||e===ci||(delete n.value,delete n.writable,n.get=()=>t[ye][e]),n}function du(t){if(Ws()){const e=fo(t);(e._||(e._=gu()))()}}function Vh(t){return du(t),Reflect.ownKeys(t)}function gu(t){const[e,n]=W(t,{equals:!1,internal:!0});return e.$=n,e}const Wh={get(t,e,n){if(e===ho)return t;if(e===ye)return n;if(e===Fi)return du(t),n;const i=fo(t),r=i[e];let o=r?r():t[e];if(e===ci||e==="__proto__")return o;if(!r){const a=Object.getOwnPropertyDescriptor(t,e);Ws()&&(typeof o!="function"||t.hasOwnProperty(e))&&!(a&&a.get)&&(o=Mo(i,e,o)())}return We(o)?lu(o):o},has(t,e){return e===ho||e===ye||e===Fi||e===ci||e==="__proto__"?!0:(this.get(t,e,t),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:Vh,getOwnPropertyDescriptor:$h};function me(t,e,n,i=!1){if(!i&&t[e]===n)return;const r=t[e],o=t.length;n===void 0?delete t[e]:t[e]=n;let a=fo(t),s;if((s=Mo(a,e,r))&&s.$(()=>n),Array.isArray(t)&&t.length!==o){for(let u=t.length;u<o;u++)(s=a[u])&&s.$();(s=Mo(a,"length",o))&&s.$(t.length)}(s=a._)&&s.$()}function hu(t,e){const n=Object.keys(e);for(let i=0;i<n.length;i+=1){const r=n[i];me(t,r,e[r])}}function Zh(t,e){if(typeof e=="function"&&(e=e(t)),e=On(e),Array.isArray(e)){if(t===e)return;let n=0,i=e.length;for(;n<i;n++){const r=e[n];t[n]!==r&&me(t,n,r)}me(t,"length",i)}else hu(t,e)}function li(t,e,n=[]){let i,r=t;if(e.length>1){i=e.shift();const a=typeof i,s=Array.isArray(t);if(Array.isArray(i)){for(let u=0;u<i.length;u++)li(t,[i[u]].concat(e),n);return}else if(s&&a==="function"){for(let u=0;u<t.length;u++)i(t[u],u)&&li(t,[u].concat(e),n);return}else if(s&&a==="object"){const{from:u=0,to:l=t.length-1,by:g=1}=i;for(let M=u;M<=l;M+=g)li(t,[M].concat(e),n);return}else if(e.length>1){li(t[i],e,[i].concat(n));return}r=t[i],n=[i].concat(n)}let o=e[0];typeof o=="function"&&(o=o(r,n),o===r)||i===void 0&&o==null||(o=On(o),i===void 0||We(r)&&We(o)&&!Array.isArray(o)?hu(r,o):me(t,i,o))}function yo(...[t,e]){const n=On(t||{}),i=Array.isArray(n),r=lu(n);function o(...a){ro(()=>{i&&a.length===1?Zh(n,a[0]):li(n,a)})}return[r,o]}const po=Symbol("store-root");function Cn(t,e,n,i,r){const o=e[n];if(t===o)return;if(n!==po&&(!We(t)||!We(o)||r&&t[r]!==o[r])){me(e,n,t);return}if(Array.isArray(t)){if(t.length&&o.length&&(!i||r&&t[0]&&t[0][r]!=null)){let u,l,g,M,c,f,d,h;for(g=0,M=Math.min(o.length,t.length);g<M&&(o[g]===t[g]||r&&o[g]&&t[g]&&o[g][r]===t[g][r]);g++)Cn(t[g],o,g,i,r);const y=new Array(t.length),p=new Map;for(M=o.length-1,c=t.length-1;M>=g&&c>=g&&(o[M]===t[c]||r&&o[g]&&t[g]&&o[M][r]===t[c][r]);M--,c--)y[c]=o[M];if(g>c||g>M){for(l=g;l<=c;l++)me(o,l,t[l]);for(;l<t.length;l++)me(o,l,y[l]),Cn(t[l],o,l,i,r);o.length>t.length&&me(o,"length",t.length);return}for(d=new Array(c+1),l=c;l>=g;l--)f=t[l],h=r&&f?f[r]:f,u=p.get(h),d[l]=u===void 0?-1:u,p.set(h,l);for(u=g;u<=M;u++)f=o[u],h=r&&f?f[r]:f,l=p.get(h),l!==void 0&&l!==-1&&(y[l]=o[u],l=d[l],p.set(h,l));for(l=g;l<t.length;l++)l in y?(me(o,l,y[l]),Cn(t[l],o,l,i,r)):me(o,l,t[l])}else for(let u=0,l=t.length;u<l;u++)Cn(t[u],o,u,i,r);o.length>t.length&&me(o,"length",t.length);return}const a=Object.keys(t);for(let u=0,l=a.length;u<l;u++)Cn(t[a[u]],o,a[u],i,r);const s=Object.keys(o);for(let u=0,l=s.length;u<l;u++)t[s[u]]===void 0&&me(o,s[u],void 0)}function qh(t,e={}){const{merge:n,key:i="id"}=e,r=On(t);return o=>{if(!We(o)||!We(r))return r;const a=Cn(r,{[po]:o},po,n,i);return a===void 0?o:a}}const Xh={scan_the_front_side:"Scan the front side of the document",flip_document:"Flip the document",scan_the_back_side:"Scan the back side of the document",scanning_wrong_side:"Scanning wrong side",move_closer:"Move closer",move_farther:"Move farther",camera_angle_too_steep:"Keep document parallel to phone",document_too_close_to_edge:"Keep the document fully visible",lightning_too_bright:"Move to spot with less lighting",lightning_too_dark:"Move to brighter spot",blur_detected:"Keep document and phone still",glare_detected:"Tilt or move document to remove reflection",occluded:"Keep the document fully visible",need_help_tooltip:"Need help?",onboarding_field_visible_title:"Keep all the details visible",onboarding_field_visible_details:"Make sure you keep the document well lit. All document fields should be visible on the camera screen.",tutorial_fields_visible_title:"Keep all the fields visible",tutorial_fields_visible_start:"Start scanning",tutorial_fields_visible_details:"Make sure you aren’t covering parts of the document with a finger, including the bottom lines. Also, watch out for hologram reflections that go over the document fields.",tutorial_harsh_light_title:"Watch out for harsh light",tutorial_harsh_light_details:"Avoid direct harsh light because it reflects from the document and can make parts of the document unreadable. If you can’t read data on the document, it won’t be visible to the camera either.",tutorial_keep_still_title:"Keep still while scanning",tutorial_keep_still_details:"Try to keep the phone and document still while scanning. Moving either can blur the image and make data on the document unreadable.",camera_unavailable:"Camera Unavailable",camera_permission_error:"App doesn't have permission to use the camera, please change privacy settings",settings:"Settings",camera_media_capture_error:"Unable to capture media",camera_unable_to_resume_session:"Unable to resume",camera_query_in_progress:"Selecting best camera, please wait",done:"Done",cancel:"Cancel",back:"Back",next:"Next",ok:"OK",dismiss:"Dismiss"},fu=se(),Jh=t=>{const[e,n]=yo(structuredClone({...Xh,...t.userStrings})),i={t:e,updateLocalization:n};return T(fu.Provider,{value:i,get children(){return t.children}})};function hn(){const t=ue(fu);if(!t)throw new Error("LocalizationProvider not in scope.");return t}function mo(t){return(...e)=>{for(const n of t)n&&n(...e)}}function tf(t){return(...e)=>{for(let n=t.length-1;n>=0;n--){const i=t[n];i&&i(...e)}}}var E=t=>typeof t=="function"&&!t.length?t():t,Mu=t=>Array.isArray(t)?t:t?[t]:[];function ef(t,...e){return typeof t=="function"?t(...e):t}var nf=st;function rf(t,e,n,i){return t.addEventListener(e,n,i),nf(t.removeEventListener.bind(t,e,n,i))}function of(t,e,n,i){const r=()=>{Mu(E(t)).forEach(o=>{o&&Mu(E(e)).forEach(a=>rf(o,a,n,i))})};typeof t=="function"?nt(r):pe(r)}var No=Symbol("fallback");function yu(t){for(const e of t)e.dispose()}function af(t,e,n,i={}){const r=new Map;return st(()=>yu(r.values())),()=>{const a=t()||[];return a[Fi],Ut(()=>{if(!a.length)return yu(r.values()),r.clear(),i.fallback?[gn(g=>(r.set(No,{dispose:g}),i.fallback()))]:[];const s=new Array(a.length),u=r.get(No);if(!r.size||u){u?.dispose(),r.delete(No);for(let g=0;g<a.length;g++){const M=a[g],c=e(M,g);o(s,M,g,c)}return s}const l=new Set(r.keys());for(let g=0;g<a.length;g++){const M=a[g],c=e(M,g);l.delete(c);const f=r.get(c);f?(s[g]=f.mapped,f.setIndex?.(g),f.setItem(()=>M)):o(s,M,g,c)}for(const g of l)r.get(g)?.dispose(),r.delete(g);return s})};function o(a,s,u,l){gn(g=>{const[M,c]=W(s),f={setItem:c,dispose:g};if(n.length>1){const[d,h]=W(u);f.setIndex=h,f.mapped=n(M,d)}else f.mapped=n(M);r.set(l,f),a[u]=f.mapped})}}function sf(t){const{by:e}=t;return V(af(()=>t.each,typeof e=="function"?e:n=>n[e],t.children,"fallback"in t?{fallback:()=>t.fallback}:void 0))}function uf(t){const e=typeof t.on=="function"||Array.isArray(t.on)?t.on:()=>t.on;return V(Se(e,(n,i)=>{const r=t.children;return typeof r=="function"&&r.length>0?r(n,i):r}))}function qi(){return!0}var cf={get(t,e,n){return e===ye?n:t.get(e)},has(t,e){return t.has(e)},set:qi,deleteProperty:qi,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:qi,deleteProperty:qi}},ownKeys(t){return t.keys()}},lf=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function pu(t){const e={};let n;for(;n=lf.exec(t);)e[n[1]]=n[2];return e}function mu(t,e){if(typeof t=="object"&&typeof e=="object")return{...t,...e};if(typeof t=="string"&&typeof e=="string")return`${t};${e}`;const n=typeof t=="object"?t:pu(t),i=typeof e=="object"?e:pu(e);return{...n,...i}}var wo=(t,e,n)=>{let i;for(const r of t){const o=E(r)[e];i?o&&(i=n(i,o)):i=o}return i};function df(...t){const e=Array.isArray(t[0]),n=e?t[0]:t;if(n.length===1)return n[0];const i=e&&t[1]?.reverseEventHandlers?tf:mo,r={};for(const a of n){const s=E(a);for(const u in s)if(u[0]==="o"&&u[1]==="n"&&u[2]){const l=s[u],g=u.toLowerCase(),M=typeof l=="function"?l:Array.isArray(l)?l.length===1?l[0]:l[0].bind(void 0,l[1]):void 0;M?r[g]?r[g].push(M):r[g]=[M]:delete r[g]}}const o=ht(...n);return new Proxy({get(a){if(typeof a!="string")return Reflect.get(o,a);if(a==="style")return wo(n,"style",mu);if(a==="ref"){const s=[];for(const u of n){const l=E(u)[a];typeof l=="function"&&s.push(l)}return i(s)}if(a[0]==="o"&&a[1]==="n"&&a[2]){const s=r[a.toLowerCase()];return s?i(s):Reflect.get(o,a)}return a==="class"||a==="className"?wo(n,a,(s,u)=>`${s} ${u}`):a==="classList"?wo(n,a,(s,u)=>({...s,...u})):Reflect.get(o,a)},has(a){return Reflect.has(o,a)},keys(){return Object.keys(o)}},cf)}function ce(...t){return mo(t)}var Nu=t=>t instanceof Element;function Lo(t,e){if(e(t))return t;if(typeof t=="function"&&!t.length)return Lo(t(),e);if(Array.isArray(t))for(const n of t){const i=Lo(n,e);if(i)return i}return null}function gf(t,e=Nu,n=Nu){const i=V(t);return V(()=>Lo(i(),e))}function wu(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function hf(t){return typeof t=="number"}function ff(t){return Array.isArray(t)}function zn(t){return Object.prototype.toString.call(t)==="[object String]"}function Xi(t){return typeof t=="function"}function kn(t){return e=>`${t()}-${e}`}function Ne(t,e){return t?t===e||t.contains(e):!1}function di(t,e=!1){const{activeElement:n}=le(t);if(!n?.nodeName)return null;if(Lu(n)&&n.contentDocument)return di(n.contentDocument.body,e);if(e){const i=n.getAttribute("aria-activedescendant");if(i){const r=le(n).getElementById(i);if(r)return r}}return n}function To(t){return le(t).defaultView||window}function le(t){return t?t.ownerDocument||t:document}function Lu(t){return t.tagName==="IFRAME"}var Tu=(t=>(t.Escape="Escape",t.Enter="Enter",t.Tab="Tab",t.Space=" ",t.ArrowDown="ArrowDown",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.ArrowUp="ArrowUp",t.End="End",t.Home="Home",t.PageDown="PageDown",t.PageUp="PageUp",t))(Tu||{});function ju(t){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(e=>t.test(e.brand))||t.test(window.navigator.userAgent)}function jo(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function gi(){return jo(/^Mac/i)}function Mf(){return jo(/^iPhone/i)}function yf(){return jo(/^iPad/i)||gi()&&navigator.maxTouchPoints>1}function Eu(){return Mf()||yf()}function pf(){return gi()||Eu()}function mf(){return ju(/AppleWebKit/i)&&!Nf()}function Nf(){return ju(/Chrome/i)}function Pt(t,e){return e&&(Xi(e)?e(t):e[0](e[1],t)),t?.defaultPrevented}function we(t){return e=>{for(const n of t)Pt(e,n)}}function wf(t){return gi()?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey}function Kt(t){if(t)if(Lf())t.focus({preventScroll:!0});else{const e=Tf(t);t.focus(),jf(e)}}var Ji=null;function Lf(){if(Ji==null){Ji=!1;try{document.createElement("div").focus({get preventScroll(){return Ji=!0,!0}})}catch{}}return Ji}function Tf(t){let e=t.parentNode;const n=[],i=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==i;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&n.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return i instanceof HTMLElement&&n.push({element:i,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}),n}function jf(t){for(const{element:e,scrollTop:n,scrollLeft:i}of t)e.scrollTop=n,e.scrollLeft=i}var Su=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Ef=[...Su,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Eo=Su.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",Sf=Ef.join(':not([hidden]):not([tabindex="-1"]),');function bu(t,e){const n=Array.from(t.querySelectorAll(Eo)).filter(Au);return e&&Au(t)&&n.unshift(t),n.forEach((i,r)=>{if(Lu(i)&&i.contentDocument){const o=i.contentDocument.body,a=bu(o,!1);n.splice(r,1,...a)}}),n}function Au(t){return vu(t)&&!bf(t)}function vu(t){return t.matches(Eo)&&So(t)}function bf(t){return parseInt(t.getAttribute("tabindex")||"0",10)<0}function So(t,e){return t.nodeName!=="#comment"&&Af(t)&&vf(t,e)&&(!t.parentElement||So(t.parentElement,t))}function Af(t){if(!(t instanceof HTMLElement)&&!(t instanceof SVGElement))return!1;const{display:e,visibility:n}=t.style;let i=e!=="none"&&n!=="hidden"&&n!=="collapse";if(i){if(!t.ownerDocument.defaultView)return i;const{getComputedStyle:r}=t.ownerDocument.defaultView,{display:o,visibility:a}=r(t);i=o!=="none"&&a!=="hidden"&&a!=="collapse"}return i}function vf(t,e){return!t.hasAttribute("hidden")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Df(t,e){return e.some(n=>n.contains(t))}function If(t,e,n){const i=e?.tabbable?Sf:Eo,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return e?.from?.contains(o)?NodeFilter.FILTER_REJECT:o.matches(i)&&So(o)&&(!n||Df(o,n))&&(!e?.accept||e.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e?.from&&(r.currentNode=e.from),r}function xf(){}function Of(t){return[t.clientX,t.clientY]}function Cf(t,e){const[n,i]=t;let r=!1;const o=e.length;for(let a=o,s=0,u=a-1;s<a;u=s++){const[l,g]=e[s],[M,c]=e[u],[,f]=e[u===0?a-1:u-1]||[0,0],d=(g-c)*(n-l)-(l-M)*(i-g);if(c<g){if(i>=c&&i<g){if(d===0)return!0;d>0&&(i===c?i>f&&(r=!r):r=!r)}}else if(g<c){if(i>g&&i<=c){if(d===0)return!0;d<0&&(i===c?i<f&&(r=!r):r=!r)}}else if(i==g&&(n>=M&&n<=l||n>=l&&n<=M))return!0}return r}function Ot(t,e){return ht(t,e)}var hi=new Map,Du=new Set;function Iu(){if(typeof window>"u")return;const t=n=>{if(!n.target)return;let i=hi.get(n.target);i||(i=new Set,hi.set(n.target,i),n.target.addEventListener("transitioncancel",e)),i.add(n.propertyName)},e=n=>{if(!n.target)return;const i=hi.get(n.target);if(i&&(i.delete(n.propertyName),i.size===0&&(n.target.removeEventListener("transitioncancel",e),hi.delete(n.target)),hi.size===0)){for(const r of Du)r();Du.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",e)}typeof document<"u"&&(document.readyState!=="loading"?Iu():document.addEventListener("DOMContentLoaded",Iu));function xu(t,e){const n=Ou(t,e,"left"),i=Ou(t,e,"top"),r=e.offsetWidth,o=e.offsetHeight;let a=t.scrollLeft,s=t.scrollTop;const u=a+t.offsetWidth,l=s+t.offsetHeight;n<=a?a=n:n+r>u&&(a+=n+r-u),i<=s?s=i:i+o>l&&(s+=i+o-l),t.scrollLeft=a,t.scrollTop=s}function Ou(t,e,n){const i=n==="left"?"offsetLeft":"offsetTop";let r=0;for(;e.offsetParent&&(r+=e[i],e.offsetParent!==t);){if(e.offsetParent.contains(t)){r-=t[i];break}e=e.offsetParent}return r}var zf={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function bo(t){let e=t.startIndex??0;const n=t.startLevel??0,i=[],r=u=>{const l=t.getKey??"key",g=zn(l)?u[l]:l(u);return g!=null?String(g):""},o=u=>{const l=t.getTextValue??"textValue",g=zn(l)?u[l]:l(u);return g!=null?String(g):""},a=u=>{const l=t.getDisabled??"disabled";return(zn(l)?u[l]:l(u))??!1},s=u=>zn(t.getSectionChildren)?u[t.getSectionChildren]:t.getSectionChildren?.(u);for(const u of t.dataSource){if(zn(u)||hf(u)){i.push({type:"item",rawValue:u,key:String(u),textValue:String(u),disabled:a(u),level:n,index:e}),e++;continue}if(s(u)!=null){i.push({type:"section",rawValue:u,key:"",textValue:"",disabled:!1,level:n,index:e}),e++;const l=s(u)??[];if(l.length>0){const g=bo({dataSource:l,getKey:t.getKey,getTextValue:t.getTextValue,getDisabled:t.getDisabled,getSectionChildren:t.getSectionChildren,startIndex:e,startLevel:n+1});i.push(...g),e+=g.length}}else i.push({type:"item",rawValue:u,key:r(u),textValue:o(u),disabled:a(u),level:n,index:e}),e++}return i}/*!
|
|
18
|
+
* Portions of this file are based on code from react-spectrum.
|
|
19
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
20
|
+
*
|
|
21
|
+
* Credits to the React Spectrum team:
|
|
22
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/collections/src/useCollection.ts
|
|
23
|
+
*/function kf(t,e=[]){const n=bo({dataSource:E(t.dataSource),getKey:E(t.getKey),getTextValue:E(t.getTextValue),getDisabled:E(t.getDisabled),getSectionChildren:E(t.getSectionChildren)}),[i,r]=W(t.factory(n));return nt(Se([()=>E(t.dataSource),()=>E(t.getKey),()=>E(t.getTextValue),()=>E(t.getDisabled),()=>E(t.getSectionChildren),()=>t.factory,...e],([o,a,s,u,l,g])=>{const M=bo({dataSource:o,getKey:a,getTextValue:s,getDisabled:u,getSectionChildren:l});r(()=>g(M))},{defer:!0})),i}/*!
|
|
24
|
+
* Portions of this file are based on code from react-spectrum.
|
|
25
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
26
|
+
*
|
|
27
|
+
* Credits to the React Spectrum team:
|
|
28
|
+
* https://github.com/adobe/react-spectrum/blob/22cb32d329e66c60f55d4fc4025d1d44bb015d71/packages/@react-stately/collections/src/getItemCount.ts
|
|
29
|
+
*/const Cu=new WeakMap;function Uf(t){let e=Cu.get(t);if(e!=null)return e;e=0;for(const n of t)n.type==="item"&&e++;return Cu.set(t,e),e}function zu(t){const[e,n]=W(t.defaultValue?.()),i=V(()=>t.value?.()!==void 0),r=V(()=>i()?t.value?.():e());return[r,o=>{Ut(()=>{const a=ef(o,r());return Object.is(a,r())||(i()||n(a),t.onChange?.(a)),a})}]}function Yf(t){const[e,n]=zu(t);return[()=>e()??!1,n]}function Ao(t={}){const[e,n]=Yf({value:()=>E(t.open),defaultValue:()=>!!E(t.defaultOpen),onChange:o=>t.onOpenChange?.(o)}),i=()=>{n(!0)},r=()=>{n(!1)};return{isOpen:e,setIsOpen:n,open:i,close:r,toggle:()=>{e()?r():i()}}}function Pf(t){const e=n=>{n.key===Tu.Escape&&t.onEscapeKeyDown?.(n)};nt(()=>{if(E(t.isDisabled))return;const n=t.ownerDocument?.()??le();n.addEventListener("keydown",e),st(()=>{n.removeEventListener("keydown",e)})})}/*!
|
|
30
|
+
* Portions of this file are based on code from radix-ui-primitives.
|
|
31
|
+
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
32
|
+
*
|
|
33
|
+
* Credits to the Radix UI team:
|
|
34
|
+
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/dismissable-layer/src/DismissableLayer.tsx
|
|
35
|
+
*
|
|
36
|
+
* Portions of this file are based on code from zag.
|
|
37
|
+
* MIT Licensed, Copyright (c) 2021 Chakra UI.
|
|
38
|
+
*
|
|
39
|
+
* Credits to the Chakra UI team:
|
|
40
|
+
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/dismissable/src/layer-stack.ts
|
|
41
|
+
*/const tr="data-kb-top-layer";let ku,vo=!1;const _e=[];function fi(t){return _e.findIndex(e=>e.node===t)}function _f(t){return _e[fi(t)]}function Rf(t){return _e[_e.length-1].node===t}function Uu(){return _e.filter(t=>t.isPointerBlocking)}function Ff(){return[...Uu()].slice(-1)[0]}function Do(){return Uu().length>0}function Yu(t){const e=fi(Ff()?.node);return fi(t)<e}function Bf(t){_e.push(t)}function Hf(t){const e=fi(t);e<0||_e.splice(e,1)}function Qf(){_e.forEach(({node:t})=>{t.style.pointerEvents=Yu(t)?"none":"auto"})}function Gf(t){if(Do()&&!vo){const e=le(t);ku=document.body.style.pointerEvents,e.body.style.pointerEvents="none",vo=!0}}function Kf(t){if(Do())return;const e=le(t);e.body.style.pointerEvents=ku,e.body.style.length===0&&e.body.removeAttribute("style"),vo=!1}const de={layers:_e,isTopMostLayer:Rf,hasPointerBlockingLayer:Do,isBelowPointerBlockingLayer:Yu,addLayer:Bf,removeLayer:Hf,indexOf:fi,find:_f,assignPointerEventToLayers:Qf,disableBodyPointerEvents:Gf,restoreBodyPointerEvents:Kf};/*!
|
|
42
|
+
* Portions of this file are based on code from radix-ui-primitives.
|
|
43
|
+
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
44
|
+
*
|
|
45
|
+
* Credits to the Radix UI team:
|
|
46
|
+
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/focus-scope/src/FocusScope.tsx
|
|
47
|
+
*
|
|
48
|
+
* Portions of this file are based on code from zag.
|
|
49
|
+
* MIT Licensed, Copyright (c) 2021 Chakra UI.
|
|
50
|
+
*
|
|
51
|
+
* Credits to the Chakra UI team:
|
|
52
|
+
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-on-child-unmount.ts
|
|
53
|
+
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/focus-scope/src/focus-containment.ts
|
|
54
|
+
*/const Io="focusScope.autoFocusOnMount",xo="focusScope.autoFocusOnUnmount",Pu={bubbles:!1,cancelable:!0},_u={stack:[],active(){return this.stack[0]},add(t){t!==this.active()&&this.active()?.pause(),this.stack=wu(this.stack,t),this.stack.unshift(t)},remove(t){this.stack=wu(this.stack,t),this.active()?.resume()}};function Ru(t,e){const[n,i]=W(!1),r={pause(){i(!0)},resume(){i(!1)}};let o=null;const a=d=>t.onMountAutoFocus?.(d),s=d=>t.onUnmountAutoFocus?.(d),u=()=>le(e()),l=()=>{const d=u().createElement("span");return d.setAttribute("data-focus-trap",""),d.tabIndex=0,Object.assign(d.style,zf),d},g=()=>{const d=e();return d?bu(d,!0).filter(h=>!h.hasAttribute("data-focus-trap")):[]},M=()=>{const d=g();return d.length>0?d[0]:null},c=()=>{const d=g();return d.length>0?d[d.length-1]:null},f=()=>{const d=e();if(!d)return!1;const h=di(d);return!h||Ne(d,h)?!1:vu(h)};nt(()=>{const d=e();if(!d)return;_u.add(r);const h=di(d);if(!Ne(d,h)){const y=new CustomEvent(Io,Pu);d.addEventListener(Io,a),d.dispatchEvent(y),y.defaultPrevented||setTimeout(()=>{Kt(M()),di(d)===h&&Kt(d)},0)}st(()=>{d.removeEventListener(Io,a),setTimeout(()=>{const y=new CustomEvent(xo,Pu);f()&&y.preventDefault(),d.addEventListener(xo,s),d.dispatchEvent(y),y.defaultPrevented||Kt(h??u().body),d.removeEventListener(xo,s),_u.remove(r)},0)})}),nt(()=>{const d=e();if(!d||!E(t.trapFocus)||n())return;const h=p=>{const w=p.target;w?.closest(`[${tr}]`)||(Ne(d,w)?o=w:Kt(o))},y=p=>{const w=p.relatedTarget??di(d);w?.closest(`[${tr}]`)||Ne(d,w)||Kt(o)};u().addEventListener("focusin",h),u().addEventListener("focusout",y),st(()=>{u().removeEventListener("focusin",h),u().removeEventListener("focusout",y)})}),nt(()=>{const d=e();if(!d||!E(t.trapFocus)||n())return;const h=l();d.insertAdjacentElement("afterbegin",h);const y=l();d.insertAdjacentElement("beforeend",y);function p(m){const N=M(),j=c();m.relatedTarget===N?Kt(j):Kt(N)}h.addEventListener("focusin",p),y.addEventListener("focusin",p);const w=new MutationObserver(m=>{for(const N of m)N.previousSibling===y&&(y.remove(),d.insertAdjacentElement("beforeend",y)),N.nextSibling===h&&(h.remove(),d.insertAdjacentElement("afterbegin",h))});w.observe(d,{childList:!0,subtree:!1}),st(()=>{h.removeEventListener("focusin",p),y.removeEventListener("focusin",p),h.remove(),y.remove(),w.disconnect()})})}/*!
|
|
55
|
+
* Portions of this file are based on code from zag.
|
|
56
|
+
* MIT Licensed, Copyright (c) 2021 Chakra UI.
|
|
57
|
+
*
|
|
58
|
+
* Credits to the zag team:
|
|
59
|
+
* https://github.com/chakra-ui/zag/blob/c1e6c7689b22bf58741ded7cf224dd9baec2a046/packages/utilities/form-utils/src/form.ts
|
|
60
|
+
*/function $f(t,e){nt(Se(t,n=>{if(n==null)return;const i=Vf(n);i!=null&&(i.addEventListener("reset",e,{passive:!0}),st(()=>{i.removeEventListener("reset",e)}))}))}function Vf(t){return Wf(t)?t.form:t.closest("form")}function Wf(t){return t.matches("textarea, input, select, button")}/*!
|
|
61
|
+
* Portions of this file are based on code from react-spectrum.
|
|
62
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
63
|
+
*
|
|
64
|
+
* Credits to the React Spectrum team:
|
|
65
|
+
* https://github.com/adobe/react-spectrum/blob/15e101b74966bd5eb719c6529ce71ce57eaed430/packages/@react-aria/live-announcer/src/LiveAnnouncer.tsx
|
|
66
|
+
*/const Zf="data-live-announcer";/*!
|
|
67
|
+
* This file is based on code from react-spectrum.
|
|
68
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
69
|
+
*
|
|
70
|
+
* Credits to the React Spectrum team:
|
|
71
|
+
* https://github.com/adobe/react-spectrum/blob/810579b671791f1593108f62cdc1893de3a220e3/packages/@react-aria/overlays/src/ariaHideOutside.ts
|
|
72
|
+
*/function Fu(t){nt(()=>{E(t.isDisabled)||st(qf(E(t.targets),E(t.root)))})}const Mi=new WeakMap,Le=[];function qf(t,e=document.body){const n=new Set(t),i=new Set,r=u=>{for(const c of u.querySelectorAll(`[${Zf}], [${tr}]`))n.add(c);const l=c=>{if(n.has(c)||c.parentElement&&i.has(c.parentElement)&&c.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const f of n)if(c.contains(f))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},g=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode:l}),M=l(u);if(M===NodeFilter.FILTER_ACCEPT&&o(u),M!==NodeFilter.FILTER_REJECT){let c=g.nextNode();for(;c!=null;)o(c),c=g.nextNode()}},o=u=>{const l=Mi.get(u)??0;u.getAttribute("aria-hidden")==="true"&&l===0||(l===0&&u.setAttribute("aria-hidden","true"),i.add(u),Mi.set(u,l+1))};Le.length&&Le[Le.length-1].disconnect(),r(e);const a=new MutationObserver(u=>{for(const l of u)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...n,...i].some(g=>g.contains(l.target))){for(const g of l.removedNodes)g instanceof Element&&(n.delete(g),i.delete(g));for(const g of l.addedNodes)(g instanceof HTMLElement||g instanceof SVGElement)&&(g.dataset.liveAnnouncer==="true"||g.dataset.reactAriaTopLayer==="true")?n.add(g):g instanceof Element&&r(g)}});a.observe(e,{childList:!0,subtree:!0});const s={observe(){a.observe(e,{childList:!0,subtree:!0})},disconnect(){a.disconnect()}};return Le.push(s),()=>{a.disconnect();for(const u of i){const l=Mi.get(u);if(l==null)return;l===1?(u.removeAttribute("aria-hidden"),Mi.delete(u)):Mi.set(u,l-1)}s===Le[Le.length-1]?(Le.pop(),Le.length&&Le[Le.length-1].observe()):Le.splice(Le.indexOf(s),1)}}/*!
|
|
73
|
+
* Portions of this file are based on code from radix-ui-primitives.
|
|
74
|
+
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
75
|
+
*
|
|
76
|
+
* Credits to the Radix UI team:
|
|
77
|
+
* https://github.com/radix-ui/primitives/blob/81b25f4b40c54f72aeb106ca0e64e1e09655153e/packages/react/dismissable-layer/src/DismissableLayer.tsx
|
|
78
|
+
*
|
|
79
|
+
* Portions of this file are based on code from zag.
|
|
80
|
+
* MIT Licensed, Copyright (c) 2021 Chakra UI.
|
|
81
|
+
*
|
|
82
|
+
* Credits to the Chakra UI team:
|
|
83
|
+
* https://github.com/chakra-ui/zag/blob/d1dbf9e240803c9e3ed81ebef363739be4273de0/packages/utilities/interact-outside/src/index.ts
|
|
84
|
+
*/const Bu="interactOutside.pointerDownOutside",Hu="interactOutside.focusOutside";function Xf(t,e){let n,i=xf;const r=()=>le(e()),o=M=>t.onPointerDownOutside?.(M),a=M=>t.onFocusOutside?.(M),s=M=>t.onInteractOutside?.(M),u=M=>{const c=M.target;return!(c instanceof HTMLElement)||c.closest(`[${tr}]`)||!Ne(r(),c)||Ne(e(),c)?!1:!t.shouldExcludeElement?.(c)},l=M=>{function c(){const f=e(),d=M.target;if(!f||!d||!u(M))return;const h=we([o,s]);d.addEventListener(Bu,h,{once:!0});const y=new CustomEvent(Bu,{bubbles:!1,cancelable:!0,detail:{originalEvent:M,isContextMenu:M.button===2||wf(M)&&M.button===0}});d.dispatchEvent(y)}M.pointerType==="touch"?(r().removeEventListener("click",c),i=c,r().addEventListener("click",c,{once:!0})):c()},g=M=>{const c=e(),f=M.target;if(!c||!f||!u(M))return;const d=we([a,s]);f.addEventListener(Hu,d,{once:!0});const h=new CustomEvent(Hu,{bubbles:!1,cancelable:!0,detail:{originalEvent:M,isContextMenu:!1}});f.dispatchEvent(h)};nt(()=>{E(t.isDisabled)||(n=window.setTimeout(()=>{r().addEventListener("pointerdown",l,!0)},0),r().addEventListener("focusin",g,!0),st(()=>{window.clearTimeout(n),r().removeEventListener("click",i),r().removeEventListener("pointerdown",l,!0),r().removeEventListener("focusin",g,!0)}))})}/*!
|
|
85
|
+
* Portions of this file are based on code from radix-ui-primitives.
|
|
86
|
+
* MIT Licensed, Copyright (c) 2022 WorkOS.
|
|
87
|
+
*
|
|
88
|
+
* Credits to the Radix UI team:
|
|
89
|
+
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/Presence.tsx
|
|
90
|
+
* https://github.com/radix-ui/primitives/blob/21a7c97dc8efa79fecca36428eec49f187294085/packages/react/presence/src/useStateMachine.tsx
|
|
91
|
+
*/function er(t){const[e,n]=W();let i={},r=t(),o="none";const[a,s]=Jf(t()?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return nt(Se(a,u=>{const l=nr(i);o=u==="mounted"?l:"none"})),nt(Se(t,u=>{if(r===u)return;const l=nr(i);u?s("MOUNT"):i?.display==="none"?s("UNMOUNT"):s(r&&o!==l?"ANIMATION_OUT":"UNMOUNT"),r=u})),nt(Se(e,u=>{if(u){const l=M=>{const c=nr(i).includes(M.animationName);M.target===u&&c&&s("ANIMATION_END")},g=M=>{M.target===u&&(o=nr(i))};u.addEventListener("animationstart",g),u.addEventListener("animationcancel",l),u.addEventListener("animationend",l),st(()=>{u.removeEventListener("animationstart",g),u.removeEventListener("animationcancel",l),u.removeEventListener("animationend",l)})}else s("ANIMATION_END")})),{isPresent:()=>["mounted","unmountSuspended"].includes(a()),setRef:u=>{u&&(i=getComputedStyle(u)),n(u)}}}function nr(t){return t?.animationName||"none"}function Jf(t,e){const n=(o,a)=>e[o][a]??o,[i,r]=W(t);return[i,o=>{r(a=>n(a,o))}]}/*!
|
|
92
|
+
* Portions of this file are based on code from floating-ui.
|
|
93
|
+
* MIT Licensed, Copyright (c) 2021 Floating UI contributors.
|
|
94
|
+
*
|
|
95
|
+
* Credits to the Floating UI contributors:
|
|
96
|
+
* https://github.com/floating-ui/floating-ui/blob/f7ce9420aa32c150eb45049f12cf3b5506715341/packages/react/src/components/FloatingOverlay.tsx
|
|
97
|
+
*
|
|
98
|
+
* Portions of this file are based on code from ariakit.
|
|
99
|
+
* MIT Licensed, Copyright (c) Diego Haz.
|
|
100
|
+
*
|
|
101
|
+
* Credits to the Ariakit team:
|
|
102
|
+
* https://github.com/ariakit/ariakit/blob/5d8a1f047fcadcf117073c70359663a3946b73bf/packages/ariakit/src/dialog/__utils/use-prevent-body-scroll.ts
|
|
103
|
+
*/const Oo="data-kb-scroll-lock";function Qu(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function tM(t,e,n){if(!t)return()=>{};const i=t.style.getPropertyValue(e);return t.style.setProperty(e,n),()=>{i?t.style.setProperty(e,i):t.style.removeProperty(e)}}function eM(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function Gu(t){nt(()=>{if(!E(t.ownerRef)||E(t.isDisabled))return;const e=le(E(t.ownerRef)),n=To(E(t.ownerRef)),{documentElement:i,body:r}=e;if(r.hasAttribute(Oo))return;r.setAttribute(Oo,"");const o=n.innerWidth-i.clientWidth,a=()=>tM(i,"--scrollbar-width",`${o}px`),s=eM(i),u=()=>Qu(r,{overflow:"hidden",[s]:`${o}px`}),l=()=>{const{scrollX:M,scrollY:c,visualViewport:f}=n,d=f?.offsetLeft??0,h=f?.offsetTop??0,y=Qu(r,{position:"fixed",overflow:"hidden",top:`${-(c-Math.floor(h))}px`,left:`${-(M-Math.floor(d))}px`,right:"0",[s]:`${o}px`});return()=>{y(),n.scrollTo(M,c)}},g=mo([a(),Eu()?l():u()]);st(()=>{g(),r.removeAttribute(Oo)})})}function ge(t){return e=>(t(e),()=>t(void 0))}/*!
|
|
104
|
+
* Portions of this file are based on code from ariakit.
|
|
105
|
+
* MIT Licensed, Copyright (c) Diego Haz.
|
|
106
|
+
*
|
|
107
|
+
* Credits to the ariakit team:
|
|
108
|
+
* https://github.com/ariakit/ariakit/blob/8a13899ff807bbf39f3d89d2d5964042ba4d5287/packages/ariakit-react-utils/src/hooks.ts
|
|
109
|
+
*/function nM(t,e){const[n,i]=W(Ku(e?.()));return nt(()=>{i(t()?.tagName.toLowerCase()||Ku(e?.()))}),n}function Ku(t){return zn(t)?t:void 0}/*!
|
|
110
|
+
* Portions of this file are based on code from react-spectrum.
|
|
111
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
112
|
+
*
|
|
113
|
+
* Credits to the React Spectrum team:
|
|
114
|
+
* https://github.com/adobe/react-spectrum/blob/70e7caf1946c423bc9aa9cb0e50dbdbe953d239b/packages/@react-aria/label/src/useField.ts
|
|
115
|
+
*/const iM=["id","name","validationState","required","disabled","readOnly"];function rM(t){const e=`form-control-${Dn()}`;t=Ot({id:e},t);const[n,i]=W(),[r,o]=W(),[a,s]=W(),[u,l]=W(),g=(f,d,h)=>{const y=h!=null||n()!=null;return[h,n(),y&&d!=null?f:void 0].filter(Boolean).join(" ")||void 0},M=f=>[a(),u(),f].filter(Boolean).join(" ")||void 0,c=V(()=>({"data-valid":E(t.validationState)==="valid"?"":void 0,"data-invalid":E(t.validationState)==="invalid"?"":void 0,"data-required":E(t.required)?"":void 0,"data-disabled":E(t.disabled)?"":void 0,"data-readonly":E(t.readOnly)?"":void 0}));return{formControlContext:{name:()=>E(t.name)??E(t.id),dataset:c,validationState:()=>E(t.validationState),isRequired:()=>E(t.required),isDisabled:()=>E(t.disabled),isReadOnly:()=>E(t.readOnly),labelId:n,fieldId:r,descriptionId:a,errorMessageId:u,getAriaLabelledBy:g,getAriaDescribedBy:M,generateId:kn(()=>E(t.id)),registerLabel:ge(i),registerField:ge(o),registerDescription:ge(s),registerErrorMessage:ge(l)}}}const $u=se();function Co(){const t=ue($u);if(t===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return t}const oM=["id","aria-label","aria-labelledby","aria-describedby"];function aM(t){const e=Co();return t=Ot({id:e.generateId("field")},t),nt(()=>st(e.registerField(E(t.id)))),{fieldProps:{id:()=>E(t.id),ariaLabel:()=>E(t["aria-label"]),ariaLabelledBy:()=>e.getAriaLabelledBy(E(t.id),E(t["aria-label"]),E(t["aria-labelledby"])),ariaDescribedBy:()=>e.getAriaDescribedBy(E(t["aria-describedby"]))}}}function ee(t){const[e,n]=St(t,["asChild","as","children"]);if(!e.asChild)return T(ui,ht({get component(){return e.as}},n,{get children(){return e.children}}));const i=Gi(()=>e.children);if(Vu(i())){const r=Wu(n,i()?.props??{});return T(ui,r)}if(ff(i())){const r=i().find(Vu);if(r){const o=()=>T(iu,{get each(){return i()},children:s=>T(kt,{when:s===r,fallback:s,get children(){return r.props.children}})}),a=Wu(n,r?.props??{});return T(ui,ht(a,{children:o}))}}throw new Error("[kobalte]: Component is expected to render `asChild` but no children `As` component was found.")}const sM=Symbol("$$KobalteAsComponent");function Vu(t){return t?.[sM]===!0}function Wu(t,e){return df([t,e],{reverseEventHandlers:!0})}const uM={"ar-AE":{dismiss:"تجاهل"},"bg-BG":{dismiss:"Отхвърляне"},"cs-CZ":{dismiss:"Odstranit"},"da-DK":{dismiss:"Luk"},"de-DE":{dismiss:"Schließen"},"el-GR":{dismiss:"Απόρριψη"},"en-US":{dismiss:"Dismiss"},"es-ES":{dismiss:"Descartar"},"et-EE":{dismiss:"Lõpeta"},"fi-FI":{dismiss:"Hylkää"},"fr-FR":{dismiss:"Rejeter"},"he-IL":{dismiss:"התעלם"},"hr-HR":{dismiss:"Odbaci"},"hu-HU":{dismiss:"Elutasítás"},"it-IT":{dismiss:"Ignora"},"ja-JP":{dismiss:"閉じる"},"ko-KR":{dismiss:"무시"},"lt-LT":{dismiss:"Atmesti"},"lv-LV":{dismiss:"Nerādīt"},"nb-NO":{dismiss:"Lukk"},"nl-NL":{dismiss:"Negeren"},"pl-PL":{dismiss:"Zignoruj"},"pt-BR":{dismiss:"Descartar"},"pt-PT":{dismiss:"Dispensar"},"ro-RO":{dismiss:"Revocare"},"ru-RU":{dismiss:"Пропустить"},"sk-SK":{dismiss:"Zrušiť"},"sl-SI":{dismiss:"Opusti"},"sr-SP":{dismiss:"Odbaci"},"sv-SE":{dismiss:"Avvisa"},"tr-TR":{dismiss:"Kapat"},"uk-UA":{dismiss:"Скасувати"},"zh-CN":{dismiss:"取消"},"zh-TW":{dismiss:"關閉"}};/*!
|
|
116
|
+
* Portions of this file are based on code from react-spectrum.
|
|
117
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
118
|
+
*
|
|
119
|
+
* Credits to the React Spectrum team:
|
|
120
|
+
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/utils.ts
|
|
121
|
+
*/const cM=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),lM=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function dM(t){if(Intl.Locale){const n=new Intl.Locale(t).maximize().script??"";return cM.has(n)}const e=t.split("-")[0];return lM.has(e)}function gM(t){return dM(t)?"rtl":"ltr"}/*!
|
|
122
|
+
* Portions of this file are based on code from react-spectrum.
|
|
123
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
124
|
+
*
|
|
125
|
+
* Credits to the React Spectrum team:
|
|
126
|
+
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useDefaultLocale.ts
|
|
127
|
+
*/function Zu(){let t=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:gM(t)}}let zo=Zu();const yi=new Set;function qu(){zo=Zu();for(const t of yi)t(zo)}function hM(){const[t,e]=W(zo),n=V(()=>t());return Ke(()=>{yi.size===0&&window.addEventListener("languagechange",qu),yi.add(e),st(()=>{yi.delete(e),yi.size===0&&window.removeEventListener("languagechange",qu)})}),{locale:()=>n().locale,direction:()=>n().direction}}const fM=se();function ir(){const t=hM();return ue(fM)||t}/*!
|
|
128
|
+
* Portions of this file are based on code from react-spectrum.
|
|
129
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
130
|
+
*
|
|
131
|
+
* Credits to the React Spectrum team:
|
|
132
|
+
* https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/i18n/src/useCollator.ts
|
|
133
|
+
*/const ko=new Map;function Xu(t){const{locale:e}=ir(),n=V(()=>e()+(t?Object.entries(t).sort((i,r)=>i[0]<r[0]?-1:1).join():""));return V(()=>{const i=n();let r;return ko.has(i)&&(r=ko.get(i)),r||(r=new Intl.Collator(e(),t),ko.set(i,r)),r})}var Uo=function(t,e){return Uo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},Uo(t,e)};function rr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Uo(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var pt=function(){return pt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},pt.apply(this,arguments)};function Yo(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function Po(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}var ut;(function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(ut||(ut={}));var Dt;(function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"})(Dt||(Dt={}));var Un;(function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"})(Un||(Un={}));function Ju(t){return t.type===Dt.literal}function MM(t){return t.type===Dt.argument}function tc(t){return t.type===Dt.number}function ec(t){return t.type===Dt.date}function nc(t){return t.type===Dt.time}function ic(t){return t.type===Dt.select}function rc(t){return t.type===Dt.plural}function yM(t){return t.type===Dt.pound}function oc(t){return t.type===Dt.tag}function ac(t){return!!(t&&typeof t=="object"&&t.type===Un.number)}function _o(t){return!!(t&&typeof t=="object"&&t.type===Un.dateTime)}var sc=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,pM=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function mM(t){var e={};return t.replace(pM,function(n){var i=n.length;switch(n[0]){case"G":e.era=i===4?"long":i===5?"narrow":"short";break;case"y":e.year=i===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][i-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][i-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=i===4?"short":i===5?"narrow":"short";break;case"e":if(i<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"c":if(i<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][i-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][i-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][i-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][i-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][i-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][i-1];break;case"s":e.second=["numeric","2-digit"][i-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=i<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),e}var NM=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function wM(t){if(t.length===0)throw new Error("Number skeleton cannot be empty");for(var e=t.split(NM).filter(function(c){return c.length>0}),n=[],i=0,r=e;i<r.length;i++){var o=r[i],a=o.split("/");if(a.length===0)throw new Error("Invalid number skeleton");for(var s=a[0],u=a.slice(1),l=0,g=u;l<g.length;l++){var M=g[l];if(M.length===0)throw new Error("Invalid number skeleton")}n.push({stem:s,options:u})}return n}function LM(t){return t.replace(/^(.*?)-/,"")}var uc=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,cc=/^(@+)?(\+|#+)?[rs]?$/g,TM=/(\*)(0+)|(#+)(0+)|(0+)/g,lc=/^(0+)$/;function dc(t){var e={};return t[t.length-1]==="r"?e.roundingPriority="morePrecision":t[t.length-1]==="s"&&(e.roundingPriority="lessPrecision"),t.replace(cc,function(n,i,r){return typeof r!="string"?(e.minimumSignificantDigits=i.length,e.maximumSignificantDigits=i.length):r==="+"?e.minimumSignificantDigits=i.length:i[0]==="#"?e.maximumSignificantDigits=i.length:(e.minimumSignificantDigits=i.length,e.maximumSignificantDigits=i.length+(typeof r=="string"?r.length:0)),""}),e}function gc(t){switch(t){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function jM(t){var e;if(t[0]==="E"&&t[1]==="E"?(e={notation:"engineering"},t=t.slice(2)):t[0]==="E"&&(e={notation:"scientific"},t=t.slice(1)),e){var n=t.slice(0,2);if(n==="+!"?(e.signDisplay="always",t=t.slice(2)):n==="+?"&&(e.signDisplay="exceptZero",t=t.slice(2)),!lc.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function hc(t){var e={},n=gc(t);return n||e}function EM(t){for(var e={},n=0,i=t;n<i.length;n++){var r=i[n];switch(r.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=r.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=LM(r.options[0]);continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=pt(pt(pt({},e),{notation:"scientific"}),r.options.reduce(function(u,l){return pt(pt({},u),hc(l))},{}));continue;case"engineering":e=pt(pt(pt({},e),{notation:"engineering"}),r.options.reduce(function(u,l){return pt(pt({},u),hc(l))},{}));continue;case"notation-simple":e.notation="standard";continue;case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(r.options[0]);continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(TM,function(u,l,g,M,c,f){if(l)e.minimumIntegerDigits=g.length;else{if(M&&c)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(lc.test(r.stem)){e.minimumIntegerDigits=r.stem.length;continue}if(uc.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(uc,function(u,l,g,M,c,f){return g==="*"?e.minimumFractionDigits=l.length:M&&M[0]==="#"?e.maximumFractionDigits=M.length:c&&f?(e.minimumFractionDigits=c.length,e.maximumFractionDigits=c.length+f.length):(e.minimumFractionDigits=l.length,e.maximumFractionDigits=l.length),""});var o=r.options[0];o==="w"?e=pt(pt({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=pt(pt({},e),dc(o)));continue}if(cc.test(r.stem)){e=pt(pt({},e),dc(r.stem));continue}var a=gc(r.stem);a&&(e=pt(pt({},e),a));var s=jM(r.stem);s&&(e=pt(pt({},e),s))}return e}var or={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","h","K"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TL:["H","hB","hb","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function SM(t,e){for(var n="",i=0;i<t.length;i++){var r=t.charAt(i);if(r==="j"){for(var o=0;i+1<t.length&&t.charAt(i+1)===r;)o++,i++;var a=1+(o&1),s=o<2?1:3+(o>>1),u="a",l=bM(e);for((l=="H"||l=="k")&&(s=0);s-- >0;)n+=u;for(;a-- >0;)n=l+n}else r==="J"?n+="H":n+=r}return n}function bM(t){var e=t.hourCycle;if(e===void 0&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=t.language,i;n!=="root"&&(i=t.maximize().region);var r=or[i||""]||or[n||""]||or["".concat(n,"-001")]||or["001"];return r[0]}var Ro,AM=new RegExp("^".concat(sc.source,"*")),vM=new RegExp("".concat(sc.source,"*$"));function gt(t,e){return{start:t,end:e}}var DM=!!String.prototype.startsWith,IM=!!String.fromCodePoint,xM=!!Object.fromEntries,OM=!!String.prototype.codePointAt,CM=!!String.prototype.trimStart,zM=!!String.prototype.trimEnd,kM=!!Number.isSafeInteger,UM=kM?Number.isSafeInteger:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},Fo=!0;try{var YM=pc("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Fo=((Ro=YM.exec("a"))===null||Ro===void 0?void 0:Ro[0])==="a"}catch{Fo=!1}var fc=DM?function(t,e,n){return t.startsWith(e,n)}:function(t,e,n){return t.slice(n,n+e.length)===e},Bo=IM?String.fromCodePoint:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n="",i=t.length,r=0,o;i>r;){if(o=t[r++],o>1114111)throw RangeError(o+" is not a valid code point");n+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return n},Mc=xM?Object.fromEntries:function(t){for(var e={},n=0,i=t;n<i.length;n++){var r=i[n],o=r[0],a=r[1];e[o]=a}return e},yc=OM?function(t,e){return t.codePointAt(e)}:function(t,e){var n=t.length;if(!(e<0||e>=n)){var i=t.charCodeAt(e),r;return i<55296||i>56319||e+1===n||(r=t.charCodeAt(e+1))<56320||r>57343?i:(i-55296<<10)+(r-56320)+65536}},PM=CM?function(t){return t.trimStart()}:function(t){return t.replace(AM,"")},_M=zM?function(t){return t.trimEnd()}:function(t){return t.replace(vM,"")};function pc(t,e){return new RegExp(t,e)}var Ho;if(Fo){var mc=pc("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Ho=function(t,e){var n;mc.lastIndex=e;var i=mc.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}}else Ho=function(t,e){for(var n=[];;){var i=yc(t,e);if(i===void 0||Nc(i)||HM(i))break;n.push(i),e+=i>=65536?2:1}return Bo.apply(void 0,n)};var RM=function(){function t(e,n){n===void 0&&(n={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return t.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(e,n,i){for(var r=[];!this.isEOF();){var o=this.char();if(o===123){var a=this.parseArgument(e,i);if(a.err)return a;r.push(a.val)}else{if(o===125&&e>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var s=this.clonePosition();this.bump(),r.push({type:Dt.pound,location:gt(s,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(ut.UNMATCHED_CLOSING_TAG,gt(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Qo(this.peek()||0)){var a=this.parseTag(e,n);if(a.err)return a;r.push(a.val)}else{var a=this.parseLiteral(e,n);if(a.err)return a;r.push(a.val)}}}return{val:r,err:null}},t.prototype.parseTag=function(e,n){var i=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Dt.literal,value:"<".concat(r,"/>"),location:gt(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,n,!0);if(o.err)return o;var a=o.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Qo(this.char()))return this.error(ut.INVALID_TAG,gt(s,this.clonePosition()));var u=this.clonePosition(),l=this.parseTagName();return r!==l?this.error(ut.UNMATCHED_CLOSING_TAG,gt(u,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Dt.tag,value:r,children:a,location:gt(i,this.clonePosition())},err:null}:this.error(ut.INVALID_TAG,gt(s,this.clonePosition())))}else return this.error(ut.UNCLOSED_TAG,gt(i,this.clonePosition()))}else return this.error(ut.INVALID_TAG,gt(i,this.clonePosition()))},t.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&BM(this.char());)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(e,n){for(var i=this.clonePosition(),r="";;){var o=this.tryParseQuote(n);if(o){r+=o;continue}var a=this.tryParseUnquoted(e,n);if(a){r+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){r+=s;continue}break}var u=gt(i,this.clonePosition());return{val:{type:Dt.literal,value:r,location:u},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!FM(this.peek()||0))?(this.bump(),"<"):null},t.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return Bo.apply(void 0,n)},t.prototype.tryParseUnquoted=function(e,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&e>0?null:(this.bump(),Bo(i))},t.prototype.parseArgument=function(e,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(ut.EXPECT_ARGUMENT_CLOSING_BRACE,gt(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(ut.EMPTY_ARGUMENT,gt(i,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(ut.MALFORMED_ARGUMENT,gt(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(ut.EXPECT_ARGUMENT_CLOSING_BRACE,gt(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Dt.argument,value:r,location:gt(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(ut.EXPECT_ARGUMENT_CLOSING_BRACE,gt(i,this.clonePosition())):this.parseArgumentOptions(e,n,r,i);default:return this.error(ut.MALFORMED_ARGUMENT,gt(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),n=this.offset(),i=Ho(this.message,n),r=n+i.length;this.bumpTo(r);var o=this.clonePosition(),a=gt(e,o);return{value:i,location:a}},t.prototype.parseArgumentOptions=function(e,n,i,r){var o,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(s){case"":return this.error(ut.EXPECT_ARGUMENT_TYPE,gt(a,u));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var g=this.clonePosition(),M=this.parseSimpleArgStyleIfPossible();if(M.err)return M;var c=_M(M.val);if(c.length===0)return this.error(ut.EXPECT_ARGUMENT_STYLE,gt(this.clonePosition(),this.clonePosition()));var f=gt(g,this.clonePosition());l={style:c,styleLocation:f}}var d=this.tryParseArgumentClose(r);if(d.err)return d;var h=gt(r,this.clonePosition());if(l&&fc(l?.style,"::",0)){var y=PM(l.style.slice(2));if(s==="number"){var M=this.parseNumberSkeletonFromString(y,l.styleLocation);return M.err?M:{val:{type:Dt.number,value:i,location:h,style:M.val},err:null}}else{if(y.length===0)return this.error(ut.EXPECT_DATE_TIME_SKELETON,h);var p=y;this.locale&&(p=SM(y,this.locale));var c={type:Un.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?mM(p):{}},w=s==="date"?Dt.date:Dt.time;return{val:{type:w,value:i,location:h,style:c},err:null}}}return{val:{type:s==="number"?Dt.number:s==="date"?Dt.date:Dt.time,value:i,location:h,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(ut.EXPECT_SELECT_ARGUMENT_OPTIONS,gt(m,pt({},m)));this.bumpSpace();var N=this.parseIdentifierIfPossible(),j=0;if(s!=="select"&&N.value==="offset"){if(!this.bumpIf(":"))return this.error(ut.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,gt(this.clonePosition(),this.clonePosition()));this.bumpSpace();var M=this.tryParseDecimalInteger(ut.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ut.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(M.err)return M;this.bumpSpace(),N=this.parseIdentifierIfPossible(),j=M.val}var b=this.tryParsePluralOrSelectOptions(e,s,n,N);if(b.err)return b;var d=this.tryParseArgumentClose(r);if(d.err)return d;var S=gt(r,this.clonePosition());return s==="select"?{val:{type:Dt.select,value:i,options:Mc(b.val),location:S},err:null}:{val:{type:Dt.plural,value:i,options:Mc(b.val),offset:j,pluralType:s==="plural"?"cardinal":"ordinal",location:S},err:null}}default:return this.error(ut.INVALID_ARGUMENT_TYPE,gt(a,u))}},t.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(ut.EXPECT_ARGUMENT_CLOSING_BRACE,gt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(ut.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,gt(r,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(e,n){var i=[];try{i=wM(e)}catch{return this.error(ut.INVALID_NUMBER_SKELETON,n)}return{val:{type:Un.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?EM(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(e,n,i,r){for(var o,a=!1,s=[],u=new Set,l=r.value,g=r.location;;){if(l.length===0){var M=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var c=this.tryParseDecimalInteger(ut.EXPECT_PLURAL_ARGUMENT_SELECTOR,ut.INVALID_PLURAL_ARGUMENT_SELECTOR);if(c.err)return c;g=gt(M,this.clonePosition()),l=this.message.slice(M.offset,this.offset())}else break}if(u.has(l))return this.error(n==="select"?ut.DUPLICATE_SELECT_ARGUMENT_SELECTOR:ut.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,g);l==="other"&&(a=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?ut.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:ut.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,gt(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(e+1,n,i);if(d.err)return d;var h=this.tryParseArgumentClose(f);if(h.err)return h;s.push([l,{value:d.val,location:gt(f,this.clonePosition())}]),u.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,g=o.location}return s.length===0?this.error(n==="select"?ut.EXPECT_SELECT_ARGUMENT_SELECTOR:ut.EXPECT_PLURAL_ARGUMENT_SELECTOR,gt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(ut.MISSING_OTHER_CLAUSE,gt(this.clonePosition(),this.clonePosition())):{val:s,err:null}},t.prototype.tryParseDecimalInteger=function(e,n){var i=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var o=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)o=!0,a=a*10+(s-48),this.bump();else break}var u=gt(r,this.clonePosition());return o?(a*=i,UM(a)?{val:a,err:null}:this.error(n,u)):this.error(e,u)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var n=yc(this.message,e);if(n===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return n},t.prototype.error=function(e,n){return{val:null,err:{kind:e,message:this.message,location:n}}},t.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},t.prototype.bumpIf=function(e){if(fc(this.message,e,this.offset())){for(var n=0;n<e.length;n++)this.bump();return!0}return!1},t.prototype.bumpUntil=function(e){var n=this.offset(),i=this.message.indexOf(e,n);return i>=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var n=this.offset();if(n===e)break;if(n>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&Nc(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(e>=65536?2:1));return i??null},t}();function Qo(t){return t>=97&&t<=122||t>=65&&t<=90}function FM(t){return Qo(t)||t===47}function BM(t){return t===45||t===46||t>=48&&t<=57||t===95||t>=97&&t<=122||t>=65&&t<=90||t==183||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function Nc(t){return t>=9&&t<=13||t===32||t===133||t>=8206&&t<=8207||t===8232||t===8233}function HM(t){return t>=33&&t<=35||t===36||t>=37&&t<=39||t===40||t===41||t===42||t===43||t===44||t===45||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||t===91||t===92||t===93||t===94||t===96||t===123||t===124||t===125||t===126||t===161||t>=162&&t<=165||t===166||t===167||t===169||t===171||t===172||t===174||t===176||t===177||t===182||t===187||t===191||t===215||t===247||t>=8208&&t<=8213||t>=8214&&t<=8215||t===8216||t===8217||t===8218||t>=8219&&t<=8220||t===8221||t===8222||t===8223||t>=8224&&t<=8231||t>=8240&&t<=8248||t===8249||t===8250||t>=8251&&t<=8254||t>=8257&&t<=8259||t===8260||t===8261||t===8262||t>=8263&&t<=8273||t===8274||t===8275||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||t===8608||t>=8609&&t<=8610||t===8611||t>=8612&&t<=8613||t===8614||t>=8615&&t<=8621||t===8622||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||t===8658||t===8659||t===8660||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||t===8968||t===8969||t===8970||t===8971||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||t===9001||t===9002||t>=9003&&t<=9083||t===9084||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||t===9655||t>=9656&&t<=9664||t===9665||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||t===9839||t>=9840&&t<=10087||t===10088||t===10089||t===10090||t===10091||t===10092||t===10093||t===10094||t===10095||t===10096||t===10097||t===10098||t===10099||t===10100||t===10101||t>=10132&&t<=10175||t>=10176&&t<=10180||t===10181||t===10182||t>=10183&&t<=10213||t===10214||t===10215||t===10216||t===10217||t===10218||t===10219||t===10220||t===10221||t===10222||t===10223||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||t===10627||t===10628||t===10629||t===10630||t===10631||t===10632||t===10633||t===10634||t===10635||t===10636||t===10637||t===10638||t===10639||t===10640||t===10641||t===10642||t===10643||t===10644||t===10645||t===10646||t===10647||t===10648||t>=10649&&t<=10711||t===10712||t===10713||t===10714||t===10715||t>=10716&&t<=10747||t===10748||t===10749||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||t===11158||t>=11159&&t<=11263||t>=11776&&t<=11777||t===11778||t===11779||t===11780||t===11781||t>=11782&&t<=11784||t===11785||t===11786||t===11787||t===11788||t===11789||t>=11790&&t<=11798||t===11799||t>=11800&&t<=11801||t===11802||t===11803||t===11804||t===11805||t>=11806&&t<=11807||t===11808||t===11809||t===11810||t===11811||t===11812||t===11813||t===11814||t===11815||t===11816||t===11817||t>=11818&&t<=11822||t===11823||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||t===11840||t===11841||t===11842||t>=11843&&t<=11855||t>=11856&&t<=11857||t===11858||t>=11859&&t<=11903||t>=12289&&t<=12291||t===12296||t===12297||t===12298||t===12299||t===12300||t===12301||t===12302||t===12303||t===12304||t===12305||t>=12306&&t<=12307||t===12308||t===12309||t===12310||t===12311||t===12312||t===12313||t===12314||t===12315||t===12316||t===12317||t>=12318&&t<=12319||t===12320||t===12336||t===64830||t===64831||t>=65093&&t<=65094}function Go(t){t.forEach(function(e){if(delete e.location,ic(e)||rc(e))for(var n in e.options)delete e.options[n].location,Go(e.options[n].value);else tc(e)&&ac(e.style)||(ec(e)||nc(e))&&_o(e.style)?delete e.style.location:oc(e)&&Go(e.children)})}function QM(t,e){e===void 0&&(e={}),e=pt({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new RM(t,e).parse();if(n.err){var i=SyntaxError(ut[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return e?.captureLocation||Go(n.val),n.val}function Ko(t,e){var n=e&&e.cache?e.cache:ZM,i=e&&e.serializer?e.serializer:WM,r=e&&e.strategy?e.strategy:KM;return r(t,{cache:n,serializer:i})}function GM(t){return t==null||typeof t=="number"||typeof t=="boolean"}function wc(t,e,n,i){var r=GM(i)?i:n(i),o=e.get(r);return typeof o>"u"&&(o=t.call(this,i),e.set(r,o)),o}function Lc(t,e,n){var i=Array.prototype.slice.call(arguments,3),r=n(i),o=e.get(r);return typeof o>"u"&&(o=t.apply(this,i),e.set(r,o)),o}function $o(t,e,n,i,r){return n.bind(e,t,i,r)}function KM(t,e){var n=t.length===1?wc:Lc;return $o(t,this,n,e.cache.create(),e.serializer)}function $M(t,e){return $o(t,this,Lc,e.cache.create(),e.serializer)}function VM(t,e){return $o(t,this,wc,e.cache.create(),e.serializer)}var WM=function(){return JSON.stringify(arguments)};function Vo(){this.cache=Object.create(null)}Vo.prototype.get=function(t){return this.cache[t]},Vo.prototype.set=function(t,e){this.cache[t]=e};var ZM={create:function(){return new Vo}},Wo={variadic:$M,monadic:VM},Yn;(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(Yn||(Yn={}));var ar=function(t){rr(e,t);function e(n,i,r){var o=t.call(this,n)||this;return o.code=i,o.originalMessage=r,o}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Tc=function(t){rr(e,t);function e(n,i,r,o){return t.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Yn.INVALID_VALUE,o)||this}return e}(ar),qM=function(t){rr(e,t);function e(n,i,r){return t.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),Yn.INVALID_VALUE,r)||this}return e}(ar),XM=function(t){rr(e,t);function e(n,i){return t.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),Yn.MISSING_VALUE,i)||this}return e}(ar),Vt;(function(t){t[t.literal=0]="literal",t[t.object=1]="object"})(Vt||(Vt={}));function JM(t){return t.length<2?t:t.reduce(function(e,n){var i=e[e.length-1];return!i||i.type!==Vt.literal||n.type!==Vt.literal?e.push(n):i.value+=n.value,e},[])}function t0(t){return typeof t=="function"}function sr(t,e,n,i,r,o,a){if(t.length===1&&Ju(t[0]))return[{type:Vt.literal,value:t[0].value}];for(var s=[],u=0,l=t;u<l.length;u++){var g=l[u];if(Ju(g)){s.push({type:Vt.literal,value:g.value});continue}if(yM(g)){typeof o=="number"&&s.push({type:Vt.literal,value:n.getNumberFormat(e).format(o)});continue}var M=g.value;if(!(r&&M in r))throw new XM(M,a);var c=r[M];if(MM(g)){(!c||typeof c=="string"||typeof c=="number")&&(c=typeof c=="string"||typeof c=="number"?String(c):""),s.push({type:typeof c=="string"?Vt.literal:Vt.object,value:c});continue}if(ec(g)){var f=typeof g.style=="string"?i.date[g.style]:_o(g.style)?g.style.parsedOptions:void 0;s.push({type:Vt.literal,value:n.getDateTimeFormat(e,f).format(c)});continue}if(nc(g)){var f=typeof g.style=="string"?i.time[g.style]:_o(g.style)?g.style.parsedOptions:i.time.medium;s.push({type:Vt.literal,value:n.getDateTimeFormat(e,f).format(c)});continue}if(tc(g)){var f=typeof g.style=="string"?i.number[g.style]:ac(g.style)?g.style.parsedOptions:void 0;f&&f.scale&&(c=c*(f.scale||1)),s.push({type:Vt.literal,value:n.getNumberFormat(e,f).format(c)});continue}if(oc(g)){var d=g.children,h=g.value,y=r[h];if(!t0(y))throw new qM(h,"function",a);var p=sr(d,e,n,i,r,o),w=y(p.map(function(j){return j.value}));Array.isArray(w)||(w=[w]),s.push.apply(s,w.map(function(j){return{type:typeof j=="string"?Vt.literal:Vt.object,value:j}}))}if(ic(g)){var m=g.options[c]||g.options.other;if(!m)throw new Tc(g.value,c,Object.keys(g.options),a);s.push.apply(s,sr(m.value,e,n,i,r));continue}if(rc(g)){var m=g.options["=".concat(c)];if(!m){if(!Intl.PluralRules)throw new ar(`Intl.PluralRules is not available in this environment.
|
|
134
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
135
|
+
`,Yn.MISSING_INTL_API,a);var N=n.getPluralRules(e,{type:g.pluralType}).select(c-(g.offset||0));m=g.options[N]||g.options.other}if(!m)throw new Tc(g.value,c,Object.keys(g.options),a);s.push.apply(s,sr(m.value,e,n,i,r,c-(g.offset||0)));continue}}return JM(s)}function e0(t,e){return e?pt(pt(pt({},t||{}),e||{}),Object.keys(t).reduce(function(n,i){return n[i]=pt(pt({},t[i]),e[i]||{}),n},{})):t}function n0(t,e){return e?Object.keys(t).reduce(function(n,i){return n[i]=e0(t[i],e[i]),n},pt({},t)):t}function Zo(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}function i0(t){return t===void 0&&(t={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ko(function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((e=Intl.NumberFormat).bind.apply(e,Po([void 0],n,!1)))},{cache:Zo(t.number),strategy:Wo.variadic}),getDateTimeFormat:Ko(function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((e=Intl.DateTimeFormat).bind.apply(e,Po([void 0],n,!1)))},{cache:Zo(t.dateTime),strategy:Wo.variadic}),getPluralRules:Ko(function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return new((e=Intl.PluralRules).bind.apply(e,Po([void 0],n,!1)))},{cache:Zo(t.pluralRules),strategy:Wo.variadic})}}var r0=function(){function t(e,n,i,r){n===void 0&&(n=t.defaultLocale);var o=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var l=o.formatToParts(u);if(l.length===1)return l[0].value;var g=l.reduce(function(M,c){return!M.length||c.type!==Vt.literal||typeof M[M.length-1]!="string"?M.push(c.value):M[M.length-1]+=c.value,M},[]);return g.length<=1?g[0]||"":g},this.formatToParts=function(u){return sr(o.ast,o.locales,o.formatters,o.formats,u,void 0,o.message)},this.resolvedOptions=function(){var u;return{locale:((u=o.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},this.locales=n,this.resolvedLocale=t.resolveLocale(n),typeof e=="string"){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var a=r||{};a.formatters;var s=Yo(a,["formatters"]);this.ast=t.__parse(e,pt(pt({},s),{locale:this.resolvedLocale}))}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=n0(t.formats,i),this.formatters=r&&r.formatters||i0(this.formatterCache)}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(e){if(!(typeof Intl.Locale>"u")){var n=Intl.NumberFormat.supportedLocalesOf(e);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof e=="string"?e:e[0])}},t.__parse=QM,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();class o0{getStringForLocale(e,n){let i=this.messages[n];i||(i=a0(n,this.messages,this.defaultLocale),this.messages[n]=i);let r=i[e];if(!r)throw new Error(`Could not find intl message ${e} in ${n} locale`);return r}constructor(e,n="en-US"){this.messages={...e},this.defaultLocale=n}}function a0(t,e,n="en-US"){if(e[t])return e[t];let i=s0(t);if(e[i])return e[i];for(let r in e)if(r.startsWith(i+"-"))return e[r];return e[n]}function s0(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}class u0{format(e,n){let i=this.cache[e];if(!i){let o=this.messages.getStringForLocale(e,this.locale);if(!o)throw new Error(`Could not find intl message ${e} in ${this.locale} locale`);i=new r0(o,this.locale),this.cache[e]=i}let r;return n&&(r=Object.keys(n).reduce((o,a)=>(o[a]=n[a]==null?!1:n[a],o),{})),i.format(r)}constructor(e,n){this.locale=e,this.messages=n,this.cache={}}}/*!
|
|
136
|
+
* Portions of this file are based on code from react-spectrum.
|
|
137
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
138
|
+
*
|
|
139
|
+
* Credits to the React Spectrum team:
|
|
140
|
+
* https://github.com/adobe/react-spectrum/blob/23c3a91e7b87952f07da9da115188bd2abd99d77/packages/@react-aria/i18n/src/useMessageFormatter.ts
|
|
141
|
+
*/const jc=new WeakMap;function c0(t){let e=jc.get(t);return e||(e=new o0(t),jc.set(t,e)),e}function l0(t){const{locale:e}=ir(),n=V(()=>new u0(e(),c0(E(t))));return V(()=>({format:(i,r)=>n().format(i,r)}))}/*!
|
|
142
|
+
* Portions of this file are based on code from react-spectrum.
|
|
143
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
144
|
+
*
|
|
145
|
+
* Credits to the React Spectrum team:
|
|
146
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/Selection.ts
|
|
147
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/types.ts
|
|
148
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-types/shared/src/selection.d.ts
|
|
149
|
+
*/class Te extends Set{anchorKey;currentKey;constructor(e,n,i){super(e),e instanceof Te?(this.anchorKey=n||e.anchorKey,this.currentKey=i||e.currentKey):(this.anchorKey=n,this.currentKey=i)}}function d0(t){const[e,n]=zu(t);return[()=>e()??new Te,n]}/*!
|
|
150
|
+
* Portions of this file are based on code from react-spectrum.
|
|
151
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
152
|
+
*
|
|
153
|
+
* Credits to the React Spectrum team:
|
|
154
|
+
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/utils.ts
|
|
155
|
+
*/function Ec(t){return pf()?t.altKey:t.ctrlKey}function Pn(t){return gi()?t.metaKey:t.ctrlKey}function Sc(t){return new Te(t)}function g0(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}/*!
|
|
156
|
+
* Portions of this file are based on code from react-spectrum.
|
|
157
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
158
|
+
*
|
|
159
|
+
* Credits to the React Spectrum team:
|
|
160
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/useMultipleSelectionState.ts
|
|
161
|
+
*/function h0(t){t=Ot({selectionMode:"none",selectionBehavior:"toggle"},t);const[e,n]=W(!1),[i,r]=W(),o=V(()=>{const d=E(t.selectedKeys);if(d)return Sc(d)}),a=V(()=>{const d=E(t.defaultSelectedKeys);return d?Sc(d):new Te}),[s,u]=d0({value:o,defaultValue:a,onChange:d=>t.onSelectionChange?.(d)}),[l,g]=W(E(t.selectionBehavior)),M=()=>E(t.selectionMode),c=()=>E(t.disallowEmptySelection)??!1,f=d=>{(E(t.allowDuplicateSelectionEvents)||!g0(d,s()))&&u(d)};return nt(()=>{const d=s();E(t.selectionBehavior)==="replace"&&l()==="toggle"&&typeof d=="object"&&d.size===0&&g("replace")}),nt(()=>{g(E(t.selectionBehavior)??"toggle")}),{selectionMode:M,disallowEmptySelection:c,selectionBehavior:l,setSelectionBehavior:g,isFocused:e,setFocused:n,focusedKey:i,setFocusedKey:r,selectedKeys:s,setSelectedKeys:f}}/*!
|
|
162
|
+
* Portions of this file are based on code from react-spectrum.
|
|
163
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
164
|
+
*
|
|
165
|
+
* Credits to the React Spectrum team:
|
|
166
|
+
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useTypeSelect.ts
|
|
167
|
+
*/function bc(t){const[e,n]=W(""),[i,r]=W(-1);return{typeSelectHandlers:{onKeyDown:o=>{if(E(t.isDisabled))return;const a=E(t.keyboardDelegate),s=E(t.selectionManager);if(!a.getKeyForSearch)return;const u=f0(o.key);if(!u||o.ctrlKey||o.metaKey)return;u===" "&&e().trim().length>0&&(o.preventDefault(),o.stopPropagation());let l=n(M=>M+=u),g=a.getKeyForSearch(l,s.focusedKey())??a.getKeyForSearch(l);g==null&&M0(l)&&(l=l[0],g=a.getKeyForSearch(l,s.focusedKey())??a.getKeyForSearch(l)),g!=null&&(s.setFocusedKey(g),t.onTypeSelect?.(g)),clearTimeout(i()),r(window.setTimeout(()=>n(""),500))}}}}function f0(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function M0(t){return t.split("").every(e=>e===t[0])}/*!
|
|
168
|
+
* Portions of this file are based on code from react-spectrum.
|
|
169
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
170
|
+
*
|
|
171
|
+
* Credits to the React Spectrum team:
|
|
172
|
+
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableCollection.ts
|
|
173
|
+
*/function y0(t,e,n){t=ht({selectOnFocus:()=>E(t.selectionManager).selectionBehavior()==="replace"},t);const i=()=>n?.()??e(),{direction:r}=ir();let o={top:0,left:0};of(()=>E(t.isVirtualized)?void 0:i(),"scroll",()=>{const c=i();c&&(o={top:c.scrollTop,left:c.scrollLeft})});const{typeSelectHandlers:a}=bc({isDisabled:()=>E(t.disallowTypeAhead),keyboardDelegate:()=>E(t.keyboardDelegate),selectionManager:()=>E(t.selectionManager)}),s=c=>{Pt(c,a.onKeyDown),c.altKey&&c.key==="Tab"&&c.preventDefault();const f=e();if(!f?.contains(c.target))return;const d=E(t.selectionManager),h=E(t.selectOnFocus),y=N=>{N!=null&&(d.setFocusedKey(N),c.shiftKey&&d.selectionMode()==="multiple"?d.extendSelection(N):h&&!Ec(c)&&d.replaceSelection(N))},p=E(t.keyboardDelegate),w=E(t.shouldFocusWrap),m=d.focusedKey();switch(c.key){case"ArrowDown":{if(p.getKeyBelow){c.preventDefault();let N;m!=null?N=p.getKeyBelow(m):N=p.getFirstKey?.(),N==null&&w&&(N=p.getFirstKey?.(m)),y(N)}break}case"ArrowUp":{if(p.getKeyAbove){c.preventDefault();let N;m!=null?N=p.getKeyAbove(m):N=p.getLastKey?.(),N==null&&w&&(N=p.getLastKey?.(m)),y(N)}break}case"ArrowLeft":{if(p.getKeyLeftOf){c.preventDefault();const N=r()==="rtl";let j;m!=null?j=p.getKeyLeftOf(m):j=N?p.getFirstKey?.():p.getLastKey?.(),y(j)}break}case"ArrowRight":{if(p.getKeyRightOf){c.preventDefault();const N=r()==="rtl";let j;m!=null?j=p.getKeyRightOf(m):j=N?p.getLastKey?.():p.getFirstKey?.(),y(j)}break}case"Home":if(p.getFirstKey){c.preventDefault();const N=p.getFirstKey(m,Pn(c));N!=null&&(d.setFocusedKey(N),Pn(c)&&c.shiftKey&&d.selectionMode()==="multiple"?d.extendSelection(N):h&&d.replaceSelection(N))}break;case"End":if(p.getLastKey){c.preventDefault();const N=p.getLastKey(m,Pn(c));N!=null&&(d.setFocusedKey(N),Pn(c)&&c.shiftKey&&d.selectionMode()==="multiple"?d.extendSelection(N):h&&d.replaceSelection(N))}break;case"PageDown":if(p.getKeyPageBelow&&m!=null){c.preventDefault();const N=p.getKeyPageBelow(m);y(N)}break;case"PageUp":if(p.getKeyPageAbove&&m!=null){c.preventDefault();const N=p.getKeyPageAbove(m);y(N)}break;case"a":Pn(c)&&d.selectionMode()==="multiple"&&E(t.disallowSelectAll)!==!0&&(c.preventDefault(),d.selectAll());break;case"Escape":c.defaultPrevented||(c.preventDefault(),E(t.disallowEmptySelection)||d.clearSelection());break;case"Tab":if(!E(t.allowsTabNavigation)){if(c.shiftKey)f.focus();else{const N=If(f,{tabbable:!0});let j,b;do b=N.lastChild(),b&&(j=b);while(b);j&&!j.contains(document.activeElement)&&Kt(j)}break}}},u=c=>{const f=E(t.selectionManager),d=E(t.keyboardDelegate),h=E(t.selectOnFocus);if(f.isFocused()){c.currentTarget.contains(c.target)||f.setFocused(!1);return}if(c.currentTarget.contains(c.target)){if(f.setFocused(!0),f.focusedKey()==null){const y=w=>{w!=null&&(f.setFocusedKey(w),h&&f.replaceSelection(w))},p=c.relatedTarget;p&&c.currentTarget.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_FOLLOWING?y(f.lastSelectedKey()??d.getLastKey?.()):y(f.firstSelectedKey()??d.getFirstKey?.())}else if(!E(t.isVirtualized)){const y=i();if(y){y.scrollTop=o.top,y.scrollLeft=o.left;const p=y.querySelector(`[data-key="${f.focusedKey()}"]`);p&&(Kt(p),xu(y,p))}}}},l=c=>{const f=E(t.selectionManager);c.currentTarget.contains(c.relatedTarget)||f.setFocused(!1)},g=c=>{i()===c.target&&c.preventDefault()},M=()=>{const c=E(t.autoFocus);if(!c)return;const f=E(t.selectionManager),d=E(t.keyboardDelegate);let h;c==="first"&&(h=d.getFirstKey?.()),c==="last"&&(h=d.getLastKey?.());const y=f.selectedKeys();y.size&&(h=y.values().next().value),f.setFocused(!0),f.setFocusedKey(h);const p=e();p&&h==null&&!E(t.shouldUseVirtualFocus)&&Kt(p)};return Ke(()=>{t.deferAutoFocus?setTimeout(M,0):M()}),nt(Se([i,()=>E(t.isVirtualized),()=>E(t.selectionManager).focusedKey()],c=>{const[f,d,h]=c;if(d)h&&t.scrollToKey?.(h);else if(h&&f){const y=f.querySelector(`[data-key="${h}"]`);y&&xu(f,y)}})),{tabIndex:V(()=>{if(!E(t.shouldUseVirtualFocus))return E(t.selectionManager).focusedKey()==null?0:-1}),onKeyDown:s,onMouseDown:g,onFocusIn:u,onFocusOut:l}}/*!
|
|
174
|
+
* Portions of this file are based on code from react-spectrum.
|
|
175
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
176
|
+
*
|
|
177
|
+
* Credits to the React Spectrum team:
|
|
178
|
+
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableItem.ts
|
|
179
|
+
*/function p0(t,e){const n=()=>E(t.selectionManager),i=()=>E(t.key),r=()=>E(t.shouldUseVirtualFocus),o=w=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(i())&&!n().disallowEmptySelection()?n().toggleSelection(i()):n().replaceSelection(i()):w&&w.shiftKey?n().extendSelection(i()):n().selectionBehavior()==="toggle"||Pn(w)||"pointerType"in w&&w.pointerType==="touch"?n().toggleSelection(i()):n().replaceSelection(i()))},a=()=>n().isSelected(i()),s=()=>E(t.disabled)||n().isDisabled(i()),u=()=>!s()&&n().canSelectItem(i());let l=null;const g=w=>{u()&&(l=w.pointerType,w.pointerType==="mouse"&&w.button===0&&!E(t.shouldSelectOnPressUp)&&o(w))},M=w=>{u()&&w.pointerType==="mouse"&&w.button===0&&E(t.shouldSelectOnPressUp)&&E(t.allowsDifferentPressOrigin)&&o(w)},c=w=>{u()&&(E(t.shouldSelectOnPressUp)&&!E(t.allowsDifferentPressOrigin)||l!=="mouse")&&o(w)},f=w=>{!u()||!["Enter"," "].includes(w.key)||(Ec(w)?n().toggleSelection(i()):o(w))},d=w=>{s()&&w.preventDefault()},h=w=>{const m=e();r()||s()||!m||w.target===m&&n().setFocusedKey(i())},y=V(()=>{if(!(r()||s()))return i()===n().focusedKey()?0:-1}),p=V(()=>E(t.virtualized)?void 0:i());return nt(Se([e,i,r,()=>n().focusedKey(),()=>n().isFocused()],([w,m,N,j,b])=>{w&&m===j&&b&&!N&&document.activeElement!==w&&(t.focus?t.focus():Kt(w))})),{isSelected:a,isDisabled:s,allowsSelection:u,tabIndex:y,dataKey:p,onPointerDown:g,onPointerUp:M,onClick:c,onKeyDown:f,onMouseDown:d,onFocus:h}}/*!
|
|
180
|
+
* Portions of this file are based on code from react-spectrum.
|
|
181
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
182
|
+
*
|
|
183
|
+
* Credits to the React Spectrum team:
|
|
184
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/selection/src/SelectionManager.ts
|
|
185
|
+
*/class m0{collection;state;constructor(e,n){this.collection=e,this.state=n}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const n=this.getKey(e);return n==null?!1:this.state.selectedKeys().has(n)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(n=>e.has(n))}firstSelectedKey(){let e;for(const n of this.state.selectedKeys()){const i=this.collection().getItem(n),r=i?.index!=null&&e?.index!=null&&i.index<e.index;(!e||r)&&(e=i)}return e?.key}lastSelectedKey(){let e;for(const n of this.state.selectedKeys()){const i=this.collection().getItem(n),r=i?.index!=null&&e?.index!=null&&i.index>e.index;(!e||r)&&(e=i)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const n=this.getKey(e);if(n==null)return;const i=this.state.selectedKeys(),r=i.anchorKey||n,o=new Te(i,r,n);for(const a of this.getKeyRange(r,i.currentKey||n))o.delete(a);for(const a of this.getKeyRange(n,r))this.canSelectItem(a)&&o.add(a);this.state.setSelectedKeys(o)}getKeyRange(e,n){const i=this.collection().getItem(e),r=this.collection().getItem(n);return i&&r?i.index!=null&&r.index!=null&&i.index<=r.index?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){const i=[];let r=e;for(;r!=null;){const o=this.collection().getItem(r);if(o&&o.type==="item"&&i.push(r),r===n)return i;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const n=this.collection().getItem(e);return n?!n||n.type!=="item"?null:n.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const n=this.getKey(e);if(n==null)return;const i=new Te(this.state.selectedKeys());i.has(n)?i.delete(n):this.canSelectItem(n)&&(i.add(n),i.anchorKey=n,i.currentKey=n),!(this.disallowEmptySelection()&&i.size===0)&&this.state.setSelectedKeys(i)}replaceSelection(e){if(this.selectionMode()==="none")return;const n=this.getKey(e);if(n==null)return;const i=this.canSelectItem(n)?new Te([n],n,n):new Te;this.state.setSelectedKeys(i)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const n=new Te;for(const i of e){const r=this.getKey(i);if(r!=null&&(n.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(n)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Te)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||n&&n.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const n=this.selectedKeys();if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;for(const i of n)if(!e.has(i))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const n=this.collection().getItem(e);return n!=null&&!n.disabled}isDisabled(e){const n=this.collection().getItem(e);return!n||n.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const i=this.collection().getItem(n);if(!i)continue;i.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}}/*!
|
|
186
|
+
* Portions of this file are based on code from react-spectrum.
|
|
187
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
188
|
+
*
|
|
189
|
+
* Credits to the React Spectrum team:
|
|
190
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/ListCollection.ts
|
|
191
|
+
*/class Ac{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let n,i=0;for(const[r,o]of this.keyMap)n?(n.nextKey=r,o.prevKey=n.key):(this.firstKey=r,o.prevKey=void 0),o.type==="item"&&(o.index=i++),n=o,n.nextKey=void 0;this.lastKey=n.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}}/*!
|
|
192
|
+
* Portions of this file are based on code from react-spectrum.
|
|
193
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
194
|
+
*
|
|
195
|
+
* Credits to the React Spectrum team:
|
|
196
|
+
* https://github.com/adobe/react-spectrum/blob/bfce84fee12a027d9cbc38b43e1747e3e4b4b169/packages/@react-stately/list/src/useListState.ts
|
|
197
|
+
*/function vc(t){const e=h0(t),n=kf({dataSource:()=>E(t.dataSource),getKey:()=>E(t.getKey),getTextValue:()=>E(t.getTextValue),getDisabled:()=>E(t.getDisabled),getSectionChildren:()=>E(t.getSectionChildren),factory:r=>t.filter?new Ac(t.filter(r)):new Ac(r)},[()=>t.filter]),i=new m0(n,e);return Vs(()=>{const r=e.focusedKey();r!=null&&!n().getItem(r)&&e.setFocusedKey(void 0)}),{collection:n,selectionManager:()=>i}}/*!
|
|
198
|
+
* Portions of this file are based on code from react-spectrum.
|
|
199
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
200
|
+
*
|
|
201
|
+
* Credits to the React Spectrum team:
|
|
202
|
+
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/ListKeyboardDelegate.ts
|
|
203
|
+
*/class Dc{collection;ref;collator;constructor(e,n,i){this.collection=e,this.ref=n,this.collator=i}getKeyBelow(e){let n=this.collection().getKeyAfter(e);for(;n!=null;){const i=this.collection().getItem(n);if(i&&i.type==="item"&&!i.disabled)return n;n=this.collection().getKeyAfter(n)}}getKeyAbove(e){let n=this.collection().getKeyBefore(e);for(;n!=null;){const i=this.collection().getItem(n);if(i&&i.type==="item"&&!i.disabled)return n;n=this.collection().getKeyBefore(n)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const n=this.collection().getItem(e);if(n&&n.type==="item"&&!n.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const n=this.collection().getItem(e);if(n&&n.type==="item"&&!n.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const n=this.ref?.();let i=this.getItem(e);if(!n||!i)return;const r=Math.max(0,i.offsetTop+i.offsetHeight-n.offsetHeight);let o=e;for(;o&&i&&i.offsetTop>r;)o=this.getKeyAbove(o),i=o!=null?this.getItem(o):null;return o}getKeyPageBelow(e){const n=this.ref?.();let i=this.getItem(e);if(!n||!i)return;const r=Math.min(n.scrollHeight,i.offsetTop-i.offsetHeight+n.offsetHeight);let o=e;for(;o&&i&&i.offsetTop<r;)o=this.getKeyBelow(o),i=o!=null?this.getItem(o):null;return o}getKeyForSearch(e,n){const i=this.collator?.();if(!i)return;let r=n!=null?this.getKeyBelow(n):this.getFirstKey();for(;r!=null;){const o=this.collection().getItem(r);if(o){const a=o.textValue.slice(0,e.length);if(o.textValue&&i.compare(a,e)===0)return r}r=this.getKeyBelow(r)}}}/*!
|
|
204
|
+
* Portions of this file are based on code from react-spectrum.
|
|
205
|
+
* Apache License Version 2.0, Copyright 2020 Adobe.
|
|
206
|
+
*
|
|
207
|
+
* Credits to the React Spectrum team:
|
|
208
|
+
* https://github.com/adobe/react-spectrum/blob/8f2f2acb3d5850382ebe631f055f88c704aa7d17/packages/@react-aria/selection/src/useSelectableList.ts
|
|
209
|
+
*/function N0(t,e,n){const i=Xu({usage:"search",sensitivity:"base"}),r=V(()=>E(t.keyboardDelegate)||new Dc(t.collection,e,i));return y0({selectionManager:()=>E(t.selectionManager),keyboardDelegate:r,autoFocus:()=>E(t.autoFocus),deferAutoFocus:()=>E(t.deferAutoFocus),shouldFocusWrap:()=>E(t.shouldFocusWrap),disallowEmptySelection:()=>E(t.disallowEmptySelection),selectOnFocus:()=>E(t.selectOnFocus),disallowTypeAhead:()=>E(t.disallowTypeAhead),shouldUseVirtualFocus:()=>E(t.shouldUseVirtualFocus),allowsTabNavigation:()=>E(t.allowsTabNavigation),isVirtualized:()=>E(t.isVirtualized),scrollToKey:o=>E(t.scrollToKey)?.(o)},e,n)}/*!
|
|
210
|
+
* Portions of this file are based on code from ariakit
|
|
211
|
+
* MIT Licensed, Copyright (c) Diego Haz.
|
|
212
|
+
*
|
|
213
|
+
* Credits to the ariakit team:
|
|
214
|
+
* https://github.com/hope-ui/hope-ui/blob/54125b130195f37161dbeeea0c21dc3b198bc3ac/packages/core/src/button/is-button.ts
|
|
215
|
+
*/const w0=["button","color","file","image","reset","submit"];function L0(t){const e=t.tagName.toLowerCase();return e==="button"?!0:e==="input"&&t.type?w0.indexOf(t.type)!==-1:!1}function ur(t){let e;t=Ot({type:"button"},t);const[n,i]=St(t,["ref","type","disabled"]),r=nM(()=>e,()=>"button"),o=V(()=>{const u=r();return u==null?!1:L0({tagName:u,type:n.type})}),a=V(()=>r()==="input"),s=V(()=>r()==="a"&&e?.getAttribute("href")!=null);return T(ee,ht({as:"button",ref(u){const l=ce(g=>e=g,n.ref);typeof l=="function"&&l(u)},get type(){return o()||a()?n.type:void 0},get role(){return!o()&&!s()?"button":void 0},get tabIndex(){return!o()&&!s()&&!n.disabled?0:void 0},get disabled(){return o()||a()?n.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},i))}const Ic=se();function _n(){const t=ue(Ic);if(t===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return t}function qo(t){const e=_n(),[n,i]=St(t,["aria-label","onClick"]),r=l0(()=>uM);return T(ur,ht({get"aria-label"(){return n["aria-label"]||r().format("dismiss")},onClick:o=>{Pt(o,n.onClick),e.close()}},i))}const xc=se();function T0(){return ue(xc)}function Xo(t){let e;const n=T0(),[i,r]=St(t,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),o=new Set([]),a=u=>{o.add(u);const l=n?.registerNestedLayer(u);return()=>{o.delete(u),l?.()}};Xf({shouldExcludeElement:u=>e?i.excludedElements?.some(l=>Ne(l(),u))||[...o].some(l=>Ne(l,u)):!1,onPointerDownOutside:u=>{!e||de.isBelowPointerBlockingLayer(e)||!i.bypassTopMostLayerCheck&&!de.isTopMostLayer(e)||(i.onPointerDownOutside?.(u),i.onInteractOutside?.(u),u.defaultPrevented||i.onDismiss?.())},onFocusOutside:u=>{i.onFocusOutside?.(u),i.onInteractOutside?.(u),u.defaultPrevented||i.onDismiss?.()}},()=>e),Pf({ownerDocument:()=>le(e),onEscapeKeyDown:u=>{!e||!de.isTopMostLayer(e)||(i.onEscapeKeyDown?.(u),!u.defaultPrevented&&i.onDismiss&&(u.preventDefault(),i.onDismiss()))}}),Ke(()=>{if(!e)return;de.addLayer({node:e,isPointerBlocking:i.disableOutsidePointerEvents,dismiss:i.onDismiss});const u=n?.registerNestedLayer(e);de.assignPointerEventToLayers(),de.disableBodyPointerEvents(e),st(()=>{e&&(de.removeLayer(e),u?.(),de.assignPointerEventToLayers(),de.restoreBodyPointerEvents(e))})}),nt(Se([()=>e,()=>i.disableOutsidePointerEvents],([u,l])=>{if(!u)return;const g=de.find(u);g&&g.isPointerBlocking!==l&&(g.isPointerBlocking=l,de.assignPointerEventToLayers()),l&&de.disableBodyPointerEvents(u),st(()=>{de.restoreBodyPointerEvents(u)})},{defer:!0}));const s={registerNestedLayer:a};return T(xc.Provider,{value:s,get children(){return T(ee,ht({as:"div",ref(u){const l=ce(g=>e=g,i.ref);typeof l=="function"&&l(u)}},r))}})}function cr(t){let e;const n=_n();t=Ot({id:n.generateId("content")},t);const[i,r]=St(t,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let o=!1,a=!1;const s=M=>{i.onPointerDownOutside?.(M),n.modal()&&M.detail.isContextMenu&&M.preventDefault()},u=M=>{i.onFocusOutside?.(M),n.modal()&&M.preventDefault()},l=M=>{i.onInteractOutside?.(M),!n.modal()&&(M.defaultPrevented||(o=!0,M.detail.originalEvent.type==="pointerdown"&&(a=!0)),Ne(n.triggerRef(),M.target)&&M.preventDefault(),M.detail.originalEvent.type==="focusin"&&a&&M.preventDefault())},g=M=>{i.onCloseAutoFocus?.(M),n.modal()?(M.preventDefault(),Kt(n.triggerRef())):(M.defaultPrevented||(o||Kt(n.triggerRef()),M.preventDefault()),o=!1,a=!1)};return Fu({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>e?[e]:[]}),Gu({ownerRef:()=>e,isDisabled:()=>!(n.isOpen()&&(n.modal()||n.preventScroll()))}),Ru({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:g},()=>e),nt(()=>st(n.registerContentId(r.id))),T(kt,{get when(){return n.contentPresence.isPresent()},get children(){return T(Xo,ht({ref(M){const c=ce(f=>{n.contentPresence.setRef(f),e=f},i.ref);typeof c=="function"&&c(M)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return V(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:l,get onDismiss(){return n.close}},r))}})}function j0(t){const e=_n();t=Ot({id:e.generateId("description")},t);const[n,i]=St(t,["id"]);return nt(()=>st(e.registerDescriptionId(n.id))),T(ee,ht({as:"p",get id(){return n.id}},i))}function Jo(t){const e=_n(),[n,i]=St(t,["ref","style","onPointerDown"]),r=o=>{Pt(o,n.onPointerDown),o.target===o.currentTarget&&o.preventDefault()};return T(kt,{get when(){return e.overlayPresence.isPresent()},get children(){return T(ee,ht({as:"div",ref(o){const a=ce(e.overlayPresence.setRef,n.ref);typeof a=="function"&&a(o)},get style(){return{"pointer-events":"auto",...n.style}},get"data-expanded"(){return e.isOpen()?"":void 0},get"data-closed"(){return e.isOpen()?void 0:""},onPointerDown:r},i))}})}function lr(t){const e=_n();return T(kt,{get when(){return e.contentPresence.isPresent()||e.overlayPresence.isPresent()},get children(){return T(go,t)}})}function dr(t){const e=`dialog-${Dn()}`;t=Ot({id:e,modal:!0,preventScroll:!1},t);const[n,i]=W(),[r,o]=W(),[a,s]=W(),[u,l]=W(),g=Ao({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:h=>t.onOpenChange?.(h)}),M=()=>t.forceMount||g.isOpen(),c=er(M),f=er(M),d={isOpen:g.isOpen,modal:()=>t.modal??!0,preventScroll:()=>t.preventScroll??!1,contentId:n,titleId:r,descriptionId:a,triggerRef:u,overlayPresence:c,contentPresence:f,close:g.close,toggle:g.toggle,setTriggerRef:l,generateId:kn(()=>t.id),registerContentId:ge(i),registerTitleId:ge(o),registerDescriptionId:ge(s)};return T(Ic.Provider,{value:d,get children(){return t.children}})}function E0(t){const e=_n();t=Ot({id:e.generateId("title")},t);const[n,i]=St(t,["id"]);return nt(()=>st(e.registerTitleId(n.id))),T(ee,ht({as:"h2",get id(){return n.id}},i))}function S0(t){return T(cr,ht({role:"alertdialog"},t))}const Oc=se();function Cc(){const t=ue(Oc);if(t===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return t}const b0=wt('<svg display="block" viewBox="0 0 30 30"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),ta=30,zc=ta/2,A0={top:180,right:-90,bottom:0,left:90};function v0(t){const e=Cc();t=Ot({size:ta},t);const[n,i]=St(t,["ref","style","children","size"]),r=()=>e.currentPlacement().split("-")[0],o=D0(e.contentRef),a=()=>o()?.getPropertyValue("background-color")||"none",s=()=>o()?.getPropertyValue(`border-${r()}-color`)||"none",u=()=>o()?.getPropertyValue(`border-${r()}-width`)||"0px",l=()=>parseInt(u())*2*(ta/n.size),g=()=>`rotate(${A0[r()]} ${zc} ${zc})`;return T(ee,ht({as:"div",ref(M){const c=ce(e.setArrowRef,n.ref);typeof c=="function"&&c(M)},"aria-hidden":"true",get style(){return{position:"absolute","font-size":`${n.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:s(),"stroke-width":l(),...n.style}}},i,{get children(){const M=b0(),c=M.firstChild;return c.firstChild.nextSibling,pe(()=>Ve(c,"transform",g())),M}}))}function D0(t){const[e,n]=W();return nt(()=>{const i=t();i&&n(To(i).getComputedStyle(i))}),e}function kc(t){const e=Cc(),[n,i]=St(t,["ref","style"]);return T(ee,ht({as:"div",ref(r){const o=ce(e.setPositionerRef,n.ref);typeof o=="function"&&o(r)},"data-popper-positioner":"",get style(){return{position:"absolute",top:0,left:0,"min-width":"max-content",...n.style}}},i))}function Rn(t){return t.split("-")[1]}function ea(t){return t==="y"?"height":"width"}function Ze(t){return t.split("-")[0]}function Fn(t){return["top","bottom"].includes(Ze(t))?"x":"y"}function Uc(t,e,n){let{reference:i,floating:r}=t;const o=i.x+i.width/2-r.width/2,a=i.y+i.height/2-r.height/2,s=Fn(e),u=ea(s),l=i[u]/2-r[u]/2,g=s==="x";let M;switch(Ze(e)){case"top":M={x:o,y:i.y-r.height};break;case"bottom":M={x:o,y:i.y+i.height};break;case"right":M={x:i.x+i.width,y:a};break;case"left":M={x:i.x-r.width,y:a};break;default:M={x:i.x,y:i.y}}switch(Rn(e)){case"start":M[s]-=l*(n&&g?-1:1);break;case"end":M[s]+=l*(n&&g?-1:1)}return M}const I0=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let l=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:g,y:M}=Uc(l,i,u),c=i,f={},d=0;for(let h=0;h<s.length;h++){const{name:y,fn:p}=s[h],{x:w,y:m,data:N,reset:j}=await p({x:g,y:M,initialPlacement:i,placement:c,strategy:r,middlewareData:f,rects:l,platform:a,elements:{reference:t,floating:e}});g=w??g,M=m??M,f={...f,[y]:{...f[y],...N}},j&&d<=50&&(d++,typeof j=="object"&&(j.placement&&(c=j.placement),j.rects&&(l=j.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):j.rects),{x:g,y:M}=Uc(l,c,u)),h=-1)}return{x:g,y:M,placement:c,strategy:r,middlewareData:f}};function fn(t,e){return typeof t=="function"?t(e):t}function Yc(t){return typeof t!="number"?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(t):{top:t,right:t,bottom:t,left:t}}function gr(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function pi(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:o,rects:a,elements:s,strategy:u}=t,{boundary:l="clippingAncestors",rootBoundary:g="viewport",elementContext:M="floating",altBoundary:c=!1,padding:f=0}=fn(e,t),d=Yc(f),h=s[c?M==="floating"?"reference":"floating":M],y=gr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(h)))==null||n?h:h.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:l,rootBoundary:g,strategy:u})),p=M==="floating"?{...a.floating,x:i,y:r}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),m=await(o.isElement==null?void 0:o.isElement(w))&&await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1},N=gr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:p,offsetParent:w,strategy:u}):p);return{top:(y.top-N.top+d.top)/m.y,bottom:(N.bottom-y.bottom+d.bottom)/m.y,left:(y.left-N.left+d.left)/m.x,right:(N.right-y.right+d.right)/m.x}}const mi=Math.min,Mn=Math.max;function na(t,e,n){return Mn(t,mi(e,n))}const x0=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:o,platform:a,elements:s}=e,{element:u,padding:l=0}=fn(t,e)||{};if(u==null)return{};const g=Yc(l),M={x:n,y:i},c=Fn(r),f=ea(c),d=await a.getDimensions(u),h=c==="y",y=h?"top":"left",p=h?"bottom":"right",w=h?"clientHeight":"clientWidth",m=o.reference[f]+o.reference[c]-M[c]-o.floating[f],N=M[c]-o.reference[c],j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let b=j?j[w]:0;b&&await(a.isElement==null?void 0:a.isElement(j))||(b=s.floating[w]||o.floating[f]);const S=m/2-N/2,v=b/2-d[f]/2-1,F=mi(g[y],v),Y=mi(g[p],v),U=F,C=b-d[f]-Y,I=b/2-d[f]/2+S,x=na(U,I,C),k=Rn(r)!=null&&I!=x&&o.reference[f]/2-(I<U?F:Y)-d[f]/2<0?I<U?U-I:C-I:0;return{[c]:M[c]-k,data:{[c]:x,centerOffset:I-x+k}}}}),Pc=["top","right","bottom","left"];Pc.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);const O0={left:"right",right:"left",bottom:"top",top:"bottom"};function hr(t){return t.replace(/left|right|bottom|top/g,e=>O0[e])}function C0(t,e,n){n===void 0&&(n=!1);const i=Rn(t),r=Fn(t),o=ea(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=hr(a)),{main:a,cross:hr(a)}}const z0={start:"end",end:"start"};function ia(t){return t.replace(/start|end/g,e=>z0[e])}const k0=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:s,elements:u}=e,{mainAxis:l=!0,crossAxis:g=!0,fallbackPlacements:M,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:d=!0,...h}=fn(t,e),y=Ze(i),p=Ze(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(u.floating)),m=M||(p||!d?[hr(a)]:function(U){const C=hr(U);return[ia(U),C,ia(C)]}(a));M||f==="none"||m.push(...function(U,C,I,x){const k=Rn(U);let D=function(P,R,H){const Z=["left","right"],tt=["right","left"],at=["top","bottom"],bt=["bottom","top"];switch(P){case"top":case"bottom":return H?R?tt:Z:R?Z:tt;case"left":case"right":return R?at:bt;default:return[]}}(Ze(U),I==="start",x);return k&&(D=D.map(P=>P+"-"+k),C&&(D=D.concat(D.map(ia)))),D}(a,d,f,w));const N=[a,...m],j=await pi(e,h),b=[];let S=((n=r.flip)==null?void 0:n.overflows)||[];if(l&&b.push(j[y]),g){const{main:U,cross:C}=C0(i,o,w);b.push(j[U],j[C])}if(S=[...S,{placement:i,overflows:b}],!b.every(U=>U<=0)){var v,F;const U=(((v=r.flip)==null?void 0:v.index)||0)+1,C=N[U];if(C)return{data:{index:U,overflows:S},reset:{placement:C}};let I=(F=S.filter(x=>x.overflows[0]<=0).sort((x,k)=>x.overflows[1]-k.overflows[1])[0])==null?void 0:F.placement;if(!I)switch(c){case"bestFit":{var Y;const x=(Y=S.map(k=>[k.placement,k.overflows.filter(D=>D>0).reduce((D,P)=>D+P,0)]).sort((k,D)=>k[1]-D[1])[0])==null?void 0:Y[0];x&&(I=x);break}case"initialPlacement":I=a}if(i!==I)return{reset:{placement:I}}}return{}}}};function _c(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Rc(t){return Pc.some(e=>t[e]>=0)}const U0=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=fn(t,e);switch(i){case"referenceHidden":{const o=_c(await pi(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Rc(o)}}}case"escaped":{const o=_c(await pi(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:o,escaped:Rc(o)}}}default:return{}}}}},Y0=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,r=await async function(o,a){const{placement:s,platform:u,elements:l}=o,g=await(u.isRTL==null?void 0:u.isRTL(l.floating)),M=Ze(s),c=Rn(s),f=Fn(s)==="x",d=["left","top"].includes(M)?-1:1,h=g&&f?-1:1,y=fn(a,o);let{mainAxis:p,crossAxis:w,alignmentAxis:m}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return c&&typeof m=="number"&&(w=c==="end"?-1*m:m),f?{x:w*h,y:p*d}:{x:p*d,y:w*h}}(e,t);return{x:n+r.x,y:i+r.y,data:r}}}};function P0(t){return t==="x"?"y":"x"}const _0=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:p,y:w}=y;return{x:p,y:w}}},...u}=fn(t,e),l={x:n,y:i},g=await pi(e,u),M=Fn(Ze(r)),c=P0(M);let f=l[M],d=l[c];if(o){const y=M==="y"?"bottom":"right";f=na(f+g[M==="y"?"top":"left"],f,f-g[y])}if(a){const y=c==="y"?"bottom":"right";d=na(d+g[c==="y"?"top":"left"],d,d-g[y])}const h=s.fn({...e,[M]:f,[c]:d});return{...h,data:{x:h.x-n,y:h.y-i}}}}},R0=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:r,elements:o}=e,{apply:a=()=>{},...s}=fn(t,e),u=await pi(e,s),l=Ze(n),g=Rn(n),M=Fn(n)==="x",{width:c,height:f}=i.floating;let d,h;l==="top"||l==="bottom"?(d=l,h=g===(await(r.isRTL==null?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(h=l,d=g==="end"?"top":"bottom");const y=f-u[d],p=c-u[h],w=!e.middlewareData.shift;let m=y,N=p;if(M){const b=c-u.left-u.right;N=g||w?mi(p,b):b}else{const b=f-u.top-u.bottom;m=g||w?mi(y,b):b}if(w&&!g){const b=Mn(u.left,0),S=Mn(u.right,0),v=Mn(u.top,0),F=Mn(u.bottom,0);M?N=c-2*(b!==0||S!==0?b+S:Mn(u.left,u.right)):m=f-2*(v!==0||F!==0?v+F:Mn(u.top,u.bottom))}await a({...e,availableWidth:N,availableHeight:m});const j=await r.getDimensions(o.floating);return c!==j.width||f!==j.height?{reset:{rects:!0}}:{}}}};function he(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Oe(t){return he(t).getComputedStyle(t)}function Fc(t){return t instanceof he(t).Node}function qe(t){return Fc(t)?(t.nodeName||"").toLowerCase():"#document"}function be(t){return t instanceof HTMLElement||t instanceof he(t).HTMLElement}function Bc(t){return typeof ShadowRoot<"u"&&(t instanceof he(t).ShadowRoot||t instanceof ShadowRoot)}function Ni(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Oe(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function F0(t){return["table","td","th"].includes(qe(t))}function ra(t){const e=oa(),n=Oe(t);return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!e&&!!n.backdropFilter&&n.backdropFilter!=="none"||!e&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function oa(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function fr(t){return["html","body","#document"].includes(qe(t))}const aa=Math.min,Bn=Math.max,Mr=Math.round,yr=Math.floor,Xe=t=>({x:t,y:t});function Hc(t){const e=Oe(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=be(t),o=r?t.offsetWidth:n,a=r?t.offsetHeight:i,s=Mr(n)!==o||Mr(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function Re(t){return t instanceof Element||t instanceof he(t).Element}function sa(t){return Re(t)?t:t.contextElement}function Hn(t){const e=sa(t);if(!be(e))return Xe(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=Hc(e);let a=(o?Mr(n.width):n.width)/i,s=(o?Mr(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const B0=Xe(0);function Qc(t){const e=he(t);return oa()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:B0}function yn(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),o=sa(t);let a=Xe(1);e&&(i?Re(i)&&(a=Hn(i)):a=Hn(t));const s=function(c,f,d){return f===void 0&&(f=!1),!(!d||f&&d!==he(c))&&f}(o,n,i)?Qc(o):Xe(0);let u=(r.left+s.x)/a.x,l=(r.top+s.y)/a.y,g=r.width/a.x,M=r.height/a.y;if(o){const c=he(o),f=i&&Re(i)?he(i):i;let d=c.frameElement;for(;d&&i&&f!==c;){const h=Hn(d),y=d.getBoundingClientRect(),p=getComputedStyle(d),w=y.left+(d.clientLeft+parseFloat(p.paddingLeft))*h.x,m=y.top+(d.clientTop+parseFloat(p.paddingTop))*h.y;u*=h.x,l*=h.y,g*=h.x,M*=h.y,u+=w,l+=m,d=he(d).frameElement}}return gr({width:g,height:M,x:u,y:l})}function pr(t){return Re(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Fe(t){var e;return(e=(Fc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gc(t){return yn(Fe(t)).left+pr(t).scrollLeft}function Qn(t){if(qe(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bc(t)&&t.host||Fe(t);return Bc(e)?e.host:e}function Kc(t){const e=Qn(t);return fr(e)?t.ownerDocument?t.ownerDocument.body:t.body:be(e)&&Ni(e)?e:Kc(e)}function mr(t,e){var n;e===void 0&&(e=[]);const i=Kc(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),o=he(i);return r?e.concat(o,o.visualViewport||[],Ni(i)?i:[]):e.concat(i,mr(i))}function $c(t,e,n){let i;if(e==="viewport")i=function(r,o){const a=he(r),s=Fe(r),u=a.visualViewport;let l=s.clientWidth,g=s.clientHeight,M=0,c=0;if(u){l=u.width,g=u.height;const f=oa();(!f||f&&o==="fixed")&&(M=u.offsetLeft,c=u.offsetTop)}return{width:l,height:g,x:M,y:c}}(t,n);else if(e==="document")i=function(r){const o=Fe(r),a=pr(r),s=r.ownerDocument.body,u=Bn(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),l=Bn(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let g=-a.scrollLeft+Gc(r);const M=-a.scrollTop;return Oe(s).direction==="rtl"&&(g+=Bn(o.clientWidth,s.clientWidth)-u),{width:u,height:l,x:g,y:M}}(Fe(t));else if(Re(e))i=function(r,o){const a=yn(r,!0,o==="fixed"),s=a.top+r.clientTop,u=a.left+r.clientLeft,l=be(r)?Hn(r):Xe(1);return{width:r.clientWidth*l.x,height:r.clientHeight*l.y,x:u*l.x,y:s*l.y}}(e,n);else{const r=Qc(t);i={...e,x:e.x-r.x,y:e.y-r.y}}return gr(i)}function Vc(t,e){const n=Qn(t);return!(n===e||!Re(n)||fr(n))&&(Oe(n).position==="fixed"||Vc(n,e))}function H0(t,e,n){const i=be(e),r=Fe(e),o=n==="fixed",a=yn(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const u=Xe(0);if(i||!i&&!o)if((qe(e)!=="body"||Ni(r))&&(s=pr(e)),be(e)){const l=yn(e,!0,o,e);u.x=l.x+e.clientLeft,u.y=l.y+e.clientTop}else r&&(u.x=Gc(r));return{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function Wc(t,e){return be(t)&&Oe(t).position!=="fixed"?e?e(t):t.offsetParent:null}function Zc(t,e){const n=he(t);if(!be(t))return n;let i=Wc(t,e);for(;i&&F0(i)&&Oe(i).position==="static";)i=Wc(i,e);return i&&(qe(i)==="html"||qe(i)==="body"&&Oe(i).position==="static"&&!ra(i))?n:i||function(r){let o=Qn(r);for(;be(o)&&!fr(o);){if(ra(o))return o;o=Qn(o)}return null}(t)||n}const qc={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:i}=t;const r=be(n),o=Fe(n);if(n===o)return e;let a={scrollLeft:0,scrollTop:0},s=Xe(1);const u=Xe(0);if((r||!r&&i!=="fixed")&&((qe(n)!=="body"||Ni(o))&&(a=pr(n)),be(n))){const l=yn(n);s=Hn(n),u.x=l.x+n.clientLeft,u.y=l.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+u.x,y:e.y*s.y-a.scrollTop*s.y+u.y}},getDocumentElement:Fe,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?function(u,l){const g=l.get(u);if(g)return g;let M=mr(u).filter(h=>Re(h)&&qe(h)!=="body"),c=null;const f=Oe(u).position==="fixed";let d=f?Qn(u):u;for(;Re(d)&&!fr(d);){const h=Oe(d),y=ra(d);y||h.position!=="fixed"||(c=null),(f?!y&&!c:!y&&h.position==="static"&&c&&["absolute","fixed"].includes(c.position)||Ni(d)&&!y&&Vc(u,d))?M=M.filter(p=>p!==d):c=h,d=Qn(d)}return l.set(u,M),M}(e,this._c):[].concat(n),i],a=o[0],s=o.reduce((u,l)=>{const g=$c(e,l,r);return u.top=Bn(g.top,u.top),u.right=aa(g.right,u.right),u.bottom=aa(g.bottom,u.bottom),u.left=Bn(g.left,u.left),u},$c(e,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Zc,getElementRects:async function(t){let{reference:e,floating:n,strategy:i}=t;const r=this.getOffsetParent||Zc,o=this.getDimensions;return{reference:H0(e,await r(n),i),floating:{x:0,y:0,...await o(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Hc(t)},getScale:Hn,isElement:Re,isRTL:function(t){return getComputedStyle(t).direction==="rtl"}};function Q0(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,l=sa(t),g=r||o?[...l?mr(l):[],...mr(e)]:[];g.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const M=l&&s?function(y,p){let w,m=null;const N=Fe(y);function j(){clearTimeout(w),m&&m.disconnect(),m=null}return function b(S,v){S===void 0&&(S=!1),v===void 0&&(v=1),j();const{left:F,top:Y,width:U,height:C}=y.getBoundingClientRect();if(S||p(),!U||!C)return;const I={rootMargin:-yr(Y)+"px "+-yr(N.clientWidth-(F+U))+"px "+-yr(N.clientHeight-(Y+C))+"px "+-yr(F)+"px",threshold:Bn(0,aa(1,v))||1};let x=!0;function k(D){const P=D[0].intersectionRatio;if(P!==v){if(!x)return b();P?b(!1,P):w=setTimeout(()=>{b(!1,1e-7)},100)}x=!1}try{m=new IntersectionObserver(k,{...I,root:N.ownerDocument})}catch{m=new IntersectionObserver(k,I)}m.observe(y)}(!0),j}(l,n):null;let c,f=-1,d=null;a&&(d=new ResizeObserver(y=>{let[p]=y;p&&p.target===l&&d&&(d.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{d&&d.observe(e)})),n()}),l&&!u&&d.observe(l),d.observe(e));let h=u?yn(t):null;return u&&function y(){const p=yn(t);!h||p.x===h.x&&p.y===h.y&&p.width===h.width&&p.height===h.height||n(),h=p,c=requestAnimationFrame(y)}(),n(),()=>{g.forEach(y=>{r&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),M&&M(),d&&d.disconnect(),d=null,u&&cancelAnimationFrame(c)}}const G0=(t,e,n)=>{const i=new Map,r={platform:qc,...n},o={...r.platform,_c:i};return I0(t,e,{...r,platform:o})};function Xc(t){const{x:e=0,y:n=0,width:i=0,height:r=0}=t??{};if(typeof DOMRect=="function")return new DOMRect(e,n,i,r);const o={x:e,y:n,width:i,height:r,top:n,right:e+i,bottom:n+r,left:e};return{...o,toJSON:()=>o}}function K0(t,e){return{contextElement:t,getBoundingClientRect:()=>{const n=e(t);return n?Xc(n):t?t.getBoundingClientRect():Xc()}}}function $0(t){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(t)}const V0={top:"bottom",right:"left",bottom:"top",left:"right"};function W0(t,e){const[n,i]=t.split("-"),r=V0[n];return i?n==="left"||n==="right"?`${r} ${i==="start"?"top":"bottom"}`:i==="start"?`${r} ${e==="rtl"?"right":"left"}`:`${r} ${e==="rtl"?"left":"right"}`:`${r} center`}function Jc(t){t=Ot({getAnchorRect:M=>M?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},t);const[e,n]=W(),[i,r]=W(),[o,a]=W(t.placement),s=()=>K0(t.anchorRef(),t.getAnchorRect),{direction:u}=ir();async function l(){const M=s(),c=e(),f=i();if(!M||!c)return;const d=(f?.clientHeight||0)/2,h=typeof t.gutter=="number"?t.gutter+d:t.gutter??d;c.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),M.getBoundingClientRect();const y=[Y0(({placement:j})=>{const b=!!j.split("-")[1];return{mainAxis:h,crossAxis:b?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const j=typeof t.flip=="string"?t.flip.split(" "):void 0;if(j!==void 0&&!j.every($0))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(k0({padding:t.overflowPadding,fallbackPlacements:j}))}(t.slide||t.overlap)&&y.push(_0({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),y.push(R0({padding:t.overflowPadding,apply({availableWidth:j,availableHeight:b,rects:S}){const v=Math.round(S.reference.width);j=Math.floor(j),b=Math.floor(b),c.style.setProperty("--kb-popper-anchor-width",`${v}px`),c.style.setProperty("--kb-popper-content-available-width",`${j}px`),c.style.setProperty("--kb-popper-content-available-height",`${b}px`),t.sameWidth&&(c.style.width=`${v}px`),t.fitViewport&&(c.style.maxWidth=`${j}px`,c.style.maxHeight=`${b}px`)}})),t.hideWhenDetached&&y.push(U0({padding:t.detachedPadding})),f&&y.push(x0({element:f,padding:t.arrowPadding}));const p=await G0(M,c,{placement:t.placement,strategy:"absolute",middleware:y,platform:{...qc,isRTL:()=>u()==="rtl"}});if(a(p.placement),t.onCurrentPlacementChange?.(p.placement),!c)return;c.style.setProperty("--kb-popper-content-transform-origin",W0(p.placement,u()));const w=Math.round(p.x),m=Math.round(p.y);let N;if(t.hideWhenDetached&&(N=p.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(c.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${m}px, 0)`,visibility:N}),f&&p.middlewareData.arrow){const{x:j,y:b}=p.middlewareData.arrow,S=p.placement.split("-")[0];Object.assign(f.style,{left:j!=null?`${j}px`:"",top:b!=null?`${b}px`:"",[S]:"100%"})}}nt(()=>{const M=s(),c=e();if(!M||!c)return;const f=Q0(M,c,l,{elementResize:typeof ResizeObserver=="function"});st(f)}),nt(()=>{const M=e(),c=t.contentRef();!M||!c||queueMicrotask(()=>{M.style.zIndex=getComputedStyle(c).zIndex})});const g={currentPlacement:o,contentRef:()=>t.contentRef(),setPositionerRef:n,setArrowRef:r};return T(Oc.Provider,{value:g,get children(){return t.children}})}const tl=se();function Z0(){const t=ue(tl);if(t===void 0)throw new Error("[kobalte]: `useListboxContext` must be used within a `Listbox` component");return t}const el=se();function nl(){const t=ue(el);if(t===void 0)throw new Error("[kobalte]: `useListboxItemContext` must be used within a `Listbox.Item` component");return t}function q0(t){let e;const n=Z0(),i=`${n.generateId("item")}-${Dn()}`;t=Ot({id:i},t);const[r,o]=St(t,["ref","item","aria-label","aria-labelledby","aria-describedby","onPointerMove","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,s]=W(),[u,l]=W(),g=()=>n.listState().selectionManager(),M=()=>g().focusedKey()===r.item.key,c=p0({key:()=>r.item.key,selectionManager:g,shouldSelectOnPressUp:n.shouldSelectOnPressUp,allowsDifferentPressOrigin:()=>n.shouldSelectOnPressUp()&&n.shouldFocusOnHover(),shouldUseVirtualFocus:n.shouldUseVirtualFocus,disabled:()=>r.item.disabled},()=>e),f=()=>{if(g().selectionMode()!=="none")return c.isSelected()},d=V(()=>!(gi()&&mf())),h=()=>d()?r["aria-label"]:void 0,y=()=>d()?a():void 0,p=()=>d()?u():void 0,w=()=>{if(!n.isVirtualized())return;const S=n.listState().collection().getItem(r.item.key)?.index;return S!=null?S+1:void 0},m=()=>{if(n.isVirtualized())return Uf(n.listState().collection())},N=S=>{Pt(S,r.onPointerMove),S.pointerType==="mouse"&&!c.isDisabled()&&n.shouldFocusOnHover()&&(Kt(S.currentTarget),g().setFocused(!0),g().setFocusedKey(r.item.key))},j=V(()=>({"data-disabled":c.isDisabled()?"":void 0,"data-selected":c.isSelected()?"":void 0,"data-highlighted":M()?"":void 0})),b={isSelected:c.isSelected,dataset:j,generateId:kn(()=>o.id),registerLabelId:ge(s),registerDescriptionId:ge(l)};return T(el.Provider,{value:b,get children(){return T(ee,ht({as:"li",ref(S){const v=ce(F=>e=F,r.ref);typeof v=="function"&&v(S)},role:"option",get tabIndex(){return c.tabIndex()},get"aria-disabled"(){return c.isDisabled()},get"aria-selected"(){return f()},get"aria-label"(){return h()},get"aria-labelledby"(){return y()},get"aria-describedby"(){return p()},get"aria-posinset"(){return w()},get"aria-setsize"(){return m()},get"data-key"(){return c.dataKey()},get onPointerDown(){return we([r.onPointerDown,c.onPointerDown])},get onPointerUp(){return we([r.onPointerUp,c.onPointerUp])},get onClick(){return we([r.onClick,c.onClick])},get onKeyDown(){return we([r.onKeyDown,c.onKeyDown])},get onMouseDown(){return we([r.onMouseDown,c.onMouseDown])},get onFocus(){return we([r.onFocus,c.onFocus])},onPointerMove:N},j,o))}})}function X0(t){const e=nl();t=Ot({id:e.generateId("indicator")},t);const[n,i]=St(t,["forceMount"]);return T(kt,{get when(){return n.forceMount||e.isSelected()},get children(){return T(ee,ht({as:"div","aria-hidden":"true"},()=>e.dataset(),i))}})}function J0(t){const e=nl();t=Ot({id:e.generateId("label")},t);const[n,i]=St(t,["id"]);return nt(()=>st(e.registerLabelId(n.id))),T(ee,ht({as:"div",get id(){return n.id}},()=>e.dataset(),i))}function ty(t){let e;const n=`listbox-${Dn()}`;t=Ot({id:n,selectionMode:"single",virtualized:!1},t);const[i,r]=St(t,["ref","children","renderItem","renderSection","value","defaultValue","onChange","options","optionValue","optionTextValue","optionDisabled","optionGroupChildren","state","keyboardDelegate","autoFocus","selectionMode","shouldFocusWrap","shouldUseVirtualFocus","shouldSelectOnPressUp","shouldFocusOnHover","allowDuplicateSelectionEvents","disallowEmptySelection","selectionBehavior","selectOnFocus","disallowTypeAhead","allowsTabNavigation","virtualized","scrollToItem","scrollRef","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),o=V(()=>i.state?i.state:vc({selectedKeys:()=>i.value,defaultSelectedKeys:()=>i.defaultValue,onSelectionChange:i.onChange,allowDuplicateSelectionEvents:()=>E(i.allowDuplicateSelectionEvents),disallowEmptySelection:()=>E(i.disallowEmptySelection),selectionBehavior:()=>E(i.selectionBehavior),selectionMode:()=>E(i.selectionMode),dataSource:()=>i.options??[],getKey:()=>i.optionValue,getTextValue:()=>i.optionTextValue,getDisabled:()=>i.optionDisabled,getSectionChildren:()=>i.optionGroupChildren})),a=N0({selectionManager:()=>o().selectionManager(),collection:()=>o().collection(),autoFocus:()=>E(i.autoFocus),shouldFocusWrap:()=>E(i.shouldFocusWrap),keyboardDelegate:()=>i.keyboardDelegate,disallowEmptySelection:()=>E(i.disallowEmptySelection),selectOnFocus:()=>E(i.selectOnFocus),disallowTypeAhead:()=>E(i.disallowTypeAhead),shouldUseVirtualFocus:()=>E(i.shouldUseVirtualFocus),allowsTabNavigation:()=>E(i.allowsTabNavigation),isVirtualized:()=>i.virtualized,scrollToKey:()=>i.scrollToItem},()=>e,()=>i.scrollRef?.()),s={listState:o,generateId:kn(()=>r.id),shouldUseVirtualFocus:()=>t.shouldUseVirtualFocus,shouldSelectOnPressUp:()=>t.shouldSelectOnPressUp,shouldFocusOnHover:()=>t.shouldFocusOnHover,isVirtualized:()=>i.virtualized};return T(tl.Provider,{value:s,get children(){return T(ee,ht({as:"ul",ref(u){const l=ce(g=>e=g,i.ref);typeof l=="function"&&l(u)},role:"listbox",get tabIndex(){return a.tabIndex()},get"aria-multiselectable"(){return o().selectionManager().selectionMode()==="multiple"?!0:void 0},get onKeyDown(){return we([i.onKeyDown,a.onKeyDown])},get onMouseDown(){return we([i.onMouseDown,a.onMouseDown])},get onFocusIn(){return we([i.onFocusIn,a.onFocusIn])},get onFocusOut(){return we([i.onFocusOut,a.onFocusOut])}},r,{get children(){return T(kt,{get when(){return!i.virtualized},get fallback(){return i.children?.(o().collection)},get children(){return T(sf,{get each(){return[...o().collection()]},by:"key",children:u=>T(co,{get children(){return[T(Pe,{get when(){return u().type==="section"},get children(){return i.renderSection?.(u())}}),T(Pe,{get when(){return u().type==="item"},get children(){return i.renderItem?.(u())}})]}})})}})}}))}})}const il=se();function Gn(){const t=ue(il);if(t===void 0)throw new Error("[kobalte]: `useSelectContext` must be used within a `Select` component");return t}function ey(t){let e;const n=Gn(),[i,r]=St(t,["ref","id","style","onCloseAutoFocus","onFocusOutside"]),o=s=>{n.close()},a=s=>{i.onFocusOutside?.(s),n.isOpen()&&n.isModal()&&s.preventDefault()};return Fu({isDisabled:()=>!(n.isOpen()&&n.isModal()),targets:()=>e?[e]:[]}),Gu({ownerRef:()=>e,isDisabled:()=>!(n.isOpen()&&(n.isModal()||n.preventScroll()))}),Ru({trapFocus:()=>n.isOpen()&&n.isModal(),onMountAutoFocus:s=>{s.preventDefault()},onUnmountAutoFocus:s=>{i.onCloseAutoFocus?.(s),s.defaultPrevented||(Kt(n.triggerRef()),s.preventDefault())}},()=>e),T(kt,{get when(){return n.contentPresence.isPresent()},get children(){return T(kc,{get children(){return T(Xo,ht({ref(s){const u=ce(l=>{n.setContentRef(l),n.contentPresence.setRef(l),e=l},i.ref);typeof u=="function"&&u(s)},get disableOutsidePointerEvents(){return V(()=>!!n.isModal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get style(){return{"--kb-select-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...i.style}},onEscapeKeyDown:o,onFocusOutside:a,get onDismiss(){return n.close}},()=>n.dataset(),r))}})}})}function ny(t){const e=Gn();return t=Ot({children:"▼"},t),T(ee,ht({as:"span","aria-hidden":"true"},()=>e.dataset(),t))}function iy(t){const e=Gn();t=Ot({id:e.generateId("listbox")},t);const[n,i]=St(t,["ref","id","onKeyDown"]);return nt(()=>st(e.registerListboxId(n.id))),T(ty,ht({ref(r){const o=ce(e.setListboxRef,n.ref);typeof o=="function"&&o(r)},get id(){return n.id},get state(){return e.listState()},get virtualized(){return e.isVirtualized()},get autoFocus(){return e.autoFocus()},shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,get shouldFocusWrap(){return e.shouldFocusWrap()},get disallowTypeAhead(){return e.disallowTypeAhead()},get"aria-labelledby"(){return e.listboxAriaLabelledBy()},get renderItem(){return e.renderItem},get renderSection(){return e.renderSection},onKeyDown:r=>{Pt(r,n.onKeyDown),r.key==="Escape"&&e.isMultiple()&&r.preventDefault()}},i))}function ry(t){const e=Gn();return T(kt,{get when(){return e.contentPresence.isPresent()},get children(){return T(go,t)}})}function oy(t){const e=`select-${Dn()}`;t=Ot({id:e,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,gutter:8,sameWidth:!0,modal:!1,preventScroll:!1},t);const[n,i,r,o]=St(t,["itemComponent","sectionComponent","open","defaultOpen","onOpenChange","value","defaultValue","onChange","placeholder","options","optionValue","optionTextValue","optionDisabled","optionGroupChildren","keyboardDelegate","allowDuplicateSelectionEvents","disallowEmptySelection","disallowTypeAhead","shouldFocusWrap","selectionBehavior","selectionMode","virtualized","modal","preventScroll","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"],iM),[a,s]=W(),[u,l]=W(),[g,M]=W(),[c,f]=W(),[d,h]=W(),[y,p]=W(),[w,m]=W(),[N,j]=W(!0),b=B=>{const ct=n.optionValue;return ct==null?String(B):String(Xi(ct)?ct(B):B[ct])},S=V(()=>{const B=n.optionGroupChildren;return B==null?n.options:Xi(B)?n.options.flatMap(ct=>B(ct)??ct):n.options.flatMap(ct=>ct[B]??ct)}),v=V(()=>S().map(B=>b(B))),F=B=>[...B].map(ct=>S().find(Nt=>b(Nt)===ct)).filter(ct=>ct!=null),Y=Ao({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:B=>n.onOpenChange?.(B)}),U=vc({selectedKeys:()=>n.value&&n.value.map(b),defaultSelectedKeys:()=>n.defaultValue&&n.defaultValue.map(b),onSelectionChange:B=>{n.onChange?.(F(B)),n.selectionMode==="single"&&P()},allowDuplicateSelectionEvents:()=>E(n.allowDuplicateSelectionEvents),disallowEmptySelection:()=>E(n.disallowEmptySelection),selectionBehavior:()=>E(n.selectionBehavior),selectionMode:()=>n.selectionMode,dataSource:()=>n.options??[],getKey:()=>n.optionValue,getTextValue:()=>n.optionTextValue,getDisabled:()=>n.optionDisabled,getSectionChildren:()=>n.optionGroupChildren}),C=V(()=>F(U.selectionManager().selectedKeys())),I=B=>{U.selectionManager().toggleSelection(b(B))},x=er(()=>n.forceMount||Y.isOpen()),k=()=>{const B=y();B&&Kt(B)},D=B=>{if(n.options.length<=0)return;j(B),Y.open();let ct=U.selectionManager().firstSelectedKey();ct==null&&(B==="first"?ct=U.collection().getFirstKey():B==="last"&&(ct=U.collection().getLastKey())),k(),U.selectionManager().setFocused(!0),U.selectionManager().setFocusedKey(ct)},P=()=>{Y.close(),U.selectionManager().setFocused(!1),U.selectionManager().setFocusedKey(void 0)},R=B=>{Y.isOpen()?P():D(B)},{formControlContext:H}=rM(r);$f(c,()=>{const B=n.defaultValue?[...n.defaultValue].map(b):new Te;U.selectionManager().setSelectedKeys(B)});const Z=Xu({usage:"search",sensitivity:"base"}),tt=V(()=>E(n.keyboardDelegate)||new Dc(U.collection,void 0,Z)),at=B=>n.itemComponent?.({item:B}),bt=B=>n.sectionComponent?.({section:B});nt(Se([v],([B])=>{const ct=[...U.selectionManager().selectedKeys()].filter(Nt=>B.includes(Nt));U.selectionManager().setSelectedKeys(ct)},{defer:!0}));const Ft=V(()=>({"data-expanded":Y.isOpen()?"":void 0,"data-closed":Y.isOpen()?void 0:""})),Lt={dataset:Ft,isOpen:Y.isOpen,isDisabled:()=>H.isDisabled()??!1,isMultiple:()=>E(n.selectionMode)==="multiple",isVirtualized:()=>n.virtualized??!1,isModal:()=>n.modal??!1,preventScroll:()=>n.preventScroll??!1,disallowTypeAhead:()=>n.disallowTypeAhead??!1,shouldFocusWrap:()=>n.shouldFocusWrap??!1,selectedOptions:C,contentPresence:x,autoFocus:N,triggerRef:c,listState:()=>U,keyboardDelegate:tt,triggerId:a,valueId:u,listboxId:g,listboxAriaLabelledBy:w,setListboxAriaLabelledBy:m,setTriggerRef:f,setContentRef:h,setListboxRef:p,open:D,close:P,toggle:R,placeholder:()=>n.placeholder,renderItem:at,renderSection:bt,removeOptionFromSelection:I,generateId:kn(()=>E(r.id)),registerTriggerId:ge(s),registerValueId:ge(l),registerListboxId:ge(M)};return T($u.Provider,{value:H,get children(){return T(il.Provider,{value:Lt,get children(){return T(Jc,ht({anchorRef:c,contentRef:d},i,{get children(){return T(ee,ht({as:"div",role:"group",get id(){return E(r.id)}},()=>H.dataset(),Ft,o))}}))}})}})}function ay(t){const[e,n]=St(t,["value","defaultValue","onChange","multiple"]),i=V(()=>{if(e.value!=null)return e.multiple?e.value:[e.value]}),r=V(()=>{if(e.defaultValue!=null)return e.multiple?e.defaultValue:[e.defaultValue]});return T(oy,ht({get value(){return i()},get defaultValue(){return r()},onChange:o=>{e.onChange?.(e.multiple?o:o[0])},get selectionMode(){return e.multiple?"multiple":"single"},get disallowEmptySelection(){return!e.multiple}},n))}function sy(t){const e=Co(),n=Gn();t=Ot({id:n.generateId("trigger")},t);const[i,r,o]=St(t,["ref","disabled","onPointerDown","onClick","onKeyDown","onFocus","onBlur"],oM),a=()=>n.listState().selectionManager(),s=()=>n.keyboardDelegate(),u=()=>i.disabled||n.isDisabled(),{fieldProps:l}=aM(r),{typeSelectHandlers:g}=bc({keyboardDelegate:s,selectionManager:a,onTypeSelect:p=>a().select(p)}),M=()=>[n.listboxAriaLabelledBy(),n.valueId()].filter(Boolean).join(" ")||void 0,c=p=>{Pt(p,i.onPointerDown),p.currentTarget.dataset.pointerType=p.pointerType,!u()&&p.pointerType!=="touch"&&p.button===0&&(p.preventDefault(),n.toggle(!0))},f=p=>{Pt(p,i.onClick),!u()&&p.currentTarget.dataset.pointerType==="touch"&&n.toggle(!0)},d=p=>{if(Pt(p,i.onKeyDown),!u())switch(Pt(p,g.onKeyDown),p.key){case"Enter":case" ":case"ArrowDown":p.stopPropagation(),p.preventDefault(),n.toggle("first");break;case"ArrowUp":p.stopPropagation(),p.preventDefault(),n.toggle("last");break;case"ArrowLeft":{if(p.preventDefault(),n.isMultiple())return;const w=a().firstSelectedKey(),m=w!=null?s().getKeyAbove?.(w):s().getFirstKey?.();m!=null&&a().select(m);break}case"ArrowRight":{if(p.preventDefault(),n.isMultiple())return;const w=a().firstSelectedKey(),m=w!=null?s().getKeyBelow?.(w):s().getFirstKey?.();m!=null&&a().select(m);break}}},h=p=>{Pt(p,i.onFocus),!a().isFocused()&&a().setFocused(!0)},y=p=>{Pt(p,i.onBlur),!n.isOpen()&&a().setFocused(!1)};return nt(()=>st(n.registerTriggerId(l.id()))),nt(()=>{n.setListboxAriaLabelledBy([l.ariaLabelledBy(),l.ariaLabel()&&!l.ariaLabelledBy()?l.id():null].filter(Boolean).join(" ")||void 0)}),T(ur,ht({ref(p){const w=ce(n.setTriggerRef,i.ref);typeof w=="function"&&w(p)},get id(){return l.id()},get disabled(){return u()},"aria-haspopup":"listbox",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return V(()=>!!n.isOpen())()?n.listboxId():void 0},get"aria-label"(){return l.ariaLabel()},get"aria-labelledby"(){return M()},get"aria-describedby"(){return l.ariaDescribedBy()},onPointerDown:c,onClick:f,onKeyDown:d,onFocus:h,onBlur:y},()=>n.dataset(),()=>e.dataset(),o))}const uy=wt("<span>");function cy(t){const e=Co(),n=Gn();t=Ot({id:n.generateId("value")},t);const[i,r]=St(t,["id","children"]),o=()=>n.listState().selectionManager(),a=()=>{const s=o().selectedKeys();return s.size===1&&s.has("")?!0:o().isEmpty()};return nt(()=>st(n.registerValueId(i.id))),(()=>{const s=uy();return te(s,ht({get id(){return i.id},get"data-placeholder-shown"(){return a()?"":void 0}},()=>e.dataset(),r),!1,!0),it(s,T(kt,{get when(){return!a()},get fallback(){return n.placeholder()},get children(){return T(ly,{state:{selectedOption:()=>n.selectedOptions()[0],selectedOptions:()=>n.selectedOptions(),remove:u=>n.removeOptionFromSelection(u),clear:()=>o().clearSelection()},get children(){return i.children}})}})),s})()}function ly(t){const e=Gi(()=>{const n=t.children;return Xi(n)?n(t.state):n});return V(e)}const rl=se();function ua(){const t=ue(rl);if(t===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return t}function dy(t){const e=ua();t=Ot({id:e.generateId("content")},t);const[n,i]=St(t,["ref","style"]);return nt(()=>st(e.registerContentId(i.id))),T(kt,{get when(){return e.contentPresence.isPresent()},get children(){return T(kc,{get children(){return T(Xo,ht({ref(r){const o=ce(a=>{e.setContentRef(a),e.contentPresence.setRef(a)},n.ref);typeof o=="function"&&o(r)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return{"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative",...n.style}},onFocusOutside:r=>r.preventDefault(),onDismiss:()=>e.hideTooltip(!0)},()=>e.dataset(),i))}})}})}function gy(t){const e=ua();return T(kt,{get when(){return e.contentPresence.isPresent()},get children(){return T(go,t)}})}/*!
|
|
216
|
+
* Portions of this file are based on code from ariakit.
|
|
217
|
+
* MIT Licensed, Copyright (c) Diego Haz.
|
|
218
|
+
*
|
|
219
|
+
* Credits to the Ariakit team:
|
|
220
|
+
* https://github.com/ariakit/ariakit/blob/84e97943ad637a582c01c9b56d880cd95f595737/packages/ariakit/src/hovercard/__utils/polygon.ts
|
|
221
|
+
* https://github.com/ariakit/ariakit/blob/f2a96973de523d67e41eec983263936c489ef3e2/packages/ariakit/src/hovercard/__utils/debug-polygon.ts
|
|
222
|
+
*/function hy(t,e,n){const i=t.split("-")[0],r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),a=[],s=r.left+r.width/2,u=r.top+r.height/2;switch(i){case"top":a.push([r.left,u]),a.push([o.left,o.bottom]),a.push([o.left,o.top]),a.push([o.right,o.top]),a.push([o.right,o.bottom]),a.push([r.right,u]);break;case"right":a.push([s,r.top]),a.push([o.left,o.top]),a.push([o.right,o.top]),a.push([o.right,o.bottom]),a.push([o.left,o.bottom]),a.push([s,r.bottom]);break;case"bottom":a.push([r.left,u]),a.push([o.left,o.top]),a.push([o.left,o.bottom]),a.push([o.right,o.bottom]),a.push([o.right,o.top]),a.push([r.right,u]);break;case"left":a.push([s,r.top]),a.push([o.right,o.top]),a.push([o.left,o.top]),a.push([o.left,o.bottom]),a.push([o.right,o.bottom]),a.push([s,r.bottom]);break}return a}const pn={};let fy=0,Kn=!1,Be,wi;function My(t){const e=`tooltip-${Dn()}`,n=`${++fy}`;t=Ot({id:e,openDelay:700,closeDelay:300},t);const[i,r]=St(t,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let o;const[a,s]=W(),[u,l]=W(),[g,M]=W(),[c,f]=W(r.placement),d=Ao({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:C=>i.onOpenChange?.(C)}),h=er(()=>i.forceMount||d.isOpen()),y=()=>{pn[n]=w},p=()=>{for(const C in pn)C!==n&&(pn[C](!0),delete pn[C])},w=(C=!1)=>{C||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,d.close()):o||(o=window.setTimeout(()=>{o=void 0,d.close()},i.closeDelay)),window.clearTimeout(Be),Be=void 0,Kn&&(window.clearTimeout(wi),wi=window.setTimeout(()=>{delete pn[n],wi=void 0,Kn=!1},i.closeDelay))},m=()=>{clearTimeout(o),o=void 0,p(),y(),Kn=!0,d.open(),window.clearTimeout(Be),Be=void 0,window.clearTimeout(wi),wi=void 0},N=()=>{p(),y(),!d.isOpen()&&!Be&&!Kn?Be=window.setTimeout(()=>{Be=void 0,Kn=!0,m()},i.openDelay):d.isOpen()||m()},j=(C=!1)=>{!C&&i.openDelay&&i.openDelay>0&&!o?N():m()},b=()=>{window.clearTimeout(Be),Be=void 0,Kn=!1},S=()=>{window.clearTimeout(o),o=void 0},v=C=>Ne(u(),C)||Ne(g(),C),F=C=>{const I=u(),x=g();if(!(!I||!x))return hy(C,I,x)},Y=C=>{const I=C.target;if(v(I)){S();return}if(!i.ignoreSafeArea){const x=F(c());if(x&&Cf(Of(C),x)){S();return}}o||w()};nt(()=>{if(!d.isOpen())return;const C=le();C.addEventListener("pointermove",Y,!0),st(()=>{C.removeEventListener("pointermove",Y,!0)})}),nt(()=>{const C=u();if(!C||!d.isOpen())return;const I=k=>{const D=k.target;Ne(D,C)&&w(!0)},x=To();x.addEventListener("scroll",I,{capture:!0}),st(()=>{x.removeEventListener("scroll",I,{capture:!0})})}),st(()=>{clearTimeout(o),pn[n]&&delete pn[n]});const U={dataset:V(()=>({"data-expanded":d.isOpen()?"":void 0,"data-closed":d.isOpen()?void 0:""})),isOpen:d.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:a,contentPresence:h,openTooltip:j,hideTooltip:w,cancelOpening:b,generateId:kn(()=>t.id),registerContentId:ge(s),isTargetOnTooltip:v,setTriggerRef:l,setContentRef:M};return T(rl.Provider,{value:U,get children(){return T(Jc,ht({anchorRef:u,contentRef:g,onCurrentPlacementChange:f},r))}})}function yy(t){let e;const n=ua(),[i,r]=St(t,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur","onTouchStart"]);let o=!1,a=!1,s=!1;const u=()=>{o=!1},l=()=>{!n.isOpen()&&(a||s)&&n.openTooltip(s)},g=p=>{n.isOpen()&&!a&&!s&&n.hideTooltip(p)},M=p=>{Pt(p,i.onPointerEnter),!(p.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||p.defaultPrevented)&&(a=!0,l())},c=p=>{Pt(p,i.onPointerLeave),p.pointerType!=="touch"&&(a=!1,s=!1,n.isOpen()?g():n.cancelOpening())},f=p=>{Pt(p,i.onPointerDown),o=!0,le(e).addEventListener("pointerup",u,{once:!0})},d=p=>{Pt(p,i.onClick),a=!1,s=!1,g(!0)},h=p=>{Pt(p,i.onFocus),!(n.isDisabled()||p.defaultPrevented||o)&&(s=!0,l())},y=p=>{Pt(p,i.onBlur);const w=p.relatedTarget;n.isTargetOnTooltip(w)||(a=!1,s=!1,g(!0))};return st(()=>{le(e).removeEventListener("pointerup",u)}),T(ee,ht({as:"button",ref(p){const w=ce(m=>{n.setTriggerRef(m),e=m},i.ref);typeof w=="function"&&w(p)},get"aria-describedby"(){return V(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:M,onPointerLeave:c,onPointerDown:f,onClick:d,onFocus:h,onBlur:y},()=>n.dataset(),r))}/**
|
|
223
|
+
* @license
|
|
224
|
+
* Copyright 2019 Google LLC
|
|
225
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
226
|
+
*/const ol=Symbol("Comlink.proxy"),py=Symbol("Comlink.endpoint"),my=Symbol("Comlink.releaseProxy"),ca=Symbol("Comlink.finalizer"),Nr=Symbol("Comlink.thrown"),al=t=>typeof t=="object"&&t!==null||typeof t=="function",Ny={canHandle:t=>al(t)&&t[ol],serialize(t){const{port1:e,port2:n}=new MessageChannel;return ul(t,e),[n,[n]]},deserialize(t){return t.start(),ll(t)}},wy={canHandle:t=>al(t)&&Nr in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},sl=new Map([["proxy",Ny],["throw",wy]]);function Ly(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function ul(t,e=globalThis,n=["*"]){e.addEventListener("message",function i(r){if(!r||!r.data)return;if(!Ly(n,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}const{id:o,type:a,path:s}=Object.assign({path:[]},r.data),u=(r.data.argumentList||[]).map(mn);let l;try{const g=s.slice(0,-1).reduce((c,f)=>c[f],t),M=s.reduce((c,f)=>c[f],t);switch(a){case"GET":l=M;break;case"SET":g[s.slice(-1)[0]]=mn(r.data.value),l=!0;break;case"APPLY":l=M.apply(g,u);break;case"CONSTRUCT":{const c=new M(...u);l=by(c)}break;case"ENDPOINT":{const{port1:c,port2:f}=new MessageChannel;ul(t,f),l=fl(c,[c])}break;case"RELEASE":l=void 0;break;default:return}}catch(g){l={value:g,[Nr]:0}}Promise.resolve(l).catch(g=>({value:g,[Nr]:0})).then(g=>{const[M,c]=jr(g);e.postMessage(Object.assign(Object.assign({},M),{id:o}),c),a==="RELEASE"&&(e.removeEventListener("message",i),cl(e),ca in t&&typeof t[ca]=="function"&&t[ca]())}).catch(g=>{const[M,c]=jr({value:new TypeError("Unserializable return value"),[Nr]:0});e.postMessage(Object.assign(Object.assign({},M),{id:o}),c)})}),e.start&&e.start()}function Ty(t){return t.constructor.name==="MessagePort"}function cl(t){Ty(t)&&t.close()}function ll(t,e){return la(t,[],e)}function wr(t){if(t)throw new Error("Proxy has been released and is not useable")}function dl(t){return $n(t,{type:"RELEASE"}).then(()=>{cl(t)})}const Lr=new WeakMap,Tr="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(Lr.get(t)||0)-1;Lr.set(t,e),e===0&&dl(t)});function jy(t,e){const n=(Lr.get(e)||0)+1;Lr.set(e,n),Tr&&Tr.register(t,e,t)}function Ey(t){Tr&&Tr.unregister(t)}function la(t,e=[],n=function(){}){let i=!1;const r=new Proxy(n,{get(o,a){if(wr(i),a===my)return()=>{Ey(r),dl(t),i=!0};if(a==="then"){if(e.length===0)return{then:()=>r};const s=$n(t,{type:"GET",path:e.map(u=>u.toString())}).then(mn);return s.then.bind(s)}return la(t,[...e,a])},set(o,a,s){wr(i);const[u,l]=jr(s);return $n(t,{type:"SET",path:[...e,a].map(g=>g.toString()),value:u},l).then(mn)},apply(o,a,s){wr(i);const u=e[e.length-1];if(u===py)return $n(t,{type:"ENDPOINT"}).then(mn);if(u==="bind")return la(t,e.slice(0,-1));const[l,g]=gl(s);return $n(t,{type:"APPLY",path:e.map(M=>M.toString()),argumentList:l},g).then(mn)},construct(o,a){wr(i);const[s,u]=gl(a);return $n(t,{type:"CONSTRUCT",path:e.map(l=>l.toString()),argumentList:s},u).then(mn)}});return jy(r,t),r}function Sy(t){return Array.prototype.concat.apply([],t)}function gl(t){const e=t.map(jr);return[e.map(n=>n[0]),Sy(e.map(n=>n[1]))]}const hl=new WeakMap;function fl(t,e){return hl.set(t,e),t}function by(t){return Object.assign(t,{[ol]:!0})}function jr(t){for(const[e,n]of sl)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},hl.get(t)||[]]}function mn(t){switch(t.type){case"HANDLER":return sl.get(t.name).deserialize(t.value);case"RAW":return t.value}}function $n(t,e,n){return new Promise(i=>{const r=Ay();t.addEventListener("message",function o(a){!a.data||!a.data.id||a.data.id!==r||(t.removeEventListener("message",o),i(a.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:r},e),n)})}function Ay(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Ml=(t=>(t[t.Invalid=0]="Invalid",t[t.RequiresServerPermission=1]="RequiresServerPermission",t[t.Valid=2]="Valid",t))(Ml||{}),yl=(t=>(t[t.Ok=0]="Ok",t[t.NetworkError=1]="NetworkError",t[t.RemoteLock=2]="RemoteLock",t[t.PermissionExpired=3]="PermissionExpired",t[t.PayloadCorrupted=4]="PayloadCorrupted",t[t.PayloadSignatureVerificationFailed=5]="PayloadSignatureVerificationFailed",t[t.IncorrectTokenState=6]="IncorrectTokenState",t))(yl||{});(function(t){/**
|
|
227
|
+
* @license
|
|
228
|
+
* Copyright 2019 Google LLC
|
|
229
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
230
|
+
*/const e=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),o=Symbol("Comlink.thrown"),a=L=>typeof L=="object"&&L!==null||typeof L=="function",s={canHandle:L=>a(L)&&L[e],serialize(L){const{port1:A,port2:Q}=new MessageChannel;return M(L,A),[Q,[Q]]},deserialize(L){return L.start(),d(L)}},u={canHandle:L=>a(L)&&o in L,serialize({value:L}){let A;return L instanceof Error?A={isError:!0,value:{message:L.message,name:L.name,stack:L.stack}}:A={isError:!1,value:L},[A,[]]},deserialize(L){throw L.isError?Object.assign(new Error(L.value.message),L.value):L.value}},l=new Map([["proxy",s],["throw",u]]);function g(L,A){for(const Q of L)if(A===Q||Q==="*"||Q instanceof RegExp&&Q.test(A))return!0;return!1}function M(L,A=globalThis,Q=["*"]){A.addEventListener("message",function lt(rt){if(!rt||!rt.data)return;if(!g(Q,rt.origin)){console.warn(`Invalid origin '${rt.origin}' for comlink proxy`);return}const{id:At,type:q,path:ft}=Object.assign({path:[]},rt.data),jt=(rt.data.argumentList||[]).map(C);let dt;try{const Mt=ft.slice(0,-1).reduce((ot,Ct)=>ot[Ct],L),et=ft.reduce((ot,Ct)=>ot[Ct],L);switch(q){case"GET":dt=et;break;case"SET":Mt[ft.slice(-1)[0]]=C(rt.data.value),dt=!0;break;case"APPLY":dt=et.apply(Mt,jt);break;case"CONSTRUCT":{const ot=new et(...jt);dt=Y(ot)}break;case"ENDPOINT":{const{port1:ot,port2:Ct}=new MessageChannel;M(L,Ct),dt=F(ot,[ot])}break;case"RELEASE":dt=void 0;break;default:return}}catch(Mt){dt={value:Mt,[o]:0}}Promise.resolve(dt).catch(Mt=>({value:Mt,[o]:0})).then(Mt=>{const[et,ot]=U(Mt);A.postMessage(Object.assign(Object.assign({},et),{id:At}),ot),q==="RELEASE"&&(A.removeEventListener("message",lt),f(A),r in L&&typeof L[r]=="function"&&L[r]())}).catch(Mt=>{const[et,ot]=U({value:new TypeError("Unserializable return value"),[o]:0});A.postMessage(Object.assign(Object.assign({},et),{id:At}),ot)})}),A.start&&A.start()}function c(L){return L.constructor.name==="MessagePort"}function f(L){c(L)&&L.close()}function d(L,A){return j(L,[],A)}function h(L){if(L)throw new Error("Proxy has been released and is not useable")}function y(L){return I(L,{type:"RELEASE"}).then(()=>{f(L)})}const p=new WeakMap,w="FinalizationRegistry"in globalThis&&new FinalizationRegistry(L=>{const A=(p.get(L)||0)-1;p.set(L,A),A===0&&y(L)});function m(L,A){const Q=(p.get(A)||0)+1;p.set(A,Q),w&&w.register(L,A,L)}function N(L){w&&w.unregister(L)}function j(L,A=[],Q=function(){}){let lt=!1;const rt=new Proxy(Q,{get(At,q){if(h(lt),q===i)return()=>{N(rt),y(L),lt=!0};if(q==="then"){if(A.length===0)return{then:()=>rt};const ft=I(L,{type:"GET",path:A.map(jt=>jt.toString())}).then(C);return ft.then.bind(ft)}return j(L,[...A,q])},set(At,q,ft){h(lt);const[jt,dt]=U(ft);return I(L,{type:"SET",path:[...A,q].map(Mt=>Mt.toString()),value:jt},dt).then(C)},apply(At,q,ft){h(lt);const jt=A[A.length-1];if(jt===n)return I(L,{type:"ENDPOINT"}).then(C);if(jt==="bind")return j(L,A.slice(0,-1));const[dt,Mt]=S(ft);return I(L,{type:"APPLY",path:A.map(et=>et.toString()),argumentList:dt},Mt).then(C)},construct(At,q){h(lt);const[ft,jt]=S(q);return I(L,{type:"CONSTRUCT",path:A.map(dt=>dt.toString()),argumentList:ft},jt).then(C)}});return m(rt,L),rt}function b(L){return Array.prototype.concat.apply([],L)}function S(L){const A=L.map(U);return[A.map(Q=>Q[0]),b(A.map(Q=>Q[1]))]}const v=new WeakMap;function F(L,A){return v.set(L,A),L}function Y(L){return Object.assign(L,{[e]:!0})}function U(L){for(const[A,Q]of l)if(Q.canHandle(L)){const[lt,rt]=Q.serialize(L);return[{type:"HANDLER",name:A,value:lt},rt]}return[{type:"RAW",value:L},v.get(L)||[]]}function C(L){switch(L.type){case"HANDLER":return l.get(L.name).deserialize(L.value);case"RAW":return L.value}}function I(L,A,Q){return new Promise(lt=>{const rt=x();L.addEventListener("message",function At(q){!q.data||!q.data.id||q.data.id!==rt||(L.removeEventListener("message",At),lt(q.data))}),L.start&&L.start(),L.postMessage(Object.assign({id:rt},A),Q)})}function x(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const k=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),D=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])),P=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),R=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),H=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),Z=async()=>WebAssembly.validate(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])),tt=()=>(async L=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(L)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function at(){return/iOS|iPhone|iPad|iPod/i.test(navigator.userAgent)}async function bt(){if(!await tt())return!1;if(!("importScripts"in self))throw Error("Not implemented");return at()?!1:"Worker"in self}async function Ft(){const L=[D(),P(),k(),R(),H()];if(!(await Promise.all(L)).every(Boolean))throw new Error("Browser doesn't meet minimum requirements!");return await Z()?await bt()?"advanced-threads":"advanced":"basic"}let Lt,B;async function ct(){const L=await Ft();console.log(`Requesting ${L} Wasm build`);const A=new URL(`resources/${L}/capture-wasm.js`,self.location.origin);try{importScripts(A)}catch(Q){console.error("loading scripts failed",Q)}return Lt=await self.createModule({locateFile:Q=>new URL(`resources/${L}/`+Q,self.location.origin).toString(),mainScriptUrlOrBlob:A.toString(),setStatus:Q=>{}}),Lt[r]=()=>{console.log("finalizer wasmModule")},Y(Lt)}function Nt(){return Lt||console.warn("Wasm is not initialized yet. Call loadWasm() first."),B=new Lt.Analyzer,B[r]=()=>{console.log("Comlink.finalizer called on Analyzer instance. Deleting instance."),B.delete()},Y(B)}function Ee(L){const A=B.analyze(L);return self.postMessage({},[L.data.buffer]),L=null,A}const oe={createAnalyzer:Nt,loadWasm:ct,analyze:Ee,terminate:()=>self.close(),[r]:()=>{console.log("Comlink.finalizer called on proxyWorker")}};return M(oe),t.proxyWorker=oe,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t})({}),!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),n=this.getVideoPlaybackQuality(),i=this.mozPresentedFrames||this.mozPaintedFrames||n.totalVideoFrames-n.droppedVideoFrames,r=(o,a)=>{const s=this.getVideoPlaybackQuality(),u=this.mozPresentedFrames||this.mozPaintedFrames||s.totalVideoFrames-s.droppedVideoFrames;if(u>i){const l=this.mozFrameDelay||s.totalFrameDelay-n.totalFrameDelay||0,g=a-o;t(a,{presentationTime:a+l*1e3,expectedDisplayTime:a+g,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+g/1e3,presentedFrames:u,processingDuration:l}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame(l=>r(a,l))};return this._rvfcpolyfillmap[e]=requestAnimationFrame(o=>r(e,o)),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]});const pl=Element.prototype.attachShadow;function da(){return typeof window.ShadyDOM<"u"&&typeof ShadowRoot<"u"}function vy(){return typeof ShadowRoot<"u"}function Dy(t){pl==null||da()||(Element.prototype.attachShadow=function(e){const n=pl.call(this,e);return t(n),n})}function Iy(t,...e){const n=new Set(e);let i=!1;const r=()=>{for(const o of n)t(o);n.clear()};return{isRunning(){return i},schedule(o){n.add(o),i&&r()},stop(){i=!1},run(){i||(i=!0,r())}}}const xy={childList:!0,subtree:!0},Oy=t=>{typeof queueMicrotask<"u"?queueMicrotask(t):typeof Promise<"u"?Promise.resolve().then(()=>t()):setTimeout(()=>t(),0)};function ml(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null)return[...t];{const e=[];for(let n=0;n<t.length;n++)e[n]=t[n];return e}}function Cy(t,e){return da()?new Set(ml(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement,e))):new Set("querySelectorAll"in t?ml(t.querySelectorAll(e)):[])}function zy(t,e){return new Set([...t??[],...e??[]])}function ky(t){return"activeElement"in t}function Nl(t=document.documentElement){if(ky(t)&&wl(t),da()&&t instanceof ShadowRoot||!vy())return;const e=t.childNodes,n="shadowRoot"in t&&t.shadowRoot!=null?[t.shadowRoot]:[];for(const i of[...e,...n])Nl(i)}function Uy(t){return"isConnected"in Node.prototype?t.isConnected:t.ownerDocument==null||!(t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED)}const Li=new Map;function Yy(t,e){const n=new Set,i=new Set,r=new Map,o=new WeakMap;let a=!1,s=!1,u=!1;const l=()=>{s=!0;const p=[...n];p.length>0&&e(p,t),n.clear(),a=!1,s=!1},g=()=>{a||(a=!0,Oy(l))},M=p=>{n.add(p),s||g()},c=()=>{const p=[...n];return n.clear(),p},f=()=>{i.clear()},d=(p,w)=>{let m=r.get(p);const N=Cy(p,w),j=m?.get(w),b=zy(N,j);h(b),m==null&&(m=new Map,r.set(p,m)),m.set(w,N)},h=p=>{for(const w of p){const m=o.get(w),N=Uy(w);m!==N&&(o.set(w,N),M({connected:N,target:w}))}},y={observedTargets:i,queryRootAndHandleMutationChanges:d,handleMutationChange:h,addObservedTarget:p=>{if(ha.run(),u||(u=!0,Nl()),i.add(p),typeof p!="string")h([p]);else for(const w of ga)d(w,p)},clearObservedTargets:f,clearQueue:c};Li.set(t,y)}const Py=t=>{for(const e of t)if(e.type==="childList")for(const n of Li.values())for(const i of n.observedTargets)typeof i=="string"?n.queryRootAndHandleMutationChanges(e.target,i):n.handleMutationChange([i])},ga=new Set,wl=(()=>{let t;return function(e){ga.has(e)||(ga.add(e),t==null&&(t=new MutationObserver(Py)),t.observe(e,xy))}})(),ha=Iy(wl,document.documentElement);class Nn{constructor(e){if(new.target===void 0)throw new TypeError(`Constructor ${Nn.name} requires 'new'`);if(e===void 0)throw new ReferenceError(`Failed to construct '${Nn.name}': 1 argument required, but only 0 present.`);if(typeof e!="function")throw new TypeError(`Failed to construct '${Nn.name}': The callback provided as parameter 1 is not a function.`);Yy(this,e)}get[Symbol.toStringTag](){return"ConnectionObserver"}observe(e){if(e===void 0)throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${Nn.name}': 1 argument required, but only 0 present.`);if(typeof e!="string"&&!(e instanceof Node))throw new TypeError(`Failed to execute '${this.observe.name}' on '${Nn.name}': parameter 1 is not of type 'Node' or a DOMString.`);Li.get(this)?.addObservedTarget(e)}takeRecords(){const e=Li.get(this);return e==null?[]:e.clearQueue()}disconnect(){Li.get(this)?.clearObservedTargets()}}Dy(ha.schedule.bind(ha));var _y=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Ry=Fy(["",""],["",""]);function Fy(t,e){return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function By(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ne=function(){function t(){for(var e=this,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return By(this,t),this.tag=function(o){for(var a=arguments.length,s=Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];return typeof o=="function"?e.interimTag.bind(e,o):typeof o=="string"?e.transformEndResult(o):(o=o.map(e.transformString.bind(e)),e.transformEndResult(o.reduce(e.processSubstitutions.bind(e,s))))},i.length>0&&Array.isArray(i[0])&&(i=i[0]),this.transformers=i.map(function(o){return typeof o=="function"?o():o}),this.tag}return _y(t,[{key:"interimTag",value:function(e,n){for(var i=arguments.length,r=Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return this.tag(Ry,e.apply(void 0,[n].concat(r)))}},{key:"processSubstitutions",value:function(e,n,i){var r=this.transformSubstitution(e.shift(),n);return"".concat(n,r,i)}},{key:"transformString",value:function(e){var n=function(i,r){return r.onString?r.onString(i):i};return this.transformers.reduce(n,e)}},{key:"transformSubstitution",value:function(e,n){var i=function(r,o){return o.onSubstitution?o.onSubstitution(r,n):r};return this.transformers.reduce(i,e)}},{key:"transformEndResult",value:function(e){var n=function(i,r){return r.onEndResult?r.onEndResult(i):i};return this.transformers.reduce(n,e)}}]),t}(),ie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return{onEndResult:function(e){if(t==="")return e.trim();if(t=t.toLowerCase(),t==="start"||t==="left")return e.replace(/^\s*/,"");if(t==="end"||t==="right")return e.replace(/\s*$/,"");throw new Error("Side not supported: "+t)}}};function Hy(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}else return Array.from(t)}var Je=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"initial";return{onEndResult:function(e){if(t==="initial"){var n=e.match(/^[^\S\n]*(?=\S)/gm),i=n&&Math.min.apply(Math,Hy(n.map(function(o){return o.length})));if(i){var r=new RegExp("^.{"+i+"}","gm");return e.replace(r,"")}return e}if(t==="all")return e.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+t)}}},Vn=function(t,e){return{onEndResult:function(n){if(t==null||e==null)throw new Error("replaceResultTransformer requires at least 2 arguments.");return n.replace(t,e)}}},Wn=function(t,e){return{onSubstitution:function(n,i){if(t==null||e==null)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return n==null?n:n.toString().replace(t,e)}}},Qy={separator:"",conjunction:"",serial:!1},Ce=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qy;return{onSubstitution:function(e,n){if(Array.isArray(e)){var i=e.length,r=t.separator,o=t.conjunction,a=t.serial,s=n.match(/(\n?[^\S\n]+)$/);if(s?e=e.join(r+s[1]):e=e.join(r+" "),o&&i>1){var u=e.lastIndexOf(r);e=e.slice(0,u)+(a?r:"")+" "+o+e.slice(u+1)}}return e}}},Ll=function(t){return{onSubstitution:function(e,n){if(t!=null&&typeof t=="string")typeof e=="string"&&e.includes(t)&&(e=e.split(t));else throw new Error("You need to specify a string character to split by.");return e}}},Tl=function(t){return t!=null&&!Number.isNaN(t)&&typeof t!="boolean"},Gy=function(){return{onSubstitution:function(t){return Array.isArray(t)?t.filter(Tl):Tl(t)?t:""}}};new ne(Ce({separator:","}),Je,ie),new ne(Ce({separator:",",conjunction:"and"}),Je,ie),new ne(Ce({separator:",",conjunction:"or"}),Je,ie),new ne(Ll(`
|
|
231
|
+
`),Gy,Ce,Je,ie),new ne(Ll(`
|
|
232
|
+
`),Ce,Je,ie,Wn(/&/g,"&"),Wn(/</g,"<"),Wn(/>/g,">"),Wn(/"/g,"""),Wn(/'/g,"'"),Wn(/`/g,"`")),new ne(Vn(/(?:\n(?:\s*))+/g," "),ie),new ne(Vn(/(?:\n\s*)/g,""),ie),new ne(Ce({separator:","}),Vn(/(?:\s+)/g," "),ie),new ne(Ce({separator:",",conjunction:"or"}),Vn(/(?:\s+)/g," "),ie),new ne(Ce({separator:",",conjunction:"and"}),Vn(/(?:\s+)/g," "),ie),new ne(Ce,Je,ie),new ne(Ce,Vn(/(?:\s+)/g," "),ie),new ne(Je,ie);var jl=new ne(Je("all"),ie),Ky=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fa={exports:{}};(function(t,e){(function(n,i){var r="1.0.35",o="",a="?",s="function",u="undefined",l="object",g="string",M="major",c="model",f="name",d="type",h="vendor",y="version",p="architecture",w="console",m="mobile",N="tablet",j="smarttv",b="wearable",S="embedded",v=350,F="Amazon",Y="Apple",U="ASUS",C="BlackBerry",I="Browser",x="Chrome",k="Edge",D="Firefox",P="Google",R="Huawei",H="LG",Z="Microsoft",tt="Motorola",at="Opera",bt="Samsung",Ft="Sharp",Lt="Sony",B="Xiaomi",ct="Zebra",Nt="Facebook",Ee="Chromium OS",oe="Mac OS",L=function(_,K){var z={};for(var $ in _)K[$]&&K[$].length%2===0?z[$]=K[$].concat(_[$]):z[$]=_[$];return z},A=function(_){for(var K={},z=0;z<_.length;z++)K[_[z].toUpperCase()]=_[z];return K},Q=function(_,K){return typeof _===g?lt(K).indexOf(lt(_))!==-1:!1},lt=function(_){return _.toLowerCase()},rt=function(_){return typeof _===g?_.replace(/[^\d\.]/g,o).split(".")[0]:i},At=function(_,K){if(typeof _===g)return _=_.replace(/^\s\s*/,o),typeof K===u?_:_.substring(0,v)},q=function(_,K){for(var z=0,$,Bt,zt,G,O,Yt;z<K.length&&!O;){var jn=K[z],xi=K[z+1];for($=Bt=0;$<jn.length&&!O&&jn[$];)if(O=jn[$++].exec(_),O)for(zt=0;zt<xi.length;zt++)Yt=O[++Bt],G=xi[zt],typeof G===l&&G.length>0?G.length===2?typeof G[1]==s?this[G[0]]=G[1].call(this,Yt):this[G[0]]=G[1]:G.length===3?typeof G[1]===s&&!(G[1].exec&&G[1].test)?this[G[0]]=Yt?G[1].call(this,Yt,G[2]):i:this[G[0]]=Yt?Yt.replace(G[1],G[2]):i:G.length===4&&(this[G[0]]=Yt?G[3].call(this,Yt.replace(G[1],G[2])):i):this[G]=Yt||i;z+=2}},ft=function(_,K){for(var z in K)if(typeof K[z]===l&&K[z].length>0){for(var $=0;$<K[z].length;$++)if(Q(K[z][$],_))return z===a?i:z}else if(Q(K[z],_))return z===a?i:z;return _},jt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},dt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,y],[/opios[\/ ]+([\w\.]+)/i],[y,[f,at+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[f,at]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[f,"UC"+I]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[y,[f,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[y,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[f,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+I],y],[/\bfocus\/([\w\.]+)/i],[y,[f,D+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[f,at+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[f,at+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[f,"MIUI "+I]],[/fxios\/([-\w\.]+)/i],[y,[f,D]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+I]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+I],y],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[f,y],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Nt],y],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[f,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[f,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,x+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[f,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[y,ft,jt]],[/(webkit|khtml)\/([\w\.]+)/i],[f,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[f,D+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,y],[/(cobalt)\/([\w\.]+)/i],[f,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,lt]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,o,lt]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,lt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,bt],[d,N]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,bt],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[h,Y],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,Y],[d,N]],[/(macintosh);/i],[c,[h,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,Ft],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,R],[d,N]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,R],[d,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[h,B],[d,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,B],[d,N]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[d,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,tt],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,tt],[d,N]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,H],[d,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,H],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[d,N]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[h,P],[d,N]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,P],[d,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,Lt],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,Lt],[d,N]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,F],[d,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,F],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[d,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,C],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,U],[d,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,U],[d,m]],[/(nexus 9)/i],[c,[h,"HTC"],[d,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[d,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[d,N]],[/(surface duo)/i],[c,[h,Z],[d,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[d,m]],[/(u304aa)/i],[c,[h,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[d,N]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[d,N]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[d,N]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[d,N]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[d,N]],[/\b(k88) b/i],[c,[h,"ZTE"],[d,N]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[d,N]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[d,N]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[d,N]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[d,N]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[d,N]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[d,m]],[/\b(ph-1) /i],[c,[h,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[d,N]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[d,N]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[d,N]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[d,N]],[/(sprint) (\w+)/i],[h,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,Z],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,ct],[d,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,ct],[d,m]],[/smart-tv.+(samsung)/i],[h,[d,j]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,bt],[d,j]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,H],[d,j]],[/(apple) ?tv/i],[h,[c,Y+" TV"],[d,j]],[/crkey/i],[[c,x+"cast"],[h,P],[d,j]],[/droid.+aft(\w)( bui|\))/i],[c,[h,F],[d,j]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,Ft],[d,j]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,Lt],[d,j]],[/(mitv-\w{5}) bui/i],[c,[h,B],[d,j]],[/Hbbtv.*(technisat) (.*);/i],[h,c,[d,j]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,At],[c,At],[d,j]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,j]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[d,w]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[d,w]],[/(playstation [345portablevi]+)/i],[c,[h,Lt],[d,w]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,Z],[d,w]],[/((pebble))app/i],[h,c,[d,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[h,Y],[d,b]],[/droid.+; (glass) \d/i],[c,[h,P],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,ct],[d,b]],[/(quest( 2| pro)?)/i],[c,[h,Nt],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,S]],[/(aeobc)\b/i],[c,[h,F],[d,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,N]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[f,k+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,y],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[f,[y,ft,dt]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,"Windows"],[y,ft,dt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,oe],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,y],[/\(bb(10);/i],[y,[f,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[f,D+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[f,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,Ee],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,y],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,y]]},et=function(_,K){if(typeof _===l&&(K=_,_=i),!(this instanceof et))return new et(_,K).getResult();var z=typeof n!==u&&n.navigator?n.navigator:i,$=_||(z&&z.userAgent?z.userAgent:o),Bt=z&&z.userAgentData?z.userAgentData:i,zt=K?L(Mt,K):Mt,G=z&&z.userAgent==$;return this.getBrowser=function(){var O={};return O[f]=i,O[y]=i,q.call(O,$,zt.browser),O[M]=rt(O[y]),G&&z&&z.brave&&typeof z.brave.isBrave==s&&(O[f]="Brave"),O},this.getCPU=function(){var O={};return O[p]=i,q.call(O,$,zt.cpu),O},this.getDevice=function(){var O={};return O[h]=i,O[c]=i,O[d]=i,q.call(O,$,zt.device),G&&!O[d]&&Bt&&Bt.mobile&&(O[d]=m),G&&O[c]=="Macintosh"&&z&&typeof z.standalone!==u&&z.maxTouchPoints&&z.maxTouchPoints>2&&(O[c]="iPad",O[d]=N),O},this.getEngine=function(){var O={};return O[f]=i,O[y]=i,q.call(O,$,zt.engine),O},this.getOS=function(){var O={};return O[f]=i,O[y]=i,q.call(O,$,zt.os),G&&!O[f]&&Bt&&Bt.platform!="Unknown"&&(O[f]=Bt.platform.replace(/chrome os/i,Ee).replace(/macos/i,oe)),O},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return $},this.setUA=function(O){return $=typeof O===g&&O.length>v?At(O,v):O,this},this.setUA($),this};et.VERSION=r,et.BROWSER=A([f,y,M]),et.CPU=A([p]),et.DEVICE=A([c,h,d,w,m,j,N,b,S]),et.ENGINE=et.OS=A([f,y]),t.exports&&(e=t.exports=et),e.UAParser=et;var ot=typeof n!==u&&(n.jQuery||n.Zepto);if(ot&&!ot.ua){var Ct=new et;ot.ua=Ct.getResult(),ot.ua.get=function(){return Ct.getUA()},ot.ua.set=function(_){Ct.setUA(_);var K=Ct.getResult();for(var z in K)ot.ua[z]=K[z]}}})(typeof window=="object"?window:Ky)})(fa,fa.exports);var Vy=fa.exports;const Wy=$y(Vy);function El(t){const e=Object.keys(t);if(e.length===0)throw new Error("No members in object!");let n=e[0],i=-1/0;for(const[r,o]of Object.entries(t))o>i&&(i=o,n=r);return n}const Sl=t=>{if(t instanceof Error)return t;try{return new Error(JSON.stringify(t))}catch{return new Error(String(t))}};class Zy{deviceInfo;settings;activeStream;name;#t;constructor(e,n){this.deviceInfo=e,this.name=e.label,this.activeStream=null,this.#t=Al(e),this.settings=n}async startStream(){if(this.activeStream)return this.activeStream;const e=await navigator.mediaDevices.getUserMedia(this.#t);this.activeStream=e,e.onaddtrack=i=>console.log("added track",i),e.onremovetrack=i=>console.log("removed track",i);const n=e.getVideoTracks()[0];return n.onended=i=>{console.log("track ended",i),this.stopStream()},e}stopStream(){this.activeStream&&(console.log(`Stopping active stream on ${this.name}`),pa(this.activeStream),this.activeStream=null)}getVideoTrack(){if(this.activeStream)return this.activeStream.getVideoTracks()[0]}}const Ma=new Wy,ya=Ma.getOS().name==="Android",bl=Ma.getOS().name==="iOS",qy=async()=>{try{const t=await navigator.mediaDevices.getUserMedia({video:!0});pa(t)}catch{throw new Error("Camera permission not given")}},Xy=async()=>{if(!navigator.mediaDevices)throw new Error(jl`
|
|
233
|
+
Cameras can only be used in a secure context:
|
|
234
|
+
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
235
|
+
`);return await qy(),(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="videoinput")};async function Jy(t){try{const e=await np(t),n=e.getVideoTracks()[0].getSettings();return pa(e),new Zy(t,n)}catch{return console.warn(`DEBUG: Device ${t.deviceId} doesn't support this constraint.`),null}}const tp=t=>{if(Ma.getOS().name!=="Android")return;if(t.some(i=>i.settings.facingMode===void 0)){console.warn("Not all devices have facingMode");return}let e=0,n=0;for(const i of t){const r=i.settings.facingMode;r==="environment"&&(i.name=`Back camera ${++n}`),r==="user"&&(i.name=`Front camera ${++e}`)}},pa=t=>{const e=t.getTracks();for(const n of e)n.stop()},ep=t=>{const e={};for(const n of t){const i=n.deviceInfo.deviceId;e[i]=0,n.settings.facingMode==="environment"&&(e[i]+=2),ya&&"torch"in n.settings&&(e[i]+=2),ya&&n.settings.focusMode==="single-shot"&&(e[i]+=2),ya&&n===t[t.length]&&(e[i]+=1),bl&&n.name==="Back Triple Camera"&&(e[i]+=5),bl&&n.name==="Back Dual Wide Camera"&&(e[i]+=3)}return El(e)};function Al(t){return{video:{deviceId:{exact:t.deviceId},frameRate:{exact:30},width:{exact:1920},height:{exact:1080}},audio:!1}}async function np(t){const e=Al(t);return await navigator.mediaDevices.getUserMedia(e)}async function ip(){const t=await Xy(),e=[];for await(const n of t){const i=await Jy(n);i!==null&&e.push(i)}return e}const rp=(t=window.location.href)=>{const e=new Worker(t+"/resources/capture-worker.js");return e.onerror=n=>console.error(n),ll(e)};let op=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const vl="capture-userid";function ap(){const t=localStorage.getItem(vl);if(t)return t;const e=op();return localStorage.setItem(vl,e),e}function sp(t){return{licenseId:t.licenseId,licensee:t.licensee,packageName:t.packageName,platform:"Browser",sdkName:t.sdkName,sdkVersion:t.sdkVersion}}async function up(t){try{return await(await fetch("https://baltazar.microblink.com/api/v1/status/check",{method:"POST",headers:{"Content-Type":"application/json"},cache:"no-cache",body:JSON.stringify(sp(t))})).json()}catch(e){throw console.error(e),e}}const re=Symbol.for("@ts-pattern/matcher"),Dl=Symbol.for("@ts-pattern/isVariadic"),Er="@ts-pattern/anonymous-select-key",ma=t=>!!(t&&typeof t=="object"),Sr=t=>t&&!!t[re],Rt=(t,e,n)=>{if(Sr(t)){const i=t[re](),{matched:r,selections:o}=i.match(e);return r&&o&&Object.keys(o).forEach(a=>n(a,o[a])),r}if(ma(t)){if(!ma(e))return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let i=[],r=[],o=[];for(const a of t.keys()){const s=t[a];Sr(s)&&s[Dl]?o.push(s):o.length?r.push(s):i.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(e.length<i.length+r.length)return!1;const a=e.slice(0,i.length),s=r.length===0?[]:e.slice(-r.length),u=e.slice(i.length,r.length===0?1/0:-r.length);return i.every((l,g)=>Rt(l,a[g],n))&&r.every((l,g)=>Rt(l,s[g],n))&&(o.length===0||Rt(o[0],u,n))}return t.length===e.length&&t.every((a,s)=>Rt(a,e[s],n))}return Object.keys(t).every(i=>{const r=t[i];return(i in e||Sr(o=r)&&o[re]().matcherType==="optional")&&Rt(r,e[i],n);var o})}return Object.is(e,t)},fe=t=>{var e,n,i;return ma(t)?Sr(t)?(e=(n=(i=t[re]()).getSelectionKeys)==null?void 0:n.call(i))!=null?e:[]:Array.isArray(t)?Ti(t,fe):Ti(Object.values(t),fe):[]},Ti=(t,e)=>t.reduce((n,i)=>n.concat(e(i)),[]);function cp(...t){if(t.length===1){const[e]=t;return n=>Rt(e,n,()=>{})}if(t.length===2){const[e,n]=t;return Rt(e,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function $t(t){return Object.assign(t,{optional:()=>wa(t),and:e=>It(t,e),or:e=>Il(t,e),select:e=>e===void 0?ji(t):ji(e,t)})}function Na(t){return Object.assign((e=>Object.assign(e,{*[Symbol.iterator](){yield Object.assign(e,{[Dl]:!0})}}))(t),{optional:()=>Na(wa(t)),select:e=>Na(e===void 0?ji(t):ji(e,t))})}function wa(t){return $t({[re]:()=>({match:e=>{let n={};const i=(r,o)=>{n[r]=o};return e===void 0?(fe(t).forEach(r=>i(r,void 0)),{matched:!0,selections:n}):{matched:Rt(t,e,i),selections:n}},getSelectionKeys:()=>fe(t),matcherType:"optional"})})}const lp=(t,e)=>{for(const n of t)if(!e(n))return!1;return!0},dp=(t,e)=>{for(const[n,i]of t.entries())if(!e(i,n))return!1;return!0};function It(...t){return $t({[re]:()=>({match:e=>{let n={};const i=(r,o)=>{n[r]=o};return{matched:t.every(r=>Rt(r,e,i)),selections:n}},getSelectionKeys:()=>Ti(t,fe),matcherType:"and"})})}function Il(...t){return $t({[re]:()=>({match:e=>{let n={};const i=(r,o)=>{n[r]=o};return Ti(t,fe).forEach(r=>i(r,void 0)),{matched:t.some(r=>Rt(r,e,i)),selections:n}},getSelectionKeys:()=>Ti(t,fe),matcherType:"or"})})}function mt(t){return{[re]:()=>({match:e=>({matched:!!t(e)})})}}function ji(...t){const e=typeof t[0]=="string"?t[0]:void 0,n=t.length===2?t[1]:typeof t[0]=="string"?void 0:t[0];return $t({[re]:()=>({match:i=>{let r={[e??Er]:i};return{matched:n===void 0||Rt(n,i,(o,a)=>{r[o]=a}),selections:r}},getSelectionKeys:()=>[e??Er].concat(n===void 0?[]:fe(n))})})}function ze(t){return typeof t=="number"}function wn(t){return typeof t=="string"}function tn(t){return typeof t=="bigint"}const xl=$t(mt(function(t){return!0})),gp=xl,Ln=t=>Object.assign($t(t),{startsWith:e=>{return Ln(It(t,(n=e,mt(i=>wn(i)&&i.startsWith(n)))));var n},endsWith:e=>{return Ln(It(t,(n=e,mt(i=>wn(i)&&i.endsWith(n)))));var n},minLength:e=>Ln(It(t,(n=>mt(i=>wn(i)&&i.length>=n))(e))),maxLength:e=>Ln(It(t,(n=>mt(i=>wn(i)&&i.length<=n))(e))),includes:e=>{return Ln(It(t,(n=e,mt(i=>wn(i)&&i.includes(n)))));var n},regex:e=>{return Ln(It(t,(n=e,mt(i=>wn(i)&&!!i.match(n)))));var n}}),hp=Ln(mt(wn)),Ol=(t,e)=>mt(n=>ze(n)&&t<=n&&e>=n),Cl=t=>mt(e=>ze(e)&&e<t),zl=t=>mt(e=>ze(e)&&e>t),kl=t=>mt(e=>ze(e)&&e<=t),Ul=t=>mt(e=>ze(e)&&e>=t),Yl=()=>mt(t=>ze(t)&&Number.isInteger(t)),Pl=()=>mt(t=>ze(t)&&Number.isFinite(t)),_l=()=>mt(t=>ze(t)&&t>0),Rl=()=>mt(t=>ze(t)&&t<0),ke=t=>Object.assign($t(t),{between:(e,n)=>ke(It(t,Ol(e,n))),lt:e=>ke(It(t,Cl(e))),gt:e=>ke(It(t,zl(e))),lte:e=>ke(It(t,kl(e))),gte:e=>ke(It(t,Ul(e))),int:()=>ke(It(t,Yl())),finite:()=>ke(It(t,Pl())),positive:()=>ke(It(t,_l())),negative:()=>ke(It(t,Rl()))}),fp=ke(mt(ze)),Fl=(t,e)=>mt(n=>tn(n)&&t<=n&&e>=n),Bl=t=>mt(e=>tn(e)&&e<t),Hl=t=>mt(e=>tn(e)&&e>t),Ql=t=>mt(e=>tn(e)&&e<=t),Gl=t=>mt(e=>tn(e)&&e>=t),Kl=()=>mt(t=>tn(t)&&t>0),$l=()=>mt(t=>tn(t)&&t<0),en=t=>Object.assign($t(t),{between:(e,n)=>en(It(t,Fl(e,n))),lt:e=>en(It(t,Bl(e))),gt:e=>en(It(t,Hl(e))),lte:e=>en(It(t,Ql(e))),gte:e=>en(It(t,Gl(e))),positive:()=>en(It(t,Kl())),negative:()=>en(It(t,$l()))}),Mp=en(mt(tn)),yp=$t(mt(function(t){return typeof t=="boolean"})),pp=$t(mt(function(t){return typeof t=="symbol"})),mp=$t(mt(function(t){return t==null}));var Np={__proto__:null,matcher:re,optional:wa,array:function(...t){return Na({[re]:()=>({match:e=>{if(!Array.isArray(e))return{matched:!1};if(t.length===0)return{matched:!0};const n=t[0];let i={};if(e.length===0)return fe(n).forEach(o=>{i[o]=[]}),{matched:!0,selections:i};const r=(o,a)=>{i[o]=(i[o]||[]).concat([a])};return{matched:e.every(o=>Rt(n,o,r)),selections:i}},getSelectionKeys:()=>t.length===0?[]:fe(t[0])})})},set:function(...t){return $t({[re]:()=>({match:e=>{if(!(e instanceof Set))return{matched:!1};let n={};if(e.size===0)return{matched:!0,selections:n};if(t.length===0)return{matched:!0};const i=(o,a)=>{n[o]=(n[o]||[]).concat([a])},r=t[0];return{matched:lp(e,o=>Rt(r,o,i)),selections:n}},getSelectionKeys:()=>t.length===0?[]:fe(t[0])})})},map:function(...t){return $t({[re]:()=>({match:e=>{if(!(e instanceof Map))return{matched:!1};let n={};if(e.size===0)return{matched:!0,selections:n};const i=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(t.length===0)return{matched:!0};var r;if(t.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(r=t[0])==null?void 0:r.toString()}`);const[o,a]=t;return{matched:dp(e,(s,u)=>{const l=Rt(o,u,i),g=Rt(a,s,i);return l&&g}),selections:n}},getSelectionKeys:()=>t.length===0?[]:[...fe(t[0]),...fe(t[1])]})})},intersection:It,union:Il,not:function(t){return $t({[re]:()=>({match:e=>({matched:!Rt(t,e,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:mt,select:ji,any:xl,_:gp,string:hp,between:Ol,lt:Cl,gt:zl,lte:kl,gte:Ul,int:Yl,finite:Pl,positive:_l,negative:Rl,number:fp,betweenBigInt:Fl,ltBigInt:Bl,gtBigInt:Hl,lteBigInt:Ql,gteBigInt:Gl,positiveBigInt:Kl,negativeBigInt:$l,bigint:Mp,boolean:yp,symbol:pp,nullish:mp,instanceOf:function(t){return $t(mt(function(e){return n=>n instanceof e}(t)))},shape:function(t){return $t(mt(cp(t)))}};const La={matched:!1,value:void 0};function wp(t){return new br(t,La)}class br{constructor(e,n){this.input=void 0,this.state=void 0,this.input=e,this.state=n}with(...e){if(this.state.matched)return this;const n=e[e.length-1],i=[e[0]];let r;e.length===3&&typeof e[1]=="function"?(i.push(e[0]),r=e[1]):e.length>2&&i.push(...e.slice(1,e.length-1));let o=!1,a={};const s=(l,g)=>{o=!0,a[l]=g},u=!i.some(l=>Rt(l,this.input,s))||r&&!r(this.input)?La:{matched:!0,value:n(o?Er in a?a[Er]:a:this.input,this.input)};return new br(this.input,u)}when(e,n){if(this.state.matched)return this;const i=!!e(this.input);return new br(this.input,i?{matched:!0,value:n(this.input,this.input)}:La)}otherwise(e){return this.state.matched?this.state.value:e(this.input)}exhaustive(){return this.run()}run(){if(this.state.matched)return this.state.value;let e;try{e=JSON.stringify(this.input)}catch{e=this.input}throw new Error(`Pattern matching error: no pattern matches value ${e}`)}returnType(){return this}}const Wt={PROCESSING:{key:"PROCESSING",reticleType:"processing",minDuration:1e3},SIDE_CAPTURED:{key:"SIDE_CAPTURED",reticleType:"done",minDuration:1e3},FLIP_CARD:{key:"FLIP_CARD",reticleType:"flip",minDuration:3e3},DOCUMENT_CAPTURED:{key:"DOCUMENT_CAPTURED",reticleType:"done",minDuration:1e3},SENSING_FRONT:{key:"SENSING_FRONT",reticleType:"searching",minDuration:1e3},SENSING_BACK:{key:"SENSING_BACK",reticleType:"searching",minDuration:1e3},DOCUMENT_FRAMING_CAMERA_TOO_FAR:{key:"DOCUMENT_FRAMING_CAMERA_TOO_FAR",reticleType:"error",minDuration:1500},DOCUMENT_FRAMING_CAMERA_TOO_CLOSE:{key:"DOCUMENT_FRAMING_CAMERA_TOO_CLOSE",reticleType:"error",minDuration:1500},DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP:{key:"DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP",reticleType:"error",minDuration:1500},DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE:{key:"DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE",reticleType:"error",minDuration:1500},LIGHTING_TOO_DARK:{key:"LIGHTING_TOO_DARK",reticleType:"error",minDuration:1500},LIGHTING_TOO_BRIGHT:{key:"LIGHTING_TOO_BRIGHT",reticleType:"error",minDuration:1500},BLUR_DETECTED:{key:"BLUR_DETECTED",reticleType:"error",minDuration:1500},GLARE_DETECTED:{key:"GLARE_DETECTED",reticleType:"error",minDuration:1500},OCCLUDED:{key:"OCCLUDED",reticleType:"error",minDuration:1500},WRONG_SIDE:{key:"WRONG_SIDE",reticleType:"error",minDuration:1500}};class Lp{timeWindow=3e3;decayRate=.95;eventStack=[];analyzerSettings;currentUiState=Wt.SENSING_FRONT;currentStateStartTime=performance.now();constructor(e){this.analyzerSettings=e}reset(){this.eventStack=[]}updateSettings(e){this.analyzerSettings=e}getUiState(e){const n=performance.now(),i={stateKey:this.getUiStateKeyFromResult(e),timeStamp:n,currentWeight:1};if(i.stateKey==="SIDE_CAPTURED"||i.stateKey==="DOCUMENT_CAPTURED")return this.eventStack=[],Wt[i.stateKey];this.eventStack.push(i);const r={};if(this.eventStack.forEach(a=>{if(n-a.timeStamp>this.timeWindow){this.eventStack.shift();return}const s=a.timeStamp/n;a.currentWeight*=this.decayRate*s,r[a.stateKey]||(r[a.stateKey]=[]),r[a.stateKey].push(a.currentWeight)}),n-this.currentStateStartTime<this.currentUiState.minDuration)return this.currentUiState;const o={};for(const a in r){const s=a,u=a.length/this.eventStack.length,l=r[s].reduce((g,M)=>g+M,0);o[s]=l*u}try{const a=El(o),s=Wt[a];return s!==this.currentUiState&&(this.currentUiState=s,this.currentStateStartTime=n),s}catch{return this.currentUiState}}getUiStateKeyFromResult(e){return wp(e).with({frameCaptured:!0,captureState:Np.when(n=>n==="first-side-capture-in-progress"||n==="second-side-capture-in-progress")},()=>"PROCESSING").with({captureState:"first-side-capture-in-progress",frameAnalysisStatus:{framingStatus:"no-document"}},()=>"SENSING_FRONT").with({captureState:"second-side-capture-in-progress",frameAnalysisStatus:{framingStatus:"no-document"}},()=>"SENSING_BACK").with({captureState:"document-captured"},()=>"DOCUMENT_CAPTURED").with({captureState:"side-captured"},()=>"SIDE_CAPTURED").with({frameAnalysisStatus:{sideAnalysisStatus:"side-already-captured"}},()=>"WRONG_SIDE").with({frameAnalysisStatus:{framingStatus:"camera-angle-too-steep"}},()=>"DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP").with({frameAnalysisStatus:{framingStatus:"camera-too-close"}},()=>"DOCUMENT_FRAMING_CAMERA_TOO_CLOSE").with({frameAnalysisStatus:{framingStatus:"camera-too-far"}},()=>"DOCUMENT_FRAMING_CAMERA_TOO_FAR").with({frameAnalysisStatus:{framingStatus:"document-too-close-to-frame-edge"}},()=>"DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE").with({frameAnalysisStatus:{lightingStatus:"too-bright"}},()=>"LIGHTING_TOO_BRIGHT").with({frameAnalysisStatus:{lightingStatus:"too-dark"}},()=>"LIGHTING_TOO_DARK").with({frameAnalysisStatus:{blurStatus:"blur-detected"}},()=>"BLUR_DETECTED").with({frameAnalysisStatus:{glareStatus:"glare-detected"}},()=>"GLARE_DETECTED").with({frameAnalysisStatus:{occlusionStatus:"occluded"}},()=>"OCCLUDED").otherwise(()=>"SENSING_FRONT")}}const Ta=document.createElement("canvas"),ja=Ta.getContext("2d",{willReadFrequently:!0,alpha:!1});function Tp(t){if(!ja)throw new Error("CanvasRenderingContext2D is missing!");const e=t.videoWidth,n=t.videoHeight;Ta.width=e,Ta.height=n,ja.drawImage(t,0,0,e,n);const i=ja.getImageData(0,0,e,n);return jp(i)}function jp(t){return{data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace}}const Ep=t=>(e,n,i)=>{const r=i.subscribe;return i.subscribe=(o,a,s)=>{let u=o;if(a){const l=s?.equalityFn||Object.is;let g=o(i.getState());u=M=>{const c=o(M);if(!l(g,c)){const f=g;a(g=c,f)}},s?.fireImmediately&&a(g,g)}return r(u)},t(e,n,i)},Sp=Ep,Vl=t=>{let e;const n=new Set,i=(a,s)=>{const u=typeof a=="function"?a(e):a;if(!Object.is(u,e)){const l=e;e=s??typeof u!="object"?u:Object.assign({},e,u),n.forEach(g=>g(e,l))}},r=()=>e,o={setState:i,getState:r,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return e=t(i,r,o),o},bp=t=>t?Vl(t):Vl,Wl={cameras:[],videoElement:null,selectedCamera:null,isPlaying:!1,isCapturing:!1,isSwappingCamera:!1,isQueryingCameras:!1,callbacks:{},uiState:structuredClone(Wt.SENSING_FRONT),initialized:!1,errorState:null,analyzerSettings:{}},J=bp()(Sp(()=>structuredClone(Wl)));J.subscribe(t=>t.videoElement,(t,e)=>{!t&&e&&Zl()});const Zl=()=>{console.log("resetting zustand store"),J.getState().cameras.forEach(t=>{t.stopStream()}),J.setState(structuredClone(Wl))};let Ar,Ea,Ei,Tn,Sa;async function Ap(t,e=!0){if(J.getState().isPlaying){console.warn("Already streaming");return}if(J.getState().selectedCamera)console.log("Reusing previous device");else try{await ed()}catch(o){J.setState({errorState:Sl(o)});return}const n=J.getState();if(!n.selectedCamera){console.warn("No selected camera!");return}const i=await n.selectedCamera.startStream(),r=i.getVideoTracks()[0].getSettings();if(!r.width||!r.height)throw new Error("Video doesn't have dimensions!");if(!t.isConnected)throw new Error("Video element needs to be in the document!");J.getState().videoElement||vp(t),t.srcObject=i,t.width=r.width,t.height=r.height,J.setState({videoElement:t}),e&&await Aa()}async function ql(){Zl(),await Ei.terminate()}function vp(t){new Nn(e=>{e[0].connected||ql()}).observe(t),t.playsInline=!0,t.setAttribute("muted","")}async function Dp(t){if(J.getState().isCapturing){console.warn("Cancel the capture process using `cancelCapture()` before updating settings");return}const e={...J.getState().analyzerSettings,...t};await Tn.updateSettings(e),Ar.updateSettings(e)}async function Ip(t){const e=J.getState();if(e.selectedCamera===t){console.warn("Already selected");return}if(e.isSwappingCamera)return;const n=e.selectedCamera;J.setState({isSwappingCamera:!0}),n&&n.stopStream(),e.videoElement&&(e.videoElement.srcObject=null);try{const i=await t.startStream();e.videoElement&&(e.videoElement.srcObject=i,e.isPlaying&&await e.videoElement.play()),J.setState({selectedCamera:t,isSwappingCamera:!1})}catch(i){console.error(i)}}async function xp(){console.log("stopStream called");const t=J.getState();if(t.selectedCamera?.stopStream(),!t.videoElement){console.log("no video element");return}t.videoElement.srcObject=null,await Jl(),va()}async function ba(){const t=J.getState();if(!t.isCapturing||!t.isPlaying)return;if(!t.videoElement){console.error("Missing video element");return}const e=t.callbacks?.onFrameAnalysis,n=typeof e=="function",i=Tp(t.videoElement);Sa=new ImageData(Uint8ClampedArray.from(i.data),i.width,i.height);const r=await Ei.analyze(fl(i,[i.data.buffer])),o=Ar.getUiState(r);if(J.setState({uiState:o}),n)try{e(Sa,r)}catch(a){throw console.warn("onFrameAnalysis callback exception"),a}if(n&&window.setTimeout(()=>Sa=null,0),o.key==="SIDE_CAPTURED"){vr(),J.setState({uiState:Wt.SIDE_CAPTURED}),await new Promise(a=>setTimeout(a,Wt.SIDE_CAPTURED.minDuration)),J.setState({uiState:Wt.FLIP_CARD}),await new Promise(a=>setTimeout(a,Wt.FLIP_CARD.minDuration)),await Xl();return}if(o.key==="DOCUMENT_CAPTURED"){va(),J.setState({uiState:Wt.DOCUMENT_CAPTURED}),await new Promise(s=>setTimeout(s,Wt.DOCUMENT_CAPTURED.minDuration));const a=await Tn.getResult();try{t.callbacks?.onCaptureResult?.(a)}catch{console.warn("onCaptureResult callback exception")}return}Ea=t.videoElement.requestVideoFrameCallback(()=>void ba())}async function Xl(){console.log("startCapture called");const t=J.getState();if(!t.isCapturing){if(!t.videoElement){console.warn("Missing video element");return}if(!t.selectedCamera){console.warn("No active camera!");return}await Aa(),J.getState().isPlaying&&(J.setState({isCapturing:!0}),Ea=t.videoElement.requestVideoFrameCallback(()=>void ba()))}}function vr(){console.log("pauseCapture called");const t=J.getState().videoElement;t&&t.cancelVideoFrameCallback(Ea),J.setState({isCapturing:!1})}async function Jl(){console.log("cancelCapture called"),await td(),Ar.reset(),vr(),J.setState({uiState:Wt.SENSING_FRONT})}async function td(){await Tn.reset()}async function Op(){await Tn.finishSideCapture()}async function ed(){if(J.getState().isQueryingCameras||J.getState().isSwappingCamera)return;J.setState({isQueryingCameras:!0});const t=await ip();if(t.length<1)throw new Error("No capable devices found! Your camera needs to have a minimum resolution of 1920x1080");tp(t);const e=ep(t),n=t.find(i=>i.deviceInfo.deviceId===e);J.setState({cameras:t,selectedCamera:n,isQueryingCameras:!1})}async function Aa(){const t=J.getState();if(!t.isPlaying){if(!t.videoElement){console.warn("No video element present.");return}if(!t.videoElement.srcObject){console.warn("No source present. Start a camera stream first.");return}if(!t.selectedCamera){console.warn("No selected camera");return}await t.selectedCamera.startStream(),await t.videoElement.play(),J.setState({isPlaying:!0}),t.isCapturing===!0&&t.videoElement.requestVideoFrameCallback(()=>void ba())}}function va(){console.log("pausePlayback called");const t=J.getState();if(!t.videoElement){J.setState({isPlaying:!1});return}vr(),t.videoElement.pause(),J.setState({isPlaying:!1})}function nd(t){J.setState({callbacks:t})}async function Cp(t){try{if(!window.isSecureContext)throw new Error(jl`
|
|
236
|
+
Can't load the SDK outside a secure context:
|
|
237
|
+
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
238
|
+
`);if(J.getState().initialized)return console.warn("Already initialized"),id;Ei=rp(t.resourceUrl);const e=ap(),n=await Ei.loadWasm(),i=await n.initializeWithLicenseKey(t.licenseKey,e,!1);if(i.unlockResult===Ml.RequiresServerPermission){const o=await up(i),a=await n.submitServerPermission(JSON.stringify(o));if(console.log(a),a.status!==yl.Ok)throw new Error("Server unlock not ok.")}Tn=await Ei.createAnalyzer();const r={...await Tn.getSettings(),minimumDocumentDpi:200,...t.analyzerSettings};return Ar=new Lp(r),t.analyzerSettings&&await Tn.updateSettings(r),J.setState({analyzerSettings:r}),t.callbacks&&nd(t.callbacks),J.setState({initialized:!0}),id}catch(e){throw J.setState({errorState:Sl(e)}),e}}const id={startCameraStream:Ap,stopStream:xp,startPlayback:Aa,pausePlayback:va,startCapture:Xl,pauseCapture:vr,cancelCapture:Jl,finishSideCapture:Op,resetAnalyzer:td,selectCamera:Ip,updateCameraDevices:ed,setCallbacks:nd,updateAnalyzerSettings:Dp,subscribe:J.subscribe,getState:J.getState,destroy:ql};function rd(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=rd(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function nn(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=rd(t))&&(i&&(i+=" "),i+=e);return i}const zp=wt('<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.41 6.91a.833.833 0 0 1 1.18 0L10 11.323l4.41-4.411a.833.833 0 1 1 1.18 1.178l-5 5a.833.833 0 0 1-1.18 0l-5-5a.833.833 0 0 1 0-1.178Z" fill="#fff">'),kp=(t={})=>(()=>{const e=zp();return te(e,t,!0,!0),e})(),Up=wt('<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g fill-rule="evenodd" clip-rule="evenodd" fill="#fff"><path d="M6.322 2.988A1.667 1.667 0 0 1 7.5 2.5h5a1.667 1.667 0 0 1 1.667 1.667A.833.833 0 0 0 15 5h.833a2.5 2.5 0 0 1 2.5 2.5V15a2.5 2.5 0 0 1-2.5 2.5H4.167a2.5 2.5 0 0 1-2.5-2.5V7.5a2.5 2.5 0 0 1 2.5-2.5H5a.833.833 0 0 0 .833-.833c0-.442.176-.866.489-1.179ZM4.167 6.667a.833.833 0 0 0-.834.833V15a.833.833 0 0 0 .834.833h11.666a.834.834 0 0 0 .834-.833V7.5a.833.833 0 0 0-.834-.833H15a2.5 2.5 0 0 1-2.5-2.5h-5a2.5 2.5 0 0 1-2.5 2.5h-.833Z"></path><path d="M10 9.167a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333Zm-3.333 1.666a3.333 3.333 0 1 1 6.666 0 3.333 3.333 0 0 1-6.666 0Z">'),Yp=(t={})=>(()=>{const e=Up();return te(e,t,!0,!0),e})(),Pp=wt('<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.167 10.833 7.5 14.167l8.333-8.334" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'),_p=(t={})=>(()=>{const e=Pp();return te(e,t,!0,!0),e})();function Rp(t,e=t.getState,n){const i=e(t.getState()),[r,o]=yo(i),a=(u,l)=>{const g=e(l),M=e(u);n!==void 0&&n(g,M)||o(qh(M))},s=t.subscribe(a);return st(()=>s()),r}const od=se(),Fp=t=>{const[e,n]=yo(t.mergedDefaults),i=Rp(J);Ke(()=>{(async()=>{const o=await Cp(t.sdkSettings);n({captureSdk:o})})()}),nt(()=>{const o=t.mergedDefaults.dismountFn;if(e.captureSdk){const a=e.captureSdk.subscribe(s=>s.videoElement,(s,u)=>{!s&&u&&o()});st(()=>a())}});const r={solidStore:e,updateSolidStore:n,sdkStore:i};return T(od.Provider,{value:r,get children(){return t.children}})};function rn(){const t=ue(od);if(!t)throw new Error("StoreContext.Provider not in scope");return t}const Bp=()=>{const{solidStore:t,sdkStore:e}=rn(),n=()=>[...e.cameras.map(s=>({value:s.deviceInfo.deviceId,label:s.name,disabled:!1}))],i=()=>n().find(s=>s.value===e.selectedCamera?.deviceInfo.deviceId),r=async s=>{if(!t.captureSdk)return;a(!0);const u=e.cameras.find(l=>l.deviceInfo.deviceId===s);if(!u){console.warn("No camera");return}await t.captureSdk.selectCamera(u),a(!1)},[o,a]=W(!1);return T(ay,{get options(){return n()},get value(){return i()},optionValue:"value",optionTextValue:"label",optionDisabled:"disabled",placeholder:"Select a camera...",get disabled(){return o()},onChange:s=>void r(s.value),itemComponent:s=>T(q0,{get item(){return s.item},class:"mb-kd2hm8",get children(){return[T(J0,{class:"mb-1v5y2d4",get children(){return s.item.textValue}}),T(X0,{class:"mb-1my8n64",get children(){return T(_p,{class:"mb-gliefk"})}})]}}),get children(){return[T(sy,{"aria-label":"Camera",class:"mb-16knymi",get children(){return[T(Yp,{class:"mb-1v0j9xg"}),T(cy,{class:"mb-1vhx4rq",children:s=>s.selectedOption().label}),T(ny,{class:"mb-16n64rq",get children(){return T(kp,{class:"mb-1pgdg8r"})}})]}}),T(ry,{get children(){return T(ey,{get class(){return nn("mb-style-scope","mb-qbe87e")},get children(){return T(iy,{class:"mb-1woc7wg"})}})}})]}})},Hp=wt('<svg viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.623 2.195A1.286 1.286 0 1 0 15.805.377L9 7.182 2.195.377A1.286 1.286 0 1 0 .377 2.195L7.182 9 .377 15.805a1.286 1.286 0 0 0 1.818 1.818L9 10.818l6.805 6.805a1.286 1.286 0 0 0 1.818-1.818L10.818 9l6.805-6.805Z" fill="#fff">'),Da=(t={})=>(()=>{const e=Hp();return te(e,t,!0,!0),e})(),Qp=wt("<div>"),Gp=wt("<div><div>"),Kp=()=>{const{sdkStore:t,solidStore:e}=rn(),{t:n}=hn();return(()=>{const i=Gp(),r=i.firstChild;return it(i,T(kt,{get when(){return t.cameras.length>1},get children(){const o=Qp();return xt(o,"mb-15a7aro"),it(o,T(Bp,{})),o}}),r),xt(r,"mb-1fovbrr"),it(r,T(ur,{get"aria-label"(){return n.dismiss},onclick:()=>e.dismountFn(),class:"mb-1kkaye",get children(){return T(Da,{width:16})}})),pe(()=>xt(i,nn("mb-sihyjw",$p))),i})()},$p="mb-1pqj4ih";function ad(t,e){t.indexOf(e)===-1&&t.push(e)}function Vp(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const sd=(t,e,n)=>Math.min(Math.max(n,t),e),Ae={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Si=t=>typeof t=="number",Zn=t=>Array.isArray(t)&&!Si(t[0]),Wp=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function Zp(t,e){return Zn(t)?t[Wp(0,t.length,e)]:t}const ud=(t,e,n)=>-n*t+n*e+t,cd=()=>{},on=t=>t,Ia=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function ld(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=Ia(0,e,i);t.push(ud(n,1,r))}}function qp(t){const e=[0];return ld(e,t-1),e}function Xp(t,e=qp(t.length),n=on){const i=t.length,r=i-e.length;return r>0&&ld(e,r),o=>{let a=0;for(;a<i-2&&!(o<e[a+1]);a++);let s=sd(0,1,Ia(e[a],e[a+1],o));return s=Zp(n,a)(s),ud(t[a],t[a+1],s)}}const dd=t=>Array.isArray(t)&&Si(t[0]),xa=t=>typeof t=="object"&&!!t.createAnimation,qn=t=>typeof t=="function",Jp=t=>typeof t=="string",Oa={ms:t=>t*1e3,s:t=>t/1e3},gd=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,tm=1e-7,em=12;function nm(t,e,n,i,r){let o,a,s=0;do a=e+(n-e)/2,o=gd(a,i,r)-t,o>0?n=a:e=a;while(Math.abs(o)>tm&&++s<em);return a}function bi(t,e,n,i){if(t===e&&n===i)return on;const r=o=>nm(o,0,1,t,n);return o=>o===0||o===1?o:gd(r(o),e,i)}const im=(t,e="end")=>n=>{n=e==="end"?Math.min(n,.999):Math.max(n,.001);const i=n*t,r=e==="end"?Math.floor(i):Math.ceil(i);return sd(0,1,r/t)},hd={ease:bi(.25,.1,.25,1),"ease-in":bi(.42,0,1,1),"ease-in-out":bi(.42,0,.58,1),"ease-out":bi(0,0,.58,1)},rm=/\((.*?)\)/;function fd(t){if(qn(t))return t;if(dd(t))return bi(...t);if(hd[t])return hd[t];if(t.startsWith("steps")){const e=rm.exec(t);if(e){const n=e[1].split(",");return im(parseFloat(n[0]),n[1].trim())}}return on}class om{constructor(e,n=[0,1],{easing:i,duration:r=Ae.duration,delay:o=Ae.delay,endDelay:a=Ae.endDelay,repeat:s=Ae.repeat,offset:u,direction:l="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=on,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((M,c)=>{this.resolve=M,this.reject=c}),i=i||Ae.easing,xa(i)){const M=i.createAnimation(n);i=M.easing,n=M.keyframes||n,r=M.duration||r}this.repeat=s,this.easing=Zn(i)?on:fd(i),this.updateDuration(r);const g=Xp(n,u,Zn(i)?i.map(fd):on);this.tick=M=>{var c;o=o;let f=0;this.pauseTime!==void 0?f=this.pauseTime:f=(M-this.startTime)*this.rate,this.t=f,f/=1e3,f=Math.max(f-o,0),this.playState==="finished"&&this.pauseTime===void 0&&(f=this.totalDuration);const d=f/this.duration;let h=Math.floor(d),y=d%1;!y&&d>=1&&(y=1),y===1&&h--;const p=h%2;(l==="reverse"||l==="alternate"&&p||l==="alternate-reverse"&&!p)&&(y=1-y);const w=f>=this.totalDuration?1:Math.min(y,1),m=g(this.easing(w));e(m),this.pauseTime===void 0&&(this.playState==="finished"||f>=this.totalDuration+a)?(this.playState="finished",(c=this.resolve)===null||c===void 0||c.call(this,m)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var Md=function(){};process.env.NODE_ENV!=="production"&&(Md=function(t,e){if(!t)throw new Error(e)});class am{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ca=new WeakMap;function yd(t){return Ca.has(t)||Ca.set(t,{transforms:[],values:new Map}),Ca.get(t)}function sm(t,e){return t.has(e)||t.set(e,new am),t.get(e)}const um=["","X","Y","Z"],cm=["translate","scale","rotate","skew"],Xn={x:"translateX",y:"translateY",z:"translateZ"},pd={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},lm={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:pd,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:on},skew:pd},Jn=new Map,Dr=t=>`--motion-${t}`,Ir=["x","y","z"];cm.forEach(t=>{um.forEach(e=>{Ir.push(t+e),Jn.set(Dr(t+e),lm[t])})});const dm=(t,e)=>Ir.indexOf(t)-Ir.indexOf(e),gm=new Set(Ir),za=t=>gm.has(t),hm=(t,e)=>{Xn[e]&&(e=Xn[e]);const{transforms:n}=yd(t);ad(n,e),t.style.transform=md(n)},md=t=>t.sort(dm).reduce(fm,"").trim(),fm=(t,e)=>`${t} ${e}(var(${Dr(e)}))`,ka=t=>t.startsWith("--"),Nd=new Set;function Mm(t){if(!Nd.has(t)){Nd.add(t);try{const{syntax:e,initialValue:n}=Jn.has(t)?Jn.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch{}}}const Ua=(t,e)=>document.createElement("div").animate(t,e),wd={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ua({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ua({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ua({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ya={},ti={};for(const t in wd)ti[t]=()=>(Ya[t]===void 0&&(Ya[t]=wd[t]()),Ya[t]);const ym=.015,pm=(t,e)=>{let n="";const i=Math.round(e/ym);for(let r=0;r<i;r++)n+=t(Ia(0,i-1,r))+", ";return n.substring(0,n.length-2)},Ld=(t,e)=>qn(t)?ti.linearEasing()?`linear(${pm(t,e)})`:Ae.easing:dd(t)?mm(t):t,mm=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`;function Nm(t,e){for(let n=0;n<t.length;n++)t[n]===null&&(t[n]=n?t[n-1]:e());return t}const wm=t=>Array.isArray(t)?t:[t];function Pa(t){return Xn[t]&&(t=Xn[t]),za(t)?Dr(t):t}const Ai={get:(t,e)=>{e=Pa(e);let n=ka(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&n!==0){const i=Jn.get(e);i&&(n=i.initialValue)}return n},set:(t,e,n)=>{e=Pa(e),ka(e)?t.style.setProperty(e,n):t.style[e]=n}};function Lm(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function Tm(t,e){var n;let i=e?.toDefaultUnit||on;const r=t[t.length-1];if(Jp(r)){const o=((n=r.match(/(-?[\d.]+)([a-z%]*)/))===null||n===void 0?void 0:n[2])||"";o&&(i=a=>a+o)}return i}function jm(){return window.__MOTION_DEV_TOOLS_RECORD}function Em(t,e,n,i={},r){const o=jm(),a=i.record!==!1&&o;let s,{duration:u=Ae.duration,delay:l=Ae.delay,endDelay:g=Ae.endDelay,repeat:M=Ae.repeat,easing:c=Ae.easing,persist:f=!1,direction:d,offset:h,allowWebkitAcceleration:y=!1}=i;const p=yd(t),w=za(e);let m=ti.waapi();w&&hm(t,e);const N=Pa(e),j=sm(p.values,N),b=Jn.get(N);return Lm(j.animation,!(xa(c)&&j.generator)&&i.record!==!1),()=>{const S=()=>{var Y,U;return(U=(Y=Ai.get(t,N))!==null&&Y!==void 0?Y:b?.initialValue)!==null&&U!==void 0?U:0};let v=Nm(wm(n),S);const F=Tm(v,b);if(xa(c)){const Y=c.createAnimation(v,e!=="opacity",S,N,j);c=Y.easing,v=Y.keyframes||v,u=Y.duration||u}if(ka(N)&&(ti.cssRegisterProperty()?Mm(N):m=!1),w&&!ti.linearEasing()&&(qn(c)||Zn(c)&&c.some(qn))&&(m=!1),m){b&&(v=v.map(C=>Si(C)?b.toDefaultUnit(C):C)),v.length===1&&(!ti.partialKeyframes()||a)&&v.unshift(S());const Y={delay:Oa.ms(l),duration:Oa.ms(u),endDelay:Oa.ms(g),easing:Zn(c)?void 0:Ld(c,u),direction:d,iterations:M+1,fill:"both"};s=t.animate({[N]:v,offset:h,easing:Zn(c)?c.map(C=>Ld(C,u)):void 0},Y),s.finished||(s.finished=new Promise((C,I)=>{s.onfinish=C,s.oncancel=I}));const U=v[v.length-1];s.finished.then(()=>{f||(Ai.set(t,N,U),s.cancel())}).catch(cd),y||(s.playbackRate=1.000001)}else if(r&&w)v=v.map(Y=>typeof Y=="string"?parseFloat(Y):Y),v.length===1&&v.unshift(parseFloat(S())),s=new r(Y=>{Ai.set(t,N,F?F(Y):Y)},v,Object.assign(Object.assign({},i),{duration:u,easing:c}));else{const Y=v[v.length-1];Ai.set(t,N,b&&Si(Y)?b.toDefaultUnit(Y):Y)}return a&&o(t,e,v,{duration:u,delay:l,easing:c,repeat:M,offset:h},"motion-one"),j.setAnimation(s),s}}const Sm=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function bm(t,e){var n;return typeof t=="string"?e?((n=e[t])!==null&&n!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Am={any:0,all:1};function vm(t,e,{root:n,margin:i,amount:r="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const o=bm(t),a=new WeakMap,s=l=>{l.forEach(g=>{const M=a.get(g.target);if(g.isIntersecting!==!!M)if(g.isIntersecting){const c=e(g);qn(c)?a.set(g.target,c):u.unobserve(g.target)}else M&&(M(g),a.delete(g.target))})},u=new IntersectionObserver(s,{root:n,rootMargin:i,threshold:typeof r=="number"?r:Am[r]});return o.forEach(l=>u.observe(l)),()=>u.disconnect()}function Dm(t,e){return typeof t!=typeof e?!0:Array.isArray(t)&&Array.isArray(e)?!Im(t,e):t!==e}function Im(t,e){const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function xm(t){return typeof t=="object"}function Td(t,e){if(xm(t))return t;if(t&&e)return e[t]}let an;function Om(){if(!an)return;const t=an.sort(zm).map(km);t.forEach(jd),t.forEach(jd),an=void 0}function _a(t){an?ad(an,t):(an=[t],requestAnimationFrame(Om))}function Cm(t){an&&Vp(an,t)}const zm=(t,e)=>t.getDepth()-e.getDepth(),km=t=>t.animateUpdates(),jd=t=>t.next(),Ed=(t,e)=>new CustomEvent(t,{detail:{target:e}});function Ra(t,e,n){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:n}}))}function Sd(t,e,n){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:n}}))}const Um={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:n},{inViewOptions:i={}})=>{const{once:r}=i,o=Yo(i,["once"]);return vm(t,a=>{if(e(),Sd(t,"viewenter",a),!r)return s=>{n(),Sd(t,"viewleave",s)}},o)}},bd=(t,e,n)=>i=>{i.pointerType&&i.pointerType!=="mouse"||(n(),Ra(t,e,i))},Ym={isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:n})=>{const i=bd(t,"hoverstart",e),r=bd(t,"hoverend",n);return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",r)}}},Pm={isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:n})=>{const i=o=>{n(),Ra(t,"pressend",o),window.removeEventListener("pointerup",i)},r=o=>{e(),Ra(t,"pressstart",o),window.addEventListener("pointerup",i)};return t.addEventListener("pointerdown",r),()=>{t.removeEventListener("pointerdown",r),window.removeEventListener("pointerup",i)}}},xr={inView:Um,hover:Ym,press:Pm},Ad=["initial","animate",...Object.keys(xr),"exit"],Fa=new WeakMap;function _m(t={},e){let n,i=e?e.getDepth()+1:0;const r={initial:!0,animate:!0},o={},a={};for(const h of Ad)a[h]=typeof t[h]=="string"?t[h]:e?.getContext()[h];const s=t.initial===!1?"animate":"initial";let u=Td(t[s]||a[s],t.variants)||{},l=Yo(u,["transition"]);const g=Object.assign({},l);function*M(){var h,y;const p=l;l={};const w={};for(const S of Ad){if(!r[S])continue;const v=Td(t[S]);if(v)for(const F in v)F!=="transition"&&(l[F]=v[F],w[F]=Sm((y=(h=v.transition)!==null&&h!==void 0?h:t.transition)!==null&&y!==void 0?y:{},F))}const m=new Set([...Object.keys(l),...Object.keys(p)]),N=[];m.forEach(S=>{var v;l[S]===void 0&&(l[S]=g[S]),Dm(p[S],l[S])&&((v=g[S])!==null&&v!==void 0||(g[S]=Ai.get(n,S)),N.push(Em(n,S,l[S],w[S],om)))}),yield;const j=N.map(S=>S()).filter(Boolean);if(!j.length)return;const b=l;n.dispatchEvent(Ed("motionstart",b)),Promise.all(j.map(S=>S.finished)).then(()=>{n.dispatchEvent(Ed("motioncomplete",b))}).catch(cd)}const c=(h,y)=>()=>{r[h]=y,_a(d)},f=()=>{for(const h in xr){const y=xr[h].isActive(t),p=o[h];y&&!p?o[h]=xr[h].subscribe(n,{enable:c(h,!0),disable:c(h,!1)},t):!y&&p&&(p(),delete o[h])}},d={update:h=>{n&&(t=h,f(),_a(d))},setActive:(h,y)=>{n&&(r[h]=y,_a(d))},animateUpdates:M,getDepth:()=>i,getTarget:()=>l,getOptions:()=>t,getContext:()=>a,mount:h=>(Md(!!h,"Animation state must be mounted with valid Element"),n=h,Fa.set(n,d),f(),()=>{Fa.delete(n),Cm(d);for(const y in o)o[y]()}),isMounted:()=>!!n};return d}function Rm(t){const e={},n=[];for(let i in t){const r=t[i];za(i)&&(Xn[i]&&(i=Xn[i]),n.push(i),i=Dr(i));let o=Array.isArray(r)?r[0]:r;const a=Jn.get(i);a&&(o=Si(r)?a.toDefaultUnit(r):r),e[i]=o}return n.length&&(e.transform=md(n)),e}var Fm=()=>{},vd=(t,e)=>e();function Bm(t,e){const n=Ut(t),i=n?[n]:[],{onEnter:r=vd,onExit:o=vd}=e,[a,s]=W(e.appear?[]:i),[u]=ph();let l,g=!1;function M(d,h){if(!d)return h&&h();g=!0,o(d,()=>{ro(()=>{g=!1,s(y=>y.filter(p=>p!==d)),h&&h()})})}function c(d){const h=l;if(!h)return d&&d();l=void 0,s(y=>[h,...y]),r(h,d??Fm)}const f=e.mode==="out-in"?d=>g||M(d,c):e.mode==="in-out"?d=>c(()=>M(d)):d=>{c(),M(d)};return Vs(d=>{const h=t();return Ut(u)?(u(),d):(h!==d&&(l=h,ro(()=>Ut(()=>f(d)))),h)},e.appear?void 0:n),a}const Dd=se(),Hm=t=>{let e=t.initial!==!1;const n=T(Dd.Provider,{value:()=>e,get children(){return T(Ba.Provider,{value:void 0,get children(){return Bm(gf(()=>t.children),{appear:e,mode:t.exitBeforeEnter?"out-in":"parallel",onExit(i,r){const o=Fa.get(i);o&&o.getOptions().exit?Id(i,r):r()}})}})}});return e=!0,n},Id=(t,e)=>t.addEventListener("motioncomplete",e);function Qm(t,e,n,i){const r=_m(n?.()===!1?{...e(),initial:!1}:e(),i);return Ke(()=>{const o=r.mount(t());st(()=>{n&&e().exit?(r.setActive("exit",!0),Id(t(),o)):o()}),qn(e)&&nt(()=>r.update(e()))}),[r,Rm(r.getTarget())]}const Gm=["initial","animate","inView","inViewOptions","hover","press","variants","transition","exit"],Km=["tag","ref","style","onMotionStart","onMotionComplete","onHoverStart","onHoverEnd","onPressStart","onPressEnd","onViewEnter","onViewLeave"],Ba=se(),xd=t=>{const[e,,n]=St(t,Gm,Km),[i,r]=Qm(()=>o,()=>({...e}),ue(Dd),ue(Ba));let o;return T(Ba.Provider,{value:i,get children(){return T(ui,ht({ref:a=>{o=a,t.ref?.(a)},get component(){return t.tag||"div"},get style(){return V(()=>!!t.style)()?mu(t.style,r):r},get"on:motionstart"(){return t.onMotionStart},get"on:motioncomplete"(){return t.onMotionComplete},get"on:hoverstart"(){return t.onHoverStart},get"on:hoverend"(){return t.onHoverEnd},get"on:pressstart"(){return t.onPressStart},get"on:pressend"(){return t.onPressEnd},get"on:viewenter"(){return t.onViewEnter},get"on:viewleave"(){return t.onViewLeave}},n))}})},ei=new Proxy(xd,{get:(t,e)=>n=>T(xd,ht(n,{tag:e}))}),$m=wt('<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 96 60"><path fill="#fff" fill-rule="evenodd" d="M0 6a6 6 0 0 1 6-6h84a6 6 0 0 1 6 6v48a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6V6Zm10.2 7.8c0-1.325 1.11-2.4 2.48-2.4h69.44c1.37 0 2.48 1.075 2.48 2.4s-1.11 2.4-2.48 2.4H12.68c-1.37 0-2.48-1.074-2.48-2.4Zm70.5 35.4a3.9 3.9 0 1 0 0-7.8 3.9 3.9 0 0 0 0 7.8Zm-70.5-3c0-1.326 1.098-2.4 2.451-2.4H34.15c1.353 0 2.451 1.075 2.451 2.4s-1.098 2.4-2.451 2.4h-21.5c-1.354 0-2.451-1.075-2.451-2.4Zm2.474-13.8c-1.366 0-2.474 1.075-2.474 2.4 0 1.326 1.108 2.4 2.474 2.4h30.452c1.366 0 2.474-1.075 2.474-2.4s-1.108-2.4-2.474-2.4H12.674Z" clip-rule="evenodd">'),Vm=(t={})=>(()=>{const e=$m();return te(e,t,!0,!0),e})(),Wm=wt('<svg viewBox="0 0 96 60" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 0a6 6 0 0 0-6 6v48a6 6 0 0 0 6 6h84a6 6 0 0 0 6-6V6a6 6 0 0 0-6-6H6Zm42.671 10.8c-1.365 0-2.471 1.074-2.471 2.4 0 1.325 1.106 2.4 2.471 2.4H82.13c1.365 0 2.471-1.075 2.471-2.4s-1.106-2.4-2.471-2.4H48.67ZM72 49.2c0-1.326 1.058-2.4 2.364-2.4h7.272c1.306 0 2.364 1.075 2.364 2.4s-1.058 2.4-2.364 2.4h-7.272C73.058 51.6 72 50.525 72 49.2ZM48.702 33.6c-1.382 0-2.502 1.075-2.502 2.4s1.12 2.4 2.502 2.4h15.396c1.382 0 2.502-1.075 2.502-2.4s-1.12-2.4-2.502-2.4H48.702Zm-2.502-9c0-1.326 1.106-2.4 2.471-2.4H82.13c1.365 0 2.471 1.075 2.471 2.4S83.494 27 82.129 27H48.67c-1.365 0-2.471-1.075-2.471-2.4ZM13.265 10.8c-1.693 0-3.065 1.407-3.065 3.144v24.024c0 1.117.569 2.097 1.42 2.653.266.174.59.224.894.138a1.12 1.12 0 0 0 .698-.587c1.385-2.82 3.678-5.021 6.438-6.162.373-.154.637-.504.688-.915.05-.41-.119-.816-.443-1.062a7.227 7.227 0 0 1-2.84-5.78c0-3.962 3.115-7.164 6.945-7.164s6.944 3.203 6.944 7.165a7.227 7.227 0 0 1-2.839 5.78 1.155 1.155 0 0 0-.442 1.061c.05.41.314.76.688.915 2.76 1.14 5.052 3.343 6.437 6.162.142.288.395.501.698.587.304.086.628.036.893-.138a3.162 3.162 0 0 0 1.421-2.653V13.944c0-1.737-1.372-3.144-3.065-3.144h-21.47Z" fill="#fff">'),Zm=(t={})=>(()=>{const e=Wm();return te(e,t,!0,!0),e})(),qm=wt('<svg viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="96" height="96" rx="48" fill="#fff"></rect><path d="M44.972 57.46a1.995 1.995 0 0 1-1.414-.584l-8.484-8.486a2 2 0 1 1 2.826-2.83l7.07 7.07L57.7 39.904a2 2 0 1 1 2.83 2.828L46.386 56.876a1.995 1.995 0 0 1-1.414.584Z" fill="#000">'),Xm=(t={})=>(()=>{const e=qm();return te(e,t,!0,!0),e})(),Jm=wt('<svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity=".75" fill-rule="evenodd" clip-rule="evenodd" d="M50 7.692C26.634 7.692 7.692 26.634 7.692 50S26.634 92.308 50 92.308 92.308 73.366 92.308 50 73.366 7.692 50 7.692ZM0 50C0 22.386 22.386 0 50 0s50 22.386 50 50-22.386 50-50 50S0 77.614 0 50Z" fill="#fff"></path><circle cx="50" cy="50" r="4" fill="#fff">'),t1=(t={})=>(()=>{const e=Jm();return te(e,t,!0,!0),e})(),e1=wt('<svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity=".75" fill-rule="evenodd" clip-rule="evenodd" d="M67.122 11.998a42.158 42.158 0 0 0-34.244 0l-3.397-7.644a50.523 50.523 0 0 1 41.038 0l-3.397 7.644Zm-55.124 20.88a42.158 42.158 0 0 0 0 34.244l-7.644 3.397a50.523 50.523 0 0 1 0-41.038l7.644 3.397Zm76.004 34.244a42.157 42.157 0 0 0 0-34.244l7.644-3.397a50.519 50.519 0 0 1 0 41.038l-7.644-3.397Zm-55.124 20.88a42.157 42.157 0 0 0 34.244 0l3.397 7.644a50.519 50.519 0 0 1-41.038 0l3.397-7.644Z" fill="#fff"></path><circle cx="50" cy="50" r="4" fill="#fff">'),n1=(t={})=>(()=>{const e=e1();return te(e,t,!0,!0),e})(),i1=wt('<svg viewBox="0 0 101 100" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity=".3" fill-rule="evenodd" clip-rule="evenodd" d="M50.301 7.692C26.935 7.692 7.994 26.634 7.994 50S26.935 92.308 50.3 92.308C73.667 92.308 92.61 73.366 92.61 50S73.667 7.692 50.301 7.692ZM.301 50c0-27.614 22.386-50 50-50s50 22.386 50 50-22.386 50-50 50-50-22.386-50-50Z" fill="#fff"></path><circle cx="50.3" cy="50" r="4" fill="#fff"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M29.148 13.36C8.912 25.043 1.977 50.918 13.662 71.154L7 75C-6.807 51.085 1.387 20.506 25.301 6.699l3.847 6.661Z" fill="#fff">'),r1=(t={})=>(()=>{const e=i1();return te(e,t,!0,!0),e})(),Od={SENSING_FRONT:"scan_the_front_side",SENSING_BACK:"scan_the_back_side",FLIP_CARD:"flip_document",WRONG_SIDE:"scanning_wrong_side",BLUR_DETECTED:"blur_detected",GLARE_DETECTED:"glare_detected",OCCLUDED:"occluded",DOCUMENT_FRAMING_CAMERA_TOO_CLOSE:"move_farther",DOCUMENT_FRAMING_CAMERA_TOO_FAR:"move_closer",DOCUMENT_TOO_CLOSE_TO_FRAME_EDGE:"document_too_close_to_edge",DOCUMENT_FRAMING_CAMERA_ANGLE_TOO_STEEP:"camera_angle_too_steep",LIGHTING_TOO_DARK:"lightning_too_dark",LIGHTING_TOO_BRIGHT:"lightning_too_bright"},o1=wt("<div><div><div><div>"),Ha=wt("<div>"),a1=()=>{const{sdkStore:t}=rn();return(()=>{const e=o1(),n=e.firstChild,i=n.firstChild,r=i.firstChild;return xt(e,"mb-79tnxm"),xt(i,"mb-1kst2vr"),xt(r,"mb-qaqzbh"),it(r,T(co,{get children(){return[T(Pe,{get when(){return t.uiState.reticleType==="searching"},get children(){return T(c1,{})}}),T(Pe,{get when(){return t.uiState.reticleType==="processing"},get children(){return T(d1,{})}}),T(Pe,{get when(){return t.uiState.reticleType==="error"},get children(){return T(l1,{})}}),T(Pe,{get when(){return t.uiState.reticleType==="done"},get children(){return T(s1,{})}}),T(Pe,{get when(){return t.uiState.reticleType==="flip"},get children(){return T(u1,{})}})]}})),it(n,T(g1,{get uiState(){return t.uiState}}),null),e})()},s1=()=>T(ei,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,transition:{easing:"ease-in-out",duration:.3}},exit:{opacity:0,scale:5},get children(){return T(Xm,{class:"mb-oegy9h"})}}),u1=()=>(()=>{const t=Ha();return xt(t,"mb-ah9it3"),it(t,T(ei,{class:"mb-pcpdyq",initial:{opacity:0},get animate(){return{opacity:1,rotateY:["180deg"],transition:{rotateY:{duration:(Wt.FLIP_CARD.minDuration-100)/1e3},opacity:{duration:.5}}}},exit:{opacity:0},get children(){return[T(Zm,{class:Cd}),T(Vm,{get class(){return nn(Cd,"mb-12tdqjq")}})]}})),t})(),Cd="mb-3q2rd5",Qa=t=>T(ei.div,{class:"mb-1v17koz",initial:{opacity:0},get animate(){return{opacity:1,background:t.type==="error"?"var(--mb-reticle-error)":"var(--mb-reticle-ok)",transition:{delay:.05}}},transition:{duration:.05},get children(){return t.children}}),c1=()=>T(Qa,{type:"searching",get children(){return T(ei,{class:"mb-5pevkr",animate:{opacity:1,transform:"rotate(360deg)"},transition:{transform:{duration:1,easing:"ease-in-out",repeat:1/0}},get children(){return T(n1,{class:"mb-1i7l9ps"})}})}}),l1=()=>T(Qa,{type:"error",get children(){return T(t1,{class:"mb-1omzjeg"})}}),d1=()=>T(Qa,{type:"processing",get children(){return T(ei,{animate:{opacity:1,rotate:"360deg"},transition:{rotate:{duration:.8,easing:[.23,.58,.58,.23],repeat:1/0}},get children(){return T(r1,{class:"mb-1i7l9ps"})}})}}),g1=t=>{const{t:e}=hn(),n=()=>{if(t.uiState.key in Od)return Od[t.uiState.key]};return(()=>{const i=Ha();return xt(i,"mb-dcm5x3"),it(i,T(Hm,{exitBeforeEnter:!0,get children(){return T(uf,{on:()=>t.uiState.key,get children(){return T(kt,{get when(){return n()},get children(){return T(ei.div,{initial:{opacity:0,transform:"translateY(30px)"},animate:{opacity:1,transform:"translateY(0)",transition:{delay:.05}},transition:{duration:.05},exit:{opacity:0,transform:"translateY(-30px)"},class:"mb-j1awg8",get children(){const r=Ha();return it(r,()=>e[n()]),r}})}})}})}})),i})()},h1=wt('<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 36 36"><path fill="#0062F2" fill-rule="evenodd" d="M12 15c0-3.315 2.685-6 6-6s6 2.685 6 6c0 1.924-1.185 2.96-2.339 3.968-1.095.957-2.161 1.889-2.161 3.532h-3c0-2.732 1.413-3.815 2.656-4.767C20.13 16.985 21 16.319 21 15c0-1.65-1.35-3-3-3s-3 1.35-3 3h-3Zm7.5 9v3h-3v-3h3Z" clip-rule="evenodd">'),f1=(t={})=>(()=>{const e=h1();return te(e,t,!0,!0),e})(),M1=wt("<p>"),y1=wt("<div>"),p1=()=>{const{updateSolidStore:t}=rn(),{t:e}=hn();return(()=>{const n=y1();return it(n,T(My,{overflowPadding:32,get children(){return[T(yy,{onclick:()=>t({helpVisible:!0}),class:m1,get children(){return T(f1,{class:"mb-1slvbtw"})}}),T(gy,{get children(){return T(dy,{get class(){return nn(N1,"mb-style-scope")},get children(){return[T(v0,{}),(()=>{const i=M1();return it(i,()=>e.need_help_tooltip),i})()]}})}})]}})),n})()},m1="mb-posxld",N1="mb-1lgdfjp";var w1=t=>typeof t=="function"&&!t.length?t():t,ni=function(){return ni=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ni.apply(this,arguments)};function zd(t,e,n){if(n||arguments.length===2)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function kd(t){return Array.prototype.slice.call(t)}function Ud(t,e){var n=Math.floor(t);return n===e||n+1===e?t:e}function Yd(){return Date.now()}function Ga(t,e,n){if(e="data-keen-slider-"+e,n===null)return t.removeAttribute(e);t.setAttribute(e,n||"")}function Or(t,e){return e=e||document,typeof t=="function"&&(t=t(e)),Array.isArray(t)?t:typeof t=="string"?kd(e.querySelectorAll(t)):t instanceof HTMLElement?[t]:t instanceof NodeList?kd(t):[]}function vi(t){t.raw&&(t=t.raw),t.cancelable&&!t.defaultPrevented&&t.preventDefault()}function Di(t){t.raw&&(t=t.raw),t.stopPropagation&&t.stopPropagation()}function Pd(){var t=[];return{add:function(e,n,i,r){e.addListener?e.addListener(i):e.addEventListener(n,i,r),t.push([e,n,i,r])},input:function(e,n,i,r){this.add(e,n,function(o){return function(a){a.nativeEvent&&(a=a.nativeEvent);var s=a.changedTouches||[],u=a.targetTouches||[],l=a.detail&&a.detail.x?a.detail:null;return o({id:l?l.identifier?l.identifier:"i":u[0]?u[0]?u[0].identifier:"e":"d",idChanged:l?l.identifier?l.identifier:"i":s[0]?s[0]?s[0].identifier:"e":"d",raw:a,x:l&&l.x?l.x:u[0]?u[0].screenX:l?l.x:a.pageX,y:l&&l.y?l.y:u[0]?u[0].screenY:l?l.y:a.pageY})}}(i),r)},purge:function(){t.forEach(function(e){e[0].removeListener?e[0].removeListener(e[2]):e[0].removeEventListener(e[1],e[2],e[3])}),t=[]}}}function Ka(t,e,n){return Math.min(Math.max(t,e),n)}function ve(t){return(t>0?1:0)-(t<0?1:0)||+t}function _d(t){var e=t.getBoundingClientRect();return{height:Ud(e.height,t.offsetHeight),width:Ud(e.width,t.offsetWidth)}}function Zt(t,e,n,i){var r=t&&t[e];return r==null?n:i&&typeof r=="function"?r():r}function je(t){return Math.round(1e6*t)/1e6}function L1(t){var e,n,i,r,o,a;function s(c){a||(a=c),u(!0);var f=c-a;f>i&&(f=i);var d=r[n];if(d[3]<f)return n++,s(c);var h=d[2],y=d[4],p=d[0],w=d[1]*(0,d[5])(y===0?1:(f-h)/y);if(w&&t.track.to(p+w),f<i)return g();a=null,u(!1),l(null),t.emit("animationEnded")}function u(c){e.active=c}function l(c){e.targetIdx=c}function g(){var c;c=s,o=window.requestAnimationFrame(c)}function M(){var c;c=o,window.cancelAnimationFrame(c),u(!1),l(null),a&&t.emit("animationStopped"),a=null}return e={active:!1,start:function(c){if(M(),t.track.details){var f=0,d=t.track.details.position;n=0,i=0,r=c.map(function(h){var y,p=Number(d),w=(y=h.earlyExit)!==null&&y!==void 0?y:h.duration,m=h.easing,N=h.distance*m(w/h.duration)||0;d+=N;var j=i;return i+=w,f+=N,[p,h.distance,j,i,h.duration,m]}),l(t.track.distToIdx(f)),g(),t.emit("animationStarted")}},stop:M,targetIdx:null}}function T1(t){var e,n,i,r,o,a,s,u,l,g,M,c,f,d,h=1/0,y=[],p=null,w=0;function m(x){C(w+x)}function N(x){var k=j(w+x).abs;return v(k)?k:null}function j(x){var k=Math.floor(Math.abs(je(x/n))),D=je((x%n+n)%n);D===n&&(D=0);var P=ve(x),R=s.indexOf(zd([],s,!0).reduce(function(Z,tt){return Math.abs(tt-D)<Math.abs(Z-D)?tt:Z})),H=R;return P<0&&k++,R===a&&(H=0,k+=P>0?1:-1),{abs:H+k*a*P,origin:R,rel:H}}function b(x,k,D){var P;if(k||!Y())return S(x,D);if(!v(x))return null;var R=j(D??w),H=R.abs,Z=x-R.rel,tt=H+Z;P=S(tt);var at=S(tt-a*ve(Z));return(at!==null&&Math.abs(at)<Math.abs(P)||P===null)&&(P=at),je(P)}function S(x,k){if(k==null&&(k=je(w)),!v(x)||x===null)return null;x=Math.round(x);var D=j(k),P=D.abs,R=D.rel,H=D.origin,Z=U(x),tt=(k%n+n)%n,at=s[H],bt=Math.floor((x-(P-R))/a)*n;return je(at-tt-at+s[Z]+bt+(H===a?n:0))}function v(x){return F(x)===x}function F(x){return Ka(x,l,g)}function Y(){return r.loop}function U(x){return(x%a+a)%a}function C(x){var k;k=x-w,y.push({distance:k,timestamp:Yd()}),y.length>6&&(y=y.slice(-6)),w=je(x);var D=I().abs;if(D!==p){var P=p!==null;p=D,P&&t.emit("slideChanged")}}function I(x){var k=x?null:function(){if(a){var D=Y(),P=D?(w%n+n)%n:w,R=(D?w%n:w)-o[0][2],H=0-(R<0&&D?n-Math.abs(R):R),Z=0,tt=j(w),at=tt.abs,bt=tt.rel,Ft=o[bt][2],Lt=o.map(function(B,ct){var Nt=H+Z;(Nt<0-B[0]||Nt>1)&&(Nt+=(Math.abs(Nt)>n-1&&D?n:0)*ve(-Nt));var Ee=ct-bt,oe=ve(Ee),L=Ee+at;D&&(oe===-1&&Nt>Ft&&(L+=a),oe===1&&Nt<Ft&&(L-=a),M!==null&&L<M&&(Nt+=n),c!==null&&L>c&&(Nt-=n));var A=Nt+B[0]+B[1],Q=Math.max(Nt>=0&&A<=1?1:A<0||Nt>1?0:Nt<0?Math.min(1,(B[0]+Nt)/B[0]):(1-Nt)/B[0],0);return Z+=B[0]+B[1],{abs:L,distance:r.rtl?-1*Nt+1-B[0]:Nt,portion:Q,size:B[0]}});return at=F(at),bt=U(at),{abs:F(at),length:i,max:d,maxIdx:g,min:f,minIdx:l,position:w,progress:D?P/n:w/i,rel:bt,slides:Lt,slidesLength:n}}}();return e.details=k,t.emit("detailsChanged"),k}return e={absToRel:U,add:m,details:null,distToIdx:N,idxToDist:b,init:function(x){if(function(){if(r=t.options,o=(r.trackConfig||[]).map(function(R){return[Zt(R,"size",1),Zt(R,"spacing",0),Zt(R,"origin",0)]}),a=o.length){n=je(o.reduce(function(R,H){return R+H[0]+H[1]},0));var D,P=a-1;i=je(n+o[0][2]-o[P][0]-o[P][2]-o[P][1]),s=o.reduce(function(R,H){if(!R)return[0];var Z=o[R.length-1],tt=R[R.length-1]+(Z[0]+Z[2])+Z[1];return tt-=H[2],R[R.length-1]>tt&&(tt=R[R.length-1]),tt=je(tt),R.push(tt),(!D||D<tt)&&(u=R.length-1),D=tt,R},null),i===0&&(u=0),s.push(je(n))}}(),!a)return I(!0);var k;(function(){var D=t.options.range,P=t.options.loop;M=l=P?Zt(P,"min",-1/0):0,c=g=P?Zt(P,"max",h):u;var R=Zt(D,"min",null),H=Zt(D,"max",null);R!==null&&(l=R),H!==null&&(g=H),f=l===-1/0?l:t.track.idxToDist(l||0,!0,0),d=g===h?g:b(g,!0,0),H===null&&(c=g),Zt(D,"align",!1)&&g!==h&&o[U(g)][2]===0&&(d-=1-o[U(g)][0],g=N(d-w)),f=je(f),d=je(d)})(),k=x,Number(k)===k?m(S(F(x))):I()},to:C,velocity:function(){var x=Yd(),k=y.reduce(function(D,P){var R=P.distance,H=P.timestamp;return x-H>200||(ve(R)!==ve(D.distance)&&D.distance&&(D={distance:0,lastTimestamp:0,time:0}),D.time&&(D.distance+=R),D.lastTimestamp&&(D.time+=H-D.lastTimestamp),D.lastTimestamp=H),D},{distance:0,lastTimestamp:0,time:0});return k.distance/k.time||0}}}function j1(t){var e,n,i,r,o,a,s,u;function l(p){return 2*p}function g(p){return Ka(p,s,u)}function M(p){return 1-Math.pow(1-p,3)}function c(){return i?t.track.velocity():0}function f(){y();var p=t.options.mode==="free-snap",w=t.track,m=c();r=ve(m);var N=t.track.details,j=[];if(m||!p){var b=d(m),S=b.dist,v=b.dur;if(v=l(v),S*=r,p){var F=w.idxToDist(w.distToIdx(S),!0);F&&(S=F)}j.push({distance:S,duration:v,easing:M});var Y=N.position,U=Y+S;if(U<o||U>a){var C=U<o?o-Y:a-Y,I=0,x=m;if(ve(C)===r){var k=Math.min(Math.abs(C)/Math.abs(S),1),D=function(H){return 1-Math.pow(1-H,1/3)}(k)*v;j[0].earlyExit=D,x=m*(1-k)}else j[0].earlyExit=0,I+=C;var P=d(x,100),R=P.dist*r;t.options.rubberband&&(j.push({distance:R,duration:l(P.dur),easing:M}),j.push({distance:-R+I,duration:500,easing:M}))}t.animator.start(j)}else t.moveToIdx(g(N.abs),!0,{duration:500,easing:function(H){return 1+--H*H*H*H*H}})}function d(p,w){w===void 0&&(w=1e3);var m=147e-9+(p=Math.abs(p))/w;return{dist:Math.pow(p,2)/m,dur:p/m}}function h(){var p=t.track.details;p&&(o=p.min,a=p.max,s=p.minIdx,u=p.maxIdx)}function y(){t.animator.stop()}t.on("updated",h),t.on("optionsChanged",h),t.on("created",h),t.on("dragStarted",function(){i=!1,y(),e=n=t.track.details.abs}),t.on("dragChecked",function(){i=!0}),t.on("dragEnded",function(){var p=t.options.mode;p==="snap"&&function(){var w=t.track,m=t.track.details,N=m.position,j=ve(c());(N>a||N<o)&&(j=0);var b=e+j;m.slides[w.absToRel(b)].portion===0&&(b-=j),e!==n&&(b=n),ve(w.idxToDist(b,!0))!==j&&(b+=j),b=g(b);var S=w.idxToDist(b,!0);t.animator.start([{distance:S,duration:500,easing:function(v){return 1+--v*v*v*v*v}}])}(),p!=="free"&&p!=="free-snap"||f()}),t.on("dragged",function(){n=t.track.details.abs})}function E1(t){var e,n,i,r,o,a,s,u,l,g,M,c,f,d,h,y,p,w,m=Pd();function N(I){if(a&&u===I.id){var x=v(I);if(l){if(!S(I))return b(I);g=x,l=!1,t.emit("dragChecked")}if(y)return g=x;vi(I);var k=function(P){if(p===-1/0&&w===1/0)return P;var R=t.track.details,H=R.length,Z=R.position,tt=Ka(P,p-Z,w-Z);if(H===0)return 0;if(!t.options.rubberband)return tt;if(Z<=w&&Z>=p||Z<p&&n>0||Z>w&&n<0)return P;var at=(Z<p?Z-p:Z-w)/H,bt=r*H,Ft=Math.abs(at*bt),Lt=Math.max(0,1-Ft/o*2);return Lt*Lt*P}(s(g-x)/r*i);n=ve(k);var D=t.track.details.position;(D>p&&D<w||D===p&&n>0||D===w&&n<0)&&Di(I),M+=k,!c&&Math.abs(M*r)>5&&(c=!0),t.track.add(k),g=x,t.emit("dragged")}}function j(I){!a&&t.track.details&&t.track.details.length&&(M=0,a=!0,c=!1,l=!0,u=I.id,S(I),g=v(I),t.emit("dragStarted"))}function b(I){a&&u===I.idChanged&&(a=!1,t.emit("dragEnded"))}function S(I){var x=F(),k=x?I.y:I.x,D=x?I.x:I.y,P=f!==void 0&&d!==void 0&&Math.abs(d-D)<=Math.abs(f-k);return f=k,d=D,P}function v(I){return F()?I.y:I.x}function F(){return t.options.vertical}function Y(){r=t.size,o=F()?window.innerHeight:window.innerWidth;var I=t.track.details;I&&(p=I.min,w=I.max)}function U(I){c&&(Di(I),vi(I))}function C(){if(m.purge(),t.options.drag&&!t.options.disabled){var I;I=t.options.dragSpeed||1,s=typeof I=="function"?I:function(k){return k*I},i=t.options.rtl?-1:1,Y(),e=t.container,function(){var k="data-keen-slider-clickable";Or("[".concat(k,"]:not([").concat(k,"=false])"),e).map(function(D){m.add(D,"dragstart",Di),m.add(D,"mousedown",Di),m.add(D,"touchstart",Di)})}(),m.add(e,"dragstart",function(k){vi(k)}),m.add(e,"click",U,{capture:!0}),m.input(e,"ksDragStart",j),m.input(e,"ksDrag",N),m.input(e,"ksDragEnd",b),m.input(e,"mousedown",j),m.input(e,"mousemove",N),m.input(e,"mouseleave",b),m.input(e,"mouseup",b),m.input(e,"touchstart",j,{passive:!0}),m.input(e,"touchmove",N,{passive:!1}),m.input(e,"touchend",b),m.input(e,"touchcancel",b),m.add(window,"wheel",function(k){a&&vi(k)});var x="data-keen-slider-scrollable";Or("[".concat(x,"]:not([").concat(x,"=false])"),t.container).map(function(k){return function(D){var P;m.input(D,"touchstart",function(R){P=v(R),y=!0,h=!0},{passive:!0}),m.input(D,"touchmove",function(R){var H=F(),Z=H?D.scrollHeight-D.clientHeight:D.scrollWidth-D.clientWidth,tt=P-v(R),at=H?D.scrollTop:D.scrollLeft,bt=H&&D.style.overflowY==="scroll"||!H&&D.style.overflowX==="scroll";if(P=v(R),(tt<0&&at>0||tt>0&&at<Z)&&h&&bt)return y=!0;h=!1,vi(R),y=!1}),m.input(D,"touchend",function(){y=!1})}(k)})}}t.on("updated",Y),t.on("optionsChanged",C),t.on("created",C),t.on("destroyed",m.purge)}function S1(t){var e,n,i=null;function r(f,d,h){t.animator.active?a(f,d,h):requestAnimationFrame(function(){return a(f,d,h)})}function o(){r(!1,!1,n)}function a(f,d,h){var y=0,p=t.size,w=t.track.details;if(w&&e){var m=w.slides;e.forEach(function(N,j){if(f)!i&&d&&u(N,null,h),l(N,null,h);else{if(!m[j])return;var b=m[j].size*p;!i&&d&&u(N,b,h),l(N,m[j].distance*p-y,h),y+=b}})}}function s(f){return t.options.renderMode==="performance"?Math.round(f):f}function u(f,d,h){var y=h?"height":"width";d!==null&&(d=s(d)+"px"),f.style["min-"+y]=d,f.style["max-"+y]=d}function l(f,d,h){if(d!==null){d=s(d);var y=h?d:0;d="translate3d(".concat(h?0:d,"px, ").concat(y,"px, 0)")}f.style.transform=d,f.style["-webkit-transform"]=d}function g(){e&&(a(!0,!0,n),e=null),t.on("detailsChanged",o,!0)}function M(){r(!1,!0,n)}function c(){g(),n=t.options.vertical,t.options.disabled||t.options.renderMode==="custom"||(i=Zt(t.options.slides,"perView",null)==="auto",t.on("detailsChanged",o),(e=t.slides).length&&M())}t.on("created",c),t.on("optionsChanged",c),t.on("beforeOptionsChanged",function(){g()}),t.on("updated",M),t.on("destroyed",g)}function b1(t,e){return function(n){var i,r,o,a,s,u=Pd();function l(S){var v;Ga(n.container,"reverse",(v=n.container,window.getComputedStyle(v,null).getPropertyValue("direction")!=="rtl"||S?null:"")),Ga(n.container,"v",n.options.vertical&&!S?"":null),Ga(n.container,"disabled",n.options.disabled&&!S?"":null)}function g(){M()&&y()}function M(){var S=null;if(a.forEach(function(F){F.matches&&(S=F.__media)}),S===i)return!1;i||n.emit("beforeOptionsChanged"),i=S;var v=S?o.breakpoints[S]:o;return n.options=ni(ni({},o),v),l(),j(),b(),w(),!0}function c(S){var v=_d(S);return(n.options.vertical?v.height:v.width)/n.size||1}function f(){return n.options.trackConfig.length}function d(S){for(var v in i=!1,o=ni(ni({},e),S),u.purge(),r=n.size,a=[],o.breakpoints||[]){var F=window.matchMedia(v);F.__media=v,a.push(F),u.add(F,"change",g)}u.add(window,"orientationchange",N),u.add(window,"resize",m),M()}function h(S){n.animator.stop();var v=n.track.details;n.track.init(S??(v?v.abs:0))}function y(S){h(S),n.emit("optionsChanged")}function p(S,v){if(S)return d(S),void y(v);j(),b();var F=f();w(),f()!==F?y(v):h(v),n.emit("updated")}function w(){var S=n.options.slides;if(typeof S=="function")return n.options.trackConfig=S(n.size,n.slides);for(var v=n.slides,F=v.length,Y=typeof S=="number"?S:Zt(S,"number",F,!0),U=[],C=Zt(S,"perView",1,!0),I=Zt(S,"spacing",0,!0)/n.size||0,x=C==="auto"?I:I/C,k=Zt(S,"origin","auto"),D=0,P=0;P<Y;P++){var R=C==="auto"?c(v[P]):1/C-I+x,H=k==="center"?.5-R/2:k==="auto"?0:k;U.push({origin:H,size:R,spacing:I}),D+=R}if(D+=I*(Y-1),k==="auto"&&!n.options.loop&&C!==1){var Z=0;U.map(function(tt){var at=D-Z;return Z+=tt.size+I,at>=1||(tt.origin=1-at-(D>1?0:1-D)),tt})}n.options.trackConfig=U}function m(){j();var S=n.size;n.options.disabled||S===r||(r=S,p())}function N(){m(),setTimeout(m,500),setTimeout(m,2e3)}function j(){var S=_d(n.container);n.size=(n.options.vertical?S.height:S.width)||1}function b(){n.slides=Or(n.options.selector,n.container)}n.container=(s=Or(t,document)).length?s[0]:null,n.destroy=function(){u.purge(),n.emit("destroyed"),l(!0)},n.prev=function(){n.moveToIdx(n.track.details.abs-1,!0)},n.next=function(){n.moveToIdx(n.track.details.abs+1,!0)},n.update=p,d(n.options)}}var A1=function(t,e,n){try{return function(i,r){var o,a={};return o={emit:function(s){a[s]&&a[s].forEach(function(l){l(o)});var u=o.options&&o.options[s];u&&u(o)},moveToIdx:function(s,u,l){var g=o.track.idxToDist(s,u);if(g){var M=o.options.defaultAnimation;o.animator.start([{distance:g,duration:Zt(l||M,"duration",500),easing:Zt(l||M,"easing",function(c){return 1+--c*c*c*c*c})}])}},on:function(s,u,l){l===void 0&&(l=!1),a[s]||(a[s]=[]);var g=a[s].indexOf(u);g>-1?l&&delete a[s][g]:l||a[s].push(u)},options:i},function(){if(o.track=T1(o),o.animator=L1(o),r)for(var s=0,u=r;s<u.length;s++)(0,u[s])(o);o.track.init(o.options.initial||0),o.emit("created")}(),o}(e,zd([b1(t,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),S1,E1,j1],n||[],!0))}catch(i){console.error(i)}};const v1=(t,...e)=>{let n,i;const r=()=>w1(t),[o,a]=W(r()?.initial||0),s=()=>n&&n.destroy(),u=(g={})=>({selector:i.childNodes,...r(),...g}),l=()=>n?.update(u());return[g=>{i=g,i.classList.add("keen-slider"),Ke(()=>{n=new A1(i,u(),e),n.on("slideChanged",()=>a(n.track.details.rel))}),st(s),typeof t=="function"&&nt(Se(()=>t,l))},{current:o,next:()=>n&&n.next(),prev:()=>n&&n.prev(),details:()=>n?n.track.details:{},slider:()=>n,moveTo:(g,M=250,c=!1,f)=>n?.moveToIdx(g,c,{duration:M,easing:f}),destroy:s,update:l}]},Cr=t=>{const[e]=St(t,["class"]);return T(ur,ht(t,{get class(){return nn(e.class,"mb-1epo54l",t.variant==="secondary"&&"mb-1ohbwoy")},get children(){return t.children}}))},D1="data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjgwIiBoZWlnaHQ9IjE5NyIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDI4MCAxOTciPgogIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0yNDEuMjY3IDEzLjQyNkgzOC43MjlhOS4wOTUgOS4wOTUgMCAwIDAtOS4wOTUgOS4wOTVWMTQ0LjU1YTkuMDk1IDkuMDk1IDAgMCAwIDkuMDk1IDkuMDk1aDIwMi41MzhhOS4wOTUgOS4wOTUgMCAwIDAgOS4wOTUtOS4wOTVWMjIuNTIx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I4LTcuOTI4LTcuOTI4SDM2LjU2M3YuMDA0Wm0xMDEuNTA5IDE3Ni40MjRjNy42MDMgMCAxMy43NjctNi4xNjQgMTMuNzY3LTEzLjc2N3MtNi4xNjQtMTMuNzY3LTEzLjc2Ny0xMy43NjctMTMuNzY2IDYuMTY0LTEzLjc2NiAxMy43NjcgNi4xNjMgMTMuNzY3IDEzLjc2NiAxMy43NjdaIi8+CiAgPHBhdGggZmlsbD0iI2ZmZiIgZD0ibTEzOS43MiAxNzYuNjYxIDIuNjQxLTIuNjQxYTEuMTY1IDEuMTY1IDAgMCAwIDAtMS42NTIgMS4xNjcgMS4xNjcgMCAwIDAtMS42NTIgMGwtMi42NDEgMi42NDEtMi42NDEtMi42NDFhMS4xNjcgMS4xNjcgMCAwIDAtMS42NTIgMCAxLjE2NSAxLjE2NSAwIDAgMCAwIDEuNjUybDIuNjQxIDIuNjQxLTIuNjQxIDIuNjQyYTEuMTY1IDEuMTY1IDAgMCAwIC44MjYgMS45OTJjLjI5OCAwIC41OTctLjExMi44MjYtLjM0bDIuNjQxLTIuNjQyIDIuNjQxIDIuNjQyYy4yMjkuMjI4LjUyOC4zNC44MjYuMzRhMS4xNjUgMS4xNjUgMCAwIDAgLjgyNi0xLjk5MmwtMi42NDEtMi42NDJaIi8+Cjwvc3ZnPg==",Rd="mb-2a9seb",Fd="mb-1mieit8",Bd=nn("mb-style-scope","mb-1ogpkgw"),O1=wt('<div><div><div><div><img alt="" srcset=""></div><div><h2></h2><p></p></div></div><div><div><img alt="" srcset=""></div><div><h2></h2><p></p></div></div><div><div><img alt="" srcset=""></div><div><h2></h2><p></p></div></div></div><div></div><div>'),Hd=wt("<div>"),C1=()=>{let t;const{solidStore:e,updateSolidStore:n}=rn(),[i,{current:r,next:o,prev:a}]=v1(),s=()=>{n({helpVisible:!1}),e.captureSdk?.startCapture()};Ke(()=>{i(t),e.captureSdk?.pauseCapture()});const{t:u}=hn();return T(dr,{open:!0,get children(){return T(lr,{get children(){return[T(Jo,{class:Fd}),(()=>{const l=Hd();return xt(l,Rd),it(l,T(cr,{onEscapeKeyDown:s,onPointerDownOutside:s,onOpenAutoFocus:g=>g.preventDefault(),class:Bd,get children(){return[T(qo,{onClick:s,class:"mb-8u3v3h",get children(){return T(Da,{class:"mb-h83tsy"})}}),(()=>{const g=O1(),M=g.firstChild,c=M.firstChild,f=c.firstChild,d=f.firstChild,h=f.nextSibling,y=h.firstChild,p=y.nextSibling,w=c.nextSibling,m=w.firstChild,N=m.firstChild,j=m.nextSibling,b=j.firstChild,S=b.nextSibling,v=w.nextSibling,F=v.firstChild,Y=F.firstChild,U=F.nextSibling,C=U.firstChild,I=C.nextSibling,x=M.nextSibling,k=x.nextSibling;xt(g,"mb-d1kpoi");const D=t;return typeof D=="function"?ou(D,M):t=M,Ve(d,"src",D1),it(y,()=>u.tutorial_fields_visible_title),it(p,()=>u.tutorial_fields_visible_details),Ve(N,"src",I1),it(b,()=>u.tutorial_harsh_light_title),it(S,()=>u.tutorial_harsh_light_details),Ve(Y,"src",x1),it(C,()=>u.tutorial_keep_still_title),it(I,()=>u.tutorial_keep_still_details),xt(x,"mb-slxsc0"),it(x,T(iu,{get each(){return new Array(3).fill(null)},children:(P,R)=>(()=>{const H=Hd();return pe(()=>xt(H,nn("mb-1777uja",R()===r()&&"mb-rp0tll"))),H})()})),xt(k,"mb-4sy7j9"),it(k,T(Cr,{get disabled(){return r()===0},onClick:()=>a(),variant:"secondary",get children(){return u.back}}),null),it(k,T(co,{get children(){return[T(Pe,{get when(){return r()!==2},get children(){return T(Cr,{onClick:()=>o(),get children(){return u.next}})}}),T(Pe,{get when(){return r()===2},get children(){return T(Cr,{onClick:s,get children(){return u.done}})}})]}}),null),g})()]}})),l})()]}})}})},z1="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyODAiIGhlaWdodD0iMjA2IiBmaWxsPSJub25lIj4KICA8cGF0aCBmaWxsPSI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UgMTc3LjA4MWExLjE2OCAxLjE2OCAwIDAgMC0xLjY1MiAwbC02LjE0MSA2LjExOS0yLjY3NC0yLjY2NGExLjE2OCAxLjE2OCAwIDAgMC0xLjY1MiAwIDEuMTYgMS4xNiAwIDAgMCAwIDEuNjQ2bDMuNDYzIDMuNDU1Yy4yMjguMjI4LjUyNy4zNC44MjYuMzRoLjA3NGMuMjk5IDAgLjU5OC0uMTEyLjgyNi0uMzRsNi45My02LjkwNWExLjE1OCAxLjE1OCAwIDAgMCAwLTEuNjQ2di0uMDA1WiIvPgo8L3N2Zz4=",k1=wt('<div><img alt="" srcset=""><h2></h2><p>'),U1=wt("<div>"),Y1=()=>{const[t,e]=W(!0),{solidStore:n}=rn(),i=()=>{e(!1),n.captureSdk?.startCapture()};Ke(()=>{n.captureSdk?.pauseCapture()});const{t:r}=hn();return T(dr,{get open(){return t()},get children(){return T(lr,{get children(){return[T(Jo,{class:Fd}),(()=>{const o=U1();return xt(o,Rd),it(o,T(cr,{onEscapeKeyDown:i,onPointerDownOutside:i,class:Bd,get children(){return[T(qo,{onClick:i,class:"mb-8u3v3h",get children(){return T(Da,{class:"mb-h83tsy"})}}),(()=>{const a=k1(),s=a.firstChild,u=s.nextSibling,l=u.nextSibling;return xt(a,"mb-zjp32o"),Ve(s,"src",z1),xt(s,"mb-zgw7tn"),it(u,()=>r.tutorial_fields_visible_title),it(l,()=>r.tutorial_fields_visible_details),it(a,T(Cr,{onClick:i,class:"mb-1r8ti85",get children(){return r.tutorial_fields_visible_start}}),null),a})()]}})),o})()]}})}})},P1=wt('<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 115 53"><path fill="#fff" d="M35.088 19.572c1.314 0 2.178-.891 2.178-2.16 0-1.287-.855-2.151-2.178-2.151h-2.601v6.579h1.152v-2.268h1.449Zm-.225-3.285c.765 0 1.197.396 1.197 1.116 0 .72-.423 1.143-1.215 1.143h-1.206v-2.259h1.224Zm2.909 3.321c0 1.386 1 2.34 2.376 2.34 1.377 0 2.376-.954 2.376-2.34s-.999-2.34-2.376-2.34c-1.377 0-2.376.954-2.376 2.34Zm1.098 0c0-.81.522-1.359 1.278-1.359s1.278.549 1.278 1.359c0 .81-.522 1.359-1.278 1.359s-1.278-.549-1.278-1.359Zm5.466 2.232h1.07l.613-1.908c.225-.729.306-1.044.35-1.251.037.225.136.648.316 1.233l.612 1.926h1.026l1.539-4.446H48.7l-.594 1.908c-.081.279-.225.81-.297 1.143a16.122 16.122 0 0 0-.288-1.143l-.594-1.908h-1.116l-.612 1.908c-.144.441-.225.72-.306 1.152a14.615 14.615 0 0 0-.27-1.152l-.585-1.908h-1.143l1.44 4.446Zm8.14.117c1.16 0 1.97-.585 2.16-1.557h-1.017c-.126.423-.522.657-1.125.657-.73 0-1.143-.396-1.224-1.179l3.348-.009v-.333c0-1.386-.846-2.277-2.178-2.277-1.305 0-2.214.963-2.214 2.358 0 1.377.927 2.34 2.25 2.34Zm-.027-3.798c.657 0 1.08.405 1.08 1.017h-2.232c.108-.666.504-1.017 1.152-1.017Zm6.018-.783a1.948 1.948 0 0 0-.486-.063c-.594 0-1.017.297-1.206.738l-.063-.648h-1.035v4.437h1.098v-2.16c0-.864.495-1.287 1.287-1.287h.405v-1.017Zm2.763 4.581c1.16 0 1.97-.585 2.16-1.557h-1.018c-.126.423-.522.657-1.125.657-.729 0-1.143-.396-1.224-1.179l3.348-.009v-.333c0-1.386-.846-2.277-2.178-2.277-1.305 0-2.214.963-2.214 2.358 0 1.377.927 2.34 2.25 2.34Zm-.028-3.798c.657 0 1.08.405 1.08 1.017H60.05c.108-.666.504-1.017 1.152-1.017Zm5.055 3.798c.675 0 1.251-.297 1.521-.81l.072.693h1.008v-6.696H67.77v2.817c-.279-.441-.828-.702-1.449-.702-1.34 0-2.15.99-2.15 2.376 0 1.377.8 2.322 2.087 2.322Zm.243-1.008c-.765 0-1.233-.558-1.233-1.35s.468-1.359 1.233-1.359c.765 0 1.26.558 1.26 1.359 0 .801-.495 1.35-1.26 1.35Zm7.305.891.072-.693c.261.513.828.81 1.494.81 1.278 0 2.115-.945 2.115-2.313 0-1.404-.774-2.394-2.043-2.394-.675 0-1.269.297-1.557.792v-2.898h-1.098v6.696h1.017Zm.09-2.241c0-.801.495-1.359 1.251-1.359.774 0 1.233.567 1.233 1.359s-.459 1.35-1.233 1.35c-.756 0-1.25-.549-1.25-1.35Zm4.092 4.302c.243.063.513.099.819.099.728 0 1.197-.342 1.53-1.17l2.177-5.436H81.38l-1.206 3.24-1.142-3.24H77.87l1.791 4.635-.126.333c-.189.522-.459.621-.89.621h-.657v.918ZM19.816 35.596l-2.89-7.432H15v9.672h1.314V30.23l2.996 7.648h.959l3.022-7.716v7.675h1.355v-9.672h-1.939l-2.89 7.432Zm8.837-7.433h-1.422v9.673h1.422v-9.672Zm19.01 4.828a3.188 3.188 0 0 0 .59-1.87c0-.791-.34-1.53-.958-2.08-.637-.566-1.523-.876-2.497-.876h-3.925v9.673h1.422v-3.46h2.303l2.008 3.459h1.688l-2.15-3.696a3.277 3.277 0 0 0 1.519-1.15Zm-.86-1.856a1.925 1.925 0 0 1-.548 1.369c-.362.362-.87.561-1.43.561h-2.532v-3.573h2.532c1.128 0 1.979.706 1.979 1.643ZM54.28 28c-1.334 0-2.537.525-3.392 1.477-.822.918-1.276 2.169-1.276 3.523s.453 2.612 1.276 3.529c.852.948 2.057 1.47 3.392 1.47 1.341 0 2.55-.523 3.404-1.47.824-.916 1.278-2.17 1.278-3.53 0-1.36-.454-2.605-1.278-3.522C56.83 28.523 55.62 28 54.28 28Zm0 8.645a2.997 2.997 0 0 1-1.27-.278 3.047 3.047 0 0 1-1.04-.79c-.586-.678-.909-1.593-.909-2.577s.323-1.892.91-2.572a3.017 3.017 0 0 1 2.31-1.073c.892 0 1.715.381 2.316 1.074.59.68.916 1.593.916 2.57 0 .979-.325 1.899-.916 2.578a3.064 3.064 0 0 1-1.044.79c-.4.184-.834.28-1.273.278Zm12.474-3.883c.83-.466 1.322-1.283 1.322-2.199 0-1.413-1.233-2.4-2.995-2.4h-4.17v9.673h4.37c1.736 0 2.996-1.175 2.996-2.794.001-.972-.58-1.839-1.523-2.28Zm-1.431 3.747h-2.99v-3.002h2.786c1.022 0 1.71.557 1.71 1.386 0 .981-.591 1.616-1.506 1.616Zm-.364-4.303h-2.627v-2.714h2.787c.917 0 1.507.484 1.507 1.235.001.737-.515 1.48-1.667 1.48v-.001Zm6.787-4.043h-1.422v9.673h6.222v-1.355h-4.8v-8.318Zm7.808 0h-1.422v9.673h1.422v-9.672Zm8.93 7.157-4.954-7.126-.021-.03h-1.375v9.672h1.341v-7.51l5.219 7.51h1.131v-9.672h-1.34v7.156Zm7.694-2.9 3.72-4.257H98.16l-4.333 4.948v-4.947h-1.422v9.672h1.422V35.03l1.38-1.56 3.07 4.367H100l-3.822-5.417Zm-58.265 2.144c-.634 1.468-1.448 2.094-2.726 2.094-.874 0-1.674-.38-2.253-1.069-.571-.678-.885-1.598-.885-2.59 0-.983.307-1.896.864-2.572.571-.691 1.364-1.072 2.234-1.072 1.177 0 2.039.597 2.633 1.825l.025.052h1.488l-.007-.042c-.035-.204-.109-.394-.18-.581l-.023-.06a3.979 3.979 0 0 0-1.522-1.872c-.685-.45-1.511-.677-2.455-.677-1.29 0-2.453.525-3.277 1.478-.793.917-1.23 2.168-1.23 3.522 0 1.372.44 2.629 1.237 3.538.839.956 1.988 1.462 3.324 1.462.936 0 1.758-.247 2.445-.733.115-.082.226-.17.332-.264.696-.615 1.223-1.491 1.41-2.343l.004-.022c.007-.03.012-.06.017-.088l.007-.042h-1.439l-.023.056Z">'),_1=(t={})=>(()=>{const e=P1();return te(e,t,!0,!0),e})(),R1=wt('<div><div></div><video src="">'),F1=wt("<div>"),Qd=()=>{let t;const{solidStore:e,sdkStore:n}=rn(),{t:i}=hn();return nt(()=>{const r=e.captureSdk;!n||!r||r.startCameraStream(t).then(async()=>{e.uiSettings.showTutorial||await r.startCapture()})}),(()=>{const r=R1(),o=r.firstChild,a=o.nextSibling;it(r,T(kt,{get when(){return!n.isQueryingCameras},get fallback(){return(()=>{const u=F1();return it(u,()=>i.camera_query_in_progress),u})()},get children(){return T(Kp,{})}}),o),it(r,T(kt,{get when(){return n.isPlaying&&e.uiSettings.showTutorial},get children(){return T(Y1,{})}}),o),it(r,T(kt,{get when(){return e.helpVisible},get children(){return T(C1,{})}}),o),it(r,T(kt,{get when(){return n.isCapturing||n.uiState.key===Wt.FLIP_CARD.key||n.uiState.key===Wt.SIDE_CAPTURED.key||n.uiState.key===Wt.DOCUMENT_CAPTURED.key},get children(){return T(a1,{})}}),o),xt(o,K1),it(o,T(_1,{class:G1})),it(r,T(p1,{}),a);const s=t;return typeof s=="function"?ou(s,a):t=a,xt(a,$1),pe(()=>xt(r,nn("mb-style-scope",H1,"mb-video-screen"))),r})()},B1=()=>T(dr,{defaultOpen:!0,get children(){return T(lr,{get children(){return T(cr,{onEscapeKeyDown:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),onOpenAutoFocus:t=>t.preventDefault(),class:Q1,get children(){return T(Qd,{})}})}})}}),H1="mb-1lz2sq8",Q1="mb-1v96fqo",G1="mb-191sfs5",K1="mb-o9aq4l",$1="mb-1f2d6cn",V1=wt('<div class="alert-dialog__header">'),W1=wt("<p>"),Z1=wt('<div class="alert-dialog__positioner">'),q1=wt("<pre>"),X1=t=>T(dr,{defaultOpen:!0,get children(){return T(lr,{get children(){return[T(Jo,{class:"alert-dialog__overlay"}),(()=>{const e=Z1();return it(e,T(S0,{class:"alert-dialog__content",get children(){return[(()=>{const n=V1();return it(n,T(E0,{class:"alert-dialog__title",get children(){return["Caught error: ",V(()=>t.error.name)]}}),null),it(n,T(qo,{class:"alert-dialog__close-button",children:"Close"}),null),n})(),T(j0,{class:"alert-dialog__description",get children(){return[(()=>{const n=W1();return it(n,()=>t.error.message),n})(),T(kt,{get when(){return t.error.stack},children:n=>(()=>{const i=q1();return xt(i,"mb-rjcpop"),it(i,n),i})()})]}})]}})),e})()]}})}}),J1=t=>{const{solidStore:e,sdkStore:n}=rn(),{updateLocalization:i}=hn();return nt(()=>{e.captureSdk&&t.exposeApiOnLoad({updateLocalization:i,captureSdk:e.captureSdk})}),[T(kt,{get when(){return n.errorState},children:r=>T(X1,{get error(){return r()}})}),T(kt,{get when(){return e.captureSdk},get children(){return T(ui,{get component(){return e.uiSettings.target===document.body?B1:Qd}})}})]};function tN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eN=function(t){return nN(t)&&!iN(t)};function nN(t){return!!t&&typeof t=="object"}function iN(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||aN(t)}var rN=typeof Symbol=="function"&&Symbol.for,oN=rN?Symbol.for("react.element"):60103;function aN(t){return t.$$typeof===oN}function sN(t){return Array.isArray(t)?[]:{}}function Ii(t,e){return e.clone!==!1&&e.isMergeableObject(t)?ii(sN(t),t,e):t}function uN(t,e,n){return t.concat(e).map(function(i){return Ii(i,n)})}function cN(t,e){if(!e.customMerge)return ii;var n=e.customMerge(t);return typeof n=="function"?n:ii}function lN(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Gd(t){return Object.keys(t).concat(lN(t))}function Kd(t,e){try{return e in t}catch{return!1}}function dN(t,e){return Kd(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function gN(t,e,n){var i={};return n.isMergeableObject(t)&&Gd(t).forEach(function(r){i[r]=Ii(t[r],n)}),Gd(e).forEach(function(r){dN(t,r)||(Kd(t,r)&&n.isMergeableObject(e[r])?i[r]=cN(r,n)(t[r],e[r],n):i[r]=Ii(e[r],n))}),i}function ii(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||uN,n.isMergeableObject=n.isMergeableObject||eN,n.cloneUnlessOtherwiseSpecified=Ii;var i=Array.isArray(e),r=Array.isArray(t),o=i===r;return o?i?n.arrayMerge(t,e,n):gN(t,e,n):Ii(e,n)}ii.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return ii(n,i,e)},{})};var hN=ii,fN=hN;const MN=tN(fN);function yN(t){return new Promise(e=>{const n=()=>s(),i={captureSdk:void 0,helpVisible:!1,uiSettings:{target:null,showTutorial:!0,showErrorDialog:!0},dismountFn:n},r=t.uiSettings?.target??document.body,o=MN(i,{uiSettings:t});o.uiSettings.target=r;const a=u=>{e({dismount:n,...u})},s=Yh(()=>T(Jh,{get userStrings(){return t.uiSettings?.localization},get children(){return T(Fp,{get sdkSettings(){return t.sdkSettings},mergedDefaults:o,get children(){return T(J1,{exposeApiOnLoad:a})}})}}),o.uiSettings.target)})}Ht.ConfiguredCamera=gs,Ht.FeedbackParser=ks,Ht.LicenseTokenState=Ur,Ht.ServerPermissionSubmitResultStatus=Yr,Ht.createCaptureSdk=uh,Ht.createCaptureUi=yN,Ht.getBase64StringFromDataURL=lh,Ht.imageDataToUrl=ch,Ht.resetCoreStore=qr,Ht.uiStateMap=Me,Ht.zustandStore=X,Object.defineProperty(Ht,Symbol.toStringTag,{value:"Module"})});
|