@smileid/web-components 11.0.2 → 11.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1352,7 +1352,7 @@ ${this.hideAttribution?"":`
1352
1352
  </div>
1353
1353
  </div>
1354
1354
  ${st(this.themeColor)}
1355
- `}class lh extends HTMLElement{constructor(){super(),this.templateString=ch.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.takeDocumentPhotoButton=this.shadowRoot.querySelector("#take-photo"),this.uploadDocumentPhotoButton=this.shadowRoot.querySelector("#upload-photo"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.takeDocumentPhotoButton&&this.takeDocumentPhotoButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-instructions.capture"))}),this.uploadDocumentPhotoButton&&this.uploadDocumentPhotoButton.addEventListener("change",i=>L(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:n}=i.target,r=yield sh.retrieve(n);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:r,previewImage:r}}))}catch(n){this.shadowRoot.querySelector("#error").innerHTML=n.message}}))}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const t=this.documentCaptureModes;return t.includes("camera")&&t.includes("upload")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",lh);const Xi={version:"11.0.2"},hh=Xi.version,B=document.querySelector("smart-camera-web");function Bt(e){return L(this,null,function*(){try{const t=yield F.getMedia({audio:!1,video:F.environmentOptions}),n=(yield navigator.mediaDevices.enumerateDevices()).find(r=>r.kind==="videoinput"&&t.getVideoTracks()[0].getSettings().deviceId===r.deviceId);B==null||B.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:n==null?void 0:n.label}})),e.removeAttribute("data-camera-error"),e.setAttribute("data-camera-ready",!0)}catch(t){e.removeAttribute("data-camera-ready"),e.setAttribute("data-camera-error",F.handleCameraError(t))}})}class ba extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),B==null||B.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1355
+ `}class lh extends HTMLElement{constructor(){super(),this.templateString=ch.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.takeDocumentPhotoButton=this.shadowRoot.querySelector("#take-photo"),this.uploadDocumentPhotoButton=this.shadowRoot.querySelector("#upload-photo"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.takeDocumentPhotoButton&&this.takeDocumentPhotoButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-instructions.capture"))}),this.uploadDocumentPhotoButton&&this.uploadDocumentPhotoButton.addEventListener("change",i=>L(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:n}=i.target,r=yield sh.retrieve(n);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:r,previewImage:r}}))}catch(n){this.shadowRoot.querySelector("#error").innerHTML=n.message}}))}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get documentCaptureModes(){return this.getAttribute("document-capture-modes")||"camera"}get supportBothCaptureModes(){const t=this.documentCaptureModes;return t.includes("camera")&&t.includes("upload")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-instructions.close"))}}"customElements"in window&&!customElements.get("document-capture-instructions")&&window.customElements.define("document-capture-instructions",lh);const Xi={version:"11.0.3"},hh=Xi.version,B=document.querySelector("smart-camera-web");function Bt(e){return L(this,null,function*(){try{const t=yield F.getMedia({audio:!1,video:F.environmentOptions}),n=(yield navigator.mediaDevices.enumerateDevices()).find(r=>r.kind==="videoinput"&&t.getVideoTracks()[0].getSettings().deviceId===r.deviceId);B==null||B.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:n==null?void 0:n.label}})),e.removeAttribute("data-camera-error"),e.setAttribute("data-camera-ready",!0)}catch(t){e.removeAttribute("data-camera-ready"),e.setAttribute("data-camera-error",F.handleCameraError(t))}})}class ba extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),B==null||B.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1356
1356
  ${st(this.themeColor)}
1357
1357
  <div style="height: 100%;">
1358
1358
  <document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
@@ -1373,14 +1373,7 @@ ${this.hideAttribution?"":`
1373
1373
  <document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
1374
1374
  <document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
1375
1375
  </div>
1376
- `,this._data={images:[],meta:{libraryVersion:hh}},this.documentInstruction=this.querySelector("document-capture-instructions"),this.documentInstructionBack=this.querySelector("#document-capture-instructions-back"),this.idCapture=this.querySelector("#document-capture-front"),this.idReview=this.querySelector("#front-of-document-capture-review"),this.idCaptureBack=this.querySelector("#document-capture-back"),this.backOfIdReview=this.querySelector("#back-of-document-capture-review"),this.thankYouScreen=this.querySelector("thank-you"),this.hideInstructions?(Bt(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){F.stopMedia(),B==null||B.dispatchEvent(new CustomEvent("metadata.cleanup")),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.documentInstruction.addEventListener("document-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.documentInstruction.addEventListener("document-capture-instructions.capture",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"gallery"}})),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-end")),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_IMAGE_BASE64}),F.stopMedia(),this.setActiveScreen(this.idReview)}),this.idCapture.addEventListener("document-capture.cancelled",()=>{this.hideInstructions?this.handleBackEvents():this.setActiveScreen(this.documentInstruction)}),this.idReview.addEventListener("document-capture-review.rejected",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>L(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>L(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"gallery"}})),this.backOfIdReview.setAttribute("data-image",i.detail.image),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-end")),this.backOfIdReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),F.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>L(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.accepted",()=>{this._publishSelectedImages()}),[this.documentInstruction,this.idCapture,this.documentInstructionBack,this.idCaptureBack,this.idReview,this.backOfIdReview].forEach(i=>{i.addEventListener(`${i.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvents())})}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("document-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get documentType(){return this.hasAttribute("document-type")?`document-type='${this.getAttribute("document-type")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.close"))}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}static get observedAttributes(){return["document-capture-modes","document-type","hide-back-to-host","show-navigation","hide-back-of-id"]}attributeChangedCallback(t){switch(t){case"document-capture-modes":case"document-type":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("document-capture-screens")&&customElements.define("document-capture-screens",ba);var Ln=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yi={exports:{}};/*!
1377
- * validate.js 0.13.1
1378
- *
1379
- * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
1380
- * Validate.js may be freely distributed under the MIT license.
1381
- * For all details and documentation:
1382
- * http://validatejs.org/
1383
- */var dh=Yi.exports,ya;function uh(){return ya||(ya=1,function(e,t){(function(i,n,r){var s=function(a,c,l){l=o.extend({},o.options,l);var d=o.runValidations(a,c,l);if(d.some(function(h){return o.isPromise(h.error)}))throw new Error("Use validate.async if you want support for promises");return s.processValidationResults(d,l)},o=s;o.extend=function(a){return[].slice.call(arguments,1).forEach(function(c){for(var l in c)a[l]=c[l]}),a},o.extend(s,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var a=o.format("%{major}.%{minor}.%{patch}",o.version);return o.isEmpty(o.version.metadata)||(a+="+"+o.version.metadata),a}},Promise:typeof Promise!="undefined"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(a,c,l){var d=[],h,u,p,f,m,v,g;(o.isDomElement(a)||o.isJqueryElement(a))&&(a=o.collectFormValues(a));for(h in c){p=o.getDeepObjectValue(a,h),f=o.result(c[h],p,a,h,l,c);for(u in f){if(m=o.validators[u],!m)throw g=o.format("Unknown validator %{name}",{name:u}),new Error(g);v=f[u],v=o.result(v,p,a,h,l,c),v&&d.push({attribute:h,value:p,validator:u,globalOptions:l,attributes:a,options:v,error:m.call(m,p,v,h,a,l)})}}return d},processValidationResults:function(a,c){a=o.pruneEmptyErrors(a,c),a=o.expandMultipleErrors(a,c),a=o.convertErrorMessages(a,c);var l=c.format||"grouped";if(typeof o.formatters[l]=="function")a=o.formatters[l](a);else throw new Error(o.format("Unknown format %{format}",c));return o.isEmpty(a)?void 0:a},async:function(a,c,l){l=o.extend({},o.async.options,l);var d=l.wrapErrors||function(u){return u};l.cleanAttributes!==!1&&(a=o.cleanAttributes(a,c));var h=o.runValidations(a,c,l);return new o.Promise(function(u,p){o.waitForResults(h).then(function(){var f=o.processValidationResults(h,l);f?p(new d(f,l,a,c)):u(a)},function(f){p(f)})})},single:function(a,c,l){return l=o.extend({},o.single.options,l,{format:"flat",fullMessages:!1}),o({single:a},{single:c},l)},waitForResults:function(a){return a.reduce(function(c,l){return o.isPromise(l.error)?c.then(function(){return l.error.then(function(d){l.error=d||null})}):c},new o.Promise(function(c){c()}))},result:function(a){var c=[].slice.call(arguments,1);return typeof a=="function"&&(a=a.apply(null,c)),a},isNumber:function(a){return typeof a=="number"&&!isNaN(a)},isFunction:function(a){return typeof a=="function"},isInteger:function(a){return o.isNumber(a)&&a%1===0},isBoolean:function(a){return typeof a=="boolean"},isObject:function(a){return a===Object(a)},isDate:function(a){return a instanceof Date},isDefined:function(a){return a!=null},isPromise:function(a){return!!a&&o.isFunction(a.then)},isJqueryElement:function(a){return a&&o.isString(a.jquery)},isDomElement:function(a){return!a||!a.querySelectorAll||!a.querySelector?!1:o.isObject(document)&&a===document?!0:typeof HTMLElement=="object"?a instanceof HTMLElement:a&&typeof a=="object"&&a!==null&&a.nodeType===1&&typeof a.nodeName=="string"},isEmpty:function(a){var c;if(!o.isDefined(a))return!0;if(o.isFunction(a))return!1;if(o.isString(a))return o.EMPTY_STRING_REGEXP.test(a);if(o.isArray(a))return a.length===0;if(o.isDate(a))return!1;if(o.isObject(a)){for(c in a)return!1;return!0}return!1},format:o.extend(function(a,c){return o.isString(a)?a.replace(o.format.FORMAT_REGEXP,function(l,d,h){return d==="%"?"%{"+h+"}":String(c[h])}):a},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(a){return o.isNumber(a)?a*100%1===0?""+a:parseFloat(Math.round(a*100)/100).toFixed(2):o.isArray(a)?a.map(function(c){return o.prettify(c)}).join(", "):o.isObject(a)?o.isDefined(a.toString)?a.toString():JSON.stringify(a):(a=""+a,a.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(c,l,d){return""+l+" "+d.toLowerCase()}).toLowerCase())},stringifyValue:function(a,c){var l=c&&c.prettify||o.prettify;return l(a)},isString:function(a){return typeof a=="string"},isArray:function(a){return{}.toString.call(a)==="[object Array]"},isHash:function(a){return o.isObject(a)&&!o.isArray(a)&&!o.isFunction(a)},contains:function(a,c){return o.isDefined(a)?o.isArray(a)?a.indexOf(c)!==-1:c in a:!1},unique:function(a){return o.isArray(a)?a.filter(function(c,l,d){return d.indexOf(c)==l}):a},forEachKeyInKeypath:function(a,c,l){if(o.isString(c)){var d="",h,u=!1;for(h=0;h<c.length;++h)switch(c[h]){case".":u?(u=!1,d+="."):(a=l(a,d,!1),d="");break;case"\\":u?(u=!1,d+="\\"):u=!0;break;default:u=!1,d+=c[h];break}return l(a,d,!0)}},getDeepObjectValue:function(a,c){if(o.isObject(a))return o.forEachKeyInKeypath(a,c,function(l,d){if(o.isObject(l))return l[d]})},collectFormValues:function(a,c){var l={},d,h,u,p,f,m;if(o.isJqueryElement(a)&&(a=a[0]),!a)return l;for(c=c||{},p=a.querySelectorAll("input[name], textarea[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){var v=u.name.replace(/\./g,"\\\\.");m=o.sanitizeFormValue(u.value,c),u.type==="number"?m=m?+m:null:u.type==="checkbox"?u.attributes.value?u.checked||(m=l[v]||null):m=u.checked:u.type==="radio"&&(u.checked||(m=l[v]||null)),l[v]=m}for(p=a.querySelectorAll("select[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){if(u.multiple){m=[];for(h in u.options)f=u.options[h],f&&f.selected&&m.push(o.sanitizeFormValue(f.value,c))}else{var g=typeof u.options[u.selectedIndex]!="undefined"?u.options[u.selectedIndex].value:"";m=o.sanitizeFormValue(g,c)}l[u.name]=m}return l},sanitizeFormValue:function(a,c){return c.trim&&o.isString(a)&&(a=a.trim()),c.nullify!==!1&&a===""?null:a},capitalize:function(a){return o.isString(a)?a[0].toUpperCase()+a.slice(1):a},pruneEmptyErrors:function(a){return a.filter(function(c){return!o.isEmpty(c.error)})},expandMultipleErrors:function(a){var c=[];return a.forEach(function(l){o.isArray(l.error)?l.error.forEach(function(d){c.push(o.extend({},l,{error:d}))}):c.push(l)}),c},convertErrorMessages:function(a,c){c=c||{};var l=[],d=c.prettify||o.prettify;return a.forEach(function(h){var u=o.result(h.error,h.value,h.attribute,h.options,h.attributes,h.globalOptions);if(!o.isString(u)){l.push(h);return}u[0]==="^"?u=u.slice(1):c.fullMessages!==!1&&(u=o.capitalize(d(h.attribute))+" "+u),u=u.replace(/\\\^/g,"^"),u=o.format(u,{value:o.stringifyValue(h.value,c)}),l.push(o.extend({},h,{error:u}))}),l},groupErrorsByAttribute:function(a){var c={};return a.forEach(function(l){var d=c[l.attribute];d?d.push(l):c[l.attribute]=[l]}),c},flattenErrorsToArray:function(a){return a.map(function(c){return c.error}).filter(function(c,l,d){return d.indexOf(c)===l})},cleanAttributes:function(a,c){function l(u,p,f){return o.isObject(u[p])?u[p]:u[p]=f?!0:{}}function d(u){var p={},f;for(f in u)u[f]&&o.forEachKeyInKeypath(p,f,l);return p}function h(u,p){if(!o.isObject(u))return u;var f=o.extend({},u),m,v;for(v in u)m=p[v],o.isObject(m)?f[v]=h(f[v],m):m||delete f[v];return f}return!o.isObject(c)||!o.isObject(a)?{}:(c=d(c),h(a,c))},exposeModule:function(a,c,l,d,h){l?(d&&d.exports&&(l=d.exports=a),l.validate=a):(c.validate=a,a.isFunction(h)&&h.amd&&h([],function(){return a}))},warn:function(a){typeof console!="undefined"&&console.warn&&console.warn("[validate.js] "+a)},error:function(a){typeof console!="undefined"&&console.error&&console.error("[validate.js] "+a)}}),s.validators={presence:function(a,c){if(c=o.extend({},this.options,c),c.allowEmpty!==!1?!o.isDefined(a):o.isEmpty(a))return c.message||this.message||"can't be blank"},length:function(a,c,l){if(o.isDefined(a)){c=o.extend({},this.options,c);var d=c.is,h=c.maximum,u=c.minimum,p=c.tokenizer||function(g){return g},f,m=[];a=p(a);var v=a.length;if(!o.isNumber(v))return c.message||this.notValid||"has an incorrect length";if(o.isNumber(d)&&v!==d&&(f=c.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",m.push(o.format(f,{count:d}))),o.isNumber(u)&&v<u&&(f=c.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",m.push(o.format(f,{count:u}))),o.isNumber(h)&&v>h&&(f=c.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",m.push(o.format(f,{count:h}))),m.length>0)return c.message||m}},numericality:function(a,c,l,d,h){if(o.isDefined(a)){c=o.extend({},this.options,c);var u=[],p,f,m={greaterThan:function(E,M){return E>M},greaterThanOrEqualTo:function(E,M){return E>=M},equalTo:function(E,M){return E===M},lessThan:function(E,M){return E<M},lessThanOrEqualTo:function(E,M){return E<=M},divisibleBy:function(E,M){return E%M===0}},v=c.prettify||h&&h.prettify||o.prettify;if(o.isString(a)&&c.strict){var g="^-?(0|[1-9]\\d*)";if(c.onlyInteger||(g+="(\\.\\d+)?"),g+="$",!new RegExp(g).test(a))return c.message||c.notValid||this.notValid||this.message||"must be a valid number"}if(c.noStrings!==!0&&o.isString(a)&&!o.isEmpty(a)&&(a=+a),!o.isNumber(a))return c.message||c.notValid||this.notValid||this.message||"is not a number";if(c.onlyInteger&&!o.isInteger(a))return c.message||c.notInteger||this.notInteger||this.message||"must be an integer";for(p in m)if(f=c[p],o.isNumber(f)&&!m[p](a,f)){var b="not"+o.capitalize(p),_=c[b]||this[b]||this.message||"must be %{type} %{count}";u.push(o.format(_,{count:f,type:v(p)}))}if(c.odd&&a%2!==1&&u.push(c.notOdd||this.notOdd||this.message||"must be odd"),c.even&&a%2!==0&&u.push(c.notEven||this.notEven||this.message||"must be even"),u.length)return c.message||u}},datetime:o.extend(function(a,c){if(!o.isFunction(this.parse)||!o.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(o.isDefined(a)){c=o.extend({},this.options,c);var l,d=[],h=c.earliest?this.parse(c.earliest,c):NaN,u=c.latest?this.parse(c.latest,c):NaN;if(a=this.parse(a,c),isNaN(a)||c.dateOnly&&a%864e5!==0)return l=c.notValid||c.message||this.notValid||"must be a valid date",o.format(l,{value:arguments[0]});if(!isNaN(h)&&a<h&&(l=c.tooEarly||c.message||this.tooEarly||"must be no earlier than %{date}",l=o.format(l,{value:this.format(a,c),date:this.format(h,c)}),d.push(l)),!isNaN(u)&&a>u&&(l=c.tooLate||c.message||this.tooLate||"must be no later than %{date}",l=o.format(l,{date:this.format(u,c),value:this.format(a,c)}),d.push(l)),d.length)return o.unique(d)}},{parse:null,format:null}),date:function(a,c){return c=o.extend({},c,{dateOnly:!0}),o.validators.datetime.call(o.validators.datetime,a,c)},format:function(a,c){(o.isString(c)||c instanceof RegExp)&&(c={pattern:c}),c=o.extend({},this.options,c);var l=c.message||this.message||"is invalid",d=c.pattern,h;if(o.isDefined(a)&&(!o.isString(a)||(o.isString(d)&&(d=new RegExp(c.pattern,c.flags)),h=d.exec(a),!h||h[0].length!=a.length)))return l},inclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is not included in the list";return o.format(l,{value:a})}},exclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is restricted";return o.isString(c.within[a])&&(a=c.within[a]),o.format(l,{value:a})}},email:o.extend(function(a,c){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid email";if(o.isDefined(a)&&(!o.isString(a)||!this.PATTERN.exec(a)))return l},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(a,c,l,d,h){if(o.isDefined(a)){o.isString(c)&&(c={attribute:c}),c=o.extend({},this.options,c);var u=c.message||this.message||"is not equal to %{attribute}";if(o.isEmpty(c.attribute)||!o.isString(c.attribute))throw new Error("The attribute must be a non empty string");var p=o.getDeepObjectValue(d,c.attribute),f=c.comparator||function(v,g){return v===g},m=c.prettify||h&&h.prettify||o.prettify;if(!f(a,p,c,l,d))return o.format(u,{attribute:m(c.attribute)})}},url:function(a,c){if(o.isDefined(a)){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid url",d=c.schemes||this.schemes||["http","https"],h=c.allowLocal||this.allowLocal||!1,u=c.allowDataUrl||this.allowDataUrl||!1;if(!o.isString(a))return l;var p="^(?:(?:"+d.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(h?f+="?":p+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",p+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+f+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",u){var m="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",v="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",g="data:(?:"+m+")?(?:;base64)?,"+v;p="(?:"+p+")|(?:^"+g+"$)"}var b=new RegExp(p,"i");if(!b.exec(a))return l}},type:o.extend(function(a,c,l,d,h){if(o.isString(c)&&(c={type:c}),!!o.isDefined(a)){var u=o.extend({},this.options,c),p=u.type;if(!o.isDefined(p))throw new Error("No type was specified");var f;if(o.isFunction(p)?f=p:f=this.types[p],!o.isFunction(f))throw new Error("validate.validators.type.types."+p+" must be a function.");if(!f(a,u,l,d,h)){var m=c.message||this.messages[p]||this.message||u.message||(o.isFunction(p)?"must be of the correct type":"must be of type %{type}");return o.isFunction(m)&&(m=m(a,c,l,d,h)),o.format(m,{attribute:o.prettify(l),type:p})}}},{types:{object:function(a){return o.isObject(a)&&!o.isArray(a)},array:o.isArray,integer:o.isInteger,number:o.isNumber,string:o.isString,date:o.isDate,boolean:o.isBoolean},messages:{}})},s.formatters={detailed:function(a){return a},flat:o.flattenErrorsToArray,grouped:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=o.flattenErrorsToArray(a[c]);return a},constraint:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=a[c].map(function(l){return l.validator}).sort();return a}},s.exposeModule(s,this,i,n,r)}).call(dh,t,e,null)}(Yi,Yi.exports)),Yi.exports}var ph=uh();const fh=wa(ph);function Hr(e,t){return fetch(e,{body:JSON.stringify(t),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function mh(){return`
1376
+ `,this._data={images:[],meta:{libraryVersion:hh}},this.documentInstruction=this.querySelector("document-capture-instructions"),this.documentInstructionBack=this.querySelector("#document-capture-instructions-back"),this.idCapture=this.querySelector("#document-capture-front"),this.idReview=this.querySelector("#front-of-document-capture-review"),this.idCaptureBack=this.querySelector("#document-capture-back"),this.backOfIdReview=this.querySelector("#back-of-document-capture-review"),this.thankYouScreen=this.querySelector("thank-you"),this.hideInstructions?(Bt(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){F.stopMedia(),B==null||B.dispatchEvent(new CustomEvent("metadata.cleanup")),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.documentInstruction.addEventListener("document-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.documentInstruction.addEventListener("document-capture-instructions.capture",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"gallery"}})),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-end")),this.idReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_IMAGE_BASE64}),F.stopMedia(),this.setActiveScreen(this.idReview)}),this.idCapture.addEventListener("document-capture.cancelled",()=>{this.hideInstructions?this.handleBackEvents():this.setActiveScreen(this.documentInstruction)}),this.idReview.addEventListener("document-capture-review.rejected",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>L(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>L(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"gallery"}})),this.backOfIdReview.setAttribute("data-image",i.detail.image),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-end")),this.backOfIdReview.setAttribute("data-image",i.detail.previewImage),this._data.images.push({image:i.detail.image.split(",")[1],image_type_id:di.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),F.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>L(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>L(this,null,function*(){B==null||B.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Bt(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.accepted",()=>{this._publishSelectedImages()}),[this.documentInstruction,this.idCapture,this.documentInstructionBack,this.idCaptureBack,this.idReview,this.backOfIdReview].forEach(i=>{i.addEventListener(`${i.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvents())})}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("document-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get title(){return this.hasAttribute("title")?`title=${this.getAttribute("title")}`:""}get documentCaptureModes(){return this.hasAttribute("document-capture-modes")?`document-capture-modes='${this.getAttribute("document-capture-modes")}'`:""}get documentType(){return this.hasAttribute("document-type")?`document-type='${this.getAttribute("document-type")}'`:""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-screens.close"))}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}static get observedAttributes(){return["document-capture-modes","document-type","hide-back-to-host","show-navigation","hide-back-of-id"]}attributeChangedCallback(t){switch(t){case"document-capture-modes":case"document-type":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("document-capture-screens")&&customElements.define("document-capture-screens",ba);var Ln=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yi={exports:{}};var dh=Yi.exports,ya;function uh(){return ya||(ya=1,function(e,t){(function(i,n,r){var s=function(a,c,l){l=o.extend({},o.options,l);var d=o.runValidations(a,c,l);if(d.some(function(h){return o.isPromise(h.error)}))throw new Error("Use validate.async if you want support for promises");return s.processValidationResults(d,l)},o=s;o.extend=function(a){return[].slice.call(arguments,1).forEach(function(c){for(var l in c)a[l]=c[l]}),a},o.extend(s,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var a=o.format("%{major}.%{minor}.%{patch}",o.version);return o.isEmpty(o.version.metadata)||(a+="+"+o.version.metadata),a}},Promise:typeof Promise!="undefined"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(a,c,l){var d=[],h,u,p,f,m,v,g;(o.isDomElement(a)||o.isJqueryElement(a))&&(a=o.collectFormValues(a));for(h in c){p=o.getDeepObjectValue(a,h),f=o.result(c[h],p,a,h,l,c);for(u in f){if(m=o.validators[u],!m)throw g=o.format("Unknown validator %{name}",{name:u}),new Error(g);v=f[u],v=o.result(v,p,a,h,l,c),v&&d.push({attribute:h,value:p,validator:u,globalOptions:l,attributes:a,options:v,error:m.call(m,p,v,h,a,l)})}}return d},processValidationResults:function(a,c){a=o.pruneEmptyErrors(a,c),a=o.expandMultipleErrors(a,c),a=o.convertErrorMessages(a,c);var l=c.format||"grouped";if(typeof o.formatters[l]=="function")a=o.formatters[l](a);else throw new Error(o.format("Unknown format %{format}",c));return o.isEmpty(a)?void 0:a},async:function(a,c,l){l=o.extend({},o.async.options,l);var d=l.wrapErrors||function(u){return u};l.cleanAttributes!==!1&&(a=o.cleanAttributes(a,c));var h=o.runValidations(a,c,l);return new o.Promise(function(u,p){o.waitForResults(h).then(function(){var f=o.processValidationResults(h,l);f?p(new d(f,l,a,c)):u(a)},function(f){p(f)})})},single:function(a,c,l){return l=o.extend({},o.single.options,l,{format:"flat",fullMessages:!1}),o({single:a},{single:c},l)},waitForResults:function(a){return a.reduce(function(c,l){return o.isPromise(l.error)?c.then(function(){return l.error.then(function(d){l.error=d||null})}):c},new o.Promise(function(c){c()}))},result:function(a){var c=[].slice.call(arguments,1);return typeof a=="function"&&(a=a.apply(null,c)),a},isNumber:function(a){return typeof a=="number"&&!isNaN(a)},isFunction:function(a){return typeof a=="function"},isInteger:function(a){return o.isNumber(a)&&a%1===0},isBoolean:function(a){return typeof a=="boolean"},isObject:function(a){return a===Object(a)},isDate:function(a){return a instanceof Date},isDefined:function(a){return a!=null},isPromise:function(a){return!!a&&o.isFunction(a.then)},isJqueryElement:function(a){return a&&o.isString(a.jquery)},isDomElement:function(a){return!a||!a.querySelectorAll||!a.querySelector?!1:o.isObject(document)&&a===document?!0:typeof HTMLElement=="object"?a instanceof HTMLElement:a&&typeof a=="object"&&a!==null&&a.nodeType===1&&typeof a.nodeName=="string"},isEmpty:function(a){var c;if(!o.isDefined(a))return!0;if(o.isFunction(a))return!1;if(o.isString(a))return o.EMPTY_STRING_REGEXP.test(a);if(o.isArray(a))return a.length===0;if(o.isDate(a))return!1;if(o.isObject(a)){for(c in a)return!1;return!0}return!1},format:o.extend(function(a,c){return o.isString(a)?a.replace(o.format.FORMAT_REGEXP,function(l,d,h){return d==="%"?"%{"+h+"}":String(c[h])}):a},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(a){return o.isNumber(a)?a*100%1===0?""+a:parseFloat(Math.round(a*100)/100).toFixed(2):o.isArray(a)?a.map(function(c){return o.prettify(c)}).join(", "):o.isObject(a)?o.isDefined(a.toString)?a.toString():JSON.stringify(a):(a=""+a,a.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(c,l,d){return""+l+" "+d.toLowerCase()}).toLowerCase())},stringifyValue:function(a,c){var l=c&&c.prettify||o.prettify;return l(a)},isString:function(a){return typeof a=="string"},isArray:function(a){return{}.toString.call(a)==="[object Array]"},isHash:function(a){return o.isObject(a)&&!o.isArray(a)&&!o.isFunction(a)},contains:function(a,c){return o.isDefined(a)?o.isArray(a)?a.indexOf(c)!==-1:c in a:!1},unique:function(a){return o.isArray(a)?a.filter(function(c,l,d){return d.indexOf(c)==l}):a},forEachKeyInKeypath:function(a,c,l){if(o.isString(c)){var d="",h,u=!1;for(h=0;h<c.length;++h)switch(c[h]){case".":u?(u=!1,d+="."):(a=l(a,d,!1),d="");break;case"\\":u?(u=!1,d+="\\"):u=!0;break;default:u=!1,d+=c[h];break}return l(a,d,!0)}},getDeepObjectValue:function(a,c){if(o.isObject(a))return o.forEachKeyInKeypath(a,c,function(l,d){if(o.isObject(l))return l[d]})},collectFormValues:function(a,c){var l={},d,h,u,p,f,m;if(o.isJqueryElement(a)&&(a=a[0]),!a)return l;for(c=c||{},p=a.querySelectorAll("input[name], textarea[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){var v=u.name.replace(/\./g,"\\\\.");m=o.sanitizeFormValue(u.value,c),u.type==="number"?m=m?+m:null:u.type==="checkbox"?u.attributes.value?u.checked||(m=l[v]||null):m=u.checked:u.type==="radio"&&(u.checked||(m=l[v]||null)),l[v]=m}for(p=a.querySelectorAll("select[name]"),d=0;d<p.length;++d)if(u=p.item(d),!o.isDefined(u.getAttribute("data-ignored"))){if(u.multiple){m=[];for(h in u.options)f=u.options[h],f&&f.selected&&m.push(o.sanitizeFormValue(f.value,c))}else{var g=typeof u.options[u.selectedIndex]!="undefined"?u.options[u.selectedIndex].value:"";m=o.sanitizeFormValue(g,c)}l[u.name]=m}return l},sanitizeFormValue:function(a,c){return c.trim&&o.isString(a)&&(a=a.trim()),c.nullify!==!1&&a===""?null:a},capitalize:function(a){return o.isString(a)?a[0].toUpperCase()+a.slice(1):a},pruneEmptyErrors:function(a){return a.filter(function(c){return!o.isEmpty(c.error)})},expandMultipleErrors:function(a){var c=[];return a.forEach(function(l){o.isArray(l.error)?l.error.forEach(function(d){c.push(o.extend({},l,{error:d}))}):c.push(l)}),c},convertErrorMessages:function(a,c){c=c||{};var l=[],d=c.prettify||o.prettify;return a.forEach(function(h){var u=o.result(h.error,h.value,h.attribute,h.options,h.attributes,h.globalOptions);if(!o.isString(u)){l.push(h);return}u[0]==="^"?u=u.slice(1):c.fullMessages!==!1&&(u=o.capitalize(d(h.attribute))+" "+u),u=u.replace(/\\\^/g,"^"),u=o.format(u,{value:o.stringifyValue(h.value,c)}),l.push(o.extend({},h,{error:u}))}),l},groupErrorsByAttribute:function(a){var c={};return a.forEach(function(l){var d=c[l.attribute];d?d.push(l):c[l.attribute]=[l]}),c},flattenErrorsToArray:function(a){return a.map(function(c){return c.error}).filter(function(c,l,d){return d.indexOf(c)===l})},cleanAttributes:function(a,c){function l(u,p,f){return o.isObject(u[p])?u[p]:u[p]=f?!0:{}}function d(u){var p={},f;for(f in u)u[f]&&o.forEachKeyInKeypath(p,f,l);return p}function h(u,p){if(!o.isObject(u))return u;var f=o.extend({},u),m,v;for(v in u)m=p[v],o.isObject(m)?f[v]=h(f[v],m):m||delete f[v];return f}return!o.isObject(c)||!o.isObject(a)?{}:(c=d(c),h(a,c))},exposeModule:function(a,c,l,d,h){l?(d&&d.exports&&(l=d.exports=a),l.validate=a):(c.validate=a,a.isFunction(h)&&h.amd&&h([],function(){return a}))},warn:function(a){typeof console!="undefined"&&console.warn&&console.warn("[validate.js] "+a)},error:function(a){typeof console!="undefined"&&console.error&&console.error("[validate.js] "+a)}}),s.validators={presence:function(a,c){if(c=o.extend({},this.options,c),c.allowEmpty!==!1?!o.isDefined(a):o.isEmpty(a))return c.message||this.message||"can't be blank"},length:function(a,c,l){if(o.isDefined(a)){c=o.extend({},this.options,c);var d=c.is,h=c.maximum,u=c.minimum,p=c.tokenizer||function(g){return g},f,m=[];a=p(a);var v=a.length;if(!o.isNumber(v))return c.message||this.notValid||"has an incorrect length";if(o.isNumber(d)&&v!==d&&(f=c.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",m.push(o.format(f,{count:d}))),o.isNumber(u)&&v<u&&(f=c.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",m.push(o.format(f,{count:u}))),o.isNumber(h)&&v>h&&(f=c.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",m.push(o.format(f,{count:h}))),m.length>0)return c.message||m}},numericality:function(a,c,l,d,h){if(o.isDefined(a)){c=o.extend({},this.options,c);var u=[],p,f,m={greaterThan:function(E,M){return E>M},greaterThanOrEqualTo:function(E,M){return E>=M},equalTo:function(E,M){return E===M},lessThan:function(E,M){return E<M},lessThanOrEqualTo:function(E,M){return E<=M},divisibleBy:function(E,M){return E%M===0}},v=c.prettify||h&&h.prettify||o.prettify;if(o.isString(a)&&c.strict){var g="^-?(0|[1-9]\\d*)";if(c.onlyInteger||(g+="(\\.\\d+)?"),g+="$",!new RegExp(g).test(a))return c.message||c.notValid||this.notValid||this.message||"must be a valid number"}if(c.noStrings!==!0&&o.isString(a)&&!o.isEmpty(a)&&(a=+a),!o.isNumber(a))return c.message||c.notValid||this.notValid||this.message||"is not a number";if(c.onlyInteger&&!o.isInteger(a))return c.message||c.notInteger||this.notInteger||this.message||"must be an integer";for(p in m)if(f=c[p],o.isNumber(f)&&!m[p](a,f)){var b="not"+o.capitalize(p),_=c[b]||this[b]||this.message||"must be %{type} %{count}";u.push(o.format(_,{count:f,type:v(p)}))}if(c.odd&&a%2!==1&&u.push(c.notOdd||this.notOdd||this.message||"must be odd"),c.even&&a%2!==0&&u.push(c.notEven||this.notEven||this.message||"must be even"),u.length)return c.message||u}},datetime:o.extend(function(a,c){if(!o.isFunction(this.parse)||!o.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(o.isDefined(a)){c=o.extend({},this.options,c);var l,d=[],h=c.earliest?this.parse(c.earliest,c):NaN,u=c.latest?this.parse(c.latest,c):NaN;if(a=this.parse(a,c),isNaN(a)||c.dateOnly&&a%864e5!==0)return l=c.notValid||c.message||this.notValid||"must be a valid date",o.format(l,{value:arguments[0]});if(!isNaN(h)&&a<h&&(l=c.tooEarly||c.message||this.tooEarly||"must be no earlier than %{date}",l=o.format(l,{value:this.format(a,c),date:this.format(h,c)}),d.push(l)),!isNaN(u)&&a>u&&(l=c.tooLate||c.message||this.tooLate||"must be no later than %{date}",l=o.format(l,{date:this.format(u,c),value:this.format(a,c)}),d.push(l)),d.length)return o.unique(d)}},{parse:null,format:null}),date:function(a,c){return c=o.extend({},c,{dateOnly:!0}),o.validators.datetime.call(o.validators.datetime,a,c)},format:function(a,c){(o.isString(c)||c instanceof RegExp)&&(c={pattern:c}),c=o.extend({},this.options,c);var l=c.message||this.message||"is invalid",d=c.pattern,h;if(o.isDefined(a)&&(!o.isString(a)||(o.isString(d)&&(d=new RegExp(c.pattern,c.flags)),h=d.exec(a),!h||h[0].length!=a.length)))return l},inclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is not included in the list";return o.format(l,{value:a})}},exclusion:function(a,c){if(o.isDefined(a)&&(o.isArray(c)&&(c={within:c}),c=o.extend({},this.options,c),!!o.contains(c.within,a))){var l=c.message||this.message||"^%{value} is restricted";return o.isString(c.within[a])&&(a=c.within[a]),o.format(l,{value:a})}},email:o.extend(function(a,c){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid email";if(o.isDefined(a)&&(!o.isString(a)||!this.PATTERN.exec(a)))return l},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(a,c,l,d,h){if(o.isDefined(a)){o.isString(c)&&(c={attribute:c}),c=o.extend({},this.options,c);var u=c.message||this.message||"is not equal to %{attribute}";if(o.isEmpty(c.attribute)||!o.isString(c.attribute))throw new Error("The attribute must be a non empty string");var p=o.getDeepObjectValue(d,c.attribute),f=c.comparator||function(v,g){return v===g},m=c.prettify||h&&h.prettify||o.prettify;if(!f(a,p,c,l,d))return o.format(u,{attribute:m(c.attribute)})}},url:function(a,c){if(o.isDefined(a)){c=o.extend({},this.options,c);var l=c.message||this.message||"is not a valid url",d=c.schemes||this.schemes||["http","https"],h=c.allowLocal||this.allowLocal||!1,u=c.allowDataUrl||this.allowDataUrl||!1;if(!o.isString(a))return l;var p="^(?:(?:"+d.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(h?f+="?":p+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",p+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+f+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",u){var m="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",v="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",g="data:(?:"+m+")?(?:;base64)?,"+v;p="(?:"+p+")|(?:^"+g+"$)"}var b=new RegExp(p,"i");if(!b.exec(a))return l}},type:o.extend(function(a,c,l,d,h){if(o.isString(c)&&(c={type:c}),!!o.isDefined(a)){var u=o.extend({},this.options,c),p=u.type;if(!o.isDefined(p))throw new Error("No type was specified");var f;if(o.isFunction(p)?f=p:f=this.types[p],!o.isFunction(f))throw new Error("validate.validators.type.types."+p+" must be a function.");if(!f(a,u,l,d,h)){var m=c.message||this.messages[p]||this.message||u.message||(o.isFunction(p)?"must be of the correct type":"must be of type %{type}");return o.isFunction(m)&&(m=m(a,c,l,d,h)),o.format(m,{attribute:o.prettify(l),type:p})}}},{types:{object:function(a){return o.isObject(a)&&!o.isArray(a)},array:o.isArray,integer:o.isInteger,number:o.isNumber,string:o.isString,date:o.isDate,boolean:o.isBoolean},messages:{}})},s.formatters={detailed:function(a){return a},flat:o.flattenErrorsToArray,grouped:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=o.flattenErrorsToArray(a[c]);return a},constraint:function(a){var c;a=o.groupErrorsByAttribute(a);for(c in a)a[c]=a[c].map(function(l){return l.validator}).sort();return a}},s.exposeModule(s,this,i,n,r)}).call(dh,t,e,null)}(Yi,Yi.exports)),Yi.exports}var ph=uh();const fh=wa(ph);function Hr(e,t){return fetch(e,{body:JSON.stringify(t),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function mh(){return`
1384
1377
  <style>
1385
1378
  *,
1386
1379
  *::before,
@@ -3123,22 +3116,7 @@ ${this.hideAttribution?"":`
3123
3116
  `}
3124
3117
  </div>
3125
3118
  </div>
3126
- `}class _h extends HTMLElement{constructor(){super(),this.templateString=yh.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image","mirror-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get shouldMirror(){return this.getAttribute("mirror-image")!=="false"}get title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":case"mirror-image":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",_h);var Ki,U,Ea,xa,Yt,ka,Aa,Sa,La,Ur,Vr,jr,Ji={},Ma=[],Ch=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qi=Array.isArray;function dt(e,t){for(var i in t)e[i]=t[i];return e}function Gr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ct(e,t,i){var n,r,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ki.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return en(e,o,n,r,null)}function en(e,t,i,n,r){var s={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r==null?++Ea:r,__i:-1,__u:0};return r==null&&U.vnode!=null&&U.vnode(s),s}function Dt(e){return e.children}function tn(e,t){this.props=e,this.context=t}function pi(e,t){if(t==null)return e.__?pi(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?pi(e):null}function Ta(e){var t,i;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null){e.__e=e.__c.base=i.__e;break}return Ta(e)}}function Ia(e){(!e.__d&&(e.__d=!0)&&Yt.push(e)&&!Mn.__r++||ka!=U.debounceRendering)&&((ka=U.debounceRendering)||Aa)(Mn)}function Mn(){for(var e,t,i,n,r,s,o,a=1;Yt.length;)Yt.length>a&&Yt.sort(Sa),e=Yt.shift(),a=Yt.length,e.__d&&(i=void 0,r=(n=(t=e).__v).__e,s=[],o=[],t.__P&&((i=dt({},n)).__v=n.__v+1,U.vnode&&U.vnode(i),zr(t.__P,i,n,t.__n,t.__P.namespaceURI,32&n.__u?[r]:null,s,r==null?pi(n):r,!!(32&n.__u),o),i.__v=n.__v,i.__.__k[i.__i]=i,Pa(s,i,o),i.__e!=r&&Ta(i)));Mn.__r=0}function Fa(e,t,i,n,r,s,o,a,c,l,d){var h,u,p,f,m,v,g=n&&n.__k||Ma,b=t.length;for(c=Eh(i,t,g,c,b),h=0;h<b;h++)(p=i.__k[h])!=null&&(u=p.__i==-1?Ji:g[p.__i]||Ji,p.__i=h,v=zr(e,p,u,r,s,o,a,c,l,d),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&qr(u.ref,null,p),d.push(p.ref,p.__c||f,p)),m==null&&f!=null&&(m=f),4&p.__u||u.__k===p.__k?c=Ba(p,c,e):typeof p.type=="function"&&v!==void 0?c=v:f&&(c=f.nextSibling),p.__u&=-7);return i.__e=m,c}function Eh(e,t,i,n,r){var s,o,a,c,l,d=i.length,h=d,u=0;for(e.__k=new Array(r),s=0;s<r;s++)(o=t[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+u,(o=e.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?en(null,o,null,null,null):Qi(o)?en(Dt,{children:o},null,null,null):o.constructor==null&&o.__b>0?en(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,a=null,(l=o.__i=xh(o,i,c,h))!=-1&&(h--,(a=i[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?u--:r<d&&u++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?u--:l==c+1?u++:(l>c?u--:u++,o.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<d;s++)(a=i[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=pi(a)),Na(a,a));return n}function Ba(e,t,i){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Ba(n[r],t,i));return t}e.__e!=t&&(t&&e.type&&!i.contains(t)&&(t=pi(e)),i.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Da(e,t){return t=t||[],e==null||typeof e=="boolean"||(Qi(e)?e.some(function(i){Da(i,t)}):t.push(e)),t}function xh(e,t,i,n){var r,s,o,a=e.key,c=e.type,l=t[i],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&a==l.key&&c==l.type)return i;if(n>(d?1:0)){for(r=i-1,s=i+1;r>=0||s<t.length;)if((l=t[o=r>=0?r--:s++])!=null&&(2&l.__u)==0&&a==l.key&&c==l.type)return o}return-1}function Ra(e,t,i){t[0]=="-"?e.setProperty(t,i==null?"":i):e[t]=i==null?"":typeof i!="number"||Ch.test(t)?i:i+"px"}function Tn(e,t,i,n,r){var s,o;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||Ra(e.style,t,"");if(i)for(t in i)n&&i[t]==n[t]||Ra(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(La,"$1")),o=t.toLowerCase(),t=o in e||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=i,i?n?i.u=n.u:(i.u=Ur,e.addEventListener(t,s?jr:Vr,s)):e.removeEventListener(t,s?jr:Vr,s);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=i==null?"":i;break e}catch(a){}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function Oa(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ur++;else if(t.t<i.u)return;return i(U.event?U.event(t):t)}}}function zr(e,t,i,n,r,s,o,a,c,l){var d,h,u,p,f,m,v,g,b,_,E,M,w,T,I,O,be,ce=t.type;if(t.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),s=[a=t.__e=i.__e]),(d=U.__b)&&d(t);e:if(typeof ce=="function")try{if(g=t.props,b="prototype"in ce&&ce.prototype.render,_=(d=ce.contextType)&&n[d.__c],E=d?_?_.props.value:d.__:n,i.__c?v=(h=t.__c=i.__c).__=h.__E:(b?t.__c=h=new ce(g,E):(t.__c=h=new tn(g,E),h.constructor=ce,h.render=Ah),_&&_.sub(h),h.props=g,h.state||(h.state={}),h.context=E,h.__n=n,u=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&ce.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=dt({},h.__s)),dt(h.__s,ce.getDerivedStateFromProps(g,h.__s))),p=h.props,f=h.state,h.__v=t,u)b&&ce.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&ce.getDerivedStateFromProps==null&&g!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(g,E),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(g,h.__s,E)===!1||t.__v==i.__v){for(t.__v!=i.__v&&(h.props=g,h.state=h.__s,h.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(re){re&&(re.__=t)}),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(g,h.__s,E),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,f,m)})}if(h.context=E,h.props=g,h.__P=e,h.__e=!1,w=U.__r,T=0,b){for(h.state=h.__s,h.__d=!1,w&&w(t),d=h.render(h.props,h.state,h.context),I=0;I<h._sb.length;I++)h.__h.push(h._sb[I]);h._sb=[]}else do h.__d=!1,w&&w(t),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++T<25);h.state=h.__s,h.getChildContext!=null&&(n=dt(dt({},n),h.getChildContext())),b&&!u&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(p,f)),O=d,d!=null&&d.type===Dt&&d.key==null&&(O=$a(d.props.children)),a=Fa(e,Qi(O)?O:[O],t,i,n,r,s,o,a,c,l),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),v&&(h.__E=h.__=null)}catch(re){if(t.__v=null,c||s!=null)if(re.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(be=s.length;be--;)Gr(s[be]);Zr(t)}else t.__e=i.__e,t.__k=i.__k,re.then||Zr(t);U.__e(re,t,i)}else s==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=kh(i.__e,t,i,n,r,s,o,c,l);return(d=U.diffed)&&d(t),128&t.__u?void 0:a}function Zr(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Zr)}function Pa(e,t,i){for(var n=0;n<i.length;n++)qr(i[n],i[++n],i[++n]);U.__c&&U.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){U.__e(s,r.__v)}})}function $a(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Qi(e)?e.map($a):dt({},e)}function kh(e,t,i,n,r,s,o,a,c){var l,d,h,u,p,f,m,v=i.props,g=t.props,b=t.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){e=p,s[l]=null;break}}if(e==null){if(b==null)return document.createTextNode(g);e=document.createElementNS(r,b,g.is&&g),a&&(U.__m&&U.__m(t,s),a=!1),s=null}if(b==null)v===g||a&&e.data==g||(e.data=g);else{if(s=s&&Ki.call(e.childNodes),v=i.props||Ji,!a&&s!=null)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)if(p=v[l],l!="children"){if(l=="dangerouslySetInnerHTML")h=p;else if(!(l in g)){if(l=="value"&&"defaultValue"in g||l=="checked"&&"defaultChecked"in g)continue;Tn(e,l,null,p,r)}}for(l in g)p=g[l],l=="children"?u=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?f=p:l=="checked"?m=p:a&&typeof p!="function"||v[l]===p||Tn(e,l,p,v[l],r);if(d)a||h&&(d.__html==h.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(h&&(e.innerHTML=""),Fa(t.type=="template"?e.content:e,Qi(u)?u:[u],t,i,n,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:i.__k&&pi(i,0),a,c),s!=null)for(l=s.length;l--;)Gr(s[l]);a||(l="value",b=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[l]||b=="progress"&&!f||b=="option"&&f!=v[l])&&Tn(e,l,f,v[l],r),l="checked",m!=null&&m!=e[l]&&Tn(e,l,m,v[l],r))}return e}function qr(e,t,i){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(r){U.__e(r,i)}}function Na(e,t,i){var n,r;if(U.unmount&&U.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||qr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){U.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(r=0;r<n.length;r++)n[r]&&Na(n[r],t,i||typeof e.type!="function");i||Gr(e.__e),e.__c=e.__=e.__e=void 0}function Ah(e,t,i){return this.constructor(e,i)}function In(e,t,i){var n,r,s,o;t==document&&(t=document.documentElement),U.__&&U.__(e,t),r=(n=typeof i=="function")?null:i&&i.__k||t.__k,s=[],o=[],zr(t,e=(!n&&i||t).__k=Ct(Dt,null,[e]),r||Ji,Ji,t.namespaceURI,!n&&i?[i]:r?null:t.firstChild?Ki.call(t.childNodes):null,s,!n&&i?i:r?r.__e:t.firstChild,n,o),Pa(s,e,o)}function Ha(e,t){In(e,t,Ha)}function Ua(e,t,i){var n,r,s,o,a=dt({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?r=t[s]:a[s]=t[s]===void 0&&o!=null?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ki.call(arguments,2):i),en(e.type,a,n||e.key,r||e.ref,null)}Ki=Ma.slice,U={__e:function(e,t,i,n){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,n||{}),o=r.__d),o)return r.__E=r}catch(a){e=a}throw e}},Ea=0,xa=function(e){return e!=null&&e.constructor==null},tn.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=dt({},this.state),typeof e=="function"&&(e=e(dt({},i),this.props)),e&&dt(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ia(this))},tn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ia(this))},tn.prototype.render=Dt,Yt=[],Aa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sa=function(e,t){return e.__v.__b-t.__v.__b},Mn.__r=0,La=/(PointerCapture)$|Capture$/i,Ur=0,Vr=Oa(!1),jr=Oa(!0);var Sh=0;function D(e,t,i,n,r,s){t||(t={});var o,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?o=t[a]:c[a]=t[a];var l={type:e,props:c,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Sh,__i:-1,__u:0,__source:r,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return U.vnode&&U.vnode(l),l}var nn,le,Wr,Va,Fn=0,ja=[],fe=U,Ga=fe.__b,za=fe.__r,Za=fe.diffed,qa=fe.__c,Wa=fe.unmount,Xa=fe.__;function Xr(e,t){fe.__h&&fe.__h(le,e,Fn||t),Fn=0;var i=le.__H||(le.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Kt(e){return Fn=1,Lh(Ja,e)}function Lh(e,t,i){var n=Xr(nn++,2);if(n.t=e,!n.__c&&(n.__=[Ja(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=le,!le.__f)){var r=function(a,c,l){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(u){return!!u.__c});if(d.every(function(u){return!u.__N}))return!s||s.call(this,a,c,l);var h=n.__c.props!==a;return d.forEach(function(u){if(u.__N){var p=u.__[0];u.__=u.__N,u.__N=void 0,p!==u.__[0]&&(h=!0)}}),s&&s.call(this,a,c,l)||h};le.__f=!0;var s=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}o&&o.call(this,a,c,l)},le.shouldComponentUpdate=r}return n.__N||n.__}function ot(e,t){var i=Xr(nn++,3);!fe.__s&&Ka(i.__H,t)&&(i.__=e,i.u=t,le.__H.__h.push(i))}function xe(e){return Fn=5,Bn(function(){return{current:e}},[])}function Bn(e,t){var i=Xr(nn++,7);return Ka(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Mh(){for(var e;e=ja.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dn),e.__H.__h.forEach(Yr),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){le=null,Ga&&Ga(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Xa&&Xa(e,t)},fe.__r=function(e){za&&za(e),nn=0;var t=(le=e.__c).__H;t&&(Wr===le?(t.__h=[],le.__h=[],t.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.forEach(Dn),t.__h.forEach(Yr),t.__h=[],nn=0)),Wr=le},fe.diffed=function(e){Za&&Za(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ja.push(t)!==1&&Va===fe.requestAnimationFrame||((Va=fe.requestAnimationFrame)||Th)(Mh)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),Wr=le=null},fe.__c=function(e,t){t.some(function(i){try{i.__h.forEach(Dn),i.__h=i.__h.filter(function(n){return!n.__||Yr(n)})}catch(n){t.some(function(r){r.__h&&(r.__h=[])}),t=[],fe.__e(n,i.__v)}}),qa&&qa(e,t)},fe.unmount=function(e){Wa&&Wa(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{Dn(n)}catch(r){t=r}}),i.__H=void 0,t&&fe.__e(t,i.__v))};var Ya=typeof requestAnimationFrame=="function";function Th(e){var t,i=function(){clearTimeout(n),Ya&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,35);Ya&&(t=requestAnimationFrame(i))}function Dn(e){var t=le,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),le=t}function Yr(e){var t=le;e.__c=e.__(),le=t}function Ka(e,t){return!e||e.length!==t.length||t.some(function(i,n){return i!==e[n]})}function Ja(e,t){return typeof t=="function"?t(e):t}/**
3127
- * @license @tabler/icons-preact v3.34.1 - MIT
3128
- *
3129
- * This source code is licensed under the MIT license.
3130
- * See the LICENSE file in the root directory of this source tree.
3131
- */var Ih={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
3132
- * @license @tabler/icons-preact v3.34.1 - MIT
3133
- *
3134
- * This source code is licensed under the MIT license.
3135
- * See the LICENSE file in the root directory of this source tree.
3136
- */const Fh=(e,t,i,n)=>{const r=f=>{var m=f,{color:s="currentColor",size:o=24,stroke:a=2,title:c,children:l,className:d="",class:h="",style:u}=m,p=ua(m,["color","size","stroke","title","children","className","class","style"]);return Ct("svg",Fe(qi(Fe({},Ih[e]),{width:String(o),height:String(o),class:["tabler-icon",`tabler-icon-${t}`,h,d].join(" "),"stroke-width":a,stroke:s,style:u}),p),[c&&Ct("title",{},c),...n.map(([v,g])=>Ct(v,g)),...Da(l)])};return r.displayName=`${i}`,r};/**
3137
- * @license @tabler/icons-preact v3.34.1 - MIT
3138
- *
3139
- * This source code is licensed under the MIT license.
3140
- * See the LICENSE file in the root directory of this source tree.
3141
- */var Bh=Fh("outline","loader-2","Loader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Kr(){return(Kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var Dh=["context","children"];function Rh(e){this.getChildContext=function(){return e.context};var t=e.children,i=function(n,r){if(n==null)return{};var s,o,a={},c=Object.keys(n);for(o=0;o<c.length;o++)r.indexOf(s=c[o])>=0||(a[s]=n[s]);return a}(e,Dh);return Ua(t,i)}function Oh(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Ct(Rh,Kr({},this._props,{context:e.detail.context}),function t(i,n){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var r=[],s={},o=0,a=i.attributes,c=i.childNodes;for(o=a.length;o--;)a[o].name!=="slot"&&(s[a[o].name]=a[o].value,s[Qa(a[o].name)]=a[o].value);for(o=c.length;o--;){var l=t(c[o],null),d=c[o].slot;d?s[d]=Ct(e1,{name:d},l):r[o]=l}var h=n?Ct(e1,null,r):r;return Ct(n||i.nodeName.toLowerCase(),s,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ha:In)(this._vdom,this._root)}function Qa(e){return e.replace(/-(\w)/g,function(t,i){return i?i.toUpperCase():""})}function Ph(e,t,i){if(this._vdom){var n={};n[e]=i=i==null?void 0:i,n[Qa(e)]=i,this._vdom=Ua(this._vdom,n),In(this._vdom,this._root)}}function $h(){In(this._vdom=null,this._root)}function e1(e,t){var i=this;return Ct("slot",Kr({},e,{ref:function(n){n?(i.ref=n,i._listener||(i._listener=function(r){r.stopPropagation(),r.detail.context=t},n.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function t1(e,t,i,n){function r(){var s=Reflect.construct(HTMLElement,[],r);return s._vdomComponent=e,s._root=n&&n.shadow?s.attachShadow({mode:n.mode||"open"}):s,s}return(r.prototype=Object.create(HTMLElement.prototype)).constructor=r,r.prototype.connectedCallback=Oh,r.prototype.attributeChangedCallback=Ph,r.prototype.disconnectedCallback=$h,i=i||e.observedAttributes||Object.keys(e.propTypes||{}),r.observedAttributes=i,i.forEach(function(s){Object.defineProperty(r.prototype,s,{get:function(){return this._vdom.props[s]},set:function(o){this._vdom?this.attributeChangedCallback(s,null,o):(this._props||(this._props={}),this._props[s]=o,this.connectedCallback());var a=typeof o;o!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(s,o)}})}),customElements.define(t||e.tagName||e.displayName||e.name,r)}const fi=(e,t=!1)=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="":t;var Nh=Symbol.for("preact-signals");function Rn(){if(Rt>1)Rt--;else{for(var e,t=!1;rn!==void 0;){var i=rn;for(rn=void 0,Jr++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&s1(i))try{i.c()}catch(r){t||(e=r,t=!0)}i=n}}if(Jr=0,Rt--,t)throw e}}function Hh(e){if(Rt>0)return e();Rt++;try{return e()}finally{Rn()}}var V=void 0;function i1(e){var t=V;V=void 0;try{return e()}finally{V=t}}var rn=void 0,Rt=0,Jr=0,On=0;function n1(e){if(V!==void 0){var t=e.n;if(t===void 0||t.t!==V)return t={i:0,S:e,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:t},V.s!==void 0&&(V.s.n=t),V.s=t,e.n=t,32&V.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=V.s,t.n=void 0,V.s.n=t,V.s=t),t}}function Ee(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}Ee.prototype.brand=Nh,Ee.prototype.h=function(){return!0},Ee.prototype.S=function(e){var t=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:i1(function(){var n;(n=t.W)==null||n.call(t)}))},Ee.prototype.U=function(e){var t=this;if(this.t!==void 0){var i=e.e,n=e.x;i!==void 0&&(i.x=n,e.e=void 0),n!==void 0&&(n.e=i,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&i1(function(){var r;(r=t.Z)==null||r.call(t)}))}},Ee.prototype.subscribe=function(e){var t=this;return sn(function(){var i=t.value,n=V;V=void 0;try{e(i)}finally{V=n}})},Ee.prototype.valueOf=function(){return this.value},Ee.prototype.toString=function(){return this.value+""},Ee.prototype.toJSON=function(){return this.value},Ee.prototype.peek=function(){var e=V;V=void 0;try{return this.value}finally{V=e}},Object.defineProperty(Ee.prototype,"value",{get:function(){var e=n1(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Jr>100)throw new Error("Cycle detected");this.v=e,this.i++,On++,Rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Rn()}}}});function r1(e,t){return new Ee(e,t)}function s1(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function o1(e){for(var t=e.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function a1(e){for(var t=e.s,i=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=i}function Jt(e,t){Ee.call(this,void 0),this.x=e,this.s=void 0,this.g=On-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}Jt.prototype=new Ee,Jt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===On))return!0;if(this.g=On,this.f|=1,this.i>0&&!s1(this))return this.f&=-2,!0;var e=V;try{o1(this),V=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return V=e,a1(this),this.f&=-2,!0},Jt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ee.prototype.S.call(this,e)},Jt.prototype.U=function(e){if(this.t!==void 0&&(Ee.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Jt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Jt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=n1(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Qr(e,t){return new Jt(e,t)}function c1(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Rt++;var i=V;V=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,es(e),n}finally{V=i,Rn()}}}function es(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,c1(e)}function Uh(e){if(V!==this)throw new Error("Out-of-order effect");a1(this),V=e,this.f&=-2,8&this.f&&es(this),Rn()}function mi(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}mi.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},mi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,c1(this),o1(this),Rt++;var e=V;return V=this,Uh.bind(this,e)},mi.prototype.N=function(){2&this.f||(this.f|=2,this.o=rn,rn=this)},mi.prototype.d=function(){this.f|=8,1&this.f||es(this)},mi.prototype.dispose=function(){this.d()};function sn(e){var t=new mi(e);try{t.c()}catch(n){throw t.d(),n}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var l1,Pn,ts,h1=[];sn(function(){l1=this.N})();function gi(e,t){U[e]=t.bind(null,U[e]||function(){})}function $n(e){ts&&ts(),ts=e&&e.S()}function d1(e){var t=this,i=e.data,n=se(i);n.value=i;var r=Bn(function(){for(var a=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=Qr(function(){var p=n.value.value;return p===0?0:p===!0?"":p||""}),d=Qr(function(){return!Array.isArray(l.value)&&!xa(l.value)}),h=sn(function(){if(this.N=u1,d.value){var p=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=p)}}),u=t.__$u.d;return t.__$u.d=function(){h(),u.call(this)},[d,l]},[]),s=r[0],o=r[1];return s.value?o.peek():o.value}d1.displayName="_st",Object.defineProperties(Ee.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:d1},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),gi("__b",function(e,t){if(typeof t.type=="string"){var i,n=t.props;for(var r in n)if(r!=="children"){var s=n[r];s instanceof Ee&&(i||(t.__np=i={}),i[r]=s,n[r]=s.peek())}}e(t)}),gi("__r",function(e,t){if(t.type!==Dt){$n();var i,n=t.__c;n&&(n.__$f&=-2,(i=n.__$u)===void 0&&(n.__$u=i=function(r){var s;return sn(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),Pn=n,$n(i)}e(t)}),gi("__e",function(e,t,i,n){$n(),Pn=void 0,e(t,i,n)}),gi("diffed",function(e,t){$n(),Pn=void 0;var i;if(typeof t.type=="string"&&(i=t.__e)){var n=t.__np,r=t.props;if(n){var s=i.U;if(s)for(var o in s){var a=s[o];a!==void 0&&!(o in n)&&(a.d(),s[o]=void 0)}else s={},i.U=s;for(var c in n){var l=s[c],d=n[c];l===void 0?(l=Vh(i,c,d,r),s[c]=l):l.o(d,r)}}}e(t)});function Vh(e,t,i,n){var r=t in e&&e.ownerSVGElement===void 0,s=r1(i);return{o:function(o,a){s.value=o,n=a},d:sn(function(){this.N=u1;var o=s.value.value;n[t]!==o&&(n[t]=o,r?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}gi("unmount",function(e,t){if(typeof t.type=="string"){var i=t.__e;if(i){var n=i.U;if(n){i.U=void 0;for(var r in n){var s=n[r];s&&s.d()}}}}else{var o=t.__c;if(o){var a=o.__$u;a&&(o.__$u=void 0,a.d())}}e(t)}),gi("__h",function(e,t,i,n){(n<3||n===9)&&(t.__$f|=2),e(t,i,n)}),tn.prototype.shouldComponentUpdate=function(e,t){var i=this.__$u,n=i&&i.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function se(e,t){return Bn(function(){return r1(e,t)},[])}function is(e,t){var i=xe(e);return i.current=e,Pn.__$f|=4,Bn(function(){return Qr(function(){return i.current()},t)},[])}var jh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Gh(){Hh(function(){for(var e;e=h1.shift();)l1.call(e)})}function u1(){h1.push(this)===1&&(U.requestAnimationFrame||jh)(Gh)}var ns,p1;function rs(){if(p1)return ns;p1=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return ns=e,ns}var ss,f1;function zh(){if(f1)return ss;f1=1;var e=typeof Ln=="object"&&Ln&&Ln.Object===Object&&Ln;return ss=e,ss}var os,m1;function g1(){if(m1)return os;m1=1;var e=zh(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return os=i,os}var as,v1;function Zh(){if(v1)return as;v1=1;var e=g1(),t=function(){return e.Date.now()};return as=t,as}var cs,b1;function qh(){if(b1)return cs;b1=1;var e=/\s/;function t(i){for(var n=i.length;n--&&e.test(i.charAt(n)););return n}return cs=t,cs}var ls,w1;function Wh(){if(w1)return ls;w1=1;var e=qh(),t=/^\s+/;function i(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return ls=i,ls}var hs,y1;function _1(){if(y1)return hs;y1=1;var e=g1(),t=e.Symbol;return hs=t,hs}var ds,C1;function Xh(){if(C1)return ds;C1=1;var e=_1(),t=Object.prototype,i=t.hasOwnProperty,n=t.toString,r=e?e.toStringTag:void 0;function s(o){var a=i.call(o,r),c=o[r];try{o[r]=void 0;var l=!0}catch(h){}var d=n.call(o);return l&&(a?o[r]=c:delete o[r]),d}return ds=s,ds}var us,E1;function Yh(){if(E1)return us;E1=1;var e=Object.prototype,t=e.toString;function i(n){return t.call(n)}return us=i,us}var ps,x1;function Kh(){if(x1)return ps;x1=1;var e=_1(),t=Xh(),i=Yh(),n="[object Null]",r="[object Undefined]",s=e?e.toStringTag:void 0;function o(a){return a==null?a===void 0?r:n:s&&s in Object(a)?t(a):i(a)}return ps=o,ps}var fs,k1;function Jh(){if(k1)return fs;k1=1;function e(t){return t!=null&&typeof t=="object"}return fs=e,fs}var ms,A1;function Qh(){if(A1)return ms;A1=1;var e=Kh(),t=Jh(),i="[object Symbol]";function n(r){return typeof r=="symbol"||t(r)&&e(r)==i}return ms=n,ms}var gs,S1;function ed(){if(S1)return gs;S1=1;var e=Wh(),t=rs(),i=Qh(),n=NaN,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function c(l){if(typeof l=="number")return l;if(i(l))return n;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var h=s.test(l);return h||o.test(l)?a(l.slice(2),h?2:8):r.test(l)?n:+l}return gs=c,gs}var vs,L1;function td(){if(L1)return vs;L1=1;var e=rs(),t=Zh(),i=ed(),n="Expected a function",r=Math.max,s=Math.min;function o(a,c,l){var d,h,u,p,f,m,v=0,g=!1,b=!1,_=!0;if(typeof a!="function")throw new TypeError(n);c=i(c)||0,e(l)&&(g=!!l.leading,b="maxWait"in l,u=b?r(i(l.maxWait)||0,c):u,_="trailing"in l?!!l.trailing:_);function E(Z){var ue=d,pe=h;return d=h=void 0,v=Z,p=a.apply(pe,ue),p}function M(Z){return v=Z,f=setTimeout(I,c),g?E(Z):p}function w(Z){var ue=Z-m,pe=Z-v,Ae=c-ue;return b?s(Ae,u-pe):Ae}function T(Z){var ue=Z-m,pe=Z-v;return m===void 0||ue>=c||ue<0||b&&pe>=u}function I(){var Z=t();if(T(Z))return O(Z);f=setTimeout(I,w(Z))}function O(Z){return f=void 0,_&&d?E(Z):(d=h=void 0,p)}function be(){f!==void 0&&clearTimeout(f),v=0,d=m=h=f=void 0}function ce(){return f===void 0?p:O(t())}function re(){var Z=t(),ue=T(Z);if(d=arguments,h=this,m=Z,ue){if(f===void 0)return M(m);if(b)return clearTimeout(f),f=setTimeout(I,c),E(m)}return f===void 0&&(f=setTimeout(I,c)),p}return re.cancel=be,re.flush=ce,re}return vs=o,vs}var bs,M1;function id(){if(M1)return bs;M1=1;var e=td(),t=rs(),i="Expected a function";function n(r,s,o){var a=!0,c=!0;if(typeof r!="function")throw new TypeError(i);return t(o)&&(a="leading"in o?!!o.leading:a,c="trailing"in o?!!o.trailing:c),e(r,s,{leading:a,maxWait:s,trailing:c})}return bs=n,bs}var nd=id();const T1=wa(nd),rd=(e="user")=>{var v;const t=xe(null),i=xe(null),[n,r]=Kt(e),[s,o]=Kt(!1),a=xe(null),c=xe(!1),l=xe(new Set),d=g=>{a.current=g};ot(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const _=setTimeout(()=>{var E;(E=a.current)==null||E.call(a),c.current=!1,l.current.delete(_)},100);l.current.add(_)}};return g.addEventListener("loadedmetadata",b),()=>{g.removeEventListener("loadedmetadata",b),l.current.forEach(_=>clearTimeout(_)),l.current.clear()}},[(v=t.current)==null?void 0:v.src]),ot(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const h=(g,b)=>L(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(be=>be.stop()),i.current=null),t.current&&(t.current.srcObject=null);const _=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||n}});i.current=_;const w=_.getVideoTracks()[0].getSettings().facingMode;(w&&w!==(g||n)||w&&w!==n)&&r(w);const O=(yield navigator.mediaDevices.enumerateDevices()).find(be=>be.kind==="videoinput"&&_.getVideoTracks()[0].getSettings().deviceId===be.deviceId);b==null||b(O==null?void 0:O.label),t.current&&(t.current.srcObject=_,yield t.current.play())}catch(_){console.error("Failed to start camera:",_)}}),u=()=>L(this,null,function*(){const g=n==="user"?"environment":"user";c.current=!0;const b=n;try{r(g),i.current&&(i.current.getTracks().forEach(_=>_.stop()),i.current=null),yield h(g)}catch(_){r(b),c.current=!1;try{yield h(b)}catch(E){console.error("Failed to restore previous camera:",E)}}}),p=()=>{const g=navigator.userAgent.toLowerCase(),b=g.includes("firefox")||g.includes("gecko")&&!g.includes("chrome")&&!g.includes("edge"),_="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",E=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||_||E,isChromium:g.includes("chrome")||g.includes("chromium")||g.includes("edge"),isWebKit:g.includes("webkit")&&!g.includes("chrome")}};return{videoRef:t,streamRef:i,facingMode:n,agentSupported:s,startCamera:h,switchCamera:u,checkAgentSupport:()=>L(this,null,function*(){var g,b;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){o(!0);return}const{isGecko:E}=p();let M=null,w=null;try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});M=(g=I.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,I.getTracks().forEach(O=>O.stop())}catch(I){}try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});w=(b=I.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,I.getTracks().forEach(O=>O.stop())}catch(I){}if(!(M&&w&&M!==w)){o(!1);return}o(!E)}catch(_){o(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(g=>g.stop()),i.current=null),t.current&&(t.current.srcObject=null,t.current.load())},registerCameraSwitchCallback:d}};var vi=typeof self!="undefined"?self:{};function Qt(){throw Error("Invalid UTF8")}function I1(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Nn,ws;const sd=typeof TextDecoder!="undefined";let od;const ad=typeof TextEncoder!="undefined";function F1(e){if(ad)e=(od||(od=new TextEncoder)).encode(e);else{let i=0;const n=new Uint8Array(3*e.length);for(let r=0;r<e.length;r++){var t=e.charCodeAt(r);if(t<128)n[i++]=t;else{if(t<2048)n[i++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&r<e.length){const s=e.charCodeAt(++r);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,n[i++]=t>>18|240,n[i++]=t>>12&63|128,n[i++]=t>>6&63|128,n[i++]=63&t|128;continue}r--}t=65533}n[i++]=t>>12|224,n[i++]=t>>6&63|128}n[i++]=63&t|128}}e=i===n.length?n:n.subarray(0,i)}return e}var ys,Hn;e:{for(var B1=["CLOSURE_FLAGS"],_s=vi,Cs=0;Cs<B1.length;Cs++)if((_s=_s[B1[Cs]])==null){Hn=null;break e}Hn=_s}var on,D1=Hn&&Hn[610401301];ys=D1!=null&&D1;const R1=vi.navigator;function Es(e){return!!ys&&!!on&&on.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Xe(e){var t;return(t=vi.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function Ot(){return!!ys&&!!on&&on.brands.length>0}function xs(){return Ot()?Es("Chromium"):(Xe("Chrome")||Xe("CriOS"))&&!(!Ot()&&Xe("Edge"))||Xe("Silk")}function Un(e){return Un[" "](e),e}on=R1&&R1.userAgentData||null,Un[" "]=function(){};var cd=!Ot()&&(Xe("Trident")||Xe("MSIE"));!Xe("Android")||xs(),xs(),Xe("Safari")&&(xs()||!Ot()&&Xe("Coast")||!Ot()&&Xe("Opera")||!Ot()&&Xe("Edge")||(Ot()?Es("Microsoft Edge"):Xe("Edg/"))||Ot()&&Es("Opera"));var O1={},an=null;function ld(e){const t=e.length;let i=3*t/4;i%3?i=Math.floor(i):"=.".indexOf(e[t-1])!=-1&&(i="=.".indexOf(e[t-2])!=-1?i-2:i-1);const n=new Uint8Array(i);let r=0;return function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=an[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}P1();let c=0;for(;;){const l=a(-1),d=a(0),h=a(64),u=a(64);if(u===64&&l===-1)break;o(l<<2|d>>4),h!=64&&(o(d<<4&240|h>>2),u!=64&&o(h<<6&192|u))}}(e,function(s){n[r++]=s}),r!==i?n.subarray(0,r):n}function P1(){if(!an){an={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const n=e.concat(t[i].split(""));O1[i]=n;for(let r=0;r<n.length;r++){const s=n[r];an[s]===void 0&&(an[s]=r)}}}}var $1=typeof Uint8Array!="undefined",N1=!cd&&typeof btoa=="function";function H1(e){if(!N1){var t;t===void 0&&(t=0),P1(),t=O1[t];var i=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var r=e[c],s=e[c+1],o=e[c+2],a=t[r>>2];r=t[(3&r)<<4|s>>4],s=t[(15&s)<<2|o>>6],o=t[63&o],i[l++]=a+r+s+o}switch(a=0,o=n,e.length-c){case 2:o=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],i[l]=t[e>>2]+t[(3&e)<<4|a>>4]+o+n}return i.join("")}for(t="",i=0,n=e.length-10240;i<n;)t+=String.fromCharCode.apply(null,e.subarray(i,i+=10240));return t+=String.fromCharCode.apply(null,i?e.subarray(i):e),btoa(t)}const U1=/[-_.]/g,hd={"-":"+",_:"/",".":"="};function dd(e){return hd[e]||""}function V1(e){if(!N1)return ld(e);U1.test(e)&&(e=e.replace(U1,dd)),e=atob(e);const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function ei(e){return $1&&e!=null&&e instanceof Uint8Array}var bi={};function ti(){return ud||(ud=new Et(null,bi))}function ks(e){j1(bi);var t=e.g;return(t=t==null||ei(t)?t:typeof t=="string"?V1(t):null)==null?t:e.g=t}var Et=class{h(){return new Uint8Array(ks(this)||0)}constructor(e,t){if(j1(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let ud,As;function j1(e){if(e!==bi)throw Error("illegal external caller")}function G1(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Ss(e){return G1(e=Error(e),"warning"),e}function Ls(e){if(e!=null){var t=As!=null?As:As={},i=t[e]||0;i>=5||(t[e]=i+1,G1(e=Error(),"incident"),function(n){vi.setTimeout(()=>{throw n},0)}(e))}}var Vn=typeof Symbol=="function"&&typeof Symbol()=="symbol";function wi(e,t,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var pd=wi("jas",void 0,!0),z1=wi(void 0,"0di"),cn=wi(void 0,"1oa"),yi=wi(void 0,Symbol()),fd=wi(void 0,"0actk"),Z1=wi(void 0,"8utk");const k=Vn?pd:"Ea",q1={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},W1=Object.defineProperties;function jn(e,t){Vn||k in e||W1(e,q1),e[k]|=t}function me(e,t){Vn||k in e||W1(e,q1),e[k]=t}function _i(e){return jn(e,34),e}function md(e,t){me(t,-15615&(0|e))}function Ms(e,t){me(t,-15581&(34|e))}function Gn(){return typeof BigInt=="function"}function Be(e){return Array.prototype.slice.call(e)}var Ts,ln={};function zn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Is(e,t){if(e!=null){if(typeof e=="string")e=e?new Et(e,bi):ti();else if(e.constructor!==Et)if(ei(e))e=e.length?new Et(new Uint8Array(e),bi):ti();else{if(!t)throw Error();e=void 0}}return e}const X1=[];function Pt(e){if(2&e)throw Error()}me(X1,55),Ts=Object.freeze(X1);class Y1{constructor(t,i,n){this.g=t,this.h=i,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function Fs(e){return yi?e[yi]:void 0}var gd=Object.freeze({});function Zn(e){return e.Na=!0,e}var vd=Zn(e=>typeof e=="number"),K1=Zn(e=>typeof e=="string"),bd=Zn(e=>typeof e=="boolean"),qn=typeof vi.BigInt=="function"&&typeof vi.BigInt(0)=="bigint";function $t(e){var t=e;if(K1(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(vd(t)&&!Number.isSafeInteger(t))throw Error(String(t));return qn?BigInt(e):e=bd(e)?e?"1":"0":K1(e)?e.trim()||"0":String(e)}var Bs=Zn(e=>qn?e>=yd&&e<=Cd:e[0]==="-"?J1(e,wd):J1(e,_d));const wd=Number.MIN_SAFE_INTEGER.toString(),yd=qn?BigInt(Number.MIN_SAFE_INTEGER):void 0,_d=Number.MAX_SAFE_INTEGER.toString(),Cd=qn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function J1(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let i=0;i<e.length;i++){const n=e[i],r=t[i];if(n>r)return!1;if(n<r)return!0}}const Ed=typeof Uint8Array.prototype.slice=="function";let Q1,q=0,oe=0;function ec(e){const t=e>>>0;q=t,oe=(e-t)/4294967296>>>0}function ii(e){if(e<0){ec(-e);const[t,i]=Ps(q,oe);q=t>>>0,oe=i>>>0}else ec(e)}function Ds(e){const t=Q1||(Q1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),oe=0,q=t.getUint32(0,!0)}function Rs(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:hn(e,t)}function Os(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Rs(e,t))=="number"?i?-e:e:i?"-"+e:e}function hn(e,t){if(e>>>=0,(t>>>=0)<=2097151)var i=""+(4294967296*t+e);else Gn()?i=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(i=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,e>=1e7&&(i+=e/1e7>>>0,e%=1e7),i>=1e7&&(t+=i/1e7>>>0,i%=1e7),i=t+tc(i)+tc(e));return i}function tc(e){return e=String(e),"0000000".slice(e.length)+e}function ic(){var e=q,t=oe;if(2147483648&t)if(Gn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,n]=Ps(e,t);e="-"+hn(i,n)}else e=hn(e,t);return e}function Wn(e){if(e.length<16)ii(Number(e));else if(Gn())e=BigInt(e),q=Number(e&BigInt(4294967295))>>>0,oe=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");oe=q=0;const i=e.length;for(let n=t,r=(i-t)%6+t;r<=i;n=r,r+=6){const s=Number(e.slice(n,r));oe*=1e6,q=1e6*q+s,q>=4294967296&&(oe+=Math.trunc(q/4294967296),oe>>>=0,q>>>=0)}if(t){const[n,r]=Ps(q,oe);q=n,oe=r}}}function Ps(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const dn=typeof BigInt=="function"?BigInt.asIntN:void 0,xd=typeof BigInt=="function"?BigInt.asUintN:void 0,Nt=Number.isSafeInteger,Xn=Number.isFinite,Ci=Math.trunc,kd=$t(0);function Ht(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function nc(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Ad=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function un(e){switch(typeof e){case"bigint":return!0;case"number":return Xn(e);case"string":return Ad.test(e);default:return!1}}function Ei(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xn(e)?0|e:void 0}function rc(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xn(e)?e>>>0:void 0}function sc(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function oc(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function ac(e){return oc(e)?e:(Wn(e),ic())}function $s(e){return e=Ci(e),Nt(e)||(ii(e),e=Os(q,oe)),e}function cc(e){var t=Ci(Number(e));return Nt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),ac(e))}function lc(e){var t=Ci(Number(e));return Nt(t)?$t(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Gn()?$t(dn(64,BigInt(e))):$t(ac(e)))}function hc(e){if(Nt(e))e=$t($s(e));else{if(e=Ci(e),Nt(e))e=String(e);else{const t=String(e);oc(t)?e=t:(ii(e),e=ic())}e=$t(e)}return e}function Ns(e){return e==null?e:typeof e=="bigint"?(Bs(e)?e=Number(e):(e=dn(64,e),e=Bs(e)?Number(e):String(e)),e):un(e)?typeof e=="number"?$s(e):cc(e):void 0}function Sd(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(xd(64,e));if(un(e)){if(t==="string")return t=Ci(Number(e)),Nt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),sc(e)||(Wn(e),e=hn(q,oe))),e;if(t==="number")return(e=Ci(e))>=0&&Nt(e)?e:function(i){if(i<0){ii(i);var n=hn(q,oe);return i=Number(n),Nt(i)?i:n}return sc(n=String(i))?n:(ii(i),Rs(q,oe))}(e)}}function dc(e){if(typeof e!="string")throw Error();return e}function xi(e){if(e!=null&&typeof e!="string")throw Error();return e}function ki(e){return e==null||typeof e=="string"?e:void 0}function Hs(e,t,i,n){if(e!=null&&typeof e=="object"&&e.W===ln)return e;if(!Array.isArray(e))return i?2&n?((e=t[z1])||(_i((e=new t).u),e=t[z1]=e),t=e):t=new t:t=void 0,t;let r=i=0|e[k];return r===0&&(r|=32&n),r|=2&n,r!==i&&me(e,r),new t(e)}function Ld(e,t,i){if(t)e:{if(!un(t=e))throw Ss("int64");switch(typeof t){case"string":t=lc(t);break e;case"bigint":t=$t(dn(64,t));break e;default:t=hc(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?$t(dn(64,t)):un(t)?e==="string"?lc(t):hc(t):void 0;return(e=t)==null?i?kd:void 0:e}function Md(e){return e}const Td={};let Id=function(){try{return Un(new class extends Map{constructor(){super()}}),!1}catch(e){return!0}}();class Us{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,i){return this.g.set(t,i),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,i){return this.g.forEach(t,i)}[Symbol.iterator](){return this.entries()}}const Fd=Id?(Object.setPrototypeOf(Us.prototype,Map.prototype),Object.defineProperties(Us.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Us):class extends Map{constructor(){super()}};function uc(e){return e}function Vs(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var ut=class extends Fd{constructor(e,t,i=uc,n=uc){super();let r=0|e[k];r|=64,me(e,r),this.M=r,this.I=t,this.S=i,this.X=this.I?Bd:n;for(let s=0;s<e.length;s++){const o=e[s],a=i(o[0],!1,!0);let c=o[1];t?c===void 0&&(c=null):c=n(o[1],!1,!0,void 0,void 0,r),super.set(a,c)}}La(){var e=$d;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=Dd){const t=[],i=super.entries();for(var n;!(n=i.next()).done;)(n=n.value)[0]=e(n[0]),n[1]=e(n[1]),t.push(n);return t}clear(){Vs(this),super.clear()}delete(e){return Vs(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new Y1(e,Rd,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new Y1(e,ut.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((i,n,r)=>{e.call(t,r.get(n),n,r)}):super.forEach(e,t)}set(e,t){return Vs(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var i=this.I;return i?((i=this.X(t,!1,!0,i,this.pa,this.M))!==t&&super.set(e,i),i):t}}[Symbol.iterator](){return this.entries()}};function Bd(e,t,i,n,r,s){return e=Hs(e,n,i,s),r&&(e=Qn(e)),e}function Dd(e){return e}function Rd(e){return[e,this.get(e)]}let Od,Yn,pc,Pd;function fc(){return Od||(Od=new ut(_i([]),void 0,void 0,void 0,Td))}function js(e,t,i,n,r){if(e!=null){if(Array.isArray(e)){const s=0|e[k];return e.length===0&&1&s?void 0:r&&2&s?e:Kn(e,t,i,n!==void 0,r)}return t(e,n)}}function Kn(e,t,i,n,r){const s=n||i?0|e[k]:0,o=n?!!(32&s):void 0;let a=0;const c=(n=Be(e)).length;for(let f=0;f<c;f++){var l=n[f];if(f===c-1&&zn(l)){var d=t,h=i,u=o,p=r;let m;for(let v in l){const g=js(l[v],d,h,u,p);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=js(n[f],t,i,o,r);n[f]=l,l!=null&&(a=f+1)}return a<c&&(n.length=a),i&&((e=Fs(e))&&(n[yi]=Be(e)),i(s,n)),n}function $d(e){return js(e,Gs,void 0,void 0,!1)}function Gs(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Bs(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(ei(e))return ei(e)&&Ls(Z1),H1(e);if(e.W===ln)return mc(e);if(e instanceof Et){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=H1(t)}return e instanceof ut?e.La():void 0}return e}function mc(e){var t=e.u;e=Kn(t,Gs,void 0,void 0,!1);var i=0|t[k];if((t=e.length)&&!(512&i)){var n=e[t-1],r=!1;zn(n)?(t--,r=!0):n=void 0;var s=t-(i=512&i?0:-1),o=(Yn!=null?Yn:Md)(s,i,e,n);if(n&&(e[t]=void 0),s<o&&n){for(var a in s=!0,n){const c=+a;c<=o?(e[r=c+i]=n[a],t=Math.max(r+1,t),r=!1,delete n[a]):s=!1}s&&(n=void 0)}for(s=t-1;t>0;s=t-1)if((a=e[s])==null)t--,r=!0;else{if(!((s-=i)>=o))break;(n!=null?n:n={})[s]=a,t--,r=!0}r&&(e.length=t),n&&e.push(n)}return e}function Ut(e,t,i){return e=gc(e,t[0],t[1],i?1:2),t!==pc&&i&&jn(e,8192),e}function gc(e,t,i,n){if(e==null){var r=96;i?(e=[i],r|=512):e=[],t&&(r=-16760833&r|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(r=0|e[k])||!(64&r)||2&r||Ls(fd),1024&r)throw Error("farr");if(64&r)return e;if(n===1||n===2||(r|=64),i&&(r|=512,i!==e[0]))throw Error("mid");e:{var s=(i=e).length;if(s){var o=s-1;if(zn(n=i[o])){if((o-=t=512&(r|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in n)(s=+a)<o&&(i[s+t]=n[a],delete n[a]);r=-16760833&r|(1023&o)<<14;break e}}if(t){if((a=Math.max(t,s-(512&r?0:-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&a)<<14}}}return me(e,r),e}function zs(e,t,i=Ms){if(e!=null){if($1&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[k];return 2&n?e:(t&&(t=n===0||!!(32&n)&&!(64&n||!(16&n))),t?(me(e,34|n),4&n&&Object.freeze(e),e):Kn(e,zs,4&n?Ms:i,!0,!0))}return e.W===ln?e=2&(n=0|(i=e.u)[k])?e:new e.constructor(Jn(i,n,!0)):e instanceof ut&&!(2&e.M)&&(i=_i(e.da(zs)),e=new ut(i,e.I,e.S,e.X)),e}}function Jn(e,t,i){const n=i||2&t?Ms:md,r=!!(32&t);return e=function(s,o,a){const c=Be(s);var l=c.length;const d=256&o?c[l-1]:void 0;for(l+=d?-1:0,o=512&o?1:0;o<l;o++)c[o]=a(c[o]);if(d){o=c[o]={};for(const h in d)o[h]=a(d[h])}return(s=Fs(s))&&(c[yi]=Be(s)),c}(e,t,s=>zs(s,r,n)),jn(e,32|(i?2:0)),e}function Qn(e){const t=e.u,i=0|t[k];return 2&i?new e.constructor(Jn(t,i,!1)):e}function Ai(e,t){return xt(e=e.u,0|e[k],t)}function xt(e,t,i){if(i===-1)return null;const n=i+(512&t?0:-1),r=e.length-1;return n>=r&&256&t?e[r][i]:n<=r?e[n]:void 0}function W(e,t,i){const n=e.u;let r=0|n[k];return Pt(r),ne(n,r,t,i),e}function ne(e,t,i,n){const r=512&t?0:-1,s=i+r;var o=e.length-1;return s>=o&&256&t?(e[o][i]=n,t):s<=o?(e[s]=n,t):(n!==void 0&&(i>=(o=t>>14&1023||536870912)?n!=null&&(e[o+r]={[i]:n},me(e,t|=256)):e[s]=n),t)}function er(e,t){let i=0|(e=e.u)[k];const n=xt(e,i,t),r=Ht(n);return r!=null&&r!==n&&ne(e,i,t,r),r}function vc(e){let t=0|(e=e.u)[k];const i=xt(e,t,1),n=Is(i,!0);return n!=null&&n!==i&&ne(e,t,1,n),n}function ni(){return gd===void 0?2:4}function ri(e,t,i,n,r){const s=e.u,o=2&(e=0|s[k])?1:n;r=!!r;let a=0|(n=Zs(s,e,t))[k];if(!(4&a)){4&a&&(n=Be(n),a=St(a,e),e=ne(s,e,t,n));let c=0,l=0;for(;c<n.length;c++){const d=i(n[c]);d!=null&&(n[l++]=d)}l<c&&(n.length=l),a=qs(a,e),i=-2049&(20|a),a=i&=-4097,me(n,a),2&a&&Object.freeze(n)}return o===1||o===4&&32&a?kt(a)||(r=a,a|=2,a!==r&&me(n,a),Object.freeze(n)):(o===2&&kt(a)&&(n=Be(n),a=St(a,e),a=Vt(a,e,r),me(n,a),e=ne(s,e,t,n)),kt(a)||(t=a,a=Vt(a,e,r),a!==t&&me(n,a))),n}function Zs(e,t,i){return e=xt(e,t,i),Array.isArray(e)?e:Ts}function qs(e,t){return e===0&&(e=St(e,t)),1|e}function kt(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function bc(e){e=Be(e);for(let t=0;t<e.length;t++){const i=e[t]=Be(e[t]);Array.isArray(i[1])&&(i[1]=_i(i[1]))}return e}function Ws(e,t,i,n){let r=0|(e=e.u)[k];Pt(r),ne(e,r,t,(n==="0"?Number(i)===0:i===n)?void 0:i)}function Si(e,t,i,n){Pt(t);let r=Zs(e,t,i);const s=r!==Ts;if(64&t||!(8192&t)||!s){const o=s?0|r[k]:0;let a=o;(!s||2&a||kt(a)||4&a&&!(32&a))&&(r=Be(r),a=St(a,t),t=ne(e,t,i,r)),a=-13&qs(a,t),a=Vt(n?-17&a:16|a,t,!0),a!==o&&me(r,a)}return r}function Xs(e,t){var i=bl;return Ks(Ys(e=e.u),e,0|e[k],i)===t?t:-1}function Ys(e){var i;if(Vn)return(i=e[cn])!=null?i:e[cn]=new Map;if(cn in e)return e[cn];const t=new Map;return Object.defineProperty(e,cn,{value:t}),t}function wc(e,t,i,n){const r=Ys(e),s=Ks(r,e,t,i);return s!==n&&(s&&(t=ne(e,t,s)),r.set(i,n)),t}function Ks(e,t,i,n){let r=e.get(n);if(r!=null)return r;r=0;for(let s=0;s<n.length;s++){const o=n[s];xt(t,i,o)!=null&&(r!==0&&(i=ne(t,i,r)),r=o)}return e.set(n,r),r}function Js(e,t,i){let n=0|e[k];const r=xt(e,n,i);let s;if(r!=null&&r.W===ln)return(t=Qn(r))!==r&&ne(e,n,i,t),t.u;if(Array.isArray(r)){const o=0|r[k];s=2&o?Ut(Jn(r,o,!1),t,!0):64&o?r:Ut(s,t,!0)}else s=Ut(void 0,t,!0);return s!==r&&ne(e,n,i,s),s}function yc(e,t,i){let n=0|(e=e.u)[k];const r=xt(e,n,i);return(t=Hs(r,t,!1,n))!==r&&t!=null&&ne(e,n,i,t),t}function N(e,t,i){if((t=yc(e,t,i))==null)return t;let n=0|(e=e.u)[k];if(!(2&n)){const r=Qn(t);r!==t&&ne(e,n,i,t=r)}return t}function _c(e,t,i,n,r,s,o){e=e.u;var a=!!(2&t);const c=a?1:r;s=!!s,o&&(o=!a);var l=0|(r=Zs(e,t,n))[k];if(!(a=!!(4&l))){var d=r,h=t;const u=!!(2&(l=qs(l,t)));u&&(h|=2);let p=!u,f=!0,m=0,v=0;for(;m<d.length;m++){const g=Hs(d[m],i,!1,h);if(g instanceof i){if(!u){const b=!!(2&(0|g.u[k]));p&&(p=!b),f&&(f=b)}d[v++]=g}}v<m&&(d.length=v),l|=4,l=f?16|l:-17&l,me(d,l=p?8|l:-9&l),u&&Object.freeze(d)}if(o&&!(8&l||!r.length&&(c===1||c===4&&32&l))){for(kt(l)&&(r=Be(r),l=St(l,t),t=ne(e,t,n,r)),i=r,o=l,d=0;d<i.length;d++)(l=i[d])!==(h=Qn(l))&&(i[d]=h);o|=8,me(i,o=i.length?-17&o:16|o),l=o}return c===1||c===4&&32&l?kt(l)||(t=l,(l|=!r.length||16&l&&(!a||32&l)?2:1024)!==t&&me(r,l),Object.freeze(r)):(c===2&&kt(l)&&(me(r=Be(r),l=Vt(l=St(l,t),t,s)),t=ne(e,t,n,r)),kt(l)||(n=l,(l=Vt(l,t,s))!==n&&me(r,l))),r}function At(e,t,i){const n=0|e.u[k];return _c(e,n,t,i,ni(),!1,!(2&n))}function S(e,t,i,n){return n==null&&(n=void 0),W(e,i,n)}function pn(e,t,i,n){n==null&&(n=void 0);e:{let r=0|(e=e.u)[k];if(Pt(r),n==null){const s=Ys(e);if(Ks(s,e,r,i)!==t)break e;s.set(i,0)}else r=wc(e,r,i,t);ne(e,r,t,n)}}function St(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Vt(e,t,i){return 32&t&&i||(e&=-33),e}function tr(e,t,i){Pt(0|e.u[k]),ri(e,t,ki,2,!0).push(dc(i))}function ir(e,t,i,n){const r=0|e.u[k];Pt(r),e=_c(e,r,i,t,2,!0),n=n!=null?n:new i,e.push(n),e[k]=2&(0|n.u[k])?-9&e[k]:-17&e[k]}function Ye(e,t){return Ei(Ai(e,t))}function Ke(e,t){return ki(Ai(e,t))}function he(e,t){var i;return(i=er(e,t))!=null?i:0}function fn(e,t,i){if(i!=null&&typeof i!="boolean")throw e=typeof i,Error(`Expected boolean but got ${e!="object"?e:i?Array.isArray(i)?"array":e:"null"}: ${i}`);W(e,t,i)}function pt(e,t,i){if(i!=null){if(typeof i!="number"||!Xn(i))throw Ss("int32");i|=0}W(e,t,i)}function x(e,t,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);W(e,t,i)}function nr(e,t,i){{const o=e.u;let a=0|o[k];if(Pt(a),i==null)ne(o,a,t);else{var n=e=0|i[k],r=kt(e),s=r||Object.isFrozen(i);for(r||(e=0),s||(i=Be(i),n=0,e=Vt(e=St(e,a),a,!0),s=!1),e|=21,r=0;r<i.length;r++){const c=i[r],l=dc(c);Object.is(c,l)||(s&&(i=Be(i),n=0,e=Vt(e=St(e,a),a,!0),s=!1),i[r]=l)}e!==n&&(s&&(i=Be(i),e=Vt(e=St(e,a),a,!0)),me(i,e)),ne(o,a,t,i)}}}function Cc(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Qs(){return Error("Failed to read varint, encoding is invalid.")}function Ec(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function eo(e){if(typeof e=="string")return{buffer:V1(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Et)return{buffer:ks(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function to(e,t){let i,n=0,r=0,s=0;const o=e.h;let a=e.g;do i=o[a++],n|=(127&i)<<s,s+=7;while(s<32&&128&i);for(s>32&&(r|=(127&i)>>4),s=3;s<32&&128&i;s+=7)i=o[a++],r|=(127&i)<<s;if(si(e,a),i<128)return t(n>>>0,r>>>0);throw Qs()}function io(e){let t=0,i=e.g;const n=i+10,r=e.h;for(;i<n;){const s=r[i++];if(t|=s,(128&s)==0)return si(e,i),!!(127&t)}throw Qs()}function jt(e){const t=e.h;let i=e.g,n=t[i++],r=127&n;if(128&n&&(n=t[i++],r|=(127&n)<<7,128&n&&(n=t[i++],r|=(127&n)<<14,128&n&&(n=t[i++],r|=(127&n)<<21,128&n&&(n=t[i++],r|=n<<28,128&n&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++])))))throw Qs();return si(e,i),r}function Lt(e){return jt(e)>>>0}function no(e){var t=e.h;const i=e.g,n=t[i],r=t[i+1],s=t[i+2];return t=t[i+3],si(e,e.g+4),(n<<0|r<<8|s<<16|t<<24)>>>0}function ro(e){var t=no(e);e=2*(t>>31)+1;const i=t>>>23&255;return t&=8388607,i==255?t?NaN:e*(1/0):i==0?1401298464324817e-60*e*t:e*Math.pow(2,i-150)*(t+8388608)}function Nd(e){return jt(e)}function so(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=eo(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function si(e,t){if(e.g=t,t>e.l)throw Ec(e.l,t)}function xc(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const i=e.g,n=i+t;if(n>e.l)throw Ec(t,e.l-i);return e.g=n,i}function kc(e,t){if(t==0)return ti();var i=xc(e,t);return e.aa&&e.m?i=e.h.subarray(i,i+t):(e=e.h,i=i===(t=i+t)?new Uint8Array(0):Ed?e.slice(i,t):new Uint8Array(e.subarray(i,t))),i.length==0?ti():new Et(i,bi)}ut.prototype.toJSON=void 0;var Ac=[];function Sc(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var i=Lt(e.g);if(t=i>>>3,!((i&=7)>=0&&i<=5))throw Cc(i,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=i,!0}function rr(e){switch(e.h){case 0:e.h!=0?rr(e):io(e.g);break;case 1:si(e=e.g,e.g+8);break;case 2:if(e.h!=2)rr(e);else{var t=Lt(e.g);si(e=e.g,e.g+t)}break;case 5:si(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Sc(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}rr(e)}break;default:throw Cc(e.h,e.l)}}function mn(e,t,i){const n=e.g.l,r=Lt(e.g),s=e.g.g+r;let o=s-n;if(o<=0&&(e.g.l=s,i(t,e,void 0,void 0,void 0),o=s-e.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${r} bytes, instead read ${r-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=s,e.g.l=n,t}function oo(e){var t=Lt(e.g),i=xc(e=e.g,t);if(e=e.h,sd){var n,r=e;(n=ws)||(n=ws=new TextDecoder("utf-8",{fatal:!0})),t=i+t,r=i===0&&t===r.length?r:r.subarray(i,t);try{var s=n.decode(r)}catch(a){if(Nn===void 0){try{n.decode(new Uint8Array([128]))}catch(c){}try{n.decode(new Uint8Array([97])),Nn=!0}catch(c){Nn=!1}}throw!Nn&&(ws=void 0),a}}else{t=(s=i)+t,i=[];let a,c=null;for(;s<t;){var o=e[s++];o<128?i.push(o):o<224?s>=t?Qt():(a=e[s++],o<194||(192&a)!=128?(s--,Qt()):i.push((31&o)<<6|63&a)):o<240?s>=t-1?Qt():(a=e[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(n=e[s++]))!=128?(s--,Qt()):i.push((15&o)<<12|(63&a)<<6|63&n)):o<=244?s>=t-2?Qt():(a=e[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(n=e[s++]))!=128||(192&(r=e[s++]))!=128?(s--,Qt()):(o=(7&o)<<18|(63&a)<<12|(63&n)<<6|63&r,o-=65536,i.push(55296+(o>>10&1023),56320+(1023&o)))):Qt(),i.length>=8192&&(c=I1(c,i),i.length=0)}s=I1(c,i)}return s}function Lc(e){const t=Lt(e.g);return kc(e.g,t)}function sr(e,t,i){var n=Lt(e.g);for(n=e.g.g+n;e.g.g<n;)i.push(t(e.g))}var or=[];function at(e,t,i){t.g?t.m(e,t.g,t.h,i):t.m(e,t.h,i)}var C=class{constructor(e,t){this.u=gc(e,t)}toJSON(){try{var e=mc(this)}finally{Yn=void 0}return e}l(){var e=_0;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(Jn(e,0|e[k],!1))}O(){return!!(2&(0|this.u[k]))}};function Mc(e){return e?/^\d+$/.test(e)?(Wn(e),new ao(q,oe)):null:Hd||(Hd=new ao(0,0))}C.prototype.W=ln,C.prototype.toString=function(){return this.u.toString()};var ao=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Hd;function Tc(e){return e?/^-?\d+$/.test(e)?(Wn(e),new co(q,oe)):null:Ud||(Ud=new co(0,0))}var co=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Ud;function Li(e,t,i){for(;i>0||t>127;)e.g.push(127&t|128),t=(t>>>7|i<<25)>>>0,i>>>=7;e.g.push(t)}function Mi(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ar(e,t){if(t>=0)Mi(e,t);else{for(let i=0;i<9;i++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function gn(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Ti(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function $e(e,t,i){Mi(e.g,8*t+i)}function lo(e,t){return $e(e,t,2),t=e.g.end(),Ti(e,t),t.push(e.h),t}function ho(e,t){var i=t.pop();for(i=e.h+e.g.length()-i;i>127;)t.push(127&i|128),i>>>=7,e.h++;t.push(i),e.h++}function cr(e,t,i){$e(e,t,2),Mi(e.g,i.length),Ti(e,e.g.end()),Ti(e,i)}function lr(e,t,i,n){i!=null&&(t=lo(e,t),n(i,e),ho(e,t))}function ct(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var uo=ct(),Ic=ct(),po=ct(),fo=ct(),Fc=ct(),Bc=ct(),mo=ct(),Dc=ct(),Rc=ct(),Ii=class{constructor(e,t,i){this.g=e,this.h=t,e=uo,this.l=!!e&&i===e||!1}};function hr(e,t){return new Ii(e,t,uo)}function Oc(e,t,i,n,r){lr(e,i,Hc(t,n),r)}const Vd=hr(function(e,t,i,n,r){return e.h===2&&(mn(e,Js(t,n,i),r),!0)},Oc),jd=hr(function(e,t,i,n,r){return e.h===2&&(mn(e,Js(t,n,i),r),!0)},Oc);var dr=Symbol(),go=Symbol(),Pc=Symbol(),$c=Symbol();let ur,pr;function oi(e,t,i,n){var r=n[e];if(r)return r;(r={}).Ma=n,r.T=function(h){switch(typeof h){case"boolean":return pc||(pc=[0,void 0,!0]);case"number":return h>0?void 0:h===0?Pd||(Pd=[0,void 0]):[-h,void 0];case"string":return[0,h];case"object":return h}}(n[0]);var s=n[1];let o=1;s&&s.constructor===Object&&(r.ga=s,typeof(s=n[++o])=="function"&&(r.la=!0,ur!=null||(ur=s),pr!=null||(pr=n[o+1]),s=n[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=n[++o]}for(c=1;s!==void 0;){let h;typeof s=="number"&&(c+=s,s=n[++o]);var l=void 0;if(s instanceof Ii?h=s:(h=Vd,o--),h==null?void 0:h.l){s=n[++o],l=n;var d=o;typeof s=="function"&&(s=s(),l[d]=s),l=s}for(d=c+1,typeof(s=n[++o])=="number"&&s<0&&(d-=s,s=n[++o]);c<d;c++){const u=a[c];l?i(r,c,h,l,u):t(r,c,h,u)}}return n[e]=r}function Nc(e){return Array.isArray(e)?e[0]instanceof Ii?e:[jd,e]:[e,void 0]}function Hc(e,t){return e instanceof C?e.u:Array.isArray(e)?Ut(e,t,!1):void 0}function vo(e,t,i,n){const r=i.g;e[t]=n?(s,o,a)=>r(s,o,a,n):r}function bo(e,t,i,n,r){const s=i.g;let o,a;e[t]=(c,l,d)=>s(c,l,d,a||(a=oi(go,vo,bo,n).T),o||(o=wo(n)),r)}function wo(e){let t=e[Pc];if(t!=null)return t;const i=oi(go,vo,bo,e);return t=i.la?(n,r)=>ur(n,r,i):(n,r)=>{const s=0|n[k];for(;Sc(r)&&r.h!=4;){var o=r.m,a=i[o];if(a==null){var c=i.ga;c&&(c=c[o])&&(c=Gd(c))!=null&&(a=i[o]=c)}a!=null&&a(r,n,o)||(o=(a=r).l,rr(a),a.fa?a=void 0:(c=a.g.g-o,a.g.g=o,a=kc(a.g,c)),o=n,a&&((c=o[yi])?c.push(a):o[yi]=[a]))}return 8192&s&&_i(n),!0},e[Pc]=t}function Gd(e){const t=(e=Nc(e))[0].g;if(e=e[1]){const i=wo(e),n=oi(go,vo,bo,e).T;return(r,s,o)=>t(r,s,o,n,i)}return t}function fr(e,t,i){e[t]=i.h}function mr(e,t,i,n){let r,s;const o=i.h;e[t]=(a,c,l)=>o(a,c,l,s||(s=oi(dr,fr,mr,n).T),r||(r=Uc(n)))}function Uc(e){let t=e[$c];if(!t){const i=oi(dr,fr,mr,e);t=(n,r)=>Vc(n,r,i),e[$c]=t}return t}function Vc(e,t,i){(function(n,r,s){const o=512&r?0:-1,a=n.length,c=a+((r=64&r?256&r:!!a&&zn(n[a-1]))?-1:0);for(let l=0;l<c;l++)s(l-o,n[l]);if(r){n=n[a-1];for(const l in n)!isNaN(l)&&s(+l,n[l])}})(e,0|e[k]|(i.T[1]?512:0),(n,r)=>{if(r!=null){var s=function(o,a){var c=o[a];if(c)return c;if((c=o.ga)&&(c=c[a])){var l=(c=Nc(c))[0].h;if(c=c[1]){const d=Uc(c),h=oi(dr,fr,mr,c).T;c=o.la?pr(h,d):(u,p,f)=>l(u,p,f,h,d)}else c=l;return o[a]=c}}(i,n);s&&s(t,r,n)}}),(e=Fs(e))&&function(n,r){Ti(n,n.g.end());for(let s=0;s<r.length;s++)Ti(n,ks(r[s])||new Uint8Array(0))}(t,e)}function Fi(e,t){if(Array.isArray(t)){var i=0|t[k];if(4&i)return t;for(var n=0,r=0;n<t.length;n++){const s=e(t[n]);s!=null&&(t[r++]=s)}return r<n&&(t.length=r),me(t,-6145&(5|i)),2&i&&Object.freeze(t),t}}function Se(e,t,i){return new Ii(e,t,i)}function Bi(e,t,i){return new Ii(e,t,i)}function Le(e,t,i){ne(e,0|e[k],t,i)}var zd=hr(function(e,t,i,n,r){return e.h===2&&(e=mn(e,Ut([void 0,void 0],n,!0),r),Pt(n=0|t[k]),(r=xt(t,n,i))instanceof ut?(2&r.M)!=0?((r=r.da()).push(e),ne(t,n,i,r)):r.Ja(e):Array.isArray(r)?(2&(0|r[k])&&ne(t,n,i,r=bc(r)),r.push(e)):ne(t,n,i,[e]),!0)},function(e,t,i,n,r){if(t instanceof ut)t.forEach((s,o)=>{lr(e,i,Ut([o,s],n,!1),r)});else if(Array.isArray(t))for(let s=0;s<t.length;s++){const o=t[s];Array.isArray(o)&&lr(e,i,Ut(o,n,!1),r)}});function jc(e,t,i){if(t=function(n){if(n==null)return n;const r=typeof n;if(r==="bigint")return String(dn(64,n));if(un(n)){if(r==="string")return cc(n);if(r==="number")return $s(n)}}(t),t!=null&&(typeof t=="string"&&Tc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Li(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new co(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Li(e.g,i.h,i.g);break;default:i=Tc(t),Li(e.g,i.h,i.g)}}function Gc(e,t,i){(t=Ei(t))!=null&&t!=null&&($e(e,i,0),ar(e.g,t))}function zc(e,t,i){(t=nc(t))!=null&&($e(e,i,0),e.g.g.push(t?1:0))}function Zc(e,t,i){(t=ki(t))!=null&&cr(e,i,F1(t))}function qc(e,t,i,n,r){lr(e,i,Hc(t,n),r)}function Wc(e,t,i){t==null||typeof t=="string"||t instanceof Et||(ei(t)?ei(t)&&Ls(Z1):t=void 0),t!=null&&cr(e,i,eo(t).buffer)}function Xc(e,t,i){return(e.h===5||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,ro,t):t.push(ro(e.g)),!0)}var Mt=Se(function(e,t,i){if(e.h!==1)return!1;var n=e.g;e=no(n);const r=no(n);n=2*(r>>31)+1;const s=r>>>20&2047;return e=4294967296*(1048575&r)+e,Le(t,i,s==2047?e?NaN:n*(1/0):s==0?5e-324*n*e:n*Math.pow(2,s-1075)*(e+4503599627370496)),!0},function(e,t,i){(t=Ht(t))!=null&&($e(e,i,1),e=e.g,(i=Q1||(Q1=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),q=i.getUint32(0,!0),oe=i.getUint32(4,!0),gn(e,q),gn(e,oe))},ct()),ge=Se(function(e,t,i){return e.h===5&&(Le(t,i,ro(e.g)),!0)},function(e,t,i){(t=Ht(t))!=null&&($e(e,i,5),e=e.g,Ds(t),gn(e,q))},mo),Zd=Bi(Xc,function(e,t,i){if((t=Fi(Ht,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&($e(n,r,5),n=n.g,Ds(s),gn(n,q))}},mo),yo=Bi(Xc,function(e,t,i){if((t=Fi(Ht,t))!=null&&t.length){$e(e,i,2),Mi(e.g,4*t.length);for(let n=0;n<t.length;n++)i=e.g,Ds(t[n]),gn(i,q)}},mo),Gt=Se(function(e,t,i){return e.h===0&&(Le(t,i,to(e.g,Os)),!0)},jc,Bc),_o=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=to(e.g,Os))===0?void 0:e),!0)},jc,Bc),qd=Se(function(e,t,i){return e.h===0&&(Le(t,i,to(e.g,Rs)),!0)},function(e,t,i){if((t=Sd(t))!=null&&(typeof t=="string"&&Mc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Li(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new ao(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Li(e.g,i.h,i.g);break;default:i=Mc(t),Li(e.g,i.h,i.g)}},ct()),ae=Se(function(e,t,i){return e.h===0&&(Le(t,i,jt(e.g)),!0)},Gc,fo),gr=Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,jt,t):t.push(jt(e.g)),!0)},function(e,t,i){if((t=Fi(Ei,t))!=null&&t.length){i=lo(e,i);for(let n=0;n<t.length;n++)ar(e.g,t[n]);ho(e,i)}},fo),Di=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=jt(e.g))===0?void 0:e),!0)},Gc,fo),Q=Se(function(e,t,i){return e.h===0&&(Le(t,i,io(e.g)),!0)},zc,Ic),Ri=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=io(e.g))===!1?void 0:e),!0)},zc,Ic),ke=Bi(function(e,t,i){return e.h===2&&(e=oo(e),Si(t,0|t[k],i,!1).push(e),!0)},function(e,t,i){if((t=Fi(ki,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&cr(n,r,F1(s))}},po),zt=Se(function(e,t,i){return e.h===2&&(Le(t,i,(e=oo(e))===""?void 0:e),!0)},Zc,po),j=Se(function(e,t,i){return e.h===2&&(Le(t,i,oo(e)),!0)},Zc,po),we=function(e,t,i=uo){return new Ii(e,t,i)}(function(e,t,i,n,r){return e.h===2&&(n=Ut(void 0,n,!0),Si(t,0|t[k],i,!0).push(n),mn(e,n,r),!0)},function(e,t,i,n,r){if(Array.isArray(t))for(let s=0;s<t.length;s++)qc(e,t[s],i,n,r)}),G=hr(function(e,t,i,n,r,s){return e.h===2&&(wc(t,0|t[k],s,i),mn(e,t=Js(t,n,i),r),!0)},qc),Yc=Se(function(e,t,i){return e.h===2&&(Le(t,i,Lc(e)),!0)},Wc,Dc),Wd=Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,Lt,t):t.push(Lt(e.g)),!0)},function(e,t,i){if((t=Fi(rc,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&($e(n,r,0),Mi(n.g,s))}},Fc),Xd=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=Lt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=rc(t))!=null&&t!=null&&($e(e,i,0),Mi(e.g,t))},Fc),Ne=Se(function(e,t,i){return e.h===0&&(Le(t,i,jt(e.g)),!0)},function(e,t,i){(t=Ei(t))!=null&&(t=parseInt(t,10),$e(e,i,0),ar(e.g,t))},Rc);class Yd{constructor(t,i){this.h=t,this.g=i,this.l=N,this.m=S,this.defaultValue=void 0}register(){Un(this)}}function lt(e,t){return new Yd(e,t)}function Zt(e,t){return(i,n)=>{if(or.length){const s=or.pop();s.o(n),so(s.g,i,n),i=s}else i=new class{constructor(s,o){if(Ac.length){const a=Ac.pop();so(a,s,o),s=a}else s=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,so(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,o);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({fa:s=!1}={}){this.fa=s}}(i,n);try{const s=new e,o=s.u;wo(t)(o,i);var r=s}finally{i.g.clear(),i.m=-1,i.h=-1,or.length<100&&or.push(i)}return r}}function vr(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Vc(this.u,t,oi(dr,fr,mr,e)),Ti(t,t.g.end());const i=new Uint8Array(t.h),n=t.l,r=n.length;let s=0;for(let o=0;o<r;o++){const a=n[o];i.set(a,s),s+=a.length}return t.l=[i],i}}var Kc=class extends C{constructor(e){super(e)}},Jc=[0,zt,Se(function(e,t,i){return e.h===2&&(Le(t,i,(e=Lc(e))===ti()?void 0:e),!0)},function(e,t,i){if(t!=null){if(t instanceof C){const n=t.Oa;return void(n&&(t=n(t),t!=null&&cr(e,i,eo(t).buffer)))}if(Array.isArray(t))return}Wc(e,t,i)},Dc)];let Co,Qc=globalThis.trustedTypes;function el(e){Co===void 0&&(Co=function(){let i=null;if(!Qc)return i;try{const n=r=>r;i=Qc.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch(n){}return i}());var t=Co;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function Kd(e,...t){if(t.length===0)return el(e[0]);let i=e[0];for(let n=0;n<t.length;n++)i+=encodeURIComponent(t[n])+e[n+1];return el(i)}var tl=[0,ae,Ne,Q,-1,gr,Ne,-1],Jd=class extends C{constructor(e){super(e)}},il=[0,Q,j,Q,Ne,-1,Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,Nd,t):t.push(jt(e.g)),!0)},function(e,t,i){if((t=Fi(Ei,t))!=null&&t.length){i=lo(e,i);for(let n=0;n<t.length;n++)ar(e.g,t[n]);ho(e,i)}},Rc),j,-1,[0,Q,-1],Ne,Q,-1],nl=[0,j,-2],rl=class extends C{constructor(e){super(e)}},sl=[0],ol=[0,ae,Q,1,Q,-3],He=class extends C{constructor(e){super(e,2)}},ve={};ve[336783863]=[0,j,Q,-1,ae,[0,[1,2,3,4,5,6,7,8,9],G,sl,G,il,G,nl,G,ol,G,tl,G,[0,j,-2],G,[0,j,Ne],G,[0,Ne,j,-1],G,[0,Ne,-1]],[0,j],Q,[0,[1,3],[2,4],G,[0,gr],-1,G,[0,ke],-1,we,[0,j,-1]],j];var al=[0,_o,-1,Ri,-3,_o,gr,zt,Di,_o,-1,Ri,Di,Ri,-2,zt];function Ue(e,t){Ws(e,2,xi(t),"")}function X(e,t){tr(e,3,t)}function $(e,t){tr(e,4,t)}var Me=class extends C{constructor(e){super(e,500)}o(e){return S(this,0,7,e)}},vn=[-1,{}],cl=[0,j,1,vn],ll=[0,j,ke,vn];function Ve(e,t){ir(e,1,Me,t)}function Y(e,t){tr(e,10,t)}function H(e,t){tr(e,15,t)}var De=class extends C{constructor(e){super(e,500)}o(e){return S(this,0,1001,e)}},hl=[-500,we,[-500,zt,-1,ke,-3,[-2,ve,Q],we,Jc,Di,-1,cl,ll,we,[0,zt,Ri],zt,al,Di,ke,987,ke],4,we,[-500,j,-1,[-1,{}],998,j],we,[-500,j,ke,-1,[-2,{},Q],997,ke,-1],Di,we,[-500,j,ke,vn,998,ke],ke,Di,cl,ll,we,[0,zt,-1,vn],ke,-2,al,zt,-1,Ri,[0,Ri,Xd],978,vn,we,Jc];De.prototype.g=vr(hl);var Qd=Zt(De,hl),e0=class extends C{constructor(e){super(e)}},dl=class extends C{constructor(e){super(e)}g(){return At(this,e0,1)}},ul=[0,we,[0,ae,ge,j,-1]],br=Zt(dl,ul),t0=class extends C{constructor(e){super(e)}},i0=class extends C{constructor(e){super(e)}},Eo=class extends C{constructor(e){super(e)}h(){return N(this,t0,2)}g(){return At(this,i0,5)}},pl=Zt(class extends C{constructor(e){super(e)}},[0,ke,gr,yo,[0,Ne,[0,ae,-3],[0,ge,-3],[0,ae,-1,[0,we,[0,ae,-2]]],we,[0,ge,-1,j,ge]],j,-1,Gt,we,[0,ae,ge],ke,Gt]),fl=class extends C{constructor(e){super(e)}},Oi=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,ge,-4]]),ml=class extends C{constructor(e){super(e)}},bn=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,ge,-4]]),n0=class extends C{constructor(e){super(e)}},r0=[0,ae,-1,yo,Ne],gl=class extends C{constructor(e){super(e)}};gl.prototype.g=vr([0,ge,-4,Gt]);var s0=class extends C{constructor(e){super(e)}},o0=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,1,ae,j,ul],Gt]),vl=class extends C{constructor(e){super(e)}},a0=class extends C{constructor(e){super(e)}ma(){const e=vc(this);return e==null?ti():e}},c0=class extends C{constructor(e){super(e)}},bl=[1,2],l0=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,bl,G,[0,yo],G,[0,Yc],ae,j],Gt]),xo=class extends C{constructor(e){super(e)}},wl=[0,j,ae,ge,ke,-1],yl=class extends C{constructor(e){super(e)}},h0=[0,Q,-1],_l=class extends C{constructor(e){super(e)}},wr=[1,2,3,4,5],yr=class extends C{constructor(e){super(e)}g(){return vc(this)!=null}h(){return Ke(this,2)!=null}},ee=class extends C{constructor(e){super(e)}g(){var e;return(e=nc(Ai(this,2)))!=null?e:!1}},Cl=[0,Yc,j,[0,ae,Gt,-1],[0,qd,Gt]],de=[0,Cl,Q,[0,wr,G,ol,G,il,G,tl,G,sl,G,nl],Ne],_r=class extends C{constructor(e){super(e)}},ko=[0,de,ge,-1,ae],d0=lt(502141897,_r);ve[502141897]=ko;var u0=Zt(class extends C{constructor(e){super(e)}},[0,[0,Ne,-1,Zd,Wd],r0]),El=class extends C{constructor(e){super(e)}},xl=class extends C{constructor(e){super(e)}},Ao=[0,de,ge,[0,de],Q],kl=[0,de,ko,Ao,ge,[0,[0,Cl]]],p0=lt(508968150,xl);ve[508968150]=kl,ve[508968149]=Ao;var Al=class extends C{constructor(e){super(e)}},f0=lt(513916220,Al);ve[513916220]=[0,de,kl,ae];var Pi=class extends C{constructor(e){super(e)}h(){return N(this,xo,2)}g(){W(this,2)}},Sl=[0,de,wl];ve[478825465]=Sl;var m0=class extends C{constructor(e){super(e)}},Ll=class extends C{constructor(e){super(e)}},So=class extends C{constructor(e){super(e)}},Lo=class extends C{constructor(e){super(e)}},Ml=class extends C{constructor(e){super(e)}},Tl=[0,de,[0,de],Sl,-1],Il=[0,de,ge,ae],Mo=[0,de,ge],Fl=[0,de,Il,Mo,ge],g0=lt(479097054,Ml);ve[479097054]=[0,de,Fl,Tl],ve[463370452]=Tl,ve[464864288]=Il;var v0=lt(462713202,Lo);ve[462713202]=Fl,ve[474472470]=Mo;var b0=class extends C{constructor(e){super(e)}},Bl=class extends C{constructor(e){super(e)}},Dl=class extends C{constructor(e){super(e)}},Rl=class extends C{constructor(e){super(e)}},To=[0,de,ge,-1,ae],Io=[0,de,ge,Q];Rl.prototype.g=vr([0,de,Mo,[0,de],ko,Ao,To,Io]);var Ol=class extends C{constructor(e){super(e)}},w0=lt(456383383,Ol);ve[456383383]=[0,de,wl];var Pl=class extends C{constructor(e){super(e)}},y0=lt(476348187,Pl);ve[476348187]=[0,de,h0];var $l=class extends C{constructor(e){super(e)}},Nl=class extends C{constructor(e){super(e)}},Hl=[0,Ne,-1],_0=lt(458105876,class extends C{constructor(e){super(e)}g(){var e=this.u;const t=0|e[k],i=2&t;return e=function(n,r,s){var o=Nl;const a=2&r;let c=!1;if(s==null){if(a)return fc();s=[]}else if(s.constructor===ut){if((2&s.M)==0||a)return s;s=s.da()}else Array.isArray(s)?c=!!(2&(0|s[k])):s=[];if(a){if(!s.length)return fc();c||(c=!0,_i(s))}else c&&(c=!1,s=bc(s));return c||(64&(0|s[k])?s[k]&=-33:32&r&&jn(s,32)),ne(n,r,2,o=new ut(s,o,Ld,void 0)),o}(e,t,xt(e,t,2)),!i&&Nl&&(e.pa=!0),e}});ve[458105876]=[0,Hl,zd,[!0,Gt,[0,j,-1,ke]]];var Fo=class extends C{constructor(e){super(e)}},Ul=lt(458105758,Fo);ve[458105758]=[0,de,j,Hl];var Vl=class extends C{constructor(e){super(e)}},C0=lt(443442058,Vl);ve[443442058]=[0,de,j,ae,ge,ke,-1,Q,ge],ve[514774813]=To;var jl=class extends C{constructor(e){super(e)}},E0=lt(516587230,jl);function Bo(e,t){return t=t?t.clone():new xo,e.displayNamesLocale!==void 0?W(t,1,xi(e.displayNamesLocale)):e.displayNamesLocale===void 0&&W(t,1),e.maxResults!==void 0?pt(t,2,e.maxResults):"maxResults"in e&&W(t,2),e.scoreThreshold!==void 0?x(t,3,e.scoreThreshold):"scoreThreshold"in e&&W(t,3),e.categoryAllowlist!==void 0?nr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&W(t,4),e.categoryDenylist!==void 0?nr(t,5,e.categoryDenylist):"categoryDenylist"in e&&W(t,5),t}function Do(e,t=-1,i=""){return{categories:e.map(n=>{var r,s,o,a,c,l,d;return{index:(s=(r=Ye(n,1))!=null?r:0)!=null?s:-1,score:(o=he(n,2))!=null?o:0,categoryName:(c=(a=Ke(n,3))!=null?a:"")!=null?c:"",displayName:(d=(l=Ke(n,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function Gl(e){var o,a,c,l,d,h,u,p,f,m,v,g,b;var t=ri(e,3,Ht,ni()),i=ri(e,2,Ei,ni()),n=ri(e,1,ki,ni()),r=ri(e,9,ki,ni());const s={categories:[],keypoints:[]};for(let _=0;_<t.length;_++)s.categories.push({score:t[_],index:(o=i[_])!=null?o:-1,categoryName:(a=n[_])!=null?a:"",displayName:(c=r[_])!=null?c:""});if((t=(l=N(e,Eo,4))==null?void 0:l.h())&&(s.boundingBox={originX:(d=Ye(t,1))!=null?d:0,originY:(h=Ye(t,2))!=null?h:0,width:(u=Ye(t,3))!=null?u:0,height:(p=Ye(t,4))!=null?p:0,angle:0}),(f=N(e,Eo,4))==null?void 0:f.g().length)for(const _ of N(e,Eo,4).g())s.keypoints.push({x:(m=er(_,1))!=null?m:0,y:(v=er(_,2))!=null?v:0,score:(g=er(_,4))!=null?g:0,label:(b=Ke(_,3))!=null?b:""});return s}function Cr(e){var i,n,r,s;const t=[];for(const o of At(e,ml,1))t.push({x:(i=he(o,1))!=null?i:0,y:(n=he(o,2))!=null?n:0,z:(r=he(o,3))!=null?r:0,visibility:(s=he(o,4))!=null?s:0});return t}function wn(e){var i,n,r,s;const t=[];for(const o of At(e,fl,1))t.push({x:(i=he(o,1))!=null?i:0,y:(n=he(o,2))!=null?n:0,z:(r=he(o,3))!=null?r:0,visibility:(s=he(o,4))!=null?s:0});return t}function zl(e){return Array.from(e,t=>t>127?t-256:t)}function Zl(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let i=0,n=0,r=0;for(let s=0;s<e.length;s++)i+=e[s]*t[s],n+=e[s]*e[s],r+=t[s]*t[s];if(n<=0||r<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(n*r)}let Er;ve[516587230]=[0,de,To,Io,ge],ve[518928384]=Io;const x0=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]);function ql(){return L(this,null,function*(){if(Er===void 0)try{yield WebAssembly.instantiate(x0),Er=!0}catch(e){Er=!1}return Er})}function yn(i){return L(this,arguments,function*(e,t=Kd``){const n=(yield ql())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${n}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}})}var ai=class{};function Wl(){var e=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}function Xl(e){return L(this,null,function*(){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((i,n)=>{t.addEventListener("load",()=>{i()},!1),t.addEventListener("error",r=>{n(r)},!1),document.body.appendChild(t)})}importScripts(e.toString())})}function Yl(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function A(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Kl(e,t,i){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(i?e.i._bindTextureToStream(i):e.i._bindTextureToCanvas(),!(i=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[n,r]=Yl(t);return!e.l||n===e.i.canvas.width&&r===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=r),[n,r]}function Jl(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let r=0;r<t.length;r++)n[r]=e.i.stringToNewUTF8(t[r]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),i(t);for(const r of n)e.i._free(r);e.i._free(t)}function ft(e,t,i){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=i}function qt(e,t,i){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(r,s,o)=>{s?(i(n,o),n=[]):n.push(r)}}ai.forVisionTasks=function(e){return yn("vision",e)},ai.forTextTasks=function(e){return yn("text",e)},ai.forGenAiExperimentalTasks=function(e){return yn("genai_experimental",e)},ai.forGenAiTasks=function(e){return yn("genai",e)},ai.forAudioTasks=function(e){return yn("audio",e)},ai.isSimdSupported=function(){return ql()};function k0(e,t,i,n){return L(this,null,function*(){return e=yield((r,s,o,a,c)=>L(this,null,function*(){if(s&&(yield Xl(s)),!self.ModuleFactory||o&&(yield Xl(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((s=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=yield self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new r(c,a)}))(e,i.wasmLoaderPath,i.assetLoaderPath,t,{locateFile:r=>r.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&r.endsWith(".data")?i.assetBinaryPath.toString():r}),yield e.o(n),e})}function Ro(e,t){const i=N(e.baseOptions,yr,1)||new yr;typeof t=="string"?(W(i,2,xi(t)),W(i,1)):t instanceof Uint8Array&&(W(i,1,Is(t,!1)),W(i,2)),S(e.baseOptions,0,1,i)}function Ql(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(i=>i.message).join(", "))}finally{e.G=[]}}function y(e,t){e.B=Math.max(e.B,t)}function xr(e,t){e.A=new Me,Ue(e.A,"PassThroughCalculator"),X(e.A,"free_memory"),$(e.A,"free_memory_unused_out"),Y(t,"free_memory"),Ve(t,e.A)}function $i(e,t){X(e.A,t),$(e.A,t+"_unused_out")}function kr(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Oo=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var i,n,r,s,o,a;if(t){const c=e.baseOptions||{};if((i=e.baseOptions)!=null&&i.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((r=N(this.baseOptions,yr,1))!=null&&r.g()||(s=N(this.baseOptions,yr,1))!=null&&s.h()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(a=e.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(l,d){let h=N(l.baseOptions,_l,3);if(!h){var u=h=new _l,p=new rl;pn(u,4,wr,p)}"delegate"in d&&(d.delegate==="GPU"?(d=h,u=new Jd,pn(d,2,wr,u)):(d=h,u=new rl,pn(d,4,wr,u))),S(l.baseOptions,0,3,h)}(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then(l=>{if(l.ok)return l.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${l.status})`)}).then(l=>{try{this.g.i.FS_unlink("/model.dat")}catch(d){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(l),!0,!1,!1),Ro(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Ro(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(l){return L(this,null,function*(){const d=[];for(var h=0;;){const{done:u,value:p}=yield l.read();if(u)break;d.push(p),h+=p.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];l=new Uint8Array(h),h=0;for(const u of d)l.set(u,h),h+=u.length;return l})}(c.modelAssetBuffer).then(l=>{Ro(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=Qd(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((i,n)=>{this.G.push(Error(n))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Ql(this)}finishProcessing(){this.g.finishProcessing(),Ql(this)}close(){this.A=void 0,this.g.closeGraph()}};function Te(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Oo.prototype.close=Oo.prototype.close;class A0{constructor(t,i,n,r){this.g=t,this.h=i,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function e2(e,t,i){const n=e.g;if(i=Te(n.createShader(i),"Failed to create WebGL shader"),n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(i)}`);return n.attachShader(e.h,i),i}function t2(e,t){const i=e.g,n=Te(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(n);const r=Te(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,r),i.enableVertexAttribArray(e.P),i.vertexAttribPointer(e.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const s=Te(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,s),i.enableVertexAttribArray(e.J),i.vertexAttribPointer(e.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new A0(i,n,r,s)}function Po(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function _n(e,t,i,n){return Po(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=t2(e,!0)),i=e.s):(e.v||(e.v=t2(e,!1)),i=e.v),t.useProgram(e.h),i.bind(),e.l(),e=n(),i.g.bindVertexArray(null),e}function Wt(e,t,i){return Po(e,t),e=Te(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i!=null?i:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i!=null?i:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Ar(e,t,i){Po(e,t),e.A||(e.A=Te(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}function $o(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ni=class{G(){return`
3119
+ `}class _h extends HTMLElement{constructor(){super(),this.templateString=yh.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-image","mirror-image"]}get hideBack(){return this.hasAttribute("hide-back-to-host")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get imageSrc(){return this.getAttribute("data-image")}get shouldMirror(){return this.getAttribute("mirror-image")!=="false"}get title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":case"mirror-image":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureImage=this.shadowRoot.querySelector("#re-capture-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.accepted",{detail:{}}))}),this.reCaptureImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("selfie-capture-review")&&window.customElements.define("selfie-capture-review",_h);var Ki,U,Ea,xa,Yt,ka,Aa,Sa,La,Ur,Vr,jr,Ji={},Ma=[],Ch=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qi=Array.isArray;function dt(e,t){for(var i in t)e[i]=t[i];return e}function Gr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ct(e,t,i){var n,r,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ki.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return en(e,o,n,r,null)}function en(e,t,i,n,r){var s={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r==null?++Ea:r,__i:-1,__u:0};return r==null&&U.vnode!=null&&U.vnode(s),s}function Dt(e){return e.children}function tn(e,t){this.props=e,this.context=t}function pi(e,t){if(t==null)return e.__?pi(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?pi(e):null}function Ta(e){var t,i;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((i=e.__k[t])!=null&&i.__e!=null){e.__e=e.__c.base=i.__e;break}return Ta(e)}}function Ia(e){(!e.__d&&(e.__d=!0)&&Yt.push(e)&&!Mn.__r++||ka!=U.debounceRendering)&&((ka=U.debounceRendering)||Aa)(Mn)}function Mn(){for(var e,t,i,n,r,s,o,a=1;Yt.length;)Yt.length>a&&Yt.sort(Sa),e=Yt.shift(),a=Yt.length,e.__d&&(i=void 0,r=(n=(t=e).__v).__e,s=[],o=[],t.__P&&((i=dt({},n)).__v=n.__v+1,U.vnode&&U.vnode(i),zr(t.__P,i,n,t.__n,t.__P.namespaceURI,32&n.__u?[r]:null,s,r==null?pi(n):r,!!(32&n.__u),o),i.__v=n.__v,i.__.__k[i.__i]=i,Pa(s,i,o),i.__e!=r&&Ta(i)));Mn.__r=0}function Fa(e,t,i,n,r,s,o,a,c,l,d){var h,u,p,f,m,v,g=n&&n.__k||Ma,b=t.length;for(c=Eh(i,t,g,c,b),h=0;h<b;h++)(p=i.__k[h])!=null&&(u=p.__i==-1?Ji:g[p.__i]||Ji,p.__i=h,v=zr(e,p,u,r,s,o,a,c,l,d),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&qr(u.ref,null,p),d.push(p.ref,p.__c||f,p)),m==null&&f!=null&&(m=f),4&p.__u||u.__k===p.__k?c=Ba(p,c,e):typeof p.type=="function"&&v!==void 0?c=v:f&&(c=f.nextSibling),p.__u&=-7);return i.__e=m,c}function Eh(e,t,i,n,r){var s,o,a,c,l,d=i.length,h=d,u=0;for(e.__k=new Array(r),s=0;s<r;s++)(o=t[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+u,(o=e.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?en(null,o,null,null,null):Qi(o)?en(Dt,{children:o},null,null,null):o.constructor==null&&o.__b>0?en(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,a=null,(l=o.__i=xh(o,i,c,h))!=-1&&(h--,(a=i[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(r>d?u--:r<d&&u++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?u--:l==c+1?u++:(l>c?u--:u++,o.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<d;s++)(a=i[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=pi(a)),Na(a,a));return n}function Ba(e,t,i){var n,r;if(typeof e.type=="function"){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Ba(n[r],t,i));return t}e.__e!=t&&(t&&e.type&&!i.contains(t)&&(t=pi(e)),i.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Da(e,t){return t=t||[],e==null||typeof e=="boolean"||(Qi(e)?e.some(function(i){Da(i,t)}):t.push(e)),t}function xh(e,t,i,n){var r,s,o,a=e.key,c=e.type,l=t[i],d=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||d&&a==l.key&&c==l.type)return i;if(n>(d?1:0)){for(r=i-1,s=i+1;r>=0||s<t.length;)if((l=t[o=r>=0?r--:s++])!=null&&(2&l.__u)==0&&a==l.key&&c==l.type)return o}return-1}function Ra(e,t,i){t[0]=="-"?e.setProperty(t,i==null?"":i):e[t]=i==null?"":typeof i!="number"||Ch.test(t)?i:i+"px"}function Tn(e,t,i,n,r){var s,o;e:if(t=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||Ra(e.style,t,"");if(i)for(t in i)n&&i[t]==n[t]||Ra(e.style,t,i[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(La,"$1")),o=t.toLowerCase(),t=o in e||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=i,i?n?i.u=n.u:(i.u=Ur,e.addEventListener(t,s?jr:Vr,s)):e.removeEventListener(t,s?jr:Vr,s);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=i==null?"":i;break e}catch(a){}typeof i=="function"||(i==null||i===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&i==1?"":i))}}function Oa(e){return function(t){if(this.l){var i=this.l[t.type+e];if(t.t==null)t.t=Ur++;else if(t.t<i.u)return;return i(U.event?U.event(t):t)}}}function zr(e,t,i,n,r,s,o,a,c,l){var d,h,u,p,f,m,v,g,b,_,E,M,w,T,I,O,be,ce=t.type;if(t.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),s=[a=t.__e=i.__e]),(d=U.__b)&&d(t);e:if(typeof ce=="function")try{if(g=t.props,b="prototype"in ce&&ce.prototype.render,_=(d=ce.contextType)&&n[d.__c],E=d?_?_.props.value:d.__:n,i.__c?v=(h=t.__c=i.__c).__=h.__E:(b?t.__c=h=new ce(g,E):(t.__c=h=new tn(g,E),h.constructor=ce,h.render=Ah),_&&_.sub(h),h.props=g,h.state||(h.state={}),h.context=E,h.__n=n,u=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&ce.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=dt({},h.__s)),dt(h.__s,ce.getDerivedStateFromProps(g,h.__s))),p=h.props,f=h.state,h.__v=t,u)b&&ce.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&ce.getDerivedStateFromProps==null&&g!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(g,E),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(g,h.__s,E)===!1||t.__v==i.__v){for(t.__v!=i.__v&&(h.props=g,h.state=h.__s,h.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(re){re&&(re.__=t)}),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(g,h.__s,E),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,f,m)})}if(h.context=E,h.props=g,h.__P=e,h.__e=!1,w=U.__r,T=0,b){for(h.state=h.__s,h.__d=!1,w&&w(t),d=h.render(h.props,h.state,h.context),I=0;I<h._sb.length;I++)h.__h.push(h._sb[I]);h._sb=[]}else do h.__d=!1,w&&w(t),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++T<25);h.state=h.__s,h.getChildContext!=null&&(n=dt(dt({},n),h.getChildContext())),b&&!u&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(p,f)),O=d,d!=null&&d.type===Dt&&d.key==null&&(O=$a(d.props.children)),a=Fa(e,Qi(O)?O:[O],t,i,n,r,s,o,a,c,l),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),v&&(h.__E=h.__=null)}catch(re){if(t.__v=null,c||s!=null)if(re.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(be=s.length;be--;)Gr(s[be]);Zr(t)}else t.__e=i.__e,t.__k=i.__k,re.then||Zr(t);U.__e(re,t,i)}else s==null&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=kh(i.__e,t,i,n,r,s,o,c,l);return(d=U.diffed)&&d(t),128&t.__u?void 0:a}function Zr(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Zr)}function Pa(e,t,i){for(var n=0;n<i.length;n++)qr(i[n],i[++n],i[++n]);U.__c&&U.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(s){s.call(r)})}catch(s){U.__e(s,r.__v)}})}function $a(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Qi(e)?e.map($a):dt({},e)}function kh(e,t,i,n,r,s,o,a,c){var l,d,h,u,p,f,m,v=i.props,g=t.props,b=t.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!b&&(b?p.localName==b:p.nodeType==3)){e=p,s[l]=null;break}}if(e==null){if(b==null)return document.createTextNode(g);e=document.createElementNS(r,b,g.is&&g),a&&(U.__m&&U.__m(t,s),a=!1),s=null}if(b==null)v===g||a&&e.data==g||(e.data=g);else{if(s=s&&Ki.call(e.childNodes),v=i.props||Ji,!a&&s!=null)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)if(p=v[l],l!="children"){if(l=="dangerouslySetInnerHTML")h=p;else if(!(l in g)){if(l=="value"&&"defaultValue"in g||l=="checked"&&"defaultChecked"in g)continue;Tn(e,l,null,p,r)}}for(l in g)p=g[l],l=="children"?u=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?f=p:l=="checked"?m=p:a&&typeof p!="function"||v[l]===p||Tn(e,l,p,v[l],r);if(d)a||h&&(d.__html==h.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(h&&(e.innerHTML=""),Fa(t.type=="template"?e.content:e,Qi(u)?u:[u],t,i,n,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:i.__k&&pi(i,0),a,c),s!=null)for(l=s.length;l--;)Gr(s[l]);a||(l="value",b=="progress"&&f==null?e.removeAttribute("value"):f!=null&&(f!==e[l]||b=="progress"&&!f||b=="option"&&f!=v[l])&&Tn(e,l,f,v[l],r),l="checked",m!=null&&m!=e[l]&&Tn(e,l,m,v[l],r))}return e}function qr(e,t,i){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(r){U.__e(r,i)}}function Na(e,t,i){var n,r;if(U.unmount&&U.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||qr(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){U.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(r=0;r<n.length;r++)n[r]&&Na(n[r],t,i||typeof e.type!="function");i||Gr(e.__e),e.__c=e.__=e.__e=void 0}function Ah(e,t,i){return this.constructor(e,i)}function In(e,t,i){var n,r,s,o;t==document&&(t=document.documentElement),U.__&&U.__(e,t),r=(n=typeof i=="function")?null:i&&i.__k||t.__k,s=[],o=[],zr(t,e=(!n&&i||t).__k=Ct(Dt,null,[e]),r||Ji,Ji,t.namespaceURI,!n&&i?[i]:r?null:t.firstChild?Ki.call(t.childNodes):null,s,!n&&i?i:r?r.__e:t.firstChild,n,o),Pa(s,e,o)}function Ha(e,t){In(e,t,Ha)}function Ua(e,t,i){var n,r,s,o,a=dt({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?r=t[s]:a[s]=t[s]===void 0&&o!=null?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ki.call(arguments,2):i),en(e.type,a,n||e.key,r||e.ref,null)}Ki=Ma.slice,U={__e:function(e,t,i,n){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,n||{}),o=r.__d),o)return r.__E=r}catch(a){e=a}throw e}},Ea=0,xa=function(e){return e!=null&&e.constructor==null},tn.prototype.setState=function(e,t){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=dt({},this.state),typeof e=="function"&&(e=e(dt({},i),this.props)),e&&dt(i,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ia(this))},tn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ia(this))},tn.prototype.render=Dt,Yt=[],Aa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sa=function(e,t){return e.__v.__b-t.__v.__b},Mn.__r=0,La=/(PointerCapture)$|Capture$/i,Ur=0,Vr=Oa(!1),jr=Oa(!0);var Sh=0;function D(e,t,i,n,r,s){t||(t={});var o,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?o=t[a]:c[a]=t[a];var l={type:e,props:c,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Sh,__i:-1,__u:0,__source:r,__self:s};if(typeof e=="function"&&(o=e.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return U.vnode&&U.vnode(l),l}var nn,le,Wr,Va,Fn=0,ja=[],fe=U,Ga=fe.__b,za=fe.__r,Za=fe.diffed,qa=fe.__c,Wa=fe.unmount,Xa=fe.__;function Xr(e,t){fe.__h&&fe.__h(le,e,Fn||t),Fn=0;var i=le.__H||(le.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Kt(e){return Fn=1,Lh(Ja,e)}function Lh(e,t,i){var n=Xr(nn++,2);if(n.t=e,!n.__c&&(n.__=[Ja(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=le,!le.__f)){var r=function(a,c,l){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(u){return!!u.__c});if(d.every(function(u){return!u.__N}))return!s||s.call(this,a,c,l);var h=n.__c.props!==a;return d.forEach(function(u){if(u.__N){var p=u.__[0];u.__=u.__N,u.__N=void 0,p!==u.__[0]&&(h=!0)}}),s&&s.call(this,a,c,l)||h};le.__f=!0;var s=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(a,c,l){if(this.__e){var d=s;s=void 0,r(a,c,l),s=d}o&&o.call(this,a,c,l)},le.shouldComponentUpdate=r}return n.__N||n.__}function ot(e,t){var i=Xr(nn++,3);!fe.__s&&Ka(i.__H,t)&&(i.__=e,i.u=t,le.__H.__h.push(i))}function xe(e){return Fn=5,Bn(function(){return{current:e}},[])}function Bn(e,t){var i=Xr(nn++,7);return Ka(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Mh(){for(var e;e=ja.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dn),e.__H.__h.forEach(Yr),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){le=null,Ga&&Ga(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Xa&&Xa(e,t)},fe.__r=function(e){za&&za(e),nn=0;var t=(le=e.__c).__H;t&&(Wr===le?(t.__h=[],le.__h=[],t.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(t.__h.forEach(Dn),t.__h.forEach(Yr),t.__h=[],nn=0)),Wr=le},fe.diffed=function(e){Za&&Za(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ja.push(t)!==1&&Va===fe.requestAnimationFrame||((Va=fe.requestAnimationFrame)||Th)(Mh)),t.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),Wr=le=null},fe.__c=function(e,t){t.some(function(i){try{i.__h.forEach(Dn),i.__h=i.__h.filter(function(n){return!n.__||Yr(n)})}catch(n){t.some(function(r){r.__h&&(r.__h=[])}),t=[],fe.__e(n,i.__v)}}),qa&&qa(e,t)},fe.unmount=function(e){Wa&&Wa(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{Dn(n)}catch(r){t=r}}),i.__H=void 0,t&&fe.__e(t,i.__v))};var Ya=typeof requestAnimationFrame=="function";function Th(e){var t,i=function(){clearTimeout(n),Ya&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,35);Ya&&(t=requestAnimationFrame(i))}function Dn(e){var t=le,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),le=t}function Yr(e){var t=le;e.__c=e.__(),le=t}function Ka(e,t){return!e||e.length!==t.length||t.some(function(i,n){return i!==e[n]})}function Ja(e,t){return typeof t=="function"?t(e):t}var Ih={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const Fh=(e,t,i,n)=>{const r=f=>{var m=f,{color:s="currentColor",size:o=24,stroke:a=2,title:c,children:l,className:d="",class:h="",style:u}=m,p=ua(m,["color","size","stroke","title","children","className","class","style"]);return Ct("svg",Fe(qi(Fe({},Ih[e]),{width:String(o),height:String(o),class:["tabler-icon",`tabler-icon-${t}`,h,d].join(" "),"stroke-width":a,stroke:s,style:u}),p),[c&&Ct("title",{},c),...n.map(([v,g])=>Ct(v,g)),...Da(l)])};return r.displayName=`${i}`,r};var Bh=Fh("outline","loader-2","Loader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Kr(){return(Kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}var Dh=["context","children"];function Rh(e){this.getChildContext=function(){return e.context};var t=e.children,i=function(n,r){if(n==null)return{};var s,o,a={},c=Object.keys(n);for(o=0;o<c.length;o++)r.indexOf(s=c[o])>=0||(a[s]=n[s]);return a}(e,Dh);return Ua(t,i)}function Oh(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Ct(Rh,Kr({},this._props,{context:e.detail.context}),function t(i,n){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var r=[],s={},o=0,a=i.attributes,c=i.childNodes;for(o=a.length;o--;)a[o].name!=="slot"&&(s[a[o].name]=a[o].value,s[Qa(a[o].name)]=a[o].value);for(o=c.length;o--;){var l=t(c[o],null),d=c[o].slot;d?s[d]=Ct(e1,{name:d},l):r[o]=l}var h=n?Ct(e1,null,r):r;return Ct(n||i.nodeName.toLowerCase(),s,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ha:In)(this._vdom,this._root)}function Qa(e){return e.replace(/-(\w)/g,function(t,i){return i?i.toUpperCase():""})}function Ph(e,t,i){if(this._vdom){var n={};n[e]=i=i==null?void 0:i,n[Qa(e)]=i,this._vdom=Ua(this._vdom,n),In(this._vdom,this._root)}}function $h(){In(this._vdom=null,this._root)}function e1(e,t){var i=this;return Ct("slot",Kr({},e,{ref:function(n){n?(i.ref=n,i._listener||(i._listener=function(r){r.stopPropagation(),r.detail.context=t},n.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function t1(e,t,i,n){function r(){var s=Reflect.construct(HTMLElement,[],r);return s._vdomComponent=e,s._root=n&&n.shadow?s.attachShadow({mode:n.mode||"open"}):s,s}return(r.prototype=Object.create(HTMLElement.prototype)).constructor=r,r.prototype.connectedCallback=Oh,r.prototype.attributeChangedCallback=Ph,r.prototype.disconnectedCallback=$h,i=i||e.observedAttributes||Object.keys(e.propTypes||{}),r.observedAttributes=i,i.forEach(function(s){Object.defineProperty(r.prototype,s,{get:function(){return this._vdom.props[s]},set:function(o){this._vdom?this.attributeChangedCallback(s,null,o):(this._props||(this._props={}),this._props[s]=o,this.connectedCallback());var a=typeof o;o!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(s,o)}})}),customElements.define(t||e.tagName||e.displayName||e.name,r)}const fi=(e,t=!1)=>typeof e=="boolean"?e:typeof e=="string"?e==="true"||e==="":t;var Nh=Symbol.for("preact-signals");function Rn(){if(Rt>1)Rt--;else{for(var e,t=!1;rn!==void 0;){var i=rn;for(rn=void 0,Jr++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&s1(i))try{i.c()}catch(r){t||(e=r,t=!0)}i=n}}if(Jr=0,Rt--,t)throw e}}function Hh(e){if(Rt>0)return e();Rt++;try{return e()}finally{Rn()}}var V=void 0;function i1(e){var t=V;V=void 0;try{return e()}finally{V=t}}var rn=void 0,Rt=0,Jr=0,On=0;function n1(e){if(V!==void 0){var t=e.n;if(t===void 0||t.t!==V)return t={i:0,S:e,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:t},V.s!==void 0&&(V.s.n=t),V.s=t,e.n=t,32&V.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=V.s,t.n=void 0,V.s.n=t,V.s=t),t}}function Ee(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}Ee.prototype.brand=Nh,Ee.prototype.h=function(){return!0},Ee.prototype.S=function(e){var t=this,i=this.t;i!==e&&e.e===void 0&&(e.x=i,this.t=e,i!==void 0?i.e=e:i1(function(){var n;(n=t.W)==null||n.call(t)}))},Ee.prototype.U=function(e){var t=this;if(this.t!==void 0){var i=e.e,n=e.x;i!==void 0&&(i.x=n,e.e=void 0),n!==void 0&&(n.e=i,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&i1(function(){var r;(r=t.Z)==null||r.call(t)}))}},Ee.prototype.subscribe=function(e){var t=this;return sn(function(){var i=t.value,n=V;V=void 0;try{e(i)}finally{V=n}})},Ee.prototype.valueOf=function(){return this.value},Ee.prototype.toString=function(){return this.value+""},Ee.prototype.toJSON=function(){return this.value},Ee.prototype.peek=function(){var e=V;V=void 0;try{return this.value}finally{V=e}},Object.defineProperty(Ee.prototype,"value",{get:function(){var e=n1(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Jr>100)throw new Error("Cycle detected");this.v=e,this.i++,On++,Rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Rn()}}}});function r1(e,t){return new Ee(e,t)}function s1(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function o1(e){for(var t=e.s;t!==void 0;t=t.n){var i=t.S.n;if(i!==void 0&&(t.r=i),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function a1(e){for(var t=e.s,i=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):i=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=i}function Jt(e,t){Ee.call(this,void 0),this.x=e,this.s=void 0,this.g=On-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched}Jt.prototype=new Ee,Jt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===On))return!0;if(this.g=On,this.f|=1,this.i>0&&!s1(this))return this.f&=-2,!0;var e=V;try{o1(this),V=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return V=e,a1(this),this.f&=-2,!0},Jt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ee.prototype.S.call(this,e)},Jt.prototype.U=function(e){if(this.t!==void 0&&(Ee.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Jt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Jt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=n1(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Qr(e,t){return new Jt(e,t)}function c1(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Rt++;var i=V;V=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,es(e),n}finally{V=i,Rn()}}}function es(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,c1(e)}function Uh(e){if(V!==this)throw new Error("Out-of-order effect");a1(this),V=e,this.f&=-2,8&this.f&&es(this),Rn()}function mi(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}mi.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},mi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,c1(this),o1(this),Rt++;var e=V;return V=this,Uh.bind(this,e)},mi.prototype.N=function(){2&this.f||(this.f|=2,this.o=rn,rn=this)},mi.prototype.d=function(){this.f|=8,1&this.f||es(this)},mi.prototype.dispose=function(){this.d()};function sn(e){var t=new mi(e);try{t.c()}catch(n){throw t.d(),n}var i=t.d.bind(t);return i[Symbol.dispose]=i,i}var l1,Pn,ts,h1=[];sn(function(){l1=this.N})();function gi(e,t){U[e]=t.bind(null,U[e]||function(){})}function $n(e){ts&&ts(),ts=e&&e.S()}function d1(e){var t=this,i=e.data,n=se(i);n.value=i;var r=Bn(function(){for(var a=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=Qr(function(){var p=n.value.value;return p===0?0:p===!0?"":p||""}),d=Qr(function(){return!Array.isArray(l.value)&&!xa(l.value)}),h=sn(function(){if(this.N=u1,d.value){var p=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=p)}}),u=t.__$u.d;return t.__$u.d=function(){h(),u.call(this)},[d,l]},[]),s=r[0],o=r[1];return s.value?o.peek():o.value}d1.displayName="_st",Object.defineProperties(Ee.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:d1},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),gi("__b",function(e,t){if(typeof t.type=="string"){var i,n=t.props;for(var r in n)if(r!=="children"){var s=n[r];s instanceof Ee&&(i||(t.__np=i={}),i[r]=s,n[r]=s.peek())}}e(t)}),gi("__r",function(e,t){if(t.type!==Dt){$n();var i,n=t.__c;n&&(n.__$f&=-2,(i=n.__$u)===void 0&&(n.__$u=i=function(r){var s;return sn(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),Pn=n,$n(i)}e(t)}),gi("__e",function(e,t,i,n){$n(),Pn=void 0,e(t,i,n)}),gi("diffed",function(e,t){$n(),Pn=void 0;var i;if(typeof t.type=="string"&&(i=t.__e)){var n=t.__np,r=t.props;if(n){var s=i.U;if(s)for(var o in s){var a=s[o];a!==void 0&&!(o in n)&&(a.d(),s[o]=void 0)}else s={},i.U=s;for(var c in n){var l=s[c],d=n[c];l===void 0?(l=Vh(i,c,d,r),s[c]=l):l.o(d,r)}}}e(t)});function Vh(e,t,i,n){var r=t in e&&e.ownerSVGElement===void 0,s=r1(i);return{o:function(o,a){s.value=o,n=a},d:sn(function(){this.N=u1;var o=s.value.value;n[t]!==o&&(n[t]=o,r?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}gi("unmount",function(e,t){if(typeof t.type=="string"){var i=t.__e;if(i){var n=i.U;if(n){i.U=void 0;for(var r in n){var s=n[r];s&&s.d()}}}}else{var o=t.__c;if(o){var a=o.__$u;a&&(o.__$u=void 0,a.d())}}e(t)}),gi("__h",function(e,t,i,n){(n<3||n===9)&&(t.__$f|=2),e(t,i,n)}),tn.prototype.shouldComponentUpdate=function(e,t){var i=this.__$u,n=i&&i.s!==void 0;for(var r in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!=="__source"&&e[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function se(e,t){return Bn(function(){return r1(e,t)},[])}function is(e,t){var i=xe(e);return i.current=e,Pn.__$f|=4,Bn(function(){return Qr(function(){return i.current()},t)},[])}var jh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Gh(){Hh(function(){for(var e;e=h1.shift();)l1.call(e)})}function u1(){h1.push(this)===1&&(U.requestAnimationFrame||jh)(Gh)}var ns,p1;function rs(){if(p1)return ns;p1=1;function e(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}return ns=e,ns}var ss,f1;function zh(){if(f1)return ss;f1=1;var e=typeof Ln=="object"&&Ln&&Ln.Object===Object&&Ln;return ss=e,ss}var os,m1;function g1(){if(m1)return os;m1=1;var e=zh(),t=typeof self=="object"&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return os=i,os}var as,v1;function Zh(){if(v1)return as;v1=1;var e=g1(),t=function(){return e.Date.now()};return as=t,as}var cs,b1;function qh(){if(b1)return cs;b1=1;var e=/\s/;function t(i){for(var n=i.length;n--&&e.test(i.charAt(n)););return n}return cs=t,cs}var ls,w1;function Wh(){if(w1)return ls;w1=1;var e=qh(),t=/^\s+/;function i(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return ls=i,ls}var hs,y1;function _1(){if(y1)return hs;y1=1;var e=g1(),t=e.Symbol;return hs=t,hs}var ds,C1;function Xh(){if(C1)return ds;C1=1;var e=_1(),t=Object.prototype,i=t.hasOwnProperty,n=t.toString,r=e?e.toStringTag:void 0;function s(o){var a=i.call(o,r),c=o[r];try{o[r]=void 0;var l=!0}catch(h){}var d=n.call(o);return l&&(a?o[r]=c:delete o[r]),d}return ds=s,ds}var us,E1;function Yh(){if(E1)return us;E1=1;var e=Object.prototype,t=e.toString;function i(n){return t.call(n)}return us=i,us}var ps,x1;function Kh(){if(x1)return ps;x1=1;var e=_1(),t=Xh(),i=Yh(),n="[object Null]",r="[object Undefined]",s=e?e.toStringTag:void 0;function o(a){return a==null?a===void 0?r:n:s&&s in Object(a)?t(a):i(a)}return ps=o,ps}var fs,k1;function Jh(){if(k1)return fs;k1=1;function e(t){return t!=null&&typeof t=="object"}return fs=e,fs}var ms,A1;function Qh(){if(A1)return ms;A1=1;var e=Kh(),t=Jh(),i="[object Symbol]";function n(r){return typeof r=="symbol"||t(r)&&e(r)==i}return ms=n,ms}var gs,S1;function ed(){if(S1)return gs;S1=1;var e=Wh(),t=rs(),i=Qh(),n=NaN,r=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function c(l){if(typeof l=="number")return l;if(i(l))return n;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var h=s.test(l);return h||o.test(l)?a(l.slice(2),h?2:8):r.test(l)?n:+l}return gs=c,gs}var vs,L1;function td(){if(L1)return vs;L1=1;var e=rs(),t=Zh(),i=ed(),n="Expected a function",r=Math.max,s=Math.min;function o(a,c,l){var d,h,u,p,f,m,v=0,g=!1,b=!1,_=!0;if(typeof a!="function")throw new TypeError(n);c=i(c)||0,e(l)&&(g=!!l.leading,b="maxWait"in l,u=b?r(i(l.maxWait)||0,c):u,_="trailing"in l?!!l.trailing:_);function E(Z){var ue=d,pe=h;return d=h=void 0,v=Z,p=a.apply(pe,ue),p}function M(Z){return v=Z,f=setTimeout(I,c),g?E(Z):p}function w(Z){var ue=Z-m,pe=Z-v,Ae=c-ue;return b?s(Ae,u-pe):Ae}function T(Z){var ue=Z-m,pe=Z-v;return m===void 0||ue>=c||ue<0||b&&pe>=u}function I(){var Z=t();if(T(Z))return O(Z);f=setTimeout(I,w(Z))}function O(Z){return f=void 0,_&&d?E(Z):(d=h=void 0,p)}function be(){f!==void 0&&clearTimeout(f),v=0,d=m=h=f=void 0}function ce(){return f===void 0?p:O(t())}function re(){var Z=t(),ue=T(Z);if(d=arguments,h=this,m=Z,ue){if(f===void 0)return M(m);if(b)return clearTimeout(f),f=setTimeout(I,c),E(m)}return f===void 0&&(f=setTimeout(I,c)),p}return re.cancel=be,re.flush=ce,re}return vs=o,vs}var bs,M1;function id(){if(M1)return bs;M1=1;var e=td(),t=rs(),i="Expected a function";function n(r,s,o){var a=!0,c=!0;if(typeof r!="function")throw new TypeError(i);return t(o)&&(a="leading"in o?!!o.leading:a,c="trailing"in o?!!o.trailing:c),e(r,s,{leading:a,maxWait:s,trailing:c})}return bs=n,bs}var nd=id();const T1=wa(nd),rd=(e="user")=>{var v;const t=xe(null),i=xe(null),[n,r]=Kt(e),[s,o]=Kt(!1),a=xe(null),c=xe(!1),l=xe(new Set),d=g=>{a.current=g};ot(()=>{const g=t.current;if(!g)return;const b=()=>{if(c.current&&a.current){const _=setTimeout(()=>{var E;(E=a.current)==null||E.call(a),c.current=!1,l.current.delete(_)},100);l.current.add(_)}};return g.addEventListener("loadedmetadata",b),()=>{g.removeEventListener("loadedmetadata",b),l.current.forEach(_=>clearTimeout(_)),l.current.clear()}},[(v=t.current)==null?void 0:v.src]),ot(()=>()=>{l.current.forEach(g=>clearTimeout(g)),l.current.clear()},[]);const h=(g,b)=>L(this,null,function*(){try{i.current&&(i.current.getTracks().forEach(be=>be.stop()),i.current=null),t.current&&(t.current.srcObject=null);const _=yield navigator.mediaDevices.getUserMedia({video:{facingMode:g||n}});i.current=_;const w=_.getVideoTracks()[0].getSettings().facingMode;(w&&w!==(g||n)||w&&w!==n)&&r(w);const O=(yield navigator.mediaDevices.enumerateDevices()).find(be=>be.kind==="videoinput"&&_.getVideoTracks()[0].getSettings().deviceId===be.deviceId);b==null||b(O==null?void 0:O.label),t.current&&(t.current.srcObject=_,yield t.current.play())}catch(_){console.error("Failed to start camera:",_)}}),u=()=>L(this,null,function*(){const g=n==="user"?"environment":"user";c.current=!0;const b=n;try{r(g),i.current&&(i.current.getTracks().forEach(_=>_.stop()),i.current=null),yield h(g)}catch(_){r(b),c.current=!1;try{yield h(b)}catch(E){console.error("Failed to restore previous camera:",E)}}}),p=()=>{const g=navigator.userAgent.toLowerCase(),b=g.includes("firefox")||g.includes("gecko")&&!g.includes("chrome")&&!g.includes("edge"),_="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",E=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:b||_||E,isChromium:g.includes("chrome")||g.includes("chromium")||g.includes("edge"),isWebKit:g.includes("webkit")&&!g.includes("chrome")}};return{videoRef:t,streamRef:i,facingMode:n,agentSupported:s,startCamera:h,switchCamera:u,checkAgentSupport:()=>L(this,null,function*(){var g,b;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){o(!0);return}const{isGecko:E}=p();let M=null,w=null;try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});M=(g=I.getVideoTracks()[0].getSettings().deviceId)!=null?g:null,I.getTracks().forEach(O=>O.stop())}catch(I){}try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});w=(b=I.getVideoTracks()[0].getSettings().deviceId)!=null?b:null,I.getTracks().forEach(O=>O.stop())}catch(I){}if(!(M&&w&&M!==w)){o(!1);return}o(!E)}catch(_){o(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(g=>g.stop()),i.current=null),t.current&&(t.current.srcObject=null,t.current.load())},registerCameraSwitchCallback:d}};var vi=typeof self!="undefined"?self:{};function Qt(){throw Error("Invalid UTF8")}function I1(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Nn,ws;const sd=typeof TextDecoder!="undefined";let od;const ad=typeof TextEncoder!="undefined";function F1(e){if(ad)e=(od||(od=new TextEncoder)).encode(e);else{let i=0;const n=new Uint8Array(3*e.length);for(let r=0;r<e.length;r++){var t=e.charCodeAt(r);if(t<128)n[i++]=t;else{if(t<2048)n[i++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&r<e.length){const s=e.charCodeAt(++r);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,n[i++]=t>>18|240,n[i++]=t>>12&63|128,n[i++]=t>>6&63|128,n[i++]=63&t|128;continue}r--}t=65533}n[i++]=t>>12|224,n[i++]=t>>6&63|128}n[i++]=63&t|128}}e=i===n.length?n:n.subarray(0,i)}return e}var ys,Hn;e:{for(var B1=["CLOSURE_FLAGS"],_s=vi,Cs=0;Cs<B1.length;Cs++)if((_s=_s[B1[Cs]])==null){Hn=null;break e}Hn=_s}var on,D1=Hn&&Hn[610401301];ys=D1!=null&&D1;const R1=vi.navigator;function Es(e){return!!ys&&!!on&&on.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Xe(e){var t;return(t=vi.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function Ot(){return!!ys&&!!on&&on.brands.length>0}function xs(){return Ot()?Es("Chromium"):(Xe("Chrome")||Xe("CriOS"))&&!(!Ot()&&Xe("Edge"))||Xe("Silk")}function Un(e){return Un[" "](e),e}on=R1&&R1.userAgentData||null,Un[" "]=function(){};var cd=!Ot()&&(Xe("Trident")||Xe("MSIE"));!Xe("Android")||xs(),xs(),Xe("Safari")&&(xs()||!Ot()&&Xe("Coast")||!Ot()&&Xe("Opera")||!Ot()&&Xe("Edge")||(Ot()?Es("Microsoft Edge"):Xe("Edg/"))||Ot()&&Es("Opera"));var O1={},an=null;function ld(e){const t=e.length;let i=3*t/4;i%3?i=Math.floor(i):"=.".indexOf(e[t-1])!=-1&&(i="=.".indexOf(e[t-2])!=-1?i-2:i-1);const n=new Uint8Array(i);let r=0;return function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=an[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}P1();let c=0;for(;;){const l=a(-1),d=a(0),h=a(64),u=a(64);if(u===64&&l===-1)break;o(l<<2|d>>4),h!=64&&(o(d<<4&240|h>>2),u!=64&&o(h<<6&192|u))}}(e,function(s){n[r++]=s}),r!==i?n.subarray(0,r):n}function P1(){if(!an){an={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const n=e.concat(t[i].split(""));O1[i]=n;for(let r=0;r<n.length;r++){const s=n[r];an[s]===void 0&&(an[s]=r)}}}}var $1=typeof Uint8Array!="undefined",N1=!cd&&typeof btoa=="function";function H1(e){if(!N1){var t;t===void 0&&(t=0),P1(),t=O1[t];var i=Array(Math.floor(e.length/3)),n=t[64]||"";let c=0,l=0;for(;c<e.length-2;c+=3){var r=e[c],s=e[c+1],o=e[c+2],a=t[r>>2];r=t[(3&r)<<4|s>>4],s=t[(15&s)<<2|o>>6],o=t[63&o],i[l++]=a+r+s+o}switch(a=0,o=n,e.length-c){case 2:o=t[(15&(a=e[c+1]))<<2]||n;case 1:e=e[c],i[l]=t[e>>2]+t[(3&e)<<4|a>>4]+o+n}return i.join("")}for(t="",i=0,n=e.length-10240;i<n;)t+=String.fromCharCode.apply(null,e.subarray(i,i+=10240));return t+=String.fromCharCode.apply(null,i?e.subarray(i):e),btoa(t)}const U1=/[-_.]/g,hd={"-":"+",_:"/",".":"="};function dd(e){return hd[e]||""}function V1(e){if(!N1)return ld(e);U1.test(e)&&(e=e.replace(U1,dd)),e=atob(e);const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function ei(e){return $1&&e!=null&&e instanceof Uint8Array}var bi={};function ti(){return ud||(ud=new Et(null,bi))}function ks(e){j1(bi);var t=e.g;return(t=t==null||ei(t)?t:typeof t=="string"?V1(t):null)==null?t:e.g=t}var Et=class{h(){return new Uint8Array(ks(this)||0)}constructor(e,t){if(j1(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let ud,As;function j1(e){if(e!==bi)throw Error("illegal external caller")}function G1(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Ss(e){return G1(e=Error(e),"warning"),e}function Ls(e){if(e!=null){var t=As!=null?As:As={},i=t[e]||0;i>=5||(t[e]=i+1,G1(e=Error(),"incident"),function(n){vi.setTimeout(()=>{throw n},0)}(e))}}var Vn=typeof Symbol=="function"&&typeof Symbol()=="symbol";function wi(e,t,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var pd=wi("jas",void 0,!0),z1=wi(void 0,"0di"),cn=wi(void 0,"1oa"),yi=wi(void 0,Symbol()),fd=wi(void 0,"0actk"),Z1=wi(void 0,"8utk");const k=Vn?pd:"Ea",q1={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},W1=Object.defineProperties;function jn(e,t){Vn||k in e||W1(e,q1),e[k]|=t}function me(e,t){Vn||k in e||W1(e,q1),e[k]=t}function _i(e){return jn(e,34),e}function md(e,t){me(t,-15615&(0|e))}function Ms(e,t){me(t,-15581&(34|e))}function Gn(){return typeof BigInt=="function"}function Be(e){return Array.prototype.slice.call(e)}var Ts,ln={};function zn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function Is(e,t){if(e!=null){if(typeof e=="string")e=e?new Et(e,bi):ti();else if(e.constructor!==Et)if(ei(e))e=e.length?new Et(new Uint8Array(e),bi):ti();else{if(!t)throw Error();e=void 0}}return e}const X1=[];function Pt(e){if(2&e)throw Error()}me(X1,55),Ts=Object.freeze(X1);class Y1{constructor(t,i,n){this.g=t,this.h=i,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}function Fs(e){return yi?e[yi]:void 0}var gd=Object.freeze({});function Zn(e){return e.Na=!0,e}var vd=Zn(e=>typeof e=="number"),K1=Zn(e=>typeof e=="string"),bd=Zn(e=>typeof e=="boolean"),qn=typeof vi.BigInt=="function"&&typeof vi.BigInt(0)=="bigint";function $t(e){var t=e;if(K1(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(vd(t)&&!Number.isSafeInteger(t))throw Error(String(t));return qn?BigInt(e):e=bd(e)?e?"1":"0":K1(e)?e.trim()||"0":String(e)}var Bs=Zn(e=>qn?e>=yd&&e<=Cd:e[0]==="-"?J1(e,wd):J1(e,_d));const wd=Number.MIN_SAFE_INTEGER.toString(),yd=qn?BigInt(Number.MIN_SAFE_INTEGER):void 0,_d=Number.MAX_SAFE_INTEGER.toString(),Cd=qn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function J1(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let i=0;i<e.length;i++){const n=e[i],r=t[i];if(n>r)return!1;if(n<r)return!0}}const Ed=typeof Uint8Array.prototype.slice=="function";let Q1,q=0,oe=0;function ec(e){const t=e>>>0;q=t,oe=(e-t)/4294967296>>>0}function ii(e){if(e<0){ec(-e);const[t,i]=Ps(q,oe);q=t>>>0,oe=i>>>0}else ec(e)}function Ds(e){const t=Q1||(Q1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),oe=0,q=t.getUint32(0,!0)}function Rs(e,t){const i=4294967296*t+(e>>>0);return Number.isSafeInteger(i)?i:hn(e,t)}function Os(e,t){const i=2147483648&t;return i&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Rs(e,t))=="number"?i?-e:e:i?"-"+e:e}function hn(e,t){if(e>>>=0,(t>>>=0)<=2097151)var i=""+(4294967296*t+e);else Gn()?i=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(i=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,e>=1e7&&(i+=e/1e7>>>0,e%=1e7),i>=1e7&&(t+=i/1e7>>>0,i%=1e7),i=t+tc(i)+tc(e));return i}function tc(e){return e=String(e),"0000000".slice(e.length)+e}function ic(){var e=q,t=oe;if(2147483648&t)if(Gn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[i,n]=Ps(e,t);e="-"+hn(i,n)}else e=hn(e,t);return e}function Wn(e){if(e.length<16)ii(Number(e));else if(Gn())e=BigInt(e),q=Number(e&BigInt(4294967295))>>>0,oe=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");oe=q=0;const i=e.length;for(let n=t,r=(i-t)%6+t;r<=i;n=r,r+=6){const s=Number(e.slice(n,r));oe*=1e6,q=1e6*q+s,q>=4294967296&&(oe+=Math.trunc(q/4294967296),oe>>>=0,q>>>=0)}if(t){const[n,r]=Ps(q,oe);q=n,oe=r}}}function Ps(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const dn=typeof BigInt=="function"?BigInt.asIntN:void 0,xd=typeof BigInt=="function"?BigInt.asUintN:void 0,Nt=Number.isSafeInteger,Xn=Number.isFinite,Ci=Math.trunc,kd=$t(0);function Ht(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function nc(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Ad=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function un(e){switch(typeof e){case"bigint":return!0;case"number":return Xn(e);case"string":return Ad.test(e);default:return!1}}function Ei(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xn(e)?0|e:void 0}function rc(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Xn(e)?e>>>0:void 0}function sc(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function oc(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function ac(e){return oc(e)?e:(Wn(e),ic())}function $s(e){return e=Ci(e),Nt(e)||(ii(e),e=Os(q,oe)),e}function cc(e){var t=Ci(Number(e));return Nt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),ac(e))}function lc(e){var t=Ci(Number(e));return Nt(t)?$t(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Gn()?$t(dn(64,BigInt(e))):$t(ac(e)))}function hc(e){if(Nt(e))e=$t($s(e));else{if(e=Ci(e),Nt(e))e=String(e);else{const t=String(e);oc(t)?e=t:(ii(e),e=ic())}e=$t(e)}return e}function Ns(e){return e==null?e:typeof e=="bigint"?(Bs(e)?e=Number(e):(e=dn(64,e),e=Bs(e)?Number(e):String(e)),e):un(e)?typeof e=="number"?$s(e):cc(e):void 0}function Sd(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(xd(64,e));if(un(e)){if(t==="string")return t=Ci(Number(e)),Nt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),sc(e)||(Wn(e),e=hn(q,oe))),e;if(t==="number")return(e=Ci(e))>=0&&Nt(e)?e:function(i){if(i<0){ii(i);var n=hn(q,oe);return i=Number(n),Nt(i)?i:n}return sc(n=String(i))?n:(ii(i),Rs(q,oe))}(e)}}function dc(e){if(typeof e!="string")throw Error();return e}function xi(e){if(e!=null&&typeof e!="string")throw Error();return e}function ki(e){return e==null||typeof e=="string"?e:void 0}function Hs(e,t,i,n){if(e!=null&&typeof e=="object"&&e.W===ln)return e;if(!Array.isArray(e))return i?2&n?((e=t[z1])||(_i((e=new t).u),e=t[z1]=e),t=e):t=new t:t=void 0,t;let r=i=0|e[k];return r===0&&(r|=32&n),r|=2&n,r!==i&&me(e,r),new t(e)}function Ld(e,t,i){if(t)e:{if(!un(t=e))throw Ss("int64");switch(typeof t){case"string":t=lc(t);break e;case"bigint":t=$t(dn(64,t));break e;default:t=hc(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?$t(dn(64,t)):un(t)?e==="string"?lc(t):hc(t):void 0;return(e=t)==null?i?kd:void 0:e}function Md(e){return e}const Td={};let Id=function(){try{return Un(new class extends Map{constructor(){super()}}),!1}catch(e){return!0}}();class Us{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,i){return this.g.set(t,i),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,i){return this.g.forEach(t,i)}[Symbol.iterator](){return this.entries()}}const Fd=Id?(Object.setPrototypeOf(Us.prototype,Map.prototype),Object.defineProperties(Us.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Us):class extends Map{constructor(){super()}};function uc(e){return e}function Vs(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var ut=class extends Fd{constructor(e,t,i=uc,n=uc){super();let r=0|e[k];r|=64,me(e,r),this.M=r,this.I=t,this.S=i,this.X=this.I?Bd:n;for(let s=0;s<e.length;s++){const o=e[s],a=i(o[0],!1,!0);let c=o[1];t?c===void 0&&(c=null):c=n(o[1],!1,!0,void 0,void 0,r),super.set(a,c)}}La(){var e=$d;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=Dd){const t=[],i=super.entries();for(var n;!(n=i.next()).done;)(n=n.value)[0]=e(n[0]),n[1]=e(n[1]),t.push(n);return t}clear(){Vs(this),super.clear()}delete(e){return Vs(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new Y1(e,Rd,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new Y1(e,ut.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((i,n,r)=>{e.call(t,r.get(n),n,r)}):super.forEach(e,t)}set(e,t){return Vs(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var i=this.I;return i?((i=this.X(t,!1,!0,i,this.pa,this.M))!==t&&super.set(e,i),i):t}}[Symbol.iterator](){return this.entries()}};function Bd(e,t,i,n,r,s){return e=Hs(e,n,i,s),r&&(e=Qn(e)),e}function Dd(e){return e}function Rd(e){return[e,this.get(e)]}let Od,Yn,pc,Pd;function fc(){return Od||(Od=new ut(_i([]),void 0,void 0,void 0,Td))}function js(e,t,i,n,r){if(e!=null){if(Array.isArray(e)){const s=0|e[k];return e.length===0&&1&s?void 0:r&&2&s?e:Kn(e,t,i,n!==void 0,r)}return t(e,n)}}function Kn(e,t,i,n,r){const s=n||i?0|e[k]:0,o=n?!!(32&s):void 0;let a=0;const c=(n=Be(e)).length;for(let f=0;f<c;f++){var l=n[f];if(f===c-1&&zn(l)){var d=t,h=i,u=o,p=r;let m;for(let v in l){const g=js(l[v],d,h,u,p);g!=null&&((m!=null?m:m={})[v]=g)}l=m}else l=js(n[f],t,i,o,r);n[f]=l,l!=null&&(a=f+1)}return a<c&&(n.length=a),i&&((e=Fs(e))&&(n[yi]=Be(e)),i(s,n)),n}function $d(e){return js(e,Gs,void 0,void 0,!1)}function Gs(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Bs(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(ei(e))return ei(e)&&Ls(Z1),H1(e);if(e.W===ln)return mc(e);if(e instanceof Et){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=H1(t)}return e instanceof ut?e.La():void 0}return e}function mc(e){var t=e.u;e=Kn(t,Gs,void 0,void 0,!1);var i=0|t[k];if((t=e.length)&&!(512&i)){var n=e[t-1],r=!1;zn(n)?(t--,r=!0):n=void 0;var s=t-(i=512&i?0:-1),o=(Yn!=null?Yn:Md)(s,i,e,n);if(n&&(e[t]=void 0),s<o&&n){for(var a in s=!0,n){const c=+a;c<=o?(e[r=c+i]=n[a],t=Math.max(r+1,t),r=!1,delete n[a]):s=!1}s&&(n=void 0)}for(s=t-1;t>0;s=t-1)if((a=e[s])==null)t--,r=!0;else{if(!((s-=i)>=o))break;(n!=null?n:n={})[s]=a,t--,r=!0}r&&(e.length=t),n&&e.push(n)}return e}function Ut(e,t,i){return e=gc(e,t[0],t[1],i?1:2),t!==pc&&i&&jn(e,8192),e}function gc(e,t,i,n){if(e==null){var r=96;i?(e=[i],r|=512):e=[],t&&(r=-16760833&r|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(r=0|e[k])||!(64&r)||2&r||Ls(fd),1024&r)throw Error("farr");if(64&r)return e;if(n===1||n===2||(r|=64),i&&(r|=512,i!==e[0]))throw Error("mid");e:{var s=(i=e).length;if(s){var o=s-1;if(zn(n=i[o])){if((o-=t=512&(r|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in n)(s=+a)<o&&(i[s+t]=n[a],delete n[a]);r=-16760833&r|(1023&o)<<14;break e}}if(t){if((a=Math.max(t,s-(512&r?0:-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&a)<<14}}}return me(e,r),e}function zs(e,t,i=Ms){if(e!=null){if($1&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var n=0|e[k];return 2&n?e:(t&&(t=n===0||!!(32&n)&&!(64&n||!(16&n))),t?(me(e,34|n),4&n&&Object.freeze(e),e):Kn(e,zs,4&n?Ms:i,!0,!0))}return e.W===ln?e=2&(n=0|(i=e.u)[k])?e:new e.constructor(Jn(i,n,!0)):e instanceof ut&&!(2&e.M)&&(i=_i(e.da(zs)),e=new ut(i,e.I,e.S,e.X)),e}}function Jn(e,t,i){const n=i||2&t?Ms:md,r=!!(32&t);return e=function(s,o,a){const c=Be(s);var l=c.length;const d=256&o?c[l-1]:void 0;for(l+=d?-1:0,o=512&o?1:0;o<l;o++)c[o]=a(c[o]);if(d){o=c[o]={};for(const h in d)o[h]=a(d[h])}return(s=Fs(s))&&(c[yi]=Be(s)),c}(e,t,s=>zs(s,r,n)),jn(e,32|(i?2:0)),e}function Qn(e){const t=e.u,i=0|t[k];return 2&i?new e.constructor(Jn(t,i,!1)):e}function Ai(e,t){return xt(e=e.u,0|e[k],t)}function xt(e,t,i){if(i===-1)return null;const n=i+(512&t?0:-1),r=e.length-1;return n>=r&&256&t?e[r][i]:n<=r?e[n]:void 0}function W(e,t,i){const n=e.u;let r=0|n[k];return Pt(r),ne(n,r,t,i),e}function ne(e,t,i,n){const r=512&t?0:-1,s=i+r;var o=e.length-1;return s>=o&&256&t?(e[o][i]=n,t):s<=o?(e[s]=n,t):(n!==void 0&&(i>=(o=t>>14&1023||536870912)?n!=null&&(e[o+r]={[i]:n},me(e,t|=256)):e[s]=n),t)}function er(e,t){let i=0|(e=e.u)[k];const n=xt(e,i,t),r=Ht(n);return r!=null&&r!==n&&ne(e,i,t,r),r}function vc(e){let t=0|(e=e.u)[k];const i=xt(e,t,1),n=Is(i,!0);return n!=null&&n!==i&&ne(e,t,1,n),n}function ni(){return gd===void 0?2:4}function ri(e,t,i,n,r){const s=e.u,o=2&(e=0|s[k])?1:n;r=!!r;let a=0|(n=Zs(s,e,t))[k];if(!(4&a)){4&a&&(n=Be(n),a=St(a,e),e=ne(s,e,t,n));let c=0,l=0;for(;c<n.length;c++){const d=i(n[c]);d!=null&&(n[l++]=d)}l<c&&(n.length=l),a=qs(a,e),i=-2049&(20|a),a=i&=-4097,me(n,a),2&a&&Object.freeze(n)}return o===1||o===4&&32&a?kt(a)||(r=a,a|=2,a!==r&&me(n,a),Object.freeze(n)):(o===2&&kt(a)&&(n=Be(n),a=St(a,e),a=Vt(a,e,r),me(n,a),e=ne(s,e,t,n)),kt(a)||(t=a,a=Vt(a,e,r),a!==t&&me(n,a))),n}function Zs(e,t,i){return e=xt(e,t,i),Array.isArray(e)?e:Ts}function qs(e,t){return e===0&&(e=St(e,t)),1|e}function kt(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function bc(e){e=Be(e);for(let t=0;t<e.length;t++){const i=e[t]=Be(e[t]);Array.isArray(i[1])&&(i[1]=_i(i[1]))}return e}function Ws(e,t,i,n){let r=0|(e=e.u)[k];Pt(r),ne(e,r,t,(n==="0"?Number(i)===0:i===n)?void 0:i)}function Si(e,t,i,n){Pt(t);let r=Zs(e,t,i);const s=r!==Ts;if(64&t||!(8192&t)||!s){const o=s?0|r[k]:0;let a=o;(!s||2&a||kt(a)||4&a&&!(32&a))&&(r=Be(r),a=St(a,t),t=ne(e,t,i,r)),a=-13&qs(a,t),a=Vt(n?-17&a:16|a,t,!0),a!==o&&me(r,a)}return r}function Xs(e,t){var i=bl;return Ks(Ys(e=e.u),e,0|e[k],i)===t?t:-1}function Ys(e){var i;if(Vn)return(i=e[cn])!=null?i:e[cn]=new Map;if(cn in e)return e[cn];const t=new Map;return Object.defineProperty(e,cn,{value:t}),t}function wc(e,t,i,n){const r=Ys(e),s=Ks(r,e,t,i);return s!==n&&(s&&(t=ne(e,t,s)),r.set(i,n)),t}function Ks(e,t,i,n){let r=e.get(n);if(r!=null)return r;r=0;for(let s=0;s<n.length;s++){const o=n[s];xt(t,i,o)!=null&&(r!==0&&(i=ne(t,i,r)),r=o)}return e.set(n,r),r}function Js(e,t,i){let n=0|e[k];const r=xt(e,n,i);let s;if(r!=null&&r.W===ln)return(t=Qn(r))!==r&&ne(e,n,i,t),t.u;if(Array.isArray(r)){const o=0|r[k];s=2&o?Ut(Jn(r,o,!1),t,!0):64&o?r:Ut(s,t,!0)}else s=Ut(void 0,t,!0);return s!==r&&ne(e,n,i,s),s}function yc(e,t,i){let n=0|(e=e.u)[k];const r=xt(e,n,i);return(t=Hs(r,t,!1,n))!==r&&t!=null&&ne(e,n,i,t),t}function N(e,t,i){if((t=yc(e,t,i))==null)return t;let n=0|(e=e.u)[k];if(!(2&n)){const r=Qn(t);r!==t&&ne(e,n,i,t=r)}return t}function _c(e,t,i,n,r,s,o){e=e.u;var a=!!(2&t);const c=a?1:r;s=!!s,o&&(o=!a);var l=0|(r=Zs(e,t,n))[k];if(!(a=!!(4&l))){var d=r,h=t;const u=!!(2&(l=qs(l,t)));u&&(h|=2);let p=!u,f=!0,m=0,v=0;for(;m<d.length;m++){const g=Hs(d[m],i,!1,h);if(g instanceof i){if(!u){const b=!!(2&(0|g.u[k]));p&&(p=!b),f&&(f=b)}d[v++]=g}}v<m&&(d.length=v),l|=4,l=f?16|l:-17&l,me(d,l=p?8|l:-9&l),u&&Object.freeze(d)}if(o&&!(8&l||!r.length&&(c===1||c===4&&32&l))){for(kt(l)&&(r=Be(r),l=St(l,t),t=ne(e,t,n,r)),i=r,o=l,d=0;d<i.length;d++)(l=i[d])!==(h=Qn(l))&&(i[d]=h);o|=8,me(i,o=i.length?-17&o:16|o),l=o}return c===1||c===4&&32&l?kt(l)||(t=l,(l|=!r.length||16&l&&(!a||32&l)?2:1024)!==t&&me(r,l),Object.freeze(r)):(c===2&&kt(l)&&(me(r=Be(r),l=Vt(l=St(l,t),t,s)),t=ne(e,t,n,r)),kt(l)||(n=l,(l=Vt(l,t,s))!==n&&me(r,l))),r}function At(e,t,i){const n=0|e.u[k];return _c(e,n,t,i,ni(),!1,!(2&n))}function S(e,t,i,n){return n==null&&(n=void 0),W(e,i,n)}function pn(e,t,i,n){n==null&&(n=void 0);e:{let r=0|(e=e.u)[k];if(Pt(r),n==null){const s=Ys(e);if(Ks(s,e,r,i)!==t)break e;s.set(i,0)}else r=wc(e,r,i,t);ne(e,r,t,n)}}function St(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Vt(e,t,i){return 32&t&&i||(e&=-33),e}function tr(e,t,i){Pt(0|e.u[k]),ri(e,t,ki,2,!0).push(dc(i))}function ir(e,t,i,n){const r=0|e.u[k];Pt(r),e=_c(e,r,i,t,2,!0),n=n!=null?n:new i,e.push(n),e[k]=2&(0|n.u[k])?-9&e[k]:-17&e[k]}function Ye(e,t){return Ei(Ai(e,t))}function Ke(e,t){return ki(Ai(e,t))}function he(e,t){var i;return(i=er(e,t))!=null?i:0}function fn(e,t,i){if(i!=null&&typeof i!="boolean")throw e=typeof i,Error(`Expected boolean but got ${e!="object"?e:i?Array.isArray(i)?"array":e:"null"}: ${i}`);W(e,t,i)}function pt(e,t,i){if(i!=null){if(typeof i!="number"||!Xn(i))throw Ss("int32");i|=0}W(e,t,i)}function x(e,t,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);W(e,t,i)}function nr(e,t,i){{const o=e.u;let a=0|o[k];if(Pt(a),i==null)ne(o,a,t);else{var n=e=0|i[k],r=kt(e),s=r||Object.isFrozen(i);for(r||(e=0),s||(i=Be(i),n=0,e=Vt(e=St(e,a),a,!0),s=!1),e|=21,r=0;r<i.length;r++){const c=i[r],l=dc(c);Object.is(c,l)||(s&&(i=Be(i),n=0,e=Vt(e=St(e,a),a,!0),s=!1),i[r]=l)}e!==n&&(s&&(i=Be(i),e=Vt(e=St(e,a),a,!0)),me(i,e)),ne(o,a,t,i)}}}function Cc(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Qs(){return Error("Failed to read varint, encoding is invalid.")}function Ec(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function eo(e){if(typeof e=="string")return{buffer:V1(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Et)return{buffer:ks(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function to(e,t){let i,n=0,r=0,s=0;const o=e.h;let a=e.g;do i=o[a++],n|=(127&i)<<s,s+=7;while(s<32&&128&i);for(s>32&&(r|=(127&i)>>4),s=3;s<32&&128&i;s+=7)i=o[a++],r|=(127&i)<<s;if(si(e,a),i<128)return t(n>>>0,r>>>0);throw Qs()}function io(e){let t=0,i=e.g;const n=i+10,r=e.h;for(;i<n;){const s=r[i++];if(t|=s,(128&s)==0)return si(e,i),!!(127&t)}throw Qs()}function jt(e){const t=e.h;let i=e.g,n=t[i++],r=127&n;if(128&n&&(n=t[i++],r|=(127&n)<<7,128&n&&(n=t[i++],r|=(127&n)<<14,128&n&&(n=t[i++],r|=(127&n)<<21,128&n&&(n=t[i++],r|=n<<28,128&n&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++]&&128&t[i++])))))throw Qs();return si(e,i),r}function Lt(e){return jt(e)>>>0}function no(e){var t=e.h;const i=e.g,n=t[i],r=t[i+1],s=t[i+2];return t=t[i+3],si(e,e.g+4),(n<<0|r<<8|s<<16|t<<24)>>>0}function ro(e){var t=no(e);e=2*(t>>31)+1;const i=t>>>23&255;return t&=8388607,i==255?t?NaN:e*(1/0):i==0?1401298464324817e-60*e*t:e*Math.pow(2,i-150)*(t+8388608)}function Nd(e){return jt(e)}function so(e,t,{aa:i=!1}={}){e.aa=i,t&&(t=eo(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function si(e,t){if(e.g=t,t>e.l)throw Ec(e.l,t)}function xc(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const i=e.g,n=i+t;if(n>e.l)throw Ec(t,e.l-i);return e.g=n,i}function kc(e,t){if(t==0)return ti();var i=xc(e,t);return e.aa&&e.m?i=e.h.subarray(i,i+t):(e=e.h,i=i===(t=i+t)?new Uint8Array(0):Ed?e.slice(i,t):new Uint8Array(e.subarray(i,t))),i.length==0?ti():new Et(i,bi)}ut.prototype.toJSON=void 0;var Ac=[];function Sc(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var i=Lt(e.g);if(t=i>>>3,!((i&=7)>=0&&i<=5))throw Cc(i,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=i,!0}function rr(e){switch(e.h){case 0:e.h!=0?rr(e):io(e.g);break;case 1:si(e=e.g,e.g+8);break;case 2:if(e.h!=2)rr(e);else{var t=Lt(e.g);si(e=e.g,e.g+t)}break;case 5:si(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!Sc(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}rr(e)}break;default:throw Cc(e.h,e.l)}}function mn(e,t,i){const n=e.g.l,r=Lt(e.g),s=e.g.g+r;let o=s-n;if(o<=0&&(e.g.l=s,i(t,e,void 0,void 0,void 0),o=s-e.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${r} bytes, instead read ${r-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=s,e.g.l=n,t}function oo(e){var t=Lt(e.g),i=xc(e=e.g,t);if(e=e.h,sd){var n,r=e;(n=ws)||(n=ws=new TextDecoder("utf-8",{fatal:!0})),t=i+t,r=i===0&&t===r.length?r:r.subarray(i,t);try{var s=n.decode(r)}catch(a){if(Nn===void 0){try{n.decode(new Uint8Array([128]))}catch(c){}try{n.decode(new Uint8Array([97])),Nn=!0}catch(c){Nn=!1}}throw!Nn&&(ws=void 0),a}}else{t=(s=i)+t,i=[];let a,c=null;for(;s<t;){var o=e[s++];o<128?i.push(o):o<224?s>=t?Qt():(a=e[s++],o<194||(192&a)!=128?(s--,Qt()):i.push((31&o)<<6|63&a)):o<240?s>=t-1?Qt():(a=e[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(n=e[s++]))!=128?(s--,Qt()):i.push((15&o)<<12|(63&a)<<6|63&n)):o<=244?s>=t-2?Qt():(a=e[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(n=e[s++]))!=128||(192&(r=e[s++]))!=128?(s--,Qt()):(o=(7&o)<<18|(63&a)<<12|(63&n)<<6|63&r,o-=65536,i.push(55296+(o>>10&1023),56320+(1023&o)))):Qt(),i.length>=8192&&(c=I1(c,i),i.length=0)}s=I1(c,i)}return s}function Lc(e){const t=Lt(e.g);return kc(e.g,t)}function sr(e,t,i){var n=Lt(e.g);for(n=e.g.g+n;e.g.g<n;)i.push(t(e.g))}var or=[];function at(e,t,i){t.g?t.m(e,t.g,t.h,i):t.m(e,t.h,i)}var C=class{constructor(e,t){this.u=gc(e,t)}toJSON(){try{var e=mc(this)}finally{Yn=void 0}return e}l(){var e=_0;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(Jn(e,0|e[k],!1))}O(){return!!(2&(0|this.u[k]))}};function Mc(e){return e?/^\d+$/.test(e)?(Wn(e),new ao(q,oe)):null:Hd||(Hd=new ao(0,0))}C.prototype.W=ln,C.prototype.toString=function(){return this.u.toString()};var ao=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Hd;function Tc(e){return e?/^-?\d+$/.test(e)?(Wn(e),new co(q,oe)):null:Ud||(Ud=new co(0,0))}var co=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Ud;function Li(e,t,i){for(;i>0||t>127;)e.g.push(127&t|128),t=(t>>>7|i<<25)>>>0,i>>>=7;e.g.push(t)}function Mi(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ar(e,t){if(t>=0)Mi(e,t);else{for(let i=0;i<9;i++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function gn(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function Ti(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function $e(e,t,i){Mi(e.g,8*t+i)}function lo(e,t){return $e(e,t,2),t=e.g.end(),Ti(e,t),t.push(e.h),t}function ho(e,t){var i=t.pop();for(i=e.h+e.g.length()-i;i>127;)t.push(127&i|128),i>>>=7,e.h++;t.push(i),e.h++}function cr(e,t,i){$e(e,t,2),Mi(e.g,i.length),Ti(e,e.g.end()),Ti(e,i)}function lr(e,t,i,n){i!=null&&(t=lo(e,t),n(i,e),ho(e,t))}function ct(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var uo=ct(),Ic=ct(),po=ct(),fo=ct(),Fc=ct(),Bc=ct(),mo=ct(),Dc=ct(),Rc=ct(),Ii=class{constructor(e,t,i){this.g=e,this.h=t,e=uo,this.l=!!e&&i===e||!1}};function hr(e,t){return new Ii(e,t,uo)}function Oc(e,t,i,n,r){lr(e,i,Hc(t,n),r)}const Vd=hr(function(e,t,i,n,r){return e.h===2&&(mn(e,Js(t,n,i),r),!0)},Oc),jd=hr(function(e,t,i,n,r){return e.h===2&&(mn(e,Js(t,n,i),r),!0)},Oc);var dr=Symbol(),go=Symbol(),Pc=Symbol(),$c=Symbol();let ur,pr;function oi(e,t,i,n){var r=n[e];if(r)return r;(r={}).Ma=n,r.T=function(h){switch(typeof h){case"boolean":return pc||(pc=[0,void 0,!0]);case"number":return h>0?void 0:h===0?Pd||(Pd=[0,void 0]):[-h,void 0];case"string":return[0,h];case"object":return h}}(n[0]);var s=n[1];let o=1;s&&s.constructor===Object&&(r.ga=s,typeof(s=n[++o])=="function"&&(r.la=!0,ur!=null||(ur=s),pr!=null||(pr=n[o+1]),s=n[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=n[++o]}for(c=1;s!==void 0;){let h;typeof s=="number"&&(c+=s,s=n[++o]);var l=void 0;if(s instanceof Ii?h=s:(h=Vd,o--),h==null?void 0:h.l){s=n[++o],l=n;var d=o;typeof s=="function"&&(s=s(),l[d]=s),l=s}for(d=c+1,typeof(s=n[++o])=="number"&&s<0&&(d-=s,s=n[++o]);c<d;c++){const u=a[c];l?i(r,c,h,l,u):t(r,c,h,u)}}return n[e]=r}function Nc(e){return Array.isArray(e)?e[0]instanceof Ii?e:[jd,e]:[e,void 0]}function Hc(e,t){return e instanceof C?e.u:Array.isArray(e)?Ut(e,t,!1):void 0}function vo(e,t,i,n){const r=i.g;e[t]=n?(s,o,a)=>r(s,o,a,n):r}function bo(e,t,i,n,r){const s=i.g;let o,a;e[t]=(c,l,d)=>s(c,l,d,a||(a=oi(go,vo,bo,n).T),o||(o=wo(n)),r)}function wo(e){let t=e[Pc];if(t!=null)return t;const i=oi(go,vo,bo,e);return t=i.la?(n,r)=>ur(n,r,i):(n,r)=>{const s=0|n[k];for(;Sc(r)&&r.h!=4;){var o=r.m,a=i[o];if(a==null){var c=i.ga;c&&(c=c[o])&&(c=Gd(c))!=null&&(a=i[o]=c)}a!=null&&a(r,n,o)||(o=(a=r).l,rr(a),a.fa?a=void 0:(c=a.g.g-o,a.g.g=o,a=kc(a.g,c)),o=n,a&&((c=o[yi])?c.push(a):o[yi]=[a]))}return 8192&s&&_i(n),!0},e[Pc]=t}function Gd(e){const t=(e=Nc(e))[0].g;if(e=e[1]){const i=wo(e),n=oi(go,vo,bo,e).T;return(r,s,o)=>t(r,s,o,n,i)}return t}function fr(e,t,i){e[t]=i.h}function mr(e,t,i,n){let r,s;const o=i.h;e[t]=(a,c,l)=>o(a,c,l,s||(s=oi(dr,fr,mr,n).T),r||(r=Uc(n)))}function Uc(e){let t=e[$c];if(!t){const i=oi(dr,fr,mr,e);t=(n,r)=>Vc(n,r,i),e[$c]=t}return t}function Vc(e,t,i){(function(n,r,s){const o=512&r?0:-1,a=n.length,c=a+((r=64&r?256&r:!!a&&zn(n[a-1]))?-1:0);for(let l=0;l<c;l++)s(l-o,n[l]);if(r){n=n[a-1];for(const l in n)!isNaN(l)&&s(+l,n[l])}})(e,0|e[k]|(i.T[1]?512:0),(n,r)=>{if(r!=null){var s=function(o,a){var c=o[a];if(c)return c;if((c=o.ga)&&(c=c[a])){var l=(c=Nc(c))[0].h;if(c=c[1]){const d=Uc(c),h=oi(dr,fr,mr,c).T;c=o.la?pr(h,d):(u,p,f)=>l(u,p,f,h,d)}else c=l;return o[a]=c}}(i,n);s&&s(t,r,n)}}),(e=Fs(e))&&function(n,r){Ti(n,n.g.end());for(let s=0;s<r.length;s++)Ti(n,ks(r[s])||new Uint8Array(0))}(t,e)}function Fi(e,t){if(Array.isArray(t)){var i=0|t[k];if(4&i)return t;for(var n=0,r=0;n<t.length;n++){const s=e(t[n]);s!=null&&(t[r++]=s)}return r<n&&(t.length=r),me(t,-6145&(5|i)),2&i&&Object.freeze(t),t}}function Se(e,t,i){return new Ii(e,t,i)}function Bi(e,t,i){return new Ii(e,t,i)}function Le(e,t,i){ne(e,0|e[k],t,i)}var zd=hr(function(e,t,i,n,r){return e.h===2&&(e=mn(e,Ut([void 0,void 0],n,!0),r),Pt(n=0|t[k]),(r=xt(t,n,i))instanceof ut?(2&r.M)!=0?((r=r.da()).push(e),ne(t,n,i,r)):r.Ja(e):Array.isArray(r)?(2&(0|r[k])&&ne(t,n,i,r=bc(r)),r.push(e)):ne(t,n,i,[e]),!0)},function(e,t,i,n,r){if(t instanceof ut)t.forEach((s,o)=>{lr(e,i,Ut([o,s],n,!1),r)});else if(Array.isArray(t))for(let s=0;s<t.length;s++){const o=t[s];Array.isArray(o)&&lr(e,i,Ut(o,n,!1),r)}});function jc(e,t,i){if(t=function(n){if(n==null)return n;const r=typeof n;if(r==="bigint")return String(dn(64,n));if(un(n)){if(r==="string")return cc(n);if(r==="number")return $s(n)}}(t),t!=null&&(typeof t=="string"&&Tc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Li(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new co(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Li(e.g,i.h,i.g);break;default:i=Tc(t),Li(e.g,i.h,i.g)}}function Gc(e,t,i){(t=Ei(t))!=null&&t!=null&&($e(e,i,0),ar(e.g,t))}function zc(e,t,i){(t=nc(t))!=null&&($e(e,i,0),e.g.g.push(t?1:0))}function Zc(e,t,i){(t=ki(t))!=null&&cr(e,i,F1(t))}function qc(e,t,i,n,r){lr(e,i,Hc(t,n),r)}function Wc(e,t,i){t==null||typeof t=="string"||t instanceof Et||(ei(t)?ei(t)&&Ls(Z1):t=void 0),t!=null&&cr(e,i,eo(t).buffer)}function Xc(e,t,i){return(e.h===5||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,ro,t):t.push(ro(e.g)),!0)}var Mt=Se(function(e,t,i){if(e.h!==1)return!1;var n=e.g;e=no(n);const r=no(n);n=2*(r>>31)+1;const s=r>>>20&2047;return e=4294967296*(1048575&r)+e,Le(t,i,s==2047?e?NaN:n*(1/0):s==0?5e-324*n*e:n*Math.pow(2,s-1075)*(e+4503599627370496)),!0},function(e,t,i){(t=Ht(t))!=null&&($e(e,i,1),e=e.g,(i=Q1||(Q1=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),q=i.getUint32(0,!0),oe=i.getUint32(4,!0),gn(e,q),gn(e,oe))},ct()),ge=Se(function(e,t,i){return e.h===5&&(Le(t,i,ro(e.g)),!0)},function(e,t,i){(t=Ht(t))!=null&&($e(e,i,5),e=e.g,Ds(t),gn(e,q))},mo),Zd=Bi(Xc,function(e,t,i){if((t=Fi(Ht,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&($e(n,r,5),n=n.g,Ds(s),gn(n,q))}},mo),yo=Bi(Xc,function(e,t,i){if((t=Fi(Ht,t))!=null&&t.length){$e(e,i,2),Mi(e.g,4*t.length);for(let n=0;n<t.length;n++)i=e.g,Ds(t[n]),gn(i,q)}},mo),Gt=Se(function(e,t,i){return e.h===0&&(Le(t,i,to(e.g,Os)),!0)},jc,Bc),_o=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=to(e.g,Os))===0?void 0:e),!0)},jc,Bc),qd=Se(function(e,t,i){return e.h===0&&(Le(t,i,to(e.g,Rs)),!0)},function(e,t,i){if((t=Sd(t))!=null&&(typeof t=="string"&&Mc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Li(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new ao(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Li(e.g,i.h,i.g);break;default:i=Mc(t),Li(e.g,i.h,i.g)}},ct()),ae=Se(function(e,t,i){return e.h===0&&(Le(t,i,jt(e.g)),!0)},Gc,fo),gr=Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,jt,t):t.push(jt(e.g)),!0)},function(e,t,i){if((t=Fi(Ei,t))!=null&&t.length){i=lo(e,i);for(let n=0;n<t.length;n++)ar(e.g,t[n]);ho(e,i)}},fo),Di=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=jt(e.g))===0?void 0:e),!0)},Gc,fo),Q=Se(function(e,t,i){return e.h===0&&(Le(t,i,io(e.g)),!0)},zc,Ic),Ri=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=io(e.g))===!1?void 0:e),!0)},zc,Ic),ke=Bi(function(e,t,i){return e.h===2&&(e=oo(e),Si(t,0|t[k],i,!1).push(e),!0)},function(e,t,i){if((t=Fi(ki,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&cr(n,r,F1(s))}},po),zt=Se(function(e,t,i){return e.h===2&&(Le(t,i,(e=oo(e))===""?void 0:e),!0)},Zc,po),j=Se(function(e,t,i){return e.h===2&&(Le(t,i,oo(e)),!0)},Zc,po),we=function(e,t,i=uo){return new Ii(e,t,i)}(function(e,t,i,n,r){return e.h===2&&(n=Ut(void 0,n,!0),Si(t,0|t[k],i,!0).push(n),mn(e,n,r),!0)},function(e,t,i,n,r){if(Array.isArray(t))for(let s=0;s<t.length;s++)qc(e,t[s],i,n,r)}),G=hr(function(e,t,i,n,r,s){return e.h===2&&(wc(t,0|t[k],s,i),mn(e,t=Js(t,n,i),r),!0)},qc),Yc=Se(function(e,t,i){return e.h===2&&(Le(t,i,Lc(e)),!0)},Wc,Dc),Wd=Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,Lt,t):t.push(Lt(e.g)),!0)},function(e,t,i){if((t=Fi(rc,t))!=null)for(let o=0;o<t.length;o++){var n=e,r=i,s=t[o];s!=null&&($e(n,r,0),Mi(n.g,s))}},Fc),Xd=Se(function(e,t,i){return e.h===0&&(Le(t,i,(e=Lt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=rc(t))!=null&&t!=null&&($e(e,i,0),Mi(e.g,t))},Fc),Ne=Se(function(e,t,i){return e.h===0&&(Le(t,i,jt(e.g)),!0)},function(e,t,i){(t=Ei(t))!=null&&(t=parseInt(t,10),$e(e,i,0),ar(e.g,t))},Rc);class Yd{constructor(t,i){this.h=t,this.g=i,this.l=N,this.m=S,this.defaultValue=void 0}register(){Un(this)}}function lt(e,t){return new Yd(e,t)}function Zt(e,t){return(i,n)=>{if(or.length){const s=or.pop();s.o(n),so(s.g,i,n),i=s}else i=new class{constructor(s,o){if(Ac.length){const a=Ac.pop();so(a,s,o),s=a}else s=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,so(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,o);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({fa:s=!1}={}){this.fa=s}}(i,n);try{const s=new e,o=s.u;wo(t)(o,i);var r=s}finally{i.g.clear(),i.m=-1,i.h=-1,or.length<100&&or.push(i)}return r}}function vr(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Vc(this.u,t,oi(dr,fr,mr,e)),Ti(t,t.g.end());const i=new Uint8Array(t.h),n=t.l,r=n.length;let s=0;for(let o=0;o<r;o++){const a=n[o];i.set(a,s),s+=a.length}return t.l=[i],i}}var Kc=class extends C{constructor(e){super(e)}},Jc=[0,zt,Se(function(e,t,i){return e.h===2&&(Le(t,i,(e=Lc(e))===ti()?void 0:e),!0)},function(e,t,i){if(t!=null){if(t instanceof C){const n=t.Oa;return void(n&&(t=n(t),t!=null&&cr(e,i,eo(t).buffer)))}if(Array.isArray(t))return}Wc(e,t,i)},Dc)];let Co,Qc=globalThis.trustedTypes;function el(e){Co===void 0&&(Co=function(){let i=null;if(!Qc)return i;try{const n=r=>r;i=Qc.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch(n){}return i}());var t=Co;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function Kd(e,...t){if(t.length===0)return el(e[0]);let i=e[0];for(let n=0;n<t.length;n++)i+=encodeURIComponent(t[n])+e[n+1];return el(i)}var tl=[0,ae,Ne,Q,-1,gr,Ne,-1],Jd=class extends C{constructor(e){super(e)}},il=[0,Q,j,Q,Ne,-1,Bi(function(e,t,i){return(e.h===0||e.h===2)&&(t=Si(t,0|t[k],i,!1),e.h==2?sr(e,Nd,t):t.push(jt(e.g)),!0)},function(e,t,i){if((t=Fi(Ei,t))!=null&&t.length){i=lo(e,i);for(let n=0;n<t.length;n++)ar(e.g,t[n]);ho(e,i)}},Rc),j,-1,[0,Q,-1],Ne,Q,-1],nl=[0,j,-2],rl=class extends C{constructor(e){super(e)}},sl=[0],ol=[0,ae,Q,1,Q,-3],He=class extends C{constructor(e){super(e,2)}},ve={};ve[336783863]=[0,j,Q,-1,ae,[0,[1,2,3,4,5,6,7,8,9],G,sl,G,il,G,nl,G,ol,G,tl,G,[0,j,-2],G,[0,j,Ne],G,[0,Ne,j,-1],G,[0,Ne,-1]],[0,j],Q,[0,[1,3],[2,4],G,[0,gr],-1,G,[0,ke],-1,we,[0,j,-1]],j];var al=[0,_o,-1,Ri,-3,_o,gr,zt,Di,_o,-1,Ri,Di,Ri,-2,zt];function Ue(e,t){Ws(e,2,xi(t),"")}function X(e,t){tr(e,3,t)}function $(e,t){tr(e,4,t)}var Me=class extends C{constructor(e){super(e,500)}o(e){return S(this,0,7,e)}},vn=[-1,{}],cl=[0,j,1,vn],ll=[0,j,ke,vn];function Ve(e,t){ir(e,1,Me,t)}function Y(e,t){tr(e,10,t)}function H(e,t){tr(e,15,t)}var De=class extends C{constructor(e){super(e,500)}o(e){return S(this,0,1001,e)}},hl=[-500,we,[-500,zt,-1,ke,-3,[-2,ve,Q],we,Jc,Di,-1,cl,ll,we,[0,zt,Ri],zt,al,Di,ke,987,ke],4,we,[-500,j,-1,[-1,{}],998,j],we,[-500,j,ke,-1,[-2,{},Q],997,ke,-1],Di,we,[-500,j,ke,vn,998,ke],ke,Di,cl,ll,we,[0,zt,-1,vn],ke,-2,al,zt,-1,Ri,[0,Ri,Xd],978,vn,we,Jc];De.prototype.g=vr(hl);var Qd=Zt(De,hl),e0=class extends C{constructor(e){super(e)}},dl=class extends C{constructor(e){super(e)}g(){return At(this,e0,1)}},ul=[0,we,[0,ae,ge,j,-1]],br=Zt(dl,ul),t0=class extends C{constructor(e){super(e)}},i0=class extends C{constructor(e){super(e)}},Eo=class extends C{constructor(e){super(e)}h(){return N(this,t0,2)}g(){return At(this,i0,5)}},pl=Zt(class extends C{constructor(e){super(e)}},[0,ke,gr,yo,[0,Ne,[0,ae,-3],[0,ge,-3],[0,ae,-1,[0,we,[0,ae,-2]]],we,[0,ge,-1,j,ge]],j,-1,Gt,we,[0,ae,ge],ke,Gt]),fl=class extends C{constructor(e){super(e)}},Oi=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,ge,-4]]),ml=class extends C{constructor(e){super(e)}},bn=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,ge,-4]]),n0=class extends C{constructor(e){super(e)}},r0=[0,ae,-1,yo,Ne],gl=class extends C{constructor(e){super(e)}};gl.prototype.g=vr([0,ge,-4,Gt]);var s0=class extends C{constructor(e){super(e)}},o0=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,1,ae,j,ul],Gt]),vl=class extends C{constructor(e){super(e)}},a0=class extends C{constructor(e){super(e)}ma(){const e=vc(this);return e==null?ti():e}},c0=class extends C{constructor(e){super(e)}},bl=[1,2],l0=Zt(class extends C{constructor(e){super(e)}},[0,we,[0,bl,G,[0,yo],G,[0,Yc],ae,j],Gt]),xo=class extends C{constructor(e){super(e)}},wl=[0,j,ae,ge,ke,-1],yl=class extends C{constructor(e){super(e)}},h0=[0,Q,-1],_l=class extends C{constructor(e){super(e)}},wr=[1,2,3,4,5],yr=class extends C{constructor(e){super(e)}g(){return vc(this)!=null}h(){return Ke(this,2)!=null}},ee=class extends C{constructor(e){super(e)}g(){var e;return(e=nc(Ai(this,2)))!=null?e:!1}},Cl=[0,Yc,j,[0,ae,Gt,-1],[0,qd,Gt]],de=[0,Cl,Q,[0,wr,G,ol,G,il,G,tl,G,sl,G,nl],Ne],_r=class extends C{constructor(e){super(e)}},ko=[0,de,ge,-1,ae],d0=lt(502141897,_r);ve[502141897]=ko;var u0=Zt(class extends C{constructor(e){super(e)}},[0,[0,Ne,-1,Zd,Wd],r0]),El=class extends C{constructor(e){super(e)}},xl=class extends C{constructor(e){super(e)}},Ao=[0,de,ge,[0,de],Q],kl=[0,de,ko,Ao,ge,[0,[0,Cl]]],p0=lt(508968150,xl);ve[508968150]=kl,ve[508968149]=Ao;var Al=class extends C{constructor(e){super(e)}},f0=lt(513916220,Al);ve[513916220]=[0,de,kl,ae];var Pi=class extends C{constructor(e){super(e)}h(){return N(this,xo,2)}g(){W(this,2)}},Sl=[0,de,wl];ve[478825465]=Sl;var m0=class extends C{constructor(e){super(e)}},Ll=class extends C{constructor(e){super(e)}},So=class extends C{constructor(e){super(e)}},Lo=class extends C{constructor(e){super(e)}},Ml=class extends C{constructor(e){super(e)}},Tl=[0,de,[0,de],Sl,-1],Il=[0,de,ge,ae],Mo=[0,de,ge],Fl=[0,de,Il,Mo,ge],g0=lt(479097054,Ml);ve[479097054]=[0,de,Fl,Tl],ve[463370452]=Tl,ve[464864288]=Il;var v0=lt(462713202,Lo);ve[462713202]=Fl,ve[474472470]=Mo;var b0=class extends C{constructor(e){super(e)}},Bl=class extends C{constructor(e){super(e)}},Dl=class extends C{constructor(e){super(e)}},Rl=class extends C{constructor(e){super(e)}},To=[0,de,ge,-1,ae],Io=[0,de,ge,Q];Rl.prototype.g=vr([0,de,Mo,[0,de],ko,Ao,To,Io]);var Ol=class extends C{constructor(e){super(e)}},w0=lt(456383383,Ol);ve[456383383]=[0,de,wl];var Pl=class extends C{constructor(e){super(e)}},y0=lt(476348187,Pl);ve[476348187]=[0,de,h0];var $l=class extends C{constructor(e){super(e)}},Nl=class extends C{constructor(e){super(e)}},Hl=[0,Ne,-1],_0=lt(458105876,class extends C{constructor(e){super(e)}g(){var e=this.u;const t=0|e[k],i=2&t;return e=function(n,r,s){var o=Nl;const a=2&r;let c=!1;if(s==null){if(a)return fc();s=[]}else if(s.constructor===ut){if((2&s.M)==0||a)return s;s=s.da()}else Array.isArray(s)?c=!!(2&(0|s[k])):s=[];if(a){if(!s.length)return fc();c||(c=!0,_i(s))}else c&&(c=!1,s=bc(s));return c||(64&(0|s[k])?s[k]&=-33:32&r&&jn(s,32)),ne(n,r,2,o=new ut(s,o,Ld,void 0)),o}(e,t,xt(e,t,2)),!i&&Nl&&(e.pa=!0),e}});ve[458105876]=[0,Hl,zd,[!0,Gt,[0,j,-1,ke]]];var Fo=class extends C{constructor(e){super(e)}},Ul=lt(458105758,Fo);ve[458105758]=[0,de,j,Hl];var Vl=class extends C{constructor(e){super(e)}},C0=lt(443442058,Vl);ve[443442058]=[0,de,j,ae,ge,ke,-1,Q,ge],ve[514774813]=To;var jl=class extends C{constructor(e){super(e)}},E0=lt(516587230,jl);function Bo(e,t){return t=t?t.clone():new xo,e.displayNamesLocale!==void 0?W(t,1,xi(e.displayNamesLocale)):e.displayNamesLocale===void 0&&W(t,1),e.maxResults!==void 0?pt(t,2,e.maxResults):"maxResults"in e&&W(t,2),e.scoreThreshold!==void 0?x(t,3,e.scoreThreshold):"scoreThreshold"in e&&W(t,3),e.categoryAllowlist!==void 0?nr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&W(t,4),e.categoryDenylist!==void 0?nr(t,5,e.categoryDenylist):"categoryDenylist"in e&&W(t,5),t}function Do(e,t=-1,i=""){return{categories:e.map(n=>{var r,s,o,a,c,l,d;return{index:(s=(r=Ye(n,1))!=null?r:0)!=null?s:-1,score:(o=he(n,2))!=null?o:0,categoryName:(c=(a=Ke(n,3))!=null?a:"")!=null?c:"",displayName:(d=(l=Ke(n,4))!=null?l:"")!=null?d:""}}),headIndex:t,headName:i}}function Gl(e){var o,a,c,l,d,h,u,p,f,m,v,g,b;var t=ri(e,3,Ht,ni()),i=ri(e,2,Ei,ni()),n=ri(e,1,ki,ni()),r=ri(e,9,ki,ni());const s={categories:[],keypoints:[]};for(let _=0;_<t.length;_++)s.categories.push({score:t[_],index:(o=i[_])!=null?o:-1,categoryName:(a=n[_])!=null?a:"",displayName:(c=r[_])!=null?c:""});if((t=(l=N(e,Eo,4))==null?void 0:l.h())&&(s.boundingBox={originX:(d=Ye(t,1))!=null?d:0,originY:(h=Ye(t,2))!=null?h:0,width:(u=Ye(t,3))!=null?u:0,height:(p=Ye(t,4))!=null?p:0,angle:0}),(f=N(e,Eo,4))==null?void 0:f.g().length)for(const _ of N(e,Eo,4).g())s.keypoints.push({x:(m=er(_,1))!=null?m:0,y:(v=er(_,2))!=null?v:0,score:(g=er(_,4))!=null?g:0,label:(b=Ke(_,3))!=null?b:""});return s}function Cr(e){var i,n,r,s;const t=[];for(const o of At(e,ml,1))t.push({x:(i=he(o,1))!=null?i:0,y:(n=he(o,2))!=null?n:0,z:(r=he(o,3))!=null?r:0,visibility:(s=he(o,4))!=null?s:0});return t}function wn(e){var i,n,r,s;const t=[];for(const o of At(e,fl,1))t.push({x:(i=he(o,1))!=null?i:0,y:(n=he(o,2))!=null?n:0,z:(r=he(o,3))!=null?r:0,visibility:(s=he(o,4))!=null?s:0});return t}function zl(e){return Array.from(e,t=>t>127?t-256:t)}function Zl(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let i=0,n=0,r=0;for(let s=0;s<e.length;s++)i+=e[s]*t[s],n+=e[s]*e[s],r+=t[s]*t[s];if(n<=0||r<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(n*r)}let Er;ve[516587230]=[0,de,To,Io,ge],ve[518928384]=Io;const x0=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]);function ql(){return L(this,null,function*(){if(Er===void 0)try{yield WebAssembly.instantiate(x0),Er=!0}catch(e){Er=!1}return Er})}function yn(i){return L(this,arguments,function*(e,t=Kd``){const n=(yield ql())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${n}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}})}var ai=class{};function Wl(){var e=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}function Xl(e){return L(this,null,function*(){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((i,n)=>{t.addEventListener("load",()=>{i()},!1),t.addEventListener("error",r=>{n(r)},!1),document.body.appendChild(t)})}importScripts(e.toString())})}function Yl(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function A(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Kl(e,t,i){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(i?e.i._bindTextureToStream(i):e.i._bindTextureToCanvas(),!(i=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[n,r]=Yl(t);return!e.l||n===e.i.canvas.width&&r===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=r),[n,r]}function Jl(e,t,i){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let r=0;r<t.length;r++)n[r]=e.i.stringToNewUTF8(t[r]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),i(t);for(const r of n)e.i._free(r);e.i._free(t)}function ft(e,t,i){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=i}function qt(e,t,i){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(r,s,o)=>{s?(i(n,o),n=[]):n.push(r)}}ai.forVisionTasks=function(e){return yn("vision",e)},ai.forTextTasks=function(e){return yn("text",e)},ai.forGenAiExperimentalTasks=function(e){return yn("genai_experimental",e)},ai.forGenAiTasks=function(e){return yn("genai",e)},ai.forAudioTasks=function(e){return yn("audio",e)},ai.isSimdSupported=function(){return ql()};function k0(e,t,i,n){return L(this,null,function*(){return e=yield((r,s,o,a,c)=>L(this,null,function*(){if(s&&(yield Xl(s)),!self.ModuleFactory||o&&(yield Xl(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((s=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=yield self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new r(c,a)}))(e,i.wasmLoaderPath,i.assetLoaderPath,t,{locateFile:r=>r.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&r.endsWith(".data")?i.assetBinaryPath.toString():r}),yield e.o(n),e})}function Ro(e,t){const i=N(e.baseOptions,yr,1)||new yr;typeof t=="string"?(W(i,2,xi(t)),W(i,1)):t instanceof Uint8Array&&(W(i,1,Is(t,!1)),W(i,2)),S(e.baseOptions,0,1,i)}function Ql(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(i=>i.message).join(", "))}finally{e.G=[]}}function y(e,t){e.B=Math.max(e.B,t)}function xr(e,t){e.A=new Me,Ue(e.A,"PassThroughCalculator"),X(e.A,"free_memory"),$(e.A,"free_memory_unused_out"),Y(t,"free_memory"),Ve(t,e.A)}function $i(e,t){X(e.A,t),$(e.A,t+"_unused_out")}function kr(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var Oo=class{constructor(e){this.g=e,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var i,n,r,s,o,a;if(t){const c=e.baseOptions||{};if((i=e.baseOptions)!=null&&i.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((r=N(this.baseOptions,yr,1))!=null&&r.g()||(s=N(this.baseOptions,yr,1))!=null&&s.h()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(a=e.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(l,d){let h=N(l.baseOptions,_l,3);if(!h){var u=h=new _l,p=new rl;pn(u,4,wr,p)}"delegate"in d&&(d.delegate==="GPU"?(d=h,u=new Jd,pn(d,2,wr,u)):(d=h,u=new rl,pn(d,4,wr,u))),S(l.baseOptions,0,3,h)}(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then(l=>{if(l.ok)return l.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${l.status})`)}).then(l=>{try{this.g.i.FS_unlink("/model.dat")}catch(d){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(l),!0,!1,!1),Ro(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)Ro(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(l){return L(this,null,function*(){const d=[];for(var h=0;;){const{done:u,value:p}=yield l.read();if(u)break;d.push(p),h+=p.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];l=new Uint8Array(h),h=0;for(const u of d)l.set(u,h),h+=u.length;return l})}(c.modelAssetBuffer).then(l=>{Ro(this,l),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=Qd(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((i,n)=>{this.G.push(Error(n))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Ql(this)}finishProcessing(){this.g.finishProcessing(),Ql(this)}close(){this.A=void 0,this.g.closeGraph()}};function Te(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Oo.prototype.close=Oo.prototype.close;class A0{constructor(t,i,n,r){this.g=t,this.h=i,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function e2(e,t,i){const n=e.g;if(i=Te(n.createShader(i),"Failed to create WebGL shader"),n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(i)}`);return n.attachShader(e.h,i),i}function t2(e,t){const i=e.g,n=Te(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(n);const r=Te(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,r),i.enableVertexAttribArray(e.P),i.vertexAttribPointer(e.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const s=Te(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,s),i.enableVertexAttribArray(e.J),i.vertexAttribPointer(e.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new A0(i,n,r,s)}function Po(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function _n(e,t,i,n){return Po(e,t),e.h||(e.m(),e.C()),i?(e.s||(e.s=t2(e,!0)),i=e.s):(e.v||(e.v=t2(e,!1)),i=e.v),t.useProgram(e.h),i.bind(),e.l(),e=n(),i.g.bindVertexArray(null),e}function Wt(e,t,i){return Po(e,t),e=Te(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i!=null?i:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i!=null?i:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Ar(e,t,i){Po(e,t),e.A||(e.A=Te(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}function $o(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ni=class{G(){return`
3142
3120
  precision mediump float;
3143
3121
  varying vec2 vTex;
3144
3122
  uniform sampler2D inputTexture;
@@ -3814,10 +3792,7 @@ ${this.hideAttribution?"":`
3814
3792
  <selfie-capture-wrapper theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} key="${this._remountKey}" start-countdown="false" hidden></selfie-capture-wrapper>
3815
3793
  <selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
3816
3794
  </div>
3817
- `,this._data={images:[],meta:{libraryVersion:Q0}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.getAttribute("initial-screen")==="selfie-capture"||this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){F.stopMedia(),nt==null||nt.dispatchEvent(new CustomEvent("metadata.cleanup")),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:t,handler:i})=>{window.removeEventListener(t,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>L(this,null,function*(){this.setActiveScreen(this.selfieCapture)})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>L(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this.selfieReview.removeAttribute("mirror-image"),this._data.images=[],yield this.forceWrapperRemount(),this.setActiveScreen(this.selfieCapture)})),this.selfieReview.addEventListener("selfie-capture-review.accepted",()=>L(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return L(this,null,function*(){F.stopMedia(),this._remountKey++;const t=this.querySelector("div"),i=this.selfieCapture;if(i&&t){const n=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(o=>{n.setAttribute(o.name,o.value)}),i.remove(),yield new Promise(o=>{setTimeout(o,50)}),n.setAttribute("key",this._remountKey.toString()),n.setAttribute("start-countdown","false"),n.setAttribute("hidden","");const s=t.querySelector("selfie-capture-review");s?t.insertBefore(n,s):t.appendChild(n),this.selfieCapture=n,this.setupSelfieWrapperEventListeners()}return new Promise(n=>{setTimeout(()=>{n()},200)})})}setActiveScreen(t){var i;this.activeScreen!==t&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t,t===this.selfieCapture?t.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:r,handler:s})=>{window.removeEventListener(r,s)});const t=()=>L(this,null,function*(){if(F.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>L(this,null,function*(){F.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),n=r=>L(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield eu(r.detail.referenceImage,20,20));const s=r.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",s?"true":"false"),this._data.images=r.detail.images,F.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:t},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:n}],this._selfieWrapperListeners.forEach(({event:r,handler:s})=>{window.addEventListener(r,s)}),this.addEventListener("selfie-capture.publish",n)}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideAttribution(){return this.hasAttribute("hide-attribution")?'hide-attribution=""':""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?'show-navigation=""':""}get inAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get allowAgentMode(){return this.inAgentMode?'allow-agent-mode="true"':""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?'show-agent-mode-for-tests=""':""}get hideBack(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?'hide-back=""':""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?'disable-image-tests=""':""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen","allow-agent-mode","show-agent-mode-for-tests","disable-image-tests"]}attributeChangedCallback(t){switch(t){case"title":case"hidden":case"initial-screen":case"allow-agent-mode":case"show-agent-mode-for-tests":case"disable-image-tests":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",V2);/*!
3818
- * Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
3819
- * (c) 2025 Szymon Nowak | Released under the MIT license
3820
- */class Br{constructor(t,i,n,r){if(isNaN(t)||isNaN(i))throw new Error(`Point is invalid: (${t}, ${i})`);this.x=+t,this.y=+i,this.pressure=n||0,this.time=r||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class ia{static fromPoints(t,i){const n=this.calculateControlPoints(t[0],t[1],t[2]).c2,r=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new ia(t[1],n,r,t[2],i.start,i.end)}static calculateControlPoints(t,i,n){const r=t.x-i.x,s=t.y-i.y,o=i.x-n.x,a=i.y-n.y,c={x:(t.x+i.x)/2,y:(t.y+i.y)/2},l={x:(i.x+n.x)/2,y:(i.y+n.y)/2},d=Math.sqrt(r*r+s*s),h=Math.sqrt(o*o+a*a),u=c.x-l.x,p=c.y-l.y,f=d+h==0?0:h/(d+h),m={x:l.x+u*f,y:l.y+p*f},v=i.x-m.x,g=i.y-m.y;return{c1:new Br(c.x+v,c.y+g),c2:new Br(l.x+v,l.y+g)}}constructor(t,i,n,r,s,o){this.startPoint=t,this.control2=i,this.control1=n,this.endPoint=r,this.startWidth=s,this.endWidth=o}length(){let i=0,n,r;for(let s=0;s<=10;s+=1){const o=s/10,a=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const l=a-n,d=c-r;i+=Math.sqrt(l*l+d*d)}n=a,r=c}return i}point(t,i,n,r,s){return i*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*r*(1-t)*t*t+s*t*t*t}}class tu{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,i,n){this._et.addEventListener(t,i,n)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,i,n){this._et.removeEventListener(t,i,n)}}function iu(e,t=250){let i=0,n=null,r,s,o;const a=()=>{i=Date.now(),n=null,r=e.apply(s,o),n||(s=null,o=[])};return function(...l){const d=Date.now(),h=t-(d-i);return s=this,o=l,h<=0||h>t?(n&&(clearTimeout(n),n=null),i=d,r=e.apply(s,o),n||(s=null,o=[])):n||(n=window.setTimeout(a,h)),r}}let nu=class pa extends tu{constructor(t,i={}){var n,r,s;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(n=i.throttle)!==null&&n!==void 0?n:16,this.minDistance=(r=i.minDistance)!==null&&r!==void 0?r:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(s=i.canvasContextOptions)!==null&&s!==void 0?s:{},this._strokeMoveUpdate=this.throttle?iu(pa.prototype._strokeUpdate,this.throttle):pa.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:i}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,i.width,i.height),t.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,i={}){return new Promise((n,r)=>{const s=new Image,o=i.ratio||window.devicePixelRatio||1,a=i.width||this.canvas.width/o,c=i.height||this.canvas.height/o,l=i.xOffset||0,d=i.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,l,d,a,c),n()},s.onerror=h=>{r(h)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1})}toDataURL(t="image/png",i){switch(t){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(t,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const i=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:i=!0}={}){i&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,i){return i?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const i=t.changedTouches[0];return{event:t,type:t.type,x:i.clientX,y:i.clientY,pressure:i.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,i=!1){return typeof this._strokePointerId=="undefined"?i:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:n}=this._getListenerFunctions();switch(t.event.type){case"mousedown":n("mousemove",this._handleMouseMove,{passive:!1}),n("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":n("touchmove",this._handleTouchMove,{passive:!1}),n("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":n("pointermove",this._handlePointerMove,{passive:!1}),n("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const r=this._getPointGroupOptions(),s=Object.assign(Object.assign({},r),{points:[]});this._data.push(s),this._reset(r),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const i=this._createPoint(t.x,t.y,t.pressure),n=this._data[this._data.length-1],r=n.points,s=r.length>0&&r[r.length-1],o=s?i.distanceTo(s)<=this.minDistance:!1,a=this._getPointGroupOptions(n);if(!s||!(s&&o)){const c=this._addPoint(i,a);s?c&&this._drawCurve(c,a):this._drawDot(i,a),r.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,i,n){const r=this.canvas.getBoundingClientRect();return new Br(t-r.left,i-r.top,n,new Date().getTime())}_addPoint(t,i){const{_lastPoints:n}=this;if(n.push(t),n.length>2){n.length===3&&n.unshift(n[0]);const r=this._calculateCurveWidths(n[1],n[2],i),s=ia.fromPoints(n,r);return n.shift(),s}return null}_calculateCurveWidths(t,i,n){const r=n.velocityFilterWeight*i.velocityFrom(t)+(1-n.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(r,n),o={end:s,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=s,o}_strokeWidth(t,i){return Math.max(i.maxWidth/(t+1),i.minWidth)}_drawCurveSegment(t,i,n){const r=this._ctx;r.moveTo(t,i),r.arc(t,i,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,i){const n=this._ctx,r=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;n.beginPath(),n.fillStyle=i.penColor;for(let o=0;o<s;o+=1){const a=o/s,c=a*a,l=c*a,d=1-a,h=d*d,u=h*d;let p=u*t.startPoint.x;p+=3*h*a*t.control1.x,p+=3*d*c*t.control2.x,p+=l*t.endPoint.x;let f=u*t.startPoint.y;f+=3*h*a*t.control1.y,f+=3*d*c*t.control2.y,f+=l*t.endPoint.y;const m=Math.min(t.startWidth+l*r,i.maxWidth);this._drawCurveSegment(p,f,m)}n.closePath(),n.fill()}_drawDot(t,i){const n=this._ctx,r=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;n.beginPath(),this._drawCurveSegment(t.x,t.y,r),n.closePath(),n.fillStyle=i.penColor,n.fill()}_fromData(t,i,n){for(const r of t){const{points:s}=r,o=this._getPointGroupOptions(r);if(s.length>1)for(let a=0;a<s.length;a+=1){const c=s[a],l=new Br(c.x,c.y,c.pressure,c.time);a===0&&this._reset(o);const d=this._addPoint(l,o);d&&i(d,o)}else this._reset(o),n(s[0],o)}}toSVG({includeBackgroundColor:t=!1}={}){const i=this._data,n=Math.max(window.devicePixelRatio||1,1),r=0,s=0,o=this.canvas.width/n,a=this.canvas.height/n,c=document.createElementNS("http://www.w3.org/2000/svg","svg");if(c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("viewBox",`${r} ${s} ${o} ${a}`),c.setAttribute("width",o.toString()),c.setAttribute("height",a.toString()),t&&this.backgroundColor){const l=document.createElement("rect");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("fill",this.backgroundColor),c.appendChild(l)}return this._fromData(i,(l,{penColor:d})=>{const h=document.createElement("path");if(!isNaN(l.control1.x)&&!isNaN(l.control1.y)&&!isNaN(l.control2.x)&&!isNaN(l.control2.y)){const u=`M ${l.startPoint.x.toFixed(3)},${l.startPoint.y.toFixed(3)} C ${l.control1.x.toFixed(3)},${l.control1.y.toFixed(3)} ${l.control2.x.toFixed(3)},${l.control2.y.toFixed(3)} ${l.endPoint.x.toFixed(3)},${l.endPoint.y.toFixed(3)}`;h.setAttribute("d",u),h.setAttribute("stroke-width",(l.endWidth*2.25).toFixed(3)),h.setAttribute("stroke",d),h.setAttribute("fill","none"),h.setAttribute("stroke-linecap","round"),c.appendChild(h)}},(l,{penColor:d,dotSize:h,minWidth:u,maxWidth:p})=>{const f=document.createElement("circle"),m=h>0?h:(u+p)/2;f.setAttribute("r",m.toString()),f.setAttribute("cx",l.x.toString()),f.setAttribute("cy",l.y.toString()),f.setAttribute("fill",d),c.appendChild(f)}),c.outerHTML}};const Ft=class Ft{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),r=t/da(1024,n);return n===0?`${t} bytes`:`${r.toFixed(0)} ${i[n]}`}static getData(t){return new Promise((i,n)=>{const r=new FileReader;r.onload=s=>{i(s.target.result)},r.onerror=()=>{n(new Error("An error occurred reading the file. Please check the file, and try again"))},r.readAsDataURL(t)})}static retrieve(t){return L(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!Ft.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>Ft.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Ft.getHumanSize(Ft.memoryLimit)}.`);return yield Ft.getData(i)})}};li(Ft,"memoryLimit",2048e3),li(Ft,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let na=Ft;class j2 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
3795
+ `,this._data={images:[],meta:{libraryVersion:Q0}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.getAttribute("initial-screen")==="selfie-capture"||this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){F.stopMedia(),nt==null||nt.dispatchEvent(new CustomEvent("metadata.cleanup")),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:t,handler:i})=>{window.removeEventListener(t,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>L(this,null,function*(){this.setActiveScreen(this.selfieCapture)})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>L(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this.selfieReview.removeAttribute("mirror-image"),this._data.images=[],yield this.forceWrapperRemount(),this.setActiveScreen(this.selfieCapture)})),this.selfieReview.addEventListener("selfie-capture-review.accepted",()=>L(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return L(this,null,function*(){F.stopMedia(),this._remountKey++;const t=this.querySelector("div"),i=this.selfieCapture;if(i&&t){const n=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(o=>{n.setAttribute(o.name,o.value)}),i.remove(),yield new Promise(o=>{setTimeout(o,50)}),n.setAttribute("key",this._remountKey.toString()),n.setAttribute("start-countdown","false"),n.setAttribute("hidden","");const s=t.querySelector("selfie-capture-review");s?t.insertBefore(n,s):t.appendChild(n),this.selfieCapture=n,this.setupSelfieWrapperEventListeners()}return new Promise(n=>{setTimeout(()=>{n()},200)})})}setActiveScreen(t){var i;this.activeScreen!==t&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t,t===this.selfieCapture?t.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:r,handler:s})=>{window.removeEventListener(r,s)});const t=()=>L(this,null,function*(){if(F.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>L(this,null,function*(){F.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),n=r=>L(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield eu(r.detail.referenceImage,20,20));const s=r.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",s?"true":"false"),this._data.images=r.detail.images,F.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:t},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:n}],this._selfieWrapperListeners.forEach(({event:r,handler:s})=>{window.addEventListener(r,s)}),this.addEventListener("selfie-capture.publish",n)}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.publish",{detail:this._data}))}get hideInstructions(){return this.hasAttribute("hide-instructions")}get hideAttribution(){return this.hasAttribute("hide-attribution")?'hide-attribution=""':""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")}get showNavigation(){return this.hasAttribute("show-navigation")?'show-navigation=""':""}get inAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get allowAgentMode(){return this.inAgentMode?'allow-agent-mode="true"':""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?'show-agent-mode-for-tests=""':""}get hideBack(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?'hide-back=""':""}get disableImageTests(){return this.hasAttribute("disable-image-tests")?'disable-image-tests=""':""}get themeColor(){return this.getAttribute("theme-color")||"#001096"}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled"))}handleCloseEvent(){this.dispatchEvent(new CustomEvent("selfie-capture-screens.close"))}static get observedAttributes(){return["title","hidden","show-navigation","hide-back-to-host","initial-screen","allow-agent-mode","show-agent-mode-for-tests","disable-image-tests"]}attributeChangedCallback(t){switch(t){case"title":case"hidden":case"initial-screen":case"allow-agent-mode":case"show-agent-mode-for-tests":case"disable-image-tests":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",V2);class Br{constructor(t,i,n,r){if(isNaN(t)||isNaN(i))throw new Error(`Point is invalid: (${t}, ${i})`);this.x=+t,this.y=+i,this.pressure=n||0,this.time=r||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class ia{static fromPoints(t,i){const n=this.calculateControlPoints(t[0],t[1],t[2]).c2,r=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new ia(t[1],n,r,t[2],i.start,i.end)}static calculateControlPoints(t,i,n){const r=t.x-i.x,s=t.y-i.y,o=i.x-n.x,a=i.y-n.y,c={x:(t.x+i.x)/2,y:(t.y+i.y)/2},l={x:(i.x+n.x)/2,y:(i.y+n.y)/2},d=Math.sqrt(r*r+s*s),h=Math.sqrt(o*o+a*a),u=c.x-l.x,p=c.y-l.y,f=d+h==0?0:h/(d+h),m={x:l.x+u*f,y:l.y+p*f},v=i.x-m.x,g=i.y-m.y;return{c1:new Br(c.x+v,c.y+g),c2:new Br(l.x+v,l.y+g)}}constructor(t,i,n,r,s,o){this.startPoint=t,this.control2=i,this.control1=n,this.endPoint=r,this.startWidth=s,this.endWidth=o}length(){let i=0,n,r;for(let s=0;s<=10;s+=1){const o=s/10,a=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const l=a-n,d=c-r;i+=Math.sqrt(l*l+d*d)}n=a,r=c}return i}point(t,i,n,r,s){return i*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*r*(1-t)*t*t+s*t*t*t}}class tu{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,i,n){this._et.addEventListener(t,i,n)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,i,n){this._et.removeEventListener(t,i,n)}}function iu(e,t=250){let i=0,n=null,r,s,o;const a=()=>{i=Date.now(),n=null,r=e.apply(s,o),n||(s=null,o=[])};return function(...l){const d=Date.now(),h=t-(d-i);return s=this,o=l,h<=0||h>t?(n&&(clearTimeout(n),n=null),i=d,r=e.apply(s,o),n||(s=null,o=[])):n||(n=window.setTimeout(a,h)),r}}let nu=class pa extends tu{constructor(t,i={}){var n,r,s;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(n=i.throttle)!==null&&n!==void 0?n:16,this.minDistance=(r=i.minDistance)!==null&&r!==void 0?r:5,this.dotSize=i.dotSize||0,this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=i.compositeOperation||"source-over",this.canvasContextOptions=(s=i.canvasContextOptions)!==null&&s!==void 0?s:{},this._strokeMoveUpdate=this.throttle?iu(pa.prototype._strokeUpdate,this.throttle):pa.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:i}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,i.width,i.height),t.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,i={}){return new Promise((n,r)=>{const s=new Image,o=i.ratio||window.devicePixelRatio||1,a=i.width||this.canvas.width/o,c=i.height||this.canvas.height/o,l=i.xOffset||0,d=i.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,l,d,a,c),n()},s.onerror=h=>{r(h)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1})}toDataURL(t="image/png",i){switch(t){case"image/svg+xml":return typeof i!="object"&&(i=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(i))}`;default:return typeof i!="number"&&(i=void 0),this.canvas.toDataURL(t,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const i=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:i=!0}={}){i&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,i){return i?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const i=t.changedTouches[0];return{event:t,type:t.type,x:i.clientX,y:i.clientY,pressure:i.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,i=!1){return typeof this._strokePointerId=="undefined"?i:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:n}=this._getListenerFunctions();switch(t.event.type){case"mousedown":n("mousemove",this._handleMouseMove,{passive:!1}),n("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":n("touchmove",this._handleTouchMove,{passive:!1}),n("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":n("pointermove",this._handlePointerMove,{passive:!1}),n("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const r=this._getPointGroupOptions(),s=Object.assign(Object.assign({},r),{points:[]});this._data.push(s),this._reset(r),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const i=this._createPoint(t.x,t.y,t.pressure),n=this._data[this._data.length-1],r=n.points,s=r.length>0&&r[r.length-1],o=s?i.distanceTo(s)<=this.minDistance:!1,a=this._getPointGroupOptions(n);if(!s||!(s&&o)){const c=this._addPoint(i,a);s?c&&this._drawCurve(c,a):this._drawDot(i,a),r.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,i,n){const r=this.canvas.getBoundingClientRect();return new Br(t-r.left,i-r.top,n,new Date().getTime())}_addPoint(t,i){const{_lastPoints:n}=this;if(n.push(t),n.length>2){n.length===3&&n.unshift(n[0]);const r=this._calculateCurveWidths(n[1],n[2],i),s=ia.fromPoints(n,r);return n.shift(),s}return null}_calculateCurveWidths(t,i,n){const r=n.velocityFilterWeight*i.velocityFrom(t)+(1-n.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(r,n),o={end:s,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=s,o}_strokeWidth(t,i){return Math.max(i.maxWidth/(t+1),i.minWidth)}_drawCurveSegment(t,i,n){const r=this._ctx;r.moveTo(t,i),r.arc(t,i,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,i){const n=this._ctx,r=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;n.beginPath(),n.fillStyle=i.penColor;for(let o=0;o<s;o+=1){const a=o/s,c=a*a,l=c*a,d=1-a,h=d*d,u=h*d;let p=u*t.startPoint.x;p+=3*h*a*t.control1.x,p+=3*d*c*t.control2.x,p+=l*t.endPoint.x;let f=u*t.startPoint.y;f+=3*h*a*t.control1.y,f+=3*d*c*t.control2.y,f+=l*t.endPoint.y;const m=Math.min(t.startWidth+l*r,i.maxWidth);this._drawCurveSegment(p,f,m)}n.closePath(),n.fill()}_drawDot(t,i){const n=this._ctx,r=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;n.beginPath(),this._drawCurveSegment(t.x,t.y,r),n.closePath(),n.fillStyle=i.penColor,n.fill()}_fromData(t,i,n){for(const r of t){const{points:s}=r,o=this._getPointGroupOptions(r);if(s.length>1)for(let a=0;a<s.length;a+=1){const c=s[a],l=new Br(c.x,c.y,c.pressure,c.time);a===0&&this._reset(o);const d=this._addPoint(l,o);d&&i(d,o)}else this._reset(o),n(s[0],o)}}toSVG({includeBackgroundColor:t=!1}={}){const i=this._data,n=Math.max(window.devicePixelRatio||1,1),r=0,s=0,o=this.canvas.width/n,a=this.canvas.height/n,c=document.createElementNS("http://www.w3.org/2000/svg","svg");if(c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.setAttribute("viewBox",`${r} ${s} ${o} ${a}`),c.setAttribute("width",o.toString()),c.setAttribute("height",a.toString()),t&&this.backgroundColor){const l=document.createElement("rect");l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.setAttribute("fill",this.backgroundColor),c.appendChild(l)}return this._fromData(i,(l,{penColor:d})=>{const h=document.createElement("path");if(!isNaN(l.control1.x)&&!isNaN(l.control1.y)&&!isNaN(l.control2.x)&&!isNaN(l.control2.y)){const u=`M ${l.startPoint.x.toFixed(3)},${l.startPoint.y.toFixed(3)} C ${l.control1.x.toFixed(3)},${l.control1.y.toFixed(3)} ${l.control2.x.toFixed(3)},${l.control2.y.toFixed(3)} ${l.endPoint.x.toFixed(3)},${l.endPoint.y.toFixed(3)}`;h.setAttribute("d",u),h.setAttribute("stroke-width",(l.endWidth*2.25).toFixed(3)),h.setAttribute("stroke",d),h.setAttribute("fill","none"),h.setAttribute("stroke-linecap","round"),c.appendChild(h)}},(l,{penColor:d,dotSize:h,minWidth:u,maxWidth:p})=>{const f=document.createElement("circle"),m=h>0?h:(u+p)/2;f.setAttribute("r",m.toString()),f.setAttribute("cx",l.x.toString()),f.setAttribute("cy",l.y.toString()),f.setAttribute("fill",d),c.appendChild(f)}),c.outerHTML}};const Ft=class Ft{static getHumanSize(t){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),r=t/da(1024,n);return n===0?`${t} bytes`:`${r.toFixed(0)} ${i[n]}`}static getData(t){return new Promise((i,n)=>{const r=new FileReader;r.onload=s=>{i(s.target.result)},r.onerror=()=>{n(new Error("An error occurred reading the file. Please check the file, and try again"))},r.readAsDataURL(t)})}static retrieve(t){return L(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!Ft.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG, PNG or SVG image");if(i.size>Ft.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Ft.getHumanSize(Ft.memoryLimit)}.`);return yield Ft.getData(i)})}};li(Ft,"memoryLimit",2048e3),li(Ft,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let na=Ft;class j2 extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
3821
3796
  :host {
3822
3797
  display: block;
3823
3798
  block-size: auto;