@smileid/web-components 2.0.2 → 10.0.2

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 (127) hide show
  1. package/dist/esm/DocumentCaptureScreens-ChpBVvNE.js +1532 -0
  2. package/dist/esm/DocumentCaptureScreens-ChpBVvNE.js.map +1 -0
  3. package/dist/esm/EndUserConsent-CMHp-34-.js +715 -0
  4. package/dist/esm/EndUserConsent-CMHp-34-.js.map +1 -0
  5. package/dist/esm/Navigation-juBE4qOw.js +136 -0
  6. package/dist/esm/Navigation-juBE4qOw.js.map +1 -0
  7. package/dist/esm/PoweredBySmileId-CxbaihMu.js +33 -0
  8. package/dist/esm/PoweredBySmileId-CxbaihMu.js.map +1 -0
  9. package/dist/esm/SelfieCaptureScreens-DMo-z-32.js +7618 -0
  10. package/dist/esm/SelfieCaptureScreens-DMo-z-32.js.map +1 -0
  11. package/dist/esm/SignaturePad-C7MtmT8m.js +324 -0
  12. package/dist/esm/SignaturePad-C7MtmT8m.js.map +1 -0
  13. package/dist/esm/TotpConsent-CQU5jQi4.js +730 -0
  14. package/dist/esm/TotpConsent-CQU5jQi4.js.map +1 -0
  15. package/dist/esm/combobox.js +300 -0
  16. package/dist/esm/combobox.js.map +1 -0
  17. package/dist/esm/document.js +5 -0
  18. package/dist/esm/document.js.map +1 -0
  19. package/dist/esm/end-user-consent.js +5 -0
  20. package/dist/esm/end-user-consent.js.map +1 -0
  21. package/dist/esm/main.js +22 -0
  22. package/dist/esm/main.js.map +1 -0
  23. package/dist/esm/navigation.js +5 -0
  24. package/dist/esm/navigation.js.map +1 -0
  25. package/dist/esm/package-D_4zJ9ck.js +105 -0
  26. package/dist/esm/package-D_4zJ9ck.js.map +1 -0
  27. package/dist/esm/selfie.js +5 -0
  28. package/dist/esm/selfie.js.map +1 -0
  29. package/dist/esm/signature-pad.js +5 -0
  30. package/dist/esm/signature-pad.js.map +1 -0
  31. package/dist/esm/smart-camera-web.js +302 -0
  32. package/dist/esm/smart-camera-web.js.map +1 -0
  33. package/dist/esm/styles-D2i3GFLK.js +405 -0
  34. package/dist/esm/styles-D2i3GFLK.js.map +1 -0
  35. package/dist/esm/totp-consent.js +5 -0
  36. package/dist/esm/totp-consent.js.map +1 -0
  37. package/dist/smart-camera-web.js +4130 -0
  38. package/dist/smart-camera-web.js.map +1 -0
  39. package/dist/types/combobox.d.ts +21 -0
  40. package/dist/types/document.d.ts +21 -0
  41. package/dist/types/end-user-consent.d.ts +21 -0
  42. package/dist/types/main.d.ts +331 -0
  43. package/dist/types/navigation.d.ts +21 -0
  44. package/dist/types/selfie.d.ts +21 -0
  45. package/dist/types/signature-pad.d.ts +21 -0
  46. package/dist/types/smart-camera-web.d.ts +21 -0
  47. package/dist/types/totp-consent.d.ts +21 -0
  48. package/{src → lib}/components/camera-permission/CameraPermission.js +0 -1
  49. package/{src → lib}/components/document/src/document-capture/DocumentCapture.js +0 -1
  50. package/{src → lib}/components/document/src/document-capture-review/DocumentCaptureReview.js +0 -1
  51. package/{src → lib}/components/selfie/src/SelfieCaptureScreens.js +188 -37
  52. package/{src → lib}/components/selfie/src/index.js +0 -2
  53. package/{src → lib}/components/selfie/src/selfie-capture/SelfieCapture.js +3 -4
  54. package/{src → lib}/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +0 -1
  55. package/{src → lib}/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +0 -8
  56. package/lib/components/selfie/src/selfie-capture-wrapper/SelfieCaptureWrapper.tsx +226 -0
  57. package/lib/components/selfie/src/selfie-capture-wrapper/index.ts +1 -0
  58. package/lib/components/selfie/src/smartselfie-capture/OvalProgress.tsx +81 -0
  59. package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.tsx +223 -0
  60. package/lib/components/selfie/src/smartselfie-capture/components/AlertDisplay.tsx +34 -0
  61. package/lib/components/selfie/src/smartselfie-capture/components/CameraPreview.tsx +97 -0
  62. package/lib/components/selfie/src/smartselfie-capture/components/CaptureControls.tsx +74 -0
  63. package/lib/components/selfie/src/smartselfie-capture/components/index.ts +3 -0
  64. package/lib/components/selfie/src/smartselfie-capture/constants.ts +23 -0
  65. package/lib/components/selfie/src/smartselfie-capture/hooks/index.ts +2 -0
  66. package/lib/components/selfie/src/smartselfie-capture/hooks/useCamera.ts +94 -0
  67. package/lib/components/selfie/src/smartselfie-capture/hooks/useFaceCapture.ts +558 -0
  68. package/lib/components/selfie/src/smartselfie-capture/index.ts +1 -0
  69. package/lib/components/selfie/src/smartselfie-capture/utils/alertMessages.ts +12 -0
  70. package/lib/components/selfie/src/smartselfie-capture/utils/canvas.ts +105 -0
  71. package/lib/components/selfie/src/smartselfie-capture/utils/faceDetection.ts +129 -0
  72. package/lib/components/selfie/src/smartselfie-capture/utils/imageCapture.ts +65 -0
  73. package/lib/components/selfie/src/smartselfie-capture/utils/index.ts +4 -0
  74. package/lib/components/selfie/src/smartselfie-capture/utils/mediapipeManager.ts +60 -0
  75. package/{src → lib}/components/signature-pad/package.json +1 -1
  76. package/{src → lib}/components/smart-camera-web/src/README.md +0 -1
  77. package/{src → lib}/styles/src/styles.js +0 -1
  78. package/package.json +76 -24
  79. package/src/index.js +0 -5
  80. /package/{src → lib}/components/README.md +0 -0
  81. /package/{src → lib}/components/attribution/PoweredBySmileId.js +0 -0
  82. /package/{src → lib}/components/camera-permission/CameraPermission.stories.js +0 -0
  83. /package/{src → lib}/components/combobox/src/Combobox.js +0 -0
  84. /package/{src → lib}/components/combobox/src/index.js +0 -0
  85. /package/{src → lib}/components/document/src/DocumentCaptureScreens.js +0 -0
  86. /package/{src → lib}/components/document/src/DocumentCaptureScreens.stories.js +0 -0
  87. /package/{src → lib}/components/document/src/README.md +0 -0
  88. /package/{src → lib}/components/document/src/document-capture/DocumentCapture.stories.js +0 -0
  89. /package/{src → lib}/components/document/src/document-capture/README.md +0 -0
  90. /package/{src → lib}/components/document/src/document-capture/index.js +0 -0
  91. /package/{src → lib}/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +0 -0
  92. /package/{src → lib}/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +0 -0
  93. /package/{src → lib}/components/document/src/document-capture-instructions/README.md +0 -0
  94. /package/{src → lib}/components/document/src/document-capture-instructions/index.js +0 -0
  95. /package/{src → lib}/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +0 -0
  96. /package/{src → lib}/components/document/src/document-capture-review/README.md +0 -0
  97. /package/{src → lib}/components/document/src/document-capture-review/index.js +0 -0
  98. /package/{src → lib}/components/document/src/index.js +0 -0
  99. /package/{src → lib}/components/end-user-consent/src/EndUserConsent.js +0 -0
  100. /package/{src → lib}/components/end-user-consent/src/EndUserConsent.stories.js +0 -0
  101. /package/{src → lib}/components/end-user-consent/src/index.js +0 -0
  102. /package/{src → lib}/components/navigation/src/Navigation.js +0 -0
  103. /package/{src → lib}/components/navigation/src/Navigation.stories.js +0 -0
  104. /package/{src → lib}/components/navigation/src/index.js +0 -0
  105. /package/{src → lib}/components/selfie/README.md +0 -0
  106. /package/{src → lib}/components/selfie/src/SelfieCaptureScreens.stories.js +0 -0
  107. /package/{src → lib}/components/selfie/src/selfie-capture/SelfieCapture.stories.js +0 -0
  108. /package/{src → lib}/components/selfie/src/selfie-capture/index.js +0 -0
  109. /package/{src → lib}/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +0 -0
  110. /package/{src → lib}/components/selfie/src/selfie-capture-instructions/index.js +0 -0
  111. /package/{src → lib}/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +0 -0
  112. /package/{src → lib}/components/selfie/src/selfie-capture-review/index.js +0 -0
  113. /package/{src → lib}/components/signature-pad/package-lock.json +0 -0
  114. /package/{src → lib}/components/signature-pad/src/SignaturePad.js +0 -0
  115. /package/{src → lib}/components/signature-pad/src/SignaturePad.stories.js +0 -0
  116. /package/{src → lib}/components/signature-pad/src/index.js +0 -0
  117. /package/{src → lib}/components/smart-camera-web/src/SmartCameraWeb.js +0 -0
  118. /package/{src → lib}/components/smart-camera-web/src/SmartCameraWeb.stories.js +0 -0
  119. /package/{src → lib}/components/totp-consent/src/TotpConsent.js +0 -0
  120. /package/{src → lib}/components/totp-consent/src/index.js +0 -0
  121. /package/{src → lib}/domain/camera/src/README.md +0 -0
  122. /package/{src → lib}/domain/camera/src/SmartCamera.js +0 -0
  123. /package/{src → lib}/domain/constants/src/Constants.js +0 -0
  124. /package/{src → lib}/domain/file-upload/README.md +0 -0
  125. /package/{src → lib}/domain/file-upload/src/SmartFileUpload.js +0 -0
  126. /package/{src → lib}/styles/README.md +0 -0
  127. /package/{src → lib}/styles/src/typography.js +0 -0
@@ -0,0 +1,4130 @@
1
+ var SmartCameraWeb=function(St){"use strict";function Ao(t){const e=[...Array(30)].map(()=>Math.random().toString(36)[3]).join("");return`${t}-${e}`}function Z2(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 W2(t){return t&&t.clientHeight<t.scrollHeight}function q2(t,e){const{offsetHeight:i,offsetTop:n}=t,{offsetHeight:r,scrollTop:s}=e,o=n<s,a=n+i>s+r;o?e.scrollTo(0,n):a&&e.scrollTo(0,n-r+i)}class X2 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 Y2 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
+ <div>
3
+ <input ${this.value?`value="${this.value}" `:""}${this.disabled?" disabled ":""}type="text" placeholder="${this.label}" />
4
+ <button ${this.disabled?"disabled ":""}tabindex='-1' type='button'>
5
+ <span class="visually-hidden">Toggle</span>
6
+ </button>
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 n=this.buttonTrigger.getAttribute("aria-activedescendant");n&&document.getElementById(n).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,n=r=>r.length===1&&r.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:""})))),(n(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 K2 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
+ <p id='empty-state' style="text-align: center;">
10
+ ${this.emptyLabel||"No items"}
11
+ </p>
12
+ `}connectedCallback(){this.setAttribute("role","listbox"),this.setAttribute("id",Ao("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,n){switch(e){case"search-term":i&&!n?this.optionNodes.forEach(r=>{r.removeAttribute("hidden")}):n&&this.filterNodes(n);break}}filterNodes(e){this.optionNodes.forEach(r=>{const s=r.getAttribute("value").toLowerCase(),o=r.getAttribute("label").toLowerCase();s.includes(e.toLowerCase())||o.includes(e.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(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(n=>n.tagName==="INPUT")[0]&&this.setAttribute("search-term",e.detail.label)}setSelected(e){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(e){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(e,i){e.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.selectedNode=i,W2(this)&&q2(this.selectedNode,this),Z2(i)||i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.triggers.forEach(n=>n.setAttribute("aria-activedescendant",i.id))}}class J2 extends HTMLElement{connectedCallback(){this.setAttribute("role","option"),this.setAttribute("tabindex","-1"),this.setAttribute("id",Ao("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 So=X2,Lo=Y2,Mo=K2,To=J2;"customElements"in window&&!window.customElements.get("smileid-combobox")&&(window.customElements.define("smileid-combobox",So),window.customElements.define("smileid-combobox-trigger",Lo),window.customElements.define("smileid-combobox-listbox",Mo),window.customElements.define("smileid-combobox-option",To));const Je={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
+ .text-xs {
14
+ font-size: 0.75rem;
15
+ line-height: 1rem;
16
+ }
17
+ .text-sm {
18
+ font-size: 0.875rem;
19
+ line-height: 1.125rem;
20
+ }
21
+ .text-base {
22
+ font-size: 1rem;
23
+ line-height: 1rem;
24
+ }
25
+ .text-lg {
26
+ font-size: 1.125rem;
27
+ line-height: 1.75rem;
28
+ }
29
+ .text-xl {
30
+ font-size: 1.25rem;
31
+ line-height: 1.75rem;
32
+ }
33
+ .text-2xl {
34
+ font-size: 1.5rem;
35
+ line-height: 2rem;
36
+ }
37
+ .text-3xl {
38
+ font-size: 1.875rem;
39
+ line-height: 2.25rem;
40
+ }
41
+ .text-4xl {
42
+ font-size: 2rem;
43
+ line-height: 2.5rem;
44
+ }
45
+ .text-5xl {
46
+ font-size: 2.25rem;
47
+ line-height: 2.5rem;
48
+ }
49
+ .font-bold {
50
+ font-weight: 700;
51
+ }
52
+ .font-semibold {
53
+ font-weight: 600;
54
+ }
55
+ .font-medium {
56
+ font-weight: 500;
57
+ }
58
+ .font-normal {
59
+ font-weight: 400;
60
+ }
61
+ `,qt=t=>`<link rel="preconnect" href="https://fonts.gstatic.com" />
62
+ <link
63
+ href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"
64
+ rel="stylesheet"
65
+ as="style"
66
+ />
67
+ <style>
68
+ ${Q2}
69
+ :host {
70
+ --theme-color: ${t||"#001096"};
71
+ --color-active: #001096;
72
+ --color-default: #2d2b2a;
73
+ --color-disabled: #848282;
74
+ --web-digital-blue: #001096;
75
+ }
76
+
77
+ * {
78
+ font-family: "DM Sans", sans-serif;
79
+ }
80
+
81
+ [hidden] {
82
+ display: none !important;
83
+ }
84
+
85
+ [disabled] {
86
+ cursor: not-allowed !important;
87
+ filter: grayscale(75%);
88
+ }
89
+
90
+ .visually-hidden {
91
+ border: 0;
92
+ clip: rect(1px 1px 1px 1px);
93
+ clip: rect(1px, 1px, 1px, 1px);
94
+ height: auto;
95
+ margin: 0;
96
+ overflow: hidden;
97
+ padding: 0;
98
+ position: absolute;
99
+ white-space: nowrap;
100
+ width: 1px;
101
+ }
102
+
103
+ img {
104
+ height: auto;
105
+ max-width: 100%;
106
+ }
107
+
108
+ video {
109
+ background-color: black;
110
+ }
111
+
112
+ a {
113
+ color: currentColor;
114
+ text-decoration: none;
115
+ }
116
+
117
+ svg {
118
+ max-width: 100%;
119
+ }
120
+
121
+ .color-gray {
122
+ color: #797979;
123
+ }
124
+
125
+ .color-red {
126
+ color: red;
127
+ }
128
+
129
+ .color-richblue {
130
+ color: #4e6577;
131
+ }
132
+
133
+ .color-richblue-shade {
134
+ color: #0e1b42;
135
+ }
136
+
137
+ .color-digital-blue {
138
+ color: var(--web-digital-blue) !important;
139
+ }
140
+
141
+ .color-deep-blue {
142
+ color: #001096;
143
+ }
144
+
145
+ .title-color {
146
+ color: ${t||"#001096"};
147
+ }
148
+
149
+ .theme-color {
150
+ color: ${t||"#001096"};
151
+ }
152
+
153
+ .center {
154
+ text-align: center;
155
+ margin-left: auto;
156
+ margin-right: auto;
157
+ }
158
+
159
+ .font-size-small {
160
+ font-size: 0.75rem;
161
+ }
162
+
163
+ .font-size-large {
164
+ font-size: 1.5rem;
165
+ }
166
+
167
+ .text-transform-uppercase {
168
+ text-transform: uppercase;
169
+ }
170
+
171
+ [id*=-"screen"] {
172
+ min-block-size: 100%;
173
+ }
174
+
175
+ [data-variant~="full-width"] {
176
+ inline-size: 100%;
177
+ }
178
+
179
+ .flow > * + * {
180
+ margin-top: var(--flow-space, 1rem);
181
+ }
182
+
183
+ .button {
184
+ --button-color: ${t||"var(--active-color)"};
185
+ -webkit-appearance: none;
186
+ appearance: none;
187
+ border-radius: 2.5rem;
188
+ border: 0;
189
+ background-color: transparent;
190
+ color: #fff;
191
+ cursor: pointer;
192
+ display: block;
193
+ font-size: 18px;
194
+ font-weight: 600;
195
+ padding: 0.75rem 1.5rem;
196
+ text-align: center;
197
+ }
198
+
199
+ .button:hover,
200
+ .button:focus,
201
+ .button:active {
202
+ --button-color: var(--color-default);
203
+ }
204
+
205
+ .button:disabled {
206
+ --button-color: var(--color-disabled);
207
+ }
208
+
209
+ .button[data-variant~="solid"] {
210
+ background-color: var(--button-color);
211
+ border: 2px solid var(--button-color);
212
+ }
213
+
214
+ .button[data-variant~="outline"] {
215
+ color: var(--button-color);
216
+ border: 2px solid var(--button-color);
217
+ }
218
+
219
+ .button[data-variant~="ghost"] {
220
+ padding: 0px;
221
+ color: var(--button-color);
222
+ background-color: transparent;
223
+ }
224
+
225
+ .icon-btn {
226
+ appearance: none;
227
+ background: none;
228
+ border: none;
229
+ color: hsl(0deg 0% 94%);
230
+ cursor: pointer;
231
+ display: flex;
232
+ align-items: center;
233
+ justify-content: center;
234
+ padding: 4px 8px;
235
+ }
236
+ .justify-right {
237
+ justify-content: end !important;
238
+ }
239
+ .nav {
240
+ display: flex;
241
+ justify-content: space-between;
242
+ }
243
+
244
+ .back-wrapper {
245
+ display: flex;
246
+ align-items: center;
247
+ }
248
+
249
+ .back-button-text {
250
+ font-size: 11px;
251
+ line-height: 11px;
252
+ color: rgb(21, 31, 114);
253
+ }
254
+
255
+
256
+ .selfie-capture-review-image {
257
+ overflow: hidden;
258
+ aspect-ratio: 1/1;
259
+ }
260
+
261
+ #review-image {
262
+ scale: 1.75;
263
+ }
264
+
265
+ @media (max-aspect-ratio: 1/1) {
266
+ #review-image {
267
+ transform: scaleX(-1) translateY(-10%);
268
+ }
269
+ }
270
+
271
+ .tips,
272
+ .powered-by {
273
+ align-items: center;
274
+ border-radius: 0.25rem;
275
+ color: #4e6577;
276
+ display: flex;
277
+ justify-content: center;
278
+ letter-spacing: 0.075em;
279
+ }
280
+
281
+ .powered-by {
282
+ box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
283
+ display: inline-flex;
284
+ font-size: 0.5rem;
285
+ }
286
+
287
+ .tips {
288
+ margin-left: auto;
289
+ margin-right: auto;
290
+ max-width: 17rem;
291
+ }
292
+
293
+ .tips > * + *,
294
+ .powered-by > * + * {
295
+ display: inline-block;
296
+ margin-left: 0.5em;
297
+ }
298
+
299
+ .powered-by .company {
300
+ color: #18406d;
301
+ font-weight: 700;
302
+ letter-spacing: 0.15rem;
303
+ }
304
+
305
+ .logo-mark {
306
+ background-color: #004071;
307
+ display: inline-block;
308
+ padding: 0.25em 0.5em;
309
+ }
310
+
311
+ .logo-mark svg {
312
+ height: auto;
313
+ justify-self: center;
314
+ width: 0.75em;
315
+ }
316
+
317
+ #document-capture-instructions-screen,
318
+ #back-of-document-capture-instructions-screen {
319
+ display: flex;
320
+ flex-direction: column;
321
+ max-block-size: 100%;
322
+ max-inline-size: 40ch;
323
+ justify-content: space-between;
324
+ }
325
+
326
+ #document-capture-instructions-screen header p {
327
+ margin-block: 0 !important;
328
+ }
329
+
330
+ .description {
331
+ color: var(--neutral-off-black, #2D2B2A);
332
+ text-align: center;
333
+
334
+ /* p */
335
+ font-family: DM Sans;
336
+ font-size: 0.875rem;
337
+ font-style: normal;
338
+ font-weight: 400;
339
+ line-height: 18px;
340
+ }
341
+
342
+ .padding-bottom-2 {
343
+ padding-bottom: 2rem;
344
+ }
345
+
346
+ .instructions-wrapper {
347
+ display: inline-flex;
348
+ flex-direction: column;
349
+ gap: 1.5rem;
350
+ margin-block-start: 2rem;
351
+ margin-block-end: 2rem;
352
+ }
353
+ .instructions {
354
+ display: flex;
355
+ align-items: center;
356
+ text-align: initial;
357
+ }
358
+
359
+ .instructions svg {
360
+ flex-shrink: 0;
361
+ margin-inline-end: 2rem;
362
+ }
363
+
364
+ .instructions p {
365
+ margin-block: 0;
366
+ }
367
+
368
+ .instruction {
369
+ display: flex;
370
+ flex-direction: column;
371
+ gap: 0.5rem;
372
+ }
373
+
374
+ .instruction-body {
375
+ font-size: 0.75rem;
376
+ }
377
+
378
+ .instruction-header {
379
+ color: ${t};
380
+ }
381
+
382
+ .flex-column {
383
+ display: flex;
384
+ flex-direction: column;
385
+ }
386
+
387
+ @keyframes spin {
388
+ 0% {
389
+ transform: translate3d(-50%, -50%, 0) rotate(0deg);
390
+ }
391
+ 100% {
392
+ transform: translate3d(-50%, -50%, 0) rotate(360deg);
393
+ }
394
+ }
395
+
396
+ .spinner {
397
+ animation: 1.5s linear infinite spin;
398
+ animation-play-state: inherit;
399
+ border: solid 5px #cfd0d1;
400
+ border-bottom-color: var(--color-active);
401
+ border-radius: 50%;
402
+ content: "";
403
+ display: block;
404
+ height: 25px;
405
+ width: 25px;
406
+ will-change: transform;
407
+ position: relative;
408
+ top: .675rem;
409
+ left: 1.25rem;
410
+ }
411
+
412
+ </style>`;class A{static stream=null;static async getMedia(e){return A.stream=await navigator.mediaDevices.getUserMedia(e),A.stream}static environmentOptions={facingMode:"environment",height:{ideal:1080,max:1440,min:720},width:{ideal:1920,max:2560,min:1280},zoom:A.isSamsungMultiCameraDevice()?2:1};static stopMedia(){A.stream&&(A.stream.getTracks().forEach(e=>e.stop()),A.stream=null)}static async supportsAgentMode(){try{const i=(await 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(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`
413
+ Looks like camera access was not granted, or was blocked by a browser
414
+ level setting / extension. Please follow the prompt from the URL bar,
415
+ or extensions, and enable access.
416
+ You may need to refresh to start all over again
417
+ `;case"AbortError":return`
418
+ Oops! Something happened, and we lost access to your stream.
419
+ Please refresh to start all over again
420
+ `;case"NotReadableError":return`
421
+ There seems to be a problem with your device's camera, or its connection.
422
+ Please check this, and when resolved, try again. Or try another device.
423
+ `;case"NotFoundError":return`
424
+ We are unable to find a video stream.
425
+ You may need to refresh to start all over again
426
+ `;case"TypeError":return`
427
+ This site is insecure, and as such cannot have access to your camera.
428
+ Try to navigate to a secure version of this page, or contact the owner.
429
+ `;default:return e.message}}}class Io extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
430
+ :host {
431
+ display: flex;
432
+ max-inline-size: 100%;
433
+ justify-content: ${this.showBackButton?"space-between":"flex-end"};
434
+ }
435
+
436
+ button {
437
+ --button-color: var(--color-default);
438
+ --flow-space: 3rem;
439
+ -webkit-appearance: none;
440
+ -moz-appearance: none;
441
+ align-items: center;
442
+ appearance: none;
443
+ background-color: transparent;
444
+ border-radius: 2.5rem;
445
+ border: none;
446
+ color: #ffffff;
447
+ cursor: pointer;
448
+ display: inline-flex;
449
+ font-size: 20px;
450
+ font-weight: 500;
451
+ inline-size: 100%;
452
+ justify-content: center;
453
+ letter-spacing: 0.05ch;
454
+ line-height: 1;
455
+ padding: 1rem 2.5rem;
456
+ text-align: center;
457
+ text-decoration: none;
458
+ }
459
+
460
+ button[data-type="icon"] {
461
+ align-items: center;
462
+ background-color: transparent;
463
+ border: 0;
464
+ cursor: pointer;
465
+ display: flex;
466
+ padding: 0;
467
+ width: auto;
468
+ }
469
+
470
+ :host::part(back-button) {
471
+ display: flex;
472
+ align-items: center;
473
+ }
474
+
475
+ :host::part(back-button-text) {
476
+ line-height: 1;
477
+ color: ${this.hasThemeColor?this.themeColor:"rgb(21, 31, 114)"} !important;
478
+ }
479
+
480
+ :host::part(close-button) {
481
+ }
482
+
483
+ .visually-hidden {
484
+ clip: rect(0 0 0 0);
485
+ clip-path: inset(50%);
486
+ block-size: 1px;
487
+ overflow: hidden;
488
+ position: absolute;
489
+ white-space: nowrap;
490
+ inline-size: 1px;
491
+ }
492
+ `;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=`
493
+ <svg
494
+ xmlns="http://www.w3.org/2000/svg"
495
+ width="40"
496
+ height="40"
497
+ viewBox="0 0 24 24"
498
+ fill="none"
499
+ >
500
+ <path
501
+ fill="#DBDBC4"
502
+ d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"
503
+ opacity=".4"
504
+ />
505
+ <path
506
+ fill="${this.themeColor}"
507
+ d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"
508
+ />
509
+ </svg>
510
+ <span part="back-button-text">Back</span>
511
+ `;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=`
512
+ <svg
513
+ xmlns="http://www.w3.org/2000/svg"
514
+ viewBox="0 0 24 24"
515
+ width="40"
516
+ height="40"
517
+ fill="none"
518
+ >
519
+ <path
520
+ fill="#DBDBC4"
521
+ d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"
522
+ opacity=".4"
523
+ />
524
+ <path
525
+ fill="#91190F"
526
+ d="m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"
527
+ />
528
+ </svg>
529
+ <span class="visually-hidden"
530
+ >Close SmileIdentity Verification frame</span
531
+ >
532
+ `,e.appendChild(i),this.showBackButton&&e.appendChild(n),e.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(){return this.getAttribute("theme-color")?.trim()}}"customElements"in window&&!window.customElements.get("smileid-navigation")&&window.customElements.define("smileid-navigation",Io);function tl(t,e=16){const i=new Set;for(let n=0;n<Math.min(t.length,1e4);n+=4)if(i.add(t[n]<<16|t[n+1]<<8|t[n+2]),i.size>e)return!0;return!1}function el(){return`
533
+ <style>
534
+ .visually-hidden {
535
+ border: 0;
536
+ clip: rect(1px 1px 1px 1px);
537
+ clip: rect(1px, 1px, 1px, 1px);
538
+ height: auto;
539
+ margin: 0;
540
+ overflow: hidden;
541
+ padding: 0;
542
+ position: absolute;
543
+ white-space: nowrap;
544
+ width: 1px;
545
+ }
546
+
547
+ .mobile-camera-screen video {
548
+ display: block;
549
+ object-fit: cover;
550
+ object-position: center;
551
+ width: 100%;
552
+ }
553
+
554
+ .id-video.mobile-camera-screen {
555
+ display: flex;
556
+ align-items: stretch;
557
+ justify-content: center;
558
+ max-height: 300px;
559
+ height: 15rem;
560
+ width: 100%;
561
+ overflow: visible;
562
+ margin: 0 auto;
563
+ }
564
+
565
+ @media (max-width: 600px) {
566
+ .section {
567
+ width: 99%;
568
+ height: 100vh;
569
+ justify-content: center;
570
+ }
571
+ }
572
+
573
+
574
+
575
+ #document-capture-screen,
576
+ #back-of-document-capture-screen {
577
+ block-size: 45rem;
578
+ display: flex;
579
+ flex-direction: column;
580
+ max-block-size: 100%;
581
+ max-inline-size: 40ch;
582
+ }
583
+
584
+ #document-capture-screen header p {
585
+ margin-block: 0 !important;
586
+ }
587
+
588
+ .padding-bottom-2 {
589
+ padding-bottom: 2rem;
590
+ }
591
+ @media (min-width: 600px) {
592
+ video {
593
+ object-fit: contain;
594
+ -webkit-tap-highlight-color: transparent;
595
+ content: normal;
596
+ }
597
+
598
+ .id-video {
599
+ width: 99%;
600
+ text-align: center;
601
+ position: relative;
602
+ overflow: hidden;
603
+ }
604
+
605
+ .id-video-container {
606
+ margin: auto;
607
+ padding: 0px;
608
+ }
609
+ }
610
+ .id-video-container {
611
+ display: flex;
612
+ flex-direction: column;
613
+ align-items: center;
614
+ }
615
+ .id-video {
616
+ width: 100%;
617
+ text-align: center;
618
+ position: relative;
619
+ background: white;
620
+ }
621
+ .video-overlay {
622
+ position: absolute;
623
+ border-style: solid;
624
+ border-color: rgba(0, 0, 0, 0.48);
625
+ box-sizing: border-box;
626
+ inset: 0px;
627
+ }
628
+
629
+ .video-overlay .inner-border {
630
+ position: absolute;
631
+ border-width: 0.25rem;
632
+ border-color: #9394ab;
633
+ border-style: solid;
634
+ border-radius: 0.25rem;
635
+ inset: -1px;
636
+ }
637
+ canvas {
638
+ border-width: 0.25rem;
639
+ border-color: #9394ab;
640
+ border-style: solid;
641
+ border-radius: 0.25rem;
642
+ }
643
+
644
+ .description {
645
+ align-self: center;
646
+ padding-bottom: 1.75rem;
647
+ }
648
+ .reset-margin-block {
649
+ margin-block: 0;
650
+ }
651
+ .align-items-center {
652
+ align-items: center;
653
+ }
654
+ .id-side {
655
+ padding-bottom: 0.5rem;
656
+ }
657
+
658
+ .circle-progress {
659
+ display: flex;
660
+ flex-direction: column;
661
+ align-items: center;
662
+ justify-content: center;
663
+ height: 10rem;
664
+ }
665
+
666
+ .portrait .sticky {
667
+ position: -webkit-sticky; /* Safari */
668
+ position: sticky;
669
+ bottom: 0;
670
+ }
671
+ .video-footer {
672
+ background-color: rgba(255, 255, 255, 0.17);
673
+ padding-top: 10px;
674
+ }
675
+ </style>
676
+ ${qt(this.themeColor)}
677
+ <div id='document-capture-screen' class='flow center flex-column'>
678
+ <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
679
+ <h2 class='text-base font-bold title-color'>${this.documentName}</h2>
680
+ <div class="circle-progress" id="loader">
681
+ ${this.cameraError?"":'<p class="spinner"></p>'}
682
+ ${this.cameraError?`<p style="--flow-space: 4rem" class='color-red | center'>${this.cameraError}</p>`:'<p style="--flow-space: 4rem">Checking permissions</p>'}
683
+ </div>
684
+ <div class='section | flow ${this.isPortraitCaptureView?"portrait":"landscape"}' ${this.cameraError?"hidden":""}>
685
+ <div class='id-video-container'>
686
+ <div class='id-video ${this.isPortraitCaptureView?"portrait":"landscape"}' hidden>
687
+ </div>
688
+ <div class='video-footer sticky'>
689
+ <h2 class='text-base font-bold title-color reset-margin-block id-side'>${this.title}</h2>
690
+ <h4 class='text-base font-normal title-color description reset-margin-block'>Make sure all corners are visible and there is no glare.</h4>
691
+ <div class='actions' hidden>
692
+ <button id='capture-id-image' class='button icon-btn | center' type='button'>
693
+ <svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70" fill="none" aria-hidden="true" focusable="false">
694
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M35 70C54.33 70 70 54.33 70 35C70 15.67 54.33 0 35 0C15.67 0 0 15.67 0 35C0 54.33 15.67 70 35 70ZM61 35C61 49.3594 49.3594 61 35 61C20.6406 61 9 49.3594 9 35C9 20.6406 20.6406 9 35 9C49.3594 9 61 20.6406 61 35ZM65 35C65 51.5685 51.5685 65 35 65C18.4315 65 5 51.5685 5 35C5 18.4315 18.4315 5 35 5C51.5685 5 65 18.4315 65 35Z" fill="${this.themeColor}"/>
695
+ </svg>
696
+ <span class='visually-hidden'>Capture Document</span>
697
+ </button>
698
+ </div>
699
+ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
700
+ </div>
701
+ </div>
702
+ </div>
703
+ </div>
704
+ `}const Qe=.6;class il extends HTMLElement{constructor(){super(),this.templateString=el.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()}async getUserMedia(){if(!A.stream&&this.hasAttribute("data-camera-error")){try{await A.getMedia({audio:!1,video:{...A.environmentOptions,aspectRatio:{ideal:1.7777777777777777}}})}catch(e){console.error(e.constraint),console.error(e.message)}this.handleIDStream(A.stream)}}_captureIDImage(){const e=this._drawIDImage();this._stopIDVideoStream(),this.dispatchEvent(new CustomEvent("document-capture.publish",{detail:{...e}}))}_drawIDImage(e=this._IDVideo){const i=document.createElement("canvas");if(this.isPortraitCaptureView){i.width=e.videoWidth,i.height=i.width*16/9;const c=document.createElement("canvas");c.width=i.width,c.height=i.height,this.updatePortraitId(i,e,1,1),this.updatePortraitId(c,e);const l=i.toDataURL("image/jpeg"),d=c.toDataURL("image/jpeg");return{image:l,originalHeight:i.height,originalWidth:i.width,previewImage:d,...this.idCardRegion}}i.width=2240,i.height=1260;const n=i.width/(e.videoWidth/e.videoHeight);i.height=n;const r=document.createElement("canvas");if(r.height=i.height,r.width=i.width,e.videoWidth<e.videoHeight){const c=document.createElement("canvas");r.height=i.width/1.75,i.width=2240,i.height=i.width/1.77,this._capturePortraitToLandscapeImage(c,e),this._drawLandscapeImageFromCanvas(i,c,1,1),this._drawLandscapeImageFromCanvas(r,c)}else this._drawLandscapeImage(i,e,1,1),this._drawLandscapeImage(r,e);const o=i.toDataURL("image/jpeg"),a=r.toDataURL("image/jpeg");return{image:o,originalHeight:i.height,originalWidth:i.width,previewImage:a,...this.idCardRegion}}_drawImage(e,i=!0,n=A.stream){this.resetErrorMessage();const r=e.getContext("2d");if(r.drawImage(n,0,0,n.videoWidth,n.videoHeight,0,0,e.width,e.height),i){const s=r.getImageData(0,0,e.width,e.height);if(tl(s.data))return r;throw new Error("Unable to capture webcam images - Please try another device")}else return r}handleIDStream(e){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=e:n.src=window.URL.createObjectURL(e),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=e,this._IDVideo=n}catch(i){this.setAttribute("data-camera-error",A.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),A.stopMedia()}}_drawLandscapeImage(e,i=this._IDVideo,n=Qe,r=Qe){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;e.getContext("2d").drawImage(i,h,u,l,d,0,0,e.width,e.height)}_capturePortraitToLandscapeImage(e,i=this._IDVideo){const{videoHeight:n,videoWidth:r}=i,s=r,o=r*9/16,a=0,c=(n-o)/2;e.width=s,e.height=o,e.getContext("2d").drawImage(i,a,c,s,o,0,0,e.width,e.height)}_drawLandscapeImageFromCanvas(e,i,n=Qe,r=Qe){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;e.getContext("2d").drawImage(i,h,u,l,d,0,0,e.width,e.height)}_drawPortraitToLandscapeImage(e,i=this._IDVideo){const{videoHeight:n,videoWidth:r}=i,s=600,o=400;e.width=s,e.height=o;const a=(r-s)/2,c=(n-o)/2;e.getContext("2d").drawImage(i,a,c,s,o,0,0,e.width,e.height)}updatePortraitId(e,i=this._IDVideo,n=Qe,r=Qe){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,g=(1-r)/2,v=l*f,b=d*p,k=l*g,S=d*m;e.getContext("2d").drawImage(a,k,S,v,b,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"),A.stream&&this.handleIDStream(A.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")),A.stopMedia()}handleCloseEvents(){this.dispatchEvent(new CustomEvent("document-capture.close")),A.stopMedia()}}"customElements"in window&&!customElements.get("document-capture")&&window.customElements.define("document-capture",il);function nl(){return`
705
+ <style>
706
+ .retake-photo.button[data-variant~="ghost"] {
707
+ color: #FF5805;
708
+ }
709
+
710
+
711
+ @media (max-width: 600px) {
712
+ .id-camera-screen {
713
+ width: 100%;
714
+ height: 100vh;
715
+ }
716
+
717
+ .section {
718
+ width: 100%;
719
+ height: 100vh;
720
+ justify-content: center;
721
+ }
722
+ }
723
+
724
+ .id-image-container {
725
+ display: flex;
726
+ flex-direction: column;
727
+ align-items: center;
728
+ gap: 1.75rem;
729
+ }
730
+
731
+ .id-image {
732
+ width: 100%;
733
+ text-align: center;
734
+ position: relative;
735
+ background: white;
736
+ }
737
+ img {
738
+ height: 100%;
739
+ min-height: 100px;
740
+ width: 98%;
741
+ }
742
+
743
+ .action-buttons {
744
+ width: 80%;
745
+ }
746
+
747
+
748
+ .icon-btn {
749
+ appearance: none;
750
+ background: none;
751
+ border: none;
752
+ color: hsl(0deg 0% 94%);
753
+ cursor: pointer;
754
+ display: flex;
755
+ align-items: center;
756
+ justify-content: center;
757
+ padding: 4px 8px;
758
+ }
759
+ .justify-right {
760
+ justify-content: end !important;
761
+ }
762
+ .nav {
763
+ display: flex;
764
+ justify-content: space-between;
765
+ }
766
+
767
+ .back-wrapper {
768
+ display: flex;
769
+ align-items: center;
770
+ }
771
+
772
+ .back-button-text {
773
+ font-size: 11px;
774
+ line-height: 11px;
775
+ color: rgb(21, 31, 114);
776
+ }
777
+
778
+
779
+
780
+ .tips,
781
+ .powered-by {
782
+ align-items: center;
783
+ border-radius: 0.25rem;
784
+ color: #4e6577;
785
+ display: flex;
786
+ justify-content: center;
787
+ letter-spacing: 0.075em;
788
+ }
789
+
790
+ .powered-by {
791
+ box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
792
+ display: inline-flex;
793
+ font-size: 0.5rem;
794
+ }
795
+
796
+ .tips {
797
+ margin-left: auto;
798
+ margin-right: auto;
799
+ max-width: 17rem;
800
+ }
801
+
802
+ .tips > * + *,
803
+ .powered-by > * + * {
804
+ display: inline-block;
805
+ margin-left: 0.5em;
806
+ }
807
+
808
+ .powered-by .company {
809
+ color: #18406d;
810
+ font-weight: 700;
811
+ letter-spacing: 0.15rem;
812
+ }
813
+
814
+ .logo-mark {
815
+ background-color: #004071;
816
+ display: inline-block;
817
+ padding: 0.25em 0.5em;
818
+ }
819
+
820
+ .logo-mark svg {
821
+ height: auto;
822
+ justify-self: center;
823
+ width: 0.75em;
824
+ }
825
+
826
+ #document-capture-review-screen {
827
+ block-size: 45rem;
828
+ display: flex;
829
+ flex-direction: column;
830
+ max-block-size: 100%;
831
+ max-inline-size: 40ch;
832
+ }
833
+
834
+ #document-capture-review-screen .id-image-container.landscape {
835
+ height: auto;
836
+ }
837
+
838
+ #document-capture-review-screen header p {
839
+ margin-block: 0 !important;
840
+ }
841
+
842
+ .description {
843
+ color: var(--neutral-off-black, #2D2B2A);
844
+ text-align: center;
845
+
846
+ /* p */
847
+ font-family: DM Sans;
848
+ font-size: 0.875rem;
849
+ font-style: normal;
850
+ font-weight: 400;
851
+ line-height: 18px;
852
+ }
853
+
854
+ .padding-bottom-2 {
855
+ padding-bottom: 2rem;
856
+ }
857
+ img {
858
+ border-width: 0.25rem;
859
+ border-color: #9394ab;
860
+ border-style: solid;
861
+ border-radius: 0.25rem;
862
+ }
863
+
864
+ .instructions-wrapper {
865
+ display: inline-flex;
866
+ flex-direction: column;
867
+ align-items: flex-start;
868
+ gap: 2rem;
869
+ margin-block-start: 2rem;
870
+ margin-block-end: 4rem;
871
+ }
872
+ .instructions {
873
+ display: flex;
874
+ align-items: center;
875
+ text-align: initial;
876
+ }
877
+
878
+ .instructions svg {
879
+ flex-shrink: 0;
880
+ margin-inline-end: 2rem;
881
+ }
882
+
883
+ .instructions p {
884
+ margin-block: 0;
885
+ }
886
+
887
+ .instruction-body {
888
+ font-size: 0.75rem;
889
+ }
890
+
891
+ h1 {
892
+ color: var(--web-digital-blue, #001096);
893
+ text-align: center;
894
+
895
+ /* h1 */
896
+ font-size: 1.5rem;
897
+ font-style: normal;
898
+ font-weight: 700;
899
+ line-height: 36px; /* 150% */
900
+ }
901
+
902
+ .p2 {
903
+ font-size: 1rem;
904
+ font-style: normal;
905
+ font-weight: 500;
906
+ line-height: 1rem;
907
+ }
908
+
909
+ .instruction-header {
910
+ color: var(--web-digital-blue, #001096);
911
+ }
912
+
913
+ .h2 {
914
+ font-size: 1rem;
915
+ font-style: normal;
916
+ font-weight: 700;
917
+ line-height: 1.5rem;
918
+ }
919
+ </style>
920
+ ${qt(this.themeColor)}
921
+ <div id='document-capture-review-screen' class='flow center'>
922
+ <smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
923
+ <h1 class="header-title title-color">
924
+ Is the document clear and readable?
925
+ </h1>
926
+ <p class="description">Make sure all corners of the document
927
+ are visible and there is no glare</p>
928
+ <div class='section | flow'>
929
+ <div class='id-image-container'>
930
+ <div class='id-image'>
931
+ <div class='video-overlay'></div>
932
+ ${this.imageSrc?`<img alt='your ID card' id='document-capture-review-image' src='${this.imageSrc}' />`:""}
933
+ </div>
934
+ <div class='flow action-buttons'>
935
+ <button data-variant='solid full-width' class='button' type='button' id='select-id-image'>
936
+ Yes, my ID is readable
937
+ </button>
938
+ <button data-variant='ghost full-width' class='button retake-photo' type='button' id='re-capture-id-image'>
939
+ No, retake photo
940
+ </button>
941
+ </div>
942
+ </div>
943
+
944
+ ${this.hideAttribution?"":`
945
+ <powered-by-smile-id></powered-by-smile-id>
946
+ `}
947
+ </div>
948
+ </div>
949
+ `}class rl extends HTMLElement{constructor(){super(),this.templateString=nl.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",rl);let sl=class Ri{static memoryLimit=1024e4;static supportedTypes=["image/jpeg","image/png"];static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),r=e/1024**n;return n===0?`${e} bytes`:`${r.toFixed(0)} ${i[n]}`}static getData(e){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(e)})}static async retrieve(e){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!Ri.supportedTypes.includes(i.type))throw new Error("Unsupported file format. Please ensure that you are providing a JPG or PNG image");if(i.size>Ri.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Ri.getHumanSize(Ri.memoryLimit)}.`);return await Ri.getData(i)}};function ol(){return`<svg xmlns="http://www.w3.org/2000/svg" width="173" height="103" viewBox="0 0 173 103" fill="none">
950
+ <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"/>
951
+ <g filter="url(#filter0_d_1281_4127)">
952
+ <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)"/>
953
+ <path d="M31.3688 47.126C31.3688 47.126 29.1191 46.3184 28.4812 46.6549C27.8432 46.9914 26.8695 48.6737 27.0038 50.6589C27.0373 51.1636 27.4403 53.6872 29.1527 54.9321C29.6564 55.2686 30.1265 56.951 31.2345 57.1865C32.3426 57.422 32.5105 56.6818 32.5105 56.6818L31.3688 47.126Z" fill="url(#paint1_linear_1281_4127)"/>
954
+ <path style="mix-blend-mode:multiply" opacity="0.6" d="M31.906 51.6683C31.906 51.6683 30.6637 47.7652 28.9848 48.3035C27.3059 48.8419 27.8767 51.6009 27.8767 51.6009C27.8767 51.6009 28.2461 49.0438 29.7571 49.8849C30.5629 50.2887 29.2534 51.029 29.2534 52.072C29.2534 53.1151 30.16 54.36 30.4622 53.6871C30.7644 53.0142 30.9659 50.6252 31.906 51.6683Z" fill="url(#paint2_linear_1281_4127)"/>
955
+ <path style="mix-blend-mode:multiply" opacity="0.6" d="M30.462 53.687C30.7306 52.7785 30.932 51.399 31.4357 51.5335C31.5749 51.5809 31.6986 51.6655 31.7933 51.7781C31.888 51.8908 31.9501 52.0273 31.973 52.1729L31.8386 51.1971C31.8386 51.1971 30.8985 49.683 29.7568 50.9952" fill="url(#paint3_linear_1281_4127)"/>
956
+ <path d="M57.3575 47.126C57.3575 47.126 59.6407 46.3184 60.2787 46.6549C60.9167 46.9914 61.8568 48.6737 61.7561 50.6589C61.7225 51.1636 61.286 53.6872 59.5736 54.9321C59.1035 55.2686 58.5998 56.951 57.4918 57.1865C56.3837 57.422 56.2158 56.6818 56.2158 56.6818L57.3575 47.126Z" fill="url(#paint4_linear_1281_4127)"/>
957
+ <path style="mix-blend-mode:multiply" opacity="0.6" d="M56.8203 51.6683C56.8203 51.6683 58.0627 47.7652 59.7415 48.3035C61.4204 48.8419 60.8832 51.6009 60.8832 51.6009C60.8832 51.6009 60.5138 49.0438 58.9693 49.8849C58.1634 50.2887 59.4729 51.029 59.4729 52.072C59.4729 53.1151 58.5663 54.36 58.2641 53.6871C57.9619 53.0142 57.7605 50.6252 56.8203 51.6683Z" fill="url(#paint5_linear_1281_4127)"/>
958
+ <path style="mix-blend-mode:multiply" opacity="0.6" d="M58.264 56.749C58.1297 56.9509 57.0552 57.5229 56.4844 56.9509C55.9135 56.3789 56.6858 52.7113 56.753 52.173C56.753 52.173 56.5515 56.177 56.8201 56.3452C56.4172 56.1097 58.2304 56.7826 58.264 56.749Z" fill="url(#paint6_linear_1281_4127)"/>
959
+ <path d="M64.4757 81.9845H23.9141L32.5771 78.6534L33.5508 75.457C34.2424 75.3865 34.938 75.364 35.6326 75.3897L35.4312 76.5673C35.4312 76.5673 37.6473 78.8553 44.1949 78.8553C50.0038 78.8553 52.9586 76.5673 52.9586 76.5673L52.7908 75.5243V75.3897C53.4854 75.364 54.181 75.3865 54.8725 75.457L55.8463 78.6534L64.4757 81.9845Z" fill="#151F72"/>
960
+ <path style="mix-blend-mode:multiply" opacity="0.6" d="M33.5509 75.4568C33.383 75.9951 37.7817 79.8309 44.0607 79.8309C48.0849 79.8356 51.9521 78.2662 54.839 75.4568L55.8128 78.6533C55.8128 78.6533 48.7615 81.5133 43.7249 81.5133C38.6883 81.5133 32.5771 78.6533 32.5771 78.6533L33.5509 75.4568Z" fill="url(#paint7_linear_1281_4127)"/>
961
+ <path d="M56.115 37.1326C51.4478 29.6629 38.8898 29.4947 33.2487 35.854C27.6077 42.2133 30.8983 45.1406 31.1334 54.6292C31.3348 60.0464 31.5699 63.613 35.0955 66.6076C36.1386 67.4711 37.2258 68.2797 38.3525 69.0302C43.7249 73.0679 51.4813 69.5349 53.5296 66.473C57.2231 63.6467 56.8537 60.7866 57.2902 54.7301C57.626 46.8903 60.0436 43.2227 56.115 37.1326Z" fill="url(#paint8_linear_1281_4127)"/>
962
+ </g>
963
+ <g filter="url(#filter1_d_1281_4127)">
964
+ <mask id="path-12-inside-1_1281_4127" fill="white">
965
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18 0C10.268 0 4 6.26801 4 14V80.8276C4 88.5596 10.268 94.8276 18 94.8276H155C162.732 94.8276 169 88.5596 169 80.8276V14C169 6.26801 162.732 0 155 0H18ZM23.7858 14.4876C19.3676 14.4876 15.7858 18.0693 15.7858 22.4876V72.3401C15.7858 76.7584 19.3676 80.3401 23.7858 80.3401H62.7858C67.2041 80.3401 70.7858 76.7584 70.7858 72.3401V22.4876C70.7858 18.0693 67.2041 14.4876 62.7858 14.4876H23.7858Z"/>
966
+ </mask>
967
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18 0C10.268 0 4 6.26801 4 14V80.8276C4 88.5596 10.268 94.8276 18 94.8276H155C162.732 94.8276 169 88.5596 169 80.8276V14C169 6.26801 162.732 0 155 0H18ZM23.7858 14.4876C19.3676 14.4876 15.7858 18.0693 15.7858 22.4876V72.3401C15.7858 76.7584 19.3676 80.3401 23.7858 80.3401H62.7858C67.2041 80.3401 70.7858 76.7584 70.7858 72.3401V22.4876C70.7858 18.0693 67.2041 14.4876 62.7858 14.4876H23.7858Z" fill="#F9F0E7"/>
968
+ <path d="M5.5 14C5.5 7.09644 11.0964 1.5 18 1.5V-1.5C9.43959 -1.5 2.5 5.43958 2.5 14H5.5ZM5.5 80.8276V14H2.5V80.8276H5.5ZM18 93.3276C11.0964 93.3276 5.5 87.7311 5.5 80.8276H2.5C2.5 89.388 9.43958 96.3276 18 96.3276V93.3276ZM155 93.3276H18V96.3276H155V93.3276ZM167.5 80.8276C167.5 87.7311 161.904 93.3276 155 93.3276V96.3276C163.56 96.3276 170.5 89.388 170.5 80.8276H167.5ZM167.5 14V80.8276H170.5V14H167.5ZM155 1.5C161.904 1.5 167.5 7.09644 167.5 14H170.5C170.5 5.43959 163.56 -1.5 155 -1.5V1.5ZM18 1.5H155V-1.5H18V1.5ZM17.2858 22.4876C17.2858 18.8977 20.196 15.9876 23.7858 15.9876V12.9876C18.5391 12.9876 14.2858 17.2409 14.2858 22.4876H17.2858ZM17.2858 72.3401V22.4876H14.2858V72.3401H17.2858ZM23.7858 78.8401C20.196 78.8401 17.2858 75.9299 17.2858 72.3401H14.2858C14.2858 77.5868 18.5391 81.8401 23.7858 81.8401V78.8401ZM62.7858 78.8401H23.7858V81.8401H62.7858V78.8401ZM69.2858 72.3401C69.2858 75.9299 66.3757 78.8401 62.7858 78.8401V81.8401C68.0325 81.8401 72.2858 77.5868 72.2858 72.3401H69.2858ZM69.2858 22.4876V72.3401H72.2858V22.4876H69.2858ZM62.7858 15.9876C66.3757 15.9876 69.2858 18.8977 69.2858 22.4876H72.2858C72.2858 17.2409 68.0325 12.9876 62.7858 12.9876V15.9876ZM23.7858 15.9876H62.7858V12.9876H23.7858V15.9876Z" fill="#001096" mask="url(#path-12-inside-1_1281_4127)"/>
969
+ </g>
970
+ <rect x="86.501" y="23.7069" width="64.8214" height="1.42241" rx="0.711207" fill="#2D2B2A"/>
971
+ <rect x="86.501" y="34.2433" width="64.8214" height="1.42241" rx="0.711207" fill="#2D2B2A"/>
972
+ <rect x="86.501" y="44.1212" width="32.7381" height="1.42241" rx="0.711207" fill="#2D2B2A"/>
973
+ <rect x="27.5713" y="86.2667" width="32.7381" height="2.63621" rx="1.3181" fill="#DBDBC4"/>
974
+ <defs>
975
+ <filter id="filter0_d_1281_4127" x="19.9141" y="31.2932" width="48.5615" height="58.6913" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
976
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
977
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
978
+ <feOffset dy="4"/>
979
+ <feGaussianBlur stdDeviation="2"/>
980
+ <feComposite in2="hardAlpha" operator="out"/>
981
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
982
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1281_4127"/>
983
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4127" result="shape"/>
984
+ </filter>
985
+ <filter id="filter1_d_1281_4127" x="0" y="0" width="173" height="102.828" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
986
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
987
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
988
+ <feOffset dy="4"/>
989
+ <feGaussianBlur stdDeviation="2"/>
990
+ <feComposite in2="hardAlpha" operator="out"/>
991
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
992
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1281_4127"/>
993
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4127" result="shape"/>
994
+ </filter>
995
+ <linearGradient id="paint0_linear_1281_4127" x1="44.1986" y1="81.4966" x2="44.1986" y2="65.578" gradientUnits="userSpaceOnUse">
996
+ <stop stop-color="#FFB09A"/>
997
+ <stop offset="0.21" stop-color="#FF9B8D"/>
998
+ <stop offset="0.47" stop-color="#FF8781"/>
999
+ <stop offset="0.74" stop-color="#FF7B79"/>
1000
+ <stop offset="1" stop-color="#FF7777"/>
1001
+ </linearGradient>
1002
+ <linearGradient id="paint1_linear_1281_4127" x1="29.7538" y1="57.2504" x2="29.7538" y2="46.5708" gradientUnits="userSpaceOnUse">
1003
+ <stop stop-color="#FFB09A"/>
1004
+ <stop offset="0.21" stop-color="#FF9B8D"/>
1005
+ <stop offset="0.47" stop-color="#FF8781"/>
1006
+ <stop offset="0.74" stop-color="#FF7B79"/>
1007
+ <stop offset="1" stop-color="#FF7777"/>
1008
+ </linearGradient>
1009
+ <linearGradient id="paint2_linear_1281_4127" x1="29.888" y1="53.8755" x2="29.888" y2="48.2632" gradientUnits="userSpaceOnUse">
1010
+ <stop stop-color="#FFE7D8"/>
1011
+ <stop offset="0.29" stop-color="#FABDC9"/>
1012
+ <stop offset="0.59" stop-color="#F597BB"/>
1013
+ <stop offset="0.84" stop-color="#F280B3"/>
1014
+ <stop offset="0.99" stop-color="#F177B0"/>
1015
+ </linearGradient>
1016
+ <linearGradient id="paint3_linear_1281_4127" x1="30.8683" y1="53.6937" x2="30.8683" y2="50.4636" gradientUnits="userSpaceOnUse">
1017
+ <stop stop-color="#FFE7D8"/>
1018
+ <stop offset="0.99" stop-color="#CE77F1"/>
1019
+ </linearGradient>
1020
+ <linearGradient id="paint4_linear_1281_4127" x1="58.9759" y1="57.2504" x2="58.9759" y2="46.5708" gradientUnits="userSpaceOnUse">
1021
+ <stop stop-color="#FFB09A"/>
1022
+ <stop offset="0.21" stop-color="#FF9B8D"/>
1023
+ <stop offset="0.47" stop-color="#FF8781"/>
1024
+ <stop offset="0.74" stop-color="#FF7B79"/>
1025
+ <stop offset="1" stop-color="#FF7777"/>
1026
+ </linearGradient>
1027
+ <linearGradient id="paint5_linear_1281_4127" x1="58.845" y1="53.8755" x2="58.845" y2="48.2632" gradientUnits="userSpaceOnUse">
1028
+ <stop stop-color="#FFE7D8"/>
1029
+ <stop offset="0.29" stop-color="#FABDC9"/>
1030
+ <stop offset="0.59" stop-color="#F597BB"/>
1031
+ <stop offset="0.84" stop-color="#F280B3"/>
1032
+ <stop offset="0.99" stop-color="#F177B0"/>
1033
+ </linearGradient>
1034
+ <linearGradient id="paint6_linear_1281_4127" x1="54.5402" y1="54.6965" x2="59.1672" y2="54.6965" gradientUnits="userSpaceOnUse">
1035
+ <stop stop-color="#FFE7D8"/>
1036
+ <stop offset="0.29" stop-color="#FABDC9"/>
1037
+ <stop offset="0.59" stop-color="#F597BB"/>
1038
+ <stop offset="0.84" stop-color="#F280B3"/>
1039
+ <stop offset="0.99" stop-color="#F177B0"/>
1040
+ </linearGradient>
1041
+ <linearGradient id="paint7_linear_1281_4127" x1="44.195" y1="75.4635" x2="44.195" y2="81.4965" gradientUnits="userSpaceOnUse">
1042
+ <stop stop-color="#151F72"/>
1043
+ <stop offset="0.19" stop-color="#151F72"/>
1044
+ <stop offset="0.54" stop-color="#7FCBF5"/>
1045
+ <stop offset="0.82" stop-color="#C574EC"/>
1046
+ <stop offset="0.99" stop-color="#FBD1EE"/>
1047
+ </linearGradient>
1048
+ <linearGradient id="paint8_linear_1281_4127" x1="30.0589" y1="51.0693" x2="58.3379" y2="51.0693" gradientUnits="userSpaceOnUse">
1049
+ <stop stop-color="#FFB09A"/>
1050
+ <stop offset="0.06" stop-color="#FF9B89"/>
1051
+ <stop offset="0.13" stop-color="#FF8A7B"/>
1052
+ <stop offset="0.23" stop-color="#FF7F71"/>
1053
+ <stop offset="0.36" stop-color="#FF786C"/>
1054
+ <stop offset="0.71" stop-color="#FF766A"/>
1055
+ </linearGradient>
1056
+ </defs>
1057
+ </svg>`}function al(){return`<svg xmlns="http://www.w3.org/2000/svg" width="182" height="108" viewBox="0 0 182 108" fill="none">
1058
+ <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"/>
1059
+ <g filter="url(#filter0_d_1281_4284)">
1060
+ <mask id="path-2-inside-1_1281_4284" fill="white">
1061
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18 0C10.268 0 4 6.26801 4 14V86C4 93.732 10.268 100 18 100H164C171.732 100 178 93.732 178 86V14C178 6.26801 171.732 0 164 0H18ZM148 67C145.791 67 144 68.7909 144 71V85C144 87.2091 145.791 89 148 89H162C164.209 89 166 87.2091 166 85V71C166 68.7909 164.209 67 162 67H148Z"/>
1062
+ </mask>
1063
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18 0C10.268 0 4 6.26801 4 14V86C4 93.732 10.268 100 18 100H164C171.732 100 178 93.732 178 86V14C178 6.26801 171.732 0 164 0H18ZM148 67C145.791 67 144 68.7909 144 71V85C144 87.2091 145.791 89 148 89H162C164.209 89 166 87.2091 166 85V71C166 68.7909 164.209 67 162 67H148Z" fill="#F9F0E7"/>
1064
+ <path d="M5.5 14C5.5 7.09644 11.0964 1.5 18 1.5V-1.5C9.43959 -1.5 2.5 5.43959 2.5 14H5.5ZM5.5 86V14H2.5V86H5.5ZM18 98.5C11.0964 98.5 5.5 92.9036 5.5 86H2.5C2.5 94.5604 9.43959 101.5 18 101.5V98.5ZM164 98.5H18V101.5H164V98.5ZM176.5 86C176.5 92.9036 170.904 98.5 164 98.5V101.5C172.56 101.5 179.5 94.5604 179.5 86H176.5ZM176.5 14V86H179.5V14H176.5ZM164 1.5C170.904 1.5 176.5 7.09644 176.5 14H179.5C179.5 5.43959 172.56 -1.5 164 -1.5V1.5ZM18 1.5H164V-1.5H18V1.5ZM145.5 71C145.5 69.6193 146.619 68.5 148 68.5V65.5C144.962 65.5 142.5 67.9624 142.5 71H145.5ZM145.5 85V71H142.5V85H145.5ZM148 87.5C146.619 87.5 145.5 86.3807 145.5 85H142.5C142.5 88.0376 144.962 90.5 148 90.5V87.5ZM162 87.5H148V90.5H162V87.5ZM164.5 85C164.5 86.3807 163.381 87.5 162 87.5V90.5C165.038 90.5 167.5 88.0376 167.5 85H164.5ZM164.5 71V85H167.5V71H164.5ZM162 68.5C163.381 68.5 164.5 69.6193 164.5 71H167.5C167.5 67.9624 165.038 65.5 162 65.5V68.5ZM148 68.5H162V65.5H148V68.5Z" fill="#001096" mask="url(#path-2-inside-1_1281_4284)"/>
1065
+ </g>
1066
+ <rect x="134" y="10" width="3" height="9" rx="0.5" fill="#DBDBC4"/>
1067
+ <rect x="148.733" y="10" width="2" height="9" rx="0.5" fill="#DBDBC4"/>
1068
+ <rect x="154" y="10" width="2" height="9" rx="0.5" fill="#DBDBC4"/>
1069
+ <rect x="166" y="10" width="1.3" height="9" rx="0.5" fill="#DBDBC4"/>
1070
+ <rect x="157" y="10" width="2" height="9" rx="0.5" fill="#DBDBC4"/>
1071
+ <rect x="141.8" y="10" width="5" height="9" rx="0.5" fill="#DBDBC4"/>
1072
+ <rect x="161" y="10" width="4" height="9" rx="0.5" fill="#DBDBC4"/>
1073
+ <rect x="137.767" y="10" width="1" height="9" rx="0.5" fill="#DBDBC4"/>
1074
+ <rect x="151.2" y="10" width="1" height="9" rx="0.5" fill="#DBDBC4"/>
1075
+ <rect x="20.25" y="32.25" width="98.5" height="0.5" rx="0.25" fill="#2D2B2A" stroke="#2D2B2A" stroke-width="0.5"/>
1076
+ <rect x="20.25" y="41.75" width="98.5" height="0.5" rx="0.25" fill="#2D2B2A" stroke="#2D2B2A" stroke-width="0.5"/>
1077
+ <rect x="20.25" y="51.25" width="49.5" height="0.5" rx="0.25" fill="#2D2B2A" stroke="#2D2B2A" stroke-width="0.5"/>
1078
+ <rect x="20.25" y="75.25" width="49.5" height="0.5" rx="0.25" fill="#2D2B2A" stroke="#2D2B2A" stroke-width="0.5"/>
1079
+ <rect x="20.25" y="84.75" width="49.5" height="0.5" rx="0.25" fill="#2D2B2A" stroke="#2D2B2A" stroke-width="0.5"/>
1080
+ <defs>
1081
+ <filter id="filter0_d_1281_4284" x="0" y="0" width="182" height="108" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
1082
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
1083
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
1084
+ <feOffset dy="4"/>
1085
+ <feGaussianBlur stdDeviation="2"/>
1086
+ <feComposite in2="hardAlpha" operator="out"/>
1087
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
1088
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1281_4284"/>
1089
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1281_4284" result="shape"/>
1090
+ </filter>
1091
+ </defs>
1092
+ </svg>`}function cl(){return`
1093
+ <div id="document-capture-instructions-screen" class="flow center">
1094
+ <section className="main">
1095
+ <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
1096
+ <header>
1097
+ ${this.isFrontOfId?ol():al()}
1098
+ <h1 class='text-2xl title-color font-bold'>${this.title}</h1>
1099
+ <p class="description text-sm font-normal">
1100
+ We'll use it to verify your identity.
1101
+ </p>
1102
+ <p class="description padding-bottom-2">
1103
+ Please follow the instructions below.
1104
+ </p>
1105
+ </header>
1106
+ <div class="flow instructions-wrapper">
1107
+ <div class="instructions">
1108
+ <svg
1109
+ xmlns="http://www.w3.org/2000/svg"
1110
+ width="38"
1111
+ height="38"
1112
+ viewBox="0 0 38 38"
1113
+ fill="none"
1114
+ >
1115
+ <g clip-path="url(#clip0_604_670)">
1116
+ <path
1117
+ fill-rule="evenodd"
1118
+ clip-rule="evenodd"
1119
+ d="M31.8569 19C31.8569 21.5428 31.1029 24.0285 29.6902 26.1428C28.2774 28.2571 26.2695 29.9049 23.9203 30.878C21.571 31.8511 18.986 32.1057 16.492 31.6096C13.9981 31.1136 11.7072 29.8891 9.90919 28.091C8.11115 26.293 6.88668 24.0022 6.3906 21.5082C5.89452 19.0143 6.14913 16.4292 7.12222 14.08C8.09531 11.7307 9.74318 9.72279 11.8574 8.31008C13.9717 6.89737 16.4574 6.14334 19.0002 6.14334C22.41 6.14334 25.6802 7.49788 28.0913 9.90897C30.5024 12.3201 31.8569 15.5902 31.8569 19Z"
1120
+ fill="${this.themeColor}"
1121
+ />
1122
+ <path
1123
+ d="M19.6064 4.5419H18.394L18.9912 0L19.6064 4.5419Z"
1124
+ fill="${this.themeColor}"
1125
+ />
1126
+ <path
1127
+ d="M26.7541 6.77667L25.7046 6.17048L28.4913 2.54239L26.7541 6.77667Z"
1128
+ fill="${this.themeColor}"
1129
+ />
1130
+ <path
1131
+ d="M31.8298 12.2957L31.2236 11.2462L35.4489 9.49097L31.8298 12.2957Z"
1132
+ fill="${this.themeColor}"
1133
+ />
1134
+ <path
1135
+ d="M33.4674 19.6062V18.3938L38.0003 18.9909L33.4674 19.6062Z"
1136
+ fill="${this.themeColor}"
1137
+ />
1138
+ <path
1139
+ d="M31.2236 26.7538L31.8298 25.7043L35.4579 28.491L31.2236 26.7538Z"
1140
+ fill="${this.themeColor}"
1141
+ />
1142
+ <path
1143
+ d="M25.7046 31.8295L26.7541 31.2233L28.5094 35.4486L25.7046 31.8295Z"
1144
+ fill="${this.themeColor}"
1145
+ />
1146
+ <path
1147
+ d="M18.394 33.4671H19.6064L19.0093 38L18.394 33.4671Z"
1148
+ fill="${this.themeColor}"
1149
+ />
1150
+ <path
1151
+ d="M11.2464 31.2233L12.2959 31.8295L9.50928 35.4576L11.2464 31.2233Z"
1152
+ fill="${this.themeColor}"
1153
+ />
1154
+ <path
1155
+ d="M6.17068 25.7043L6.77687 26.7538L2.55164 28.509L6.17068 25.7043Z"
1156
+ fill="${this.themeColor}"
1157
+ />
1158
+ <path
1159
+ d="M4.54215 18.3938V19.6062L0.000244141 19.009L4.54215 18.3938Z"
1160
+ fill="${this.themeColor}"
1161
+ />
1162
+ <path
1163
+ d="M6.77689 11.2462L6.1707 12.2957L2.5426 9.50903L6.77689 11.2462Z"
1164
+ fill="${this.themeColor}"
1165
+ />
1166
+ <path
1167
+ d="M12.296 6.17047L11.2464 6.77666L9.49121 2.55142L12.296 6.17047Z"
1168
+ fill="${this.themeColor}"
1169
+ />
1170
+ </g>
1171
+ <defs>
1172
+ <clipPath id="clip0_604_670">
1173
+ <rect
1174
+ width="38"
1175
+ height="38"
1176
+ fill="white"
1177
+ transform="translate(0.000244141)"
1178
+ />
1179
+ </clipPath>
1180
+ </defs>
1181
+ </svg>
1182
+ <div class="instruction">
1183
+ <p class="instruction-header font-bold text-base">Good Light</p>
1184
+ <p class="instruction-body text-xs font-medium">
1185
+ Make sure the image is taken in a well-lit environment where the ID document is easy to read.
1186
+ </p>
1187
+ </div>
1188
+ </div>
1189
+ <div class="instructions">
1190
+ <svg
1191
+ xmlns="http://www.w3.org/2000/svg"
1192
+ width="38"
1193
+ height="36"
1194
+ viewBox="0 0 38 36"
1195
+ fill="none"
1196
+ >
1197
+ <g clip-path="url(#clip0_604_672)">
1198
+ <path
1199
+ d="M36.7211 12.6391H1.22537C1.06275 13.0909 0.910962 13.5427 0.77002 14.0055H37.1764C37.0463 13.5427 36.8946 13.0909 36.7211 12.6391Z"
1200
+ fill="${this.themeColor}"
1201
+ />
1202
+ <path
1203
+ d="M37.3716 14.7438H0.574875C0.466458 15.1625 0.379725 15.5813 0.303833 16.011H37.6426C37.5667 15.5813 37.48 15.1625 37.3716 14.7438Z"
1204
+ fill="${this.themeColor}"
1205
+ />
1206
+ <path
1207
+ d="M37.7727 16.8485H0.173703C0.119494 17.2342 0.0869685 17.6198 0.0544434 18.0055H37.892C37.8594 17.6198 37.8269 17.2342 37.7727 16.8485Z"
1208
+ fill="${this.themeColor}"
1209
+ />
1210
+ <path
1211
+ d="M37.9462 19.4711C37.9462 19.2948 37.9462 19.1295 37.9353 18.9532H0.0110865C0.000244802 19.1295 0.000244141 19.2948 0.000244141 19.4711C0.000244141 19.6474 0.000244802 19.8347 0.0110865 20.011H37.9353C37.9462 19.8347 37.9462 19.6474 37.9462 19.4711Z"
1212
+ fill="${this.themeColor}"
1213
+ />
1214
+ <path
1215
+ d="M37.8811 21.0579H0.0653076C0.086991 21.3774 0.119515 21.697 0.162882 22.0055H37.7836C37.8269 21.697 37.8595 21.3774 37.8811 21.0579Z"
1216
+ fill="${this.themeColor}"
1217
+ />
1218
+ <path
1219
+ d="M37.5992 23.1625H0.347168C0.401376 23.449 0.466426 23.7245 0.531477 24H37.4149C37.48 23.7245 37.545 23.449 37.5992 23.1625Z"
1220
+ fill="${this.themeColor}"
1221
+ />
1222
+ <path
1223
+ d="M37.0788 25.2672H0.867554C0.954287 25.5096 1.03018 25.7631 1.11691 26.0055H36.8295C36.9162 25.7631 37.0029 25.5096 37.0788 25.2672Z"
1224
+ fill="${this.themeColor}"
1225
+ />
1226
+ <path
1227
+ d="M36.2874 27.3719H1.65906L1.95178 28H35.9947L36.2874 27.3719Z"
1228
+ fill="${this.themeColor}"
1229
+ />
1230
+ <path
1231
+ d="M35.2032 29.4766H2.75403C2.84799 29.6529 2.95641 29.8292 3.07928 30.0055H34.878L35.2032 29.4766Z"
1232
+ fill="${this.themeColor}"
1233
+ />
1234
+ <path
1235
+ d="M33.7396 31.5813H4.20679L4.54288 32H33.4035L33.7396 31.5813Z"
1236
+ fill="${this.themeColor}"
1237
+ />
1238
+ <path
1239
+ d="M31.7989 33.6859H6.14746L6.49439 33.9945H31.452L31.7989 33.6859Z"
1240
+ fill="${this.themeColor}"
1241
+ />
1242
+ <path
1243
+ d="M29.0993 35.7906H8.84705L9.18314 36H28.7632L29.0993 35.7906Z"
1244
+ fill="${this.themeColor}"
1245
+ />
1246
+ <path
1247
+ d="M34.2384 8.01102C33.8914 7.53719 33.5228 7.07438 33.1325 6.63361C29.8258 2.60055 24.6977 0 18.9407 0C12.891 0 7.53525 2.86501 4.25021 7.26171H4.28274C4.08759 7.51515 3.89244 7.75757 3.70813 8.01102H34.2384Z"
1248
+ fill="${this.themeColor}"
1249
+ />
1250
+ <path
1251
+ d="M34.531 8.44077H3.41533C3.06839 8.94765 2.74314 9.47658 2.43958 10.0165H35.5068C35.2124 9.47215 34.8866 8.94597 34.531 8.44077Z"
1252
+ fill="${this.themeColor}"
1253
+ />
1254
+ <path
1255
+ d="M35.7887 10.5344H2.15776C1.9084 11.0193 1.68072 11.5151 1.47473 12.011H36.4717C36.2657 11.5151 36.0381 11.0193 35.7887 10.5344Z"
1256
+ fill="${this.themeColor}"
1257
+ />
1258
+ </g>
1259
+ <defs>
1260
+ <clipPath id="clip0_604_672">
1261
+ <rect
1262
+ width="37.9459"
1263
+ height="36"
1264
+ fill="white"
1265
+ transform="translate(0.000244141)"
1266
+ />
1267
+ </clipPath>
1268
+ </defs>
1269
+ </svg>
1270
+ <div>
1271
+ <p class="instruction-header font-bold text-base">Clear Image</p>
1272
+ <p class="instruction-body text-xs font-medium">
1273
+ Hold your camera steady so the words on the ID are not blurry.
1274
+ </p>
1275
+ </div>
1276
+ </div>
1277
+ <div id="error" class='color-red'>
1278
+ </div>
1279
+ </div>
1280
+ </section>
1281
+ <section className="footer">
1282
+ <div class='flow'>
1283
+ ${this.supportBothCaptureModes||this.documentCaptureModes==="camera"?`
1284
+ <button data-variant='solid full-width' class='button' type='button' id='take-photo'>
1285
+ Take Photo
1286
+ </button>
1287
+ `:""}
1288
+ ${this.supportBothCaptureModes||this.documentCaptureModes==="upload"?`
1289
+ <label id='upload-photo-label' data-variant='${this.supportBothCaptureModes?"outline":"solid"}' class='button'>
1290
+ <input type='file' hidden onclick='this.value=null;' id='upload-photo' name='document' accept='image/png, image/jpeg' />
1291
+ <span>Upload Photo</span>
1292
+ </label>
1293
+ `:""}
1294
+ </div>
1295
+ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
1296
+ </section>
1297
+ </div>
1298
+ ${qt(this.themeColor)}
1299
+ `}class ll extends HTMLElement{constructor(){super(),this.templateString=cl.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",async i=>{this.shadowRoot.querySelector("#error").innerHTML="";try{const{files:n}=i.target,r=await sl.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 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",ll);const $i={version:"10.0.2"},hl=$i.version,Nt=document.querySelector("smart-camera-web");async function we(t){try{const e=await A.getMedia({audio:!1,video:A.environmentOptions}),n=(await navigator.mediaDevices.enumerateDevices()).find(r=>r.kind==="videoinput"&&e.getVideoTracks()[0].getSettings().deviceId===r.deviceId);Nt?.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:n?.label}})),t.removeAttribute("data-camera-error"),t.setAttribute("data-camera-ready",!0)}catch(e){t.removeAttribute("data-camera-ready"),t.setAttribute("data-camera-error",A.handleCameraError(e))}}class Bo extends HTMLElement{constructor(){super(),this.activeScreen=null,this.smartCameraWeb=this.closest("smart-camera-web"),Nt?.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
1300
+ ${qt(this.themeColor)}
1301
+ <div>
1302
+ <document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title}
1303
+ ${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions?"hidden":""}
1304
+ ${this.hideAttribution}
1305
+ ></document-capture-instructions>
1306
+ <document-capture id='document-capture-front' side-of-id='Front'
1307
+ ${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}
1308
+ ${this.documentCaptureModes} ${this.documentType} theme-color='${this.themeColor}'
1309
+ ></document-capture>
1310
+ <document-capture-instructions id='document-capture-instructions-back' side-of-id='Back' title='Submit Back of ID'
1311
+ ${this.documentCaptureModes} ${this.showNavigation} theme-color='${this.themeColor}' ${this.hideAttribution} hidden
1312
+ ></document-capture-instructions>
1313
+ <document-capture id='document-capture-back' side-of-id='Back' ${this.title} ${this.showNavigation}
1314
+ ${this.documentCaptureModes} theme-color='${this.themeColor}' ${this.hideAttribution}
1315
+ hidden
1316
+ ></document-capture>
1317
+ <document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
1318
+ <document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' ${this.hideAttribution} hidden></document-capture-review>
1319
+ </div>
1320
+ `,this._data={images:[],meta:{libraryVersion:hl}},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?(we(this.idCapture),this.setActiveScreen(this.idCapture)):this.setActiveScreen(this.documentInstruction),this.setUpEventListeners()}disconnectedCallback(){A.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",async()=>{Nt?.dispatchEvent(new CustomEvent("metadata.document-front-capture-start")),Nt?.dispatchEvent(new CustomEvent("metadata.document-front-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCapture),await we(this.idCapture)}),this.documentInstruction.addEventListener("document-capture-instructions.upload",async i=>{Nt?.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:Je.ID_CARD_IMAGE_BASE64}),this.setActiveScreen(this.idReview)}),this.idCapture.addEventListener("document-capture.publish",i=>{Nt?.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:Je.ID_CARD_IMAGE_BASE64}),A.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",async()=>{Nt?.dispatchEvent(new CustomEvent("metadata.document-front-capture-retry")),this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),await we(this.idCapture)):this.setActiveScreen(this.documentInstruction)}),this.idReview.addEventListener("document-capture-review.accepted",async()=>{this.hideBackOfId?this._publishSelectedImages():this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),await we(this.idCaptureBack)):this.setActiveScreen(this.documentInstructionBack)}),this.documentInstructionBack.addEventListener("document-capture-instructions.capture",async()=>{Nt?.dispatchEvent(new CustomEvent("metadata.document-back-capture-start")),Nt?.dispatchEvent(new CustomEvent("metadata.document-back-origin",{detail:{imageOrigin:"camera_manual_capture"}})),this.setActiveScreen(this.idCaptureBack),await we(this.idCaptureBack)}),this.documentInstructionBack.addEventListener("document-capture-instructions.cancelled",async()=>{this.idReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCapture),await we(this.idCapture)):this.setActiveScreen(this.documentInstruction)}),this.documentInstructionBack.addEventListener("document-capture-instructions.upload",async i=>{Nt?.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:Je.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview)}),this.idCaptureBack.addEventListener("document-capture.publish",i=>{Nt?.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:Je.ID_CARD_BACK_IMAGE_BASE64}),this.setActiveScreen(this.backOfIdReview),A.stopMedia()}),this.idCaptureBack.addEventListener("document-capture.cancelled",async()=>{this.hideInstructions?(this.setActiveScreen(this.idCapture),await we(this.idCapture)):this.setActiveScreen(this.documentInstructionBack)}),this.backOfIdReview.addEventListener("document-capture-review.rejected",async()=>{Nt?.dispatchEvent(new CustomEvent("metadata.document-back-capture-retry")),this.backOfIdReview.removeAttribute("data-image"),this._data.images.pop(),this.hideInstructions?(this.setActiveScreen(this.idCaptureBack),await we(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){this.activeScreen?.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",Bo);function dl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Oi={exports:{}};/*!
1321
+ * validate.js 0.13.1
1322
+ *
1323
+ * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
1324
+ * Validate.js may be freely distributed under the MIT license.
1325
+ * For all details and documentation:
1326
+ * http://validatejs.org/
1327
+ */var ul=Oi.exports,Fo;function pl(){return Fo||(Fo=1,function(t,e){(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<"u"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(a,c,l){var d=[],h,u,p,f,m,g,v;(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 v=o.format("Unknown validator %{name}",{name:u}),new Error(v);g=f[u],g=o.result(g,p,a,h,l,c),g&&d.push({attribute:h,value:p,validator:u,globalOptions:l,attributes:a,options:g,error:m.call(m,p,g,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 g=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[g]||null):m=u.checked:u.type==="radio"&&(u.checked||(m=l[g]||null)),l[g]=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 v=typeof u.options[u.selectedIndex]<"u"?u.options[u.selectedIndex].value:"";m=o.sanitizeFormValue(v,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,g;for(g in u)m=p[g],o.isObject(m)?f[g]=h(f[g],m):m||delete f[g];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<"u"&&console.warn&&console.warn("[validate.js] "+a)},error:function(a){typeof console<"u"&&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(v){return v},f,m=[];a=p(a);var g=a.length;if(!o.isNumber(g))return c.message||this.notValid||"has an incorrect length";if(o.isNumber(d)&&g!==d&&(f=c.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",m.push(o.format(f,{count:d}))),o.isNumber(u)&&g<u&&(f=c.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",m.push(o.format(f,{count:u}))),o.isNumber(h)&&g>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(S,O){return S>O},greaterThanOrEqualTo:function(S,O){return S>=O},equalTo:function(S,O){return S===O},lessThan:function(S,O){return S<O},lessThanOrEqualTo:function(S,O){return S<=O},divisibleBy:function(S,O){return S%O===0}},g=c.prettify||h&&h.prettify||o.prettify;if(o.isString(a)&&c.strict){var v="^-?(0|[1-9]\\d*)";if(c.onlyInteger||(v+="(\\.\\d+)?"),v+="$",!new RegExp(v).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),k=c[b]||this[b]||this.message||"must be %{type} %{count}";u.push(o.format(k,{count:f,type:g(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(g,v){return g===v},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=]+)*",g="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",v="data:(?:"+m+")?(?:;base64)?,"+g;p="(?:"+p+")|(?:^"+v+"$)"}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(ul,e,t,null)}(Oi,Oi.exports)),Oi.exports}var fl=pl();const ml=dl(fl);function _r(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 gl(){return`
1328
+ <style>
1329
+ *,
1330
+ *::before,
1331
+ *::after {
1332
+ box-sizing: border-box;
1333
+ margin: 0;
1334
+ padding: 0;
1335
+ }
1336
+
1337
+ :host {
1338
+ --flow-space: 1.5rem;
1339
+
1340
+ --color-dark: #404040;
1341
+ --color-grey: #555B69;
1342
+
1343
+ --color-success: #1EB244;
1344
+ --color-failure: #FFEDEB;
1345
+ --color-failure-tint: #F86B58;
1346
+
1347
+ --color-richblue: #043C93;
1348
+ --color-theme: ${this.themeColor};
1349
+
1350
+ --color-active: #2D2B2A;
1351
+ --color-default: #001096;
1352
+ --color-disabled: #848282;
1353
+ }
1354
+
1355
+ html {
1356
+ font-family: 'DM Sans', sans-serif;
1357
+ }
1358
+
1359
+ [hidden] {
1360
+ display: none !important;
1361
+ }
1362
+
1363
+ [disabled] {
1364
+ cursor: not-allowed !important;
1365
+ }
1366
+
1367
+ .visually-hidden {
1368
+ border: 0;
1369
+ clip: rect(1px 1px 1px 1px);
1370
+ clip: rect(1px, 1px, 1px, 1px);
1371
+ height: auto;
1372
+ margin: 0;
1373
+ overflow: hidden;
1374
+ padding: 0;
1375
+ position: absolute;
1376
+ white-space: nowrap;
1377
+ width: 1px;
1378
+ }
1379
+
1380
+ .color-dark {
1381
+ color: var(--color-dark);
1382
+ }
1383
+
1384
+ .color-grey {
1385
+ color: var(--color-grey);
1386
+ }
1387
+
1388
+ .flow > * + * {
1389
+ margin-top: var(--flow-space);
1390
+ }
1391
+
1392
+ .center {
1393
+ margin-left: auto;
1394
+ margin-right: auto;
1395
+
1396
+ text-align: center;
1397
+ }
1398
+
1399
+ h1 {
1400
+ font-size: 1.5rem;
1401
+ font-weight: 700;
1402
+ }
1403
+
1404
+ button, input, select, textarea {
1405
+ font: inherit
1406
+ }
1407
+
1408
+ label,
1409
+ input,
1410
+ select,
1411
+ textarea {
1412
+ --flow-space: .5rem;
1413
+ display: block;
1414
+ width: 100%;
1415
+ }
1416
+
1417
+ input,
1418
+ select,
1419
+ textarea {
1420
+ border: 1px solid #d1d8d6;
1421
+ border-radius: .5rem;
1422
+ padding: .75rem 1rem;
1423
+ }
1424
+
1425
+ button {
1426
+ --button-color: var(--color-default);
1427
+ --flow-space: 3rem;
1428
+ -webkit-appearance: none;
1429
+ -moz-appearance: none;
1430
+ align-items: center;
1431
+ appearance: none;
1432
+ background-color: transparent;
1433
+ border-radius: 2.5rem;
1434
+ border: none;
1435
+ color: #ffffff;
1436
+ cursor: pointer;
1437
+ display: inline-flex;
1438
+ font-size: 20px;
1439
+ font-weight: 500;
1440
+ inline-size: 100%;
1441
+ justify-content: center;
1442
+ letter-spacing: .05ch;
1443
+ line-height: 1;
1444
+ padding: 1rem 2.5rem;
1445
+ text-align: center;
1446
+ text-decoration: none;
1447
+ }
1448
+
1449
+ button[data-variant='solid'] {
1450
+ background-color: var(--button-color);
1451
+ border: 2px solid var(--button-color);
1452
+ }
1453
+
1454
+ button[data-variant='outline'] {
1455
+ color: var(--button-color);
1456
+ border: 2px solid var(--button-color);
1457
+ }
1458
+
1459
+ button[data-variant='ghost'] {
1460
+ color: var(--button-color);
1461
+ }
1462
+
1463
+ button:hover,
1464
+ button:focus,
1465
+ button:active {
1466
+ --button-color: var(--color-active);
1467
+ }
1468
+
1469
+ button:disabled {
1470
+ --button-color: var(--color-disabled);
1471
+ }
1472
+
1473
+ button[data-type='icon'] {
1474
+ height: 2rem;
1475
+ padding: 0;
1476
+ width: 2rem;
1477
+ background: transparent;
1478
+ }
1479
+
1480
+ input {
1481
+ font: inherit;
1482
+ }
1483
+
1484
+ fieldset {
1485
+ margin: 0;
1486
+ border: none;
1487
+ }
1488
+
1489
+ .font-weight:bold {
1490
+ font-weight: bold;
1491
+ }
1492
+
1493
+ .justify-right {
1494
+ justify-content: end !important;
1495
+ }
1496
+ .nav {
1497
+ display: flex;
1498
+ justify-content: space-between;
1499
+ }
1500
+
1501
+ .back-wrapper {
1502
+ display: flex;
1503
+ align-items: center;
1504
+ }
1505
+
1506
+ .back-button-text {
1507
+ font-size: 11px;
1508
+ line-height: 11px;
1509
+ color: ${this.themeColor||"rgb(21, 31, 114)"};
1510
+ }
1511
+
1512
+ #error,
1513
+ .validation-message {
1514
+ color: red;
1515
+ text-transform: capitalize;
1516
+ }
1517
+
1518
+ .input-group {
1519
+ --flow-space: 1.5rem;
1520
+ text-align: initial;
1521
+ }
1522
+
1523
+ .input-radio {
1524
+ --flow-space: 1.5rem;
1525
+ background-color: #F8F8F8;
1526
+ border-radius: .5rem;
1527
+ padding: .625rem 1rem;
1528
+ display: flex;
1529
+ align-items: center;
1530
+ }
1531
+
1532
+ .otp-mode {
1533
+ display: flex;
1534
+ align-items: center;
1535
+ text-align: initial;
1536
+ }
1537
+
1538
+ .otp-mode :first-child {
1539
+ margin: 0;
1540
+ margin-inline-end: 1rem;
1541
+ }
1542
+
1543
+ .otp-mode :nth-child(2n) {
1544
+ --flow-space: .5rem;
1545
+ }
1546
+
1547
+ .input-radio [type='radio'] {
1548
+ border-radius: 50%;
1549
+ inline-size: 2rem;
1550
+ block-size: 2rem;
1551
+ margin-inline-end: .5rem;
1552
+ background-color: white;
1553
+ border: .125rem solid #f5f5f5;
1554
+ }
1555
+
1556
+ #totp-token {
1557
+ block-size: 3rem;
1558
+ inline-size: 20rem;
1559
+ max-inline-size: 100%;
1560
+ background-color: #F5F5F5;
1561
+ border: none;
1562
+ border-bottom: 2px solid #2F718D;
1563
+ font-size: 1.5rem;
1564
+ text-align: center;
1565
+ font-weight: 700;
1566
+ letter-spacing: 2rem;
1567
+ padding: .5rem 1rem;
1568
+ margin-inline: auto;
1569
+ }
1570
+
1571
+ @keyframes spin {
1572
+ 0% {
1573
+ transform: translate3d(-50%, -50%, 0) rotate(0deg);
1574
+ }
1575
+ 100% {
1576
+ transform: translate3d(-50%, -50%, 0) rotate(360deg);
1577
+ }
1578
+ }
1579
+
1580
+ .spinner {
1581
+ animation: 1.5s linear infinite spin;
1582
+ animation-play-state: inherit;
1583
+ border: solid 5px #cfd0d1;
1584
+ border-bottom-color: var(--color-active);
1585
+ border-radius: 50%;
1586
+ content: "";
1587
+ display: block;
1588
+ height: 25px;
1589
+ width: 25px;
1590
+ will-change: transform;
1591
+ position: relative;
1592
+ top: .675rem;
1593
+ left: 1.25rem;
1594
+ }
1595
+ </style>
1596
+
1597
+ <div class='flow center' id='id-entry'>
1598
+ <div class="nav">
1599
+ <div class="back-wrapper">
1600
+ <button type='button' data-type='icon' id="back-button" class="back-button">
1601
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
1602
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
1603
+ <path fill="${this.themeColor}" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
1604
+ </svg>
1605
+ </button>
1606
+ <div class="back-button-text">Back</div>
1607
+ </div>
1608
+ <button data-type='icon' type='button' class='close-iframe'>
1609
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
1610
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
1611
+ <path fill="#91190F" d="m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"/>
1612
+ </svg>
1613
+ <span class='visually-hidden'>Close SmileIdentity Verification frame</span>
1614
+ </button>
1615
+ </div>
1616
+ <h1>
1617
+ Enter your ${this.idTypeLabel}
1618
+ </h1>
1619
+
1620
+ <form name='id-entry-form' class='flow' novalidate style='--flow-space: 5.5rem'>
1621
+ <div id='id-number' class="input-group flow">
1622
+ <label class='required' for="id_number">
1623
+ ${this.idTypeLabel}
1624
+ </label>
1625
+
1626
+ <input aria-required='true' id="id_number" name="id_number"
1627
+ maxlength='11' placeholder='' />
1628
+
1629
+ <p>
1630
+ <small>${this.idHint}</small>
1631
+ </p>
1632
+ </div>
1633
+
1634
+ <button data-variant='solid' id='query-otp-modes' type='submit'>
1635
+ <span class='text'>Continue</span>
1636
+ <svg aria-hidden='true' width="25" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
1637
+ <path d="M7 12h11m0 0-4.588-4M18 12l-4.588 4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1638
+ </svg>
1639
+ <span hidden class='spinner'></span>
1640
+ </button>
1641
+ </form>
1642
+ </div>
1643
+
1644
+ <div hidden class='flow center' id='select-mode'>
1645
+ <div class="nav">
1646
+ <div class="back-wrapper">
1647
+ <button type='button' data-type='icon' id="back-to-entry-button" class="back-button">
1648
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
1649
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
1650
+ <path fill="${this.themeColor}" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
1651
+ </svg>
1652
+ </button>
1653
+ <div class="back-button-text">Back</div>
1654
+ </div>
1655
+ <button data-type='icon' type='button' class='close-iframe'>
1656
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
1657
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
1658
+ <path fill="#91190F" d="m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"/>
1659
+ </svg>
1660
+ <span class='visually-hidden'>Close SmileIdentity Verification frame</span>
1661
+ </button>
1662
+ </div>
1663
+ <h1>
1664
+ Select contact method
1665
+ </h1>
1666
+
1667
+ <form name='select-mode-form' novalidate style='--flow-space: 4.25rem' id='otp-entry' class='flow center'>
1668
+ <fieldset class='flow center'>
1669
+ <legend class='flow' style='--flow-space: 1.5rem'>
1670
+ <p>
1671
+ NIBSS, the data custodian of BVN,&nbsp;
1672
+ will send you a One-Time Password (OTP)
1673
+ </p>
1674
+
1675
+ <p>
1676
+ <small>
1677
+ The request will be from Chams Plc, who is NIBSS' technical partner.
1678
+ </small>
1679
+ </p>
1680
+ </legend>
1681
+
1682
+ <div class='flow center'>
1683
+ ${this.modes.length?this.modes.map(t=>`<label class='input-radio'>
1684
+ <input type="radio" id="" name="mode" value="${Object.keys(t)[0]}">
1685
+ <div class='otp-mode'>
1686
+ ${Object.keys(t)[0].includes("sms")?`
1687
+ <svg xmlns="http://www.w3.org/2000/svg" width="29" height="37" fill="none">
1688
+ <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"/>
1689
+ <g filter="url(#sms)">
1690
+ <path stroke="#2F718D" stroke-linecap="round" stroke-width="2" d="M16.697 24.12c-1.61 0-3.384.703-5.005 1.613-2.602 1.462-3.903 2.193-4.545 1.727-.64-.465-.52-1.91-.277-4.799l.055-.656" shape-rendering="crispEdges"/>
1691
+ </g>
1692
+ <defs>
1693
+ <filter id="sms" width="20.023" height="15.595" x="1.675" y="21.005" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">
1694
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
1695
+ <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
1696
+ <feOffset dy="4"/>
1697
+ <feGaussianBlur stdDeviation="2"/>
1698
+ <feComposite in2="hardAlpha" operator="out"/>
1699
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
1700
+ <feBlend in2="BackgroundImageFix" result="effect1_dropShadow_2_404"/>
1701
+ <feBlend in="SourceGraphic" in2="effect1_dropShadow_2_404" result="shape"/>
1702
+ </filter>
1703
+ </defs>
1704
+ </svg>
1705
+ `:`
1706
+ <svg xmlns="http://www.w3.org/2000/svg" width="35" height="24" fill="none">
1707
+ <path stroke="#2F718D" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.062 4.367c0-1.437 1.221-2.603 2.727-2.603h21.815c1.506 0 2.727 1.166 2.727 2.603v15.62c0 1.438-1.221 2.604-2.727 2.604H6.789c-1.506 0-2.727-1.166-2.727-2.604V4.367Z"/>
1708
+ <g filter="url(#message)">
1709
+ <path stroke="#2F718D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m5.426 3.066 8.647 7.338c2.067 1.754 5.18 1.754 7.247 0l8.648-7.338" shape-rendering="crispEdges"/>
1710
+ </g>
1711
+ <defs>
1712
+ <filter id="message" width="34.042" height="18.154" x=".676" y="2.316" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">
1713
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
1714
+ <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
1715
+ <feOffset dy="4"/>
1716
+ <feGaussianBlur stdDeviation="2"/>
1717
+ <feComposite in2="hardAlpha" operator="out"/>
1718
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
1719
+ <feBlend in2="BackgroundImageFix" result="effect1_dropShadow_2_394"/>
1720
+ <feBlend in="SourceGraphic" in2="effect1_dropShadow_2_394" result="shape"/>
1721
+ </filter>
1722
+ </defs>
1723
+ </svg>
1724
+ `}
1725
+ <div class='flow'>
1726
+ <p>
1727
+ ${Object.values(t)[0]}
1728
+ </p>
1729
+ <p>
1730
+ <small>
1731
+ An OTP will be sent by ${Object.keys(t)[0].includes("sms")?"sms":"email"} to verify your identity
1732
+ </small>
1733
+ </p>
1734
+ </div>
1735
+ </div>
1736
+ </label>`).join(`
1737
+ `):"No modes yet"}
1738
+ </div>
1739
+ </fieldset>
1740
+
1741
+ <button data-variant='ghost' id='contact-methods-outdated' style='--flow-space: .5rem' class='' type='button'>
1742
+ I am no longer using any of these options
1743
+ </button>
1744
+
1745
+ <button data-variant='solid' id='select-otp-mode' type='submit'>
1746
+ <span class='text'>Continue</span>
1747
+ <svg aria-hidden='true' width="25" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
1748
+ <path d="M7 12h11m0 0-4.588-4M18 12l-4.588 4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1749
+ </svg>
1750
+ <span hidden class='spinner'></span>
1751
+ </button>
1752
+ </form>
1753
+ </div>
1754
+
1755
+ <div hidden class='flow center' id='otp-verification'>
1756
+ <div class="nav justify-right">
1757
+ <button data-type='icon' type='button' class='close-iframe'>
1758
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
1759
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
1760
+ <path fill="#91190F" d="m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"/>
1761
+ </svg>
1762
+ <span class='visually-hidden'>Close SmileIdentity Verification frame</span>
1763
+ </button>
1764
+ </div>
1765
+ <h1>
1766
+ OTP Verification
1767
+ </h1>
1768
+
1769
+ <div style='--flow-space: 4.25rem' id='otp-entry'>
1770
+ <form name='otp-submission-form' novalidate style='--flow-space: 1.5rem' class='flow center'>
1771
+ <label for='totp-token'>
1772
+ Enter the OTP sent to <span class='font-weight:bold'>${this.selectedOtpDeliveryMode}</span>
1773
+ </label>
1774
+ <input type='text' id='totp-token' maxlength='6' inputmode='numeric' autocomplete='one-time-code' />
1775
+
1776
+ <p>
1777
+ Didn't receive the OTP${this.selectedOtpDeliveryMode?` at <span class='font-weight:bold'>${this.selectedOtpDeliveryMode}</span>?`:"?"}
1778
+ </p>
1779
+
1780
+ <button style='--flow-space: .5rem' data-variant='ghost' class='try-another-method' type='button'>
1781
+ Try another contact method
1782
+ </button>
1783
+
1784
+ <button data-variant='solid' id='submit-otp' type='submit'>
1785
+ <span class='text'>Submit</span>
1786
+ <svg aria-hidden='true' width="25" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
1787
+ <path d="M7 12h11m0 0-4.588-4M18 12l-4.588 4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1788
+ </svg>
1789
+ <span hidden class='spinner'></span>
1790
+ </button>
1791
+ </form>
1792
+ </div>
1793
+ </div>
1794
+ `}class Do extends HTMLElement{constructor(){super(),this.templateString=gl.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 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 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(n=>n.removeAttribute("aria-invalid")),this.activeScreen.querySelectorAll(".validation-message").forEach(n=>n.remove())}handleIdNumberValidationErrors(e){Object.keys(e).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=e[n][0],r.insertAdjacentElement("afterend",s)})}handleActiveScreenErrors(e){const i=this.activeScreen.querySelector('[type="submit"]'),n=document.createElement("div");n.setAttribute("class","validation-message"),n.textContent=e,i.insertAdjacentElement("beforebegin",n)}validateIdNumber(e){const i={id_number:{format:new RegExp(this.idRegex),presence:{allowEmpty:!1,message:"is required"}}},n=ml({id_number:e},i);return n&&this.handleIdNumberValidationErrors(n),n}async queryOtpModes(e){e&&(e.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=await _r(r,n),o=await 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)}}}async selectOtpMode(e){e.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=await _r(n,i),s=await 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)}}async submitOtp(e){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},n=`${this.baseUrl}/totp_consent/otp`;try{this.toggleLoading();const r=await _r(n,i),s=await r.json();this.toggleLoading(),r.ok?this.handleTotpConsentGrant(e):this.handleActiveScreenErrors(s.error)}catch(r){this.toggleLoading(),this.handleActiveScreenErrors(r.message)}}toggleLoading(){const e=this.activeScreen.querySelector('button[type="submit"]'),i=e.querySelector(".text"),n=e.querySelector("svg"),r=e.querySelector(".spinner");e.toggleAttribute("disabled"),i.toggleAttribute("hidden"),n.toggleAttribute("hidden"),r.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",Do);class vl extends HTMLElement{constructor(){super();const e=document.createElement("template");e.innerHTML=`
1795
+ <p style='margin-inline: auto; max-inline-size: 10rem'>
1796
+ <svg viewBox="0 0 90 9" fill="none" xmlns="http://www.w3.org/2000/svg">
1797
+ <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"/>
1798
+ <g clipPath="url(#clip0_1923_23296)">
1799
+ <path d="M58.5141 6.02913C58.5644 6.37005 58.8092 6.77098 59.4839 6.77098C60.0578 6.77098 60.336 6.56623 60.336 6.23338C60.336 5.90053 60.142 5.75579 59.788 5.71292L58.5988 5.58482C57.5612 5.47387 56.9539 4.86819 56.9539 3.87872C56.9539 2.77779 57.7801 2.04401 59.4335 2.04401C61.2135 2.04401 61.9221 2.88874 61.9894 3.88679H60.3195C60.2687 3.51157 59.965 3.27253 59.442 3.27253C58.9783 3.27253 58.6577 3.44349 58.6577 3.75062C58.6577 3.99774 58.8097 4.18534 59.2141 4.21964L60.1844 4.30486C61.4918 4.41582 62.0397 5.04672 62.0397 6.0962C62.0397 7.21377 61.3477 7.999 59.4504 7.999C57.5532 7.999 56.9534 7.02667 56.8691 6.02862H58.5141V6.02913Z" fill="#001096" />
1800
+ <path d="M70.1965 5.28736V7.85484H68.5431V5.56019C68.5431 5.09925 68.3746 4.80069 67.9194 4.80069C67.4212 4.80069 67.2108 5.11639 67.2108 5.78159V7.85484H65.5824V5.56019C65.5824 5.09925 65.4133 4.80069 64.9581 4.80069C64.4605 4.80069 64.2496 5.11639 64.2496 5.78159V7.85484H62.5967V3.58932H64.2496V4.24644C64.5113 3.75171 64.9581 3.45265 65.6586 3.45265C66.3592 3.45265 66.8309 3.7855 67.0587 4.35689C67.3285 3.80265 67.7842 3.45265 68.5351 3.45265C69.6735 3.45265 70.197 4.16928 70.197 5.28736H70.1965Z" fill="#001096" />
1801
+ <path d="M70.9785 3.8535V2.18118H72.6319V3.8535H70.9785ZM70.9785 7.85476V4.2504H72.6319V7.85476H70.9785Z" fill="#001096" />
1802
+ <path d="M73.4121 7.85475V2.18167H75.065V7.85525H73.4121V7.85475Z" fill="#001096" />
1803
+ <path d="M78.7264 6.53958H80.3579C80.1968 7.3243 79.5696 7.99151 78.0179 7.99151C76.2294 7.99151 75.6221 6.8568 75.6221 5.71351C75.6221 4.48499 76.3391 3.45265 78.0179 3.45265C79.8653 3.45265 80.3629 4.59594 80.3629 5.77302C80.3629 5.91776 80.3539 6.05443 80.3374 6.13966H77.2336C77.3178 6.68583 77.5881 6.89059 78.0518 6.89059C78.3729 6.89059 78.6083 6.73526 78.7269 6.53908L78.7264 6.53958ZM77.2416 5.21877H78.8022C78.7519 4.77497 78.5404 4.52785 78.0428 4.52785C77.5791 4.52785 77.3348 4.70689 77.2416 5.21877Z" fill="#001096" />
1804
+ <path d="M83.5907 7.85476H81.8994L81.9034 2.18118H83.5902L83.5912 7.85476H83.5907Z" fill="#001096" />
1805
+ <path d="M89.9995 5.00535C89.9995 6.46434 89.1474 7.85475 87.3345 7.85475H84.3652V2.18167H87.3345C89.1479 2.18167 89.9995 3.54686 89.9995 5.00535ZM86.9376 6.5067C87.8401 6.5067 88.2364 5.99482 88.2364 5.00535C88.2364 4.01588 87.8226 3.52971 86.9376 3.52971H86.06V6.5067H86.9376Z" fill="#001096" />
1806
+ <path d="M52.2123 3.88737H48V7.86846H52.2123V3.88737Z" fill="#001096" />
1807
+ <path d="M53.2359 0C53.2165 0 53.1975 0.00201727 53.1786 0.00252159C53.1591 0.00252159 53.1402 0 53.1207 0C52.0457 0 51.0869 0.708567 51.0869 2.27044V3.8888H55.2882V2.27044C55.2882 0.708567 54.3174 0 53.2359 0Z" fill="#FF9B00" />
1808
+ </g>
1809
+ <defs>
1810
+ <clipPath id="clip0_1923_23296">
1811
+ <rect width="42" height="8" fill="white" transform="translate(48)" />
1812
+ </clipPath>
1813
+ </defs>
1814
+ </svg>
1815
+ </p>
1816
+ `,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",vl);function bl(){return`
1817
+ <style>
1818
+ *,
1819
+ *::before,
1820
+ *::after {
1821
+ box-sizing: border-box;
1822
+ margin: 0;
1823
+ padding: 0;
1824
+ }
1825
+
1826
+ :host {
1827
+ --flow-space: 1.5rem;
1828
+
1829
+ --color-dark: #404040;
1830
+ --color-grey: #555B69;
1831
+
1832
+ --color-success: #1EB244;
1833
+ --color-failure: #FFEDEB;
1834
+ --color-failure-tint: #F86B58;
1835
+ --color-danger: #FF5805;
1836
+
1837
+ --color-primary-blue: #151F72;
1838
+ --color-richblue: #043C93;
1839
+ --color-theme: ${this.themeColor};
1840
+ }
1841
+
1842
+ html {
1843
+ font-family: 'DM Sans', sans-serif;
1844
+ }
1845
+
1846
+ [hidden] {
1847
+ display: none !important;
1848
+ }
1849
+
1850
+ [disabled] {
1851
+ cursor: not-allowed !important;
1852
+ filter: grayscale(75%);
1853
+ }
1854
+
1855
+ .visually-hidden {
1856
+ border: 0;
1857
+ clip: rect(1px 1px 1px 1px);
1858
+ clip: rect(1px, 1px, 1px, 1px);
1859
+ height: auto;
1860
+ margin: 0;
1861
+ overflow: hidden;
1862
+ padding: 0;
1863
+ position: absolute;
1864
+ white-space: nowrap;
1865
+ width: 1px;
1866
+ }
1867
+
1868
+ .color-dark {
1869
+ color: var(--color-dark);
1870
+ }
1871
+
1872
+ .color-grey {
1873
+ color: var(--color-grey);
1874
+ }
1875
+
1876
+ .flow > * + * {
1877
+ margin-top: var(--flow-space);
1878
+ }
1879
+
1880
+ .center {
1881
+ margin-left: auto;
1882
+ margin-right: auto;
1883
+
1884
+ text-align: center;
1885
+ }
1886
+
1887
+ h1 {
1888
+ font-size: 20px;
1889
+ font-weight: 400;
1890
+ }
1891
+
1892
+ ol[role=list], ul[role=list] {
1893
+ list-style: none;
1894
+ padding-left: 0;
1895
+ }
1896
+
1897
+ button {
1898
+ --button-color: var(--color-default);
1899
+ --flow-space: 3rem;
1900
+ -webkit-appearance: none;
1901
+ -moz-appearance: none;
1902
+ align-items: center;
1903
+ appearance: none;
1904
+ background-color: transparent;
1905
+ border-radius: 2.5rem;
1906
+ border: none;
1907
+ color: #ffffff;
1908
+ cursor: pointer;
1909
+ display: inline-flex;
1910
+ font-size: 20px;
1911
+ font-weight: 500;
1912
+ inline-size: 100%;
1913
+ justify-content: center;
1914
+ letter-spacing: .05ch;
1915
+ line-height: 1;
1916
+ padding: 1rem 2.5rem;
1917
+ text-align: center;
1918
+ text-decoration: none;
1919
+ }
1920
+
1921
+ button[data-variant='solid'] {
1922
+ background-color: var(--button-color);
1923
+ border: 2px solid var(--button-color);
1924
+ }
1925
+
1926
+ button[data-variant='outline'] {
1927
+ color: var(--button-color);
1928
+ border: 2px solid var(--button-color);
1929
+ }
1930
+
1931
+ button[data-variant='ghost'] {
1932
+ color: var(--button-color);
1933
+ }
1934
+
1935
+ button:hover,
1936
+ button:focus,
1937
+ button:active {
1938
+ --button-color: var(--theme-color);
1939
+ }
1940
+
1941
+ button:disabled {
1942
+ --button-color: var(--color-disabled);
1943
+ }
1944
+
1945
+ button[data-type='icon'] {
1946
+ align-items: center;
1947
+ background-color: transparent;
1948
+ border: 0;
1949
+ cursor: pointer;
1950
+ display: flex;
1951
+ padding: 0;
1952
+ }
1953
+
1954
+ button[data-type='icon'] {
1955
+ height: 2rem;
1956
+ padding: 0;
1957
+ width: 2rem;
1958
+ background: transparent;
1959
+ }
1960
+
1961
+ .nav {
1962
+ display: flex;
1963
+ justify-content: space-between;
1964
+ }
1965
+
1966
+ .justify-right {
1967
+ justify-content: end !important;
1968
+ }
1969
+
1970
+ .back-wrapper {
1971
+ display: flex;
1972
+ align-items: center;
1973
+ }
1974
+
1975
+ .back-button-text {
1976
+ font-size: 11px;
1977
+ line-height: 1;
1978
+ color: ${this.themeColor} !important;
1979
+ }
1980
+
1981
+ img {
1982
+ border-radius: 50%;
1983
+ position: relative;
1984
+ }
1985
+
1986
+ img::before {
1987
+ background-color: #ffffff;
1988
+ border-radius: 50%;
1989
+ position: absolute;
1990
+ top: 50%;
1991
+ left: 50%;
1992
+ transform: translate(-50%, -50%);
1993
+ }
1994
+
1995
+ .demo-tip {
1996
+ align-items: center;
1997
+ background-color: #f5fcff;
1998
+ border-radius: .75rem;
1999
+ border: 1px solid #A9D1E8;
2000
+ color: inherit;
2001
+ display: flex;
2002
+ font-size: .875rem;
2003
+ max-width: 36rem;
2004
+ padding: 1rem;
2005
+ text-align: left;
2006
+ text-decoration: none;
2007
+ }
2008
+
2009
+ .demo-tip > * + * {
2010
+ margin-left: .5rem;
2011
+ }
2012
+
2013
+ .callout {
2014
+ font-size: .875rem;
2015
+ padding: 1rem 1.5rem;
2016
+ max-width: 20.6875rem;
2017
+ }
2018
+
2019
+ .processing-list {
2020
+ display: flex;
2021
+ flex-direction: column;
2022
+ align-items: center;
2023
+ gap: 2rem;
2024
+ padding-top: 2rem;
2025
+
2026
+ }
2027
+
2028
+ .processing-list__items {
2029
+ display: flex;
2030
+ align-items: center;
2031
+ gap: 1rem;
2032
+ }
2033
+
2034
+ .processing-list__items > * + p {
2035
+ margin-left: 1rem;
2036
+ }
2037
+
2038
+ .processing-list__items-item {
2039
+ display: flex;
2040
+ flex-direction: column;
2041
+ gap: 0.5rem;
2042
+ }
2043
+ .processing-list__item__title {
2044
+ color: var(--color-theme);
2045
+ }
2046
+
2047
+ .processing-list__items-item__description {
2048
+ width: 269px
2049
+ }
2050
+
2051
+ .theme {
2052
+ font-weight: 700;
2053
+ color: var(--color-theme);
2054
+ }
2055
+
2056
+ .tooltip {
2057
+ position: relative;
2058
+ }
2059
+
2060
+ .tooltip__trigger {
2061
+ }
2062
+
2063
+ .tooltip__trigger:focus + .tooltip__content,
2064
+ .tooltip__trigger:hover + .tooltip__content {
2065
+ display: flex;
2066
+ }
2067
+
2068
+ .tooltip__content {
2069
+ align-items: flex-start;
2070
+ background-color: #ffffff;
2071
+ border-radius: .5rem;
2072
+ box-shadow: 0px 12px 36px rgba(0, 0, 0, 0.08);
2073
+ display: none;
2074
+ padding: 1.25rem;
2075
+ position: absolute;
2076
+ right: 20px;
2077
+ bottom: -50px;
2078
+ width: 200px;
2079
+ }
2080
+
2081
+ .tooltip__content > :last-child {
2082
+ margin-left: 1rem;
2083
+ }
2084
+
2085
+ .tooltip__content .title {
2086
+ font-size: .75rem;
2087
+ font-weight: 700;
2088
+ }
2089
+
2090
+ .tooltip__content .description {
2091
+ --flow-space: .25rem;
2092
+ font-size: .625rem;
2093
+ color: #6B7280;
2094
+ }
2095
+
2096
+ svg {
2097
+ flex-shrink: 0;
2098
+ }
2099
+
2100
+ [disabled] {
2101
+ cursor: not-allowed;
2102
+ filter: opacity(.7);
2103
+ }
2104
+
2105
+ .credits {
2106
+ --flow-space: 2rem;
2107
+ margin-inline: auto;
2108
+ max-inline-size: 10rem;
2109
+ }
2110
+
2111
+ .company-name {
2112
+ text-transform: uppercase;
2113
+ letter-spacing: .1rem;
2114
+ border-left: 1px solid #cecece;
2115
+ margin-left: .75rem;
2116
+ padding-left: .75rem;
2117
+ display: inline-flex;
2118
+ align-items: center;
2119
+ }
2120
+
2121
+ .company-name svg {
2122
+ margin-right: .5rem;
2123
+ }
2124
+ #cancel {
2125
+ color: var(--color-danger);
2126
+ }
2127
+ </style>
2128
+ ${qt(this.themeColor)}
2129
+ <div id='consent-screen'>
2130
+ <section class='flow center'>
2131
+ <div class="nav ${this.hideBack?"justify-right":""}">
2132
+ <div class="back-wrapper" ${this.hideBack?"hidden":""}>
2133
+ <button type='button' data-type='icon' id="back-button" class="back-button">
2134
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
2135
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
2136
+ <path fill="${this.themeColor}" d="M15.5 11.25h-5.19l1.72-1.72c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-3 3c-.29.29-.29.77 0 1.06l3 3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-1.72-1.72h5.19c.41 0 .75-.34.75-.75s-.34-.75-.75-.75Z"/>
2137
+ </svg>
2138
+ </button>
2139
+ <div class="back-button-text">Back</div>
2140
+ </div>
2141
+ <button data-type='icon' type='button' class='close-iframe'>
2142
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
2143
+ <path fill="#DBDBC4" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z" opacity=".4"/>
2144
+ <path fill="#91190F" d="m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"/>
2145
+ </svg>
2146
+ <span class='visually-hidden'>Close SmileIdentity Verification frame</span>
2147
+ </button>
2148
+ </div>
2149
+ <img alt='' width='50' height='50' src='${this.partnerLogoURL}' />
2150
+ <p class='demo-tip' ${this.demoMode?"":"hidden"}>
2151
+ <svg aria-hidden='true' width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2152
+ <rect x="4.46045" y="4.46069" width="47.7205" height="47.7205" rx="23.8603" fill="white"/>
2153
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M35.1578 25.7487H34.2813V23.1195C34.2813 20.2273 31.915 17.861 29.0229 17.861C26.1307 17.861 23.7644 20.2273 23.7644 23.1195V25.7487H22.888C21.3981 25.7487 20.2588 26.888 20.2588 28.3779V34.5128C20.2588 36.0027 21.3981 37.142 22.888 37.142H35.1578C36.6476 37.142 37.787 36.0027 37.787 34.5128V28.3779C37.787 26.888 36.6476 25.7487 35.1578 25.7487ZM25.5171 23.1194C25.5171 21.1913 27.0946 19.6138 29.0227 19.6138C30.9508 19.6138 32.5283 21.1913 32.5283 23.1194V25.7487H25.5171V23.1194ZM35.1577 35.3892C35.6836 35.3892 36.0342 35.0386 36.0342 34.5128V28.3779C36.0342 27.8521 35.6836 27.5015 35.1577 27.5015H22.888C22.3622 27.5015 22.0116 27.8521 22.0116 28.3779V34.5128C22.0116 35.0386 22.3622 35.3892 22.888 35.3892H35.1577Z" fill="#2D9CDB"/>
2154
+ <rect x="4.46045" y="4.46069" width="47.7205" height="47.7205" rx="23.8603" stroke="#DDF2F7" stroke-width="7.15808"/>
2155
+ </svg>
2156
+
2157
+ <span>
2158
+ This consent screen is for illustrative purposes only. Demo App does not collect personal ID data.
2159
+ </span>
2160
+ </p>
2161
+ <h1 class='text-base font-bold'>
2162
+ <span class='theme'>${this.partnerName}</span>
2163
+ wants to access your
2164
+ <span class='theme'>${this.idTypeLabel}</span>
2165
+ information
2166
+ </h1>
2167
+ <p class='text-base font-normal'>
2168
+ This will allow ${this.partnerName} to:
2169
+ </p>
2170
+ </section>
2171
+
2172
+ <ul role='list' class='processing-list flow' style='--flow-space: 0rem; margin: var(--flow-space) auto;'>
2173
+ <li class='processing-list__items'>
2174
+ <svg width="20" height="24" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2175
+ <path opacity="0.4" d="M9.49983 0C13.0841 0 15.9894 2.90479 15.9894 6.4883C15.9894 10.0718 13.0841 12.9766 9.49983 12.9766C5.91561 12.9766 3.01025 10.0718 3.01025 6.4883C3.01025 2.90479 5.91561 0 9.49983 0Z" fill="#5E646E"/>
2176
+ <path d="M1.47086 20.2288H17.5251C18.0342 20.2288 18.5313 20.1561 19 20.0227C18.3413 15.3646 14.3409 11.7811 9.50001 11.7811C4.65909 11.7811 0.658656 15.3646 0 20.0227C0.468737 20.1561 0.961716 20.2288 1.4749 20.2288" fill="#151F72"/>
2177
+ <path d="M14.9238 19.0148L13.8262 17.931C13.8262 17.931 13.6341 17.7956 13.5244 17.7956C13.4146 17.7956 13.3049 17.8498 13.2226 17.931C13.1402 18.0123 13.0854 18.1207 13.0854 18.2291C13.0854 18.3374 13.1402 18.4458 13.2226 18.5271L14.622 19.9089C14.622 19.9089 14.814 20.0443 14.9238 20.0443C15.0335 20.0443 15.1433 19.9901 15.2256 19.9089L17.8323 17.335C17.8323 17.335 17.9421 17.1724 17.9421 17.0369C17.9421 16.9015 17.9146 16.8202 17.8323 16.7389C17.75 16.6576 17.6677 16.6305 17.5579 16.6305C17.4482 16.6305 17.3384 16.6576 17.2835 16.7389L15.0061 18.9877L14.9238 19.0148ZM15.5 24C15.5 24 15.4177 24 15.3902 24C15.3628 24 15.3354 24 15.3079 24C14.0457 23.6207 13.0305 22.8621 12.2073 21.7241C11.4116 20.5862 11 19.3128 11 17.931V15.2217C11 15.0591 11.0549 14.8965 11.1646 14.734C11.2744 14.5714 11.4116 14.4901 11.5488 14.4089L15.1982 13.0542C15.1982 13.0542 15.3902 13 15.5 13C15.6098 13 15.6921 13 15.8018 13.0542L19.4512 14.4089C19.6159 14.4631 19.753 14.5714 19.8354 14.734C19.9177 14.8965 20 15.032 20 15.2217V17.931C20 19.3128 19.5884 20.5862 18.7927 21.7241C17.9969 22.8621 16.9543 23.6478 15.6921 24H15.5Z" fill="#2CC05C"/>
2178
+ </svg>
2179
+ <div class='processing-list__items-item'>
2180
+ <p class='font-medium text-base processing-list__item__title'>Process your personal details</p>
2181
+ <p class='text-xs font-medium processing-list__items-item__description'>Partner can process your names, DoB and gender</p>
2182
+ </div
2183
+ </li>
2184
+ <li class='processing-list__items'>
2185
+ <svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
2186
+ <path d="M15.0226 7.222C14.8323 7.222 14.642 7.152 14.4918 7.002L12.4888 5.002C12.3491 4.86086 12.2708 4.67043 12.2708 4.472C12.2708 4.27357 12.3491 4.08313 12.4888 3.942C12.7792 3.652 13.2599 3.652 13.5504 3.942L15.0226 5.412L18.4978 1.952C18.7882 1.662 19.269 1.662 19.5594 1.952C19.8498 2.242 19.8498 2.722 19.5594 3.012L15.5534 7.012C15.4032 7.142 15.2129 7.222 15.0226 7.222Z" fill="#2CC05C"/>
2187
+ <path opacity="0.4" d="M9.80472 12.71L6.5298 15.98C6.16926 15.66 5.81874 15.33 5.47822 14.99C4.46547 13.972 3.5314 12.8789 2.68403 11.72C1.8628 10.58 1.2018 9.44 0.721083 8.31C0.240361 7.17 0 6.08 0 5.04C0 4.36 0.12018 3.71 0.360541 3.11C0.600902 2.5 0.981474 1.94 1.51227 1.44C2.15323 0.81 2.85429 0.5 3.5954 0.5C3.87582 0.5 4.15624 0.56 4.40662 0.68C4.66701 0.8 4.89735 0.98 5.07762 1.24L7.40111 4.51C7.58138 4.76 7.71158 4.99 7.80171 5.21C7.89185 5.42 7.94192 5.63 7.94192 5.82C7.94192 6.06 7.87182 6.3 7.73161 6.53C7.60141 6.76 7.41113 7 7.17077 7.24L6.40962 8.03C6.29946 8.14 6.24938 8.27 6.24938 8.43C6.24938 8.51 6.2594 8.58 6.27943 8.66C6.30947 8.74 6.33952 8.8 6.35955 8.86C6.53982 9.19 6.85028 9.62 7.29095 10.14C7.74162 10.66 8.22234 11.19 8.74313 11.72C9.10367 12.07 9.45419 12.41 9.80472 12.71Z" fill="#5E646E"/>
2188
+ <path d="M20 16.83C19.9987 17.2074 19.9131 17.5798 19.7496 17.92C19.5794 18.28 19.359 18.62 19.0686 18.94C18.5779 19.48 18.037 19.87 17.4261 20.12C17.4161 20.12 17.4061 20.13 17.3961 20.13C16.8052 20.37 16.1642 20.5 15.4732 20.5C14.4517 20.5 13.36 20.26 12.2083 19.77C11.0566 19.28 9.90483 18.62 8.76312 17.79C8.37253 17.5 7.98195 17.21 7.61139 16.9L10.8863 13.63C11.1667 13.84 11.4171 14 11.6274 14.11C11.6775 14.13 11.7376 14.16 11.8077 14.19C11.8878 14.22 11.9679 14.23 12.0581 14.23C12.2283 14.23 12.3585 14.17 12.4687 14.06L13.2298 13.31C13.4802 13.06 13.7206 12.87 13.9509 12.75C14.1813 12.61 14.4116 12.54 14.662 12.54C14.8523 12.54 15.0526 12.58 15.2729 12.67C15.4932 12.76 15.7236 12.89 15.9739 13.06L19.2889 15.41C19.5493 15.59 19.7296 15.8 19.8397 16.05C19.9399 16.3 20 16.55 20 16.83Z" fill="#151F72"/>
2189
+ </svg>
2190
+ <div class='processing-list__items-item'>
2191
+ <p class='font-medium text-base processing-list__item__title'>Process your contact information</p>
2192
+ <p class='text-xs font-medium processing-list__items-item__description'>Partner can process your phone numbers and address</p>
2193
+ </div
2194
+ </li>
2195
+ <li class='processing-list__items'>
2196
+ <svg width="20" height="18" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2197
+ <rect opacity="0.4" y="2" width="19" height="16" rx="4" fill="#5E646E"/>
2198
+ <path d="M0 8H19V14C19 16.2091 17.2091 18 15 18H4C1.79086 18 0 16.2091 0 14V8Z" fill="#151F72"/>
2199
+ <path d="M4.66669 9C5.77129 9 6.66669 9.89539 6.66669 11C6.66669 12.1046 5.77129 13 4.66669 13C3.56208 13 2.66669 12.1046 2.66669 11C2.66669 9.89539 3.56208 9 4.66669 9Z" fill="#2CC05C"/>
2200
+ <path d="M2.41287 15H6.91933C7.06224 15 7.20176 14.9771 7.33333 14.935C7.14845 13.4645 6.02552 12.3333 4.66667 12.3333C3.30781 12.3333 2.18489 13.4645 2 14.935C2.13158 14.9771 2.26996 15 2.41401 15" fill="#2CC05C"/>
2201
+ <rect x="10" y="10" width="7" height="1" rx="0.5" fill="#2CC05C"/>
2202
+ <rect x="10" y="12" width="5.25" height="1" rx="0.5" fill="#2CC05C"/>
2203
+ <rect x="10" y="14" width="3.5" height="1" rx="0.5" fill="#2CC05C"/>
2204
+ <g clip-path="url(#clip0_641_419)">
2205
+ <path d="M17.7221 0.583344H15.2779C14.2162 0.583344 13.5833 1.21626 13.5833 2.27793V4.71918C13.5833 5.78376 14.2162 6.41668 15.2779 6.41668H17.7191C18.7808 6.41668 19.4137 5.78376 19.4137 4.72209V2.27793C19.4166 1.21626 18.7837 0.583344 17.7221 0.583344Z" fill="#151F72"/>
2206
+ <path d="M16.0859 4.54474C16.0279 4.54469 15.9723 4.52161 15.9313 4.48058L15.1059 3.65516C15.0652 3.614 15.0424 3.55845 15.0424 3.50058C15.0424 3.4427 15.0652 3.38716 15.1059 3.34599C15.1904 3.26141 15.3304 3.26141 15.415 3.34599L16.0859 4.01683L17.585 2.51766C17.6696 2.43308 17.8096 2.43308 17.8942 2.51766C17.9788 2.60224 17.9788 2.74224 17.8942 2.82683L16.2404 4.48058C16.1995 4.52161 16.1439 4.54469 16.0859 4.54474Z" fill="#2CC05C"/>
2207
+ </g>
2208
+ <defs>
2209
+ <clipPath id="clip0_641_419">
2210
+ <rect width="7" height="7" fill="white" transform="translate(13)"/>
2211
+ </clipPath>
2212
+ </defs>
2213
+ </svg>
2214
+ <div class='processing-list__items-item'>
2215
+ <p class='font-medium text-base processing-list__item__title'>Process your document information</p>
2216
+ <p class='text-xs font-medium processing-list__items-item__description'>Partner can process your photo, ID expiration date, country of issuance and document number</p>
2217
+ </div
2218
+ </li>
2219
+ </ul>
2220
+
2221
+ <section class='callout | flow center' style='--flow-space: 2rem; margin: var(--flow-space) auto;'>
2222
+ <p>
2223
+ You can view <span class='theme'>${this.partnerName}</span>'s privacy policy
2224
+ <a class='theme' href='${this.partnerPolicyURL}' rel='noreferer noopener' target='_blank'>here</a>
2225
+ </p>
2226
+
2227
+ <p style='--flow-space: .75rem'>
2228
+ By choosing "Allow", you grant
2229
+ <span class='theme'>${this.partnerName}</span>
2230
+ consent to process your personal data to offer you this service
2231
+ </p>
2232
+ </section>
2233
+
2234
+ <section class='flow' style='--flow-space: 2.5rem'>
2235
+ <button id='allow' data-variant='solid'>
2236
+ Allow
2237
+ </button>
2238
+
2239
+ <button id='cancel' data-variant='ghost' class='color-danger' style='--flow-space: 1.5rem'>
2240
+ Cancel
2241
+ </button>
2242
+ </section>
2243
+ </div>
2244
+
2245
+ <totp-consent
2246
+ hidden
2247
+ base-url='${this.baseUrl}'
2248
+ country='${this.country}'
2249
+ id-hint='${this.idHint}'
2250
+ id-regex='${this.idRegex}'
2251
+ id-type='${this.idType}'
2252
+ id-type-label='${this.idTypeLabel}'
2253
+ partner-id='${this.partnerId}'
2254
+ partner-name='${this.partnerName}'
2255
+ token='${this.token}'
2256
+ theme-color='${this.themeColor}'
2257
+ ${this.hideAttribution?"hide-attribution":""}
2258
+ >
2259
+ </totp-consent>
2260
+
2261
+ <div hidden id='consent-rejected-screen' class='flow'>
2262
+ <section class='flow center'>
2263
+ <svg xmlns="http://www.w3.org/2000/svg" width="185" height="138" fill="none">
2264
+ <g filter="url(#a)">
2265
+ <path fill="url(#b)" d="M115.503 88.266H70.86a3.443 3.443 0 0 1-3.445-3.444V23.59a3.443 3.443 0 0 1 3.445-3.444h44.643a3.443 3.443 0 0 1 3.444 3.444v61.232a3.443 3.443 0 0 1-3.444 3.444Z"/>
2266
+ </g>
2267
+ <path fill="#D5DDEA" d="M98.982 71.746H87.38a2.33 2.33 0 0 1-2.334-2.334 2.33 2.33 0 0 1 2.334-2.334h11.603a2.33 2.33 0 0 1 2.334 2.334 2.33 2.33 0 0 1-2.334 2.334Zm5.326 5.054H82.032c-.68 0-1.224-.544-1.224-1.224 0-.68.544-1.224 1.224-1.224h22.276c.68 0 1.224.544 1.224 1.224 0 .657-.544 1.223-1.224 1.223Z"/>
2268
+ <path fill="#D9DEEA" d="M108.41 44.439c0 4.578-2.017 8.68-5.213 11.467a15.186 15.186 0 0 1-10.016 3.739 15.09 15.09 0 0 1-10.016-3.762 15.17 15.17 0 0 1-5.212-11.467c0-8.407 6.82-15.228 15.228-15.228 8.407 0 15.229 6.844 15.229 15.251Z"/>
2269
+ <path fill="#fff" d="M103.197 55.906a15.187 15.187 0 0 1-10.016 3.739 15.09 15.09 0 0 1-10.016-3.762c1.11-.43 2.56-.997 4.51-1.79a1.87 1.87 0 0 0 .996-.952 1.8 1.8 0 0 0 .159-.77v-3.649c-.068-.068-.113-.159-.159-.227a3.648 3.648 0 0 1-.589-1.586l-.317-.158c-.93.226-.861-.771-1.11-2.697-.091-.793.022-.952.385-1.088l.294-.408c-1.813-4.079-.906-6.64.884-7.546-.59-1.292-.635-1.768-.635-1.768s3.808.635 5.1.386c1.654-.34 4.214.067 5.166 2.266 1.586.611 2.198 1.631 2.334 2.696.136.998-.158 2.085-.453 2.924a1.077 1.077 0 0 1-.068.158c0 .023-.023.046-.023.068-.045.114-.068.204-.113.295-.023.045-.023.09-.045.136-.023.09-.068.181-.09.25 0 .022 0 .022-.023.044l-.069.204a2.466 2.466 0 0 1-.068.227c.023.023.023.068.046.09.25.114.34.34.25 1.043-.228 1.836-.16 2.946-1.111 2.697l-.839 1.45c-.022.159-.045.25-.068.34-.022.272-.022.816-.022 3.807 0 .363.113.703.294.997.204.317.499.59.861.748 0 0 .023 0 .023.023 1.971.838 3.422 1.382 4.532 1.813Z"/>
2270
+ <path fill="url(#c)" d="M99.254 42.92c.068-.453-.136-1.042-.294-1.427-.023-.068-.068-.136-.091-.204-.725-1.45-2.357-2.062-3.898-2.153-3.943-.204-4.328.544-5.552-.589.386.567.408 1.496-.181 2.629-.408.793-1.201 1.155-1.926 1.382-1.813-4.079-.907-6.64.883-7.546-.589-1.292-.634-1.768-.634-1.768s3.807.635 5.099.386c1.654-.34 4.215.067 5.167 2.266 1.586.611 2.198 1.631 2.334 2.696.272 1.7-.725 3.58-.907 4.329Z"/>
2271
+ <path fill="url(#d)" d="M97.804 53.368v.702h-9.156v-.929a1.8 1.8 0 0 0 .16-.77v-3.649c-.069-.068-.114-.159-.16-.227v-.226c.204.34.454.634.748.906l2.856 2.017c.657.567 1.631.567 2.311.023l2.674-2.402c.09-.068.181-.159.272-.25-.023.272-.023.816-.023 3.807.046.363.136.703.318.998Z"/>
2272
+ <g filter="url(#e)">
2273
+ <path fill="url(#f)" d="M54.86 77.728H26.15a3.443 3.443 0 0 1-3.445-3.444V34.128a3.443 3.443 0 0 1 3.445-3.445h28.71a3.443 3.443 0 0 1 3.444 3.445v40.179a3.424 3.424 0 0 1-3.444 3.421Z"/>
2274
+ </g>
2275
+ <path fill="#D5DDEA" d="M44.504 66.33h-8.022a1.615 1.615 0 0 1-1.609-1.61c0-.883.725-1.608 1.609-1.608h8.022c.884 0 1.61.725 1.61 1.609s-.726 1.609-1.61 1.609Zm3.694 3.49H32.811a.837.837 0 0 1-.838-.839c0-.476.385-.838.838-.838h15.387c.476 0 .839.385.839.838a.851.851 0 0 1-.839.839Z"/>
2276
+ <path fill="#D9DEEA" d="M51.008 47.453a10.52 10.52 0 0 1-3.603 7.931 10.5 10.5 0 0 1-6.912 2.584c-2.651 0-5.076-.975-6.911-2.584a10.52 10.52 0 0 1-3.604-7.931c0-5.801 4.714-10.515 10.515-10.515 5.802 0 10.515 4.714 10.515 10.515Z"/>
2277
+ <path fill="#fff" d="M47.405 55.385a10.5 10.5 0 0 1-6.912 2.584c-2.651 0-5.076-.975-6.912-2.584a87.84 87.84 0 0 0 3.105-1.246c.317-.136.544-.363.68-.658.068-.158.113-.34.113-.543v-2.516a.69.69 0 0 1-.113-.158 2.36 2.36 0 0 1-.408-1.088l-.227-.113c-.634.158-.589-.544-.77-1.859-.068-.544.023-.657.25-.748l.203-.271c-1.246-2.833-.612-4.6.612-5.213-.408-.883-.43-1.223-.43-1.223s2.628.43 3.535.272c1.155-.227 2.9.045 3.557 1.563 1.088.43 1.519 1.133 1.61 1.858.09.703-.114 1.428-.295 2.017-.023.046-.023.068-.045.114 0 .022-.023.022-.023.045l-.068.204c-.023.023-.023.068-.045.09-.023.069-.046.114-.068.182v.023c-.023.045-.046.09-.046.136-.022.068-.045.113-.045.158.023.023.023.045.023.068.18.09.226.227.158.703-.158 1.269-.113 2.04-.77 1.858l-.567 1.02c-.022.113-.045.158-.045.249-.023.181-.023.567-.023 2.629 0 .249.068.475.204.68.136.226.34.407.59.498h.022c1.405.59 2.402.974 3.15 1.27Z"/>
2278
+ <path fill="url(#g)" d="M44.708 46.41c.046-.317-.09-.702-.204-.997l-.068-.136c-.498-.997-1.631-1.427-2.696-1.473-2.72-.136-2.992.386-3.83-.407.272.407.294 1.02-.113 1.813-.295.543-.839.793-1.315.951-1.246-2.832-.612-4.6.612-5.212-.408-.884-.43-1.224-.43-1.224s2.628.431 3.535.272c1.155-.226 2.9.046 3.557 1.564 1.088.43 1.519 1.133 1.61 1.858.135 1.179-.544 2.47-.658 2.992Z"/>
2279
+ <path fill="url(#h)" d="M43.711 53.64v.498H37.39v-.657a1.37 1.37 0 0 0 .113-.544v-2.515a.69.69 0 0 1-.113-.16v-.135c.136.227.317.453.52.612l1.972 1.382a1.264 1.264 0 0 0 1.61.023l1.858-1.654a.689.689 0 0 0 .18-.182c-.022.181-.022.567-.022 2.629 0 .25.068.498.204.703Z"/>
2280
+ <g filter="url(#i)">
2281
+ <path fill="url(#j)" d="M159.533 77.728h-28.712a3.443 3.443 0 0 1-3.444-3.444V34.128a3.443 3.443 0 0 1 3.444-3.445h28.712a3.443 3.443 0 0 1 3.445 3.445v40.179a3.424 3.424 0 0 1-3.445 3.421Z"/>
2282
+ </g>
2283
+ <path fill="#D5DDEA" d="M149.177 66.33h-8.022a1.616 1.616 0 0 1-1.609-1.61c0-.883.726-1.608 1.609-1.608h8.022c.884 0 1.609.725 1.609 1.609.023.884-.702 1.609-1.609 1.609Zm3.694 3.49h-15.387a.836.836 0 0 1-.838-.839c0-.476.385-.838.838-.838h15.387c.476 0 .839.385.839.838a.837.837 0 0 1-.839.839Z"/>
2284
+ <path fill="#D9DEEA" d="M155.704 47.453c0 3.172-1.405 6.005-3.604 7.931a10.498 10.498 0 0 1-6.911 2.584c-2.652 0-5.076-.975-6.912-2.584a10.52 10.52 0 0 1-3.603-7.931c0-5.801 4.713-10.515 10.515-10.515 5.801 0 10.515 4.714 10.515 10.515Z"/>
2285
+ <path fill="#fff" d="M152.101 55.385a10.501 10.501 0 0 1-6.912 2.584c-2.651 0-5.076-.975-6.912-2.584a87.84 87.84 0 0 0 3.105-1.246c.317-.136.544-.363.68-.658.068-.158.113-.34.113-.543v-2.516a.677.677 0 0 1-.113-.158 2.352 2.352 0 0 1-.408-1.088l-.227-.113c-.634.158-.589-.544-.77-1.859-.068-.544.022-.657.249-.748l.204-.271c-1.246-2.833-.612-4.6.612-5.213-.408-.883-.431-1.223-.431-1.223s2.629.43 3.535.272c1.156-.227 2.901.045 3.558 1.563 1.088.43 1.519 1.133 1.609 1.858.091.703-.113 1.428-.294 2.017-.023.046-.023.068-.046.114 0 .022-.022.022-.022.045l-.068.204c-.023.023-.023.068-.046.09-.022.069-.045.114-.068.182v.023c-.022.045-.045.09-.045.136-.023.068-.045.113-.045.158.022.023.022.045.022.068.182.09.227.227.159.703-.159 1.269-.113 2.04-.77 1.858l-.567 1.02c-.023.113-.045.158-.045.249-.023.181-.023.567-.023 2.629 0 .249.068.475.204.68.136.226.34.407.589.498h.023c1.382.59 2.379.974 3.15 1.27Z"/>
2286
+ <path fill="url(#k)" d="M149.382 46.41c.045-.317-.091-.702-.204-.997l-.068-.136c-.499-.997-1.632-1.427-2.697-1.473-2.719-.136-2.991.386-3.83-.407.272.407.295 1.02-.113 1.813-.295.543-.839.793-1.315.951-1.246-2.832-.611-4.6.612-5.212-.408-.884-.43-1.224-.43-1.224s2.628.431 3.535.272c1.156-.226 2.901.046 3.558 1.564 1.088.43 1.518 1.133 1.609 1.858.136 1.179-.521 2.47-.657 2.992Z"/>
2287
+ <path fill="url(#l)" d="M148.385 53.64v.498h-6.323v-.657a1.37 1.37 0 0 0 .113-.544v-2.515a.71.71 0 0 1-.113-.16v-.135c.136.227.317.453.521.612l1.972 1.382a1.264 1.264 0 0 0 1.609.023l1.858-1.654a.683.683 0 0 0 .181-.182c-.022.181-.022.567-.022 2.629 0 .25.068.498.204.703Z"/>
2288
+ <path fill="#F97B6A" d="M154.163 120.944 125.496 92.3l6.572-6.572 28.644 28.667-6.549 6.549Z"/>
2289
+ <path fill="#F97B6A" d="m168.44 135.334-21.982-21.982a4.72 4.72 0 0 1 0-6.662 4.719 4.719 0 0 1 6.663 0l21.981 21.981a4.719 4.719 0 0 1 0 6.663 4.72 4.72 0 0 1-6.662 0Z"/>
2290
+ <path fill="url(#m)" d="m166.876 136.739-28.282-28.282c-.657-.657-.657-1.722 0-2.402l7.229-7.229a1.71 1.71 0 0 1 2.403 0l28.281 28.282c.657.657.657 1.722 0 2.402l-7.229 7.229c-.68.657-1.745.657-2.402 0Z"/>
2291
+ <path fill="url(#n)" d="M93.045 0c-30.004 0-54.32 24.316-54.32 54.32 0 29.98 24.316 54.319 54.297 54.319 30.004 0 54.32-24.316 54.32-54.32C147.342 24.316 123.026 0 93.045 0Zm0 98.577c-24.09 0-43.6-19.829-43.6-44.28 0-24.452 19.51-44.258 43.6-44.258 24.089 0 43.6 19.829 43.6 44.28 0 24.452-19.534 44.258-43.6 44.258Z"/>
2292
+ <defs>
2293
+ <linearGradient id="b" x1="93.164" x2="93.164" y1="18.57" y2="89.001" gradientUnits="userSpaceOnUse">
2294
+ <stop stop-color="#FDFEFF"/>
2295
+ <stop offset=".996" stop-color="#ECF0F5"/>
2296
+ </linearGradient>
2297
+ <linearGradient id="c" x1="86.316" x2="100.21" y1="38.084" y2="38.084" gradientUnits="userSpaceOnUse">
2298
+ <stop stop-color="#B0BACC"/>
2299
+ <stop offset="1" stop-color="#969EAE"/>
2300
+ </linearGradient>
2301
+ <linearGradient id="d" x1="93.229" x2="93.229" y1="54.105" y2="50.91" gradientUnits="userSpaceOnUse">
2302
+ <stop stop-color="#fff"/>
2303
+ <stop offset="1" stop-color="#E2E5EC"/>
2304
+ </linearGradient>
2305
+ <linearGradient id="f" x1="40.493" x2="40.493" y1="29.595" y2="78.236" gradientUnits="userSpaceOnUse">
2306
+ <stop stop-color="#FDFEFF"/>
2307
+ <stop offset=".996" stop-color="#ECF0F5"/>
2308
+ </linearGradient>
2309
+ <linearGradient id="g" x1="35.801" x2="45.385" y1="43.069" y2="43.069" gradientUnits="userSpaceOnUse">
2310
+ <stop stop-color="#B0BACC"/>
2311
+ <stop offset="1" stop-color="#969EAE"/>
2312
+ </linearGradient>
2313
+ <linearGradient id="h" x1="40.552" x2="40.552" y1="54.162" y2="51.953" gradientUnits="userSpaceOnUse">
2314
+ <stop stop-color="#fff"/>
2315
+ <stop offset="1" stop-color="#E2E5EC"/>
2316
+ </linearGradient>
2317
+ <linearGradient id="j" x1="145.166" x2="145.166" y1="29.595" y2="78.236" gradientUnits="userSpaceOnUse">
2318
+ <stop stop-color="#FDFEFF"/>
2319
+ <stop offset=".996" stop-color="#ECF0F5"/>
2320
+ </linearGradient>
2321
+ <linearGradient id="k" x1="140.474" x2="150.059" y1="43.069" y2="43.069" gradientUnits="userSpaceOnUse">
2322
+ <stop stop-color="#B0BACC"/>
2323
+ <stop offset="1" stop-color="#969EAE"/>
2324
+ </linearGradient>
2325
+ <linearGradient id="l" x1="145.225" x2="145.225" y1="54.162" y2="51.953" gradientUnits="userSpaceOnUse">
2326
+ <stop stop-color="#fff"/>
2327
+ <stop offset="1" stop-color="#E2E5EC"/>
2328
+ </linearGradient>
2329
+ <linearGradient id="m" x1="138.084" x2="177.007" y1="117.787" y2="117.787" gradientUnits="userSpaceOnUse">
2330
+ <stop stop-color="#FF6551"/>
2331
+ <stop offset="1" stop-color="#FF9F92"/>
2332
+ </linearGradient>
2333
+ <linearGradient id="n" x1="38.676" x2="147.361" y1="54.331" y2="54.331" gradientUnits="userSpaceOnUse">
2334
+ <stop stop-color="#FF6551"/>
2335
+ <stop offset="1" stop-color="#FF9F92"/>
2336
+ </linearGradient>
2337
+ <filter id="a" width="95.532" height="112.12" x="45.415" y="9.146" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">
2338
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2339
+ <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
2340
+ <feOffset dy="11"/>
2341
+ <feGaussianBlur stdDeviation="11"/>
2342
+ <feColorMatrix values="0 0 0 0 0.397708 0 0 0 0 0.47749 0 0 0 0 0.575 0 0 0 0.27 0"/>
2343
+ <feBlend in2="BackgroundImageFix" result="effect1_dropShadow_1211:246"/>
2344
+ <feBlend in="SourceGraphic" in2="effect1_dropShadow_1211:246" result="shape"/>
2345
+ </filter>
2346
+ <filter id="e" width="79.601" height="91.045" x=".704" y="19.683" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">
2347
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2348
+ <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
2349
+ <feOffset dy="11"/>
2350
+ <feGaussianBlur stdDeviation="11"/>
2351
+ <feColorMatrix values="0 0 0 0 0.397708 0 0 0 0 0.47749 0 0 0 0 0.575 0 0 0 0.27 0"/>
2352
+ <feBlend in2="BackgroundImageFix" result="effect1_dropShadow_1211:246"/>
2353
+ <feBlend in="SourceGraphic" in2="effect1_dropShadow_1211:246" result="shape"/>
2354
+ </filter>
2355
+ <filter id="i" width="79.601" height="91.045" x="105.377" y="19.683" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">
2356
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
2357
+ <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
2358
+ <feOffset dy="11"/>
2359
+ <feGaussianBlur stdDeviation="11"/>
2360
+ <feColorMatrix values="0 0 0 0 0.397708 0 0 0 0 0.47749 0 0 0 0 0.575 0 0 0 0.27 0"/>
2361
+ <feBlend in2="BackgroundImageFix" result="effect1_dropShadow_1211:246"/>
2362
+ <feBlend in="SourceGraphic" in2="effect1_dropShadow_1211:246" result="shape"/>
2363
+ </filter>
2364
+ </defs>
2365
+ </svg>
2366
+
2367
+ <h1 style='font-size: 36px; line-height: 1; font-weight: 500; --flow-space: 1.5rem'>
2368
+ Consent Denied
2369
+ </h1>
2370
+
2371
+ <p class='color-grey' style='--flow-space: 1rem'>
2372
+ We cannot verify you without your consent
2373
+ </p>
2374
+
2375
+ <p>
2376
+ Wish to correct that?
2377
+ </p>
2378
+ </section>
2379
+
2380
+ <button data-variant='solid' type='button' id='back-to-consent'>
2381
+ <svg style='transform: rotate(.5turn);' width="25" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
2382
+ <path d="M7 12h11m0 0-4.588-4M18 12l-4.588 4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2383
+ </svg>
2384
+ Go Back
2385
+ </button>
2386
+
2387
+ <button data-variant='outline' id='confirm-consent-rejection' style='--flow-space: 1rem; border-radius: 2rem'>
2388
+ No, Cancel Verification
2389
+ </button>
2390
+
2391
+ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
2392
+ </div>
2393
+ `}class Ro extends HTMLElement{constructor(){super(),this.idRequiresTotpConsent=["BVN_MFA"],this.templateString=bl.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",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(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:{...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",Ro);function wl(){return`
2394
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
2395
+ <link
2396
+ href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap"
2397
+ rel="stylesheet"
2398
+ />
2399
+ <style>
2400
+ :host {
2401
+ --theme-color: ${this.themeColor||"#001096"}
2402
+ --color-active: #001096;
2403
+ --color-default: #2d2b2a;
2404
+ --color-disabled: #848282;
2405
+ }
2406
+
2407
+ * {
2408
+ font-family: "DM Sans", sans-serif;
2409
+ }
2410
+
2411
+ [hidden] {
2412
+ display: none !important;
2413
+ }
2414
+
2415
+ [disabled] {
2416
+ cursor: not-allowed !important;
2417
+ filter: grayscale(75%);
2418
+ }
2419
+
2420
+ .visually-hidden {
2421
+ border: 0;
2422
+ clip: rect(1px 1px 1px 1px);
2423
+ clip: rect(1px, 1px, 1px, 1px);
2424
+ height: auto;
2425
+ margin: 0;
2426
+ overflow: hidden;
2427
+ padding: 0;
2428
+ position: absolute;
2429
+ white-space: nowrap;
2430
+ width: 1px;
2431
+ }
2432
+
2433
+ img {
2434
+ height: auto;
2435
+ max-width: 100%;
2436
+ transform: scaleX(-1);
2437
+ }
2438
+
2439
+ video {
2440
+ background-color: black;
2441
+ }
2442
+
2443
+ a {
2444
+ color: currentColor;
2445
+ text-decoration: none;
2446
+ }
2447
+
2448
+ svg {
2449
+ max-width: 100%;
2450
+ }
2451
+
2452
+ .color-gray {
2453
+ color: #797979;
2454
+ }
2455
+
2456
+ .color-red {
2457
+ color: red;
2458
+ }
2459
+
2460
+ .color-richblue {
2461
+ color: #4e6577;
2462
+ }
2463
+
2464
+ .color-richblue-shade {
2465
+ color: #0e1b42;
2466
+ }
2467
+
2468
+ .color-digital-blue {
2469
+ color: #001096 !important;
2470
+ }
2471
+
2472
+ .color-deep-blue {
2473
+ color: #001096;
2474
+ }
2475
+
2476
+ .center {
2477
+ text-align: center;
2478
+ margin-left: auto;
2479
+ margin-right: auto;
2480
+ }
2481
+
2482
+ .font-size-small {
2483
+ font-size: 0.75rem;
2484
+ }
2485
+
2486
+ .font-size-large {
2487
+ font-size: 1.5rem;
2488
+ }
2489
+
2490
+ .text-transform-uppercase {
2491
+ text-transform: uppercase;
2492
+ }
2493
+
2494
+ [id*=-"screen"] {
2495
+ min-block-size: 100%;
2496
+ }
2497
+
2498
+ [data-variant~="full-width"] {
2499
+ inline-size: 100%;
2500
+ }
2501
+
2502
+ .flow > * + * {
2503
+ margin-top: 1rem;
2504
+ }
2505
+
2506
+ .button {
2507
+ --button-color: var(--theme-color);
2508
+ -webkit-appearance: none;
2509
+ appearance: none;
2510
+ border-radius: 2.5rem;
2511
+ border: 0;
2512
+ background-color: transparent;
2513
+ color: #fff;
2514
+ cursor: pointer;
2515
+ display: block;
2516
+ font-size: 18px;
2517
+ font-weight: 600;
2518
+ padding: 0.75rem 1.5rem;
2519
+ text-align: center;
2520
+ }
2521
+
2522
+ .button:hover,
2523
+ .button:focus,
2524
+ .button:active {
2525
+ --button-color: var(--color-default);
2526
+ }
2527
+
2528
+ .button:disabled {
2529
+ --button-color: var(--color-disabled);
2530
+ }
2531
+
2532
+ .button[data-variant~="solid"] {
2533
+ background-color: var(--button-color);
2534
+ border: 2px solid var(--button-color);
2535
+ }
2536
+
2537
+ .button[data-variant~="outline"] {
2538
+ color: var(--button-color);
2539
+ border: 2px solid var(--button-color);
2540
+ }
2541
+
2542
+ .button[data-variant~="ghost"] {
2543
+ padding: 0px;
2544
+ color: var(--button-color);
2545
+ background-color: transparent;
2546
+ }
2547
+
2548
+ .icon-btn {
2549
+ appearance: none;
2550
+ background: none;
2551
+ border: none;
2552
+ color: hsl(0deg 0% 94%);
2553
+ cursor: pointer;
2554
+ display: flex;
2555
+ align-items: center;
2556
+ justify-content: center;
2557
+ padding: 4px 8px;
2558
+ }
2559
+ .justify-right {
2560
+ justify-content: end !important;
2561
+ }
2562
+ .nav {
2563
+ display: flex;
2564
+ justify-content: space-between;
2565
+ }
2566
+
2567
+ .back-wrapper {
2568
+ display: flex;
2569
+ align-items: center;
2570
+ }
2571
+
2572
+ .back-button {
2573
+ display: block !important;
2574
+ }
2575
+ .back-button-text {
2576
+ font-size: 11px;
2577
+ line-height: 11px;
2578
+ color: rgb(21, 31, 114);
2579
+ }
2580
+ .section {
2581
+ border: 1px solid #f4f4f4;
2582
+ border-radius: 0.5rem;
2583
+ margin-left: auto;
2584
+ margin-right: auto;
2585
+ max-width: 35ch;
2586
+ padding: 1rem;
2587
+ }
2588
+
2589
+ .selfie-capture-review-image {
2590
+ overflow: hidden;
2591
+ aspect-ratio: 1/1;
2592
+ }
2593
+
2594
+ #review-image {
2595
+ scale: 1.75;
2596
+ }
2597
+
2598
+ @media (max-aspect-ratio: 1/1) {
2599
+ #review-image {
2600
+ transform: scaleX(-1) translateY(-10%);
2601
+ }
2602
+ }
2603
+
2604
+ .tips,
2605
+ .powered-by {
2606
+ align-items: center;
2607
+ border-radius: 0.25rem;
2608
+ color: #4e6577;
2609
+ display: flex;
2610
+ justify-content: center;
2611
+ letter-spacing: 0.075em;
2612
+ }
2613
+
2614
+ .powered-by {
2615
+ box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
2616
+ display: inline-flex;
2617
+ font-size: 0.5rem;
2618
+ }
2619
+
2620
+ .tips {
2621
+ margin-left: auto;
2622
+ margin-right: auto;
2623
+ max-width: 17rem;
2624
+ }
2625
+
2626
+ .tips > * + *,
2627
+ .powered-by > * + * {
2628
+ display: inline-block;
2629
+ margin-left: 0.5em;
2630
+ }
2631
+
2632
+ .powered-by .company {
2633
+ color: #18406d;
2634
+ font-weight: 700;
2635
+ letter-spacing: 0.15rem;
2636
+ }
2637
+
2638
+ .logo-mark {
2639
+ background-color: #004071;
2640
+ display: inline-block;
2641
+ padding: 0.25em 0.5em;
2642
+ }
2643
+
2644
+ .logo-mark svg {
2645
+ height: auto;
2646
+ justify-self: center;
2647
+ width: 0.75em;
2648
+ }
2649
+
2650
+ #selfie-capture-instruction-screen {
2651
+ display: flex;
2652
+ flex-direction: column;
2653
+ max-block-size: 100%;
2654
+ max-inline-size: 40ch;
2655
+ }
2656
+
2657
+ #selfie-capture-instruction-screen header p {
2658
+ margin-block: 0 !important;
2659
+ }
2660
+
2661
+ .instructions {
2662
+ margin-block-start: 1.5rem;
2663
+ display: flex;
2664
+ align-items: center;
2665
+ text-align: initial;
2666
+ gap: 1rem;
2667
+ }
2668
+
2669
+ .instructions svg {
2670
+ flex-shrink: 0;
2671
+ margin-inline-end: 1rem;
2672
+ }
2673
+
2674
+ .instructions p {
2675
+ margin-block: 0;
2676
+ }
2677
+
2678
+ h1 {
2679
+ color: ${this.themeColor};
2680
+ text-align: center;
2681
+
2682
+ /* h1 */
2683
+ font-size: 1.5rem;
2684
+ font-style: normal;
2685
+ font-weight: 700;
2686
+ line-height: 36px; /* 150% */
2687
+ }
2688
+
2689
+ .tip-header {
2690
+ color: ${this.themeColor};
2691
+ }
2692
+ </style>
2693
+ ${qt(this.themeColor)}
2694
+ <div id="selfie-capture-instruction-screen" class="flow center">
2695
+ <smileid-navigation theme-color=${this.themeColor} ${this.hideBack?"hide-back":""} ${this.showNavigation?"":"hidden"}></smileid-navigation>
2696
+ <header>
2697
+ <svg xmlns="http://www.w3.org/2000/svg" width="65" height="91" viewBox="0 0 65 91" fill="none">
2698
+ <g clip-path="url(#clip0_604_692)">
2699
+ <path d="M36.6833 60.4888C26.9272 54.8682 13.1977 54.3026 5.53473 59.2162C-2.12824 64.1298 -0.851078 72.9318 8.05358 78.9413L17.8806 85.1274L51.5126 69.6797L36.7188 60.4534H36.6478L36.6833 60.4888Z" fill="#3B3837"/>
2700
+ <path d="M27.5624 90.5007L17.9127 85.0923C17.9127 85.0923 17.9127 74.6288 18.1256 70.4929C18.232 68.2305 23.2342 37.441 44.1655 34.6484C48.1389 34.1182 56.8662 40.5871 56.8662 40.5871" fill="#91190F"/>
2701
+ <path d="M27.5624 90.5007L17.9127 85.0923C17.9127 85.0923 17.9127 74.6288 18.1256 70.4929C18.232 68.2305 23.2342 37.441 44.1655 34.6484C48.1389 34.1182 56.8662 40.5871 56.8662 40.5871" fill="#3B3837"/>
2702
+ <path d="M64.0705 51.9698C63.8931 41.0114 56.2301 36.5927 46.7224 42.0366C37.0727 47.5511 29.055 60.9486 28.3454 72.2958L27.5649 90.4655L63.7512 69.5739L64.1769 51.8991H64.106L64.0705 51.9698Z" fill="#7ECAF0"/>
2703
+ <path d="M44.2729 28.3906L30.0112 36.521L30.4015 19.73L44.6631 11.5643L44.2729 28.3906Z" fill="#F8CEEB"/>
2704
+ <path d="M53.959 33.8711L39.6974 42.0368L40.0876 25.2104L54.3493 17.0447L53.959 33.8711Z" fill="#7ECAF0"/>
2705
+ <path d="M44.6631 11.5643L54.3483 17.0434L40.0866 25.2092L39.6964 42.0356L30.0112 36.521L30.4015 19.73L44.6631 11.5643Z" fill="#3B3837"/>
2706
+ <path d="M53.0767 51.0497L59.9591 46.8785L59.9237 36.9099L64.4647 34.3294L64.5002 49.4236L53.0767 56.2461V51.0497Z" fill="#FF5805"/>
2707
+ <path d="M54.0676 54.5139L63.5044 48.8933L63.469 36.026L60.9146 37.4754V47.4439L54.0676 51.5798V54.5139Z" fill="#FF5805"/>
2708
+ <path d="M30.4053 52.2515L34.9463 49.6356V60.8414L44.0638 55.1855V60.4172L30.4407 68.7244L30.4053 52.2515Z" fill="#FF5805"/>
2709
+ <path d="M31.4317 66.9921L43.0681 59.8869V56.9529L33.9506 62.6088V51.3323L31.3962 52.817L31.4317 66.9921Z" fill="#FF5805"/>
2710
+ <path d="M30.4053 19.7312L42.5383 13.0148V18.1759L34.9463 22.3471V32.4924L30.4407 35.073L30.4053 19.7312Z" fill="#FF5805"/>
2711
+ <path d="M31.3962 33.377L33.9506 31.9276V21.7823L41.5426 17.6111V14.6771L31.3962 20.2976V28.7815V33.377Z" fill="#FF5805"/>
2712
+ <path d="M59.9223 8.27746L53.5365 11.9538V6.79277L64.4279 0.500549L64.4633 16.5846L59.9578 19.1651L59.9223 8.27746Z" fill="#FF5805"/>
2713
+ <path d="M60.9142 17.4682L63.504 16.0189L63.4685 2.19722L54.4929 7.35826L54.5284 10.2569L60.9142 6.58057V17.4682Z" fill="#FF5805"/>
2714
+ </g>
2715
+ <defs>
2716
+ <clipPath id="clip0_604_692">
2717
+ <rect width="64" height="90" fill="white" transform="translate(0.5 0.5)"/>
2718
+ </clipPath>
2719
+ </defs>
2720
+ </svg>
2721
+ <h1 class='text-2xl title-color font-bold'>Next, we'll take a quick selfie</h1>
2722
+ </header>
2723
+ <div class="flow instructions-wrapper">
2724
+ <div class="instructions">
2725
+ <svg
2726
+ xmlns="http://www.w3.org/2000/svg"
2727
+ width="38"
2728
+ height="38"
2729
+ viewBox="0 0 38 38"
2730
+ fill="none"
2731
+ >
2732
+ <g clip-path="url(#clip0_604_670)">
2733
+ <path
2734
+ fill-rule="evenodd"
2735
+ clip-rule="evenodd"
2736
+ d="M31.8569 19C31.8569 21.5428 31.1029 24.0285 29.6902 26.1428C28.2774 28.2571 26.2695 29.9049 23.9203 30.878C21.571 31.8511 18.986 32.1057 16.492 31.6096C13.9981 31.1136 11.7072 29.8891 9.90919 28.091C8.11115 26.293 6.88668 24.0022 6.3906 21.5082C5.89452 19.0143 6.14913 16.4292 7.12222 14.08C8.09531 11.7307 9.74318 9.72279 11.8574 8.31008C13.9717 6.89737 16.4574 6.14334 19.0002 6.14334C22.41 6.14334 25.6802 7.49788 28.0913 9.90897C30.5024 12.3201 31.8569 15.5902 31.8569 19Z"
2737
+ fill="${this.themeColor}"
2738
+ />
2739
+ <path
2740
+ d="M19.6064 4.5419H18.394L18.9912 0L19.6064 4.5419Z"
2741
+ fill="${this.themeColor}"
2742
+ />
2743
+ <path
2744
+ d="M26.7541 6.77667L25.7046 6.17048L28.4913 2.54239L26.7541 6.77667Z"
2745
+ fill="${this.themeColor}"
2746
+ />
2747
+ <path
2748
+ d="M31.8298 12.2957L31.2236 11.2462L35.4489 9.49097L31.8298 12.2957Z"
2749
+ fill="${this.themeColor}"
2750
+ />
2751
+ <path
2752
+ d="M33.4674 19.6062V18.3938L38.0003 18.9909L33.4674 19.6062Z"
2753
+ fill="${this.themeColor}"
2754
+ />
2755
+ <path
2756
+ d="M31.2236 26.7538L31.8298 25.7043L35.4579 28.491L31.2236 26.7538Z"
2757
+ fill="${this.themeColor}"
2758
+ />
2759
+ <path
2760
+ d="M25.7046 31.8295L26.7541 31.2233L28.5094 35.4486L25.7046 31.8295Z"
2761
+ fill="${this.themeColor}"
2762
+ />
2763
+ <path
2764
+ d="M18.394 33.4671H19.6064L19.0093 38L18.394 33.4671Z"
2765
+ fill="${this.themeColor}"
2766
+ />
2767
+ <path
2768
+ d="M11.2464 31.2233L12.2959 31.8295L9.50928 35.4576L11.2464 31.2233Z"
2769
+ fill="${this.themeColor}"
2770
+ />
2771
+ <path
2772
+ d="M6.17068 25.7043L6.77687 26.7538L2.55164 28.509L6.17068 25.7043Z"
2773
+ fill="${this.themeColor}"
2774
+ />
2775
+ <path
2776
+ d="M4.54215 18.3938V19.6062L0.000244141 19.009L4.54215 18.3938Z"
2777
+ fill="${this.themeColor}"
2778
+ />
2779
+ <path
2780
+ d="M6.77689 11.2462L6.1707 12.2957L2.5426 9.50903L6.77689 11.2462Z"
2781
+ fill="${this.themeColor}"
2782
+ />
2783
+ <path
2784
+ d="M12.296 6.17047L11.2464 6.77666L9.49121 2.55142L12.296 6.17047Z"
2785
+ fill="${this.themeColor}"
2786
+ />
2787
+ </g>
2788
+ <defs>
2789
+ <clipPath id="clip0_604_670">
2790
+ <rect
2791
+ width="38"
2792
+ height="38"
2793
+ fill="white"
2794
+ transform="translate(0.000244141)"
2795
+ />
2796
+ </clipPath>
2797
+ </defs>
2798
+ </svg>
2799
+ <div class="instruction">
2800
+ <p class="text-base title-color font-bold tip-header">Good Light</p>
2801
+ <p class="tip-body">
2802
+ Make sure you are in a well-lit environment where your face is
2803
+ clear and visible.
2804
+ </p>
2805
+ </div>
2806
+ </div>
2807
+ <div class="instructions">
2808
+ <svg
2809
+ xmlns="http://www.w3.org/2000/svg"
2810
+ width="38"
2811
+ height="36"
2812
+ viewBox="0 0 38 36"
2813
+ fill="none"
2814
+ >
2815
+ <g clip-path="url(#clip0_604_672)">
2816
+ <path
2817
+ d="M36.7211 12.6391H1.22537C1.06275 13.0909 0.910962 13.5427 0.77002 14.0055H37.1764C37.0463 13.5427 36.8946 13.0909 36.7211 12.6391Z"
2818
+ fill="${this.themeColor}"
2819
+ />
2820
+ <path
2821
+ d="M37.3716 14.7438H0.574875C0.466458 15.1625 0.379725 15.5813 0.303833 16.011H37.6426C37.5667 15.5813 37.48 15.1625 37.3716 14.7438Z"
2822
+ fill="${this.themeColor}"
2823
+ />
2824
+ <path
2825
+ d="M37.7727 16.8485H0.173703C0.119494 17.2342 0.0869685 17.6198 0.0544434 18.0055H37.892C37.8594 17.6198 37.8269 17.2342 37.7727 16.8485Z"
2826
+ fill="${this.themeColor}"
2827
+ />
2828
+ <path
2829
+ d="M37.9462 19.4711C37.9462 19.2948 37.9462 19.1295 37.9353 18.9532H0.0110865C0.000244802 19.1295 0.000244141 19.2948 0.000244141 19.4711C0.000244141 19.6474 0.000244802 19.8347 0.0110865 20.011H37.9353C37.9462 19.8347 37.9462 19.6474 37.9462 19.4711Z"
2830
+ fill="${this.themeColor}"
2831
+ />
2832
+ <path
2833
+ d="M37.8811 21.0579H0.0653076C0.086991 21.3774 0.119515 21.697 0.162882 22.0055H37.7836C37.8269 21.697 37.8595 21.3774 37.8811 21.0579Z"
2834
+ fill="${this.themeColor}"
2835
+ />
2836
+ <path
2837
+ d="M37.5992 23.1625H0.347168C0.401376 23.449 0.466426 23.7245 0.531477 24H37.4149C37.48 23.7245 37.545 23.449 37.5992 23.1625Z"
2838
+ fill="${this.themeColor}"
2839
+ />
2840
+ <path
2841
+ d="M37.0788 25.2672H0.867554C0.954287 25.5096 1.03018 25.7631 1.11691 26.0055H36.8295C36.9162 25.7631 37.0029 25.5096 37.0788 25.2672Z"
2842
+ fill="${this.themeColor}"
2843
+ />
2844
+ <path
2845
+ d="M36.2874 27.3719H1.65906L1.95178 28H35.9947L36.2874 27.3719Z"
2846
+ fill="${this.themeColor}"
2847
+ />
2848
+ <path
2849
+ d="M35.2032 29.4766H2.75403C2.84799 29.6529 2.95641 29.8292 3.07928 30.0055H34.878L35.2032 29.4766Z"
2850
+ fill="${this.themeColor}"
2851
+ />
2852
+ <path
2853
+ d="M33.7396 31.5813H4.20679L4.54288 32H33.4035L33.7396 31.5813Z"
2854
+ fill="${this.themeColor}"
2855
+ />
2856
+ <path
2857
+ d="M31.7989 33.6859H6.14746L6.49439 33.9945H31.452L31.7989 33.6859Z"
2858
+ fill="${this.themeColor}"
2859
+ />
2860
+ <path
2861
+ d="M29.0993 35.7906H8.84705L9.18314 36H28.7632L29.0993 35.7906Z"
2862
+ fill="${this.themeColor}"
2863
+ />
2864
+ <path
2865
+ d="M34.2384 8.01102C33.8914 7.53719 33.5228 7.07438 33.1325 6.63361C29.8258 2.60055 24.6977 0 18.9407 0C12.891 0 7.53525 2.86501 4.25021 7.26171H4.28274C4.08759 7.51515 3.89244 7.75757 3.70813 8.01102H34.2384Z"
2866
+ fill="${this.themeColor}"
2867
+ />
2868
+ <path
2869
+ d="M34.531 8.44077H3.41533C3.06839 8.94765 2.74314 9.47658 2.43958 10.0165H35.5068C35.2124 9.47215 34.8866 8.94597 34.531 8.44077Z"
2870
+ fill="${this.themeColor}"
2871
+ />
2872
+ <path
2873
+ d="M35.7887 10.5344H2.15776C1.9084 11.0193 1.68072 11.5151 1.47473 12.011H36.4717C36.2657 11.5151 36.0381 11.0193 35.7887 10.5344Z"
2874
+ fill="${this.themeColor}"
2875
+ />
2876
+ </g>
2877
+ <defs>
2878
+ <clipPath id="clip0_604_672">
2879
+ <rect
2880
+ width="37.9459"
2881
+ height="36"
2882
+ fill="white"
2883
+ transform="translate(0.000244141)"
2884
+ />
2885
+ </clipPath>
2886
+ </defs>
2887
+ </svg>
2888
+ <div class="instruction">
2889
+ <p class="text-base title-color font-bold tip-header">Clear Image</p>
2890
+ <p>
2891
+ Hold your phone steady so the selfie is clear and sharp. Don't
2892
+ take blurry images.
2893
+ </p>
2894
+ </div>
2895
+ </div>
2896
+ <div class="instructions">
2897
+ <svg
2898
+ xmlns="http://www.w3.org/2000/svg"
2899
+ width="38"
2900
+ height="38"
2901
+ viewBox="0 0 38 38"
2902
+ fill="none"
2903
+ >
2904
+ <path
2905
+ d="M18.9496 0C18.9496 0 13.9842 6.03205e-06 11.1469 1.09139C8.30957 2.18277 8.41092 4.46476 7.80292 6.15145C7.28787 7.56786 6.91455 9.02989 6.68824 10.517C6.68824 10.517 4.86424 11.3107 3.24291 12.2036C2.43378 12.6113 1.72475 13.1862 1.16487 13.8886C0.604986 14.5909 0.207618 15.404 0.000244141 16.2715C0.506911 21.4308 6.68824 23.6136 6.68824 23.6136C6.67321 21.7242 6.77473 19.8356 6.99225 17.9582C7.29625 16.47 7.90424 15.7754 10.4376 14.6841C12.9709 13.5927 18.9496 13.1958 18.9496 13.1958C18.9496 13.1958 24.9282 13.5927 27.4616 14.6841C29.9949 15.7754 30.7042 16.47 31.0082 17.9582C31.2258 19.8356 31.3273 21.7242 31.3122 23.6136C31.3122 23.6136 37.3922 21.4308 38.0002 16.2715C37.5126 14.5484 36.3463 13.0853 34.7576 12.2036L31.2109 10.517C30.9867 9.03874 30.6479 7.57936 30.1976 6.15145C29.4882 4.46476 28.4749 1.78591 26.8536 1.09139C25.2322 0.396873 18.9496 0 18.9496 0Z"
2906
+ fill="${this.themeColor}"
2907
+ />
2908
+ <path
2909
+ d="M10.7416 21.53C12.8058 21.6524 14.8473 22.0188 16.8216 22.6214C18.6235 23.1643 20.5642 23.0588 22.2936 22.3238C24.8269 21.2324 27.5629 21.4308 30.1976 21.6292C30.7849 21.6319 31.3675 21.7326 31.9202 21.9269C32.4269 22.1253 32.4269 22.423 32.4269 23.2167C32.14 24.7237 31.6635 26.19 31.0083 27.5822C30.7799 28.1169 30.4019 28.5776 29.9179 28.9111C29.4338 29.2446 28.8634 29.4375 28.2723 29.4674C27.2359 29.6525 26.1773 29.6859 25.1309 29.5666C24.279 29.5405 23.4506 29.2863 22.736 28.8315C22.0214 28.3766 21.4478 27.7387 21.0776 26.987C20.8887 26.3594 20.6161 25.7589 20.2669 25.201C19.8616 24.705 19.5576 24.5065 19.0509 24.6057C18.7188 24.5693 18.3842 24.6489 18.1061 24.8304C17.828 25.0119 17.6243 25.2837 17.5309 25.5979C16.9229 27.0862 16.4162 28.6736 14.6936 29.2689C13.939 29.5055 13.1548 29.6391 12.3629 29.6658C11.2345 29.6928 10.1081 29.5591 9.01892 29.2689C7.39759 28.7728 6.89092 27.3838 6.38425 25.8956C6.24296 25.2819 6.03928 24.6836 5.77625 24.1096C5.57359 23.5143 5.37092 23.1175 5.67492 22.5222C5.97892 21.9269 6.18159 22.0261 6.68825 21.9269C8.02604 21.6866 9.38168 21.5538 10.7416 21.53ZM12.0589 28.8721C14.4909 28.5744 14.8963 28.5744 15.6056 27.3838C16.0105 26.8072 16.3184 26.1708 16.5176 25.4987C16.9229 24.3081 16.7203 23.7128 15.6056 23.2167C13.2959 22.2331 10.6949 22.127 8.30959 22.9191C8.07105 23.0198 7.85723 23.1693 7.68248 23.3575C7.50772 23.5458 7.37604 23.7684 7.29626 24.0105C7.12045 24.8478 7.19957 25.7172 7.52382 26.5109C7.84807 27.3046 8.40315 27.9876 9.12025 28.4752C10.0603 28.8088 11.0617 28.9441 12.0589 28.8721ZM25.7389 28.9713C26.8173 28.9934 27.8881 28.7904 28.8802 28.376C30.7042 27.5823 30.7043 25.7963 30.7043 24.1096C30.7043 22.423 29.9949 22.9191 29.2856 22.7206C27.3226 22.2044 25.2509 22.2387 23.3069 22.8198C23.0246 22.8282 22.7476 22.8972 22.4956 23.0221C22.2436 23.1469 22.0228 23.3245 21.8487 23.5423C21.6746 23.7601 21.5516 24.0127 21.4884 24.2822C21.4252 24.5517 21.4233 24.8315 21.4829 25.1018C21.6856 27.3838 23.1043 28.5744 25.7389 28.9713Z"
2910
+ fill="${this.themeColor}"
2911
+ />
2912
+ <path
2913
+ d="M11.9576 24.4073C10.8429 24.4073 9.93091 25.1018 9.93091 25.7963V26.2924C9.9546 26.4062 10.0183 26.5082 10.1109 26.5807C10.2034 26.6532 10.319 26.6916 10.4376 26.6893C10.8429 26.6893 11.0456 26.4909 11.0456 26.2924V25.7963C11.0456 25.4987 11.4509 25.201 11.9576 25.201C12.4642 25.201 12.8696 25.4987 12.8696 25.7963V26.2924C12.8696 26.4909 13.1736 26.6893 13.4776 26.6893C13.5961 26.6916 13.7117 26.6532 13.8043 26.5807C13.8969 26.5082 13.9606 26.4062 13.9842 26.2924V25.7963C13.9842 25.1018 13.0722 24.4073 11.9576 24.4073Z"
2914
+ fill="${this.themeColor}"
2915
+ />
2916
+ <path
2917
+ d="M26.1442 24.4073C24.9282 24.4073 24.0162 25.1018 24.0162 25.7963V26.2924C24.0162 26.4909 24.3202 26.6893 24.6242 26.6893C24.9282 26.6893 25.2322 26.4909 25.2322 26.2924V25.7963C25.2322 25.4987 25.6376 25.201 26.1442 25.201C26.6509 25.201 27.0562 25.4987 27.0562 25.7963V26.2924C27.0799 26.4062 27.1436 26.5082 27.2362 26.5807C27.3287 26.6532 27.4444 26.6916 27.5629 26.6893C27.8669 26.6893 28.1709 26.4909 28.1709 26.2924V25.7963C28.1709 25.1018 27.2589 24.4073 26.1442 24.4073Z"
2918
+ fill="${this.themeColor}"
2919
+ />
2920
+ </svg>
2921
+ <div class="instruction">
2922
+ <p class="text-base title-color font-bold tip-header">Remove Obstructions</p>
2923
+ <p>
2924
+ Remove anything that covers your face, such glasses, masks, hats
2925
+ and scarves.
2926
+ </p>
2927
+ </div>
2928
+ </div>
2929
+ <div class="instructions">
2930
+ <svg xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 24 24" fill="none" stroke="${this.themeColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-mood-happy"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M9 9l.01 0" /><path d="M15 9l.01 0" /><path d="M8 13a4 4 0 1 0 8 0h-8" /></svg>
2931
+ <div class="instruction">
2932
+ <p class="text-base title-color font-bold tip-header">Big Smile</p>
2933
+ <p>
2934
+ When asked to smile, give a big smile, showing your teeth and keep your eyes open.
2935
+ </p>
2936
+ </div>
2937
+ </div>
2938
+ <section class='flow' style='--flow-space: 2.5rem'>
2939
+ <button id='allow' data-variant='solid full-width' class='button theme-background'>
2940
+ Allow
2941
+ </button>
2942
+ <button id='cancel' data-variant='outline full-width' class="button" style='--flow-space: 1.5rem' ${this.hideBack||!this.showNavigation?"hidden":""}>
2943
+ Cancel
2944
+ </button>
2945
+ </section>
2946
+ </div>
2947
+ ${this.hideAttribution?"":`
2948
+ <powered-by-smile-id></powered-by-smile-id>
2949
+ `}
2950
+ </div>
2951
+ `}class yl extends HTMLElement{constructor(){super(),this.templateString=wl.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.cancelButton=this.shadowRoot.querySelector("#cancel"),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),this.cancelButton.addEventListener("click",()=>{this.handleBackEvents()})}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",yl);function _l(){return`
2952
+ <style>
2953
+ .retake-photo.button[data-variant~="ghost"] {
2954
+ color: #FF5805;
2955
+ }
2956
+ .icon-btn {
2957
+ appearance: none;
2958
+ background: none;
2959
+ border: none;
2960
+ color: hsl(0deg 0% 94%);
2961
+ cursor: pointer;
2962
+ display: flex;
2963
+ align-items: center;
2964
+ justify-content: center;
2965
+ padding: 4px 8px;
2966
+ }
2967
+ .justify-right {
2968
+ justify-content: end !important;
2969
+ }
2970
+ .nav {
2971
+ display: flex;
2972
+ justify-content: space-between;
2973
+ }
2974
+ .back-wrapper {
2975
+ display: flex;
2976
+ align-items: center;
2977
+ }
2978
+ .back-button-text {
2979
+ font-size: 11px;
2980
+ line-height: 11px;
2981
+ color: rgb(21, 31, 114);
2982
+ }
2983
+ .section {
2984
+ border-radius: .5rem;
2985
+ margin-left: auto;
2986
+ margin-right: auto;
2987
+ max-width: 35ch;
2988
+ padding: 1rem;
2989
+ }
2990
+ .selfie-capture-review-image {
2991
+ overflow: hidden;
2992
+ aspect-ratio: 1/1;
2993
+ }
2994
+ #review-image {
2995
+ scale: 1.75;
2996
+ }
2997
+ @media (max-aspect-ratio: 1/1) {
2998
+ #review-image {
2999
+ transform: scaleX(-1) translateY(-10%);
3000
+ }
3001
+ }
3002
+ .tips,
3003
+ .powered-by {
3004
+ align-items: center;
3005
+ border-radius: 0.25rem;
3006
+ color: #4e6577;
3007
+ display: flex;
3008
+ justify-content: center;
3009
+ letter-spacing: 0.075em;
3010
+ }
3011
+ .powered-by {
3012
+ box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
3013
+ display: inline-flex;
3014
+ font-size: 0.5rem;
3015
+ }
3016
+ .tips {
3017
+ margin-left: auto;
3018
+ margin-right: auto;
3019
+ max-width: 17rem;
3020
+ }
3021
+ .tips > * + *,
3022
+ .powered-by > * + * {
3023
+ display: inline-block;
3024
+ margin-left: 0.5em;
3025
+ }
3026
+ .powered-by .company {
3027
+ color: #18406d;
3028
+ font-weight: 700;
3029
+ letter-spacing: 0.15rem;
3030
+ }
3031
+ .logo-mark {
3032
+ background-color: #004071;
3033
+ display: inline-block;
3034
+ padding: 0.25em 0.5em;
3035
+ }
3036
+ .logo-mark svg {
3037
+ height: auto;
3038
+ justify-self: center;
3039
+ width: 0.75em;
3040
+ }
3041
+ #selfie-capture-review-screen {
3042
+ block-size: 45rem;
3043
+ display: flex;
3044
+ flex-direction: column;
3045
+ max-block-size: 100%;
3046
+ max-inline-size: 40ch;
3047
+ }
3048
+ #selfie-capture-review-screen .selfie-review-container.landscape {
3049
+ height: auto;
3050
+ }
3051
+ #selfie-capture-review-screen header p {
3052
+ margin-block: 0 !important;
3053
+ }
3054
+ .selfie-review-container.portrait {
3055
+ width: 100%;
3056
+ position: relative;
3057
+ height: calc(200px * 1.4);
3058
+ }
3059
+
3060
+ .selfie-review-container.portrait img {
3061
+ width: calc(213px + 0.9rem);
3062
+ height: 100%;
3063
+ position: absolute;
3064
+ top: 239px;
3065
+ left: 161px;
3066
+ padding-bottom: calc((214px * 1.4) / 3);
3067
+ padding-top: calc((191px * 1.4) / 3);
3068
+ object-fit: cover;
3069
+
3070
+ transform: translateX(-50%) translateY(-50%);
3071
+ z-index: 1;
3072
+ block-size: 100%;
3073
+ }
3074
+
3075
+ .selfie-container img {
3076
+ background-color: black;
3077
+ position: absolute;
3078
+ left: 50%;
3079
+ height: calc(100% - 6px);
3080
+ clip-path: ellipse(101px 118px);
3081
+ }
3082
+
3083
+ .description {
3084
+ color: var(--neutral-off-black, #2D2B2A);
3085
+ text-align: center;
3086
+ /* p */
3087
+ font-family: DM Sans;
3088
+ font-size: 0.875rem;
3089
+ font-style: normal;
3090
+ font-weight: 400;
3091
+ line-height: 18px;
3092
+ }
3093
+ .padding-bottom-2 {
3094
+ padding-bottom: 2rem;
3095
+ }
3096
+ .instructions-wrapper {
3097
+ display: inline-flex;
3098
+ flex-direction: column;
3099
+ align-items: flex-start;
3100
+ gap: 2rem;
3101
+ margin-block-start: 2rem;
3102
+ margin-block-end: 4rem;
3103
+ }
3104
+ .instructions {
3105
+ display: flex;
3106
+ align-items: center;
3107
+ text-align: initial;
3108
+ }
3109
+ .instructions svg {
3110
+ flex-shrink: 0;
3111
+ margin-inline-end: 2rem;
3112
+ }
3113
+ .instructions p {
3114
+ margin-block: 0;
3115
+ }
3116
+ .instruction-body {
3117
+ font-size: 0.75rem;
3118
+ }
3119
+ h1 {
3120
+ color: var(--web-digital-blue, #001096);
3121
+ text-align: center;
3122
+ /* h1 */
3123
+ font-size: 1.5rem;
3124
+ font-style: normal;
3125
+ font-weight: 700;
3126
+ line-height: 36px; /* 150% */
3127
+ }
3128
+ .p2 {
3129
+ font-size: 1rem;
3130
+ font-style: normal;
3131
+ font-weight: 500;
3132
+ line-height: 1rem;
3133
+ }
3134
+ .instruction-header {
3135
+ color: var(--web-digital-blue, #001096);
3136
+ }
3137
+ .h2 {
3138
+ font-size: 1rem;
3139
+ font-style: normal;
3140
+ font-weight: 700;
3141
+ line-height: 1.5rem;
3142
+ }
3143
+ </style>
3144
+ ${qt(this.themeColor)}
3145
+ <div id='selfie-capture-review-screen' class='flow center'>
3146
+ <smileid-navigation ${this.showNavigation?"show-navigation":""} hide-back></smileid-navigation>
3147
+ <h1 class="header-title text-2xl title-color font-bold">
3148
+ Is your whole face visible and clear in this photo?
3149
+ </h1>
3150
+ <div class='section | flow'>
3151
+ <div class='selfie-review-container ${this.isPortraitCaptureView?"portrait":"landscape"}'>
3152
+ ${this.imageSrc?`<img
3153
+ alt='your ID card'
3154
+ id='document-capture-review-image'
3155
+ src='${this.imageSrc}'
3156
+ width='396'
3157
+ />`:""}
3158
+ </div>
3159
+ <div class='flow action-buttons'>
3160
+ <button data-variant='solid full-width' class='button' type='button' id='select-id-image'>
3161
+ Yes, use this
3162
+ </button>
3163
+ <button data-variant='ghost full-width' class='button retake-photo' type='button' id='re-capture-image'>
3164
+ No, Retake Selfie
3165
+ </button>
3166
+ </div>
3167
+ ${this.hideAttribution?"":`
3168
+ <powered-by-smile-id></powered-by-smile-id>
3169
+ `}
3170
+ </div>
3171
+ </div>
3172
+ `}class Cl extends HTMLElement{constructor(){super(),this.templateString=_l.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("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":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",Cl);var Pi,F,$o,Oo,Oe,Po,No,Ho,Uo,Cr,xr,Er,Ni={},Vo=[],xl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Hi=Array.isArray;function te(t,e){for(var i in e)t[i]=e[i];return t}function kr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ce(t,e,i){var n,r,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Pi.call(arguments,2):i),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Ui(t,o,n,r,null)}function Ui(t,e,i,n,r){var s={type:t,props:e,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++$o,__i:-1,__u:0};return r==null&&F.vnode!=null&&F.vnode(s),s}function ye(t){return t.children}function Vi(t,e){this.props=t,this.context=e}function ti(t,e){if(e==null)return t.__?ti(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"?ti(t):null}function jo(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 jo(t)}}function Go(t){(!t.__d&&(t.__d=!0)&&Oe.push(t)&&!mn.__r++||Po!=F.debounceRendering)&&((Po=F.debounceRendering)||No)(mn)}function mn(){for(var t,e,i,n,r,s,o,a=1;Oe.length;)Oe.length>a&&Oe.sort(Ho),t=Oe.shift(),a=Oe.length,t.__d&&(i=void 0,r=(n=(e=t).__v).__e,s=[],o=[],e.__P&&((i=te({},n)).__v=n.__v+1,F.vnode&&F.vnode(i),Ar(e.__P,i,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,r??ti(n),!!(32&n.__u),o),i.__v=n.__v,i.__.__k[i.__i]=i,Yo(s,i,o),i.__e!=r&&jo(i)));mn.__r=0}function zo(t,e,i,n,r,s,o,a,c,l,d){var h,u,p,f,m,g,v=n&&n.__k||Vo,b=e.length;for(c=El(i,e,v,c,b),h=0;h<b;h++)(p=i.__k[h])!=null&&(u=p.__i==-1?Ni:v[p.__i]||Ni,p.__i=h,g=Ar(t,p,u,r,s,o,a,c,l,d),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&Sr(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=Zo(p,c,t):typeof p.type=="function"&&g!==void 0?c=g:f&&(c=f.nextSibling),p.__u&=-7);return i.__e=m,c}function El(t,e,i,n,r){var s,o,a,c,l,d=i.length,h=d,u=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+u,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ui(null,o,null,null,null):Hi(o)?Ui(ye,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ui(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(l=o.__i=kl(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))):t.__k[s]=null;if(h)for(s=0;s<d;s++)(a=i[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=ti(a)),Jo(a,a));return n}function Zo(t,e,i){var n,r;if(typeof t.type=="function"){for(n=t.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=t,e=Zo(n[r],e,i));return e}t.__e!=e&&(e&&t.type&&!i.contains(e)&&(e=ti(t)),i.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Wo(t,e){return e=e||[],t==null||typeof t=="boolean"||(Hi(t)?t.some(function(i){Wo(i,e)}):e.push(t)),e}function kl(t,e,i,n){var r,s,o=t.key,a=t.type,c=e[i];if(c===null&&t.key==null||c&&o==c.key&&a==c.type&&(2&c.__u)==0)return i;if(n>(c!=null&&(2&c.__u)==0?1:0))for(r=i-1,s=i+1;r>=0||s<e.length;){if(r>=0){if((c=e[r])&&(2&c.__u)==0&&o==c.key&&a==c.type)return r;r--}if(s<e.length){if((c=e[s])&&(2&c.__u)==0&&o==c.key&&a==c.type)return s;s++}}return-1}function qo(t,e,i){e[0]=="-"?t.setProperty(e,i??""):t[e]=i==null?"":typeof i!="number"||xl.test(e)?i:i+"px"}function gn(t,e,i,n,r){var s,o;t:if(e=="style")if(typeof i=="string")t.style.cssText=i;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)i&&e in i||qo(t.style,e,"");if(i)for(e in i)n&&i[e]==n[e]||qo(t.style,e,i[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Uo,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?n?i.u=n.u:(i.u=Cr,t.addEventListener(e,s?Er:xr,s)):t.removeEventListener(e,s?Er:xr,s);else{if(r=="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??"";break t}catch{}typeof i=="function"||(i==null||i===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&i==1?"":i))}}function Xo(t){return function(e){if(this.l){var i=this.l[e.type+t];if(e.t==null)e.t=Cr++;else if(e.t<i.u)return;return i(F.event?F.event(e):e)}}}function Ar(t,e,i,n,r,s,o,a,c,l){var d,h,u,p,f,m,g,v,b,k,S,O,ut,kt,At,wt,be,lt=e.type;if(e.constructor!=null)return null;128&i.__u&&(c=!!(32&i.__u),s=[a=e.__e=i.__e]),(d=F.__b)&&d(e);t:if(typeof lt=="function")try{if(v=e.props,b="prototype"in lt&&lt.prototype.render,k=(d=lt.contextType)&&n[d.__c],S=d?k?k.props.value:d.__:n,i.__c?g=(h=e.__c=i.__c).__=h.__E:(b?e.__c=h=new lt(v,S):(e.__c=h=new Vi(v,S),h.constructor=lt,h.render=Sl),k&&k.sub(h),h.props=v,h.state||(h.state={}),h.context=S,h.__n=n,u=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&lt.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=te({},h.__s)),te(h.__s,lt.getDerivedStateFromProps(v,h.__s))),p=h.props,f=h.state,h.__v=e,u)b&&lt.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&lt.getDerivedStateFromProps==null&&v!==p&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(v,S),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(v,h.__s,S)===!1||e.__v==i.__v){for(e.__v!=i.__v&&(h.props=v,h.state=h.__s,h.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);h._sb=[],h.__h.length&&o.push(h);break t}h.componentWillUpdate!=null&&h.componentWillUpdate(v,h.__s,S),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(p,f,m)})}if(h.context=S,h.props=v,h.__P=t,h.__e=!1,ut=F.__r,kt=0,b){for(h.state=h.__s,h.__d=!1,ut&&ut(e),d=h.render(h.props,h.state,h.context),At=0;At<h._sb.length;At++)h.__h.push(h._sb[At]);h._sb=[]}else do h.__d=!1,ut&&ut(e),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++kt<25);h.state=h.__s,h.getChildContext!=null&&(n=te(te({},n),h.getChildContext())),b&&!u&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(p,f)),wt=d,d!=null&&d.type===ye&&d.key==null&&(wt=Ko(d.props.children)),a=zo(t,Hi(wt)?wt:[wt],e,i,n,r,s,o,a,c,l),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),g&&(h.__E=h.__=null)}catch(Q){if(e.__v=null,c||s!=null)if(Q.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else for(be=s.length;be--;)kr(s[be]);else e.__e=i.__e,e.__k=i.__k;F.__e(Q,e,i)}else s==null&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=Al(i.__e,e,i,n,r,s,o,c,l);return(d=F.diffed)&&d(e),128&e.__u?void 0:a}function Yo(t,e,i){for(var n=0;n<i.length;n++)Sr(i[n],i[++n],i[++n]);F.__c&&F.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){F.__e(s,r.__v)}})}function Ko(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Hi(t)?t.map(Ko):te({},t)}function Al(t,e,i,n,r,s,o,a,c){var l,d,h,u,p,f,m,g=i.props,v=e.props,b=e.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)){t=p,s[l]=null;break}}if(t==null){if(b==null)return document.createTextNode(v);t=document.createElementNS(r,b,v.is&&v),a&&(F.__m&&F.__m(e,s),a=!1),s=null}if(b==null)g===v||a&&t.data==v||(t.data=v);else{if(s=s&&Pi.call(t.childNodes),g=i.props||Ni,!a&&s!=null)for(g={},l=0;l<t.attributes.length;l++)g[(p=t.attributes[l]).name]=p.value;for(l in g)if(p=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")h=p;else if(!(l in v)){if(l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v)continue;gn(t,l,null,p,r)}}for(l in v)p=v[l],l=="children"?u=p:l=="dangerouslySetInnerHTML"?d=p:l=="value"?f=p:l=="checked"?m=p:a&&typeof p!="function"||g[l]===p||gn(t,l,p,g[l],r);if(d)a||h&&(d.__html==h.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(h&&(t.innerHTML=""),zo(e.type=="template"?t.content:t,Hi(u)?u:[u],e,i,n,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:i.__k&&ti(i,0),a,c),s!=null)for(l=s.length;l--;)kr(s[l]);a||(l="value",b=="progress"&&f==null?t.removeAttribute("value"):f!=null&&(f!==t[l]||b=="progress"&&!f||b=="option"&&f!=g[l])&&gn(t,l,f,g[l],r),l="checked",m!=null&&m!=t[l]&&gn(t,l,m,g[l],r))}return t}function Sr(t,e,i){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(r){F.__e(r,i)}}function Jo(t,e,i){var n,r;if(F.unmount&&F.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Sr(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){F.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(r=0;r<n.length;r++)n[r]&&Jo(n[r],e,i||typeof t.type!="function");i||kr(t.__e),t.__c=t.__=t.__e=void 0}function Sl(t,e,i){return this.constructor(t,i)}function vn(t,e,i){var n,r,s,o;e==document&&(e=document.documentElement),F.__&&F.__(t,e),r=(n=typeof i=="function")?null:i&&i.__k||e.__k,s=[],o=[],Ar(e,t=(!n&&i||e).__k=ce(ye,null,[t]),r||Ni,Ni,e.namespaceURI,!n&&i?[i]:r?null:e.firstChild?Pi.call(e.childNodes):null,s,!n&&i?i:r?r.__e:e.firstChild,n,o),Yo(s,t,o)}function Qo(t,e){vn(t,e,Qo)}function ta(t,e,i){var n,r,s,o,a=te({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?r=e[s]:a[s]=e[s]===void 0&&o!=null?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Pi.call(arguments,2):i),Ui(t.type,a,n||t.key,r||t.ref,null)}Pi=Vo.slice,F={__e:function(t,e,i,n){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,n||{}),o=r.__d),o)return r.__E=r}catch(a){t=a}throw t}},$o=0,Oo=function(t){return t!=null&&t.constructor==null},Vi.prototype.setState=function(t,e){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=te({},this.state),typeof t=="function"&&(t=t(te({},i),this.props)),t&&te(i,t),t!=null&&this.__v&&(e&&this._sb.push(e),Go(this))},Vi.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Go(this))},Vi.prototype.render=ye,Oe=[],No=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ho=function(t,e){return t.__v.__b-e.__v.__b},mn.__r=0,Uo=/(PointerCapture)$|Capture$/i,Cr=0,xr=Xo(!1),Er=Xo(!0);var Ll=0;function L(t,e,i,n,r,s){e||(e={});var o,a,c=e;if("ref"in c)for(a in c={},e)a=="ref"?o=e[a]:c[a]=e[a];var l={type:t,props:c,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ll,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(a in o)c[a]===void 0&&(c[a]=o[a]);return F.vnode&&F.vnode(l),l}var ji,Y,Lr,ea,bn=0,ia=[],tt=F,na=tt.__b,ra=tt.__r,sa=tt.diffed,oa=tt.__c,aa=tt.unmount,ca=tt.__;function Mr(t,e){tt.__h&&tt.__h(Y,t,bn||e),bn=0;var i=Y.__H||(Y.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Pe(t){return bn=1,Ml(da,t)}function Ml(t,e,i){var n=Mr(ji++,2);if(n.t=t,!n.__c&&(n.__=[da(void 0,e),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=Y,!Y.__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};Y.__f=!0;var s=Y.shouldComponentUpdate,o=Y.componentWillUpdate;Y.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)},Y.shouldComponentUpdate=r}return n.__N||n.__}function ei(t,e){var i=Mr(ji++,3);!tt.__s&&ha(i.__H,e)&&(i.__=t,i.u=e,Y.__H.__h.push(i))}function Xt(t){return bn=5,wn(function(){return{current:t}},[])}function wn(t,e){var i=Mr(ji++,7);return ha(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Tl(){for(var t;t=ia.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(yn),t.__H.__h.forEach(Tr),t.__H.__h=[]}catch(e){t.__H.__h=[],tt.__e(e,t.__v)}}tt.__b=function(t){Y=null,na&&na(t)},tt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ca&&ca(t,e)},tt.__r=function(t){ra&&ra(t),ji=0;var e=(Y=t.__c).__H;e&&(Lr===Y?(e.__h=[],Y.__h=[],e.__.forEach(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(e.__h.forEach(yn),e.__h.forEach(Tr),e.__h=[],ji=0)),Lr=Y},tt.diffed=function(t){sa&&sa(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ia.push(e)!==1&&ea===tt.requestAnimationFrame||((ea=tt.requestAnimationFrame)||Il)(Tl)),e.__H.__.forEach(function(i){i.u&&(i.__H=i.u),i.u=void 0})),Lr=Y=null},tt.__c=function(t,e){e.some(function(i){try{i.__h.forEach(yn),i.__h=i.__h.filter(function(n){return!n.__||Tr(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],tt.__e(n,i.__v)}}),oa&&oa(t,e)},tt.unmount=function(t){aa&&aa(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{yn(n)}catch(r){e=r}}),i.__H=void 0,e&&tt.__e(e,i.__v))};var la=typeof requestAnimationFrame=="function";function Il(t){var e,i=function(){clearTimeout(n),la&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(i,35);la&&(e=requestAnimationFrame(i))}function yn(t){var e=Y,i=t.__c;typeof i=="function"&&(t.__c=void 0,i()),Y=e}function Tr(t){var e=Y;t.__c=t.__(),Y=e}function ha(t,e){return!t||t.length!==e.length||e.some(function(i,n){return i!==t[n]})}function da(t,e){return typeof e=="function"?e(t):e}/**
3173
+ * @license @tabler/icons-preact v3.34.0 - MIT
3174
+ *
3175
+ * This source code is licensed under the MIT license.
3176
+ * See the LICENSE file in the root directory of this source tree.
3177
+ */var Bl={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"}};/**
3178
+ * @license @tabler/icons-preact v3.34.0 - MIT
3179
+ *
3180
+ * This source code is licensed under the MIT license.
3181
+ * See the LICENSE file in the root directory of this source tree.
3182
+ */const Fl=(t,e,i,n)=>{const r=({color:s="currentColor",size:o=24,stroke:a=2,title:c,children:l,className:d="",class:h="",style:u,...p})=>ce("svg",{...Bl[t],width:String(o),height:String(o),class:["tabler-icon",`tabler-icon-${e}`,h,d].join(" "),"stroke-width":a,stroke:s,style:u,...p},[c&&ce("title",{},c),...n.map(([f,m])=>ce(f,m)),...Wo(l)]);return r.displayName=`${i}`,r};/**
3183
+ * @license @tabler/icons-preact v3.34.0 - MIT
3184
+ *
3185
+ * This source code is licensed under the MIT license.
3186
+ * See the LICENSE file in the root directory of this source tree.
3187
+ */var Dl=Fl("outline","loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]);function Ir(){return(Ir=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}var Rl=["context","children"];function $l(t){this.getChildContext=function(){return t.context};var e=t.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}(t,Rl);return ta(e,i)}function Ol(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=ce($l,Ir({},this._props,{context:t.detail.context}),function e(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[ua(a[o].name)]=a[o].value);for(o=c.length;o--;){var l=e(c[o],null),d=c[o].slot;d?s[d]=ce(pa,{name:d},l):r[o]=l}var h=n?ce(pa,null,r):r;return ce(n||i.nodeName.toLowerCase(),s,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Qo:vn)(this._vdom,this._root)}function ua(t){return t.replace(/-(\w)/g,function(e,i){return i?i.toUpperCase():""})}function Pl(t,e,i){if(this._vdom){var n={};n[t]=i=i??void 0,n[ua(t)]=i,this._vdom=ta(this._vdom,n),vn(this._vdom,this._root)}}function Nl(){vn(this._vdom=null,this._root)}function pa(t,e){var i=this;return ce("slot",Ir({},t,{ref:function(n){n?(i.ref=n,i._listener||(i._listener=function(r){r.stopPropagation(),r.detail.context=e},n.addEventListener("_preact",i._listener))):i.ref.removeEventListener("_preact",i._listener)}}))}function fa(t,e,i,n){function r(){var s=Reflect.construct(HTMLElement,[],r);return s._vdomComponent=t,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=Ol,r.prototype.attributeChangedCallback=Pl,r.prototype.disconnectedCallback=Nl,i=i||t.observedAttributes||Object.keys(t.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(e||t.tagName||t.displayName||t.name,r)}const ii=(t,e=!1)=>typeof t=="boolean"?t:typeof t=="string"?t==="true"||t==="":e,Hl=()=>{const t=Xt(null),e=Xt(null),[i,n]=Pe("user"),[r,s]=Pe(!1),o=async()=>{try{e.current&&(e.current.getTracks().forEach(f=>f.stop()),e.current=null),t.current&&(t.current.srcObject=null);const d=await navigator.mediaDevices.getUserMedia({video:{facingMode:i}});e.current=d;const u=(await navigator.mediaDevices.enumerateDevices()).find(f=>f.kind==="videoinput"&&d.getVideoTracks()[0].getSettings().deviceId===f.deviceId);document.querySelector("smart-camera-web")?.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:u?.label}})),t.current&&(t.current.srcObject=d,await t.current.play())}catch(d){console.error("Failed to start camera:",d)}};return{videoRef:t,streamRef:e,facingMode:i,agentSupported:r,startCamera:o,switchCamera:async()=>{n(i==="user"?"environment":"user"),e.current&&(e.current.getTracks().forEach(h=>h.stop()),e.current=null),await o()},checkAgentSupport:async()=>{try{const h=(await navigator.mediaDevices.enumerateDevices()).filter(u=>u.kind==="videoinput");s(h.length>1)}catch{s(!1)}},stopCamera:()=>{e.current&&(e.current.getTracks().forEach(d=>d.stop()),e.current=null),t.current&&(t.current.srcObject=null,t.current.load())}}};var Ul=Symbol.for("preact-signals");function _n(){if(_e>1)_e--;else{for(var t,e=!1;Gi!==void 0;){var i=Gi;for(Gi=void 0,Br++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&ba(i))try{i.c()}catch(r){e||(t=r,e=!0)}i=n}}if(Br=0,_e--,e)throw t}}function Vl(t){if(_e>0)return t();_e++;try{return t()}finally{_n()}}var D=void 0;function ma(t){var e=D;D=void 0;try{return t()}finally{D=e}}var Gi=void 0,_e=0,Br=0,Cn=0;function ga(t){if(D!==void 0){var e=t.n;if(e===void 0||e.t!==D)return e={i:0,S:t,p:D.s,n:void 0,t:D,e:void 0,x:void 0,r:e},D.s!==void 0&&(D.s.n=e),D.s=e,t.n=e,32&D.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=D.s,e.n=void 0,D.s.n=e,D.s=e),e}}function dt(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched}dt.prototype.brand=Ul,dt.prototype.h=function(){return!0},dt.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:ma(function(){var n;(n=e.W)==null||n.call(e)}))},dt.prototype.U=function(t){var e=this;if(this.t!==void 0){var i=t.e,n=t.x;i!==void 0&&(i.x=n,t.e=void 0),n!==void 0&&(n.e=i,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&ma(function(){var r;(r=e.Z)==null||r.call(e)}))}},dt.prototype.subscribe=function(t){var e=this;return zi(function(){var i=e.value,n=D;D=void 0;try{t(i)}finally{D=n}})},dt.prototype.valueOf=function(){return this.value},dt.prototype.toString=function(){return this.value+""},dt.prototype.toJSON=function(){return this.value},dt.prototype.peek=function(){var t=D;D=void 0;try{return this.value}finally{D=t}},Object.defineProperty(dt.prototype,"value",{get:function(){var t=ga(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Br>100)throw new Error("Cycle detected");this.v=t,this.i++,Cn++,_e++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{_n()}}}});function va(t,e){return new dt(t,e)}function ba(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 wa(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 ya(t){for(var e=t.s,i=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=i}function Ne(t,e){dt.call(this,void 0),this.x=t,this.s=void 0,this.g=Cn-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched}Ne.prototype=new dt,Ne.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cn))return!0;if(this.g=Cn,this.f|=1,this.i>0&&!ba(this))return this.f&=-2,!0;var t=D;try{wa(this),D=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 D=t,ya(this),this.f&=-2,!0},Ne.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)}dt.prototype.S.call(this,t)},Ne.prototype.U=function(t){if(this.t!==void 0&&(dt.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)}},Ne.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(Ne.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=ga(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Fr(t,e){return new Ne(t,e)}function _a(t){var e=t.u;if(t.u=void 0,typeof e=="function"){_e++;var i=D;D=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Dr(t),n}finally{D=i,_n()}}}function Dr(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,_a(t)}function jl(t){if(D!==this)throw new Error("Out-of-order effect");ya(this),D=t,this.f&=-2,8&this.f&&Dr(this),_n()}function ni(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ni.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()}},ni.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,_a(this),wa(this),_e++;var t=D;return D=this,jl.bind(this,t)},ni.prototype.N=function(){2&this.f||(this.f|=2,this.o=Gi,Gi=this)},ni.prototype.d=function(){this.f|=8,1&this.f||Dr(this)},ni.prototype.dispose=function(){this.d()};function zi(t){var e=new ni(t);try{e.c()}catch(n){throw e.d(),n}var i=e.d.bind(e);return i[Symbol.dispose]=i,i}var Ca,xn,Rr,xa=[];zi(function(){Ca=this.N})();function ri(t,e){F[t]=e.bind(null,F[t]||function(){})}function En(t){Rr&&Rr(),Rr=t&&t.S()}function Ea(t){var e=this,i=t.data,n=et(i);n.value=i;var r=wn(function(){for(var a=e,c=e.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var l=Fr(function(){var p=n.value.value;return p===0?0:p===!0?"":p||""}),d=Fr(function(){return!Array.isArray(l.value)&&!Oo(l.value)}),h=zi(function(){if(this.N=ka,d.value){var p=l.value;a.__v&&a.__v.__e&&a.__v.__e.nodeType===3&&(a.__v.__e.data=p)}}),u=e.__$u.d;return e.__$u.d=function(){h(),u.call(this)},[d,l]},[]),s=r[0],o=r[1];return s.value?o.peek():o.value}Ea.displayName="_st",Object.defineProperties(dt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ea},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),ri("__b",function(t,e){if(typeof e.type=="string"){var i,n=e.props;for(var r in n)if(r!=="children"){var s=n[r];s instanceof dt&&(i||(e.__np=i={}),i[r]=s,n[r]=s.peek())}}t(e)}),ri("__r",function(t,e){if(e.type!==ye){En();var i,n=e.__c;n&&(n.__$f&=-2,(i=n.__$u)===void 0&&(n.__$u=i=function(r){var s;return zi(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),xn=n,En(i)}t(e)}),ri("__e",function(t,e,i,n){En(),xn=void 0,t(e,i,n)}),ri("diffed",function(t,e){En(),xn=void 0;var i;if(typeof e.type=="string"&&(i=e.__e)){var n=e.__np,r=e.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=Gl(i,c,d,r),s[c]=l):l.o(d,r)}}}t(e)});function Gl(t,e,i,n){var r=e in t&&t.ownerSVGElement===void 0,s=va(i);return{o:function(o,a){s.value=o,n=a},d:zi(function(){this.N=ka;var o=s.value.value;n[e]!==o&&(n[e]=o,r?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}ri("unmount",function(t,e){if(typeof e.type=="string"){var i=e.__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=e.__c;if(o){var a=o.__$u;a&&(o.__$u=void 0,a.d())}}t(e)}),ri("__h",function(t,e,i,n){(n<3||n===9)&&(e.__$f|=2),t(e,i,n)}),Vi.prototype.shouldComponentUpdate=function(t,e){var i=this.__$u,n=i&&i.s!==void 0;for(var r in e)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 t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var a in this.props)if(!(a in t))return!0;return!1};function et(t,e){return wn(function(){return va(t,e)},[])}function $r(t,e){var i=Xt(t);return i.current=t,xn.__$f|=4,wn(function(){return Fr(function(){return i.current()},e)},[])}var zl=function(t){queueMicrotask(function(){queueMicrotask(t)})};function Zl(){Vl(function(){for(var t;t=xa.shift();)Ca.call(t)})}function ka(){xa.push(this)===1&&(F.requestAnimationFrame||zl)(Zl)}var si=typeof self<"u"?self:{};function He(){throw Error("Invalid UTF8")}function Aa(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let kn,Or;const Wl=typeof TextDecoder<"u";let ql;const Xl=typeof TextEncoder<"u";function Sa(t){if(Xl)t=(ql||=new TextEncoder).encode(t);else{let i=0;const n=new Uint8Array(3*t.length);for(let r=0;r<t.length;r++){var e=t.charCodeAt(r);if(e<128)n[i++]=e;else{if(e<2048)n[i++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&r<t.length){const s=t.charCodeAt(++r);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,n[i++]=e>>18|240,n[i++]=e>>12&63|128,n[i++]=e>>6&63|128,n[i++]=63&e|128;continue}r--}e=65533}n[i++]=e>>12|224,n[i++]=e>>6&63|128}n[i++]=63&e|128}}t=i===n.length?n:n.subarray(0,i)}return t}var Pr,An;t:{for(var La=["CLOSURE_FLAGS"],Nr=si,Hr=0;Hr<La.length;Hr++)if((Nr=Nr[La[Hr]])==null){An=null;break t}An=Nr}var Zi,Ma=An&&An[610401301];Pr=Ma!=null&&Ma;const Ta=si.navigator;function Ur(t){return!!Pr&&!!Zi&&Zi.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function Ht(t){var e;return(e=si.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function Ce(){return!!Pr&&!!Zi&&Zi.brands.length>0}function Vr(){return Ce()?Ur("Chromium"):(Ht("Chrome")||Ht("CriOS"))&&!(!Ce()&&Ht("Edge"))||Ht("Silk")}function Sn(t){return Sn[" "](t),t}Zi=Ta&&Ta.userAgentData||null,Sn[" "]=function(){};var Yl=!Ce()&&(Ht("Trident")||Ht("MSIE"));!Ht("Android")||Vr(),Vr(),Ht("Safari")&&(Vr()||!Ce()&&Ht("Coast")||!Ce()&&Ht("Opera")||!Ce()&&Ht("Edge")||(Ce()?Ur("Microsoft Edge"):Ht("Edg/"))||Ce()&&Ur("Opera"));var Ia={},Wi=null;function Kl(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 n=new Uint8Array(i);let r=0;return function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=Wi[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}Ba();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))}}(t,function(s){n[r++]=s}),r!==i?n.subarray(0,r):n}function Ba(){if(!Wi){Wi={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let i=0;i<5;i++){const n=t.concat(e[i].split(""));Ia[i]=n;for(let r=0;r<n.length;r++){const s=n[r];Wi[s]===void 0&&(Wi[s]=r)}}}}var Fa=typeof Uint8Array<"u",Da=!Yl&&typeof btoa=="function";function Ra(t){if(!Da){var e;e===void 0&&(e=0),Ba(),e=Ia[e];var i=Array(Math.floor(t.length/3)),n=e[64]||"";let c=0,l=0;for(;c<t.length-2;c+=3){var r=t[c],s=t[c+1],o=t[c+2],a=e[r>>2];r=e[(3&r)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],i[l++]=a+r+s+o}switch(a=0,o=n,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||n;case 1:t=t[c],i[l]=e[t>>2]+e[(3&t)<<4|a>>4]+o+n}return i.join("")}for(e="",i=0,n=t.length-10240;i<n;)e+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));return e+=String.fromCharCode.apply(null,i?t.subarray(i):t),btoa(e)}const $a=/[-_.]/g,Jl={"-":"+",_:"/",".":"="};function Ql(t){return Jl[t]||""}function Oa(t){if(!Da)return Kl(t);$a.test(t)&&(t=t.replace($a,Ql)),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 Ue(t){return Fa&&t!=null&&t instanceof Uint8Array}var oi={};function Ve(){return th||=new le(null,oi)}function jr(t){Pa(oi);var e=t.g;return(e=e==null||Ue(e)?e:typeof e=="string"?Oa(e):null)==null?e:t.g=e}var le=class{h(){return new Uint8Array(jr(this)||0)}constructor(t,e){if(Pa(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}};let th,eh;function Pa(t){if(t!==oi)throw Error("illegal external caller")}function Na(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function Gr(t){return Na(t=Error(t),"warning"),t}function zr(t){if(t!=null){var e=eh??={},i=e[t]||0;i>=5||(e[t]=i+1,Na(t=Error(),"incident"),function(n){si.setTimeout(()=>{throw n},0)}(t))}}var Ln=typeof Symbol=="function"&&typeof Symbol()=="symbol";function ai(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 ih=ai("jas",void 0,!0),Ha=ai(void 0,"0di"),qi=ai(void 0,"1oa"),ci=ai(void 0,Symbol()),nh=ai(void 0,"0actk"),Ua=ai(void 0,"8utk");const C=Ln?ih:"Ea",Va={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},ja=Object.defineProperties;function Mn(t,e){Ln||C in t||ja(t,Va),t[C]|=e}function it(t,e){Ln||C in t||ja(t,Va),t[C]=e}function li(t){return Mn(t,34),t}function rh(t,e){it(e,-15615&(0|t))}function Zr(t,e){it(e,-15581&(34|t))}function Tn(){return typeof BigInt=="function"}function _t(t){return Array.prototype.slice.call(t)}var Wr,Xi={};function In(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function qr(t,e){if(t!=null){if(typeof t=="string")t=t?new le(t,oi):Ve();else if(t.constructor!==le)if(Ue(t))t=t.length?new le(new Uint8Array(t),oi):Ve();else{if(!e)throw Error();t=void 0}}return t}const Ga=[];function xe(t){if(2&t)throw Error()}it(Ga,55),Wr=Object.freeze(Ga);class za{constructor(e,i,n){this.g=e,this.h=i,this.l=n}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}function Xr(t){return ci?t[ci]:void 0}var sh=Object.freeze({});function Bn(t){return t.Na=!0,t}var oh=Bn(t=>typeof t=="number"),Za=Bn(t=>typeof t=="string"),ah=Bn(t=>typeof t=="boolean"),Fn=typeof si.BigInt=="function"&&typeof si.BigInt(0)=="bigint";function Ee(t){var e=t;if(Za(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(oh(e)&&!Number.isSafeInteger(e))throw Error(String(e));return Fn?BigInt(t):t=ah(t)?t?"1":"0":Za(t)?t.trim()||"0":String(t)}var Yr=Bn(t=>Fn?t>=lh&&t<=dh:t[0]==="-"?Wa(t,ch):Wa(t,hh));const ch=Number.MIN_SAFE_INTEGER.toString(),lh=Fn?BigInt(Number.MIN_SAFE_INTEGER):void 0,hh=Number.MAX_SAFE_INTEGER.toString(),dh=Fn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Wa(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 n=t[i],r=e[i];if(n>r)return!1;if(n<r)return!0}}const uh=typeof Uint8Array.prototype.slice=="function";let qa,P=0,q=0;function Xa(t){const e=t>>>0;P=e,q=(t-e)/4294967296>>>0}function je(t){if(t<0){Xa(-t);const[e,i]=ts(P,q);P=e>>>0,q=i>>>0}else Xa(t)}function Kr(t){const e=qa||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,P=e.getUint32(0,!0)}function Jr(t,e){const i=4294967296*e+(t>>>0);return Number.isSafeInteger(i)?i:Yi(t,e)}function Qr(t,e){const i=2147483648&e;return i&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=Jr(t,e))=="number"?i?-t:t:i?"-"+t:t}function Yi(t,e){if(t>>>=0,(e>>>=0)<=2097151)var i=""+(4294967296*e+t);else Tn()?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+Ya(i)+Ya(t));return i}function Ya(t){return t=String(t),"0000000".slice(t.length)+t}function Ka(){var t=P,e=q;if(2147483648&e)if(Tn())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[i,n]=ts(t,e);t="-"+Yi(i,n)}else t=Yi(t,e);return t}function Dn(t){if(t.length<16)je(Number(t));else if(Tn())t=BigInt(t),P=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");q=P=0;const i=t.length;for(let n=e,r=(i-e)%6+e;r<=i;n=r,r+=6){const s=Number(t.slice(n,r));q*=1e6,P=1e6*P+s,P>=4294967296&&(q+=Math.trunc(P/4294967296),q>>>=0,P>>>=0)}if(e){const[n,r]=ts(P,q);P=n,q=r}}}function ts(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const Ki=typeof BigInt=="function"?BigInt.asIntN:void 0,ph=typeof BigInt=="function"?BigInt.asUintN:void 0,ke=Number.isSafeInteger,Rn=Number.isFinite,hi=Math.trunc,fh=Ee(0);function Ae(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function Ja(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const mh=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ji(t){switch(typeof t){case"bigint":return!0;case"number":return Rn(t);case"string":return mh.test(t);default:return!1}}function di(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Rn(t)?0|t:void 0}function Qa(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return Rn(t)?t>>>0:void 0}function t1(t){if(t[0]==="-")return!1;const e=t.length;return e<20||e===20&&Number(t.substring(0,6))<184467}function e1(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 i1(t){return e1(t)?t:(Dn(t),Ka())}function es(t){return t=hi(t),ke(t)||(je(t),t=Qr(P,q)),t}function n1(t){var e=hi(Number(t));return ke(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),i1(t))}function r1(t){var e=hi(Number(t));return ke(e)?Ee(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Tn()?Ee(Ki(64,BigInt(t))):Ee(i1(t)))}function s1(t){if(ke(t))t=Ee(es(t));else{if(t=hi(t),ke(t))t=String(t);else{const e=String(t);e1(e)?t=e:(je(t),t=Ka())}t=Ee(t)}return t}function is(t){return t==null?t:typeof t=="bigint"?(Yr(t)?t=Number(t):(t=Ki(64,t),t=Yr(t)?Number(t):String(t)),t):Ji(t)?typeof t=="number"?es(t):n1(t):void 0}function gh(t){if(t==null)return t;var e=typeof t;if(e==="bigint")return String(ph(64,t));if(Ji(t)){if(e==="string")return e=hi(Number(t)),ke(e)&&e>=0?t=String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),t1(t)||(Dn(t),t=Yi(P,q))),t;if(e==="number")return(t=hi(t))>=0&&ke(t)?t:function(i){if(i<0){je(i);var n=Yi(P,q);return i=Number(n),ke(i)?i:n}return t1(n=String(i))?n:(je(i),Jr(P,q))}(t)}}function o1(t){if(typeof t!="string")throw Error();return t}function ui(t){if(t!=null&&typeof t!="string")throw Error();return t}function pi(t){return t==null||typeof t=="string"?t:void 0}function ns(t,e,i,n){if(t!=null&&typeof t=="object"&&t.W===Xi)return t;if(!Array.isArray(t))return i?2&n?((t=e[Ha])||(li((t=new e).u),t=e[Ha]=t),e=t):e=new e:e=void 0,e;let r=i=0|t[C];return r===0&&(r|=32&n),r|=2&n,r!==i&&it(t,r),new e(t)}function vh(t,e,i){if(e)t:{if(!Ji(e=t))throw Gr("int64");switch(typeof e){case"string":e=r1(e);break t;case"bigint":e=Ee(Ki(64,e));break t;default:e=s1(e)}}else t=typeof(e=t),e=e==null?e:t==="bigint"?Ee(Ki(64,e)):Ji(e)?t==="string"?r1(e):s1(e):void 0;return(t=e)==null?i?fh:void 0:t}function bh(t){return t}const wh={};let yh=function(){try{return Sn(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class rs{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 _h=yh?(Object.setPrototypeOf(rs.prototype,Map.prototype),Object.defineProperties(rs.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),rs):class extends Map{constructor(){super()}};function a1(t){return t}function ss(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var ee=class extends _h{constructor(t,e,i=a1,n=a1){super();let r=0|t[C];r|=64,it(t,r),this.M=r,this.I=e,this.S=i,this.X=this.I?Ch:n;for(let s=0;s<t.length;s++){const o=t[s],a=i(o[0],!1,!0);let c=o[1];e?c===void 0&&(c=null):c=n(o[1],!1,!0,void 0,void 0,r),super.set(a,c)}}La(){var t=Sh;if(this.size!==0)return Array.from(super.entries(),e=>(e[0]=t(e[0]),e[1]=t(e[1]),e))}da(t=xh){const e=[],i=super.entries();for(var n;!(n=i.next()).done;)(n=n.value)[0]=t(n[0]),n[1]=t(n[1]),e.push(n);return e}clear(){ss(this),super.clear()}delete(t){return ss(this),super.delete(this.S(t,!0,!1))}entries(){if(this.I){var t=super.keys();t=new za(t,Eh,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new za(t,ee.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach((i,n,r)=>{t.call(e,r.get(n),n,r)}):super.forEach(t,e)}set(t,e){return ss(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 Ch(t,e,i,n,r,s){return t=ns(t,n,i,s),r&&(t=Pn(t)),t}function xh(t){return t}function Eh(t){return[t,this.get(t)]}let kh,c1,l1,Ah;function h1(){return kh||=new ee(li([]),void 0,void 0,void 0,wh)}function os(t,e,i,n,r){if(t!=null){if(Array.isArray(t)){const s=0|t[C];return t.length===0&&1&s?void 0:r&&2&s?t:$n(t,e,i,n!==void 0,r)}return e(t,n)}}function $n(t,e,i,n,r){const s=n||i?0|t[C]:0,o=n?!!(32&s):void 0;let a=0;const c=(n=_t(t)).length;for(let f=0;f<c;f++){var l=n[f];if(f===c-1&&In(l)){var d=e,h=i,u=o,p=r;let m;for(let g in l){const v=os(l[g],d,h,u,p);v!=null&&((m??={})[g]=v)}l=m}else l=os(n[f],e,i,o,r);n[f]=l,l!=null&&(a=f+1)}return a<c&&(n.length=a),i&&((t=Xr(t))&&(n[ci]=_t(t)),i(s,n)),n}function Sh(t){return os(t,as,void 0,void 0,!1)}function as(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Yr(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Ue(t))return Ue(t)&&zr(Ua),Ra(t);if(t.W===Xi)return d1(t);if(t instanceof le){const e=t.g;return e==null?"":typeof e=="string"?e:t.g=Ra(e)}return t instanceof ee?t.La():void 0}return t}function d1(t){var e=t.u;t=$n(e,as,void 0,void 0,!1);var i=0|e[C];if((e=t.length)&&!(512&i)){var n=t[e-1],r=!1;In(n)?(e--,r=!0):n=void 0;var s=e-(i=512&i?0:-1),o=(c1??bh)(s,i,t,n);if(n&&(t[e]=void 0),s<o&&n){for(var a in s=!0,n){const c=+a;c<=o?(t[r=c+i]=n[a],e=Math.max(r+1,e),r=!1,delete n[a]):s=!1}s&&(n=void 0)}for(s=e-1;e>0;s=e-1)if((a=t[s])==null)e--,r=!0;else{if(!((s-=i)>=o))break;(n??={})[s]=a,e--,r=!0}r&&(t.length=e),n&&t.push(n)}return t}function Se(t,e,i){return t=u1(t,e[0],e[1],i?1:2),e!==l1&&i&&Mn(t,8192),t}function u1(t,e,i,n){if(t==null){var r=96;i?(t=[i],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(r=0|t[C])||!(64&r)||2&r||zr(nh),1024&r)throw Error("farr");if(64&r)return t;if(n===1||n===2||(r|=64),i&&(r|=512,i!==t[0]))throw Error("mid");t:{var s=(i=t).length;if(s){var o=s-1;if(In(n=i[o])){if((o-=e=512&(r|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in n)(s=+a)<o&&(i[s+e]=n[a],delete n[a]);r=-16760833&r|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(512&r?0:-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&a)<<14}}}return it(t,r),t}function cs(t,e,i=Zr){if(t!=null){if(Fa&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var n=0|t[C];return 2&n?t:(e&&=n===0||!!(32&n)&&!(64&n||!(16&n)),e?(it(t,34|n),4&n&&Object.freeze(t),t):$n(t,cs,4&n?Zr:i,!0,!0))}return t.W===Xi?t=2&(n=0|(i=t.u)[C])?t:new t.constructor(On(i,n,!0)):t instanceof ee&&!(2&t.M)&&(i=li(t.da(cs)),t=new ee(i,t.I,t.S,t.X)),t}}function On(t,e,i){const n=i||2&e?Zr:rh,r=!!(32&e);return t=function(s,o,a){const c=_t(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=Xr(s))&&(c[ci]=_t(s)),c}(t,e,s=>cs(s,r,n)),Mn(t,32|(i?2:0)),t}function Pn(t){const e=t.u,i=0|e[C];return 2&i?new t.constructor(On(e,i,!1)):t}function fi(t,e){return he(t=t.u,0|t[C],e)}function he(t,e,i){if(i===-1)return null;const n=i+(512&e?0:-1),r=t.length-1;return n>=r&&256&e?t[r][i]:n<=r?t[n]:void 0}function N(t,e,i){const n=t.u;let r=0|n[C];return xe(r),Z(n,r,e,i),t}function Z(t,e,i,n){const r=512&e?0:-1,s=i+r;var o=t.length-1;return s>=o&&256&e?(t[o][i]=n,e):s<=o?(t[s]=n,e):(n!==void 0&&(i>=(o=e>>14&1023||536870912)?n!=null&&(t[o+r]={[i]:n},it(t,e|=256)):t[s]=n),e)}function Nn(t,e){let i=0|(t=t.u)[C];const n=he(t,i,e),r=Ae(n);return r!=null&&r!==n&&Z(t,i,e,r),r}function p1(t){let e=0|(t=t.u)[C];const i=he(t,e,1),n=qr(i,!0);return n!=null&&n!==i&&Z(t,e,1,n),n}function Ge(){return sh===void 0?2:4}function ze(t,e,i,n,r){const s=t.u,o=2&(t=0|s[C])?1:n;r=!!r;let a=0|(n=ls(s,t,e))[C];if(!(4&a)){4&a&&(n=_t(n),a=pe(a,t),t=Z(s,t,e,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=hs(a,t),i=-2049&(20|a),a=i&=-4097,it(n,a),2&a&&Object.freeze(n)}return o===1||o===4&&32&a?de(a)||(r=a,a|=2,a!==r&&it(n,a),Object.freeze(n)):(o===2&&de(a)&&(n=_t(n),a=pe(a,t),a=Le(a,t,r),it(n,a),t=Z(s,t,e,n)),de(a)||(e=a,a=Le(a,t,r),a!==e&&it(n,a))),n}function ls(t,e,i){return t=he(t,e,i),Array.isArray(t)?t:Wr}function hs(t,e){return t===0&&(t=pe(t,e)),1|t}function de(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function f1(t){t=_t(t);for(let e=0;e<t.length;e++){const i=t[e]=_t(t[e]);Array.isArray(i[1])&&(i[1]=li(i[1]))}return t}function ds(t,e,i,n){let r=0|(t=t.u)[C];xe(r),Z(t,r,e,(n==="0"?Number(i)===0:i===n)?void 0:i)}function mi(t,e,i,n){xe(e);let r=ls(t,e,i);const s=r!==Wr;if(64&e||!(8192&e)||!s){const o=s?0|r[C]:0;let a=o;(!s||2&a||de(a)||4&a&&!(32&a))&&(r=_t(r),a=pe(a,e),e=Z(t,e,i,r)),a=-13&hs(a,e),a=Le(n?-17&a:16|a,e,!0),a!==o&&it(r,a)}return r}function us(t,e){var i=gc;return fs(ps(t=t.u),t,0|t[C],i)===e?e:-1}function ps(t){if(Ln)return t[qi]??(t[qi]=new Map);if(qi in t)return t[qi];const e=new Map;return Object.defineProperty(t,qi,{value:e}),e}function m1(t,e,i,n){const r=ps(t),s=fs(r,t,e,i);return s!==n&&(s&&(e=Z(t,e,s)),r.set(i,n)),e}function fs(t,e,i,n){let r=t.get(n);if(r!=null)return r;r=0;for(let s=0;s<n.length;s++){const o=n[s];he(e,i,o)!=null&&(r!==0&&(i=Z(e,i,r)),r=o)}return t.set(n,r),r}function ms(t,e,i){let n=0|t[C];const r=he(t,n,i);let s;if(r!=null&&r.W===Xi)return(e=Pn(r))!==r&&Z(t,n,i,e),e.u;if(Array.isArray(r)){const o=0|r[C];s=2&o?Se(On(r,o,!1),e,!0):64&o?r:Se(s,e,!0)}else s=Se(void 0,e,!0);return s!==r&&Z(t,n,i,s),s}function g1(t,e,i){let n=0|(t=t.u)[C];const r=he(t,n,i);return(e=ns(r,e,!1,n))!==r&&e!=null&&Z(t,n,i,e),e}function I(t,e,i){if((e=g1(t,e,i))==null)return e;let n=0|(t=t.u)[C];if(!(2&n)){const r=Pn(e);r!==e&&Z(t,n,i,e=r)}return e}function v1(t,e,i,n,r,s,o){t=t.u;var a=!!(2&e);const c=a?1:r;s=!!s,o&&=!a;var l=0|(r=ls(t,e,n))[C];if(!(a=!!(4&l))){var d=r,h=e;const u=!!(2&(l=hs(l,e)));u&&(h|=2);let p=!u,f=!0,m=0,g=0;for(;m<d.length;m++){const v=ns(d[m],i,!1,h);if(v instanceof i){if(!u){const b=!!(2&(0|v.u[C]));p&&=!b,f&&=b}d[g++]=v}}g<m&&(d.length=g),l|=4,l=f?16|l:-17&l,it(d,l=p?8|l:-9&l),u&&Object.freeze(d)}if(o&&!(8&l||!r.length&&(c===1||c===4&&32&l))){for(de(l)&&(r=_t(r),l=pe(l,e),e=Z(t,e,n,r)),i=r,o=l,d=0;d<i.length;d++)(l=i[d])!==(h=Pn(l))&&(i[d]=h);o|=8,it(i,o=i.length?-17&o:16|o),l=o}return c===1||c===4&&32&l?de(l)||(e=l,(l|=!r.length||16&l&&(!a||32&l)?2:1024)!==e&&it(r,l),Object.freeze(r)):(c===2&&de(l)&&(it(r=_t(r),l=Le(l=pe(l,e),e,s)),e=Z(t,e,n,r)),de(l)||(n=l,(l=Le(l,e,s))!==n&&it(r,l))),r}function ue(t,e,i){const n=0|t.u[C];return v1(t,n,e,i,Ge(),!1,!(2&n))}function E(t,e,i,n){return n==null&&(n=void 0),N(t,i,n)}function Qi(t,e,i,n){n==null&&(n=void 0);t:{let r=0|(t=t.u)[C];if(xe(r),n==null){const s=ps(t);if(fs(s,t,r,i)!==e)break t;s.set(i,0)}else r=m1(t,r,i,e);Z(t,r,e,n)}}function pe(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function Le(t,e,i){return 32&e&&i||(t&=-33),t}function Hn(t,e,i){xe(0|t.u[C]),ze(t,e,pi,2,!0).push(o1(i))}function Un(t,e,i,n){const r=0|t.u[C];xe(r),t=v1(t,r,i,e,2,!0),n=n??new i,t.push(n),t[C]=2&(0|n.u[C])?-9&t[C]:-17&t[C]}function Ut(t,e){return di(fi(t,e))}function Vt(t,e){return pi(fi(t,e))}function K(t,e){return Nn(t,e)??0}function tn(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}`);N(t,e,i)}function ie(t,e,i){if(i!=null){if(typeof i!="number"||!Rn(i))throw Gr("int32");i|=0}N(t,e,i)}function _(t,e,i){if(i!=null&&typeof i!="number")throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);N(t,e,i)}function Vn(t,e,i){{const o=t.u;let a=0|o[C];if(xe(a),i==null)Z(o,a,e);else{var n=t=0|i[C],r=de(t),s=r||Object.isFrozen(i);for(r||(t=0),s||(i=_t(i),n=0,t=Le(t=pe(t,a),a,!0),s=!1),t|=21,r=0;r<i.length;r++){const c=i[r],l=o1(c);Object.is(c,l)||(s&&(i=_t(i),n=0,t=Le(t=pe(t,a),a,!0),s=!1),i[r]=l)}t!==n&&(s&&(i=_t(i),t=Le(t=pe(t,a),a,!0)),it(i,t)),Z(o,a,e,i)}}}function b1(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function gs(){return Error("Failed to read varint, encoding is invalid.")}function w1(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function vs(t){if(typeof t=="string")return{buffer:Oa(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===le)return{buffer:jr(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 bs(t,e){let i,n=0,r=0,s=0;const o=t.h;let a=t.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(Ze(t,a),i<128)return e(n>>>0,r>>>0);throw gs()}function ws(t){let e=0,i=t.g;const n=i+10,r=t.h;for(;i<n;){const s=r[i++];if(e|=s,(128&s)==0)return Ze(t,i),!!(127&e)}throw gs()}function Me(t){const e=t.h;let i=t.g,n=e[i++],r=127&n;if(128&n&&(n=e[i++],r|=(127&n)<<7,128&n&&(n=e[i++],r|=(127&n)<<14,128&n&&(n=e[i++],r|=(127&n)<<21,128&n&&(n=e[i++],r|=n<<28,128&n&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++]&&128&e[i++])))))throw gs();return Ze(t,i),r}function fe(t){return Me(t)>>>0}function ys(t){var e=t.h;const i=t.g,n=e[i],r=e[i+1],s=e[i+2];return e=e[i+3],Ze(t,t.g+4),(n<<0|r<<8|s<<16|e<<24)>>>0}function _s(t){var e=ys(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 Lh(t){return Me(t)}function Cs(t,e,{aa:i=!1}={}){t.aa=i,e&&(e=vs(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function Ze(t,e){if(t.g=e,e>t.l)throw w1(t.l,e)}function y1(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const i=t.g,n=i+e;if(n>t.l)throw w1(e,t.l-i);return t.g=n,i}function _1(t,e){if(e==0)return Ve();var i=y1(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):uh?t.slice(i,e):new Uint8Array(t.subarray(i,e))),i.length==0?Ve():new le(i,oi)}ee.prototype.toJSON=void 0;var C1=[];function x1(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var i=fe(t.g);if(e=i>>>3,!((i&=7)>=0&&i<=5))throw b1(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 jn(t){switch(t.h){case 0:t.h!=0?jn(t):ws(t.g);break;case 1:Ze(t=t.g,t.g+8);break;case 2:if(t.h!=2)jn(t);else{var e=fe(t.g);Ze(t=t.g,t.g+e)}break;case 5:Ze(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!x1(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}jn(t)}break;default:throw b1(t.h,t.l)}}function en(t,e,i){const n=t.g.l,r=fe(t.g),s=t.g.g+r;let o=s-n;if(o<=0&&(t.g.l=s,i(e,t,void 0,void 0,void 0),o=s-t.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 t.g.g=s,t.g.l=n,e}function xs(t){var e=fe(t.g),i=y1(t=t.g,e);if(t=t.h,Wl){var n,r=t;(n=Or)||(n=Or=new TextDecoder("utf-8",{fatal:!0})),e=i+e,r=i===0&&e===r.length?r:r.subarray(i,e);try{var s=n.decode(r)}catch(a){if(kn===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),kn=!0}catch{kn=!1}}throw!kn&&(Or=void 0),a}}else{e=(s=i)+e,i=[];let a,c=null;for(;s<e;){var o=t[s++];o<128?i.push(o):o<224?s>=e?He():(a=t[s++],o<194||(192&a)!=128?(s--,He()):i.push((31&o)<<6|63&a)):o<240?s>=e-1?He():(a=t[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(n=t[s++]))!=128?(s--,He()):i.push((15&o)<<12|(63&a)<<6|63&n)):o<=244?s>=e-2?He():(a=t[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(n=t[s++]))!=128||(192&(r=t[s++]))!=128?(s--,He()):(o=(7&o)<<18|(63&a)<<12|(63&n)<<6|63&r,o-=65536,i.push(55296+(o>>10&1023),56320+(1023&o)))):He(),i.length>=8192&&(c=Aa(c,i),i.length=0)}s=Aa(c,i)}return s}function E1(t){const e=fe(t.g);return _1(t.g,e)}function Gn(t,e,i){var n=fe(t.g);for(n=t.g.g+n;t.g.g<n;)i.push(e(t.g))}var zn=[];function Yt(t,e,i){e.g?e.m(t,e.g,e.h,i):e.m(t,e.h,i)}var y=class{constructor(t,e){this.u=u1(t,e)}toJSON(){try{var t=d1(this)}finally{c1=void 0}return t}l(){var t=h0;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(On(t,0|t[C],!1))}O(){return!!(2&(0|this.u[C]))}};function k1(t){return t?/^\d+$/.test(t)?(Dn(t),new Es(P,q)):null:Mh||=new Es(0,0)}y.prototype.W=Xi,y.prototype.toString=function(){return this.u.toString()};var Es=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Mh;function A1(t){return t?/^-?\d+$/.test(t)?(Dn(t),new ks(P,q)):null:Th||=new ks(0,0)}var ks=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Th;function gi(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 vi(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Zn(t,e){if(e>=0)vi(t,e);else{for(let i=0;i<9;i++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function nn(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 bi(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function Lt(t,e,i){vi(t.g,8*e+i)}function As(t,e){return Lt(t,e,2),e=t.g.end(),bi(t,e),e.push(t.h),e}function Ss(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 Wn(t,e,i){Lt(t,e,2),vi(t.g,i.length),bi(t,t.g.end()),bi(t,i)}function qn(t,e,i,n){i!=null&&(e=As(t,e),n(i,t),Ss(t,e))}function Kt(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Ls=Kt(),S1=Kt(),Ms=Kt(),Ts=Kt(),L1=Kt(),M1=Kt(),Is=Kt(),T1=Kt(),I1=Kt(),wi=class{constructor(t,e,i){this.g=t,this.h=e,t=Ls,this.l=!!t&&i===t||!1}};function Xn(t,e){return new wi(t,e,Ls)}function B1(t,e,i,n,r){qn(t,i,P1(e,n),r)}const Ih=Xn(function(t,e,i,n,r){return t.h===2&&(en(t,ms(e,n,i),r),!0)},B1),Bh=Xn(function(t,e,i,n,r){return t.h===2&&(en(t,ms(e,n,i),r),!0)},B1);var Yn=Symbol(),Bs=Symbol(),F1=Symbol(),D1=Symbol();let R1,$1;function We(t,e,i,n){var r=n[t];if(r)return r;(r={}).Ma=n,r.T=function(h){switch(typeof h){case"boolean":return l1||=[0,void 0,!0];case"number":return h>0?void 0:h===0?Ah||=[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,R1??=s,$1??=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 wi?h=s:(h=Ih,o--),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):e(r,c,h,u)}}return n[t]=r}function O1(t){return Array.isArray(t)?t[0]instanceof wi?t:[Bh,t]:[t,void 0]}function P1(t,e){return t instanceof y?t.u:Array.isArray(t)?Se(t,e,!1):void 0}function Fs(t,e,i,n){const r=i.g;t[e]=n?(s,o,a)=>r(s,o,a,n):r}function Ds(t,e,i,n,r){const s=i.g;let o,a;t[e]=(c,l,d)=>s(c,l,d,a||=We(Bs,Fs,Ds,n).T,o||=Rs(n),r)}function Rs(t){let e=t[F1];if(e!=null)return e;const i=We(Bs,Fs,Ds,t);return e=i.la?(n,r)=>R1(n,r,i):(n,r)=>{const s=0|n[C];for(;x1(r)&&r.h!=4;){var o=r.m,a=i[o];if(a==null){var c=i.ga;c&&(c=c[o])&&(c=Fh(c))!=null&&(a=i[o]=c)}a!=null&&a(r,n,o)||(o=(a=r).l,jn(a),a.fa?a=void 0:(c=a.g.g-o,a.g.g=o,a=_1(a.g,c)),o=n,a&&((c=o[ci])?c.push(a):o[ci]=[a]))}return 8192&s&&li(n),!0},t[F1]=e}function Fh(t){const e=(t=O1(t))[0].g;if(t=t[1]){const i=Rs(t),n=We(Bs,Fs,Ds,t).T;return(r,s,o)=>e(r,s,o,n,i)}return e}function Kn(t,e,i){t[e]=i.h}function Jn(t,e,i,n){let r,s;const o=i.h;t[e]=(a,c,l)=>o(a,c,l,s||=We(Yn,Kn,Jn,n).T,r||=N1(n))}function N1(t){let e=t[D1];if(!e){const i=We(Yn,Kn,Jn,t);e=(n,r)=>H1(n,r,i),t[D1]=e}return e}function H1(t,e,i){(function(n,r,s){const o=512&r?0:-1,a=n.length,c=a+((r=64&r?256&r:!!a&&In(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])}})(t,0|t[C]|(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=O1(c))[0].h;if(c=c[1]){const d=N1(c),h=We(Yn,Kn,Jn,c).T;c=o.la?$1(h,d):(u,p,f)=>l(u,p,f,h,d)}else c=l;return o[a]=c}}(i,n);s&&s(e,r,n)}}),(t=Xr(t))&&function(n,r){bi(n,n.g.end());for(let s=0;s<r.length;s++)bi(n,jr(r[s])||new Uint8Array(0))}(e,t)}function yi(t,e){if(Array.isArray(e)){var i=0|e[C];if(4&i)return e;for(var n=0,r=0;n<e.length;n++){const s=t(e[n]);s!=null&&(e[r++]=s)}return r<n&&(e.length=r),it(e,-6145&(5|i)),2&i&&Object.freeze(e),e}}function ft(t,e,i){return new wi(t,e,i)}function _i(t,e,i){return new wi(t,e,i)}function mt(t,e,i){Z(t,0|t[C],e,i)}var Dh=Xn(function(t,e,i,n,r){return t.h===2&&(t=en(t,Se([void 0,void 0],n,!0),r),xe(n=0|e[C]),(r=he(e,n,i))instanceof ee?(2&r.M)!=0?((r=r.da()).push(t),Z(e,n,i,r)):r.Ja(t):Array.isArray(r)?(2&(0|r[C])&&Z(e,n,i,r=f1(r)),r.push(t)):Z(e,n,i,[t]),!0)},function(t,e,i,n,r){if(e instanceof ee)e.forEach((s,o)=>{qn(t,i,Se([o,s],n,!1),r)});else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&qn(t,i,Se(o,n,!1),r)}});function U1(t,e,i){if(e=function(n){if(n==null)return n;const r=typeof n;if(r==="bigint")return String(Ki(64,n));if(Ji(n)){if(r==="string")return n1(n);if(r==="number")return es(n)}}(e),e!=null&&(typeof e=="string"&&A1(e),e!=null))switch(Lt(t,i,0),typeof e){case"number":t=t.g,je(e),gi(t,P,q);break;case"bigint":i=BigInt.asUintN(64,e),i=new ks(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),gi(t.g,i.h,i.g);break;default:i=A1(e),gi(t.g,i.h,i.g)}}function V1(t,e,i){(e=di(e))!=null&&e!=null&&(Lt(t,i,0),Zn(t.g,e))}function j1(t,e,i){(e=Ja(e))!=null&&(Lt(t,i,0),t.g.g.push(e?1:0))}function G1(t,e,i){(e=pi(e))!=null&&Wn(t,i,Sa(e))}function z1(t,e,i,n,r){qn(t,i,P1(e,n),r)}function Z1(t,e,i){e==null||typeof e=="string"||e instanceof le||(Ue(e)?Ue(e)&&zr(Ua):e=void 0),e!=null&&Wn(t,i,vs(e).buffer)}function W1(t,e,i){return(t.h===5||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,_s,e):e.push(_s(t.g)),!0)}var me=ft(function(t,e,i){if(t.h!==1)return!1;var n=t.g;t=ys(n);const r=ys(n);n=2*(r>>31)+1;const s=r>>>20&2047;return t=4294967296*(1048575&r)+t,mt(e,i,s==2047?t?NaN:n*(1/0):s==0?5e-324*n*t:n*Math.pow(2,s-1075)*(t+4503599627370496)),!0},function(t,e,i){(e=Ae(e))!=null&&(Lt(t,i,1),t=t.g,(i=qa||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),P=i.getUint32(0,!0),q=i.getUint32(4,!0),nn(t,P),nn(t,q))},Kt()),nt=ft(function(t,e,i){return t.h===5&&(mt(e,i,_s(t.g)),!0)},function(t,e,i){(e=Ae(e))!=null&&(Lt(t,i,5),t=t.g,Kr(e),nn(t,P))},Is),Rh=_i(W1,function(t,e,i){if((e=yi(Ae,e))!=null)for(let o=0;o<e.length;o++){var n=t,r=i,s=e[o];s!=null&&(Lt(n,r,5),n=n.g,Kr(s),nn(n,P))}},Is),$s=_i(W1,function(t,e,i){if((e=yi(Ae,e))!=null&&e.length){Lt(t,i,2),vi(t.g,4*e.length);for(let n=0;n<e.length;n++)i=t.g,Kr(e[n]),nn(i,P)}},Is),Te=ft(function(t,e,i){return t.h===0&&(mt(e,i,bs(t.g,Qr)),!0)},U1,M1),Os=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=bs(t.g,Qr))===0?void 0:t),!0)},U1,M1),$h=ft(function(t,e,i){return t.h===0&&(mt(e,i,bs(t.g,Jr)),!0)},function(t,e,i){if((e=gh(e))!=null&&(typeof e=="string"&&k1(e),e!=null))switch(Lt(t,i,0),typeof e){case"number":t=t.g,je(e),gi(t,P,q);break;case"bigint":i=BigInt.asUintN(64,e),i=new Es(Number(i&BigInt(4294967295)),Number(i>>BigInt(32))),gi(t.g,i.h,i.g);break;default:i=k1(e),gi(t.g,i.h,i.g)}},Kt()),X=ft(function(t,e,i){return t.h===0&&(mt(e,i,Me(t.g)),!0)},V1,Ts),Qn=_i(function(t,e,i){return(t.h===0||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,Me,e):e.push(Me(t.g)),!0)},function(t,e,i){if((e=yi(di,e))!=null&&e.length){i=As(t,i);for(let n=0;n<e.length;n++)Zn(t.g,e[n]);Ss(t,i)}},Ts),Ci=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=Me(t.g))===0?void 0:t),!0)},V1,Ts),j=ft(function(t,e,i){return t.h===0&&(mt(e,i,ws(t.g)),!0)},j1,S1),xi=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=ws(t.g))===!1?void 0:t),!0)},j1,S1),pt=_i(function(t,e,i){return t.h===2&&(t=xs(t),mi(e,0|e[C],i,!1).push(t),!0)},function(t,e,i){if((e=yi(pi,e))!=null)for(let o=0;o<e.length;o++){var n=t,r=i,s=e[o];s!=null&&Wn(n,r,Sa(s))}},Ms),Ie=ft(function(t,e,i){return t.h===2&&(mt(e,i,(t=xs(t))===""?void 0:t),!0)},G1,Ms),R=ft(function(t,e,i){return t.h===2&&(mt(e,i,xs(t)),!0)},G1,Ms),ot=function(t,e,i=Ls){return new wi(t,e,i)}(function(t,e,i,n,r){return t.h===2&&(n=Se(void 0,n,!0),mi(e,0|e[C],i,!0).push(n),en(t,n,r),!0)},function(t,e,i,n,r){if(Array.isArray(e))for(let s=0;s<e.length;s++)z1(t,e[s],i,n,r)}),$=Xn(function(t,e,i,n,r,s){return t.h===2&&(m1(e,0|e[C],s,i),en(t,e=ms(e,n,i),r),!0)},z1),q1=ft(function(t,e,i){return t.h===2&&(mt(e,i,E1(t)),!0)},Z1,T1),Oh=_i(function(t,e,i){return(t.h===0||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,fe,e):e.push(fe(t.g)),!0)},function(t,e,i){if((e=yi(Qa,e))!=null)for(let o=0;o<e.length;o++){var n=t,r=i,s=e[o];s!=null&&(Lt(n,r,0),vi(n.g,s))}},L1),Ph=ft(function(t,e,i){return t.h===0&&(mt(e,i,(t=fe(t.g))===0?void 0:t),!0)},function(t,e,i){(e=Qa(e))!=null&&e!=null&&(Lt(t,i,0),vi(t.g,e))},L1),Mt=ft(function(t,e,i){return t.h===0&&(mt(e,i,Me(t.g)),!0)},function(t,e,i){(e=di(e))!=null&&(e=parseInt(e,10),Lt(t,i,0),Zn(t.g,e))},I1);class Nh{constructor(e,i){this.h=e,this.g=i,this.l=I,this.m=E,this.defaultValue=void 0}register(){Sn(this)}}function Jt(t,e){return new Nh(t,e)}function Be(t,e){return(i,n)=>{if(zn.length){const s=zn.pop();s.o(n),Cs(s.g,i,n),i=s}else i=new class{constructor(s,o){if(C1.length){const a=C1.pop();Cs(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,Cs(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 t,o=s.u;Rs(e)(o,i);var r=s}finally{i.g.clear(),i.m=-1,i.h=-1,zn.length<100&&zn.push(i)}return r}}function tr(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 o=this.g;return this.g=[],o}}}};H1(this.u,e,We(Yn,Kn,Jn,t)),bi(e,e.g.end());const i=new Uint8Array(e.h),n=e.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 e.l=[i],i}}var X1=class extends y{constructor(t){super(t)}},Y1=[0,Ie,ft(function(t,e,i){return t.h===2&&(mt(e,i,(t=E1(t))===Ve()?void 0:t),!0)},function(t,e,i){if(e!=null){if(e instanceof y){const n=e.Oa;return void(n&&(e=n(e),e!=null&&Wn(t,i,vs(e).buffer)))}if(Array.isArray(e))return}Z1(t,e,i)},T1)];let Ps,K1=globalThis.trustedTypes;function J1(t){Ps===void 0&&(Ps=function(){let i=null;if(!K1)return i;try{const n=r=>r;i=K1.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return i}());var e=Ps;return new class{constructor(i){this.g=i}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Hh(t,...e){if(e.length===0)return J1(t[0]);let i=t[0];for(let n=0;n<e.length;n++)i+=encodeURIComponent(e[n])+t[n+1];return J1(i)}var Q1=[0,X,Mt,j,-1,Qn,Mt,-1],Uh=class extends y{constructor(t){super(t)}},tc=[0,j,R,j,Mt,-1,_i(function(t,e,i){return(t.h===0||t.h===2)&&(e=mi(e,0|e[C],i,!1),t.h==2?Gn(t,Lh,e):e.push(Me(t.g)),!0)},function(t,e,i){if((e=yi(di,e))!=null&&e.length){i=As(t,i);for(let n=0;n<e.length;n++)Zn(t.g,e[n]);Ss(t,i)}},I1),R,-1,[0,j,-1],Mt,j,-1],ec=[0,R,-2],ic=class extends y{constructor(t){super(t)}},nc=[0],rc=[0,X,j,1,j,-3],Tt=class extends y{constructor(t){super(t,2)}},rt={};rt[336783863]=[0,R,j,-1,X,[0,[1,2,3,4,5,6,7,8,9],$,nc,$,tc,$,ec,$,rc,$,Q1,$,[0,R,-2],$,[0,R,Mt],$,[0,Mt,R,-1],$,[0,Mt,-1]],[0,R],j,[0,[1,3],[2,4],$,[0,Qn],-1,$,[0,pt],-1,ot,[0,R,-1]],R];var sc=[0,Os,-1,xi,-3,Os,Qn,Ie,Ci,Os,-1,xi,Ci,xi,-2,Ie];function It(t,e){ds(t,2,ui(e),"")}function H(t,e){Hn(t,3,e)}function T(t,e){Hn(t,4,e)}var gt=class extends y{constructor(t){super(t,500)}o(t){return E(this,0,7,t)}},rn=[-1,{}],oc=[0,R,1,rn],ac=[0,R,pt,rn];function Bt(t,e){Un(t,1,gt,e)}function U(t,e){Hn(t,10,e)}function B(t,e){Hn(t,15,e)}var Ct=class extends y{constructor(t){super(t,500)}o(t){return E(this,0,1001,t)}},cc=[-500,ot,[-500,Ie,-1,pt,-3,[-2,rt,j],ot,Y1,Ci,-1,oc,ac,ot,[0,Ie,xi],Ie,sc,Ci,pt,987,pt],4,ot,[-500,R,-1,[-1,{}],998,R],ot,[-500,R,pt,-1,[-2,{},j],997,pt,-1],Ci,ot,[-500,R,pt,rn,998,pt],pt,Ci,oc,ac,ot,[0,Ie,-1,rn],pt,-2,sc,Ie,-1,xi,[0,xi,Ph],978,rn,ot,Y1];Ct.prototype.g=tr(cc);var Vh=Be(Ct,cc),jh=class extends y{constructor(t){super(t)}},lc=class extends y{constructor(t){super(t)}g(){return ue(this,jh,1)}},hc=[0,ot,[0,X,nt,R,-1]],er=Be(lc,hc),Gh=class extends y{constructor(t){super(t)}},zh=class extends y{constructor(t){super(t)}},Ns=class extends y{constructor(t){super(t)}h(){return I(this,Gh,2)}g(){return ue(this,zh,5)}},dc=Be(class extends y{constructor(t){super(t)}},[0,pt,Qn,$s,[0,Mt,[0,X,-3],[0,nt,-3],[0,X,-1,[0,ot,[0,X,-2]]],ot,[0,nt,-1,R,nt]],R,-1,Te,ot,[0,X,nt],pt,Te]),uc=class extends y{constructor(t){super(t)}},Ei=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,nt,-4]]),pc=class extends y{constructor(t){super(t)}},sn=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,nt,-4]]),Zh=class extends y{constructor(t){super(t)}},Wh=[0,X,-1,$s,Mt],fc=class extends y{constructor(t){super(t)}};fc.prototype.g=tr([0,nt,-4,Te]);var qh=class extends y{constructor(t){super(t)}},Xh=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,1,X,R,hc],Te]),mc=class extends y{constructor(t){super(t)}},Yh=class extends y{constructor(t){super(t)}ma(){const t=p1(this);return t??Ve()}},Kh=class extends y{constructor(t){super(t)}},gc=[1,2],Jh=Be(class extends y{constructor(t){super(t)}},[0,ot,[0,gc,$,[0,$s],$,[0,q1],X,R],Te]),Hs=class extends y{constructor(t){super(t)}},vc=[0,R,X,nt,pt,-1],bc=class extends y{constructor(t){super(t)}},Qh=[0,j,-1],wc=class extends y{constructor(t){super(t)}},ir=[1,2,3,4,5],nr=class extends y{constructor(t){super(t)}g(){return p1(this)!=null}h(){return Vt(this,2)!=null}},G=class extends y{constructor(t){super(t)}g(){return Ja(fi(this,2))??!1}},yc=[0,q1,R,[0,X,Te,-1],[0,$h,Te]],J=[0,yc,j,[0,ir,$,rc,$,tc,$,Q1,$,nc,$,ec],Mt],rr=class extends y{constructor(t){super(t)}},Us=[0,J,nt,-1,X],t0=Jt(502141897,rr);rt[502141897]=Us;var e0=Be(class extends y{constructor(t){super(t)}},[0,[0,Mt,-1,Rh,Oh],Wh]),_c=class extends y{constructor(t){super(t)}},Cc=class extends y{constructor(t){super(t)}},Vs=[0,J,nt,[0,J],j],xc=[0,J,Us,Vs,nt,[0,[0,yc]]],i0=Jt(508968150,Cc);rt[508968150]=xc,rt[508968149]=Vs;var Ec=class extends y{constructor(t){super(t)}},n0=Jt(513916220,Ec);rt[513916220]=[0,J,xc,X];var ki=class extends y{constructor(t){super(t)}h(){return I(this,Hs,2)}g(){N(this,2)}},kc=[0,J,vc];rt[478825465]=kc;var r0=class extends y{constructor(t){super(t)}},Ac=class extends y{constructor(t){super(t)}},js=class extends y{constructor(t){super(t)}},Gs=class extends y{constructor(t){super(t)}},Sc=class extends y{constructor(t){super(t)}},Lc=[0,J,[0,J],kc,-1],Mc=[0,J,nt,X],zs=[0,J,nt],Tc=[0,J,Mc,zs,nt],s0=Jt(479097054,Sc);rt[479097054]=[0,J,Tc,Lc],rt[463370452]=Lc,rt[464864288]=Mc;var o0=Jt(462713202,Gs);rt[462713202]=Tc,rt[474472470]=zs;var a0=class extends y{constructor(t){super(t)}},Ic=class extends y{constructor(t){super(t)}},Bc=class extends y{constructor(t){super(t)}},Fc=class extends y{constructor(t){super(t)}},Zs=[0,J,nt,-1,X],Ws=[0,J,nt,j];Fc.prototype.g=tr([0,J,zs,[0,J],Us,Vs,Zs,Ws]);var Dc=class extends y{constructor(t){super(t)}},c0=Jt(456383383,Dc);rt[456383383]=[0,J,vc];var Rc=class extends y{constructor(t){super(t)}},l0=Jt(476348187,Rc);rt[476348187]=[0,J,Qh];var $c=class extends y{constructor(t){super(t)}},Oc=class extends y{constructor(t){super(t)}},Pc=[0,Mt,-1],h0=Jt(458105876,class extends y{constructor(t){super(t)}g(){var t=this.u;const e=0|t[C],i=2&e;return t=function(n,r,s){var o=Oc;const a=2&r;let c=!1;if(s==null){if(a)return h1();s=[]}else if(s.constructor===ee){if((2&s.M)==0||a)return s;s=s.da()}else Array.isArray(s)?c=!!(2&(0|s[C])):s=[];if(a){if(!s.length)return h1();c||(c=!0,li(s))}else c&&(c=!1,s=f1(s));return c||(64&(0|s[C])?s[C]&=-33:32&r&&Mn(s,32)),Z(n,r,2,o=new ee(s,o,vh,void 0)),o}(t,e,he(t,e,2)),!i&&Oc&&(t.pa=!0),t}});rt[458105876]=[0,Pc,Dh,[!0,Te,[0,R,-1,pt]]];var qs=class extends y{constructor(t){super(t)}},Nc=Jt(458105758,qs);rt[458105758]=[0,J,R,Pc];var Hc=class extends y{constructor(t){super(t)}},d0=Jt(443442058,Hc);rt[443442058]=[0,J,R,X,nt,pt,-1,j,nt],rt[514774813]=Zs;var Uc=class extends y{constructor(t){super(t)}},u0=Jt(516587230,Uc);function Xs(t,e){return e=e?e.clone():new Hs,t.displayNamesLocale!==void 0?N(e,1,ui(t.displayNamesLocale)):t.displayNamesLocale===void 0&&N(e,1),t.maxResults!==void 0?ie(e,2,t.maxResults):"maxResults"in t&&N(e,2),t.scoreThreshold!==void 0?_(e,3,t.scoreThreshold):"scoreThreshold"in t&&N(e,3),t.categoryAllowlist!==void 0?Vn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&N(e,4),t.categoryDenylist!==void 0?Vn(e,5,t.categoryDenylist):"categoryDenylist"in t&&N(e,5),e}function Ys(t,e=-1,i=""){return{categories:t.map(n=>({index:Ut(n,1)??0??-1,score:K(n,2)??0,categoryName:Vt(n,3)??""??"",displayName:Vt(n,4)??""??""})),headIndex:e,headName:i}}function Vc(t){var e=ze(t,3,Ae,Ge()),i=ze(t,2,di,Ge()),n=ze(t,1,pi,Ge()),r=ze(t,9,pi,Ge());const s={categories:[],keypoints:[]};for(let o=0;o<e.length;o++)s.categories.push({score:e[o],index:i[o]??-1,categoryName:n[o]??"",displayName:r[o]??""});if((e=I(t,Ns,4)?.h())&&(s.boundingBox={originX:Ut(e,1)??0,originY:Ut(e,2)??0,width:Ut(e,3)??0,height:Ut(e,4)??0,angle:0}),I(t,Ns,4)?.g().length)for(const o of I(t,Ns,4).g())s.keypoints.push({x:Nn(o,1)??0,y:Nn(o,2)??0,score:Nn(o,4)??0,label:Vt(o,3)??""});return s}function sr(t){const e=[];for(const i of ue(t,pc,1))e.push({x:K(i,1)??0,y:K(i,2)??0,z:K(i,3)??0,visibility:K(i,4)??0});return e}function on(t){const e=[];for(const i of ue(t,uc,1))e.push({x:K(i,1)??0,y:K(i,2)??0,z:K(i,3)??0,visibility:K(i,4)??0});return e}function jc(t){return Array.from(t,e=>e>127?e-256:e)}function Gc(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,n=0,r=0;for(let s=0;s<t.length;s++)i+=t[s]*e[s],n+=t[s]*t[s],r+=e[s]*e[s];if(n<=0||r<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(n*r)}let or;rt[516587230]=[0,J,Zs,Ws,nt],rt[518928384]=Ws;const p0=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function zc(){if(or===void 0)try{await WebAssembly.instantiate(p0),or=!0}catch{or=!1}return or}async function an(t,e=Hh``){const i=await zc()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${i}.js`,wasmBinaryPath:`${e}/${t}_${i}.wasm`}}var qe=class{};function Zc(){var t=navigator;return typeof OffscreenCanvas<"u"&&(!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))}async function Wc(t){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((i,n)=>{e.addEventListener("load",()=>{i()},!1),e.addEventListener("error",r=>{n(r)},!1),document.body.appendChild(e)})}importScripts(t.toString())}function qc(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 x(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 Xc(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[n,r]=qc(e);return!t.l||n===t.i.canvas.width&&r===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=r),[n,r]}function Yc(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),i(e);for(const r of n)t.i._free(r);t.i._free(e)}function ne(t,e,i){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=i}function Fe(t,e,i){let n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(r,s,o)=>{s?(i(n,o),n=[]):n.push(r)}}qe.forVisionTasks=function(t){return an("vision",t)},qe.forTextTasks=function(t){return an("text",t)},qe.forGenAiExperimentalTasks=function(t){return an("genai_experimental",t)},qe.forGenAiTasks=function(t){return an("genai",t)},qe.forAudioTasks=function(t){return an("audio",t)},qe.isSimdSupported=function(){return zc()};async function f0(t,e,i,n){return t=await(async(r,s,o,a,c)=>{if(s&&await Wc(s),!self.ModuleFactory||o&&(await Wc(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=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new r(c,a)})(t,i.wasmLoaderPath,i.assetLoaderPath,e,{locateFile:r=>r.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&r.endsWith(".data")?i.assetBinaryPath.toString():r}),await t.o(n),t}function Ks(t,e){const i=I(t.baseOptions,nr,1)||new nr;typeof e=="string"?(N(i,2,ui(e)),N(i,1)):e instanceof Uint8Array&&(N(i,1,qr(e,!1)),N(i,2)),E(t.baseOptions,0,1,i)}function Kc(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 w(t,e){t.B=Math.max(t.B,e)}function ar(t,e){t.A=new gt,It(t.A,"PassThroughCalculator"),H(t.A,"free_memory"),T(t.A,"free_memory_unused_out"),U(e,"free_memory"),Bt(e,t.A)}function Ai(t,e){H(t.A,e),T(t.A,e+"_unused_out")}function cr(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var Js=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const i=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(I(this.baseOptions,nr,1)?.g()||I(this.baseOptions,nr,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(n,r){let s=I(n.baseOptions,wc,3);if(!s){var o=s=new wc,a=new ic;Qi(o,4,ir,a)}"delegate"in r&&(r.delegate==="GPU"?(r=s,o=new Uh,Qi(r,2,ir,o)):(r=s,o=new ic,Qi(r,4,ir,o))),E(n.baseOptions,0,3,s)}(this,i),i.modelAssetPath)return fetch(i.modelAssetPath.toString()).then(n=>{if(n.ok)return n.arrayBuffer();throw Error(`Failed to fetch model: ${i.modelAssetPath} (${n.status})`)}).then(n=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),Ks(this,"/model.dat"),this.m(),this.J()});if(i.modelAssetBuffer instanceof Uint8Array)Ks(this,i.modelAssetBuffer);else if(i.modelAssetBuffer)return async function(n){const r=[];for(var s=0;;){const{done:o,value:a}=await n.read();if(o)break;r.push(a),s+=a.length}if(r.length===0)return new Uint8Array(0);if(r.length===1)return r[0];n=new Uint8Array(s),s=0;for(const o of r)n.set(o,s),s+=o.length;return n}(i.modelAssetBuffer).then(n=>{Ks(this,n),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca(e=>{t=Vh(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((i,n)=>{this.G.push(Error(n))}),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,Kc(this)}finishProcessing(){this.g.finishProcessing(),Kc(this)}close(){this.A=void 0,this.g.closeGraph()}};function vt(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Js.prototype.close=Js.prototype.close;class m0{constructor(e,i,n,r){this.g=e,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 Jc(t,e,i){const n=t.g;if(i=vt(n.createShader(i),"Failed to create WebGL shader"),n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(i)}`);return n.attachShader(t.h,i),i}function Qc(t,e){const i=t.g,n=vt(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(n);const r=vt(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,r),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 s=vt(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,s),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 m0(i,n,r,s)}function Qs(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function cn(t,e,i,n){return Qs(t,e),t.h||(t.m(),t.C()),i?(t.s||(t.s=Qc(t,!0)),i=t.s):(t.v||(t.v=Qc(t,!1)),i=t.v),e.useProgram(t.h),i.bind(),t.l(),t=n(),i.g.bindVertexArray(null),t}function De(t,e,i){return Qs(t,e),t=vt(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??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function lr(t,e,i){Qs(t,e),t.A||(t.A=vt(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 to(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var Si=class{G(){return`
3188
+ precision mediump float;
3189
+ varying vec2 vTex;
3190
+ uniform sampler2D inputTexture;
3191
+ void main() {
3192
+ gl_FragColor = texture2D(inputTexture, vTex);
3193
+ }
3194
+ `}m(){const t=this.g;if(this.h=vt(t.createProgram(),"Failed to create WebGL program"),this.Z=Jc(this,`
3195
+ attribute vec2 aVertex;
3196
+ attribute vec2 aTex;
3197
+ varying vec2 vTex;
3198
+ void main(void) {
3199
+ gl_Position = vec4(aVertex, 0.0, 1.0);
3200
+ vTex = aTex;
3201
+ }`,t.VERTEX_SHADER),this.Y=Jc(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()}},g0=class extends Si{G(){return`
3202
+ precision mediump float;
3203
+ uniform sampler2D backgroundTexture;
3204
+ uniform sampler2D maskTexture;
3205
+ uniform sampler2D colorMappingTexture;
3206
+ varying vec2 vTex;
3207
+ void main() {
3208
+ vec4 backgroundColor = texture2D(backgroundTexture, vTex);
3209
+ float category = texture2D(maskTexture, vTex).r;
3210
+ vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
3211
+ gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
3212
+ }
3213
+ `}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=De(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=De(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.L=vt(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=vt(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=vt(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()}},v0=class extends Si{G(){return`
3214
+ precision mediump float;
3215
+ uniform sampler2D maskTexture;
3216
+ uniform sampler2D defaultTexture;
3217
+ uniform sampler2D overlayTexture;
3218
+ varying vec2 vTex;
3219
+ void main() {
3220
+ float confidence = texture2D(maskTexture, vTex).r;
3221
+ vec4 defaultColor = texture2D(defaultTexture, vTex);
3222
+ vec4 overlayColor = texture2D(overlayTexture, vTex);
3223
+ // Apply the alpha from the overlay and merge in the default color
3224
+ overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
3225
+ gl_FragColor = mix(defaultColor, overlayColor, confidence);
3226
+ }
3227
+ `}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=De(this,t),t.activeTexture(t.TEXTURE2),this.B=De(this,t)}m(){super.m();const t=this.g;this.K=vt(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=vt(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=vt(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 ge(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<"u"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function eo(t){var e=ge(t,1);if(!e){if(e=ge(t,0))e=new Float32Array(e).map(n=>n/255);else{e=new Float32Array(t.width*t.height);const n=Li(t);var i=io(t);if(lr(i,n,t2(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),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,i);for(let r=0,s=0;r<e.length;++r,s+=4)e[r]=i[s]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function t2(t){let e=ge(t,2);if(!e){const i=Li(t);e=i2(t);const n=eo(t),r=e2(t);i.texImage2D(i.TEXTURE_2D,0,r,t.width,t.height,0,i.RED,i.FLOAT,n),no(t)}return e}function Li(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=vt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function e2(t){if(t=Li(t),!hr)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))hr=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");hr=t.R16F}return hr}function io(t){return t.l||(t.l=new Si),t.l}function i2(t){const e=Li(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=ge(t,2);return i||(i=De(io(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(i),t.j=!0),e.bindTexture(e.TEXTURE_2D,i),i}function no(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var hr,at=class{constructor(t,e,i,n,r,s,o){this.g=t,this.m=e,this.j=i,this.canvas=n,this.l=r,this.width=s,this.height=o,this.j&&--n2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!ge(this,0)}ja(){return!!ge(this,1)}R(){return!!ge(this,2)}ia(){return(e=ge(t=this,0))||(e=eo(t),e=new Uint8Array(e.map(i=>255*i)),t.g.push(e)),e;var t,e}ha(){return eo(this)}N(){return t2(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 n=Li(this),r=io(this);n.activeTexture(n.TEXTURE1),i=De(r,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,i);const s=e2(this);n.texImage2D(n.TEXTURE_2D,0,s,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),lr(r,n,i),cn(r,n,!1,()=>{i2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),no(this)}),to(r),no(this)}}t.push(i)}return new at(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Li(this).deleteTexture(ge(this,2)),n2=-1}};at.prototype.close=at.prototype.close,at.prototype.clone=at.prototype.clone,at.prototype.getAsWebGLTexture=at.prototype.N,at.prototype.getAsFloat32Array=at.prototype.ha,at.prototype.getAsUint8Array=at.prototype.ia,at.prototype.hasWebGLTexture=at.prototype.R,at.prototype.hasFloat32Array=at.prototype.ja,at.prototype.hasUint8Array=at.prototype.Da;var n2=250;const b0={color:"white",lineWidth:4,radius:6};function ro(t){return{...b0,fillColor:(t=t||{}).color,...t}}function ve(t,e){return t instanceof Function?t(e):t}function r2(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function ln(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function hn(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function s2(t,e,i){if(e.R())i(e.N());else{const n=e.ja()?e.ha():e.ia();t.m=t.m??new Si;const r=hn(t);i((t=new at([n],e.m,!1,r.canvas,t.m,e.width,e.height)).N()),t.close()}}function o2(t,e,i,n){const r=function(a){return a.g||(a.g=new g0),a.g}(t),s=hn(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;cn(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[g,v]of p){p=g;const b=v;var m=f.next();if(m.done)return!1;const[k,S]=m.value;if(m=S,p!==k||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,e,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 a2(t,e,i,n){const r=hn(t),s=function(c){return c.h||(c.h=new v0),c.h}(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;cn(s,r,!0,()=>{var c=s.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,e),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 bt=class{constructor(t,e){typeof CanvasRenderingContext2D<"u"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var i=ln(this);e=ro(e),i.save();var n=i.canvas,r=0;for(const s of t)i.fillStyle=ve(e.fillColor,{index:r,from:s}),i.strokeStyle=ve(e.color,{index:r,from:s}),i.lineWidth=ve(e.lineWidth,{index:r,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,ve(e.radius,{index:r,from:s}),0,2*Math.PI),i.fill(t),i.stroke(t),++r;i.restore()}}va(t,e,i){if(t&&e){var n=ln(this);i=ro(i),n.save();var r=n.canvas,s=0;for(const o of e){n.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(n.strokeStyle=ve(i.color,{index:s,from:e,to:a}),n.lineWidth=ve(i.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*r.width,e.y*r.height),n.lineTo(a.x*r.width,a.y*r.height)),++s,n.stroke()}n.restore()}}sa(t,e){const i=ln(this);e=ro(e),i.save(),i.beginPath(),i.lineWidth=ve(e.lineWidth,{}),i.strokeStyle=ve(e.color,{}),i.fillStyle=ve(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(n,r,s,o){const a=hn(n);s2(n,r,c=>{o2(n,c,s,o),(c=ln(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,i,e):o2(this,t.N(),i,e)}ua(t,e,i){this.l?function(n,r,s,o){const a=hn(n);s2(n,r,c=>{a2(n,c,s,o),(c=ln(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,e,i):a2(this,t.N(),e,i)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function re(t,e){switch(e){case 0:return t.g.find(i=>i instanceof ImageData);case 1:return t.g.find(i=>typeof ImageBitmap<"u"&&i instanceof ImageBitmap);case 2:return t.g.find(i=>typeof WebGLTexture<"u"&&i instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function c2(t){var e=re(t,0);if(!e){e=Mi(t);const i=ur(t),n=new Uint8Array(t.width*t.height*4);lr(i,e,dr(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),to(i),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function dr(t){let e=re(t,2);if(!e){const i=Mi(t);e=pr(t);const n=re(t,1)||c2(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),dn(t)}return e}function Mi(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=vt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ur(t){return t.l||(t.l=new Si),t.l}function pr(t){const e=Mi(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=re(t,2);return i||(i=De(ur(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function dn(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function l2(t){const e=Mi(t);return cn(ur(t),e,!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}(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()}))}bt.prototype.close=bt.prototype.close,bt.prototype.drawConfidenceMask=bt.prototype.ua,bt.prototype.drawCategoryMask=bt.prototype.ta,bt.prototype.drawBoundingBox=bt.prototype.sa,bt.prototype.drawConnectors=bt.prototype.va,bt.prototype.drawLandmarks=bt.prototype.wa,bt.lerp=function(t,e,i,n,r){return r2(n*(1-(t-e)/(i-e))+r*(1-(i-t)/(i-e)),n,r)},bt.clamp=r2;var ct=class{constructor(t,e,i,n,r,s,o){this.g=t,this.j=e,this.m=i,this.canvas=n,this.l=r,this.width=s,this.height=o,(this.j||this.m)&&--h2===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!re(this,0)}ka(){return!!re(this,1)}R(){return!!re(this,2)}Aa(){return c2(this)}za(){var t=re(this,1);return t||(dr(this),pr(this),t=l2(this),dn(this),this.g.push(t),this.j=!0),t}N(){return dr(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 n=Mi(this),r=ur(this);n.activeTexture(n.TEXTURE1),i=De(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),lr(r,n,i),cn(r,n,!1,()=>{pr(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),dn(this)}),to(r),dn(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);dr(this),pr(this),i=l2(this),dn(this)}t.push(i)}return new ct(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&re(this,1).close(),this.m&&Mi(this).deleteTexture(re(this,2)),h2=-1}};ct.prototype.close=ct.prototype.close,ct.prototype.clone=ct.prototype.clone,ct.prototype.getAsWebGLTexture=ct.prototype.N,ct.prototype.getAsImageBitmap=ct.prototype.za,ct.prototype.getAsImageData=ct.prototype.Aa,ct.prototype.hasWebGLTexture=ct.prototype.R,ct.prototype.hasImageBitmap=ct.prototype.ka,ct.prototype.hasImageData=ct.prototype.Ca;var h2=250;function Qt(...t){return t.map(([e,i])=>({start:e,end:i}))}const w0=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((d2=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:Zc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await 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,n=this.i._malloc(i);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(i,n):this.i._changeTextGraph(i,n),this.i._free(n)}configureAudio(t,e,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?'),x(this,n||"input_audio",s=>{x(this,r=r||"audio_header",o=>{this.i._configureAudio(s,o,t,e??0,i)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){ne(this,"__graph_config__",e=>{t(e)}),x(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,n,r){const s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),x(this,n,o=>{this.i._addAudioToInputStream(this.g,e,i,o,r)})}addGpuBufferToStream(t,e,i){x(this,e,n=>{const[r,s]=Xc(this,t,n);this.i._addBoundTextureToStream(n,r,s,i)})}addBoolToStream(t,e,i){x(this,e,n=>{this.i._addBoolToInputStream(t,n,i)})}addDoubleToStream(t,e,i){x(this,e,n=>{this.i._addDoubleToInputStream(t,n,i)})}addFloatToStream(t,e,i){x(this,e,n=>{this.i._addFloatToInputStream(t,n,i)})}addIntToStream(t,e,i){x(this,e,n=>{this.i._addIntToInputStream(t,n,i)})}addUintToStream(t,e,i){x(this,e,n=>{this.i._addUintToInputStream(t,n,i)})}addStringToStream(t,e,i){x(this,e,n=>{x(this,t,r=>{this.i._addStringToInputStream(r,n,i)})})}addStringRecordToStream(t,e,i){x(this,e,n=>{Yc(this,Object.keys(t),r=>{Yc(this,Object.values(t),s=>{this.i._addFlatHashMapToInputStream(r,s,Object.keys(t).length,n,i)})})})}addProtoToStream(t,e,i,n){x(this,i,r=>{x(this,e,s=>{const o=this.i._malloc(t.length);this.i.HEAPU8.set(t,o),this.i._addProtoToInputStream(o,t.length,s,r,n),this.i._free(o)})})}addEmptyPacketToStream(t,e){x(this,t,i=>{this.i._addEmptyPacketToInputStream(i,e)})}addBoolVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const s of t)this.i._addBoolVectorEntry(r,s);this.i._addBoolVectorToInputStream(r,n,i)})}addDoubleVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const s of t)this.i._addDoubleVectorEntry(r,s);this.i._addDoubleVectorToInputStream(r,n,i)})}addFloatVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const s of t)this.i._addFloatVectorEntry(r,s);this.i._addFloatVectorToInputStream(r,n,i)})}addIntVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const s of t)this.i._addIntVectorEntry(r,s);this.i._addIntVectorToInputStream(r,n,i)})}addUintVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of t)this.i._addUintVectorEntry(r,s);this.i._addUintVectorToInputStream(r,n,i)})}addStringVectorToStream(t,e,i){x(this,e,n=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const s of t)x(this,s,o=>{this.i._addStringVectorEntry(r,o)});this.i._addStringVectorToInputStream(r,n,i)})}addBoolToInputSidePacket(t,e){x(this,e,i=>{this.i._addBoolToInputSidePacket(t,i)})}addDoubleToInputSidePacket(t,e){x(this,e,i=>{this.i._addDoubleToInputSidePacket(t,i)})}addFloatToInputSidePacket(t,e){x(this,e,i=>{this.i._addFloatToInputSidePacket(t,i)})}addIntToInputSidePacket(t,e){x(this,e,i=>{this.i._addIntToInputSidePacket(t,i)})}addUintToInputSidePacket(t,e){x(this,e,i=>{this.i._addUintToInputSidePacket(t,i)})}addStringToInputSidePacket(t,e){x(this,e,i=>{x(this,t,n=>{this.i._addStringToInputSidePacket(n,i)})})}addProtoToInputSidePacket(t,e,i){x(this,i,n=>{x(this,e,r=>{const s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputSidePacket(s,t.length,r,n),this.i._free(s)})})}addBoolVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const r of t)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputSidePacket(n,i)})}addDoubleVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const r of t)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputSidePacket(n,i)})}addFloatVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const r of t)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputSidePacket(n,i)})}addIntVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const r of t)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputSidePacket(n,i)})}addUintVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const r of t)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputSidePacket(n,i)})}addStringVectorToInputSidePacket(t,e){x(this,e,i=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const r of t)x(this,r,s=>{this.i._addStringVectorEntry(n,s)});this.i._addStringVectorToInputSidePacket(n,i)})}attachBoolListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachBoolListener(i)})}attachBoolVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachBoolVectorListener(i)})}attachIntListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachIntListener(i)})}attachIntVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachIntVectorListener(i)})}attachUintListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachUintListener(i)})}attachUintVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachUintVectorListener(i)})}attachDoubleListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachDoubleListener(i)})}attachDoubleVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachDoubleVectorListener(i)})}attachFloatListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachFloatListener(i)})}attachFloatVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachFloatVectorListener(i)})}attachStringListener(t,e){ne(this,t,e),x(this,t,i=>{this.i._attachStringListener(i)})}attachStringVectorListener(t,e){Fe(this,t,e),x(this,t,i=>{this.i._attachStringVectorListener(i)})}attachProtoListener(t,e,i){ne(this,t,e),x(this,t,n=>{this.i._attachProtoListener(n,i||!1)})}attachProtoVectorListener(t,e,i){Fe(this,t,e),x(this,t,n=>{this.i._attachProtoVectorListener(n,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?'),ne(this,t,(n,r)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),e(n,r)}),x(this,t,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 d2{get ea(){return this.i}oa(t,e,i){x(this,e,n=>{const[r,s]=Xc(this,t,n);this.ea._addBoundTextureAsImageToStream(n,r,s,i)})}V(t,e){ne(this,t,e),x(this,t,i=>{this.ea._attachImageListener(i)})}ba(t,e){Fe(this,t,e),x(this,t,i=>{this.ea._attachImageVectorListener(i)})}}));var d2,jt=class extends w0{};async function M(t,e,i){return async function(n,r,s,o){return f0(n,r,s,o)}(t,i.canvas??(Zc()?void 0:document.createElement("canvas")),e,i)}function u2(t,e,i,n){if(t.U){const s=new fc;if(i?.regionOfInterest){if(!t.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].");_(s,1,(r.left+r.right)/2),_(s,2,(r.top+r.bottom)/2),_(s,4,r.right-r.left),_(s,3,r.bottom-r.top)}else _(s,1,.5),_(s,2,.5),_(s,4,1),_(s,3,1);if(i?.rotationDegrees){if(i?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(s,5,-Math.PI*i.rotationDegrees/180),i?.rotationDegrees%180!=0){const[o,a]=qc(e);i=K(s,3)*a/o,r=K(s,4)*o/a,_(s,4,i),_(s,3,r)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,n)}t.g.oa(e,t.Z,n??performance.now()),t.finishProcessing()}function Gt(t,e,i){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");u2(t,e,i,t.B+1)}function se(t,e,i,n){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");u2(t,e,i,n)}function Ti(t,e,i,n){var r=e.data;const s=e.width,o=s*(e=e.height);if((r instanceof Uint8Array||r instanceof Float32Array)&&r.length!==o)throw Error("Unsupported channel count: "+r.length/o);return t=new at([r],i,!1,t.g.i.canvas,t.P,s,e),n?t.clone():t}var xt=class extends Js{constructor(t,e,i,n){super(t),this.g=t,this.Z=e,this.U=i,this.na=n,this.P=new Si}l(t,e=!0){if("runningMode"in t&&tn(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()}};xt.prototype.close=xt.prototype.close;var zt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},E(t=this.h=new rr,0,1,e=new G),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&_(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&_(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}D(t,e){return this.j={detections:[]},Gt(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect_in"),B(t,"detections");const e=new Tt;Yt(e,t0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect_in"),T(i,"DETECTIONS:detections"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=dc(s),this.j.detections.push(Vc(n));w(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};zt.prototype.detectForVideo=zt.prototype.F,zt.prototype.detect=zt.prototype.D,zt.prototype.setOptions=zt.prototype.o,zt.createFromModelPath=async function(t,e){return M(zt,t,{baseOptions:{modelAssetPath:e}})},zt.createFromModelBuffer=function(t,e){return M(zt,t,{baseOptions:{modelAssetBuffer:e}})},zt.createFromOptions=function(t,e){return M(zt,t,e)};var so=Qt([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]),oo=Qt([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]),ao=Qt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),p2=Qt([474,475],[475,476],[476,477],[477,474]),co=Qt([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]),lo=Qt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),f2=Qt([469,470],[470,471],[471,472],[472,469]),ho=Qt([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]),m2=[...so,...oo,...ao,...co,...lo,...ho],g2=Qt([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 v2(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var V=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,E(t=this.h=new Cc,0,1,e=new G),this.v=new _c,E(this.h,0,3,this.v),this.s=new rr,E(this.h,0,2,this.s),ie(this.s,4,1),_(this.s,2,.5),_(this.v,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numFaces"in t&&ie(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&_(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&_(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return v2(this),Gt(this,t,e),this.j}F(t,e,i){return v2(this),se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"face_landmarks");const e=new Tt;Yt(e,i0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("face_landmarks",(n,r)=>{for(const s of n)n=sn(s),this.j.faceLandmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{w(this,n)}),this.outputFaceBlendshapes&&(B(t,"blendshapes"),T(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,r)=>{if(this.outputFaceBlendshapes)for(const s of n)n=er(s),this.j.faceBlendshapes.push(Ys(n.g()??[]));w(this,r)}),this.g.attachEmptyPacketListener("blendshapes",n=>{w(this,n)})),this.outputFacialTransformationMatrixes&&(B(t,"face_geometry"),T(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,r)=>{if(this.outputFacialTransformationMatrixes)for(const s of n)(n=I(e0(s),Zh,2))&&this.j.facialTransformationMatrixes.push({rows:Ut(n,1)??0??0,columns:Ut(n,2)??0??0,data:ze(n,3,Ae,Ge()).slice()??[]});w(this,r)}),this.g.attachEmptyPacketListener("face_geometry",n=>{w(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};V.prototype.detectForVideo=V.prototype.F,V.prototype.detect=V.prototype.D,V.prototype.setOptions=V.prototype.o,V.createFromModelPath=function(t,e){return M(V,t,{baseOptions:{modelAssetPath:e}})},V.createFromModelBuffer=function(t,e){return M(V,t,{baseOptions:{modelAssetBuffer:e}})},V.createFromOptions=function(t,e){return M(V,t,e)},V.FACE_LANDMARKS_LIPS=so,V.FACE_LANDMARKS_LEFT_EYE=oo,V.FACE_LANDMARKS_LEFT_EYEBROW=ao,V.FACE_LANDMARKS_LEFT_IRIS=p2,V.FACE_LANDMARKS_RIGHT_EYE=co,V.FACE_LANDMARKS_RIGHT_EYEBROW=lo,V.FACE_LANDMARKS_RIGHT_IRIS=f2,V.FACE_LANDMARKS_FACE_OVAL=ho,V.FACE_LANDMARKS_CONTOURS=m2,V.FACE_LANDMARKS_TESSELATION=g2;var oe=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!0),E(t=this.j=new Ec,0,1,e=new G)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,i){const n=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:i,Gt(this,t,n??{}),!this.h)return this.s}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"stylized_image");const e=new Tt;Yt(e,n0,this.j);const i=new gt;It(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Bt(t,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 ct([o],!1,!1,this.g.i.canvas,this.P,a,n),this.s=s=s?a.clone():a,this.h&&this.h(s),w(this,r)}),this.g.attachEmptyPacketListener("stylized_image",n=>{this.s=null,this.h&&this.h(null),w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};oe.prototype.stylize=oe.prototype.Ka,oe.prototype.setOptions=oe.prototype.o,oe.createFromModelPath=function(t,e){return M(oe,t,{baseOptions:{modelAssetPath:e}})},oe.createFromModelBuffer=function(t,e){return M(oe,t,{baseOptions:{modelAssetBuffer:e}})},oe.createFromOptions=function(t,e){return M(oe,t,e)};var uo=Qt([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 b2(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function w2(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 y2(t,e=!0){const i=[];for(const r of t){var n=er(r);t=[];for(const s of n.g())n=e&&Ut(s,1)!=null?Ut(s,1)??0:-1,t.push({score:K(s,2)??0,index:n,categoryName:Vt(s,3)??""??"",displayName:Vt(s,4)??""??""});i.push(t)}return i}var Ft=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.j=new Sc,0,1,e=new G),this.s=new Gs,E(this.j,0,2,this.s),this.C=new js,E(this.s,0,3,this.C),this.v=new Ac,E(this.s,0,2,this.v),this.h=new r0,E(this.j,0,3,this.h),_(this.v,2,.5),_(this.s,4,.5),_(this.C,2,.5)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){if(ie(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&_(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&_(this.C,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new ki,i=e,n=Xs(t.cannedGesturesClassifierOptions,I(this.h,ki,3)?.h());E(i,0,2,n),E(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&I(this.h,ki,3)?.g();return t.customGesturesClassifierOptions?(E(i=e=new ki,0,2,n=Xs(t.customGesturesClassifierOptions,I(this.h,ki,4)?.h())),E(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&I(this.h,ki,4)?.g(),this.l(t)}Fa(t,e){return b2(this),Gt(this,t,e),w2(this)}Ga(t,e,i){return b2(this),se(this,t,i,e),w2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"hand_gestures"),B(t,"hand_landmarks"),B(t,"world_hand_landmarks"),B(t,"handedness");const e=new Tt;Yt(e,s0,this.j);const i=new gt;It(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"HAND_GESTURES:hand_gestures"),T(i,"LANDMARKS:hand_landmarks"),T(i,"WORLD_LANDMARKS:world_hand_landmarks"),T(i,"HANDEDNESS:handedness"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n){n=sn(s);const o=[];for(const a of ue(n,pc,1))o.push({x:K(a,1)??0,y:K(a,2)??0,z:K(a,3)??0,visibility:K(a,4)??0});this.landmarks.push(o)}w(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n){n=Ei(s);const o=[];for(const a of ue(n,uc,1))o.push({x:K(a,1)??0,y:K(a,2)??0,z:K(a,3)??0,visibility:K(a,4)??0});this.worldLandmarks.push(o)}w(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,r)=>{this.gestures.push(...y2(n,!1)),w(this,r)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{w(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{this.handedness.push(...y2(n)),w(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function _2(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}Ft.prototype.recognizeForVideo=Ft.prototype.Ga,Ft.prototype.recognize=Ft.prototype.Fa,Ft.prototype.setOptions=Ft.prototype.o,Ft.createFromModelPath=function(t,e){return M(Ft,t,{baseOptions:{modelAssetPath:e}})},Ft.createFromModelBuffer=function(t,e){return M(Ft,t,{baseOptions:{modelAssetBuffer:e}})},Ft.createFromOptions=function(t,e){return M(Ft,t,e)},Ft.HAND_CONNECTIONS=uo;var Dt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.h=new Gs,0,1,e=new G),this.s=new js,E(this.h,0,3,this.s),this.j=new Ac,E(this.h,0,2,this.j),ie(this.j,3,1),_(this.j,2,.5),_(this.s,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numHands"in t&&ie(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&_(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&_(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Gt(this,t,e),_2(this)}F(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],se(this,t,i,e),_2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"hand_landmarks"),B(t,"world_hand_landmarks"),B(t,"handedness");const e=new Tt;Yt(e,o0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"LANDMARKS:hand_landmarks"),T(i,"WORLD_LANDMARKS:world_hand_landmarks"),T(i,"HANDEDNESS:handedness"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("hand_landmarks",(n,r)=>{for(const s of n)n=sn(s),this.landmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,r)=>{for(const s of n)n=Ei(s),this.worldLandmarks.push(on(n));w(this,r)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{w(this,n)}),this.g.attachProtoVectorListener("handedness",(n,r)=>{var s=this.handedness,o=s.push;const a=[];for(const c of n){n=er(c);const l=[];for(const d of n.g())l.push({score:K(d,2)??0,index:Ut(d,1)??0??-1,categoryName:Vt(d,3)??""??"",displayName:Vt(d,4)??""??""});a.push(l)}o.call(s,...a),w(this,r)}),this.g.attachEmptyPacketListener("handedness",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Dt.prototype.detectForVideo=Dt.prototype.F,Dt.prototype.detect=Dt.prototype.D,Dt.prototype.setOptions=Dt.prototype.o,Dt.createFromModelPath=function(t,e){return M(Dt,t,{baseOptions:{modelAssetPath:e}})},Dt.createFromModelBuffer=function(t,e){return M(Dt,t,{baseOptions:{modelAssetBuffer:e}})},Dt.createFromOptions=function(t,e){return M(Dt,t,e)},Dt.HAND_CONNECTIONS=uo;var C2=Qt([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 x2(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function E2(t){try{if(!t.C)return t.h;t.C(t.h)}finally{cr(t)}}function fr(t,e){t=sn(t),e.push(sr(t))}var z=class extends xt{constructor(t,e){super(new jt(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,E(t=this.j=new Fc,0,1,e=new G),this.K=new js,E(this.j,0,2,this.K),this.Y=new a0,E(this.j,0,3,this.Y),this.s=new rr,E(this.j,0,4,this.s),this.H=new _c,E(this.j,0,5,this.H),this.v=new Ic,E(this.j,0,6,this.v),this.L=new Bc,E(this.j,0,7,this.L),_(this.s,2,.5),_(this.s,3,.3),_(this.H,2,.5),_(this.v,2,.5),_(this.v,3,.3),_(this.L,2,.5),_(this.K,2,.5)}get baseOptions(){return I(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&_(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&_(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&_(this.H,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&_(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&_(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&_(this.L,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&_(this.K,2,t.minHandLandmarksConfidence??.5),this.l(t)}D(t,e,i){const n=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:i,x2(this),Gt(this,t,n),E2(this)}F(t,e,i,n){const r=typeof i!="function"?i:{};return this.C=typeof i=="function"?i:n,x2(this),se(this,t,r,e),E2(this)}m(){var t=new Ct;U(t,"input_frames_image"),B(t,"pose_landmarks"),B(t,"pose_world_landmarks"),B(t,"face_landmarks"),B(t,"left_hand_landmarks"),B(t,"left_hand_world_landmarks"),B(t,"right_hand_landmarks"),B(t,"right_hand_world_landmarks");const e=new Tt,i=new X1;ds(i,1,ui("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(r,s){if(s!=null)if(Array.isArray(s))N(r,2,$n(s,as,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof le||Ue(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");ds(r,2,qr(s,!1),Ve())}}(i,this.j.g());const n=new gt;It(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Un(n,8,X1,i),H(n,"IMAGE:input_frames_image"),T(n,"POSE_LANDMARKS:pose_landmarks"),T(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),T(n,"FACE_LANDMARKS:face_landmarks"),T(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),T(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),T(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),T(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(e),Bt(t,n),ar(this,t),this.g.attachProtoListener("pose_landmarks",(r,s)=>{fr(r,this.h.poseLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("pose_world_landmarks",(r,s)=>{var o=this.h.poseWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",r=>{w(this,r)}),this.outputPoseSegmentationMasks&&(T(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Ai(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(r,s)=>{this.h.poseSegmentationMasks=[Ti(this,r,!0,!this.C)],w(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",r=>{this.h.poseSegmentationMasks=[],w(this,r)})),this.g.attachProtoListener("face_landmarks",(r,s)=>{fr(r,this.h.faceLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{w(this,r)}),this.outputFaceBlendshapes&&(B(t,"extra_blendshapes"),T(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(r,s)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(r=er(r),o.push(Ys(r.g()??[]))),w(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",r=>{w(this,r)})),this.g.attachProtoListener("left_hand_landmarks",(r,s)=>{fr(r,this.h.leftHandLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("left_hand_world_landmarks",(r,s)=>{var o=this.h.leftHandWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("right_hand_landmarks",(r,s)=>{fr(r,this.h.rightHandLandmarks),w(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",r=>{w(this,r)}),this.g.attachProtoListener("right_hand_world_landmarks",(r,s)=>{var o=this.h.rightHandWorldLandmarks;r=Ei(r),o.push(on(r)),w(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",r=>{w(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};z.prototype.detectForVideo=z.prototype.F,z.prototype.detect=z.prototype.D,z.prototype.setOptions=z.prototype.o,z.createFromModelPath=function(t,e){return M(z,t,{baseOptions:{modelAssetPath:e}})},z.createFromModelBuffer=function(t,e){return M(z,t,{baseOptions:{modelAssetBuffer:e}})},z.createFromOptions=function(t,e){return M(z,t,e)},z.HAND_CONNECTIONS=uo,z.POSE_CONNECTIONS=C2,z.FACE_LANDMARKS_LIPS=so,z.FACE_LANDMARKS_LEFT_EYE=oo,z.FACE_LANDMARKS_LEFT_EYEBROW=ao,z.FACE_LANDMARKS_LEFT_IRIS=p2,z.FACE_LANDMARKS_RIGHT_EYE=co,z.FACE_LANDMARKS_RIGHT_EYEBROW=lo,z.FACE_LANDMARKS_RIGHT_IRIS=f2,z.FACE_LANDMARKS_FACE_OVAL=ho,z.FACE_LANDMARKS_CONTOURS=m2,z.FACE_LANDMARKS_TESSELATION=g2;var Zt=class extends xt{constructor(t,e){super(new jt(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},E(t=this.h=new Dc,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return E(this.h,0,2,Xs(t,I(this.h,Hs,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},Gt(this,t,e),this.j}ra(t,e,i){return this.j={classifications:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"input_image"),U(t,"norm_rect"),B(t,"classifications");const e=new Tt;Yt(e,c0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),H(i,"IMAGE:input_image"),H(i,"NORM_RECT:norm_rect"),T(i,"CLASSIFICATIONS:classifications"),i.o(e),Bt(t,i),this.g.attachProtoListener("classifications",(n,r)=>{this.j=function(s){const o={classifications:ue(s,qh,1).map(a=>Ys(I(a,lc,4)?.g()??[],Ut(a,2)??0,Vt(a,3)??""))};return is(fi(s,2))!=null&&(o.timestampMs=is(fi(s,2))??0),o}(Xh(n)),w(this,r)}),this.g.attachEmptyPacketListener("classifications",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Zt.prototype.classifyForVideo=Zt.prototype.ra,Zt.prototype.classify=Zt.prototype.qa,Zt.prototype.setOptions=Zt.prototype.o,Zt.createFromModelPath=function(t,e){return M(Zt,t,{baseOptions:{modelAssetPath:e}})},Zt.createFromModelBuffer=function(t,e){return M(Zt,t,{baseOptions:{modelAssetBuffer:e}})},Zt.createFromOptions=function(t,e){return M(Zt,t,e)};var Rt=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!0),this.h=new Rc,this.embeddings={embeddings:[]},E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e=this.h,i=I(this.h,bc,2);return i=i?i.clone():new bc,t.l2Normalize!==void 0?tn(i,1,t.l2Normalize):"l2Normalize"in t&&N(i,1),t.quantize!==void 0?tn(i,2,t.quantize):"quantize"in t&&N(i,2),E(e,0,2,i),this.l(t)}xa(t,e){return Gt(this,t,e),this.embeddings}ya(t,e,i){return se(this,t,i,e),this.embeddings}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"embeddings_out");const e=new Tt;Yt(e,l0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"EMBEDDINGS:embeddings_out"),i.o(e),Bt(t,i),this.g.attachProtoListener("embeddings_out",(n,r)=>{n=Jh(n),this.embeddings=function(s){return{embeddings:ue(s,Kh,1).map(o=>{const a={headIndex:Ut(o,3)??0??-1,headName:Vt(o,4)??""??""};if(g1(o,mc,us(o,1))!==void 0)o=ze(o=I(o,mc,us(o,1)),1,Ae,Ge()),a.floatEmbedding=o.slice();else{const c=new Uint8Array(0);a.quantizedEmbedding=I(o,Yh,us(o,2))?.ma()?.h()??c}return a}),timestampMs:is(fi(s,2))??0}}(n),w(this,r)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Rt.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Gc(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Gc(jc(t.quantizedEmbedding),jc(e.quantizedEmbedding))}return t},Rt.prototype.embedForVideo=Rt.prototype.ya,Rt.prototype.embed=Rt.prototype.xa,Rt.prototype.setOptions=Rt.prototype.o,Rt.createFromModelPath=function(t,e){return M(Rt,t,{baseOptions:{modelAssetPath:e}})},Rt.createFromModelBuffer=function(t,e){return M(Rt,t,{baseOptions:{modelAssetBuffer:e}})},Rt.createFromOptions=function(t,e){return M(Rt,t,e)};var po=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function k2(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function A2(t){try{const e=new po(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{cr(t)}}po.prototype.close=po.prototype.close;var Et=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new qs,this.v=new $c,E(this.h,0,3,this.v),E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?N(this.h,2,ui(t.displayNamesLocale)):"displayNamesLocale"in t&&N(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}J(){(function(t){const e=ue(t.ca(),gt,1).filter(i=>(Vt(i,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&(I(e[0],Tt,7)?.l()?.g()??new Map).forEach((i,n)=>{t.s[Number(n)]=Vt(i,1)??""})})(this)}segment(t,e,i){const n=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:i,k2(this),Gt(this,t,n),A2(this)}Ia(t,e,i,n){const r=typeof i!="function"?i:{};return this.j=typeof i=="function"?i:n,k2(this),se(this,t,r,e),A2(this)}Ba(){return this.s}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect");const e=new Tt;Yt(e,Nc,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),i.o(e),Bt(t,i),ar(this,t),this.outputConfidenceMasks&&(B(t,"confidence_masks"),T(i,"CONFIDENCE_MASKS:confidence_masks"),Ai(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Ti(this,s,!0,!this.j)),w(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],w(this,n)})),this.outputCategoryMask&&(B(t,"category_mask"),T(i,"CATEGORY_MASK:category_mask"),Ai(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Ti(this,n,!1,!this.j),w(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,w(this,n)})),B(t,"quality_scores"),T(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,w(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Et.prototype.getLabels=Et.prototype.Ba,Et.prototype.segmentForVideo=Et.prototype.Ia,Et.prototype.segment=Et.prototype.segment,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(t,e){return M(Et,t,{baseOptions:{modelAssetPath:e}})},Et.createFromModelBuffer=function(t,e){return M(Et,t,{baseOptions:{modelAssetBuffer:e}})},Et.createFromOptions=function(t,e){return M(Et,t,e)};var fo=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};fo.prototype.close=fo.prototype.close;var y0=class extends y{constructor(t){super(t)}},Ii=[0,X,-2],mr=[0,me,-3,j,me,-1],S2=[0,mr],L2=[0,mr,X,-1],mo=class extends y{constructor(t){super(t)}},M2=[0,me,-1,j],_0=class extends y{constructor(t){super(t)}},T2=class extends y{constructor(t){super(t)}},go=[1,2,3,4,5,6,7,8,9,10,14,15],I2=class extends y{constructor(t){super(t)}};I2.prototype.g=tr([0,ot,[0,go,$,mr,$,[0,mr,Ii],$,S2,$,[0,S2,Ii],$,M2,$,[0,me,-3,j,Mt],$,[0,me,-3,j],$,[0,R,me,-2,j,X,j,-1,2,me,Ii],$,L2,$,[0,L2,Ii],me,Ii,R,$,[0,me,-3,j,Ii,-1],$,[0,ot,M2]],R,[0,R,X,-1,j]]);var ae=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new qs,this.s=new $c,E(this.h,0,3,this.s),E(t=this.h,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,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 I2;const s=new T2;var o=new y0;if(ie(o,1,255),E(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new mo;tn(a,3,!0),_(a,1,e.keypoint.x),_(a,2,e.keypoint.y),Qi(s,5,go,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new _0,e.scribble))tn(e=new mo,3,!0),_(e,1,a.x),_(e,2,a.y),Un(o,1,mo,e);Qi(s,15,go,o)}Un(n,1,T2,s),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",i),Gt(this,t,r);t:{try{const l=new fo(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=l;break t}this.j(l)}finally{cr(this)}c=void 0}return c}m(){var t=new Ct;U(t,"image_in"),U(t,"roi_in"),U(t,"norm_rect_in");const e=new Tt;Yt(e,Nc,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),H(i,"IMAGE:image_in"),H(i,"ROI:roi_in"),H(i,"NORM_RECT:norm_rect_in"),i.o(e),Bt(t,i),ar(this,t),this.outputConfidenceMasks&&(B(t,"confidence_masks"),T(i,"CONFIDENCE_MASKS:confidence_masks"),Ai(this,"confidence_masks"),this.g.ba("confidence_masks",(n,r)=>{this.confidenceMasks=n.map(s=>Ti(this,s,!0,!this.j)),w(this,r)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],w(this,n)})),this.outputCategoryMask&&(B(t,"category_mask"),T(i,"CATEGORY_MASK:category_mask"),Ai(this,"category_mask"),this.g.V("category_mask",(n,r)=>{this.categoryMask=Ti(this,n,!1,!this.j),w(this,r)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,w(this,n)})),B(t,"quality_scores"),T(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,r)=>{this.qualityScores=n,w(this,r)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ae.prototype.segment=ae.prototype.segment,ae.prototype.setOptions=ae.prototype.o,ae.createFromModelPath=function(t,e){return M(ae,t,{baseOptions:{modelAssetPath:e}})},ae.createFromModelBuffer=function(t,e){return M(ae,t,{baseOptions:{modelAssetBuffer:e}})},ae.createFromOptions=function(t,e){return M(ae,t,e)};var Wt=class extends xt{constructor(t,e){super(new jt(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},E(t=this.h=new Hc,0,1,e=new G)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?N(this.h,2,ui(t.displayNamesLocale)):"displayNamesLocale"in t&&N(this.h,2),t.maxResults!==void 0?ie(this.h,3,t.maxResults):"maxResults"in t&&N(this.h,3),t.scoreThreshold!==void 0?_(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&N(this.h,4),t.categoryAllowlist!==void 0?Vn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&N(this.h,5),t.categoryDenylist!==void 0?Vn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&N(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},Gt(this,t,e),this.j}F(t,e,i){return this.j={detections:[]},se(this,t,i,e),this.j}m(){var t=new Ct;U(t,"input_frame_gpu"),U(t,"norm_rect"),B(t,"detections");const e=new Tt;Yt(e,d0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),H(i,"IMAGE:input_frame_gpu"),H(i,"NORM_RECT:norm_rect"),T(i,"DETECTIONS:detections"),i.o(e),Bt(t,i),this.g.attachProtoVectorListener("detections",(n,r)=>{for(const s of n)n=dc(s),this.j.detections.push(Vc(n));w(this,r)}),this.g.attachEmptyPacketListener("detections",n=>{w(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Wt.prototype.detectForVideo=Wt.prototype.F,Wt.prototype.detect=Wt.prototype.D,Wt.prototype.setOptions=Wt.prototype.o,Wt.createFromModelPath=async function(t,e){return M(Wt,t,{baseOptions:{modelAssetPath:e}})},Wt.createFromModelBuffer=function(t,e){return M(Wt,t,{baseOptions:{modelAssetBuffer:e}})},Wt.createFromOptions=function(t,e){return M(Wt,t,e)};var vo=class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=i}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function B2(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function F2(t){try{const e=new vo(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{cr(t)}}vo.prototype.close=vo.prototype.close;var $t=class extends xt{constructor(t,e){super(new jt(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,E(t=this.h=new Uc,0,1,e=new G),this.v=new Bc,E(this.h,0,3,this.v),this.j=new Ic,E(this.h,0,2,this.j),ie(this.j,4,1),_(this.j,2,.5),_(this.v,2,.5),_(this.h,4,.5)}get baseOptions(){return I(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return"numPoses"in t&&ie(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&_(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&_(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&_(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}D(t,e,i){const n=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:i,B2(this),Gt(this,t,n),F2(this)}F(t,e,i,n){const r=typeof i!="function"?i:{};return this.s=typeof i=="function"?i:n,B2(this),se(this,t,r,e),F2(this)}m(){var t=new Ct;U(t,"image_in"),U(t,"norm_rect"),B(t,"normalized_landmarks"),B(t,"world_landmarks"),B(t,"segmentation_masks");const e=new Tt;Yt(e,u0,this.h);const i=new gt;It(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),H(i,"IMAGE:image_in"),H(i,"NORM_RECT:norm_rect"),T(i,"NORM_LANDMARKS:normalized_landmarks"),T(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Bt(t,i),ar(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(n,r)=>{this.landmarks=[];for(const s of n)n=sn(s),this.landmarks.push(sr(n));w(this,r)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],w(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,r)=>{this.worldLandmarks=[];for(const s of n)n=Ei(s),this.worldLandmarks.push(on(n));w(this,r)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],w(this,n)}),this.outputSegmentationMasks&&(T(i,"SEGMENTATION_MASK:segmentation_masks"),Ai(this,"segmentation_masks"),this.g.ba("segmentation_masks",(n,r)=>{this.segmentationMasks=n.map(s=>Ti(this,s,!0,!this.s)),w(this,r)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],w(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$t.prototype.detectForVideo=$t.prototype.F,$t.prototype.detect=$t.prototype.D,$t.prototype.setOptions=$t.prototype.o,$t.createFromModelPath=function(t,e){return M($t,t,{baseOptions:{modelAssetPath:e}})},$t.createFromModelBuffer=function(t,e){return M($t,t,{baseOptions:{modelAssetBuffer:e}})},$t.createFromOptions=function(t,e){return M($t,t,e)},$t.POSE_CONNECTIONS=C2;const C0=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;let i=1,n=0,r=1,s=0;e.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)},x0=(t,e)=>{if(!t||t.length===0)return!1;const i=t[0];let n=1,r=0,s=1,o=0;i.forEach(Q=>{n=Math.min(n,Q.x),r=Math.max(r,Q.x),s=Math.min(s,Q.y),o=Math.max(o,Q.y)});const a=.5,c=.6,l=e>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),g=h*(1+f),b=((Q,Ot)=>{const st=(Q-a)/m,Re=(Ot-c)/g;return st*st+Re*Re<=1})(u,p),k=.2,S=.1,O=d*(1+k),ut=h*(1+S),kt=(Q,Ot)=>{const st=(Q-a)/O,Re=(Ot-c)/ut;return st*st+Re*Re<=1},At=kt(n,s),wt=kt(r,s),be=kt(n,o),lt=kt(r,o);return b&&At&&wt&&be&&lt},E0=t=>{if(!t||t.length===0)return 0;const e=t[0];if(!e||e.length===0)return 0;const i=e[13],n=e[14];if(!i||!n)return 0;const r=Math.abs(n.y-i.y),s=Math.min(...e.map(c=>c.y)),a=Math.max(...e.map(c=>c.y))-s;return a>0?r/a:0},k0=t=>{const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)return null;const n=t.videoWidth,r=t.videoHeight,s=Math.min(n,r),o=(n-s)/2,a=(r-s)/2;return e.width=s,e.height=s,i.drawImage(t,o,a,s,s,0,0,s,s),e},D2=(t,e,i,n)=>{const r=t.getContext("2d");if(!r)return;const s=t.width,o=t.height;r.clearRect(0,0,s,o);const a=new bt(r);e.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,V.FACE_LANDMARKS_FACE_OVAL,{color:l,lineWidth:d}),i>0&&i>=n&&a.drawConnectors(c,V.FACE_LANDMARKS_LIPS,{color:l,lineWidth:d})})},A0=t=>{const e=t.getContext("2d");e&&e.clearRect(0,0,t.width,t.height)},S0=(t,e=!1)=>{const i=document.createElement("canvas"),n=i.getContext("2d");if(!n)return null;const r=t.videoHeight>t.videoWidth;e?r?(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)):r?(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 s=t.videoHeight>720?1.3:1,o=t.videoWidth*s,a=t.videoHeight*s,c=(o-t.videoWidth)/2,l=(a-t.videoHeight)/2,d=t.videoHeight*.05;return n.drawImage(t,-c,-l-d,o,a,0,0,i.width,i.height),i.toDataURL("image/jpeg")},R2={LIVENESS_IMAGE_BASE64:6,SELFIE_IMAGE_BASE64:2},$2={"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":"Bigger smile!"},O2=async()=>{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=(async()=>{try{const e=await qe.forVisionTasks("https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm"),i=await V.createFromOptions(e,{baseOptions:{modelAssetPath:"https://web-models.smileidentity.com/face_landmarker/face_landmarker.task",delegate:"GPU"},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)},un=$i.version,L0=({videoRef:t,canvasRef:e,interval:i,duration:n,smileThreshold:r,mouthOpenThreshold:s,minFaceSize:o,maxFaceSize:a,smileCooldown:c})=>{const l=Xt(null),d=Xt(null),h=Xt(null),u=Xt(null),p=et(!1),f=et(!1),m=et("good"),g=et(!1),v=et(16/9),b=et([]),k=et(0),S=et(0),O=et(0),ut=et(0),kt=et(""),At=et(!1),wt=et(!1),be=et(0),lt=et([]),Q=et(null),Ot=et(1),st=et(0),Re=et(!1),Bi=$r(()=>Math.floor(Ot.value*.4)),yo=$r(()=>Math.floor(Ot.value*.2)),q0=$r(()=>p.value&&f.value&&m.value==="good"&&!g.value),X0=async()=>{try{l.current=await O2()}catch(W){console.error("Failed to initialize MediaPipe:",W)}},Pt=W=>{W&&$2[W]?kt.value=$2[W]:kt.value=""},Y0=()=>{if(t.current&&e.current){const{videoWidth:W,videoHeight:yt}=t.current;v.value=W/yt,e.current.width=W,e.current.height=yt,t.current.parentElement&&(e.current.style.left="50%",e.current.style.top="50%",e.current.style.transform="translate(-50%, -50%) scaleX(-1)")}},K0=()=>{const W=st.value<yo.value,yt=st.value>=Bi.value;W&&k.value>=r?Pt("neutral-expression"):W?kt.value="Capturing...":yt?Date.now()-ut.value>c?k.value>=r&&O.value<s?Pt("open-mouth-smile"):Pt("smile-required"):kt.value="Keep smiling!":Pt(null)},J0=()=>{g.value?Pt("multiple-faces"):p.value?m.value==="too-close"?Pt("too-close"):m.value==="too-far"?Pt("too-far"):f.value?At.value?K0():kt.value="Ready to capture":Pt("out-of-bounds"):Pt("no-face")},_o=()=>{d.current&&(cancelAnimationFrame(d.current),d.current=null)},j2=async()=>{if(!l.current||!t.current){_o();return}try{const W=k0(t.current),yt=W||t.current,ht=l.current.detectForVideo(yt,performance.now());if(b.value=ht.faceLandmarks||[],ht.faceLandmarks&&e.current&&t.current)if(W){const $e=t.current.videoWidth,Ke=t.current.videoHeight,Fi=Math.min($e,Ke),xo=($e-Fi)/(2*$e),wr=(Ke-Fi)/(2*Ke),yr=Fi/$e,Di=Fi/Ke,ed=ht.faceLandmarks.map(id=>id.map(Eo=>({x:Eo.x*yr+xo,y:Eo.y*Di+wr,z:Eo.z})));D2(e.current,ed,st.value,Bi.value)}else D2(e.current,ht.faceLandmarks,st.value,Bi.value);else e.current&&A0(e.current);const Co=ht.faceLandmarks?ht.faceLandmarks.length:0;g.value=Co>1;const br=ht.faceBlendshapes&&ht.faceBlendshapes.length>0&&Co===1;if(p.value=br,br&&ht.faceLandmarks){const $e=C0(ht.faceLandmarks);S.value=$e,$e>a?m.value="too-close":$e<o?m.value="too-far":m.value="good",f.value=x0(ht.faceLandmarks,v.value);const Ke=ht.faceBlendshapes[0].categories,Fi=Ke.find(Di=>Di.categoryName==="mouthSmileLeft")?.score||0,xo=Ke.find(Di=>Di.categoryName==="mouthSmileRight")?.score||0,wr=E0(ht.faceLandmarks),yr=(Fi+xo)/2;k.value=yr,O.value=wr,yr>=r&&wr>=s&&(ut.value=Date.now(),wt.value&&At.value&&u.current&&setTimeout(()=>{Date.now()-ut.value<=100&&wt.value&&At.value&&u.current&&u.current()},0))}else k.value=0,S.value=0,O.value=0,f.value=!1,m.value="good";J0()}catch{p.value=!1,f.value=!1,g.value=!1,m.value="good",O.value=0,At.value&&Pt("no-face")}d.current=requestAnimationFrame(j2)},Q0=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(j2)},td=()=>{if(!t.current)return;const W=st.value===Ot.value-1,yt=S0(t.current,W);yt&&(W?Q.value=yt:lt.value=[...lt.value,yt],st.value++,be.value=Ot.value-st.value)},vr=()=>{if(h.current&&(clearInterval(h.current),h.current=null),At.value=!1,wt.value=!1,st.value>=Ot.value&&Q.value){const W=lt.value.map(br=>({image:br.split(",")[1],image_type_id:R2.LIVENESS_IMAGE_BASE64})),yt={image:Q.value.split(",")[1],image_type_id:R2.SELFIE_IMAGE_BASE64},ht={images:[...W,yt],referenceImage:Q.value,previewImage:Q.value,meta:{libraryVersion:un}};window.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:ht})),document.querySelector("smart-camera-web")?.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),Re.value=!0}},fn=()=>{h.current&&(clearInterval(h.current),h.current=null),wt.value=!0,!g.value&&p.value&&f.value&&m.value==="good"&&Pt("smile-required")},G2=()=>{h.current&&clearInterval(h.current),h.current=setInterval(()=>{if(st.value>=Ot.value){vr();return}if(g.value){fn();return}if(!p.value)return;if(!f.value){fn();return}if(m.value!=="good"){fn();return}const W=st.value<yo.value,yt=st.value>=Bi.value;if(!(W&&k.value>=r)){if(yt&&Date.now()-ut.value>c){fn();return}td()}},i)},z2=()=>{if(p.value&&m.value==="good"&&f.value&&!g.value){if(st.value>=Bi.value&&Date.now()-ut.value>c)return;wt.value=!1,Pt(null),G2()}};return u.current=z2,{faceDetected:p,faceInBounds:f,faceProximity:m,multipleFaces:g,videoAspectRatio:v,faceLandmarks:b,currentSmileScore:k,currentFaceSize:S,currentMouthOpen:O,lastSmileTime:ut,alertTitle:kt,isReadyToCapture:q0,isCapturing:At,isPaused:wt,countdown:be,capturedImages:lt,referencePhoto:Q,totalCaptures:Ot,capturesTaken:st,hasFinishedCapture:Re,smileCheckpoint:Bi,neutralZone:yo,initializeFaceLandmarker:X0,setupCanvas:Y0,startDetectionLoop:Q0,stopDetectionLoop:_o,updateAlert:Pt,startCapture:async()=>{lt.value=[],At.value=!0,wt.value=!1,Ot.value=Math.ceil(n/i),st.value=0,be.value=Ot.value,G2()},stopCapture:vr,pauseCapture:fn,resumeCapture:z2,handleCancel:()=>{vr(),window.dispatchEvent(new CustomEvent("selfie-capture.cancelled",{detail:{meta:{libraryVersion:un}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.cancelled",{detail:{meta:{libraryVersion:un}}}))},handleClose:()=>{vr(),window.dispatchEvent(new CustomEvent("selfie-capture.close",{detail:{meta:{libraryVersion:un}}})),window.dispatchEvent(new CustomEvent("selfie-capture-screens.close",{detail:{meta:{libraryVersion:un}}}))},cleanup:()=>{h.current&&clearInterval(h.current),_o()}}},M0=({progress:t,duration:e=1e3,themeColor:i="#001096"})=>{const n=Xt(null),r=Xt(t);return ei(()=>{const s=n.current;if(!s)return;const o=s.getTotalLength();s.style.opacity=t>0?"1":"0";const a=o*(1-r.current),c=o*(1-t);a!==c&&(s.style.transition="none",s.style.strokeDasharray=`${o} ${o}`,s.style.strokeDashoffset=`${a}`,s.getBoundingClientRect(),s.style.transition=`stroke-dashoffset ${e}ms ease-out`,s.style.strokeDashoffset=`${c}`,r.current=t)},[t,e]),L("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"},children:L("svg",{viewBox:"0 0 285 380",preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:[L("clipPath",{id:"selfie-clip-path",clipPathUnits:"objectBoundingBox",children:L("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"})}),L("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"}}),L("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"})]})})},T0=({videoRef:t,canvasRef:e,facingMode:i,multipleFaces:n,progress:r,interval:s,themeColor:o})=>L(ye,{children:[L("div",{className:"camera-preview-container",children:[L("div",{className:"video-wrapper",style:{clipPath:n?"none":"url(#selfie-clip-path)"},children:L("div",{className:"video-container",children:[L("video",{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`camera-video ${i==="user"?"mirror":""}`}),L("canvas",{ref:e,className:`camera-canvas ${i==="user"?"mirror":""}`})]})}),!n&&L(M0,{progress:r,duration:s,themeColor:o})]}),L("style",{children:`
3228
+ .camera-preview-container {
3229
+ position: relative;
3230
+ width: 100%;
3231
+ max-width: 300px;
3232
+ margin: 0 auto;
3233
+ }
3234
+
3235
+ .video-wrapper {
3236
+ width: 100%;
3237
+ max-width: 300px;
3238
+ margin: 0 auto;
3239
+ position: relative;
3240
+ aspect-ratio: 3 / 4;
3241
+ overflow: hidden;
3242
+ }
3243
+
3244
+ .video-container {
3245
+ position: absolute;
3246
+ top: 0;
3247
+ left: 0;
3248
+ width: 100%;
3249
+ height: 100%;
3250
+ }
3251
+
3252
+ .camera-video,
3253
+ .camera-canvas {
3254
+ position: absolute;
3255
+ top: 50%;
3256
+ left: 50%;
3257
+ transform: translate(-50%, -50%);
3258
+ }
3259
+
3260
+ .camera-video.mirror,
3261
+ .camera-canvas.mirror {
3262
+ transform: translate(-50%, -50%) scaleX(-1);
3263
+ }
3264
+
3265
+ .camera-canvas {
3266
+ pointer-events: none;
3267
+ }
3268
+ `})]}),I0=({alertTitle:t})=>t?L(ye,{children:[L("div",{className:"alert-message",children:L("div",{className:"alert-title",children:t})}),L("style",{children:`
3269
+ .alert-message {
3270
+ margin-top: 1.5rem;
3271
+ color: #000;
3272
+ color: #151F72;
3273
+ padding: 0.5rem 1.5rem;
3274
+ border-radius: 4px;
3275
+ text-align: start;
3276
+ width: 100%;
3277
+ }
3278
+
3279
+ .alert-title {
3280
+ font-size: 16px;
3281
+ font-weight: bold;
3282
+ text-align: center;
3283
+ }
3284
+ `})]}):null,B0=({isCapturing:t,hasFinishedCapture:e,isReadyToCapture:i,allowAgentMode:n,agentSupported:r,showAgentModeForTests:s,facingMode:o,themeColor:a="#001096",onStartCapture:c,onSwitchCamera:l})=>L(ye,{children:[L("div",{className:"controls",children:[L("button",{class:"btn-primary",onClick:c,disabled:t||e||!i,children:"Start Capture"}),n&&(r||s)&&L("button",{onClick:l,className:"agent-mode-btn",disabled:t||e,children:o==="user"?"Agent Mode Off":"Agent Mode On"})]}),L("style",{children:`
3285
+ .controls {
3286
+ margin: 1.5rem 0;
3287
+ display: flex;
3288
+ flex-direction: column;
3289
+ gap: 1rem;
3290
+ justify-content: center;
3291
+ }
3292
+
3293
+ .agent-mode-btn {
3294
+ padding: 8px 16px;
3295
+ font-size: 14px;
3296
+ background: ${a};
3297
+ color: white;
3298
+ border: none;
3299
+ border-radius: 4px;
3300
+ cursor: pointer;
3301
+ }
3302
+
3303
+ .agent-mode-btn:disabled {
3304
+ background: #ccc;
3305
+ cursor: not-allowed;
3306
+ }
3307
+ `})]}),bo=({interval:t=350,duration:e=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=Xt(null),c=Xt(null),l=ii(n),d=ii(r),h=ii(s),u=ii(o),p=300,f=.25,m=.05,g=.35,v=.5,b=Hl(),k=L0({videoRef:b.videoRef,canvasRef:a,interval:t,duration:e,smileThreshold:f,mouthOpenThreshold:m,minFaceSize:g,maxFaceSize:v,smileCooldown:p});return ei(()=>((async()=>{await b.startCamera(),await b.checkAgentSupport(),await k.initializeFaceLandmarker(),setTimeout(()=>{k.setupCanvas(),k.startDetectionLoop()},500)})(),()=>{k.stopDetectionLoop(),b.stopCamera(),k.cleanup()}),[]),ei(()=>{const S=c.current;if(S&&l){const O=()=>{k.handleCancel()},ut=()=>{k.handleClose()};return S.addEventListener("navigation.back",O),S.addEventListener("navigation.close",ut),()=>{S.removeEventListener("navigation.back",O),S.removeEventListener("navigation.close",ut)}}},[l]),L("div",{className:"smartselfie-capture",children:[l&&L("smileid-navigation",{ref:c,"theme-color":i}),L(T0,{videoRef:b.videoRef,canvasRef:a,facingMode:b.facingMode,multipleFaces:k.multipleFaces.value,progress:k.capturesTaken.value>0?k.capturesTaken.value/k.totalCaptures.value:0,interval:t,themeColor:i}),L(I0,{alertTitle:k.alertTitle.value}),!k.isCapturing.value&&!k.hasFinishedCapture.value&&L(B0,{isCapturing:k.isCapturing.value,hasFinishedCapture:k.hasFinishedCapture.value,isReadyToCapture:k.isReadyToCapture.value,allowAgentMode:d,agentSupported:b.agentSupported,showAgentModeForTests:h,facingMode:b.facingMode,themeColor:i,onStartCapture:k.startCapture,onSwitchCamera:b.switchCamera}),!u&&L("powered-by-smile-id",{}),L("style",{children:`
3308
+ * {
3309
+ box-sizing: border-box;
3310
+ }
3311
+
3312
+ button {
3313
+ padding: 10px 20px;
3314
+ background: ${i||"#001096"};
3315
+ color: white;
3316
+ border: none;
3317
+ border-radius: 4px;
3318
+ cursor: pointer;
3319
+ font-size: 16px;
3320
+ }
3321
+
3322
+ button:disabled {
3323
+ background: #ccc;
3324
+ cursor: not-allowed;
3325
+ }
3326
+
3327
+ button.btn-primary {
3328
+ background-color: ${i||"#001096"};
3329
+ border-radius: 2.5rem;
3330
+ color: white;
3331
+ border: none;
3332
+ height: 3.125rem;
3333
+ display: inline-block;
3334
+ padding: 0.75rem 1.5rem;
3335
+ text-align: center;
3336
+ font-size: 1.125rem;
3337
+ font-weight: 600;
3338
+ font-family: "DM Sans", sans-serif;
3339
+ cursor: pointer;
3340
+ }
3341
+
3342
+ button.btn-primary:hover {
3343
+ background-color: #2d2b2a;
3344
+ }
3345
+
3346
+ button.btn-primary:disabled {
3347
+ background-color: #666;
3348
+ cursor: not-allowed;
3349
+ }
3350
+
3351
+ .smartselfie-capture {
3352
+ font-family: sans-serif;
3353
+ max-width: 356px;
3354
+ margin: 0 auto;
3355
+ }
3356
+ `})]})};customElements.get("smartselfie-capture")||fa(bo,"smartselfie-capture",["interval","duration","theme-color","show-navigation","allow-agent-mode","show-agent-mode-for-tests","hide-attribution","disable-image-tests"],{shadow:!0});const F0=$i.version,D0=8;function R0(t,e=16){const i=new Set;for(let n=0;n<Math.min(t.length,1e4);n+=4)if(i.add(t[n]<<16|t[n+1]<<8|t[n+2]),i.size>e)return!0;return!1}function $0(t,e=D0){const i=[];if(t<e)throw new Error("SmartCameraWeb: Minimum required no of frames is ",e);const n=e-1,r=Math.floor(t/n);let s=1;for(let a=0;a<t;a+=r)i.length<8?i.push(a):(i[s]=a,i.sort((c,l)=>c-l),s+=1);const o=t-1;return i.length<8&&!i.includes(o)&&i.push(o),i}function O0(){return`
3357
+ ${qt(this.themeColor)}
3358
+ <style>
3359
+ :host {
3360
+ --theme-color: ${this.themeColor||"#001096"};
3361
+ --color-active: #001096;
3362
+ --color-default: #2D2B2A;
3363
+ --color-disabled: #848282;
3364
+ }
3365
+
3366
+ * {
3367
+ font-family: 'DM Sans', sans-serif;
3368
+ }
3369
+
3370
+ [hidden] {
3371
+ display: none !important;
3372
+ }
3373
+
3374
+ [disabled] {
3375
+ cursor: not-allowed !important;
3376
+ filter: grayscale(75%);
3377
+ }
3378
+
3379
+ .visually-hidden {
3380
+ border: 0;
3381
+ clip: rect(1px 1px 1px 1px);
3382
+ clip: rect(1px, 1px, 1px, 1px);
3383
+ height: auto;
3384
+ margin: 0;
3385
+ overflow: hidden;
3386
+ padding: 0;
3387
+ position: absolute;
3388
+ white-space: nowrap;
3389
+ width: 1px;
3390
+ }
3391
+
3392
+ img {
3393
+ height: auto;
3394
+ max-width: 100%;
3395
+ transform: scaleX(-1);
3396
+ }
3397
+
3398
+ video {
3399
+ background-color: black;
3400
+ }
3401
+
3402
+ a {
3403
+ color: currentColor;
3404
+ text-decoration: none;
3405
+ }
3406
+
3407
+ svg {
3408
+ max-width: 100%;
3409
+ }
3410
+
3411
+ .color-gray {
3412
+ color: #797979;
3413
+ }
3414
+
3415
+ .color-red {
3416
+ color: red;
3417
+ }
3418
+
3419
+ .color-richblue {
3420
+ color: #4E6577;
3421
+ }
3422
+
3423
+ .color-richblue-shade {
3424
+ color: #0E1B42;
3425
+ }
3426
+
3427
+ .color-digital-blue {
3428
+ color: #001096 !important;
3429
+ }
3430
+
3431
+ .color-deep-blue {
3432
+ color: #001096;
3433
+ }
3434
+
3435
+ .title-color {
3436
+ color: ${this.themeColor};
3437
+ }
3438
+
3439
+ .theme-color {
3440
+ color: ${this.themeColor};
3441
+ }
3442
+
3443
+ .center {
3444
+ text-align: center;
3445
+ margin-left: auto;
3446
+ margin-right: auto;
3447
+ }
3448
+
3449
+ .font-size-small {
3450
+ font-size: .75rem;
3451
+ }
3452
+
3453
+ .font-size-large {
3454
+ font-size: 1.5rem;
3455
+ }
3456
+
3457
+ .text-transform-uppercase {
3458
+ text-transform: uppercase;
3459
+ }
3460
+
3461
+ [id*=-"screen"] {
3462
+ min-block-size: 100%;
3463
+ }
3464
+
3465
+ [data-variant~="full-width"] {
3466
+ inline-size: 100%;
3467
+ }
3468
+
3469
+ .flow > * + * {
3470
+ margin-top: 1rem;
3471
+ }
3472
+
3473
+ .button {
3474
+ --button-color: ${this.themeColor};
3475
+ -webkit-appearance: none;
3476
+ appearance: none;
3477
+ border-radius: 2.5rem;
3478
+ border: 0;
3479
+ background-color: transparent;
3480
+ color: #fff;
3481
+ cursor: pointer;
3482
+ display: block;
3483
+ font-size: 18px;
3484
+ font-weight: 600;
3485
+ padding: .75rem 1.5rem;
3486
+ text-align: center;
3487
+ }
3488
+
3489
+ .button:hover,
3490
+ .button:focus,
3491
+ .button:active {
3492
+ --button-color: var(--color-default);
3493
+ }
3494
+
3495
+ .button:disabled {
3496
+ --button-color: var(--color-disabled);
3497
+ }
3498
+
3499
+ .button[data-variant~='solid'] {
3500
+ background-color: var(--button-color);
3501
+ border: 2px solid var(--button-color);
3502
+ }
3503
+
3504
+ .button[data-variant~='outline'] {
3505
+ color: var(--button-color);
3506
+ border: 2px solid var(--button-color);
3507
+ }
3508
+
3509
+ .button[data-variant~='ghost'] {
3510
+ padding: 0px;
3511
+ color: var(--button-color);
3512
+ background-color: transparent;
3513
+ }
3514
+
3515
+ .icon-btn {
3516
+ appearance: none;
3517
+ background: none;
3518
+ border: none;
3519
+ color: hsl(0deg 0% 94%);
3520
+ cursor: pointer;
3521
+ display: flex;
3522
+ align-items: center;
3523
+ justify-content: center;
3524
+ padding: 4px 8px;
3525
+ }
3526
+ .justify-right {
3527
+ justify-content: end !important;
3528
+ }
3529
+ .nav {
3530
+ display: flex;
3531
+ justify-content: space-between;
3532
+ }
3533
+
3534
+ .back-wrapper {
3535
+ display: flex;
3536
+ align-items: center;
3537
+ }
3538
+
3539
+ .back-button {
3540
+ display: block !important;
3541
+ }
3542
+ .back-button-text {
3543
+ font-size: 11px;
3544
+ line-height: 11px;
3545
+ color: rgb(21, 31, 114);
3546
+ }
3547
+ .section {
3548
+ border-radius: .5rem;
3549
+ margin-left: auto;
3550
+ margin-right: auto;
3551
+ max-width: 35ch;
3552
+ padding: 1rem;
3553
+ }
3554
+
3555
+ .selfie-capture-review-image {
3556
+ overflow: hidden;
3557
+ aspect-ratio: 1/1;
3558
+ }
3559
+
3560
+ #review-image {
3561
+ scale: 1.75;
3562
+ }
3563
+
3564
+ @media (max-aspect-ratio: 1/1) {
3565
+ #review-image {
3566
+ transform: scaleX(-1) translateY(-10%);
3567
+ }
3568
+ }
3569
+
3570
+ .tips,
3571
+ .powered-by {
3572
+ align-items: center;
3573
+ border-radius: .25rem;
3574
+ display: flex;
3575
+ justify-content: center;
3576
+ letter-spacing: .075em;
3577
+ }
3578
+
3579
+ .powered-by {
3580
+ box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
3581
+ display: inline-flex;
3582
+ font-size: .5rem;
3583
+ }
3584
+
3585
+ .tips {
3586
+ margin-left: auto;
3587
+ margin-right: auto;
3588
+ max-width: 17rem;
3589
+ font-size: 0.875rem;
3590
+ font-weight: 600;
3591
+ }
3592
+
3593
+ .tips > * + *,
3594
+ .powered-by > * + * {
3595
+ display: inline-block;
3596
+ margin-left: .5em;
3597
+ }
3598
+
3599
+ .powered-by .company {
3600
+ color: #18406D;
3601
+ font-weight: 700;
3602
+ letter-spacing: .15rem;
3603
+ }
3604
+
3605
+ .logo-mark {
3606
+ background-color: #004071;
3607
+ display: inline-block;
3608
+ padding: .25em .5em;
3609
+ }
3610
+
3611
+ .logo-mark svg {
3612
+ height: auto;
3613
+ justify-self: center;
3614
+ width: .75em;
3615
+ }
3616
+
3617
+ .id-video-container.portrait {
3618
+ width: 100%;
3619
+ position: relative;
3620
+ height: calc(200px * 1.4);
3621
+ }
3622
+
3623
+ .id-video-container.portrait video {
3624
+ width: calc(213px + 0.9rem);
3625
+ height: 100%;
3626
+ position: absolute;
3627
+ top: 239px;
3628
+ left: 161px;
3629
+ padding-bottom: calc((214px * 1.4) / 3);
3630
+ padding-top: calc((191px * 1.4) / 3);
3631
+ object-fit: cover;
3632
+
3633
+ transform: translateX(-50%) translateY(-50%);
3634
+ z-index: 1;
3635
+ block-size: 100%;
3636
+ }
3637
+
3638
+ .video-container,
3639
+ .id-video-container.landscape {
3640
+ position: relative;
3641
+ z-index: 1;
3642
+ width: 100%;
3643
+ }
3644
+
3645
+ .video-container video,
3646
+ .id-video-container.landscape video {
3647
+ left: 50%;
3648
+ min-width: auto;
3649
+ position: absolute;
3650
+ top: 50%;
3651
+ transform: translateX(-50%) translateY(50%);
3652
+ }
3653
+
3654
+ .video-container #smile-cta-box {
3655
+ color: #fff;
3656
+ width: 100%;
3657
+ position: absolute;
3658
+ top: 0;
3659
+ left: 0;
3660
+ padding: 2rem 0;
3661
+ opacity: 0;
3662
+ transition: opacity 0.5s ease-in-out;
3663
+ }
3664
+
3665
+ .video-container #smile-cta {
3666
+ font-size: 1.2rem;
3667
+ font-weight: bold;
3668
+ margin-top: 0;
3669
+ margin-bottom: 0;
3670
+ }
3671
+
3672
+ .video-container video {
3673
+ height: 150%;
3674
+ transform: scaleX(-1) translateX(50%) translateY(-50%);
3675
+ }
3676
+
3677
+ .video-container video.agent-mode {
3678
+ min-height: 100%;
3679
+ transform: scaleX(1) translateX(-50%) translateY(-50%);
3680
+ }
3681
+
3682
+ .video-container .video {
3683
+ background-color: black;
3684
+ position: absolute;
3685
+ left: 50%;
3686
+ height: calc(100% - 6px);
3687
+ clip-path: ellipse(101px 118px);
3688
+ }
3689
+
3690
+ .id-video-container.landscape {
3691
+ min-height: calc((2 * 10rem) + 198px);
3692
+ height: auto;
3693
+ }
3694
+
3695
+ .id-video-container.portrait .image-frame-portrait {
3696
+ border-width: 0.9rem;
3697
+ border-color: rgba(0, 0, 0, 0.7);
3698
+ border-style: solid;
3699
+ height: auto;
3700
+ position: absolute;
3701
+ top: 80px;
3702
+ left: 47px;
3703
+ z-index: 2;
3704
+ width: 200px;
3705
+ height: calc(200px * 1.4);
3706
+ }
3707
+
3708
+ .id-video-container.landscape .image-frame {
3709
+ border-width: 10rem 1rem;
3710
+ border-color: rgba(0, 0, 0, 0.7);
3711
+ border-style: solid;
3712
+ height: auto;
3713
+ width: 90%;
3714
+ position: absolute;
3715
+ top: 0;
3716
+ left: 0;
3717
+ z-index: 2;
3718
+ }
3719
+
3720
+ .id-video-container.landscape video {
3721
+ width: 100%;
3722
+ transform: translateX(-50%) translateY(-50%);
3723
+ z-index: 1;
3724
+ height: 100%;
3725
+ block-size: 100%;
3726
+ }
3727
+
3728
+ .id-video-container.landscape img {
3729
+ position: absolute;
3730
+ top: 50%;
3731
+ left: 50%;
3732
+ transform: translateX(-50%) translateY(-50%);
3733
+ max-width: 90%;
3734
+ }
3735
+
3736
+ .actions {
3737
+ background-color: rgba(0, 0, 0, .7);
3738
+ bottom: 0;
3739
+ display: flex;
3740
+ justify-content: space-between;
3741
+ padding: 1rem;
3742
+ position: absolute;
3743
+ width: 90%;
3744
+ z-index: 2;
3745
+ }
3746
+
3747
+ #back-of-id-camera-screen .id-video-container.portrait .actions,
3748
+ #id-camera-screen .id-video-container.portrait .actions {
3749
+ top: 145%;
3750
+ width: calc(200px * 1.4);
3751
+ }
3752
+
3753
+ #back-of-id-camera-screen .section.portrait, #id-camera-screen .section.portrait {
3754
+ min-height: calc((200px * 1.4) + 260px);
3755
+ }
3756
+
3757
+ #selfie-capture-screen,
3758
+ #back-of-id-entry-screen {
3759
+ block-size: 45rem;
3760
+ display: flex;
3761
+ flex-direction: column;
3762
+ max-block-size: 100%;
3763
+ max-inline-size: 40ch;
3764
+ }
3765
+
3766
+ #selfie-capture-screen header p {
3767
+ margin-block: 0 !important;
3768
+ }
3769
+
3770
+ .document-tips {
3771
+ margin-block-start: 1.5rem;
3772
+ display: flex;
3773
+ align-items: center;
3774
+ text-align: initial;
3775
+ }
3776
+
3777
+ .document-tips svg {
3778
+ flex-shrink: 0;
3779
+ margin-inline-end: 1rem;
3780
+ }
3781
+
3782
+ .document-tips p {
3783
+ margin-block: 0;
3784
+ }
3785
+
3786
+ .document-tips p:first-of-type {
3787
+ font-size; 1.875rem;
3788
+ font-weight: bold
3789
+ }
3790
+
3791
+ [type='file'] {
3792
+ display: none;
3793
+ }
3794
+
3795
+ .document-tips > * + * {
3796
+ margin-inline-start; 1em;
3797
+ }
3798
+ </style>
3799
+ <div id='selfie-capture-screen' class='flow center'>
3800
+ <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
3801
+
3802
+ <div class='tips'>Fit your head inside the oval frame</div>
3803
+
3804
+ <div className="error">
3805
+ ${this.cameraError?`<p class="color-red">${this.cameraError}</p>`:""}
3806
+ </div>
3807
+ <div class='section | flow' ${this.cameraError?"hidden":""}>
3808
+ <div class='video-container'>
3809
+ <div class='video'>
3810
+ </div>
3811
+ <svg id="image-outline" width="215" height="245" viewBox="0 0 215 245" fill="none" xmlns="http://www.w3.org/2000/svg" style="position: relative;">
3812
+ <path d="M210.981 122.838C210.981 188.699 164.248 241.268 107.55 241.268C50.853 241.268 4.12018 188.699 4.12018 122.838C4.12018 56.9763 50.853 4.40771 107.55 4.40771C164.248 4.40771 210.981 56.9763 210.981 122.838Z" stroke="${this.themeColor}" stroke-width="7.13965"/>
3813
+ </svg>
3814
+ <div id="smile-cta-box">
3815
+ <div>
3816
+ <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" viewBox="70 70 360 360" fill="currentColor">
3817
+ <path d="M354.02,247.69c4.12-12.26,6.39-24.53,6.39-35.75,0-54.63-50.19-99.08-111.88-99.08s-111.95,44.45-111.95,99.08c0,11.22,2.28,23.49,6.39,35.75-6.6,4.66-10.94,12.33-10.94,21.04,0,13.45,10.36,24.4,23.46,25.51.52,26.93,12.56,53.51,35.04,71.64v.73c.07.03.14.05.21.08,3.66,1.63,6.74,4.28,9.92,6.66.08.06.17.12.25.17,0-.08-.01-.16-.01-.25,15.23,9.12,32.95,13.89,51.85,12.96h0c15.54-.72,30.01-5.37,42.59-12.99,2.91-2.85,7.01-4.93,10.42-6.71.25-.16.51-.28.77-.43v-.76c20.36-16.83,33.62-42.32,34.85-71.11,13.15-1.05,23.57-12.03,23.57-25.53,0-8.7-4.35-16.38-10.94-21.04ZM155.53,283.54c-7.18-1.09-12.71-7.31-12.71-14.85s5.53-13.75,12.71-14.85v29.7ZM330.53,289.9c0,45.26-33.98,83.65-78.48,85.72-47.29,2.31-86.52-35.65-86.52-83.18v-40.7c15.63-4.03,38.45-15.61,65.91-46.31.08.59.13,1.21.11,1.87-.13,4.43-3.09,9.32-8.58,14.14-1.79,1.57-2.32,4.13-1.31,6.28,1.01,2.14,3.29,3.35,5.68,3,2.19-.35,48.6-8.13,71.88-38.36,3.84,13.25,12.48,33.59,31.31,48.79v48.75ZM339.42,234.31c-27.83-21.03-32.1-56.22-32.15-56.57-.26-2.37-2.08-4.28-4.43-4.67-2.33-.39-4.68.83-5.69,2.99-11.08,23.62-39.34,35.42-56.72,40.63,1.35-2.97,2.08-6,2.16-9.06.26-9.11-5.24-14.81-5.88-15.43-1.06-1.05-2.53-1.59-3.99-1.53-1.48.07-2.87.75-3.83,1.88-32.09,37.93-57.18,47.4-69.28,49.67-.68.13-1.29.39-1.84.74-.11,0-.18-.03-.29-.03-1.65,0-3.26.19-4.82.49-3.58-10.9-5.56-21.72-5.56-31.57,0-48.78,45.46-88.46,101.33-88.46s101.26,39.68,101.26,88.46c0,9.84-1.98,20.67-5.56,31.57-.85-.16-1.73-.19-2.61-.27v-4.6c0-1.67-.78-3.25-2.12-4.26ZM341.53,283.54v-29.7c7.18,1.09,12.72,7.3,12.72,14.85s-5.53,13.76-12.72,14.85Z"/>
3818
+ <path d="M259.05,305.3c2.08-2.08,2.08-5.46,0-7.55-2.09-2.08-5.47-2.07-7.54,0-1.75,1.75-4.79,1.75-6.54,0-2.08-2.08-5.45-2.09-7.54,0-2.08,2.08-2.08,5.46,0,7.55,5.98,5.98,15.65,5.98,21.63,0h0Z"/>
3819
+ <path id="mouth"
3820
+ 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">
3821
+ <animate
3822
+ id="mouthAnim"
3823
+ attributeName="d"
3824
+ begin="indefinite"
3825
+ dur="1s"
3826
+ fill="freeze"
3827
+ to="m 211.72,312.36 c -1.58,0.97 -2.56,2.86 -2.56,4.72 0,21.54 17.40021,38.7239 38.94021,38.7239 21.54,0 39.18979,-17.1739 39.18979,-39.0439 0,-1.86 -0.97,-3.59 -2.56,-4.56 -1.6,-0.97 -3.57,-1.03 -5.22,-0.18 -21.07,10.85 -41.53,10.85 -62.58,0 -1.65,-0.85 -3.62,-0.61 -5.22,0.35 z m 63.61,13.22 c -3.62,11.52 -14.4,19.9 -27.1,19.9 -12.7,0 -23.49,-8.38 -27.1,-19.9 18.03,6.94 36.2,6.94 54.2,0 z" />
3828
+ </path>
3829
+ <circle fill="none" stroke="currentColor" stroke-width="10px" cx="287.3" cy="263.68" r="14"/>
3830
+ <circle fill="none" stroke="currentColor" stroke-width="10px" cx="209.16" cy="263.68" r="14"/>
3831
+ </svg>
3832
+ </div>
3833
+ <div>
3834
+ <p id='smile-cta'>SMILE</p>
3835
+ </div>
3836
+ </div>
3837
+ </div>
3838
+
3839
+ ${this.allowAgentMode?`<button data-variant='outline small' id='switch-camera' class='button | center' type='button'>${this.inAgentMode?"Agent Mode On":"Agent Mode Off"}</button>`:""}
3840
+
3841
+ <button data-variant='solid' id='start-image-capture' class='button | center' type='button'>
3842
+ Take Selfie
3843
+ </button>
3844
+
3845
+ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
3846
+ </div>
3847
+ </div>
3848
+ `}async function P2(t,e={facingMode:"user"}){try{const i=await A.getMedia({audio:!1,video:e}),r=(await navigator.mediaDevices.enumerateDevices()).find(s=>s.kind==="videoinput"&&i.getVideoTracks()[0].getSettings().deviceId===s.deviceId);window.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:r?.label}})),t?.removeAttribute("data-camera-error"),t?.setAttribute("data-camera-ready",!0)}catch(i){t?.removeAttribute("data-camera-ready"),t?.setAttribute("data-camera-error",A.handleCameraError(i))}}class P0 extends HTMLElement{constructor(){super(),this.templateString=O0.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:F0}},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="BIGGER 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)}async _switchCamera(){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,A.stopMedia(),await P2(this,{facingMode:this.facingMode}),this.handleStream(A.stream)}_stopVideoStream(){try{clearTimeout(this._videoStreamTimeout),clearInterval(this._imageCaptureInterval),clearInterval(this._drawingInterval),this._capturePOLPhoto(),this._captureReferencePhoto(),A.stopMedia();const e=this._rawImages.length;this._data.referenceImage=this._referenceImage,this._data.previewImage=this._referenceImage;const i=$0(e);this._data.images=this._data.images.concat(i.map(n=>({image:this._rawImages[n].split(",")[1],image_type_id:Je.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 n=e.toDataURL("image/jpeg");this._referenceImage=n,this._data.images.push({image:n.split(",")[1],image_type_id:Je.SELFIE_IMAGE_BASE64})}_publishImages(){this.dispatchEvent(new CustomEvent("selfie-capture.publish",{detail:this._data}))}resetErrorMessage(){this.errorMessage.textContent=""}_drawImage(e,i=!0,n=this._video){const r=e.getContext("2d");if(r.drawImage(n,0,0,n.videoWidth,n.videoHeight,0,0,e.width,e.height),i){const s=r.getImageData(0,0,e.width,e.height);if(R0(s.data))return r;throw new Error("Unable to capture webcam images - Please try another device")}else return r}handleStream(e){try{const i=this.shadowRoot.querySelector("video");let n=null;i?n=this.shadowRoot.querySelector("video"):n=document.createElement("video"),n.autoplay=!0,n.playsInline=!0,n.muted=!0,"srcObject"in n?n.srcObject=e:n.src=window.URL.createObjectURL(e),n.onloadedmetadata=()=>{n.play()},this._video=n;const r=this.shadowRoot.querySelector(".video-container > .video");this._data.permissionGranted=!0,i||r.prepend(n)}catch(i){this.setAttribute("data-camera-error",A.handleCameraError(i)),i.name!=="AbortError"&&console.error(i),A.stopMedia()}}setUpEventListeners(){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()}),this.switchCamera?.addEventListener("click",()=>{this._switchCamera()}),this.navigation.addEventListener("navigation.back",()=>{this.handleBackEvents()}),this.navigation.addEventListener("navigation.close",()=>{this.closeWindow()}),A.stream?this.handleStream(A.stream):this.hasAttribute("data-camera-ready")&&P2(this,{facingMode:this.facingMode}),this.setupAgentMode()}disconnectedCallback(){A.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")}async setupAgentMode(){if(!this.allowAgentMode)return;await A.supportsAgentMode()||this.hasAttribute("show-agent-mode-for-tests")?(this.switchCamera.hidden=!1,this.facingMode==="user"?this.shadowRoot.querySelector("video")?.classList?.remove("agent-mode"):this.shadowRoot.querySelector("video")?.classList?.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"data-camera-ready":case"hidden":case"title":case"allow-agent-mode":this.shadowRoot.innerHTML=this.render(),this.init();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"),A.stopMedia()}}"customElements"in window&&!customElements.get("selfie-capture")&&window.customElements.define("selfie-capture",P0);const N0=({timeout:t=2e4,"start-countdown":e=!1,hidden:i=!1,...n})=>{const r=ii(i),s=ii(e),[o,a]=Pe(!1),[c,l]=Pe(0),[d,h]=Pe(!1),[u,p]=Pe(!1),[f,m]=Pe(!1);if(ei(()=>{if(o||u)return;(async()=>{p(!0);try{await O2(),a(!0)}catch(v){console.error("Failed to load Mediapipe:",v)}p(!1)})()},[o,u]),ei(()=>{if(r||!s||o)return;const g=setInterval(()=>{l(v=>Math.min(v+1,100))},t/100);return()=>{clearInterval(g)}},[r,s,t,o]),ei(()=>{if(r||o||c<100)return;const v=setTimeout(()=>{const b=document.querySelector("selfie-capture");if(b&&!b.hasAttribute("data-backup-events-setup")){b.setAttribute("data-backup-events-setup","true");const k=S=>{const O=S;window.dispatchEvent(new CustomEvent(O.type,{detail:O.detail,bubbles:!0}))};return b.addEventListener("selfie-capture.publish",k),b.addEventListener("selfie-capture.cancelled",k),b.addEventListener("selfie-capture.close",k),()=>{b.removeEventListener("selfie-capture.publish",k),b.removeEventListener("selfie-capture.cancelled",k),b.removeEventListener("selfie-capture.close",k)}}},200);return()=>{clearTimeout(v)}},[r,o,c]),r)return null;if(d&&o&&!f)return L(bo,{...n});if(!d&&o&&!f)return L(bo,{...n});if(c>=100){f||m(!0);const g={...n};return delete g.hidden,L("selfie-capture",{...g,ref:v=>{if(v&&!v.hasAttribute("data-events-setup")){v.setAttribute("data-events-setup","true");const b=k=>{const S=k;(S.type==="selfie-capture.publish"||S.type==="selfie-capture.cancelled"||S.type==="selfie-capture.close")&&h(!0),window.dispatchEvent(new CustomEvent(S.type,{detail:S.detail,bubbles:!0}))};v.addEventListener("selfie-capture.publish",b),v.addEventListener("selfie-capture.cancelled",b),v.addEventListener("selfie-capture.close",b)}}})}return L("div",{style:{textAlign:"center",marginTop:"20%"},children:[L("div",{style:{marginBottom:"16px",display:"flex",justifyContent:"center"},children:L(Dl,{size:48,style:{animation:"spin 1s linear infinite"}})}),L("p",{children:["Loading... ",c,"%"]}),L("style",{children:`
3849
+ @keyframes spin {
3850
+ from { transform: rotate(0deg); }
3851
+ to { transform: rotate(360deg); }
3852
+ }
3853
+ `})]})};customElements.get("selfie-capture-wrapper")||fa(N0,"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 H0=$i.version,Xe=document.querySelector("smart-camera-web");async function pn(t,e="user"){try{const i=await A.getMedia({audio:!1,video:{facingMode:e}}),r=(await navigator.mediaDevices.enumerateDevices()).find(s=>s.kind==="videoinput"&&i.getVideoTracks()[0].getSettings().deviceId===s.deviceId);Xe?.dispatchEvent(new CustomEvent("metadata.camera-name",{detail:{cameraName:r?.label}})),t.removeAttribute("data-camera-error"),t.setAttribute("data-camera-ready",!0)}catch(i){t.removeAttribute("data-camera-ready"),t.setAttribute("data-camera-error",A.handleCameraError(i))}}const N2=(t,e=0,i=0,n=.9)=>new Promise((r,s)=>{if(!t||typeof t!="string"){s(new Error("Invalid data URI provided"));return}if(e<0||e>=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*e/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=t});class H2 extends HTMLElement{constructor(){super(),this.activeScreen=null,this._remountKey=0,Xe?.dispatchEvent(new CustomEvent("metadata.initialize"))}connectedCallback(){this.innerHTML=`
3854
+ ${qt(this.themeColor)}
3855
+ <div>
3856
+ <selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
3857
+ <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>
3858
+ <selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
3859
+ </div>
3860
+ `,this._data={images:[],meta:{libraryVersion:H0}},this.selfieInstruction=this.querySelector("selfie-capture-instructions"),this.selfieCapture=this.querySelector("selfie-capture-wrapper"),this.selfieReview=this.querySelector("selfie-capture-review"),this.hideInstructions&&!this.hasAttribute("hidden")&&pn(this.selfieCapture,this.getAgentMode()),this.getAttribute("initial-screen")==="selfie-capture"?pn(this.selfieCapture,this.getAgentMode()).then(()=>this.setActiveScreen(this.selfieCapture)):this.hideInstructions?this.setActiveScreen(this.selfieCapture):this.setActiveScreen(this.selfieInstruction),this.setUpEventListeners()}getAgentMode(){return this.inAgentMode?"environment":"user"}disconnectedCallback(){A.stopMedia(),this.activeScreen&&this.activeScreen.removeAttribute("hidden"),this.activeScreen=null,this.innerHTML=""}setUpEventListeners(){this.selfieInstruction.addEventListener("selfie-capture-instructions.capture",async()=>{await pn(this.selfieCapture,this.getAgentMode()).then(()=>this.setActiveScreen(this.selfieCapture)),Xe?.dispatchEvent(new CustomEvent("metadata.selfie-capture-start")),Xe?.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",async()=>{Xe?.dispatchEvent(new CustomEvent("metadata.selfie-capture-retry")),this.selfieReview.removeAttribute("data-image"),this._data.images=[],this.forceWrapperRemount(),this.hideInstructions?(this.setActiveScreen(this.selfieCapture),await pn(this.selfieCapture,this.getAgentMode())):this.setActiveScreen(this.selfieInstruction)}),this.selfieReview.addEventListener("selfie-capture-review.accepted",async()=>{this._publishSelectedImages()}),[this.selfieInstruction,this.selfieCapture,this.selfieReview].forEach(e=>{e.addEventListener(`${e.nodeName.toLowerCase()}.close`,()=>{this.handleCloseEvent()})})}forceWrapperRemount(){this._remountKey++;const e=this.querySelector("div"),i=this.selfieCapture,n=document.createElement("selfie-capture-wrapper");n.setAttribute("theme-color",this.themeColor),n.setAttribute("key",this._remountKey.toString()),n.setAttribute("start-countdown","false");const r=this.hasAttribute("show-navigation"),s=this.getAttribute("allow-agent-mode")==="true",o=this.hasAttribute("show-agent-mode-for-tests"),a=this.hasAttribute("hide-attribution"),c=this.hasAttribute("disable-image-tests");r&&n.setAttribute("show-navigation",""),s&&n.setAttribute("allow-agent-mode","true"),o&&n.setAttribute("show-agent-mode-for-tests",""),a&&n.setAttribute("hide-attribution",""),c&&n.setAttribute("disable-image-tests",""),n.setAttribute("hidden",""),e.replaceChild(n,i),this.selfieCapture=n,this.setupSelfieWrapperEventListeners()}setActiveScreen(e){this.activeScreen?.setAttribute("hidden",""),e.removeAttribute("hidden"),this.activeScreen=e,e===this.selfieCapture?(e.setAttribute("start-countdown","true"),pn(this.selfieCapture,this.getAgentMode())):this.selfieCapture&&this.selfieCapture.setAttribute("start-countdown","false")}setupSelfieWrapperEventListeners(){window.addEventListener("selfie-capture.cancelled",()=>{if(A.stopMedia(),this.forceWrapperRemount(),this.hideInstructions){this.handleBackEvents();return}this.setActiveScreen(this.selfieInstruction)}),window.addEventListener("selfie-capture.close",()=>{A.stopMedia(),this.forceWrapperRemount(),this.handleCloseEvent()}),window.addEventListener("selfie-capture.publish",async e=>{Xe?.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",await N2(e.detail.referenceImage,20,20)),this._data.images=e.detail.images,A.stopMedia(),this.setActiveScreen(this.selfieReview)}),this.addEventListener("selfie-capture.publish",async e=>{Xe?.dispatchEvent(new CustomEvent("metadata.selfie-capture-end")),this.selfieReview.setAttribute("data-image",await N2(e.detail.referenceImage,20,20)),this._data.images=e.detail.images,A.stopMedia(),this.setActiveScreen(this.selfieReview)})}_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",H2);/*!
3861
+ * Signature Pad v5.0.2 | https://github.com/szimek/signature_pad
3862
+ * (c) 2024 Szymon Nowak | Released under the MIT license
3863
+ */class gr{constructor(e,i,n,r){if(isNaN(e)||isNaN(i))throw new Error(`Point is invalid: (${e}, ${i})`);this.x=+e,this.y=+i,this.pressure=n||0,this.time=r||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 wo{static fromPoints(e,i){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,r=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new wo(e[1],n,r,e[2],i.start,i.end)}static calculateControlPoints(e,i,n){const r=e.x-i.x,s=e.y-i.y,o=i.x-n.x,a=i.y-n.y,c={x:(e.x+i.x)/2,y:(e.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=h/(d+h),m={x:l.x+u*f,y:l.y+p*f},g=i.x-m.x,v=i.y-m.y;return{c1:new gr(c.x+g,c.y+v),c2:new gr(l.x+g,l.y+v)}}constructor(e,i,n,r,s,o){this.startPoint=e,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(e,i,n,r,s){return i*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+s*e*e*e}}class U0{constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,i,n){this._et.addEventListener(e,i,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,i,n){this._et.removeEventListener(e,i,n)}}function V0(t,e=250){let i=0,n=null,r,s,o;const a=()=>{i=Date.now(),n=null,r=t.apply(s,o),n||(s=null,o=[])};return function(...l){const d=Date.now(),h=e-(d-i);return s=this,o=l,h<=0||h>e?(n&&(clearTimeout(n),n=null),i=d,r=t.apply(s,o),n||(s=null,o=[])):n||(n=window.setTimeout(a,h)),r}}let j0=class ko extends U0{constructor(e,i={}){var n,r,s;super(),this.canvas=e,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=o=>{!this._isLeftButtonPressed(o,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(o))},this._handleMouseMove=o=>{if(!this._isLeftButtonPressed(o,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(o),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(o))},this._handleMouseUp=o=>{this._isLeftButtonPressed(o)||this._strokeEnd(this._pointerEventToSignatureEvent(o))},this._handleTouchStart=o=>{o.targetTouches.length!==1||this._drawingStroke||(o.cancelable&&o.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(o)))},this._handleTouchMove=o=>{if(o.targetTouches.length===1){if(o.cancelable&&o.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(o),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(o))}},this._handleTouchEnd=o=>{o.targetTouches.length===0&&(o.cancelable&&o.preventDefault(),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this._strokeEnd(this._touchEventToSignatureEvent(o)))},this._handlePointerDown=o=>{!this._isLeftButtonPressed(o)||this._drawingStroke||(o.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(o)))},this._handlePointerMove=o=>{if(!this._isLeftButtonPressed(o,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(o),!1);return}o.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(o))},this._handlePointerUp=o=>{this._isLeftButtonPressed(o)||(o.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(o)))},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?V0(ko.prototype._strokeUpdate,this.throttle):ko.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((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=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:n}=this._getListenerFunctions();switch(e.event.type){case"mousedown":n("mousemove",this._handleMouseMove),n("mouseup",this._handleMouseUp);break;case"touchstart":n("touchmove",this._handleTouchMove),n("touchend",this._handleTouchEnd);break;case"pointerdown":n("pointermove",this._handlePointerMove),n("pointerup",this._handlePointerUp);break}this._drawingStroke=!0;const r=this._getPointGroupOptions(),s=Object.assign(Object.assign({},r),{points:[]});this._data.push(s),this._reset(r),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),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: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,n){const r=this.canvas.getBoundingClientRect();return new gr(e-r.left,i-r.top,n,new Date().getTime())}_addPoint(e,i){const{_lastPoints:n}=this;if(n.push(e),n.length>2){n.length===3&&n.unshift(n[0]);const r=this._calculateCurveWidths(n[1],n[2],i),s=wo.fromPoints(n,r);return n.shift(),s}return null}_calculateCurveWidths(e,i,n){const r=n.velocityFilterWeight*i.velocityFrom(e)+(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(e,i){return Math.max(i.maxWidth/(e+1),i.minWidth)}_drawCurveSegment(e,i,n){const r=this._ctx;r.moveTo(e,i),r.arc(e,i,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,i){const n=this._ctx,r=e.endWidth-e.startWidth,s=Math.ceil(e.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*e.startPoint.x;p+=3*h*a*e.control1.x,p+=3*d*c*e.control2.x,p+=l*e.endPoint.x;let f=u*e.startPoint.y;f+=3*h*a*e.control1.y,f+=3*d*c*e.control2.y,f+=l*e.endPoint.y;const m=Math.min(e.startWidth+l*r,i.maxWidth);this._drawCurveSegment(p,f,m)}n.closePath(),n.fill()}_drawDot(e,i){const n=this._ctx,r=i.dotSize>0?i.dotSize:(i.minWidth+i.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=i.penColor,n.fill()}_fromData(e,i,n){for(const r of e){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 gr(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:e=!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()),e&&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}};class Ye{static memoryLimit=2048e3;static supportedTypes=["image/jpeg","image/png","image/svg+xml"];static getHumanSize(e){const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1),r=e/1024**n;return n===0?`${e} bytes`:`${r.toFixed(0)} ${i[n]}`}static getData(e){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(e)})}static async retrieve(e){if(e.length>1)throw new Error("Only one file upload is permitted at a time");const i=e[0];if(!Ye.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>Ye.memoryLimit)throw new Error(`${i.name} is too large. Please ensure that the file is less than ${Ye.getHumanSize(Ye.memoryLimit)}.`);return await Ye.getData(i)}}class U2 extends HTMLElement{connectedCallback(){const e=this.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
3864
+ :host {
3865
+ display: block;
3866
+ block-size: auto;
3867
+ inline-size: 30rem;
3868
+ max-inline-size: 100%;
3869
+ position: relative;
3870
+ --color-active: #2D2B2A;
3871
+ --color-default: #001096;
3872
+ --color-disabled: #848282;
3873
+ }
3874
+
3875
+ :host::part(upload) {
3876
+ text-align: center;
3877
+ }
3878
+
3879
+ :host::part(signature-controls) {
3880
+ display: inline-flex;
3881
+ position: absolute;
3882
+ top: 1rem;
3883
+ right: 1rem;
3884
+ }
3885
+
3886
+ :host::part(upload) svg + * {
3887
+ margin-inline-start: .5rem;
3888
+ }
3889
+
3890
+ :host::part(canvas) {
3891
+ background-color: #F9F0E7;
3892
+ --dot-bg: #F9F0E7;
3893
+ --dot-color: black;
3894
+ --dot-size: 1px;
3895
+ --dot-space: 22px;
3896
+ background:
3897
+ linear-gradient(90deg, var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
3898
+ linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
3899
+ var(--dot-color);
3900
+ border-radius: 2rem;
3901
+ inline-size: 30rem;
3902
+ max-inline-size: 100%;
3903
+ aspect-ratio: 2 / 1;
3904
+ }
3905
+
3906
+ :host::part(upload-preview-image) {
3907
+ max-inline-size: 10rem;
3908
+ margin-inline: auto;
3909
+ }
3910
+
3911
+ .visually-hidden {
3912
+ clip: rect(0 0 0 0);
3913
+ clip-path: inset(50%);
3914
+ height: 1px;
3915
+ overflow: hidden;
3916
+ position: absolute;
3917
+ white-space: nowrap;
3918
+ width: 1px;
3919
+ }
3920
+
3921
+ button,
3922
+ label {
3923
+ font: inherit;
3924
+ cursor: pointer;
3925
+ }
3926
+
3927
+ label {
3928
+ display: inline-flex;
3929
+ text-decoration: underline;
3930
+ }
3931
+
3932
+ label svg + * {
3933
+ margin-inline-start: .5rem;
3934
+ }
3935
+
3936
+ [type="file"] {
3937
+ display: none;
3938
+ }
3939
+
3940
+ .center {
3941
+ text-align: center;
3942
+ margin-inline: auto;
3943
+ }
3944
+
3945
+ .color-red {
3946
+ color: red;
3947
+ }
3948
+
3949
+ button[data-variant="icon"] {
3950
+ appearance: none;
3951
+ -webkit-appearance: none;
3952
+ background-color: transparent;
3953
+ border: 0px;
3954
+ }
3955
+
3956
+ button[data-variant="text"] {
3957
+ appearance: none;
3958
+ -webkit-appearance: none;
3959
+ background-color: transparent;
3960
+ border: 0px;
3961
+ text-decoration: underline;
3962
+ display: inline-flex;
3963
+ align-items: baseline;
3964
+ }
3965
+
3966
+ button[data-variant="solid"] {
3967
+ --button-color: ${this.themeColor};
3968
+ border-radius: 2.5rem;
3969
+ border: 0;
3970
+ background-color: transparent;
3971
+ color: #fff;
3972
+ cursor: pointer;
3973
+ inline-size: 100%;
3974
+ display: inline-flex;
3975
+ align-items: center;
3976
+ justify-content: center;
3977
+ font-size: 18px;
3978
+ font-weight: 600;
3979
+ padding: .75rem 1.5rem;
3980
+ text-align: center;
3981
+ background-color: var(--button-color);
3982
+ border: 2px solid var(--button-color);
3983
+ }
3984
+
3985
+ button:hover,
3986
+ button:focus,
3987
+ button:active {
3988
+ --button-color: var(--color-active);
3989
+ }
3990
+
3991
+ button:disabled {
3992
+ --button-color: var(--color-disabled);
3993
+ }
3994
+ `;const n=document.createElement("div"),r=document.createElement("div");r.innerHTML=`
3995
+ <p id="error" class="color-red | center"><p>
3996
+ `;const s=document.createElement("div");s.setAttribute("id","controls"),s.setAttribute("part","signature-controls"),s.innerHTML=`
3997
+ <button data-variant="icon" type="button" name="clear" id="clear">
3998
+ <span class="visually-hidden">
3999
+ Clear Signature
4000
+ </span>
4001
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" width="18" viewBox="0 0 17 18">
4002
+ <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" />
4003
+ </svg>
4004
+ </button>
4005
+ `;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=`
4006
+ <p part="upload">
4007
+ <strong>or</strong>
4008
+ <label>
4009
+ <input type='file' onclick='this.value=null;' id='upload-signature' accept='image/jpeg, image/png, image/svg+xml' />
4010
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none">
4011
+ <rect width="16" height="16" fill="#F9F0E7" rx="2"/>
4012
+ <mask id="sign" width="16" height="16" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha">
4013
+ <rect width="16" height="16" fill="#D9D9D9" rx="2"/>
4014
+ </mask>
4015
+ <g mask="url(#sign)">
4016
+ <path fill="#2D2B2A" d="M0 13.333h16V16H0z"/>
4017
+ </g>
4018
+ <path fill="#2D2B2A" fill-rule="evenodd" d="M2.69 7.346a.23.23 0 0 1 .059-.073.275.275 0 0 1 .284-.034c.07.036.146.064.224.084h.12c0-.012.105-.048.105-.395a.796.796 0 0 1 .211-.61.667.667 0 0 1 .607-.096c.202.061.39.154.555.275.194.138.38.286.555.443.146.134.31.25.489.347l.092.047c.119.06.238-.023.185-.143l-.04-.12a.817.817 0 0 1-.066-.694.675.675 0 0 1 .244-.273.774.774 0 0 1 .364-.12c.324-.028.651 0 .964.083h.026c.027-.861.225-1.83.82-2.523.593-.694 1.478-.993 2.205-.837.726.155 1.307.73 1.307 1.602 0 1.34-.872 2.26-1.915 2.93.471.374.85.835 1.11 1.351.027.046.05.094.065.144h.014a.55.55 0 0 0 .079.203.44.44 0 0 0 .04.18c.002.025.011.05.026.07h-.013c.037.17.041.344.013.515a.955.955 0 0 1-.188.493 1.097 1.097 0 0 1-.433.344 1.346 1.346 0 0 1-1.122.012 2.194 2.194 0 0 1-.846-.67 5.024 5.024 0 0 1-.462-.681h-.026a.502.502 0 0 0-.106-.144.014.014 0 0 1-.01-.003.011.011 0 0 1-.003-.009.035.035 0 0 1-.013-.023.047.047 0 0 1-.011-.017.626.626 0 0 0-.055-.163.24.24 0 0 0-.014-.095h.014a3.477 3.477 0 0 1-.198-.49 6.318 6.318 0 0 1-.278-1.699L7.51 6.51c-.243-.07-.5-.094-.753-.071-.158.024-.198.071-.211.107-.014.036-.04.168.053.359.092.191.171.478.118.658a.45.45 0 0 1-.21.25.66.66 0 0 1-.305.06 1.521 1.521 0 0 1-.568-.19 3.533 3.533 0 0 1-.58-.42 3.54 3.54 0 0 0-.49-.394 1.49 1.49 0 0 0-.409-.203c-.053-.024-.079-.024-.092-.012H4.05c-.014.012-.066.072-.066.275 0 .395-.12.705-.423.813a.813.813 0 0 1-.41.024 1.646 1.646 0 0 1-.343-.12.237.237 0 0 1-.126-.127.208.208 0 0 1 .007-.172Zm5.731.766c.068.204.152.404.251.598.011.053.03.105.053.155.036.068.08.132.132.191.02.05.047.099.08.144.085.152.186.296.303.43.167.22.389.4.647.526a.847.847 0 0 0 .687-.011.655.655 0 0 0 .247-.204.573.573 0 0 0 .11-.287 1.435 1.435 0 0 0-.04-.454h-.014a.496.496 0 0 0-.079-.335.491.491 0 0 0-.119-.191 3.842 3.842 0 0 0-1.017-1.16l-.356.18a.253.253 0 0 1-.193.027.248.248 0 0 1-.088-.041.22.22 0 0 1-.063-.07.219.219 0 0 1-.02-.172.242.242 0 0 1 .113-.14l.172-.083a3.388 3.388 0 0 0-.463-.251l-.58-.24c.022.47.101.935.237 1.388Zm.568-1.555c.24.12.474.252.7.395 1.017-.634 1.81-1.459 1.81-2.63 0-.67-.41-1.053-.912-1.16-.502-.108-1.189.083-1.704.669-.515.586-.7 1.47-.713 2.32v.083c.251.084.515.192.819.323Z" clip-rule="evenodd"/>
4019
+ </svg>
4020
+ <span>upload a signature</span>
4021
+ </label>
4022
+ </p>
4023
+ `;const f=document.createElement("p");f.innerHTML=`
4024
+ <button data-variant="solid" type="button" name="publish" id="publish">
4025
+ <span>
4026
+ Continue
4027
+ </span>
4028
+ <svg
4029
+ aria-hidden="true"
4030
+ width="25"
4031
+ height="24"
4032
+ fill="none"
4033
+ xmlns="http://www.w3.org/2000/svg"
4034
+ >
4035
+ <path
4036
+ d="M7 12h11m0 0-4.588-4M18 12l-4.588 4"
4037
+ stroke="#fff"
4038
+ stroke-width="1.5"
4039
+ stroke-linecap="round"
4040
+ stroke-linejoin="round"
4041
+ />
4042
+ </svg>
4043
+ </button>
4044
+ `,n.appendChild(r),n.appendChild(s),n.appendChild(o),this.allowUpload&&n.appendChild(p),n.appendChild(f),e.appendChild(i),e.appendChild(n),this.core=new j0(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",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 n=this.shadowRoot.querySelector("img");n||(n=document.createElement("img")),n.src=e,n.setAttribute("part","upload-preview-image"),i.setAttribute("hidden",!0),i.insertAdjacentElement("afterend",n)}async uploadSignature(e){try{this.resetErrorMessage();const{files:i}=e.target,n=await Ye.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",U2);function G0(){return`
4045
+ ${qt(this.themeColor)}
4046
+ <style>
4047
+ .camera-permission-screen {
4048
+ display: flex;
4049
+ flex-direction: column;
4050
+ max-block-size: 100%;
4051
+ max-inline-size: 40ch;
4052
+ }
4053
+ .camera-permission {
4054
+ display: flex;
4055
+ flex-direction: column;
4056
+ gap: 1.5rem;
4057
+ align-items: center;
4058
+ margin-top: auto;
4059
+ margin-bottom: auto;
4060
+ }
4061
+ .camera-permission svg {
4062
+ flex-shrink: 0;
4063
+ margin-inline-end: 2rem;
4064
+ }
4065
+ .camera-permission p {
4066
+ margin-block: 0;
4067
+ text-align: center;
4068
+ }
4069
+ </style>
4070
+ <div class='camera-permission-screen flow center'>
4071
+ <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation?"show-navigation":""} ${this.hideBack?"hide-back":""}></smileid-navigation>
4072
+ <div class='flow center'>
4073
+ <p class='color-red | center' id='error'>
4074
+ </p>
4075
+ </div>
4076
+ <div class='section | flow camera-permission-wrapper'>
4077
+ <div class='center camera-permission'>
4078
+ <svg xmlns="http://www.w3.org/2000/svg" width="43" height="33" viewBox="0 0 43 33" fill="none">
4079
+ <g clip-path="url(#clip0_658_1399)">
4080
+ <path d="M6.36288 7.14178H36.6374C38.1923 7.14178 39.6835 7.7593 40.783 8.85849C41.8824 9.95768 42.5001 11.4485 42.5001 13.003V29.8478C42.5001 30.6838 42.1679 31.4856 41.5766 32.0767C40.9853 32.6679 40.1833 33 39.347 33H6.36288C4.80798 33 3.31676 32.3825 2.21728 31.2833C1.1178 30.1841 0.500122 28.6933 0.500122 27.1388L0.500122 13.003C0.500122 11.4485 1.1178 9.95768 2.21728 8.85849C3.31676 7.7593 4.80798 7.14178 6.36288 7.14178Z" fill="#B2B2B2"/>
4081
+ <path d="M10.454 23.1789C10.7438 21.9337 9.96906 20.6893 8.7235 20.3995C7.47794 20.1098 6.23325 20.8843 5.9434 22.1296C5.65355 23.3748 6.4283 24.6191 7.67386 24.9089C8.91942 25.1987 10.1641 24.4241 10.454 23.1789Z" fill="#DBDBC4"/>
4082
+ <path d="M10.0768 22.9365C10.2425 21.9024 9.53826 20.9298 8.50389 20.7642C7.46952 20.5985 6.49668 21.3025 6.331 22.3366C6.16532 23.3707 6.86954 24.3433 7.90391 24.509C8.93828 24.6746 9.91112 23.9706 10.0768 22.9365Z" fill="#FF5805"/>
4083
+ <path d="M10.9694 16.2784H5.20514C4.83782 16.2784 4.54004 16.576 4.54004 16.9433V18.5194C4.54004 18.8866 4.83782 19.1843 5.20514 19.1843H10.9694C11.3367 19.1843 11.6345 18.8866 11.6345 18.5194V16.9433C11.6345 16.576 11.3367 16.2784 10.9694 16.2784Z" fill="#2D2B2A"/>
4084
+ <path d="M37.9183 22.6813C37.9183 19.8492 37.9183 17.0418 37.9429 14.2097C37.9429 11.8948 37.9183 9.57985 37.9676 7.28955C37.5348 7.16853 37.0868 7.11047 36.6374 7.11716H36.0708C36.0954 9.87537 36.1201 12.6089 36.1201 15.3672C36.1201 20.9082 36.1201 26.4739 36.1447 32.0149V32.9754H37.8937C37.8937 29.5522 37.8937 26.1291 37.9183 22.6813Z" fill="#DBDBC4"/>
4085
+ <path d="M0.500136 12.9291C0.496683 12.9634 0.500492 12.9981 0.511315 13.0309C0.522139 13.0637 0.539736 13.0938 0.562964 13.1194C0.586192 13.1449 0.614532 13.1653 0.646146 13.1792C0.67776 13.1931 0.71194 13.2002 0.746471 13.2H10.4767C12.8169 13.2 12.1271 11.2545 15.1324 11.2545H41.9582C41.9989 11.2523 42.0385 11.2411 42.0742 11.2215C42.1099 11.2019 42.1408 11.1745 42.1644 11.1414C42.1881 11.1083 42.204 11.0702 42.2109 11.0301C42.2179 10.99 42.2157 10.9488 42.2045 10.9097C41.8333 9.80556 41.125 8.84568 40.1793 8.16529C39.2335 7.48491 38.0981 7.11831 36.933 7.11716H6.31363C5.55019 7.11716 4.79423 7.26749 4.0889 7.55957C3.38358 7.85164 2.7427 8.27975 2.20287 8.81944C1.66304 9.35913 1.23482 9.99983 0.942663 10.705C0.650508 11.4101 0.500136 12.1659 0.500136 12.9291Z" fill="#5E646E"/>
4086
+ <path d="M29.7154 1.3791H23.4585C21.4632 1.3791 19.7388 2.48731 19.394 4.01418L18.113 9.45671L18.1623 9.50597H35.0116C35.0362 9.50597 35.0608 9.48134 35.0362 9.45671L33.7799 4.01418C33.4104 2.48731 31.7107 1.3791 29.7154 1.3791Z" fill="#5E646E"/>
4087
+ <path d="M30.8977 4.06343V3.71865C30.8977 3.32677 30.742 2.95093 30.4649 2.67382C30.1877 2.39672 29.8117 2.24104 29.4197 2.24104H23.6555C23.2678 2.2475 22.8982 2.40603 22.6263 2.68244C22.3544 2.95885 22.2021 3.331 22.2021 3.71865V4.06343H30.8977Z" fill="#2D2B2A"/>
4088
+ <path d="M14.0731 4.72836H6.70771C6.4084 4.72836 6.16577 4.97093 6.16577 5.27015V6.63695C6.16577 6.93617 6.4084 7.17874 6.70771 7.17874H14.0731C14.3724 7.17874 14.615 6.93617 14.615 6.63695V5.27015C14.615 4.97093 14.3724 4.72836 14.0731 4.72836Z" fill="#2D2B2A"/>
4089
+ <path d="M8.99862 8.76717H7.12648C6.73194 8.76717 6.41211 9.08692 6.41211 9.48135V11.0181C6.41211 11.4125 6.73194 11.7322 7.12648 11.7322H8.99862C9.39315 11.7322 9.71299 11.4125 9.71299 11.0181V9.48135C9.71299 9.08692 9.39315 8.76717 8.99862 8.76717Z" fill="#FCFCFC"/>
4090
+ <path d="M8.77703 10.2448C8.77709 10.1521 8.75846 10.0604 8.72227 9.97507C8.68608 9.88977 8.63306 9.81263 8.56638 9.74827C8.4997 9.6839 8.42073 9.63363 8.33418 9.60047C8.24763 9.5673 8.15529 9.55191 8.06266 9.55522C7.97208 9.55522 7.88239 9.57305 7.79871 9.60771C7.71503 9.64236 7.63899 9.69315 7.57494 9.75718C7.5109 9.82121 7.46009 9.89723 7.42543 9.98089C7.39076 10.0646 7.37292 10.1542 7.37292 10.2448C7.37281 10.43 7.44469 10.608 7.57338 10.7413C7.70206 10.8745 7.8775 10.9526 8.06266 10.9589C8.25212 10.9589 8.43382 10.8837 8.56779 10.7498C8.70176 10.6158 8.77703 10.4342 8.77703 10.2448Z" fill="#5E646E"/>
4091
+ <path d="M26.9318 30.0202C33.7069 30.0202 39.1992 24.5293 39.1992 17.756C39.1992 10.9827 33.7069 5.49179 26.9318 5.49179C20.1566 5.49179 14.6643 10.9827 14.6643 17.756C14.6643 24.5293 20.1566 30.0202 26.9318 30.0202Z" fill="#FCFCFC"/>
4092
+ <path d="M26.9319 28.3455C32.7819 28.3455 37.5242 23.6044 37.5242 17.756C37.5242 11.9075 32.7819 7.16641 26.9319 7.16641C21.0818 7.16641 16.3395 11.9075 16.3395 17.756C16.3395 23.6044 21.0818 28.3455 26.9319 28.3455Z" fill="#0A462F"/>
4093
+ <path d="M26.9318 24.0358C30.401 24.0358 33.2133 21.2242 33.2133 17.756C33.2133 14.2877 30.401 11.4761 26.9318 11.4761C23.4626 11.4761 20.6503 14.2877 20.6503 17.756C20.6503 21.2242 23.4626 24.0358 26.9318 24.0358Z" fill="#2D2B2A"/>
4094
+ <path opacity="0.49" d="M28.4098 19.1104C30.1376 19.1104 31.5383 17.7102 31.5383 15.9828C31.5383 14.2555 30.1376 12.8552 28.4098 12.8552C26.682 12.8552 25.2814 14.2555 25.2814 15.9828C25.2814 17.7102 26.682 19.1104 28.4098 19.1104Z" fill="url(#paint0_linear_658_1399)"/>
4095
+ <g style="mix-blend-mode:screen" opacity="0.24">
4096
+ <path d="M30.9717 14.6776C30.9717 14.9977 30.8445 15.3046 30.6182 15.5309C30.3918 15.7572 30.0848 15.8843 29.7647 15.8843C29.4445 15.8843 29.1375 15.7572 28.9112 15.5309C28.6848 15.3046 28.5576 14.9977 28.5576 14.6776C28.5576 14.5203 28.589 14.3645 28.6499 14.2195C28.7109 14.0744 28.8002 13.943 28.9126 13.8329C29.025 13.7228 29.1583 13.6363 29.3046 13.5783C29.4509 13.5204 29.6073 13.4922 29.7647 13.4955C29.922 13.4922 30.0784 13.5204 30.2247 13.5783C30.371 13.6363 30.5043 13.7228 30.6167 13.8329C30.7291 13.943 30.8184 14.0744 30.8794 14.2195C30.9403 14.3645 30.9717 14.5203 30.9717 14.6776Z" fill="#00FFFF"/>
4097
+ </g>
4098
+ </g>
4099
+ <defs>
4100
+ <linearGradient id="paint0_linear_658_1399" x1="25.2617" y1="15.9804" x2="31.5383" y2="15.9804" gradientUnits="userSpaceOnUse">
4101
+ <stop stop-color="#7F47DD" stop-opacity="0.1"/>
4102
+ <stop offset="0.99" stop-color="#00FFFF"/>
4103
+ </linearGradient>
4104
+ <clipPath id="clip0_658_1399">
4105
+ <rect width="42" height="33" fill="white" transform="translate(0.500122)"/>
4106
+ </clipPath>
4107
+ </defs>
4108
+ </svg>
4109
+ <p class='text-2xl font-bold'>We need access to your camera so that we can capture your details.</p>
4110
+ <div class='flow action-buttons'>
4111
+ <button data-variant='solid full-width' class='button' type='button' id='request-camera-access'>
4112
+ Request Camera Access
4113
+ </button>
4114
+ ${this.hideAttribution?"":"<powered-by-smile-id></powered-by-smile-id>"}
4115
+ </div>
4116
+ </div>
4117
+ </div>
4118
+ </div>
4119
+ `}class z0 extends HTMLElement{connectedCallback(){this.templateString=G0.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",async()=>{i.setAttribute("disabled",!0);try{await A.getMedia({audio:!1,video:!0}),this.dispatchEvent(new CustomEvent("camera-permission.granted"))}catch(n){this.dispatchEvent(new CustomEvent("camera-permission.denied",{detail:n})),e.textContent=A.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",z0);const Z0=$i.version;function W0(){return`
4120
+ ${qt(this.themeColor)}
4121
+ <div>
4122
+ <camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions?"":"hidden"} ${this.hideAttribution}></camera-permission>
4123
+ <selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
4124
+ ${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
4125
+ ></selfie-capture-screens>
4126
+ <document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
4127
+ ${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
4128
+ </div>
4129
+ `}class V2 extends HTMLElement{constructor(){super(),this.scwTemplateString=W0.bind(this),this.render=()=>this.scwTemplateString(),this.attachShadow({mode:"open"}),this.activeScreen=null}connectedCallback(){this.shadowRoot.innerHTML=this.render(),this._data={images:[],meta:{libraryVersion:Z0}},"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(){A.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){this.activeScreen?.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",V2),St.DocumentCaptureScreens=Bo,St.EndUserConsent=Ro,St.List=Mo,St.Navigation=Io,St.Option=To,St.Root=So,St.SelfieCaptureScreens=H2,St.SignaturePad=U2,St.SmartCameraWeb=V2,St.TotpConsent=Do,St.Trigger=Lo,Object.defineProperty(St,Symbol.toStringTag,{value:"Module"}),St}({});
4130
+ //# sourceMappingURL=smart-camera-web.js.map