matter-all-in-one-addon 1.8.21

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 (244) hide show
  1. package/README.md +183 -0
  2. package/dist/camera/ai/camera-ai-detector.d.ts +44 -0
  3. package/dist/camera/ai/camera-ai-detector.js +329 -0
  4. package/dist/camera/ai/camera-ai-detector.js.map +1 -0
  5. package/dist/camera/camera-capabilities.d.ts +13 -0
  6. package/dist/camera/camera-capabilities.js +186 -0
  7. package/dist/camera/camera-capabilities.js.map +1 -0
  8. package/dist/camera/camera-source-resolver.d.ts +18 -0
  9. package/dist/camera/camera-source-resolver.js +187 -0
  10. package/dist/camera/camera-source-resolver.js.map +1 -0
  11. package/dist/camera/camera-types.d.ts +124 -0
  12. package/dist/camera/camera-types.js +8 -0
  13. package/dist/camera/camera-types.js.map +1 -0
  14. package/dist/camera/cameraui/cameraui-client.d.ts +54 -0
  15. package/dist/camera/cameraui/cameraui-client.js +698 -0
  16. package/dist/camera/cameraui/cameraui-client.js.map +1 -0
  17. package/dist/camera/cameraui/cameraui-homekit-bridge.d.ts +21 -0
  18. package/dist/camera/cameraui/cameraui-homekit-bridge.js +343 -0
  19. package/dist/camera/cameraui/cameraui-homekit-bridge.js.map +1 -0
  20. package/dist/camera/cameraui/cameraui-storage.d.ts +17 -0
  21. package/dist/camera/cameraui/cameraui-storage.js +916 -0
  22. package/dist/camera/cameraui/cameraui-storage.js.map +1 -0
  23. package/dist/camera/cameraui/cameraui-types.d.ts +89 -0
  24. package/dist/camera/cameraui/cameraui-types.js +5 -0
  25. package/dist/camera/cameraui/cameraui-types.js.map +1 -0
  26. package/dist/camera/homekit/ffmpeg-helper.d.ts +88 -0
  27. package/dist/camera/homekit/ffmpeg-helper.js +673 -0
  28. package/dist/camera/homekit/ffmpeg-helper.js.map +1 -0
  29. package/dist/camera/homekit/fmp4-parser.d.ts +48 -0
  30. package/dist/camera/homekit/fmp4-parser.js +156 -0
  31. package/dist/camera/homekit/fmp4-parser.js.map +1 -0
  32. package/dist/camera/homekit/hevc-eligibility.d.ts +16 -0
  33. package/dist/camera/homekit/hevc-eligibility.js +153 -0
  34. package/dist/camera/homekit/hevc-eligibility.js.map +1 -0
  35. package/dist/camera/homekit/homekit-camera-recording.delegate.d.ts +73 -0
  36. package/dist/camera/homekit/homekit-camera-recording.delegate.js +445 -0
  37. package/dist/camera/homekit/homekit-camera-recording.delegate.js.map +1 -0
  38. package/dist/camera/homekit/homekit-camera-stream.delegate.d.ts +47 -0
  39. package/dist/camera/homekit/homekit-camera-stream.delegate.js +833 -0
  40. package/dist/camera/homekit/homekit-camera-stream.delegate.js.map +1 -0
  41. package/dist/camera/homekit/homekit-camera.accessory.d.ts +53 -0
  42. package/dist/camera/homekit/homekit-camera.accessory.js +697 -0
  43. package/dist/camera/homekit/homekit-camera.accessory.js.map +1 -0
  44. package/dist/camera/matter/camera-endpoint.builder.d.ts +7 -0
  45. package/dist/camera/matter/camera-endpoint.builder.js +127 -0
  46. package/dist/camera/matter/camera-endpoint.builder.js.map +1 -0
  47. package/dist/camera/matter/camera-session-manager.d.ts +46 -0
  48. package/dist/camera/matter/camera-session-manager.js +120 -0
  49. package/dist/camera/matter/camera-session-manager.js.map +1 -0
  50. package/dist/camera/matter/camera-webrtc-adapter.d.ts +62 -0
  51. package/dist/camera/matter/camera-webrtc-adapter.js +298 -0
  52. package/dist/camera/matter/camera-webrtc-adapter.js.map +1 -0
  53. package/dist/camera/motion/ffmpeg-motion-detector.d.ts +46 -0
  54. package/dist/camera/motion/ffmpeg-motion-detector.js +200 -0
  55. package/dist/camera/motion/ffmpeg-motion-detector.js.map +1 -0
  56. package/dist/camera/nest/nest-camera-adapter.d.ts +38 -0
  57. package/dist/camera/nest/nest-camera-adapter.js +109 -0
  58. package/dist/camera/nest/nest-camera-adapter.js.map +1 -0
  59. package/dist/camera/scrypted/scrypted-camera-card.d.ts +39 -0
  60. package/dist/camera/scrypted/scrypted-camera-card.js +38 -0
  61. package/dist/camera/scrypted/scrypted-camera-card.js.map +1 -0
  62. package/dist/camera/scrypted/scrypted-camera-detail.d.ts +33 -0
  63. package/dist/camera/scrypted/scrypted-camera-detail.js +34 -0
  64. package/dist/camera/scrypted/scrypted-camera-detail.js.map +1 -0
  65. package/dist/camera/scrypted/scrypted-camera-discovery-adapter.d.ts +17 -0
  66. package/dist/camera/scrypted/scrypted-camera-discovery-adapter.js +24 -0
  67. package/dist/camera/scrypted/scrypted-camera-discovery-adapter.js.map +1 -0
  68. package/dist/camera/scrypted/scrypted-camera-normalizer.d.ts +44 -0
  69. package/dist/camera/scrypted/scrypted-camera-normalizer.js +44 -0
  70. package/dist/camera/scrypted/scrypted-camera-normalizer.js.map +1 -0
  71. package/dist/camera/scrypted/scrypted-camera-policy.d.ts +11 -0
  72. package/dist/camera/scrypted/scrypted-camera-policy.js +13 -0
  73. package/dist/camera/scrypted/scrypted-camera-policy.js.map +1 -0
  74. package/dist/camera/scrypted/scrypted-camera-presentation.d.ts +13 -0
  75. package/dist/camera/scrypted/scrypted-camera-presentation.js +23 -0
  76. package/dist/camera/scrypted/scrypted-camera-presentation.js.map +1 -0
  77. package/dist/camera/scrypted/scrypted-client-discovery-adapter.d.ts +6 -0
  78. package/dist/camera/scrypted/scrypted-client-discovery-adapter.js +12 -0
  79. package/dist/camera/scrypted/scrypted-client-discovery-adapter.js.map +1 -0
  80. package/dist/camera/scrypted/scrypted-client.d.ts +152 -0
  81. package/dist/camera/scrypted/scrypted-client.js +1170 -0
  82. package/dist/camera/scrypted/scrypted-client.js.map +1 -0
  83. package/dist/camera/scrypted/scrypted-crypto.d.ts +21 -0
  84. package/dist/camera/scrypted/scrypted-crypto.js +90 -0
  85. package/dist/camera/scrypted/scrypted-crypto.js.map +1 -0
  86. package/dist/camera/scrypted/scrypted-discovery-provider.d.ts +9 -0
  87. package/dist/camera/scrypted/scrypted-discovery-provider.js +25 -0
  88. package/dist/camera/scrypted/scrypted-discovery-provider.js.map +1 -0
  89. package/dist/camera/scrypted/scrypted-homekit-bridge.d.ts +12 -0
  90. package/dist/camera/scrypted/scrypted-homekit-bridge.js +214 -0
  91. package/dist/camera/scrypted/scrypted-homekit-bridge.js.map +1 -0
  92. package/dist/camera/scrypted/scrypted-matter-bridge.d.ts +36 -0
  93. package/dist/camera/scrypted/scrypted-matter-bridge.js +226 -0
  94. package/dist/camera/scrypted/scrypted-matter-bridge.js.map +1 -0
  95. package/dist/camera/scrypted/scrypted-reconnect-manager.d.ts +40 -0
  96. package/dist/camera/scrypted/scrypted-reconnect-manager.js +353 -0
  97. package/dist/camera/scrypted/scrypted-reconnect-manager.js.map +1 -0
  98. package/dist/camera/scrypted/scrypted-runtime-connector.d.ts +7 -0
  99. package/dist/camera/scrypted/scrypted-runtime-connector.js +17 -0
  100. package/dist/camera/scrypted/scrypted-runtime-connector.js.map +1 -0
  101. package/dist/camera/scrypted/scrypted-runtime-facade.d.ts +13 -0
  102. package/dist/camera/scrypted/scrypted-runtime-facade.js +29 -0
  103. package/dist/camera/scrypted/scrypted-runtime-facade.js.map +1 -0
  104. package/dist/camera/scrypted/scrypted-runtime-ingest.d.ts +5 -0
  105. package/dist/camera/scrypted/scrypted-runtime-ingest.js +54 -0
  106. package/dist/camera/scrypted/scrypted-runtime-ingest.js.map +1 -0
  107. package/dist/camera/scrypted/scrypted-storage.d.ts +95 -0
  108. package/dist/camera/scrypted/scrypted-storage.js +698 -0
  109. package/dist/camera/scrypted/scrypted-storage.js.map +1 -0
  110. package/dist/camera/scrypted/scrypted-stream-validator.d.ts +46 -0
  111. package/dist/camera/scrypted/scrypted-stream-validator.js +412 -0
  112. package/dist/camera/scrypted/scrypted-stream-validator.js.map +1 -0
  113. package/dist/camera/scrypted/scrypted-types.d.ts +354 -0
  114. package/dist/camera/scrypted/scrypted-types.js +6 -0
  115. package/dist/camera/scrypted/scrypted-types.js.map +1 -0
  116. package/dist/converters/binary_sensor.converter.d.ts +18 -0
  117. package/dist/converters/binary_sensor.converter.js +21 -0
  118. package/dist/converters/binary_sensor.converter.js.map +1 -0
  119. package/dist/converters/camera.converter.d.ts +18 -0
  120. package/dist/converters/camera.converter.js +24 -0
  121. package/dist/converters/camera.converter.js.map +1 -0
  122. package/dist/converters/climate.converter.d.ts +21 -0
  123. package/dist/converters/climate.converter.js +55 -0
  124. package/dist/converters/climate.converter.js.map +1 -0
  125. package/dist/converters/cover.converter.d.ts +14 -0
  126. package/dist/converters/cover.converter.js +22 -0
  127. package/dist/converters/cover.converter.js.map +1 -0
  128. package/dist/converters/energy_tariff.converter.d.ts +10 -0
  129. package/dist/converters/energy_tariff.converter.js +12 -0
  130. package/dist/converters/energy_tariff.converter.js.map +1 -0
  131. package/dist/converters/fan.converter.d.ts +233 -0
  132. package/dist/converters/fan.converter.js +353 -0
  133. package/dist/converters/fan.converter.js.map +1 -0
  134. package/dist/converters/index.d.ts +14 -0
  135. package/dist/converters/index.js +15 -0
  136. package/dist/converters/index.js.map +1 -0
  137. package/dist/converters/light.converter.d.ts +26 -0
  138. package/dist/converters/light.converter.js +36 -0
  139. package/dist/converters/light.converter.js.map +1 -0
  140. package/dist/converters/lock.converter.d.ts +20 -0
  141. package/dist/converters/lock.converter.js +29 -0
  142. package/dist/converters/lock.converter.js.map +1 -0
  143. package/dist/converters/sensor.converter.d.ts +18 -0
  144. package/dist/converters/sensor.converter.js +33 -0
  145. package/dist/converters/sensor.converter.js.map +1 -0
  146. package/dist/converters/soil_sensor.converter.d.ts +14 -0
  147. package/dist/converters/soil_sensor.converter.js +21 -0
  148. package/dist/converters/soil_sensor.converter.js.map +1 -0
  149. package/dist/converters/vacuum.converter.d.ts +168 -0
  150. package/dist/converters/vacuum.converter.js +288 -0
  151. package/dist/converters/vacuum.converter.js.map +1 -0
  152. package/dist/device-profiles.d.ts +14 -0
  153. package/dist/device-profiles.js +245 -0
  154. package/dist/device-profiles.js.map +1 -0
  155. package/dist/device-registry.d.ts +58 -0
  156. package/dist/device-registry.js +288 -0
  157. package/dist/device-registry.js.map +1 -0
  158. package/dist/entities/base.entity.d.ts +40 -0
  159. package/dist/entities/base.entity.js +826 -0
  160. package/dist/entities/base.entity.js.map +1 -0
  161. package/dist/entities/camera.entity.d.ts +48 -0
  162. package/dist/entities/camera.entity.js +127 -0
  163. package/dist/entities/camera.entity.js.map +1 -0
  164. package/dist/entities/closure.entity.d.ts +9 -0
  165. package/dist/entities/closure.entity.js +52 -0
  166. package/dist/entities/closure.entity.js.map +1 -0
  167. package/dist/entities/composite-device.entity.d.ts +61 -0
  168. package/dist/entities/composite-device.entity.js +986 -0
  169. package/dist/entities/composite-device.entity.js.map +1 -0
  170. package/dist/entities/cooktop.entity.d.ts +20 -0
  171. package/dist/entities/cooktop.entity.js +59 -0
  172. package/dist/entities/cooktop.entity.js.map +1 -0
  173. package/dist/entities/energy_tariff.entity.d.ts +7 -0
  174. package/dist/entities/energy_tariff.entity.js +32 -0
  175. package/dist/entities/energy_tariff.entity.js.map +1 -0
  176. package/dist/entities/humidifier.entity.d.ts +27 -0
  177. package/dist/entities/humidifier.entity.js +187 -0
  178. package/dist/entities/humidifier.entity.js.map +1 -0
  179. package/dist/entities/lock.entity.d.ts +12 -0
  180. package/dist/entities/lock.entity.js +58 -0
  181. package/dist/entities/lock.entity.js.map +1 -0
  182. package/dist/entities/media-player.entity.d.ts +13 -0
  183. package/dist/entities/media-player.entity.js +52 -0
  184. package/dist/entities/media-player.entity.js.map +1 -0
  185. package/dist/entities/oven.entity.d.ts +20 -0
  186. package/dist/entities/oven.entity.js +112 -0
  187. package/dist/entities/oven.entity.js.map +1 -0
  188. package/dist/entities/pet_feeder.entity.d.ts +28 -0
  189. package/dist/entities/pet_feeder.entity.js +67 -0
  190. package/dist/entities/pet_feeder.entity.js.map +1 -0
  191. package/dist/entities/soil_sensor.entity.d.ts +7 -0
  192. package/dist/entities/soil_sensor.entity.js +40 -0
  193. package/dist/entities/soil_sensor.entity.js.map +1 -0
  194. package/dist/entities/vacuum.entity.d.ts +37 -0
  195. package/dist/entities/vacuum.entity.js +352 -0
  196. package/dist/entities/vacuum.entity.js.map +1 -0
  197. package/dist/frontend/assets/index-DPXu3al2.js +26 -0
  198. package/dist/frontend/assets/index-DalMl4eS.css +1 -0
  199. package/dist/frontend/assets/logo-B_gEBugV.png +0 -0
  200. package/dist/frontend/index.html +14 -0
  201. package/dist/frontend/logo.png +0 -0
  202. package/dist/homeAssistant.d.ts +1268 -0
  203. package/dist/homeAssistant.js +1623 -0
  204. package/dist/homeAssistant.js.map +1 -0
  205. package/dist/homekit.compat.d.ts +40 -0
  206. package/dist/homekit.compat.js +43 -0
  207. package/dist/homekit.compat.js.map +1 -0
  208. package/dist/index.d.ts +7 -0
  209. package/dist/index.js +31 -0
  210. package/dist/index.js.map +1 -0
  211. package/dist/mqtt/mqtt-client.d.ts +33 -0
  212. package/dist/mqtt/mqtt-client.js +138 -0
  213. package/dist/mqtt/mqtt-client.js.map +1 -0
  214. package/dist/mqtt/mqtt.entity.d.ts +30 -0
  215. package/dist/mqtt/mqtt.entity.js +286 -0
  216. package/dist/mqtt/mqtt.entity.js.map +1 -0
  217. package/dist/platform.d.ts +318 -0
  218. package/dist/platform.js +6144 -0
  219. package/dist/platform.js.map +1 -0
  220. package/dist/proxy.d.ts +1 -0
  221. package/dist/proxy.js +226 -0
  222. package/dist/proxy.js.map +1 -0
  223. package/dist/utils/ha-discovery.d.ts +30 -0
  224. package/dist/utils/ha-discovery.js +175 -0
  225. package/dist/utils/ha-discovery.js.map +1 -0
  226. package/dist/utils/ha-state.d.ts +48 -0
  227. package/dist/utils/ha-state.js +21 -0
  228. package/dist/utils/ha-state.js.map +1 -0
  229. package/dist/utils/light-color.d.ts +63 -0
  230. package/dist/utils/light-color.js +213 -0
  231. package/dist/utils/light-color.js.map +1 -0
  232. package/dist/utils/log-buffer.d.ts +13 -0
  233. package/dist/utils/log-buffer.js +50 -0
  234. package/dist/utils/log-buffer.js.map +1 -0
  235. package/dist/utils/matter-attributes.d.ts +13 -0
  236. package/dist/utils/matter-attributes.js +35 -0
  237. package/dist/utils/matter-attributes.js.map +1 -0
  238. package/dist/utils/matter-device-identity.d.ts +22 -0
  239. package/dist/utils/matter-device-identity.js +70 -0
  240. package/dist/utils/matter-device-identity.js.map +1 -0
  241. package/dist/utils/thread-credentials.d.ts +22 -0
  242. package/dist/utils/thread-credentials.js +29 -0
  243. package/dist/utils/thread-credentials.js.map +1 -0
  244. package/package.json +80 -0
