@smileid/web-components 10.0.5 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +15 -15
  2. package/dist/esm/{DocumentCaptureScreens-BIJUlWLB.js → DocumentCaptureScreens-RECPb0wH.js} +3 -3
  3. package/dist/esm/{DocumentCaptureScreens-BIJUlWLB.js.map → DocumentCaptureScreens-RECPb0wH.js.map} +1 -1
  4. package/dist/esm/EndUserConsent-D4fd1ovG.js.map +1 -1
  5. package/dist/esm/Navigation-CTjK6tLU.js.map +1 -1
  6. package/dist/esm/PoweredBySmileId-CxbaihMu.js.map +1 -1
  7. package/dist/esm/SelfieCaptureScreens-CqBVGEJk.js +7901 -0
  8. package/dist/esm/SelfieCaptureScreens-CqBVGEJk.js.map +1 -0
  9. package/dist/esm/SignaturePad-C7MtmT8m.js.map +1 -1
  10. package/dist/esm/TotpConsent-CQU5jQi4.js.map +1 -1
  11. package/dist/esm/combobox.js.map +1 -1
  12. package/dist/esm/document.js +1 -1
  13. package/dist/esm/main.js +2 -2
  14. package/dist/esm/{package-PZvRbm5J.js → package-BDJnoIAU.js} +2 -2
  15. package/dist/esm/{package-PZvRbm5J.js.map → package-BDJnoIAU.js.map} +1 -1
  16. package/dist/esm/selfie.js +1 -1
  17. package/dist/esm/smart-camera-web.js +3 -3
  18. package/dist/esm/smart-camera-web.js.map +1 -1
  19. package/dist/smart-camera-web.js +72 -98
  20. package/dist/smart-camera-web.js.map +1 -1
  21. package/lib/components/document/src/DocumentCaptureScreens.js +1 -0
  22. package/lib/components/selfie/src/SelfieCaptureScreens.js +7 -18
  23. package/lib/components/selfie/src/selfie-capture/SelfieCapture.js +15 -0
  24. package/lib/components/selfie/src/selfie-capture-wrapper/SelfieCaptureWrapper.tsx +19 -2
  25. package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.tsx +2 -20
  26. package/lib/components/selfie/src/smartselfie-capture/components/CaptureControls.tsx +2 -0
  27. package/lib/components/selfie/src/smartselfie-capture/hooks/useFaceCapture.ts +5 -4
  28. package/lib/components/signature-pad/package.json +1 -1
  29. package/package.json +2 -2
  30. package/dist/esm/SelfieCaptureScreens-CnMaKUmP.js +0 -11361
  31. package/dist/esm/SelfieCaptureScreens-CnMaKUmP.js.map +0 -1
@@ -1,15 +1,15 @@
1
- var SmartCameraWeb=function(ht){"use strict";var hw=Object.defineProperty,dw=Object.defineProperties;var fw=Object.getOwnPropertyDescriptors;var vc=Object.getOwnPropertySymbols;var B4=Object.prototype.hasOwnProperty,R4=Object.prototype.propertyIsEnumerable;var Uu=Math.pow,Pu=(ht,Dt,Nt)=>Dt in ht?hw(ht,Dt,{enumerable:!0,configurable:!0,writable:!0,value:Nt}):ht[Dt]=Nt,Fe=(ht,Dt)=>{for(var Nt in Dt||(Dt={}))B4.call(Dt,Nt)&&Pu(ht,Nt,Dt[Nt]);if(vc)for(var Nt of vc(Dt))R4.call(Dt,Nt)&&Pu(ht,Nt,Dt[Nt]);return ht},ys=(ht,Dt)=>dw(ht,fw(Dt));var $u=(ht,Dt)=>{var Nt={};for(var We in ht)B4.call(ht,We)&&Dt.indexOf(We)<0&&(Nt[We]=ht[We]);if(ht!=null&&vc)for(var We of vc(ht))Dt.indexOf(We)<0&&R4.call(ht,We)&&(Nt[We]=ht[We]);return Nt};var xr=(ht,Dt,Nt)=>Pu(ht,typeof Dt!="symbol"?Dt+"":Dt,Nt);var q=(ht,Dt,Nt)=>new Promise((We,bo)=>{var _c=Ji=>{try{Cs(Nt.next(Ji))}catch(Er){bo(Er)}},wc=Ji=>{try{Cs(Nt.throw(Ji))}catch(Er){bo(Er)}},Cs=Ji=>Ji.done?We(Ji.value):Promise.resolve(Ji.value).then(_c,wc);Cs((Nt=Nt.apply(ht,Dt)).next())});var mi;function Dt(t){const e=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${t}-${e}`}function Nt(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function We(t){return t&&t.clientHeight<t.scrollHeight}function bo(t,e){const{offsetHeight:i,offsetTop:s}=t,{offsetHeight:o,scrollTop:c}=e,l=s<c,u=s+i>c+o;l?e.scrollTo(0,s):u&&e.scrollTo(0,s-o+i)}class _c extends HTMLElement{constructor(){super(),this.handleRoaming=this.handleRoaming.bind(this)}connectedCallback(){this.trigger=this.querySelector("smileid-combobox-trigger"),document.addEventListener("click",this.handleRoaming),this.addEventListener("focusout",this.handleRoaming),this.addEventListener("blur",this.handleRoaming)}disconnectedCallback(){document.removeEventListener("click",this.handleRoaming),this.removeEventListener("focusout",this.handleRoaming),this.removeEventListener("blur",this.handleRoaming)}handleRoaming(e){const i=e.relatedTarget||e.target;this.contains(i)||this.trigger.getAttribute("expanded")==="true"&&this.trigger.setAttribute("expanded","false")}}class wc extends HTMLElement{constructor(){super(),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleSelection=this.handleSelection.bind(this),this.toggleExpansionState=this.toggleExpansionState.bind(this)}get type(){return this.getAttribute("type")||"text"}get label(){return this.getAttribute("label")||""}get value(){return this.getAttribute("value")||""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){if(!this.label)throw new Error("<combobox-trigger>: a label attribute is required");this.innerHTML=`${this.type==="text"?`
1
+ var SmartCameraWeb=function(P){"use strict";var mu=Object.defineProperty,gu=Object.defineProperties;var vu=Object.getOwnPropertyDescriptors;var Pr=Object.getOwnPropertySymbols;var K2=Object.prototype.hasOwnProperty,J2=Object.prototype.propertyIsEnumerable;var da=Math.pow,ha=(P,J,ie)=>J in P?mu(P,J,{enumerable:!0,configurable:!0,writable:!0,value:ie}):P[J]=ie,Fe=(P,J)=>{for(var ie in J||(J={}))K2.call(J,ie)&&ha(P,ie,J[ie]);if(Pr)for(var ie of Pr(J))J2.call(J,ie)&&ha(P,ie,J[ie]);return P},qi=(P,J)=>gu(P,vu(J));var ua=(P,J)=>{var ie={};for(var Pe in P)K2.call(P,Pe)&&J.indexOf(Pe)<0&&(ie[Pe]=P[Pe]);if(P!=null&&Pr)for(var Pe of Pr(P))J.indexOf(Pe)<0&&J2.call(P,Pe)&&(ie[Pe]=P[Pe]);return ie};var li=(P,J,ie)=>ha(P,typeof J!="symbol"?J+"":J,ie);var M=(P,J,ie)=>new Promise((Pe,Sn)=>{var $r=_t=>{try{Wi(ie.next(_t))}catch(hi){Sn(hi)}},Nr=_t=>{try{Wi(ie.throw(_t))}catch(hi){Sn(hi)}},Wi=_t=>_t.done?Pe(_t.value):Promise.resolve(_t.value).then($r,Nr);Wi((ie=ie.apply(P,J)).next())});var rt;function J(e){const t=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${e}-${t}`}function ie(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function Pe(e){return e&&e.clientHeight<e.scrollHeight}function Sn(e,t){const{offsetHeight:i,offsetTop:n}=e,{offsetHeight:r,scrollTop:s}=t,o=n<s,a=n+i>s+r;o?t.scrollTo(0,n):a&&t.scrollTo(0,n-r+i)}class $r extends HTMLElement{constructor(){super(),this.handleRoaming=this.handleRoaming.bind(this)}connectedCallback(){this.trigger=this.querySelector("smileid-combobox-trigger"),document.addEventListener("click",this.handleRoaming),this.addEventListener("focusout",this.handleRoaming),this.addEventListener("blur",this.handleRoaming)}disconnectedCallback(){document.removeEventListener("click",this.handleRoaming),this.removeEventListener("focusout",this.handleRoaming),this.removeEventListener("blur",this.handleRoaming)}handleRoaming(t){const i=t.relatedTarget||t.target;this.contains(i)||this.trigger.getAttribute("expanded")==="true"&&this.trigger.setAttribute("expanded","false")}}class Nr extends HTMLElement{constructor(){super(),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleSelection=this.handleSelection.bind(this),this.toggleExpansionState=this.toggleExpansionState.bind(this)}get type(){return this.getAttribute("type")||"text"}get label(){return this.getAttribute("label")||""}get value(){return this.getAttribute("value")||""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){if(!this.label)throw new Error("<combobox-trigger>: a label attribute is required");this.innerHTML=`${this.type==="text"?`
2
2
  <div>
3
3
  <input ${this.value?`value="${this.value}" `:""}${this.disabled?" disabled ":""}type="text" placeholder="${this.label}" />
4
4
  <button ${this.disabled?"disabled ":""}tabindex='-1' type='button'>
5
5
  <span class="visually-hidden">Toggle</span>
6
6
  </button>
7
7
  </div>
8
- `:`<button ${this.disabled?"disabled ":""}type="button">${this.value||this.label}</button>`}`,this.setAttribute("expanded",!1),this.inputTrigger=this.querySelector("input"),this.buttonTrigger=this.querySelector("button"),this.buttonTrigger.setAttribute("aria-expanded",!1),this.buttonTrigger.setAttribute("role","combobox"),this.buttonTrigger.addEventListener("keydown",this.handleKeyDown),this.buttonTrigger.addEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.setAttribute("aria-expanded",!1),this.inputTrigger.setAttribute("role","combobox"),this.inputTrigger.addEventListener("keydown",this.handleKeyDown),this.inputTrigger.addEventListener("keyup",this.handleKeyUp),this.inputTrigger.addEventListener("change",e=>e.stopPropagation())),this.listbox=this.parentElement.querySelector("smileid-combobox-listbox"),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.options.forEach(e=>{e.addEventListener("combobox.option.select",this.handleSelection)})}disconnectedCallback(){this.buttonTrigger.removeEventListener("keydown",this.handleKeyDown),this.buttonTrigger.removeEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.removeEventListener("keydown",this.handleKeyDown),this.inputTrigger.removeEventListener("keyup",this.handleKeyUp),this.inputTrigger.removeEventListener("change",e=>e.stopPropagation())),this.options&&this.options.forEach(e=>{e.removeEventListener("combobox.option.select",this.handleSelection)})}handleKeyDown(e){if(e.ctrlKey||e.shiftKey)return;const{key:i}=e;switch(i){case"Enter":case"Space":case" ":if(this.getAttribute("expanded")==="true")if(this.inputTrigger&&(i==="Space"||i===" "))this.resetListbox();else{e.preventDefault();const s=this.buttonTrigger.getAttribute("aria-activedescendant");s&&document.getElementById(s).click()}else e.preventDefault(),this.toggleExpansionState();break;case"Esc":case"Escape":e.preventDefault(),this.getAttribute("expanded")==="true"&&this.toggleExpansionState();break;case"Down":case"ArrowDown":e.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("First")):this.focusListbox("Down");break;case"Up":case"ArrowUp":e.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("Last")):this.focusListbox("Up");break;case"Left":case"ArrowLeft":case"Right":case"ArrowRight":case"Home":case"End":this.resetListbox();break}}handleKeyUp(e){const{key:i}=e,s=o=>o.length===1&&o.match(/\S| /);(e.key==="Escape"||e.key==="Esc")&&(e.preventDefault(),this.getAttribute("expanded")==="true"?this.toggleExpansionState():this.inputTrigger&&(this.inputTrigger.value="",this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:""})))),(s(i)||i==="Backspace")&&(this.resetListbox(),this.filterListbox(e.target.value))}toggleExpansionState(){const e=this.getAttribute("expanded")==="true";this.setAttribute("expanded",!e),this.buttonTrigger.setAttribute("aria-expanded",!e),this.inputTrigger&&this.inputTrigger.setAttribute("aria-expanded",!e)}handleSelection(e){this.inputTrigger?this.inputTrigger.value=e.detail.label:this.buttonTrigger.textContent=e.detail.label,this.toggleExpansionState(),this.parentElement.dispatchEvent(new CustomEvent("combobox.change",{detail:{value:e.detail.value}}))}filterListbox(e){this.getAttribute("expanded")!=="true"&&this.toggleExpansionState(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:e}))}focusListbox(e){this.resetListbox(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.focus",{detail:{direction:e}}))}resetListbox(){this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.reset"))}}class Cs extends HTMLElement{constructor(){super(),this.handleFilter=this.handleFilter.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleReset=this.handleReset.bind(this),this.handleOptionSelection=this.handleOptionSelection.bind(this)}get emptyLabel(){return this.getAttribute("empty-label")}get emptyState(){return`
8
+ `:`<button ${this.disabled?"disabled ":""}type="button">${this.value||this.label}</button>`}`,this.setAttribute("expanded",!1),this.inputTrigger=this.querySelector("input"),this.buttonTrigger=this.querySelector("button"),this.buttonTrigger.setAttribute("aria-expanded",!1),this.buttonTrigger.setAttribute("role","combobox"),this.buttonTrigger.addEventListener("keydown",this.handleKeyDown),this.buttonTrigger.addEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.setAttribute("aria-expanded",!1),this.inputTrigger.setAttribute("role","combobox"),this.inputTrigger.addEventListener("keydown",this.handleKeyDown),this.inputTrigger.addEventListener("keyup",this.handleKeyUp),this.inputTrigger.addEventListener("change",t=>t.stopPropagation())),this.listbox=this.parentElement.querySelector("smileid-combobox-listbox"),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.options.forEach(t=>{t.addEventListener("combobox.option.select",this.handleSelection)})}disconnectedCallback(){this.buttonTrigger.removeEventListener("keydown",this.handleKeyDown),this.buttonTrigger.removeEventListener("click",this.toggleExpansionState),this.inputTrigger&&(this.inputTrigger.removeEventListener("keydown",this.handleKeyDown),this.inputTrigger.removeEventListener("keyup",this.handleKeyUp),this.inputTrigger.removeEventListener("change",t=>t.stopPropagation())),this.options&&this.options.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleSelection)})}handleKeyDown(t){if(t.ctrlKey||t.shiftKey)return;const{key:i}=t;switch(i){case"Enter":case"Space":case" ":if(this.getAttribute("expanded")==="true")if(this.inputTrigger&&(i==="Space"||i===" "))this.resetListbox();else{t.preventDefault();const n=this.buttonTrigger.getAttribute("aria-activedescendant");n&&document.getElementById(n).click()}else t.preventDefault(),this.toggleExpansionState();break;case"Esc":case"Escape":t.preventDefault(),this.getAttribute("expanded")==="true"&&this.toggleExpansionState();break;case"Down":case"ArrowDown":t.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("First")):this.focusListbox("Down");break;case"Up":case"ArrowUp":t.preventDefault(),this.getAttribute("expanded")!=="true"?(this.toggleExpansionState(),this.focusListbox("Last")):this.focusListbox("Up");break;case"Left":case"ArrowLeft":case"Right":case"ArrowRight":case"Home":case"End":this.resetListbox();break}}handleKeyUp(t){const{key:i}=t,n=r=>r.length===1&&r.match(/\S| /);(t.key==="Escape"||t.key==="Esc")&&(t.preventDefault(),this.getAttribute("expanded")==="true"?this.toggleExpansionState():this.inputTrigger&&(this.inputTrigger.value="",this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:""})))),(n(i)||i==="Backspace")&&(this.resetListbox(),this.filterListbox(t.target.value))}toggleExpansionState(){const t=this.getAttribute("expanded")==="true";this.setAttribute("expanded",!t),this.buttonTrigger.setAttribute("aria-expanded",!t),this.inputTrigger&&this.inputTrigger.setAttribute("aria-expanded",!t)}handleSelection(t){this.inputTrigger?this.inputTrigger.value=t.detail.label:this.buttonTrigger.textContent=t.detail.label,this.toggleExpansionState(),this.parentElement.dispatchEvent(new CustomEvent("combobox.change",{detail:{value:t.detail.value}}))}filterListbox(t){this.getAttribute("expanded")!=="true"&&this.toggleExpansionState(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.filter",{detail:t}))}focusListbox(t){this.resetListbox(),this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.focus",{detail:{direction:t}}))}resetListbox(){this.listbox.dispatchEvent(new CustomEvent("combobox.listbox.reset"))}}class Wi extends HTMLElement{constructor(){super(),this.handleFilter=this.handleFilter.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleReset=this.handleReset.bind(this),this.handleOptionSelection=this.handleOptionSelection.bind(this)}get emptyLabel(){return this.getAttribute("empty-label")}get emptyState(){return`
9
9
  <p id='empty-state' style="text-align: center;">
10
10
  ${this.emptyLabel||"No items"}
11
11
  </p>
12
- `}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",Dt("listbox")),this.addEventListener("combobox.listbox.filter",this.handleFilter),this.addEventListener("combobox.listbox.focus",this.handleFocus),this.addEventListener("combobox.listbox.reset",this.handleReset),this.triggers=Array.from(this.parentElement.querySelectorAll("smileid-combobox-trigger input, smileid-combobox-trigger button")),this.triggers.forEach(e=>e.setAttribute("aria-controls",this.getAttribute("id"))),this.optionNodes=Array.from(this.querySelectorAll("smileid-combobox-option")),this.selectedNode=this.optionNodes.find(e=>!e.hasAttribute("hidden")&&e.hasAttribute("aria-selected"))||this.optionNodes.filter(e=>!e.hasAttribute("hidden"))[0],this.selectedNode.setAttribute("tabindex","0"),this.optionNodes.forEach(e=>{e.addEventListener("combobox.option.select",this.handleOptionSelection)}),this.optionNodes.length===0&&(this.innerHTML=this.emptyState)}disconnectedCallback(){this.removeEventListener("combobox.listbox.filter",this.handleFilter),this.removeEventListener("combobox.listbox.focus",this.handleFocus),this.removeEventListener("combobox.listbox.reset",this.handleReset),this.optionNodes.forEach(e=>{e.removeEventListener("combobox.option.select",this.handleOptionSelection)})}static get observedAttributes(){return["search-term"]}attributeChangedCallback(e,i,s){switch(e){case"search-term":i&&!s?this.optionNodes.forEach(o=>{o.removeAttribute("hidden")}):s&&this.filterNodes(s);break}}filterNodes(e){this.optionNodes.forEach(o=>{const c=o.getAttribute("value").toLowerCase(),l=o.getAttribute("label").toLowerCase();c.includes(e.toLowerCase())||l.includes(e.toLowerCase())?o.removeAttribute("hidden"):o.setAttribute("hidden",!0)});const i=this.optionNodes.find(o=>!o.hasAttribute("hidden")),s=this.querySelector("#empty-state");!i&&!s?this.insertAdjacentHTML("afterbegin",this.emptyState):i&&s&&this.removeChild(s)}handleFilter(e){const i=e.detail;this.setAttribute("search-term",i)}handleFocus(e){this.setSelected(e.detail.direction)}handleReset(){this.optionNodes.forEach(e=>e.setAttribute("tabindex","-1"))}handleOptionSelection(e){this.triggers.filter(s=>s.tagName==="INPUT")[0]&&this.setAttribute("search-term",e.detail.label)}setSelected(e){const i=this.optionNodes.filter(l=>!l.hasAttribute("hidden"));this.selectedNode.setAttribute("tabindex","0");const s=i.findIndex(l=>l===this.selectedNode),o=i.length-1;let c;switch(e){case"First":c=0;break;case"Last":c=o;break;case"Up":s===0?c=o:c=s-1;break;default:s===o?c=0:c=s+1;break}s!==c&&this.swapSelected(this.selectedNode,i[c])}swapSelected(e,i){e.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,We(this)&&bo(this.selectedNode,this),Nt(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(s=>s.setAttribute("aria-activedescendant",i.id))}}class Ji extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",Dt("option")),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.addEventListener("click",this.select)}disconnectedCallback(){this.removeEventListener("click",this.select)}get value(){return this.getAttribute("value")}get label(){return this.getAttribute("label")}select(){const e=this.options.find(i=>i.getAttribute("aria-selected"));e&&e.removeAttribute("aria-selected"),this.setAttribute("aria-selected",!0),this.dispatchEvent(new CustomEvent("combobox.option.select",{detail:{id:this.getAttribute("id"),label:this.label,value:this.value}}))}}const Er=_c,Hu=wc,Vu=Cs,Gu=Ji;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",Er),window.customElements.define("smileid-combobox-trigger",Hu),window.customElements.define("smileid-combobox-listbox",Vu),window.customElements.define("smileid-combobox-option",Gu));const Ar={ID_CARD_BACK_IMAGE_BASE64:7,ID_CARD_BACK_IMAGE_FILE:5,ID_CARD_IMAGE_BASE64:3,ID_CARD_IMAGE_FILE:1,LIVENESS_IMAGE_BASE64:6,LIVENESS_IMAGE_FILE:4,SELFIE_IMAGE_BASE64:2,SELFIE_IMAGE_FILE:0},D4=`
12
+ `}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",J("listbox")),this.addEventListener("combobox.listbox.filter",this.handleFilter),this.addEventListener("combobox.listbox.focus",this.handleFocus),this.addEventListener("combobox.listbox.reset",this.handleReset),this.triggers=Array.from(this.parentElement.querySelectorAll("smileid-combobox-trigger input, smileid-combobox-trigger button")),this.triggers.forEach(t=>t.setAttribute("aria-controls",this.getAttribute("id"))),this.optionNodes=Array.from(this.querySelectorAll("smileid-combobox-option")),this.selectedNode=this.optionNodes.find(t=>!t.hasAttribute("hidden")&&t.hasAttribute("aria-selected"))||this.optionNodes.filter(t=>!t.hasAttribute("hidden"))[0],this.selectedNode.setAttribute("tabindex","0"),this.optionNodes.forEach(t=>{t.addEventListener("combobox.option.select",this.handleOptionSelection)}),this.optionNodes.length===0&&(this.innerHTML=this.emptyState)}disconnectedCallback(){this.removeEventListener("combobox.listbox.filter",this.handleFilter),this.removeEventListener("combobox.listbox.focus",this.handleFocus),this.removeEventListener("combobox.listbox.reset",this.handleReset),this.optionNodes.forEach(t=>{t.removeEventListener("combobox.option.select",this.handleOptionSelection)})}static get observedAttributes(){return["search-term"]}attributeChangedCallback(t,i,n){switch(t){case"search-term":i&&!n?this.optionNodes.forEach(r=>{r.removeAttribute("hidden")}):n&&this.filterNodes(n);break}}filterNodes(t){this.optionNodes.forEach(r=>{const s=r.getAttribute("value").toLowerCase(),o=r.getAttribute("label").toLowerCase();s.includes(t.toLowerCase())||o.includes(t.toLowerCase())?r.removeAttribute("hidden"):r.setAttribute("hidden",!0)});const i=this.optionNodes.find(r=>!r.hasAttribute("hidden")),n=this.querySelector("#empty-state");!i&&!n?this.insertAdjacentHTML("afterbegin",this.emptyState):i&&n&&this.removeChild(n)}handleFilter(t){const i=t.detail;this.setAttribute("search-term",i)}handleFocus(t){this.setSelected(t.detail.direction)}handleReset(){this.optionNodes.forEach(t=>t.setAttribute("tabindex","-1"))}handleOptionSelection(t){this.triggers.filter(n=>n.tagName==="INPUT")[0]&&this.setAttribute("search-term",t.detail.label)}setSelected(t){const i=this.optionNodes.filter(o=>!o.hasAttribute("hidden"));this.selectedNode.setAttribute("tabindex","0");const n=i.findIndex(o=>o===this.selectedNode),r=i.length-1;let s;switch(t){case"First":s=0;break;case"Last":s=r;break;case"Up":n===0?s=r:s=n-1;break;default:n===r?s=0:s=n+1;break}n!==s&&this.swapSelected(this.selectedNode,i[s])}swapSelected(t,i){t.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,Pe(this)&&Sn(this.selectedNode,this),ie(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(n=>n.setAttribute("aria-activedescendant",i.id))}}class _t extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",J("option")),this.options=Array.from(this.parentElement.querySelectorAll("smileid-combobox-option")),this.addEventListener("click",this.select)}disconnectedCallback(){this.removeEventListener("click",this.select)}get value(){return this.getAttribute("value")}get label(){return this.getAttribute("label")}select(){const t=this.options.find(i=>i.getAttribute("aria-selected"));t&&t.removeAttribute("aria-selected"),this.setAttribute("aria-selected",!0),this.dispatchEvent(new CustomEvent("combobox.option.select",{detail:{id:this.getAttribute("id"),label:this.label,value:this.value}}))}}const hi=$r,fa=Nr,ma=Wi,ga=_t;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",hi),window.customElements.define("smileid-combobox-trigger",fa),window.customElements.define("smileid-combobox-listbox",ma),window.customElements.define("smileid-combobox-option",ga));const di={ID_CARD_BACK_IMAGE_BASE64:7,ID_CARD_BACK_IMAGE_FILE:5,ID_CARD_IMAGE_BASE64:3,ID_CARD_IMAGE_FILE:1,LIVENESS_IMAGE_BASE64:6,LIVENESS_IMAGE_FILE:4,SELFIE_IMAGE_BASE64:2,SELFIE_IMAGE_FILE:0},Q2=`
13
13
  .text-xs {
14
14
  font-size: 0.75rem;
15
15
  line-height: 1rem;
@@ -58,16 +58,16 @@ var SmartCameraWeb=function(ht){"use strict";var hw=Object.defineProperty,dw=Obj
58
58
  .font-normal {
59
59
  font-weight: 400;
60
60
  }
61
- `,Ai=t=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
61
+ `,st=e=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
62
62
  <link
63
63
  href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"
64
64
  rel="stylesheet"
65
65
  as="style"
66
66
  />
67
67
  <style>
68
- ${D4}
68
+ ${Q2}
69
69
  :host {
70
- --theme-color: ${t||"#001096"};
70
+ --theme-color: ${e||"#001096"};
71
71
  --color-active: #001096;
72
72
  --color-default: #2d2b2a;
73
73
  --color-disabled: #848282;
@@ -143,11 +143,11 @@ ${D4}
143
143
  }
144
144
 
145
145
  .title-color {
146
- color: ${t||"#001096"};
146
+ color: ${e||"#001096"};
147
147
  }
148
148
 
149
149
  .theme-color {
150
- color: ${t||"#001096"};
150
+ color: ${e||"#001096"};
151
151
  }
152
152
 
153
153
  .center {
@@ -181,7 +181,7 @@ ${D4}
181
181
  }
182
182
 
183
183
  .button {
184
- --button-color: ${t||"var(--active-color)"};
184
+ --button-color: ${e||"var(--active-color)"};
185
185
  -webkit-appearance: none;
186
186
  appearance: none;
187
187
  border-radius: 2.5rem;
@@ -390,7 +390,7 @@ ${D4}
390
390
  }
391
391
 
392
392
  .instruction-header {
393
- color: ${t};
393
+ color: ${e};
394
394
  }
395
395
 
396
396
  .flex-column {
@@ -423,7 +423,7 @@ ${D4}
423
423
  left: 1.25rem;
424
424
  }
425
425
 
426
- </style>`,zi=class zi{static getMedia(e){return q(this,null,function*(){return zi.stream=yield navigator.mediaDevices.getUserMedia(e),zi.stream})}static stopMedia(){zi.stream&&(zi.stream.getTracks().forEach(e=>e.stop()),zi.stream=null)}static supportsAgentMode(){return q(this,null,function*(){try{const i=(yield navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput");let s=!1;return i.forEach(o=>o.label.toLowerCase().includes("back")||o.label.toLowerCase().includes("rear")?(s=!0,!0):!1),s}catch(e){return console.warn("Error accessing media devices: ",e),!1}})}static isSamsungMultiCameraDevice(){const e=navigator.userAgent.match(/SM-[N|G]\d{3}/);if(!e)return!1;const i=parseInt(e[0].match(/\d{3}/)[0],10);return!Number.isNaN(i)&&i>=970}static handleCameraError(e){switch(e.name){case"NotAllowedError":case"SecurityError":return`
426
+ </style>`,wt=class wt{static getMedia(t){return M(this,null,function*(){return wt.stream=yield navigator.mediaDevices.getUserMedia(t),wt.stream})}static stopMedia(){wt.stream&&(wt.stream.getTracks().forEach(t=>t.stop()),wt.stream=null)}static supportsAgentMode(){return M(this,null,function*(){try{const i=(yield navigator.mediaDevices.enumerateDevices()).filter(r=>r.kind==="videoinput");let n=!1;return i.forEach(r=>r.label.toLowerCase().includes("back")||r.label.toLowerCase().includes("rear")?(n=!0,!0):!1),n}catch(t){return console.warn("Error accessing media devices: ",t),!1}})}static isSamsungMultiCameraDevice(){const t=navigator.userAgent.match(/SM-[N|G]\d{3}/);if(!t)return!1;const i=parseInt(t[0].match(/\d{3}/)[0],10);return!Number.isNaN(i)&&i>=970}static handleCameraError(t){switch(t.name){case"NotAllowedError":case"SecurityError":return`
427
427
  Looks like camera access was not granted, or was blocked by a browser
428
428
  level setting / extension. Please follow the prompt from the URL bar,
429
429
  or extensions, and enable access.
@@ -440,7 +440,7 @@ ${D4}
440
440
  `;case"TypeError":return`
441
441
  This site is insecure, and as such cannot have access to your camera.
442
442
  Try to navigate to a secure version of this page, or contact the owner.
443
- `;default:return e.message}}};xr(zi,"stream",null),xr(zi,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:zi.isSamsungMultiCameraDevice()?2:1});let et=zi;class zu extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
443
+ `;default:return t.message}}};li(wt,"stream",null),li(wt,"environmentOptions",{facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:wt.isSamsungMultiCameraDevice()?2:1});let F=wt;class va extends HTMLElement{connectedCallback(){const t=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
444
444
  :host {
445
445
  display: flex;
446
446
  max-inline-size: 100%;
@@ -503,7 +503,7 @@ button[data-type="icon"] {
503
503
  white-space: nowrap;
504
504
  inline-size: 1px;
505
505
  }
506
- `;const s=document.createElement("button");s.setAttribute("class","back-button"),s.setAttribute("data-type","icon"),s.setAttribute("part","back-button"),s.setAttribute("type","button"),s.innerHTML=`
506
+ `;const n=document.createElement("button");n.setAttribute("class","back-button"),n.setAttribute("data-type","icon"),n.setAttribute("part","back-button"),n.setAttribute("type","button"),n.innerHTML=`
507
507
  <svg
508
508
  xmlns="http://www.w3.org/2000/svg"
509
509
  width="24"
@@ -522,7 +522,7 @@ button[data-type="icon"] {
522
522
  />
523
523
  </svg>
524
524
  <span part="back-button-text">Back</span>
525
- `;const o=document.createElement("button");o.setAttribute("class","close-button"),o.setAttribute("data-type","icon"),o.setAttribute("part","close-button"),o.setAttribute("type","button"),o.innerHTML=`
525
+ `;const r=document.createElement("button");r.setAttribute("class","close-button"),r.setAttribute("data-type","icon"),r.setAttribute("part","close-button"),r.setAttribute("type","button"),r.innerHTML=`
526
526
  <svg
527
527
  xmlns="http://www.w3.org/2000/svg"
528
528
  viewBox="0 0 24 24"
@@ -543,7 +543,7 @@ button[data-type="icon"] {
543
543
  <span class="visually-hidden"
544
544
  >Close SmileIdentity Verification frame</span
545
545
  >
546
- `,e.appendChild(i),this.showBackButton&&e.appendChild(s),e.appendChild(o),this.backButton=s,this.backButton.addEventListener("click",()=>this.handleBack()),this.closeButton=o,this.closeButton.addEventListener("click",()=>this.handleClose())}disconnectedCallback(){this.backButton.removeEventListener("click",()=>this.handleBack()),this.closeButton.removeEventListener("click",()=>this.handleClose())}handleBack(){this.dispatchEvent(new CustomEvent("navigation.back"))}handleClose(){this.dispatchEvent(new CustomEvent("navigation.close"))}get showBackButton(){return!this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hasThemeColor(){var e;return(e=this.getAttribute("theme-color"))==null?void 0:e.trim()}}"customElements"in window&&!window.customElements.get("smileid-navigation")&&window.customElements.define("smileid-navigation",zu);function O4(t,e=16){const i=new Set;for(let s=0;s<Math.min(t.length,1e4);s+=4)if(i.add(t[s]<<16|t[s+1]<<8|t[s+2]),i.size>e)return!0;return!1}function P4(){return`
546
+ `,t.appendChild(i),this.showBackButton&&t.appendChild(n),t.appendChild(r),this.backButton=n,this.backButton.addEventListener("click",()=>this.handleBack()),this.closeButton=r,this.closeButton.addEventListener("click",()=>this.handleClose())}disconnectedCallback(){this.backButton.removeEventListener("click",()=>this.handleBack()),this.closeButton.removeEventListener("click",()=>this.handleClose())}handleBack(){this.dispatchEvent(new CustomEvent("navigation.back"))}handleClose(){this.dispatchEvent(new CustomEvent("navigation.close"))}get showBackButton(){return!this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hasThemeColor(){var t;return(t=this.getAttribute("theme-color"))==null?void 0:t.trim()}}"customElements"in window&&!window.customElements.get("smileid-navigation")&&window.customElements.define("smileid-navigation",va);function eh(e,t=16){const i=new Set;for(let n=0;n<Math.min(e.length,1e4);n+=4)if(i.add(e[n]<<16|e[n+1]<<8|e[n+2]),i.size>t)return!0;return!1}function th(){return`
547
547
  <style>
548
548
  .visually-hidden {
549
549
  border: 0;
@@ -688,7 +688,7 @@ button[data-type="icon"] {
688
688
  padding-top: 10px;
689
689
  }
690
690
  </style>
691
- ${Ai(this.themeColor)}
691
+ ${st(this.themeColor)}
692
692
  <div id='document-capture-screen' class='flow center flex-column'>
693
693
  <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
694
694
  <h2 class='text-base font-bold title-color'>${this.documentName}</h2>
@@ -716,7 +716,7 @@ button[data-type="icon"] {
716
716
  </div>
717
717
  </div>
718
718
  </div>
719
- `}const Sr=.6;class U4 extends HTMLElement{constructor(){super(),this.templateString=P4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.IdSides={back:"Back",front:"Front"}}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}getUserMedia(){return q(this,null,function*(){if(!et.stream&&this.hasAttribute("data-camera-error")){try{yield et.getMedia({audio:!1,video:ys(Fe({},et.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(e){console.error(e.constraint),console.error(e.message)}this.handleIDStream(et.stream)}})}_captureIDImage(){const e=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:Fe({},e)}))}_drawIDImage(e=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=e.videoWidth,i.height=i.width*16/9;const h=document.createElement("canvas");h.width=i.width,h.height=i.height,this.updatePortraitId(i,e,1,1),this.updatePortraitId(h,e);const f=i.toDataURL("image/jpeg"),_=h.toDataURL("image/jpeg");return Fe({image:f,originalHeight:i.height,originalWidth:i.width,previewImage:_},this.idCardRegion)}i.width=2240,i.height=1260;const s=i.width/(e.videoWidth/e.videoHeight);i.height=s;const o=document.createElement("canvas");if(o.height=i.height,o.width=i.width,e.videoWidth<e.videoHeight){const h=document.createElement("canvas");o.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(h,e),this._drawLandscapeImageFromCanvas(i,h,1,1),this._drawLandscapeImageFromCanvas(o,h)}else this._drawLandscapeImage(i,e,1,1),this._drawLandscapeImage(o,e);const l=i.toDataURL("image/jpeg"),u=o.toDataURL("image/jpeg");return Fe({image:l,originalHeight:i.height,originalWidth:i.width,previewImage:u},this.idCardRegion)}_drawImage(e,i=!0,s=et.stream){this.resetErrorMessage();const o=e.getContext("2d");if(o.drawImage(s,0,0,s.videoWidth,s.videoHeight,0,0,e.width,e.height),i){const c=o.getImageData(0,0,e.width,e.height);if(O4(c.data))return o;throw new Error("Unable to capture webcam images - Please try another device")}else return o}handleIDStream(e){try{const i=this.shadowRoot.querySelector("canvas");i&&i.remove();let s=null,o=null;s=document.createElement("video"),o=document.createElement("canvas");const c=this.shadowRoot.querySelector(".id-video-container");s.muted=!0,s.setAttribute("muted","true"),s.autoplay=!0,s.playsInline=!0,"srcObject"in s?s.srcObject=e:s.src=window.URL.createObjectURL(e),o.width=c.clientWidth,o.height=c.clientWidth*9/16,this.isPortraitCaptureView&&(o.height=c.clientWidth*16/9),s.onloadedmetadata=()=>{s.play(),this.shadowRoot.querySelector("#loader").hidden=!0,this.shadowRoot.querySelector(".id-video").hidden=!1,this.shadowRoot.querySelector(".actions").hidden=!1,i||c.prepend(o)};const l=()=>{if(s.paused||s.ended)return;s.removeEventListener("playing",l);const h=s.videoWidth/s.videoHeight<1;if(this.isPortraitCaptureView){this.updatePortraitId(o,s),requestAnimationFrame(l);return}if(h){c.classList.add("mobile-camera-screen");const f=document.createElement("canvas");this._capturePortraitToLandscapeImage(f,s),this._drawLandscapeImageFromCanvas(o,f)}else this._drawLandscapeImage(o,s);requestAnimationFrame(l)};s.addEventListener("playing",l),this._IDStream=e,this._IDVideo=s}catch(i){this.setAttribute("data-camera-error",et.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),et.stopMedia()}}_drawLandscapeImage(e,i=this._IDVideo,s=Sr,o=Sr){const c=this.height?this.height/i.videoHeight:s,l=this.width?this.width/i.videoWidth:o,u=(1-s)/2,h=(1-o)/2,f=i.videoWidth*l,_=i.videoHeight*c,m=i.videoWidth*h,b=i.videoHeight*u;e.getContext("2d").drawImage(i,m,b,f,_,0,0,e.width,e.height)}_capturePortraitToLandscapeImage(e,i=this._IDVideo){const{videoHeight:s,videoWidth:o}=i,c=o,l=o*9/16,u=0,h=(s-l)/2;e.width=c,e.height=l,e.getContext("2d").drawImage(i,u,h,c,l,0,0,e.width,e.height)}_drawLandscapeImageFromCanvas(e,i,s=Sr,o=Sr){const c=this.height?this.height/i.height:s,l=this.width?this.width/i.width:o,u=(1-s)/2,h=(1-o)/2,f=i.width*l,_=i.height*c,m=i.width*h,b=i.height*u;e.getContext("2d").drawImage(i,m,b,f,_,0,0,e.width,e.height)}_drawPortraitToLandscapeImage(e,i=this._IDVideo){const{videoHeight:s,videoWidth:o}=i,c=600,l=400;e.width=c,e.height=l;const u=(o-c)/2,h=(s-l)/2;e.getContext("2d").drawImage(i,u,h,c,l,0,0,e.width,e.height)}updatePortraitId(e,i=this._IDVideo,s=Sr,o=Sr){const{videoWidth:c,videoHeight:l}=i;if(c&&l){const u=document.createElement("canvas"),h=9/16;let f,_,m,b;c/l>h?(_=l,f=_*h,m=(c-f)/2,b=0):(f=c,_=f,m=0,b=0),u.height=_,u.width=f,u.getContext("2d").drawImage(i,m,b,f,_,0,0,u.width,u.height);const E=this.height?this.height/f:s,A=this.width?this.width/_:o,k=(1-s)/2,F=(1-o)/2,M=f*A,D=_*E,R=f*F,$=_*k;e.getContext("2d").drawImage(u,R,$,M,D,0,0,e.width,e.height)}}_stopIDVideoStream(e=this._IDStream){e.getTracks().forEach(i=>i.stop())}setUpEventListeners(){this.captureIDImage=this.shadowRoot.querySelector("#capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),et.stream&&this.handleIDStream(et.stream),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.captureIDImage.addEventListener("click",()=>{this._captureIDImage()}),this.getUserMedia()}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 e=this.documentCaptureModes;return e.includes("camera")&&e.includes("upload")}get title(){return this.getAttribute("title")||`${this.IdSides[this.sideOfId]} of ${this.documentName}`}get height(){return this.getAttribute("height")}get width(){return this.getAttribute("width")}get hidden(){return this.getAttribute("hidden")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get documentType(){return this.getAttribute("document-type")||""}get documentName(){return this.getAttribute("document-name")||"Document"}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get cameraError(){return this.getAttribute("data-camera-error")}static get observedAttributes(){return["data-camera-error","data-camera-ready","document-name","document-type","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(e){switch(e){case"data-camera-error":case"data-camera-ready":case"document-name":case"document-type":case"hidden":case"title":this.connectedCallback();break}}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture.cancelled")),et.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),et.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",U4);function $4(){return`
719
+ `}const ui=.6;class ih extends HTMLElement{constructor(){super(),this.templateString=th.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.IdSides={back:"Back",front:"Front"}}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}getUserMedia(){return M(this,null,function*(){if(!F.stream&&this.hasAttribute("data-camera-error")){try{yield F.getMedia({audio:!1,video:qi(Fe({},F.environmentOptions),{aspectRatio:{ideal:1.7777777777777777}})})}catch(t){console.error(t.constraint),console.error(t.message)}this.handleIDStream(F.stream)}})}_captureIDImage(){const t=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:Fe({},t)}))}_drawIDImage(t=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=t.videoWidth,i.height=i.width*16/9;const c=document.createElement("canvas");c.width=i.width,c.height=i.height,this.updatePortraitId(i,t,1,1),this.updatePortraitId(c,t);const l=i.toDataURL("image/jpeg"),d=c.toDataURL("image/jpeg");return Fe({image:l,originalHeight:i.height,originalWidth:i.width,previewImage:d},this.idCardRegion)}i.width=2240,i.height=1260;const n=i.width/(t.videoWidth/t.videoHeight);i.height=n;const r=document.createElement("canvas");if(r.height=i.height,r.width=i.width,t.videoWidth<t.videoHeight){const c=document.createElement("canvas");r.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(c,t),this._drawLandscapeImageFromCanvas(i,c,1,1),this._drawLandscapeImageFromCanvas(r,c)}else this._drawLandscapeImage(i,t,1,1),this._drawLandscapeImage(r,t);const o=i.toDataURL("image/jpeg"),a=r.toDataURL("image/jpeg");return Fe({image:o,originalHeight:i.height,originalWidth:i.width,previewImage:a},this.idCardRegion)}_drawImage(t,i=!0,n=F.stream){this.resetErrorMessage();const r=t.getContext("2d");if(r.drawImage(n,0,0,n.videoWidth,n.videoHeight,0,0,t.width,t.height),i){const s=r.getImageData(0,0,t.width,t.height);if(eh(s.data))return r;throw new Error("Unable to capture webcam images - Please try another device")}else return r}handleIDStream(t){try{const i=this.shadowRoot.querySelector("canvas");i&&i.remove();let n=null,r=null;n=document.createElement("video"),r=document.createElement("canvas");const s=this.shadowRoot.querySelector(".id-video-container");n.muted=!0,n.setAttribute("muted","true"),n.autoplay=!0,n.playsInline=!0,"srcObject"in n?n.srcObject=t:n.src=window.URL.createObjectURL(t),r.width=s.clientWidth,r.height=s.clientWidth*9/16,this.isPortraitCaptureView&&(r.height=s.clientWidth*16/9),n.onloadedmetadata=()=>{n.play(),this.shadowRoot.querySelector("#loader").hidden=!0,this.shadowRoot.querySelector(".id-video").hidden=!1,this.shadowRoot.querySelector(".actions").hidden=!1,i||s.prepend(r)};const o=()=>{if(n.paused||n.ended)return;n.removeEventListener("playing",o);const c=n.videoWidth/n.videoHeight<1;if(this.isPortraitCaptureView){this.updatePortraitId(r,n),requestAnimationFrame(o);return}if(c){s.classList.add("mobile-camera-screen");const l=document.createElement("canvas");this._capturePortraitToLandscapeImage(l,n),this._drawLandscapeImageFromCanvas(r,l)}else this._drawLandscapeImage(r,n);requestAnimationFrame(o)};n.addEventListener("playing",o),this._IDStream=t,this._IDVideo=n}catch(i){this.setAttribute("data-camera-error",F.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),F.stopMedia()}}_drawLandscapeImage(t,i=this._IDVideo,n=ui,r=ui){const s=this.height?this.height/i.videoHeight:n,o=this.width?this.width/i.videoWidth:r,a=(1-n)/2,c=(1-r)/2,l=i.videoWidth*o,d=i.videoHeight*s,h=i.videoWidth*c,u=i.videoHeight*a;t.getContext("2d").drawImage(i,h,u,l,d,0,0,t.width,t.height)}_capturePortraitToLandscapeImage(t,i=this._IDVideo){const{videoHeight:n,videoWidth:r}=i,s=r,o=r*9/16,a=0,c=(n-o)/2;t.width=s,t.height=o,t.getContext("2d").drawImage(i,a,c,s,o,0,0,t.width,t.height)}_drawLandscapeImageFromCanvas(t,i,n=ui,r=ui){const s=this.height?this.height/i.height:n,o=this.width?this.width/i.width:r,a=(1-n)/2,c=(1-r)/2,l=i.width*o,d=i.height*s,h=i.width*c,u=i.height*a;t.getContext("2d").drawImage(i,h,u,l,d,0,0,t.width,t.height)}_drawPortraitToLandscapeImage(t,i=this._IDVideo){const{videoHeight:n,videoWidth:r}=i,s=600,o=400;t.width=s,t.height=o;const a=(r-s)/2,c=(n-o)/2;t.getContext("2d").drawImage(i,a,c,s,o,0,0,t.width,t.height)}updatePortraitId(t,i=this._IDVideo,n=ui,r=ui){const{videoWidth:s,videoHeight:o}=i;if(s&&o){const a=document.createElement("canvas"),c=9/16;let l,d,h,u;s/o>c?(d=o,l=d*c,h=(s-l)/2,u=0):(l=s,d=l,h=0,u=0),a.height=d,a.width=l,a.getContext("2d").drawImage(i,h,u,l,d,0,0,a.width,a.height);const p=this.height?this.height/l:n,f=this.width?this.width/d:r,m=(1-n)/2,v=(1-r)/2,g=l*f,b=d*p,_=l*v,E=d*m;t.getContext("2d").drawImage(a,_,E,g,b,0,0,t.width,t.height)}}_stopIDVideoStream(t=this._IDStream){t.getTracks().forEach(i=>i.stop())}setUpEventListeners(){this.captureIDImage=this.shadowRoot.querySelector("#capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),F.stream&&this.handleIDStream(F.stream),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.captureIDImage.addEventListener("click",()=>{this._captureIDImage()}),this.getUserMedia()}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")||`${this.IdSides[this.sideOfId]} of ${this.documentName}`}get height(){return this.getAttribute("height")}get width(){return this.getAttribute("width")}get hidden(){return this.getAttribute("hidden")}get sideOfId(){return(this.getAttribute("side-of-id")||"front").toLowerCase()}get isFrontOfId(){return this.sideOfId==="front"}get isBackOfId(){return!this.isFrontOfId}get documentType(){return this.getAttribute("document-type")||""}get documentName(){return this.getAttribute("document-name")||"Document"}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get cameraError(){return this.getAttribute("data-camera-error")}static get observedAttributes(){return["data-camera-error","data-camera-ready","document-name","document-type","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"data-camera-ready":case"document-name":case"document-type":case"hidden":case"title":this.connectedCallback();break}}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture.cancelled")),F.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),F.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",ih);function nh(){return`
720
720
  <style>
721
721
  .retake-photo.button[data-variant~="ghost"] {
722
722
  color: #FF5805;
@@ -931,7 +931,7 @@ button[data-type="icon"] {
931
931
  line-height: 1.5rem;
932
932
  }
933
933
  </style>
934
- ${Ai(this.themeColor)}
934
+ ${st(this.themeColor)}
935
935
  <div id='document-capture-review-screen' class='flow center'>
936
936
  <smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
937
937
  <h1 class="header-title title-color">
@@ -960,7 +960,7 @@ button[data-type="icon"] {
960
960
  `}
961
961
  </div>
962
962
  </div>
963
- `}class N4 extends HTMLElement{constructor(){super(),this.templateString=$4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}static get observedAttributes(){return["hide-back-to-host","show-navigation","data-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 title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.close"))}attributeChangedCallback(e){switch(e){case"data-image":case"hide-back-to-host":case"show-navigation":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectIDImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureIDImage=this.shadowRoot.querySelector("#re-capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.accepted",{detail:{}}))}),this.reCaptureIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("document-capture-review")&&window.customElements.define("document-capture-review",N4);let H4=(mi=class{static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),o=e/Uu(1024,s);return s===0?`${e} bytes`:`${o.toFixed(0)} ${i[s]}`}static getData(e){return new Promise((i,s)=>{const o=new FileReader;o.onload=c=>{i(c.target.result)},o.onerror=()=>{s(new Error("An error occurred reading the file. Please check the file, and try again"))},o.readAsDataURL(e)})}static retrieve(e){return q(this,null,function*(){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!mi.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG or PNG image");if(i.size>mi.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${mi.getHumanSize(mi.memoryLimit)}.`);return yield mi.getData(i)})}},xr(mi,"memoryLimit",1024e4),xr(mi,"supportedTypes",["image/jpeg","image/png"]),mi);function V4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
963
+ `}class rh extends HTMLElement{constructor(){super(),this.templateString=nh.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"]}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 title(){return this.getAttribute("title")||"Submit Front of ID"}handleBackEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.cancelled"))}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture-review.close"))}attributeChangedCallback(t){switch(t){case"data-image":case"hide-back-to-host":case"show-navigation":this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.selectIDImage=this.shadowRoot.querySelector("#select-id-image"),this.reCaptureIDImage=this.shadowRoot.querySelector("#re-capture-id-image"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()}),this.selectIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.accepted",{detail:{}}))}),this.reCaptureIDImage.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("document-capture-review.rejected",{detail:{}}))})}}"customElements"in window&&!customElements.get("document-capture-review")&&window.customElements.define("document-capture-review",rh);let sh=(rt=class{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 M(this,null,function*(){if(t.length>1)throw new Error("Only one file upload is permitted at a time");const i=t[0];if(!rt.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG or PNG image");if(i.size>rt.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${rt.getHumanSize(rt.memoryLimit)}.`);return yield rt.getData(i)})}},li(rt,"memoryLimit",1024e4),li(rt,"supportedTypes",["image/jpeg","image/png"]),rt);function oh(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
964
964
  <path d="M15.3799 21.2759C15.3799 16.8576 18.9616 13.2759 23.3799 13.2759H64.2764C68.6947 13.2759 72.2764 16.8576 72.2764 21.2759V73.5517C72.2764 77.97 68.6947 81.5517 64.2764 81.5517H23.3799C18.9616 81.5517 15.3799 77.97 15.3799 73.5517V21.2759Z" fill="#F6C969"/>
965
965
  <g filter="url(#filter0_d_1281_4127)">
966
966
  <path d="M60.2117 80.8741C60.2117 80.8741 49.3661 81.5134 44.1952 81.5134C39.0242 81.5134 28.1787 80.8741 28.1787 80.8741C28.1787 80.8741 34.6256 78.4515 35.3307 76.8701C35.7001 76.0962 35.8344 73.2362 35.9015 70.578C35.9687 67.9199 35.9015 65.5646 35.9015 65.5646L44.1952 65.6992L52.4888 65.5646C52.4888 65.5646 52.3881 72.0921 52.7575 75.3223C52.7813 75.8503 52.8832 76.372 53.0597 76.8701C53.7984 78.4515 60.2117 80.8741 60.2117 80.8741Z" fill="url(#paint0_linear_1281_4127)"/>
@@ -1068,7 +1068,7 @@ button[data-type="icon"] {
1068
1068
  <stop offset="0.71" stop-color="#FF766A"/>
1069
1069
  </linearGradient>
1070
1070
  </defs>
1071
- </svg>`}function G4(){return`<svg xmlns="http://www.w3.org/2000/svg" width="182" height="108" viewBox="0 0 182 108" fill="none">
1071
+ </svg>`}function ah(){return`<svg xmlns="http://www.w3.org/2000/svg" width="182" height="108" viewBox="0 0 182 108" fill="none">
1072
1072
  <path d="M143 68C143 65.7909 144.791 64 147 64H164C166.209 64 168 65.7909 168 68V89C168 91.2091 166.209 93 164 93H147C144.791 93 143 91.2091 143 89V68Z" fill="#F6C969"/>
1073
1073
  <g filter="url(#filter0_d_1281_4284)">
1074
1074
  <mask id="path-2-inside-1_1281_4284" fill="white">
@@ -1103,7 +1103,7 @@ button[data-type="icon"] {
1103
1103
  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4284" result="shape"/>
1104
1104
  </filter>
1105
1105
  </defs>
1106
- </svg>`}function z4(){return`
1106
+ </svg>`}function ch(){return`
1107
1107
  <style>
1108
1108
  h1 {
1109
1109
  font-size: 1.25rem;
@@ -1147,7 +1147,7 @@ button[data-type="icon"] {
1147
1147
  </div>
1148
1148
  <div class="content-body">
1149
1149
  <header>
1150
- ${this.isFrontOfId?V4():G4()}
1150
+ ${this.isFrontOfId?oh():ah()}
1151
1151
  <h1 class='title-color font-bold'>${this.title}</h1>
1152
1152
  <p class="description text-sm font-normal">
1153
1153
  We'll use it to verify your identity.
@@ -1351,9 +1351,9 @@ ${this.hideAttribution?"":`
1351
1351
  </div>
1352
1352
  </div>
1353
1353
  </div>
1354
- ${Ai(this.themeColor)}
1355
- `}class W4 extends HTMLElement{constructor(){super(),this.templateString=z4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.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=>q(this,null,function*(){this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:s}=i.target,o=yield H4.retrieve(s);this.dispatchEvent(new CustomEvent("document-capture-instructions.upload",{detail:{image:o,previewImage:o}}))}catch(s){this.shadowRoot.querySelector("#error").innerHTML=s.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 e=this.documentCaptureModes;return e.includes("camera")&&e.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",W4);const xs={version:"10.0.5"},Z4=xs.version,at=document.querySelector("smart-camera-web");function Cn(t){return q(this,null,function*(){try{const e=yield et.getMedia({audio:!1,video:et.environmentOptions}),s=(yield navigator.mediaDevices.enumerateDevices()).find(o=>o.kind==="videoinput"&&e.getVideoTracks()[0].getSettings().deviceId===o.deviceId);at==null||at.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:s==null?void 0:s.label}})),t.removeAttribute("data-camera-error"),t.setAttribute("data-camera-ready",!0)}catch(e){t.removeAttribute("data-camera-ready"),t.setAttribute("data-camera-error",et.handleCameraError(e))}})}class Wu extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),at==null||at.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1356
- ${Ai(this.themeColor)}
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=>M(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.0"},hh=Xi.version,B=document.querySelector("smart-camera-web");function Bt(e){return M(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
+ ${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}
1359
1359
  ${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions?"hidden":""}
@@ -1373,14 +1373,14 @@ ${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:Z4}},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?(Cn(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){et.stopMedia(),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",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)})),this.documentInstruction.addEventListener("document-capture-instructions.upload",i=>q(this,null,function*(){at==null||at.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:Ar.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)})),this.idCapture.addEventListener("document-capture.publish",i=>{at==null||at.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:Ar.ID_CARD_IMAGE_BASE64}),et.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",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.idReview.addEventListener("document-capture-review.accepted",()=>q(this,null,function*(){this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Cn(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),yield Cn(this.idCaptureBack)})),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",()=>q(this,null,function*(){this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)):this.setActiveScreen(this.documentInstruction)})),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",i=>q(this,null,function*(){at==null||at.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:Ar.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)})),this.idCaptureBack.addEventListener("document-capture.publish",i=>{at==null||at.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:Ar.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),et.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",()=>q(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Cn(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>q(this,null,function*(){at==null||at.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),yield Cn(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(e){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e}static get observedAttributes(){return["document-capture-modes","document-type","hide-back-to-host","show-navigation","hide-back-of-id"]}attributeChangedCallback(e){switch(e){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",Wu);var yo=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function q4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Es={exports:{}};/*!
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",()=>M(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=>M(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",()=>M(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",()=>M(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",()=>M(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",()=>M(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=>M(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",()=>M(this,null,function*(){this.hideInstructions?(this.setActiveScreen(this.idCapture),yield Bt(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)})),this.backOfIdReview.addEventListener("document-capture-review.rejected",()=>M(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 Mn=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
1377
  * validate.js 0.13.1
1378
1378
  *
1379
1379
  * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
1380
1380
  * Validate.js may be freely distributed under the MIT license.
1381
1381
  * For all details and documentation:
1382
1382
  * http://validatejs.org/
1383
- */var j4=Es.exports,Zu;function X4(){return Zu||(Zu=1,function(t,e){(function(i,s,o){var c=function(u,h,f){f=l.extend({},l.options,f);var _=l.runValidations(u,h,f);if(_.some(function(m){return l.isPromise(m.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(_,f)},l=c;l.extend=function(u){return[].slice.call(arguments,1).forEach(function(h){for(var f in h)u[f]=h[f]}),u},l.extend(c,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var u=l.format("%{major}.%{minor}.%{patch}",l.version);return l.isEmpty(l.version.metadata)||(u+="+"+l.version.metadata),u}},Promise:typeof Promise!="undefined"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(u,h,f){var _=[],m,b,E,A,k,F,M;(l.isDomElement(u)||l.isJqueryElement(u))&&(u=l.collectFormValues(u));for(m in h){E=l.getDeepObjectValue(u,m),A=l.result(h[m],E,u,m,f,h);for(b in A){if(k=l.validators[b],!k)throw M=l.format("Unknown validator %{name}",{name:b}),new Error(M);F=A[b],F=l.result(F,E,u,m,f,h),F&&_.push({attribute:m,value:E,validator:b,globalOptions:f,attributes:u,options:F,error:k.call(k,E,F,m,u,f)})}}return _},processValidationResults:function(u,h){u=l.pruneEmptyErrors(u,h),u=l.expandMultipleErrors(u,h),u=l.convertErrorMessages(u,h);var f=h.format||"grouped";if(typeof l.formatters[f]=="function")u=l.formatters[f](u);else throw new Error(l.format("Unknown format %{format}",h));return l.isEmpty(u)?void 0:u},async:function(u,h,f){f=l.extend({},l.async.options,f);var _=f.wrapErrors||function(b){return b};f.cleanAttributes!==!1&&(u=l.cleanAttributes(u,h));var m=l.runValidations(u,h,f);return new l.Promise(function(b,E){l.waitForResults(m).then(function(){var A=l.processValidationResults(m,f);A?E(new _(A,f,u,h)):b(u)},function(A){E(A)})})},single:function(u,h,f){return f=l.extend({},l.single.options,f,{format:"flat",fullMessages:!1}),l({single:u},{single:h},f)},waitForResults:function(u){return u.reduce(function(h,f){return l.isPromise(f.error)?h.then(function(){return f.error.then(function(_){f.error=_||null})}):h},new l.Promise(function(h){h()}))},result:function(u){var h=[].slice.call(arguments,1);return typeof u=="function"&&(u=u.apply(null,h)),u},isNumber:function(u){return typeof u=="number"&&!isNaN(u)},isFunction:function(u){return typeof u=="function"},isInteger:function(u){return l.isNumber(u)&&u%1===0},isBoolean:function(u){return typeof u=="boolean"},isObject:function(u){return u===Object(u)},isDate:function(u){return u instanceof Date},isDefined:function(u){return u!=null},isPromise:function(u){return!!u&&l.isFunction(u.then)},isJqueryElement:function(u){return u&&l.isString(u.jquery)},isDomElement:function(u){return!u||!u.querySelectorAll||!u.querySelector?!1:l.isObject(document)&&u===document?!0:typeof HTMLElement=="object"?u instanceof HTMLElement:u&&typeof u=="object"&&u!==null&&u.nodeType===1&&typeof u.nodeName=="string"},isEmpty:function(u){var h;if(!l.isDefined(u))return!0;if(l.isFunction(u))return!1;if(l.isString(u))return l.EMPTY_STRING_REGEXP.test(u);if(l.isArray(u))return u.length===0;if(l.isDate(u))return!1;if(l.isObject(u)){for(h in u)return!1;return!0}return!1},format:l.extend(function(u,h){return l.isString(u)?u.replace(l.format.FORMAT_REGEXP,function(f,_,m){return _==="%"?"%{"+m+"}":String(h[m])}):u},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(u){return l.isNumber(u)?u*100%1===0?""+u:parseFloat(Math.round(u*100)/100).toFixed(2):l.isArray(u)?u.map(function(h){return l.prettify(h)}).join(", "):l.isObject(u)?l.isDefined(u.toString)?u.toString():JSON.stringify(u):(u=""+u,u.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(h,f,_){return""+f+" "+_.toLowerCase()}).toLowerCase())},stringifyValue:function(u,h){var f=h&&h.prettify||l.prettify;return f(u)},isString:function(u){return typeof u=="string"},isArray:function(u){return{}.toString.call(u)==="[object Array]"},isHash:function(u){return l.isObject(u)&&!l.isArray(u)&&!l.isFunction(u)},contains:function(u,h){return l.isDefined(u)?l.isArray(u)?u.indexOf(h)!==-1:h in u:!1},unique:function(u){return l.isArray(u)?u.filter(function(h,f,_){return _.indexOf(h)==f}):u},forEachKeyInKeypath:function(u,h,f){if(l.isString(h)){var _="",m,b=!1;for(m=0;m<h.length;++m)switch(h[m]){case".":b?(b=!1,_+="."):(u=f(u,_,!1),_="");break;case"\\":b?(b=!1,_+="\\"):b=!0;break;default:b=!1,_+=h[m];break}return f(u,_,!0)}},getDeepObjectValue:function(u,h){if(l.isObject(u))return l.forEachKeyInKeypath(u,h,function(f,_){if(l.isObject(f))return f[_]})},collectFormValues:function(u,h){var f={},_,m,b,E,A,k;if(l.isJqueryElement(u)&&(u=u[0]),!u)return f;for(h=h||{},E=u.querySelectorAll("input[name], textarea[name]"),_=0;_<E.length;++_)if(b=E.item(_),!l.isDefined(b.getAttribute("data-ignored"))){var F=b.name.replace(/\./g,"\\\\.");k=l.sanitizeFormValue(b.value,h),b.type==="number"?k=k?+k:null:b.type==="checkbox"?b.attributes.value?b.checked||(k=f[F]||null):k=b.checked:b.type==="radio"&&(b.checked||(k=f[F]||null)),f[F]=k}for(E=u.querySelectorAll("select[name]"),_=0;_<E.length;++_)if(b=E.item(_),!l.isDefined(b.getAttribute("data-ignored"))){if(b.multiple){k=[];for(m in b.options)A=b.options[m],A&&A.selected&&k.push(l.sanitizeFormValue(A.value,h))}else{var M=typeof b.options[b.selectedIndex]!="undefined"?b.options[b.selectedIndex].value:"";k=l.sanitizeFormValue(M,h)}f[b.name]=k}return f},sanitizeFormValue:function(u,h){return h.trim&&l.isString(u)&&(u=u.trim()),h.nullify!==!1&&u===""?null:u},capitalize:function(u){return l.isString(u)?u[0].toUpperCase()+u.slice(1):u},pruneEmptyErrors:function(u){return u.filter(function(h){return!l.isEmpty(h.error)})},expandMultipleErrors:function(u){var h=[];return u.forEach(function(f){l.isArray(f.error)?f.error.forEach(function(_){h.push(l.extend({},f,{error:_}))}):h.push(f)}),h},convertErrorMessages:function(u,h){h=h||{};var f=[],_=h.prettify||l.prettify;return u.forEach(function(m){var b=l.result(m.error,m.value,m.attribute,m.options,m.attributes,m.globalOptions);if(!l.isString(b)){f.push(m);return}b[0]==="^"?b=b.slice(1):h.fullMessages!==!1&&(b=l.capitalize(_(m.attribute))+" "+b),b=b.replace(/\\\^/g,"^"),b=l.format(b,{value:l.stringifyValue(m.value,h)}),f.push(l.extend({},m,{error:b}))}),f},groupErrorsByAttribute:function(u){var h={};return u.forEach(function(f){var _=h[f.attribute];_?_.push(f):h[f.attribute]=[f]}),h},flattenErrorsToArray:function(u){return u.map(function(h){return h.error}).filter(function(h,f,_){return _.indexOf(h)===f})},cleanAttributes:function(u,h){function f(b,E,A){return l.isObject(b[E])?b[E]:b[E]=A?!0:{}}function _(b){var E={},A;for(A in b)b[A]&&l.forEachKeyInKeypath(E,A,f);return E}function m(b,E){if(!l.isObject(b))return b;var A=l.extend({},b),k,F;for(F in b)k=E[F],l.isObject(k)?A[F]=m(A[F],k):k||delete A[F];return A}return!l.isObject(h)||!l.isObject(u)?{}:(h=_(h),m(u,h))},exposeModule:function(u,h,f,_,m){f?(_&&_.exports&&(f=_.exports=u),f.validate=u):(h.validate=u,u.isFunction(m)&&m.amd&&m([],function(){return u}))},warn:function(u){typeof console!="undefined"&&console.warn&&console.warn("[validate.js] "+u)},error:function(u){typeof console!="undefined"&&console.error&&console.error("[validate.js] "+u)}}),c.validators={presence:function(u,h){if(h=l.extend({},this.options,h),h.allowEmpty!==!1?!l.isDefined(u):l.isEmpty(u))return h.message||this.message||"can't be blank"},length:function(u,h,f){if(l.isDefined(u)){h=l.extend({},this.options,h);var _=h.is,m=h.maximum,b=h.minimum,E=h.tokenizer||function(M){return M},A,k=[];u=E(u);var F=u.length;if(!l.isNumber(F))return h.message||this.notValid||"has an incorrect length";if(l.isNumber(_)&&F!==_&&(A=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",k.push(l.format(A,{count:_}))),l.isNumber(b)&&F<b&&(A=h.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",k.push(l.format(A,{count:b}))),l.isNumber(m)&&F>m&&(A=h.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",k.push(l.format(A,{count:m}))),k.length>0)return h.message||k}},numericality:function(u,h,f,_,m){if(l.isDefined(u)){h=l.extend({},this.options,h);var b=[],E,A,k={greaterThan:function($,X){return $>X},greaterThanOrEqualTo:function($,X){return $>=X},equalTo:function($,X){return $===X},lessThan:function($,X){return $<X},lessThanOrEqualTo:function($,X){return $<=X},divisibleBy:function($,X){return $%X===0}},F=h.prettify||m&&m.prettify||l.prettify;if(l.isString(u)&&h.strict){var M="^-?(0|[1-9]\\d*)";if(h.onlyInteger||(M+="(\\.\\d+)?"),M+="$",!new RegExp(M).test(u))return h.message||h.notValid||this.notValid||this.message||"must be a valid number"}if(h.noStrings!==!0&&l.isString(u)&&!l.isEmpty(u)&&(u=+u),!l.isNumber(u))return h.message||h.notValid||this.notValid||this.message||"is not a number";if(h.onlyInteger&&!l.isInteger(u))return h.message||h.notInteger||this.notInteger||this.message||"must be an integer";for(E in k)if(A=h[E],l.isNumber(A)&&!k[E](u,A)){var D="not"+l.capitalize(E),R=h[D]||this[D]||this.message||"must be %{type} %{count}";b.push(l.format(R,{count:A,type:F(E)}))}if(h.odd&&u%2!==1&&b.push(h.notOdd||this.notOdd||this.message||"must be odd"),h.even&&u%2!==0&&b.push(h.notEven||this.notEven||this.message||"must be even"),b.length)return h.message||b}},datetime:l.extend(function(u,h){if(!l.isFunction(this.parse)||!l.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(l.isDefined(u)){h=l.extend({},this.options,h);var f,_=[],m=h.earliest?this.parse(h.earliest,h):NaN,b=h.latest?this.parse(h.latest,h):NaN;if(u=this.parse(u,h),isNaN(u)||h.dateOnly&&u%864e5!==0)return f=h.notValid||h.message||this.notValid||"must be a valid date",l.format(f,{value:arguments[0]});if(!isNaN(m)&&u<m&&(f=h.tooEarly||h.message||this.tooEarly||"must be no earlier than %{date}",f=l.format(f,{value:this.format(u,h),date:this.format(m,h)}),_.push(f)),!isNaN(b)&&u>b&&(f=h.tooLate||h.message||this.tooLate||"must be no later than %{date}",f=l.format(f,{date:this.format(b,h),value:this.format(u,h)}),_.push(f)),_.length)return l.unique(_)}},{parse:null,format:null}),date:function(u,h){return h=l.extend({},h,{dateOnly:!0}),l.validators.datetime.call(l.validators.datetime,u,h)},format:function(u,h){(l.isString(h)||h instanceof RegExp)&&(h={pattern:h}),h=l.extend({},this.options,h);var f=h.message||this.message||"is invalid",_=h.pattern,m;if(l.isDefined(u)&&(!l.isString(u)||(l.isString(_)&&(_=new RegExp(h.pattern,h.flags)),m=_.exec(u),!m||m[0].length!=u.length)))return f},inclusion:function(u,h){if(l.isDefined(u)&&(l.isArray(h)&&(h={within:h}),h=l.extend({},this.options,h),!l.contains(h.within,u))){var f=h.message||this.message||"^%{value} is not included in the list";return l.format(f,{value:u})}},exclusion:function(u,h){if(l.isDefined(u)&&(l.isArray(h)&&(h={within:h}),h=l.extend({},this.options,h),!!l.contains(h.within,u))){var f=h.message||this.message||"^%{value} is restricted";return l.isString(h.within[u])&&(u=h.within[u]),l.format(f,{value:u})}},email:l.extend(function(u,h){h=l.extend({},this.options,h);var f=h.message||this.message||"is not a valid email";if(l.isDefined(u)&&(!l.isString(u)||!this.PATTERN.exec(u)))return f},{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(u,h,f,_,m){if(l.isDefined(u)){l.isString(h)&&(h={attribute:h}),h=l.extend({},this.options,h);var b=h.message||this.message||"is not equal to %{attribute}";if(l.isEmpty(h.attribute)||!l.isString(h.attribute))throw new Error("The attribute must be a non empty string");var E=l.getDeepObjectValue(_,h.attribute),A=h.comparator||function(F,M){return F===M},k=h.prettify||m&&m.prettify||l.prettify;if(!A(u,E,h,f,_))return l.format(b,{attribute:k(h.attribute)})}},url:function(u,h){if(l.isDefined(u)){h=l.extend({},this.options,h);var f=h.message||this.message||"is not a valid url",_=h.schemes||this.schemes||["http","https"],m=h.allowLocal||this.allowLocal||!1,b=h.allowDataUrl||this.allowDataUrl||!1;if(!l.isString(u))return f;var E="^(?:(?:"+_.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",A="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(m?A+="?":E+="(?!(?: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})",E+="(?:[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]+)*"+A+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",b){var k="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",F="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",M="data:(?:"+k+")?(?:;base64)?,"+F;E="(?:"+E+")|(?:^"+M+"$)"}var D=new RegExp(E,"i");if(!D.exec(u))return f}},type:l.extend(function(u,h,f,_,m){if(l.isString(h)&&(h={type:h}),!!l.isDefined(u)){var b=l.extend({},this.options,h),E=b.type;if(!l.isDefined(E))throw new Error("No type was specified");var A;if(l.isFunction(E)?A=E:A=this.types[E],!l.isFunction(A))throw new Error("validate.validators.type.types."+E+" must be a function.");if(!A(u,b,f,_,m)){var k=h.message||this.messages[E]||this.message||b.message||(l.isFunction(E)?"must be of the correct type":"must be of type %{type}");return l.isFunction(k)&&(k=k(u,h,f,_,m)),l.format(k,{attribute:l.prettify(f),type:E})}}},{types:{object:function(u){return l.isObject(u)&&!l.isArray(u)},array:l.isArray,integer:l.isInteger,number:l.isNumber,string:l.isString,date:l.isDate,boolean:l.isBoolean},messages:{}})},c.formatters={detailed:function(u){return u},flat:l.flattenErrorsToArray,grouped:function(u){var h;u=l.groupErrorsByAttribute(u);for(h in u)u[h]=l.flattenErrorsToArray(u[h]);return u},constraint:function(u){var h;u=l.groupErrorsByAttribute(u);for(h in u)u[h]=u[h].map(function(f){return f.validator}).sort();return u}},c.exposeModule(c,this,i,s,o)}).call(j4,e,t,null)}(Es,Es.exports)),Es.exports}var K4=X4();const Y4=q4(K4);function bc(t,e){return fetch(t,{body:JSON.stringify(e),cache:"no-cache",headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",mode:"cors"})}function J4(){return`
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,L){return E>L},greaterThanOrEqualTo:function(E,L){return E>=L},equalTo:function(E,L){return E===L},lessThan:function(E,L){return E<L},lessThanOrEqualTo:function(E,L){return E<=L},divisibleBy:function(E,L){return E%L===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
1384
  <style>
1385
1385
  *,
1386
1386
  *::before,
@@ -1736,10 +1736,10 @@ ${this.hideAttribution?"":`
1736
1736
  </legend>
1737
1737
 
1738
1738
  <div class='flow center'>
1739
- ${this.modes.length?this.modes.map(t=>`<label class='input-radio'>
1740
- <input type="radio" id="" name="mode" value="${Object.keys(t)[0]}">
1739
+ ${this.modes.length?this.modes.map(e=>`<label class='input-radio'>
1740
+ <input type="radio" id="" name="mode" value="${Object.keys(e)[0]}">
1741
1741
  <div class='otp-mode'>
1742
- ${Object.keys(t)[0].includes("sms")?`
1742
+ ${Object.keys(e)[0].includes("sms")?`
1743
1743
  <svg xmlns="http://www.w3.org/2000/svg" width="29" height="37" fill="none">
1744
1744
  <path stroke="#2F718D" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16.697 24.12c4.914 0 7.37 0 8.897-1.652 1.527-1.651 1.527-4.31 1.527-9.625 0-5.316 0-7.974-1.527-9.625-1.526-1.651-3.983-1.651-8.897-1.651h-5.211c-4.914 0-7.37 0-8.897 1.651-1.527 1.651-1.527 4.31-1.527 9.625 0 5.316 0 7.974 1.527 9.625.85.92 1.991 1.328 3.685 1.508"/>
1745
1745
  <g filter="url(#sms)">
@@ -1780,11 +1780,11 @@ ${this.hideAttribution?"":`
1780
1780
  `}
1781
1781
  <div class='flow'>
1782
1782
  <p>
1783
- ${Object.values(t)[0]}
1783
+ ${Object.values(e)[0]}
1784
1784
  </p>
1785
1785
  <p>
1786
1786
  <small>
1787
- An OTP will be sent by ${Object.keys(t)[0].includes("sms")?"sms":"email"} to verify your identity
1787
+ An OTP will be sent by ${Object.keys(e)[0].includes("sms")?"sms":"email"} to verify your identity
1788
1788
  </small>
1789
1789
  </p>
1790
1790
  </div>
@@ -1847,7 +1847,7 @@ ${this.hideAttribution?"":`
1847
1847
  </form>
1848
1848
  </div>
1849
1849
  </div>
1850
- `}class qu extends HTMLElement{constructor(){super(),this.templateString=J4.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.modes=[],this["otp-delivery-mode"]="",this.queryOtpModes=this.queryOtpModes.bind(this),this.selectOtpMode=this.selectOtpMode.bind(this),this.submitOtp=this.submitOtp.bind(this),this.switchContactMethod=this.switchContactMethod.bind(this),this.handleTotpConsentGrant=this.handleTotpConsentGrant.bind(this),this.handleTotpConsentContactMethodsOutdated=this.handleTotpConsentContactMethodsOutdated.bind(this),this.pages=[]}static get observedAttributes(){return["modes","otp-delivery-mode"]}attributeChangedCallback(e){switch(e){case"modes":case"otp-delivery-mode":{const i=document.createElement("template");i.innerHTML=this.render();const s=i.content.cloneNode(!0).querySelector(`#${this.activeScreen.id}`);s.hidden=!1,this.shadowRoot.replaceChild(s,this.activeScreen),this.setUpEventListeners(),this.setActiveScreen(s);break}}}setUpEventListeners(){this.idEntryScreen=this.shadowRoot.querySelector("#id-entry"),this.selectModeScreen=this.shadowRoot.querySelector("#select-mode"),this.otpVerificationScreen=this.shadowRoot.querySelector("#otp-verification"),this.activeScreen||(this.activeScreen=this.idEntryScreen),this.queryOtpModesButton=this.idEntryScreen.querySelector("#query-otp-modes"),this.backButton=this.idEntryScreen.querySelector("#back-button"),this.selectOtpModeButton=this.selectModeScreen.querySelector("#select-otp-mode"),this.entryBackbutton=this.selectModeScreen.querySelector("#back-to-entry-button"),this.contactMethodsOutdatedButton=this.selectModeScreen.querySelector("#contact-methods-outdated"),this.submitOtpButton=this.otpVerificationScreen.querySelector("#submit-otp"),this.switchContactMethodButton=this.otpVerificationScreen.querySelector(".try-another-method");const e=this.shadowRoot.querySelectorAll(".close-iframe");this.idNumberInput=this.idEntryScreen.querySelector("#id_number"),this.modeInputs=this.selectModeScreen.querySelectorAll('[name="mode"]'),this.otpInput=this.otpVerificationScreen.querySelector("#totp-token"),this.queryOtpModesButton.addEventListener("click",i=>this.queryOtpModes(i)),this.selectOtpModeButton.addEventListener("click",i=>this.selectOtpMode(i)),this.submitOtpButton.addEventListener("click",i=>this.submitOtp(i)),this.switchContactMethodButton.addEventListener("click",i=>this.switchContactMethod(i)),this.contactMethodsOutdatedButton.addEventListener("click",i=>this.handleTotpConsentContactMethodsOutdated(i)),this.entryBackbutton.addEventListener("click",()=>{this.handleBackClick()}),this.backButton.addEventListener("click",()=>{this.handleBackClick()}),e.forEach(i=>{i.addEventListener("click",()=>{this.closeWindow()},!1)})}closeWindow(){const e=window.parent;[e.parent,e].forEach(i=>{i.postMessage("SmileIdentity::Close","*")})}handleBackClick(){const e=this.pages.pop();e?this.setActiveScreen(e):this.dispatchEvent(new CustomEvent("end-user-consent.totp.cancelled",{}))}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.setUpEventListeners()}switchContactMethod(){this.queryOtpModes()}resetForm(){this.activeScreen.querySelectorAll("[aria-invalid]").forEach(s=>s.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(s=>s.remove())}handleIdNumberValidationErrors(e){Object.keys(e).forEach(s=>{const o=this.activeScreen.querySelector(`#${s}`);o.setAttribute("aria-invalid","true"),o.setAttribute("aria-describedby",`${s}-hint`);const c=document.createElement("div");c.setAttribute("id",`${s}-hint`),c.setAttribute("class","validation-message"),c.textContent=e[s][0],o.insertAdjacentElement("afterend",c)})}handleActiveScreenErrors(e){const i=this.activeScreen.querySelector('[type="submit"]'),s=document.createElement("div");s.setAttribute("class","validation-message"),s.textContent=e,i.insertAdjacentElement("beforebegin",s)}validateIdNumber(e){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},s=Y4({id_number:e},i);return s&&this.handleIdNumberValidationErrors(s),s}queryOtpModes(e){return q(this,null,function*(){e&&(e.preventDefault(),this.resetForm());const i=this.validateIdNumber(this.idNumberInput.value);if(localStorage.setItem("idNumber",this.idNumberInput.value||this.idNumber),!i){const s={country:this.country,id_number:this.idNumber,id_type:this.idType,partner_id:this.partnerId,token:this.token},o=`${this.baseUrl}/totp_consent`;try{this.toggleLoading();const c=yield bc(o,s),l=yield c.json();this.toggleLoading(),c.ok?(this.sessionId=l.session_id,this.modes=l.modes,this.setActiveScreen(this.selectModeScreen),this.setAttribute("modes",l.modes)):this.handleActiveScreenErrors(l.error)}catch(c){this.toggleLoading(),this.handleActiveScreenErrors(c.message)}}})}selectOtpMode(e){return q(this,null,function*(){e.preventDefault(),this.resetForm(),this.mode=Array.prototype.find.call(this.modeInputs,o=>o.checked).value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,mode:this.mode,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},s=`${this.baseUrl}/totp_consent/mode`;try{this.toggleLoading();const o=yield bc(s,i),c=yield o.json();this.toggleLoading(),o.ok?(this.selectedOtpDeliveryMode=this.modes.filter(l=>l[this.mode])[0][this.mode],this.setActiveScreen(this.otpVerificationScreen),this.setAttribute("otp-delivery-mode",this.selectedOtpDeliveryMode)):this.handleActiveScreenErrors(c.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}})}submitOtp(e){return q(this,null,function*(){e.preventDefault(),this.resetForm(),this.otp=this.otpInput.value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,otp:this.otp,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},s=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const o=yield bc(s,i),c=yield o.json();this.toggleLoading(),o.ok?this.handleTotpConsentGrant(e):this.handleActiveScreenErrors(c.error)}catch(o){this.toggleLoading(),this.handleActiveScreenErrors(o.message)}})}toggleLoading(){const e=this.activeScreen.querySelector('button[type="submit"]'),i=e.querySelector(".text"),s=e.querySelector("svg"),o=e.querySelector(".spinner");e.toggleAttribute("disabled"),i.toggleAttribute("hidden"),s.toggleAttribute("hidden"),o.toggleAttribute("hidden")}setActiveScreen(e){this.activeScreen.hidden=!0,e.hidden=!1,this.activeScreen=e}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get idNumber(){return localStorage.getItem("idNumber")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get token(){return this.getAttribute("token")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}handleTotpConsentGrant(){const e=new CustomEvent("end-user-consent.totp.granted",{detail:{consented:{contact_information:!0,document_information:!0,personal_details:!0},id_number:this.idNumber,session_id:this.sessionId}});this.dispatchEvent(e)}handleTotpConsentContactMethodsOutdated(){const e="end-user-consent.totp.denied.contact-methods-outdated",i=new CustomEvent(e,{detail:{data:{id_number:this.idNumber,session_id:this.sessionId},message:e}});this.dispatchEvent(i)}}"customElements"in window&&!window.customElements.get("totp-consent")&&window.customElements.define("totp-consent",qu);class Q4 extends HTMLElement{constructor(){super();const e=document.createElement("template");e.innerHTML=`
1850
+ `}class _a extends HTMLElement{constructor(){super(),this.templateString=mh.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.modes=[],this["otp-delivery-mode"]="",this.queryOtpModes=this.queryOtpModes.bind(this),this.selectOtpMode=this.selectOtpMode.bind(this),this.submitOtp=this.submitOtp.bind(this),this.switchContactMethod=this.switchContactMethod.bind(this),this.handleTotpConsentGrant=this.handleTotpConsentGrant.bind(this),this.handleTotpConsentContactMethodsOutdated=this.handleTotpConsentContactMethodsOutdated.bind(this),this.pages=[]}static get observedAttributes(){return["modes","otp-delivery-mode"]}attributeChangedCallback(t){switch(t){case"modes":case"otp-delivery-mode":{const i=document.createElement("template");i.innerHTML=this.render();const n=i.content.cloneNode(!0).querySelector(`#${this.activeScreen.id}`);n.hidden=!1,this.shadowRoot.replaceChild(n,this.activeScreen),this.setUpEventListeners(),this.setActiveScreen(n);break}}}setUpEventListeners(){this.idEntryScreen=this.shadowRoot.querySelector("#id-entry"),this.selectModeScreen=this.shadowRoot.querySelector("#select-mode"),this.otpVerificationScreen=this.shadowRoot.querySelector("#otp-verification"),this.activeScreen||(this.activeScreen=this.idEntryScreen),this.queryOtpModesButton=this.idEntryScreen.querySelector("#query-otp-modes"),this.backButton=this.idEntryScreen.querySelector("#back-button"),this.selectOtpModeButton=this.selectModeScreen.querySelector("#select-otp-mode"),this.entryBackbutton=this.selectModeScreen.querySelector("#back-to-entry-button"),this.contactMethodsOutdatedButton=this.selectModeScreen.querySelector("#contact-methods-outdated"),this.submitOtpButton=this.otpVerificationScreen.querySelector("#submit-otp"),this.switchContactMethodButton=this.otpVerificationScreen.querySelector(".try-another-method");const t=this.shadowRoot.querySelectorAll(".close-iframe");this.idNumberInput=this.idEntryScreen.querySelector("#id_number"),this.modeInputs=this.selectModeScreen.querySelectorAll('[name="mode"]'),this.otpInput=this.otpVerificationScreen.querySelector("#totp-token"),this.queryOtpModesButton.addEventListener("click",i=>this.queryOtpModes(i)),this.selectOtpModeButton.addEventListener("click",i=>this.selectOtpMode(i)),this.submitOtpButton.addEventListener("click",i=>this.submitOtp(i)),this.switchContactMethodButton.addEventListener("click",i=>this.switchContactMethod(i)),this.contactMethodsOutdatedButton.addEventListener("click",i=>this.handleTotpConsentContactMethodsOutdated(i)),this.entryBackbutton.addEventListener("click",()=>{this.handleBackClick()}),this.backButton.addEventListener("click",()=>{this.handleBackClick()}),t.forEach(i=>{i.addEventListener("click",()=>{this.closeWindow()},!1)})}closeWindow(){const t=window.parent;[t.parent,t].forEach(i=>{i.postMessage("SmileIdentity::Close","*")})}handleBackClick(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.totp.cancelled",{}))}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.setUpEventListeners()}switchContactMethod(){this.queryOtpModes()}resetForm(){this.activeScreen.querySelectorAll("[aria-invalid]").forEach(n=>n.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(n=>n.remove())}handleIdNumberValidationErrors(t){Object.keys(t).forEach(n=>{const r=this.activeScreen.querySelector(`#${n}`);r.setAttribute("aria-invalid","true"),r.setAttribute("aria-describedby",`${n}-hint`);const s=document.createElement("div");s.setAttribute("id",`${n}-hint`),s.setAttribute("class","validation-message"),s.textContent=t[n][0],r.insertAdjacentElement("afterend",s)})}handleActiveScreenErrors(t){const i=this.activeScreen.querySelector('[type="submit"]'),n=document.createElement("div");n.setAttribute("class","validation-message"),n.textContent=t,i.insertAdjacentElement("beforebegin",n)}validateIdNumber(t){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},n=fh({id_number:t},i);return n&&this.handleIdNumberValidationErrors(n),n}queryOtpModes(t){return M(this,null,function*(){t&&(t.preventDefault(),this.resetForm());const i=this.validateIdNumber(this.idNumberInput.value);if(localStorage.setItem("idNumber",this.idNumberInput.value||this.idNumber),!i){const n={country:this.country,id_number:this.idNumber,id_type:this.idType,partner_id:this.partnerId,token:this.token},r=`${this.baseUrl}/totp_consent`;try{this.toggleLoading();const s=yield Hr(r,n),o=yield s.json();this.toggleLoading(),s.ok?(this.sessionId=o.session_id,this.modes=o.modes,this.setActiveScreen(this.selectModeScreen),this.setAttribute("modes",o.modes)):this.handleActiveScreenErrors(o.error)}catch(s){this.toggleLoading(),this.handleActiveScreenErrors(s.message)}}})}selectOtpMode(t){return M(this,null,function*(){t.preventDefault(),this.resetForm(),this.mode=Array.prototype.find.call(this.modeInputs,r=>r.checked).value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,mode:this.mode,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},n=`${this.baseUrl}/totp_consent/mode`;try{this.toggleLoading();const r=yield Hr(n,i),s=yield r.json();this.toggleLoading(),r.ok?(this.selectedOtpDeliveryMode=this.modes.filter(o=>o[this.mode])[0][this.mode],this.setActiveScreen(this.otpVerificationScreen),this.setAttribute("otp-delivery-mode",this.selectedOtpDeliveryMode)):this.handleActiveScreenErrors(s.error)}catch(r){this.toggleLoading(),this.handleActiveScreenErrors(r.message)}})}submitOtp(t){return M(this,null,function*(){t.preventDefault(),this.resetForm(),this.otp=this.otpInput.value;const i={country:this.country,id_number:this.idNumber,id_type:this.idType,otp:this.otp,partner_id:this.partnerId,session_id:this.sessionId,token:this.token},n=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const r=yield Hr(n,i),s=yield r.json();this.toggleLoading(),r.ok?this.handleTotpConsentGrant(t):this.handleActiveScreenErrors(s.error)}catch(r){this.toggleLoading(),this.handleActiveScreenErrors(r.message)}})}toggleLoading(){const t=this.activeScreen.querySelector('button[type="submit"]'),i=t.querySelector(".text"),n=t.querySelector("svg"),r=t.querySelector(".spinner");t.toggleAttribute("disabled"),i.toggleAttribute("hidden"),n.toggleAttribute("hidden"),r.toggleAttribute("hidden")}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get idNumber(){return localStorage.getItem("idNumber")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get token(){return this.getAttribute("token")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}handleTotpConsentGrant(){const t=new CustomEvent("end-user-consent.totp.granted",{detail:{consented:{contact_information:!0,document_information:!0,personal_details:!0},id_number:this.idNumber,session_id:this.sessionId}});this.dispatchEvent(t)}handleTotpConsentContactMethodsOutdated(){const t="end-user-consent.totp.denied.contact-methods-outdated",i=new CustomEvent(t,{detail:{data:{id_number:this.idNumber,session_id:this.sessionId},message:t}});this.dispatchEvent(i)}}"customElements"in window&&!window.customElements.get("totp-consent")&&window.customElements.define("totp-consent",_a);class gh extends HTMLElement{constructor(){super();const t=document.createElement("template");t.innerHTML=`
1851
1851
  <p style='margin-inline: auto; max-inline-size: 10rem'>
1852
1852
  <svg viewBox="0 0 90 9" fill="none" xmlns="http://www.w3.org/2000/svg">
1853
1853
  <path d="M0.544 7V1.4H2.616C3.064 1.4 3.43467 1.47467 3.728 1.624C4.02133 1.77333 4.24 1.97867 4.384 2.24C4.528 2.50133 4.6 2.79467 4.6 3.12C4.6 3.42933 4.53067 3.71467 4.392 3.976C4.25333 4.232 4.03733 4.44 3.744 4.6C3.45067 4.75467 3.07467 4.832 2.616 4.832H1.568V7H0.544ZM1.568 4H2.552C2.90933 4 3.16533 3.92267 3.32 3.768C3.48 3.608 3.56 3.392 3.56 3.12C3.56 2.84267 3.48 2.62667 3.32 2.472C3.16533 2.312 2.90933 2.232 2.552 2.232H1.568V4ZM7.08025 7.096C6.69625 7.096 6.34958 7.008 6.04025 6.832C5.73625 6.656 5.49358 6.41333 5.31225 6.104C5.13625 5.78933 5.04825 5.42667 5.04825 5.016C5.04825 4.60533 5.13892 4.24533 5.32025 3.936C5.50158 3.62133 5.74425 3.376 6.04825 3.2C6.35758 3.024 6.70425 2.936 7.08825 2.936C7.46692 2.936 7.80825 3.024 8.11225 3.2C8.42158 3.376 8.66425 3.62133 8.84025 3.936C9.02158 4.24533 9.11225 4.60533 9.11225 5.016C9.11225 5.42667 9.02158 5.78933 8.84025 6.104C8.66425 6.41333 8.42158 6.656 8.11225 6.832C7.80292 7.008 7.45892 7.096 7.08025 7.096ZM7.08025 6.208C7.34692 6.208 7.57892 6.10933 7.77625 5.912C7.97358 5.70933 8.07225 5.41067 8.07225 5.016C8.07225 4.62133 7.97358 4.32533 7.77625 4.128C7.57892 3.92533 7.34958 3.824 7.08825 3.824C6.81625 3.824 6.58158 3.92533 6.38425 4.128C6.19225 4.32533 6.09625 4.62133 6.09625 5.016C6.09625 5.41067 6.19225 5.70933 6.38425 5.912C6.58158 6.10933 6.81358 6.208 7.08025 6.208ZM10.6632 7L9.50319 3.032H10.5192L11.2072 5.888L12.0072 3.032H13.1432L13.9432 5.888L14.6392 3.032H15.6552L14.4872 7H13.4232L12.5752 4.032L11.7272 7H10.6632ZM18.0886 7.096C17.6886 7.096 17.334 7.01067 17.0246 6.84C16.7153 6.66933 16.4726 6.42933 16.2966 6.12C16.1206 5.81067 16.0326 5.45333 16.0326 5.048C16.0326 4.63733 16.118 4.272 16.2886 3.952C16.4646 3.632 16.7046 3.384 17.0086 3.208C17.318 3.02667 17.6806 2.936 18.0966 2.936C18.486 2.936 18.83 3.02133 19.1286 3.192C19.4273 3.36267 19.6593 3.59733 19.8246 3.896C19.9953 4.18933 20.0806 4.51733 20.0806 4.88C20.0806 4.93867 20.078 5 20.0726 5.064C20.0726 5.128 20.07 5.19467 20.0646 5.264H17.0486C17.07 5.57333 17.1766 5.816 17.3686 5.992C17.566 6.168 17.8033 6.256 18.0806 6.256C18.2886 6.256 18.462 6.21067 18.6006 6.12C18.7446 6.024 18.8513 5.90133 18.9206 5.752H19.9606C19.886 6.00267 19.7606 6.232 19.5846 6.44C19.414 6.64267 19.2006 6.80267 18.9446 6.92C18.694 7.03733 18.4086 7.096 18.0886 7.096ZM18.0966 3.768C17.846 3.768 17.6246 3.84 17.4326 3.984C17.2406 4.12267 17.118 4.336 17.0646 4.624H19.0406C19.0246 4.36267 18.9286 4.15467 18.7526 4C18.5766 3.84533 18.358 3.768 18.0966 3.768ZM20.9419 7V3.032H21.8539L21.9499 3.776C22.0939 3.52 22.2885 3.31733 22.5339 3.168C22.7845 3.01333 23.0779 2.936 23.4139 2.936V4.016H23.1259C22.9019 4.016 22.7019 4.05067 22.5259 4.12C22.3499 4.18933 22.2112 4.30933 22.1099 4.48C22.0139 4.65067 21.9659 4.888 21.9659 5.192V7H20.9419ZM25.9714 7.096C25.5714 7.096 25.2168 7.01067 24.9074 6.84C24.5981 6.66933 24.3554 6.42933 24.1794 6.12C24.0034 5.81067 23.9154 5.45333 23.9154 5.048C23.9154 4.63733 24.0008 4.272 24.1714 3.952C24.3474 3.632 24.5874 3.384 24.8914 3.208C25.2008 3.02667 25.5634 2.936 25.9794 2.936C26.3688 2.936 26.7128 3.02133 27.0114 3.192C27.3101 3.36267 27.5421 3.59733 27.7074 3.896C27.8781 4.18933 27.9634 4.51733 27.9634 4.88C27.9634 4.93867 27.9608 5 27.9554 5.064C27.9554 5.128 27.9528 5.19467 27.9474 5.264H24.9314C24.9528 5.57333 25.0594 5.816 25.2514 5.992C25.4488 6.168 25.6861 6.256 25.9634 6.256C26.1714 6.256 26.3448 6.21067 26.4834 6.12C26.6274 6.024 26.7341 5.90133 26.8034 5.752H27.8434C27.7688 6.00267 27.6434 6.232 27.4674 6.44C27.2968 6.64267 27.0834 6.80267 26.8274 6.92C26.5768 7.03733 26.2914 7.096 25.9714 7.096ZM25.9794 3.768C25.7288 3.768 25.5074 3.84 25.3154 3.984C25.1234 4.12267 25.0008 4.336 24.9474 4.624H26.9234C26.9074 4.36267 26.8114 4.15467 26.6354 4C26.4594 3.84533 26.2408 3.768 25.9794 3.768ZM30.6487 7.096C30.2754 7.096 29.942 7.00533 29.6487 6.824C29.3554 6.64267 29.1234 6.39467 28.9527 6.08C28.782 5.76533 28.6967 5.408 28.6967 5.008C28.6967 4.608 28.782 4.25333 28.9527 3.944C29.1234 3.62933 29.3554 3.384 29.6487 3.208C29.942 3.02667 30.2754 2.936 30.6487 2.936C30.9474 2.936 31.2087 2.992 31.4327 3.104C31.6567 3.216 31.838 3.37333 31.9767 3.576V1.24H33.0007V7H32.0887L31.9767 6.432C31.8487 6.608 31.678 6.76267 31.4647 6.896C31.2567 7.02933 30.9847 7.096 30.6487 7.096ZM30.8647 6.2C31.1954 6.2 31.4647 6.09067 31.6727 5.872C31.886 5.648 31.9927 5.36267 31.9927 5.016C31.9927 4.66933 31.886 4.38667 31.6727 4.168C31.4647 3.944 31.1954 3.832 30.8647 3.832C30.5394 3.832 30.27 3.94133 30.0567 4.16C29.8434 4.37867 29.7367 4.66133 29.7367 5.008C29.7367 5.35467 29.8434 5.64 30.0567 5.864C30.27 6.088 30.5394 6.2 30.8647 6.2ZM38.3017 7.096C38.003 7.096 37.7417 7.04 37.5177 6.928C37.2937 6.816 37.1124 6.65867 36.9737 6.456L36.8617 7H35.9497V1.24H36.9737V3.6C37.1017 3.424 37.2697 3.26933 37.4777 3.136C37.691 3.00267 37.9657 2.936 38.3017 2.936C38.675 2.936 39.0084 3.02667 39.3017 3.208C39.595 3.38933 39.827 3.63733 39.9977 3.952C40.1684 4.26667 40.2537 4.624 40.2537 5.024C40.2537 5.424 40.1684 5.78133 39.9977 6.096C39.827 6.40533 39.595 6.65067 39.3017 6.832C39.0084 7.008 38.675 7.096 38.3017 7.096ZM38.0857 6.2C38.411 6.2 38.6804 6.09067 38.8937 5.872C39.107 5.65333 39.2137 5.37067 39.2137 5.024C39.2137 4.67733 39.107 4.392 38.8937 4.168C38.6804 3.944 38.411 3.832 38.0857 3.832C37.755 3.832 37.483 3.944 37.2697 4.168C37.0617 4.38667 36.9577 4.66933 36.9577 5.016C36.9577 5.36267 37.0617 5.648 37.2697 5.872C37.483 6.09067 37.755 6.2 38.0857 6.2ZM41.3051 8.76L42.2251 6.736H41.9851L40.4411 3.032H41.5531L42.6651 5.824L43.8251 3.032H44.9131L42.3931 8.76H41.3051Z" fill="#001096"/>
@@ -1869,7 +1869,7 @@ ${this.hideAttribution?"":`
1869
1869
  </defs>
1870
1870
  </svg>
1871
1871
  </p>
1872
- `,this.attachShadow({mode:"open"}).appendChild(e.content.cloneNode(!0))}}window.customElements&&!window.customElements.get("powered-by-smile-id")&&window.customElements.define("powered-by-smile-id",Q4);function t5(){return`
1872
+ `,this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}}window.customElements&&!window.customElements.get("powered-by-smile-id")&&window.customElements.define("powered-by-smile-id",gh);function vh(){return`
1873
1873
  <style>
1874
1874
  *,
1875
1875
  *::before,
@@ -2181,7 +2181,7 @@ ${this.hideAttribution?"":`
2181
2181
  color: var(--color-danger);
2182
2182
  }
2183
2183
  </style>
2184
- ${Ai(this.themeColor)}
2184
+ ${st(this.themeColor)}
2185
2185
  <div id='consent-screen'>
2186
2186
  <section class='flow center'>
2187
2187
  <div class="nav ${this.hideBack?"justify-right":""}">
@@ -2446,7 +2446,7 @@ ${this.hideAttribution?"":`
2446
2446
 
2447
2447
  ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
2448
2448
  </div>
2449
- `}class ju extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=t5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.consentScreen=this.shadowRoot.querySelector("#consent-screen"),this.totpConsentApp=this.shadowRoot.querySelector("totp-consent"),this.consentRejectedScreen=this.shadowRoot.querySelector("#consent-rejected-screen"),this.allowButton=this.shadowRoot.querySelector("#allow"),this.rejectButton=this.shadowRoot.querySelector("#cancel"),this.backToConsentButton=this.shadowRoot.querySelector("#back-to-consent"),this.confirmConsentRejectionButton=this.shadowRoot.querySelector("#confirm-consent-rejection"),this.backButton=this.shadowRoot.querySelector("#back-button");const i=this.shadowRoot.querySelectorAll(".close-iframe");this.allowButton.addEventListener("click",s=>this.handleConsentGrant(s)),this.rejectButton.addEventListener("click",s=>this.handleConsentGrant(s)),this.backToConsentButton.addEventListener("click",()=>this.setActiveScreen(this.consentScreen)),this.confirmConsentRejectionButton.addEventListener("click",s=>this.handleConsentRejection(s)),this.totpConsentApp.addEventListener("end-user-consent.totp.denied.contact-methods-outdated",s=>this.handleTotpConsentEvents(s)),this.totpConsentApp.addEventListener("end-user-consent.totp.granted",s=>this.handleTotpConsentEvents(s)),this.totpConsentApp.addEventListener("end-user-consent.totp.cancelled",s=>this.handleBackEvents(s)),this.backButton.addEventListener("click",s=>{this.handleBackEvents(s)}),i.forEach(s=>{s.addEventListener("click",()=>{this.closeWindow()},!1)}),this.activeScreen=this.consentScreen}setActiveScreen(e){this.activeScreen.hidden=!0,e.hidden=!1,this.activeScreen=e}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get demoMode(){return!!this.hasAttribute("demo-mode")}get hideBack(){return this.hasAttribute("hide-back-to-host")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get partnerLogoURL(){return this.getAttribute("partner-logo")}get partnerPolicyURL(){return this.getAttribute("policy-url")}get themeColor(){return this.getAttribute("theme-color")||"#151F72"}get token(){return this.getAttribute("token")}handleConsentGrant(e){const i=e.target===this.allowButton;i?this.idRequiresTotpConsent.includes(this.idType)?(this.setActiveScreen(this.totpConsentApp),this.pages.push(this.consentScreen)):this.dispatchEvent(new CustomEvent("end-user-consent.granted",{detail:{consented:{contact_information:i,document_information:i,personal_details:i}}})):this.setActiveScreen(this.consentRejectedScreen)}handleConsentRejection(){this.dispatchEvent(new CustomEvent("end-user-consent.denied"))}handleTotpConsentEvents(e){const i=new CustomEvent(e.type,{detail:Fe({},e.detail)});this.dispatchEvent(i)}handleBackEvents(){const e=this.pages.pop();e?this.setActiveScreen(e):this.dispatchEvent(new CustomEvent("end-user-consent.cancelled"))}closeWindow(){window.parent.postMessage("SmileIdentity::Close","*")}}"customElements"in window&&!window.customElements.get("end-user-consent")&&window.customElements.define("end-user-consent",ju);function e5(){return`
2449
+ `}class Ca extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=vh.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.consentScreen=this.shadowRoot.querySelector("#consent-screen"),this.totpConsentApp=this.shadowRoot.querySelector("totp-consent"),this.consentRejectedScreen=this.shadowRoot.querySelector("#consent-rejected-screen"),this.allowButton=this.shadowRoot.querySelector("#allow"),this.rejectButton=this.shadowRoot.querySelector("#cancel"),this.backToConsentButton=this.shadowRoot.querySelector("#back-to-consent"),this.confirmConsentRejectionButton=this.shadowRoot.querySelector("#confirm-consent-rejection"),this.backButton=this.shadowRoot.querySelector("#back-button");const i=this.shadowRoot.querySelectorAll(".close-iframe");this.allowButton.addEventListener("click",n=>this.handleConsentGrant(n)),this.rejectButton.addEventListener("click",n=>this.handleConsentGrant(n)),this.backToConsentButton.addEventListener("click",()=>this.setActiveScreen(this.consentScreen)),this.confirmConsentRejectionButton.addEventListener("click",n=>this.handleConsentRejection(n)),this.totpConsentApp.addEventListener("end-user-consent.totp.denied.contact-methods-outdated",n=>this.handleTotpConsentEvents(n)),this.totpConsentApp.addEventListener("end-user-consent.totp.granted",n=>this.handleTotpConsentEvents(n)),this.totpConsentApp.addEventListener("end-user-consent.totp.cancelled",n=>this.handleBackEvents(n)),this.backButton.addEventListener("click",n=>{this.handleBackEvents(n)}),i.forEach(n=>{n.addEventListener("click",()=>{this.closeWindow()},!1)}),this.activeScreen=this.consentScreen}setActiveScreen(t){this.activeScreen.hidden=!0,t.hidden=!1,this.activeScreen=t}get baseUrl(){return this.getAttribute("base-url")}get country(){return this.getAttribute("country")}get demoMode(){return!!this.hasAttribute("demo-mode")}get hideBack(){return this.hasAttribute("hide-back-to-host")}get idHint(){return this.getAttribute("id-hint")||"Your BVN should be 11 digits long"}get hideAttribution(){return this.hasAttribute("hide-attribution")}get idRegex(){return this.getAttribute("id-regex")}get idType(){return this.getAttribute("id-type")}get idTypeLabel(){return this.getAttribute("id-type-label")}get partnerId(){return this.getAttribute("partner-id")}get partnerName(){return this.getAttribute("partner-name")}get partnerLogoURL(){return this.getAttribute("partner-logo")}get partnerPolicyURL(){return this.getAttribute("policy-url")}get themeColor(){return this.getAttribute("theme-color")||"#151F72"}get token(){return this.getAttribute("token")}handleConsentGrant(t){const i=t.target===this.allowButton;i?this.idRequiresTotpConsent.includes(this.idType)?(this.setActiveScreen(this.totpConsentApp),this.pages.push(this.consentScreen)):this.dispatchEvent(new CustomEvent("end-user-consent.granted",{detail:{consented:{contact_information:i,document_information:i,personal_details:i}}})):this.setActiveScreen(this.consentRejectedScreen)}handleConsentRejection(){this.dispatchEvent(new CustomEvent("end-user-consent.denied"))}handleTotpConsentEvents(t){const i=new CustomEvent(t.type,{detail:Fe({},t.detail)});this.dispatchEvent(i)}handleBackEvents(){const t=this.pages.pop();t?this.setActiveScreen(t):this.dispatchEvent(new CustomEvent("end-user-consent.cancelled"))}closeWindow(){window.parent.postMessage("SmileIdentity::Close","*")}}"customElements"in window&&!window.customElements.get("end-user-consent")&&window.customElements.define("end-user-consent",Ca);function bh(){return`
2450
2450
  <link rel="preconnect" href="https://fonts.gstatic.com" />
2451
2451
  <link
2452
2452
  href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap"
@@ -2782,7 +2782,7 @@ ${this.hideAttribution?"":`
2782
2782
  text-align: justify;
2783
2783
  }
2784
2784
  </style>
2785
- ${Ai(this.themeColor)}
2785
+ ${st(this.themeColor)}
2786
2786
  <div id="selfie-capture-instruction-screen" class="center">
2787
2787
  <div class="content-root">
2788
2788
  <div class="content-header">
@@ -3042,7 +3042,7 @@ ${this.hideAttribution?"":`
3042
3042
  </div>
3043
3043
  </div>
3044
3044
  </div>
3045
- `}class i5 extends HTMLElement{constructor(){super(),this.templateString=e5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.allowButton=this.shadowRoot.querySelector("#allow"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.allowButton&&this.allowButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-instructions.capture"))}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()},!1)}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.cancelled"))}get showNavigation(){return this.hasAttribute("show-navigation")}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.close"))}static get observedAttributes(){return["show-navigation"]}}"customElements"in window&&!window.customElements.get("selfie-capture-instructions")&&window.customElements.define("selfie-capture-instructions",i5);function n5(){return`
3045
+ `}class wh extends HTMLElement{constructor(){super(),this.templateString=bh.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){this.pages=[];const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.allowButton=this.shadowRoot.querySelector("#allow"),this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.allowButton&&this.allowButton.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("selfie-capture-instructions.capture"))}),this.navigation.addEventListener("navigation.close",()=>{this.handleCloseEvents()},!1)}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}handleBackEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.cancelled"))}get showNavigation(){return this.hasAttribute("show-navigation")}handleCloseEvents(){this.dispatchEvent(new CustomEvent("selfie-capture-instructions.close"))}static get observedAttributes(){return["show-navigation"]}}"customElements"in window&&!window.customElements.get("selfie-capture-instructions")&&window.customElements.define("selfie-capture-instructions",wh);function yh(){return`
3046
3046
  <style>
3047
3047
  .retake-photo.button[data-variant~="ghost"] {
3048
3048
  color: #FF5805;
@@ -3094,7 +3094,7 @@ ${this.hideAttribution?"":`
3094
3094
  margin-top: 0;
3095
3095
  }
3096
3096
  </style>
3097
- ${Ai(this.themeColor)}
3097
+ ${st(this.themeColor)}
3098
3098
  <div id='selfie-capture-review-screen' class='center'>
3099
3099
  <smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
3100
3100
  <h1 class="header-title title-color font-bold">
@@ -3123,62 +3123,36 @@ ${this.hideAttribution?"":`
3123
3123
  `}
3124
3124
  </div>
3125
3125
  </div>
3126
- `}class r5 extends HTMLElement{constructor(){super(),this.templateString=n5.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"})}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.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(e){switch(e){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",r5);var As,wt,Xu,Ku,Jn,Yu,Ju,Qu,t2,yc,Cc,xc,Ss={},e2=[],s5=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ks=Array.isArray;function Oi(t,e){for(var i in e)t[i]=e[i];return t}function Ec(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Qi(t,e,i){var s,o,c,l={};for(c in e)c=="key"?s=e[c]:c=="ref"?o=e[c]:l[c]=e[c];if(arguments.length>2&&(l.children=arguments.length>3?As.call(arguments,2):i),typeof t=="function"&&t.defaultProps!=null)for(c in t.defaultProps)l[c]===void 0&&(l[c]=t.defaultProps[c]);return Ls(t,l,s,o,null)}function Ls(t,e,i,s,o){var c={type:t,props:e,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o==null?++Xu:o,__i:-1,__u:0};return o==null&&wt.vnode!=null&&wt.vnode(c),c}function xn(t){return t.children}function Ms(t,e){this.props=t,this.context=e}function kr(t,e){if(e==null)return t.__?kr(t.__,t.__i+1):null;for(var i;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null)return i.__e;return typeof t.type=="function"?kr(t):null}function i2(t){var e,i;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((i=t.__k[e])!=null&&i.__e!=null){t.__e=t.__c.base=i.__e;break}return i2(t)}}function n2(t){(!t.__d&&(t.__d=!0)&&Jn.push(t)&&!Co.__r++||Yu!=wt.debounceRendering)&&((Yu=wt.debounceRendering)||Ju)(Co)}function Co(){for(var t,e,i,s,o,c,l,u=1;Jn.length;)Jn.length>u&&Jn.sort(Qu),t=Jn.shift(),u=Jn.length,t.__d&&(i=void 0,o=(s=(e=t).__v).__e,c=[],l=[],e.__P&&((i=Oi({},s)).__v=s.__v+1,wt.vnode&&wt.vnode(i),Ac(e.__P,i,s,e.__n,e.__P.namespaceURI,32&s.__u?[o]:null,c,o==null?kr(s):o,!!(32&s.__u),l),i.__v=s.__v,i.__.__k[i.__i]=i,l2(c,i,l),i.__e!=o&&i2(i)));Co.__r=0}function r2(t,e,i,s,o,c,l,u,h,f,_){var m,b,E,A,k,F,M=s&&s.__k||e2,D=e.length;for(h=o5(i,e,M,h,D),m=0;m<D;m++)(E=i.__k[m])!=null&&(b=E.__i==-1?Ss:M[E.__i]||Ss,E.__i=m,F=Ac(t,E,b,o,c,l,u,h,f,_),A=E.__e,E.ref&&b.ref!=E.ref&&(b.ref&&Sc(b.ref,null,E),_.push(E.ref,E.__c||A,E)),k==null&&A!=null&&(k=A),4&E.__u||b.__k===E.__k?h=s2(E,h,t):typeof E.type=="function"&&F!==void 0?h=F:A&&(h=A.nextSibling),E.__u&=-7);return i.__e=k,h}function o5(t,e,i,s,o){var c,l,u,h,f,_=i.length,m=_,b=0;for(t.__k=new Array(o),c=0;c<o;c++)(l=e[c])!=null&&typeof l!="boolean"&&typeof l!="function"?(h=c+b,(l=t.__k[c]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?Ls(null,l,null,null,null):ks(l)?Ls(xn,{children:l},null,null,null):l.constructor==null&&l.__b>0?Ls(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=t,l.__b=t.__b+1,u=null,(f=l.__i=a5(l,i,h,m))!=-1&&(m--,(u=i[f])&&(u.__u|=2)),u==null||u.__v==null?(f==-1&&(o>_?b--:o<_&&b++),typeof l.type!="function"&&(l.__u|=4)):f!=h&&(f==h-1?b--:f==h+1?b++:(f>h?b--:b++,l.__u|=4))):t.__k[c]=null;if(m)for(c=0;c<_;c++)(u=i[c])!=null&&(2&u.__u)==0&&(u.__e==s&&(s=kr(u)),h2(u,u));return s}function s2(t,e,i){var s,o;if(typeof t.type=="function"){for(s=t.__k,o=0;s&&o<s.length;o++)s[o]&&(s[o].__=t,e=s2(s[o],e,i));return e}t.__e!=e&&(e&&t.type&&!i.contains(e)&&(e=kr(t)),i.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function o2(t,e){return e=e||[],t==null||typeof t=="boolean"||(ks(t)?t.some(function(i){o2(i,e)}):e.push(t)),e}function a5(t,e,i,s){var o,c,l=t.key,u=t.type,h=e[i];if(h===null&&t.key==null||h&&l==h.key&&u==h.type&&(2&h.__u)==0)return i;if(s>(h!=null&&(2&h.__u)==0?1:0))for(o=i-1,c=i+1;o>=0||c<e.length;){if(o>=0){if((h=e[o])&&(2&h.__u)==0&&l==h.key&&u==h.type)return o;o--}if(c<e.length){if((h=e[c])&&(2&h.__u)==0&&l==h.key&&u==h.type)return c;c++}}return-1}function a2(t,e,i){e[0]=="-"?t.setProperty(e,i==null?"":i):t[e]=i==null?"":typeof i!="number"||s5.test(e)?i:i+"px"}function xo(t,e,i,s,o){var c,l;t:if(e=="style")if(typeof i=="string")t.style.cssText=i;else{if(typeof s=="string"&&(t.style.cssText=s=""),s)for(e in s)i&&e in i||a2(t.style,e,"");if(i)for(e in i)s&&i[e]==s[e]||a2(t.style,e,i[e])}else if(e[0]=="o"&&e[1]=="n")c=e!=(e=e.replace(t2,"$1")),l=e.toLowerCase(),e=l in t||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+c]=i,i?s?i.u=s.u:(i.u=yc,t.addEventListener(e,c?xc:Cc,c)):t.removeEventListener(e,c?xc:Cc,c);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=i==null?"":i;break t}catch(u){}typeof i=="function"||(i==null||i===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&i==1?"":i))}}function c2(t){return function(e){if(this.l){var i=this.l[e.type+t];if(e.t==null)e.t=yc++;else if(e.t<i.u)return;return i(wt.event?wt.event(e):e)}}}function Ac(t,e,i,s,o,c,l,u,h,f){var _,m,b,E,A,k,F,M,D,R,$,X,N,vt,J,pt,kt,Zt=e.type;if(e.constructor!=null)return null;128&i.__u&&(h=!!(32&i.__u),c=[u=e.__e=i.__e]),(_=wt.__b)&&_(e);t:if(typeof Zt=="function")try{if(M=e.props,D="prototype"in Zt&&Zt.prototype.render,R=(_=Zt.contextType)&&s[_.__c],$=_?R?R.props.value:_.__:s,i.__c?F=(m=e.__c=i.__c).__=m.__E:(D?e.__c=m=new Zt(M,$):(e.__c=m=new Ms(M,$),m.constructor=Zt,m.render=l5),R&&R.sub(m),m.props=M,m.state||(m.state={}),m.context=$,m.__n=s,b=m.__d=!0,m.__h=[],m._sb=[]),D&&m.__s==null&&(m.__s=m.state),D&&Zt.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=Oi({},m.__s)),Oi(m.__s,Zt.getDerivedStateFromProps(M,m.__s))),E=m.props,A=m.state,m.__v=e,b)D&&Zt.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),D&&m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(D&&Zt.getDerivedStateFromProps==null&&M!==E&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(M,$),!m.__e&&m.shouldComponentUpdate!=null&&m.shouldComponentUpdate(M,m.__s,$)===!1||e.__v==i.__v){for(e.__v!=i.__v&&(m.props=M,m.state=m.__s,m.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(ne){ne&&(ne.__=e)}),X=0;X<m._sb.length;X++)m.__h.push(m._sb[X]);m._sb=[],m.__h.length&&l.push(m);break t}m.componentWillUpdate!=null&&m.componentWillUpdate(M,m.__s,$),D&&m.componentDidUpdate!=null&&m.__h.push(function(){m.componentDidUpdate(E,A,k)})}if(m.context=$,m.props=M,m.__P=t,m.__e=!1,N=wt.__r,vt=0,D){for(m.state=m.__s,m.__d=!1,N&&N(e),_=m.render(m.props,m.state,m.context),J=0;J<m._sb.length;J++)m.__h.push(m._sb[J]);m._sb=[]}else do m.__d=!1,N&&N(e),_=m.render(m.props,m.state,m.context),m.state=m.__s;while(m.__d&&++vt<25);m.state=m.__s,m.getChildContext!=null&&(s=Oi(Oi({},s),m.getChildContext())),D&&!b&&m.getSnapshotBeforeUpdate!=null&&(k=m.getSnapshotBeforeUpdate(E,A)),pt=_,_!=null&&_.type===xn&&_.key==null&&(pt=u2(_.props.children)),u=r2(t,ks(pt)?pt:[pt],e,i,s,o,c,l,u,h,f),m.base=e.__e,e.__u&=-161,m.__h.length&&l.push(m),F&&(m.__E=m.__=null)}catch(ne){if(e.__v=null,h||c!=null)if(ne.then){for(e.__u|=h?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;c[c.indexOf(u)]=null,e.__e=u}else for(kt=c.length;kt--;)Ec(c[kt]);else e.__e=i.__e,e.__k=i.__k;wt.__e(ne,e,i)}else c==null&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):u=e.__e=c5(i.__e,e,i,s,o,c,l,h,f);return(_=wt.diffed)&&_(e),128&e.__u?void 0:u}function l2(t,e,i){for(var s=0;s<i.length;s++)Sc(i[s],i[++s],i[++s]);wt.__c&&wt.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(c){c.call(o)})}catch(c){wt.__e(c,o.__v)}})}function u2(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:ks(t)?t.map(u2):Oi({},t)}function c5(t,e,i,s,o,c,l,u,h){var f,_,m,b,E,A,k,F=i.props,M=e.props,D=e.type;if(D=="svg"?o="http://www.w3.org/2000/svg":D=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),c!=null){for(f=0;f<c.length;f++)if((E=c[f])&&"setAttribute"in E==!!D&&(D?E.localName==D:E.nodeType==3)){t=E,c[f]=null;break}}if(t==null){if(D==null)return document.createTextNode(M);t=document.createElementNS(o,D,M.is&&M),u&&(wt.__m&&wt.__m(e,c),u=!1),c=null}if(D==null)F===M||u&&t.data==M||(t.data=M);else{if(c=c&&As.call(t.childNodes),F=i.props||Ss,!u&&c!=null)for(F={},f=0;f<t.attributes.length;f++)F[(E=t.attributes[f]).name]=E.value;for(f in F)if(E=F[f],f!="children"){if(f=="dangerouslySetInnerHTML")m=E;else if(!(f in M)){if(f=="value"&&"defaultValue"in M||f=="checked"&&"defaultChecked"in M)continue;xo(t,f,null,E,o)}}for(f in M)E=M[f],f=="children"?b=E:f=="dangerouslySetInnerHTML"?_=E:f=="value"?A=E:f=="checked"?k=E:u&&typeof E!="function"||F[f]===E||xo(t,f,E,F[f],o);if(_)u||m&&(_.__html==m.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),e.__k=[];else if(m&&(t.innerHTML=""),r2(e.type=="template"?t.content:t,ks(b)?b:[b],e,i,s,D=="foreignObject"?"http://www.w3.org/1999/xhtml":o,c,l,c?c[0]:i.__k&&kr(i,0),u,h),c!=null)for(f=c.length;f--;)Ec(c[f]);u||(f="value",D=="progress"&&A==null?t.removeAttribute("value"):A!=null&&(A!==t[f]||D=="progress"&&!A||D=="option"&&A!=F[f])&&xo(t,f,A,F[f],o),f="checked",k!=null&&k!=t[f]&&xo(t,f,k,F[f],o))}return t}function Sc(t,e,i){try{if(typeof t=="function"){var s=typeof t.__u=="function";s&&t.__u(),s&&e==null||(t.__u=t(e))}else t.current=e}catch(o){wt.__e(o,i)}}function h2(t,e,i){var s,o;if(wt.unmount&&wt.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||Sc(s,null,e)),(s=t.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(c){wt.__e(c,e)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&h2(s[o],e,i||typeof t.type!="function");i||Ec(t.__e),t.__c=t.__=t.__e=void 0}function l5(t,e,i){return this.constructor(t,i)}function Eo(t,e,i){var s,o,c,l;e==document&&(e=document.documentElement),wt.__&&wt.__(t,e),o=(s=typeof i=="function")?null:i&&i.__k||e.__k,c=[],l=[],Ac(e,t=(!s&&i||e).__k=Qi(xn,null,[t]),o||Ss,Ss,e.namespaceURI,!s&&i?[i]:o?null:e.firstChild?As.call(e.childNodes):null,c,!s&&i?i:o?o.__e:e.firstChild,s,l),l2(c,t,l)}function d2(t,e){Eo(t,e,d2)}function f2(t,e,i){var s,o,c,l,u=Oi({},t.props);for(c in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)c=="key"?s=e[c]:c=="ref"?o=e[c]:u[c]=e[c]===void 0&&l!=null?l[c]:e[c];return arguments.length>2&&(u.children=arguments.length>3?As.call(arguments,2):i),Ls(t.type,u,s||t.key,o||t.ref,null)}As=e2.slice,wt={__e:function(t,e,i,s){for(var o,c,l;e=e.__;)if((o=e.__c)&&!o.__)try{if((c=o.constructor)&&c.getDerivedStateFromError!=null&&(o.setState(c.getDerivedStateFromError(t)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,s||{}),l=o.__d),l)return o.__E=o}catch(u){t=u}throw t}},Xu=0,Ku=function(t){return t!=null&&t.constructor==null},Ms.prototype.setState=function(t,e){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Oi({},this.state),typeof t=="function"&&(t=t(Oi({},i),this.props)),t&&Oi(i,t),t!=null&&this.__v&&(e&&this._sb.push(e),n2(this))},Ms.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),n2(this))},Ms.prototype.render=xn,Jn=[],Ju=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qu=function(t,e){return t.__v.__b-e.__v.__b},Co.__r=0,t2=/(PointerCapture)$|Capture$/i,yc=0,Cc=c2(!1),xc=c2(!0);var u5=0;function st(t,e,i,s,o,c){e||(e={});var l,u,h=e;if("ref"in h)for(u in h={},e)u=="ref"?l=e[u]:h[u]=e[u];var f={type:t,props:h,key:i,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--u5,__i:-1,__u:0,__source:o,__self:c};if(typeof t=="function"&&(l=t.defaultProps))for(u in l)h[u]===void 0&&(h[u]=l[u]);return wt.vnode&&wt.vnode(f),f}var Ts,jt,kc,p2,Ao=0,g2=[],Qt=wt,m2=Qt.__b,v2=Qt.__r,_2=Qt.diffed,w2=Qt.__c,b2=Qt.unmount,y2=Qt.__;function Lc(t,e){Qt.__h&&Qt.__h(jt,t,Ao||e),Ao=0;var i=jt.__H||(jt.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Qn(t){return Ao=1,h5(E2,t)}function h5(t,e,i){var s=Lc(Ts++,2);if(s.t=t,!s.__c&&(s.__=[E2(void 0,e),function(u){var h=s.__N?s.__N[0]:s.__[0],f=s.t(h,u);h!==f&&(s.__N=[f,s.__[1]],s.__c.setState({}))}],s.__c=jt,!jt.__f)){var o=function(u,h,f){if(!s.__c.__H)return!0;var _=s.__c.__H.__.filter(function(b){return!!b.__c});if(_.every(function(b){return!b.__N}))return!c||c.call(this,u,h,f);var m=s.__c.props!==u;return _.forEach(function(b){if(b.__N){var E=b.__[0];b.__=b.__N,b.__N=void 0,E!==b.__[0]&&(m=!0)}}),c&&c.call(this,u,h,f)||m};jt.__f=!0;var c=jt.shouldComponentUpdate,l=jt.componentWillUpdate;jt.componentWillUpdate=function(u,h,f){if(this.__e){var _=c;c=void 0,o(u,h,f),c=_}l&&l.call(this,u,h,f)},jt.shouldComponentUpdate=o}return s.__N||s.__}function Si(t,e){var i=Lc(Ts++,3);!Qt.__s&&x2(i.__H,e)&&(i.__=t,i.u=e,jt.__H.__h.push(i))}function pe(t){return Ao=5,So(function(){return{current:t}},[])}function So(t,e){var i=Lc(Ts++,7);return x2(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function d5(){for(var t;t=g2.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ko),t.__H.__h.forEach(Mc),t.__H.__h=[]}catch(e){t.__H.__h=[],Qt.__e(e,t.__v)}}Qt.__b=function(t){jt=null,m2&&m2(t)},Qt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),y2&&y2(t,e)},Qt.__r=function(t){v2&&v2(t),Ts=0;var e=(jt=t.__c).__H;e&&(kc===jt?(e.__h=[],jt.__h=[],e.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(e.__h.forEach(ko),e.__h.forEach(Mc),e.__h=[],Ts=0)),kc=jt},Qt.diffed=function(t){_2&&_2(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(g2.push(e)!==1&&p2===Qt.requestAnimationFrame||((p2=Qt.requestAnimationFrame)||f5)(d5)),e.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),kc=jt=null},Qt.__c=function(t,e){e.some(function(i){try{i.__h.forEach(ko),i.__h=i.__h.filter(function(s){return!s.__||Mc(s)})}catch(s){e.some(function(o){o.__h&&(o.__h=[])}),e=[],Qt.__e(s,i.__v)}}),w2&&w2(t,e)},Qt.unmount=function(t){b2&&b2(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(s){try{ko(s)}catch(o){e=o}}),i.__H=void 0,e&&Qt.__e(e,i.__v))};var C2=typeof requestAnimationFrame=="function";function f5(t){var e,i=function(){clearTimeout(s),C2&&cancelAnimationFrame(e),setTimeout(t)},s=setTimeout(i,35);C2&&(e=requestAnimationFrame(i))}function ko(t){var e=jt,i=t.__c;typeof i=="function"&&(t.__c=void 0,i()),jt=e}function Mc(t){var e=jt;t.__c=t.__(),jt=e}function x2(t,e){return!t||t.length!==e.length||e.some(function(i,s){return i!==t[s]})}function E2(t,e){return typeof e=="function"?e(t):e}/**
3127
- * @license @tabler/icons-preact v3.34.0 - MIT
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,Ma,Ur,Vr,jr,Ji={},La=[],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)&&!Ln.__r++||ka!=U.debounceRendering)&&((ka=U.debounceRendering)||Aa)(Ln)}function Ln(){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)));Ln.__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||La,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(Ma,"$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,L,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)}),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);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=La.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},Ln.__r=0,Ma=/(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,Mh(Ja,e)}function Mh(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 Lh(){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)(Lh)),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
3128
  *
3129
3129
  * This source code is licensed under the MIT license.
3130
3130
  * See the LICENSE file in the root directory of this source tree.
3131
- */var p5={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.0 - MIT
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
3133
  *
3134
3134
  * This source code is licensed under the MIT license.
3135
3135
  * See the LICENSE file in the root directory of this source tree.
3136
- */const g5=(t,e,i,s)=>{const o=A=>{var k=A,{color:c="currentColor",size:l=24,stroke:u=2,title:h,children:f,className:_="",class:m="",style:b}=k,E=$u(k,["color","size","stroke","title","children","className","class","style"]);return Qi("svg",Fe(ys(Fe({},p5[t]),{width:String(l),height:String(l),class:["tabler-icon",`tabler-icon-${e}`,m,_].join(" "),"stroke-width":u,stroke:c,style:b}),E),[h&&Qi("title",{},h),...s.map(([F,M])=>Qi(F,M)),...o2(f)])};return o.displayName=`${i}`,o};/**
3137
- * @license @tabler/icons-preact v3.34.0 - MIT
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
3138
  *
3139
3139
  * This source code is licensed under the MIT license.
3140
3140
  * See the LICENSE file in the root directory of this source tree.
3141
- */var m5=g5("outline","loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Tc(){return(Tc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}).apply(this,arguments)}var v5=["context","children"];function _5(t){this.getChildContext=function(){return t.context};var e=t.children,i=function(s,o){if(s==null)return{};var c,l,u={},h=Object.keys(s);for(l=0;l<h.length;l++)o.indexOf(c=h[l])>=0||(u[c]=s[c]);return u}(t,v5);return f2(e,i)}function w5(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=Qi(_5,Tc({},this._props,{context:t.detail.context}),function e(i,s){if(i.nodeType===3)return i.data;if(i.nodeType!==1)return null;var o=[],c={},l=0,u=i.attributes,h=i.childNodes;for(l=u.length;l--;)u[l].name!=="slot"&&(c[u[l].name]=u[l].value,c[A2(u[l].name)]=u[l].value);for(l=h.length;l--;){var f=e(h[l],null),_=h[l].slot;_?c[_]=Qi(S2,{name:_},f):o[l]=f}var m=s?Qi(S2,null,o):o;return Qi(s||i.nodeName.toLowerCase(),c,m)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?d2:Eo)(this._vdom,this._root)}function A2(t){return t.replace(/-(\w)/g,function(e,i){return i?i.toUpperCase():""})}function b5(t,e,i){if(this._vdom){var s={};s[t]=i=i==null?void 0:i,s[A2(t)]=i,this._vdom=f2(this._vdom,s),Eo(this._vdom,this._root)}}function y5(){Eo(this._vdom=null,this._root)}function S2(t,e){var i=this;return Qi("slot",Tc({},t,{ref:function(s){s?(i.ref=s,i._listener||(i._listener=function(o){o.stopPropagation(),o.detail.context=e},s.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function k2(t,e,i,s){function o(){var c=Reflect.construct(HTMLElement,[],o);return c._vdomComponent=t,c._root=s&&s.shadow?c.attachShadow({mode:s.mode||"open"}):c,c}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=w5,o.prototype.attributeChangedCallback=b5,o.prototype.disconnectedCallback=y5,i=i||t.observedAttributes||Object.keys(t.propTypes||{}),o.observedAttributes=i,i.forEach(function(c){Object.defineProperty(o.prototype,c,{get:function(){return this._vdom.props[c]},set:function(l){this._vdom?this.attributeChangedCallback(c,null,l):(this._props||(this._props={}),this._props[c]=l,this.connectedCallback());var u=typeof l;l!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(c,l)}})}),customElements.define(e||t.tagName||t.displayName||t.name,o)}const Lr=(t,e=!1)=>typeof t=="boolean"?t:typeof t=="string"?t==="true"||t==="":e;var C5=Symbol.for("preact-signals");function Lo(){if(En>1)En--;else{for(var t,e=!1;Is!==void 0;){var i=Is;for(Is=void 0,Ic++;i!==void 0;){var s=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&I2(i))try{i.c()}catch(o){e||(t=o,e=!0)}i=s}}if(Ic=0,En--,e)throw t}}function x5(t){if(En>0)return t();En++;try{return t()}finally{Lo()}}var bt=void 0;function L2(t){var e=bt;bt=void 0;try{return t()}finally{bt=e}}var Is=void 0,En=0,Ic=0,Mo=0;function M2(t){if(bt!==void 0){var e=t.n;if(e===void 0||e.t!==bt)return e={i:0,S:t,p:bt.s,n:void 0,t:bt,e:void 0,x:void 0,r:e},bt.s!==void 0&&(bt.s.n=e),bt.s=e,t.n=e,32&bt.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=bt.s,e.n=void 0,bt.s.n=e,bt.s=e),e}}function ue(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched}ue.prototype.brand=C5,ue.prototype.h=function(){return!0},ue.prototype.S=function(t){var e=this,i=this.t;i!==t&&t.e===void 0&&(t.x=i,this.t=t,i!==void 0?i.e=t:L2(function(){var s;(s=e.W)==null||s.call(e)}))},ue.prototype.U=function(t){var e=this;if(this.t!==void 0){var i=t.e,s=t.x;i!==void 0&&(i.x=s,t.e=void 0),s!==void 0&&(s.e=i,t.x=void 0),t===this.t&&(this.t=s,s===void 0&&L2(function(){var o;(o=e.Z)==null||o.call(e)}))}},ue.prototype.subscribe=function(t){var e=this;return Fs(function(){var i=e.value,s=bt;bt=void 0;try{t(i)}finally{bt=s}})},ue.prototype.valueOf=function(){return this.value},ue.prototype.toString=function(){return this.value+""},ue.prototype.toJSON=function(){return this.value},ue.prototype.peek=function(){var t=bt;bt=void 0;try{return this.value}finally{bt=t}},Object.defineProperty(ue.prototype,"value",{get:function(){var t=M2(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Ic>100)throw new Error("Cycle detected");this.v=t,this.i++,Mo++,En++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Lo()}}}});function T2(t,e){return new ue(t,e)}function I2(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function F2(t){for(var e=t.s;e!==void 0;e=e.n){var i=e.S.n;if(i!==void 0&&(e.r=i),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function B2(t){for(var e=t.s,i=void 0;e!==void 0;){var s=e.p;e.i===-1?(e.S.U(e),s!==void 0&&(s.n=e.n),e.n!==void 0&&(e.n.p=s)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=s}t.s=i}function tr(t,e){ue.call(this,void 0),this.x=t,this.s=void 0,this.g=Mo-1,this.f=4,this.W=e==null?void 0:e.watched,this.Z=e==null?void 0:e.unwatched}tr.prototype=new ue,tr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Mo))return!0;if(this.g=Mo,this.f|=1,this.i>0&&!I2(this))return this.f&=-2,!0;var t=bt;try{F2(this),bt=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return bt=t,B2(this),this.f&=-2,!0},tr.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ue.prototype.S.call(this,t)},tr.prototype.U=function(t){if(this.t!==void 0&&(ue.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},tr.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(tr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=M2(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Fc(t,e){return new tr(t,e)}function R2(t){var e=t.u;if(t.u=void 0,typeof e=="function"){En++;var i=bt;bt=void 0;try{e()}catch(s){throw t.f&=-2,t.f|=8,Bc(t),s}finally{bt=i,Lo()}}}function Bc(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,R2(t)}function E5(t){if(bt!==this)throw new Error("Out-of-order effect");B2(this),bt=t,this.f&=-2,8&this.f&&Bc(this),Lo()}function Mr(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Mr.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}},Mr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,R2(this),F2(this),En++;var t=bt;return bt=this,E5.bind(this,t)},Mr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Is,Is=this)},Mr.prototype.d=function(){this.f|=8,1&this.f||Bc(this)},Mr.prototype.dispose=function(){this.d()};function Fs(t){var e=new Mr(t);try{e.c()}catch(s){throw e.d(),s}var i=e.d.bind(e);return i[Symbol.dispose]=i,i}var D2,To,Rc,O2=[];Fs(function(){D2=this.N})();function Tr(t,e){wt[t]=e.bind(null,wt[t]||function(){})}function Io(t){Rc&&Rc(),Rc=t&&t.S()}function P2(t){var e=this,i=t.data,s=Gt(i);s.value=i;var o=So(function(){for(var u=e,h=e.__v;h=h.__;)if(h.__c){h.__c.__$f|=4;break}var f=Fc(function(){var E=s.value.value;return E===0?0:E===!0?"":E||""}),_=Fc(function(){return!Array.isArray(f.value)&&!Ku(f.value)}),m=Fs(function(){if(this.N=U2,_.value){var E=f.value;u.__v&&u.__v.__e&&u.__v.__e.nodeType===3&&(u.__v.__e.data=E)}}),b=e.__$u.d;return e.__$u.d=function(){m(),b.call(this)},[_,f]},[]),c=o[0],l=o[1];return c.value?l.peek():l.value}P2.displayName="_st",Object.defineProperties(ue.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:P2},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Tr("__b",function(t,e){if(typeof e.type=="string"){var i,s=e.props;for(var o in s)if(o!=="children"){var c=s[o];c instanceof ue&&(i||(e.__np=i={}),i[o]=c,s[o]=c.peek())}}t(e)}),Tr("__r",function(t,e){if(e.type!==xn){Io();var i,s=e.__c;s&&(s.__$f&=-2,(i=s.__$u)===void 0&&(s.__$u=i=function(o){var c;return Fs(function(){c=this}),c.c=function(){s.__$f|=1,s.setState({})},c}())),To=s,Io(i)}t(e)}),Tr("__e",function(t,e,i,s){Io(),To=void 0,t(e,i,s)}),Tr("diffed",function(t,e){Io(),To=void 0;var i;if(typeof e.type=="string"&&(i=e.__e)){var s=e.__np,o=e.props;if(s){var c=i.U;if(c)for(var l in c){var u=c[l];u!==void 0&&!(l in s)&&(u.d(),c[l]=void 0)}else c={},i.U=c;for(var h in s){var f=c[h],_=s[h];f===void 0?(f=A5(i,h,_,o),c[h]=f):f.o(_,o)}}}t(e)});function A5(t,e,i,s){var o=e in t&&t.ownerSVGElement===void 0,c=T2(i);return{o:function(l,u){c.value=l,s=u},d:Fs(function(){this.N=U2;var l=c.value.value;s[e]!==l&&(s[e]=l,o?t[e]=l:l?t.setAttribute(e,l):t.removeAttribute(e))})}}Tr("unmount",function(t,e){if(typeof e.type=="string"){var i=e.__e;if(i){var s=i.U;if(s){i.U=void 0;for(var o in s){var c=s[o];c&&c.d()}}}}else{var l=e.__c;if(l){var u=l.__$u;u&&(l.__$u=void 0,u.d())}}t(e)}),Tr("__h",function(t,e,i,s){(s<3||s===9)&&(e.__$f|=2),t(e,i,s)}),Ms.prototype.shouldComponentUpdate=function(t,e){var i=this.__$u,s=i&&i.s!==void 0;for(var o in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var c=2&this.__$f;if(!(s||c||4&this.__$f)||1&this.__$f)return!0}else if(!(s||4&this.__$f)||3&this.__$f)return!0;for(var l in t)if(l!=="__source"&&t[l]!==this.props[l])return!0;for(var u in this.props)if(!(u in t))return!0;return!1};function Gt(t,e){return So(function(){return T2(t,e)},[])}function Dc(t,e){var i=pe(t);return i.current=t,To.__$f|=4,So(function(){return Fc(function(){return i.current()},e)},[])}var S5=function(t){queueMicrotask(function(){queueMicrotask(t)})};function k5(){x5(function(){for(var t;t=O2.shift();)D2.call(t)})}function U2(){O2.push(this)===1&&(wt.requestAnimationFrame||S5)(k5)}var Bs={exports:{}};/**
3142
- * @license
3143
- * Lodash <https://lodash.com/>
3144
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
3145
- * Released under MIT license <https://lodash.com/license>
3146
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
3147
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3148
- */var L5=Bs.exports,$2;function M5(){return $2||($2=1,function(t,e){(function(){var i,s="4.17.21",o=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",f=500,_="__lodash_placeholder__",m=1,b=2,E=4,A=1,k=2,F=1,M=2,D=4,R=8,$=16,X=32,N=64,vt=128,J=256,pt=512,kt=30,Zt="...",ne=800,Ii=16,Ae=1,he=2,Se=3,ur=1/0,ei=9007199254740991,ka=17976931348623157e292,rs=NaN,Pe=4294967295,ke=Pe-1,b1=Pe>>>1,y1=[["ary",vt],["bind",F],["bindKey",M],["curry",R],["curryRight",$],["flip",pt],["partial",X],["partialRight",N],["rearg",J]],Un="[object Arguments]",ss="[object Array]",to="[object AsyncFunction]",hn="[object Boolean]",hr="[object Date]",C1="[object DOMException]",dn="[object Error]",Wi="[object Function]",eo="[object GeneratorFunction]",Ue="[object Map]",os="[object Number]",e3="[object Null]",Zi="[object Object]",x1="[object Promise]",i3="[object Proxy]",lt="[object RegExp]",xt="[object Set]",me="[object String]",$n="[object Symbol]",Le="[object Undefined]",Nn="[object WeakMap]",La="[object WeakSet]",$e="[object ArrayBuffer]",Ne="[object DataView]",qi="[object Float32Array]",dr="[object Float64Array]",Hn="[object Int8Array]",Vn="[object Int16Array]",ji="[object Int32Array]",io="[object Uint8Array]",no="[object Uint8ClampedArray]",fr="[object Uint16Array]",E1="[object Uint32Array]",F6=/\b__p \+= '';/g,B6=/\b(__p \+=) '' \+/g,R6=/(__e\(.*?\)|\b__t\)) \+\n'';/g,n3=/&(?:amp|lt|gt|quot|#39);/g,r3=/[&<>"']/g,D6=RegExp(n3.source),O6=RegExp(r3.source),P6=/<%-([\s\S]+?)%>/g,U6=/<%([\s\S]+?)%>/g,s3=/<%=([\s\S]+?)%>/g,$6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N6=/^\w*$/,H6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A1=/[\\^$.*+?()[\]{}|]/g,V6=RegExp(A1.source),S1=/^\s+/,G6=/\s/,z6=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W6=/\{\n\/\* \[wrapped with (.+)\] \*/,Z6=/,? & /,q6=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,j6=/[()=,{}\[\]\/\s]/,X6=/\\(\\)?/g,K6=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,o3=/\w*$/,Y6=/^[-+]0x[0-9a-f]+$/i,J6=/^0b[01]+$/i,Q6=/^\[object .+?Constructor\]$/,t7=/^0o[0-7]+$/i,e7=/^(?:0|[1-9]\d*)$/,i7=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ma=/($^)/,n7=/['\n\r\u2028\u2029\\]/g,Ta="\\ud800-\\udfff",r7="\\u0300-\\u036f",s7="\\ufe20-\\ufe2f",o7="\\u20d0-\\u20ff",a3=r7+s7+o7,c3="\\u2700-\\u27bf",l3="a-z\\xdf-\\xf6\\xf8-\\xff",a7="\\xac\\xb1\\xd7\\xf7",c7="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",l7="\\u2000-\\u206f",u7=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",u3="A-Z\\xc0-\\xd6\\xd8-\\xde",h3="\\ufe0e\\ufe0f",d3=a7+c7+l7+u7,k1="['’]",h7="["+Ta+"]",f3="["+d3+"]",Ia="["+a3+"]",p3="\\d+",d7="["+c3+"]",g3="["+l3+"]",m3="[^"+Ta+d3+p3+c3+l3+u3+"]",L1="\\ud83c[\\udffb-\\udfff]",f7="(?:"+Ia+"|"+L1+")",v3="[^"+Ta+"]",M1="(?:\\ud83c[\\udde6-\\uddff]){2}",T1="[\\ud800-\\udbff][\\udc00-\\udfff]",as="["+u3+"]",_3="\\u200d",w3="(?:"+g3+"|"+m3+")",p7="(?:"+as+"|"+m3+")",b3="(?:"+k1+"(?:d|ll|m|re|s|t|ve))?",y3="(?:"+k1+"(?:D|LL|M|RE|S|T|VE))?",C3=f7+"?",x3="["+h3+"]?",g7="(?:"+_3+"(?:"+[v3,M1,T1].join("|")+")"+x3+C3+")*",m7="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",v7="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",E3=x3+C3+g7,_7="(?:"+[d7,M1,T1].join("|")+")"+E3,w7="(?:"+[v3+Ia+"?",Ia,M1,T1,h7].join("|")+")",b7=RegExp(k1,"g"),y7=RegExp(Ia,"g"),I1=RegExp(L1+"(?="+L1+")|"+w7+E3,"g"),C7=RegExp([as+"?"+g3+"+"+b3+"(?="+[f3,as,"$"].join("|")+")",p7+"+"+y3+"(?="+[f3,as+w3,"$"].join("|")+")",as+"?"+w3+"+"+b3,as+"+"+y3,v7,m7,p3,_7].join("|"),"g"),x7=RegExp("["+_3+Ta+a3+h3+"]"),E7=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,A7=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],S7=-1,Rt={};Rt[qi]=Rt[dr]=Rt[Hn]=Rt[Vn]=Rt[ji]=Rt[io]=Rt[no]=Rt[fr]=Rt[E1]=!0,Rt[Un]=Rt[ss]=Rt[$e]=Rt[hn]=Rt[Ne]=Rt[hr]=Rt[dn]=Rt[Wi]=Rt[Ue]=Rt[os]=Rt[Zi]=Rt[lt]=Rt[xt]=Rt[me]=Rt[Nn]=!1;var It={};It[Un]=It[ss]=It[$e]=It[Ne]=It[hn]=It[hr]=It[qi]=It[dr]=It[Hn]=It[Vn]=It[ji]=It[Ue]=It[os]=It[Zi]=It[lt]=It[xt]=It[me]=It[$n]=It[io]=It[no]=It[fr]=It[E1]=!0,It[dn]=It[Wi]=It[Nn]=!1;var k7={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},L7={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M7={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},T7={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},I7=parseFloat,F7=parseInt,A3=typeof yo=="object"&&yo&&yo.Object===Object&&yo,B7=typeof self=="object"&&self&&self.Object===Object&&self,de=A3||B7||Function("return this")(),F1=e&&!e.nodeType&&e,pr=F1&&!0&&t&&!t.nodeType&&t,S3=pr&&pr.exports===F1,B1=S3&&A3.process,vi=function(){try{var C=pr&&pr.require&&pr.require("util").types;return C||B1&&B1.binding&&B1.binding("util")}catch(L){}}(),k3=vi&&vi.isArrayBuffer,L3=vi&&vi.isDate,M3=vi&&vi.isMap,T3=vi&&vi.isRegExp,I3=vi&&vi.isSet,F3=vi&&vi.isTypedArray;function ii(C,L,S){switch(S.length){case 0:return C.call(L);case 1:return C.call(L,S[0]);case 2:return C.call(L,S[0],S[1]);case 3:return C.call(L,S[0],S[1],S[2])}return C.apply(L,S)}function R7(C,L,S,P){for(var Q=-1,_t=C==null?0:C.length;++Q<_t;){var oe=C[Q];L(P,oe,S(oe),C)}return P}function _i(C,L){for(var S=-1,P=C==null?0:C.length;++S<P&&L(C[S],S,C)!==!1;);return C}function D7(C,L){for(var S=C==null?0:C.length;S--&&L(C[S],S,C)!==!1;);return C}function B3(C,L){for(var S=-1,P=C==null?0:C.length;++S<P;)if(!L(C[S],S,C))return!1;return!0}function Gn(C,L){for(var S=-1,P=C==null?0:C.length,Q=0,_t=[];++S<P;){var oe=C[S];L(oe,S,C)&&(_t[Q++]=oe)}return _t}function Fa(C,L){var S=C==null?0:C.length;return!!S&&cs(C,L,0)>-1}function R1(C,L,S){for(var P=-1,Q=C==null?0:C.length;++P<Q;)if(S(L,C[P]))return!0;return!1}function $t(C,L){for(var S=-1,P=C==null?0:C.length,Q=Array(P);++S<P;)Q[S]=L(C[S],S,C);return Q}function zn(C,L){for(var S=-1,P=L.length,Q=C.length;++S<P;)C[Q+S]=L[S];return C}function D1(C,L,S,P){var Q=-1,_t=C==null?0:C.length;for(P&&_t&&(S=C[++Q]);++Q<_t;)S=L(S,C[Q],Q,C);return S}function O7(C,L,S,P){var Q=C==null?0:C.length;for(P&&Q&&(S=C[--Q]);Q--;)S=L(S,C[Q],Q,C);return S}function O1(C,L){for(var S=-1,P=C==null?0:C.length;++S<P;)if(L(C[S],S,C))return!0;return!1}var P7=P1("length");function U7(C){return C.split("")}function $7(C){return C.match(q6)||[]}function R3(C,L,S){var P;return S(C,function(Q,_t,oe){if(L(Q,_t,oe))return P=_t,!1}),P}function Ba(C,L,S,P){for(var Q=C.length,_t=S+(P?1:-1);P?_t--:++_t<Q;)if(L(C[_t],_t,C))return _t;return-1}function cs(C,L,S){return L===L?Y7(C,L,S):Ba(C,D3,S)}function N7(C,L,S,P){for(var Q=S-1,_t=C.length;++Q<_t;)if(P(C[Q],L))return Q;return-1}function D3(C){return C!==C}function O3(C,L){var S=C==null?0:C.length;return S?$1(C,L)/S:rs}function P1(C){return function(L){return L==null?i:L[C]}}function U1(C){return function(L){return C==null?i:C[L]}}function P3(C,L,S,P,Q){return Q(C,function(_t,oe,Lt){S=P?(P=!1,_t):L(S,_t,oe,Lt)}),S}function H7(C,L){var S=C.length;for(C.sort(L);S--;)C[S]=C[S].value;return C}function $1(C,L){for(var S,P=-1,Q=C.length;++P<Q;){var _t=L(C[P]);_t!==i&&(S=S===i?_t:S+_t)}return S}function N1(C,L){for(var S=-1,P=Array(C);++S<C;)P[S]=L(S);return P}function V7(C,L){return $t(L,function(S){return[S,C[S]]})}function U3(C){return C&&C.slice(0,V3(C)+1).replace(S1,"")}function ni(C){return function(L){return C(L)}}function H1(C,L){return $t(L,function(S){return C[S]})}function ro(C,L){return C.has(L)}function $3(C,L){for(var S=-1,P=C.length;++S<P&&cs(L,C[S],0)>-1;);return S}function N3(C,L){for(var S=C.length;S--&&cs(L,C[S],0)>-1;);return S}function G7(C,L){for(var S=C.length,P=0;S--;)C[S]===L&&++P;return P}var z7=U1(k7),W7=U1(L7);function Z7(C){return"\\"+T7[C]}function q7(C,L){return C==null?i:C[L]}function ls(C){return x7.test(C)}function j7(C){return E7.test(C)}function X7(C){for(var L,S=[];!(L=C.next()).done;)S.push(L.value);return S}function V1(C){var L=-1,S=Array(C.size);return C.forEach(function(P,Q){S[++L]=[Q,P]}),S}function H3(C,L){return function(S){return C(L(S))}}function Wn(C,L){for(var S=-1,P=C.length,Q=0,_t=[];++S<P;){var oe=C[S];(oe===L||oe===_)&&(C[S]=_,_t[Q++]=S)}return _t}function Ra(C){var L=-1,S=Array(C.size);return C.forEach(function(P){S[++L]=P}),S}function K7(C){var L=-1,S=Array(C.size);return C.forEach(function(P){S[++L]=[P,P]}),S}function Y7(C,L,S){for(var P=S-1,Q=C.length;++P<Q;)if(C[P]===L)return P;return-1}function J7(C,L,S){for(var P=S+1;P--;)if(C[P]===L)return P;return P}function us(C){return ls(C)?t8(C):P7(C)}function Fi(C){return ls(C)?e8(C):U7(C)}function V3(C){for(var L=C.length;L--&&G6.test(C.charAt(L)););return L}var Q7=U1(M7);function t8(C){for(var L=I1.lastIndex=0;I1.test(C);)++L;return L}function e8(C){return C.match(I1)||[]}function i8(C){return C.match(C7)||[]}var n8=function C(L){L=L==null?de:hs.defaults(de.Object(),L,hs.pick(de,A7));var S=L.Array,P=L.Date,Q=L.Error,_t=L.Function,oe=L.Math,Lt=L.Object,G1=L.RegExp,r8=L.String,wi=L.TypeError,Da=S.prototype,s8=_t.prototype,ds=Lt.prototype,Oa=L["__core-js_shared__"],Pa=s8.toString,At=ds.hasOwnProperty,o8=0,G3=function(){var n=/[^.]+$/.exec(Oa&&Oa.keys&&Oa.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),Ua=ds.toString,a8=Pa.call(Lt),c8=de._,l8=G1("^"+Pa.call(At).replace(A1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$a=S3?L.Buffer:i,Zn=L.Symbol,Na=L.Uint8Array,z3=$a?$a.allocUnsafe:i,Ha=H3(Lt.getPrototypeOf,Lt),W3=Lt.create,Z3=ds.propertyIsEnumerable,Va=Da.splice,q3=Zn?Zn.isConcatSpreadable:i,so=Zn?Zn.iterator:i,gr=Zn?Zn.toStringTag:i,Ga=function(){try{var n=br(Lt,"defineProperty");return n({},"",{}),n}catch(r){}}(),u8=L.clearTimeout!==de.clearTimeout&&L.clearTimeout,h8=P&&P.now!==de.Date.now&&P.now,d8=L.setTimeout!==de.setTimeout&&L.setTimeout,za=oe.ceil,Wa=oe.floor,z1=Lt.getOwnPropertySymbols,f8=$a?$a.isBuffer:i,j3=L.isFinite,p8=Da.join,g8=H3(Lt.keys,Lt),ae=oe.max,ve=oe.min,m8=P.now,v8=L.parseInt,X3=oe.random,_8=Da.reverse,W1=br(L,"DataView"),oo=br(L,"Map"),Z1=br(L,"Promise"),fs=br(L,"Set"),ao=br(L,"WeakMap"),co=br(Lt,"create"),Za=ao&&new ao,ps={},w8=yr(W1),b8=yr(oo),y8=yr(Z1),C8=yr(fs),x8=yr(ao),qa=Zn?Zn.prototype:i,lo=qa?qa.valueOf:i,K3=qa?qa.toString:i;function g(n){if(qt(n)&&!tt(n)&&!(n instanceof ut)){if(n instanceof bi)return n;if(At.call(n,"__wrapped__"))return Jf(n)}return new bi(n)}var gs=function(){function n(){}return function(r){if(!Vt(r))return{};if(W3)return W3(r);n.prototype=r;var a=new n;return n.prototype=i,a}}();function ja(){}function bi(n,r){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=i}g.templateSettings={escape:P6,evaluate:U6,interpolate:s3,variable:"",imports:{_:g}},g.prototype=ja.prototype,g.prototype.constructor=g,bi.prototype=gs(ja.prototype),bi.prototype.constructor=bi;function ut(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Pe,this.__views__=[]}function E8(){var n=new ut(this.__wrapped__);return n.__actions__=He(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=He(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=He(this.__views__),n}function A8(){if(this.__filtered__){var n=new ut(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function S8(){var n=this.__wrapped__.value(),r=this.__dir__,a=tt(n),d=r<0,p=a?n.length:0,v=Ug(0,p,this.__views__),w=v.start,y=v.end,x=y-w,T=d?y:w-1,I=this.__iteratees__,B=I.length,O=0,V=ve(x,this.__takeCount__);if(!a||!d&&p==x&&V==x)return yf(n,this.__actions__);var K=[];t:for(;x--&&O<V;){T+=r;for(var nt=-1,Y=n[T];++nt<B;){var ot=I[nt],ft=ot.iteratee,oi=ot.type,Ie=ft(Y);if(oi==he)Y=Ie;else if(!Ie){if(oi==Ae)continue t;break t}}K[O++]=Y}return K}ut.prototype=gs(ja.prototype),ut.prototype.constructor=ut;function mr(n){var r=-1,a=n==null?0:n.length;for(this.clear();++r<a;){var d=n[r];this.set(d[0],d[1])}}function k8(){this.__data__=co?co(null):{},this.size=0}function L8(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}function M8(n){var r=this.__data__;if(co){var a=r[n];return a===h?i:a}return At.call(r,n)?r[n]:i}function T8(n){var r=this.__data__;return co?r[n]!==i:At.call(r,n)}function I8(n,r){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=co&&r===i?h:r,this}mr.prototype.clear=k8,mr.prototype.delete=L8,mr.prototype.get=M8,mr.prototype.has=T8,mr.prototype.set=I8;function fn(n){var r=-1,a=n==null?0:n.length;for(this.clear();++r<a;){var d=n[r];this.set(d[0],d[1])}}function F8(){this.__data__=[],this.size=0}function B8(n){var r=this.__data__,a=Xa(r,n);if(a<0)return!1;var d=r.length-1;return a==d?r.pop():Va.call(r,a,1),--this.size,!0}function R8(n){var r=this.__data__,a=Xa(r,n);return a<0?i:r[a][1]}function D8(n){return Xa(this.__data__,n)>-1}function O8(n,r){var a=this.__data__,d=Xa(a,n);return d<0?(++this.size,a.push([n,r])):a[d][1]=r,this}fn.prototype.clear=F8,fn.prototype.delete=B8,fn.prototype.get=R8,fn.prototype.has=D8,fn.prototype.set=O8;function pn(n){var r=-1,a=n==null?0:n.length;for(this.clear();++r<a;){var d=n[r];this.set(d[0],d[1])}}function P8(){this.size=0,this.__data__={hash:new mr,map:new(oo||fn),string:new mr}}function U8(n){var r=ac(this,n).delete(n);return this.size-=r?1:0,r}function $8(n){return ac(this,n).get(n)}function N8(n){return ac(this,n).has(n)}function H8(n,r){var a=ac(this,n),d=a.size;return a.set(n,r),this.size+=a.size==d?0:1,this}pn.prototype.clear=P8,pn.prototype.delete=U8,pn.prototype.get=$8,pn.prototype.has=N8,pn.prototype.set=H8;function vr(n){var r=-1,a=n==null?0:n.length;for(this.__data__=new pn;++r<a;)this.add(n[r])}function V8(n){return this.__data__.set(n,h),this}function G8(n){return this.__data__.has(n)}vr.prototype.add=vr.prototype.push=V8,vr.prototype.has=G8;function Bi(n){var r=this.__data__=new fn(n);this.size=r.size}function z8(){this.__data__=new fn,this.size=0}function W8(n){var r=this.__data__,a=r.delete(n);return this.size=r.size,a}function Z8(n){return this.__data__.get(n)}function q8(n){return this.__data__.has(n)}function j8(n,r){var a=this.__data__;if(a instanceof fn){var d=a.__data__;if(!oo||d.length<o-1)return d.push([n,r]),this.size=++a.size,this;a=this.__data__=new pn(d)}return a.set(n,r),this.size=a.size,this}Bi.prototype.clear=z8,Bi.prototype.delete=W8,Bi.prototype.get=Z8,Bi.prototype.has=q8,Bi.prototype.set=j8;function Y3(n,r){var a=tt(n),d=!a&&Cr(n),p=!a&&!d&&Yn(n),v=!a&&!d&&!p&&ws(n),w=a||d||p||v,y=w?N1(n.length,r8):[],x=y.length;for(var T in n)(r||At.call(n,T))&&!(w&&(T=="length"||p&&(T=="offset"||T=="parent")||v&&(T=="buffer"||T=="byteLength"||T=="byteOffset")||_n(T,x)))&&y.push(T);return y}function J3(n){var r=n.length;return r?n[nu(0,r-1)]:i}function X8(n,r){return cc(He(n),_r(r,0,n.length))}function K8(n){return cc(He(n))}function q1(n,r,a){(a!==i&&!Ri(n[r],a)||a===i&&!(r in n))&&gn(n,r,a)}function uo(n,r,a){var d=n[r];(!(At.call(n,r)&&Ri(d,a))||a===i&&!(r in n))&&gn(n,r,a)}function Xa(n,r){for(var a=n.length;a--;)if(Ri(n[a][0],r))return a;return-1}function Y8(n,r,a,d){return qn(n,function(p,v,w){r(d,p,a(p),w)}),d}function Q3(n,r){return n&&Ki(r,le(r),n)}function J8(n,r){return n&&Ki(r,Ge(r),n)}function gn(n,r,a){r=="__proto__"&&Ga?Ga(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}function j1(n,r){for(var a=-1,d=r.length,p=S(d),v=n==null;++a<d;)p[a]=v?i:Lu(n,r[a]);return p}function _r(n,r,a){return n===n&&(a!==i&&(n=n<=a?n:a),r!==i&&(n=n>=r?n:r)),n}function yi(n,r,a,d,p,v){var w,y=r&m,x=r&b,T=r&E;if(a&&(w=p?a(n,d,p,v):a(n)),w!==i)return w;if(!Vt(n))return n;var I=tt(n);if(I){if(w=Ng(n),!y)return He(n,w)}else{var B=_e(n),O=B==Wi||B==eo;if(Yn(n))return Ef(n,y);if(B==Zi||B==Un||O&&!p){if(w=x||O?{}:Gf(n),!y)return x?Mg(n,J8(w,n)):Lg(n,Q3(w,n))}else{if(!It[B])return p?n:{};w=Hg(n,B,y)}}v||(v=new Bi);var V=v.get(n);if(V)return V;v.set(n,w),_4(n)?n.forEach(function(Y){w.add(yi(Y,r,a,Y,n,v))}):m4(n)&&n.forEach(function(Y,ot){w.set(ot,yi(Y,r,a,ot,n,v))});var K=T?x?pu:fu:x?Ge:le,nt=I?i:K(n);return _i(nt||n,function(Y,ot){nt&&(ot=Y,Y=n[ot]),uo(w,ot,yi(Y,r,a,ot,n,v))}),w}function Q8(n){var r=le(n);return function(a){return tf(a,n,r)}}function tf(n,r,a){var d=a.length;if(n==null)return!d;for(n=Lt(n);d--;){var p=a[d],v=r[p],w=n[p];if(w===i&&!(p in n)||!v(w))return!1}return!0}function ef(n,r,a){if(typeof n!="function")throw new wi(l);return _o(function(){n.apply(i,a)},r)}function ho(n,r,a,d){var p=-1,v=Fa,w=!0,y=n.length,x=[],T=r.length;if(!y)return x;a&&(r=$t(r,ni(a))),d?(v=R1,w=!1):r.length>=o&&(v=ro,w=!1,r=new vr(r));t:for(;++p<y;){var I=n[p],B=a==null?I:a(I);if(I=d||I!==0?I:0,w&&B===B){for(var O=T;O--;)if(r[O]===B)continue t;x.push(I)}else v(r,B,d)||x.push(I)}return x}var qn=Mf(Xi),nf=Mf(K1,!0);function tg(n,r){var a=!0;return qn(n,function(d,p,v){return a=!!r(d,p,v),a}),a}function Ka(n,r,a){for(var d=-1,p=n.length;++d<p;){var v=n[d],w=r(v);if(w!=null&&(y===i?w===w&&!si(w):a(w,y)))var y=w,x=v}return x}function eg(n,r,a,d){var p=n.length;for(a=it(a),a<0&&(a=-a>p?0:p+a),d=d===i||d>p?p:it(d),d<0&&(d+=p),d=a>d?0:b4(d);a<d;)n[a++]=r;return n}function rf(n,r){var a=[];return qn(n,function(d,p,v){r(d,p,v)&&a.push(d)}),a}function fe(n,r,a,d,p){var v=-1,w=n.length;for(a||(a=Gg),p||(p=[]);++v<w;){var y=n[v];r>0&&a(y)?r>1?fe(y,r-1,a,d,p):zn(p,y):d||(p[p.length]=y)}return p}var X1=Tf(),sf=Tf(!0);function Xi(n,r){return n&&X1(n,r,le)}function K1(n,r){return n&&sf(n,r,le)}function Ya(n,r){return Gn(r,function(a){return wn(n[a])})}function wr(n,r){r=Xn(r,n);for(var a=0,d=r.length;n!=null&&a<d;)n=n[Yi(r[a++])];return a&&a==d?n:i}function of(n,r,a){var d=r(n);return tt(n)?d:zn(d,a(n))}function Me(n){return n==null?n===i?Le:e3:gr&&gr in Lt(n)?Pg(n):Kg(n)}function Y1(n,r){return n>r}function ig(n,r){return n!=null&&At.call(n,r)}function ng(n,r){return n!=null&&r in Lt(n)}function rg(n,r,a){return n>=ve(r,a)&&n<ae(r,a)}function J1(n,r,a){for(var d=a?R1:Fa,p=n[0].length,v=n.length,w=v,y=S(v),x=1/0,T=[];w--;){var I=n[w];w&&r&&(I=$t(I,ni(r))),x=ve(I.length,x),y[w]=!a&&(r||p>=120&&I.length>=120)?new vr(w&&I):i}I=n[0];var B=-1,O=y[0];t:for(;++B<p&&T.length<x;){var V=I[B],K=r?r(V):V;if(V=a||V!==0?V:0,!(O?ro(O,K):d(T,K,a))){for(w=v;--w;){var nt=y[w];if(!(nt?ro(nt,K):d(n[w],K,a)))continue t}O&&O.push(K),T.push(V)}}return T}function sg(n,r,a,d){return Xi(n,function(p,v,w){r(d,a(p),v,w)}),d}function fo(n,r,a){r=Xn(r,n),n=qf(n,r);var d=n==null?n:n[Yi(xi(r))];return d==null?i:ii(d,n,a)}function af(n){return qt(n)&&Me(n)==Un}function og(n){return qt(n)&&Me(n)==$e}function ag(n){return qt(n)&&Me(n)==hr}function po(n,r,a,d,p){return n===r?!0:n==null||r==null||!qt(n)&&!qt(r)?n!==n&&r!==r:cg(n,r,a,d,po,p)}function cg(n,r,a,d,p,v){var w=tt(n),y=tt(r),x=w?ss:_e(n),T=y?ss:_e(r);x=x==Un?Zi:x,T=T==Un?Zi:T;var I=x==Zi,B=T==Zi,O=x==T;if(O&&Yn(n)){if(!Yn(r))return!1;w=!0,I=!1}if(O&&!I)return v||(v=new Bi),w||ws(n)?Nf(n,r,a,d,p,v):Dg(n,r,x,a,d,p,v);if(!(a&A)){var V=I&&At.call(n,"__wrapped__"),K=B&&At.call(r,"__wrapped__");if(V||K){var nt=V?n.value():n,Y=K?r.value():r;return v||(v=new Bi),p(nt,Y,a,d,v)}}return O?(v||(v=new Bi),Og(n,r,a,d,p,v)):!1}function lg(n){return qt(n)&&_e(n)==Ue}function Q1(n,r,a,d){var p=a.length,v=p,w=!d;if(n==null)return!v;for(n=Lt(n);p--;){var y=a[p];if(w&&y[2]?y[1]!==n[y[0]]:!(y[0]in n))return!1}for(;++p<v;){y=a[p];var x=y[0],T=n[x],I=y[1];if(w&&y[2]){if(T===i&&!(x in n))return!1}else{var B=new Bi;if(d)var O=d(T,I,x,n,r,B);if(!(O===i?po(I,T,A|k,d,B):O))return!1}}return!0}function cf(n){if(!Vt(n)||Wg(n))return!1;var r=wn(n)?l8:Q6;return r.test(yr(n))}function ug(n){return qt(n)&&Me(n)==lt}function hg(n){return qt(n)&&_e(n)==xt}function dg(n){return qt(n)&&pc(n.length)&&!!Rt[Me(n)]}function lf(n){return typeof n=="function"?n:n==null?ze:typeof n=="object"?tt(n)?df(n[0],n[1]):hf(n):I4(n)}function tu(n){if(!vo(n))return g8(n);var r=[];for(var a in Lt(n))At.call(n,a)&&a!="constructor"&&r.push(a);return r}function fg(n){if(!Vt(n))return Xg(n);var r=vo(n),a=[];for(var d in n)d=="constructor"&&(r||!At.call(n,d))||a.push(d);return a}function eu(n,r){return n<r}function uf(n,r){var a=-1,d=Ve(n)?S(n.length):[];return qn(n,function(p,v,w){d[++a]=r(p,v,w)}),d}function hf(n){var r=mu(n);return r.length==1&&r[0][2]?Wf(r[0][0],r[0][1]):function(a){return a===n||Q1(a,n,r)}}function df(n,r){return _u(n)&&zf(r)?Wf(Yi(n),r):function(a){var d=Lu(a,n);return d===i&&d===r?Mu(a,n):po(r,d,A|k)}}function Ja(n,r,a,d,p){n!==r&&X1(r,function(v,w){if(p||(p=new Bi),Vt(v))pg(n,r,w,a,Ja,d,p);else{var y=d?d(bu(n,w),v,w+"",n,r,p):i;y===i&&(y=v),q1(n,w,y)}},Ge)}function pg(n,r,a,d,p,v,w){var y=bu(n,a),x=bu(r,a),T=w.get(x);if(T){q1(n,a,T);return}var I=v?v(y,x,a+"",n,r,w):i,B=I===i;if(B){var O=tt(x),V=!O&&Yn(x),K=!O&&!V&&ws(x);I=x,O||V||K?tt(y)?I=y:Yt(y)?I=He(y):V?(B=!1,I=Ef(x,!0)):K?(B=!1,I=Af(x,!0)):I=[]:wo(x)||Cr(x)?(I=y,Cr(y)?I=y4(y):(!Vt(y)||wn(y))&&(I=Gf(x))):B=!1}B&&(w.set(x,I),p(I,x,d,v,w),w.delete(x)),q1(n,a,I)}function ff(n,r){var a=n.length;if(a)return r+=r<0?a:0,_n(r,a)?n[r]:i}function pf(n,r,a){r.length?r=$t(r,function(v){return tt(v)?function(w){return wr(w,v.length===1?v[0]:v)}:v}):r=[ze];var d=-1;r=$t(r,ni(j()));var p=uf(n,function(v,w,y){var x=$t(r,function(T){return T(v)});return{criteria:x,index:++d,value:v}});return H7(p,function(v,w){return kg(v,w,a)})}function gg(n,r){return gf(n,r,function(a,d){return Mu(n,d)})}function gf(n,r,a){for(var d=-1,p=r.length,v={};++d<p;){var w=r[d],y=wr(n,w);a(y,w)&&go(v,Xn(w,n),y)}return v}function mg(n){return function(r){return wr(r,n)}}function iu(n,r,a,d){var p=d?N7:cs,v=-1,w=r.length,y=n;for(n===r&&(r=He(r)),a&&(y=$t(n,ni(a)));++v<w;)for(var x=0,T=r[v],I=a?a(T):T;(x=p(y,I,x,d))>-1;)y!==n&&Va.call(y,x,1),Va.call(n,x,1);return n}function mf(n,r){for(var a=n?r.length:0,d=a-1;a--;){var p=r[a];if(a==d||p!==v){var v=p;_n(p)?Va.call(n,p,1):ou(n,p)}}return n}function nu(n,r){return n+Wa(X3()*(r-n+1))}function vg(n,r,a,d){for(var p=-1,v=ae(za((r-n)/(a||1)),0),w=S(v);v--;)w[d?v:++p]=n,n+=a;return w}function ru(n,r){var a="";if(!n||r<1||r>ei)return a;do r%2&&(a+=n),r=Wa(r/2),r&&(n+=n);while(r);return a}function rt(n,r){return yu(Zf(n,r,ze),n+"")}function _g(n){return J3(bs(n))}function wg(n,r){var a=bs(n);return cc(a,_r(r,0,a.length))}function go(n,r,a,d){if(!Vt(n))return n;r=Xn(r,n);for(var p=-1,v=r.length,w=v-1,y=n;y!=null&&++p<v;){var x=Yi(r[p]),T=a;if(x==="__proto__"||x==="constructor"||x==="prototype")return n;if(p!=w){var I=y[x];T=d?d(I,x,y):i,T===i&&(T=Vt(I)?I:_n(r[p+1])?[]:{})}uo(y,x,T),y=y[x]}return n}var vf=Za?function(n,r){return Za.set(n,r),n}:ze,bg=Ga?function(n,r){return Ga(n,"toString",{configurable:!0,enumerable:!1,value:Iu(r),writable:!0})}:ze;function yg(n){return cc(bs(n))}function Ci(n,r,a){var d=-1,p=n.length;r<0&&(r=-r>p?0:p+r),a=a>p?p:a,a<0&&(a+=p),p=r>a?0:a-r>>>0,r>>>=0;for(var v=S(p);++d<p;)v[d]=n[d+r];return v}function Cg(n,r){var a;return qn(n,function(d,p,v){return a=r(d,p,v),!a}),!!a}function Qa(n,r,a){var d=0,p=n==null?d:n.length;if(typeof r=="number"&&r===r&&p<=b1){for(;d<p;){var v=d+p>>>1,w=n[v];w!==null&&!si(w)&&(a?w<=r:w<r)?d=v+1:p=v}return p}return su(n,r,ze,a)}function su(n,r,a,d){var p=0,v=n==null?0:n.length;if(v===0)return 0;r=a(r);for(var w=r!==r,y=r===null,x=si(r),T=r===i;p<v;){var I=Wa((p+v)/2),B=a(n[I]),O=B!==i,V=B===null,K=B===B,nt=si(B);if(w)var Y=d||K;else T?Y=K&&(d||O):y?Y=K&&O&&(d||!V):x?Y=K&&O&&!V&&(d||!nt):V||nt?Y=!1:Y=d?B<=r:B<r;Y?p=I+1:v=I}return ve(v,ke)}function _f(n,r){for(var a=-1,d=n.length,p=0,v=[];++a<d;){var w=n[a],y=r?r(w):w;if(!a||!Ri(y,x)){var x=y;v[p++]=w===0?0:w}}return v}function wf(n){return typeof n=="number"?n:si(n)?rs:+n}function ri(n){if(typeof n=="string")return n;if(tt(n))return $t(n,ri)+"";if(si(n))return K3?K3.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function jn(n,r,a){var d=-1,p=Fa,v=n.length,w=!0,y=[],x=y;if(a)w=!1,p=R1;else if(v>=o){var T=r?null:Bg(n);if(T)return Ra(T);w=!1,p=ro,x=new vr}else x=r?[]:y;t:for(;++d<v;){var I=n[d],B=r?r(I):I;if(I=a||I!==0?I:0,w&&B===B){for(var O=x.length;O--;)if(x[O]===B)continue t;r&&x.push(B),y.push(I)}else p(x,B,a)||(x!==y&&x.push(B),y.push(I))}return y}function ou(n,r){return r=Xn(r,n),n=qf(n,r),n==null||delete n[Yi(xi(r))]}function bf(n,r,a,d){return go(n,r,a(wr(n,r)),d)}function tc(n,r,a,d){for(var p=n.length,v=d?p:-1;(d?v--:++v<p)&&r(n[v],v,n););return a?Ci(n,d?0:v,d?v+1:p):Ci(n,d?v+1:0,d?p:v)}function yf(n,r){var a=n;return a instanceof ut&&(a=a.value()),D1(r,function(d,p){return p.func.apply(p.thisArg,zn([d],p.args))},a)}function au(n,r,a){var d=n.length;if(d<2)return d?jn(n[0]):[];for(var p=-1,v=S(d);++p<d;)for(var w=n[p],y=-1;++y<d;)y!=p&&(v[p]=ho(v[p]||w,n[y],r,a));return jn(fe(v,1),r,a)}function Cf(n,r,a){for(var d=-1,p=n.length,v=r.length,w={};++d<p;){var y=d<v?r[d]:i;a(w,n[d],y)}return w}function cu(n){return Yt(n)?n:[]}function lu(n){return typeof n=="function"?n:ze}function Xn(n,r){return tt(n)?n:_u(n,r)?[n]:Yf(Et(n))}var xg=rt;function Kn(n,r,a){var d=n.length;return a=a===i?d:a,!r&&a>=d?n:Ci(n,r,a)}var xf=u8||function(n){return de.clearTimeout(n)};function Ef(n,r){if(r)return n.slice();var a=n.length,d=z3?z3(a):new n.constructor(a);return n.copy(d),d}function uu(n){var r=new n.constructor(n.byteLength);return new Na(r).set(new Na(n)),r}function Eg(n,r){var a=r?uu(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.byteLength)}function Ag(n){var r=new n.constructor(n.source,o3.exec(n));return r.lastIndex=n.lastIndex,r}function Sg(n){return lo?Lt(lo.call(n)):{}}function Af(n,r){var a=r?uu(n.buffer):n.buffer;return new n.constructor(a,n.byteOffset,n.length)}function Sf(n,r){if(n!==r){var a=n!==i,d=n===null,p=n===n,v=si(n),w=r!==i,y=r===null,x=r===r,T=si(r);if(!y&&!T&&!v&&n>r||v&&w&&x&&!y&&!T||d&&w&&x||!a&&x||!p)return 1;if(!d&&!v&&!T&&n<r||T&&a&&p&&!d&&!v||y&&a&&p||!w&&p||!x)return-1}return 0}function kg(n,r,a){for(var d=-1,p=n.criteria,v=r.criteria,w=p.length,y=a.length;++d<w;){var x=Sf(p[d],v[d]);if(x){if(d>=y)return x;var T=a[d];return x*(T=="desc"?-1:1)}}return n.index-r.index}function kf(n,r,a,d){for(var p=-1,v=n.length,w=a.length,y=-1,x=r.length,T=ae(v-w,0),I=S(x+T),B=!d;++y<x;)I[y]=r[y];for(;++p<w;)(B||p<v)&&(I[a[p]]=n[p]);for(;T--;)I[y++]=n[p++];return I}function Lf(n,r,a,d){for(var p=-1,v=n.length,w=-1,y=a.length,x=-1,T=r.length,I=ae(v-y,0),B=S(I+T),O=!d;++p<I;)B[p]=n[p];for(var V=p;++x<T;)B[V+x]=r[x];for(;++w<y;)(O||p<v)&&(B[V+a[w]]=n[p++]);return B}function He(n,r){var a=-1,d=n.length;for(r||(r=S(d));++a<d;)r[a]=n[a];return r}function Ki(n,r,a,d){var p=!a;a||(a={});for(var v=-1,w=r.length;++v<w;){var y=r[v],x=d?d(a[y],n[y],y,a,n):i;x===i&&(x=n[y]),p?gn(a,y,x):uo(a,y,x)}return a}function Lg(n,r){return Ki(n,vu(n),r)}function Mg(n,r){return Ki(n,Hf(n),r)}function ec(n,r){return function(a,d){var p=tt(a)?R7:Y8,v=r?r():{};return p(a,n,j(d,2),v)}}function ms(n){return rt(function(r,a){var d=-1,p=a.length,v=p>1?a[p-1]:i,w=p>2?a[2]:i;for(v=n.length>3&&typeof v=="function"?(p--,v):i,w&&Te(a[0],a[1],w)&&(v=p<3?i:v,p=1),r=Lt(r);++d<p;){var y=a[d];y&&n(r,y,d,v)}return r})}function Mf(n,r){return function(a,d){if(a==null)return a;if(!Ve(a))return n(a,d);for(var p=a.length,v=r?p:-1,w=Lt(a);(r?v--:++v<p)&&d(w[v],v,w)!==!1;);return a}}function Tf(n){return function(r,a,d){for(var p=-1,v=Lt(r),w=d(r),y=w.length;y--;){var x=w[n?y:++p];if(a(v[x],x,v)===!1)break}return r}}function Tg(n,r,a){var d=r&F,p=mo(n);function v(){var w=this&&this!==de&&this instanceof v?p:n;return w.apply(d?a:this,arguments)}return v}function If(n){return function(r){r=Et(r);var a=ls(r)?Fi(r):i,d=a?a[0]:r.charAt(0),p=a?Kn(a,1).join(""):r.slice(1);return d[n]()+p}}function vs(n){return function(r){return D1(M4(L4(r).replace(b7,"")),n,"")}}function mo(n){return function(){var r=arguments;switch(r.length){case 0:return new n;case 1:return new n(r[0]);case 2:return new n(r[0],r[1]);case 3:return new n(r[0],r[1],r[2]);case 4:return new n(r[0],r[1],r[2],r[3]);case 5:return new n(r[0],r[1],r[2],r[3],r[4]);case 6:return new n(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new n(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var a=gs(n.prototype),d=n.apply(a,r);return Vt(d)?d:a}}function Ig(n,r,a){var d=mo(n);function p(){for(var v=arguments.length,w=S(v),y=v,x=_s(p);y--;)w[y]=arguments[y];var T=v<3&&w[0]!==x&&w[v-1]!==x?[]:Wn(w,x);if(v-=T.length,v<a)return Of(n,r,ic,p.placeholder,i,w,T,i,i,a-v);var I=this&&this!==de&&this instanceof p?d:n;return ii(I,this,w)}return p}function Ff(n){return function(r,a,d){var p=Lt(r);if(!Ve(r)){var v=j(a,3);r=le(r),a=function(y){return v(p[y],y,p)}}var w=n(r,a,d);return w>-1?p[v?r[w]:w]:i}}function Bf(n){return vn(function(r){var a=r.length,d=a,p=bi.prototype.thru;for(n&&r.reverse();d--;){var v=r[d];if(typeof v!="function")throw new wi(l);if(p&&!w&&oc(v)=="wrapper")var w=new bi([],!0)}for(d=w?d:a;++d<a;){v=r[d];var y=oc(v),x=y=="wrapper"?gu(v):i;x&&wu(x[0])&&x[1]==(vt|R|X|J)&&!x[4].length&&x[9]==1?w=w[oc(x[0])].apply(w,x[3]):w=v.length==1&&wu(v)?w[y]():w.thru(v)}return function(){var T=arguments,I=T[0];if(w&&T.length==1&&tt(I))return w.plant(I).value();for(var B=0,O=a?r[B].apply(this,T):I;++B<a;)O=r[B].call(this,O);return O}})}function ic(n,r,a,d,p,v,w,y,x,T){var I=r&vt,B=r&F,O=r&M,V=r&(R|$),K=r&pt,nt=O?i:mo(n);function Y(){for(var ot=arguments.length,ft=S(ot),oi=ot;oi--;)ft[oi]=arguments[oi];if(V)var Ie=_s(Y),ai=G7(ft,Ie);if(d&&(ft=kf(ft,d,p,V)),v&&(ft=Lf(ft,v,w,V)),ot-=ai,V&&ot<T){var Jt=Wn(ft,Ie);return Of(n,r,ic,Y.placeholder,a,ft,Jt,y,x,T-ot)}var Di=B?a:this,yn=O?Di[n]:n;return ot=ft.length,y?ft=Yg(ft,y):K&&ot>1&&ft.reverse(),I&&x<ot&&(ft.length=x),this&&this!==de&&this instanceof Y&&(yn=nt||mo(yn)),yn.apply(Di,ft)}return Y}function Rf(n,r){return function(a,d){return sg(a,n,r(d),{})}}function nc(n,r){return function(a,d){var p;if(a===i&&d===i)return r;if(a!==i&&(p=a),d!==i){if(p===i)return d;typeof a=="string"||typeof d=="string"?(a=ri(a),d=ri(d)):(a=wf(a),d=wf(d)),p=n(a,d)}return p}}function hu(n){return vn(function(r){return r=$t(r,ni(j())),rt(function(a){var d=this;return n(r,function(p){return ii(p,d,a)})})})}function rc(n,r){r=r===i?" ":ri(r);var a=r.length;if(a<2)return a?ru(r,n):r;var d=ru(r,za(n/us(r)));return ls(r)?Kn(Fi(d),0,n).join(""):d.slice(0,n)}function Fg(n,r,a,d){var p=r&F,v=mo(n);function w(){for(var y=-1,x=arguments.length,T=-1,I=d.length,B=S(I+x),O=this&&this!==de&&this instanceof w?v:n;++T<I;)B[T]=d[T];for(;x--;)B[T++]=arguments[++y];return ii(O,p?a:this,B)}return w}function Df(n){return function(r,a,d){return d&&typeof d!="number"&&Te(r,a,d)&&(a=d=i),r=bn(r),a===i?(a=r,r=0):a=bn(a),d=d===i?r<a?1:-1:bn(d),vg(r,a,d,n)}}function sc(n){return function(r,a){return typeof r=="string"&&typeof a=="string"||(r=Ei(r),a=Ei(a)),n(r,a)}}function Of(n,r,a,d,p,v,w,y,x,T){var I=r&R,B=I?w:i,O=I?i:w,V=I?v:i,K=I?i:v;r|=I?X:N,r&=~(I?N:X),r&D||(r&=-4);var nt=[n,r,p,V,B,K,O,y,x,T],Y=a.apply(i,nt);return wu(n)&&jf(Y,nt),Y.placeholder=d,Xf(Y,n,r)}function du(n){var r=oe[n];return function(a,d){if(a=Ei(a),d=d==null?0:ve(it(d),292),d&&j3(a)){var p=(Et(a)+"e").split("e"),v=r(p[0]+"e"+(+p[1]+d));return p=(Et(v)+"e").split("e"),+(p[0]+"e"+(+p[1]-d))}return r(a)}}var Bg=fs&&1/Ra(new fs([,-0]))[1]==ur?function(n){return new fs(n)}:Ru;function Pf(n){return function(r){var a=_e(r);return a==Ue?V1(r):a==xt?K7(r):V7(r,n(r))}}function mn(n,r,a,d,p,v,w,y){var x=r&M;if(!x&&typeof n!="function")throw new wi(l);var T=d?d.length:0;if(T||(r&=-97,d=p=i),w=w===i?w:ae(it(w),0),y=y===i?y:it(y),T-=p?p.length:0,r&N){var I=d,B=p;d=p=i}var O=x?i:gu(n),V=[n,r,a,d,p,I,B,v,w,y];if(O&&jg(V,O),n=V[0],r=V[1],a=V[2],d=V[3],p=V[4],y=V[9]=V[9]===i?x?0:n.length:ae(V[9]-T,0),!y&&r&(R|$)&&(r&=-25),!r||r==F)var K=Tg(n,r,a);else r==R||r==$?K=Ig(n,r,y):(r==X||r==(F|X))&&!p.length?K=Fg(n,r,a,d):K=ic.apply(i,V);var nt=O?vf:jf;return Xf(nt(K,V),n,r)}function Uf(n,r,a,d){return n===i||Ri(n,ds[a])&&!At.call(d,a)?r:n}function $f(n,r,a,d,p,v){return Vt(n)&&Vt(r)&&(v.set(r,n),Ja(n,r,i,$f,v),v.delete(r)),n}function Rg(n){return wo(n)?i:n}function Nf(n,r,a,d,p,v){var w=a&A,y=n.length,x=r.length;if(y!=x&&!(w&&x>y))return!1;var T=v.get(n),I=v.get(r);if(T&&I)return T==r&&I==n;var B=-1,O=!0,V=a&k?new vr:i;for(v.set(n,r),v.set(r,n);++B<y;){var K=n[B],nt=r[B];if(d)var Y=w?d(nt,K,B,r,n,v):d(K,nt,B,n,r,v);if(Y!==i){if(Y)continue;O=!1;break}if(V){if(!O1(r,function(ot,ft){if(!ro(V,ft)&&(K===ot||p(K,ot,a,d,v)))return V.push(ft)})){O=!1;break}}else if(!(K===nt||p(K,nt,a,d,v))){O=!1;break}}return v.delete(n),v.delete(r),O}function Dg(n,r,a,d,p,v,w){switch(a){case Ne:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case $e:return!(n.byteLength!=r.byteLength||!v(new Na(n),new Na(r)));case hn:case hr:case os:return Ri(+n,+r);case dn:return n.name==r.name&&n.message==r.message;case lt:case me:return n==r+"";case Ue:var y=V1;case xt:var x=d&A;if(y||(y=Ra),n.size!=r.size&&!x)return!1;var T=w.get(n);if(T)return T==r;d|=k,w.set(n,r);var I=Nf(y(n),y(r),d,p,v,w);return w.delete(n),I;case $n:if(lo)return lo.call(n)==lo.call(r)}return!1}function Og(n,r,a,d,p,v){var w=a&A,y=fu(n),x=y.length,T=fu(r),I=T.length;if(x!=I&&!w)return!1;for(var B=x;B--;){var O=y[B];if(!(w?O in r:At.call(r,O)))return!1}var V=v.get(n),K=v.get(r);if(V&&K)return V==r&&K==n;var nt=!0;v.set(n,r),v.set(r,n);for(var Y=w;++B<x;){O=y[B];var ot=n[O],ft=r[O];if(d)var oi=w?d(ft,ot,O,r,n,v):d(ot,ft,O,n,r,v);if(!(oi===i?ot===ft||p(ot,ft,a,d,v):oi)){nt=!1;break}Y||(Y=O=="constructor")}if(nt&&!Y){var Ie=n.constructor,ai=r.constructor;Ie!=ai&&"constructor"in n&&"constructor"in r&&!(typeof Ie=="function"&&Ie instanceof Ie&&typeof ai=="function"&&ai instanceof ai)&&(nt=!1)}return v.delete(n),v.delete(r),nt}function vn(n){return yu(Zf(n,i,e4),n+"")}function fu(n){return of(n,le,vu)}function pu(n){return of(n,Ge,Hf)}var gu=Za?function(n){return Za.get(n)}:Ru;function oc(n){for(var r=n.name+"",a=ps[r],d=At.call(ps,r)?a.length:0;d--;){var p=a[d],v=p.func;if(v==null||v==n)return p.name}return r}function _s(n){var r=At.call(g,"placeholder")?g:n;return r.placeholder}function j(){var n=g.iteratee||Fu;return n=n===Fu?lf:n,arguments.length?n(arguments[0],arguments[1]):n}function ac(n,r){var a=n.__data__;return zg(r)?a[typeof r=="string"?"string":"hash"]:a.map}function mu(n){for(var r=le(n),a=r.length;a--;){var d=r[a],p=n[d];r[a]=[d,p,zf(p)]}return r}function br(n,r){var a=q7(n,r);return cf(a)?a:i}function Pg(n){var r=At.call(n,gr),a=n[gr];try{n[gr]=i;var d=!0}catch(v){}var p=Ua.call(n);return d&&(r?n[gr]=a:delete n[gr]),p}var vu=z1?function(n){return n==null?[]:(n=Lt(n),Gn(z1(n),function(r){return Z3.call(n,r)}))}:Du,Hf=z1?function(n){for(var r=[];n;)zn(r,vu(n)),n=Ha(n);return r}:Du,_e=Me;(W1&&_e(new W1(new ArrayBuffer(1)))!=Ne||oo&&_e(new oo)!=Ue||Z1&&_e(Z1.resolve())!=x1||fs&&_e(new fs)!=xt||ao&&_e(new ao)!=Nn)&&(_e=function(n){var r=Me(n),a=r==Zi?n.constructor:i,d=a?yr(a):"";if(d)switch(d){case w8:return Ne;case b8:return Ue;case y8:return x1;case C8:return xt;case x8:return Nn}return r});function Ug(n,r,a){for(var d=-1,p=a.length;++d<p;){var v=a[d],w=v.size;switch(v.type){case"drop":n+=w;break;case"dropRight":r-=w;break;case"take":r=ve(r,n+w);break;case"takeRight":n=ae(n,r-w);break}}return{start:n,end:r}}function $g(n){var r=n.match(W6);return r?r[1].split(Z6):[]}function Vf(n,r,a){r=Xn(r,n);for(var d=-1,p=r.length,v=!1;++d<p;){var w=Yi(r[d]);if(!(v=n!=null&&a(n,w)))break;n=n[w]}return v||++d!=p?v:(p=n==null?0:n.length,!!p&&pc(p)&&_n(w,p)&&(tt(n)||Cr(n)))}function Ng(n){var r=n.length,a=new n.constructor(r);return r&&typeof n[0]=="string"&&At.call(n,"index")&&(a.index=n.index,a.input=n.input),a}function Gf(n){return typeof n.constructor=="function"&&!vo(n)?gs(Ha(n)):{}}function Hg(n,r,a){var d=n.constructor;switch(r){case $e:return uu(n);case hn:case hr:return new d(+n);case Ne:return Eg(n,a);case qi:case dr:case Hn:case Vn:case ji:case io:case no:case fr:case E1:return Af(n,a);case Ue:return new d;case os:case me:return new d(n);case lt:return Ag(n);case xt:return new d;case $n:return Sg(n)}}function Vg(n,r){var a=r.length;if(!a)return n;var d=a-1;return r[d]=(a>1?"& ":"")+r[d],r=r.join(a>2?", ":" "),n.replace(z6,`{
3149
- /* [wrapped with `+r+`] */
3150
- `)}function Gg(n){return tt(n)||Cr(n)||!!(q3&&n&&n[q3])}function _n(n,r){var a=typeof n;return r=r==null?ei:r,!!r&&(a=="number"||a!="symbol"&&e7.test(n))&&n>-1&&n%1==0&&n<r}function Te(n,r,a){if(!Vt(a))return!1;var d=typeof r;return(d=="number"?Ve(a)&&_n(r,a.length):d=="string"&&r in a)?Ri(a[r],n):!1}function _u(n,r){if(tt(n))return!1;var a=typeof n;return a=="number"||a=="symbol"||a=="boolean"||n==null||si(n)?!0:N6.test(n)||!$6.test(n)||r!=null&&n in Lt(r)}function zg(n){var r=typeof n;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null}function wu(n){var r=oc(n),a=g[r];if(typeof a!="function"||!(r in ut.prototype))return!1;if(n===a)return!0;var d=gu(a);return!!d&&n===d[0]}function Wg(n){return!!G3&&G3 in n}var Zg=Oa?wn:Ou;function vo(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||ds;return n===a}function zf(n){return n===n&&!Vt(n)}function Wf(n,r){return function(a){return a==null?!1:a[n]===r&&(r!==i||n in Lt(a))}}function qg(n){var r=dc(n,function(d){return a.size===f&&a.clear(),d}),a=r.cache;return r}function jg(n,r){var a=n[1],d=r[1],p=a|d,v=p<(F|M|vt),w=d==vt&&a==R||d==vt&&a==J&&n[7].length<=r[8]||d==(vt|J)&&r[7].length<=r[8]&&a==R;if(!(v||w))return n;d&F&&(n[2]=r[2],p|=a&F?0:D);var y=r[3];if(y){var x=n[3];n[3]=x?kf(x,y,r[4]):y,n[4]=x?Wn(n[3],_):r[4]}return y=r[5],y&&(x=n[5],n[5]=x?Lf(x,y,r[6]):y,n[6]=x?Wn(n[5],_):r[6]),y=r[7],y&&(n[7]=y),d&vt&&(n[8]=n[8]==null?r[8]:ve(n[8],r[8])),n[9]==null&&(n[9]=r[9]),n[0]=r[0],n[1]=p,n}function Xg(n){var r=[];if(n!=null)for(var a in Lt(n))r.push(a);return r}function Kg(n){return Ua.call(n)}function Zf(n,r,a){return r=ae(r===i?n.length-1:r,0),function(){for(var d=arguments,p=-1,v=ae(d.length-r,0),w=S(v);++p<v;)w[p]=d[r+p];p=-1;for(var y=S(r+1);++p<r;)y[p]=d[p];return y[r]=a(w),ii(n,this,y)}}function qf(n,r){return r.length<2?n:wr(n,Ci(r,0,-1))}function Yg(n,r){for(var a=n.length,d=ve(r.length,a),p=He(n);d--;){var v=r[d];n[d]=_n(v,a)?p[v]:i}return n}function bu(n,r){if(!(r==="constructor"&&typeof n[r]=="function")&&r!="__proto__")return n[r]}var jf=Kf(vf),_o=d8||function(n,r){return de.setTimeout(n,r)},yu=Kf(bg);function Xf(n,r,a){var d=r+"";return yu(n,Vg(d,Jg($g(d),a)))}function Kf(n){var r=0,a=0;return function(){var d=m8(),p=Ii-(d-a);if(a=d,p>0){if(++r>=ne)return arguments[0]}else r=0;return n.apply(i,arguments)}}function cc(n,r){var a=-1,d=n.length,p=d-1;for(r=r===i?d:r;++a<r;){var v=nu(a,p),w=n[v];n[v]=n[a],n[a]=w}return n.length=r,n}var Yf=qg(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(H6,function(a,d,p,v){r.push(p?v.replace(X6,"$1"):d||a)}),r});function Yi(n){if(typeof n=="string"||si(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function yr(n){if(n!=null){try{return Pa.call(n)}catch(r){}try{return n+""}catch(r){}}return""}function Jg(n,r){return _i(y1,function(a){var d="_."+a[0];r&a[1]&&!Fa(n,d)&&n.push(d)}),n.sort()}function Jf(n){if(n instanceof ut)return n.clone();var r=new bi(n.__wrapped__,n.__chain__);return r.__actions__=He(n.__actions__),r.__index__=n.__index__,r.__values__=n.__values__,r}function Qg(n,r,a){(a?Te(n,r,a):r===i)?r=1:r=ae(it(r),0);var d=n==null?0:n.length;if(!d||r<1)return[];for(var p=0,v=0,w=S(za(d/r));p<d;)w[v++]=Ci(n,p,p+=r);return w}function t9(n){for(var r=-1,a=n==null?0:n.length,d=0,p=[];++r<a;){var v=n[r];v&&(p[d++]=v)}return p}function e9(){var n=arguments.length;if(!n)return[];for(var r=S(n-1),a=arguments[0],d=n;d--;)r[d-1]=arguments[d];return zn(tt(a)?He(a):[a],fe(r,1))}var i9=rt(function(n,r){return Yt(n)?ho(n,fe(r,1,Yt,!0)):[]}),n9=rt(function(n,r){var a=xi(r);return Yt(a)&&(a=i),Yt(n)?ho(n,fe(r,1,Yt,!0),j(a,2)):[]}),r9=rt(function(n,r){var a=xi(r);return Yt(a)&&(a=i),Yt(n)?ho(n,fe(r,1,Yt,!0),i,a):[]});function s9(n,r,a){var d=n==null?0:n.length;return d?(r=a||r===i?1:it(r),Ci(n,r<0?0:r,d)):[]}function o9(n,r,a){var d=n==null?0:n.length;return d?(r=a||r===i?1:it(r),r=d-r,Ci(n,0,r<0?0:r)):[]}function a9(n,r){return n&&n.length?tc(n,j(r,3),!0,!0):[]}function c9(n,r){return n&&n.length?tc(n,j(r,3),!0):[]}function l9(n,r,a,d){var p=n==null?0:n.length;return p?(a&&typeof a!="number"&&Te(n,r,a)&&(a=0,d=p),eg(n,r,a,d)):[]}function Qf(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=a==null?0:it(a);return p<0&&(p=ae(d+p,0)),Ba(n,j(r,3),p)}function t4(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=d-1;return a!==i&&(p=it(a),p=a<0?ae(d+p,0):ve(p,d-1)),Ba(n,j(r,3),p,!0)}function e4(n){var r=n==null?0:n.length;return r?fe(n,1):[]}function u9(n){var r=n==null?0:n.length;return r?fe(n,ur):[]}function h9(n,r){var a=n==null?0:n.length;return a?(r=r===i?1:it(r),fe(n,r)):[]}function d9(n){for(var r=-1,a=n==null?0:n.length,d={};++r<a;){var p=n[r];d[p[0]]=p[1]}return d}function i4(n){return n&&n.length?n[0]:i}function f9(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=a==null?0:it(a);return p<0&&(p=ae(d+p,0)),cs(n,r,p)}function p9(n){var r=n==null?0:n.length;return r?Ci(n,0,-1):[]}var g9=rt(function(n){var r=$t(n,cu);return r.length&&r[0]===n[0]?J1(r):[]}),m9=rt(function(n){var r=xi(n),a=$t(n,cu);return r===xi(a)?r=i:a.pop(),a.length&&a[0]===n[0]?J1(a,j(r,2)):[]}),v9=rt(function(n){var r=xi(n),a=$t(n,cu);return r=typeof r=="function"?r:i,r&&a.pop(),a.length&&a[0]===n[0]?J1(a,i,r):[]});function _9(n,r){return n==null?"":p8.call(n,r)}function xi(n){var r=n==null?0:n.length;return r?n[r-1]:i}function w9(n,r,a){var d=n==null?0:n.length;if(!d)return-1;var p=d;return a!==i&&(p=it(a),p=p<0?ae(d+p,0):ve(p,d-1)),r===r?J7(n,r,p):Ba(n,D3,p,!0)}function b9(n,r){return n&&n.length?ff(n,it(r)):i}var y9=rt(n4);function n4(n,r){return n&&n.length&&r&&r.length?iu(n,r):n}function C9(n,r,a){return n&&n.length&&r&&r.length?iu(n,r,j(a,2)):n}function x9(n,r,a){return n&&n.length&&r&&r.length?iu(n,r,i,a):n}var E9=vn(function(n,r){var a=n==null?0:n.length,d=j1(n,r);return mf(n,$t(r,function(p){return _n(p,a)?+p:p}).sort(Sf)),d});function A9(n,r){var a=[];if(!(n&&n.length))return a;var d=-1,p=[],v=n.length;for(r=j(r,3);++d<v;){var w=n[d];r(w,d,n)&&(a.push(w),p.push(d))}return mf(n,p),a}function Cu(n){return n==null?n:_8.call(n)}function S9(n,r,a){var d=n==null?0:n.length;return d?(a&&typeof a!="number"&&Te(n,r,a)?(r=0,a=d):(r=r==null?0:it(r),a=a===i?d:it(a)),Ci(n,r,a)):[]}function k9(n,r){return Qa(n,r)}function L9(n,r,a){return su(n,r,j(a,2))}function M9(n,r){var a=n==null?0:n.length;if(a){var d=Qa(n,r);if(d<a&&Ri(n[d],r))return d}return-1}function T9(n,r){return Qa(n,r,!0)}function I9(n,r,a){return su(n,r,j(a,2),!0)}function F9(n,r){var a=n==null?0:n.length;if(a){var d=Qa(n,r,!0)-1;if(Ri(n[d],r))return d}return-1}function B9(n){return n&&n.length?_f(n):[]}function R9(n,r){return n&&n.length?_f(n,j(r,2)):[]}function D9(n){var r=n==null?0:n.length;return r?Ci(n,1,r):[]}function O9(n,r,a){return n&&n.length?(r=a||r===i?1:it(r),Ci(n,0,r<0?0:r)):[]}function P9(n,r,a){var d=n==null?0:n.length;return d?(r=a||r===i?1:it(r),r=d-r,Ci(n,r<0?0:r,d)):[]}function U9(n,r){return n&&n.length?tc(n,j(r,3),!1,!0):[]}function $9(n,r){return n&&n.length?tc(n,j(r,3)):[]}var N9=rt(function(n){return jn(fe(n,1,Yt,!0))}),H9=rt(function(n){var r=xi(n);return Yt(r)&&(r=i),jn(fe(n,1,Yt,!0),j(r,2))}),V9=rt(function(n){var r=xi(n);return r=typeof r=="function"?r:i,jn(fe(n,1,Yt,!0),i,r)});function G9(n){return n&&n.length?jn(n):[]}function z9(n,r){return n&&n.length?jn(n,j(r,2)):[]}function W9(n,r){return r=typeof r=="function"?r:i,n&&n.length?jn(n,i,r):[]}function xu(n){if(!(n&&n.length))return[];var r=0;return n=Gn(n,function(a){if(Yt(a))return r=ae(a.length,r),!0}),N1(r,function(a){return $t(n,P1(a))})}function r4(n,r){if(!(n&&n.length))return[];var a=xu(n);return r==null?a:$t(a,function(d){return ii(r,i,d)})}var Z9=rt(function(n,r){return Yt(n)?ho(n,r):[]}),q9=rt(function(n){return au(Gn(n,Yt))}),j9=rt(function(n){var r=xi(n);return Yt(r)&&(r=i),au(Gn(n,Yt),j(r,2))}),X9=rt(function(n){var r=xi(n);return r=typeof r=="function"?r:i,au(Gn(n,Yt),i,r)}),K9=rt(xu);function Y9(n,r){return Cf(n||[],r||[],uo)}function J9(n,r){return Cf(n||[],r||[],go)}var Q9=rt(function(n){var r=n.length,a=r>1?n[r-1]:i;return a=typeof a=="function"?(n.pop(),a):i,r4(n,a)});function s4(n){var r=g(n);return r.__chain__=!0,r}function tm(n,r){return r(n),n}function lc(n,r){return r(n)}var em=vn(function(n){var r=n.length,a=r?n[0]:0,d=this.__wrapped__,p=function(v){return j1(v,n)};return r>1||this.__actions__.length||!(d instanceof ut)||!_n(a)?this.thru(p):(d=d.slice(a,+a+(r?1:0)),d.__actions__.push({func:lc,args:[p],thisArg:i}),new bi(d,this.__chain__).thru(function(v){return r&&!v.length&&v.push(i),v}))});function im(){return s4(this)}function nm(){return new bi(this.value(),this.__chain__)}function rm(){this.__values__===i&&(this.__values__=w4(this.value()));var n=this.__index__>=this.__values__.length,r=n?i:this.__values__[this.__index__++];return{done:n,value:r}}function sm(){return this}function om(n){for(var r,a=this;a instanceof ja;){var d=Jf(a);d.__index__=0,d.__values__=i,r?p.__wrapped__=d:r=d;var p=d;a=a.__wrapped__}return p.__wrapped__=n,r}function am(){var n=this.__wrapped__;if(n instanceof ut){var r=n;return this.__actions__.length&&(r=new ut(this)),r=r.reverse(),r.__actions__.push({func:lc,args:[Cu],thisArg:i}),new bi(r,this.__chain__)}return this.thru(Cu)}function cm(){return yf(this.__wrapped__,this.__actions__)}var lm=ec(function(n,r,a){At.call(n,a)?++n[a]:gn(n,a,1)});function um(n,r,a){var d=tt(n)?B3:tg;return a&&Te(n,r,a)&&(r=i),d(n,j(r,3))}function hm(n,r){var a=tt(n)?Gn:rf;return a(n,j(r,3))}var dm=Ff(Qf),fm=Ff(t4);function pm(n,r){return fe(uc(n,r),1)}function gm(n,r){return fe(uc(n,r),ur)}function mm(n,r,a){return a=a===i?1:it(a),fe(uc(n,r),a)}function o4(n,r){var a=tt(n)?_i:qn;return a(n,j(r,3))}function a4(n,r){var a=tt(n)?D7:nf;return a(n,j(r,3))}var vm=ec(function(n,r,a){At.call(n,a)?n[a].push(r):gn(n,a,[r])});function _m(n,r,a,d){n=Ve(n)?n:bs(n),a=a&&!d?it(a):0;var p=n.length;return a<0&&(a=ae(p+a,0)),gc(n)?a<=p&&n.indexOf(r,a)>-1:!!p&&cs(n,r,a)>-1}var wm=rt(function(n,r,a){var d=-1,p=typeof r=="function",v=Ve(n)?S(n.length):[];return qn(n,function(w){v[++d]=p?ii(r,w,a):fo(w,r,a)}),v}),bm=ec(function(n,r,a){gn(n,a,r)});function uc(n,r){var a=tt(n)?$t:uf;return a(n,j(r,3))}function ym(n,r,a,d){return n==null?[]:(tt(r)||(r=r==null?[]:[r]),a=d?i:a,tt(a)||(a=a==null?[]:[a]),pf(n,r,a))}var Cm=ec(function(n,r,a){n[a?0:1].push(r)},function(){return[[],[]]});function xm(n,r,a){var d=tt(n)?D1:P3,p=arguments.length<3;return d(n,j(r,4),a,p,qn)}function Em(n,r,a){var d=tt(n)?O7:P3,p=arguments.length<3;return d(n,j(r,4),a,p,nf)}function Am(n,r){var a=tt(n)?Gn:rf;return a(n,fc(j(r,3)))}function Sm(n){var r=tt(n)?J3:_g;return r(n)}function km(n,r,a){(a?Te(n,r,a):r===i)?r=1:r=it(r);var d=tt(n)?X8:wg;return d(n,r)}function Lm(n){var r=tt(n)?K8:yg;return r(n)}function Mm(n){if(n==null)return 0;if(Ve(n))return gc(n)?us(n):n.length;var r=_e(n);return r==Ue||r==xt?n.size:tu(n).length}function Tm(n,r,a){var d=tt(n)?O1:Cg;return a&&Te(n,r,a)&&(r=i),d(n,j(r,3))}var Im=rt(function(n,r){if(n==null)return[];var a=r.length;return a>1&&Te(n,r[0],r[1])?r=[]:a>2&&Te(r[0],r[1],r[2])&&(r=[r[0]]),pf(n,fe(r,1),[])}),hc=h8||function(){return de.Date.now()};function Fm(n,r){if(typeof r!="function")throw new wi(l);return n=it(n),function(){if(--n<1)return r.apply(this,arguments)}}function c4(n,r,a){return r=a?i:r,r=n&&r==null?n.length:r,mn(n,vt,i,i,i,i,r)}function l4(n,r){var a;if(typeof r!="function")throw new wi(l);return n=it(n),function(){return--n>0&&(a=r.apply(this,arguments)),n<=1&&(r=i),a}}var Eu=rt(function(n,r,a){var d=F;if(a.length){var p=Wn(a,_s(Eu));d|=X}return mn(n,d,r,a,p)}),u4=rt(function(n,r,a){var d=F|M;if(a.length){var p=Wn(a,_s(u4));d|=X}return mn(r,d,n,a,p)});function h4(n,r,a){r=a?i:r;var d=mn(n,R,i,i,i,i,i,r);return d.placeholder=h4.placeholder,d}function d4(n,r,a){r=a?i:r;var d=mn(n,$,i,i,i,i,i,r);return d.placeholder=d4.placeholder,d}function f4(n,r,a){var d,p,v,w,y,x,T=0,I=!1,B=!1,O=!0;if(typeof n!="function")throw new wi(l);r=Ei(r)||0,Vt(a)&&(I=!!a.leading,B="maxWait"in a,v=B?ae(Ei(a.maxWait)||0,r):v,O="trailing"in a?!!a.trailing:O);function V(Jt){var Di=d,yn=p;return d=p=i,T=Jt,w=n.apply(yn,Di),w}function K(Jt){return T=Jt,y=_o(ot,r),I?V(Jt):w}function nt(Jt){var Di=Jt-x,yn=Jt-T,F4=r-Di;return B?ve(F4,v-yn):F4}function Y(Jt){var Di=Jt-x,yn=Jt-T;return x===i||Di>=r||Di<0||B&&yn>=v}function ot(){var Jt=hc();if(Y(Jt))return ft(Jt);y=_o(ot,nt(Jt))}function ft(Jt){return y=i,O&&d?V(Jt):(d=p=i,w)}function oi(){y!==i&&xf(y),T=0,d=x=p=y=i}function Ie(){return y===i?w:ft(hc())}function ai(){var Jt=hc(),Di=Y(Jt);if(d=arguments,p=this,x=Jt,Di){if(y===i)return K(x);if(B)return xf(y),y=_o(ot,r),V(x)}return y===i&&(y=_o(ot,r)),w}return ai.cancel=oi,ai.flush=Ie,ai}var Bm=rt(function(n,r){return ef(n,1,r)}),Rm=rt(function(n,r,a){return ef(n,Ei(r)||0,a)});function Dm(n){return mn(n,pt)}function dc(n,r){if(typeof n!="function"||r!=null&&typeof r!="function")throw new wi(l);var a=function(){var d=arguments,p=r?r.apply(this,d):d[0],v=a.cache;if(v.has(p))return v.get(p);var w=n.apply(this,d);return a.cache=v.set(p,w)||v,w};return a.cache=new(dc.Cache||pn),a}dc.Cache=pn;function fc(n){if(typeof n!="function")throw new wi(l);return function(){var r=arguments;switch(r.length){case 0:return!n.call(this);case 1:return!n.call(this,r[0]);case 2:return!n.call(this,r[0],r[1]);case 3:return!n.call(this,r[0],r[1],r[2])}return!n.apply(this,r)}}function Om(n){return l4(2,n)}var Pm=xg(function(n,r){r=r.length==1&&tt(r[0])?$t(r[0],ni(j())):$t(fe(r,1),ni(j()));var a=r.length;return rt(function(d){for(var p=-1,v=ve(d.length,a);++p<v;)d[p]=r[p].call(this,d[p]);return ii(n,this,d)})}),Au=rt(function(n,r){var a=Wn(r,_s(Au));return mn(n,X,i,r,a)}),p4=rt(function(n,r){var a=Wn(r,_s(p4));return mn(n,N,i,r,a)}),Um=vn(function(n,r){return mn(n,J,i,i,i,r)});function $m(n,r){if(typeof n!="function")throw new wi(l);return r=r===i?r:it(r),rt(n,r)}function Nm(n,r){if(typeof n!="function")throw new wi(l);return r=r==null?0:ae(it(r),0),rt(function(a){var d=a[r],p=Kn(a,0,r);return d&&zn(p,d),ii(n,this,p)})}function Hm(n,r,a){var d=!0,p=!0;if(typeof n!="function")throw new wi(l);return Vt(a)&&(d="leading"in a?!!a.leading:d,p="trailing"in a?!!a.trailing:p),f4(n,r,{leading:d,maxWait:r,trailing:p})}function Vm(n){return c4(n,1)}function Gm(n,r){return Au(lu(r),n)}function zm(){if(!arguments.length)return[];var n=arguments[0];return tt(n)?n:[n]}function Wm(n){return yi(n,E)}function Zm(n,r){return r=typeof r=="function"?r:i,yi(n,E,r)}function qm(n){return yi(n,m|E)}function jm(n,r){return r=typeof r=="function"?r:i,yi(n,m|E,r)}function Xm(n,r){return r==null||tf(n,r,le(r))}function Ri(n,r){return n===r||n!==n&&r!==r}var Km=sc(Y1),Ym=sc(function(n,r){return n>=r}),Cr=af(function(){return arguments}())?af:function(n){return qt(n)&&At.call(n,"callee")&&!Z3.call(n,"callee")},tt=S.isArray,Jm=k3?ni(k3):og;function Ve(n){return n!=null&&pc(n.length)&&!wn(n)}function Yt(n){return qt(n)&&Ve(n)}function Qm(n){return n===!0||n===!1||qt(n)&&Me(n)==hn}var Yn=f8||Ou,tv=L3?ni(L3):ag;function ev(n){return qt(n)&&n.nodeType===1&&!wo(n)}function iv(n){if(n==null)return!0;if(Ve(n)&&(tt(n)||typeof n=="string"||typeof n.splice=="function"||Yn(n)||ws(n)||Cr(n)))return!n.length;var r=_e(n);if(r==Ue||r==xt)return!n.size;if(vo(n))return!tu(n).length;for(var a in n)if(At.call(n,a))return!1;return!0}function nv(n,r){return po(n,r)}function rv(n,r,a){a=typeof a=="function"?a:i;var d=a?a(n,r):i;return d===i?po(n,r,i,a):!!d}function Su(n){if(!qt(n))return!1;var r=Me(n);return r==dn||r==C1||typeof n.message=="string"&&typeof n.name=="string"&&!wo(n)}function sv(n){return typeof n=="number"&&j3(n)}function wn(n){if(!Vt(n))return!1;var r=Me(n);return r==Wi||r==eo||r==to||r==i3}function g4(n){return typeof n=="number"&&n==it(n)}function pc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ei}function Vt(n){var r=typeof n;return n!=null&&(r=="object"||r=="function")}function qt(n){return n!=null&&typeof n=="object"}var m4=M3?ni(M3):lg;function ov(n,r){return n===r||Q1(n,r,mu(r))}function av(n,r,a){return a=typeof a=="function"?a:i,Q1(n,r,mu(r),a)}function cv(n){return v4(n)&&n!=+n}function lv(n){if(Zg(n))throw new Q(c);return cf(n)}function uv(n){return n===null}function hv(n){return n==null}function v4(n){return typeof n=="number"||qt(n)&&Me(n)==os}function wo(n){if(!qt(n)||Me(n)!=Zi)return!1;var r=Ha(n);if(r===null)return!0;var a=At.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&Pa.call(a)==a8}var ku=T3?ni(T3):ug;function dv(n){return g4(n)&&n>=-9007199254740991&&n<=ei}var _4=I3?ni(I3):hg;function gc(n){return typeof n=="string"||!tt(n)&&qt(n)&&Me(n)==me}function si(n){return typeof n=="symbol"||qt(n)&&Me(n)==$n}var ws=F3?ni(F3):dg;function fv(n){return n===i}function pv(n){return qt(n)&&_e(n)==Nn}function gv(n){return qt(n)&&Me(n)==La}var mv=sc(eu),vv=sc(function(n,r){return n<=r});function w4(n){if(!n)return[];if(Ve(n))return gc(n)?Fi(n):He(n);if(so&&n[so])return X7(n[so]());var r=_e(n),a=r==Ue?V1:r==xt?Ra:bs;return a(n)}function bn(n){if(!n)return n===0?n:0;if(n=Ei(n),n===ur||n===-1/0){var r=n<0?-1:1;return r*ka}return n===n?n:0}function it(n){var r=bn(n),a=r%1;return r===r?a?r-a:r:0}function b4(n){return n?_r(it(n),0,Pe):0}function Ei(n){if(typeof n=="number")return n;if(si(n))return rs;if(Vt(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=Vt(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=U3(n);var a=J6.test(n);return a||t7.test(n)?F7(n.slice(2),a?2:8):Y6.test(n)?rs:+n}function y4(n){return Ki(n,Ge(n))}function _v(n){return n?_r(it(n),-9007199254740991,ei):n===0?n:0}function Et(n){return n==null?"":ri(n)}var wv=ms(function(n,r){if(vo(r)||Ve(r)){Ki(r,le(r),n);return}for(var a in r)At.call(r,a)&&uo(n,a,r[a])}),C4=ms(function(n,r){Ki(r,Ge(r),n)}),mc=ms(function(n,r,a,d){Ki(r,Ge(r),n,d)}),bv=ms(function(n,r,a,d){Ki(r,le(r),n,d)}),yv=vn(j1);function Cv(n,r){var a=gs(n);return r==null?a:Q3(a,r)}var xv=rt(function(n,r){n=Lt(n);var a=-1,d=r.length,p=d>2?r[2]:i;for(p&&Te(r[0],r[1],p)&&(d=1);++a<d;)for(var v=r[a],w=Ge(v),y=-1,x=w.length;++y<x;){var T=w[y],I=n[T];(I===i||Ri(I,ds[T])&&!At.call(n,T))&&(n[T]=v[T])}return n}),Ev=rt(function(n){return n.push(i,$f),ii(x4,i,n)});function Av(n,r){return R3(n,j(r,3),Xi)}function Sv(n,r){return R3(n,j(r,3),K1)}function kv(n,r){return n==null?n:X1(n,j(r,3),Ge)}function Lv(n,r){return n==null?n:sf(n,j(r,3),Ge)}function Mv(n,r){return n&&Xi(n,j(r,3))}function Tv(n,r){return n&&K1(n,j(r,3))}function Iv(n){return n==null?[]:Ya(n,le(n))}function Fv(n){return n==null?[]:Ya(n,Ge(n))}function Lu(n,r,a){var d=n==null?i:wr(n,r);return d===i?a:d}function Bv(n,r){return n!=null&&Vf(n,r,ig)}function Mu(n,r){return n!=null&&Vf(n,r,ng)}var Rv=Rf(function(n,r,a){r!=null&&typeof r.toString!="function"&&(r=Ua.call(r)),n[r]=a},Iu(ze)),Dv=Rf(function(n,r,a){r!=null&&typeof r.toString!="function"&&(r=Ua.call(r)),At.call(n,r)?n[r].push(a):n[r]=[a]},j),Ov=rt(fo);function le(n){return Ve(n)?Y3(n):tu(n)}function Ge(n){return Ve(n)?Y3(n,!0):fg(n)}function Pv(n,r){var a={};return r=j(r,3),Xi(n,function(d,p,v){gn(a,r(d,p,v),d)}),a}function Uv(n,r){var a={};return r=j(r,3),Xi(n,function(d,p,v){gn(a,p,r(d,p,v))}),a}var $v=ms(function(n,r,a){Ja(n,r,a)}),x4=ms(function(n,r,a,d){Ja(n,r,a,d)}),Nv=vn(function(n,r){var a={};if(n==null)return a;var d=!1;r=$t(r,function(v){return v=Xn(v,n),d||(d=v.length>1),v}),Ki(n,pu(n),a),d&&(a=yi(a,m|b|E,Rg));for(var p=r.length;p--;)ou(a,r[p]);return a});function Hv(n,r){return E4(n,fc(j(r)))}var Vv=vn(function(n,r){return n==null?{}:gg(n,r)});function E4(n,r){if(n==null)return{};var a=$t(pu(n),function(d){return[d]});return r=j(r),gf(n,a,function(d,p){return r(d,p[0])})}function Gv(n,r,a){r=Xn(r,n);var d=-1,p=r.length;for(p||(p=1,n=i);++d<p;){var v=n==null?i:n[Yi(r[d])];v===i&&(d=p,v=a),n=wn(v)?v.call(n):v}return n}function zv(n,r,a){return n==null?n:go(n,r,a)}function Wv(n,r,a,d){return d=typeof d=="function"?d:i,n==null?n:go(n,r,a,d)}var A4=Pf(le),S4=Pf(Ge);function Zv(n,r,a){var d=tt(n),p=d||Yn(n)||ws(n);if(r=j(r,4),a==null){var v=n&&n.constructor;p?a=d?new v:[]:Vt(n)?a=wn(v)?gs(Ha(n)):{}:a={}}return(p?_i:Xi)(n,function(w,y,x){return r(a,w,y,x)}),a}function qv(n,r){return n==null?!0:ou(n,r)}function jv(n,r,a){return n==null?n:bf(n,r,lu(a))}function Xv(n,r,a,d){return d=typeof d=="function"?d:i,n==null?n:bf(n,r,lu(a),d)}function bs(n){return n==null?[]:H1(n,le(n))}function Kv(n){return n==null?[]:H1(n,Ge(n))}function Yv(n,r,a){return a===i&&(a=r,r=i),a!==i&&(a=Ei(a),a=a===a?a:0),r!==i&&(r=Ei(r),r=r===r?r:0),_r(Ei(n),r,a)}function Jv(n,r,a){return r=bn(r),a===i?(a=r,r=0):a=bn(a),n=Ei(n),rg(n,r,a)}function Qv(n,r,a){if(a&&typeof a!="boolean"&&Te(n,r,a)&&(r=a=i),a===i&&(typeof r=="boolean"?(a=r,r=i):typeof n=="boolean"&&(a=n,n=i)),n===i&&r===i?(n=0,r=1):(n=bn(n),r===i?(r=n,n=0):r=bn(r)),n>r){var d=n;n=r,r=d}if(a||n%1||r%1){var p=X3();return ve(n+p*(r-n+I7("1e-"+((p+"").length-1))),r)}return nu(n,r)}var t_=vs(function(n,r,a){return r=r.toLowerCase(),n+(a?k4(r):r)});function k4(n){return Tu(Et(n).toLowerCase())}function L4(n){return n=Et(n),n&&n.replace(i7,z7).replace(y7,"")}function e_(n,r,a){n=Et(n),r=ri(r);var d=n.length;a=a===i?d:_r(it(a),0,d);var p=a;return a-=r.length,a>=0&&n.slice(a,p)==r}function i_(n){return n=Et(n),n&&O6.test(n)?n.replace(r3,W7):n}function n_(n){return n=Et(n),n&&V6.test(n)?n.replace(A1,"\\$&"):n}var r_=vs(function(n,r,a){return n+(a?"-":"")+r.toLowerCase()}),s_=vs(function(n,r,a){return n+(a?" ":"")+r.toLowerCase()}),o_=If("toLowerCase");function a_(n,r,a){n=Et(n),r=it(r);var d=r?us(n):0;if(!r||d>=r)return n;var p=(r-d)/2;return rc(Wa(p),a)+n+rc(za(p),a)}function c_(n,r,a){n=Et(n),r=it(r);var d=r?us(n):0;return r&&d<r?n+rc(r-d,a):n}function l_(n,r,a){n=Et(n),r=it(r);var d=r?us(n):0;return r&&d<r?rc(r-d,a)+n:n}function u_(n,r,a){return a||r==null?r=0:r&&(r=+r),v8(Et(n).replace(S1,""),r||0)}function h_(n,r,a){return(a?Te(n,r,a):r===i)?r=1:r=it(r),ru(Et(n),r)}function d_(){var n=arguments,r=Et(n[0]);return n.length<3?r:r.replace(n[1],n[2])}var f_=vs(function(n,r,a){return n+(a?"_":"")+r.toLowerCase()});function p_(n,r,a){return a&&typeof a!="number"&&Te(n,r,a)&&(r=a=i),a=a===i?Pe:a>>>0,a?(n=Et(n),n&&(typeof r=="string"||r!=null&&!ku(r))&&(r=ri(r),!r&&ls(n))?Kn(Fi(n),0,a):n.split(r,a)):[]}var g_=vs(function(n,r,a){return n+(a?" ":"")+Tu(r)});function m_(n,r,a){return n=Et(n),a=a==null?0:_r(it(a),0,n.length),r=ri(r),n.slice(a,a+r.length)==r}function v_(n,r,a){var d=g.templateSettings;a&&Te(n,r,a)&&(r=i),n=Et(n),r=mc({},r,d,Uf);var p=mc({},r.imports,d.imports,Uf),v=le(p),w=H1(p,v),y,x,T=0,I=r.interpolate||Ma,B="__p += '",O=G1((r.escape||Ma).source+"|"+I.source+"|"+(I===s3?K6:Ma).source+"|"+(r.evaluate||Ma).source+"|$","g"),V="//# sourceURL="+(At.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++S7+"]")+`
3151
- `;n.replace(O,function(Y,ot,ft,oi,Ie,ai){return ft||(ft=oi),B+=n.slice(T,ai).replace(n7,Z7),ot&&(y=!0,B+=`' +
3152
- __e(`+ot+`) +
3153
- '`),Ie&&(x=!0,B+=`';
3154
- `+Ie+`;
3155
- __p += '`),ft&&(B+=`' +
3156
- ((__t = (`+ft+`)) == null ? '' : __t) +
3157
- '`),T=ai+Y.length,Y}),B+=`';
3158
- `;var K=At.call(r,"variable")&&r.variable;if(!K)B=`with (obj) {
3159
- `+B+`
3160
- }
3161
- `;else if(j6.test(K))throw new Q(u);B=(x?B.replace(F6,""):B).replace(B6,"$1").replace(R6,"$1;"),B="function("+(K||"obj")+`) {
3162
- `+(K?"":`obj || (obj = {});
3163
- `)+"var __t, __p = ''"+(y?", __e = _.escape":"")+(x?`, __j = Array.prototype.join;
3164
- function print() { __p += __j.call(arguments, '') }
3165
- `:`;
3166
- `)+B+`return __p
3167
- }`;var nt=T4(function(){return _t(v,V+"return "+B).apply(i,w)});if(nt.source=B,Su(nt))throw nt;return nt}function __(n){return Et(n).toLowerCase()}function w_(n){return Et(n).toUpperCase()}function b_(n,r,a){if(n=Et(n),n&&(a||r===i))return U3(n);if(!n||!(r=ri(r)))return n;var d=Fi(n),p=Fi(r),v=$3(d,p),w=N3(d,p)+1;return Kn(d,v,w).join("")}function y_(n,r,a){if(n=Et(n),n&&(a||r===i))return n.slice(0,V3(n)+1);if(!n||!(r=ri(r)))return n;var d=Fi(n),p=N3(d,Fi(r))+1;return Kn(d,0,p).join("")}function C_(n,r,a){if(n=Et(n),n&&(a||r===i))return n.replace(S1,"");if(!n||!(r=ri(r)))return n;var d=Fi(n),p=$3(d,Fi(r));return Kn(d,p).join("")}function x_(n,r){var a=kt,d=Zt;if(Vt(r)){var p="separator"in r?r.separator:p;a="length"in r?it(r.length):a,d="omission"in r?ri(r.omission):d}n=Et(n);var v=n.length;if(ls(n)){var w=Fi(n);v=w.length}if(a>=v)return n;var y=a-us(d);if(y<1)return d;var x=w?Kn(w,0,y).join(""):n.slice(0,y);if(p===i)return x+d;if(w&&(y+=x.length-y),ku(p)){if(n.slice(y).search(p)){var T,I=x;for(p.global||(p=G1(p.source,Et(o3.exec(p))+"g")),p.lastIndex=0;T=p.exec(I);)var B=T.index;x=x.slice(0,B===i?y:B)}}else if(n.indexOf(ri(p),y)!=y){var O=x.lastIndexOf(p);O>-1&&(x=x.slice(0,O))}return x+d}function E_(n){return n=Et(n),n&&D6.test(n)?n.replace(n3,Q7):n}var A_=vs(function(n,r,a){return n+(a?" ":"")+r.toUpperCase()}),Tu=If("toUpperCase");function M4(n,r,a){return n=Et(n),r=a?i:r,r===i?j7(n)?i8(n):$7(n):n.match(r)||[]}var T4=rt(function(n,r){try{return ii(n,i,r)}catch(a){return Su(a)?a:new Q(a)}}),S_=vn(function(n,r){return _i(r,function(a){a=Yi(a),gn(n,a,Eu(n[a],n))}),n});function k_(n){var r=n==null?0:n.length,a=j();return n=r?$t(n,function(d){if(typeof d[1]!="function")throw new wi(l);return[a(d[0]),d[1]]}):[],rt(function(d){for(var p=-1;++p<r;){var v=n[p];if(ii(v[0],this,d))return ii(v[1],this,d)}})}function L_(n){return Q8(yi(n,m))}function Iu(n){return function(){return n}}function M_(n,r){return n==null||n!==n?r:n}var T_=Bf(),I_=Bf(!0);function ze(n){return n}function Fu(n){return lf(typeof n=="function"?n:yi(n,m))}function F_(n){return hf(yi(n,m))}function B_(n,r){return df(n,yi(r,m))}var R_=rt(function(n,r){return function(a){return fo(a,n,r)}}),D_=rt(function(n,r){return function(a){return fo(n,a,r)}});function Bu(n,r,a){var d=le(r),p=Ya(r,d);a==null&&!(Vt(r)&&(p.length||!d.length))&&(a=r,r=n,n=this,p=Ya(r,le(r)));var v=!(Vt(a)&&"chain"in a)||!!a.chain,w=wn(n);return _i(p,function(y){var x=r[y];n[y]=x,w&&(n.prototype[y]=function(){var T=this.__chain__;if(v||T){var I=n(this.__wrapped__),B=I.__actions__=He(this.__actions__);return B.push({func:x,args:arguments,thisArg:n}),I.__chain__=T,I}return x.apply(n,zn([this.value()],arguments))})}),n}function O_(){return de._===this&&(de._=c8),this}function Ru(){}function P_(n){return n=it(n),rt(function(r){return ff(r,n)})}var U_=hu($t),$_=hu(B3),N_=hu(O1);function I4(n){return _u(n)?P1(Yi(n)):mg(n)}function H_(n){return function(r){return n==null?i:wr(n,r)}}var V_=Df(),G_=Df(!0);function Du(){return[]}function Ou(){return!1}function z_(){return{}}function W_(){return""}function Z_(){return!0}function q_(n,r){if(n=it(n),n<1||n>ei)return[];var a=Pe,d=ve(n,Pe);r=j(r),n-=Pe;for(var p=N1(d,r);++a<n;)r(a);return p}function j_(n){return tt(n)?$t(n,Yi):si(n)?[n]:He(Yf(Et(n)))}function X_(n){var r=++o8;return Et(n)+r}var K_=nc(function(n,r){return n+r},0),Y_=du("ceil"),J_=nc(function(n,r){return n/r},1),Q_=du("floor");function tw(n){return n&&n.length?Ka(n,ze,Y1):i}function ew(n,r){return n&&n.length?Ka(n,j(r,2),Y1):i}function iw(n){return O3(n,ze)}function nw(n,r){return O3(n,j(r,2))}function rw(n){return n&&n.length?Ka(n,ze,eu):i}function sw(n,r){return n&&n.length?Ka(n,j(r,2),eu):i}var ow=nc(function(n,r){return n*r},1),aw=du("round"),cw=nc(function(n,r){return n-r},0);function lw(n){return n&&n.length?$1(n,ze):0}function uw(n,r){return n&&n.length?$1(n,j(r,2)):0}return g.after=Fm,g.ary=c4,g.assign=wv,g.assignIn=C4,g.assignInWith=mc,g.assignWith=bv,g.at=yv,g.before=l4,g.bind=Eu,g.bindAll=S_,g.bindKey=u4,g.castArray=zm,g.chain=s4,g.chunk=Qg,g.compact=t9,g.concat=e9,g.cond=k_,g.conforms=L_,g.constant=Iu,g.countBy=lm,g.create=Cv,g.curry=h4,g.curryRight=d4,g.debounce=f4,g.defaults=xv,g.defaultsDeep=Ev,g.defer=Bm,g.delay=Rm,g.difference=i9,g.differenceBy=n9,g.differenceWith=r9,g.drop=s9,g.dropRight=o9,g.dropRightWhile=a9,g.dropWhile=c9,g.fill=l9,g.filter=hm,g.flatMap=pm,g.flatMapDeep=gm,g.flatMapDepth=mm,g.flatten=e4,g.flattenDeep=u9,g.flattenDepth=h9,g.flip=Dm,g.flow=T_,g.flowRight=I_,g.fromPairs=d9,g.functions=Iv,g.functionsIn=Fv,g.groupBy=vm,g.initial=p9,g.intersection=g9,g.intersectionBy=m9,g.intersectionWith=v9,g.invert=Rv,g.invertBy=Dv,g.invokeMap=wm,g.iteratee=Fu,g.keyBy=bm,g.keys=le,g.keysIn=Ge,g.map=uc,g.mapKeys=Pv,g.mapValues=Uv,g.matches=F_,g.matchesProperty=B_,g.memoize=dc,g.merge=$v,g.mergeWith=x4,g.method=R_,g.methodOf=D_,g.mixin=Bu,g.negate=fc,g.nthArg=P_,g.omit=Nv,g.omitBy=Hv,g.once=Om,g.orderBy=ym,g.over=U_,g.overArgs=Pm,g.overEvery=$_,g.overSome=N_,g.partial=Au,g.partialRight=p4,g.partition=Cm,g.pick=Vv,g.pickBy=E4,g.property=I4,g.propertyOf=H_,g.pull=y9,g.pullAll=n4,g.pullAllBy=C9,g.pullAllWith=x9,g.pullAt=E9,g.range=V_,g.rangeRight=G_,g.rearg=Um,g.reject=Am,g.remove=A9,g.rest=$m,g.reverse=Cu,g.sampleSize=km,g.set=zv,g.setWith=Wv,g.shuffle=Lm,g.slice=S9,g.sortBy=Im,g.sortedUniq=B9,g.sortedUniqBy=R9,g.split=p_,g.spread=Nm,g.tail=D9,g.take=O9,g.takeRight=P9,g.takeRightWhile=U9,g.takeWhile=$9,g.tap=tm,g.throttle=Hm,g.thru=lc,g.toArray=w4,g.toPairs=A4,g.toPairsIn=S4,g.toPath=j_,g.toPlainObject=y4,g.transform=Zv,g.unary=Vm,g.union=N9,g.unionBy=H9,g.unionWith=V9,g.uniq=G9,g.uniqBy=z9,g.uniqWith=W9,g.unset=qv,g.unzip=xu,g.unzipWith=r4,g.update=jv,g.updateWith=Xv,g.values=bs,g.valuesIn=Kv,g.without=Z9,g.words=M4,g.wrap=Gm,g.xor=q9,g.xorBy=j9,g.xorWith=X9,g.zip=K9,g.zipObject=Y9,g.zipObjectDeep=J9,g.zipWith=Q9,g.entries=A4,g.entriesIn=S4,g.extend=C4,g.extendWith=mc,Bu(g,g),g.add=K_,g.attempt=T4,g.camelCase=t_,g.capitalize=k4,g.ceil=Y_,g.clamp=Yv,g.clone=Wm,g.cloneDeep=qm,g.cloneDeepWith=jm,g.cloneWith=Zm,g.conformsTo=Xm,g.deburr=L4,g.defaultTo=M_,g.divide=J_,g.endsWith=e_,g.eq=Ri,g.escape=i_,g.escapeRegExp=n_,g.every=um,g.find=dm,g.findIndex=Qf,g.findKey=Av,g.findLast=fm,g.findLastIndex=t4,g.findLastKey=Sv,g.floor=Q_,g.forEach=o4,g.forEachRight=a4,g.forIn=kv,g.forInRight=Lv,g.forOwn=Mv,g.forOwnRight=Tv,g.get=Lu,g.gt=Km,g.gte=Ym,g.has=Bv,g.hasIn=Mu,g.head=i4,g.identity=ze,g.includes=_m,g.indexOf=f9,g.inRange=Jv,g.invoke=Ov,g.isArguments=Cr,g.isArray=tt,g.isArrayBuffer=Jm,g.isArrayLike=Ve,g.isArrayLikeObject=Yt,g.isBoolean=Qm,g.isBuffer=Yn,g.isDate=tv,g.isElement=ev,g.isEmpty=iv,g.isEqual=nv,g.isEqualWith=rv,g.isError=Su,g.isFinite=sv,g.isFunction=wn,g.isInteger=g4,g.isLength=pc,g.isMap=m4,g.isMatch=ov,g.isMatchWith=av,g.isNaN=cv,g.isNative=lv,g.isNil=hv,g.isNull=uv,g.isNumber=v4,g.isObject=Vt,g.isObjectLike=qt,g.isPlainObject=wo,g.isRegExp=ku,g.isSafeInteger=dv,g.isSet=_4,g.isString=gc,g.isSymbol=si,g.isTypedArray=ws,g.isUndefined=fv,g.isWeakMap=pv,g.isWeakSet=gv,g.join=_9,g.kebabCase=r_,g.last=xi,g.lastIndexOf=w9,g.lowerCase=s_,g.lowerFirst=o_,g.lt=mv,g.lte=vv,g.max=tw,g.maxBy=ew,g.mean=iw,g.meanBy=nw,g.min=rw,g.minBy=sw,g.stubArray=Du,g.stubFalse=Ou,g.stubObject=z_,g.stubString=W_,g.stubTrue=Z_,g.multiply=ow,g.nth=b9,g.noConflict=O_,g.noop=Ru,g.now=hc,g.pad=a_,g.padEnd=c_,g.padStart=l_,g.parseInt=u_,g.random=Qv,g.reduce=xm,g.reduceRight=Em,g.repeat=h_,g.replace=d_,g.result=Gv,g.round=aw,g.runInContext=C,g.sample=Sm,g.size=Mm,g.snakeCase=f_,g.some=Tm,g.sortedIndex=k9,g.sortedIndexBy=L9,g.sortedIndexOf=M9,g.sortedLastIndex=T9,g.sortedLastIndexBy=I9,g.sortedLastIndexOf=F9,g.startCase=g_,g.startsWith=m_,g.subtract=cw,g.sum=lw,g.sumBy=uw,g.template=v_,g.times=q_,g.toFinite=bn,g.toInteger=it,g.toLength=b4,g.toLower=__,g.toNumber=Ei,g.toSafeInteger=_v,g.toString=Et,g.toUpper=w_,g.trim=b_,g.trimEnd=y_,g.trimStart=C_,g.truncate=x_,g.unescape=E_,g.uniqueId=X_,g.upperCase=A_,g.upperFirst=Tu,g.each=o4,g.eachRight=a4,g.first=i4,Bu(g,function(){var n={};return Xi(g,function(r,a){At.call(g.prototype,a)||(n[a]=r)}),n}(),{chain:!1}),g.VERSION=s,_i(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){g[n].placeholder=g}),_i(["drop","take"],function(n,r){ut.prototype[n]=function(a){a=a===i?1:ae(it(a),0);var d=this.__filtered__&&!r?new ut(this):this.clone();return d.__filtered__?d.__takeCount__=ve(a,d.__takeCount__):d.__views__.push({size:ve(a,Pe),type:n+(d.__dir__<0?"Right":"")}),d},ut.prototype[n+"Right"]=function(a){return this.reverse()[n](a).reverse()}}),_i(["filter","map","takeWhile"],function(n,r){var a=r+1,d=a==Ae||a==Se;ut.prototype[n]=function(p){var v=this.clone();return v.__iteratees__.push({iteratee:j(p,3),type:a}),v.__filtered__=v.__filtered__||d,v}}),_i(["head","last"],function(n,r){var a="take"+(r?"Right":"");ut.prototype[n]=function(){return this[a](1).value()[0]}}),_i(["initial","tail"],function(n,r){var a="drop"+(r?"":"Right");ut.prototype[n]=function(){return this.__filtered__?new ut(this):this[a](1)}}),ut.prototype.compact=function(){return this.filter(ze)},ut.prototype.find=function(n){return this.filter(n).head()},ut.prototype.findLast=function(n){return this.reverse().find(n)},ut.prototype.invokeMap=rt(function(n,r){return typeof n=="function"?new ut(this):this.map(function(a){return fo(a,n,r)})}),ut.prototype.reject=function(n){return this.filter(fc(j(n)))},ut.prototype.slice=function(n,r){n=it(n);var a=this;return a.__filtered__&&(n>0||r<0)?new ut(a):(n<0?a=a.takeRight(-n):n&&(a=a.drop(n)),r!==i&&(r=it(r),a=r<0?a.dropRight(-r):a.take(r-n)),a)},ut.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ut.prototype.toArray=function(){return this.take(Pe)},Xi(ut.prototype,function(n,r){var a=/^(?:filter|find|map|reject)|While$/.test(r),d=/^(?:head|last)$/.test(r),p=g[d?"take"+(r=="last"?"Right":""):r],v=d||/^find/.test(r);p&&(g.prototype[r]=function(){var w=this.__wrapped__,y=d?[1]:arguments,x=w instanceof ut,T=y[0],I=x||tt(w),B=function(ot){var ft=p.apply(g,zn([ot],y));return d&&O?ft[0]:ft};I&&a&&typeof T=="function"&&T.length!=1&&(x=I=!1);var O=this.__chain__,V=!!this.__actions__.length,K=v&&!O,nt=x&&!V;if(!v&&I){w=nt?w:new ut(this);var Y=n.apply(w,y);return Y.__actions__.push({func:lc,args:[B],thisArg:i}),new bi(Y,O)}return K&&nt?n.apply(this,y):(Y=this.thru(B),K?d?Y.value()[0]:Y.value():Y)})}),_i(["pop","push","shift","sort","splice","unshift"],function(n){var r=Da[n],a=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",d=/^(?:pop|shift)$/.test(n);g.prototype[n]=function(){var p=arguments;if(d&&!this.__chain__){var v=this.value();return r.apply(tt(v)?v:[],p)}return this[a](function(w){return r.apply(tt(w)?w:[],p)})}}),Xi(ut.prototype,function(n,r){var a=g[r];if(a){var d=a.name+"";At.call(ps,d)||(ps[d]=[]),ps[d].push({name:r,func:a})}}),ps[ic(i,M).name]=[{name:"wrapper",func:i}],ut.prototype.clone=E8,ut.prototype.reverse=A8,ut.prototype.value=S8,g.prototype.at=em,g.prototype.chain=im,g.prototype.commit=nm,g.prototype.next=rm,g.prototype.plant=om,g.prototype.reverse=am,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=cm,g.prototype.first=g.prototype.head,so&&(g.prototype[so]=sm),g},hs=n8();pr?((pr.exports=hs)._=hs,F1._=hs):de._=hs}).call(L5)}(Bs,Bs.exports)),Bs.exports}var N2=M5();const T5=(t="user")=>{var F;const e=pe(null),i=pe(null),[s,o]=Qn(t),[c,l]=Qn(!1),u=pe(null),h=pe(!1),f=pe(new Set),_=M=>{u.current=M};Si(()=>{const M=e.current;if(!M)return;const D=()=>{if(h.current&&u.current){const R=setTimeout(()=>{var $;($=u.current)==null||$.call(u),h.current=!1,f.current.delete(R)},100);f.current.add(R)}};return M.addEventListener("loadedmetadata",D),()=>{M.removeEventListener("loadedmetadata",D),f.current.forEach(R=>clearTimeout(R)),f.current.clear()}},[(F=e.current)==null?void 0:F.src]),Si(()=>()=>{f.current.forEach(M=>clearTimeout(M)),f.current.clear()},[]);const m=(M,D)=>q(null,null,function*(){try{i.current&&(i.current.getTracks().forEach(kt=>kt.stop()),i.current=null),e.current&&(e.current.srcObject=null);const R=yield navigator.mediaDevices.getUserMedia({video:{facingMode:M||s}});i.current=R;const N=R.getVideoTracks()[0].getSettings().facingMode;(N&&N!==(M||s)||N&&N!==s)&&o(N);const pt=(yield navigator.mediaDevices.enumerateDevices()).find(kt=>kt.kind==="videoinput"&&R.getVideoTracks()[0].getSettings().deviceId===kt.deviceId);D==null||D(pt==null?void 0:pt.label),e.current&&(e.current.srcObject=R,yield e.current.play())}catch(R){console.error("Failed to start camera:",R)}}),b=()=>q(null,null,function*(){const M=s==="user"?"environment":"user";h.current=!0;const D=s;try{o(M),i.current&&(i.current.getTracks().forEach(R=>R.stop()),i.current=null),yield m(M)}catch(R){o(D),h.current=!1;try{yield m(D)}catch($){console.error("Failed to restore previous camera:",$)}}}),E=()=>{const M=navigator.userAgent.toLowerCase(),D=M.includes("firefox")||M.includes("gecko")&&!M.includes("chrome")&&!M.includes("edge"),R="mozInnerScreenX"in window||"mozInputSource"in window||"mozPaintCount"in window||typeof window.InstallTrigger!="undefined",$=CSS.supports&&(CSS.supports("-moz-appearance","none")||CSS.supports("-moz-user-select","none"));return{isGecko:D||R||$,isChromium:M.includes("chrome")||M.includes("chromium")||M.includes("edge"),isWebKit:M.includes("webkit")&&!M.includes("chrome")}};return{videoRef:e,streamRef:i,facingMode:s,agentSupported:c,startCamera:m,switchCamera:b,checkAgentSupport:()=>q(null,null,function*(){var M,D;try{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>1){l(!0);return}const{isGecko:$}=E();let X=null,N=null;try{const J=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});X=(M=J.getVideoTracks()[0].getSettings().deviceId)!=null?M:null,J.getTracks().forEach(pt=>pt.stop())}catch(J){}try{const J=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}});N=(D=J.getVideoTracks()[0].getSettings().deviceId)!=null?D:null,J.getTracks().forEach(pt=>pt.stop())}catch(J){}if(!(X&&N&&X!==N)){l(!1);return}l(!$)}catch(R){l(!1)}}),stopCamera:()=>{i.current&&(i.current.getTracks().forEach(M=>M.stop()),i.current=null),e.current&&(e.current.srcObject=null,e.current.load())},registerCameraSwitchCallback:_}};var Ir=typeof self!="undefined"?self:{};function er(){throw Error("Invalid UTF8")}function H2(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let Fo,Oc;const I5=typeof TextDecoder!="undefined";let F5;const B5=typeof TextEncoder!="undefined";function V2(t){if(B5)t=(F5||(F5=new TextEncoder)).encode(t);else{let i=0;const s=new Uint8Array(3*t.length);for(let o=0;o<t.length;o++){var e=t.charCodeAt(o);if(e<128)s[i++]=e;else{if(e<2048)s[i++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&o<t.length){const c=t.charCodeAt(++o);if(c>=56320&&c<=57343){e=1024*(e-55296)+c-56320+65536,s[i++]=e>>18|240,s[i++]=e>>12&63|128,s[i++]=e>>6&63|128,s[i++]=63&e|128;continue}o--}e=65533}s[i++]=e>>12|224,s[i++]=e>>6&63|128}s[i++]=63&e|128}}t=i===s.length?s:s.subarray(0,i)}return t}var Pc,Bo;t:{for(var G2=["CLOSURE_FLAGS"],Uc=Ir,$c=0;$c<G2.length;$c++)if((Uc=Uc[G2[$c]])==null){Bo=null;break t}Bo=Uc}var Rs,z2=Bo&&Bo[610401301];Pc=z2!=null&&z2;const W2=Ir.navigator;function Nc(t){return!!Pc&&!!Rs&&Rs.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function ci(t){var e;return(e=Ir.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function An(){return!!Pc&&!!Rs&&Rs.brands.length>0}function Hc(){return An()?Nc("Chromium"):(ci("Chrome")||ci("CriOS"))&&!(!An()&&ci("Edge"))||ci("Silk")}function Ro(t){return Ro[" "](t),t}Rs=W2&&W2.userAgentData||null,Ro[" "]=function(){};var R5=!An()&&(ci("Trident")||ci("MSIE"));!ci("Android")||Hc(),Hc(),ci("Safari")&&(Hc()||!An()&&ci("Coast")||!An()&&ci("Opera")||!An()&&ci("Edge")||(An()?Nc("Microsoft Edge"):ci("Edg/"))||An()&&Nc("Opera"));var Z2={},Ds=null;function D5(t){const e=t.length;let i=3*e/4;i%3?i=Math.floor(i):"=.".indexOf(t[e-1])!=-1&&(i="=.".indexOf(t[e-2])!=-1?i-2:i-1);const s=new Uint8Array(i);let o=0;return function(c,l){function u(f){for(;h<c.length;){const _=c.charAt(h++),m=Ds[_];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(_))throw Error("Unknown base64 encoding at char: "+_)}return f}q2();let h=0;for(;;){const f=u(-1),_=u(0),m=u(64),b=u(64);if(b===64&&f===-1)break;l(f<<2|_>>4),m!=64&&(l(_<<4&240|m>>2),b!=64&&l(m<<6&192|b))}}(t,function(c){s[o++]=c}),o!==i?s.subarray(0,o):s}function q2(){if(!Ds){Ds={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const s=t.concat(e[i].split(""));Z2[i]=s;for(let o=0;o<s.length;o++){const c=s[o];Ds[c]===void 0&&(Ds[c]=o)}}}}var j2=typeof Uint8Array!="undefined",X2=!R5&&typeof btoa=="function";function K2(t){if(!X2){var e;e===void 0&&(e=0),q2(),e=Z2[e];var i=Array(Math.floor(t.length/3)),s=e[64]||"";let h=0,f=0;for(;h<t.length-2;h+=3){var o=t[h],c=t[h+1],l=t[h+2],u=e[o>>2];o=e[(3&o)<<4|c>>4],c=e[(15&c)<<2|l>>6],l=e[63&l],i[f++]=u+o+c+l}switch(u=0,l=s,t.length-h){case 2:l=e[(15&(u=t[h+1]))<<2]||s;case 1:t=t[h],i[f]=e[t>>2]+e[(3&t)<<4|u>>4]+l+s}return i.join("")}for(e="",i=0,s=t.length-10240;i<s;)e+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));return e+=String.fromCharCode.apply(null,i?t.subarray(i):t),btoa(e)}const Y2=/[-_.]/g,O5={"-":"+",_:"/",".":"="};function P5(t){return O5[t]||""}function J2(t){if(!X2)return D5(t);Y2.test(t)&&(t=t.replace(Y2,P5)),t=atob(t);const e=new Uint8Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}function ir(t){return j2&&t!=null&&t instanceof Uint8Array}var Fr={};function nr(){return U5||(U5=new tn(null,Fr))}function Vc(t){Q2(Fr);var e=t.g;return(e=e==null||ir(e)?e:typeof e=="string"?J2(e):null)==null?e:t.g=e}var tn=class{h(){return new Uint8Array(Vc(this)||0)}constructor(t,e){if(Q2(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}};let U5,Gc;function Q2(t){if(t!==Fr)throw Error("illegal external caller")}function th(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function zc(t){return th(t=Error(t),"warning"),t}function Wc(t){if(t!=null){var e=Gc!=null?Gc:Gc={},i=e[t]||0;i>=5||(e[t]=i+1,th(t=Error(),"incident"),function(s){Ir.setTimeout(()=>{throw s},0)}(t))}}var Do=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Br(t,e,i=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?i&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var $5=Br("jas",void 0,!0),eh=Br(void 0,"0di"),Os=Br(void 0,"1oa"),Rr=Br(void 0,Symbol()),N5=Br(void 0,"0actk"),ih=Br(void 0,"8utk");const z=Do?$5:"Ea",nh={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},rh=Object.defineProperties;function Oo(t,e){Do||z in t||rh(t,nh),t[z]|=e}function te(t,e){Do||z in t||rh(t,nh),t[z]=e}function Dr(t){return Oo(t,34),t}function H5(t,e){te(e,-15615&(0|t))}function Zc(t,e){te(e,-15581&(34|t))}function Po(){return typeof BigInt=="function"}function Be(t){return Array.prototype.slice.call(t)}var qc,Ps={};function Uo(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function jc(t,e){if(t!=null){if(typeof t=="string")t=t?new tn(t,Fr):nr();else if(t.constructor!==tn)if(ir(t))t=t.length?new tn(new Uint8Array(t),Fr):nr();else{if(!e)throw Error();t=void 0}}return t}const sh=[];function Sn(t){if(2&t)throw Error()}te(sh,55),qc=Object.freeze(sh);class oh{constructor(e,i,s){this.g=e,this.h=i,this.l=s}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}function Xc(t){return Rr?t[Rr]:void 0}var V5=Object.freeze({});function $o(t){return t.Na=!0,t}var G5=$o(t=>typeof t=="number"),ah=$o(t=>typeof t=="string"),z5=$o(t=>typeof t=="boolean"),No=typeof Ir.BigInt=="function"&&typeof Ir.BigInt(0)=="bigint";function kn(t){var e=t;if(ah(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(G5(e)&&!Number.isSafeInteger(e))throw Error(String(e));return No?BigInt(t):t=z5(t)?t?"1":"0":ah(t)?t.trim()||"0":String(t)}var Kc=$o(t=>No?t>=Z5&&t<=j5:t[0]==="-"?ch(t,W5):ch(t,q5));const W5=Number.MIN_SAFE_INTEGER.toString(),Z5=No?BigInt(Number.MIN_SAFE_INTEGER):void 0,q5=Number.MAX_SAFE_INTEGER.toString(),j5=No?BigInt(Number.MAX_SAFE_INTEGER):void 0;function ch(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let i=0;i<t.length;i++){const s=t[i],o=e[i];if(s>o)return!1;if(s<o)return!0}}const X5=typeof Uint8Array.prototype.slice=="function";let lh,St=0,zt=0;function uh(t){const e=t>>>0;St=e,zt=(t-e)/4294967296>>>0}function rr(t){if(t<0){uh(-t);const[e,i]=tl(St,zt);St=e>>>0,zt=i>>>0}else uh(t)}function Yc(t){const e=lh||(lh=new DataView(new ArrayBuffer(8)));e.setFloat32(0,+t,!0),zt=0,St=e.getUint32(0,!0)}function Jc(t,e){const i=4294967296*e+(t>>>0);return Number.isSafeInteger(i)?i:Us(t,e)}function Qc(t,e){const i=2147483648&e;return i&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=Jc(t,e))=="number"?i?-t:t:i?"-"+t:t}function Us(t,e){if(t>>>=0,(e>>>=0)<=2097151)var i=""+(4294967296*e+t);else Po()?i=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(i=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),i+=8147497*e,e*=2,t>=1e7&&(i+=t/1e7>>>0,t%=1e7),i>=1e7&&(e+=i/1e7>>>0,i%=1e7),i=e+hh(i)+hh(t));return i}function hh(t){return t=String(t),"0000000".slice(t.length)+t}function dh(){var t=St,e=zt;if(2147483648&e)if(Po())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[i,s]=tl(t,e);t="-"+Us(i,s)}else t=Us(t,e);return t}function Ho(t){if(t.length<16)rr(Number(t));else if(Po())t=BigInt(t),St=Number(t&BigInt(4294967295))>>>0,zt=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");zt=St=0;const i=t.length;for(let s=e,o=(i-e)%6+e;o<=i;s=o,o+=6){const c=Number(t.slice(s,o));zt*=1e6,St=1e6*St+c,St>=4294967296&&(zt+=Math.trunc(St/4294967296),zt>>>=0,St>>>=0)}if(e){const[s,o]=tl(St,zt);St=s,zt=o}}}function tl(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const $s=typeof BigInt=="function"?BigInt.asIntN:void 0,K5=typeof BigInt=="function"?BigInt.asUintN:void 0,Ln=Number.isSafeInteger,Vo=Number.isFinite,Or=Math.trunc,Y5=kn(0);function Mn(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function fh(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const J5=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ns(t){switch(typeof t){case"bigint":return!0;case"number":return Vo(t);case"string":return J5.test(t);default:return!1}}function Pr(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Vo(t)?0|t:void 0}function ph(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Vo(t)?t>>>0:void 0}function gh(t){if(t[0]==="-")return!1;const e=t.length;return e<20||e===20&&Number(t.substring(0,6))<184467}function mh(t){const e=t.length;return t[0]==="-"?e<20||e===20&&Number(t.substring(0,7))>-922337:e<19||e===19&&Number(t.substring(0,6))<922337}function vh(t){return mh(t)?t:(Ho(t),dh())}function el(t){return t=Or(t),Ln(t)||(rr(t),t=Qc(St,zt)),t}function _h(t){var e=Or(Number(t));return Ln(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),vh(t))}function wh(t){var e=Or(Number(t));return Ln(e)?kn(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Po()?kn($s(64,BigInt(t))):kn(vh(t)))}function bh(t){if(Ln(t))t=kn(el(t));else{if(t=Or(t),Ln(t))t=String(t);else{const e=String(t);mh(e)?t=e:(rr(t),t=dh())}t=kn(t)}return t}function il(t){return t==null?t:typeof t=="bigint"?(Kc(t)?t=Number(t):(t=$s(64,t),t=Kc(t)?Number(t):String(t)),t):Ns(t)?typeof t=="number"?el(t):_h(t):void 0}function Q5(t){if(t==null)return t;var e=typeof t;if(e==="bigint")return String(K5(64,t));if(Ns(t)){if(e==="string")return e=Or(Number(t)),Ln(e)&&e>=0?t=String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),gh(t)||(Ho(t),t=Us(St,zt))),t;if(e==="number")return(t=Or(t))>=0&&Ln(t)?t:function(i){if(i<0){rr(i);var s=Us(St,zt);return i=Number(s),Ln(i)?i:s}return gh(s=String(i))?s:(rr(i),Jc(St,zt))}(t)}}function yh(t){if(typeof t!="string")throw Error();return t}function Ur(t){if(t!=null&&typeof t!="string")throw Error();return t}function $r(t){return t==null||typeof t=="string"?t:void 0}function nl(t,e,i,s){if(t!=null&&typeof t=="object"&&t.W===Ps)return t;if(!Array.isArray(t))return i?2&s?((t=e[eh])||(Dr((t=new e).u),t=e[eh]=t),e=t):e=new e:e=void 0,e;let o=i=0|t[z];return o===0&&(o|=32&s),o|=2&s,o!==i&&te(t,o),new e(t)}function tp(t,e,i){if(e)t:{if(!Ns(e=t))throw zc("int64");switch(typeof e){case"string":e=wh(e);break t;case"bigint":e=kn($s(64,e));break t;default:e=bh(e)}}else t=typeof(e=t),e=e==null?e:t==="bigint"?kn($s(64,e)):Ns(e)?t==="string"?wh(e):bh(e):void 0;return(t=e)==null?i?Y5:void 0:t}function ep(t){return t}const ip={};let np=function(){try{return Ro(new class extends Map{constructor(){super()}}),!1}catch(t){return!0}}();class rl{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,i){return this.g.set(e,i),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,i){return this.g.forEach(e,i)}[Symbol.iterator](){return this.entries()}}const rp=np?(Object.setPrototypeOf(rl.prototype,Map.prototype),Object.defineProperties(rl.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),rl):class extends Map{constructor(){super()}};function Ch(t){return t}function sl(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var Pi=class extends rp{constructor(t,e,i=Ch,s=Ch){super();let o=0|t[z];o|=64,te(t,o),this.M=o,this.I=e,this.S=i,this.X=this.I?sp:s;for(let c=0;c<t.length;c++){const l=t[c],u=i(l[0],!1,!0);let h=l[1];e?h===void 0&&(h=null):h=s(l[1],!1,!0,void 0,void 0,o),super.set(u,h)}}La(){var t=up;if(this.size!==0)return Array.from(super.entries(),e=>(e[0]=t(e[0]),e[1]=t(e[1]),e))}da(t=op){const e=[],i=super.entries();for(var s;!(s=i.next()).done;)(s=s.value)[0]=t(s[0]),s[1]=t(s[1]),e.push(s);return e}clear(){sl(this),super.clear()}delete(t){return sl(this),super.delete(this.S(t,!0,!1))}entries(){if(this.I){var t=super.keys();t=new oh(t,ap,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new oh(t,Pi.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach((i,s,o)=>{t.call(e,o.get(s),s,o)}):super.forEach(t,e)}set(t,e){return sl(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.X(e,!0,!0,this.I,!1,this.M))}Ja(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.I?t===void 0?null:t:this.X(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(e!==void 0){var i=this.I;return i?((i=this.X(e,!1,!0,i,this.pa,this.M))!==e&&super.set(t,i),i):e}}[Symbol.iterator](){return this.entries()}};function sp(t,e,i,s,o,c){return t=nl(t,s,i,c),o&&(t=Zo(t)),t}function op(t){return t}function ap(t){return[t,this.get(t)]}let cp,Go,xh,lp;function Eh(){return cp||(cp=new Pi(Dr([]),void 0,void 0,void 0,ip))}function ol(t,e,i,s,o){if(t!=null){if(Array.isArray(t)){const c=0|t[z];return t.length===0&&1&c?void 0:o&&2&c?t:zo(t,e,i,s!==void 0,o)}return e(t,s)}}function zo(t,e,i,s,o){const c=s||i?0|t[z]:0,l=s?!!(32&c):void 0;let u=0;const h=(s=Be(t)).length;for(let A=0;A<h;A++){var f=s[A];if(A===h-1&&Uo(f)){var _=e,m=i,b=l,E=o;let k;for(let F in f){const M=ol(f[F],_,m,b,E);M!=null&&((k!=null?k:k={})[F]=M)}f=k}else f=ol(s[A],e,i,l,o);s[A]=f,f!=null&&(u=A+1)}return u<h&&(s.length=u),i&&((t=Xc(t))&&(s[Rr]=Be(t)),i(c,s)),s}function up(t){return ol(t,al,void 0,void 0,!1)}function al(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Kc(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(ir(t))return ir(t)&&Wc(ih),K2(t);if(t.W===Ps)return Ah(t);if(t instanceof tn){const e=t.g;return e==null?"":typeof e=="string"?e:t.g=K2(e)}return t instanceof Pi?t.La():void 0}return t}function Ah(t){var e=t.u;t=zo(e,al,void 0,void 0,!1);var i=0|e[z];if((e=t.length)&&!(512&i)){var s=t[e-1],o=!1;Uo(s)?(e--,o=!0):s=void 0;var c=e-(i=512&i?0:-1),l=(Go!=null?Go:ep)(c,i,t,s);if(s&&(t[e]=void 0),c<l&&s){for(var u in c=!0,s){const h=+u;h<=l?(t[o=h+i]=s[u],e=Math.max(o+1,e),o=!1,delete s[u]):c=!1}c&&(s=void 0)}for(c=e-1;e>0;c=e-1)if((u=t[c])==null)e--,o=!0;else{if(!((c-=i)>=l))break;(s!=null?s:s={})[c]=u,e--,o=!0}o&&(t.length=e),s&&t.push(s)}return t}function Tn(t,e,i){return t=Sh(t,e[0],e[1],i?1:2),e!==xh&&i&&Oo(t,8192),t}function Sh(t,e,i,s){if(t==null){var o=96;i?(t=[i],o|=512):t=[],e&&(o=-16760833&o|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(o=0|t[z])||!(64&o)||2&o||Wc(N5),1024&o)throw Error("farr");if(64&o)return t;if(s===1||s===2||(o|=64),i&&(o|=512,i!==t[0]))throw Error("mid");t:{var c=(i=t).length;if(c){var l=c-1;if(Uo(s=i[l])){if((l-=e=512&(o|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var u in s)(c=+u)<l&&(i[c+e]=s[u],delete s[u]);o=-16760833&o|(1023&l)<<14;break t}}if(e){if((u=Math.max(e,c-(512&o?0:-1)))>1024)throw Error("spvt");o=-16760833&o|(1023&u)<<14}}}return te(t,o),t}function cl(t,e,i=Zc){if(t!=null){if(j2&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var s=0|t[z];return 2&s?t:(e&&(e=s===0||!!(32&s)&&!(64&s||!(16&s))),e?(te(t,34|s),4&s&&Object.freeze(t),t):zo(t,cl,4&s?Zc:i,!0,!0))}return t.W===Ps?t=2&(s=0|(i=t.u)[z])?t:new t.constructor(Wo(i,s,!0)):t instanceof Pi&&!(2&t.M)&&(i=Dr(t.da(cl)),t=new Pi(i,t.I,t.S,t.X)),t}}function Wo(t,e,i){const s=i||2&e?Zc:H5,o=!!(32&e);return t=function(c,l,u){const h=Be(c);var f=h.length;const _=256&l?h[f-1]:void 0;for(f+=_?-1:0,l=512&l?1:0;l<f;l++)h[l]=u(h[l]);if(_){l=h[l]={};for(const m in _)l[m]=u(_[m])}return(c=Xc(c))&&(h[Rr]=Be(c)),h}(t,e,c=>cl(c,o,s)),Oo(t,32|(i?2:0)),t}function Zo(t){const e=t.u,i=0|e[z];return 2&i?new t.constructor(Wo(e,i,!1)):t}function Nr(t,e){return en(t=t.u,0|t[z],e)}function en(t,e,i){if(i===-1)return null;const s=i+(512&e?0:-1),o=t.length-1;return s>=o&&256&e?t[o][i]:s<=o?t[s]:void 0}function Mt(t,e,i){const s=t.u;let o=0|s[z];return Sn(o),Ht(s,o,e,i),t}function Ht(t,e,i,s){const o=512&e?0:-1,c=i+o;var l=t.length-1;return c>=l&&256&e?(t[l][i]=s,e):c<=l?(t[c]=s,e):(s!==void 0&&(i>=(l=e>>14&1023||536870912)?s!=null&&(t[l+o]={[i]:s},te(t,e|=256)):t[c]=s),e)}function qo(t,e){let i=0|(t=t.u)[z];const s=en(t,i,e),o=Mn(s);return o!=null&&o!==s&&Ht(t,i,e,o),o}function kh(t){let e=0|(t=t.u)[z];const i=en(t,e,1),s=jc(i,!0);return s!=null&&s!==i&&Ht(t,e,1,s),s}function sr(){return V5===void 0?2:4}function or(t,e,i,s,o){const c=t.u,l=2&(t=0|c[z])?1:s;o=!!o;let u=0|(s=ll(c,t,e))[z];if(!(4&u)){4&u&&(s=Be(s),u=sn(u,t),t=Ht(c,t,e,s));let h=0,f=0;for(;h<s.length;h++){const _=i(s[h]);_!=null&&(s[f++]=_)}f<h&&(s.length=f),u=ul(u,t),i=-2049&(20|u),u=i&=-4097,te(s,u),2&u&&Object.freeze(s)}return l===1||l===4&&32&u?nn(u)||(o=u,u|=2,u!==o&&te(s,u),Object.freeze(s)):(l===2&&nn(u)&&(s=Be(s),u=sn(u,t),u=In(u,t,o),te(s,u),t=Ht(c,t,e,s)),nn(u)||(e=u,u=In(u,t,o),u!==e&&te(s,u))),s}function ll(t,e,i){return t=en(t,e,i),Array.isArray(t)?t:qc}function ul(t,e){return t===0&&(t=sn(t,e)),1|t}function nn(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function Lh(t){t=Be(t);for(let e=0;e<t.length;e++){const i=t[e]=Be(t[e]);Array.isArray(i[1])&&(i[1]=Dr(i[1]))}return t}function hl(t,e,i,s){let o=0|(t=t.u)[z];Sn(o),Ht(t,o,e,(s==="0"?Number(i)===0:i===s)?void 0:i)}function Hr(t,e,i,s){Sn(e);let o=ll(t,e,i);const c=o!==qc;if(64&e||!(8192&e)||!c){const l=c?0|o[z]:0;let u=l;(!c||2&u||nn(u)||4&u&&!(32&u))&&(o=Be(o),u=sn(u,e),e=Ht(t,e,i,o)),u=-13&ul(u,e),u=In(s?-17&u:16|u,e,!0),u!==l&&te(o,u)}return o}function dl(t,e){var i=L0;return pl(fl(t=t.u),t,0|t[z],i)===e?e:-1}function fl(t){var i;if(Do)return(i=t[Os])!=null?i:t[Os]=new Map;if(Os in t)return t[Os];const e=new Map;return Object.defineProperty(t,Os,{value:e}),e}function Mh(t,e,i,s){const o=fl(t),c=pl(o,t,e,i);return c!==s&&(c&&(e=Ht(t,e,c)),o.set(i,s)),e}function pl(t,e,i,s){let o=t.get(s);if(o!=null)return o;o=0;for(let c=0;c<s.length;c++){const l=s[c];en(e,i,l)!=null&&(o!==0&&(i=Ht(e,i,o)),o=l)}return t.set(s,o),o}function gl(t,e,i){let s=0|t[z];const o=en(t,s,i);let c;if(o!=null&&o.W===Ps)return(e=Zo(o))!==o&&Ht(t,s,i,e),e.u;if(Array.isArray(o)){const l=0|o[z];c=2&l?Tn(Wo(o,l,!1),e,!0):64&l?o:Tn(c,e,!0)}else c=Tn(void 0,e,!0);return c!==o&&Ht(t,s,i,c),c}function Th(t,e,i){let s=0|(t=t.u)[z];const o=en(t,s,i);return(e=nl(o,e,!1,s))!==o&&e!=null&&Ht(t,s,i,e),e}function gt(t,e,i){if((e=Th(t,e,i))==null)return e;let s=0|(t=t.u)[z];if(!(2&s)){const o=Zo(e);o!==e&&Ht(t,s,i,e=o)}return e}function Ih(t,e,i,s,o,c,l){t=t.u;var u=!!(2&e);const h=u?1:o;c=!!c,l&&(l=!u);var f=0|(o=ll(t,e,s))[z];if(!(u=!!(4&f))){var _=o,m=e;const b=!!(2&(f=ul(f,e)));b&&(m|=2);let E=!b,A=!0,k=0,F=0;for(;k<_.length;k++){const M=nl(_[k],i,!1,m);if(M instanceof i){if(!b){const D=!!(2&(0|M.u[z]));E&&(E=!D),A&&(A=D)}_[F++]=M}}F<k&&(_.length=F),f|=4,f=A?16|f:-17&f,te(_,f=E?8|f:-9&f),b&&Object.freeze(_)}if(l&&!(8&f||!o.length&&(h===1||h===4&&32&f))){for(nn(f)&&(o=Be(o),f=sn(f,e),e=Ht(t,e,s,o)),i=o,l=f,_=0;_<i.length;_++)(f=i[_])!==(m=Zo(f))&&(i[_]=m);l|=8,te(i,l=i.length?-17&l:16|l),f=l}return h===1||h===4&&32&f?nn(f)||(e=f,(f|=!o.length||16&f&&(!u||32&f)?2:1024)!==e&&te(o,f),Object.freeze(o)):(h===2&&nn(f)&&(te(o=Be(o),f=In(f=sn(f,e),e,c)),e=Ht(t,e,s,o)),nn(f)||(s=f,(f=In(f,e,c))!==s&&te(o,f))),o}function rn(t,e,i){const s=0|t.u[z];return Ih(t,s,e,i,sr(),!1,!(2&s))}function Z(t,e,i,s){return s==null&&(s=void 0),Mt(t,i,s)}function Hs(t,e,i,s){s==null&&(s=void 0);t:{let o=0|(t=t.u)[z];if(Sn(o),s==null){const c=fl(t);if(pl(c,t,o,i)!==e)break t;c.set(i,0)}else o=Mh(t,o,i,e);Ht(t,o,e,s)}}function sn(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function In(t,e,i){return 32&e&&i||(t&=-33),t}function jo(t,e,i){Sn(0|t.u[z]),or(t,e,$r,2,!0).push(yh(i))}function Xo(t,e,i,s){const o=0|t.u[z];Sn(o),t=Ih(t,o,i,e,2,!0),s=s!=null?s:new i,t.push(s),t[z]=2&(0|s.u[z])?-9&t[z]:-17&t[z]}function li(t,e){return Pr(Nr(t,e))}function ui(t,e){return $r(Nr(t,e))}function Xt(t,e){var i;return(i=qo(t,e))!=null?i:0}function Vs(t,e,i){if(i!=null&&typeof i!="boolean")throw t=typeof i,Error(`Expected boolean but got ${t!="object"?t:i?Array.isArray(i)?"array":t:"null"}: ${i}`);Mt(t,e,i)}function Ui(t,e,i){if(i!=null){if(typeof i!="number"||!Vo(i))throw zc("int32");i|=0}Mt(t,e,i)}function G(t,e,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);Mt(t,e,i)}function Ko(t,e,i){{const l=t.u;let u=0|l[z];if(Sn(u),i==null)Ht(l,u,e);else{var s=t=0|i[z],o=nn(t),c=o||Object.isFrozen(i);for(o||(t=0),c||(i=Be(i),s=0,t=In(t=sn(t,u),u,!0),c=!1),t|=21,o=0;o<i.length;o++){const h=i[o],f=yh(h);Object.is(h,f)||(c&&(i=Be(i),s=0,t=In(t=sn(t,u),u,!0),c=!1),i[o]=f)}t!==s&&(c&&(i=Be(i),t=In(t=sn(t,u),u,!0)),te(i,t)),Ht(l,u,e,i)}}}function Fh(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function ml(){return Error("Failed to read varint, encoding is invalid.")}function Bh(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function vl(t){if(typeof t=="string")return{buffer:J2(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===tn)return{buffer:Vc(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.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 _l(t,e){let i,s=0,o=0,c=0;const l=t.h;let u=t.g;do i=l[u++],s|=(127&i)<<c,c+=7;while(c<32&&128&i);for(c>32&&(o|=(127&i)>>4),c=3;c<32&&128&i;c+=7)i=l[u++],o|=(127&i)<<c;if(ar(t,u),i<128)return e(s>>>0,o>>>0);throw ml()}function wl(t){let e=0,i=t.g;const s=i+10,o=t.h;for(;i<s;){const c=o[i++];if(e|=c,(128&c)==0)return ar(t,i),!!(127&e)}throw ml()}function Fn(t){const e=t.h;let i=t.g,s=e[i++],o=127&s;if(128&s&&(s=e[i++],o|=(127&s)<<7,128&s&&(s=e[i++],o|=(127&s)<<14,128&s&&(s=e[i++],o|=(127&s)<<21,128&s&&(s=e[i++],o|=s<<28,128&s&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++])))))throw ml();return ar(t,i),o}function on(t){return Fn(t)>>>0}function bl(t){var e=t.h;const i=t.g,s=e[i],o=e[i+1],c=e[i+2];return e=e[i+3],ar(t,t.g+4),(s<<0|o<<8|c<<16|e<<24)>>>0}function yl(t){var e=bl(t);t=2*(e>>31)+1;const i=e>>>23&255;return e&=8388607,i==255?e?NaN:t*(1/0):i==0?1401298464324817e-60*t*e:t*Math.pow(2,i-150)*(e+8388608)}function hp(t){return Fn(t)}function Cl(t,e,{aa:i=!1}={}){t.aa=i,e&&(e=vl(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function ar(t,e){if(t.g=e,e>t.l)throw Bh(t.l,e)}function Rh(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const i=t.g,s=i+e;if(s>t.l)throw Bh(e,t.l-i);return t.g=s,i}function Dh(t,e){if(e==0)return nr();var i=Rh(t,e);return t.aa&&t.m?i=t.h.subarray(i,i+e):(t=t.h,i=i===(e=i+e)?new Uint8Array(0):X5?t.slice(i,e):new Uint8Array(t.subarray(i,e))),i.length==0?nr():new tn(i,Fr)}Pi.prototype.toJSON=void 0;var Oh=[];function Ph(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var i=on(t.g);if(e=i>>>3,!((i&=7)>=0&&i<=5))throw Fh(i,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=i,!0}function Yo(t){switch(t.h){case 0:t.h!=0?Yo(t):wl(t.g);break;case 1:ar(t=t.g,t.g+8);break;case 2:if(t.h!=2)Yo(t);else{var e=on(t.g);ar(t=t.g,t.g+e)}break;case 5:ar(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Ph(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}Yo(t)}break;default:throw Fh(t.h,t.l)}}function Gs(t,e,i){const s=t.g.l,o=on(t.g),c=t.g.g+o;let l=c-s;if(l<=0&&(t.g.l=c,i(e,t,void 0,void 0,void 0),l=c-t.g.g),l)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-l} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=c,t.g.l=s,e}function xl(t){var e=on(t.g),i=Rh(t=t.g,e);if(t=t.h,I5){var s,o=t;(s=Oc)||(s=Oc=new TextDecoder("utf-8",{fatal:!0})),e=i+e,o=i===0&&e===o.length?o:o.subarray(i,e);try{var c=s.decode(o)}catch(u){if(Fo===void 0){try{s.decode(new Uint8Array([128]))}catch(h){}try{s.decode(new Uint8Array([97])),Fo=!0}catch(h){Fo=!1}}throw!Fo&&(Oc=void 0),u}}else{e=(c=i)+e,i=[];let u,h=null;for(;c<e;){var l=t[c++];l<128?i.push(l):l<224?c>=e?er():(u=t[c++],l<194||(192&u)!=128?(c--,er()):i.push((31&l)<<6|63&u)):l<240?c>=e-1?er():(u=t[c++],(192&u)!=128||l===224&&u<160||l===237&&u>=160||(192&(s=t[c++]))!=128?(c--,er()):i.push((15&l)<<12|(63&u)<<6|63&s)):l<=244?c>=e-2?er():(u=t[c++],(192&u)!=128||u-144+(l<<28)>>30!=0||(192&(s=t[c++]))!=128||(192&(o=t[c++]))!=128?(c--,er()):(l=(7&l)<<18|(63&u)<<12|(63&s)<<6|63&o,l-=65536,i.push(55296+(l>>10&1023),56320+(1023&l)))):er(),i.length>=8192&&(h=H2(h,i),i.length=0)}c=H2(h,i)}return c}function Uh(t){const e=on(t.g);return Dh(t.g,e)}function Jo(t,e,i){var s=on(t.g);for(s=t.g.g+s;t.g.g<s;)i.push(e(t.g))}var Qo=[];function ki(t,e,i){e.g?e.m(t,e.g,e.h,i):e.m(t,e.h,i)}var H=class{constructor(t,e){this.u=Sh(t,e)}toJSON(){try{var t=Ah(this)}finally{Go=void 0}return t}l(){var t=qp;return t.g?t.l(this,t.g,t.h):t.l(this,t.h,t.defaultValue)}clone(){const t=this.u;return new this.constructor(Wo(t,0|t[z],!1))}O(){return!!(2&(0|this.u[z]))}};function $h(t){return t?/^\d+$/.test(t)?(Ho(t),new El(St,zt)):null:dp||(dp=new El(0,0))}H.prototype.W=Ps,H.prototype.toString=function(){return this.u.toString()};var El=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let dp;function Nh(t){return t?/^-?\d+$/.test(t)?(Ho(t),new Al(St,zt)):null:fp||(fp=new Al(0,0))}var Al=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let fp;function Vr(t,e,i){for(;i>0||e>127;)t.g.push(127&e|128),e=(e>>>7|i<<25)>>>0,i>>>=7;t.g.push(e)}function Gr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function ta(t,e){if(e>=0)Gr(t,e);else{for(let i=0;i<9;i++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function zs(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function zr(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function Ze(t,e,i){Gr(t.g,8*e+i)}function Sl(t,e){return Ze(t,e,2),e=t.g.end(),zr(t,e),e.push(t.h),e}function kl(t,e){var i=e.pop();for(i=t.h+t.g.length()-i;i>127;)e.push(127&i|128),i>>>=7,t.h++;e.push(i),t.h++}function ea(t,e,i){Ze(t,e,2),Gr(t.g,i.length),zr(t,t.g.end()),zr(t,i)}function ia(t,e,i,s){i!=null&&(e=Sl(t,e),s(i,t),kl(t,e))}function Li(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Ll=Li(),Hh=Li(),Ml=Li(),Tl=Li(),Vh=Li(),Gh=Li(),Il=Li(),zh=Li(),Wh=Li(),Wr=class{constructor(t,e,i){this.g=t,this.h=e,t=Ll,this.l=!!t&&i===t||!1}};function na(t,e){return new Wr(t,e,Ll)}function Zh(t,e,i,s,o){ia(t,i,Kh(e,s),o)}const pp=na(function(t,e,i,s,o){return t.h===2&&(Gs(t,gl(e,s,i),o),!0)},Zh),gp=na(function(t,e,i,s,o){return t.h===2&&(Gs(t,gl(e,s,i),o),!0)},Zh);var ra=Symbol(),Fl=Symbol(),qh=Symbol(),jh=Symbol();let sa,oa;function cr(t,e,i,s){var o=s[t];if(o)return o;(o={}).Ma=s,o.T=function(m){switch(typeof m){case"boolean":return xh||(xh=[0,void 0,!0]);case"number":return m>0?void 0:m===0?lp||(lp=[0,void 0]):[-m,void 0];case"string":return[0,m];case"object":return m}}(s[0]);var c=s[1];let l=1;c&&c.constructor===Object&&(o.ga=c,typeof(c=s[++l])=="function"&&(o.la=!0,sa!=null||(sa=c),oa!=null||(oa=s[l+1]),c=s[l+=2]));const u={};for(;c&&Array.isArray(c)&&c.length&&typeof c[0]=="number"&&c[0]>0;){for(var h=0;h<c.length;h++)u[c[h]]=c;c=s[++l]}for(h=1;c!==void 0;){let m;typeof c=="number"&&(h+=c,c=s[++l]);var f=void 0;if(c instanceof Wr?m=c:(m=pp,l--),m==null?void 0:m.l){c=s[++l],f=s;var _=l;typeof c=="function"&&(c=c(),f[_]=c),f=c}for(_=h+1,typeof(c=s[++l])=="number"&&c<0&&(_-=c,c=s[++l]);h<_;h++){const b=u[h];f?i(o,h,m,f,b):e(o,h,m,b)}}return s[t]=o}function Xh(t){return Array.isArray(t)?t[0]instanceof Wr?t:[gp,t]:[t,void 0]}function Kh(t,e){return t instanceof H?t.u:Array.isArray(t)?Tn(t,e,!1):void 0}function Bl(t,e,i,s){const o=i.g;t[e]=s?(c,l,u)=>o(c,l,u,s):o}function Rl(t,e,i,s,o){const c=i.g;let l,u;t[e]=(h,f,_)=>c(h,f,_,u||(u=cr(Fl,Bl,Rl,s).T),l||(l=Dl(s)),o)}function Dl(t){let e=t[qh];if(e!=null)return e;const i=cr(Fl,Bl,Rl,t);return e=i.la?(s,o)=>sa(s,o,i):(s,o)=>{const c=0|s[z];for(;Ph(o)&&o.h!=4;){var l=o.m,u=i[l];if(u==null){var h=i.ga;h&&(h=h[l])&&(h=mp(h))!=null&&(u=i[l]=h)}u!=null&&u(o,s,l)||(l=(u=o).l,Yo(u),u.fa?u=void 0:(h=u.g.g-l,u.g.g=l,u=Dh(u.g,h)),l=s,u&&((h=l[Rr])?h.push(u):l[Rr]=[u]))}return 8192&c&&Dr(s),!0},t[qh]=e}function mp(t){const e=(t=Xh(t))[0].g;if(t=t[1]){const i=Dl(t),s=cr(Fl,Bl,Rl,t).T;return(o,c,l)=>e(o,c,l,s,i)}return e}function aa(t,e,i){t[e]=i.h}function ca(t,e,i,s){let o,c;const l=i.h;t[e]=(u,h,f)=>l(u,h,f,c||(c=cr(ra,aa,ca,s).T),o||(o=Yh(s)))}function Yh(t){let e=t[jh];if(!e){const i=cr(ra,aa,ca,t);e=(s,o)=>Jh(s,o,i),t[jh]=e}return e}function Jh(t,e,i){(function(s,o,c){const l=512&o?0:-1,u=s.length,h=u+((o=64&o?256&o:!!u&&Uo(s[u-1]))?-1:0);for(let f=0;f<h;f++)c(f-l,s[f]);if(o){s=s[u-1];for(const f in s)!isNaN(f)&&c(+f,s[f])}})(t,0|t[z]|(i.T[1]?512:0),(s,o)=>{if(o!=null){var c=function(l,u){var h=l[u];if(h)return h;if((h=l.ga)&&(h=h[u])){var f=(h=Xh(h))[0].h;if(h=h[1]){const _=Yh(h),m=cr(ra,aa,ca,h).T;h=l.la?oa(m,_):(b,E,A)=>f(b,E,A,m,_)}else h=f;return l[u]=h}}(i,s);c&&c(e,o,s)}}),(t=Xc(t))&&function(s,o){zr(s,s.g.end());for(let c=0;c<o.length;c++)zr(s,Vc(o[c])||new Uint8Array(0))}(e,t)}function Zr(t,e){if(Array.isArray(e)){var i=0|e[z];if(4&i)return e;for(var s=0,o=0;s<e.length;s++){const c=t(e[s]);c!=null&&(e[o++]=c)}return o<s&&(e.length=o),te(e,-6145&(5|i)),2&i&&Object.freeze(e),e}}function we(t,e,i){return new Wr(t,e,i)}function qr(t,e,i){return new Wr(t,e,i)}function be(t,e,i){Ht(t,0|t[z],e,i)}var vp=na(function(t,e,i,s,o){return t.h===2&&(t=Gs(t,Tn([void 0,void 0],s,!0),o),Sn(s=0|e[z]),(o=en(e,s,i))instanceof Pi?(2&o.M)!=0?((o=o.da()).push(t),Ht(e,s,i,o)):o.Ja(t):Array.isArray(o)?(2&(0|o[z])&&Ht(e,s,i,o=Lh(o)),o.push(t)):Ht(e,s,i,[t]),!0)},function(t,e,i,s,o){if(e instanceof Pi)e.forEach((c,l)=>{ia(t,i,Tn([l,c],s,!1),o)});else if(Array.isArray(e))for(let c=0;c<e.length;c++){const l=e[c];Array.isArray(l)&&ia(t,i,Tn(l,s,!1),o)}});function Qh(t,e,i){if(e=function(s){if(s==null)return s;const o=typeof s;if(o==="bigint")return String($s(64,s));if(Ns(s)){if(o==="string")return _h(s);if(o==="number")return el(s)}}(e),e!=null&&(typeof e=="string"&&Nh(e),e!=null))switch(Ze(t,i,0),typeof e){case"number":t=t.g,rr(e),Vr(t,St,zt);break;case"bigint":i=BigInt.asUintN(64,e),i=new Al(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Vr(t.g,i.h,i.g);break;default:i=Nh(e),Vr(t.g,i.h,i.g)}}function t0(t,e,i){(e=Pr(e))!=null&&e!=null&&(Ze(t,i,0),ta(t.g,e))}function e0(t,e,i){(e=fh(e))!=null&&(Ze(t,i,0),t.g.g.push(e?1:0))}function i0(t,e,i){(e=$r(e))!=null&&ea(t,i,V2(e))}function n0(t,e,i,s,o){ia(t,i,Kh(e,s),o)}function r0(t,e,i){e==null||typeof e=="string"||e instanceof tn||(ir(e)?ir(e)&&Wc(ih):e=void 0),e!=null&&ea(t,i,vl(e).buffer)}function s0(t,e,i){return(t.h===5||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,yl,e):e.push(yl(t.g)),!0)}var an=we(function(t,e,i){if(t.h!==1)return!1;var s=t.g;t=bl(s);const o=bl(s);s=2*(o>>31)+1;const c=o>>>20&2047;return t=4294967296*(1048575&o)+t,be(e,i,c==2047?t?NaN:s*(1/0):c==0?5e-324*s*t:s*Math.pow(2,c-1075)*(t+4503599627370496)),!0},function(t,e,i){(e=Mn(e))!=null&&(Ze(t,i,1),t=t.g,(i=lh||(lh=new DataView(new ArrayBuffer(8)))).setFloat64(0,+e,!0),St=i.getUint32(0,!0),zt=i.getUint32(4,!0),zs(t,St),zs(t,zt))},Li()),ee=we(function(t,e,i){return t.h===5&&(be(e,i,yl(t.g)),!0)},function(t,e,i){(e=Mn(e))!=null&&(Ze(t,i,5),t=t.g,Yc(e),zs(t,St))},Il),_p=qr(s0,function(t,e,i){if((e=Zr(Mn,e))!=null)for(let l=0;l<e.length;l++){var s=t,o=i,c=e[l];c!=null&&(Ze(s,o,5),s=s.g,Yc(c),zs(s,St))}},Il),Ol=qr(s0,function(t,e,i){if((e=Zr(Mn,e))!=null&&e.length){Ze(t,i,2),Gr(t.g,4*e.length);for(let s=0;s<e.length;s++)i=t.g,Yc(e[s]),zs(i,St)}},Il),Bn=we(function(t,e,i){return t.h===0&&(be(e,i,_l(t.g,Qc)),!0)},Qh,Gh),Pl=we(function(t,e,i){return t.h===0&&(be(e,i,(t=_l(t.g,Qc))===0?void 0:t),!0)},Qh,Gh),wp=we(function(t,e,i){return t.h===0&&(be(e,i,_l(t.g,Jc)),!0)},function(t,e,i){if((e=Q5(e))!=null&&(typeof e=="string"&&$h(e),e!=null))switch(Ze(t,i,0),typeof e){case"number":t=t.g,rr(e),Vr(t,St,zt);break;case"bigint":i=BigInt.asUintN(64,e),i=new El(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Vr(t.g,i.h,i.g);break;default:i=$h(e),Vr(t.g,i.h,i.g)}},Li()),Wt=we(function(t,e,i){return t.h===0&&(be(e,i,Fn(t.g)),!0)},t0,Tl),la=qr(function(t,e,i){return(t.h===0||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,Fn,e):e.push(Fn(t.g)),!0)},function(t,e,i){if((e=Zr(Pr,e))!=null&&e.length){i=Sl(t,i);for(let s=0;s<e.length;s++)ta(t.g,e[s]);kl(t,i)}},Tl),jr=we(function(t,e,i){return t.h===0&&(be(e,i,(t=Fn(t.g))===0?void 0:t),!0)},t0,Tl),Ot=we(function(t,e,i){return t.h===0&&(be(e,i,wl(t.g)),!0)},e0,Hh),Xr=we(function(t,e,i){return t.h===0&&(be(e,i,(t=wl(t.g))===!1?void 0:t),!0)},e0,Hh),ge=qr(function(t,e,i){return t.h===2&&(t=xl(t),Hr(e,0|e[z],i,!1).push(t),!0)},function(t,e,i){if((e=Zr($r,e))!=null)for(let l=0;l<e.length;l++){var s=t,o=i,c=e[l];c!=null&&ea(s,o,V2(c))}},Ml),Rn=we(function(t,e,i){return t.h===2&&(be(e,i,(t=xl(t))===""?void 0:t),!0)},i0,Ml),yt=we(function(t,e,i){return t.h===2&&(be(e,i,xl(t)),!0)},i0,Ml),re=function(t,e,i=Ll){return new Wr(t,e,i)}(function(t,e,i,s,o){return t.h===2&&(s=Tn(void 0,s,!0),Hr(e,0|e[z],i,!0).push(s),Gs(t,s,o),!0)},function(t,e,i,s,o){if(Array.isArray(e))for(let c=0;c<e.length;c++)n0(t,e[c],i,s,o)}),Ct=na(function(t,e,i,s,o,c){return t.h===2&&(Mh(e,0|e[z],c,i),Gs(t,e=gl(e,s,i),o),!0)},n0),o0=we(function(t,e,i){return t.h===2&&(be(e,i,Uh(t)),!0)},r0,zh),bp=qr(function(t,e,i){return(t.h===0||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,on,e):e.push(on(t.g)),!0)},function(t,e,i){if((e=Zr(ph,e))!=null)for(let l=0;l<e.length;l++){var s=t,o=i,c=e[l];c!=null&&(Ze(s,o,0),Gr(s.g,c))}},Vh),yp=we(function(t,e,i){return t.h===0&&(be(e,i,(t=on(t.g))===0?void 0:t),!0)},function(t,e,i){(e=ph(e))!=null&&e!=null&&(Ze(t,i,0),Gr(t.g,e))},Vh),qe=we(function(t,e,i){return t.h===0&&(be(e,i,Fn(t.g)),!0)},function(t,e,i){(e=Pr(e))!=null&&(e=parseInt(e,10),Ze(t,i,0),ta(t.g,e))},Wh);class Cp{constructor(e,i){this.h=e,this.g=i,this.l=gt,this.m=Z,this.defaultValue=void 0}register(){Ro(this)}}function Mi(t,e){return new Cp(t,e)}function Dn(t,e){return(i,s)=>{if(Qo.length){const c=Qo.pop();c.o(s),Cl(c.g,i,s),i=c}else i=new class{constructor(c,l){if(Oh.length){const u=Oh.pop();Cl(u,c,l),c=u}else c=new class{constructor(u,h){this.h=null,this.m=!1,this.g=this.l=this.j=0,Cl(this,u,h)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(c,l);this.g=c,this.l=this.g.g,this.h=this.m=-1,this.o(l)}o({fa:c=!1}={}){this.fa=c}}(i,s);try{const c=new t,l=c.u;Dl(e)(l,i);var o=c}finally{i.g.clear(),i.m=-1,i.h=-1,Qo.length<100&&Qo.push(i)}return o}}function ua(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const l=this.g;return this.g=[],l}}}};Jh(this.u,e,cr(ra,aa,ca,t)),zr(e,e.g.end());const i=new Uint8Array(e.h),s=e.l,o=s.length;let c=0;for(let l=0;l<o;l++){const u=s[l];i.set(u,c),c+=u.length}return e.l=[i],i}}var a0=class extends H{constructor(t){super(t)}},c0=[0,Rn,we(function(t,e,i){return t.h===2&&(be(e,i,(t=Uh(t))===nr()?void 0:t),!0)},function(t,e,i){if(e!=null){if(e instanceof H){const s=e.Oa;return void(s&&(e=s(e),e!=null&&ea(t,i,vl(e).buffer)))}if(Array.isArray(e))return}r0(t,e,i)},zh)];let Ul,l0=globalThis.trustedTypes;function u0(t){Ul===void 0&&(Ul=function(){let i=null;if(!l0)return i;try{const s=o=>o;i=l0.createPolicy("goog#html",{createHTML:s,createScript:s,createScriptURL:s})}catch(s){}return i}());var e=Ul;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function xp(t,...e){if(e.length===0)return u0(t[0]);let i=t[0];for(let s=0;s<e.length;s++)i+=encodeURIComponent(e[s])+t[s+1];return u0(i)}var h0=[0,Wt,qe,Ot,-1,la,qe,-1],Ep=class extends H{constructor(t){super(t)}},d0=[0,Ot,yt,Ot,qe,-1,qr(function(t,e,i){return(t.h===0||t.h===2)&&(e=Hr(e,0|e[z],i,!1),t.h==2?Jo(t,hp,e):e.push(Fn(t.g)),!0)},function(t,e,i){if((e=Zr(Pr,e))!=null&&e.length){i=Sl(t,i);for(let s=0;s<e.length;s++)ta(t.g,e[s]);kl(t,i)}},Wh),yt,-1,[0,Ot,-1],qe,Ot,-1],f0=[0,yt,-2],p0=class extends H{constructor(t){super(t)}},g0=[0],m0=[0,Wt,Ot,1,Ot,-3],je=class extends H{constructor(t){super(t,2)}},ie={};ie[336783863]=[0,yt,Ot,-1,Wt,[0,[1,2,3,4,5,6,7,8,9],Ct,g0,Ct,d0,Ct,f0,Ct,m0,Ct,h0,Ct,[0,yt,-2],Ct,[0,yt,qe],Ct,[0,qe,yt,-1],Ct,[0,qe,-1]],[0,yt],Ot,[0,[1,3],[2,4],Ct,[0,la],-1,Ct,[0,ge],-1,re,[0,yt,-1]],yt];var v0=[0,Pl,-1,Xr,-3,Pl,la,Rn,jr,Pl,-1,Xr,jr,Xr,-2,Rn];function Xe(t,e){hl(t,2,Ur(e),"")}function Tt(t,e){jo(t,3,e)}function dt(t,e){jo(t,4,e)}var ye=class extends H{constructor(t){super(t,500)}o(t){return Z(this,0,7,t)}},Ws=[-1,{}],_0=[0,yt,1,Ws],w0=[0,yt,ge,Ws];function Ke(t,e){Xo(t,1,ye,e)}function Ft(t,e){jo(t,10,e)}function mt(t,e){jo(t,15,e)}var Re=class extends H{constructor(t){super(t,500)}o(t){return Z(this,0,1001,t)}},b0=[-500,re,[-500,Rn,-1,ge,-3,[-2,ie,Ot],re,c0,jr,-1,_0,w0,re,[0,Rn,Xr],Rn,v0,jr,ge,987,ge],4,re,[-500,yt,-1,[-1,{}],998,yt],re,[-500,yt,ge,-1,[-2,{},Ot],997,ge,-1],jr,re,[-500,yt,ge,Ws,998,ge],ge,jr,_0,w0,re,[0,Rn,-1,Ws],ge,-2,v0,Rn,-1,Xr,[0,Xr,yp],978,Ws,re,c0];Re.prototype.g=ua(b0);var Ap=Dn(Re,b0),Sp=class extends H{constructor(t){super(t)}},y0=class extends H{constructor(t){super(t)}g(){return rn(this,Sp,1)}},C0=[0,re,[0,Wt,ee,yt,-1]],ha=Dn(y0,C0),kp=class extends H{constructor(t){super(t)}},Lp=class extends H{constructor(t){super(t)}},$l=class extends H{constructor(t){super(t)}h(){return gt(this,kp,2)}g(){return rn(this,Lp,5)}},x0=Dn(class extends H{constructor(t){super(t)}},[0,ge,la,Ol,[0,qe,[0,Wt,-3],[0,ee,-3],[0,Wt,-1,[0,re,[0,Wt,-2]]],re,[0,ee,-1,yt,ee]],yt,-1,Bn,re,[0,Wt,ee],ge,Bn]),E0=class extends H{constructor(t){super(t)}},Kr=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,ee,-4]]),A0=class extends H{constructor(t){super(t)}},Zs=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,ee,-4]]),Mp=class extends H{constructor(t){super(t)}},Tp=[0,Wt,-1,Ol,qe],S0=class extends H{constructor(t){super(t)}};S0.prototype.g=ua([0,ee,-4,Bn]);var Ip=class extends H{constructor(t){super(t)}},Fp=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,1,Wt,yt,C0],Bn]),k0=class extends H{constructor(t){super(t)}},Bp=class extends H{constructor(t){super(t)}ma(){const t=kh(this);return t==null?nr():t}},Rp=class extends H{constructor(t){super(t)}},L0=[1,2],Dp=Dn(class extends H{constructor(t){super(t)}},[0,re,[0,L0,Ct,[0,Ol],Ct,[0,o0],Wt,yt],Bn]),Nl=class extends H{constructor(t){super(t)}},M0=[0,yt,Wt,ee,ge,-1],T0=class extends H{constructor(t){super(t)}},Op=[0,Ot,-1],I0=class extends H{constructor(t){super(t)}},da=[1,2,3,4,5],fa=class extends H{constructor(t){super(t)}g(){return kh(this)!=null}h(){return ui(this,2)!=null}},Pt=class extends H{constructor(t){super(t)}g(){var t;return(t=fh(Nr(this,2)))!=null?t:!1}},F0=[0,o0,yt,[0,Wt,Bn,-1],[0,wp,Bn]],Kt=[0,F0,Ot,[0,da,Ct,m0,Ct,d0,Ct,h0,Ct,g0,Ct,f0],qe],pa=class extends H{constructor(t){super(t)}},Hl=[0,Kt,ee,-1,Wt],Pp=Mi(502141897,pa);ie[502141897]=Hl;var Up=Dn(class extends H{constructor(t){super(t)}},[0,[0,qe,-1,_p,bp],Tp]),B0=class extends H{constructor(t){super(t)}},R0=class extends H{constructor(t){super(t)}},Vl=[0,Kt,ee,[0,Kt],Ot],D0=[0,Kt,Hl,Vl,ee,[0,[0,F0]]],$p=Mi(508968150,R0);ie[508968150]=D0,ie[508968149]=Vl;var O0=class extends H{constructor(t){super(t)}},Np=Mi(513916220,O0);ie[513916220]=[0,Kt,D0,Wt];var Yr=class extends H{constructor(t){super(t)}h(){return gt(this,Nl,2)}g(){Mt(this,2)}},P0=[0,Kt,M0];ie[478825465]=P0;var Hp=class extends H{constructor(t){super(t)}},U0=class extends H{constructor(t){super(t)}},Gl=class extends H{constructor(t){super(t)}},zl=class extends H{constructor(t){super(t)}},$0=class extends H{constructor(t){super(t)}},N0=[0,Kt,[0,Kt],P0,-1],H0=[0,Kt,ee,Wt],Wl=[0,Kt,ee],V0=[0,Kt,H0,Wl,ee],Vp=Mi(479097054,$0);ie[479097054]=[0,Kt,V0,N0],ie[463370452]=N0,ie[464864288]=H0;var Gp=Mi(462713202,zl);ie[462713202]=V0,ie[474472470]=Wl;var zp=class extends H{constructor(t){super(t)}},G0=class extends H{constructor(t){super(t)}},z0=class extends H{constructor(t){super(t)}},W0=class extends H{constructor(t){super(t)}},Zl=[0,Kt,ee,-1,Wt],ql=[0,Kt,ee,Ot];W0.prototype.g=ua([0,Kt,Wl,[0,Kt],Hl,Vl,Zl,ql]);var Z0=class extends H{constructor(t){super(t)}},Wp=Mi(456383383,Z0);ie[456383383]=[0,Kt,M0];var q0=class extends H{constructor(t){super(t)}},Zp=Mi(476348187,q0);ie[476348187]=[0,Kt,Op];var j0=class extends H{constructor(t){super(t)}},X0=class extends H{constructor(t){super(t)}},K0=[0,qe,-1],qp=Mi(458105876,class extends H{constructor(t){super(t)}g(){var t=this.u;const e=0|t[z],i=2&e;return t=function(s,o,c){var l=X0;const u=2&o;let h=!1;if(c==null){if(u)return Eh();c=[]}else if(c.constructor===Pi){if((2&c.M)==0||u)return c;c=c.da()}else Array.isArray(c)?h=!!(2&(0|c[z])):c=[];if(u){if(!c.length)return Eh();h||(h=!0,Dr(c))}else h&&(h=!1,c=Lh(c));return h||(64&(0|c[z])?c[z]&=-33:32&o&&Oo(c,32)),Ht(s,o,2,l=new Pi(c,l,tp,void 0)),l}(t,e,en(t,e,2)),!i&&X0&&(t.pa=!0),t}});ie[458105876]=[0,K0,vp,[!0,Bn,[0,yt,-1,ge]]];var jl=class extends H{constructor(t){super(t)}},Y0=Mi(458105758,jl);ie[458105758]=[0,Kt,yt,K0];var J0=class extends H{constructor(t){super(t)}},jp=Mi(443442058,J0);ie[443442058]=[0,Kt,yt,Wt,ee,ge,-1,Ot,ee],ie[514774813]=Zl;var Q0=class extends H{constructor(t){super(t)}},Xp=Mi(516587230,Q0);function Xl(t,e){return e=e?e.clone():new Nl,t.displayNamesLocale!==void 0?Mt(e,1,Ur(t.displayNamesLocale)):t.displayNamesLocale===void 0&&Mt(e,1),t.maxResults!==void 0?Ui(e,2,t.maxResults):"maxResults"in t&&Mt(e,2),t.scoreThreshold!==void 0?G(e,3,t.scoreThreshold):"scoreThreshold"in t&&Mt(e,3),t.categoryAllowlist!==void 0?Ko(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Mt(e,4),t.categoryDenylist!==void 0?Ko(e,5,t.categoryDenylist):"categoryDenylist"in t&&Mt(e,5),e}function Kl(t,e=-1,i=""){return{categories:t.map(s=>{var o,c,l,u,h,f,_;return{index:(c=(o=li(s,1))!=null?o:0)!=null?c:-1,score:(l=Xt(s,2))!=null?l:0,categoryName:(h=(u=ui(s,3))!=null?u:"")!=null?h:"",displayName:(_=(f=ui(s,4))!=null?f:"")!=null?_:""}}),headIndex:e,headName:i}}function td(t){var l,u,h,f,_,m,b,E,A,k,F,M,D;var e=or(t,3,Mn,sr()),i=or(t,2,Pr,sr()),s=or(t,1,$r,sr()),o=or(t,9,$r,sr());const c={categories:[],keypoints:[]};for(let R=0;R<e.length;R++)c.categories.push({score:e[R],index:(l=i[R])!=null?l:-1,categoryName:(u=s[R])!=null?u:"",displayName:(h=o[R])!=null?h:""});if((e=(f=gt(t,$l,4))==null?void 0:f.h())&&(c.boundingBox={originX:(_=li(e,1))!=null?_:0,originY:(m=li(e,2))!=null?m:0,width:(b=li(e,3))!=null?b:0,height:(E=li(e,4))!=null?E:0,angle:0}),(A=gt(t,$l,4))==null?void 0:A.g().length)for(const R of gt(t,$l,4).g())c.keypoints.push({x:(k=qo(R,1))!=null?k:0,y:(F=qo(R,2))!=null?F:0,score:(M=qo(R,4))!=null?M:0,label:(D=ui(R,3))!=null?D:""});return c}function ga(t){var i,s,o,c;const e=[];for(const l of rn(t,A0,1))e.push({x:(i=Xt(l,1))!=null?i:0,y:(s=Xt(l,2))!=null?s:0,z:(o=Xt(l,3))!=null?o:0,visibility:(c=Xt(l,4))!=null?c:0});return e}function qs(t){var i,s,o,c;const e=[];for(const l of rn(t,E0,1))e.push({x:(i=Xt(l,1))!=null?i:0,y:(s=Xt(l,2))!=null?s:0,z:(o=Xt(l,3))!=null?o:0,visibility:(c=Xt(l,4))!=null?c:0});return e}function ed(t){return Array.from(t,e=>e>127?e-256:e)}function id(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let i=0,s=0,o=0;for(let c=0;c<t.length;c++)i+=t[c]*e[c],s+=t[c]*t[c],o+=e[c]*e[c];if(s<=0||o<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(s*o)}let ma;ie[516587230]=[0,Kt,Zl,ql,ee],ie[518928384]=ql;const Kp=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 nd(){return q(this,null,function*(){if(ma===void 0)try{yield WebAssembly.instantiate(Kp),ma=!0}catch(t){ma=!1}return ma})}function js(i){return q(this,arguments,function*(t,e=xp``){const s=(yield nd())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${s}.js`,wasmBinaryPath:`${e}/${t}_${s}.wasm`}})}var lr=class{};function rd(){var t=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}function sd(t){return q(this,null,function*(){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((i,s)=>{e.addEventListener("load",()=>{i()},!1),e.addEventListener("error",o=>{s(o)},!1),document.body.appendChild(e)})}importScripts(t.toString())})}function od(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function W(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function ad(t,e,i){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(i?t.i._bindTextureToStream(i):t.i._bindTextureToCanvas(),!(i=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[s,o]=od(e);return!t.l||s===t.i.canvas.width&&o===t.i.canvas.height||(t.i.canvas.width=s,t.i.canvas.height=o),[s,o]}function cd(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const s=new Uint32Array(e.length);for(let o=0;o<e.length;o++)s[o]=t.i.stringToNewUTF8(e[o]);e=t.i._malloc(4*s.length),t.i.HEAPU32.set(s,e>>2),i(e);for(const o of s)t.i._free(o);t.i._free(e)}function $i(t,e,i){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=i}function On(t,e,i){let s=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(o,c,l)=>{c?(i(s,l),s=[]):s.push(o)}}lr.forVisionTasks=function(t){return js("vision",t)},lr.forTextTasks=function(t){return js("text",t)},lr.forGenAiExperimentalTasks=function(t){return js("genai_experimental",t)},lr.forGenAiTasks=function(t){return js("genai",t)},lr.forAudioTasks=function(t){return js("audio",t)},lr.isSimdSupported=function(){return nd()};function Yp(t,e,i,s){return q(this,null,function*(){return t=yield((o,c,l,u,h)=>q(null,null,function*(){if(c&&(yield sd(c)),!self.ModuleFactory||l&&(yield sd(l),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&h&&((c=self.Module).locateFile=h.locateFile,h.mainScriptUrlOrBlob&&(c.mainScriptUrlOrBlob=h.mainScriptUrlOrBlob)),h=yield self.ModuleFactory(self.Module||h),self.ModuleFactory=self.Module=void 0,new o(h,u)}))(t,i.wasmLoaderPath,i.assetLoaderPath,e,{locateFile:o=>o.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&o.endsWith(".data")?i.assetBinaryPath.toString():o}),yield t.o(s),t})}function Yl(t,e){const i=gt(t.baseOptions,fa,1)||new fa;typeof e=="string"?(Mt(i,2,Ur(e)),Mt(i,1)):e instanceof Uint8Array&&(Mt(i,1,jc(e,!1)),Mt(i,2)),Z(t.baseOptions,0,1,i)}function ld(t){try{const e=t.G.length;if(e===1)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map(i=>i.message).join(", "))}finally{t.G=[]}}function U(t,e){t.B=Math.max(t.B,e)}function va(t,e){t.A=new ye,Xe(t.A,"PassThroughCalculator"),Tt(t.A,"free_memory"),dt(t.A,"free_memory_unused_out"),Ft(e,"free_memory"),Ke(e,t.A)}function Jr(t,e){Tt(t.A,e),dt(t.A,e+"_unused_out")}function _a(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var Jl=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){var i,s,o,c,l,u;if(e){const h=t.baseOptions||{};if((i=t.baseOptions)!=null&&i.modelAssetBuffer&&((s=t.baseOptions)!=null&&s.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((o=gt(this.baseOptions,fa,1))!=null&&o.g()||(c=gt(this.baseOptions,fa,1))!=null&&c.h()||(l=t.baseOptions)!=null&&l.modelAssetBuffer||(u=t.baseOptions)!=null&&u.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(f,_){let m=gt(f.baseOptions,I0,3);if(!m){var b=m=new I0,E=new p0;Hs(b,4,da,E)}"delegate"in _&&(_.delegate==="GPU"?(_=m,b=new Ep,Hs(_,2,da,b)):(_=m,b=new p0,Hs(_,4,da,b))),Z(f.baseOptions,0,3,m)}(this,h),h.modelAssetPath)return fetch(h.modelAssetPath.toString()).then(f=>{if(f.ok)return f.arrayBuffer();throw Error(`Failed to fetch model: ${h.modelAssetPath} (${f.status})`)}).then(f=>{try{this.g.i.FS_unlink("/model.dat")}catch(_){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(f),!0,!1,!1),Yl(this,"/model.dat"),this.m(),this.J()});if(h.modelAssetBuffer instanceof Uint8Array)Yl(this,h.modelAssetBuffer);else if(h.modelAssetBuffer)return function(f){return q(this,null,function*(){const _=[];for(var m=0;;){const{done:b,value:E}=yield f.read();if(b)break;_.push(E),m+=E.length}if(_.length===0)return new Uint8Array(0);if(_.length===1)return _[0];f=new Uint8Array(m),m=0;for(const b of _)f.set(b,m),m+=b.length;return f})}(h.modelAssetBuffer).then(f=>{Yl(this,f),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca(e=>{t=Ap(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((i,s)=>{this.G.push(Error(s))}),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,ld(this)}finishProcessing(){this.g.finishProcessing(),ld(this)}close(){this.A=void 0,this.g.closeGraph()}};function Ce(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Jl.prototype.close=Jl.prototype.close;class Jp{constructor(e,i,s,o){this.g=e,this.h=i,this.m=s,this.l=o}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ud(t,e,i){const s=t.g;if(i=Ce(s.createShader(i),"Failed to create WebGL shader"),s.shaderSource(i,e),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${s.getShaderInfoLog(i)}`);return s.attachShader(t.h,i),i}function hd(t,e){const i=t.g,s=Ce(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(s);const o=Ce(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,o),i.enableVertexAttribArray(t.P),i.vertexAttribPointer(t.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 c=Ce(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,c),i.enableVertexAttribArray(t.J),i.vertexAttribPointer(t.J,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(e?[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 Jp(i,s,o,c)}function Ql(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function Xs(t,e,i,s){return Ql(t,e),t.h||(t.m(),t.C()),i?(t.s||(t.s=hd(t,!0)),i=t.s):(t.v||(t.v=hd(t,!1)),i=t.v),e.useProgram(t.h),i.bind(),t.l(),t=s(),i.g.bindVertexArray(null),t}function Pn(t,e,i){return Ql(t,e),t=Ce(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i!=null?i:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i!=null?i:e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function wa(t,e,i){Ql(t,e),t.A||(t.A=Ce(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0)}function t1(t){var e;(e=t.g)==null||e.bindFramebuffer(t.g.FRAMEBUFFER,null)}var Qr=class{G(){return`
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 Mn=="object"&&Mn&&Mn.Object===Object&&Mn;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,M1;function td(){if(M1)return vs;M1=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 L(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 L(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,L1;function id(){if(L1)return bs;L1=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)=>M(null,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=()=>M(null,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:()=>M(null,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 L=null,w=null;try{const I=yield navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});L=(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(!(L&&w&&L!==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 Ms(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 Ls(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 Md(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 Ld(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)&&Ms(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:Ld)(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||Ms(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=Ls){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?Ls: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?Ls: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 Mt(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=Mt(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=Mt(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=Mt(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=Mt(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 Mc(e){const t=Mt(e.g);return kc(e.g,t)}function sr(e,t,i){var n=Mt(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 Lc(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 Mi(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 Li(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function ar(e,t){if(t>=0)Li(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){Li(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),Li(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 Me(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),Mi(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new co(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Mi(e.g,i.h,i.g);break;default:i=Tc(t),Mi(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)&&Ms(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 Lt=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,Me(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&&(Me(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),Li(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&&(Me(t,i,to(e.g,Os)),!0)},jc,Bc),_o=Se(function(e,t,i){return e.h===0&&(Me(t,i,(e=to(e.g,Os))===0?void 0:e),!0)},jc,Bc),qd=Se(function(e,t,i){return e.h===0&&(Me(t,i,to(e.g,Rs)),!0)},function(e,t,i){if((t=Sd(t))!=null&&(typeof t=="string"&&Lc(t),t!=null))switch($e(e,i,0),typeof t){case"number":e=e.g,ii(t),Mi(e,q,oe);break;case"bigint":i=BigInt.asUintN(64,t),i=new ao(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),Mi(e.g,i.h,i.g);break;default:i=Lc(t),Mi(e.g,i.h,i.g)}},ct()),ae=Se(function(e,t,i){return e.h===0&&(Me(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&&(Me(t,i,(e=jt(e.g))===0?void 0:e),!0)},Gc,fo),Q=Se(function(e,t,i){return e.h===0&&(Me(t,i,io(e.g)),!0)},zc,Ic),Ri=Se(function(e,t,i){return e.h===0&&(Me(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&&(Me(t,i,(e=oo(e))===""?void 0:e),!0)},Zc,po),j=Se(function(e,t,i){return e.h===2&&(Me(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&&(Me(t,i,Mc(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,Mt,t):t.push(Mt(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),Li(n.g,s))}},Fc),Xd=Se(function(e,t,i){return e.h===0&&(Me(t,i,(e=Mt(e.g))===0?void 0:e),!0)},function(e,t,i){(t=rc(t))!=null&&t!=null&&($e(e,i,0),Li(e.g,t))},Fc),Ne=Se(function(e,t,i){return e.h===0&&(Me(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&&(Me(t,i,(e=Mc(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 Le=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,Le,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)}},Ml=class extends C{constructor(e){super(e)}},So=class extends C{constructor(e){super(e)}},Mo=class extends C{constructor(e){super(e)}},Ll=class extends C{constructor(e){super(e)}},Tl=[0,de,[0,de],Sl,-1],Il=[0,de,ge,ae],Lo=[0,de,ge],Fl=[0,de,Il,Lo,ge],g0=lt(479097054,Ll);ve[479097054]=[0,de,Fl,Tl],ve[463370452]=Tl,ve[464864288]=Il;var v0=lt(462713202,Mo);ve[462713202]=Fl,ve[474472470]=Lo;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,Lo,[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,Md,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 M(this,null,function*(){if(Er===void 0)try{yield WebAssembly.instantiate(x0),Er=!0}catch(e){Er=!1}return Er})}function yn(i){return M(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 M(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 M(this,null,function*(){return e=yield((r,s,o,a,c)=>M(null,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 Le,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 M(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`
3168
3142
  precision mediump float;
3169
3143
  varying vec2 vTex;
3170
3144
  uniform sampler2D inputTexture;
3171
3145
  void main() {
3172
3146
  gl_FragColor = texture2D(inputTexture, vTex);
3173
3147
  }
3174
- `}m(){const t=this.g;if(this.h=Ce(t.createProgram(),"Failed to create WebGL program"),this.Z=ud(this,`
3148
+ `}m(){const e=this.g;if(this.h=Te(e.createProgram(),"Failed to create WebGL program"),this.Z=e2(this,`
3175
3149
  attribute vec2 aVertex;
3176
3150
  attribute vec2 aTex;
3177
3151
  varying vec2 vTex;
3178
3152
  void main(void) {
3179
3153
  gl_Position = vec4(aVertex, 0.0, 1.0);
3180
3154
  vTex = aTex;
3181
- }`,t.VERTEX_SHADER),this.Y=ud(this,this.G(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.Z),t.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},Qp=class extends Qr{G(){return`
3155
+ }`,e.VERTEX_SHADER),this.Y=e2(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},S0=class extends Ni{G(){return`
3182
3156
  precision mediump float;
3183
3157
  uniform sampler2D backgroundTexture;
3184
3158
  uniform sampler2D maskTexture;
@@ -3190,7 +3164,7 @@ function print() { __p += __j.call(arguments, '') }
3190
3164
  vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
3191
3165
  gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
3192
3166
  }
3193
- `}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=Pn(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=Pn(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.L=Ce(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=Ce(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=Ce(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.K,0),t.uniform1i(this.L,1),t.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},t6=class extends Qr{G(){return`
3167
+ `}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.B=Wt(this,e,e.LINEAR),e.activeTexture(e.TEXTURE2),this.j=Wt(this,e,e.NEAREST)}m(){super.m();const e=this.g;this.L=Te(e.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=Te(e.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=Te(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const e=this.g;e.uniform1i(this.K,0),e.uniform1i(this.L,1),e.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},M0=class extends Ni{G(){return`
3194
3168
  precision mediump float;
3195
3169
  uniform sampler2D maskTexture;
3196
3170
  uniform sampler2D defaultTexture;
@@ -3204,7 +3178,7 @@ function print() { __p += __j.call(arguments, '') }
3204
3178
  overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
3205
3179
  gl_FragColor = mix(defaultColor, overlayColor, confidence);
3206
3180
  }
3207
- `}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=Pn(this,t),t.activeTexture(t.TEXTURE2),this.B=Pn(this,t)}m(){super.m();const t=this.g;this.K=Ce(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Ce(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Ce(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.H,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function cn(t,e){switch(e){case 0:return t.g.find(i=>i instanceof Uint8Array);case 1:return t.g.find(i=>i instanceof Float32Array);case 2:return t.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function e1(t){var e=cn(t,1);if(!e){if(e=cn(t,0))e=new Float32Array(e).map(s=>s/255);else{e=new Float32Array(t.width*t.height);const s=ts(t);var i=i1(t);if(wa(i,s,dd(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(t.width*t.height*4),s.readPixels(0,0,t.width,t.height,s.RGBA,s.FLOAT,i);for(let o=0,c=0;o<e.length;++o,c+=4)e[o]=i[c]}else s.readPixels(0,0,t.width,t.height,s.RED,s.FLOAT,e)}t.g.push(e)}return e}function dd(t){let e=cn(t,2);if(!e){const i=ts(t);e=pd(t);const s=e1(t),o=fd(t);i.texImage2D(i.TEXTURE_2D,0,o,t.width,t.height,0,i.RED,i.FLOAT,s),n1(t)}return e}function ts(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=Ce(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function fd(t){if(t=ts(t),!ba)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))ba=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");ba=t.R16F}return ba}function i1(t){return t.l||(t.l=new Qr),t.l}function pd(t){const e=ts(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=cn(t,2);return i||(i=Pn(i1(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(i),t.j=!0),e.bindTexture(e.TEXTURE_2D,i),i}function n1(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var ba,se=class{constructor(t,e,i,s,o,c,l){this.g=t,this.m=e,this.j=i,this.canvas=s,this.l=o,this.width=c,this.height=l,this.j&&--gd===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!cn(this,0)}ja(){return!!cn(this,1)}R(){return!!cn(this,2)}ia(){return(e=cn(t=this,0))||(e=e1(t),e=new Uint8Array(e.map(i=>255*i)),t.g.push(e)),e;var t,e}ha(){return e1(this)}N(){return dd(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof Uint8Array)i=new Uint8Array(e);else if(e instanceof Float32Array)i=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const s=ts(this),o=i1(this);s.activeTexture(s.TEXTURE1),i=Pn(o,s,this.m?s.LINEAR:s.NEAREST),s.bindTexture(s.TEXTURE_2D,i);const c=fd(this);s.texImage2D(s.TEXTURE_2D,0,c,this.width,this.height,0,s.RED,s.FLOAT,null),s.bindTexture(s.TEXTURE_2D,null),wa(o,s,i),Xs(o,s,!1,()=>{pd(this),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4),n1(this)}),t1(o),n1(this)}}t.push(i)}return new se(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ts(this).deleteTexture(cn(this,2)),gd=-1}};se.prototype.close=se.prototype.close,se.prototype.clone=se.prototype.clone,se.prototype.getAsWebGLTexture=se.prototype.N,se.prototype.getAsFloat32Array=se.prototype.ha,se.prototype.getAsUint8Array=se.prototype.ia,se.prototype.hasWebGLTexture=se.prototype.R,se.prototype.hasFloat32Array=se.prototype.ja,se.prototype.hasUint8Array=se.prototype.Da;var gd=250;const e6={color:"white",lineWidth:4,radius:6};function r1(t){return Fe(ys(Fe({},e6),{fillColor:(t=t||{}).color}),t)}function ln(t,e){return t instanceof Function?t(e):t}function md(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function Ks(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Ys(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function vd(t,e,i){var s;if(e.R())i(e.N());else{const o=e.ja()?e.ha():e.ia();t.m=(s=t.m)!=null?s:new Qr;const c=Ys(t);i((t=new se([o],e.m,!1,c.canvas,t.m,e.width,e.height)).N()),t.close()}}function _d(t,e,i,s){const o=function(u){return u.g||(u.g=new Qp),u.g}(t),c=Ys(t),l=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;Xs(o,c,!0,()=>{(function(h,f,_,m){const b=h.g;if(b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,f),b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,h.B),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,_),h.H&&function(E,A){if(E!==A)return!1;E=E.entries(),A=A.entries();for(const[F,M]of E){E=F;const D=M;var k=A.next();if(k.done)return!1;const[R,$]=k.value;if(k=$,E!==R||D[0]!==k[0]||D[1]!==k[1]||D[2]!==k[2]||D[3]!==k[3])return!1}return!!A.next().done}(h.H,m))b.activeTexture(b.TEXTURE2),b.bindTexture(b.TEXTURE_2D,h.j);else{h.H=m;const E=Array(1024).fill(0);m.forEach((A,k)=>{if(A.length!==4)throw Error(`Color at index ${k} is not a four-channel value.`);E[4*k]=A[0],E[4*k+1]=A[1],E[4*k+2]=A[2],E[4*k+3]=A[3]}),b.activeTexture(b.TEXTURE2),b.bindTexture(b.TEXTURE_2D,h.j),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,256,1,0,b.RGBA,b.UNSIGNED_BYTE,new Uint8Array(E))}})(o,e,l,s),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),c.drawArrays(c.TRIANGLE_FAN,0,4);const u=o.g;u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,null),u.activeTexture(u.TEXTURE1),u.bindTexture(u.TEXTURE_2D,null),u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,null)})}function wd(t,e,i,s){const o=Ys(t),c=function(h){return h.h||(h.h=new t6),h.h}(t),l=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,u=Array.isArray(s)?new ImageData(new Uint8ClampedArray(s),1,1):s;Xs(c,o,!0,()=>{var h=c.g;h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,c.j),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,l),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,c.B),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,u),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4),o.bindTexture(o.TEXTURE_2D,null),(h=c.g).activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,null),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,null),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,null)})}var xe=class{constructor(t,e){typeof CanvasRenderingContext2D!="undefined"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var i=Ks(this);e=r1(e),i.save();var s=i.canvas,o=0;for(const c of t)i.fillStyle=ln(e.fillColor,{index:o,from:c}),i.strokeStyle=ln(e.color,{index:o,from:c}),i.lineWidth=ln(e.lineWidth,{index:o,from:c}),(t=new Path2D).arc(c.x*s.width,c.y*s.height,ln(e.radius,{index:o,from:c}),0,2*Math.PI),i.fill(t),i.stroke(t),++o;i.restore()}}va(t,e,i){if(t&&e){var s=Ks(this);i=r1(i),s.save();var o=s.canvas,c=0;for(const l of e){s.beginPath(),e=t[l.start];const u=t[l.end];e&&u&&(s.strokeStyle=ln(i.color,{index:c,from:e,to:u}),s.lineWidth=ln(i.lineWidth,{index:c,from:e,to:u}),s.moveTo(e.x*o.width,e.y*o.height),s.lineTo(u.x*o.width,u.y*o.height)),++c,s.stroke()}s.restore()}}sa(t,e){const i=Ks(this);e=r1(e),i.save(),i.beginPath(),i.lineWidth=ln(e.lineWidth,{}),i.strokeStyle=ln(e.color,{}),i.fillStyle=ln(e.fillColor,{}),i.moveTo(t.originX,t.originY),i.lineTo(t.originX+t.width,t.originY),i.lineTo(t.originX+t.width,t.originY+t.height),i.lineTo(t.originX,t.originY+t.height),i.lineTo(t.originX,t.originY),i.stroke(),i.fill(),i.restore()}ta(t,e,i=[0,0,0,255]){this.l?function(s,o,c,l){const u=Ys(s);vd(s,o,h=>{_d(s,h,c,l),(h=Ks(s)).drawImage(u.canvas,0,0,h.canvas.width,h.canvas.height)})}(this,t,i,e):_d(this,t.N(),i,e)}ua(t,e,i){this.l?function(s,o,c,l){const u=Ys(s);vd(s,o,h=>{wd(s,h,c,l),(h=Ks(s)).drawImage(u.canvas,0,0,h.canvas.width,h.canvas.height)})}(this,t,e,i):wd(this,t.N(),e,i)}close(){var t,e,i;(t=this.g)==null||t.close(),this.g=void 0,(e=this.h)==null||e.close(),this.h=void 0,(i=this.m)==null||i.close(),this.m=void 0}};function Ni(t,e){switch(e){case 0:return t.g.find(i=>i instanceof ImageData);case 1:return t.g.find(i=>typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap);case 2:return t.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function bd(t){var e=Ni(t,0);if(!e){e=es(t);const i=Ca(t),s=new Uint8Array(t.width*t.height*4);wa(i,e,ya(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,s),t1(i),e=new ImageData(new Uint8ClampedArray(s.buffer),t.width,t.height),t.g.push(e)}return e}function ya(t){let e=Ni(t,2);if(!e){const i=es(t);e=xa(t);const s=Ni(t,1)||bd(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,s),Js(t)}return e}function es(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=Ce(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Ca(t){return t.l||(t.l=new Qr),t.l}function xa(t){const e=es(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=Ni(t,2);return i||(i=Pn(Ca(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function Js(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function yd(t){const e=es(t);return Xs(Ca(t),e,!0,()=>function(i,s){const o=i.canvas;if(o.width===i.width&&o.height===i.height)return s();const c=o.width,l=o.height;return o.width=i.width,o.height=i.height,i=s(),o.width=c,o.height=l,i}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}xe.prototype.close=xe.prototype.close,xe.prototype.drawConfidenceMask=xe.prototype.ua,xe.prototype.drawCategoryMask=xe.prototype.ta,xe.prototype.drawBoundingBox=xe.prototype.sa,xe.prototype.drawConnectors=xe.prototype.va,xe.prototype.drawLandmarks=xe.prototype.wa,xe.lerp=function(t,e,i,s,o){return md(s*(1-(t-e)/(i-e))+o*(1-(i-t)/(i-e)),s,o)},xe.clamp=md;var ce=class{constructor(t,e,i,s,o,c,l){this.g=t,this.j=e,this.m=i,this.canvas=s,this.l=o,this.width=c,this.height=l,(this.j||this.m)&&--Cd===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!Ni(this,0)}ka(){return!!Ni(this,1)}R(){return!!Ni(this,2)}Aa(){return bd(this)}za(){var t=Ni(this,1);return t||(ya(this),xa(this),t=yd(this),Js(this),this.g.push(t),this.j=!0),t}N(){return ya(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof ImageData)i=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const s=es(this),o=Ca(this);s.activeTexture(s.TEXTURE1),i=Pn(o,s),s.bindTexture(s.TEXTURE_2D,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,this.width,this.height,0,s.RGBA,s.UNSIGNED_BYTE,null),s.bindTexture(s.TEXTURE_2D,null),wa(o,s,i),Xs(o,s,!1,()=>{xa(this),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4),Js(this)}),t1(o),Js(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);ya(this),xa(this),i=yd(this),Js(this)}t.push(i)}return new ce(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ni(this,1).close(),this.m&&es(this).deleteTexture(Ni(this,2)),Cd=-1}};ce.prototype.close=ce.prototype.close,ce.prototype.clone=ce.prototype.clone,ce.prototype.getAsWebGLTexture=ce.prototype.N,ce.prototype.getAsImageBitmap=ce.prototype.za,ce.prototype.getAsImageData=ce.prototype.Aa,ce.prototype.hasWebGLTexture=ce.prototype.R,ce.prototype.hasImageBitmap=ce.prototype.ka,ce.prototype.hasImageData=ce.prototype.Ca;var Cd=250;function Ti(...t){return t.map(([e,i])=>({start:e,end:i}))}const i6=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((xd=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",e!==void 0?this.i.canvas=e:rd()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}initializeGraph(t){return q(this,null,function*(){const e=yield(yield fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)})}setGraphFromString(t){this.setGraph(new TextEncoder().encode(t),!1)}setGraph(t,e){const i=t.length,s=this.i._malloc(i);this.i.HEAPU8.set(t,s),e?this.i._changeBinaryGraph(i,s):this.i._changeTextGraph(i,s),this.i._free(s)}configureAudio(t,e,i,s,o){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),W(this,s||"input_audio",c=>{W(this,o=o||"audio_header",l=>{this.i._configureAudio(c,l,t,e!=null?e:0,i)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){$i(this,"__graph_config__",e=>{t(e)}),W(this,"__graph_config__",e=>{this.i._getGraphConfig(e,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,i){this.addAudioToStreamWithShape(t,0,0,e,i)}addAudioToStreamWithShape(t,e,i,s,o){const c=4*t.length;this.h!==c&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(c),this.h=c),this.i.HEAPF32.set(t,this.g/4),W(this,s,l=>{this.i._addAudioToInputStream(this.g,e,i,l,o)})}addGpuBufferToStream(t,e,i){W(this,e,s=>{const[o,c]=ad(this,t,s);this.i._addBoundTextureToStream(s,o,c,i)})}addBoolToStream(t,e,i){W(this,e,s=>{this.i._addBoolToInputStream(t,s,i)})}addDoubleToStream(t,e,i){W(this,e,s=>{this.i._addDoubleToInputStream(t,s,i)})}addFloatToStream(t,e,i){W(this,e,s=>{this.i._addFloatToInputStream(t,s,i)})}addIntToStream(t,e,i){W(this,e,s=>{this.i._addIntToInputStream(t,s,i)})}addUintToStream(t,e,i){W(this,e,s=>{this.i._addUintToInputStream(t,s,i)})}addStringToStream(t,e,i){W(this,e,s=>{W(this,t,o=>{this.i._addStringToInputStream(o,s,i)})})}addStringRecordToStream(t,e,i){W(this,e,s=>{cd(this,Object.keys(t),o=>{cd(this,Object.values(t),c=>{this.i._addFlatHashMapToInputStream(o,c,Object.keys(t).length,s,i)})})})}addProtoToStream(t,e,i,s){W(this,i,o=>{W(this,e,c=>{const l=this.i._malloc(t.length);this.i.HEAPU8.set(t,l),this.i._addProtoToInputStream(l,t.length,c,o,s),this.i._free(l)})})}addEmptyPacketToStream(t,e){W(this,t,i=>{this.i._addEmptyPacketToInputStream(i,e)})}addBoolVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateBoolVector(t.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(const c of t)this.i._addBoolVectorEntry(o,c);this.i._addBoolVectorToInputStream(o,s,i)})}addDoubleVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateDoubleVector(t.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(const c of t)this.i._addDoubleVectorEntry(o,c);this.i._addDoubleVectorToInputStream(o,s,i)})}addFloatVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateFloatVector(t.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(const c of t)this.i._addFloatVectorEntry(o,c);this.i._addFloatVectorToInputStream(o,s,i)})}addIntVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateIntVector(t.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(const c of t)this.i._addIntVectorEntry(o,c);this.i._addIntVectorToInputStream(o,s,i)})}addUintVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateUintVector(t.length);if(!o)throw Error("Unable to allocate new unsigned int vector on heap.");for(const c of t)this.i._addUintVectorEntry(o,c);this.i._addUintVectorToInputStream(o,s,i)})}addStringVectorToStream(t,e,i){W(this,e,s=>{const o=this.i._allocateStringVector(t.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(const c of t)W(this,c,l=>{this.i._addStringVectorEntry(o,l)});this.i._addStringVectorToInputStream(o,s,i)})}addBoolToInputSidePacket(t,e){W(this,e,i=>{this.i._addBoolToInputSidePacket(t,i)})}addDoubleToInputSidePacket(t,e){W(this,e,i=>{this.i._addDoubleToInputSidePacket(t,i)})}addFloatToInputSidePacket(t,e){W(this,e,i=>{this.i._addFloatToInputSidePacket(t,i)})}addIntToInputSidePacket(t,e){W(this,e,i=>{this.i._addIntToInputSidePacket(t,i)})}addUintToInputSidePacket(t,e){W(this,e,i=>{this.i._addUintToInputSidePacket(t,i)})}addStringToInputSidePacket(t,e){W(this,e,i=>{W(this,t,s=>{this.i._addStringToInputSidePacket(s,i)})})}addProtoToInputSidePacket(t,e,i){W(this,i,s=>{W(this,e,o=>{const c=this.i._malloc(t.length);this.i.HEAPU8.set(t,c),this.i._addProtoToInputSidePacket(c,t.length,o,s),this.i._free(c)})})}addBoolVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateBoolVector(t.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const o of t)this.i._addBoolVectorEntry(s,o);this.i._addBoolVectorToInputSidePacket(s,i)})}addDoubleVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateDoubleVector(t.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const o of t)this.i._addDoubleVectorEntry(s,o);this.i._addDoubleVectorToInputSidePacket(s,i)})}addFloatVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateFloatVector(t.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const o of t)this.i._addFloatVectorEntry(s,o);this.i._addFloatVectorToInputSidePacket(s,i)})}addIntVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateIntVector(t.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const o of t)this.i._addIntVectorEntry(s,o);this.i._addIntVectorToInputSidePacket(s,i)})}addUintVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateUintVector(t.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const o of t)this.i._addUintVectorEntry(s,o);this.i._addUintVectorToInputSidePacket(s,i)})}addStringVectorToInputSidePacket(t,e){W(this,e,i=>{const s=this.i._allocateStringVector(t.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const o of t)W(this,o,c=>{this.i._addStringVectorEntry(s,c)});this.i._addStringVectorToInputSidePacket(s,i)})}attachBoolListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(t,e){$i(this,t,e),W(this,t,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(t,e){On(this,t,e),W(this,t,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(t,e,i){$i(this,t,e),W(this,t,s=>{this.i._attachProtoListener(s,i||!1)})}attachProtoVectorListener(t,e,i){On(this,t,e),W(this,t,s=>{this.i._attachProtoVectorListener(s,i||!1)})}attachAudioListener(t,e,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),$i(this,t,(s,o)=>{s=new Float32Array(s.buffer,s.byteOffset,s.length/4),e(s,o)}),W(this,t,s=>{this.i._attachAudioListener(s,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends xd{get ea(){return this.i}oa(t,e,i){W(this,e,s=>{const[o,c]=ad(this,t,s);this.ea._addBoundTextureAsImageToStream(s,o,c,i)})}V(t,e){$i(this,t,e),W(this,t,i=>{this.ea._attachImageListener(i)})}ba(t,e){On(this,t,e),W(this,t,i=>{this.ea._attachImageVectorListener(i)})}}));var xd,hi=class extends i6{};function ct(t,e,i){return q(this,null,function*(){var s;return function(o,c,l,u){return q(this,null,function*(){return Yp(o,c,l,u)})}(t,(s=i.canvas)!=null?s:rd()?void 0:document.createElement("canvas"),e,i)})}function Ed(t,e,i,s){if(t.U){const c=new S0;if(i!=null&&i.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var o=i.regionOfInterest;if(o.left>=o.right||o.top>=o.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(o.left<0||o.top<0||o.right>1||o.bottom>1)throw Error("Expected RectF values to be in [0,1].");G(c,1,(o.left+o.right)/2),G(c,2,(o.top+o.bottom)/2),G(c,4,o.right-o.left),G(c,3,o.bottom-o.top)}else G(c,1,.5),G(c,2,.5),G(c,4,1),G(c,3,1);if(i!=null&&i.rotationDegrees){if((i==null?void 0:i.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(G(c,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[l,u]=od(e);i=Xt(c,3)*u/l,o=Xt(c,4)*l/u,G(c,4,i),G(c,3,o)}}t.g.addProtoToStream(c.g(),"mediapipe.NormalizedRect",t.U,s)}t.g.oa(e,t.Z,s!=null?s:performance.now()),t.finishProcessing()}function di(t,e,i){var s;if((s=t.baseOptions)!=null&&s.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Ed(t,e,i,t.B+1)}function Hi(t,e,i,s){var o;if(!((o=t.baseOptions)!=null&&o.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Ed(t,e,i,s)}function is(t,e,i,s){var o=e.data;const c=e.width,l=c*(e=e.height);if((o instanceof Uint8Array||o instanceof Float32Array)&&o.length!==l)throw Error("Unsupported channel count: "+o.length/l);return t=new se([o],i,!1,t.g.i.canvas,t.P,c,e),s?t.clone():t}var De=class extends Jl{constructor(t,e,i,s){super(t),this.g=t,this.Z=e,this.U=i,this.na=s,this.P=new Qr}l(t,e=!0){if("runningMode"in t&&Vs(this.baseOptions,2,!!t.runningMode&&t.runningMode!=="IMAGE"),t.canvas!==void 0&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};De.prototype.close=De.prototype.close;var fi=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},Z(t=this.h=new pa,0,1,e=new Pt),G(this.h,2,.5),G(this.h,3,.3)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i;return"minDetectionConfidence"in t&&G(this.h,2,(e=t.minDetectionConfidence)!=null?e:.5),"minSuppressionThreshold"in t&&G(this.h,3,(i=t.minSuppressionThreshold)!=null?i:.3),this.l(t)}D(t,e){return this.j={detections:[]},di(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect_in"),mt(t,"detections");const e=new je;ki(e,Pp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect_in"),dt(i,"DETECTIONS:detections"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("detections",(s,o)=>{for(const c of s)s=x0(c),this.j.detections.push(td(s));U(this,o)}),this.g.attachEmptyPacketListener("detections",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fi.prototype.detectForVideo=fi.prototype.F,fi.prototype.detect=fi.prototype.D,fi.prototype.setOptions=fi.prototype.o,fi.createFromModelPath=function(t,e){return q(this,null,function*(){return ct(fi,t,{baseOptions:{modelAssetPath:e}})})},fi.createFromModelBuffer=function(t,e){return ct(fi,t,{baseOptions:{modelAssetBuffer:e}})},fi.createFromOptions=function(t,e){return ct(fi,t,e)};var s1=Ti([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),o1=Ti([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),a1=Ti([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Ad=Ti([474,475],[475,476],[476,477],[477,474]),c1=Ti([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),l1=Ti([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Sd=Ti([469,470],[470,471],[471,472],[472,469]),u1=Ti([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),kd=[...s1,...o1,...a1,...c1,...l1,...u1],Ld=Ti([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Md(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var Bt=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,Z(t=this.h=new R0,0,1,e=new Pt),this.v=new B0,Z(this.h,0,3,this.v),this.s=new pa,Z(this.h,0,2,this.s),Ui(this.s,4,1),G(this.s,2,.5),G(this.v,2,.5),G(this.h,4,.5)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i,s,o;return"numFaces"in t&&Ui(this.s,4,(e=t.numFaces)!=null?e:1),"minFaceDetectionConfidence"in t&&G(this.s,2,(i=t.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in t&&G(this.h,4,(s=t.minTrackingConfidence)!=null?s:.5),"minFacePresenceConfidence"in t&&G(this.v,2,(o=t.minFacePresenceConfidence)!=null?o:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return Md(this),di(this,t,e),this.j}F(t,e,i){return Md(this),Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"face_landmarks");const e=new je;ki(e,$p,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("face_landmarks",(s,o)=>{for(const c of s)s=Zs(c),this.j.faceLandmarks.push(ga(s));U(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{U(this,s)}),this.outputFaceBlendshapes&&(mt(t,"blendshapes"),dt(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(s,o)=>{var c;if(this.outputFaceBlendshapes)for(const l of s)s=ha(l),this.j.faceBlendshapes.push(Kl((c=s.g())!=null?c:[]));U(this,o)}),this.g.attachEmptyPacketListener("blendshapes",s=>{U(this,s)})),this.outputFacialTransformationMatrixes&&(mt(t,"face_geometry"),dt(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(s,o)=>{var c,l,u,h,f;if(this.outputFacialTransformationMatrixes)for(const _ of s)(s=gt(Up(_),Mp,2))&&this.j.facialTransformationMatrixes.push({rows:(l=(c=li(s,1))!=null?c:0)!=null?l:0,columns:(h=(u=li(s,2))!=null?u:0)!=null?h:0,data:(f=or(s,3,Mn,sr()).slice())!=null?f:[]});U(this,o)}),this.g.attachEmptyPacketListener("face_geometry",s=>{U(this,s)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Bt.prototype.detectForVideo=Bt.prototype.F,Bt.prototype.detect=Bt.prototype.D,Bt.prototype.setOptions=Bt.prototype.o,Bt.createFromModelPath=function(t,e){return ct(Bt,t,{baseOptions:{modelAssetPath:e}})},Bt.createFromModelBuffer=function(t,e){return ct(Bt,t,{baseOptions:{modelAssetBuffer:e}})},Bt.createFromOptions=function(t,e){return ct(Bt,t,e)},Bt.FACE_LANDMARKS_LIPS=s1,Bt.FACE_LANDMARKS_LEFT_EYE=o1,Bt.FACE_LANDMARKS_LEFT_EYEBROW=a1,Bt.FACE_LANDMARKS_LEFT_IRIS=Ad,Bt.FACE_LANDMARKS_RIGHT_EYE=c1,Bt.FACE_LANDMARKS_RIGHT_EYEBROW=l1,Bt.FACE_LANDMARKS_RIGHT_IRIS=Sd,Bt.FACE_LANDMARKS_FACE_OVAL=u1,Bt.FACE_LANDMARKS_CONTOURS=kd,Bt.FACE_LANDMARKS_TESSELATION=Ld;var Vi=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!0),Z(t=this.j=new O0,0,1,e=new Pt)}get baseOptions(){return gt(this.j,Pt,1)}set baseOptions(t){Z(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,i){const s=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:i,di(this,t,s!=null?s:{}),!this.h)return this.s}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"stylized_image");const e=new je;ki(e,Np,this.j);const i=new ye;Xe(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Ke(t,i),this.g.V("stylized_image",(s,o)=>{var c=!this.h,l=s.data,u=s.width;const h=u*(s=s.height);if(l instanceof Uint8Array)if(l.length===3*h){const f=new Uint8ClampedArray(4*h);for(let _=0;_<h;++_)f[4*_]=l[3*_],f[4*_+1]=l[3*_+1],f[4*_+2]=l[3*_+2],f[4*_+3]=255;l=new ImageData(f,u,s)}else{if(l.length!==4*h)throw Error("Unsupported channel count: "+l.length/h);l=new ImageData(new Uint8ClampedArray(l.buffer,l.byteOffset,l.length),u,s)}else if(!(l instanceof WebGLTexture))throw Error(`Unsupported format: ${l.constructor.name}`);u=new ce([l],!1,!1,this.g.i.canvas,this.P,u,s),this.s=c=c?u.clone():u,this.h&&this.h(c),U(this,o)}),this.g.attachEmptyPacketListener("stylized_image",s=>{this.s=null,this.h&&this.h(null),U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Vi.prototype.stylize=Vi.prototype.Ka,Vi.prototype.setOptions=Vi.prototype.o,Vi.createFromModelPath=function(t,e){return ct(Vi,t,{baseOptions:{modelAssetPath:e}})},Vi.createFromModelBuffer=function(t,e){return ct(Vi,t,{baseOptions:{modelAssetBuffer:e}})},Vi.createFromOptions=function(t,e){return ct(Vi,t,e)};var h1=Ti([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function Td(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function Id(t){return t.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function Fd(t,e=!0){var o,c,l,u,h,f;const i=[];for(const _ of t){var s=ha(_);t=[];for(const m of s.g())s=e&&li(m,1)!=null?(o=li(m,1))!=null?o:0:-1,t.push({score:(c=Xt(m,2))!=null?c:0,index:s,categoryName:(u=(l=ui(m,3))!=null?l:"")!=null?u:"",displayName:(f=(h=ui(m,4))!=null?h:"")!=null?f:""});i.push(t)}return i}var Ye=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Z(t=this.j=new $0,0,1,e=new Pt),this.s=new zl,Z(this.j,0,2,this.s),this.C=new Gl,Z(this.s,0,3,this.C),this.v=new U0,Z(this.s,0,2,this.v),this.h=new Hp,Z(this.j,0,3,this.h),G(this.v,2,.5),G(this.s,4,.5),G(this.C,2,.5)}get baseOptions(){return gt(this.j,Pt,1)}set baseOptions(t){Z(this.j,0,1,t)}o(t){var o,c,l,u,h,f,_,m;if(Ui(this.v,3,(o=t.numHands)!=null?o:1),"minHandDetectionConfidence"in t&&G(this.v,2,(c=t.minHandDetectionConfidence)!=null?c:.5),"minTrackingConfidence"in t&&G(this.s,4,(l=t.minTrackingConfidence)!=null?l:.5),"minHandPresenceConfidence"in t&&G(this.C,2,(u=t.minHandPresenceConfidence)!=null?u:.5),t.cannedGesturesClassifierOptions){var e=new Yr,i=e,s=Xl(t.cannedGesturesClassifierOptions,(h=gt(this.h,Yr,3))==null?void 0:h.h());Z(i,0,2,s),Z(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&((f=gt(this.h,Yr,3))==null||f.g());return t.customGesturesClassifierOptions?(Z(i=e=new Yr,0,2,s=Xl(t.customGesturesClassifierOptions,(_=gt(this.h,Yr,4))==null?void 0:_.h())),Z(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&((m=gt(this.h,Yr,4))==null||m.g()),this.l(t)}Fa(t,e){return Td(this),di(this,t,e),Id(this)}Ga(t,e,i){return Td(this),Hi(this,t,i,e),Id(this)}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"hand_gestures"),mt(t,"hand_landmarks"),mt(t,"world_hand_landmarks"),mt(t,"handedness");const e=new je;ki(e,Vp,this.j);const i=new ye;Xe(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"HAND_GESTURES:hand_gestures"),dt(i,"LANDMARKS:hand_landmarks"),dt(i,"WORLD_LANDMARKS:world_hand_landmarks"),dt(i,"HANDEDNESS:handedness"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("hand_landmarks",(s,o)=>{var c,l,u,h;for(const f of s){s=Zs(f);const _=[];for(const m of rn(s,A0,1))_.push({x:(c=Xt(m,1))!=null?c:0,y:(l=Xt(m,2))!=null?l:0,z:(u=Xt(m,3))!=null?u:0,visibility:(h=Xt(m,4))!=null?h:0});this.landmarks.push(_)}U(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("world_hand_landmarks",(s,o)=>{var c,l,u,h;for(const f of s){s=Kr(f);const _=[];for(const m of rn(s,E0,1))_.push({x:(c=Xt(m,1))!=null?c:0,y:(l=Xt(m,2))!=null?l:0,z:(u=Xt(m,3))!=null?u:0,visibility:(h=Xt(m,4))!=null?h:0});this.worldLandmarks.push(_)}U(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("hand_gestures",(s,o)=>{this.gestures.push(...Fd(s,!1)),U(this,o)}),this.g.attachEmptyPacketListener("hand_gestures",s=>{U(this,s)}),this.g.attachProtoVectorListener("handedness",(s,o)=>{this.handedness.push(...Fd(s)),U(this,o)}),this.g.attachEmptyPacketListener("handedness",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Bd(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}Ye.prototype.recognizeForVideo=Ye.prototype.Ga,Ye.prototype.recognize=Ye.prototype.Fa,Ye.prototype.setOptions=Ye.prototype.o,Ye.createFromModelPath=function(t,e){return ct(Ye,t,{baseOptions:{modelAssetPath:e}})},Ye.createFromModelBuffer=function(t,e){return ct(Ye,t,{baseOptions:{modelAssetBuffer:e}})},Ye.createFromOptions=function(t,e){return ct(Ye,t,e)},Ye.HAND_CONNECTIONS=h1;var Je=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Z(t=this.h=new zl,0,1,e=new Pt),this.s=new Gl,Z(this.h,0,3,this.s),this.j=new U0,Z(this.h,0,2,this.j),Ui(this.j,3,1),G(this.j,2,.5),G(this.s,2,.5),G(this.h,4,.5)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i,s,o;return"numHands"in t&&Ui(this.j,3,(e=t.numHands)!=null?e:1),"minHandDetectionConfidence"in t&&G(this.j,2,(i=t.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in t&&G(this.h,4,(s=t.minTrackingConfidence)!=null?s:.5),"minHandPresenceConfidence"in t&&G(this.s,2,(o=t.minHandPresenceConfidence)!=null?o:.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],di(this,t,e),Bd(this)}F(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Hi(this,t,i,e),Bd(this)}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"hand_landmarks"),mt(t,"world_hand_landmarks"),mt(t,"handedness");const e=new je;ki(e,Gp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"LANDMARKS:hand_landmarks"),dt(i,"WORLD_LANDMARKS:world_hand_landmarks"),dt(i,"HANDEDNESS:handedness"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("hand_landmarks",(s,o)=>{for(const c of s)s=Zs(c),this.landmarks.push(ga(s));U(this,o)}),this.g.attachEmptyPacketListener("hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("world_hand_landmarks",(s,o)=>{for(const c of s)s=Kr(c),this.worldLandmarks.push(qs(s));U(this,o)}),this.g.attachEmptyPacketListener("world_hand_landmarks",s=>{U(this,s)}),this.g.attachProtoVectorListener("handedness",(s,o)=>{var h,f,_,m,b,E,A;var c=this.handedness,l=c.push;const u=[];for(const k of s){s=ha(k);const F=[];for(const M of s.g())F.push({score:(h=Xt(M,2))!=null?h:0,index:(_=(f=li(M,1))!=null?f:0)!=null?_:-1,categoryName:(b=(m=ui(M,3))!=null?m:"")!=null?b:"",displayName:(A=(E=ui(M,4))!=null?E:"")!=null?A:""});u.push(F)}l.call(c,...u),U(this,o)}),this.g.attachEmptyPacketListener("handedness",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Je.prototype.detectForVideo=Je.prototype.F,Je.prototype.detect=Je.prototype.D,Je.prototype.setOptions=Je.prototype.o,Je.createFromModelPath=function(t,e){return ct(Je,t,{baseOptions:{modelAssetPath:e}})},Je.createFromModelBuffer=function(t,e){return ct(Je,t,{baseOptions:{modelAssetBuffer:e}})},Je.createFromOptions=function(t,e){return ct(Je,t,e)},Je.HAND_CONNECTIONS=h1;var Rd=Ti([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function Dd(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Od(t){try{if(!t.C)return t.h;t.C(t.h)}finally{_a(t)}}function Ea(t,e){t=Zs(t),e.push(ga(t))}var Ut=class extends De{constructor(t,e){super(new hi(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,Z(t=this.j=new W0,0,1,e=new Pt),this.K=new Gl,Z(this.j,0,2,this.K),this.Y=new zp,Z(this.j,0,3,this.Y),this.s=new pa,Z(this.j,0,4,this.s),this.H=new B0,Z(this.j,0,5,this.H),this.v=new G0,Z(this.j,0,6,this.v),this.L=new z0,Z(this.j,0,7,this.L),G(this.s,2,.5),G(this.s,3,.3),G(this.H,2,.5),G(this.v,2,.5),G(this.v,3,.3),G(this.L,2,.5),G(this.K,2,.5)}get baseOptions(){return gt(this.j,Pt,1)}set baseOptions(t){Z(this.j,0,1,t)}o(t){var e,i,s,o,c,l,u;return"minFaceDetectionConfidence"in t&&G(this.s,2,(e=t.minFaceDetectionConfidence)!=null?e:.5),"minFaceSuppressionThreshold"in t&&G(this.s,3,(i=t.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in t&&G(this.H,2,(s=t.minFacePresenceConfidence)!=null?s:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&G(this.v,2,(o=t.minPoseDetectionConfidence)!=null?o:.5),"minPoseSuppressionThreshold"in t&&G(this.v,3,(c=t.minPoseSuppressionThreshold)!=null?c:.3),"minPosePresenceConfidence"in t&&G(this.L,2,(l=t.minPosePresenceConfidence)!=null?l:.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&G(this.K,2,(u=t.minHandLandmarksConfidence)!=null?u:.5),this.l(t)}D(t,e,i){const s=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:i,Dd(this),di(this,t,s),Od(this)}F(t,e,i,s){const o=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:s,Dd(this),Hi(this,t,o,e),Od(this)}m(){var t=new Re;Ft(t,"input_frames_image"),mt(t,"pose_landmarks"),mt(t,"pose_world_landmarks"),mt(t,"face_landmarks"),mt(t,"left_hand_landmarks"),mt(t,"left_hand_world_landmarks"),mt(t,"right_hand_landmarks"),mt(t,"right_hand_world_landmarks");const e=new je,i=new a0;hl(i,1,Ur("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(o,c){if(c!=null)if(Array.isArray(c))Mt(o,2,zo(c,al,void 0,void 0,!1));else{if(!(typeof c=="string"||c instanceof tn||ir(c)))throw Error("invalid value in Any.value field: "+c+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");hl(o,2,jc(c,!1),nr())}}(i,this.j.g());const s=new ye;Xe(s,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Xo(s,8,a0,i),Tt(s,"IMAGE:input_frames_image"),dt(s,"POSE_LANDMARKS:pose_landmarks"),dt(s,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),dt(s,"FACE_LANDMARKS:face_landmarks"),dt(s,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),dt(s,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),dt(s,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),dt(s,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),s.o(e),Ke(t,s),va(this,t),this.g.attachProtoListener("pose_landmarks",(o,c)=>{Ea(o,this.h.poseLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("pose_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("pose_world_landmarks",(o,c)=>{var l=this.h.poseWorldLandmarks;o=Kr(o),l.push(qs(o)),U(this,c)}),this.g.attachEmptyPacketListener("pose_world_landmarks",o=>{U(this,o)}),this.outputPoseSegmentationMasks&&(dt(s,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Jr(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(o,c)=>{this.h.poseSegmentationMasks=[is(this,o,!0,!this.C)],U(this,c)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",o=>{this.h.poseSegmentationMasks=[],U(this,o)})),this.g.attachProtoListener("face_landmarks",(o,c)=>{Ea(o,this.h.faceLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("face_landmarks",o=>{U(this,o)}),this.outputFaceBlendshapes&&(mt(t,"extra_blendshapes"),dt(s,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(o,c)=>{var u;var l=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(o=ha(o),l.push(Kl((u=o.g())!=null?u:[]))),U(this,c)}),this.g.attachEmptyPacketListener("extra_blendshapes",o=>{U(this,o)})),this.g.attachProtoListener("left_hand_landmarks",(o,c)=>{Ea(o,this.h.leftHandLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("left_hand_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("left_hand_world_landmarks",(o,c)=>{var l=this.h.leftHandWorldLandmarks;o=Kr(o),l.push(qs(o)),U(this,c)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("right_hand_landmarks",(o,c)=>{Ea(o,this.h.rightHandLandmarks),U(this,c)}),this.g.attachEmptyPacketListener("right_hand_landmarks",o=>{U(this,o)}),this.g.attachProtoListener("right_hand_world_landmarks",(o,c)=>{var l=this.h.rightHandWorldLandmarks;o=Kr(o),l.push(qs(o)),U(this,c)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",o=>{U(this,o)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ut.prototype.detectForVideo=Ut.prototype.F,Ut.prototype.detect=Ut.prototype.D,Ut.prototype.setOptions=Ut.prototype.o,Ut.createFromModelPath=function(t,e){return ct(Ut,t,{baseOptions:{modelAssetPath:e}})},Ut.createFromModelBuffer=function(t,e){return ct(Ut,t,{baseOptions:{modelAssetBuffer:e}})},Ut.createFromOptions=function(t,e){return ct(Ut,t,e)},Ut.HAND_CONNECTIONS=h1,Ut.POSE_CONNECTIONS=Rd,Ut.FACE_LANDMARKS_LIPS=s1,Ut.FACE_LANDMARKS_LEFT_EYE=o1,Ut.FACE_LANDMARKS_LEFT_EYEBROW=a1,Ut.FACE_LANDMARKS_LEFT_IRIS=Ad,Ut.FACE_LANDMARKS_RIGHT_EYE=c1,Ut.FACE_LANDMARKS_RIGHT_EYEBROW=l1,Ut.FACE_LANDMARKS_RIGHT_IRIS=Sd,Ut.FACE_LANDMARKS_FACE_OVAL=u1,Ut.FACE_LANDMARKS_CONTOURS=kd,Ut.FACE_LANDMARKS_TESSELATION=Ld;var pi=class extends De{constructor(t,e){super(new hi(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},Z(t=this.h=new Z0,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){return Z(this.h,0,2,Xl(t,gt(this.h,Nl,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},di(this,t,e),this.j}ra(t,e,i){return this.j={classifications:[]},Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"input_image"),Ft(t,"norm_rect"),mt(t,"classifications");const e=new je;ki(e,Wp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Tt(i,"IMAGE:input_image"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"CLASSIFICATIONS:classifications"),i.o(e),Ke(t,i),this.g.attachProtoListener("classifications",(s,o)=>{this.j=function(c){var u;const l={classifications:rn(c,Ip,1).map(h=>{var f,_,m,b;return Kl((_=(f=gt(h,y0,4))==null?void 0:f.g())!=null?_:[],(m=li(h,2))!=null?m:0,(b=ui(h,3))!=null?b:"")})};return il(Nr(c,2))!=null&&(l.timestampMs=(u=il(Nr(c,2)))!=null?u:0),l}(Fp(s)),U(this,o)}),this.g.attachEmptyPacketListener("classifications",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};pi.prototype.classifyForVideo=pi.prototype.ra,pi.prototype.classify=pi.prototype.qa,pi.prototype.setOptions=pi.prototype.o,pi.createFromModelPath=function(t,e){return ct(pi,t,{baseOptions:{modelAssetPath:e}})},pi.createFromModelBuffer=function(t,e){return ct(pi,t,{baseOptions:{modelAssetBuffer:e}})},pi.createFromOptions=function(t,e){return ct(pi,t,e)};var Qe=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!0),this.h=new q0,this.embeddings={embeddings:[]},Z(t=this.h,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e=this.h,i=gt(this.h,T0,2);return i=i?i.clone():new T0,t.l2Normalize!==void 0?Vs(i,1,t.l2Normalize):"l2Normalize"in t&&Mt(i,1),t.quantize!==void 0?Vs(i,2,t.quantize):"quantize"in t&&Mt(i,2),Z(e,0,2,i),this.l(t)}xa(t,e){return di(this,t,e),this.embeddings}ya(t,e,i){return Hi(this,t,i,e),this.embeddings}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"embeddings_out");const e=new je;ki(e,Zp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"EMBEDDINGS:embeddings_out"),i.o(e),Ke(t,i),this.g.attachProtoListener("embeddings_out",(s,o)=>{s=Dp(s),this.embeddings=function(c){var l;return{embeddings:rn(c,Rp,1).map(u=>{var f,_,m,b,E,A,k;const h={headIndex:(_=(f=li(u,3))!=null?f:0)!=null?_:-1,headName:(b=(m=ui(u,4))!=null?m:"")!=null?b:""};if(Th(u,k0,dl(u,1))!==void 0)u=or(u=gt(u,k0,dl(u,1)),1,Mn,sr()),h.floatEmbedding=u.slice();else{const F=new Uint8Array(0);h.quantizedEmbedding=(k=(A=(E=gt(u,Bp,dl(u,2)))==null?void 0:E.ma())==null?void 0:A.h())!=null?k:F}return h}),timestampMs:(l=il(Nr(c,2)))!=null?l:0}}(s),U(this,o)}),this.g.attachEmptyPacketListener("embeddings_out",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Qe.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=id(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=id(ed(t.quantizedEmbedding),ed(e.quantizedEmbedding))}return t},Qe.prototype.embedForVideo=Qe.prototype.ya,Qe.prototype.embed=Qe.prototype.xa,Qe.prototype.setOptions=Qe.prototype.o,Qe.createFromModelPath=function(t,e){return ct(Qe,t,{baseOptions:{modelAssetPath:e}})},Qe.createFromModelBuffer=function(t,e){return ct(Qe,t,{baseOptions:{modelAssetBuffer:e}})},Qe.createFromOptions=function(t,e){return ct(Qe,t,e)};var d1=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(i=>{i.close()}),(e=this.categoryMask)==null||e.close()}};function Pd(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Ud(t){try{const e=new d1(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{_a(t)}}d1.prototype.close=d1.prototype.close;var Oe=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new jl,this.v=new j0,Z(this.h,0,3,this.v),Z(t=this.h,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i;return t.displayNamesLocale!==void 0?Mt(this.h,2,Ur(t.displayNamesLocale)):"displayNamesLocale"in t&&Mt(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(i=t.outputConfidenceMasks)!=null?i:!0),super.l(t)}J(){(function(t){var i,s,o;const e=rn(t.ca(),ye,1).filter(c=>{var l;return((l=ui(c,1))!=null?l:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&((o=(s=(i=gt(e[0],je,7))==null?void 0:i.l())==null?void 0:s.g())!=null?o:new Map).forEach((c,l)=>{var u;t.s[Number(l)]=(u=ui(c,1))!=null?u:""})})(this)}segment(t,e,i){const s=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:i,Pd(this),di(this,t,s),Ud(this)}Ia(t,e,i,s){const o=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:s,Pd(this),Hi(this,t,o,e),Ud(this)}Ba(){return this.s}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect");const e=new je;ki(e,Y0,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),i.o(e),Ke(t,i),va(this,t),this.outputConfidenceMasks&&(mt(t,"confidence_masks"),dt(i,"CONFIDENCE_MASKS:confidence_masks"),Jr(this,"confidence_masks"),this.g.ba("confidence_masks",(s,o)=>{this.confidenceMasks=s.map(c=>is(this,c,!0,!this.j)),U(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",s=>{this.confidenceMasks=[],U(this,s)})),this.outputCategoryMask&&(mt(t,"category_mask"),dt(i,"CATEGORY_MASK:category_mask"),Jr(this,"category_mask"),this.g.V("category_mask",(s,o)=>{this.categoryMask=is(this,s,!1,!this.j),U(this,o)}),this.g.attachEmptyPacketListener("category_mask",s=>{this.categoryMask=void 0,U(this,s)})),mt(t,"quality_scores"),dt(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(s,o)=>{this.qualityScores=s,U(this,o)}),this.g.attachEmptyPacketListener("quality_scores",s=>{this.categoryMask=void 0,U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Oe.prototype.getLabels=Oe.prototype.Ba,Oe.prototype.segmentForVideo=Oe.prototype.Ia,Oe.prototype.segment=Oe.prototype.segment,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(t,e){return ct(Oe,t,{baseOptions:{modelAssetPath:e}})},Oe.createFromModelBuffer=function(t,e){return ct(Oe,t,{baseOptions:{modelAssetBuffer:e}})},Oe.createFromOptions=function(t,e){return ct(Oe,t,e)};var f1=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(i=>{i.close()}),(e=this.categoryMask)==null||e.close()}};f1.prototype.close=f1.prototype.close;var n6=class extends H{constructor(t){super(t)}},ns=[0,Wt,-2],Aa=[0,an,-3,Ot,an,-1],$d=[0,Aa],Nd=[0,Aa,Wt,-1],p1=class extends H{constructor(t){super(t)}},Hd=[0,an,-1,Ot],r6=class extends H{constructor(t){super(t)}},Vd=class extends H{constructor(t){super(t)}},g1=[1,2,3,4,5,6,7,8,9,10,14,15],Gd=class extends H{constructor(t){super(t)}};Gd.prototype.g=ua([0,re,[0,g1,Ct,Aa,Ct,[0,Aa,ns],Ct,$d,Ct,[0,$d,ns],Ct,Hd,Ct,[0,an,-3,Ot,qe],Ct,[0,an,-3,Ot],Ct,[0,yt,an,-2,Ot,Wt,Ot,-1,2,an,ns],Ct,Nd,Ct,[0,Nd,ns],an,ns,yt,Ct,[0,an,-3,Ot,ns,-1],Ct,[0,re,Hd]],yt,[0,yt,Wt,-1,Ot]]);var Gi=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new jl,this.s=new j0,Z(this.h,0,3,this.s),Z(t=this.h,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i;return"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(i=t.outputConfidenceMasks)!=null?i:!0),super.l(t)}segment(t,e,i,s){const o=typeof i!="function"?i:{};this.j=typeof i=="function"?i:s,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,s=new Gd;const c=new Vd;var l=new n6;if(Ui(l,1,255),Z(c,0,12,l),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var u=new p1;Vs(u,3,!0),G(u,1,e.keypoint.x),G(u,2,e.keypoint.y),Hs(c,5,g1,u)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(u of(l=new r6,e.scribble))Vs(e=new p1,3,!0),G(e,1,u.x),G(e,2,u.y),Xo(l,1,p1,e);Hs(c,15,g1,l)}Xo(s,1,Vd,c),this.g.addProtoToStream(s.g(),"drishti.RenderData","roi_in",i),di(this,t,o);t:{try{const f=new f1(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var h=f;break t}this.j(f)}finally{_a(this)}h=void 0}return h}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"roi_in"),Ft(t,"norm_rect_in");const e=new je;ki(e,Y0,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"ROI:roi_in"),Tt(i,"NORM_RECT:norm_rect_in"),i.o(e),Ke(t,i),va(this,t),this.outputConfidenceMasks&&(mt(t,"confidence_masks"),dt(i,"CONFIDENCE_MASKS:confidence_masks"),Jr(this,"confidence_masks"),this.g.ba("confidence_masks",(s,o)=>{this.confidenceMasks=s.map(c=>is(this,c,!0,!this.j)),U(this,o)}),this.g.attachEmptyPacketListener("confidence_masks",s=>{this.confidenceMasks=[],U(this,s)})),this.outputCategoryMask&&(mt(t,"category_mask"),dt(i,"CATEGORY_MASK:category_mask"),Jr(this,"category_mask"),this.g.V("category_mask",(s,o)=>{this.categoryMask=is(this,s,!1,!this.j),U(this,o)}),this.g.attachEmptyPacketListener("category_mask",s=>{this.categoryMask=void 0,U(this,s)})),mt(t,"quality_scores"),dt(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(s,o)=>{this.qualityScores=s,U(this,o)}),this.g.attachEmptyPacketListener("quality_scores",s=>{this.categoryMask=void 0,U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Gi.prototype.segment=Gi.prototype.segment,Gi.prototype.setOptions=Gi.prototype.o,Gi.createFromModelPath=function(t,e){return ct(Gi,t,{baseOptions:{modelAssetPath:e}})},Gi.createFromModelBuffer=function(t,e){return ct(Gi,t,{baseOptions:{modelAssetBuffer:e}})},Gi.createFromOptions=function(t,e){return ct(Gi,t,e)};var gi=class extends De{constructor(t,e){super(new hi(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},Z(t=this.h=new J0,0,1,e=new Pt)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?Mt(this.h,2,Ur(t.displayNamesLocale)):"displayNamesLocale"in t&&Mt(this.h,2),t.maxResults!==void 0?Ui(this.h,3,t.maxResults):"maxResults"in t&&Mt(this.h,3),t.scoreThreshold!==void 0?G(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&Mt(this.h,4),t.categoryAllowlist!==void 0?Ko(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&Mt(this.h,5),t.categoryDenylist!==void 0?Ko(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&Mt(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},di(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},Hi(this,t,i,e),this.j}m(){var t=new Re;Ft(t,"input_frame_gpu"),Ft(t,"norm_rect"),mt(t,"detections");const e=new je;ki(e,jp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),Tt(i,"IMAGE:input_frame_gpu"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"DETECTIONS:detections"),i.o(e),Ke(t,i),this.g.attachProtoVectorListener("detections",(s,o)=>{for(const c of s)s=x0(c),this.j.detections.push(td(s));U(this,o)}),this.g.attachEmptyPacketListener("detections",s=>{U(this,s)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};gi.prototype.detectForVideo=gi.prototype.F,gi.prototype.detect=gi.prototype.D,gi.prototype.setOptions=gi.prototype.o,gi.createFromModelPath=function(t,e){return q(this,null,function*(){return ct(gi,t,{baseOptions:{modelAssetPath:e}})})},gi.createFromModelBuffer=function(t,e){return ct(gi,t,{baseOptions:{modelAssetBuffer:e}})},gi.createFromOptions=function(t,e){return ct(gi,t,e)};var m1=class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=i}close(){var t;(t=this.segmentationMasks)==null||t.forEach(e=>{e.close()})}};function zd(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Wd(t){try{const e=new m1(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{_a(t)}}m1.prototype.close=m1.prototype.close;var ti=class extends De{constructor(t,e){super(new hi(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,Z(t=this.h=new Q0,0,1,e=new Pt),this.v=new z0,Z(this.h,0,3,this.v),this.j=new G0,Z(this.h,0,2,this.j),Ui(this.j,4,1),G(this.j,2,.5),G(this.v,2,.5),G(this.h,4,.5)}get baseOptions(){return gt(this.h,Pt,1)}set baseOptions(t){Z(this.h,0,1,t)}o(t){var e,i,s,o,c;return"numPoses"in t&&Ui(this.j,4,(e=t.numPoses)!=null?e:1),"minPoseDetectionConfidence"in t&&G(this.j,2,(i=t.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in t&&G(this.h,4,(s=t.minTrackingConfidence)!=null?s:.5),"minPosePresenceConfidence"in t&&G(this.v,2,(o=t.minPosePresenceConfidence)!=null?o:.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=(c=t.outputSegmentationMasks)!=null?c:!1),this.l(t)}D(t,e,i){const s=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:i,zd(this),di(this,t,s),Wd(this)}F(t,e,i,s){const o=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:s,zd(this),Hi(this,t,o,e),Wd(this)}m(){var t=new Re;Ft(t,"image_in"),Ft(t,"norm_rect"),mt(t,"normalized_landmarks"),mt(t,"world_landmarks"),mt(t,"segmentation_masks");const e=new je;ki(e,Xp,this.h);const i=new ye;Xe(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Tt(i,"IMAGE:image_in"),Tt(i,"NORM_RECT:norm_rect"),dt(i,"NORM_LANDMARKS:normalized_landmarks"),dt(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Ke(t,i),va(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(s,o)=>{this.landmarks=[];for(const c of s)s=Zs(c),this.landmarks.push(ga(s));U(this,o)}),this.g.attachEmptyPacketListener("normalized_landmarks",s=>{this.landmarks=[],U(this,s)}),this.g.attachProtoVectorListener("world_landmarks",(s,o)=>{this.worldLandmarks=[];for(const c of s)s=Kr(c),this.worldLandmarks.push(qs(s));U(this,o)}),this.g.attachEmptyPacketListener("world_landmarks",s=>{this.worldLandmarks=[],U(this,s)}),this.outputSegmentationMasks&&(dt(i,"SEGMENTATION_MASK:segmentation_masks"),Jr(this,"segmentation_masks"),this.g.ba("segmentation_masks",(s,o)=>{this.segmentationMasks=s.map(c=>is(this,c,!0,!this.s)),U(this,o)}),this.g.attachEmptyPacketListener("segmentation_masks",s=>{this.segmentationMasks=[],U(this,s)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ti.prototype.detectForVideo=ti.prototype.F,ti.prototype.detect=ti.prototype.D,ti.prototype.setOptions=ti.prototype.o,ti.createFromModelPath=function(t,e){return ct(ti,t,{baseOptions:{modelAssetPath:e}})},ti.createFromModelBuffer=function(t,e){return ct(ti,t,{baseOptions:{modelAssetBuffer:e}})},ti.createFromOptions=function(t,e){return ct(ti,t,e)},ti.POSE_CONNECTIONS=Rd;const s6=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;let i=1,s=0,o=1,c=0;e.forEach(f=>{f&&typeof f.x=="number"&&typeof f.y=="number"&&(i=Math.min(i,f.x),s=Math.max(s,f.x),o=Math.min(o,f.y),c=Math.max(c,f.y))});const l=s-i,u=c-o;return Math.max(l,u)},o6=(t,e)=>{if(!t||t.length===0)return!1;const i=t[0];let s=1,o=0,c=1,l=0;i.forEach(ne=>{s=Math.min(s,ne.x),o=Math.max(o,ne.x),c=Math.min(c,ne.y),l=Math.max(l,ne.y)});const u=.5,h=.6,f=e>1;let _,m;f?(_=.4,m=.3):(_=.35,m=.5);const b=(s+o)/2,E=(c+l)/2,A=.2,k=_*(1+A),F=m*(1+A),D=((ne,Ii)=>{const Ae=(ne-u)/k,he=(Ii-h)/F;return Ae*Ae+he*he<=1})(b,E),R=.2,$=.1,X=_*(1+R),N=m*(1+$),vt=(ne,Ii)=>{const Ae=(ne-u)/X,he=(Ii-h)/N;return Ae*Ae+he*he<=1},J=vt(s,c),pt=vt(o,c),kt=vt(s,l),Zt=vt(o,l);return D&&J&&pt&&kt&&Zt},a6=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;const i=e[13],s=e[14];if(!i||!s)return 0;const o=Math.abs(s.y-i.y),c=Math.min(...e.map(h=>h.y)),u=Math.max(...e.map(h=>h.y))-c;return u>0?o/u:0},c6=t=>{const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return null;const s=t.videoWidth,o=t.videoHeight,c=Math.min(s,o),l=(s-c)/2,u=(o-c)/2;return e.width=c,e.height=c,i.drawImage(t,l,u,c,c,0,0,c,c),e},Zd=(t,e,i,s)=>{const o=t.getContext("2d");if(!o)return;const c=t.width,l=t.height;o.clearRect(0,0,c,l);const u=new xe(o);e.forEach(h=>{if(!h||h.length===0)return;const f="rgba(162, 155, 254,0.4)",_=2;o.strokeStyle="rgba(255, 255, 255, 0.6)",o.lineWidth=_,o.lineCap="round",o.lineJoin="round",u.drawLandmarks(h,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),u.drawConnectors(h,Bt.FACE_LANDMARKS_FACE_OVAL,{color:f,lineWidth:_}),i>0&&i>=s&&u.drawConnectors(h,Bt.FACE_LANDMARKS_LIPS,{color:f,lineWidth:_})})},qd=t=>{const e=t.getContext("2d");e&&e.clearRect(0,0,t.width,t.height)},l6=(t,e=!1)=>{const i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;const o=t.videoHeight>t.videoWidth;e?o?(i.width=480,i.height=Math.max(640,i.width*t.videoHeight/t.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*t.videoHeight/t.videoWidth)):o?(i.width=240,i.height=Math.max(320,i.width*t.videoHeight/t.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*t.videoHeight/t.videoWidth));const c=1,l=t.videoWidth*c,u=t.videoHeight*c,h=(l-t.videoWidth)/2,f=(u-t.videoHeight)/2;return s.drawImage(t,-h,-f-0,l,u,0,0,i.width,i.height),i.toDataURL("image/jpeg")},jd={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},Xd={"multiple-faces":"Ensure only one face is visible","no-face":"Position your face in the oval","out-of-bounds":"Position your face in the oval","too-close":"Move farther away","too-far":"Move closer","neutral-expression":"Neutral expression","smile-required":"Smile!","open-mouth-smile":"Wider smile - teeth visible",initializing:"Initializing..."},u6=()=>{const t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)return!1;const i=e.getExtension("OES_texture_half_float"),s=e.getExtension("OES_texture_half_float_linear"),o=e.getExtension("EXT_color_buffer_half_float");return!!(i&&o&&s)},Kd=()=>q(null,null,function*(){window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const t=window.__smileIdentityMediapipe;return t.loaded&&t.instance?t.instance:(t.loading||(t.loading=q(null,null,function*(){try{const e=yield lr.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=yield Bt.createFromOptions(e,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:u6()?"GPU":"CPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return t.instance=i,t.loaded=!0,t.loading=null,i}catch(e){throw t.loading=null,e}})),t.loading)}),Qs=xs.version,h6=({videoRef:t,canvasRef:e,interval:i,duration:s,smileThreshold:o,mouthOpenThreshold:c,minFaceSize:l,maxFaceSize:u,smileCooldown:h,getFacingMode:f})=>{const _=pe(null),m=pe(null),b=pe(null),E=pe(null),A=Gt(!1),k=Gt(!1),F=Gt("good"),M=Gt(!1),D=Gt(16/9),R=Gt([]),$=Gt(0),X=Gt(0),N=Gt(0),vt=Gt(0),J=Gt(""),pt=Gt(!0),kt=Gt(!1),Zt=Gt(!1),ne=Gt(0),Ii=Gt([]),Ae=Gt(null),he=Gt(1),Se=Gt(0),ur=Gt(!1),ei=Dc(()=>Math.floor(he.value*.4)),ka=Dc(()=>Math.floor(he.value*.2)),rs=Dc(()=>A.value&&k.value&&F.value==="good"&&!M.value),Pe=lt=>{lt&&Xd[lt]?J.value=Xd[lt]:J.value=""},ke=pe(N2.throttle(lt=>{Pe(lt)},300)).current,b1=()=>q(null,null,function*(){var lt,xt;try{((lt=window.__smileIdentityMediapipe)==null?void 0:lt.loaded)&&((xt=window.__smileIdentityMediapipe)==null?void 0:xt.instance)||(pt.value=!0,Pe("initializing")),_.current=yield Kd(),pt.value=!1}catch(me){console.error("Failed to initialize MediaPipe:",me),pt.value=!1}}),y1=()=>{if(t.current&&e.current){const{videoWidth:lt,videoHeight:xt}=t.current;D.value=lt/xt,e.current.width=lt,e.current.height=xt,t.current.parentElement&&(e.current.style.left="50%",e.current.style.top="50%")}},Un=()=>{const lt=Se.value<ka.value,xt=Se.value>=ei.value;lt?J.value="Capturing...":xt?Date.now()-vt.value>h?$.value>=o&&N.value<c?ke("open-mouth-smile"):ke("smile-required"):J.value="Keep smiling!":ke(null)},ss=()=>{pt.value?Pe("initializing"):M.value?ke("multiple-faces"):A.value?F.value==="too-close"?ke("too-close"):F.value==="too-far"?ke("too-far"):k.value?kt.value?Un():J.value="Ready to capture":ke("out-of-bounds"):ke("no-face")},to=()=>{m.current&&(cancelAnimationFrame(m.current),m.current=null)},hn=()=>q(null,null,function*(){var lt,xt;if(!_.current||!t.current){to();return}if(t.current.videoWidth<=0||t.current.videoHeight<=0||t.current.readyState<2){m.current=requestAnimationFrame(hn);return}try{pt.value&&(pt.value=!1);const me=c6(t.current),$n=me||t.current,Le=_.current.detectForVideo($n,performance.now());if(R.value=Le.faceLandmarks||[],Le.faceLandmarks&&e.current&&t.current)if(me){const $e=t.current.videoWidth,Ne=t.current.videoHeight,qi=Math.min($e,Ne),dr=($e-qi)/(2*$e),Hn=(Ne-qi)/(2*Ne),Vn=qi/$e,ji=qi/Ne,io=Le.faceLandmarks.map(no=>no.map(fr=>({x:fr.x*Vn+dr,y:fr.y*ji+Hn,z:fr.z})));Zd(e.current,io,Se.value,ei.value)}else Zd(e.current,Le.faceLandmarks,Se.value,ei.value);else e.current&&qd(e.current);const Nn=Le.faceLandmarks?Le.faceLandmarks.length:0;M.value=Nn>1;const La=Le.faceBlendshapes&&Le.faceBlendshapes.length>0&&Nn===1;if(A.value=La,La&&Le.faceLandmarks){const $e=s6(Le.faceLandmarks);X.value=$e,$e>u?F.value="too-close":$e<l?F.value="too-far":F.value="good",k.value=o6(Le.faceLandmarks,D.value);const Ne=Le.faceBlendshapes[0].categories,qi=((lt=Ne.find(ji=>ji.categoryName==="mouthSmileLeft"))==null?void 0:lt.score)||0,dr=((xt=Ne.find(ji=>ji.categoryName==="mouthSmileRight"))==null?void 0:xt.score)||0,Hn=a6(Le.faceLandmarks),Vn=(qi+dr)/2;$.value=Vn,N.value=Hn,Vn>=o&&Hn>=c&&(vt.value=Date.now(),Zt.value&&kt.value&&E.current&&setTimeout(()=>{Date.now()-vt.value<=100&&Zt.value&&kt.value&&E.current&&E.current()},0))}else $.value=0,X.value=0,N.value=0,k.value=!1,F.value="good";ss()}catch(me){A.value=!1,k.value=!1,M.value=!1,F.value="good",N.value=0,kt.value&&ke("no-face")}m.current=requestAnimationFrame(hn)}),hr=()=>{m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(hn)},C1=()=>{if(!t.current)return;const lt=Se.value===he.value-1,xt=l6(t.current,lt);xt&&(lt?Ae.value=xt:Ii.value=[...Ii.value,xt],Se.value++,ne.value=he.value-Se.value)},dn=()=>{if(b.current&&(clearInterval(b.current),b.current=null),kt.value=!1,Zt.value=!1,Se.value>=he.value&&Ae.value){const lt=Ii.value.map($n=>({image:$n.split(",")[1],image_type_id:jd.LIVENESS_IMAGE_BASE64})),xt={image:Ae.value.split(",")[1],image_type_id:jd.SELFIE_IMAGE_BASE64},me={images:[...lt,xt],referenceImage:Ae.value,previewImage:Ae.value,facingMode:f(),meta:{libraryVersion:Qs}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:me})),ur.value=!0}},Wi=()=>{b.current&&(clearInterval(b.current),b.current=null),Zt.value=!0,!M.value&&A.value&&k.value&&F.value==="good"&&ke("smile-required")},eo=()=>{b.current&&clearInterval(b.current),b.current=setInterval(()=>{if(Se.value>=he.value){dn();return}if(M.value){Wi();return}if(!A.value)return;if(!k.value){Wi();return}if(F.value!=="good"){Wi();return}if(Se.value>=ei.value&&Date.now()-vt.value>h){Wi();return}C1()},i)},Ue=()=>{if(A.value&&F.value==="good"&&k.value&&!M.value){if(Se.value>=ei.value&&Date.now()-vt.value>h)return;Zt.value=!1,ke(null),eo()}};return E.current=Ue,{faceDetected:A,faceInBounds:k,faceProximity:F,multipleFaces:M,videoAspectRatio:D,faceLandmarks:R,currentSmileScore:$,currentFaceSize:X,currentMouthOpen:N,lastSmileTime:vt,alertTitle:J,isInitializing:pt,isReadyToCapture:rs,isCapturing:kt,isPaused:Zt,countdown:ne,capturedImages:Ii,referencePhoto:Ae,totalCaptures:he,capturesTaken:Se,hasFinishedCapture:ur,smileCheckpoint:ei,neutralZone:ka,initializeFaceLandmarker:b1,setupCanvas:y1,startDetectionLoop:hr,stopDetectionLoop:to,updateAlert:ke,startCapture:()=>q(null,null,function*(){Ii.value=[],kt.value=!0,Zt.value=!1,he.value=Math.ceil(s/i),Se.value=0,ne.value=he.value;const lt=document.querySelector("smart-camera-web");lt==null||lt.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),lt==null||lt.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[f()]}})),eo()}),stopCapture:dn,pauseCapture:Wi,resumeCapture:Ue,handleCancel:()=>{dn(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:Qs}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:Qs}}}))},handleClose:()=>{dn(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:Qs}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:Qs}}}))},cleanup:()=>{b.current&&clearInterval(b.current),to(),ke.cancel()},resetFaceDetectionState:()=>{A.value=!1,k.value=!1,F.value="good",M.value=!1,R.value=[],$.value=0,X.value=0,N.value=0,vt.value=0,e.current&&qd(e.current)}}},d6=({progress:t,duration:e=1e3,themeColor:i="#001096"})=>{const s=pe(null),o=pe(t);return Si(()=>{const c=s.current;if(!c)return;const l=c.getTotalLength();c.style.opacity=t>0?"1":"0";const u=l*(1-o.current),h=l*(1-t);u!==h&&(c.style.transition="none",c.style.strokeDasharray=`${l} ${l}`,c.style.strokeDashoffset=`${u}`,c.getBoundingClientRect(),c.style.transition=`stroke-dashoffset ${e}ms ease-out`,c.style.strokeDashoffset=`${h}`,o.current=t)},[t,e]),st("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:st("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[st("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:st("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),st("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),st("path",{ref:s,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},f6=({videoRef:t,canvasRef:e,facingMode:i,multipleFaces:s,progress:o,interval:c,themeColor:l})=>st(xn,{children:[st("div",{className:"camera-preview-container",children:[st("div",{className:"video-wrapper",style:{clipPath:s?"none":"url(#selfie-clip-path)"},children:st("div",{className:"video-container",children:[st("video",{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),st("canvas",{ref:e,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!s&&st(d6,{progress:o,duration:c,themeColor:l})]}),st("style",{children:`
3181
+ `}C(){const e=this.g;e.activeTexture(e.TEXTURE1),this.j=Wt(this,e),e.activeTexture(e.TEXTURE2),this.B=Wt(this,e)}m(){super.m();const e=this.g;this.K=Te(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=Te(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=Te(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const e=this.g;e.uniform1i(this.H,0),e.uniform1i(this.K,1),e.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Tt(e,t){switch(t){case 0:return e.g.find(i=>i instanceof Uint8Array);case 1:return e.g.find(i=>i instanceof Float32Array);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function No(e){var t=Tt(e,1);if(!t){if(t=Tt(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=Hi(e);var i=Ho(e);if(Ar(i,n,i2(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){i=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,i);for(let r=0,s=0;r<t.length;++r,s+=4)t[r]=i[s]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function i2(e){let t=Tt(e,2);if(!t){const i=Hi(e);t=r2(e);const n=No(e),r=n2(e);i.texImage2D(i.TEXTURE_2D,0,r,e.width,e.height,0,i.RED,i.FLOAT,n),Uo(e)}return t}function Hi(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Te(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function n2(e){if(e=Hi(e),!Sr)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Sr=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Sr=e.R16F}return Sr}function Ho(e){return e.l||(e.l=new Ni),e.l}function r2(e){const t=Hi(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=Tt(e,2);return i||(i=Wt(Ho(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(i),e.j=!0),t.bindTexture(t.TEXTURE_2D,i),i}function Uo(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Sr,ye=class{constructor(e,t,i,n,r,s,o){this.g=e,this.m=t,this.j=i,this.canvas=n,this.l=r,this.width=s,this.height=o,this.j&&--s2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Tt(this,0)}ja(){return!!Tt(this,1)}R(){return!!Tt(this,2)}ia(){return(t=Tt(e=this,0))||(t=No(e),t=new Uint8Array(t.map(i=>255*i)),e.g.push(t)),t;var e,t}ha(){return No(this)}N(){return i2(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof Uint8Array)i=new Uint8Array(t);else if(t instanceof Float32Array)i=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=Hi(this),r=Ho(this);n.activeTexture(n.TEXTURE1),i=Wt(r,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,i);const s=n2(this);n.texImage2D(n.TEXTURE_2D,0,s,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),Ar(r,n,i),_n(r,n,!1,()=>{r2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),Uo(this)}),$o(r),Uo(this)}}e.push(i)}return new ye(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Hi(this).deleteTexture(Tt(this,2)),s2=-1}};ye.prototype.close=ye.prototype.close,ye.prototype.clone=ye.prototype.clone,ye.prototype.getAsWebGLTexture=ye.prototype.N,ye.prototype.getAsFloat32Array=ye.prototype.ha,ye.prototype.getAsUint8Array=ye.prototype.ia,ye.prototype.hasWebGLTexture=ye.prototype.R,ye.prototype.hasFloat32Array=ye.prototype.ja,ye.prototype.hasUint8Array=ye.prototype.Da;var s2=250;const L0={color:"white",lineWidth:4,radius:6};function Vo(e){return Fe(qi(Fe({},L0),{fillColor:(e=e||{}).color}),e)}function It(e,t){return e instanceof Function?e(t):e}function o2(e,t,i){return Math.max(Math.min(t,i),Math.min(Math.max(t,i),e))}function Cn(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function En(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function a2(e,t,i){var n;if(t.R())i(t.N());else{const r=t.ja()?t.ha():t.ia();e.m=(n=e.m)!=null?n:new Ni;const s=En(e);i((e=new ye([r],t.m,!1,s.canvas,e.m,t.width,t.height)).N()),e.close()}}function c2(e,t,i,n){const r=function(a){return a.g||(a.g=new S0),a.g}(e),s=En(e),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;_n(r,s,!0,()=>{(function(c,l,d,h){const u=c.g;if(u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l),u.activeTexture(u.TEXTURE1),u.bindTexture(u.TEXTURE_2D,c.B),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,d),c.H&&function(p,f){if(p!==f)return!1;p=p.entries(),f=f.entries();for(const[v,g]of p){p=v;const b=g;var m=f.next();if(m.done)return!1;const[_,E]=m.value;if(m=E,p!==_||b[0]!==m[0]||b[1]!==m[1]||b[2]!==m[2]||b[3]!==m[3])return!1}return!!f.next().done}(c.H,h))u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j);else{c.H=h;const p=Array(1024).fill(0);h.forEach((f,m)=>{if(f.length!==4)throw Error(`Color at index ${m} is not a four-channel value.`);p[4*m]=f[0],p[4*m+1]=f[1],p[4*m+2]=f[2],p[4*m+3]=f[3]}),u.activeTexture(u.TEXTURE2),u.bindTexture(u.TEXTURE_2D,c.j),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,256,1,0,u.RGBA,u.UNSIGNED_BYTE,new Uint8Array(p))}})(r,t,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const a=r.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)})}function l2(e,t,i,n){const r=En(e),s=function(c){return c.h||(c.h=new M0),c.h}(e),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;_n(s,r,!0,()=>{var c=s.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,t),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,s.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,o),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,s.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),r.bindTexture(r.TEXTURE_2D,null),(c=s.g).activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)})}var Ie=class{constructor(e,t){typeof CanvasRenderingContext2D!="undefined"&&e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}wa(e,t){if(e){var i=Cn(this);t=Vo(t),i.save();var n=i.canvas,r=0;for(const s of e)i.fillStyle=It(t.fillColor,{index:r,from:s}),i.strokeStyle=It(t.color,{index:r,from:s}),i.lineWidth=It(t.lineWidth,{index:r,from:s}),(e=new Path2D).arc(s.x*n.width,s.y*n.height,It(t.radius,{index:r,from:s}),0,2*Math.PI),i.fill(e),i.stroke(e),++r;i.restore()}}va(e,t,i){if(e&&t){var n=Cn(this);i=Vo(i),n.save();var r=n.canvas,s=0;for(const o of t){n.beginPath(),t=e[o.start];const a=e[o.end];t&&a&&(n.strokeStyle=It(i.color,{index:s,from:t,to:a}),n.lineWidth=It(i.lineWidth,{index:s,from:t,to:a}),n.moveTo(t.x*r.width,t.y*r.height),n.lineTo(a.x*r.width,a.y*r.height)),++s,n.stroke()}n.restore()}}sa(e,t){const i=Cn(this);t=Vo(t),i.save(),i.beginPath(),i.lineWidth=It(t.lineWidth,{}),i.strokeStyle=It(t.color,{}),i.fillStyle=It(t.fillColor,{}),i.moveTo(e.originX,e.originY),i.lineTo(e.originX+e.width,e.originY),i.lineTo(e.originX+e.width,e.originY+e.height),i.lineTo(e.originX,e.originY+e.height),i.lineTo(e.originX,e.originY),i.stroke(),i.fill(),i.restore()}ta(e,t,i=[0,0,0,255]){this.l?function(n,r,s,o){const a=En(n);a2(n,r,c=>{c2(n,c,s,o),(c=Cn(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,i,t):c2(this,e.N(),i,t)}ua(e,t,i){this.l?function(n,r,s,o){const a=En(n);a2(n,r,c=>{l2(n,c,s,o),(c=Cn(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,e,t,i):l2(this,e.N(),t,i)}close(){var e,t,i;(e=this.g)==null||e.close(),this.g=void 0,(t=this.h)==null||t.close(),this.h=void 0,(i=this.m)==null||i.close(),this.m=void 0}};function mt(e,t){switch(t){case 0:return e.g.find(i=>i instanceof ImageData);case 1:return e.g.find(i=>typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap);case 2:return e.g.find(i=>typeof WebGLTexture!="undefined"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function h2(e){var t=mt(e,0);if(!t){t=Ui(e);const i=Lr(e),n=new Uint8Array(e.width*e.height*4);Ar(i,t,Mr(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,n),$o(i),t=new ImageData(new Uint8ClampedArray(n.buffer),e.width,e.height),e.g.push(t)}return t}function Mr(e){let t=mt(e,2);if(!t){const i=Ui(e);t=Tr(e);const n=mt(e,1)||h2(e);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),xn(e)}return t}function Ui(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Te(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Lr(e){return e.l||(e.l=new Ni),e.l}function Tr(e){const t=Ui(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let i=mt(e,2);return i||(i=Wt(Lr(e),t),e.g.push(i),e.m=!0),t.bindTexture(t.TEXTURE_2D,i),i}function xn(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function d2(e){const t=Ui(e);return _n(Lr(e),t,!0,()=>function(i,n){const r=i.canvas;if(r.width===i.width&&r.height===i.height)return n();const s=r.width,o=r.height;return r.width=i.width,r.height=i.height,i=n(),r.width=s,r.height=o,i}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}Ie.prototype.close=Ie.prototype.close,Ie.prototype.drawConfidenceMask=Ie.prototype.ua,Ie.prototype.drawCategoryMask=Ie.prototype.ta,Ie.prototype.drawBoundingBox=Ie.prototype.sa,Ie.prototype.drawConnectors=Ie.prototype.va,Ie.prototype.drawLandmarks=Ie.prototype.wa,Ie.lerp=function(e,t,i,n,r){return o2(n*(1-(e-t)/(i-t))+r*(1-(i-e)/(i-t)),n,r)},Ie.clamp=o2;var _e=class{constructor(e,t,i,n,r,s,o){this.g=e,this.j=t,this.m=i,this.canvas=n,this.l=r,this.width=s,this.height=o,(this.j||this.m)&&--u2===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!mt(this,0)}ka(){return!!mt(this,1)}R(){return!!mt(this,2)}Aa(){return h2(this)}za(){var e=mt(this,1);return e||(Mr(this),Tr(this),e=d2(this),xn(this),this.g.push(e),this.j=!0),e}N(){return Mr(this)}clone(){const e=[];for(const t of this.g){let i;if(t instanceof ImageData)i=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const n=Ui(this),r=Lr(this);n.activeTexture(n.TEXTURE1),i=Wt(r,n),n.bindTexture(n.TEXTURE_2D,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),Ar(r,n,i),_n(r,n,!1,()=>{Tr(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),xn(this)}),$o(r),xn(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);Mr(this),Tr(this),i=d2(this),xn(this)}e.push(i)}return new _e(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&mt(this,1).close(),this.m&&Ui(this).deleteTexture(mt(this,2)),u2=-1}};_e.prototype.close=_e.prototype.close,_e.prototype.clone=_e.prototype.clone,_e.prototype.getAsWebGLTexture=_e.prototype.N,_e.prototype.getAsImageBitmap=_e.prototype.za,_e.prototype.getAsImageData=_e.prototype.Aa,_e.prototype.hasWebGLTexture=_e.prototype.R,_e.prototype.hasImageBitmap=_e.prototype.ka,_e.prototype.hasImageData=_e.prototype.Ca;var u2=250;function ht(...e){return e.map(([t,i])=>({start:t,end:i}))}const T0=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((p2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Wl()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}initializeGraph(e){return M(this,null,function*(){const t=yield(yield fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)})}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const i=e.length,n=this.i._malloc(i);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(i,n):this.i._changeTextGraph(i,n),this.i._free(n)}configureAudio(e,t,i,n,r){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),A(this,n||"input_audio",s=>{A(this,r=r||"audio_header",o=>{this.i._configureAudio(s,o,e,t!=null?t:0,i)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){ft(this,"__graph_config__",t=>{e(t)}),A(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,i){this.addAudioToStreamWithShape(e,0,0,t,i)}addAudioToStreamWithShape(e,t,i,n,r){const s=4*e.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(e,this.g/4),A(this,n,o=>{this.i._addAudioToInputStream(this.g,t,i,o,r)})}addGpuBufferToStream(e,t,i){A(this,t,n=>{const[r,s]=Kl(this,e,n);this.i._addBoundTextureToStream(n,r,s,i)})}addBoolToStream(e,t,i){A(this,t,n=>{this.i._addBoolToInputStream(e,n,i)})}addDoubleToStream(e,t,i){A(this,t,n=>{this.i._addDoubleToInputStream(e,n,i)})}addFloatToStream(e,t,i){A(this,t,n=>{this.i._addFloatToInputStream(e,n,i)})}addIntToStream(e,t,i){A(this,t,n=>{this.i._addIntToInputStream(e,n,i)})}addUintToStream(e,t,i){A(this,t,n=>{this.i._addUintToInputStream(e,n,i)})}addStringToStream(e,t,i){A(this,t,n=>{A(this,e,r=>{this.i._addStringToInputStream(r,n,i)})})}addStringRecordToStream(e,t,i){A(this,t,n=>{Jl(this,Object.keys(e),r=>{Jl(this,Object.values(e),s=>{this.i._addFlatHashMapToInputStream(r,s,Object.keys(e).length,n,i)})})})}addProtoToStream(e,t,i,n){A(this,i,r=>{A(this,t,s=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,s,r,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){A(this,e,i=>{this.i._addEmptyPacketToInputStream(i,t)})}addBoolVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(r,s);this.i._addBoolVectorToInputStream(r,n,i)})}addDoubleVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(r,s);this.i._addDoubleVectorToInputStream(r,n,i)})}addFloatVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(r,s);this.i._addFloatVectorToInputStream(r,n,i)})}addIntVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(r,s);this.i._addIntVectorToInputStream(r,n,i)})}addUintVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(r,s);this.i._addUintVectorToInputStream(r,n,i)})}addStringVectorToStream(e,t,i){A(this,t,n=>{const r=this.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const s of e)A(this,s,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputStream(r,n,i)})}addBoolToInputSidePacket(e,t){A(this,t,i=>{this.i._addBoolToInputSidePacket(e,i)})}addDoubleToInputSidePacket(e,t){A(this,t,i=>{this.i._addDoubleToInputSidePacket(e,i)})}addFloatToInputSidePacket(e,t){A(this,t,i=>{this.i._addFloatToInputSidePacket(e,i)})}addIntToInputSidePacket(e,t){A(this,t,i=>{this.i._addIntToInputSidePacket(e,i)})}addUintToInputSidePacket(e,t){A(this,t,i=>{this.i._addUintToInputSidePacket(e,i)})}addStringToInputSidePacket(e,t){A(this,t,i=>{A(this,e,n=>{this.i._addStringToInputSidePacket(n,i)})})}addProtoToInputSidePacket(e,t,i){A(this,i,n=>{A(this,t,r=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputSidePacket(s,e.length,r,n),this.i._free(s)})})}addBoolVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const r of e)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputSidePacket(n,i)})}addDoubleVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const r of e)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputSidePacket(n,i)})}addFloatVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const r of e)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputSidePacket(n,i)})}addIntVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const r of e)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputSidePacket(n,i)})}addUintVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of e)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputSidePacket(n,i)})}addStringVectorToInputSidePacket(e,t){A(this,t,i=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const r of e)A(this,r,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputSidePacket(n,i)})}attachBoolListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(e,t){ft(this,e,t),A(this,e,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(e,t){qt(this,e,t),A(this,e,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(e,t,i){ft(this,e,t),A(this,e,n=>{this.i._attachProtoListener(n,i||!1)})}attachProtoVectorListener(e,t,i){qt(this,e,t),A(this,e,n=>{this.i._attachProtoVectorListener(n,i||!1)})}attachAudioListener(e,t,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ft(this,e,(n,r)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,r)}),A(this,e,n=>{this.i._attachAudioListener(n,i||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends p2{get ea(){return this.i}oa(e,t,i){A(this,t,n=>{const[r,s]=Kl(this,e,n);this.ea._addBoundTextureAsImageToStream(n,r,s,i)})}V(e,t){ft(this,e,t),A(this,e,i=>{this.ea._attachImageListener(i)})}ba(e,t){qt(this,e,t),A(this,e,i=>{this.ea._attachImageVectorListener(i)})}}));var p2,Je=class extends T0{};function R(e,t,i){return M(this,null,function*(){var n;return function(r,s,o,a){return M(this,null,function*(){return k0(r,s,o,a)})}(e,(n=i.canvas)!=null?n:Wl()?void 0:document.createElement("canvas"),t,i)})}function f2(e,t,i,n){if(e.U){const s=new gl;if(i!=null&&i.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var r=i.regionOfInterest;if(r.left>=r.right||r.top>=r.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(r.left<0||r.top<0||r.right>1||r.bottom>1)throw Error("Expected RectF values to be in [0,1].");x(s,1,(r.left+r.right)/2),x(s,2,(r.top+r.bottom)/2),x(s,4,r.right-r.left),x(s,3,r.bottom-r.top)}else x(s,1,.5),x(s,2,.5),x(s,4,1),x(s,3,1);if(i!=null&&i.rotationDegrees){if((i==null?void 0:i.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(x(s,5,-Math.PI*i.rotationDegrees/180),(i==null?void 0:i.rotationDegrees)%180!=0){const[o,a]=Yl(t);i=he(s,3)*a/o,r=he(s,4)*o/a,x(s,4,i),x(s,3,r)}}e.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.oa(t,e.Z,n!=null?n:performance.now()),e.finishProcessing()}function Qe(e,t,i){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");f2(e,t,i,e.B+1)}function gt(e,t,i,n){var r;if(!((r=e.baseOptions)!=null&&r.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");f2(e,t,i,n)}function Vi(e,t,i,n){var r=t.data;const s=t.width,o=s*(t=t.height);if((r instanceof Uint8Array||r instanceof Float32Array)&&r.length!==o)throw Error("Unsupported channel count: "+r.length/o);return e=new ye([r],i,!1,e.g.i.canvas,e.P,s,t),n?e.clone():e}var Re=class extends Oo{constructor(e,t,i,n){super(e),this.g=e,this.Z=t,this.U=i,this.na=n,this.P=new Ni}l(e,t=!0){if("runningMode"in e&&fn(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Re.prototype.close=Re.prototype.close;var et=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},S(e=this.h=new _r,0,1,t=new ee),x(this.h,2,.5),x(this.h,3,.3)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i;return"minDetectionConfidence"in e&&x(this.h,2,(t=e.minDetectionConfidence)!=null?t:.5),"minSuppressionThreshold"in e&&x(this.h,3,(i=e.minSuppressionThreshold)!=null?i:.3),this.l(e)}D(e,t){return this.j={detections:[]},Qe(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect_in"),H(e,"detections");const t=new He;at(t,d0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect_in"),$(i,"DETECTIONS:detections"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=pl(s),this.j.detections.push(Gl(n));y(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};et.prototype.detectForVideo=et.prototype.F,et.prototype.detect=et.prototype.D,et.prototype.setOptions=et.prototype.o,et.createFromModelPath=function(e,t){return M(this,null,function*(){return R(et,e,{baseOptions:{modelAssetPath:t}})})},et.createFromModelBuffer=function(e,t){return R(et,e,{baseOptions:{modelAssetBuffer:t}})},et.createFromOptions=function(e,t){return R(et,e,t)};var jo=ht([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Go=ht([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),zo=ht([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),m2=ht([474,475],[475,476],[476,477],[477,474]),Zo=ht([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),qo=ht([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),g2=ht([469,470],[470,471],[471,472],[472,469]),Wo=ht([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),v2=[...jo,...Go,...zo,...Zo,...qo,...Wo],b2=ht([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function w2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var K=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,S(e=this.h=new xl,0,1,t=new ee),this.v=new El,S(this.h,0,3,this.v),this.s=new _r,S(this.h,0,2,this.s),pt(this.s,4,1),x(this.s,2,.5),x(this.v,2,.5),x(this.h,4,.5)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i,n,r;return"numFaces"in e&&pt(this.s,4,(t=e.numFaces)!=null?t:1),"minFaceDetectionConfidence"in e&&x(this.s,2,(i=e.minFaceDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&x(this.h,4,(n=e.minTrackingConfidence)!=null?n:.5),"minFacePresenceConfidence"in e&&x(this.v,2,(r=e.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return w2(this),Qe(this,e,t),this.j}F(e,t,i){return w2(this),gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"face_landmarks");const t=new He;at(t,p0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"NORM_LANDMARKS:face_landmarks"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("face_landmarks",(n,r)=>{for(const s of n)n=bn(s),this.j.faceLandmarks.push(Cr(n));y(this,r)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{y(this,n)}),this.outputFaceBlendshapes&&(H(e,"blendshapes"),$(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,r)=>{var s;if(this.outputFaceBlendshapes)for(const o of n)n=br(o),this.j.faceBlendshapes.push(Do((s=n.g())!=null?s:[]));y(this,r)}),this.g.attachEmptyPacketListener("blendshapes",n=>{y(this,n)})),this.outputFacialTransformationMatrixes&&(H(e,"face_geometry"),$(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,r)=>{var s,o,a,c,l;if(this.outputFacialTransformationMatrixes)for(const d of n)(n=N(u0(d),n0,2))&&this.j.facialTransformationMatrixes.push({rows:(o=(s=Ye(n,1))!=null?s:0)!=null?o:0,columns:(c=(a=Ye(n,2))!=null?a:0)!=null?c:0,data:(l=ri(n,3,Ht,ni()).slice())!=null?l:[]});y(this,r)}),this.g.attachEmptyPacketListener("face_geometry",n=>{y(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};K.prototype.detectForVideo=K.prototype.F,K.prototype.detect=K.prototype.D,K.prototype.setOptions=K.prototype.o,K.createFromModelPath=function(e,t){return R(K,e,{baseOptions:{modelAssetPath:t}})},K.createFromModelBuffer=function(e,t){return R(K,e,{baseOptions:{modelAssetBuffer:t}})},K.createFromOptions=function(e,t){return R(K,e,t)},K.FACE_LANDMARKS_LIPS=jo,K.FACE_LANDMARKS_LEFT_EYE=Go,K.FACE_LANDMARKS_LEFT_EYEBROW=zo,K.FACE_LANDMARKS_LEFT_IRIS=m2,K.FACE_LANDMARKS_RIGHT_EYE=Zo,K.FACE_LANDMARKS_RIGHT_EYEBROW=qo,K.FACE_LANDMARKS_RIGHT_IRIS=g2,K.FACE_LANDMARKS_FACE_OVAL=Wo,K.FACE_LANDMARKS_CONTOURS=v2,K.FACE_LANDMARKS_TESSELATION=b2;var vt=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!0),S(e=this.j=new Al,0,1,t=new ee)}get baseOptions(){return N(this.j,ee,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,i){const n=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:i,Qe(this,e,n!=null?n:{}),!this.h)return this.s}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"stylized_image");const t=new He;at(t,f0,this.j);const i=new Le;Ue(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"STYLIZED_IMAGE:stylized_image"),i.o(t),Ve(e,i),this.g.V("stylized_image",(n,r)=>{var s=!this.h,o=n.data,a=n.width;const c=a*(n=n.height);if(o instanceof Uint8Array)if(o.length===3*c){const l=new Uint8ClampedArray(4*c);for(let d=0;d<c;++d)l[4*d]=o[3*d],l[4*d+1]=o[3*d+1],l[4*d+2]=o[3*d+2],l[4*d+3]=255;o=new ImageData(l,a,n)}else{if(o.length!==4*c)throw Error("Unsupported channel count: "+o.length/c);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),a,n)}else if(!(o instanceof WebGLTexture))throw Error(`Unsupported format: ${o.constructor.name}`);a=new _e([o],!1,!1,this.g.i.canvas,this.P,a,n),this.s=s=s?a.clone():a,this.h&&this.h(s),y(this,r)}),this.g.attachEmptyPacketListener("stylized_image",n=>{this.s=null,this.h&&this.h(null),y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};vt.prototype.stylize=vt.prototype.Ka,vt.prototype.setOptions=vt.prototype.o,vt.createFromModelPath=function(e,t){return R(vt,e,{baseOptions:{modelAssetPath:t}})},vt.createFromModelBuffer=function(e,t){return R(vt,e,{baseOptions:{modelAssetBuffer:t}})},vt.createFromOptions=function(e,t){return R(vt,e,t)};var Xo=ht([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function y2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function _2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function C2(e,t=!0){var r,s,o,a,c,l;const i=[];for(const d of e){var n=br(d);e=[];for(const h of n.g())n=t&&Ye(h,1)!=null?(r=Ye(h,1))!=null?r:0:-1,e.push({score:(s=he(h,2))!=null?s:0,index:n,categoryName:(a=(o=Ke(h,3))!=null?o:"")!=null?a:"",displayName:(l=(c=Ke(h,4))!=null?c:"")!=null?l:""});i.push(e)}return i}var je=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.j=new Ll,0,1,t=new ee),this.s=new Mo,S(this.j,0,2,this.s),this.C=new So,S(this.s,0,3,this.C),this.v=new Ml,S(this.s,0,2,this.v),this.h=new m0,S(this.j,0,3,this.h),x(this.v,2,.5),x(this.s,4,.5),x(this.C,2,.5)}get baseOptions(){return N(this.j,ee,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){var r,s,o,a,c,l,d,h;if(pt(this.v,3,(r=e.numHands)!=null?r:1),"minHandDetectionConfidence"in e&&x(this.v,2,(s=e.minHandDetectionConfidence)!=null?s:.5),"minTrackingConfidence"in e&&x(this.s,4,(o=e.minTrackingConfidence)!=null?o:.5),"minHandPresenceConfidence"in e&&x(this.C,2,(a=e.minHandPresenceConfidence)!=null?a:.5),e.cannedGesturesClassifierOptions){var t=new Pi,i=t,n=Bo(e.cannedGesturesClassifierOptions,(c=N(this.h,Pi,3))==null?void 0:c.h());S(i,0,2,n),S(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=N(this.h,Pi,3))==null||l.g());return e.customGesturesClassifierOptions?(S(i=t=new Pi,0,2,n=Bo(e.customGesturesClassifierOptions,(d=N(this.h,Pi,4))==null?void 0:d.h())),S(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((h=N(this.h,Pi,4))==null||h.g()),this.l(e)}Fa(e,t){return y2(this),Qe(this,e,t),_2(this)}Ga(e,t,i){return y2(this),gt(this,e,i,t),_2(this)}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"hand_gestures"),H(e,"hand_landmarks"),H(e,"world_hand_landmarks"),H(e,"handedness");const t=new He;at(t,g0,this.j);const i=new Le;Ue(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"HAND_GESTURES:hand_gestures"),$(i,"LANDMARKS:hand_landmarks"),$(i,"WORLD_LANDMARKS:world_hand_landmarks"),$(i,"HANDEDNESS:handedness"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{var s,o,a,c;for(const l of n){n=bn(l);const d=[];for(const h of At(n,ml,1))d.push({x:(s=he(h,1))!=null?s:0,y:(o=he(h,2))!=null?o:0,z:(a=he(h,3))!=null?a:0,visibility:(c=he(h,4))!=null?c:0});this.landmarks.push(d)}y(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{var s,o,a,c;for(const l of n){n=Oi(l);const d=[];for(const h of At(n,fl,1))d.push({x:(s=he(h,1))!=null?s:0,y:(o=he(h,2))!=null?o:0,z:(a=he(h,3))!=null?a:0,visibility:(c=he(h,4))!=null?c:0});this.worldLandmarks.push(d)}y(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,r)=>{this.gestures.push(...C2(n,!1)),y(this,r)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{y(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{this.handedness.push(...C2(n)),y(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function E2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}je.prototype.recognizeForVideo=je.prototype.Ga,je.prototype.recognize=je.prototype.Fa,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return R(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return R(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return R(je,e,t)},je.HAND_CONNECTIONS=Xo;var Ge=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.h=new Mo,0,1,t=new ee),this.s=new So,S(this.h,0,3,this.s),this.j=new Ml,S(this.h,0,2,this.j),pt(this.j,3,1),x(this.j,2,.5),x(this.s,2,.5),x(this.h,4,.5)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i,n,r;return"numHands"in e&&pt(this.j,3,(t=e.numHands)!=null?t:1),"minHandDetectionConfidence"in e&&x(this.j,2,(i=e.minHandDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&x(this.h,4,(n=e.minTrackingConfidence)!=null?n:.5),"minHandPresenceConfidence"in e&&x(this.s,2,(r=e.minHandPresenceConfidence)!=null?r:.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Qe(this,e,t),E2(this)}F(e,t,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],gt(this,e,i,t),E2(this)}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"hand_landmarks"),H(e,"world_hand_landmarks"),H(e,"handedness");const t=new He;at(t,v0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"LANDMARKS:hand_landmarks"),$(i,"WORLD_LANDMARKS:world_hand_landmarks"),$(i,"HANDEDNESS:handedness"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n)n=bn(s),this.landmarks.push(Cr(n));y(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n)n=Oi(s),this.worldLandmarks.push(wn(n));y(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{y(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{var c,l,d,h,u,p,f;var s=this.handedness,o=s.push;const a=[];for(const m of n){n=br(m);const v=[];for(const g of n.g())v.push({score:(c=he(g,2))!=null?c:0,index:(d=(l=Ye(g,1))!=null?l:0)!=null?d:-1,categoryName:(u=(h=Ke(g,3))!=null?h:"")!=null?u:"",displayName:(f=(p=Ke(g,4))!=null?p:"")!=null?f:""});a.push(v)}o.call(s,...a),y(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ge.prototype.detectForVideo=Ge.prototype.F,Ge.prototype.detect=Ge.prototype.D,Ge.prototype.setOptions=Ge.prototype.o,Ge.createFromModelPath=function(e,t){return R(Ge,e,{baseOptions:{modelAssetPath:t}})},Ge.createFromModelBuffer=function(e,t){return R(Ge,e,{baseOptions:{modelAssetBuffer:t}})},Ge.createFromOptions=function(e,t){return R(Ge,e,t)},Ge.HAND_CONNECTIONS=Xo;var x2=ht([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function k2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function A2(e){try{if(!e.C)return e.h;e.C(e.h)}finally{kr(e)}}function Ir(e,t){e=bn(e),t.push(Cr(e))}var te=class extends Re{constructor(e,t){super(new Je(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,S(e=this.j=new Rl,0,1,t=new ee),this.K=new So,S(this.j,0,2,this.K),this.Y=new b0,S(this.j,0,3,this.Y),this.s=new _r,S(this.j,0,4,this.s),this.H=new El,S(this.j,0,5,this.H),this.v=new Bl,S(this.j,0,6,this.v),this.L=new Dl,S(this.j,0,7,this.L),x(this.s,2,.5),x(this.s,3,.3),x(this.H,2,.5),x(this.v,2,.5),x(this.v,3,.3),x(this.L,2,.5),x(this.K,2,.5)}get baseOptions(){return N(this.j,ee,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){var t,i,n,r,s,o,a;return"minFaceDetectionConfidence"in e&&x(this.s,2,(t=e.minFaceDetectionConfidence)!=null?t:.5),"minFaceSuppressionThreshold"in e&&x(this.s,3,(i=e.minFaceSuppressionThreshold)!=null?i:.3),"minFacePresenceConfidence"in e&&x(this.H,2,(n=e.minFacePresenceConfidence)!=null?n:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&x(this.v,2,(r=e.minPoseDetectionConfidence)!=null?r:.5),"minPoseSuppressionThreshold"in e&&x(this.v,3,(s=e.minPoseSuppressionThreshold)!=null?s:.3),"minPosePresenceConfidence"in e&&x(this.L,2,(o=e.minPosePresenceConfidence)!=null?o:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&x(this.K,2,(a=e.minHandLandmarksConfidence)!=null?a:.5),this.l(e)}D(e,t,i){const n=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:i,k2(this),Qe(this,e,n),A2(this)}F(e,t,i,n){const r=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:n,k2(this),gt(this,e,r,t),A2(this)}m(){var e=new De;Y(e,"input_frames_image"),H(e,"pose_landmarks"),H(e,"pose_world_landmarks"),H(e,"face_landmarks"),H(e,"left_hand_landmarks"),H(e,"left_hand_world_landmarks"),H(e,"right_hand_landmarks"),H(e,"right_hand_world_landmarks");const t=new He,i=new Kc;Ws(i,1,xi("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(r,s){if(s!=null)if(Array.isArray(s))W(r,2,Kn(s,Gs,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof Et||ei(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Ws(r,2,Is(s,!1),ti())}}(i,this.j.g());const n=new Le;Ue(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),ir(n,8,Kc,i),X(n,"IMAGE:input_frames_image"),$(n,"POSE_LANDMARKS:pose_landmarks"),$(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),$(n,"FACE_LANDMARKS:face_landmarks"),$(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),$(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),$(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),$(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ve(e,n),xr(this,e),this.g.attachProtoListener("pose_landmarks",(r,s)=>{Ir(r,this.h.poseLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("pose_world_landmarks",(r,s)=>{var o=this.h.poseWorldLandmarks;r=Oi(r),o.push(wn(r)),y(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",r=>{y(this,r)}),this.outputPoseSegmentationMasks&&($(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),$i(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(r,s)=>{this.h.poseSegmentationMasks=[Vi(this,r,!0,!this.C)],y(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",r=>{this.h.poseSegmentationMasks=[],y(this,r)})),this.g.attachProtoListener("face_landmarks",(r,s)=>{Ir(r,this.h.faceLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{y(this,r)}),this.outputFaceBlendshapes&&(H(e,"extra_blendshapes"),$(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(r,s)=>{var a;var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(r=br(r),o.push(Do((a=r.g())!=null?a:[]))),y(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",r=>{y(this,r)})),this.g.attachProtoListener("left_hand_landmarks",(r,s)=>{Ir(r,this.h.leftHandLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("left_hand_world_landmarks",(r,s)=>{var o=this.h.leftHandWorldLandmarks;r=Oi(r),o.push(wn(r)),y(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("right_hand_landmarks",(r,s)=>{Ir(r,this.h.rightHandLandmarks),y(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",r=>{y(this,r)}),this.g.attachProtoListener("right_hand_world_landmarks",(r,s)=>{var o=this.h.rightHandWorldLandmarks;r=Oi(r),o.push(wn(r)),y(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",r=>{y(this,r)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};te.prototype.detectForVideo=te.prototype.F,te.prototype.detect=te.prototype.D,te.prototype.setOptions=te.prototype.o,te.createFromModelPath=function(e,t){return R(te,e,{baseOptions:{modelAssetPath:t}})},te.createFromModelBuffer=function(e,t){return R(te,e,{baseOptions:{modelAssetBuffer:t}})},te.createFromOptions=function(e,t){return R(te,e,t)},te.HAND_CONNECTIONS=Xo,te.POSE_CONNECTIONS=x2,te.FACE_LANDMARKS_LIPS=jo,te.FACE_LANDMARKS_LEFT_EYE=Go,te.FACE_LANDMARKS_LEFT_EYEBROW=zo,te.FACE_LANDMARKS_LEFT_IRIS=m2,te.FACE_LANDMARKS_RIGHT_EYE=Zo,te.FACE_LANDMARKS_RIGHT_EYEBROW=qo,te.FACE_LANDMARKS_RIGHT_IRIS=g2,te.FACE_LANDMARKS_FACE_OVAL=Wo,te.FACE_LANDMARKS_CONTOURS=v2,te.FACE_LANDMARKS_TESSELATION=b2;var tt=class extends Re{constructor(e,t){super(new Je(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},S(e=this.h=new Ol,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return S(this.h,0,2,Bo(e,N(this.h,xo,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},Qe(this,e,t),this.j}ra(e,t,i){return this.j={classifications:[]},gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"input_image"),Y(e,"norm_rect"),H(e,"classifications");const t=new He;at(t,w0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),X(i,"IMAGE:input_image"),X(i,"NORM_RECT:norm_rect"),$(i,"CLASSIFICATIONS:classifications"),i.o(t),Ve(e,i),this.g.attachProtoListener("classifications",(n,r)=>{this.j=function(s){var a;const o={classifications:At(s,s0,1).map(c=>{var l,d,h,u;return Do((d=(l=N(c,dl,4))==null?void 0:l.g())!=null?d:[],(h=Ye(c,2))!=null?h:0,(u=Ke(c,3))!=null?u:"")})};return Ns(Ai(s,2))!=null&&(o.timestampMs=(a=Ns(Ai(s,2)))!=null?a:0),o}(o0(n)),y(this,r)}),this.g.attachEmptyPacketListener("classifications",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};tt.prototype.classifyForVideo=tt.prototype.ra,tt.prototype.classify=tt.prototype.qa,tt.prototype.setOptions=tt.prototype.o,tt.createFromModelPath=function(e,t){return R(tt,e,{baseOptions:{modelAssetPath:t}})},tt.createFromModelBuffer=function(e,t){return R(tt,e,{baseOptions:{modelAssetBuffer:t}})},tt.createFromOptions=function(e,t){return R(tt,e,t)};var ze=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!0),this.h=new Pl,this.embeddings={embeddings:[]},S(e=this.h,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t=this.h,i=N(this.h,yl,2);return i=i?i.clone():new yl,e.l2Normalize!==void 0?fn(i,1,e.l2Normalize):"l2Normalize"in e&&W(i,1),e.quantize!==void 0?fn(i,2,e.quantize):"quantize"in e&&W(i,2),S(t,0,2,i),this.l(e)}xa(e,t){return Qe(this,e,t),this.embeddings}ya(e,t,i){return gt(this,e,i,t),this.embeddings}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"embeddings_out");const t=new He;at(t,y0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"EMBEDDINGS:embeddings_out"),i.o(t),Ve(e,i),this.g.attachProtoListener("embeddings_out",(n,r)=>{n=l0(n),this.embeddings=function(s){var o;return{embeddings:At(s,c0,1).map(a=>{var l,d,h,u,p,f,m;const c={headIndex:(d=(l=Ye(a,3))!=null?l:0)!=null?d:-1,headName:(u=(h=Ke(a,4))!=null?h:"")!=null?u:""};if(yc(a,vl,Xs(a,1))!==void 0)a=ri(a=N(a,vl,Xs(a,1)),1,Ht,ni()),c.floatEmbedding=a.slice();else{const v=new Uint8Array(0);c.quantizedEmbedding=(m=(f=(p=N(a,a0,Xs(a,2)))==null?void 0:p.ma())==null?void 0:f.h())!=null?m:v}return c}),timestampMs:(o=Ns(Ai(s,2)))!=null?o:0}}(n),y(this,r)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ze.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Zl(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Zl(zl(e.quantizedEmbedding),zl(t.quantizedEmbedding))}return e},ze.prototype.embedForVideo=ze.prototype.ya,ze.prototype.embed=ze.prototype.xa,ze.prototype.setOptions=ze.prototype.o,ze.createFromModelPath=function(e,t){return R(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return R(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return R(ze,e,t)};var Yo=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};function S2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function M2(e){try{const t=new Yo(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{kr(e)}}Yo.prototype.close=Yo.prototype.close;var Oe=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fo,this.v=new $l,S(this.h,0,3,this.v),S(e=this.h,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i;return e.displayNamesLocale!==void 0?W(this.h,2,xi(e.displayNamesLocale)):"displayNamesLocale"in e&&W(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}J(){(function(e){var i,n,r;const t=At(e.ca(),Le,1).filter(s=>{var o;return((o=Ke(s,1))!=null?o:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&((r=(n=(i=N(t[0],He,7))==null?void 0:i.l())==null?void 0:n.g())!=null?r:new Map).forEach((s,o)=>{var a;e.s[Number(o)]=(a=Ke(s,1))!=null?a:""})})(this)}segment(e,t,i){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:i,S2(this),Qe(this,e,n),M2(this)}Ia(e,t,i,n){const r=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:n,S2(this),gt(this,e,r,t),M2(this)}Ba(){return this.s}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect");const t=new He;at(t,Ul,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),i.o(t),Ve(e,i),xr(this,e),this.outputConfidenceMasks&&(H(e,"confidence_masks"),$(i,"CONFIDENCE_MASKS:confidence_masks"),$i(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Vi(this,s,!0,!this.j)),y(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],y(this,n)})),this.outputCategoryMask&&(H(e,"category_mask"),$(i,"CATEGORY_MASK:category_mask"),$i(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Vi(this,n,!1,!this.j),y(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,y(this,n)})),H(e,"quality_scores"),$(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,y(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Oe.prototype.getLabels=Oe.prototype.Ba,Oe.prototype.segmentForVideo=Oe.prototype.Ia,Oe.prototype.segment=Oe.prototype.segment,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return R(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return R(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return R(Oe,e,t)};var Ko=class{constructor(e,t,i){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=i}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(i=>{i.close()}),(t=this.categoryMask)==null||t.close()}};Ko.prototype.close=Ko.prototype.close;var I0=class extends C{constructor(e){super(e)}},ji=[0,ae,-2],Fr=[0,Lt,-3,Q,Lt,-1],L2=[0,Fr],T2=[0,Fr,ae,-1],Jo=class extends C{constructor(e){super(e)}},I2=[0,Lt,-1,Q],F0=class extends C{constructor(e){super(e)}},F2=class extends C{constructor(e){super(e)}},Qo=[1,2,3,4,5,6,7,8,9,10,14,15],B2=class extends C{constructor(e){super(e)}};B2.prototype.g=vr([0,we,[0,Qo,G,Fr,G,[0,Fr,ji],G,L2,G,[0,L2,ji],G,I2,G,[0,Lt,-3,Q,Ne],G,[0,Lt,-3,Q],G,[0,j,Lt,-2,Q,ae,Q,-1,2,Lt,ji],G,T2,G,[0,T2,ji],Lt,ji,j,G,[0,Lt,-3,Q,ji,-1],G,[0,we,I2]],j,[0,j,ae,-1,Q]]);var bt=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Fo,this.s=new $l,S(this.h,0,3,this.s),S(e=this.h,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i;return"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(i=e.outputConfidenceMasks)!=null?i:!0),super.l(e)}segment(e,t,i,n){const r=typeof i!="function"?i:{};this.j=typeof i=="function"?i:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.B+1,n=new B2;const s=new F2;var o=new I0;if(pt(o,1,255),S(s,0,12,o),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var a=new Jo;fn(a,3,!0),x(a,1,t.keypoint.x),x(a,2,t.keypoint.y),pn(s,5,Qo,a)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new F0,t.scribble))fn(t=new Jo,3,!0),x(t,1,a.x),x(t,2,a.y),ir(o,1,Jo,t);pn(s,15,Qo,o)}ir(n,1,F2,s),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",i),Qe(this,e,r);e:{try{const l=new Ko(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break e}this.j(l)}finally{kr(this)}c=void 0}return c}m(){var e=new De;Y(e,"image_in"),Y(e,"roi_in"),Y(e,"norm_rect_in");const t=new He;at(t,Ul,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),X(i,"IMAGE:image_in"),X(i,"ROI:roi_in"),X(i,"NORM_RECT:norm_rect_in"),i.o(t),Ve(e,i),xr(this,e),this.outputConfidenceMasks&&(H(e,"confidence_masks"),$(i,"CONFIDENCE_MASKS:confidence_masks"),$i(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Vi(this,s,!0,!this.j)),y(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],y(this,n)})),this.outputCategoryMask&&(H(e,"category_mask"),$(i,"CATEGORY_MASK:category_mask"),$i(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Vi(this,n,!1,!this.j),y(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,y(this,n)})),H(e,"quality_scores"),$(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,y(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};bt.prototype.segment=bt.prototype.segment,bt.prototype.setOptions=bt.prototype.o,bt.createFromModelPath=function(e,t){return R(bt,e,{baseOptions:{modelAssetPath:t}})},bt.createFromModelBuffer=function(e,t){return R(bt,e,{baseOptions:{modelAssetBuffer:t}})},bt.createFromOptions=function(e,t){return R(bt,e,t)};var it=class extends Re{constructor(e,t){super(new Je(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},S(e=this.h=new Vl,0,1,t=new ee)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?W(this.h,2,xi(e.displayNamesLocale)):"displayNamesLocale"in e&&W(this.h,2),e.maxResults!==void 0?pt(this.h,3,e.maxResults):"maxResults"in e&&W(this.h,3),e.scoreThreshold!==void 0?x(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&W(this.h,4),e.categoryAllowlist!==void 0?nr(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&W(this.h,5),e.categoryDenylist!==void 0?nr(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&W(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},Qe(this,e,t),this.j}F(e,t,i){return this.j={detections:[]},gt(this,e,i,t),this.j}m(){var e=new De;Y(e,"input_frame_gpu"),Y(e,"norm_rect"),H(e,"detections");const t=new He;at(t,C0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),X(i,"IMAGE:input_frame_gpu"),X(i,"NORM_RECT:norm_rect"),$(i,"DETECTIONS:detections"),i.o(t),Ve(e,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=pl(s),this.j.detections.push(Gl(n));y(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{y(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};it.prototype.detectForVideo=it.prototype.F,it.prototype.detect=it.prototype.D,it.prototype.setOptions=it.prototype.o,it.createFromModelPath=function(e,t){return M(this,null,function*(){return R(it,e,{baseOptions:{modelAssetPath:t}})})},it.createFromModelBuffer=function(e,t){return R(it,e,{baseOptions:{modelAssetBuffer:t}})},it.createFromOptions=function(e,t){return R(it,e,t)};var ea=class{constructor(e,t,i){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=i}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function D2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function R2(e){try{const t=new ea(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{kr(e)}}ea.prototype.close=ea.prototype.close;var Ze=class extends Re{constructor(e,t){super(new Je(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,S(e=this.h=new jl,0,1,t=new ee),this.v=new Dl,S(this.h,0,3,this.v),this.j=new Bl,S(this.h,0,2,this.j),pt(this.j,4,1),x(this.j,2,.5),x(this.v,2,.5),x(this.h,4,.5)}get baseOptions(){return N(this.h,ee,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t,i,n,r,s;return"numPoses"in e&&pt(this.j,4,(t=e.numPoses)!=null?t:1),"minPoseDetectionConfidence"in e&&x(this.j,2,(i=e.minPoseDetectionConfidence)!=null?i:.5),"minTrackingConfidence"in e&&x(this.h,4,(n=e.minTrackingConfidence)!=null?n:.5),"minPosePresenceConfidence"in e&&x(this.v,2,(r=e.minPosePresenceConfidence)!=null?r:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=(s=e.outputSegmentationMasks)!=null?s:!1),this.l(e)}D(e,t,i){const n=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:i,D2(this),Qe(this,e,n),R2(this)}F(e,t,i,n){const r=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:n,D2(this),gt(this,e,r,t),R2(this)}m(){var e=new De;Y(e,"image_in"),Y(e,"norm_rect"),H(e,"normalized_landmarks"),H(e,"world_landmarks"),H(e,"segmentation_masks");const t=new He;at(t,E0,this.h);const i=new Le;Ue(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),X(i,"IMAGE:image_in"),X(i,"NORM_RECT:norm_rect"),$(i,"NORM_LANDMARKS:normalized_landmarks"),$(i,"WORLD_LANDMARKS:world_landmarks"),i.o(t),Ve(e,i),xr(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,r)=>{this.landmarks=[];for(const s of n)n=bn(s),this.landmarks.push(Cr(n));y(this,r)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],y(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,r)=>{this.worldLandmarks=[];for(const s of n)n=Oi(s),this.worldLandmarks.push(wn(n));y(this,r)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],y(this,n)}),this.outputSegmentationMasks&&($(i,"SEGMENTATION_MASK:segmentation_masks"),$i(this,"segmentation_masks"),this.g.ba("segmentation_masks",(n,r)=>{this.segmentationMasks=n.map(s=>Vi(this,s,!0,!this.s)),y(this,r)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],y(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ze.prototype.detectForVideo=Ze.prototype.F,Ze.prototype.detect=Ze.prototype.D,Ze.prototype.setOptions=Ze.prototype.o,Ze.createFromModelPath=function(e,t){return R(Ze,e,{baseOptions:{modelAssetPath:t}})},Ze.createFromModelBuffer=function(e,t){return R(Ze,e,{baseOptions:{modelAssetBuffer:t}})},Ze.createFromOptions=function(e,t){return R(Ze,e,t)},Ze.POSE_CONNECTIONS=x2;const B0=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;let i=1,n=0,r=1,s=0;t.forEach(l=>{l&&typeof l.x=="number"&&typeof l.y=="number"&&(i=Math.min(i,l.x),n=Math.max(n,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y))});const o=n-i,a=s-r;return Math.max(o,a)},D0=(e,t)=>{if(!e||e.length===0)return!1;const i=e[0];let n=1,r=0,s=1,o=0;i.forEach(re=>{n=Math.min(n,re.x),r=Math.max(r,re.x),s=Math.min(s,re.y),o=Math.max(o,re.y)});const a=.5,c=.6,l=t>1;let d,h;l?(d=.4,h=.3):(d=.35,h=.5);const u=(n+r)/2,p=(s+o)/2,f=.2,m=d*(1+f),v=h*(1+f),b=((re,Z)=>{const ue=(re-a)/m,pe=(Z-c)/v;return ue*ue+pe*pe<=1})(u,p),_=.2,E=.1,L=d*(1+_),w=h*(1+E),T=(re,Z)=>{const ue=(re-a)/L,pe=(Z-c)/w;return ue*ue+pe*pe<=1},I=T(n,s),O=T(r,s),be=T(n,o),ce=T(r,o);return b&&I&&O&&be&&ce},R0=e=>{if(!e||e.length===0)return 0;const t=e[0];if(!t||t.length===0)return 0;const i=t[13],n=t[14];if(!i||!n)return 0;const r=Math.abs(n.y-i.y),s=Math.min(...t.map(c=>c.y)),a=Math.max(...t.map(c=>c.y))-s;return a>0?r/a:0},O0=e=>{const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)return null;const n=e.videoWidth,r=e.videoHeight,s=Math.min(n,r),o=(n-s)/2,a=(r-s)/2;return t.width=s,t.height=s,i.drawImage(e,o,a,s,s,0,0,s,s),t},O2=(e,t,i,n)=>{const r=e.getContext("2d");if(!r)return;const s=e.width,o=e.height;r.clearRect(0,0,s,o);const a=new Ie(r);t.forEach(c=>{if(!c||c.length===0)return;const l="rgba(162, 155, 254,0.4)",d=2;r.strokeStyle="rgba(255, 255, 255, 0.6)",r.lineWidth=d,r.lineCap="round",r.lineJoin="round",a.drawLandmarks(c,{color:"rgba(9, 132, 227,0.7)",lineWidth:.5,radius:.5}),a.drawConnectors(c,K.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=n&&a.drawConnectors(c,K.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},P2=e=>{const t=e.getContext("2d");t&&t.clearRect(0,0,e.width,e.height)},P0=(e,t=!1)=>{const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const r=e.videoHeight>e.videoWidth;t?r?(i.width=480,i.height=Math.max(640,i.width*e.videoHeight/e.videoWidth)):(i.width=640,i.height=Math.max(480,i.width*e.videoHeight/e.videoWidth)):r?(i.width=240,i.height=Math.max(320,i.width*e.videoHeight/e.videoWidth)):(i.width=320,i.height=Math.max(240,i.width*e.videoHeight/e.videoWidth));const s=1,o=e.videoWidth*s,a=e.videoHeight*s,c=(o-e.videoWidth)/2,l=(a-e.videoHeight)/2;return n.drawImage(e,-c,-l-0,o,a,0,0,i.width,i.height),i.toDataURL("image/jpeg")},$2={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},N2={"multiple-faces":"Ensure only one face is visible","no-face":"Position your face in the oval","out-of-bounds":"Position your face in the oval","too-close":"Move farther away","too-far":"Move closer","neutral-expression":"Neutral expression","smile-required":"Smile!","open-mouth-smile":"Wider smile - teeth visible",initializing:"Initializing..."},$0=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const i=t.getExtension("OES_texture_half_float"),n=t.getExtension("OES_texture_half_float_linear"),r=t.getExtension("EXT_color_buffer_half_float");return!!(i&&r&&n)},H2=()=>M(null,null,function*(){window.__smileIdentityMediapipe||(window.__smileIdentityMediapipe={instance:null,loading:null,loaded:!1});const e=window.__smileIdentityMediapipe;return e.loaded&&e.instance?e.instance:(e.loading||(e.loading=M(null,null,function*(){try{const t=yield ai.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=yield K.createFromOptions(t,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:$0()?"GPU":"CPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO",numFaces:2});return e.instance=i,e.loaded=!0,e.loading=null,i}catch(t){throw e.loading=null,t}})),e.loading)}),kn=Xi.version,N0=({videoRef:e,canvasRef:t,interval:i,duration:n,smileThreshold:r,mouthOpenThreshold:s,minFaceSize:o,maxFaceSize:a,smileCooldown:c,getFacingMode:l})=>{const d=xe(null),h=xe(null),u=xe(null),p=xe(null),f=se(!1),m=se(!1),v=se("good"),g=se(!1),b=se(16/9),_=se([]),E=se(0),L=se(0),w=se(0),T=se(0),I=se(""),O=se(!0),be=se(!1),ce=se(!1),re=se(0),Z=se([]),ue=se(null),pe=se(1),Ae=se(0),z2=se(!1),Gi=is(()=>Math.floor(pe.value*.4)),Z2=is(()=>Math.floor(pe.value*.2)),ou=is(()=>f.value&&m.value&&v.value==="good"&&!g.value),ra=z=>{z&&N2[z]?I.value=N2[z]:I.value=""},qe=xe(T1(z=>{ra(z)},600)).current,au=()=>M(null,null,function*(){var z,Ce;try{((z=window.__smileIdentityMediapipe)==null?void 0:z.loaded)&&((Ce=window.__smileIdentityMediapipe)==null?void 0:Ce.instance)||(O.value=!0,ra("initializing")),d.current=yield H2(),O.value=!1}catch(yt){console.error("Failed to initialize MediaPipe:",yt),O.value=!1}}),cu=()=>{if(e.current&&t.current){const{videoWidth:z,videoHeight:Ce}=e.current;b.value=z/Ce,t.current.width=z,t.current.height=Ce,e.current.parentElement&&(t.current.style.left="50%",t.current.style.top="50%")}},lu=()=>{const z=Ae.value<Z2.value,Ce=Ae.value>=Gi.value;z?I.value="Capturing...":Ce?Date.now()-T.value>c?E.value>=r&&w.value<s?qe("open-mouth-smile"):qe("smile-required"):I.value="Keep smiling!":qe(null)},hu=()=>{O.value?ra("initializing"):g.value?qe("multiple-faces"):f.value?v.value==="too-close"?qe("too-close"):v.value==="too-far"?qe("too-far"):m.value?be.value?lu():I.value="Ready to capture":qe("out-of-bounds"):qe("no-face")},sa=()=>{h.current&&(cancelAnimationFrame(h.current),h.current=null)},oa=()=>M(null,null,function*(){var z,Ce;if(!d.current||!e.current){sa();return}if(e.current.videoWidth<=0||e.current.videoHeight<=0||e.current.readyState<2){h.current=requestAnimationFrame(oa);return}try{O.value&&(O.value=!1);const yt=O0(e.current),aa=yt||e.current,We=d.current.detectForVideo(aa,performance.now());if(_.value=We.faceLandmarks||[],We.faceLandmarks&&t.current&&e.current)if(yt){const Xt=e.current.videoWidth,ci=e.current.videoHeight,zi=Math.min(Xt,ci),ca=(Xt-zi)/(2*Xt),Rr=(ci-zi)/(2*ci),Or=zi/Xt,Zi=zi/ci,pu=We.faceLandmarks.map(fu=>fu.map(la=>({x:la.x*Or+ca,y:la.y*Zi+Rr,z:la.z})));O2(t.current,pu,Ae.value,Gi.value)}else O2(t.current,We.faceLandmarks,Ae.value,Gi.value);else t.current&&P2(t.current);const X2=We.faceLandmarks?We.faceLandmarks.length:0;g.value=X2>1;const Y2=We.faceBlendshapes&&We.faceBlendshapes.length>0&&X2===1;if(f.value=Y2,Y2&&We.faceLandmarks){const Xt=B0(We.faceLandmarks);L.value=Xt,Xt>a?v.value="too-close":Xt<o?v.value="too-far":v.value="good",m.value=D0(We.faceLandmarks,b.value);const ci=We.faceBlendshapes[0].categories,zi=((z=ci.find(Zi=>Zi.categoryName==="mouthSmileLeft"))==null?void 0:z.score)||0,ca=((Ce=ci.find(Zi=>Zi.categoryName==="mouthSmileRight"))==null?void 0:Ce.score)||0,Rr=R0(We.faceLandmarks),Or=(zi+ca)/2;E.value=Or,w.value=Rr,Or>=r&&Rr>=s&&(T.value=Date.now(),ce.value&&be.value&&p.current&&setTimeout(()=>{Date.now()-T.value<=100&&ce.value&&be.value&&p.current&&p.current()},0))}else E.value=0,L.value=0,w.value=0,m.value=!1,v.value="good";hu()}catch(yt){f.value=!1,m.value=!1,g.value=!1,v.value="good",w.value=0,be.value&&qe("no-face")}h.current=requestAnimationFrame(oa)}),du=()=>{h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(oa)},uu=()=>{if(!e.current)return;const z=Ae.value===pe.value-1,Ce=P0(e.current,z);Ce&&(z?ue.value=Ce:Z.value=[...Z.value,Ce],Ae.value++,re.value=pe.value-Ae.value)},Dr=()=>{if(u.current&&(clearInterval(u.current),u.current=null),be.value=!1,ce.value=!1,Ae.value>=pe.value&&ue.value){const z=Z.value.map(aa=>({image:aa.split(",")[1],image_type_id:$2.LIVENESS_IMAGE_BASE64})),Ce={image:ue.value.split(",")[1],image_type_id:$2.SELFIE_IMAGE_BASE64},yt={images:[...z,Ce],referenceImage:ue.value,previewImage:ue.value,facingMode:l(),meta:{libraryVersion:kn}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:yt})),z2.value=!0}},An=()=>{u.current&&(clearInterval(u.current),u.current=null),ce.value=!0,!g.value&&f.value&&m.value&&v.value==="good"&&qe("smile-required")},q2=()=>{u.current&&clearInterval(u.current),u.current=setInterval(()=>{if(Ae.value>=pe.value){Dr();return}if(g.value){An();return}if(!f.value)return;if(!m.value){An();return}if(v.value!=="good"){An();return}if(Ae.value>=Gi.value&&Date.now()-T.value>c){An();return}uu()},i)},W2=()=>{if(f.value&&v.value==="good"&&m.value&&!g.value){if(Ae.value>=Gi.value&&Date.now()-T.value>c)return;ce.value=!1,qe(null),q2()}};return p.current=W2,{faceDetected:f,faceInBounds:m,faceProximity:v,multipleFaces:g,videoAspectRatio:b,faceLandmarks:_,currentSmileScore:E,currentFaceSize:L,currentMouthOpen:w,lastSmileTime:T,alertTitle:I,isInitializing:O,isReadyToCapture:ou,isCapturing:be,isPaused:ce,countdown:re,capturedImages:Z,referencePhoto:ue,totalCaptures:pe,capturesTaken:Ae,hasFinishedCapture:z2,smileCheckpoint:Gi,neutralZone:Z2,initializeFaceLandmarker:au,setupCanvas:cu,startDetectionLoop:du,stopDetectionLoop:sa,updateAlert:qe,startCapture:()=>M(null,null,function*(){Z.value=[],be.value=!0,ce.value=!1,pe.value=Math.ceil(n/i),Ae.value=0,re.value=pe.value;const z=document.querySelector("smart-camera-web");z==null||z.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),z==null||z.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[l()]}})),q2()}),stopCapture:Dr,pauseCapture:An,resumeCapture:W2,handleCancel:()=>{Dr(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:kn}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:kn}}}))},handleClose:()=>{Dr(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:kn}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:kn}}}))},cleanup:()=>{u.current&&clearInterval(u.current),sa(),qe.cancel()},resetFaceDetectionState:()=>{f.value=!1,m.value=!1,v.value="good",g.value=!1,_.value=[],E.value=0,L.value=0,w.value=0,T.value=0,t.current&&P2(t.current)}}},H0=({progress:e,duration:t=1e3,themeColor:i="#001096"})=>{const n=xe(null),r=xe(e);return ot(()=>{const s=n.current;if(!s)return;const o=s.getTotalLength();s.style.opacity=e>0?"1":"0";const a=o*(1-r.current),c=o*(1-e);a!==c&&(s.style.transition="none",s.style.strokeDasharray=`${o} ${o}`,s.style.strokeDashoffset=`${a}`,s.getBoundingClientRect(),s.style.transition=`stroke-dashoffset ${t}ms ease-out`,s.style.strokeDashoffset=`${c}`,r.current=e)},[e,t]),D("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:D("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[D("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:D("path",{d:"M0.085 0.382 C0.087 0.357 0.092 0.294 0.131 0.236 C0.200 0.133 0.340 0.063 0.501 0.063 C0.730 0.063 0.915 0.205 0.915 0.382 C0.915 0.424 0.899 0.513 0.891 0.549 C0.882 0.588 0.871 0.626 0.857 0.664 C0.792 0.825 0.639 0.937 0.501 0.937 C0.314 0.937 0.182 0.755 0.144 0.666 C0.126 0.624 0.110 0.557 0.107 0.547 C0.092 0.485 0.081 0.439 0.085 0.382 Z"})}),D("path",{d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:i,fill:"none",style:{strokeWidth:"8"}}),D("path",{ref:n,d:"M142.693 24C208.319 24 261 77.97 261 145.008C261 160.97 256.319 194.788 254.129 208.356C251.64 223.188 248.348 237.875 244.27 252.35C225.747 313.203 182.328 356 142.693 356C89.414 356 51.871 286.667 41.016 252.948C35.937 236.987 31.356 211.748 30.559 207.857C26.277 184.114 22.991 166.556 24.285 145.008C24.883 135.631 26.277 111.789 37.431 89.742C57.049 50.636 96.983 24 142.693 24Z",stroke:"#22c55e",style:{strokeWidth:"8"},fill:"none",strokeLinecap:"round"})]})})},U0=({videoRef:e,canvasRef:t,facingMode:i,multipleFaces:n,progress:r,interval:s,themeColor:o})=>D(Dt,{children:[D("div",{className:"camera-preview-container",children:[D("div",{className:"video-wrapper",style:{clipPath:n?"none":"url(#selfie-clip-path)"},children:D("div",{className:"video-container",children:[D("video",{ref:e,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),D("canvas",{ref:t,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!n&&D(H0,{progress:r,duration:s,themeColor:o})]}),D("style",{children:`
3208
3182
  .camera-preview-container {
3209
3183
  position: relative;
3210
3184
  width: 100%;
@@ -3245,7 +3219,7 @@ function print() { __p += __j.call(arguments, '') }
3245
3219
  .camera-canvas {
3246
3220
  pointer-events: none;
3247
3221
  }
3248
- `})]}),p6=({alertTitle:t})=>t?st(xn,{children:[st("div",{className:"alert-message",children:st("div",{className:"alert-title",children:t})}),st("style",{children:`
3222
+ `})]}),V0=({alertTitle:e})=>e?D(Dt,{children:[D("div",{className:"alert-message",children:D("div",{className:"alert-title",children:e})}),D("style",{children:`
3249
3223
  .alert-message {
3250
3224
  margin-top: 1.5rem;
3251
3225
  color: #000;
@@ -3261,7 +3235,7 @@ function print() { __p += __j.call(arguments, '') }
3261
3235
  font-weight: bold;
3262
3236
  text-align: center;
3263
3237
  }
3264
- `})]}):null,g6=({isCapturing:t,hasFinishedCapture:e,isReadyToCapture:i,allowAgentMode:s,agentSupported:o,showAgentModeForTests:c,facingMode:l,themeColor:u="#001096",onStartCapture:h,onSwitchCamera:f})=>st(xn,{children:[st("div",{className:"controls",children:[st("button",{class:"btn-primary",onClick:h,disabled:t||e||!i,children:"Start Capture"}),s&&(o||c)&&st("button",{onClick:f,className:"agent-mode-btn",disabled:t||e,children:l==="user"?"Agent Mode Off":"Agent Mode On"})]}),st("style",{children:`
3238
+ `})]}):null,j0=({isCapturing:e,hasFinishedCapture:t,isReadyToCapture:i,allowAgentMode:n,agentSupported:r,showAgentModeForTests:s,facingMode:o,themeColor:a="#001096",onStartCapture:c,onSwitchCamera:l})=>D(Dt,{children:[D("div",{className:"controls",children:[D("button",{id:"start-image-capture",class:"btn-primary",onClick:c,disabled:e||t||!i,children:"Start Capture"}),n&&(r||s)&&D("button",{id:"switch-camera",onClick:l,className:"agent-mode-btn",disabled:e||t,children:o==="user"?"Agent Mode Off":"Agent Mode On"})]}),D("style",{children:`
3265
3239
  .controls {
3266
3240
  margin: 1.5rem 0;
3267
3241
  display: flex;
@@ -3275,7 +3249,7 @@ function print() { __p += __j.call(arguments, '') }
3275
3249
  .agent-mode-btn {
3276
3250
  padding: 8px 16px;
3277
3251
  font-size: 14px;
3278
- background: ${u};
3252
+ background: ${a};
3279
3253
  color: white;
3280
3254
  border: none;
3281
3255
  border-radius: 4px;
@@ -3286,7 +3260,7 @@ function print() { __p += __j.call(arguments, '') }
3286
3260
  background: #ccc;
3287
3261
  cursor: not-allowed;
3288
3262
  }
3289
- `})]}),v1=({interval:t=350,duration:e=2800,"theme-color":i="#001096","show-navigation":s=!1,"allow-agent-mode":o=!1,"show-agent-mode-for-tests":c=!1,"hide-attribution":l=!1})=>{const u=pe(null),h=pe(null),f=Lr(s),_=Lr(o),m=Lr(c),b=Lr(l),E=300,A=.25,k=.05,F=.35,M=.5,D=_?"environment":"user",R=T5(D),$=Gt(!1),X=pe(N2.throttle(J=>{$.value=J},100)).current,N=h6({videoRef:R.videoRef,canvasRef:u,interval:t,duration:e,smileThreshold:A,mouthOpenThreshold:k,minFaceSize:F,maxFaceSize:M,smileCooldown:E,getFacingMode:()=>R.facingMode});Si(()=>{const J=()=>q(null,null,function*(){yield R.startCamera(D,pt=>{const kt=document.querySelector("smart-camera-web");kt==null||kt.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:pt}}))}),yield R.checkAgentSupport(),yield N.initializeFaceLandmarker(),setTimeout(()=>{N.setupCanvas(),N.startDetectionLoop()},500)});return R.registerCameraSwitchCallback(()=>{try{N.resetFaceDetectionState(),N.setupCanvas(),N.stopDetectionLoop(),N.startDetectionLoop()}catch(pt){console.error("Error during camera switch callback:",pt)}}),J(),()=>{N.stopDetectionLoop(),R.stopCamera(),N.cleanup(),X.cancel()}},[]),Si(()=>{X(N.multipleFaces.value)},[N.multipleFaces.value]),Si(()=>{const J=h.current;if(J&&f){const pt=()=>{N.handleCancel()},kt=()=>{N.handleClose()};return J.addEventListener("navigation.back",pt),J.addEventListener("navigation.close",kt),()=>{J.removeEventListener("navigation.back",pt),J.removeEventListener("navigation.close",kt)}}},[f]),Si(()=>{if(N.hasFinishedCapture.value){const J=document.querySelector("smart-camera-web");J==null||J.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[N.hasFinishedCapture.value]);const vt=()=>{N.startCapture();const J=document.querySelector("smart-camera-web");J==null||J.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),J==null||J.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[R.facingMode]}}))};return st("div",{className:"smartselfie-capture",children:[f&&st("smileid-navigation",{ref:h,"theme-color":i}),st(f6,{videoRef:R.videoRef,canvasRef:u,facingMode:R.facingMode,multipleFaces:$.value,progress:N.capturesTaken.value>0?N.capturesTaken.value/N.totalCaptures.value:0,interval:t,themeColor:i}),st(p6,{alertTitle:N.alertTitle.value}),!N.isCapturing.value&&!N.hasFinishedCapture.value&&st(g6,{isCapturing:N.isCapturing.value,hasFinishedCapture:N.hasFinishedCapture.value,isReadyToCapture:N.isReadyToCapture.value,allowAgentMode:_,agentSupported:R.agentSupported,showAgentModeForTests:m,facingMode:R.facingMode,themeColor:i,onStartCapture:vt,onSwitchCamera:R.switchCamera}),!b&&st("powered-by-smile-id",{}),st("style",{children:`
3263
+ `})]}),ta=({interval:e=350,duration:t=2800,"theme-color":i="#001096","show-navigation":n=!1,"allow-agent-mode":r=!1,"show-agent-mode-for-tests":s=!1,"hide-attribution":o=!1})=>{const a=xe(null),c=xe(null),l=fi(n),d=fi(r),h=fi(s),u=fi(o),p=300,f=.25,m=.05,v=.35,g=.5,b=d?"environment":"user",_=rd(b),E=se(!1),L=xe(T1(T=>{E.value=T},100)).current,w=N0({videoRef:_.videoRef,canvasRef:a,interval:e,duration:t,smileThreshold:f,mouthOpenThreshold:m,minFaceSize:v,maxFaceSize:g,smileCooldown:p,getFacingMode:()=>_.facingMode});return ot(()=>{const T=()=>M(null,null,function*(){yield _.startCamera(b,I=>{const O=document.querySelector("smart-camera-web");O==null||O.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:I}}))}),yield _.checkAgentSupport(),yield w.initializeFaceLandmarker(),setTimeout(()=>{w.setupCanvas(),w.startDetectionLoop()},500)});return _.registerCameraSwitchCallback(()=>{try{w.resetFaceDetectionState(),w.setupCanvas(),w.stopDetectionLoop(),w.startDetectionLoop()}catch(I){console.error("Error during camera switch callback:",I)}}),T(),()=>{w.stopDetectionLoop(),_.stopCamera(),w.cleanup(),L.cancel()}},[]),ot(()=>{L(w.multipleFaces.value)},[w.multipleFaces.value]),ot(()=>{const T=c.current;if(T&&l){const I=()=>{w.handleCancel()},O=()=>{w.handleClose()};return T.addEventListener("navigation.back",I),T.addEventListener("navigation.close",O),()=>{T.removeEventListener("navigation.back",I),T.removeEventListener("navigation.close",O)}}},[l]),ot(()=>{if(w.hasFinishedCapture.value){const T=document.querySelector("smart-camera-web");T==null||T.dispatchEvent(new CustomEvent("metadata.selfie-capture-end"))}},[w.hasFinishedCapture.value]),D("div",{className:"smartselfie-capture",children:[l&&D("smileid-navigation",{ref:c,"theme-color":i}),D(U0,{videoRef:_.videoRef,canvasRef:a,facingMode:_.facingMode,multipleFaces:E.value,progress:w.capturesTaken.value>0?w.capturesTaken.value/w.totalCaptures.value:0,interval:e,themeColor:i}),D(V0,{alertTitle:w.alertTitle.value}),!w.isCapturing.value&&!w.hasFinishedCapture.value&&D(j0,{isCapturing:w.isCapturing.value,hasFinishedCapture:w.hasFinishedCapture.value,isReadyToCapture:w.isReadyToCapture.value,allowAgentMode:d,agentSupported:_.agentSupported,showAgentModeForTests:h,facingMode:_.facingMode,themeColor:i,onStartCapture:w.startCapture,onSwitchCamera:_.switchCamera}),!u&&D("powered-by-smile-id",{}),D("style",{children:`
3290
3264
  * {
3291
3265
  box-sizing: border-box;
3292
3266
  }
@@ -3334,8 +3308,8 @@ function print() { __p += __j.call(arguments, '') }
3334
3308
  padding: 1rem;
3335
3309
  font-family: sans-serif;
3336
3310
  }
3337
- `})]})};customElements.get("smartselfie-capture")||k2(v1,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const m6=xs.version,v6=8;function _6(t,e=16){const i=new Set;for(let s=0;s<Math.min(t.length,1e4);s+=4)if(i.add(t[s]<<16|t[s+1]<<8|t[s+2]),i.size>e)return!0;return!1}function w6(t,e=v6){const i=[];if(t<e)throw new Error("SmartCameraWeb: Minimum required no of frames is ",e);const s=e-1,o=Math.floor(t/s);let c=1;for(let u=0;u<t;u+=o)i.length<8?i.push(u):(i[c]=u,i.sort((h,f)=>h-f),c+=1);const l=t-1;return i.length<8&&!i.includes(l)&&i.push(l),i}function b6(){return`
3338
- ${Ai(this.themeColor)}
3311
+ `})]})};customElements.get("smartselfie-capture")||t1(ta,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const G0=Xi.version,z0=8;function Z0(e,t=16){const i=new Set;for(let n=0;n<Math.min(e.length,1e4);n+=4)if(i.add(e[n]<<16|e[n+1]<<8|e[n+2]),i.size>t)return!0;return!1}function q0(e,t=z0){const i=[];if(e<t)throw new Error("SmartCameraWeb: Minimum required no of frames is ",t);const n=t-1,r=Math.floor(e/n);let s=1;for(let a=0;a<e;a+=r)i.length<8?i.push(a):(i[s]=a,i.sort((c,l)=>c-l),s+=1);const o=e-1;return i.length<8&&!i.includes(o)&&i.push(o),i}function W0(){return`
3312
+ ${st(this.themeColor)}
3339
3313
  <style>
3340
3314
  :host {
3341
3315
  --theme-color: ${this.themeColor||"#001096"};
@@ -3828,22 +3802,22 @@ function print() { __p += __j.call(arguments, '') }
3828
3802
  ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
3829
3803
  </div>
3830
3804
  </div>
3831
- `}function Yd(i){return q(this,arguments,function*(t,e={facingMode:"user"}){try{const s=yield et.getMedia({audio:!1,video:e}),c=(yield navigator.mediaDevices.enumerateDevices()).find(u=>u.kind==="videoinput"&&s.getVideoTracks()[0].getSettings().deviceId===u.deviceId),l=document.querySelector("smart-camera-web");l==null||l.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:c==null?void 0:c.label}})),t==null||t.removeAttribute("data-camera-error"),t==null||t.setAttribute("data-camera-ready",!0)}catch(s){t==null||t.removeAttribute("data-camera-ready"),t==null||t.setAttribute("data-camera-error",et.handleCameraError(s))}})}class y6 extends HTMLElement{constructor(){super(),this.templateString=b6.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const e=document.createElement("template");e.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(e.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:m6}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const e=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${e} ${e}`,this.imageOutline.style.strokeDashoffset=e,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent="WIDER SMILE",this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}_switchCamera(){return q(this,null,function*(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,et.stopMedia(),yield Yd(this,{facingMode:this.facingMode}),this.handleStream(et.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),et.stopMedia();const e=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=w6(e);this._data.images=this._data.images.concat(i.map(s=>({image:this._rawImages[s].split(",")[1],image_type_id:Ar.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(e){console.error(e)}}_capturePOLPhoto(){const e=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(e.width=240,e.height=Math.max(320,e.width*this._video.videoHeight/this._video.videoWidth)):(e.height=240,e.width=Math.max(320,e.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(e,!1),this._rawImages.push(e.toDataURL("image/jpeg"))}_captureReferencePhoto(){const e=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(e.width=480,e.height=Math.max(640,e.width*this._video.videoHeight/this._video.videoWidth)):(e.height=480,e.width=Math.max(640,e.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(e,!this.disableImageTests);const s=e.toDataURL("image/jpeg");this._referenceImage=s,this._data.images.push({image:s.split(",")[1],image_type_id:Ar.SELFIE_IMAGE_BASE64})}_publishImages(){const e=ys(Fe({},this._data),{facingMode:this.facingMode});this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:e}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(e,i=!0,s=this._video){const o=e.getContext("2d");if(o.drawImage(s,0,0,s.videoWidth,s.videoHeight,0,0,e.width,e.height),i){const c=o.getImageData(0,0,e.width,e.height);if(_6(c.data))return o;throw new Error("Unable to capture webcam images - Please try another device")}else return o}handleStream(e){try{const i=this.shadowRoot.querySelector(".video");if(!i)return;const s=this.shadowRoot.querySelector("video");let o=null;s?o=this.shadowRoot.querySelector("video"):o=document.createElement("video"),o.autoplay=!0,o.playsInline=!0,o.muted=!0,"srcObject"in o?o.srcObject=e:o.src=window.URL.createObjectURL(e),o.onloadedmetadata=()=>{o.play()},this._video=o,this._data.permissionGranted=!0,s||i.prepend(o)}catch(i){this.setAttribute("data-camera-error",et.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),et.stopMedia()}}setUpEventListeners(){var e;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(e=this.switchCamera)==null||e.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),et.stream?this.handleStream(et.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&Yd(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){et.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}setupAgentMode(){return q(this,null,function*(){var i,s,o,c;if(!this.allowAgentMode)return;(yield et.supportsAgentMode())||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?(s=(i=this.shadowRoot.querySelector("video"))==null?void 0:i.classList)==null||s.remove("agent-mode"):(c=(o=this.shadowRoot.querySelector("video"))==null?void 0:o.classList)==null||c.add("agent-mode")):this.switchCamera.hidden=!0})}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(e){switch(e){case"data-camera-error":case"hidden":case"title":this.shadowRoot.innerHTML=this.render(),this.init();break;case"allow-agent-mode":this.shadowRoot.innerHTML.trim()?this.setupAgentMode():(this.shadowRoot.innerHTML=this.render(),this.init());break;case"show-navigation":if(this.shadowRoot.innerHTML.trim()){const i=this.shadowRoot.querySelector("smileid-navigation");i&&(this.showNavigation?i.setAttribute("show-navigation",""):i.removeAttribute("show-navigation"))}else this.shadowRoot.innerHTML=this.render(),this.init();break;case"data-camera-ready":this.hasAttribute("data-camera-ready")&&et.stream&&this.handleStream(et.stream);break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),et.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",y6);const C6=o=>{var c=o,{timeout:t=2e4,"start-countdown":e=!1,hidden:i=!1}=c,s=$u(c,["timeout","start-countdown","hidden"]);const l=Lr(i),u=Lr(e),[h,f]=Qn(!1),[_,m]=Qn(0),[b,E]=Qn(!1),[A,k]=Qn(!1),[F,M]=Qn(!1);if(Si(()=>{if(h||A)return;q(null,null,function*(){k(!0);try{yield Kd(),f(!0)}catch(R){console.error("Failed to load Mediapipe:",R)}k(!1)})},[h,A]),Si(()=>{if(l||!u||h)return;const D=setInterval(()=>{m(R=>Math.min(R+1,100))},t/100);return()=>{clearInterval(D)}},[l,u,t,h]),Si(()=>{if(l||h||_<100)return;const R=setTimeout(()=>{const $=document.querySelector("selfie-capture");if($&&!$.hasAttribute("data-backup-events-setup")){$.setAttribute("data-backup-events-setup","true");const X=N=>{const vt=N;window.dispatchEvent(new CustomEvent(vt.type,{detail:vt.detail,bubbles:!0}))};return $.addEventListener("selfie-capture.publish",X),$.addEventListener("selfie-capture.cancelled",X),$.addEventListener("selfie-capture.close",X),()=>{$.removeEventListener("selfie-capture.publish",X),$.removeEventListener("selfie-capture.cancelled",X),$.removeEventListener("selfie-capture.close",X)}}},200);return()=>{clearTimeout(R)}},[l,h,_]),Si(()=>{if(l||A)return;const D=document.querySelector("smart-camera-web");D==null||D.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:F?"0.0.1":"1.0.0"}}))},[F,l,A]),l)return null;if(b&&h&&!F)return st(v1,Fe({},s));if(!b&&h&&!F)return st(v1,Fe({},s));if(_>=100){F||M(!0);const D=Fe({},s);return delete D.hidden,st("selfie-capture",ys(Fe({},D),{ref:R=>{if(R&&!R.hasAttribute("data-events-setup")){R.setAttribute("data-events-setup","true");const $=X=>{const N=X;(N.type==="selfie-capture.publish"||N.type==="selfie-capture.cancelled"||N.type==="selfie-capture.close")&&E(!0),window.dispatchEvent(new CustomEvent(N.type,{detail:N.detail,bubbles:!0}))};R.addEventListener("selfie-capture.publish",$),R.addEventListener("selfie-capture.cancelled",$),R.addEventListener("selfie-capture.close",$)}}}))}return st("div",{style:{textAlign:"center",marginTop:"20%"},children:[st("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:st(m5,{size:48,style:{animation:"spin 1s linear infinite"}})}),st("p",{children:["Loading... ",_,"%"]}),st("style",{children:`
3805
+ `}function U2(i){return M(this,arguments,function*(e,t={facingMode:"user"}){try{const n=yield F.getMedia({audio:!1,video:t}),s=(yield navigator.mediaDevices.enumerateDevices()).find(a=>a.kind==="videoinput"&&n.getVideoTracks()[0].getSettings().deviceId===a.deviceId),o=document.querySelector("smart-camera-web");o==null||o.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:s==null?void 0:s.label}})),e==null||e.removeAttribute("data-camera-error"),e==null||e.setAttribute("data-camera-ready",!0)}catch(n){e==null||e.removeAttribute("data-camera-ready"),e==null||e.setAttribute("data-camera-error",F.handleCameraError(n))}})}class X0 extends HTMLElement{constructor(){super(),this.templateString=W0.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.facingMode="user",this.allowAgentMode&&(this.facingMode="environment")}connectedCallback(){const t=document.createElement("template");t.innerHTML=this.render(),this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(t.content.cloneNode(!0)),this.videoContainer=this.shadowRoot.querySelector(".video-container > .video"),this.init()}init(){this._videoStreamDurationInMS=7800,this._imageCaptureIntervalInMS=200,this._data={images:[],meta:{libraryVersion:G0}},this._rawImages=[],this.setUpEventListeners()}reset(){this.disconnectedCallback(),this.connectedCallback()}_startImageCapture(){this.startImageCapture.disabled=!0,this.switchCamera&&(this.switchCamera.disabled=!0);const t=document.querySelector("smart-camera-web");t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),t==null||t.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[this.inAgentMode?"environment":"user"]}}));const i=this.imageOutline.getTotalLength();this.imageOutline.style.transition="none",this.imageOutline.style.strokeDasharray=`${i} ${i}`,this.imageOutline.style.strokeDashoffset=i,this.imageOutline.getBoundingClientRect(),this.imageOutline.style.transition=`stroke-dashoffset ${this._videoStreamDurationInMS/1e3}s ease-in-out`,this.imageOutline.style.strokeDashoffset="0",setTimeout(()=>{this.smileCTABox.style.opacity=1,this.mouthAnim.beginElement()},1500),setTimeout(()=>{this.smileCTABox.style.opacity=0},3500),setTimeout(()=>{this.smileCTABox.style.opacity=1,this.smileCTA.textContent="WIDER SMILE",this.mouth.setAttribute("d","m 213.88314,319.4551 c -1.58,0.97 -0.35309,9.33393 1.50671,9.30586 6.05679,-0.0914 16.11631,0.17227 34.57066,0.13346 18.45435,-0.0388 28.15778,-0.0418 31.09964,-0.79956 1.80122,-0.46394 2.75061,-7.48365 1.16061,-8.45365 -1.6,-1.74874 -2.96432,-0.94348 -6.77747,-1.56441 -12.83012,0.04 -36.52534,0.50197 -41.29469,0.43262 -2.51525,-0.0713 -18.41588,-0.61 -20.01588,0.35 z m 57.29363,1.36599 c -9.24417,-2.23757 -8.08363,-2.42362 -20.78363,-2.42362 -12.7,0 -17.77931,2.69528 -26.84042,5.36549 12.57883,3.28731 33.57775,-4.29887 49.70067,2.24964 z"),this.mouthAnim.beginElement()},4e3),this._imageCaptureInterval=setInterval(()=>{this._capturePOLPhoto()},this._imageCaptureIntervalInMS),this._videoStreamTimeout=setTimeout(()=>{this._stopVideoStream()},this._videoStreamDurationInMS)}_switchCamera(){return M(this,null,function*(){this.facingMode=this.facingMode==="user"?"environment":"user",this.facingMode==="user"?this.shadowRoot.querySelector("video").classList.remove("agent-mode"):this.shadowRoot.querySelector("video").classList.add("agent-mode"),this.startImageCapture.disabled=!0,this.switchCamera.disabled=!0,F.stopMedia(),yield U2(this,{facingMode:this.facingMode}),this.handleStream(F.stream)})}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),F.stopMedia();const t=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=q0(t);this._data.images=this._data.images.concat(i.map(n=>({image:this._rawImages[n].split(",")[1],image_type_id:di.LIVENESS_IMAGE_BASE64}))),this._publishImages()}catch(t){console.error(t)}}_capturePOLPhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=240,t.height=Math.max(320,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=240,t.width=Math.max(320,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!1),this._rawImages.push(t.toDataURL("image/jpeg"))}_captureReferencePhoto(){const t=document.createElement("canvas");this._video.videoHeight>this._video.videoWidth?(t.width=480,t.height=Math.max(640,t.width*this._video.videoHeight/this._video.videoWidth)):(t.height=480,t.width=Math.max(640,t.height*this._video.videoWidth/this._video.videoHeight)),this._drawImage(t,!this.disableImageTests);const n=t.toDataURL("image/jpeg");this._referenceImage=n,this._data.images.push({image:n.split(",")[1],image_type_id:di.SELFIE_IMAGE_BASE64})}_publishImages(){const t=qi(Fe({},this._data),{facingMode:this.facingMode});this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:t}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(t,i=!0,n=this._video){const r=t.getContext("2d");if(r.drawImage(n,0,0,n.videoWidth,n.videoHeight,0,0,t.width,t.height),i){const s=r.getImageData(0,0,t.width,t.height);if(Z0(s.data))return r;throw new Error("Unable to capture webcam images - Please try another device")}else return r}handleStream(t){try{const i=this.shadowRoot.querySelector(".video");if(!i)return;const n=this.shadowRoot.querySelector("video");let r=null;n?r=this.shadowRoot.querySelector("video"):r=document.createElement("video"),r.autoplay=!0,r.playsInline=!0,r.muted=!0,"srcObject"in r?r.srcObject=t:r.src=window.URL.createObjectURL(t),r.onloadedmetadata=()=>{r.play()},this._video=r,this._data.permissionGranted=!0,n||i.prepend(r)}catch(i){this.setAttribute("data-camera-error",F.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),F.stopMedia()}}setUpEventListeners(){var t;this.navigation=this.shadowRoot.querySelector("smileid-navigation"),this.startImageCapture=this.shadowRoot.querySelector("#start-image-capture"),this.switchCamera=this.shadowRoot.querySelector("#switch-camera"),this.imageOutline=this.shadowRoot.querySelector("#image-outline path"),this.smileCTABox=this.shadowRoot.querySelector("#smile-cta-box"),this.smileCTA=this.shadowRoot.querySelector("#smile-cta"),this.mouth=this.shadowRoot.querySelector("#mouth"),this.mouthAnim=this.shadowRoot.querySelector("#mouthAnim"),this.startImageCapture.addEventListener("click",()=>{this._startImageCapture()}),(t=this.switchCamera)==null||t.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),F.stream?this.handleStream(F.stream):(this.hasAttribute("data-camera-ready")||!this.hasAttribute("data-camera-error"))&&U2(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){F.stopMedia(),clearTimeout(this._videoStreamTimeout)}get hideBack(){return this.hasAttribute("hide-back")}get showNavigation(){return this.hasAttribute("show-navigation")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}get hideAttribution(){return this.hasAttribute("hide-attribution")}setupAgentMode(){return M(this,null,function*(){var i,n,r,s;if(!this.allowAgentMode)return;(yield F.supportsAgentMode())||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?(n=(i=this.shadowRoot.querySelector("video"))==null?void 0:i.classList)==null||n.remove("agent-mode"):(s=(r=this.shadowRoot.querySelector("video"))==null?void 0:r.classList)==null||s.add("agent-mode")):this.switchCamera.hidden=!0})}get hasAgentSupport(){return this.hasAttribute("has-agent-support")}get title(){return this.getAttribute("title")||"Submit Front of ID"}get hidden(){return this.getAttribute("hidden")}get cameraError(){return this.getAttribute("data-camera-error")}get disableImageTests(){return this.hasAttribute("disable-image-tests")}get allowAgentMode(){return this.getAttribute("allow-agent-mode")==="true"}get inAgentMode(){return this.facingMode==="environment"}static get observedAttributes(){return["allow-agent-mode","data-camera-error","data-camera-ready","disable-image-tests","hidden","hide-back-to-host","show-navigation","title"]}attributeChangedCallback(t){switch(t){case"data-camera-error":case"hidden":case"title":this.shadowRoot.innerHTML=this.render(),this.init();break;case"allow-agent-mode":this.shadowRoot.innerHTML.trim()?this.setupAgentMode():(this.shadowRoot.innerHTML=this.render(),this.init());break;case"show-navigation":if(this.shadowRoot.innerHTML.trim()){const i=this.shadowRoot.querySelector("smileid-navigation");i&&(this.showNavigation?i.setAttribute("show-navigation",""):i.removeAttribute("show-navigation"))}else this.shadowRoot.innerHTML=this.render(),this.init();break;case"data-camera-ready":this.hasAttribute("data-camera-ready")&&F.stream&&this.handleStream(F.stream);break}}handleBackEvents(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.cancelled"))}closeWindow(){this.stopMedia(),this.dispatchEvent(new CustomEvent("selfie-capture.close"))}stopMedia(){this.removeAttribute("data-camera-ready"),F.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",X0);const Y0=r=>{var s=r,{timeout:e=2e4,"start-countdown":t=!1,hidden:i=!1}=s,n=ua(s,["timeout","start-countdown","hidden"]);const a=(()=>{try{return!!window.parent.Cypress||window.parent.navigator.userAgent.includes("Electron")&&window.parent.__Cypress}catch(E){return!1}})()||!!window.Cypress||window.navigator.userAgent.includes("Electron")&&window.__Cypress,c=fi(i),l=fi(t),[d,h]=Kt(!1),[u,p]=Kt(a?100:0),[f,m]=Kt(!1),[v,g]=Kt(!1),[b,_]=Kt(!1);if(ot(()=>{if(d||v||a)return;M(null,null,function*(){g(!0);try{yield H2(),h(!0)}catch(L){console.error("Failed to load Mediapipe:",L)}g(!1)})},[d,v]),ot(()=>{if(c||!l||d)return;const E=setInterval(()=>{p(L=>Math.min(L+1,100))},e/100);return()=>{clearInterval(E)}},[c,l,e,d]),ot(()=>{if(c||d||u<100)return;const L=setTimeout(()=>{const w=document.querySelector("selfie-capture");if(w&&!w.hasAttribute("data-backup-events-setup")){w.setAttribute("data-backup-events-setup","true");const T=I=>{const O=I;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return w.addEventListener("selfie-capture.publish",T),w.addEventListener("selfie-capture.cancelled",T),w.addEventListener("selfie-capture.close",T),()=>{w.removeEventListener("selfie-capture.publish",T),w.removeEventListener("selfie-capture.cancelled",T),w.removeEventListener("selfie-capture.close",T)}}},200);return()=>{clearTimeout(L)}},[c,d,u]),ot(()=>{if(c||v)return;const E=document.querySelector("smart-camera-web");E==null||E.dispatchEvent(new CustomEvent("metadata.active-liveness-version",{detail:{version:b?"0.0.1":"1.0.0"}}))},[b,c,v]),c)return null;if(f&&d&&!b)return D(ta,Fe({},n));if(!f&&d&&!b)return D(ta,Fe({},n));if(u>=100){b||_(!0);const E=Fe({},n);return delete E.hidden,D("selfie-capture",qi(Fe({},E),{ref:L=>{if(L&&!L.hasAttribute("data-events-setup")){L.setAttribute("data-events-setup","true");const w=T=>{const I=T;(I.type==="selfie-capture.publish"||I.type==="selfie-capture.cancelled"||I.type==="selfie-capture.close")&&m(!0),window.dispatchEvent(new CustomEvent(I.type,{detail:I.detail,bubbles:!0}))};L.addEventListener("selfie-capture.publish",w),L.addEventListener("selfie-capture.cancelled",w),L.addEventListener("selfie-capture.close",w)}}}))}return D("div",{style:{textAlign:"center",marginTop:"20%"},children:[D("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:D(Bh,{size:48,style:{animation:"spin 1s linear infinite"}})}),D("p",{children:["Loading... ",u,"%"]}),D("style",{children:`
3832
3806
  @keyframes spin {
3833
3807
  from { transform: rotate(0deg); }
3834
3808
  to { transform: rotate(360deg); }
3835
3809
  }
3836
- `})]})};customElements.get("selfie-capture-wrapper")||k2(C6,"selfie-capture-wrapper",["timeout","interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests","key","start-countdown","hidden"],{shadow:!0});const x6=xs.version,Ee=document.querySelector("smart-camera-web"),E6=(t,e=0,i=0,s=.9)=>new Promise((o,c)=>{if(!t||typeof t!="string"){c(new Error("Invalid data URI provided"));return}if(e<0||e>=99||i<0||i>=99){c(new Error("Crop percentages must be between 0 and 99"));return}const l=new Image;l.onload=()=>{try{const u=document.createElement("canvas"),h=u.getContext("2d"),f=l.width,_=l.height,m=f*e/100,b=_*i/100,E=f-m*2,A=_-b*2;u.width=E,u.height=A,h.drawImage(l,m,b,E,A,0,0,E,A);const k=u.toDataURL("image/jpeg",s);o(k)}catch(u){c(new Error(`Failed to process image: ${u.message}`))}},l.onerror=()=>{c(new Error("Failed to load image from data URI"))},l.src=t});class Jd extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
3837
- ${Ai(this.themeColor)}
3810
+ `})]})};customElements.get("selfie-capture-wrapper")||t1(Y0,"selfie-capture-wrapper",["timeout","interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests","key","start-countdown","hidden"],{shadow:!0});const K0=Xi.version,nt=document.querySelector("smart-camera-web"),J0=(e,t=0,i=0,n=.9)=>new Promise((r,s)=>{if(!e||typeof e!="string"){s(new Error("Invalid data URI provided"));return}if(t<0||t>=99||i<0||i>=99){s(new Error("Crop percentages must be between 0 and 99"));return}const o=new Image;o.onload=()=>{try{const a=document.createElement("canvas"),c=a.getContext("2d"),l=o.width,d=o.height,h=l*t/100,u=d*i/100,p=l-h*2,f=d-u*2;a.width=p,a.height=f,c.drawImage(o,h,u,p,f,0,0,p,f);const m=a.toDataURL("image/jpeg",n);r(m)}catch(a){s(new Error(`Failed to process image: ${a.message}`))}},o.onerror=()=>{s(new Error("Failed to load image from data URI"))},o.src=e});class V2 extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,nt==null||nt.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
3811
+ ${st(this.themeColor)}
3838
3812
  <div style="height: 100%;">
3839
3813
  <selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
3840
3814
  <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>
3841
3815
  <selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
3842
3816
  </div>
3843
- `,this._data={images:[],meta:{libraryVersion:x6}},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(){et.stopMedia(),this._selfieWrapperListeners&&(this._selfieWrapperListeners.forEach(({event:e,handler:i})=>{window.removeEventListener(e,i)}),this._selfieWrapperListeners=null),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",()=>q(this,null,function*(){this.setActiveScreen(this.selfieCapture),this.selfieCapture.querySelector("selfie-capture")&&(Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-origin",{detail:{imageOrigin:{environment:"back_camera",user:"front_camera"}[this.getAgentMode()]}})))})),this.selfieInstruction.addEventListener("selfie-capture-instructions.cancelled",()=>{this.handleBackEvents()}),this.setupSelfieWrapperEventListeners(),this.selfieReview.addEventListener("selfie-capture-review.rejected",()=>q(this,null,function*(){Ee==null||Ee.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",()=>q(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(e=>{e.addEventListener(`${e.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return q(this,null,function*(){et.stopMedia(),this._remountKey++;const e=this.querySelector("div"),i=this.selfieCapture;if(i&&e){const s=document.createElement("selfie-capture-wrapper");Array.from(i.attributes).forEach(l=>{s.setAttribute(l.name,l.value)}),i.remove(),yield new Promise(l=>{setTimeout(l,50)}),s.setAttribute("key",this._remountKey.toString()),s.setAttribute("start-countdown","false"),s.setAttribute("hidden","");const c=e.querySelector("selfie-capture-review");c?e.insertBefore(s,c):e.appendChild(s),this.selfieCapture=s,this.setupSelfieWrapperEventListeners()}return new Promise(s=>{setTimeout(()=>{s()},200)})})}setActiveScreen(e){var i;this.activeScreen!==e&&((i=this.activeScreen)==null||i.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e,e===this.selfieCapture?e.setAttribute("start-countdown","true"):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false"))}setupSelfieWrapperEventListeners(){this._selfieWrapperListeners&&this._selfieWrapperListeners.forEach(({event:o,handler:c})=>{window.removeEventListener(o,c)});const e=()=>q(this,null,function*(){if(et.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>q(this,null,function*(){et.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),s=o=>q(this,null,function*(){Ee==null||Ee.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield E6(o.detail.referenceImage,20,20));const c=o.detail.facingMode==="user";this.selfieReview.setAttribute("mirror-image",c?"true":"false"),this._data.images=o.detail.images,et.stopMedia(),this.setActiveScreen(this.selfieReview)});this._selfieWrapperListeners=[{event:"selfie-capture.cancelled",handler:e},{event:"selfie-capture.close",handler:i},{event:"selfie-capture.publish",handler:s}],this._selfieWrapperListeners.forEach(({event:o,handler:c})=>{window.addEventListener(o,c)}),this.addEventListener("selfie-capture.publish",s)}_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"]}attributeChangedCallback(e){switch(e){case"title":case"hidden":case"initial-screen":this.connectedCallback();break}}}"customElements"in window&&!customElements.get("selfie-capture-screens")&&customElements.define("selfie-capture-screens",Jd);/*!
3844
- * Signature Pad v5.0.2 | https://github.com/szimek/signature_pad
3845
- * (c) 2024 Szymon Nowak | Released under the MIT license
3846
- */class Sa{constructor(e,i,s,o){if(isNaN(e)||isNaN(i))throw new Error(`Point is invalid: (${e}, ${i})`);this.x=+e,this.y=+i,this.pressure=s||0,this.time=o||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class _1{static fromPoints(e,i){const s=this.calculateControlPoints(e[0],e[1],e[2]).c2,o=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new _1(e[1],s,o,e[2],i.start,i.end)}static calculateControlPoints(e,i,s){const o=e.x-i.x,c=e.y-i.y,l=i.x-s.x,u=i.y-s.y,h={x:(e.x+i.x)/2,y:(e.y+i.y)/2},f={x:(i.x+s.x)/2,y:(i.y+s.y)/2},_=Math.sqrt(o*o+c*c),m=Math.sqrt(l*l+u*u),b=h.x-f.x,E=h.y-f.y,A=m/(_+m),k={x:f.x+b*A,y:f.y+E*A},F=i.x-k.x,M=i.y-k.y;return{c1:new Sa(h.x+F,h.y+M),c2:new Sa(f.x+F,f.y+M)}}constructor(e,i,s,o,c,l){this.startPoint=e,this.control2=i,this.control1=s,this.endPoint=o,this.startWidth=c,this.endWidth=l}length(){let i=0,s,o;for(let c=0;c<=10;c+=1){const l=c/10,u=this.point(l,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),h=this.point(l,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(c>0){const f=u-s,_=h-o;i+=Math.sqrt(f*f+_*_)}s=u,o=h}return i}point(e,i,s,o,c){return i*(1-e)*(1-e)*(1-e)+3*s*(1-e)*(1-e)*e+3*o*(1-e)*e*e+c*e*e*e}}class A6{constructor(){try{this._et=new EventTarget}catch(e){this._et=document}}addEventListener(e,i,s){this._et.addEventListener(e,i,s)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,i,s){this._et.removeEventListener(e,i,s)}}function S6(t,e=250){let i=0,s=null,o,c,l;const u=()=>{i=Date.now(),s=null,o=t.apply(c,l),s||(c=null,l=[])};return function(...f){const _=Date.now(),m=e-(_-i);return c=this,l=f,m<=0||m>e?(s&&(clearTimeout(s),s=null),i=_,o=t.apply(c,l),s||(c=null,l=[])):s||(s=window.setTimeout(u,m)),o}}let k6=class Nu extends A6{constructor(e,i={}){var s,o,c;super(),this.canvas=e,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=l=>{!this._isLeftButtonPressed(l,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(l))},this._handleMouseMove=l=>{if(!this._isLeftButtonPressed(l,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(l),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(l))},this._handleMouseUp=l=>{this._isLeftButtonPressed(l)||this._strokeEnd(this._pointerEventToSignatureEvent(l))},this._handleTouchStart=l=>{l.targetTouches.length!==1||this._drawingStroke||(l.cancelable&&l.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(l)))},this._handleTouchMove=l=>{if(l.targetTouches.length===1){if(l.cancelable&&l.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(l),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(l))}},this._handleTouchEnd=l=>{l.targetTouches.length===0&&(l.cancelable&&l.preventDefault(),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this._strokeEnd(this._touchEventToSignatureEvent(l)))},this._handlePointerDown=l=>{!this._isLeftButtonPressed(l)||this._drawingStroke||(l.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(l)))},this._handlePointerMove=l=>{if(!this._isLeftButtonPressed(l,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(l),!1);return}l.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(l))},this._handlePointerUp=l=>{this._isLeftButtonPressed(l)||(l.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(l)))},this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle=(s=i.throttle)!==null&&s!==void 0?s:16,this.minDistance=(o=i.minDistance)!==null&&o!==void 0?o: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=(c=i.canvasContextOptions)!==null&&c!==void 0?c:{},this._strokeMoveUpdate=this.throttle?S6(Nu.prototype._strokeUpdate,this.throttle):Nu.prototype._strokeUpdate,this._ctx=e.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:e,canvas:i}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,i.width,i.height),e.fillRect(0,0,i.width,i.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(e,i={}){return new Promise((s,o)=>{const c=new Image,l=i.ratio||window.devicePixelRatio||1,u=i.width||this.canvas.width/l,h=i.height||this.canvas.height/l,f=i.xOffset||0,_=i.yOffset||0;this._reset(this._getPointGroupOptions()),c.onload=()=>{this._ctx.drawImage(c,f,_,u,h),s()},c.onerror=m=>{o(m)},c.crossOrigin="anonymous",c.src=e,this._isEmpty=!1})}toDataURL(e="image/png",i){switch(e){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(e,i)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const e=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!e?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 e;const i=window.document===this.canvas.ownerDocument?window:(e=this.canvas.ownerDocument.defaultView)!==null&&e!==void 0?e:this.canvas.ownerDocument;return{addEventListener:i.addEventListener.bind(i),removeEventListener:i.removeEventListener.bind(i)}}_removeMoveUpEventListeners(){const{removeEventListener:e}=this._getListenerFunctions();e("pointermove",this._handlePointerMove),e("pointerup",this._handlePointerUp),e("mousemove",this._handleMouseMove),e("mouseup",this._handleMouseUp),e("touchmove",this._handleTouchMove),e("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(e,{clear:i=!0}={}){i&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_isLeftButtonPressed(e,i){return i?e.buttons===1:(e.buttons&1)===1}_pointerEventToSignatureEvent(e){return{event:e,type:e.type,x:e.clientX,y:e.clientY,pressure:"pressure"in e?e.pressure:0}}_touchEventToSignatureEvent(e){const i=e.changedTouches[0];return{event:e,type:e.type,x:i.clientX,y:i.clientY,pressure:i.force}}_getPointGroupOptions(e){return{penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:e,cancelable:!0})))return;const{addEventListener:s}=this._getListenerFunctions();switch(e.event.type){case"mousedown":s("mousemove",this._handleMouseMove),s("mouseup",this._handleMouseUp);break;case"touchstart":s("touchmove",this._handleTouchMove),s("touchend",this._handleTouchEnd);break;case"pointerdown":s("pointermove",this._handlePointerMove),s("pointerup",this._handlePointerUp);break}this._drawingStroke=!0;const o=this._getPointGroupOptions(),c=Object.assign(Object.assign({},o),{points:[]});this._data.push(c),this._reset(o),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(e);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:e}));const i=this._createPoint(e.x,e.y,e.pressure),s=this._data[this._data.length-1],o=s.points,c=o.length>0&&o[o.length-1],l=c?i.distanceTo(c)<=this.minDistance:!1,u=this._getPointGroupOptions(s);if(!c||!(c&&l)){const h=this._addPoint(i,u);c?h&&this._drawCurve(h,u):this._drawDot(i,u),o.push({time:i.time,x:i.x,y:i.y,pressure:i.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:e}))}_strokeEnd(e,i=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(i&&this._strokeUpdate(e),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown)}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart)}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,i,s){const o=this.canvas.getBoundingClientRect();return new Sa(e-o.left,i-o.top,s,new Date().getTime())}_addPoint(e,i){const{_lastPoints:s}=this;if(s.push(e),s.length>2){s.length===3&&s.unshift(s[0]);const o=this._calculateCurveWidths(s[1],s[2],i),c=_1.fromPoints(s,o);return s.shift(),c}return null}_calculateCurveWidths(e,i,s){const o=s.velocityFilterWeight*i.velocityFrom(e)+(1-s.velocityFilterWeight)*this._lastVelocity,c=this._strokeWidth(o,s),l={end:c,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=c,l}_strokeWidth(e,i){return Math.max(i.maxWidth/(e+1),i.minWidth)}_drawCurveSegment(e,i,s){const o=this._ctx;o.moveTo(e,i),o.arc(e,i,s,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,i){const s=this._ctx,o=e.endWidth-e.startWidth,c=Math.ceil(e.length())*2;s.beginPath(),s.fillStyle=i.penColor;for(let l=0;l<c;l+=1){const u=l/c,h=u*u,f=h*u,_=1-u,m=_*_,b=m*_;let E=b*e.startPoint.x;E+=3*m*u*e.control1.x,E+=3*_*h*e.control2.x,E+=f*e.endPoint.x;let A=b*e.startPoint.y;A+=3*m*u*e.control1.y,A+=3*_*h*e.control2.y,A+=f*e.endPoint.y;const k=Math.min(e.startWidth+f*o,i.maxWidth);this._drawCurveSegment(E,A,k)}s.closePath(),s.fill()}_drawDot(e,i){const s=this._ctx,o=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;s.beginPath(),this._drawCurveSegment(e.x,e.y,o),s.closePath(),s.fillStyle=i.penColor,s.fill()}_fromData(e,i,s){for(const o of e){const{points:c}=o,l=this._getPointGroupOptions(o);if(c.length>1)for(let u=0;u<c.length;u+=1){const h=c[u],f=new Sa(h.x,h.y,h.pressure,h.time);u===0&&this._reset(l);const _=this._addPoint(f,l);_&&i(_,l)}else this._reset(l),s(c[0],l)}}toSVG({includeBackgroundColor:e=!1}={}){const i=this._data,s=Math.max(window.devicePixelRatio||1,1),o=0,c=0,l=this.canvas.width/s,u=this.canvas.height/s,h=document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.setAttribute("viewBox",`${o} ${c} ${l} ${u}`),h.setAttribute("width",l.toString()),h.setAttribute("height",u.toString()),e&&this.backgroundColor){const f=document.createElement("rect");f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.setAttribute("fill",this.backgroundColor),h.appendChild(f)}return this._fromData(i,(f,{penColor:_})=>{const m=document.createElement("path");if(!isNaN(f.control1.x)&&!isNaN(f.control1.y)&&!isNaN(f.control2.x)&&!isNaN(f.control2.y)){const b=`M ${f.startPoint.x.toFixed(3)},${f.startPoint.y.toFixed(3)} C ${f.control1.x.toFixed(3)},${f.control1.y.toFixed(3)} ${f.control2.x.toFixed(3)},${f.control2.y.toFixed(3)} ${f.endPoint.x.toFixed(3)},${f.endPoint.y.toFixed(3)}`;m.setAttribute("d",b),m.setAttribute("stroke-width",(f.endWidth*2.25).toFixed(3)),m.setAttribute("stroke",_),m.setAttribute("fill","none"),m.setAttribute("stroke-linecap","round"),h.appendChild(m)}},(f,{penColor:_,dotSize:m,minWidth:b,maxWidth:E})=>{const A=document.createElement("circle"),k=m>0?m:(b+E)/2;A.setAttribute("r",k.toString()),A.setAttribute("cx",f.x.toString()),A.setAttribute("cy",f.y.toString()),A.setAttribute("fill",_),h.appendChild(A)}),h.outerHTML}};const un=class un{static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),o=e/Uu(1024,s);return s===0?`${e} bytes`:`${o.toFixed(0)} ${i[s]}`}static getData(e){return new Promise((i,s)=>{const o=new FileReader;o.onload=c=>{i(c.target.result)},o.onerror=()=>{s(new Error("An error occurred reading the file. Please check the file, and try again"))},o.readAsDataURL(e)})}static retrieve(e){return q(this,null,function*(){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!un.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>un.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${un.getHumanSize(un.memoryLimit)}.`);return yield un.getData(i)})}};xr(un,"memoryLimit",2048e3),xr(un,"supportedTypes",["image/jpeg","image/png","image/svg+xml"]);let w1=un;class Qd extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
3817
+ `,this._data={images:[],meta:{libraryVersion:K0}},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",()=>M(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",()=>M(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",()=>M(this,null,function*(){this._publishSelectedImages()})),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){return M(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=()=>M(this,null,function*(){if(F.stopMedia(),yield this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),i=()=>M(this,null,function*(){F.stopMedia(),yield this.forceWrapperRemount(),this.handleCloseEvent()}),n=r=>M(this,null,function*(){nt==null||nt.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",yield J0(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 Q0{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 eu(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 tu=class pa extends Q0{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?eu(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 M(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=`
3847
3821
  :host {
3848
3822
  display: block;
3849
3823
  block-size: auto;
@@ -3974,9 +3948,9 @@ button:active {
3974
3948
  button:disabled {
3975
3949
  --button-color: var(--color-disabled);
3976
3950
  }
3977
- `;const s=document.createElement("div"),o=document.createElement("div");o.innerHTML=`
3951
+ `;const n=document.createElement("div"),r=document.createElement("div");r.innerHTML=`
3978
3952
  <p id="error" class="color-red | center"><p>
3979
- `;const c=document.createElement("div");c.setAttribute("id","controls"),c.setAttribute("part","signature-controls"),c.innerHTML=`
3953
+ `;const s=document.createElement("div");s.setAttribute("id","controls"),s.setAttribute("part","signature-controls"),s.innerHTML=`
3980
3954
  <button data-variant="icon" type="button" name="clear" id="clear">
3981
3955
  <span class="visually-hidden">
3982
3956
  Clear Signature
@@ -3985,7 +3959,7 @@ button:disabled {
3985
3959
  <path d="M3.314 15.646a8.004 8.004 0 01-2.217-4.257 8.06 8.06 0 01.545-4.655l1.789.788a6.062 6.062 0 001.264 6.737 6.033 6.033 0 008.551 0c2.358-2.37 2.358-6.224 0-8.592a5.996 5.996 0 00-4.405-1.782l.662 2.354-3.128-.796-3.127-.796 2.25-2.324L7.748 0l.55 1.953a7.966 7.966 0 016.33 2.326 8.004 8.004 0 012.342 5.684 8.005 8.005 0 01-2.343 5.683A7.928 7.928 0 018.97 18a7.928 7.928 0 01-5.656-2.354z" fill="currentColor" />
3986
3960
  </svg>
3987
3961
  </button>
3988
- `;const l=document.createElement("canvas"),f=this.parentElement.closest(":not([hidden])").querySelector(":not([hidden])").offsetWidth,m=30*getComputedStyle(document.documentElement).fontSize.split("px")[0],b=2;l.width=f<m?f:m,l.height=(f<m?f:m)/b,l.setAttribute("id","signature-canvas"),l.setAttribute("part","canvas");const E=document.createElement("div");E.setAttribute("id","signature-upload-wrapper"),E.innerHTML=`
3962
+ `;const o=document.createElement("canvas"),l=this.parentElement.closest(":not([hidden])").querySelector(":not([hidden])").offsetWidth,h=30*getComputedStyle(document.documentElement).fontSize.split("px")[0],u=2;o.width=l<h?l:h,o.height=(l<h?l:h)/u,o.setAttribute("id","signature-canvas"),o.setAttribute("part","canvas");const p=document.createElement("div");p.setAttribute("id","signature-upload-wrapper"),p.innerHTML=`
3989
3963
  <p part="upload">
3990
3964
  <strong>or</strong>
3991
3965
  <label>
@@ -4003,7 +3977,7 @@ button:disabled {
4003
3977
  <span>upload a signature</span>
4004
3978
  </label>
4005
3979
  </p>
4006
- `;const A=document.createElement("p");A.innerHTML=`
3980
+ `;const f=document.createElement("p");f.innerHTML=`
4007
3981
  <button data-variant="solid" type="button" name="publish" id="publish">
4008
3982
  <span>
4009
3983
  Continue
@@ -4024,8 +3998,8 @@ button:disabled {
4024
3998
  />
4025
3999
  </svg>
4026
4000
  </button>
4027
- `,s.appendChild(o),s.appendChild(c),s.appendChild(l),this.allowUpload&&s.appendChild(E),s.appendChild(A),e.appendChild(i),e.appendChild(s),this.core=new k6(l),this.errorMessage=o.querySelector("#error"),window&&(window.onresize=this.resizeCanvas()),this.clearSignatureButton=c.querySelector("#clear"),this.clearSignatureButton.addEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton=E.querySelector("#upload-signature"),this.uploadSignatureButton.addEventListener("change",k=>this.uploadSignature(k)),this.publishSignatureButton=A.querySelector("#publish"),this.publishSignatureButton.addEventListener("click",()=>this.publishSignature())}disconnectedCallback(){this.publishSignatureButton.removeEventListener("click",()=>this.publishSignature()),this.clearSignatureButton.removeEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton.removeEventListener("change",e=>this.uploadSignature(e))}resizeCanvas(){const e=this.shadowRoot.querySelector("canvas"),i=Math.max(window.devicePixelRatio||1,1);e.width=(e.offsetWidth||e.width)*i,e.height=(e.offsetHeight||e.height)*i,e.getContext("2d").scale(i,i),this.core.fromData(this.core.toData())}publishSignature(){try{this.resetErrorMessage();const e=this.shadowRoot.querySelector("img");let i=e?e.src:void 0;if(!i&&!this.core.isEmpty()&&(i=this.core.toDataURL("image/svg+xml")),i)this.dispatchEvent(new CustomEvent("signature-pad.publish",{detail:i}));else throw new Error(`No signature present. ${this.allowUpload?"Draw or upload":"Draw"} a signature`)}catch(e){this.handleError(e.message)}}resetErrorMessage(){this.errorMessage.textContent=""}handleError(e){this.errorMessage.textContent=e}clearSignature(){this.resetErrorMessage();const e=this.shadowRoot.querySelector("canvas"),i=this.shadowRoot.querySelector("img");i&&(i.remove(),e.removeAttribute("hidden")),this.core.clear()}previewUpload(e){const i=this.shadowRoot.querySelector("canvas");let s=this.shadowRoot.querySelector("img");s||(s=document.createElement("img")),s.src=e,s.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",s)}uploadSignature(e){return q(this,null,function*(){try{this.resetErrorMessage();const{files:i}=e.target,s=yield w1.retrieve(i);this.previewUpload(s)}catch(i){this.handleError(i.message)}})}get allowUpload(){return this.hasAttribute("allow-upload")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}"customElements"in window&&!window.customElements.get("smileid-signature-pad")&&window.customElements.define("smileid-signature-pad",Qd);function L6(){return`
4028
- ${Ai(this.themeColor)}
4001
+ `,n.appendChild(r),n.appendChild(s),n.appendChild(o),this.allowUpload&&n.appendChild(p),n.appendChild(f),t.appendChild(i),t.appendChild(n),this.core=new tu(o),this.errorMessage=r.querySelector("#error"),window&&(window.onresize=this.resizeCanvas()),this.clearSignatureButton=s.querySelector("#clear"),this.clearSignatureButton.addEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton=p.querySelector("#upload-signature"),this.uploadSignatureButton.addEventListener("change",m=>this.uploadSignature(m)),this.publishSignatureButton=f.querySelector("#publish"),this.publishSignatureButton.addEventListener("click",()=>this.publishSignature())}disconnectedCallback(){this.publishSignatureButton.removeEventListener("click",()=>this.publishSignature()),this.clearSignatureButton.removeEventListener("click",()=>this.clearSignature()),this.uploadSignatureButton.removeEventListener("change",t=>this.uploadSignature(t))}resizeCanvas(){const t=this.shadowRoot.querySelector("canvas"),i=Math.max(window.devicePixelRatio||1,1);t.width=(t.offsetWidth||t.width)*i,t.height=(t.offsetHeight||t.height)*i,t.getContext("2d").scale(i,i),this.core.fromData(this.core.toData())}publishSignature(){try{this.resetErrorMessage();const t=this.shadowRoot.querySelector("img");let i=t?t.src:void 0;if(!i&&!this.core.isEmpty()&&(i=this.core.toDataURL("image/svg+xml")),i)this.dispatchEvent(new CustomEvent("signature-pad.publish",{detail:i}));else throw new Error(`No signature present. ${this.allowUpload?"Draw or upload":"Draw"} a signature`)}catch(t){this.handleError(t.message)}}resetErrorMessage(){this.errorMessage.textContent=""}handleError(t){this.errorMessage.textContent=t}clearSignature(){this.resetErrorMessage();const t=this.shadowRoot.querySelector("canvas"),i=this.shadowRoot.querySelector("img");i&&(i.remove(),t.removeAttribute("hidden")),this.core.clear()}previewUpload(t){const i=this.shadowRoot.querySelector("canvas");let n=this.shadowRoot.querySelector("img");n||(n=document.createElement("img")),n.src=t,n.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",n)}uploadSignature(t){return M(this,null,function*(){try{this.resetErrorMessage();const{files:i}=t.target,n=yield na.retrieve(i);this.previewUpload(n)}catch(i){this.handleError(i.message)}})}get allowUpload(){return this.hasAttribute("allow-upload")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}"customElements"in window&&!window.customElements.get("smileid-signature-pad")&&window.customElements.define("smileid-signature-pad",j2);function iu(){return`
4002
+ ${st(this.themeColor)}
4029
4003
  <style>
4030
4004
  .camera-permission-screen {
4031
4005
  display: flex;
@@ -4099,14 +4073,14 @@ button:disabled {
4099
4073
  </div>
4100
4074
  </div>
4101
4075
  </div>
4102
- `}class M6 extends HTMLElement{connectedCallback(){this.templateString=L6.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners()}setUpEventListeners(){const e=this.shadowRoot.querySelector("#error"),i=this.shadowRoot.getElementById("request-camera-access");e.textContent="",i.addEventListener("click",()=>q(this,null,function*(){i.setAttribute("disabled",!0);try{yield et.getMedia({audio:!1,video:!0}),this.dispatchEvent(new CustomEvent("camera-permission.granted"))}catch(s){this.dispatchEvent(new CustomEvent("camera-permission.denied",{detail:s})),e.textContent=et.handleCameraError(s)}i.removeAttribute("disabled")}))}get showNavigation(){return this.hasAttribute("show-navigation")}get hideAttribution(){return this.hasAttribute("hide-attribution")}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}window.customElements&&!window.customElements.get("camera-permission")&&window.customElements.define("camera-permission",M6);const T6=xs.version;function I6(){return`
4076
+ `}class nu extends HTMLElement{connectedCallback(){this.templateString=iu.bind(this),this.render=()=>this.templateString(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners()}setUpEventListeners(){const t=this.shadowRoot.querySelector("#error"),i=this.shadowRoot.getElementById("request-camera-access");t.textContent="",i.addEventListener("click",()=>M(this,null,function*(){i.setAttribute("disabled",!0);try{yield F.getMedia({audio:!1,video:!0}),this.dispatchEvent(new CustomEvent("camera-permission.granted"))}catch(n){this.dispatchEvent(new CustomEvent("camera-permission.denied",{detail:n})),t.textContent=F.handleCameraError(n)}i.removeAttribute("disabled")}))}get showNavigation(){return this.hasAttribute("show-navigation")}get hideAttribution(){return this.hasAttribute("hide-attribution")}get hideBack(){return this.hasAttribute("hide-back")}get themeColor(){return this.getAttribute("theme-color")||"#001096"}}window.customElements&&!window.customElements.get("camera-permission")&&window.customElements.define("camera-permission",nu);const ru=Xi.version;function su(){return`
4103
4077
  <style>
4104
4078
  :host {
4105
4079
  display: block;
4106
4080
  height: 100%;
4107
4081
  }
4108
4082
  </style>
4109
- ${Ai(this.themeColor)}
4083
+ ${st(this.themeColor)}
4110
4084
  <div style="height: 100%;">
4111
4085
  <camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}></camera-permission>
4112
4086
  <selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
@@ -4115,5 +4089,5 @@ button:disabled {
4115
4089
  <document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
4116
4090
  ${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
4117
4091
  </div>
4118
- `}class t3 extends HTMLElement{constructor(){super(),this.scwTemplateString=I6.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:T6}},"mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices?this.setUpEventListeners():this.shadowRoot.innerHTML='<h1 class="error-message">Your browser does not support this integration</h1>'}disconnectedCallback(){et.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.shadowRoot.innerHTML=""}static get observedAttributes(){return["allow-agent-mode","disable-image-tests","document-capture-modes","document-type","hide-attribution","hide-back-of-id","hide-back-to-host","show-navigation","theme-color"]}attributeChangedCallback(e){switch(e){case"allow-agent-mode":case"disable-image-tests":case"document-capture-modes":case"document-type":case"hide-attribution":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":case"theme-color":this.disconnectedCallback(),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.cameraPermission=this.shadowRoot.querySelector("camera-permission"),this.SelfieCaptureScreens=this.shadowRoot.querySelector("selfie-capture-screens"),this.documentCapture=this.shadowRoot.querySelector("document-capture-screens"),this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.setActiveScreen(this.SelfieCaptureScreens),this.cameraPermission.addEventListener("camera-permission.granted",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.publish",e=>{this._data.images=e.detail.images,this.captureId?this.setActiveScreen(this.documentCapture):this._publishSelectedImages()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.cancelled",()=>{this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.handleBackEvents()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.back",()=>{this.hideInstructions||this.setActiveScreen(this.cameraPermission)}),this.documentCapture.addEventListener("document-capture-screens.publish",e=>{this._data.images=[...this._data.images,...e.detail.images],this._publishSelectedImages()}),this.documentCapture.addEventListener("document-capture-screens.cancelled",()=>{this.SelfieCaptureScreens.setAttribute("initial-screen","selfie-capture"),this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),[this.cameraPermission,this.SelfieCaptureScreens,this.documentCapture].forEach(e=>{e.addEventListener(`${e.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvent())}),this.documentCapture.addEventListener("document-capture-screens.back",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.reset()})}reset(){this.disconnectedCallback(),this.connectedCallback()}handleBackEvents(){this.dispatchEvent(new CustomEvent("smart-camera-web.cancelled"))}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("smart-camera-web.publish",{detail:this._data}))}get captureId(){return this.hasAttribute("capture-id")}get documentType(){return this.getAttribute("document-type")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get hideInstructions(){return this.hasAttribute("hide-instructions")?"hide-instructions":""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")?"hide-back-of-id":""}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get hideBackToHost(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?"hide-back":""}get allowAgentMode(){return this.hasAttribute("allow-agent-mode")?`allow-agent-mode=${this.getAttribute("allow-agent-mode")}`:""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?"show-agent-mode-for-tests":""}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 disableImageTests(){return this.hasAttribute("disable-image-tests")?"disable-image-tests":""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get hasThemeColor(){return this.hasAttribute("theme-color")&&![null,void 0,"null","undefined"].includes(this.getAttribute("theme-color"))}get themeColor(){return this.hasThemeColor?this.getAttribute("theme-color"):"#001096"}get applyComponentThemeColor(){return this.hasThemeColor?`theme-color='${this.themeColor}'`:""}setActiveScreen(e){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e}handleCloseEvent(){this.dispatchEvent(new CustomEvent("smart-camera-web.close"))}}return"customElements"in window&&!customElements.get("smart-camera-web")&&customElements.define("smart-camera-web",t3),ht.DocumentCaptureScreens=Wu,ht.EndUserConsent=ju,ht.List=Vu,ht.Navigation=zu,ht.Option=Gu,ht.Root=Er,ht.SelfieCaptureScreens=Jd,ht.SignaturePad=Qd,ht.SmartCameraWeb=t3,ht.TotpConsent=qu,ht.Trigger=Hu,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"}),ht}({});
4092
+ `}class G2 extends HTMLElement{constructor(){super(),this.scwTemplateString=su.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:ru}},"mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices?this.setUpEventListeners():this.shadowRoot.innerHTML='<h1 class="error-message">Your browser does not support this integration</h1>'}disconnectedCallback(){F.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.shadowRoot.innerHTML=""}static get observedAttributes(){return["allow-agent-mode","disable-image-tests","document-capture-modes","document-type","hide-attribution","hide-back-of-id","hide-back-to-host","show-navigation","theme-color"]}attributeChangedCallback(t){switch(t){case"allow-agent-mode":case"disable-image-tests":case"document-capture-modes":case"document-type":case"hide-attribution":case"hide-back-of-id":case"hide-back-to-host":case"show-navigation":case"theme-color":this.disconnectedCallback(),this.shadowRoot.innerHTML=this.render(),this.setUpEventListeners();break}}setUpEventListeners(){this.cameraPermission=this.shadowRoot.querySelector("camera-permission"),this.SelfieCaptureScreens=this.shadowRoot.querySelector("selfie-capture-screens"),this.documentCapture=this.shadowRoot.querySelector("document-capture-screens"),this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.setActiveScreen(this.SelfieCaptureScreens),this.cameraPermission.addEventListener("camera-permission.granted",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.publish",t=>{this._data.images=t.detail.images,this.captureId?this.setActiveScreen(this.documentCapture):this._publishSelectedImages()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.cancelled",()=>{this.hideInstructions?this.setActiveScreen(this.cameraPermission):this.handleBackEvents()}),this.SelfieCaptureScreens.addEventListener("selfie-capture-screens.back",()=>{this.hideInstructions||this.setActiveScreen(this.cameraPermission)}),this.documentCapture.addEventListener("document-capture-screens.publish",t=>{this._data.images=[...this._data.images,...t.detail.images],this._publishSelectedImages()}),this.documentCapture.addEventListener("document-capture-screens.cancelled",()=>{this.SelfieCaptureScreens.setAttribute("initial-screen","selfie-capture"),this.setActiveScreen(this.SelfieCaptureScreens),this.SelfieCaptureScreens.removeAttribute("data-camera-error"),this.SelfieCaptureScreens.setAttribute("data-camera-ready",!0)}),[this.cameraPermission,this.SelfieCaptureScreens,this.documentCapture].forEach(t=>{t.addEventListener(`${t.nodeName.toLowerCase()}.close`,()=>this.handleCloseEvent())}),this.documentCapture.addEventListener("document-capture-screens.back",()=>{this.setActiveScreen(this.SelfieCaptureScreens),this.reset()})}reset(){this.disconnectedCallback(),this.connectedCallback()}handleBackEvents(){this.dispatchEvent(new CustomEvent("smart-camera-web.cancelled"))}_publishSelectedImages(){this.dispatchEvent(new CustomEvent("smart-camera-web.publish",{detail:this._data}))}get captureId(){return this.hasAttribute("capture-id")}get documentType(){return this.getAttribute("document-type")}get isPortraitCaptureView(){return this.getAttribute("document-type")==="GREEN_BOOK"}get hideInstructions(){return this.hasAttribute("hide-instructions")?"hide-instructions":""}get hideBackOfId(){return this.hasAttribute("hide-back-of-id")?"hide-back-of-id":""}get showNavigation(){return this.hasAttribute("show-navigation")?"show-navigation":""}get hideBackToHost(){return this.hasAttribute("hide-back-to-host")||this.hasAttribute("hide-back")?"hide-back":""}get allowAgentMode(){return this.hasAttribute("allow-agent-mode")?`allow-agent-mode=${this.getAttribute("allow-agent-mode")}`:""}get allowAgentModeTests(){return this.hasAttribute("show-agent-mode-for-tests")?"show-agent-mode-for-tests":""}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 disableImageTests(){return this.hasAttribute("disable-image-tests")?"disable-image-tests":""}get hideAttribution(){return this.hasAttribute("hide-attribution")?"hide-attribution":""}get hasThemeColor(){return this.hasAttribute("theme-color")&&![null,void 0,"null","undefined"].includes(this.getAttribute("theme-color"))}get themeColor(){return this.hasThemeColor?this.getAttribute("theme-color"):"#001096"}get applyComponentThemeColor(){return this.hasThemeColor?`theme-color='${this.themeColor}'`:""}setActiveScreen(t){var i;(i=this.activeScreen)==null||i.setAttribute("hidden",""),t.removeAttribute("hidden"),this.activeScreen=t}handleCloseEvent(){this.dispatchEvent(new CustomEvent("smart-camera-web.close"))}}return"customElements"in window&&!customElements.get("smart-camera-web")&&customElements.define("smart-camera-web",G2),P.DocumentCaptureScreens=ba,P.EndUserConsent=Ca,P.List=ma,P.Navigation=va,P.Option=ga,P.Root=hi,P.SelfieCaptureScreens=V2,P.SignaturePad=j2,P.SmartCameraWeb=G2,P.TotpConsent=_a,P.Trigger=fa,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),P}({});
4119
4093
  //# sourceMappingURL=smart-camera-web.js.map