@@ -0,0 +1,26 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function re(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=re(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ae=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var ce={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),ee=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),ne=Symbol.for(`react.profiler`),re=Symbol.for(`react.consumer`),j=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),ae=Symbol.for(`react.suspense`),oe=Symbol.for(`react.suspense_list`),se=Symbol.for(`react.memo`),ce=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),fe=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function _e(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case ne:return`Profiler`;case te:return`StrictMode`;case ae:return`Suspense`;case oe:return`SuspenseList`;case le:return`Activity`;case fe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ee:return`Portal`;case j:return e.displayName||`Context`;case re:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case se:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case ce:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ve=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function P(e,t){xe++,be[xe]=e.current,e.current=t}var we=Se(null),Te=Se(null),Ee=Se(null),De=Se(null);function Oe(e,t){switch(P(Ee,t),P(Te,e),P(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(we),P(we,e)}function ke(){Ce(we),Ce(Te),Ce(Ee)}function F(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,P(De,e)),t=we.current;var n=dp(t,e.type);t!==n&&(P(Te,e),P(we,n))}function Ae(e){Te.current===e&&(Ce(we),Ce(Te)),De.current===e&&(Ce(De),sh._currentValue=ye)}var je,Me;function I(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+je+e+Me}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?I(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return I(e.type);case 16:return I(`Lazy`);case 13:return e.child!==t&&t!==null?I(`Suspense Fallback`):I(`Suspense`);case 19:return I(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return I(`Activity`);case 30:return I(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function $e(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&gt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function St(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[wt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Gt={},Kt={};function qt(e){return Le.call(Kt,e)?!0:Le.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var L=!1;function Jt(){var e=L;return L=!1,e}function Yt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Xt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Zt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Qt(s):e.removeAttribute(`name`)}function sn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function ln(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function un(e,t,n){if(t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Qt(n)}function dn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ve(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function mn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||pn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function hn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,L=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(mn(e,a,r),L=!0)}else for(var o in t)t.hasOwnProperty(o)&&mn(e,o,t[o])}function gn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var _n=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),vn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function yn(e){return vn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));on(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&nn(r)}break a;case`textarea`:un(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&ln(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(zd(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var kn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),An=!1;if(kn)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){An=!0}}),window.addEventListener(`test`,jn,jn),window.removeEventListener(`test`,jn,jn)}catch{An=!1}var Mn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in Mn?Mn.value:Mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Pn=i.slice(e,1<r?1-r:void 0)}function In(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ln(){return!0}function Rn(){return!1}function zn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Ln:Rn,this.isPropagationStopped=Rn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=zn(Bn),Hn=D({},Bn,{view:0,detail:0}),Un=zn(Hn),Wn,Gn,Kn,qn=D({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ir,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Kn&&(Kn&&e.type===`mousemove`?(Wn=e.screenX-Kn.screenX,Gn=e.screenY-Kn.screenY):Gn=Wn=0,Kn=e),Wn)},movementY:function(e){return`movementY`in e?e.movementY:Gn}}),Jn=zn(qn),Yn=zn(D({},qn,{dataTransfer:0})),Xn=zn(D({},Hn,{relatedTarget:0})),Zn=zn(D({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Qn=zn(D({},Bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),$n=zn(D({},Bn,{data:0})),er={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},tr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},nr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function rr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nr[e])?!!t[e]:!1}function ir(){return rr}var ar=zn(D({},Hn,{key:function(e){if(e.key){var t=er[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=In(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?tr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ir,charCode:function(e){return e.type===`keypress`?In(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?In(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),or=zn(D({},qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),sr=zn(D({},Bn,{submitter:0})),cr=zn(D({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ir})),lr=zn(D({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ur=zn(D({},qn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),dr=zn(D({},Bn,{newState:0,oldState:0,source:0})),fr=[9,13,27,32],pr=kn&&`CompositionEvent`in window,mr=null;kn&&`documentMode`in document&&(mr=document.documentMode);var hr=kn&&`TextEvent`in window&&!mr,gr=kn&&(!pr||mr&&8<mr&&11>=mr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!pr&&yr(e,t)?(e=Fn(),Pn=Nn=Mn=null,xr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return gr&&t.locale!==`ko`?null:t.data;default:return null}}var wr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!wr[e.type]:t===`textarea`}function Er(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Or=null;function kr(e){Vf(e,0)}function Ar(e){if(nn(It(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(kn){var Nr;if(kn){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Dr&&(Dr.detachEvent(`onpropertychange`,Lr),Or=Dr=null)}function Lr(e){if(e.propertyName===`value`&&Ar(Or)){var t=[];Er(t,Or,e,Sn(e)),Dn(kr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Dr=t,Or=n,Dr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(Or)}function Br(e,t){if(e===`click`)return Ar(t)}function Vr(e,t){if(e===`input`||e===`change`)return Ar(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Le.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gr(e.document)}return t}function Xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Zr=kn&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ei&&Wr(ei,r)||(ei=r,r=Jf($r,`onSelect`),0<r.length&&(t=new Vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};kn&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ht(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ci=[],wi=0,Ti=0;function Ei(){for(var e=wi,t=Ti=wi=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ai(n,i,a)}}function Di(e,t,n,r){Ci[wi++]=e,Ci[wi++]=t,Ci[wi++]=n,Ci[wi++]=r,Ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Oi(e,t,n,r){return Di(e,t,n,r),ji(e)}function ki(e,t){return Di(e,null,null,t),ji(e)}function Ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ji(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Mi={};function Ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pi(e,t,n,r){return new Ni(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=Pi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Li(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ri(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Pi(31,n,t,a),e.elementType=le,e.lanes=o,e;case A:return zi(n.children,a,o,t);case te:s=8,a|=24;break;case ne:return e=Pi(12,n,t,a|2),e.elementType=ne,e.lanes=o,e;case ae:return e=Pi(13,n,t,a),e.elementType=ae,e.lanes=o,e;case oe:return e=Pi(19,n,t,a),e.elementType=oe,e.lanes=o,e;case ue:case fe:return e=a|32,e=Pi(30,n,t,e),e.elementType=fe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case j:s=10;break a;case re:s=9;break a;case ie:s=11;break a;case se:s=14;break a;case ce:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Pi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=Pi(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=Pi(6,e,null,t),e.lanes=n,e}function Vi(e){var t=Pi(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=Pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Gi=[],Ki=0,qi=null,Ji=0,Yi=[],Xi=0,Zi=null,Qi=1,$i=``;function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e,Ji=t}function ta(e,t,n){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Zi=e;var r=Qi;e=$i;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Qi=1<<32-et(t)+i|n<<i|r,$i=a+e}else Qi=1<<a|n<<i|r,$i=e}function na(e){e.return!==null&&(ea(e,1),ta(e,1,0))}function ra(e){for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null;for(;e===Zi;)Zi=Yi[--Xi],Yi[Xi]=null,$i=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null}function ia(e,t){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Qi=t.id,$i=t.overflow,Zi=e}var aa=null,R=null,z=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ha(Wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),dn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||la(e,!0)}function da(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:aa=aa.return}}function fa(e){if(e!==aa)return!1;if(!z)return da(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&R&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));R=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));R=dm(e)}else t===27?(t=R,Sp(e.type)?(e=um,um=null,R=e):R=t):R=aa?lm(e.stateNode.nextSibling):null;return!0}function pa(){R=aa=null,z=!1}function ma(){var e=oa;return e!==null&&(pd===null?pd=e:pd.push.apply(pd,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=Se(null),_a=null,va=null;function ya(e,t,n){P(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,Ce(ga)}function xa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Sa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),xa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),xa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),xa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ca(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Ur(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===De.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Pf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ga=M.S;M.S=function(e,t){if(gd=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=bf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=Se(null);function qa(){var e=Ka.current;return e===null?K.pooledCache:e}function Ja(e,t){t===null?P(Ka,Ka.current):P(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=K,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Bi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===A?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ce&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),lo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=zi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ri(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case ee:return t=Hi(t,e.mode,n),t.return=e,t;case ce:return t=no(t),f(e,t,n)}if(ve(t)||he(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===j)return f(e,Da(e,t),n);uo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case ee:return n.key===i?u(e,t,n,r):null;case ce:return n=no(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===j)return p(e,t,Da(e,n),r);uo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ee:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ce:return r=no(r),m(e,t,n,r,i)}if(ve(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===j)return m(e,t,n,Da(t,r),i);uo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&ea(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return z&&ea(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),z&&ea(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&ea(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&ea(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&ea(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=zi(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case ee:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=no(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===j)return _(e,r,Da(e,o),c);uo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function bo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:ho=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),sd|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=Se(null),Oo=Se(0);function ko(e,t){e=ad,P(Oo,e),P(Do,t),ad=e|t.baseLanes}function Ao(){P(Oo,ad),P(Do,Do.current)}function jo(){ad=Oo.current,Ce(Do),Ce(Oo)}var Mo=Se(null),No=null;function Po(e){var t=e.alternate;P(zo,zo.current&1),P(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){P(zo,zo.current),P(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(P(zo,zo.current),P(Mo,e),No===null&&(No=e)):Lo()}function Lo(){P(zo,zo.current),P(Mo,Mo.current)}function Ro(e){Ce(Mo),No===e&&(No=null),Ce(zo)}var zo=Se(0);function Bo(e,t){P(Mo,Mo.current),P(zo,t)}function Vo(e){Ce(zo),Ce(Mo),No===e&&(No=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uo=0,B=null,V=null,Wo=null,Go=!1,Ko=!1,qo=!1,Jo=0,Yo=0,Xo=null,Zo=0;function Qo(){throw Error(i(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?_c:vc,qo=!1,a=n(r,i),qo=!1,Ko&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){M.H=gc;var t=V!==null&&V.next!==null;if(Uo=0,Wo=V=B=null,Go=!1,Yo=0,Xo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&wa(e)&&(Fc=!0))}function ns(e,t,n,r){B=e;var a=0;do{if(Ko&&(Xo=null),Yo=0,Ko=!1,25<=a)throw Error(i(301));if(a+=1,Wo=V=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=yc,o=t(n,r)}while(Ko);return o}function rs(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(V===null?null:V.memoizedState)!==e&&(B.flags|=1024),t}function is(){var e=Jo!==0;return Jo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Uo=0,Wo=V=B=null,Ko=!1,Yo=Jo=0,Xo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?B.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function cs(){if(V===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=V.next;var t=Wo===null?B.memoizedState:Wo.next;if(t!==null)Wo=t,V=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));V=e,e={memoizedState:V.memoizedState,baseState:V.baseState,baseQueue:V.baseQueue,queue:V.queue,next:null},Wo===null?B.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Yo;return Yo+=1,Xo===null&&(Xo=[]),e=to(Xo,e,t),t=B,(Wo===null?t.memoizedState:Wo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===pe)return;if(e.$$typeof===j)return Ea(e)}throw Error(i(438,String(e)))}function fs(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ls(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=de;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),V,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Uo&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ba&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,sd|=p;f=u.action,qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Fc=!0,d&&(n=Va,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ur(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=B,a=cs(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ur((V||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Hs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Wo!==null&&!!(Wo.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,a,n,t),null),e){if(r.flags|=2048,K===null)throw Error(i(349));o||Uo&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=ls(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function Ss(e){var t=ki(e,2);t!==null&&Pd(t,e,2)}function Cs(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),qo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,V,typeof r==`function`?r:ps)}function Ts(e,t,n,r,a){if(pc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(z){var n=K.formState;if(n!==null){a:{var r=B;if(z){if(R){b:{for(var i=R,a=sa;i.nodeType!==8;){if(!a){i=null;break b}if(i=lm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){R=lm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,B,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,B,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),V,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=V;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=ls(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=ss();B.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;V!==null&&r!==null&&$o(r,V.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(B.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=ls(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(G&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Uo&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),B.lanes|=e,sd|=e,n)}function $s(e,t,n,r){return Ur(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(J&261930)?(Fc=!0,e.memoizedState=n):(e=Md(),B.lanes|=e,sd|=e,t):(e=Qs(e,n,r),Ur(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,fc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Wa(c,r),jd(e)):dc(e,t,r,jd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,ye,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},jd())}function ac(){return Ea(sh)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=vo(n);var r=yo(t,e,n);r!==null&&(Pd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Oi(e,t,n,r),n!==null&&(Pd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,jd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ur(s,o))return Di(e,t,i,0),K===null&&Ei(),!1}catch{}if(n=Oi(e,t,i,r),n!==null)return Pd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Oi(e,n,r,2),t!==null&&Pd(t,e,2)}function pc(e){var t=e.alternate;return e===B||t!==null&&t===B}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var gc={readContext:Ea,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Ea,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,B,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=ss();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=K.identifierPrefix;if(z){var n=$i,r=Qi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Zo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return ss().memoizedState=cc.bind(null,B)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Ea,use:ds,useCallback:Xs,useContext:Ea,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),V.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),V,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Ea,use:ds,useCallback:Xs,useContext:Ea,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return V===null?Qs(n,e,t):$s(n,V.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return V===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,V,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Pd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Pd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Pd(t,e,n),bo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Wr(n,r)||!Wr(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){Si(e)}function Ec(e){console.error(e)}function Dc(e){Si(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=vo(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(yd===null?yd=new Set([this]):yd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?Kd():n.alternate===null&&od===0&&(od=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Kd(),!1}if(z)return t=Mo.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ha(Wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Wi(r,n),a=Ac(e.stateNode,r,a),xo(e,a),od!==4&&(od=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ha(Wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Wi(o,n),fd===null?fd=[o]:fd.push(o),od!==4&&(od=2),t===null)return!0;r=Wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),xo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(yd===null||!yd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(z&&s&&na(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return po(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Fo(t),(e=R)?(e=am(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,R=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(Do.current===null){if(r=K,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ki(e,s),Pd(r,e,s),Pc;Kd()}t=Wc(e,t,n)}else e=o.treeContext,R=lm(s.nextSibling),aa=t,z=!0,oa=null,sa=!1,e!==null&&ia(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Ta(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(z&&r&&na(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Fc?(as(e,t,a),dl(e,t,a)):(z&&r&&na(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=Mi,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):Mi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Mi,typeof u==`object`&&u&&(o=Ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=ho||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,_o(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Mi,typeof l==`object`&&l&&(c=Ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=ho||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=po(t,e.child,null,i),t.child=po(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return pa(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Ya()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ud),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?Po(t):Lo(),(e=R)?(e=am(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,R=null)):e=null,e===null)throw la(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=zi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(Po(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Pi(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return po(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=zi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ha({value:a,source:null,stack:null})),rl(e,t,c)}if(Fc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Do.current!==null)return rl(e,t,c);if(r=K,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ki(e,a),Pd(r,e,a),Pc;return om(o)||Kd(),rl(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,R=lm(o.nextSibling),aa=t,z=!0,oa=null,sa=!1,e!==null&&ia(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=z?Ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function pl(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:F(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Po(t),e=dl(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,z&&t.flags&1048576&&ta(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Fi(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===se){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===j){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=_e(e)||e,Error(i(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),Co(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==a){a=Wi(Error(i(424)),t),ha(a),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(R=lm(e.firstChild),aa=t,z=!0,oa=null,sa=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=fp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return F(t),e===null&&z&&(r=t.stateNode=hm(t.type,t.pendingProps,Ee.current),aa=t,sa=!0,a=R,Sp(t.type)?(um=a,R=lm(r.firstChild)):R=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=R)&&(r=rm(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,aa=t,R=lm(r.firstChild),sa=!1,a=!0)),a||la(t)),F(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=es(e,t,rs,null,null,n),sh._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=R)&&(n=im(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,aa=t,R=null,e=!0)),e||la(t)),null;case 13:return el(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=K,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:z&&na(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw ro=$a,Za}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,dd|=t)}function yl(e,t){if(!z)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function H(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ra(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return H(t),null;case 1:return H(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),H(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(H(t),gl(t,a,null,r,n)):(H(t),_l(t,o))):o?o===e.memoizedState?(H(t),t.flags&=-16777217):(hl(t),H(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),H(t),gl(t,a,e,r,n)),null;case 27:if(Ae(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return H(t),t.subtreeFlags&=-33554433,null}e=we.current,fa(t)?ua(t,e):(e=hm(a,r,n),t.stateNode=e,hl(t))}return H(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return H(t),t.subtreeFlags&=-33554433,null}if(o=we.current,fa(t))ua(t,o);else{var s=lp(Ee.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return H(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=aa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),H(t),null);case 4:return ke(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,H(t),null;case 10:return ba(t.type),H(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return H(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Li(n,e),n=n.sibling;return Bo(t,zo.current&1|2),z&&ea(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>_d&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return H(t),null}else 2*He()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Bo(t,o):(n=o,P(Mo,t),P(zo,n),No===null&&(No=t)),z&&ea(t,r.treeForkCount),e}return H(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ce(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),H(t),null;case 25:return null;case 30:return t.flags|=33554432,H(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&Ce(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(ra(t),t.tag){case 3:ba(Ma),ke();break;case 26:case 27:case 5:Ae(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&Ce(Ka);break;case 24:ba(Ma)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){Z(e,e.return,t)}}}function El(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&em(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&tm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Tt]=t}catch(t){Z(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bn)),kl(e,r),L=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),L=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[wt]=e,t[Tt]=n}catch(t){Z(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Vl=!0,Tp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=xi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Nd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=xi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Nd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,U=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,sp=gh,e=Yr(e),Xr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&eu(e),gu(n))}}Hl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=yi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=xi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&Cl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Iu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Eo(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&Tu(e,n);break;case 13:Iu(e,n),r&4&&Eu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||U;t=ou,i=U,ou=r,(U=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),ou=t,U=i}break;case 30:Iu(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Iu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,L=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var W=null,Su=!1;function Cu(e,t,n){for(n=n.child;n!==null;)wu(e,t,n),n=n.sibling}function wu(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:U||Ol(n,t),Cu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!U&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:U||Ol(n,t),jl(n);var r=W,i=Su;Sp(n.type)&&(W=n.stateNode,Su=!1),Cu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),W=r,Su=i;break;case 5:U||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=W,i=Su,W=null,Cu(e,t,n),W=r,Su=i,W!==null){if(Su)try{(W.nodeType===9?W.body:W.nodeName===`HTML`?W.ownerDocument.body:W).removeChild(n.stateNode),L=!0}catch(e){Z(n,t,e)}else try{W.removeChild(n.stateNode),L=!0}catch(e){Z(n,t,e)}}break;case 18:W!==null&&(Su?(e=W,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(W,n.stateNode));break;case 4:r=W,i=Su,W=n.stateNode.containerInfo,Su=!0,Cu(e,t,n),W=r,Su=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),U||wl(4,n,t),Cu(e,t,n);break;case 1:U||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Cu(e,t,n);break;case 21:Cu(e,t,n);break;case 22:U=(r=U)||n.memoizedState!==null,Cu(e,t,n),U=r;break;case 30:Ol(n,t),Cu(e,t,n);break;case 7:U||Ol(n,t),Cu(e,t,n);break;default:Cu(e,t,n)}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function ku(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){W=l.stateNode,Su=!1;break a}break;case 5:W=l.stateNode,Su=!1;break a;case 3:case 4:W=l.stateNode.containerInfo,Su=!0;break a}l=l.return}if(W===null)throw Error(i(160));wu(s,c,o),W=null,Su=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ku(t,e,n),Mu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),a&512&&(U||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Au,ku(t,e,n),Mu(e),a&512&&(U||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ou||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||U||t.parentNode.removeChild(t)):a.count--,n===null?ou||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),a&512&&(U||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,ku(t,e,n),su=o,Mu(e),a&512&&(U||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{fn(t,``),L=!0}catch(t){Z(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(ku(t,e,n),Mu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,L=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(L=!1,Wm=null,o=Au,Au=bm(t.containerInfo),ku(t,e,n),Au=o,Mu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}cu&&(cu=!1,Nu(e)),L=!1;break;case 4:a=su,su=ou,r=Jt(),o=Au,Au=bm(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,L&&fu&&(pu=!0),L=r,su=a;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hd=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=U,u=su;ou=c||o,su=u||o,U=l||s,ku(t,e,n),U=l,su=u,ou=c,Mu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||U||(t=s||U,n=ou,r=U,ou=o||ou,U=t,Lu(e,2),ou=n,U=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:a&512&&(U||r===null||Ol(r,r.return)),a=Jt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&xi(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&L&&(e.flags|=4),fu=o,L=a;break;case 21:break;case 7:a&512&&(U||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(fn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else au(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Gl(),Pu(t,e),!du&&!pu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Wl=null;break;case 5:Pu(t,e);break;case 4:r=du,du=!1,Pu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Zl(e,!1));break;case 30:r=du,i=Gl(),du=!1,Pu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),du=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Lu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),Lu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Lu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||U||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:Ol(n,n.return),Lu(n,r);break;case 7:Ol(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ru(i,a,n),Cl(4,a);break;case 1:if(Ru(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)To(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Ru(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Km(bm(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&Tu(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),Dl(a,a.return);break;case 30:Ru(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Pa(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Pa(a)));break;case 12:if(a&2048){Vu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Uu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Au;Au=bm(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var $u={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,G=0,K=null,q=null,J=0,Y=0,td=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=null,pd=null,md=!1,hd=0,gd=0,_d=1/0,vd=null,yd=null,X=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return G&2&&J!==0?J&-J:M.T===null?xt():Pf()}function Md(){if(ud===0){if(!(J&536870912)||z){var e=at;at<<=1,!(at&3932160)&&(at=262144),ud=e}else ud=536870912}return e=Mo.current,e!==null&&(e.flags|=32),ud}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(yi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===K&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,J,ud,!1)),mt(e,n),(!(G&2)||e!==K)&&(e===K&&(!(G&2)&&(cd|=n),od===4&&Rd(e,J,ud,!1)),Ef(e))}function Fd(e,t,n){if(G&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){rd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n)){a=qd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=fd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=o,cd|=o,a=4;break a}o=pd,pd=a,o!==null&&(pd===null?pd=o:pd.push.apply(pd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ud,!nd);break a;case 2:pd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=hd+300-He(),10<a)){if(Rd(r,t,ud,!nd),ct(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,pd,vd,md,t,ud,cd,dd,nd,o,`Throttled`,-0,0),a);break a}Id(r,n,pd,vd,md,t,ud,cd,dd,nd,o,null,-0,0)}break}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Hl=null,qu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?hd-He():(a&4194048)===a?gd-He():0,m=eh(d,m),m!==null)){Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l);return}nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ur(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=ut(e,t),t&=~ld,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&gt(e,n,t)}function zd(){return G&6?!0:(Df(0,!1),!1)}function Bd(){if(q!==null){if(Y===0)var e=q.return;else e=q,va=_a=null,os(e),oo=null,so=0,e=q;for(;e!==null;)Sl(e.alternate,e),e=e.return;q=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),K=e,q=n=Ii(e.current,null),J=t,Y=0,td=null,nd=!1,rd=lt(e,t),id=!1,dd=ud=ld=cd=sd=od=0,pd=fd=null,md=!1,ad=ut(e,t),Ei(),n}function Hd(e,t){B=null,M.H=gc,t===Xa||t===Qa?(t=io(),Y=3):t===Za?(t=io(),Y=4):Y=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,q===null&&(od=1,Oc(e,Wi(t,e.current)))}function Ud(){var e=Mo.current;return e===null?!0:(J&4194048)===J?No===null:(J&62914560)===J||J&536870912?e===No:!1}function Wd(){var e=M.H;return M.H=gc,e===null?gc:e}function Gd(){var e=M.A;return M.A=$u,e}function Kd(){od=4,nd||(J&4194048)!==J&&Mo.current!==null||(rd=!0),!(sd&134217727)&&!(cd&134217727)||K===null||Rd(K,J,ud,!1)}function qd(e,t,n){var r=G;G|=2;var i=Wd(),a=Gd();(K!==e||J!==t)&&(vd=null,Vd(e,t)),t=!1;var o=od;a:do try{if(Y!==0&&q!==null){var s=q,c=td;switch(Y){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=Y;if(Y=0,td=null,$d(e,s,c,l),n&&rd){o=0;break a}break;default:l=Y,Y=0,td=null,$d(e,s,c,l)}}Jd(),o=od;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,G=r,M.H=i,M.A=a,q===null&&(K=null,J=0,Ei()),o}function Jd(){for(;q!==null;)Zd(q)}function Yd(e,t){var n=G;G|=2;var r=Wd(),a=Gd();K!==e||J!==t?(vd=null,_d=He()+500,Vd(e,t)):rd=lt(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=td;b:switch(Y){case 1:Y=0,td=null,$d(e,t,o,1);break;case 2:case 9:if(eo(o)){Y=0,td=null,Qd(t);break}t=function(){Y!==2&&Y!==9||K!==e||(Y=7),Ef(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:eo(o)?(Y=0,td=null,Qd(t)):(Y=0,td=null,$d(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Ym(s):c.stateNode.complete){Y=0,td=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,ef(u))}break b}}Y=0,td=null,$d(e,t,o,5);break;case 6:Y=0,td=null,$d(e,t,o,6);break;case 8:Bd(),od=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return va=_a=null,M.H=r,M.A=a,G=n,q===null?(K=null,J=0,Ei(),od):0}function Xd(){for(;q!==null&&!Be();)Zd(q)}function Zd(e){var t=ml(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:os(t);var r=t;r===aa&&(z?(da(r),r.tag===5&&r.stateNode!=null&&(R=r.stateNode)):(da(r),z=!0));default:Sl(n,t),t=q=Li(t,ad),t=ml(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function $d(e,t,n,r){va=_a=null,os(t),oo=null,so=0;var i=t.return;try{if(Nc(e,i,t,n,J)){od=1,Oc(e,Wi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;od=1,Oc(e,Wi(n,e.current)),q=null;return}t.flags&32768?(z||r===1?e=!0:rd||J&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,nd);return}e=t.return;var n=bl(t.alternate,t,ad);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);od===0&&(od=5)}function tf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);od=6,q=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(X!==0);if(G&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===K&&(q=K=null,J=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=Ti,ht(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=La(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ke,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=G,G|=4;try{hu(e,t,n)}finally{G=a,N.p=i,M.T=r}}X=1,Vl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(X!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){X===3&&(X=0,Fu(xd,bd),X=4)}function sf(){if(X===1){X=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=G;G|=4;try{fu=pu=!1,ju(t,e,n),n=cp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=qr(s,h),v=qr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{G=a,N.p=i,M.T=r}}e.current=t,X=2}}function cf(){if(X===2){X=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=G;G|=4;try{_u(e,t.alternate,t)}finally{G=i,N.p=r,M.T=n}}X=3}}function lf(){if(X===4||X===3){X=0;var e=Ed;Ed=null,Ve();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?X=5:(X=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(yd=null),bt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{M.T=n,N.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(X!==5)return!1;var e=bd,t=Cd;Cd=0;var n=bt(Sd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=wd,wd=null;var o=bd,s=Sd;if(X=0,xd=bd=null,Sd=0,G&6)throw Error(i(331));var c=G;if(G|=4,Xu(o.current),Hu(o,o.current,s,n),G=c,Df(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{N.p=a,M.T=r,uf(e,t)}}function pf(e,t,n){t=Wi(n,t),t=Ac(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(mt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Wi(n,e),n=jc(2),r=yo(t,n,2),r!==null&&(Mc(n,r,t,e),mt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(id=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(od===4||od===3&&(J&62914560)===J&&300>He()-hd?G&2?ld|=n:Vd(e,0):ld|=n,dd===J&&(dd=0)),Ef(e)}function gf(e,t){t===0&&(t=ft()),e=ki(e,t),e!==null&&(mt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Re(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=J,a=ct(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=He(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}X!==0&&X!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=K,n=J,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),bt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=jf.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(X!==0&&X!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=J;return r=ct(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,He()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){G&6?Re(We,Of):kf()})}function Pf(){if(Tf===0){var e=Ba;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:yn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<gi.length;Lf++){var Rf=gi[Lf];_i(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!An||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Dn(function(){var r=a,i=Sn(n),s=[];a:{var c=hi.get(e);if(c!==void 0){var l=Vn,u=e;switch(e){case`keypress`:if(In(n)===0)break a;case`keydown`:case`keyup`:l=ar;break;case`focusin`:u=`focus`,l=Xn;break;case`focusout`:u=`blur`,l=Xn;break;case`beforeblur`:case`afterblur`:l=Xn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=cr;break;case ci:case li:case ui:l=Zn;break;case mi:l=lr;break;case`scroll`:case`scrollend`:l=Un;break;case`wheel`:l=ur;break;case`copy`:case`cut`:case`paste`:l=Qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=or;break;case`submit`:l=sr;break;case`toggle`:case`beforetoggle`:l=dr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=On(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==xn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=or,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=jr;else if(Tr(c)){if(Mr)_=Vr;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&gn(r.elementType)&&(_=jr):_=Br;if(_&&=_(e,r)){Er(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Tr(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(s,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(s,n,i)}var y;if(pr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else xr?yr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(gr&&n.locale!==`ko`&&(xr||b!==`onCompositionStart`?b===`onCompositionEnd`&&xr&&(y=Fn()):(Mn=i,Nn=`value`in Mn?Mn.value:Mn.textContent,xr=!0)),v=Jf(r,b),0<v.length&&(b=new $n(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=br(n),y!==null&&(b.data=y)))),(y=hr?Sr(e,n):Cr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new $n(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=On(e,n),i!=null&&r.unshift(qf(e,i,a)),i=On(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=On(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=On(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
9
+ `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&fn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:hn(e,r,o);return;case`data`:if(t!==`object`){Xt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=yn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=_n.get(n)||n,Yt(e,n,r);else return}L=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:hn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)fn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}L=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}L=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&ln(e,!!r,n,!0):ln(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}dn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(gn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(L=!0),o=m;break;case`name`:m!==f&&(L=!0),a=m;break;case`checked`:m!==f&&(L=!0),u=m;break;case`defaultChecked`:m!==f&&(L=!0),d=m;break;case`value`:m!==f&&(L=!0),s=m;break;case`defaultValue`:m!==f&&(L=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}on(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(L=!0),p=o;break;case`defaultValue`:o!==l&&(L=!0),c=o;break;case`multiple`:o!==l&&(L=!0),s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?ln(e,!!n,n?[]:``,!1):ln(e,!!n,t,!0)):ln(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(L=!0),p=a;break;case`defaultValue`:a!==o&&(L=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}un(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(L=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(gn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[wt]=r,n[Tt]=t,np(n,e,t),Rt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Nt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=N.d;N.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Lt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Rt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Lt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Rt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Lt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Rt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Ee.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+an(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),np(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+an(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Rt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:j,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function uh(e){return e?(e=Mi,e):Mi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Pd(n,e,t),bo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=ki(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=yt(t);var n=ki(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,yh(e,t,n,r)}finally{N.p=a,M.T=i}}function vh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,yh(e,t,n,r)}finally{N.p=a,M.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(G&6)&&(_d=He()+500,Df(0,!1))}}break;case 31:case 13:s=ki(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=Sn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Ft(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Et]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ze=Jh.inject(qh),Qe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Et]=t.current,Wf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=`./api/custom`;async function b(e,t={}){let n=`${y}${e.startsWith(`/`)?e:`/${e}`}`,r=await fetch(n,{...t,headers:{"Content-Type":`application/json`,...t.headers||{}}});if(!r.ok){let e=`Error ${r.status}: ${r.statusText}`;try{let t=await r.json();(t?.error||t?.message)&&(e=t.error||t.message)}catch{}throw Error(e)}return r.json()}var x={getStatus:()=>b(`/status`),getDevices:()=>b(`/devices`),getCameras:()=>b(`/cameras`),getScryptedConfig:()=>b(`/scrypted/config`),saveScryptedConfig:e=>b(`/scrypted/config`,{method:`POST`,body:JSON.stringify(e)}),deleteScryptedConfig:()=>b(`/scrypted/config`,{method:`DELETE`}),testScryptedConnection:e=>b(`/scrypted/connection-test`,{method:`POST`,body:JSON.stringify(e)}),syncCameras:()=>b(`/scrypted/load-cameras`,{method:`POST`}),getCameraUiConfig:()=>b(`/cameraui/config`),saveCameraUiConfig:e=>b(`/cameraui/config`,{method:`POST`,body:JSON.stringify(e)}),testCameraUiConnection:e=>b(`/cameraui/test-connection`,{method:`POST`,body:JSON.stringify(e)}),syncCameraUiCameras:e=>b(`/cameraui/sync`,e?{method:`POST`,body:JSON.stringify(e)}:{method:`POST`}),getCameraUiCameras:()=>b(`/cameraui/cameras`),toggleCameraUiHomeKit:e=>b(`/cameraui/cameras/${encodeURIComponent(e)}/toggle-homekit`,{method:`POST`}),resetCameraUiPairing:e=>b(`/cameraui/cameras/${encodeURIComponent(e)}/reset-pairing`,{method:`POST`}),verifyCameraStream:(e,t,n)=>b(`/cameras/${encodeURIComponent(e)}/verify-stream`,{method:`POST`,body:JSON.stringify({streamUrl:t,transport:n})}),diagnoseCameraStream:(e,t,n)=>b(`/cameras/${encodeURIComponent(e)}/diagnose-stream`,{method:`POST`,body:JSON.stringify({streamUrl:t,transport:n,timeoutMs:8e3})}),getCameraSnapshotUrl:e=>`${y}/cameras/${encodeURIComponent(e)}/snapshot?t=${Date.now()}`,updateCameraIdentity:(e,t)=>b(`/cameras/${encodeURIComponent(e)}/identity-override`,{method:`PUT`,body:JSON.stringify(t)}),saveCameraStreamUrl:(e,t)=>b(`/cameras/${encodeURIComponent(e)}/stream-url`,{method:`POST`,body:JSON.stringify({streamUrl:t})}),saveCameraExportConfig:(e,t)=>b(`/cameras/${encodeURIComponent(e)}/export-config`,{method:`PUT`,body:JSON.stringify(t)}),resetCameraPairing:e=>b(`/reset-camera-pairing/${encodeURIComponent(e)}`,{method:`POST`}),controlCameraEntity:(e,t)=>b(`/cameras/control-entity`,{method:`POST`,body:JSON.stringify({entityId:e,action:t})}),getCameraAiConfig:e=>b(`/cameras/ai-config?cameraId=${encodeURIComponent(e)}`),saveCameraAiConfig:(e,t)=>b(`/cameras/ai-config`,{method:`POST`,body:JSON.stringify({cameraId:e,config:t})}),removeCamera:e=>b(`/cameras/${encodeURIComponent(e)}`,{method:`DELETE`}),toggleExport:(e,t)=>b(`/${t?`register`:`unregister`}/${encodeURIComponent(e)}`,{method:`POST`}),setDeviceProfile:(e,t)=>b(`/device-profile/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({profileId:t,profile:t})}),reconnectAccessory:e=>b(`/refresh-accessory/${encodeURIComponent(e)}`,{method:`POST`}),removeFabric:(e,t)=>b(`/remove-fabric/${encodeURIComponent(e)}/${t}`,{method:`DELETE`}),openCommissioning:e=>b(`/open-commissioning/${encodeURIComponent(e)}`,{method:`POST`}),resetAccessory:e=>b(`/reset-accessory/${encodeURIComponent(e)}`,{method:`POST`}),getMqttConfig:()=>b(`/mqtt-config`),saveMqttConfig:e=>b(`/mqtt-config`,{method:`POST`,body:JSON.stringify(e)}),restartService:()=>b(`/restart`,{method:`POST`}),factoryReset:()=>b(`/factoryreset`,{method:`POST`}),getLogs:()=>b(`/logs`),clearLogs:()=>b(`/logs/clear`,{method:`POST`})};function S(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(!0),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`all`),[y,b]=(0,_.useState)(null),S=(0,_.useCallback)((e,t=!1)=>{b({text:e,isError:t}),setTimeout(()=>{b(t=>t?.text===e?null:t)},4e3)},[]),C=(0,_.useCallback)(async()=>{try{let[e,n,i,o,c,u]=await Promise.allSettled([x.getStatus(),x.getDevices(),x.getCameras(),x.getScryptedConfig(),x.getCameraUiConfig(),x.getCameraUiCameras()]);if(e.status===`fulfilled`&&t(e.value),n.status===`fulfilled`){let e=n.value,t=Array.isArray(e)?e:e?.entities||[];r(t)}if(i.status===`fulfilled`){let e=i.value,t=Array.isArray(e)?e:e?.cameras||[];a(t)}if(u.status===`fulfilled`){let e=u.value;s(Array.isArray(e)?e:[])}o.status===`fulfilled`&&l(o.value),c.status===`fulfilled`&&d(c.value)}catch(e){console.error(`Error refreshing addon state:`,e)}finally{p(!1)}},[]);(0,_.useEffect)(()=>{C();let e=setInterval(C,1e4);return()=>clearInterval(e)},[C]),(0,_.useEffect)(()=>{let e=null,t=null,n=()=>{try{e=new EventSource(`./api/custom/events`),e.onmessage=e=>{if(e.data&&!e.data.startsWith(`:`))try{let t=JSON.parse(e.data);(t.type===`device_update`||t.type===`camera_update`||t.type===`state_change`||t.type===`scrypted_status`||t.type===`camera_pairing_updated`||t.type===`cameraui_updated`||t.type===`cameraui_motion`||t.type===`camera_ai_detection`||t.type===`entity_state_changed`)&&C()}catch{}},e.onerror=()=>{e?.close(),t=setTimeout(n,5e3)}}catch{t=setTimeout(n,5e3)}};return n(),()=>{t&&clearTimeout(t),e?.close()}},[C]);let w=(0,_.useMemo)(()=>{let e=new Map;for(let t of n){let n=t.compositeDeviceId?`matter:${t.compositeDeviceId}`:t.device_id||`entity:${t.entityId}`;e.has(n)||e.set(n,{id:n,name:t.device_name||t.name||t.area_name||t.domain,area:t.area_name||``,manufacturer:t.manufacturer||``,model:t.model||``,entities:[]}),e.get(n).entities.push(t)}return[...e.values()].sort((e,t)=>e.name.localeCompare(t.name))},[n]),T=c?.connectionStatus===`connected`||e?.scrypted?.connected===!0,E=(0,_.useMemo)(()=>T?new Set(i.map(e=>(e.name||``).toLowerCase().trim())):new Set,[i,T]),D=(0,_.useMemo)(()=>T?new Set(i.map(e=>String(e.cameraId).toLowerCase().trim())):new Set,[i,T]),O=(0,_.useMemo)(()=>w.filter(e=>e.entities.some(t=>t.domain===`camera`&&!t.auxiliary&&!t.entityId.includes(`map`)&&!t.entityId.includes(`radar`)&&!t.entityId.includes(`screen`)&&!E.has((e.name||``).toLowerCase().trim())&&!D.has((e.id||``).toLowerCase().trim()))),[w,E,D]);return{status:e,entities:n,cameras:i,cameraUiCameras:o,allDevices:w,realHaCameraDevices:O,scryptedConfig:c,cameraUiConfig:u,loading:f,searchQuery:m,setSearchQuery:h,activeFilter:g,setActiveFilter:v,stats:(0,_.useMemo)(()=>{let e=e=>e.compositeDeviceId||e.entityId,t=new Set(n.filter(e=>e.exported).map(e)).size,r=new Set(n.filter(e=>e.exported&&e.commissioned).map(e)).size,a=new Set(n.filter(e=>e.exported&&!e.commissioned).map(e)).size,s=n.filter(e=>e.exported).length,c=n.filter(e=>e.exported&&e.commissioned).length,l=w.filter(e=>e.entities.some(e=>e.origin===`mqtt`||e.entityId.startsWith(`mqtt.`))).length,u=new Set(O.map(e=>e.id)),d=i.length,f=O.length,p=o.length,m=d+f+p,h=w.filter(e=>!u.has(e.id)).length,g=i.filter(e=>e.identity?.homeKitPairingState===`paired`||e.bindingState?.matterCommissioned===!0).length,_=O.filter(e=>e.entities.some(e=>e.exported&&e.commissioned)).length,v=o.filter(e=>e.isPaired).length,y=r+g+v,b=i.filter(e=>!!e.identity?.matterPairingCode&&e.identity?.homeKitPairingState!==`paired`&&e.bindingState?.matterCommissioned!==!0).length,x=o.filter(e=>e.homeKitEnabled&&!e.isPaired).length,S=a+b+x,C=w.filter(e=>!e.entities.some(e=>e.exported||e.commissioned)).length,T=i.filter(e=>e.identity?.homeKitPairingState!==`paired`&&e.bindingState?.matterCommissioned!==!0&&!e.identity?.matterPairingCode).length,E=o.filter(e=>!e.homeKitEnabled).length,D=C+T+E,k=w.filter(e=>e.entities.some(e=>e.exported?e.hasIssue||e.state===`unavailable`||e.state===`unknown`||e.state===`offline`:!1)).length,ee=i.filter(e=>e.identity?.homeKitPairingState===`paired`||e.bindingState?.matterCommissioned===!0||e.identity?.matterPairingCode?e.status?.connection===`offline`||e.status?.isOnline===!1||!!e.status?.lastError||e.hasIssue===!0:!1).length,A=o.filter(e=>e.homeKitEnabled!==!1&&e.status===`offline`).length,te=k+ee+A;return{totalDevices:h+m,rawDevicesCount:w.length,iotDevices:h,exportedNodes:t,pairedNodes:r,pendingNodes:a,exportedEntities:s,pairedEntities:c,pairedTotal:y,unpairedTotal:S,unactivatedTotal:D,issues:te,mqttCount:l,scryptedTotal:d,scryptedPaired:g,camerauiTotal:p,camerauiPaired:v,haCamsTotal:f,haCamsPaired:_,totalCameras:m}},[n,w,i,O,o]),toastMessage:y,showToast:S,refreshAll:C}}var C=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),w=o(((e,t)=>{t.exports=C()}))(),T=({status:e,onOpenSettings:t,onRestartService:n})=>{let r=e?.haStatus===`conectado`;return(0,w.jsxs)(`header`,{className:`topbar`,role:`banner`,"aria-label":`Barra superior de servicio`,children:[(0,w.jsxs)(`div`,{className:`topbar-left`,children:[(0,w.jsxs)(`div`,{className:`topbar-brand`,children:[(0,w.jsx)(`img`,{className:`topbar-logo`,src:`logo.png`,alt:`Logo`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{className:`topbar-brand-info`,children:[(0,w.jsx)(`p`,{className:`eyebrow`,children:`MATTER 1.6 BRIDGE`}),(0,w.jsx)(`h1`,{children:`Matter All In One Chrisalvir`})]})]}),(0,w.jsxs)(`div`,{className:`topbar-status-badge`,"aria-live":`polite`,children:[(0,w.jsx)(`span`,{className:`status-orb ${r?`online`:`offline`}`,id:`bridge-orb`}),(0,w.jsx)(`div`,{className:`topbar-status-desc`,children:(0,w.jsx)(`strong`,{id:`bridge-title`,children:e?r?`Conectado a Home Assistant`:`Desconectado`:`Iniciando…`})}),e?.version&&(0,w.jsxs)(`span`,{className:`version-pill`,id:`version`,children:[`v`,e.version]})]})]}),(0,w.jsxs)(`div`,{className:`topbar-actions`,children:[(0,w.jsxs)(`button`,{className:`button button-secondary button-topbar`,id:`settings-button`,type:`button`,onClick:t,children:[(0,w.jsx)(`span`,{className:`btn-icon`,"aria-hidden":`true`,children:`⚙`}),`Ajustes del servicio`]}),(0,w.jsxs)(`button`,{className:`button button-secondary button-restart-quick button-topbar`,id:`quick-restart-button`,type:`button`,onClick:n,children:[(0,w.jsx)(`span`,{className:`btn-icon`,"aria-hidden":`true`,children:`↻`}),`Reiniciar Servicio`]})]})]})},E=({stats:e,activeFilter:t,onFilterChange:n,loading:r,onRefresh:i,filteredCount:a})=>{let o=[{id:`all`,icon:`🌐`,label:`TODOS`,count:e.totalDevices,subtext:`${e.iotDevices} IoT + ${e.totalCameras} Cams`,variant:`default`},{id:`iot`,icon:`⚡`,label:`DISPOSITIVOS IOT`,count:e.iotDevices,subtext:`Luces, switches, clima`,variant:`cyan`},{id:`cameras`,icon:`📹`,label:`CÁMARAS HAP & MATTER`,count:e.totalCameras,subtext:`${e.scryptedTotal} Scrypted · ${e.haCamsTotal} HA`,variant:`default`},{id:`paired`,icon:`🍏`,label:`EMPAREJADOS`,count:e.pairedTotal,subtext:`${e.pairedNodes} Matter · ${e.scryptedPaired} HAP`,variant:`success`},{id:`unpaired`,icon:`⏳`,label:`MATTER ACTIVO SIN EMPAREJAR`,count:e.unpairedTotal,subtext:`Código QR listo para enlazar`,variant:`default`},{id:`unactivated`,icon:`⚪`,label:`NO ACTIVADOS`,count:e.unactivatedTotal,subtext:`Dispositivos inactivos`,variant:`default`},{id:`mqtt`,icon:`📡`,label:`DISPOSITIVOS MQTT`,count:e.mqttCount,subtext:`Auto-Discovery`,variant:`default`},{id:`issues`,icon:`⚠️`,label:`NECESITA ATENCIÓN`,count:e.issues,subtext:e.issues>0?`${e.issues} con incidencias`:`Red saludable`,variant:e.issues>0?`warning`:`default`}];return(0,w.jsxs)(`section`,{className:`liquid-control-center`,"aria-label":`Centro de Control de Dispositivos`,children:[(0,w.jsxs)(`div`,{className:`control-center-header`,children:[(0,w.jsxs)(`div`,{className:`control-center-title-group`,children:[(0,w.jsx)(`span`,{className:`control-center-sparkle`,"aria-hidden":`true`,children:`✦`}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`control-center-badge-row`,children:[(0,w.jsx)(`span`,{className:`control-center-label`,children:`CENTRO DE CONTROL MATTER & HAP`}),(0,w.jsx)(`span`,{className:`control-center-status-pill`,children:e.issues>0?(0,w.jsxs)(`span`,{className:`pill-warning`,children:[`⚠️ `,e.issues,` requieren atención`]}):(0,w.jsx)(`span`,{className:`pill-healthy`,children:`✓ Red 100% operativa`})})]}),(0,w.jsx)(`strong`,{className:`control-center-summary-text`,children:r?`Sincronizando dispositivos y accesorios…`:`${e.exportedNodes} accesorios activos en Matter · ${e.pairedTotal} emparejados en el hogar`})]})]}),(0,w.jsxs)(`div`,{className:`control-center-actions`,children:[typeof a==`number`&&(0,w.jsxs)(`span`,{className:`filtered-counter-tag`,children:[`Mostrando: `,(0,w.jsx)(`strong`,{children:a})]}),(0,w.jsxs)(`button`,{className:`refresh-glass-button`,id:`refresh-button`,type:`button`,onClick:i,title:`Recargar estados en tiempo real`,disabled:r,children:[(0,w.jsx)(`span`,{className:r?`spin`:``,children:`↻`}),` Actualizar`]})]})]}),(0,w.jsx)(`div`,{className:`control-center-grid`,role:`tablist`,"aria-label":`Filtros de accesorios`,children:o.map(e=>{let i=t===e.id,a=e.variant===`warning`||e.id===`issues`&&e.count>0,o=e.variant===`success`||e.id===`paired`&&e.count>0;return(0,w.jsxs)(`button`,{role:`tab`,"aria-selected":i,id:`tab-${e.id}`,className:`glass-card-tab ${i?`active`:``} ${a?`card-warning`:``} ${o?`card-success`:``}`,onClick:()=>n(e.id),type:`button`,children:[(0,w.jsxs)(`div`,{className:`tab-card-header`,children:[(0,w.jsx)(`span`,{className:`tab-card-icon`,"aria-hidden":`true`,children:e.icon}),(0,w.jsx)(`span`,{className:`tab-card-title`,children:e.label})]}),(0,w.jsx)(`div`,{className:`tab-card-body`,children:(0,w.jsx)(`strong`,{className:`tab-card-count`,children:r?`—`:e.count})}),(0,w.jsxs)(`div`,{className:`tab-card-footer`,children:[(0,w.jsx)(`span`,{className:`tab-card-subtext`,children:e.subtext}),i&&(0,w.jsx)(`span`,{className:`active-indicator-dot`})]})]},e.id)})})]})},D=({activeFilter:e,stats:t,scryptedConfig:n,cameraUiConfig:r,onOpenScryptedModal:i,onOpenCameraUiModal:a,onSyncCameras:o,isSyncing:s})=>{let c=n?.connectionStatus===`connected`||(n?.cameraCount??0)>0,l=!!r?.enabled;return e!==`cameras`&&e!==`paired`?null:(0,w.jsxs)(`div`,{className:`scrypted-header-bar`,style:{display:`flex`,alignItems:`center`,gap:10,margin:`6px 0 16px`,flexWrap:`wrap`},children:[c?(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:[(0,w.jsx)(`span`,{className:`badge-scrypted-tag`,children:`SCRYPTED`}),(0,w.jsxs)(`span`,{className:`scrypted-url-display`,style:{fontSize:`0.82rem`,opacity:.85},children:[t.scryptedTotal??0,` cámaras`]}),(0,w.jsx)(`button`,{className:`button button-sm button-primary`,type:`button`,onClick:o,disabled:s,style:{fontSize:`0.78rem`,padding:`4px 8px`},children:s?`Sincronizando...`:`🔄 Sincronizar`}),(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:i,style:{fontSize:`0.78rem`,padding:`4px 8px`},children:`⚙️ Scrypted`})]}):(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:i,style:{fontSize:`0.82rem`},children:`📹 Conectar con Scrypted`}),(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:`auto`,flexWrap:`wrap`},children:[l&&(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,w.jsx)(`span`,{className:`badge-cameraui-tag`,children:`CAMERA.UI`}),(0,w.jsxs)(`span`,{style:{fontSize:`0.82rem`,opacity:.85},children:[t.camerauiTotal??0,` cámaras`]})]}),(0,w.jsx)(`button`,{className:`button button-sm ${l?`button-primary`:`button-secondary`}`,type:`button`,onClick:a,style:{fontSize:`0.8rem`,padding:`4px 10px`},children:l?`🎥 Ajustes Camera.UI`:`🎥 Conectar Camera.UI / MQTT`})]})]})};function O(e){let t=(`name`in e?e.name:``)||``,n=(`displayModel`in e?e.displayModel:`model`in e?e.model:``)||``,r=(`displayManufacturer`in e?e.displayManufacturer:`manufacturer`in e?e.manufacturer:``)||``;for(let e of[`EZVIZ`,`Tapo`,`TP-Link`,`Reolink`,`Eufy`,`Hikvision`,`Dahua`,`Aqara`,`Google`,`Nest`,`Ring`,`UniFi`,`Amcrest`,`Imou`,`Wyze`,`Tuya`,`Sonoff`,`Blink`,`Foscam`,`Axis`,`Wansview`]){let i=RegExp(`\\b${e}\\b`,`i`);if(i.test(t)||i.test(n)||i.test(r))return e.toUpperCase()}return r&&r.toLowerCase()!==`desconocido`?r.toUpperCase():`Marca no identificada`}var k=({camera:e,haDevice:t,cameraUiCamera:n,onConfigure:r})=>{if(e){let t=e.status?.connection===`online`&&e.status?.isOnline===!0,n=e.identity?.homeKitPairingState===`paired`,i=e.bindingState?.matterCommissioned===!0,a=O(e),o=e.displayModel||e.model||``,s=e.displaySerialNumber||e.serialNumber||(e.cameraId?`CAM-${e.cameraId}`:``),c=(e.sensors||[]).filter(e=>e.type===`motion`||e.type===`doorbell`||e.name?.toLowerCase().includes(`movimiento`)||e.name?.toLowerCase().includes(`timbre`)||e.name?.toLowerCase().includes(`motion`)),l=1+c.length;return(0,w.jsxs)(`article`,{className:`device-card scrypted-camera-card is-scrypted-camera`,onClick:r,children:[(0,w.jsxs)(`div`,{className:`card-top`,children:[(0,w.jsx)(`span`,{className:`device-icon`,style:{fontSize:`1.2rem`},children:`📹`}),(0,w.jsxs)(`div`,{className:`card-pills-group`,style:{display:`flex`,gap:5,flexWrap:`wrap`},children:[(0,w.jsx)(`span`,{className:`badge-scrypted-tag`,children:`SCRYPTED`}),n?(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:`rgba(16, 185, 129, 0.15)`,color:`#6ee7b7`,border:`1px solid rgba(52, 211, 153, 0.4)`,fontWeight:600},children:`🍏 Enlazada a Casa`}):(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:`rgba(245, 158, 11, 0.15)`,color:`#fcd34d`,border:`1px solid rgba(245, 158, 11, 0.4)`,fontWeight:600},children:`⚠️ No enlazada a Casa`}),i&&(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:`rgba(59, 130, 246, 0.15)`,color:`#60a5fa`,border:`1px solid rgba(59, 130, 246, 0.4)`,fontWeight:600},children:`⚡ Matter`}),(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:t?`rgba(16, 185, 129, 0.15)`:`rgba(239, 68, 68, 0.15)`,color:t?`#6ee7b7`:`#fca5a5`,borderColor:t?`rgba(52, 211, 153, 0.4)`:`rgba(239, 68, 68, 0.4)`},children:t?`🟢 En línea`:`🔴 Desconectada`})]})]}),(0,w.jsx)(`h3`,{title:e.name,children:e.name}),(0,w.jsxs)(`p`,{className:`device-meta`,children:[a,o&&o!==`Modelo no identificado`?` (${o})`:``,s?` · SN: ${s}`:``]}),(0,w.jsx)(`div`,{className:`tags`,children:c.map((e,t)=>(0,w.jsx)(`span`,{className:`tag`,children:e.type===`doorbell`||e.name?.toLowerCase().includes(`timbre`)?`🔔 Timbre`:`🏃 Movimiento`},t))}),(0,w.jsxs)(`div`,{className:`card-footer`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,w.jsxs)(`span`,{className:`entity-summary`,children:[l,` entidad`,l===1?``:`es`]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[!n&&(0,w.jsx)(`button`,{className:`button button-primary`,type:`button`,style:{fontSize:`0.75rem`,padding:`4px 8px`},onClick:e=>{e.stopPropagation(),r()},children:`📲 Enlazar QR`}),(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:e=>{e.stopPropagation(),r()},children:`Configurar`})]})]})]})}if(n){let e=n.status===`online`&&n.homeKitEnabled!==!1,t=n.isPaired===!0,i=O(n),a=n.model&&n.model!==`Cámara RTSP`?n.model:``,o=n.serialNumber||(n.id.startsWith(`cameraui_`)?``:n.id),s=[];if(n.realEntities&&n.realEntities.length>0)for(let e of n.realEntities)e.type===`motion`&&!s.includes(`🏃 Movimiento`)&&s.push(`🏃 Movimiento`),e.type===`light`&&!s.includes(`💡 Luz`)&&s.push(`💡 Luz`),e.type===`siren`&&!s.includes(`🚨 Sirena`)&&s.push(`🚨 Sirena`),e.type===`doorbell`&&!s.includes(`🔔 Timbre`)&&s.push(`🔔 Timbre`);else(n.motionTopic||n.motionActive)&&s.push(`🏃 Movimiento`),n.hasLight&&s.push(`💡 Luz`),n.hasSiren&&s.push(`🚨 Sirena`),(n.doorbellTopic||n.doorbellActive)&&s.push(`🔔 Timbre`);let c=1+s.length;return(0,w.jsxs)(`article`,{className:`device-card cameraui-camera-card`,onClick:r,style:{borderLeft:`3px solid #a855f7`},children:[(0,w.jsxs)(`div`,{className:`card-top`,children:[(0,w.jsx)(`span`,{className:`device-icon`,style:{fontSize:`1.2rem`},children:`🎥`}),(0,w.jsxs)(`div`,{className:`card-pills-group`,style:{display:`flex`,gap:5,flexWrap:`wrap`},children:[(0,w.jsx)(`span`,{className:`badge-cameraui-tag`,children:`CAMERA.UI`}),t?(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:`rgba(16, 185, 129, 0.15)`,color:`#6ee7b7`,border:`1px solid rgba(52, 211, 153, 0.4)`,fontWeight:600},children:`🍏 Enlazada a Casa`}):(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:`rgba(245, 158, 11, 0.15)`,color:`#fcd34d`,border:`1px solid rgba(245, 158, 11, 0.4)`,fontWeight:600},children:`⚠️ No enlazada a Casa`}),(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:e?`rgba(16, 185, 129, 0.15)`:n.homeKitEnabled===!1?`rgba(156, 163, 175, 0.15)`:`rgba(239, 68, 68, 0.15)`,color:e?`#6ee7b7`:n.homeKitEnabled===!1?`#9ca3af`:`#fca5a5`,borderColor:e?`rgba(52, 211, 153, 0.4)`:n.homeKitEnabled===!1?`rgba(156, 163, 175, 0.4)`:`rgba(239, 68, 68, 0.4)`},children:e?`🟢 En línea`:n.homeKitEnabled===!1?`⚪ Desactivada`:`🔴 Desconectada`})]})]}),(0,w.jsx)(`h3`,{title:n.name,children:n.name}),(0,w.jsxs)(`p`,{className:`device-meta`,children:[i,a?` (${a})`:``,o?` · SN: ${o}`:``]}),(0,w.jsxs)(`div`,{className:`tags`,children:[n.motionActive&&(0,w.jsxs)(`span`,{className:`tag`,style:{fontSize:`0.72rem`,background:`rgba(239, 68, 68, 0.25)`,color:`#ef4444`,border:`1px solid #ef4444`,fontWeight:700},children:[`🚨 ¡MOVIMIENTO DETECTADO!`,n.motionSource?` (${n.motionSource.split(` `)[0]})`:``]}),s.map((e,t)=>(0,w.jsx)(`span`,{className:`tag`,children:e},t))]}),(0,w.jsxs)(`div`,{className:`card-footer`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,w.jsxs)(`span`,{className:`entity-summary`,children:[c,` entidad`,c===1?``:`es`]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[!t&&(0,w.jsx)(`button`,{className:`button button-primary`,type:`button`,style:{fontSize:`0.75rem`,padding:`4px 8px`},onClick:e=>{e.stopPropagation(),r()},children:`📲 Enlazar QR`}),(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:e=>{e.stopPropagation(),r()},children:`Configurar`})]})]})]})}if(t){let e=O(t),n=t.entities.filter(e=>e.domain===`camera`),i=t.entities.filter(e=>e.domain===`binary_sensor`&&(e.entityId.includes(`motion`)||e.entityId.includes(`doorbell`)||e.entityId.includes(`movimiento`)||e.entityId.includes(`timbre`))),a=n.length+i.length,o=t.entities.some(e=>e.exported),s=t.entities.some(e=>e.exported&&e.commissioned),c=e===`GOOGLE`||e===`NEST`||t.entities.some(e=>e.domain===`camera`&&(e.entityId.includes(`nest`)||e.entityId.includes(`google`))),l=t.streamStrategy;return(0,w.jsxs)(`article`,{className:`device-card ha-camera-card`,onClick:r,children:[(0,w.jsxs)(`div`,{className:`card-top`,children:[(0,w.jsx)(`span`,{className:`device-icon`,style:{fontSize:`1.2rem`},children:`📹`}),(0,w.jsxs)(`div`,{className:`card-pills-group`,style:{display:`flex`,gap:5,flexWrap:`wrap`},children:[(0,w.jsx)(`span`,{className:`badge-ha-tag`,children:`HOME ASSISTANT`}),s&&(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.68rem`,background:`rgba(16, 185, 129, 0.15)`,color:`#6ee7b7`,border:`1px solid rgba(52, 211, 153, 0.4)`,fontWeight:600},children:`🍏 Matter Vinculado`}),!s&&o&&(0,w.jsx)(`span`,{className:`tag tag-mqtt`,children:`EN MATTER`}),c&&l===`unsupported`&&(0,w.jsx)(`span`,{className:`tag`,title:`Esta cámara Nest necesita go2rtc configurado para tener live stream en HomeKit. Haz clic en Configurar para ver los pasos.`,style:{fontSize:`0.68rem`,background:`rgba(251, 146, 60, 0.15)`,color:`#fb923c`,border:`1px solid rgba(251, 146, 60, 0.4)`,fontWeight:600,cursor:`help`},children:`⚠️ Nest: Configurar go2rtc`})]})]}),(0,w.jsx)(`h3`,{title:t.name,children:t.name}),(0,w.jsxs)(`p`,{className:`device-meta`,children:[e,t.model?` (${t.model})`:``,t.area?` · 📍 ${t.area}`:``]}),(0,w.jsx)(`div`,{className:`tags`,children:i.map((e,t)=>(0,w.jsx)(`span`,{className:`tag`,children:e.entityId.includes(`doorbell`)||e.entityId.includes(`timbre`)?`🔔 Timbre`:`🏃 Movimiento`},t))}),(0,w.jsxs)(`div`,{className:`card-footer`,children:[(0,w.jsxs)(`span`,{className:`entity-summary`,children:[a,` entidad`,a===1?``:`es`]}),(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:e=>{e.stopPropagation(),r()},children:`Configurar`})]})]})}return null};function ee(e){try{let t=localStorage.getItem(`matter_collapsed_camera_brands`);return new Set(JSON.parse(t||`[]`)).has(e.toLowerCase().trim())}catch{return!1}}function A(e,t){try{let n=localStorage.getItem(`matter_collapsed_camera_brands`),r=new Set(JSON.parse(n||`[]`)),i=e.toLowerCase().trim();t?r.add(i):r.delete(i),localStorage.setItem(`matter_collapsed_camera_brands`,JSON.stringify([...r]))}catch{}}var te=({brand:e,scryptedCameras:t,haCameras:n,cameraUiCameras:r=[],onConfigureCamera:i,onConfigureHaDevice:a,onConfigureCameraUiCamera:o})=>{let[s,c]=(0,_.useState)(()=>!ee(e)),l=t.length+n.length+r.length;return(0,w.jsxs)(`details`,{className:`camera-brand-group`,open:s,onToggle:t=>{let n=t.target.open;c(n),A(e,!n)},children:[(0,w.jsxs)(`summary`,{className:`camera-brand-group__header`,children:[(0,w.jsxs)(`h3`,{children:[`📹 `,e]}),(0,w.jsxs)(`span`,{className:`brand-camera-count`,children:[l,` `,l===1?`cámara`:`cámaras`,` `,s?`▾`:`▸`]})]}),(0,w.jsxs)(`div`,{className:`cameras-grid`,children:[t.map(e=>(0,w.jsx)(k,{camera:e,onConfigure:()=>i(e)},`scrypted-${e.cameraId}`)),r.map(e=>(0,w.jsx)(k,{cameraUiCamera:e,onConfigure:()=>o?.(e)},`cameraui-${e.id}`)),n.map(e=>(0,w.jsx)(k,{haDevice:e,onConfigure:()=>a(e)},`ha-${e.id}`))]})]})};function ne(e){switch(e){case`light`:return`💡`;case`switch`:return`🔌`;case`camera`:return`📹`;case`climate`:return`❄️`;case`fan`:return`🌀`;case`cover`:return`🪟`;case`lock`:return`🔒`;case`sensor`:return`🌡️`;case`binary_sensor`:return`🔔`;case`vacuum`:return`🤖`;case`humidifier`:return`💧`;default:return`⚡`}}var re=({device:e,searchQuery:t,onConfigure:n})=>{let r=e.entities.some(e=>e.composite||e.isComposite||e.compositeDeviceId)||e.entities.some(e=>e.domain===`fan`)&&e.entities.some(e=>e.domain===`light`),i=r&&e.entities.some(e=>e.exported&&!e.auxiliary),a=e.entities.filter(e=>e.exported).length,o=e.entities.filter(e=>e.exported&&e.commissioned).length,s=o>0,c=e.entities.some(e=>e.origin===`mqtt`||e.entityId.startsWith(`mqtt.`)),l=e.entities.filter(e=>e.exported&&(e.hasIssue||e.state===`unavailable`||e.state===`unknown`||e.state===`offline`)),u=l.some(e=>e.state===`unavailable`||e.state===`unknown`||e.state===`offline`),d=l.length>0,f=e.entities.find(e=>e.domain===`fan`),p=r?f?`fan`:`light`:e.entities[0]?.domain||`switch`,m=[...new Set(e.entities.map(e=>e.domain))].slice(0,3),h=e.entities.length>1,g=e.manufacturer?`${e.manufacturer}${e.model?` (${e.model})`:``}`:``,_=c?`MQTT Auto-Discovery`:g?`${g}${e.area?` · 📍 ${e.area}`:``}`:e.area?`📍 ${e.area} · Home Assistant`:`Home Assistant`;return(0,w.jsxs)(`article`,{className:`device-card ${d?`needs-attention`:``}`,onClick:n,children:[(0,w.jsxs)(`div`,{className:`card-top`,children:[(0,w.jsx)(`span`,{className:`device-icon`,children:ne(p)}),(0,w.jsx)(`span`,{className:`export-badge ${r?i?`active`:``:a?`active`:``}`,children:r?i?`1/1 Matter`:`0/1 Matter`:h?`${a}/${e.entities.length} activos`:`${a}/${e.entities.length}`})]}),(0,w.jsx)(`h3`,{title:e.name,children:e.name}),(0,w.jsx)(`p`,{className:`device-meta`,children:_}),u&&(0,w.jsxs)(`p`,{style:{margin:`3px 0 0`,fontSize:`11px`,color:`#f87171`,display:`flex`,alignItems:`center`,gap:`4px`,fontWeight:500},children:[(0,w.jsx)(`span`,{children:`⚠️`}),(0,w.jsx)(`span`,{children:l.length===1&&h?`"${l[0].name||l[0].entityId}" desconectado en HA`:`Desconectado en Home Assistant`})]}),(0,w.jsxs)(`div`,{className:`tags`,children:[s&&(0,w.jsxs)(`span`,{className:`tag`,style:{background:`rgba(16, 185, 129, 0.15)`,color:`#6ee7b7`,border:`1px solid rgba(52, 211, 153, 0.3)`,fontWeight:600},children:[`🍏 Matter Vinculado `,h?`(${o}/${e.entities.length} botones)`:``]}),r&&(0,w.jsx)(`span`,{className:`tag`,style:{background:`rgba(59, 130, 246, 0.15)`,color:`#60a5fa`,border:`1px solid rgba(59, 130, 246, 0.3)`,fontWeight:600},children:`⚡ Unificado (1 QR)`}),c&&(0,w.jsx)(`span`,{className:`tag tag-mqtt`,children:`📡 MQTT`}),e.manufacturer&&(0,w.jsx)(`span`,{className:`tag tag-brand`,children:e.manufacturer}),u?(0,w.jsxs)(`span`,{className:`tag`,style:{background:`rgba(239, 68, 68, 0.15)`,color:`#fca5a5`,border:`1px solid rgba(239, 68, 68, 0.4)`,fontWeight:600},title:`Entidad desconectada en HA: ${l.map(e=>e.name||e.entityId).join(`, `)}`,children:[`⚠️ `,l.length===1&&h?`${l[0].name||`Botón`}: Desconectado`:`⚠️ Desconectado`]}):d?(0,w.jsxs)(`span`,{className:`tag tag-warning`,title:`Incidencia en: ${l.map(e=>e.name||e.entityId).join(`, `)}`,children:[`⚠️ `,l.length===1&&h?`${l[0].name||`Botón`}: Revisar`:`Revisar`]}):null,m.map(e=>(0,w.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,w.jsxs)(`div`,{className:`card-footer`,children:[(0,w.jsx)(`span`,{className:`entity-summary`,children:r?`1 accesorio · ${e.entities.length} entidad${e.entities.length===1?``:`es`}`:h?`${e.entities.length} botones (${a} en Matter)`:`${e.entities.length} entidad${e.entities.length===1?``:`es`}`}),(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:e=>{e.stopPropagation(),n()},children:`Configurar`})]})]})},j=o(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),ie=o((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),ae=o((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),oe=o(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),se=o(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),ce=o((e=>{var t=ie().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),le=o((e=>{var t=ie().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),ue=o((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),de=o((e=>{var t=ae(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),fe=o((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),pe=o((e=>{var t=fe();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),me=o(((e,t)=>{var n=pe();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),he=o((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),ge=o((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
10
+ ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),_e=o((e=>{var t=he(),n=ge();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),ve=o((e=>{var t=ie(),n=de(),r=ae(),i=_e(),a=he(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),M=o((e=>{var t=ie(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),N=o(((e,t)=>{var n=_e();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),ye=o(((e,t)=>{var n=_e(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),be=o(((e,t)=>{var n=_e();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),xe=o(((e,t)=>{var n=_e(),r=ie();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
11
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Se=o(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Ce=o((e=>{var t=_e(),n=N(),r=ye(),i=be(),a=xe(),o=ge(),s=ie(),c=Se();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
12
+ Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),P=o((e=>{var t=ie(),n=ae(),r=oe(),i=se(),a=ce(),o=le(),s=ue(),c=de(),l=me(),u=ve(),d=M(),f=_e(),p=Ce();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
13
+ The chosen QR Code version cannot contain this amount of data.
14
+ Minimum version required to store current data is: `+c+`.
15
+ `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),we=o((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||(e.color={});let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Te=o((e=>{var t=we();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),Ee=o((e=>{var t=we();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
16
+ `;return typeof a==`function`&&a(null,p),p}})),De=c(o((e=>{var t=j(),n=P(),r=Te(),i=Ee();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),1),Oe=({variant:e=`color`,size:t=48})=>{let n=e===`color`,r=n?`col`:`mon`;return(0,w.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 100 100`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`,flexShrink:0},"aria-hidden":`true`,children:[(0,w.jsx)(`defs`,{children:n?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`linearGradient`,{id:`${r}-out`,x1:`50`,y1:`8`,x2:`50`,y2:`92`,gradientUnits:`userSpaceOnUse`,children:[(0,w.jsx)(`stop`,{offset:`0%`,stopColor:`#ff9f0a`}),(0,w.jsx)(`stop`,{offset:`100%`,stopColor:`#f57c00`})]}),(0,w.jsxs)(`linearGradient`,{id:`${r}-mid`,x1:`50`,y1:`26`,x2:`50`,y2:`82`,gradientUnits:`userSpaceOnUse`,children:[(0,w.jsx)(`stop`,{offset:`0%`,stopColor:`#ffc83b`}),(0,w.jsx)(`stop`,{offset:`100%`,stopColor:`#ffab10`})]}),(0,w.jsxs)(`linearGradient`,{id:`${r}-in`,x1:`50`,y1:`44`,x2:`50`,y2:`74`,gradientUnits:`userSpaceOnUse`,children:[(0,w.jsx)(`stop`,{offset:`0%`,stopColor:`#fffde7`}),(0,w.jsx)(`stop`,{offset:`100%`,stopColor:`#fff3b0`})]}),(0,w.jsx)(`filter`,{id:`${r}-sh1`,x:`0`,y:`0`,width:`100`,height:`100`,filterUnits:`userSpaceOnUse`,children:(0,w.jsx)(`feDropShadow`,{dx:`0`,dy:`2.5`,stdDeviation:`2.5`,floodColor:`#b25000`,floodOpacity:`0.35`})}),(0,w.jsx)(`filter`,{id:`${r}-sh2`,x:`0`,y:`0`,width:`100`,height:`100`,filterUnits:`userSpaceOnUse`,children:(0,w.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1.5`,floodColor:`#d97706`,floodOpacity:`0.25`})})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`linearGradient`,{id:`${r}-out`,x1:`50`,y1:`8`,x2:`50`,y2:`92`,gradientUnits:`userSpaceOnUse`,children:[(0,w.jsx)(`stop`,{offset:`0%`,stopColor:`#1e293b`}),(0,w.jsx)(`stop`,{offset:`100%`,stopColor:`#0f172a`})]}),(0,w.jsxs)(`linearGradient`,{id:`${r}-mid`,x1:`50`,y1:`26`,x2:`50`,y2:`82`,gradientUnits:`userSpaceOnUse`,children:[(0,w.jsx)(`stop`,{offset:`0%`,stopColor:`#64748b`}),(0,w.jsx)(`stop`,{offset:`100%`,stopColor:`#475569`})]}),(0,w.jsxs)(`linearGradient`,{id:`${r}-in`,x1:`50`,y1:`44`,x2:`50`,y2:`74`,gradientUnits:`userSpaceOnUse`,children:[(0,w.jsx)(`stop`,{offset:`0%`,stopColor:`#ffffff`}),(0,w.jsx)(`stop`,{offset:`100%`,stopColor:`#f1f5f9`})]}),(0,w.jsx)(`filter`,{id:`${r}-sh1`,x:`0`,y:`0`,width:`100`,height:`100`,filterUnits:`userSpaceOnUse`,children:(0,w.jsx)(`feDropShadow`,{dx:`0`,dy:`2.5`,stdDeviation:`2.5`,floodColor:`#000000`,floodOpacity:`0.45`})}),(0,w.jsx)(`filter`,{id:`${r}-sh2`,x:`0`,y:`0`,width:`100`,height:`100`,filterUnits:`userSpaceOnUse`,children:(0,w.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1.5`,floodColor:`#0f172a`,floodOpacity:`0.3`})})]})}),(0,w.jsx)(`path`,{d:`M72 18V38H84V22.5C84 20.01 81.99 18 79.5 18H72Z`,fill:`url(#${r}-out)`}),(0,w.jsx)(`path`,{d:`M47.45 9.77C48.98 8.44 51.02 8.44 52.55 9.77L90.8 42.87C92.68 44.5 91.53 47.6 89.04 47.6H79.5V81.5C79.5 86.47 75.47 90.5 70.5 90.5H29.5C24.53 90.5 20.5 86.47 20.5 81.5V47.6H10.96C8.47 47.6 7.32 44.5 9.2 42.87L47.45 9.77Z`,fill:`url(#${r}-out)`}),(0,w.jsx)(`path`,{d:`M48.1 27.8C49.2 26.8 50.8 26.8 51.9 27.8L71.8 44.7C73.2 45.9 72.4 48.2 70.5 48.2H66.5V74.5C66.5 77.8 63.8 80.5 60.5 80.5H39.5C36.2 80.5 33.5 77.8 33.5 74.5V48.2H29.5C27.6 48.2 26.8 45.9 28.2 44.7L48.1 27.8Z`,fill:`url(#${r}-mid)`,filter:`url(#${r}-sh1)`}),(0,w.jsx)(`path`,{d:`M48.7 44.2C49.5 43.5 50.5 43.5 51.3 44.2L60.5 52.1C61.4 52.9 60.8 54.5 59.6 54.5H57.5V69.5C57.5 71.4 55.9 73 54 73H46C44.1 73 42.5 71.4 42.5 69.5V54.5H40.4C39.2 54.5 38.6 52.9 39.5 52.1L48.7 44.2Z`,fill:`url(#${r}-in)`,filter:`url(#${r}-sh2)`})]})};function ke(e){if(!e)return`—————`;let t=String(e).replace(/\D/g,``);return t.length===11?`${t.slice(0,4)}-${t.slice(4,7)}-${t.slice(7)}`:t.length===21?`${t.slice(0,4)}-${t.slice(4,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16)}`:e}function F(e,t){if(!e)return{line1:`••••`,line2:`••••`};let n=String(e).replace(/\D/g,``);if(n.length===8)return{line1:n.slice(0,4).split(``).join(` `),line2:n.slice(4,8).split(``).join(` `)};if(n.length===11)return{line1:n.slice(0,4).split(``).join(` `),line2:`${n.slice(4,7)}-${n.slice(7)}`};if(n.length===21)return{line1:n.slice(0,4).split(``).join(` `),line2:`${n.slice(4,11)}...`};let r=Math.ceil(n.length/2);return{line1:n.slice(0,r).split(``).join(` `),line2:n.slice(r)}}var Ae=({pairingCode:e,manualCode:t,pinCode:n,entityName:r=`matter-accessory`,elementId:i=`device-qr-code`,noteText:a,variant:o=`matter-badge`})=>{let s=(0,_.useRef)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),f=o===`multi-admin-glass`,p=o===`hap-homekit`;(0,_.useEffect)(()=>{e&&s.current&&(d(null),De.toCanvas(s.current,e,{width:180,margin:1,color:{dark:f?`#09101f`:`#000000`,light:`#ffffff`},errorCorrectionLevel:f?`H`:`M`}).catch(e=>{console.error(`Error al renderizar código QR:`,e),d(`Error al generar código QR`)}))},[e,f]);let m=async r=>{let i=r||t||n||e;if(i)try{await navigator.clipboard.writeText(i),l(!0),setTimeout(()=>l(!1),2500)}catch{let e=document.createElement(`input`);e.value=i,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),l(!0),setTimeout(()=>l(!1),2500)}},h=()=>{if(!e)return;let t=`${r.toLowerCase().replace(/[^a-z0-9]+/g,`-`)}-qr.png`;try{let n=document.createElement(`canvas`);n.width=1024,n.height=1024;let r=n.getContext(`2d`);if(!r)return;De.toCanvas(n,e,{width:920,margin:2,errorCorrectionLevel:f?`H`:`M`,color:{dark:f?`#09101f`:`#000000`,light:`#ffffff`}}).then(()=>{if(f){let e=new Image;e.onload=()=>{r.fillStyle=`#ffffff`,r.beginPath(),typeof r.roundRect==`function`?r.roundRect(410,410,204,204,28):r.rect(410,410,204,204),r.fill(),r.shadowColor=`rgba(0,0,0,0.25)`,r.shadowBlur=12,r.drawImage(e,422,422,180,180);let i=document.createElement(`a`);i.download=t,i.href=n.toDataURL(`image/png`),i.click()},e.onerror=()=>{let e=document.createElement(`a`);e.download=t,e.href=n.toDataURL(`image/png`),e.click()},e.src=`logo.png`}else{let e=document.createElement(`a`);e.download=t,e.href=n.toDataURL(`image/png`),e.click()}}).catch(e=>console.error(`Error al descargar QR:`,e))}catch(e){console.error(`Error en descarga de QR:`,e)}};if(!e)return(0,w.jsx)(`div`,{className:`qr-empty-card`,children:`Sin código QR disponible.`});let g=p?n||t:t||e,v=F(g,p);return(0,w.jsxs)(`div`,{className:`qr-display-container`,style:{display:`block`},children:[f?(0,w.jsxs)(`div`,{className:`qr-liquid-glass-card multi-admin-mode`,children:[(0,w.jsxs)(`div`,{className:`qr-badge-header multi-admin-header`,children:[(0,w.jsxs)(`div`,{className:`qr-badge-title-group`,children:[(0,w.jsx)(`span`,{className:`multi-admin-sparkle-icon`,"aria-hidden":`true`,children:(0,w.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#38bdf8`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,w.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,w.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,w.jsx)(`path`,{d:`M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z`})]})}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{className:`qr-badge-brand text-cyan`,children:`Modo Multi-Admin`}),(0,w.jsx)(`span`,{className:`qr-badge-type`,children:`Ventana abierta (15 min)`})]})]}),(0,w.jsx)(`span`,{className:`qr-protocol-tag tag-multi-admin`,children:`Activo`})]}),(0,w.jsxs)(`div`,{className:`qr-visual-wrapper`,children:[(0,w.jsx)(`div`,{className:`qr-frame-glow`,"aria-hidden":`true`}),(0,w.jsxs)(`div`,{className:`qr-frame`,children:[(0,w.jsx)(`div`,{id:i,children:(0,w.jsx)(`canvas`,{ref:s,style:{width:`100%`,height:`100%`,display:`block`}})}),(0,w.jsx)(`div`,{className:`qr-center-logo`,"aria-hidden":`true`,children:(0,w.jsx)(`img`,{src:`logo.png`,alt:`Matter Logo`,className:`qr-logo-img`})})]})]}),(0,w.jsxs)(`div`,{className:`qr-manual-box box-multi-admin`,children:[(0,w.jsx)(`span`,{className:`manual-code-label`,children:`CÓDIGO MATTER MULTI-ADMIN`}),(0,w.jsxs)(`div`,{className:`manual-code-row`,children:[(0,w.jsx)(`code`,{className:`manual-code-display code-cyan`,children:ke(t||e)}),(0,w.jsxs)(`button`,{className:`button-copy-code`,type:`button`,onClick:()=>m(t||e),title:`Copiar código temporal Matter`,"aria-label":`Copiar código manual`,children:[(0,w.jsx)(`span`,{className:`copy-icon`,children:`📋`}),(0,w.jsx)(`span`,{className:`copy-text`,children:c?`¡Copiado!`:`Copiar`})]})]})]})]}):(0,w.jsxs)(`div`,{className:`ios27-glass-sticker ${p?`sticker-hap`:`sticker-matter`}`,children:[(0,w.jsxs)(`div`,{className:`sticker-header`,children:[(0,w.jsx)(`div`,{className:`sticker-house-col`,children:(0,w.jsx)(Oe,{variant:p?`color`:`mono`,size:48})}),(0,w.jsxs)(`div`,{className:`sticker-code-col`,children:[(0,w.jsx)(`div`,{className:`sticker-code-line line-1`,children:v.line1}),(0,w.jsx)(`div`,{className:`sticker-code-line line-2`,children:v.line2})]})]}),(0,w.jsx)(`div`,{className:`sticker-qr-frame`,children:(0,w.jsx)(`div`,{id:i,className:`sticker-qr-canvas-wrapper`,children:(0,w.jsx)(`canvas`,{ref:s,style:{width:`100%`,height:`100%`,display:`block`}})})}),(0,w.jsxs)(`div`,{className:`sticker-footer-row`,children:[(0,w.jsx)(`span`,{className:`sticker-badge-tag`,children:p?`Apple HomeKit HAP`:`Matter (Apple Home)`}),(0,w.jsx)(`button`,{className:`button-sticker-copy`,type:`button`,onClick:()=>m(g),title:`Copiar código`,"aria-label":`Copiar código`,children:(0,w.jsx)(`span`,{children:c?`¡Copiado!`:`Copiar`})})]})]}),u&&(0,w.jsx)(`p`,{style:{color:`#f87171`,fontSize:`0.8rem`,marginTop:6,textAlign:`center`},children:u}),(0,w.jsx)(`div`,{className:`qr-card-actions`,children:(0,w.jsx)(`button`,{className:`button-download-qr`,type:`button`,onClick:h,title:`Descargar código QR en alta resolución (PNG)`,children:(0,w.jsx)(`span`,{children:`💾 Descargar QR (PNG)`})})}),a&&(0,w.jsx)(`small`,{className:`qr-note`,children:a})]})};async function je(e){if(navigator?.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-9999px`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch(e){return console.warn(`Failed to copy to clipboard:`,e),!1}}function Me(e,t){try{let n=(parseInt(String(e).replace(/-/g,``),10)|-1879048192)>>>0,r=(BigInt(8)*4294967296n+BigInt(n)).toString(36).toUpperCase();for(;r.length<9;)r=`0`+r;return`X-HM://${r}${t.substring(0,4).toUpperCase().padStart(4,`S`)}`}catch{return`X-HM://00GW95DQA${t.substring(0,4).toUpperCase().padStart(4,`S`)}`}}var I=({camera:e,onClose:t,onRefresh:n,showToast:r})=>{let[i,a]=(0,_.useState)(`homekit`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`tcp`),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(null),[S,C]=(0,_.useState)(!1),[T,E]=(0,_.useState)(!1),[D,k]=(0,_.useState)(null),[ee,A]=(0,_.useState)(null),[te,ne]=(0,_.useState)(!1),[re,j]=(0,_.useState)(``),[ie,ae]=(0,_.useState)(!1),[oe,se]=(0,_.useState)(null),[ce,le]=(0,_.useState)(null),[ue,de]=(0,_.useState)({}),[fe,pe]=(0,_.useState)({}),[me,he]=(0,_.useState)({enabled:!0,targets:[`person`,`dog`,`cat`,`bird`,`raccoon`,`snake`,`spider`],sensitivity:85,motionTimeoutSeconds:15,publishMqtt:!0}),[ge,_e]=(0,_.useState)(null),[ve,M]=(0,_.useState)(!1),[N,ye]=(0,_.useState)(null),[be,xe]=(0,_.useState)(!1),[Se,Ce]=(0,_.useState)(!1),[P,we]=(0,_.useState)(`auto`),[Te,Ee]=(0,_.useState)(`auto`),[De,ke]=(0,_.useState)(`auto`),F=!!(e&&`id`in e&&!(`cameraId`in e)),I=e?`cameraId`in e?e.cameraId:e.id:``,Ne=e?.name||``;(0,_.useEffect)(()=>{if(!e)return;let t=e?.lightEntityId||`auto`,n=e?.sirenEntityId||`auto`,r=e?.motionEntityId||`auto`;we(t),Ee(n),ke(r);let i=``,a=`tcp`,o=``;if(F){let t=e;if(i=t.rtspUrl||``,o=t.model||``,j(o),s(i),l(`tcp`),k(null),A(null),E(!1),t.width&&t.height){C(!0);let e=t.width,n=t.height,r=(t.videoCodec||`H.264`).toUpperCase(),i=t.fps||30,a=t.hasAudio?`Con Audio (AAC)`:`Sin Audio`;b({text:`✓ Stream nativo activo (${r} ${e}x${n} @ ${i}fps, ${a}). Passthrough puro listo para Apple Home.`})}else i?(C(!1),b({text:`ℹ️ Pulsa 'Verificar Stream' para comprobar la resolución y códec en tiempo real.`})):(C(!1),b({text:`ℹ️ Sin URL de stream RTSP directa configurada.`,isError:!0}))}else{let t=e;i=t.source?.streamReference?.directUrl||t.source?.profiles?.find(e=>e.directUrl)?.directUrl||``,a=t.exportConfig?.rtspTransportPreference||`tcp`,o=t.displayModel||t.model||``,j(o),s(i),l(a),k(null),A(null),E(!1);let n=t.capabilities?.observed;if((t.source?.streamValidationStatus===`verified`||t.source?.streamReference?.validationStatus===`verified`)&&n){C(!0);let e=n.resolution?.width||1920,t=n.resolution?.height||1080,r=(n.videoCodec||`H.264`).toUpperCase(),i=n.fps||30,a=n.hasAudio===!1?`Sin Audio`:`Con Audio`;b({text:`✓ Stream verificado y activo (${r} ${e}x${t} @ ${i}fps, ${a}). Live View listo para Apple Home.`})}else i?(C(!1),b({text:`ℹ️ Pulsa 'Verificar Stream' para probar la conectividad y resolución nativa en vivo.`})):(C(!1),b({text:`ℹ️ Sin URL de stream configurada. Ingresa una URL RTSP directa para activar Live View.`,isError:!0}))}I&&(ye(x.getCameraSnapshotUrl(I)),Ce(!1),x.getCameraAiConfig(I).then(e=>{e?.config&&he(e.config),e?.active&&_e(e.active)}).catch(()=>{}))},[I,F]);let Pe=()=>{I&&(xe(!0),ye(x.getCameraSnapshotUrl(I)),setTimeout(()=>xe(!1),800))},Fe=async()=>{if(I){M(!0);try{(await x.saveCameraAiConfig(I,me))?.success?r(`✓ Configuración de IA guardada correctamente`):r(`Error al guardar configuración de IA`,!0)}catch{r(`Error al conectar con el servidor`,!0)}finally{M(!1)}}};if(!e)return null;let Ie=O(e),Le=F?e.status===`online`&&e.homeKitEnabled!==!1:e?.status?.connection===`online`&&e?.status?.isOnline===!0,Re=F?!!e.isPaired:e?.identity?.homeKitPairingState===`paired`,ze=!F&&(Ie===`GOOGLE`||Ie===`NEST`||I.includes(`nest`)||I.includes(`google`)||e?.capabilities?.observed?.streamSourceType===`webrtc`&&e?.capabilities?.observed?.strategy===`unsupported`),Be=ze&&e?.capabilities?.observed?.strategy===`unsupported`,Ve=F?e.pincode||`031-45-154`:e?.identity?.homeKitPincode||`031-45-154`,He=F?e.setupId||`CUI1`:e?.identity?.homeKitSetupId||`SC01`,Ue=()=>{if(F){let t=e;return t.setupUri?t.setupUri:Me(Ve,He)}let t=e;return t.identity?.homeKitSetupUri?t.identity.homeKitSetupUri:Me(Ve,He)},We=!F&&!!(e.bindingState?.matterCommissioned||e.bindingState?.fabrics&&e.bindingState.fabrics.length>0),Ge=i===`homekit`?Ue():D||(F?``:e.identity?.matterPairingCode)||``,Ke=F?e.model||`Modelo no identificado`:e.displayModel||e.model||`Modelo no identificado`,qe=async t=>{let i=(t??re).trim();if(i){ae(!0);try{F?e.model=i:(await x.updateCameraIdentity(I,{manufacturer:Ie,model:i}),e.displayModel=i,e.model=i,e.identityOverride||={},e.identityOverride.model=i),j(i),r(`✓ Modelo actualizado a «${i}»`),n()}catch(e){r(e.message||`Error al actualizar modelo`,!0)}finally{ae(!1)}}},Je=[];if(e.realEntities&&Array.isArray(e.realEntities)&&Je.push(...e.realEntities),F){let t=e;t.hasLight&&!Je.some(e=>e.type===`light`)&&Je.push({id:`cameraui.${t.id}.light`,domain:`light`,type:`light`,name:`${t.name} Foco / Luz`,state:!!t.lightActive,matterExported:!1}),t.hasSiren&&!Je.some(e=>e.type===`siren`)&&Je.push({id:`cameraui.${t.id}.siren`,domain:`siren`,type:`siren`,name:`${t.name} Sirena`,state:!!t.sirenActive,matterExported:!1}),t.motionTopic&&!Je.some(e=>e.type===`motion`)&&Je.push({id:`cameraui.${t.id}.motion`,domain:`binary_sensor`,type:`motion`,name:`${t.name} Sensor Movimiento`,state:!!t.motionActive,topic:t.motionTopic}),t.doorbellTopic&&!Je.some(e=>e.type===`doorbell`)&&Je.push({id:`cameraui.${t.id}.doorbell`,domain:`event`,type:`doorbell`,name:`${t.name} Timbre`,state:!!t.doorbellActive,topic:t.doorbellTopic})}else if(`sensors`in e&&Array.isArray(e.sensors))for(let t of e.sensors||[])(t.type===`light`||t.type===`siren`||t.type===`motion`||t.type===`doorbell`)&&!Je.some(e=>e.type===t.type)&&Je.push({id:`sensor.${t.sensorId}`,domain:t.type===`motion`?`binary_sensor`:t.type===`doorbell`?`event`:t.type,type:t.type,name:t.name||`${e.name} ${t.type}`,state:!!t.state,matterExported:!1});let Ye=`—`,Xe=`—`,Ze=`—`,Qe=`—`,$e=!1;if(F){let t=e;t.videoCodec&&(Ye=t.videoCodec.toUpperCase()),t.width&&t.height&&(Xe=`${t.width}x${t.height}`,$e=!0),t.fps&&(Ze=`${t.fps} fps`),Qe=t.hasAudio?`Con Audio (AAC)`:`Sin Audio detectado`}else{let t=e,n=t.capabilities?.observed,r=t.source?.streamValidationStatus===`verified`||t.source?.streamReference?.validationStatus===`verified`||!!n?.resolution;n?.videoCodec&&(Ye=n.videoCodec.toUpperCase()),n?.resolution?.width&&n?.resolution?.height?(Xe=`${n.resolution.width}x${n.resolution.height}`,$e=!0):t.resolution?.width&&t.resolution?.height&&(Xe=`${t.resolution.width}x${t.resolution.height}`,$e=!0),n?.fps?Ze=`${n.fps} fps`:t.fps&&(Ze=`${t.fps} fps`),n?.hasAudio!==void 0&&(Qe=n.hasAudio?n.audioCodec?.toUpperCase()||`AAC`:`Sin Audio`),r&&($e=!0)}let et=async()=>{if(confirm(`¿Restablecer emparejamiento HomeKit para "${Ne}"?`)){h(!0);try{if(F)(await x.resetCameraUiPairing(I)).success?(r(`✓ Vinculación HAP restablecida. Escanea el nuevo código QR en Apple Home.`),n()):r(`No se pudo restablecer el emparejamiento`,!0);else{let t=await x.resetCameraPairing(`scrypted.${I}`);t.success&&t.setupUri?(e.identity||={},e.identity.homeKitSetupUri=t.setupUri,e.identity.homeKitPairingState=`not_paired`,r(`✓ Vinculación restablecida. Escanea el nuevo código QR.`),n()):r(t.error||`No se pudo restablecer`,!0)}}catch(e){r(e.message||`Error al reiniciar vinculación`,!0)}finally{h(!1)}}},tt=async()=>{if(confirm(`¿Eliminar la cámara "${Ne}" de la exportación?`)){v(!0);try{F?await x.toggleCameraUiHomeKit(I):await x.removeCamera(I),r(`✓ Cámara eliminada de la exportación`),n(),t()}catch(e){r(e.message||`Error al eliminar cámara`,!0)}finally{v(!1)}}},nt=async()=>{ne(!0);try{let e=F?`cameraui.${I}`:`scrypted.${I}`,t=await x.openCommissioning(e);(t?.pairingCode||t?.manualPairingCode)&&(k(t.pairingCode||null),A(t.manualPairingCode||null)),E(!0),r(`✓ Ventana de emparejamiento (Multi-Admin) abierta por 15 min. Escanea en Google Home, Alexa o SmartThings.`)}catch(e){r(e.message||`Error al abrir Multi-Admin`,!0)}finally{ne(!1)}},rt=async()=>{if(!o.trim()){r(`Ingresa una URL RTSP para verificar`,!0);return}d(!0),b({text:`Verificando stream RTSP/HTTP (ffprobe en vivo)...`});try{let t=await x.verifyCameraStream(I,o.trim(),c);if(t.ok&&t.status===`verified`){if(C(!0),t.validation&&!F){let n=e;n.capabilities||={},n.capabilities.observed||(n.capabilities.observed={}),t.validation.resolution&&(n.capabilities.observed.resolution=t.validation.resolution),t.validation.videoCodec&&(n.capabilities.observed.videoCodec=t.validation.videoCodec),t.validation.audioCodec&&(n.capabilities.observed.audioCodec=t.validation.audioCodec),t.validation.hasAudio!==void 0&&(n.capabilities.observed.hasAudio=t.validation.hasAudio),t.validation.fps&&(n.capabilities.observed.fps=t.validation.fps)}let n=t.validation?.resolution?.width||1920,r=t.validation?.resolution?.height||1080,i=(t.validation?.videoCodec||`H.264`).toUpperCase(),a=t.validation?.fps||30;b({text:`✓ Stream verificado con éxito (${i} ${n}x${r} @ ${a}fps). Live View listo para Apple Home.`}),Pe()}else C(!1),b({text:`❌ ${t.validation?.error||`Stream inválido o no compatible`}`,isError:!0})}catch(e){C(!1),b({text:`❌ Error: ${e.message}`,isError:!0})}finally{d(!1)}},it=async()=>{if(!o.trim()){r(`Ingresa una URL RTSP para diagnosticar`,!0);return}p(!0),b({text:`Diagnosticando stream en tiempo real (DESCRIBE, 1er frame, GOP, FPS)...`});try{let e=await x.diagnoseCameraStream(I,o.trim(),c);if(e.success&&e.metrics){let t=e.metrics.timeToDescribeMs?.value??`—`,n=e.metrics.timeToFirstFrameMs?.value??`—`,r=e.metrics.observedFps?.value??`—`,i=e.metrics.observedGopSeconds?.value?`${e.metrics.observedGopSeconds.value}s`:`—`,a=(e.metrics.selectedTransport?.value||c).toUpperCase();b({text:`✓ Diagnóstico completado: ⚡ Inicio: ${t}ms · 1er Frame: ${n}ms · FPS: ${r} · GOP: ${i} · Transporte: ${a}`})}else b({text:`❌ Diagnóstico fallido: ${e.metrics?.error||`Error al conectar con el stream`}`,isError:!0})}catch(e){b({text:`❌ Error de diagnóstico: ${e.message}`,isError:!0})}finally{p(!1)}},at=async()=>{if(o.trim())try{await x.saveCameraStreamUrl(I,o.trim()),r(`✓ URL de stream guardada`),n()}catch(e){r(e.message||`Error al guardar stream`,!0)}},ot=async()=>{try{await x.saveCameraExportConfig(I,{matterEnabled:!0,homeKitEnabled:!0,hksvEnabledByDefault:!0,googleHomeEnabled:!1,alexaEnabled:!1,smartThingsEnabled:!1,nasEnabled:!1,rtspTransportPreference:c,rtspUrl:o.trim()||void 0,model:re.trim()||void 0,lightEntityId:P,sirenEntityId:Te,motionEntityId:De}),r(`✓ Configuración de cámara guardada`),n(),t()}catch(e){r(e.message||`Error al guardar configuración`,!0)}},st=async e=>{se(e.id);let t=e.state?`turn_off`:`turn_on`;try{let i=await x.controlCameraEntity(e.id,t);i.success?(e.state=i.state===void 0?!e.state:i.state,r(`✓ ${e.name}: ${e.state?`Encendido/Activado`:`Apagado/Silenciado`}`),n()):r(i.error||`No se pudo cambiar el estado`,!0)}catch(e){r(e.message||`Error al controlar entidad`,!0)}finally{se(null)}},ct=async e=>{if(ce===e.id){le(null);return}if(le(e.id),!e.matterPairingCode&&!ue[e.id]){pe(t=>({...t,[e.id]:!0}));try{e.matterExported||=(await x.toggleExport(e.id,!0),!0);let t=await x.openCommissioning(e.id);(t?.pairingCode||t?.manualPairingCode)&&(de(n=>({...n,[e.id]:{pairingCode:t.pairingCode,manualCode:t.manualPairingCode||t.pairingCode}})),e.matterPairingCode=t.pairingCode,e.matterManualCode=t.manualPairingCode,r(`✓ Código Matter generado para ${e.name}`),n())}catch(e){r(e.message||`Error al generar código Matter`,!0)}finally{pe(t=>({...t,[e.id]:!1}))}}},lt=async e=>{pe(t=>({...t,[e.id]:!0}));try{let t=await x.openCommissioning(e.id);(t?.pairingCode||t?.manualPairingCode)&&(de(n=>({...n,[e.id]:{pairingCode:t.pairingCode,manualCode:t.manualPairingCode||t.pairingCode}})),e.matterPairingCode=t.pairingCode,e.matterManualCode=t.manualPairingCode,r(`✓ Modo Multi-Admin abierto (15 min) para ${e.name}`),n())}catch(e){r(e.message||`Error al abrir Multi-Admin`,!0)}finally{pe(t=>({...t,[e.id]:!1}))}};return(0,w.jsx)(`div`,{className:`modal-backdrop open`,role:`dialog`,"aria-modal":`true`,children:(0,w.jsxs)(`section`,{className:`modal modal-wide`,style:{maxWidth:940},children:[(0,w.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":`Cerrar`,onClick:t,children:`×`}),(0,w.jsxs)(`header`,{className:`modal-header`,children:[(0,w.jsx)(`span`,{className:`modal-icon`,style:{fontSize:`1.8rem`},children:`📹`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow`,children:F?`CÁMARA CAMERA.UI · APPLE HOME HAP & MATTER`:`CÁMARA SCRYPTED · APPLE HOME HAP & MATTER`}),(0,w.jsx)(`h2`,{children:Ne}),(0,w.jsxs)(`p`,{className:`entity-id`,children:[Le?`🟢 En línea`:`🔴 Desconectada`,` · `,Ie,` `,Ke&&`(${Ke})`,` · ID: `,I,F&&e.port&&(0,w.jsxs)(w.Fragment,{children:[` · Puerto HAP: `,(0,w.jsx)(`code`,{children:e.port})]})]})]})]}),(0,w.jsxs)(`div`,{className:`camera-modal-layout`,children:[(0,w.jsxs)(`div`,{className:`qr-panel`,children:[(0,w.jsxs)(`div`,{className:`tab-group`,style:{display:`flex`,gap:6,marginBottom:12,flexWrap:`wrap`},children:[(0,w.jsx)(`button`,{className:`button button-sm ${i===`homekit`?`button-primary`:`button-secondary`}`,type:`button`,onClick:()=>a(`homekit`),children:`Apple Home (HAP)`}),(0,w.jsx)(`button`,{className:`button button-sm ${i===`matter`?`button-primary`:`button-secondary`}`,type:`button`,onClick:()=>a(`matter`),children:`Matter 1.6`}),(0,w.jsx)(`button`,{className:`button button-sm ${i===`ai`?`button-primary`:`button-secondary`}`,type:`button`,onClick:()=>a(`ai`),children:`🧠 IA & Fauna`}),ze&&(0,w.jsx)(`button`,{className:`button button-sm ${i===`nest`?`button-primary`:`button-secondary`}`,type:`button`,onClick:()=>a(`nest`),style:Be?{borderColor:`#fb923c`,color:i===`nest`?void 0:`#fb923c`}:void 0,children:`📡 Google Nest`})]}),i===`nest`?(0,w.jsxs)(`div`,{className:`card`,style:{padding:16},children:[(0,w.jsx)(`h4`,{style:{margin:`0 0 8px`,fontSize:`0.95rem`,color:`#fb923c`},children:`📡 Google Nest — Live Stream en HomeKit`}),Be?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{style:{background:`rgba(251,146,60,0.1)`,border:`1px solid rgba(251,146,60,0.4)`,borderRadius:8,padding:`10px 14px`,marginBottom:14,fontSize:`0.82rem`,color:`#fb923c`},children:[(0,w.jsx)(`strong`,{children:`⚠️ Sin stream disponible:`}),` La integración `,(0,w.jsx)(`code`,{children:`google_nest`}),` de HA solo hace WebRTC efímero a Google Cloud. Para tener live stream estable en HomeKit necesitas `,(0,w.jsx)(`strong`,{children:`go2rtc`}),` como puente RTSP local.`]}),(0,w.jsxs)(`p`,{style:{fontSize:`0.82rem`,color:`var(--text-muted)`,marginBottom:12},children:[`go2rtc se conecta directamente al Google SDM API con tus credenciales OAuth2 y expone un endpoint RTSP local (`,(0,w.jsxs)(`code`,{children:[`rtsp://127.0.0.1:8554/`,Ne.toLowerCase().replace(/\s+/g,`_`)]}),`) que nuestro addon detecta automáticamente y exporta a HomeKit con `,(0,w.jsx)(`strong`,{children:`passthrough H.264`}),` y `,(0,w.jsx)(`strong`,{children:`audio AAC-ELD`}),`.`]}),(0,w.jsxs)(`div`,{style:{fontSize:`0.82rem`,color:`var(--text-secondary)`},children:[(0,w.jsx)(`p`,{style:{fontWeight:600,color:`#f1f5f9`,marginBottom:6},children:`Pasos de configuración:`}),(0,w.jsxs)(`ol`,{style:{paddingLeft:18,margin:0,lineHeight:1.9},children:[(0,w.jsxs)(`li`,{children:[(0,w.jsx)(`a`,{href:`https://console.cloud.google.com/apis/library/smartdevicemanagement.googleapis.com`,target:`_blank`,rel:`noreferrer`,style:{color:`#60a5fa`},children:`Google Cloud Console`}),` `,`→ Habilitar `,(0,w.jsx)(`strong`,{children:`Smart Device Management API`})]}),(0,w.jsxs)(`li`,{children:[`APIs & Services → Credentials → Create OAuth 2.0 Client ID → Guardar `,(0,w.jsx)(`code`,{children:`client_id`}),` y `,(0,w.jsx)(`code`,{children:`client_secret`})]}),(0,w.jsxs)(`li`,{children:[(0,w.jsx)(`a`,{href:`https://console.nest.google.com/device-access/project-list`,target:`_blank`,rel:`noreferrer`,style:{color:`#60a5fa`},children:`Google Device Access Console`}),` `,`→ Create project (`,(0,w.jsx)(`strong`,{children:`pago único \\$5`}),`) → Guardar `,(0,w.jsx)(`code`,{children:`project_id`})]}),(0,w.jsxs)(`li`,{children:[`Completar OAuth flow para obtener `,(0,w.jsx)(`code`,{children:`refresh_token`}),` `,(0,w.jsx)(`a`,{href:`https://developers.google.com/nest/device-access/authorize`,target:`_blank`,rel:`noreferrer`,style:{color:`#60a5fa`},children:`(guía oficial)`})]}),(0,w.jsxs)(`li`,{children:[`Obtener `,(0,w.jsx)(`code`,{children:`device_id`}),`: `,(0,w.jsx)(`code`,{children:`GET /v1/enterprises/{project_id}/devices`}),` `,`con tu access token`]}),(0,w.jsxs)(`li`,{children:[`En HA → Settings → go2rtc → agregar stream:`,(0,w.jsx)(`pre`,{style:{background:`#0f172a`,borderRadius:6,padding:`8px 10px`,fontSize:`0.75rem`,color:`#a5f3fc`,marginTop:6,overflowX:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:`streams:
17
+ ${Ne.toLowerCase().replace(/\s+/g,`_`)}:
18
+ - nest:?client_id=TU_ID&client_secret=TU_SECRET
19
+ &project_id=TU_PROJECT&refresh_token=TU_TOKEN
20
+ &device_id=TU_DEVICE_ID`})]}),(0,w.jsx)(`li`,{children:`Reiniciar HA → Nuestro addon detecta el stream automáticamente al iniciar`})]})]}),(0,w.jsxs)(`div`,{style:{marginTop:14,fontSize:`0.78rem`,color:`var(--text-muted)`},children:[`💡 `,(0,w.jsx)(`strong`,{children:`Tip:`}),` go2rtc gestiona la re-autenticación automáticamente. No es necesario renovar el token manualmente. El stream aparecerá como `,(0,w.jsxs)(`code`,{children:[`rtsp://127.0.0.1:8554/`,Ne.toLowerCase().replace(/\s+/g,`_`)]}),` `,`y será detectado en el próximo inicio del addon.`]})]}):(0,w.jsxs)(`div`,{style:{background:`rgba(16,185,129,0.1)`,border:`1px solid rgba(16,185,129,0.4)`,borderRadius:8,padding:`10px 14px`,fontSize:`0.82rem`,color:`#6ee7b7`},children:[`✅ `,(0,w.jsx)(`strong`,{children:`go2rtc detectado:`}),` El addon está recibiendo el stream RTSP local de esta cámara Nest. Live view y audio AAC-ELD están disponibles en HomeKit.`]})]}):i===`ai`?(0,w.jsxs)(`div`,{className:`card`,style:{padding:16},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,w.jsx)(`h4`,{style:{margin:0,fontSize:`0.95rem`,color:`#38bdf8`},children:`🧠 Detección IA Local`}),(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,cursor:`pointer`,fontSize:`0.85rem`},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:me.enabled,onChange:e=>he({...me,enabled:e.target.checked})}),(0,w.jsx)(`span`,{children:me.enabled?`Activa`:`Inactiva`})]})]}),(0,w.jsx)(`p`,{style:{fontSize:`0.8rem`,color:`var(--text-muted)`,marginBottom:14},children:`Integración y enrutamiento en tiempo real de detecciones OpenCV (vehículos, personas y fauna) desde Camera.UI y Home Assistant hacia Apple HomeKit.`}),ge&&(0,w.jsxs)(`div`,{style:{background:`rgba(56, 189, 248, 0.15)`,border:`1px solid rgba(56, 189, 248, 0.3)`,borderRadius:8,padding:10,marginBottom:14},children:[(0,w.jsx)(`div`,{style:{fontSize:`0.85rem`,fontWeight:600,color:`#38bdf8`},children:`🚨 Detección Activa`}),(0,w.jsxs)(`div`,{style:{fontSize:`0.8rem`,marginTop:4},children:[ge.labels?.join(`, `),` (`,(ge.confidence*100).toFixed(0),`%)`]})]}),(0,w.jsxs)(`div`,{style:{marginBottom:14},children:[(0,w.jsx)(`label`,{style:{fontSize:`0.8rem`,fontWeight:600,display:`block`,marginBottom:6},children:`Objetivos de Detección:`}),(0,w.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:[{id:`person`,label:`👤 Persona`},{id:`vehicle`,label:`🚗 Vehículo`},{id:`dog`,label:`🐶 Perro`},{id:`cat`,label:`🐱 Gato`},{id:`bird`,label:`🦜 Ave`},{id:`raccoon`,label:`🦝 Mapache`},{id:`snake`,label:`🐍 Serpiente`},{id:`spider`,label:`🕷️ Araña`}].map(e=>{let t=me.targets.includes(e.id);return(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 10px`,borderRadius:6,background:t?`rgba(56, 189, 248, 0.1)`:`rgba(255,255,255,0.03)`,border:`1px solid ${t?`rgba(56, 189, 248, 0.3)`:`rgba(255,255,255,0.08)`}`,cursor:`pointer`,fontSize:`0.85rem`},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:t,onChange:t=>{let n=t.target.checked?[...me.targets,e.id]:me.targets.filter(t=>t!==e.id);he({...me,targets:n})}}),(0,w.jsx)(`span`,{children:e.label})]},e.id)})})]}),(0,w.jsxs)(`div`,{style:{marginBottom:14},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:`0.8rem`,marginBottom:4},children:[(0,w.jsx)(`span`,{children:`Sensibilidad:`}),(0,w.jsxs)(`span`,{style:{fontWeight:600,color:`#38bdf8`},children:[me.sensitivity,`%`]})]}),(0,w.jsx)(`input`,{type:`range`,min:50,max:95,value:me.sensitivity,onChange:e=>he({...me,sensitivity:Number(e.target.value)}),style:{width:`100%`}})]}),(0,w.jsxs)(`div`,{style:{marginBottom:14},children:[(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontSize:`0.85rem`},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:me.publishMqtt,onChange:e=>he({...me,publishMqtt:e.target.checked})}),(0,w.jsx)(`span`,{children:`📡 Publicar eventos en broker MQTT`})]}),me.publishMqtt&&(0,w.jsxs)(`div`,{style:{fontSize:`0.75rem`,color:`var(--text-muted)`,marginTop:4,paddingLeft:24},children:[`Tópico: `,(0,w.jsx)(`code`,{children:me.mqttTopic||`matter-all-in-one/ai/${I.replace(/[^a-zA-Z0-9_]/g,`_`)}/detection`})]})]}),(0,w.jsx)(`button`,{className:`button button-primary`,type:`button`,style:{width:`100%`,marginTop:8},onClick:Fe,disabled:ve,children:ve?`Guardando...`:`💾 Guardar Configuración de IA`})]}):i===`matter`?We&&!T?(0,w.jsxs)(`div`,{className:`paired-success-glass-card`,id:`paired-camera-matter-card`,children:[(0,w.jsx)(`div`,{className:`paired-apple-home-badge`,children:(0,w.jsx)(Oe,{variant:`mono`,size:56})}),(0,w.jsx)(`h4`,{className:`paired-card-title`,children:`¡Cámara activa en red Matter!`}),(0,w.jsx)(`p`,{className:`paired-card-desc`,children:`Esta cámara está sincronizada en el puente Matter. El código inicial se oculta para proteger la sesión activa.`}),(0,w.jsxs)(`div`,{className:`paired-multiadmin-box`,children:[(0,w.jsx)(`p`,{className:`paired-multiadmin-subtext`,children:`¿Deseas agregarla a Google Home, Alexa o SmartThings?`}),(0,w.jsx)(`button`,{className:`button button-primary button-open-multiadmin`,type:`button`,onClick:nt,disabled:te,id:`cam-open-multiadmin-btn`,children:(0,w.jsx)(`span`,{children:te?`Abriendo...`:`🌐 Abrir Modo Multi-Admin (15 min)`})})]})]}):T||D?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{id:`cam-multi-admin-hint`,className:`multi-admin-hint`,style:{display:`block`,marginBottom:10},children:[(0,w.jsx)(`p`,{className:`hint-title`,children:`🌐 Modo Multi-Admin Abierto (15 min)`}),(0,w.jsxs)(`p`,{className:`hint-desc`,children:[`Ventana de emparejamiento abierta. Escanea este código QR en `,(0,w.jsx)(`strong`,{children:`Google Home`}),`, `,(0,w.jsx)(`strong`,{children:`Alexa`}),` o `,(0,w.jsx)(`strong`,{children:`SmartThings`}),`.`]})]}),(0,w.jsx)(Ae,{pairingCode:D||(F?``:e.identity?.matterPairingCode)||``,manualCode:ee||D||(F?``:e.identity?.matterPairingCode),entityName:Ne,elementId:`cam-matter-qr-code`,variant:`multi-admin-glass`,noteText:`Escanea con Google Home, Alexa o SmartThings (Matter 1.6)`})]}):!F&&e.identity?.matterPairingCode?(0,w.jsx)(Ae,{pairingCode:e.identity.matterPairingCode,manualCode:e.identity.matterPairingCode,entityName:Ne,elementId:`cam-matter-qr-code`,variant:`matter-badge`,noteText:`Escanea para agregar por Matter 1.6 a Apple Home o Google Home`}):(0,w.jsxs)(`div`,{className:`paired-success-glass-card`,style:{textAlign:`center`,padding:`20px 16px`},children:[(0,w.jsx)(`div`,{style:{fontSize:`2.2rem`,marginBottom:8},children:`⚡`}),(0,w.jsx)(`h4`,{className:`paired-card-title`,style:{fontSize:`1rem`},children:`Vincular Cámara con Matter 1.6`}),(0,w.jsx)(`p`,{className:`paired-card-desc`,style:{fontSize:`0.82rem`,marginBottom:14},children:`Genera el código de emparejamiento dinámico para agregar esta cámara a Google Home, Alexa o Apple Home.`}),(0,w.jsx)(`button`,{className:`button button-primary`,type:`button`,onClick:nt,disabled:te,style:{width:`100%`,justifyContent:`center`},children:(0,w.jsx)(`span`,{children:te?`Generando código...`:`⚡ Generar Código de Emparejamiento`})})]}):Re?(0,w.jsxs)(`div`,{className:`paired-success-glass-card`,id:`paired-camera-card`,children:[(0,w.jsx)(`div`,{className:`paired-apple-home-badge`,children:(0,w.jsx)(Oe,{variant:`color`,size:56})}),(0,w.jsx)(`h4`,{className:`paired-card-title`,children:`¡Cámara vinculada en Apple Home!`}),(0,w.jsx)(`p`,{className:`paired-card-desc`,children:`Esta cámara ya está configurada en Apple Home para Live View HAP. El código QR se oculta para proteger la sesión activa.`}),(0,w.jsxs)(`div`,{style:{marginTop:12,padding:`10px 14px`,background:`rgba(59, 130, 246, 0.12)`,borderRadius:8,border:`1px solid rgba(59, 130, 246, 0.3)`,fontSize:`0.82rem`,textAlign:`left`},children:[(0,w.jsx)(`strong`,{style:{color:`#93c5fd`},children:`💡 IMPORTANTE PARA GRABAR EN ICLOUD (HKSV):`}),(0,w.jsxs)(`div`,{style:{marginTop:6,color:`#bfdbfe`,lineHeight:1.4},children:[`Apple Home desactiva la grabación por defecto. En tu iPhone/iPad:`,(0,w.jsxs)(`ol`,{style:{margin:`4px 0 0 16px`,padding:0},children:[(0,w.jsxs)(`li`,{children:[`Abre la app `,(0,w.jsx)(`strong`,{children:`Casa`}),` y toca esta cámara.`]}),(0,w.jsxs)(`li`,{children:[`Toca ⚙️ `,(0,w.jsx)(`strong`,{children:`Ajustes de la cámara`}),` → `,(0,w.jsx)(`strong`,{children:`Opciones de grabación`}),`.`]}),(0,w.jsxs)(`li`,{children:[`Selecciona `,(0,w.jsx)(`strong`,{children:`«Transmitir y permitir la grabación»`}),` (tanto En casa como Fuera de casa).`]})]})]})]})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Ae,{pairingCode:Ge,manualCode:Ve,pinCode:i===`homekit`?Ve:void 0,variant:i===`homekit`?`hap-homekit`:`matter-badge`,entityName:Ne,elementId:`cam-modal-qr-code`,noteText:`Escanea con la app Casa de Apple para Live View HAP`}),(0,w.jsxs)(`div`,{style:{marginTop:10,padding:`10px 12px`,background:`rgba(245, 158, 11, 0.1)`,borderRadius:8,border:`1px solid rgba(245, 158, 11, 0.3)`,fontSize:`0.78rem`,textAlign:`left`},children:[(0,w.jsx)(`strong`,{style:{color:`#fcd34d`},children:`📲 Cómo vincular en Apple Casa:`}),(0,w.jsxs)(`ol`,{style:{margin:`4px 0 0 16px`,padding:0,color:`#fef08a`},children:[(0,w.jsxs)(`li`,{children:[`Abre la app `,(0,w.jsx)(`strong`,{children:`Casa`}),` en tu iPhone o iPad.`]}),(0,w.jsxs)(`li`,{children:[`Toca `,(0,w.jsx)(`strong`,{children:`+`}),` → `,(0,w.jsx)(`strong`,{children:`Agregar accesorio`}),` y escanea el código QR.`]}),(0,w.jsxs)(`li`,{children:[`O toca `,(0,w.jsx)(`em`,{children:`«Más opciones...»`}),`, elige `,(0,w.jsx)(`strong`,{children:Ne}),` e introduce el PIN: `,(0,w.jsx)(`strong`,{children:Ve}),`.`]})]})]})]}),(0,w.jsxs)(`div`,{className:`qr-actions`,style:{display:`flex`,flexDirection:`column`,gap:8,marginTop:12},children:[i===`homekit`&&(0,w.jsx)(`button`,{className:`button button-danger-outline button-sm`,type:`button`,onClick:et,disabled:m,children:m?`Restableciendo...`:`🔄 Restablecer emparejamiento`}),i===`matter`&&We&&(0,w.jsx)(`button`,{className:`button button-secondary button-sm`,type:`button`,onClick:nt,disabled:te,children:te?`Abriendo...`:`🌐 Reabrir Multi-Admin (15 min)`})]})]}),(0,w.jsxs)(`div`,{className:`selection-panel`,children:[(0,w.jsx)(`div`,{style:{marginBottom:12,padding:`8px 12px`,background:`rgba(255, 255, 255, 0.03)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:8,display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:260},children:[(0,w.jsx)(`span`,{style:{fontSize:`0.74rem`,fontWeight:700,color:`var(--dim)`,textTransform:`uppercase`},children:`MODELO DE CÁMARA:`}),(0,w.jsx)(`input`,{type:`text`,value:re,onChange:e=>j(e.target.value),placeholder:`ej. Tapo C402, Tapo C120, Wyze Cam Pan v2`,style:{background:`rgba(0, 0, 0, 0.3)`,border:`1px solid var(--border)`,borderRadius:6,padding:`3px 8px`,color:`var(--text)`,fontSize:`0.82rem`,flex:1}}),(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:()=>qe(),disabled:ie,style:{whiteSpace:`nowrap`},children:ie?`...`:`Guardar`})]})}),(0,w.jsxs)(`div`,{className:`camera-modal-specs-box`,children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,w.jsx)(`span`,{style:{fontSize:`0.74rem`,fontWeight:700,color:`var(--dim)`,textTransform:`uppercase`},children:`ESPECIFICACIONES TÉCNICAS REALES`}),(0,w.jsx)(`span`,{style:{fontSize:`0.72rem`,padding:`2px 8px`,borderRadius:4,background:u?`rgba(59, 130, 246, 0.15)`:$e||S?`rgba(16, 185, 129, 0.15)`:`rgba(239, 68, 68, 0.15)`,color:u?`#93c5fd`:$e||S?`#6ee7b7`:`#fca5a5`,border:`1px solid ${u?`rgba(59, 130, 246, 0.3)`:$e||S?`rgba(52, 211, 153, 0.3)`:`rgba(239, 68, 68, 0.3)`}`},children:u?`🔄 Verificando stream...`:$e||S?`🟢 Stream verificado`:`🔴 Stream sin verificar`})]}),(0,w.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:6,fontSize:`0.8rem`},children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:`📹 Video:`}),` `,Ye===`—`?`H.264 (Nativo)`:Ye,` · `,Xe===`—`?`Pendiente de detección`:Xe,` `,Ze===`—`?``:`@ ${Ze}`]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:`🔊 Audio:`}),` `,Qe===`—`?`Passthrough`:Qe]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:`⚡ Latencia:`}),` <200ms (LAN Ultra Baja)`]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:`🍏 HAP:`}),` Passthrough Puro H.264 (0% CPU / Sin transcode)`]})]})]}),(0,w.jsxs)(`div`,{style:{background:`rgba(255, 255, 255, 0.03)`,border:`1px solid var(--border)`,borderRadius:12,padding:14,marginTop:12},children:[(0,w.jsx)(`span`,{style:{fontSize:`0.74rem`,fontWeight:700,color:`var(--dim)`,textTransform:`uppercase`,display:`block`,marginBottom:6},children:`URL DIRECTA DEL STREAM RTSP (H.264)`}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:8},children:[(0,w.jsx)(`input`,{type:`text`,placeholder:`rtsp://192.168.1.50:8554/cam1`,value:o,onChange:e=>s(e.target.value),style:{flex:1,background:`rgba(0, 0, 0, 0.3)`,border:`1px solid var(--border)`,borderRadius:8,padding:`6px 10px`,color:`var(--text)`,fontSize:`0.85rem`}}),(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:at,children:`💾 Guardar`})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:rt,disabled:u,children:u?`Verificando...`:`🔍 Verificar Stream`}),(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:it,disabled:f,children:f?`Diagnosticando...`:`⚡ Diagnosticar Stream`}),(0,w.jsxs)(`select`,{value:c,onChange:e=>l(e.target.value),style:{background:`rgba(0, 0, 0, 0.3)`,border:`1px solid var(--border)`,borderRadius:6,padding:`4px 8px`,color:`var(--text)`,fontSize:`0.78rem`},children:[(0,w.jsx)(`option`,{value:`tcp`,children:`TCP (Recomendado)`}),(0,w.jsx)(`option`,{value:`udp`,children:`UDP`})]})]}),y&&(0,w.jsx)(`div`,{style:{marginTop:8,padding:8,borderRadius:6,fontSize:`0.8rem`,background:y.isError?`rgba(239, 68, 68, 0.1)`:`rgba(16, 185, 129, 0.1)`,color:y.isError?`#fca5a5`:`#6ee7b7`,border:y.isError?`1px solid rgba(239, 68, 68, 0.3)`:`1px solid rgba(52, 211, 153, 0.3)`},children:y.text}),/wyze/i.test(Ne||re||o)&&(0,w.jsxs)(`div`,{style:{marginTop:8,padding:`8px 12px`,borderRadius:6,fontSize:`0.78rem`,background:`rgba(56, 189, 248, 0.08)`,border:`1px solid rgba(56, 189, 248, 0.25)`,color:`#7dd3fc`,display:`flex`,alignItems:`center`,gap:8},children:[(0,w.jsx)(`span`,{style:{fontSize:`1.1rem`},children:`💡`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:`Calidad Prioritaria Wyze:`}),` `,(0,w.jsx)(`code`,{children:`/stream0`}),` es la resolución máxima `,(0,w.jsx)(`strong`,{children:`1080p (Full HD @ 20fps)`}),`. El sub-stream `,(0,w.jsx)(`code`,{children:`/stream1`}),` reduce la calidad a `,(0,w.jsx)(`strong`,{children:`360p`}),`. Nuestro sistema mantiene `,(0,w.jsx)(`code`,{children:`/stream0`}),` con transporte directo de cero latencia para máxima fidelidad visual sin lag.`]})]}),(0,w.jsxs)(`div`,{style:{marginTop:12,padding:`10px 12px`,background:`rgba(0, 0, 0, 0.45)`,borderRadius:8,border:`1px solid rgba(255, 255, 255, 0.1)`},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,w.jsx)(`span`,{style:{fontSize:`0.78rem`,fontWeight:700,color:`#38bdf8`,display:`flex`,alignItems:`center`,gap:6},children:`📺 Vista Previa del Stream (Snapshot / Live)`}),(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:Pe,disabled:be,style:{fontSize:`0.72rem`,padding:`2px 8px`},children:be?`Cargando...`:`🔄 Actualizar Frame`})]}),(0,w.jsxs)(`div`,{style:{position:`relative`,width:`100%`,aspectRatio:`16/9`,background:`#080808`,borderRadius:6,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(255, 255, 255, 0.05)`},children:[N?(0,w.jsx)(`img`,{src:N,alt:`Vista previa de la cámara`,style:{width:`100%`,height:`100%`,objectFit:`contain`,display:Se?`block`:`none`},onLoad:()=>Ce(!0),onError:()=>Ce(!1)}):null,!Se&&(0,w.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`0.8rem`,textAlign:`center`,padding:16},children:be?`🔄 Capturando frame de la cámara en vivo...`:`ℹ️ Pulsa 'Verificar Stream' o 'Actualizar Frame' para cargar la vista previa.`})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginTop:8,fontSize:`0.72rem`,color:`var(--text-muted)`},children:[(0,w.jsxs)(`span`,{children:[`⚡ Códec: `,(0,w.jsx)(`strong`,{style:{color:`#f8fafc`},children:Ye}),` · Res:`,` `,(0,w.jsx)(`strong`,{style:{color:`#f8fafc`},children:Xe})]}),(0,w.jsx)(`span`,{style:{color:`#34d399`,fontWeight:600},children:Ye.includes(`HEVC`)||Ye.includes(`265`)?`🚀 Passthrough Puro HEVC (Zero Transcode)`:`🚀 Passthrough Puro H.264`})]})]})]}),(0,w.jsxs)(`div`,{style:{marginTop:14},children:[(0,w.jsxs)(`div`,{style:{marginBottom:10,padding:`10px 12px`,borderRadius:8,background:`rgba(59, 130, 246, 0.08)`,border:`1px solid rgba(59, 130, 246, 0.25)`,fontSize:`0.78rem`,color:`#93c5fd`,display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,w.jsx)(`span`,{style:{fontSize:`1.2rem`,lineHeight:1},children:`🍏`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{style:{color:`#dbeafe`},children:`Luz y Sirena Nativas en Apple Home (Casa):`}),(0,w.jsxs)(`div`,{style:{marginTop:3,color:`#bfdbfe`,fontSize:`0.74rem`,lineHeight:1.4},children:[`Al emparejar la cámara mediante su código QR HAP principal (`,(0,w.jsx)(`strong`,{children:`📲 Enlazar QR`}),`), `,(0,w.jsx)(`strong`,{children:`el foco/reflector y la sirena se integran de forma nativa dentro del mismo mosaico de la cámara en la app Casa`}),`. No necesitas escanear códigos adicionales en Casa. El botón `,(0,w.jsx)(`em`,{children:`"⚡ QR Matter"`}),` es exclusivamente si deseas sincronizar el foco o sirena como accesorio independiente en Google Home o Alexa.`]})]})]}),(0,w.jsxs)(`div`,{style:{marginBottom:14,padding:`12px 14px`,borderRadius:8,background:`rgba(0, 0, 0, 0.3)`,border:`1px solid rgba(56, 189, 248, 0.2)`,display:`flex`,flexDirection:`column`,gap:6},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,w.jsx)(`span`,{style:{fontSize:`1.1rem`},children:`✨`}),(0,w.jsx)(`span`,{style:{fontSize:`0.82rem`,fontWeight:700,color:`#38bdf8`},children:`Hardware Físico Genuino de la Cámara`})]}),(0,w.jsxs)(`div`,{style:{color:`#94a3b8`,fontSize:`0.75rem`,lineHeight:1.4},children:[`El sistema extrae y asocia `,(0,w.jsx)(`strong`,{children:`única y exclusivamente los componentes físicos integrados en el cuerpo de esta cámara`}),` (foco/reflector, sirena y sensor de movimiento) a través de su identificador de hardware en Home Assistant. No se vincula ninguna luminaria ni interruptor ajeno del hogar.`]})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,w.jsxs)(`span`,{style:{fontSize:`0.74rem`,fontWeight:700,color:`var(--dim)`,textTransform:`uppercase`},children:[`ESTADO EN TIEMPO REAL (`,Je.length,` FUNCIONES ACTIVAS)`]}),(0,w.jsx)(`span`,{style:{fontSize:`0.72rem`,color:`#6ee7b7`,fontWeight:600},children:`🍏 Live View HAP + Controles Interactivos`})]}),Je.length===0?(0,w.jsx)(`div`,{style:{padding:`12px 14px`,borderRadius:8,background:`rgba(255,255,255,0.02)`,border:`1px solid rgba(255,255,255,0.06)`,fontSize:`0.8rem`,color:`var(--dim)`,textAlign:`center`},children:`No se detectaron reflectores de luz ni sirenas físicas integradas para esta cámara.`}):(0,w.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:Je.map(e=>{let t=oe===e.id,n=ce===e.id,r=!!fe[e.id],i=ue[e.id]||(e.matterPairingCode?{pairingCode:e.matterPairingCode,manualCode:e.matterManualCode}:null),a=e.type===`light`?`💡`:e.type===`siren`?`🚨`:e.type===`doorbell`?`🔔`:`🏃`,o=e.type===`light`?`Reflector / Foco físico integrado. Control directo y exportable a Matter.`:e.type===`siren`?`Sirena de alarma integrada. Activación disuasoria en tiempo real.`:e.type===`doorbell`?`Pulsador de timbre con notificación acústica y visual.`:`Sensor de presencia y movimiento con detección instantánea.`,s=e.type===`light`?e.state?`🟢 Encendida`:`⚪ Apagada`:e.type===`siren`?e.state?`🚨 Activada`:`⚪ Silenciada`:e.type===`doorbell`?e.state?`🔔 Activo`:`⚪ En reposo`:e.state?`🟢 Movimiento`:`⚪ En reposo`;return(0,w.jsxs)(`div`,{style:{background:`rgba(255, 255, 255, 0.025)`,border:`1px solid rgba(255, 255, 255, 0.07)`,borderRadius:8,padding:`10px 12px`,display:`flex`,flexDirection:`column`,gap:8},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:8},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,w.jsx)(`span`,{style:{fontSize:`1.4rem`},children:a}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{style:{fontSize:`0.86rem`,fontWeight:600,display:`flex`,alignItems:`center`,gap:6,flexWrap:`wrap`},children:[(0,w.jsx)(`span`,{children:e.name}),e.topic&&(0,w.jsxs)(`span`,{style:{fontSize:`0.68rem`,color:`#a78bfa`,background:`rgba(139, 92, 246, 0.15)`,padding:`1px 6px`,borderRadius:4},children:[`MQTT: `,e.topic]})]}),(0,w.jsxs)(`div`,{style:{fontSize:`0.72rem`,color:`var(--text-secondary)`},children:[o,` · `,(0,w.jsx)(`code`,{style:{fontSize:`0.7rem`,color:`var(--dim)`},children:e.id})]})]})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`0.7rem`,whiteSpace:`nowrap`,background:e.state?`rgba(16, 185, 129, 0.15)`:`rgba(255,255,255,0.05)`,color:e.state?`#6ee7b7`:`var(--dim)`,border:e.state?`1px solid rgba(52, 211, 153, 0.3)`:`1px solid rgba(255,255,255,0.08)`},children:s}),(e.type===`light`||e.type===`siren`||e.type===`switch`)&&(0,w.jsx)(`button`,{className:`button button-sm ${e.state?`button-danger`:`button-primary`}`,type:`button`,onClick:()=>st(e),disabled:t,style:{fontSize:`0.76rem`,padding:`4px 10px`},children:t?`...`:e.type===`light`?e.state?`💡 Apagar Luz`:`💡 Encender Luz`:e.type===`siren`?e.state?`🚨 Silenciar`:`🚨 Activar Sirena`:e.state?`Apagar`:`Encender`}),(0,w.jsx)(`button`,{className:`button button-sm ${n?`button-primary`:`button-secondary`}`,type:`button`,onClick:()=>ct(e),disabled:r,style:{fontSize:`0.76rem`,padding:`4px 10px`},title:`Ver código QR Matter independiente para vincular esta entidad`,children:r?`Generando...`:`⚡ QR Matter (Separado)`})]})]}),n&&(0,w.jsxs)(`div`,{style:{marginTop:6,padding:`12px`,background:`rgba(0, 0, 0, 0.35)`,borderRadius:8,border:`1px solid rgba(139, 92, 246, 0.3)`},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,w.jsxs)(`span`,{style:{fontSize:`0.78rem`,fontWeight:700,color:`#c084fc`},children:[`⚡ VINCULACIÓN MATTER 1.6 · `,e.name.toUpperCase()]}),(0,w.jsx)(`span`,{style:{fontSize:`0.7rem`,color:`var(--dim)`},children:`QR INDEPENDIENTE DE CÁMARA`})]}),i?.pairingCode?(0,w.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:8},children:[(0,w.jsx)(Ae,{pairingCode:i.pairingCode,manualCode:i.manualCode||i.pairingCode,entityName:e.name,elementId:`matter-qr-entity-${e.id.replace(/[^a-zA-Z0-9]/g,`_`)}`,variant:`matter-badge`,noteText:`⚡ Para Google Home o Alexa (Matter 1.6). En Apple Home ya está integrada de forma nativa dentro de la cámara (no escanear aquí para Casa).`}),(0,w.jsx)(`button`,{className:`button button-sm button-secondary`,type:`button`,onClick:()=>lt(e),disabled:r,style:{fontSize:`0.74rem`},children:r?`Abriendo...`:`🌐 Reabrir Multi-Admin (15 min)`})]}):(0,w.jsxs)(`div`,{style:{textAlign:`center`,padding:`8px 0`},children:[(0,w.jsx)(`p`,{style:{fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:8},children:`Esta entidad aún no está publicada individualmente en el bus Matter.`}),(0,w.jsx)(`button`,{className:`button button-primary button-sm`,type:`button`,onClick:()=>ct(e),disabled:r,style:{fontSize:`0.78rem`},children:r?`Publicando...`:`⚡ Publicar en Matter y Generar QR`})]})]})]},e.id)})})]}),(0,w.jsxs)(`div`,{className:`diagnostics-panel`,style:{marginTop:14,userSelect:`text`},children:[(0,w.jsxs)(`div`,{className:`diagnostics-heading`,children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`✓`}),(0,w.jsx)(`strong`,{children:`Diagnóstico y estado de la cámara`}),(0,w.jsx)(`button`,{className:`copy-diagnostics-button`,type:`button`,onClick:async()=>{await je([`=== DIAGNÓSTICO DE CÁMARA ===`,`ID: ${I}`,`Nombre: ${Ne}`,`Tipo de Puente: ${F?`Camera.UI`:`Scrypted`}`,`Marca: ${Ie}`,`Modelo: ${Ke}`,`Estado: ${Le?`En línea`:`Desconectada`}`,`RTSP URL: ${o||`No configurada`}`,`Transporte RTSP: ${c.toUpperCase()}`,`HomeKit HAP: ${Re?`Emparejado en Apple Home`:`Listo para vincular`}`,`HomeKit Setup PIN: ${Ve}`,`HomeKit Setup ID: ${He}`,`HomeKit Setup URI: ${Ue()}`,`Resolución Probed: ${Xe}`,`Códec Video: ${Ye}`,`FPS: ${Ze}`,`Audio: ${Qe}`,`Entidades Físicas Descubiertas: ${Je.length}`,...Je.map(e=>` - [${e.type.toUpperCase()}] ${e.name} (${e.id}) - Estado: ${e.state?`ON`:`OFF`}${e.topic?` - MQTT: ${e.topic}`:``}`)].join(`
21
+ `))?r(`✓ Diagnóstico de cámara copiado al portapapeles`):r(`⚠️ No se pudo acceder al portapapeles`,!0)},title:`Copiar diagnóstico de cámara`,children:`📋 Copiar diagnóstico`})]}),(0,w.jsx)(`p`,{style:{margin:`6px 0 4px`,fontSize:`0.78rem`,color:`var(--dim)`},children:Le?`Cámara en línea y operativa para Live View HAP.`:`Cámara no responde o desconectada.`})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginTop:16},children:[(0,w.jsx)(`button`,{className:`button button-danger`,type:`button`,onClick:tt,disabled:g,children:`🗑️ Eliminar de la exportación`}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:t,children:`Cancelar`}),(0,w.jsx)(`button`,{className:`button button-primary`,type:`button`,onClick:ot,children:`💾 Guardar`})]})]})]})]})]})})};function Ne(e){switch(e){case`light`:return`💡`;case`switch`:return`🔌`;case`camera`:return`📹`;case`climate`:return`❄️`;case`fan`:return`🌀`;case`cover`:return`🪟`;case`lock`:return`🔒`;case`sensor`:return`🌡️`;case`binary_sensor`:return`🔔`;case`vacuum`:return`🤖`;case`humidifier`:return`💧`;default:return`⚡`}}function Pe(e,t){let n=t||`Controlador Matter`,r=e==null?null:Number(e);return r===4937||/apple/i.test(n)?{icon:`🍎`,name:`Apple Home`}:r===24582||/google/i.test(n)?{icon:`🌐`,name:`Google Home`}:r===4625||/amazon|alexa/i.test(n)?{icon:`🔊`,name:`Amazon Alexa`}:r!==null&&[4321,4362,4731,4469,4960].includes(r)||/smartthings|samsung/i.test(n)?{icon:`💠`,name:`Samsung SmartThings`}:r===4877||/home assistant/i.test(n)?{icon:`🏠`,name:`Home Assistant`}:{icon:`📱`,name:n}}var Fe=({device:e,targetEntity:t,onClose:n,onRefresh:r,showToast:i})=>{let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(()=>!!e?.entities.some(e=>e.composite&&e.exported)),b=e?[...e.entities].sort((e,n)=>{if(t){if(e.entityId===t.entityId)return-1;if(n.entityId===t.entityId)return 1}return Number(n.entityId===n.compositePrimaryEntityId)-Number(e.entityId===e.compositePrimaryEntityId)||Number(n.exported)-Number(e.exported)||(e.name||e.entityId).localeCompare(n.name||n.entityId)}):[];if((0,_.useEffect)(()=>{e&&(y(e.entities.some(e=>e.composite&&e.exported)),o(n=>{if(n){let t=e.entities.find(e=>e.entityId===n.entityId);if(t)return t}return t||b[0]||e.entities[0]||null}),u(!1),(e.entities.find(e=>e.exported&&e.pairingCode)?.pairingCode??null)&&(f(null),m(null)),e.entities.some(e=>e.commissioned)||g(!1))},[e,t]),!e)return null;let S=a||b[0]||null,C=e.entities.some(e=>e.domain===`fan`&&!e.auxiliary),T=e.entities.some(e=>e.domain===`light`&&!e.auxiliary),E=e.entities.some(e=>e.composite)||C&&T,D=e.entities.find(e=>e.entityId===e.compositePrimaryEntityId)||e.entities.find(e=>e.domain===`fan`)||e.entities[0],O=v,k=d||(E?D?.pairingCode:S?.pairingCode)||e.entities.find(e=>e.exported&&e.pairingCode)?.pairingCode||``,ee=p||(E?D?.manualPairingCode:S?.manualPairingCode)||e.entities.find(e=>e.exported&&e.manualPairingCode)?.manualPairingCode||``,A=h?[]:Array.isArray(S?.matterFabrics)&&S.matterFabrics.length>0?S.matterFabrics:Array.isArray(D?.matterFabrics)&&D.matterFabrics.length>0?D.matterFabrics:Array.isArray(e.entities.find(e=>e.matterFabrics?.length)?.matterFabrics)?e.entities.find(e=>e.matterFabrics?.length).matterFabrics:[],te=E?!!O:!!S?.exported,ne=!h&&(E?!!D?.commissioned||e.entities.some(e=>e.composite&&e.commissioned):!!S?.commissioned),re=async()=>{if(!D)return;let t=!O;try{let n=await x.toggleExport(D.entityId,t);y(t),t&&n?.pairingCode&&f(n.pairingCode),t&&n?.manualPairingCode&&m(n.manualPairingCode),e.entities.forEach(e=>{e.composite&&(e.exported=t)}),i(t?`✓ Accesorio publicado en Matter (Ventilador + Luz juntos en 1 QR)`:`Accesorio retirado de Matter`),r()}catch(e){i(e.message||`Error al modificar publicación`,!0)}},j=async t=>{if(!S||!confirm(`¿Desconectar este accesorio de este controlador Matter?`))return;c(!0);let n=E&&D?.entityId||S.entityId;try{let a=await x.removeFabric(n,t);a?.remainingFabrics===0?(g(!0),a?.pairingCode&&f(a.pairingCode),a?.manualPairingCode&&m(a.manualPairingCode),S.commissioned=!1,S.matterFabrics=[],e.entities.forEach(e=>{e.commissioned=!1,e.matterFabrics=[]})):(S.matterFabrics&&=S.matterFabrics.filter(e=>String(e.fabricIndex)!==String(t)&&String(e.fabricId)!==String(t)),e.entities.forEach(e=>{e.matterFabrics&&=e.matterFabrics.filter(e=>String(e.fabricIndex)!==String(t)&&String(e.fabricId)!==String(t))})),i(`✓ Fabric desconectado de este accesorio`),r()}catch(e){i(e.message||`Error al desconectar fabric`,!0)}finally{c(!1)}},ie=async e=>{let t=!e.exported;try{await x.toggleExport(e.entityId,t),e.exported=t,i(t?`✓ ${e.name||e.entityId} publicado en Matter`:`${e.name||e.entityId} retirado de Matter`),r()}catch(e){i(e.message||`Error al modificar publicación`,!0)}},ae=async()=>{if(!S)return;c(!0),i(`Reconectando accesorio Matter...`);let e=E&&D?.entityId||S.entityId;try{await x.reconnectAccessory(S.compositeDeviceId||e),i(`✓ Accesorio reconectado`),r()}catch(e){i(e.message||`Error al reconectar`,!0)}finally{c(!1)}},oe=async()=>{if(!S)return;c(!0);let e=E&&D?.entityId||S.entityId;try{await x.openCommissioning(e),u(!0),i(`✓ Modo Multi-Admin Abierto. Puedes emparejar en una segunda plataforma.`)}catch(e){i(e.message||`Error al abrir Multi-Admin`,!0)}finally{c(!1)}},se=async()=>{if(!S||!confirm(`¿Desconectar este accesorio de todas las casas y generar un nuevo código QR limpio?
22
+
23
+ IMPORTANTE: Si ya agregaste este accesorio en Apple Home, primero elimínalo de la app Casa (Ajustes -> Eliminar accesorio) para evitar que Apple Home intente reconectar una sesión obsoleta.`))return;c(!0);let t=E&&D?.entityId||S.entityId;try{let n=await x.resetAccessory(t);(n?.pairingCode||n?.manualPairingCode)&&(f(n.pairingCode||null),m(n.manualPairingCode||null),g(!0),S.pairingCode=n.pairingCode||S.pairingCode,S.manualPairingCode=n.manualPairingCode||S.manualPairingCode,S.commissioned=!1,S.matterFabrics=[],e.entities.forEach(e=>{e.commissioned=!1,e.matterFabrics=[],n?.pairingCode&&(e.pairingCode=n.pairingCode),n?.manualPairingCode&&(e.manualPairingCode=n.manualPairingCode)})),i(`✓ Accesorio desvinculado y nuevo QR generado`),r()}catch(e){i(e.message||`Error al desvincular`,!0)}finally{c(!1)}},ce=a||S,le=(ce?.state||``).toLowerCase(),ue=le===`unavailable`||le===`unknown`||le===`offline`,de=ce?.diagnostics||[],fe=a?.logs||ce?.logs||[],pe=(0,_.useMemo)(()=>{let e=[];ue&&e.push({text:`Home Assistant informa estado "${le.toUpperCase()}". El dispositivo físico no responde (posiblemente apagado, sin batería, fuera de rango o con la integración origen caída).`,level:`warning`});for(let t of de)e.push({text:t.message,level:t.level||`warning`,timestamp:t.timestamp});for(let t of fe){let n=typeof t==`string`?t:t?.message||JSON.stringify(t),r=typeof t==`object`&&t?.level?t.level:`error`;e.push({text:n,level:r})}return e},[ue,le,de,fe]),me=async()=>{if(!S)return;let e=pe.map(e=>`${e.timestamp?`[${new Date(e.timestamp).toLocaleTimeString()}] `:``}[${e.level.toUpperCase()}] ${e.text}`).join(`
24
+ `);await je([`=== DIAGNÓSTICO DE ACCESORIO MATTER ===`,`Entidad: ${S.entityId}`,`Nombre: ${S.name||S.friendly_name||`Desconocido`}`,`Dominio: ${S.domain}`,`Estado en Home Assistant: ${S.state?S.state.toUpperCase():`N/A`}`,...ue?[`Causa detectada: Dispositivo físico no responde en Home Assistant (apagado, sin batería o sin enlace con la integración)`]:[],`Publicado en Matter: ${S.exported?`SÍ`:`NO`}`,`Emparejado: ${S.commissioned?`SÍ (Vinculado)`:`NO`}`,`Código de emparejamiento manual: ${S.manualPairingCode||`N/A`}`,`Incidencias activas: ${S.hasIssue||ue?`SÍ`:`NO`}`,`\n=== HISTORIAL DE EVENTOS Y DIAGNÓSTICO (${pe.length}) ===`,e||`(Sin incidencias ni eventos registrados)`].join(`
25
+ `))?i(`✓ Diagnóstico y logs copiados al portapapeles`):i(`⚠️ No se pudo acceder al portapapeles, intenta seleccionar el texto manualmente`,!0)},he=new Set(e.entities.filter(e=>e.exported).map(e=>e.compositeDeviceId||e.entityId)).size;return(0,w.jsx)(`div`,{className:`modal-backdrop open`,id:`device-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`device-modal-name`,children:(0,w.jsxs)(`section`,{className:`modal modal-wide modal-fullscreen`,style:{width:`min(98vw, 1720px)`,maxWidth:`98vw`,height:`min(96vh, 960px)`,maxHeight:`96vh`,display:`flex`,flexDirection:`column`,padding:`24px 32px`},children:[(0,w.jsx)(`button`,{className:`icon-button`,id:`device-modal-close`,type:`button`,"aria-label":`Cerrar`,onClick:n,children:`×`}),(0,w.jsxs)(`header`,{className:`modal-header`,style:{marginBottom:8},children:[(0,w.jsx)(`span`,{className:`modal-icon`,id:`device-modal-icon`,children:Ne(S?.domain||b[0]?.domain||e.entities[0]?.domain)}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow`,children:`DISPOSITIVO IOT · MATTER ALL-IN-ONE`}),(0,w.jsx)(`h2`,{id:`device-modal-name`,children:e.name}),(0,w.jsxs)(`p`,{className:`entity-id`,id:`device-modal-id`,children:[e.manufacturer?`${e.manufacturer} · `:``,e.model?`${e.model} · `:``,e.area?`📍 ${e.area}`:e.id]})]})]}),(0,w.jsxs)(`div`,{className:`modal-layout`,style:{display:`grid`,gridTemplateColumns:`310px minmax(0, 1fr) 370px`,gap:16,flex:1,minHeight:0,overflow:`hidden`,alignItems:`stretch`},children:[(0,w.jsxs)(`div`,{className:`entity-list-col`,style:{display:`flex`,flexDirection:`column`,minHeight:0,height:`100%`},children:[(0,w.jsxs)(`div`,{className:`section-header`,style:{marginBottom:E?`8px`:`12px`},children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{style:{margin:0},children:E?`Endpoints del Accesorio`:`Entidades disponibles`}),E&&(0,w.jsx)(`p`,{style:{fontSize:`11px`,color:`var(--muted)`,margin:`2px 0 0`},children:`1 accesorio Matter unificado (1 solo código QR)`})]}),(0,w.jsx)(`span`,{id:`modal-export-count`,children:E?O?`✓ 1 accesorio activo en Matter`:`0 accesorios en Matter`:he?`${he} accesorio Matter · ${e.entities.filter(e=>e.exported).length}/${e.entities.length} endpoints`:`0/${e.entities.length} publicadas`})]}),E&&(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 14px`,background:O?`rgba(16, 185, 129, 0.08)`:`rgba(255, 255, 255, 0.03)`,border:`1px solid ${O?`rgba(16, 185, 129, 0.25)`:`var(--border)`}`,borderRadius:`10px`,marginBottom:`10px`,flexShrink:0},children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{style:{fontSize:`12.5px`,fontWeight:600,color:`var(--text)`},children:`Publicar Accesorio en Matter`}),(0,w.jsx)(`div`,{style:{fontSize:`11px`,color:`var(--muted)`,marginTop:`2px`},children:`Ventilador y luz juntos bajo un solo código QR`})]}),(0,w.jsxs)(`label`,{className:`toggle`,style:{margin:0},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:!!O,onChange:re}),(0,w.jsx)(`span`,{})]})]}),(0,w.jsx)(`div`,{className:`entity-list`,id:`entity-list`,style:{flex:1,minHeight:0,maxHeight:`none`,overflowY:`auto`},children:b.map(e=>{let t=S?.entityId===e.entityId,n=e.entityId===e.compositePrimaryEntityId||E&&e.domain===`fan`,r=E&&(e.domain===`fan`||e.domain===`light`)&&!e.auxiliary,i=E&&e.auxiliary;return(0,w.jsxs)(`div`,{className:`entity-row${e.exported?``:` dimmed`}${t?` selected`:``}`,onClick:()=>o(e),children:[(0,w.jsx)(`span`,{className:`entity-row-icon`,children:Ne(e.domain)}),(0,w.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,w.jsx)(`div`,{className:`entity-row-name`,children:e.name||e.entityId}),(0,w.jsx)(`div`,{className:`entity-row-id`,children:e.entityId}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,alignItems:`center`,marginTop:`3px`,flexWrap:`wrap`},children:[(0,w.jsx)(`span`,{className:`entity-state${e.state===`on`?` on`:``}`,children:e.state||`desconocido`}),E&&n&&(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`10px`,padding:`1px 6px`,background:`rgba(59, 130, 246, 0.15)`,color:`#60a5fa`,border:`1px solid rgba(59, 130, 246, 0.3)`},children:`Endpoint 1 · Ventilador`}),E&&!n&&r&&(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`10px`,padding:`1px 6px`,background:`rgba(16, 185, 129, 0.15)`,color:`#34d399`,border:`1px solid rgba(16, 185, 129, 0.3)`},children:`Endpoint 2 · Luz (Dimmer + Kelvin)`}),i&&(0,w.jsx)(`span`,{className:`tag`,style:{fontSize:`10px`,padding:`1px 6px`,background:`rgba(156, 163, 175, 0.15)`,color:`#9ca3af`,border:`1px solid rgba(156, 163, 175, 0.25)`},children:`Auxiliar (Omitido)`})]})]}),(0,w.jsx)(`div`,{className:`export-control`,onClick:e=>e.stopPropagation(),children:E?i?(0,w.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--muted)`,fontStyle:`italic`},children:`Excluido`}):(0,w.jsx)(`span`,{className:`badge ${e.exported?`badge-success`:`badge-muted`}`,style:{fontSize:`10.5px`,padding:`2px 8px`,borderRadius:`6px`,background:e.exported?`rgba(16, 185, 129, 0.15)`:`rgba(255, 255, 255, 0.05)`,color:e.exported?`#34d399`:`var(--muted)`,border:`1px solid ${e.exported?`rgba(16, 185, 129, 0.3)`:`rgba(255, 255, 255, 0.1)`}`,fontWeight:500},children:e.exported?`✓ En Matter`:`Inactivo`}):(0,w.jsxs)(`label`,{className:`toggle`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:!!e.exported,onChange:()=>ie(e)}),(0,w.jsx)(`span`,{})]})})]},e.entityId)})})]}),(0,w.jsxs)(`aside`,{className:`selection-panel`,id:`selection-panel`,style:{flex:1,minHeight:0,maxHeight:`none`,overflowY:`auto`,padding:22,gap:14},children:[(0,w.jsx)(`p`,{className:`card-label`,children:`SELECCIÓN Y CONFIGURACIÓN`}),(0,w.jsxs)(`h3`,{id:`selection-title`,children:[(0,w.jsx)(`span`,{className:`selection-title-text`,children:S?.name||S?.entityId||`Selecciona una entidad`}),ne&&(0,w.jsx)(`span`,{className:`home-badge commissioned`,children:`🏠 Vinculado`})]}),(0,w.jsx)(`p`,{id:`selection-description`,children:E?S?.auxiliary?`Esta entidad es auxiliar (ej. buzzer/beeper) y se omite en Matter para mantener limpio el accesorio.`:te?`Este canal forma parte del accesorio unificado y está activo en Matter bajo el mismo código QR.`:`Activa el interruptor general arriba para publicar el accesorio (ventilador y luz juntos en 1 QR).`:te?`Esta entidad está activa y expuesta a través de Matter.`:`Activa el interruptor para publicar este canal en Matter.`}),S&&Array.isArray(S.profiles)&&S.profiles.length>0&&!S.auxiliary&&(0,w.jsxs)(`div`,{className:`profile-field`,id:`profile-field`,style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:14,padding:12,background:`rgba(255, 255, 255, 0.03)`,border:`1px solid var(--border)`,borderRadius:10},children:[(0,w.jsx)(`label`,{htmlFor:`profile-select`,style:{fontSize:10,fontWeight:750,letterSpacing:`0.05em`,color:`var(--dim)`,textTransform:`uppercase`},children:`Perfil Matter`}),(0,w.jsx)(`select`,{id:`profile-select`,"aria-label":`Perfil Matter`,value:S.profileId||S.matterType||``,onChange:async e=>{let t=e.target.value;try{c(!0),await x.setDeviceProfile(S.entityId,t),S.profileId=t,S.matterType=t,i(`✓ Perfil Matter actualizado a ${t}`),r()}catch(e){i(e.message||`Error al cambiar perfil Matter`,!0)}finally{c(!1)}},disabled:s,style:{width:`100%`,padding:`8px 10px`,background:`#0b1528`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:8,fontSize:12,cursor:`pointer`},children:S.profiles.map(e=>(0,w.jsxs)(`option`,{value:e.id,children:[e.label,e.appleHome===`supported`?``:e.appleHome===`experimental`?` · experimental`:` · no compatible con Apple Home`]},e.id))}),(()=>{let e=S.profiles.find(e=>e.id===(S.profileId||S.matterType))||S.profiles[0];return e?(0,w.jsx)(`small`,{id:`profile-note`,style:{color:`var(--muted)`,fontSize:10,lineHeight:1.4},children:e.description}):null})()]}),(0,w.jsxs)(`dl`,{className:`selection-meta`,id:`selection-meta`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{children:`Entidad ID`}),(0,w.jsx)(`dd`,{children:S?.entityId||`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{children:`Dominio`}),(0,w.jsx)(`dd`,{children:S?.domain||`—`})]}),S?.area_name&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{children:`Área`}),(0,w.jsx)(`dd`,{children:S.area_name})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{children:`Estado Matter`}),(0,w.jsx)(`dd`,{children:ne?`Emparejado en red Matter`:te?`Listo para vincular`:`Sin publicar`})]})]}),(0,w.jsxs)(`section`,{className:`fabrics-section`,id:`fabrics-section`,children:[(0,w.jsxs)(`div`,{className:`fabrics-heading`,children:[(0,w.jsx)(`span`,{className:`fabrics-icon`,"aria-hidden":`true`,children:`🏠`}),(0,w.jsx)(`strong`,{children:`Casas / Controladores Conectados`})]}),(0,w.jsx)(`p`,{className:`fabrics-subtitle`,children:`Desconectar de ecosistemas Matter existentes si cambias de controlador o si ya eliminaste este accesorio en tu app de Apple Home, Google Home o Alexa.`}),A.length>0?(0,w.jsx)(`div`,{className:`fabrics-list`,children:A.map((e,t)=>{let n=Pe(e.vendorId,e.controller),r=e.fabricIndex??e.fabricId??t+1;return(0,w.jsxs)(`div`,{className:`fabric-item`,children:[(0,w.jsxs)(`div`,{className:`fabric-info`,children:[(0,w.jsxs)(`div`,{className:`fabric-controller-line`,children:[(0,w.jsx)(`span`,{style:{fontSize:15},children:n.icon}),(0,w.jsx)(`span`,{className:`fabric-name`,children:n.name})]}),e.label&&(0,w.jsxs)(`span`,{className:`fabric-home-name`,children:[`Casa: `,(0,w.jsx)(`strong`,{children:e.label})]}),(0,w.jsxs)(`span`,{className:`fabric-detail`,children:[`Fabric `,r,e.vendorId?` · VID: 0x${Number(e.vendorId).toString(16).toUpperCase()}`:``]})]}),(0,w.jsx)(`button`,{type:`button`,className:`button button-danger-outline button-xs`,onClick:()=>j(r),disabled:s,title:`Desconectar únicamente esta casa`,style:{padding:`4px 8px`,fontSize:`11px`,borderRadius:`6px`,cursor:`pointer`,background:`rgba(239, 68, 68, 0.15)`,color:`#fca5a5`,border:`1px solid rgba(239, 68, 68, 0.35)`},children:`Desconectar`})]},r)})}):(0,w.jsx)(`div`,{style:{fontSize:11,color:`var(--muted)`,fontStyle:`italic`,padding:`4px 0`},children:ne?`Sesión registrada en el puente (sin etiquetas de controlador reportadas).`:`No hay casas ni controladores vinculados a este accesorio.`})]}),(0,w.jsxs)(`section`,{className:`diagnostics-panel ${ue||S?.hasIssue?`has-issues`:``}`,id:`diagnostics-panel`,"aria-live":`polite`,style:{userSelect:`text`,background:ue?`rgba(245, 158, 11, 0.08)`:`rgba(255, 255, 255, 0.03)`,border:ue?`1px solid rgba(245, 158, 11, 0.3)`:`1px solid var(--border)`,borderRadius:`10px`,padding:`14px`},children:[(0,w.jsxs)(`div`,{className:`diagnostics-heading`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`8px`},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,w.jsx)(`span`,{id:`diagnostics-icon`,"aria-hidden":`true`,style:{fontSize:`16px`},children:ue||S?.hasIssue?`⚠️`:pe.length>0?`ℹ️`:`✓`}),(0,w.jsx)(`strong`,{id:`diagnostics-heading-text`,style:{fontSize:`13px`},children:ue?`Estado de Conexión y Diagnóstico`:`Diagnóstico y logs`})]}),(0,w.jsx)(`button`,{id:`copy-diagnostics-button`,className:`copy-diagnostics-button`,type:`button`,onClick:me,title:`Copiar diagnóstico y logs al portapapeles`,children:`📋 Copiar logs`})]}),ue&&(0,w.jsxs)(`div`,{style:{background:`rgba(245, 158, 11, 0.15)`,borderLeft:`3px solid #f59e0b`,padding:`8px 10px`,borderRadius:`4px`,fontSize:`11px`,color:`#fbbf24`,marginBottom:`8px`,lineHeight:`1.4`},children:[(0,w.jsxs)(`strong`,{children:[`⚠️ Dispositivo no disponible en Home Assistant (Estado: `,le.toUpperCase(),`)`]}),(0,w.jsx)(`div`,{style:{marginTop:`3px`,color:`var(--text)`},children:`Home Assistant perdió comunicación con el dispositivo físico. El puente Matter sigue activo, pero el aparato no responde en su origen (posiblemente apagado, sin batería o sin Wi-Fi).`})]}),(0,w.jsx)(`p`,{id:`diagnostics-summary`,style:{margin:`4px 0`,fontSize:`11.5px`,color:ue?`#fbbf24`:`var(--muted)`},children:pe.length===0?`Sin errores registrados para este accesorio.`:`${pe.length} evento${pe.length===1?``:`s`} registrado${pe.length===1?``:`s`}`}),pe.length>0&&(0,w.jsx)(`ul`,{id:`diagnostics-list`,style:{userSelect:`text`,maxHeight:`180px`,overflowY:`auto`,margin:`6px 0 0`,paddingLeft:`16px`,fontSize:`11px`,display:`flex`,flexDirection:`column`,gap:`4px`},children:pe.slice(-25).map((e,t)=>(0,w.jsxs)(`li`,{style:{userSelect:`text`,wordBreak:`break-word`,color:e.level===`warning`?`#fbbf24`:e.level===`error`?`#f87171`:`var(--text)`},children:[e.timestamp?(0,w.jsxs)(`span`,{style:{opacity:.6,marginRight:`5px`},children:[`[`,new Date(e.timestamp).toLocaleTimeString(),`]`]}):null,(0,w.jsxs)(`span`,{style:{fontWeight:600,marginRight:`4px`},children:[`[`,e.level.toUpperCase(),`]`]}),e.text]},t))})]})]}),(0,w.jsxs)(`div`,{className:`qr-panel`,id:`qr-panel`,style:{display:`flex`,flexDirection:`column`,gap:8,minHeight:0,height:`100%`,overflowY:`auto`,overflowX:`hidden`,paddingRight:6},children:[(0,w.jsx)(`p`,{className:`card-label`,style:{margin:`0 0 2px 0`,flexShrink:0},children:`CÓDIGO MATTER`}),(0,w.jsx)(`div`,{className:`qr-status-label${ne?` commissioned`:te?` active`:``}`,id:`qr-status-label`,style:{flexShrink:0},children:ne?`Vinculado a Matter`:te?`Listo para emparejar`:`Sin publicar`}),te?ne&&!l?(0,w.jsxs)(`div`,{className:`paired-success-glass-card`,id:`paired-device-card`,children:[(0,w.jsx)(`div`,{className:`paired-apple-home-badge`,children:(0,w.jsx)(Oe,{variant:`color`,size:56})}),(0,w.jsx)(`h4`,{className:`paired-card-title`,children:`¡Accesorio vinculado en Apple Home!`}),(0,w.jsx)(`p`,{className:`paired-card-desc`,children:`Este dispositivo ya está emparejado y activo en tu red Matter. El código QR inicial se oculta para proteger la sesión activa.`}),(0,w.jsxs)(`div`,{className:`paired-multiadmin-box`,children:[(0,w.jsx)(`p`,{className:`paired-multiadmin-subtext`,children:`¿Deseas compartirlo con Google Home, Alexa o SmartThings?`}),(0,w.jsx)(`button`,{className:`button button-primary button-open-multiadmin`,type:`button`,onClick:oe,disabled:s,id:`paired-open-multiadmin-btn`,children:(0,w.jsx)(`span`,{children:`🌐 Abrir Modo Multi-Admin (15 min)`})})]})]}):(0,w.jsxs)(w.Fragment,{children:[l&&(0,w.jsxs)(`div`,{id:`multi-admin-hint`,className:`multi-admin-hint`,style:{display:`block`,flexShrink:0},children:[(0,w.jsx)(`p`,{className:`hint-title`,children:`🌐 Modo Multi-Admin Abierto (15 min)`}),(0,w.jsxs)(`p`,{className:`hint-desc`,children:[`Ventana de emparejamiento abierta. Escanea este código QR en`,(0,w.jsx)(`strong`,{children:` Google Home`}),`, `,(0,w.jsx)(`strong`,{children:`Alexa`}),` o`,` `,(0,w.jsx)(`strong`,{children:`SmartThings`}),`.`]})]}),(0,w.jsx)(Ae,{pairingCode:k,manualCode:ee,entityName:E?D?.name||e.name:S?.name||e.name,elementId:`device-qr-code`,variant:l?`multi-admin-glass`:`matter-badge`})]}):(0,w.jsx)(`div`,{className:`qr-liquid-glass-card`,style:{padding:20,textAlign:`center`,color:`var(--text-secondary)`,flexShrink:0},children:E?`Activa el interruptor general del accesorio para generar el código QR de Matter.`:`Activa la entidad para generar el código QR de Matter.`}),(0,w.jsx)(`div`,{className:`accessory-controls`,id:`accessory-controls`,style:{flexShrink:0,paddingTop:6},children:te&&(0,w.jsxs)(`div`,{className:`matter-actions`,style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,w.jsx)(`button`,{className:`button button-secondary action-btn`,id:`reconnect-accessory-button`,type:`button`,onClick:ae,disabled:s,title:`Refresca la conexión con Home Assistant y Matter`,style:{padding:`7px 10px`,fontSize:11.5},children:`↻ Recargar / Sincronizar`}),(0,w.jsx)(`button`,{className:`button button-secondary action-btn`,id:`regenerate-code-button`,type:`button`,onClick:oe,disabled:s,style:{padding:`7px 10px`,fontSize:11.5},children:`Abrir Modo Multi-Admin`}),(0,w.jsx)(`button`,{className:`button button-danger action-btn`,id:`reset-accessory-button`,type:`button`,onClick:se,disabled:s,title:`Desconectar de todas las casas y generar un nuevo código QR`,style:{padding:`7px 10px`,fontSize:11.5},children:`Desconectar todo y nuevo QR`})]})})]})]})]})})},Ie=({config:e,onClose:t,onRefresh:n,showToast:r})=>{let[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(null);(0,_.useEffect)(()=>{e&&(a(e.serverUrl||``),s(e.username||``),d(!!e.allowSelfSignedCertificate))},[e]);let y=async()=>{if(!i.trim()||!o.trim()||!c){r(`Completa la URL, usuario y contraseña`,!0);return}p(!0),v({text:`Comprobando conexión con Scrypted...`});try{let e=await x.testScryptedConnection({serverUrl:i.trim(),username:o.trim(),password:c,allowSelfSignedCertificate:u});e.success?v({text:`✓ Conexión exitosa. Se detectaron ${e.cameraCount||0} cámaras.`}):v({text:`❌ ${e.error||`No se pudo conectar`}`,isError:!0})}catch(e){v({text:`❌ Error: ${e.message}`,isError:!0})}finally{p(!1)}},b=async e=>{if(e.preventDefault(),!i.trim()||!o.trim()){r(`Ingresa la URL y el usuario`,!0);return}h(!0);try{await x.saveScryptedConfig({serverUrl:i.trim(),username:o.trim(),password:c,allowSelfSignedCertificate:u}),r(`✓ Configuración de Scrypted guardada exitosamente`),n(),t()}catch(e){r(e.message||`Error al guardar`,!0)}finally{h(!1)}},[S,C]=(0,_.useState)(!1);return(0,w.jsx)(`div`,{className:`modal-backdrop open`,role:`dialog`,"aria-modal":`true`,children:(0,w.jsxs)(`section`,{className:`modal`,style:{maxWidth:520},children:[(0,w.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":`Cerrar`,onClick:t,children:`×`}),(0,w.jsxs)(`header`,{className:`modal-header`,children:[(0,w.jsx)(`span`,{className:`modal-icon`,style:{fontSize:`1.8rem`},children:`📹`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow`,children:`INTEGRACIÓN DE CÁMARAS`}),(0,w.jsx)(`h2`,{children:`Conectar con Scrypted`}),(0,w.jsx)(`p`,{className:`entity-id`,children:`Transmisión de alta velocidad HAP y Matter`})]})]}),(0,w.jsxs)(`form`,{onSubmit:b,style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:4},children:`URL del Servidor Scrypted`}),(0,w.jsx)(`input`,{type:`url`,value:i,onChange:e=>a(e.target.value),placeholder:`https://192.168.1.100:10443`,required:!0,style:{width:`100%`,padding:`8px 12px`,borderRadius:8,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`}})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:4},children:`Usuario de Scrypted`}),(0,w.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`admin`,required:!0,style:{width:`100%`,padding:`8px 12px`,borderRadius:8,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`}})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:4},children:`Contraseña`}),(0,w.jsx)(`input`,{type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:`••••••••`,style:{width:`100%`,padding:`8px 12px`,borderRadius:8,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`}})]}),(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontSize:`0.82rem`},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),(0,w.jsx)(`span`,{children:`Permitir certificados SSL autofirmados (HTTPS local)`})]}),g&&(0,w.jsx)(`div`,{style:{padding:`8px 12px`,borderRadius:8,fontSize:`0.8rem`,background:g.isError?`rgba(239,68,68,0.15)`:`rgba(16,185,129,0.15)`,color:g.isError?`#fca5a5`:`#6ee7b7`},children:g.text}),(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:8,marginTop:12,flexWrap:`wrap`},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:y,disabled:f,children:f?`Comprobando...`:`Probar Conexión`}),!!e?.serverUrl&&(0,w.jsx)(`button`,{className:`button button-danger-outline`,type:`button`,onClick:async()=>{if(confirm(`¿Desvincular Scrypted y limpiar todas las cámaras en caché de Scrypted?`)){C(!0);try{await x.deleteScryptedConfig(),r(`✓ Scrypted desvinculado y caché de cámaras limpiada`),n(),t()}catch(e){r(e.message||`Error al desvincular`,!0)}finally{C(!1)}}},disabled:S,title:`Elimina las credenciales y limpia las cámaras de Scrypted en caché`,style:{background:`rgba(239, 68, 68, 0.12)`,color:`#fca5a5`,borderColor:`rgba(239, 68, 68, 0.35)`,fontSize:`0.8rem`},children:S?`Limpiando...`:`Desvincular y Limpiar`})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:t,children:`Cancelar`}),(0,w.jsx)(`button`,{className:`button button-primary`,type:`submit`,disabled:m,children:m?`Guardando...`:`Guardar`})]})]})]})]})})},Le=({config:e,onClose:t,onRefresh:n,showToast:r})=>{let[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(!0),[m,h]=(0,_.useState)(!0),[g,v]=(0,_.useState)(`camera.ui`),[y,b]=(0,_.useState)(!1),[S,C]=(0,_.useState)(!1),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(null),[k,ee]=(0,_.useState)([]),[A,te]=(0,_.useState)(`settings`),ne=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(e&&!ne.current){ne.current=!0,a(e.enabled??!0);let t=(e.serverUrl||``).trim();s(t||`http://127.0.0.1:8181`),l(e.username||``),p(e.allowSelfSignedCertificate??!0),h(e.mqttEnabled??!0),v(e.mqttTopicPrefix||`camera.ui`)}re()},[e]);let re=async()=>{try{let e=await x.getCameraUiCameras();ee(e)}catch{}},j=async()=>{let t=o.trim()||e?.serverUrl||`http://127.0.0.1:8181`;if(!t){r(`Ingresa la URL del servidor Camera.UI (ej. https://192.168.110.46:3543)`,!0);return}b(!0),O({text:`Comprobando conexión con Camera.UI...`});try{let e=await x.testCameraUiConnection({serverUrl:t,username:c.trim()||void 0,password:u.trim()?u:void 0,allowSelfSignedCertificate:f});e.ok?O({text:`✓ ${e.message}`}):O({text:`❌ ${e.message}`,isError:!0})}catch(e){O({text:`❌ Error: ${e.message}`,isError:!0})}finally{b(!1)}},ie=async()=>{let t=o.trim()||e?.serverUrl||`http://127.0.0.1:8181`;if(!t){r(`Ingresa la URL del servidor Camera.UI (ej. https://192.168.110.46:3543)`,!0);return}C(!0);try{let e=await x.syncCameraUiCameras({serverUrl:t,username:c.trim()||void 0,password:u.trim()?u:void 0,allowSelfSignedCertificate:f});e.success?(r(`✓ Sincronización completa: ${e.totalCameras} cámaras detectadas (${e.newCameras} nuevas).`),ee(e.cameras||[]),n()):r(`Error al sincronizar cámaras de Camera.UI`,!0)}catch(e){r(e.message||`Error al sincronizar`,!0)}finally{C(!1)}},ae=async e=>{try{await x.toggleCameraUiHomeKit(e),await re(),r(`✓ Estado de HomeKit actualizado.`),n()}catch(e){r(`Error: ${e.message}`,!0)}},oe=async e=>{try{(await x.resetCameraUiPairing(e)).success?(r(`✓ Emparejamiento HomeKit restablecido. Listo para escanear en Apple Home.`),await re(),n()):r(`No se pudo restablecer el emparejamiento`,!0)}catch(e){r(`Error: ${e.message}`,!0)}};return(0,w.jsx)(`div`,{className:`modal-backdrop open`,role:`dialog`,"aria-modal":`true`,children:(0,w.jsxs)(`section`,{className:`modal`,style:{maxWidth:620,maxHeight:`90vh`,overflowY:`auto`},children:[(0,w.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":`Cerrar`,onClick:t,children:`×`}),(0,w.jsxs)(`header`,{className:`modal-header`,children:[(0,w.jsx)(`span`,{className:`modal-icon`,style:{fontSize:`1.8rem`},children:`🎥`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow`,children:`INTEGRACIÓN DE CÁMARAS Y MQTT`}),(0,w.jsx)(`h2`,{children:`Camera.UI / Homebridge Camera.UI`}),(0,w.jsx)(`p`,{className:`entity-id`,children:`Descubrimiento RTSP, eventos MQTT (movimiento/timbre) y puente directo HomeKit HAP`})]})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:10,margin:`12px 0 16px`,borderBottom:`1px solid rgba(255,255,255,0.1)`,paddingBottom:8},children:[(0,w.jsx)(`button`,{type:`button`,className:`button ${A===`settings`?`button-primary`:`button-secondary`}`,style:{fontSize:`0.85rem`,padding:`6px 14px`},onClick:()=>te(`settings`),children:`⚙️ Configuración y Conexión`}),(0,w.jsxs)(`button`,{type:`button`,className:`button ${A===`cameras`?`button-primary`:`button-secondary`}`,style:{fontSize:`0.85rem`,padding:`6px 14px`},onClick:()=>{te(`cameras`),re()},children:[`📷 Cámaras Descubiertas (`,k.length,`)`]})]}),A===`settings`?(0,w.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!o.trim()){r(`Ingresa la URL del servidor Camera.UI`,!0);return}E(!0);try{await x.saveCameraUiConfig({enabled:i,serverUrl:o.trim(),username:c.trim()||void 0,password:u||void 0,allowSelfSignedCertificate:f,mqttEnabled:m,mqttTopicPrefix:g.trim()||`camera.ui`}),r(`✓ Configuración de Camera.UI guardada exitosamente`),n(),t()}catch(e){r(e.message||`Error al guardar`,!0)}finally{E(!1)}},style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:10,cursor:`pointer`,fontSize:`0.9rem`,fontWeight:600},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),(0,w.jsx)(`span`,{children:`Habilitar integración Camera.UI`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:4},children:`URL del Servidor Camera.UI`}),(0,w.jsx)(`input`,{type:`url`,value:o,onChange:e=>s(e.target.value),placeholder:`https://192.168.110.46:3543 o http://192.168.1.100:8181`,required:!0,style:{width:`100%`,padding:`8px 12px`,borderRadius:8,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`}}),(0,w.jsx)(`span`,{style:{fontSize:`0.75rem`,color:`var(--dim)`},children:`Puerto REST por defecto de Camera.UI: 8181 (o HTTPS en 3543). Restreaming RTSP nativo en puerto 8554.`}),(0,w.jsx)(`div`,{style:{marginTop:8},children:(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontSize:`0.8rem`,color:`var(--dim)`},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>p(e.target.checked)}),(0,w.jsx)(`span`,{children:`Permitir certificados SSL autofirmados (HTTPS local)`})]})})]}),(0,w.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:10},children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:4},children:`Usuario (opcional)`}),(0,w.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`admin`,style:{width:`100%`,padding:`8px 12px`,borderRadius:8,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`}})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.8rem`,color:`var(--dim)`,marginBottom:4},children:`Contraseña (opcional)`}),(0,w.jsx)(`input`,{type:`password`,value:u,onChange:e=>d(e.target.value),placeholder:e?.hasPassword?`•••••••• (guardada)`:`••••••••`,style:{width:`100%`,padding:`8px 12px`,borderRadius:8,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`}})]})]}),(0,w.jsxs)(`div`,{style:{padding:`10px 12px`,borderRadius:8,background:`rgba(255,255,255,0.03)`,border:`1px solid rgba(255,255,255,0.08)`},children:[(0,w.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontSize:`0.85rem`,fontWeight:500},children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),(0,w.jsx)(`span`,{children:`Escuchar tópicos MQTT de Camera.UI para Movimiento y Timbre`})]}),m&&(0,w.jsxs)(`div`,{style:{marginTop:8},children:[(0,w.jsx)(`label`,{style:{display:`block`,fontSize:`0.75rem`,color:`var(--dim)`,marginBottom:4},children:`Prefijo de Tópicos MQTT`}),(0,w.jsx)(`input`,{type:`text`,value:g,onChange:e=>v(e.target.value),placeholder:`camera.ui`,style:{width:`100%`,padding:`6px 10px`,borderRadius:6,background:`rgba(0,0,0,0.2)`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`,fontSize:`0.85rem`}}),(0,w.jsxs)(`span`,{style:{fontSize:`0.75rem`,color:`var(--dim)`,display:`block`,marginTop:4},children:[`Se suscribe automáticamente a `,(0,w.jsx)(`code`,{children:`camera.ui/#`}),` y `,(0,w.jsx)(`code`,{children:`cameraui/#`}),` para disparar notificaciones de movimiento y timbres en Apple Home.`]})]})]}),D&&(0,w.jsx)(`div`,{style:{padding:`8px 12px`,borderRadius:8,fontSize:`0.8rem`,background:D.isError?`rgba(239,68,68,0.15)`:`rgba(16,185,129,0.15)`,color:D.isError?`#fca5a5`:`#6ee7b7`},children:D.text}),(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:8,marginTop:12},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:j,disabled:y,children:y?`Comprobando...`:`Probar Conexión`}),(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:ie,disabled:S,children:S?`Sincronizando...`:`🔄 Sincronizar Cámaras`})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:t,children:`Cancelar`}),(0,w.jsx)(`button`,{className:`button button-primary`,type:`submit`,disabled:T,children:T?`Guardando...`:`Guardar`})]})]})]}):(0,w.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,w.jsx)(`span`,{style:{fontSize:`0.85rem`,color:`var(--dim)`},children:k.length===0?`No se han sincronizado cámaras aún.`:`${k.length} cámaras encontradas en Camera.UI.`}),(0,w.jsx)(`button`,{className:`button button-secondary`,type:`button`,onClick:ie,disabled:S,style:{fontSize:`0.8rem`,padding:`4px 10px`},children:S?`Sincronizando...`:`🔄 Sincronizar Ahora`})]}),k.length===0?(0,w.jsx)(`div`,{style:{padding:`24px 16px`,textAlign:`center`,background:`rgba(255,255,255,0.02)`,borderRadius:8,border:`1px dashed rgba(255,255,255,0.1)`},children:(0,w.jsxs)(`p`,{style:{margin:0,color:`var(--dim)`,fontSize:`0.9rem`},children:[`Asegúrate de que la URL del servidor sea correcta y presiona `,(0,w.jsx)(`strong`,{children:`Sincronizar Ahora`}),`.`]})}):(0,w.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:k.map(e=>(0,w.jsxs)(`div`,{style:{padding:`12px`,borderRadius:8,background:`rgba(255,255,255,0.03)`,border:`1px solid rgba(255,255,255,0.08)`,display:`flex`,flexDirection:`column`,gap:8},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`},children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{style:{fontSize:`0.95rem`},children:e.name}),(0,w.jsxs)(`div`,{style:{fontSize:`0.75rem`,color:`var(--dim)`,marginTop:2},children:[`ID: `,(0,w.jsx)(`code`,{children:e.id}),` · Puerto HAP: `,(0,w.jsx)(`code`,{children:e.port||`Pendiente`})]})]}),(0,w.jsx)(`span`,{style:{fontSize:`0.75rem`,padding:`2px 8px`,borderRadius:6,background:e.isPaired?`rgba(16,185,129,0.2)`:`rgba(245,158,11,0.2)`,color:e.isPaired?`#6ee7b7`:`#fde68a`},children:e.isPaired?`✓ Vinculada en Apple Home`:`⚠️ Lista para vincular`})]}),(0,w.jsxs)(`div`,{style:{fontSize:`0.8rem`,color:`var(--dim)`,wordBreak:`break-all`},children:[`RTSP: `,(0,w.jsx)(`code`,{children:e.rtspUrl})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:4,paddingTop:8,borderTop:`1px solid rgba(255,255,255,0.06)`},children:[(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`},children:[(0,w.jsxs)(`span`,{style:{fontSize:`0.8rem`},children:[`PIN: `,(0,w.jsx)(`strong`,{children:e.pincode||`031-45-154`})]}),e.setupUri&&!e.isPaired&&(0,w.jsx)(`a`,{href:e.setupUri,target:`_blank`,rel:`noopener noreferrer`,className:`button button-secondary`,style:{fontSize:`0.75rem`,padding:`2px 8px`,textDecoration:`none`},children:`🔗 Código HomeKit`})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,w.jsx)(`button`,{type:`button`,className:`button button-secondary`,style:{fontSize:`0.75rem`,padding:`3px 8px`},onClick:()=>oe(e.id),title:`Restablece el ID y genera nuevo PIN si Apple Home no la encuentra`,children:`Restablecer PIN`}),(0,w.jsx)(`button`,{type:`button`,className:`button ${e.homeKitEnabled?`button-primary`:`button-secondary`}`,style:{fontSize:`0.75rem`,padding:`3px 8px`},onClick:()=>ae(e.id),children:e.homeKitEnabled?`Activada en HomeKit`:`Desactivada`})]})]})]},e.id))})]})]})})};function Re(e){let t=e.toLowerCase();return/\b(error|failed|failure|exception|unable|crash|fatal)\b/.test(t)?`error`:/\b(warn|warning|timeout|retry|deprecated)\b/.test(t)?`warn`:/\b(info|notice|debug|connected|registered|online)\b/.test(t)?`info`:`default`}var ze=({isOpen:e,onClose:t,showToast:n,status:r,stats:i})=>{let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(1883),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)([]),[v,y]=(0,_.useState)(!1),[b,S]=(0,_.useState)(`all`),[C,T]=(0,_.useState)(``),[E,D]=(0,_.useState)(!0),O=(0,_.useRef)(null),k=async()=>{y(!0);try{let e=await x.getLogs();g(e.logs||[])}catch(e){n(e.message||`Error al cargar logs`,!0)}finally{y(!1)}};(0,_.useEffect)(()=>{e&&(x.getMqttConfig().then(e=>{e&&(o(e.host||``),c(e.port||1883),u(e.username||``),f(e.password||``))}).catch(()=>{}),k())},[e]);let ee=(0,_.useMemo)(()=>{let e=0,t=0,n=0;for(let r of h){let i=Re(r);i===`error`?e++:i===`warn`?t++:i===`info`&&n++}return{all:h.length,errors:e,warns:t,infos:n}},[h]),A=(0,_.useMemo)(()=>{let e=h;if(b!==`all`&&(e=e.filter(e=>Re(e)===b)),C.trim()){let t=C.toLowerCase().trim();e=e.filter(e=>e.toLowerCase().includes(t))}return e},[h,b,C]);return(0,_.useEffect)(()=>{E&&O.current&&(O.current.scrollTop=O.current.scrollHeight)},[A,E]),e?(0,w.jsx)(`div`,{className:`modal-backdrop open`,id:`settings-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`settings-title`,children:(0,w.jsxs)(`section`,{className:`modal modal-settings-wide`,children:[(0,w.jsx)(`button`,{className:`icon-button`,id:`settings-modal-close`,type:`button`,"aria-label":`Cerrar`,onClick:t,children:`×`}),(0,w.jsx)(`div`,{className:`settings-modal-header`,children:(0,w.jsxs)(`div`,{className:`settings-modal-header-left`,children:[(0,w.jsx)(`span`,{className:`settings-sparkle`,children:`⚙️`}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`settings-header-badge-row`,children:[(0,w.jsx)(`span`,{className:`settings-badge-eyebrow`,children:`MANTENIMIENTO & SISTEMA`}),(0,w.jsx)(`span`,{className:`settings-ha-status-pill`,children:r?.haStatus===`conectado`?(0,w.jsx)(`span`,{className:`pill-healthy`,children:`✓ HA Conectado`}):(0,w.jsx)(`span`,{className:`pill-warning`,children:`⚠️ HA Desconectado`})}),(0,w.jsxs)(`span`,{className:`settings-version-pill`,children:[`v`,r?.version||`1.5.76`]})]}),(0,w.jsx)(`h2`,{id:`settings-title`,children:`Ajustes del Servicio & Registros`})]})]})}),(0,w.jsxs)(`div`,{className:`settings-grid-layout`,children:[(0,w.jsxs)(`div`,{className:`settings-left-col`,children:[(0,w.jsxs)(`div`,{className:`settings-card-glass`,children:[(0,w.jsxs)(`div`,{className:`settings-card-title`,children:[(0,w.jsx)(`span`,{children:`📊`}),` Telemetría del Servicio`]}),(0,w.jsxs)(`div`,{className:`settings-telemetry-grid`,children:[(0,w.jsxs)(`div`,{className:`telemetry-item`,children:[(0,w.jsx)(`span`,{className:`telemetry-label`,children:`Servicio Bridge`}),(0,w.jsx)(`strong`,{className:`telemetry-value`,title:r?.bridgeName,children:r?.bridgeName||`Matter All-in-One`})]}),(0,w.jsxs)(`div`,{className:`telemetry-item`,children:[(0,w.jsx)(`span`,{className:`telemetry-label`,children:`Nodos Activos`}),(0,w.jsx)(`strong`,{className:`telemetry-value`,children:i?.exportedNodes??r?.exportedNodes??0})]}),(0,w.jsxs)(`div`,{className:`telemetry-item`,children:[(0,w.jsx)(`span`,{className:`telemetry-label`,children:`Emparejados`}),(0,w.jsx)(`strong`,{className:`telemetry-value text-green`,children:i?.pairedTotal??r?.commissionedNodes??0})]}),(0,w.jsxs)(`div`,{className:`telemetry-item`,children:[(0,w.jsx)(`span`,{className:`telemetry-label`,children:`Incidencias`}),(0,w.jsx)(`strong`,{className:`telemetry-value ${(i?.issues??0)>0?`text-amber`:`text-green`}`,children:i?.issues??0})]})]})]}),(0,w.jsxs)(`div`,{className:`settings-card-glass`,children:[(0,w.jsxs)(`div`,{className:`settings-card-title`,children:[(0,w.jsx)(`span`,{children:`📡`}),` Configuración MQTT (Auto-Discovery)`]}),(0,w.jsx)(`p`,{className:`settings-card-desc`,children:`Habilita la integración de dispositivos MQTT directamente en el ecosistema Matter.`}),(0,w.jsxs)(`div`,{className:`mqtt-form-grid`,children:[(0,w.jsxs)(`div`,{className:`input-group`,children:[(0,w.jsx)(`label`,{htmlFor:`mqtt-host`,children:`Broker IP / Host`}),(0,w.jsx)(`input`,{type:`text`,id:`mqtt-host`,placeholder:`ej. 192.168.110.147`,"aria-label":`MQTT Host`,className:`form-input`,value:a,onChange:e=>o(e.target.value)})]}),(0,w.jsxs)(`div`,{className:`input-group`,children:[(0,w.jsx)(`label`,{htmlFor:`mqtt-port`,children:`Puerto`}),(0,w.jsx)(`input`,{type:`number`,id:`mqtt-port`,placeholder:`1883`,"aria-label":`MQTT Port`,className:`form-input`,value:s,onChange:e=>c(Number(e.target.value))})]}),(0,w.jsxs)(`div`,{className:`input-group`,children:[(0,w.jsx)(`label`,{htmlFor:`mqtt-user`,children:`Usuario (opcional)`}),(0,w.jsx)(`input`,{type:`text`,id:`mqtt-user`,placeholder:`Usuario MQTT`,"aria-label":`MQTT User`,className:`form-input`,value:l,onChange:e=>u(e.target.value)})]}),(0,w.jsxs)(`div`,{className:`input-group`,children:[(0,w.jsx)(`label`,{htmlFor:`mqtt-pass`,children:`Contraseña (opcional)`}),(0,w.jsx)(`input`,{type:`password`,id:`mqtt-pass`,placeholder:`Contraseña`,"aria-label":`MQTT Password`,className:`form-input`,value:d,onChange:e=>f(e.target.value)})]})]}),(0,w.jsx)(`button`,{className:`button button-primary button-full`,id:`mqtt-save-button`,type:`button`,onClick:async()=>{m(!0);try{await x.saveMqttConfig({host:a,port:Number(s),username:l,password:d}),n(`✓ Configuración MQTT guardada`)}catch(e){n(e.message||`Error al guardar MQTT`,!0)}finally{m(!1)}},disabled:p,children:p?`Guardando...`:`💾 Guardar Configuración MQTT`})]}),(0,w.jsxs)(`div`,{className:`settings-card-glass`,children:[(0,w.jsxs)(`div`,{className:`settings-card-title`,children:[(0,w.jsx)(`span`,{children:`⚡`}),` Operaciones del Servicio`]}),(0,w.jsxs)(`div`,{className:`operations-row`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{children:`Reiniciar servicio`}),(0,w.jsx)(`p`,{children:`Recarga el runtime y restablece conexiones activas.`})]}),(0,w.jsx)(`button`,{className:`button button-secondary`,id:`restart-button`,type:`button`,onClick:async()=>{if(confirm(`¿Deseas reiniciar el servicio de Matter All-in-One?`))try{await x.restartService(),n(`Reiniciando servicio...`),t()}catch(e){n(e.message||`Error al reiniciar servicio`,!0)}},children:`🔄 Reiniciar`})]})]}),(0,w.jsxs)(`div`,{className:`settings-card-glass danger-card`,children:[(0,w.jsxs)(`div`,{className:`settings-card-title danger-title`,children:[(0,w.jsx)(`span`,{children:`⚠️`}),` Zona de Mantenimiento Crítico`]}),(0,w.jsxs)(`div`,{className:`operations-row`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`strong`,{className:`text-red`,children:`Restablecimiento de fábrica`}),(0,w.jsx)(`p`,{children:`Elimina toda la configuración y obligará a volver a emparejar.`})]}),(0,w.jsx)(`button`,{className:`button button-danger`,id:`factory-reset-button`,type:`button`,onClick:async()=>{if(confirm(`¿Estás seguro de que deseas restablecer de fábrica el plugin? Se eliminarán todos los accesorios Matter y requerirá volver a emparejar.`))try{await x.factoryReset(),n(`Restablecimiento de fábrica iniciado...`),t()}catch(e){n(e.message||`Error al restablecer`,!0)}},children:`Restablecer`})]})]})]}),(0,w.jsx)(`div`,{className:`settings-right-col`,children:(0,w.jsxs)(`div`,{className:`glass-terminal-wrapper`,children:[(0,w.jsxs)(`div`,{className:`terminal-header`,children:[(0,w.jsxs)(`div`,{className:`terminal-header-title`,children:[(0,w.jsx)(`span`,{className:`terminal-dot red`}),(0,w.jsx)(`span`,{className:`terminal-dot yellow`}),(0,w.jsx)(`span`,{className:`terminal-dot green`}),(0,w.jsx)(`span`,{className:`terminal-title-text`,children:`REGISTROS DEL SISTEMA (CONSOLE LOGS)`})]}),(0,w.jsxs)(`div`,{className:`terminal-header-actions`,children:[(0,w.jsxs)(`label`,{className:`terminal-search-box`,children:[(0,w.jsx)(`span`,{children:`⌕`}),(0,w.jsx)(`input`,{type:`search`,placeholder:`Buscar en logs...`,value:C,onChange:e=>T(e.target.value)}),C&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>T(``),className:`search-clear-btn`,title:`Borrar búsqueda`,children:`×`})]}),(0,w.jsx)(`button`,{className:`terminal-action-btn ${E?`active`:``}`,type:`button`,onClick:()=>D(!E),title:E?`Auto-scroll activado`:`Auto-scroll pausado`,children:E?`⬇ Auto-scroll`:`⏸ Pausado`}),(0,w.jsxs)(`button`,{className:`terminal-action-btn`,type:`button`,onClick:k,disabled:v,title:`Recargar registros`,children:[(0,w.jsx)(`span`,{className:v?`spin`:``,children:`↻`}),v?`Cargando…`:`Actualizar`]}),(0,w.jsx)(`button`,{className:`terminal-action-btn`,type:`button`,onClick:async()=>{try{let e=A.join(`
26
+ `);if(!e){n(`No hay registros para copiar`,!0);return}await je(e)?n(`✓ ${A.length} líneas copiadas al portapapeles`):n(`⚠️ No se pudo acceder al portapapeles`,!0)}catch(e){n(e.message||`Error al copiar logs`,!0)}},title:`Copiar registros visibles al portapapeles`,children:`📋 Copiar`}),(0,w.jsx)(`button`,{className:`terminal-action-btn btn-danger-subtle`,type:`button`,onClick:async()=>{if(confirm(`¿Deseas vaciar el historial de registros del Add-on?`))try{await x.clearLogs(),g([]),n(`✓ Registros del sistema vaciados`)}catch(e){n(e.message||`Error al vaciar logs`,!0)}},title:`Vaciar historial de logs del Add-on`,children:`🗑️ Limpiar`})]})]}),(0,w.jsxs)(`div`,{className:`terminal-filters-row`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`filter-tab-pill ${b===`all`?`active`:``}`,onClick:()=>S(`all`),children:[`Todos `,(0,w.jsx)(`span`,{className:`pill-count`,children:ee.all})]}),(0,w.jsxs)(`button`,{type:`button`,className:`filter-tab-pill pill-error ${b===`error`?`active`:``}`,onClick:()=>S(`error`),children:[`❌ Errores `,(0,w.jsx)(`span`,{className:`pill-count`,children:ee.errors})]}),(0,w.jsxs)(`button`,{type:`button`,className:`filter-tab-pill pill-warn ${b===`warn`?`active`:``}`,onClick:()=>S(`warn`),children:[`⚠️ Advertencias `,(0,w.jsx)(`span`,{className:`pill-count`,children:ee.warns})]}),(0,w.jsxs)(`button`,{type:`button`,className:`filter-tab-pill pill-info ${b===`info`?`active`:``}`,onClick:()=>S(`info`),children:[`ℹ️ Info / Eventos `,(0,w.jsx)(`span`,{className:`pill-count`,children:ee.infos})]}),(0,w.jsxs)(`span`,{className:`terminal-status-counter`,children:[`Mostrando: `,(0,w.jsx)(`strong`,{children:A.length}),` de `,h.length]})]}),(0,w.jsx)(`div`,{className:`glass-terminal-body`,ref:O,children:A.length===0?(0,w.jsx)(`div`,{className:`terminal-empty-state`,children:v?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`span`,{className:`spinner`}),(0,w.jsx)(`p`,{children:`Cargando registros del sistema…`})]}):(0,w.jsx)(`p`,{children:C?`No se encontraron registros que coincidan con "${C}".`:`No hay registros disponibles para este filtro.`})}):(0,w.jsx)(`div`,{className:`terminal-lines-list`,children:A.map((e,t)=>{let n=Re(e);return(0,w.jsxs)(`div`,{className:`terminal-line line-${n}`,children:[(0,w.jsx)(`span`,{className:`line-num`,children:t+1}),(0,w.jsx)(`span`,{className:`line-content`,children:e})]},t)})})})]})})]})]})}):null},Be=()=>{let{status:e,allDevices:t,cameras:n,cameraUiCameras:r,realHaCameraDevices:i,scryptedConfig:a,cameraUiConfig:o,loading:s,searchQuery:c,setSearchQuery:l,activeFilter:u,setActiveFilter:d,stats:f,toastMessage:p,showToast:m,refreshAll:h}=S(),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(null),[C,k]=(0,_.useState)(null),[ee,A]=(0,_.useState)(!1),[ne,j]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),[oe,se]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(!C)return;let e=t.find(e=>e.id===C.id);e&&k(e)},[t]),(0,_.useEffect)(()=>{if(!g)return;let e=n.find(e=>e.cameraId===g.cameraId);e&&v(e)},[n]),(0,_.useEffect)(()=>{if(!y)return;let e=r.find(e=>e.id===y.id);e&&b(e)},[r]);let ce=(0,_.useMemo)(()=>{let e=t;if(c.trim()){let t=c.toLowerCase().trim();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.manufacturer&&e.manufacturer.toLowerCase().includes(t)||e.model&&e.model.toLowerCase().includes(t)||e.area&&e.area.toLowerCase().includes(t)||e.entities.some(e=>e.name?.toLowerCase().includes(t)||e.entityId.toLowerCase().includes(t)))}let n=new Set(i.map(e=>e.id)),r=e.filter(e=>!n.has(e.id));switch(u){case`all`:return r;case`iot`:return r;case`cameras`:return[];case`paired`:return r.filter(e=>e.entities.some(e=>e.exported&&e.commissioned));case`unpaired`:return r.filter(e=>e.entities.some(e=>e.exported&&!e.commissioned));case`unactivated`:return r.filter(e=>!e.entities.some(e=>e.exported||e.commissioned));case`mqtt`:return r.filter(e=>e.entities.some(e=>e.origin===`mqtt`||e.entityId.startsWith(`mqtt.`)));case`issues`:return r.filter(e=>e.entities.some(e=>e.exported?e.hasIssue||e.state===`unavailable`||e.state===`unknown`||e.state===`offline`:!1));default:return r}},[t,i,c,u]),le=(0,_.useMemo)(()=>{if(u===`iot`||u===`mqtt`)return[];let e=new Map,t=n;if(c.trim()){let e=c.toLowerCase().trim();t=t.filter(t=>t.name.toLowerCase().includes(e))}u===`paired`?t=t.filter(e=>e.identity?.homeKitPairingState===`paired`||e.bindingState?.matterCommissioned===!0):u===`unpaired`?t=t.filter(e=>!!e.identity?.matterPairingCode&&e.identity?.homeKitPairingState!==`paired`&&e.bindingState?.matterCommissioned!==!0):u===`unactivated`?t=t.filter(e=>e.identity?.homeKitPairingState!==`paired`&&e.bindingState?.matterCommissioned!==!0&&!e.identity?.matterPairingCode):u===`issues`&&(t=t.filter(e=>e.identity?.homeKitPairingState===`paired`||e.bindingState?.matterCommissioned===!0||e.identity?.matterPairingCode?e.status?.connection===`offline`||e.status?.isOnline===!1||!!e.status?.lastError||e.hasIssue===!0:!1));for(let n of t){let t=O(n);e.has(t)||e.set(t,{scrypted:[],ha:[],cui:[]}),e.get(t).scrypted.push(n)}let a=r;if(c.trim()){let e=c.toLowerCase().trim();a=a.filter(t=>t.name.toLowerCase().includes(e))}u===`paired`?a=a.filter(e=>e.isPaired===!0):u===`unpaired`?a=a.filter(e=>e.homeKitEnabled&&!e.isPaired):u===`unactivated`?a=a.filter(e=>!e.homeKitEnabled):u===`issues`&&(a=a.filter(e=>e.status===`offline`));for(let t of a){let n=O(t);e.has(n)||e.set(n,{scrypted:[],ha:[],cui:[]}),e.get(n).cui.push(t)}let o=i;if(c.trim()){let e=c.toLowerCase().trim();o=o.filter(t=>t.name.toLowerCase().includes(e))}u===`paired`?o=o.filter(e=>e.entities.some(e=>e.exported&&e.commissioned)):u===`unpaired`?o=o.filter(e=>e.entities.some(e=>e.exported&&!e.commissioned)):u===`unactivated`?o=o.filter(e=>!e.entities.some(e=>e.exported||e.commissioned)):u===`issues`&&(o=o.filter(e=>e.entities.some(e=>e.exported||e.commissioned)?e.entities.some(e=>e.hasIssue||e.state===`unavailable`||e.state===`unknown`||e.state===`offline`||Array.isArray(e.logs)&&e.logs.length>0&&e.exported):!1));for(let t of o){let n=O(t);e.has(n)||e.set(n,{scrypted:[],ha:[],cui:[]}),e.get(n).ha.push(t)}return[...e.keys()].sort((e,t)=>{let n=e.toLowerCase().includes(`no identificada`),r=t.toLowerCase().includes(`no identificada`);return n&&!r?1:!n&&r?-1:e.localeCompare(t,`es`,{sensitivity:`base`})}).map(t=>({brand:t,scrypted:e.get(t).scrypted,ha:e.get(t).ha,cui:e.get(t).cui}))},[u,n,r,i,c]),ue=(0,_.useMemo)(()=>{let e=le.reduce((e,t)=>e+t.scrypted.length+t.ha.length+t.cui.length,0);return ce.length+e},[le,ce]),de=(0,_.useCallback)(e=>{let t=e.entities.find(e=>e.domain===`camera`),n=(e.manufacturer||``).toLowerCase().includes(`google`)||(e.manufacturer||``).toLowerCase().includes(`nest`)||(e.name||``).toLowerCase().includes(`nest`)||!!t?.entityId.toLowerCase().includes(`nest`),r=e.entities.filter(e=>e.domain===`binary_sensor`).map(e=>({name:e.name||e.entityId,sensorId:e.entityId,type:e.entityId.includes(`doorbell`)||e.name?.toLowerCase().includes(`timbre`)?`doorbell`:`motion`,enabled:!0,state:e.state===`on`})),i=e.entities.filter(e=>e.domain===`binary_sensor`||e.domain===`light`||e.domain===`siren`||e.domain===`switch`||e.domain===`event`).map(e=>({id:e.entityId,domain:e.domain,name:e.name||e.entityId,type:e.entityId.includes(`doorbell`)||e.name?.toLowerCase().includes(`timbre`)?`doorbell`:e.domain===`light`?`light`:e.domain===`siren`?`siren`:e.domain===`switch`?`switch`:`motion`,state:e.state===`on`,matterExported:!!e.exported})),a=e.entities.some(e=>e.exported&&e.commissioned);return{cameraId:t?.entityId||e.id,name:e.name,manufacturer:e.manufacturer||(n?`Google`:`Home Assistant`),model:e.model||(n?`Nest Cam`:`Cámara IP`),serialNumber:e.id,status:{connection:`online`,isOnline:!0},sensors:r,realEntities:i,identity:{homeKitPairingState:a?`paired`:`not_paired`,homeKitSetupId:`HA01`,homeKitPincode:`031-45-154`},source:{streamReference:{directUrl:t?.stream_source||``}}}},[]);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`div`,{className:`ambient ambient-one`}),(0,w.jsx)(`div`,{className:`ambient ambient-two`}),(0,w.jsxs)(`div`,{className:`app-shell`,children:[(0,w.jsx)(T,{status:e,onOpenSettings:()=>ae(!0),onRestartService:async()=>{if(confirm(`¿Deseas reiniciar el servicio de Matter All-in-One?`))try{await x.restartService(),m(`Reiniciando servicio...`)}catch(e){m(e.message||`Error al reiniciar`,!0)}}}),(0,w.jsxs)(`main`,{className:`content`,children:[(0,w.jsxs)(`header`,{className:`content-header`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`eyebrow`,children:[(0,w.jsx)(`span`,{className:`eyebrow-pulse`,"aria-hidden":`true`}),`PUBLICACIÓN CONTROLADA`]}),(0,w.jsx)(`h2`,{children:`Tu espacio Matter`}),(0,w.jsx)(`p`,{className:`lead`,children:`Activa la entidad principal para publicar el dispositivo físico. Sus capacidades compatibles se integran como endpoints bajo un único código Matter.`})]}),(0,w.jsxs)(`label`,{className:`search`,htmlFor:`device-search`,children:[(0,w.jsx)(`span`,{"aria-hidden":`true`,children:`⌕`}),(0,w.jsx)(`input`,{id:`device-search`,type:`search`,placeholder:`Buscar dispositivo o habitación`,autoComplete:`off`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,w.jsx)(E,{stats:f,activeFilter:u,onFilterChange:d,loading:s,onRefresh:h,filteredCount:ue}),(0,w.jsx)(D,{activeFilter:u,stats:f,scryptedConfig:a,cameraUiConfig:o,onOpenScryptedModal:()=>A(!0),onOpenCameraUiModal:()=>j(!0),onSyncCameras:async()=>{se(!0),m(`Sincronizando cámaras de Scrypted...`);try{let e=await x.syncCameras();m(`✓ Sincronización completada. ${e?.length||0} cámaras encontradas.`),h()}catch(e){m(e.message||`Error al sincronizar cámaras`,!0)}finally{se(!1)}},isSyncing:oe}),(0,w.jsx)(`section`,{className:`device-grid`,id:`device-list`,"aria-live":`polite`,"aria-busy":s,children:s?(0,w.jsxs)(`div`,{className:`empty-state`,style:{gridColumn:`1 / -1`,textAlign:`center`,padding:40},children:[(0,w.jsx)(`span`,{className:`spinner`}),(0,w.jsx)(`p`,{children:`Cargando entidades de Home Assistant…`})]}):(0,w.jsxs)(w.Fragment,{children:[le.map(e=>(0,w.jsx)(te,{brand:e.brand,scryptedCameras:e.scrypted,haCameras:e.ha,cameraUiCameras:e.cui,onConfigureCamera:e=>v(e),onConfigureHaDevice:e=>v(de(e)),onConfigureCameraUiCamera:e=>b(e)},e.brand)),ce.map(e=>(0,w.jsx)(re,{device:e,searchQuery:c,onConfigure:()=>k(e)},e.id)),le.length===0&&ce.length===0&&(0,w.jsx)(`div`,{className:`empty-state`,style:{gridColumn:`1 / -1`,textAlign:`center`,padding:40},children:(0,w.jsx)(`p`,{children:u===`cameras`?`No se encontraron cámaras configuradas.`:u===`mqtt`?`No se encontraron dispositivos MQTT configurados.`:u===`paired`?`No hay accesorios vinculados en Matter ni en HAP todavía.`:u===`unpaired`?`No hay accesorios pendientes de emparejar (todos los accesorios activos ya están vinculados).`:u===`unactivated`?`No hay dispositivos inactivos disponibles.`:u===`issues`?`No hay incidencias registradas en este momento.`:`No hay dispositivos que coincidan con los filtros seleccionados.`})})]})})]})]}),(g||y)&&(0,w.jsx)(I,{camera:g||y,onClose:()=>{v(null),b(null)},onRefresh:h,showToast:m}),C&&(0,w.jsx)(Fe,{device:C,onClose:()=>k(null),onRefresh:h,showToast:m}),ee&&(0,w.jsx)(Ie,{config:a,onClose:()=>A(!1),onRefresh:h,showToast:m}),ne&&(0,w.jsx)(Le,{config:o,onClose:()=>j(!1),onRefresh:h,showToast:m}),(0,w.jsx)(ze,{isOpen:ie,onClose:()=>ae(!1),showToast:m,status:e,stats:f}),p&&(0,w.jsx)(`div`,{className:`toast show${p.isError?` error`:``}`,role:`status`,"aria-live":`polite`,children:p.text})]})},Ve=class extends _.Component{state={hasError:!1,error:null,errorInfo:null};static getDerivedStateFromError(e){return{hasError:!0,error:e,errorInfo:null}}componentDidCatch(e,t){console.error(`[ErrorBoundary] Uncaught render error:`,e,t),this.setState({errorInfo:t})}handleReload=()=>{window.location.reload()};handleClearCache=()=>{try{localStorage.clear(),sessionStorage.clear()}catch{}window.location.reload()};render(){return this.state.hasError?(0,w.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,minHeight:`100vh`,padding:`24px`,background:`var(--bg, #09101f)`,color:`var(--text, #f2f6ff)`,fontFamily:`var(--font, system-ui, sans-serif)`,boxSizing:`border-box`},children:(0,w.jsxs)(`div`,{style:{maxWidth:580,width:`100%`,background:`rgba(20, 31, 53, 0.85)`,backdropFilter:`blur(20px)`,WebkitBackdropFilter:`blur(20px)`,border:`1px solid rgba(251, 132, 150, 0.35)`,borderRadius:16,padding:28,boxShadow:`0 16px 40px rgba(0,0,0,0.5)`,textAlign:`center`},children:[(0,w.jsx)(`div`,{style:{fontSize:44,marginBottom:12},children:`⚠️`}),(0,w.jsx)(`h2`,{style:{fontSize:20,margin:`0 0 8px 0`,color:`#fb8496`},children:`Error al cargar la interfaz`}),(0,w.jsx)(`p`,{style:{fontSize:13,color:`var(--muted, #9aa9c2)`,margin:`0 0 20px 0`},children:`Se produjo una excepción inesperada durante la inicialización visual. Puedes intentar recargar o restablecer los datos guardados en caché local.`}),this.state.error&&(0,w.jsxs)(`div`,{style:{textAlign:`left`,background:`rgba(0, 0, 0, 0.35)`,border:`1px solid rgba(255, 255, 255, 0.08)`,borderRadius:8,padding:12,marginBottom:20,maxHeight:180,overflowY:`auto`},children:[(0,w.jsxs)(`div`,{style:{fontSize:12,fontWeight:700,color:`#fca5a5`},children:[this.state.error.name,`: `,this.state.error.message]}),this.state.error.stack&&(0,w.jsx)(`pre`,{style:{fontSize:10,color:`rgba(255, 255, 255, 0.6)`,margin:`8px 0 0 0`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:this.state.error.stack})]}),(0,w.jsxs)(`div`,{style:{display:`flex`,gap:12,justifyContent:`center`,flexWrap:`wrap`},children:[(0,w.jsx)(`button`,{onClick:this.handleReload,style:{padding:`10px 18px`,borderRadius:8,background:`linear-gradient(135deg, #3b82f6, #2563eb)`,color:`#ffffff`,border:`none`,fontSize:13,fontWeight:600,cursor:`pointer`},children:`↻ Recargar interfaz`}),(0,w.jsx)(`button`,{onClick:this.handleClearCache,style:{padding:`10px 18px`,borderRadius:8,background:`rgba(255, 255, 255, 0.08)`,color:`var(--text, #f2f6ff)`,border:`1px solid rgba(255, 255, 255, 0.15)`,fontSize:13,fontWeight:600,cursor:`pointer`},children:`🧹 Limpiar caché local`})]})]})}):this.props.children}};window.addEventListener(`error`,e=>{console.error(`[Window Error]`,e.error||e.message)}),window.addEventListener(`unhandledrejection`,e=>{console.error(`[Unhandled Promise Rejection]`,e.reason)});var He=document.getElementById(`root`);He&&(0,v.createRoot)(He).render((0,w.jsx)(_.StrictMode,{children:(0,w.jsx)(Ve,{children:(0,w.jsx)(Be,{})})}));